From f8ea49cfe8f44316e3873388882a2ec66312e69f Mon Sep 17 00:00:00 2001 From: asyncapi-bot <61865014+asyncapi-bot@users.noreply.github.com> Date: Mon, 28 Jun 2021 12:46:56 +0200 Subject: [PATCH] chore(release): v1.0.32 --- dist/index.js | 208 +++------------------------------------------- dist/index.js.map | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 14 insertions(+), 200 deletions(-) diff --git a/dist/index.js b/dist/index.js index f45e2ac10..3b1e788ce 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5,7 +5,7 @@ require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"_args":[["@asyncapi/generator@1.7.4","/Users/wookiee/sources/github-action-for-generator"]],"_from":"@asyncapi/generator@1.7.4","_id":"@asyncapi/generator@1.7.4","_inBundle":false,"_integrity":"sha512-rGyI+gcPrFS1xLkXt/QdR5kTSwn6wPLWGkGJO1mxHyOVF6X9sCnCHKLHqQ9tzh++fi5tivi6Ybx5VM5xaRc1eg==","_location":"/@asyncapi/generator","_phantomChildren":{"lru-cache":"6.0.0"},"_requested":{"type":"version","registry":true,"raw":"@asyncapi/generator@1.7.4","name":"@asyncapi/generator","escapedName":"@asyncapi%2fgenerator","scope":"@asyncapi","rawSpec":"1.7.4","saveSpec":null,"fetchSpec":"1.7.4"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/@asyncapi/generator/-/generator-1.7.4.tgz","_spec":"1.7.4","_where":"/Users/wookiee/sources/github-action-for-generator","author":{"name":"Fran Mendez","email":"fmvilas@gmail.com"},"bin":{"asyncapi-generator":"cli.js","ag":"cli.js"},"bugs":{"url":"https://github.com/asyncapi/generator/issues"},"dependencies":{"@asyncapi/avro-schema-parser":"^0.2.1","@asyncapi/generator-react-sdk":"^0.2.11","@asyncapi/openapi-schema-parser":"^2.0.1","@asyncapi/parser":"^1.5.2","@asyncapi/raml-dt-schema-parser":"^2.0.1","@npmcli/arborist":"^2.2.4","ajv":"^6.10.2","chokidar":"^3.4.0","commander":"^6.1.0","filenamify":"^4.1.0","fs.extra":"^1.3.2","global-dirs":"^3.0.0","jmespath":"^0.15.0","js-yaml":"^3.13.1","levenshtein-edit-distance":"^2.0.5","loglevel":"^1.6.8","markdown-it":"^8.4.1","minimatch":"^3.0.4","node-fetch":"^2.6.0","nunjucks":"^3.2.0","resolve-from":"^5.0.0","resolve-pkg":"^2.0.0","semver":"^7.3.2","simple-git":"^1.131.0","source-map-support":"^0.5.19","ts-node":"^9.1.1","typescript":"^4.2.2"},"description":"The AsyncAPI generator. It can generate documentation, code, anything!","devDependencies":{"@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/github":"^7.0.4","@semantic-release/npm":"^7.0.6","@semantic-release/release-notes-generator":"^9.0.1","all-contributors-cli":"^6.14.2","conventional-changelog-conventionalcommits":"^4.4.0","eslint":"^6.8.0","eslint-plugin-jest":"^23.8.2","eslint-plugin-sonarjs":"^0.5.0","jest":"^25.5.0","jsdoc-to-markdown":"^5.0.0","markdown-toc":"^1.2.0","rimraf":"^3.0.2","semantic-release":"^17.2.2","unixify":"^1.0.0"},"engines":{"node":">12.16","npm":">6.13.7"},"homepage":"https://github.com/asyncapi/generator","keywords":["asyncapi","documentation","generator","markdown"],"license":"Apache-2.0","main":"./lib/generator.js","name":"@asyncapi/generator","preferGlobal":true,"publishConfig":{"access":"public"},"release":{"branches":["master"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits"}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits"}],"@semantic-release/npm","@semantic-release/github"]},"repository":{"type":"git","url":"git://github.com/asyncapi/generator.git"},"scripts":{"bump:version":"npm --no-git-tag-version --allow-same-version version $VERSION","docker:build":"docker build -t asyncapi/generator:latest .","docs":"jsdoc2md lib/generator.js > docs/api.md","generate:assets":"npm run docs && npm run generate:readme:toc","generate:readme:toc":"markdown-toc -i README.md","get:name":"echo $npm_package_name","get:version":"echo $npm_package_version","lint":"eslint --max-warnings 0 --config .eslintrc .","lint:tpl:validator":"eslint --fix --config .eslintrc .github/templates-list-validator","release":"semantic-release","test":"npm run test:unit && npm run test:integration && npm run test:cli","test:cleanup":"rimraf \\"test/temp\\"","test:cli":"node cli.js ./test/docs/dummy.yml @asyncapi/html-template -o test/output --force-write --debug && test -e test/output/index.html","test:dev":"npm run test:unit -- --watchAll","test:integration":"npm run test:cleanup && jest --testPathPattern=integration --modulePathIgnorePatterns=\'./__mocks__\'","test:unit":"jest --coverage --testPathIgnorePatterns=integration --testPathIgnorePatterns=test-project"},"version":"1.7.4"}'); +module.exports = JSON.parse('{"_args":[["@asyncapi/generator@1.7.4","/home/runner/work/github-action-for-generator/github-action-for-generator"]],"_from":"@asyncapi/generator@1.7.4","_id":"@asyncapi/generator@1.7.4","_inBundle":false,"_integrity":"sha512-rGyI+gcPrFS1xLkXt/QdR5kTSwn6wPLWGkGJO1mxHyOVF6X9sCnCHKLHqQ9tzh++fi5tivi6Ybx5VM5xaRc1eg==","_location":"/@asyncapi/generator","_phantomChildren":{"lru-cache":"6.0.0"},"_requested":{"type":"version","registry":true,"raw":"@asyncapi/generator@1.7.4","name":"@asyncapi/generator","escapedName":"@asyncapi%2fgenerator","scope":"@asyncapi","rawSpec":"1.7.4","saveSpec":null,"fetchSpec":"1.7.4"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/@asyncapi/generator/-/generator-1.7.4.tgz","_spec":"1.7.4","_where":"/home/runner/work/github-action-for-generator/github-action-for-generator","author":{"name":"Fran Mendez","email":"fmvilas@gmail.com"},"bin":{"asyncapi-generator":"cli.js","ag":"cli.js"},"bugs":{"url":"https://github.com/asyncapi/generator/issues"},"dependencies":{"@asyncapi/avro-schema-parser":"^0.2.1","@asyncapi/generator-react-sdk":"^0.2.11","@asyncapi/openapi-schema-parser":"^2.0.1","@asyncapi/parser":"^1.5.2","@asyncapi/raml-dt-schema-parser":"^2.0.1","@npmcli/arborist":"^2.2.4","ajv":"^6.10.2","chokidar":"^3.4.0","commander":"^6.1.0","filenamify":"^4.1.0","fs.extra":"^1.3.2","global-dirs":"^3.0.0","jmespath":"^0.15.0","js-yaml":"^3.13.1","levenshtein-edit-distance":"^2.0.5","loglevel":"^1.6.8","markdown-it":"^8.4.1","minimatch":"^3.0.4","node-fetch":"^2.6.0","nunjucks":"^3.2.0","resolve-from":"^5.0.0","resolve-pkg":"^2.0.0","semver":"^7.3.2","simple-git":"^1.131.0","source-map-support":"^0.5.19","ts-node":"^9.1.1","typescript":"^4.2.2"},"description":"The AsyncAPI generator. It can generate documentation, code, anything!","devDependencies":{"@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/github":"^7.0.4","@semantic-release/npm":"^7.0.6","@semantic-release/release-notes-generator":"^9.0.1","all-contributors-cli":"^6.14.2","conventional-changelog-conventionalcommits":"^4.4.0","eslint":"^6.8.0","eslint-plugin-jest":"^23.8.2","eslint-plugin-sonarjs":"^0.5.0","jest":"^25.5.0","jsdoc-to-markdown":"^5.0.0","markdown-toc":"^1.2.0","rimraf":"^3.0.2","semantic-release":"^17.2.2","unixify":"^1.0.0"},"engines":{"node":">12.16","npm":">6.13.7"},"homepage":"https://github.com/asyncapi/generator","keywords":["asyncapi","documentation","generator","markdown"],"license":"Apache-2.0","main":"./lib/generator.js","name":"@asyncapi/generator","preferGlobal":true,"publishConfig":{"access":"public"},"release":{"branches":["master"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits"}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits"}],"@semantic-release/npm","@semantic-release/github"]},"repository":{"type":"git","url":"git://github.com/asyncapi/generator.git"},"scripts":{"bump:version":"npm --no-git-tag-version --allow-same-version version $VERSION","docker:build":"docker build -t asyncapi/generator:latest .","docs":"jsdoc2md lib/generator.js > docs/api.md","generate:assets":"npm run docs && npm run generate:readme:toc","generate:readme:toc":"markdown-toc -i README.md","get:name":"echo $npm_package_name","get:version":"echo $npm_package_version","lint":"eslint --max-warnings 0 --config .eslintrc .","lint:tpl:validator":"eslint --fix --config .eslintrc .github/templates-list-validator","release":"semantic-release","test":"npm run test:unit && npm run test:integration && npm run test:cli","test:cleanup":"rimraf \\"test/temp\\"","test:cli":"node cli.js ./test/docs/dummy.yml @asyncapi/html-template -o test/output --force-write --debug && test -e test/output/index.html","test:dev":"npm run test:unit -- --watchAll","test:integration":"npm run test:cleanup && jest --testPathPattern=integration --modulePathIgnorePatterns=\'./__mocks__\'","test:unit":"jest --coverage --testPathIgnorePatterns=integration --testPathIgnorePatterns=test-project"},"version":"1.7.4"}'); /***/ }), @@ -80,7 +80,7 @@ module.exports = webpackEmptyAsyncContext; /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"_args":[["@babel/core@7.12.3","/Users/wookiee/sources/github-action-for-generator"]],"_development":true,"_from":"@babel/core@7.12.3","_id":"@babel/core@7.12.3","_inBundle":false,"_integrity":"sha512-0qXcZYKZp3/6N2jKYVxZv0aNCsxTSVCiK72DTiTYZAu7sjg73W0/aynWjMbiGd87EQL4WyA8reiJVh92AVla9g==","_location":"/@babel/core","_phantomChildren":{"chalk":"2.4.2","js-tokens":"4.0.0"},"_requested":{"type":"version","registry":true,"raw":"@babel/core@7.12.3","name":"@babel/core","escapedName":"@babel%2fcore","scope":"@babel","rawSpec":"7.12.3","saveSpec":null,"fetchSpec":"7.12.3"},"_requiredBy":["/@jest/transform","/istanbul-lib-instrument","/jest-config"],"_resolved":"https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz","_spec":"7.12.3","_where":"/Users/wookiee/sources/github-action-for-generator","author":{"name":"Sebastian McKenzie","email":"sebmck@gmail.com"},"browser":{"./lib/config/files/index.js":"./lib/config/files/index-browser.js","./lib/transform-file.js":"./lib/transform-file-browser.js","./src/config/files/index.js":"./src/config/files/index-browser.js","./src/transform-file.js":"./src/transform-file-browser.js"},"bugs":{"url":"https://github.com/babel/babel/issues"},"dependencies":{"@babel/code-frame":"^7.10.4","@babel/generator":"^7.12.1","@babel/helper-module-transforms":"^7.12.1","@babel/helpers":"^7.12.1","@babel/parser":"^7.12.3","@babel/template":"^7.10.4","@babel/traverse":"^7.12.1","@babel/types":"^7.12.1","convert-source-map":"^1.7.0","debug":"^4.1.0","gensync":"^1.0.0-beta.1","json5":"^2.1.2","lodash":"^4.17.19","resolve":"^1.3.2","semver":"^5.4.1","source-map":"^0.5.0"},"description":"Babel compiler core.","devDependencies":{"@babel/helper-transform-fixture-test-runner":"^7.12.1"},"engines":{"node":">=6.9.0"},"funding":{"type":"opencollective","url":"https://opencollective.com/babel"},"homepage":"https://babeljs.io/","keywords":["6to5","babel","classes","const","es6","harmony","let","modules","transpile","transpiler","var","babel-core","compiler"],"license":"MIT","main":"lib/index.js","name":"@babel/core","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/babel/babel.git","directory":"packages/babel-core"},"version":"7.12.3"}'); +module.exports = JSON.parse('{"_args":[["@babel/core@7.12.3","/home/runner/work/github-action-for-generator/github-action-for-generator"]],"_development":true,"_from":"@babel/core@7.12.3","_id":"@babel/core@7.12.3","_inBundle":false,"_integrity":"sha512-0qXcZYKZp3/6N2jKYVxZv0aNCsxTSVCiK72DTiTYZAu7sjg73W0/aynWjMbiGd87EQL4WyA8reiJVh92AVla9g==","_location":"/@babel/core","_phantomChildren":{"chalk":"2.4.2","js-tokens":"4.0.0"},"_requested":{"type":"version","registry":true,"raw":"@babel/core@7.12.3","name":"@babel/core","escapedName":"@babel%2fcore","scope":"@babel","rawSpec":"7.12.3","saveSpec":null,"fetchSpec":"7.12.3"},"_requiredBy":["/@jest/transform","/istanbul-lib-instrument","/jest-config"],"_resolved":"https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz","_spec":"7.12.3","_where":"/home/runner/work/github-action-for-generator/github-action-for-generator","author":{"name":"Sebastian McKenzie","email":"sebmck@gmail.com"},"browser":{"./lib/config/files/index.js":"./lib/config/files/index-browser.js","./lib/transform-file.js":"./lib/transform-file-browser.js","./src/config/files/index.js":"./src/config/files/index-browser.js","./src/transform-file.js":"./src/transform-file-browser.js"},"bugs":{"url":"https://github.com/babel/babel/issues"},"dependencies":{"@babel/code-frame":"^7.10.4","@babel/generator":"^7.12.1","@babel/helper-module-transforms":"^7.12.1","@babel/helpers":"^7.12.1","@babel/parser":"^7.12.3","@babel/template":"^7.10.4","@babel/traverse":"^7.12.1","@babel/types":"^7.12.1","convert-source-map":"^1.7.0","debug":"^4.1.0","gensync":"^1.0.0-beta.1","json5":"^2.1.2","lodash":"^4.17.19","resolve":"^1.3.2","semver":"^5.4.1","source-map":"^0.5.0"},"description":"Babel compiler core.","devDependencies":{"@babel/helper-transform-fixture-test-runner":"^7.12.1"},"engines":{"node":">=6.9.0"},"funding":{"type":"opencollective","url":"https://opencollective.com/babel"},"homepage":"https://babeljs.io/","keywords":["6to5","babel","classes","const","es6","harmony","let","modules","transpile","transpiler","var","babel-core","compiler"],"license":"MIT","main":"lib/index.js","name":"@babel/core","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/babel/babel.git","directory":"packages/babel-core"},"version":"7.12.3"}'); /***/ }), @@ -108397,7 +108397,7 @@ const { promisify } = __nccwpck_require__(31669); let fsevents; try { - fsevents = __nccwpck_require__(80461); + fsevents = __nccwpck_require__(89149); } catch (error) { if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error); } @@ -109681,96 +109681,6 @@ anymatch.default = anymatch; module.exports = anymatch; -/***/ }), - -/***/ 80461: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -/* - ** © 2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller - ** Licensed under MIT License. - */ - -/* jshint node:true */ - - -if (process.platform !== "darwin") { - throw new Error(`Module 'fsevents' is not compatible with platform '${process.platform}'`); -} - -const Native = __nccwpck_require__(47824); -const events = Native.constants; - -function watch(path, since, handler) { - if (typeof path !== "string") { - throw new TypeError(`fsevents argument 1 must be a string and not a ${typeof path}`); - } - if ("function" === typeof since && "undefined" === typeof handler) { - handler = since; - since = Native.flags.SinceNow; - } - if (typeof since !== "number") { - throw new TypeError(`fsevents argument 2 must be a number and not a ${typeof since}`); - } - if (typeof handler !== "function") { - throw new TypeError(`fsevents argument 3 must be a function and not a ${typeof handler}`); - } - - let instance = Native.start(Native.global, path, since, handler); - if (!instance) throw new Error(`could not watch: ${path}`); - return () => { - const result = instance ? Promise.resolve(instance).then(Native.stop) : Promise.resolve(undefined); - instance = undefined; - return result; - }; -} - -function getInfo(path, flags) { - return { - path, - flags, - event: getEventType(flags), - type: getFileType(flags), - changes: getFileChanges(flags), - }; -} - -function getFileType(flags) { - if (events.ItemIsFile & flags) return "file"; - if (events.ItemIsDir & flags) return "directory"; - if (events.ItemIsSymlink & flags) return "symlink"; -} -function anyIsTrue(obj) { - for (let key in obj) { - if (obj[key]) return true; - } - return false; -} -function getEventType(flags) { - if (events.ItemRemoved & flags) return "deleted"; - if (events.ItemRenamed & flags) return "moved"; - if (events.ItemCreated & flags) return "created"; - if (events.ItemModified & flags) return "modified"; - if (events.RootChanged & flags) return "root-changed"; - if (events.ItemCloned & flags) return "cloned"; - if (anyIsTrue(flags)) return "modified"; - return "unknown"; -} -function getFileChanges(flags) { - return { - inode: !!(events.ItemInodeMetaMod & flags), - finder: !!(events.ItemFinderInfoMod & flags), - access: !!(events.ItemChangeOwner & flags), - xattrs: !!(events.ItemXattrMod & flags), - }; -} - -exports.watch = watch; -exports.getInfo = getInfo; -exports.constants = events; - - /***/ }), /***/ 59051: @@ -201585,7 +201495,7 @@ const treeshakePresets = { let fsEvents; let fsEventsImportError; function loadFsEvents() { - return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(__nccwpck_require__(232)); }) + return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(__nccwpck_require__(89149)); }) .then(namespace => { fsEvents = namespace.default; }) @@ -222786,96 +222696,6 @@ exports.Watcher = Watcher; //# sourceMappingURL=watch.js.map -/***/ }), - -/***/ 232: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -/* - ** © 2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller - ** Licensed under MIT License. - */ - -/* jshint node:true */ - - -if (process.platform !== "darwin") { - throw new Error(`Module 'fsevents' is not compatible with platform '${process.platform}'`); -} - -const Native = __nccwpck_require__(85816); -const events = Native.constants; - -function watch(path, since, handler) { - if (typeof path !== "string") { - throw new TypeError(`fsevents argument 1 must be a string and not a ${typeof path}`); - } - if ("function" === typeof since && "undefined" === typeof handler) { - handler = since; - since = Native.flags.SinceNow; - } - if (typeof since !== "number") { - throw new TypeError(`fsevents argument 2 must be a number and not a ${typeof since}`); - } - if (typeof handler !== "function") { - throw new TypeError(`fsevents argument 3 must be a function and not a ${typeof handler}`); - } - - let instance = Native.start(Native.global, path, since, handler); - if (!instance) throw new Error(`could not watch: ${path}`); - return () => { - const result = instance ? Promise.resolve(instance).then(Native.stop) : Promise.resolve(undefined); - instance = undefined; - return result; - }; -} - -function getInfo(path, flags) { - return { - path, - flags, - event: getEventType(flags), - type: getFileType(flags), - changes: getFileChanges(flags), - }; -} - -function getFileType(flags) { - if (events.ItemIsFile & flags) return "file"; - if (events.ItemIsDir & flags) return "directory"; - if (events.ItemIsSymlink & flags) return "symlink"; -} -function anyIsTrue(obj) { - for (let key in obj) { - if (obj[key]) return true; - } - return false; -} -function getEventType(flags) { - if (events.ItemRemoved & flags) return "deleted"; - if (events.ItemRenamed & flags) return "moved"; - if (events.ItemCreated & flags) return "created"; - if (events.ItemModified & flags) return "modified"; - if (events.RootChanged & flags) return "root-changed"; - if (events.ItemCloned & flags) return "cloned"; - if (anyIsTrue(flags)) return "modified"; - return "unknown"; -} -function getFileChanges(flags) { - return { - inode: !!(events.ItemInodeMetaMod & flags), - finder: !!(events.ItemFinderInfoMod & flags), - access: !!(events.ItemChangeOwner & flags), - xattrs: !!(events.ItemXattrMod & flags), - }; -} - -exports.watch = watch; -exports.getInfo = getInfo; -exports.constants = events; - - /***/ }), /***/ 21867: @@ -260730,24 +260550,18 @@ module.exports = (input, options) => { /***/ }), -/***/ 47824: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = require(__nccwpck_require__.ab + "fsevents.node") - -/***/ }), +/***/ 28992: +/***/ ((module) => { -/***/ 85816: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +module.exports = eval("require")("bluebird"); -module.exports = require(__nccwpck_require__.ab + "fsevents1.node") /***/ }), -/***/ 28992: +/***/ 89149: /***/ ((module) => { -module.exports = eval("require")("bluebird"); +module.exports = eval("require")("fsevents"); /***/ }), @@ -260924,7 +260738,7 @@ module.exports = JSON.parse('{"id":"https://raw.githubusercontent.com/epoberezki /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"_args":[["make-fetch-happen@9.0.3","/Users/wookiee/sources/github-action-for-generator"]],"_from":"make-fetch-happen@9.0.3","_id":"make-fetch-happen@9.0.3","_inBundle":false,"_integrity":"sha512-uZ/9Cf2vKqsSWZyXhZ9wHHyckBrkntgbnqV68Bfe8zZenlf7D6yuGMXvHZQ+jSnzPkjosuNP1HGasj1J4h8OlQ==","_location":"/make-fetch-happen","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"make-fetch-happen@9.0.3","name":"make-fetch-happen","escapedName":"make-fetch-happen","rawSpec":"9.0.3","saveSpec":null,"fetchSpec":"9.0.3"},"_requiredBy":["/npm-registry-fetch"],"_resolved":"https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.0.3.tgz","_spec":"9.0.3","_where":"/Users/wookiee/sources/github-action-for-generator","author":{"name":"Kat Marchán","email":"kzm@zkat.tech"},"bugs":{"url":"https://github.com/npm/make-fetch-happen/issues"},"dependencies":{"agentkeepalive":"^4.1.3","cacache":"^15.2.0","http-cache-semantics":"^4.1.0","http-proxy-agent":"^4.0.1","https-proxy-agent":"^5.0.0","is-lambda":"^1.0.1","lru-cache":"^6.0.0","minipass":"^3.1.3","minipass-collect":"^1.0.2","minipass-fetch":"^1.3.2","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4","negotiator":"^0.6.2","promise-retry":"^2.0.1","socks-proxy-agent":"^5.0.0","ssri":"^8.0.0"},"description":"Opinionated, caching, retrying fetch client","devDependencies":{"eslint":"^7.26.0","eslint-plugin-import":"^2.23.2","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0","eslint-plugin-standard":"^5.0.0","mkdirp":"^1.0.4","nock":"^13.0.11","npmlog":"^4.1.2","require-inject":"^1.4.2","rimraf":"^3.0.2","safe-buffer":"^5.2.1","standard-version":"^9.3.0","tap":"^15.0.9"},"engines":{"node":">= 10"},"files":["lib"],"homepage":"https://github.com/npm/make-fetch-happen#readme","keywords":["http","request","fetch","mean girls","caching","cache","subresource integrity"],"license":"ISC","main":"lib/index.js","name":"make-fetch-happen","repository":{"type":"git","url":"git+https://github.com/npm/make-fetch-happen.git"},"scripts":{"eslint":"eslint","lint":"npm run eslint -- lib test","lintfix":"npm run lint -- --fix","posttest":"npm run lint","postversion":"npm publish","prepublishOnly":"git push --follow-tags","preversion":"npm t","test":"tap"},"tap":{"color":1,"files":"test/*.js","check-coverage":true},"version":"9.0.3"}'); +module.exports = JSON.parse('{"_args":[["make-fetch-happen@9.0.3","/home/runner/work/github-action-for-generator/github-action-for-generator"]],"_from":"make-fetch-happen@9.0.3","_id":"make-fetch-happen@9.0.3","_inBundle":false,"_integrity":"sha512-uZ/9Cf2vKqsSWZyXhZ9wHHyckBrkntgbnqV68Bfe8zZenlf7D6yuGMXvHZQ+jSnzPkjosuNP1HGasj1J4h8OlQ==","_location":"/make-fetch-happen","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"make-fetch-happen@9.0.3","name":"make-fetch-happen","escapedName":"make-fetch-happen","rawSpec":"9.0.3","saveSpec":null,"fetchSpec":"9.0.3"},"_requiredBy":["/npm-registry-fetch"],"_resolved":"https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.0.3.tgz","_spec":"9.0.3","_where":"/home/runner/work/github-action-for-generator/github-action-for-generator","author":{"name":"Kat Marchán","email":"kzm@zkat.tech"},"bugs":{"url":"https://github.com/npm/make-fetch-happen/issues"},"dependencies":{"agentkeepalive":"^4.1.3","cacache":"^15.2.0","http-cache-semantics":"^4.1.0","http-proxy-agent":"^4.0.1","https-proxy-agent":"^5.0.0","is-lambda":"^1.0.1","lru-cache":"^6.0.0","minipass":"^3.1.3","minipass-collect":"^1.0.2","minipass-fetch":"^1.3.2","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4","negotiator":"^0.6.2","promise-retry":"^2.0.1","socks-proxy-agent":"^5.0.0","ssri":"^8.0.0"},"description":"Opinionated, caching, retrying fetch client","devDependencies":{"eslint":"^7.26.0","eslint-plugin-import":"^2.23.2","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0","eslint-plugin-standard":"^5.0.0","mkdirp":"^1.0.4","nock":"^13.0.11","npmlog":"^4.1.2","require-inject":"^1.4.2","rimraf":"^3.0.2","safe-buffer":"^5.2.1","standard-version":"^9.3.0","tap":"^15.0.9"},"engines":{"node":">= 10"},"files":["lib"],"homepage":"https://github.com/npm/make-fetch-happen#readme","keywords":["http","request","fetch","mean girls","caching","cache","subresource integrity"],"license":"ISC","main":"lib/index.js","name":"make-fetch-happen","repository":{"type":"git","url":"git+https://github.com/npm/make-fetch-happen.git"},"scripts":{"eslint":"eslint","lint":"npm run eslint -- lib test","lintfix":"npm run lint -- --fix","posttest":"npm run lint","postversion":"npm publish","prepublishOnly":"git push --follow-tags","preversion":"npm t","test":"tap"},"tap":{"color":1,"files":"test/*.js","check-coverage":true},"version":"9.0.3"}'); /***/ }), @@ -260940,7 +260754,7 @@ module.exports = {"i8":"1.3.3"}; /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"_args":[["npm-registry-fetch@11.0.0","/Users/wookiee/sources/github-action-for-generator"]],"_from":"npm-registry-fetch@11.0.0","_id":"npm-registry-fetch@11.0.0","_inBundle":false,"_integrity":"sha512-jmlgSxoDNuhAtxUIG6pVwwtz840i994dL14FoNVZisrmZW5kWd63IUTNv1m/hyRSGSqWjCUp/YZlS1BJyNp9XA==","_location":"/npm-registry-fetch","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"npm-registry-fetch@11.0.0","name":"npm-registry-fetch","escapedName":"npm-registry-fetch","rawSpec":"11.0.0","saveSpec":null,"fetchSpec":"11.0.0"},"_requiredBy":["/@npmcli/arborist","/pacote"],"_resolved":"https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz","_spec":"11.0.0","_where":"/Users/wookiee/sources/github-action-for-generator","author":{"name":"Kat Marchán","email":"kzm@sykosomatic.org"},"bugs":{"url":"https://github.com/npm/npm-registry-fetch/issues"},"dependencies":{"make-fetch-happen":"^9.0.1","minipass":"^3.1.3","minipass-fetch":"^1.3.0","minipass-json-stream":"^1.0.1","minizlib":"^2.0.0","npm-package-arg":"^8.0.0"},"description":"Fetch-based http client for use with npm registry APIs","devDependencies":{"@npmcli/lint":"^1.0.1","cacache":"^15.0.0","nock":"^13.1.0","npmlog":"^4.1.2","require-inject":"^1.4.4","ssri":"^8.0.0","tap":"^15.0.4"},"engines":{"node":">=10"},"files":["*.js"],"homepage":"https://github.com/npm/npm-registry-fetch#readme","keywords":["npm","registry","fetch"],"license":"ISC","main":"index.js","name":"npm-registry-fetch","repository":{"type":"git","url":"git+https://github.com/npm/npm-registry-fetch.git"},"scripts":{"eslint":"eslint","lint":"npm run npmclilint -- \\"*.*js\\" \\"test/**/*.*js\\"","lintfix":"npm run lint -- --fix","npmclilint":"npmcli-lint","postsnap":"npm run lintfix --","posttest":"npm run lint --","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","preversion":"npm test","test":"tap"},"tap":{"check-coverage":true,"test-ignore":"test[\\\\\\\\/](util|cache)[\\\\\\\\/]"},"version":"11.0.0"}'); +module.exports = JSON.parse('{"_args":[["npm-registry-fetch@11.0.0","/home/runner/work/github-action-for-generator/github-action-for-generator"]],"_from":"npm-registry-fetch@11.0.0","_id":"npm-registry-fetch@11.0.0","_inBundle":false,"_integrity":"sha512-jmlgSxoDNuhAtxUIG6pVwwtz840i994dL14FoNVZisrmZW5kWd63IUTNv1m/hyRSGSqWjCUp/YZlS1BJyNp9XA==","_location":"/npm-registry-fetch","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"npm-registry-fetch@11.0.0","name":"npm-registry-fetch","escapedName":"npm-registry-fetch","rawSpec":"11.0.0","saveSpec":null,"fetchSpec":"11.0.0"},"_requiredBy":["/@npmcli/arborist","/pacote"],"_resolved":"https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz","_spec":"11.0.0","_where":"/home/runner/work/github-action-for-generator/github-action-for-generator","author":{"name":"Kat Marchán","email":"kzm@sykosomatic.org"},"bugs":{"url":"https://github.com/npm/npm-registry-fetch/issues"},"dependencies":{"make-fetch-happen":"^9.0.1","minipass":"^3.1.3","minipass-fetch":"^1.3.0","minipass-json-stream":"^1.0.1","minizlib":"^2.0.0","npm-package-arg":"^8.0.0"},"description":"Fetch-based http client for use with npm registry APIs","devDependencies":{"@npmcli/lint":"^1.0.1","cacache":"^15.0.0","nock":"^13.1.0","npmlog":"^4.1.2","require-inject":"^1.4.4","ssri":"^8.0.0","tap":"^15.0.4"},"engines":{"node":">=10"},"files":["*.js"],"homepage":"https://github.com/npm/npm-registry-fetch#readme","keywords":["npm","registry","fetch"],"license":"ISC","main":"index.js","name":"npm-registry-fetch","repository":{"type":"git","url":"git+https://github.com/npm/npm-registry-fetch.git"},"scripts":{"eslint":"eslint","lint":"npm run npmclilint -- \\"*.*js\\" \\"test/**/*.*js\\"","lintfix":"npm run lint -- --fix","npmclilint":"npmcli-lint","postsnap":"npm run lintfix --","posttest":"npm run lint --","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","preversion":"npm test","test":"tap"},"tap":{"check-coverage":true,"test-ignore":"test[\\\\\\\\/](util|cache)[\\\\\\\\/]"},"version":"11.0.0"}'); /***/ }), diff --git a/dist/index.js.map b/dist/index.js.map index f1ab70b0e..d4e8ebc8f 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/files|lazy|groupOptions: {}|namespace object","../webpack://github-action-for-generator/./lib/utils.js","../webpack://github-action-for-generator/./node_modules/@actions/core/lib/command.js","../webpack://github-action-for-generator/./node_modules/@actions/core/lib/core.js","../webpack://github-action-for-generator/./node_modules/@actions/core/lib/file-command.js","../webpack://github-action-for-generator/./node_modules/@actions/core/lib/utils.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/dereference.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/index.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/normalize-args.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/options.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/parse.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/parsers/binary.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/parsers/json.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/parsers/text.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/parsers/yaml.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/pointer.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/ref.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/refs.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/resolve-external.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/resolvers/file.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/resolvers/http.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/util/errors.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/util/plugins.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/lib/util/url.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/index.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/common.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/dumper.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/exception.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/loader.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/schema.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/schema/core.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/schema/default.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/schema/failsafe.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/schema/json.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/snippet.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type/binary.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type/bool.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type/float.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type/int.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type/map.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type/merge.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type/null.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type/omap.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type/pairs.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type/seq.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type/set.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type/str.js","../webpack://github-action-for-generator/./node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml/lib/type/timestamp.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/avro-schema-parser/index.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/avro-schema-parser/to-json-schema.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/components/File.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/components/Indent.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/components/Text.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/components/index.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/index.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/renderer/index.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/renderer/renderer.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/renderer/template.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/transpiler/index.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/transpiler/transpiler.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/types.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/utils/getStatsInDir.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/utils/index.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/utils/isJsFile.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/utils/withIndendation.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator-react-sdk/lib/utils/withNewLines.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/lib/filtersRegistry.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/lib/generator.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/lib/hooksRegistry.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/lib/logMessages.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/lib/renderer/nunjucks.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/lib/renderer/react.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/lib/templateConfigValidator.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/lib/utils.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/classes/comparator.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/classes/range.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/classes/semver.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/clean.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/cmp.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/coerce.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/compare-build.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/compare-loose.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/compare.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/diff.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/eq.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/gt.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/gte.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/inc.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/lt.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/lte.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/major.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/minor.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/neq.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/parse.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/patch.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/prerelease.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/rcompare.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/rsort.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/satisfies.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/sort.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/functions/valid.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/index.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/internal/constants.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/internal/debug.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/internal/identifiers.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/internal/parse-options.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/internal/re.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/ranges/gtr.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/ranges/intersects.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/ranges/ltr.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/ranges/max-satisfying.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/ranges/min-satisfying.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/ranges/min-version.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/ranges/outside.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/ranges/simplify.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/ranges/subset.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/ranges/to-comparators.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/generator/node_modules/semver/ranges/valid.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/openapi-schema-parser/index.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/anonymousNaming.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/asyncapiSchemaFormatParser.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/constants.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/customValidators.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/errors/parser-error.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/index.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/iterators.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/json-parse.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/mixins/bindings.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/mixins/description.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/mixins/external-docs.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/mixins/specification-extensions.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/mixins/tags.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/asyncapi.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/base.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/channel-parameter.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/channel.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/components.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/contact.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/correlation-id.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/external-docs.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/info.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/license.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/message-trait.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/message-traitable.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/message.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/oauth-flow.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/operation-trait.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/operation-traitable.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/operation.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/publish-operation.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/schema.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/security-scheme.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/server-security-requirement.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/server-variable.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/server.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/subscribe-operation.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/tag.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/models/utils.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/parser.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/parser/lib/utils.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/raml-dt-schema-parser/index.js","../webpack://github-action-for-generator/./node_modules/@asyncapi/specs/index.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/caching.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/config-chain.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/config-descriptors.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/files/configuration.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/files/import.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/files/index.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/files/module-types.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/files/package.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/files/plugins.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/files/utils.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/full.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/helpers/config-api.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/helpers/environment.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/index.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/item.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/partial.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/pattern-to-regex.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/plugin.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/printer.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/util.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/validation/option-assertions.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/validation/options.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/validation/plugins.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/config/validation/removed.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/gensync-utils/async.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/gensync-utils/fs.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/gensync-utils/resolve.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/parse.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/parser/index.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/tools/build-external-helpers.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/transform-ast.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/transform-file.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/transform.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/transformation/block-hoist-plugin.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/transformation/file/file.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/transformation/file/generate.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/transformation/file/merge-map.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/transformation/index.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/transformation/normalize-file.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/transformation/normalize-opts.js","../webpack://github-action-for-generator/./node_modules/@babel/core/lib/transformation/plugin-pass.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/@babel/code-frame/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/identifier.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/keyword.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/@babel/highlight/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/source-map/lib/array-set.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/source-map/lib/base64-vlq.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/source-map/lib/base64.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/source-map/lib/binary-search.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/source-map/lib/mapping-list.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/source-map/lib/quick-sort.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/source-map/lib/source-map-consumer.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/source-map/lib/source-map-generator.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/source-map/lib/source-node.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/source-map/lib/util.js","../webpack://github-action-for-generator/./node_modules/@babel/core/node_modules/source-map/source-map.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/buffer.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/generators/base.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/generators/classes.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/generators/expressions.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/generators/flow.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/generators/index.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/generators/jsx.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/generators/methods.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/generators/modules.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/generators/statements.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/generators/template-literals.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/generators/types.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/generators/typescript.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/node/index.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/node/parentheses.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/node/whitespace.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/printer.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/lib/source-map.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/node_modules/source-map/lib/array-set.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/node_modules/source-map/lib/base64-vlq.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/node_modules/source-map/lib/base64.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/node_modules/source-map/lib/binary-search.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/node_modules/source-map/lib/mapping-list.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/node_modules/source-map/lib/quick-sort.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/node_modules/source-map/lib/source-map-consumer.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/node_modules/source-map/lib/source-map-generator.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/node_modules/source-map/lib/source-node.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/node_modules/source-map/lib/util.js","../webpack://github-action-for-generator/./node_modules/@babel/generator/node_modules/source-map/source-map.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-function-name/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-get-function-arity/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-member-expression-to-functions/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-module-imports/lib/import-builder.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-module-imports/lib/import-injector.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-module-imports/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-module-imports/lib/is-module.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-module-transforms/lib/get-module-name.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-module-transforms/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-module-transforms/lib/rewrite-this.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-validator-identifier/lib/identifier.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-validator-identifier/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-validator-identifier/lib/keyword.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-optimise-call-expression/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-replace-supers/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-simple-access/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/helper-split-export-declaration/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/helpers/lib/helpers.js","../webpack://github-action-for-generator/./node_modules/@babel/helpers/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/parser/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/template/lib/builder.js","../webpack://github-action-for-generator/./node_modules/@babel/template/lib/formatters.js","../webpack://github-action-for-generator/./node_modules/@babel/template/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/template/lib/literal.js","../webpack://github-action-for-generator/./node_modules/@babel/template/lib/options.js","../webpack://github-action-for-generator/./node_modules/@babel/template/lib/parse.js","../webpack://github-action-for-generator/./node_modules/@babel/template/lib/populate.js","../webpack://github-action-for-generator/./node_modules/@babel/template/lib/string.js","../webpack://github-action-for-generator/./node_modules/@babel/template/node_modules/@babel/code-frame/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/template/node_modules/@babel/helper-validator-identifier/lib/identifier.js","../webpack://github-action-for-generator/./node_modules/@babel/template/node_modules/@babel/helper-validator-identifier/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/template/node_modules/@babel/helper-validator-identifier/lib/keyword.js","../webpack://github-action-for-generator/./node_modules/@babel/template/node_modules/@babel/highlight/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/cache.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/context.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/hub.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/ancestry.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/comments.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/context.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/conversion.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/evaluation.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/family.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/index.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/inference/index.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/inference/inferer-reference.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/inference/inferers.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/introspection.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/lib/hoister.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/lib/removal-hooks.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/lib/virtual-types.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/modification.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/removal.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/path/replacement.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/scope/binding.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/scope/index.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/scope/lib/renamer.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/lib/visitors.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/node_modules/@babel/code-frame/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/node_modules/@babel/helper-validator-identifier/lib/identifier.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/node_modules/@babel/helper-validator-identifier/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/node_modules/@babel/helper-validator-identifier/lib/keyword.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/node_modules/@babel/highlight/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/traverse/node_modules/globals/index.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/asserts/assertNode.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/asserts/generated/index.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/builders/builder.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/builders/generated/index.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/builders/react/buildChildren.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/clone/clone.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/clone/cloneDeep.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/clone/cloneNode.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/clone/cloneWithoutLoc.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/comments/addComment.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/comments/addComments.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/comments/inheritInnerComments.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/comments/inheritLeadingComments.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/comments/inheritTrailingComments.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/comments/inheritsComments.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/comments/removeComments.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/constants/generated/index.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/constants/index.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/converters/ensureBlock.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/converters/toBindingIdentifierName.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/converters/toBlock.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/converters/toComputedKey.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/converters/toExpression.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/converters/toIdentifier.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/converters/toKeyAlias.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/converters/toSequenceExpression.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/converters/toStatement.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/converters/valueToNode.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/definitions/core.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/definitions/experimental.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/definitions/flow.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/definitions/index.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/definitions/jsx.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/definitions/misc.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/definitions/placeholders.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/definitions/typescript.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/definitions/utils.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/modifications/appendToMemberExpression.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/modifications/inherits.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/modifications/prependToMemberExpression.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/modifications/removeProperties.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/modifications/removePropertiesDeep.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/traverse/traverse.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/traverse/traverseFast.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/utils/inherit.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/utils/shallowEqual.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/generated/index.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/is.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isBinding.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isBlockScoped.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isImmutable.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isLet.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isNode.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isNodesEquivalent.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isPlaceholderType.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isReferenced.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isScope.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isSpecifierDefault.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isType.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isValidES3Identifier.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isValidIdentifier.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/isVar.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/matchesPattern.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/react/isCompatTag.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/react/isReactComponent.js","../webpack://github-action-for-generator/./node_modules/@babel/types/lib/validators/validate.js","../webpack://github-action-for-generator/./node_modules/@babel/types/node_modules/@babel/helper-validator-identifier/lib/identifier.js","../webpack://github-action-for-generator/./node_modules/@babel/types/node_modules/@babel/helper-validator-identifier/lib/index.js","../webpack://github-action-for-generator/./node_modules/@babel/types/node_modules/@babel/helper-validator-identifier/lib/keyword.js","../webpack://github-action-for-generator/./node_modules/@fmvilas/pseudo-yaml-ast/src/index.js","../webpack://github-action-for-generator/./node_modules/@jsdevtools/ono/cjs/constructor.js","../webpack://github-action-for-generator/./node_modules/@jsdevtools/ono/cjs/extend-error.js","../webpack://github-action-for-generator/./node_modules/@jsdevtools/ono/cjs/index.js","../webpack://github-action-for-generator/./node_modules/@jsdevtools/ono/cjs/isomorphic.node.js","../webpack://github-action-for-generator/./node_modules/@jsdevtools/ono/cjs/normalize.js","../webpack://github-action-for-generator/./node_modules/@jsdevtools/ono/cjs/singleton.js","../webpack://github-action-for-generator/./node_modules/@jsdevtools/ono/cjs/stack.js","../webpack://github-action-for-generator/./node_modules/@jsdevtools/ono/cjs/to-json.js","../webpack://github-action-for-generator/./node_modules/@jsdevtools/ono/cjs/types.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/arborist/audit.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/arborist/deduper.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/arborist/index.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/arborist/load-actual.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/arborist/load-virtual.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/arborist/load-workspaces.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/arborist/pruner.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/arborist/rebuild.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/arborist/reify.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/audit-report.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/calc-dep-flags.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/consistent-resolve.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/debug.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/dep-valid.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/diff.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/edge.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/from-path.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/gather-dep-set.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/get-workspace-nodes.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/index.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/inventory.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/link.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/node.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/optional-set.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/peer-set.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/printable.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/realpath.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/relpath.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/reset-dep-flags.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/retire-path.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/shrinkwrap.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/signal-handling.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/signals.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/spec-from-lock.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/tracker.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/tree-check.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/update-root-package-json.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/version-from-tgz.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/vuln.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/lib/yarn-lock.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/classes/comparator.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/classes/range.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/classes/semver.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/clean.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/cmp.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/coerce.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/compare-build.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/compare-loose.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/compare.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/diff.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/eq.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/gt.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/gte.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/inc.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/lt.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/lte.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/major.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/minor.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/neq.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/parse.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/patch.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/prerelease.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/rcompare.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/rsort.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/satisfies.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/sort.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/functions/valid.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/index.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/internal/constants.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/internal/debug.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/internal/identifiers.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/internal/parse-options.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/internal/re.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/ranges/gtr.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/ranges/intersects.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/ranges/ltr.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/ranges/max-satisfying.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/ranges/min-satisfying.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/ranges/min-version.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/ranges/outside.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/ranges/simplify.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/ranges/subset.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/ranges/to-comparators.js","../webpack://github-action-for-generator/./node_modules/@npmcli/arborist/node_modules/semver/ranges/valid.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/clone.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/errors.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/find.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/index.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/is-clean.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/is.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/lines-to-revs.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/make-error.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/opts.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/proc-log.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/revs.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/spawn.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/utils.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/lib/which.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/classes/comparator.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/classes/range.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/classes/semver.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/clean.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/cmp.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/coerce.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/compare-build.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/compare-loose.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/compare.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/diff.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/eq.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/gt.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/gte.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/inc.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/lt.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/lte.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/major.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/minor.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/neq.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/parse.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/patch.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/prerelease.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/rcompare.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/rsort.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/satisfies.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/sort.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/functions/valid.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/index.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/internal/constants.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/internal/debug.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/internal/identifiers.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/internal/parse-options.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/internal/re.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/ranges/gtr.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/ranges/intersects.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/ranges/ltr.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/ranges/max-satisfying.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/ranges/min-satisfying.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/ranges/min-version.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/ranges/outside.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/ranges/simplify.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/ranges/subset.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/ranges/to-comparators.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/semver/ranges/valid.js","../webpack://github-action-for-generator/./node_modules/@npmcli/git/node_modules/which/which.js","../webpack://github-action-for-generator/./node_modules/@npmcli/installed-package-contents/index.js","../webpack://github-action-for-generator/./node_modules/@npmcli/map-workspaces/index.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/lib/advisory.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/lib/hash.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/lib/index.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/classes/comparator.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/classes/range.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/classes/semver.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/clean.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/cmp.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/coerce.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/compare-build.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/compare-loose.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/compare.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/diff.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/eq.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/gt.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/gte.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/inc.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/lt.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/lte.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/major.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/minor.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/neq.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/parse.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/patch.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/prerelease.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/rcompare.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/rsort.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/satisfies.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/sort.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/functions/valid.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/index.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/internal/constants.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/internal/debug.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/internal/identifiers.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/internal/parse-options.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/internal/re.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/ranges/gtr.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/ranges/intersects.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/ranges/ltr.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/ranges/max-satisfying.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/ranges/min-satisfying.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/ranges/min-version.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/ranges/outside.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/ranges/simplify.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/ranges/subset.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/ranges/to-comparators.js","../webpack://github-action-for-generator/./node_modules/@npmcli/metavuln-calculator/node_modules/semver/ranges/valid.js","../webpack://github-action-for-generator/./node_modules/@npmcli/move-file/index.js","../webpack://github-action-for-generator/./node_modules/@npmcli/name-from-folder/index.js","../webpack://github-action-for-generator/./node_modules/@npmcli/node-gyp/lib/index.js","../webpack://github-action-for-generator/./node_modules/@npmcli/promise-spawn/index.js","../webpack://github-action-for-generator/./node_modules/@openapi-contrib/openapi-schema-to-json-schema/index.js","../webpack://github-action-for-generator/./node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/convert.js","../webpack://github-action-for-generator/./node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/converters/parameter.js","../webpack://github-action-for-generator/./node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/converters/schema.js","../webpack://github-action-for-generator/./node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/errors/invalid-input-error.js","../webpack://github-action-for-generator/./node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/errors/invalid-type-error.js","../webpack://github-action-for-generator/./node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/utils/isObject.js","../webpack://github-action-for-generator/./node_modules/@rollup/plugin-babel/dist/index.js","../webpack://github-action-for-generator/./node_modules/@rollup/pluginutils/dist/cjs/index.js","../webpack://github-action-for-generator/./node_modules/@tootallnate/once/dist/index.js","../webpack://github-action-for-generator/./node_modules/a-sync-waterfall/index.js","../webpack://github-action-for-generator/./node_modules/agent-base/dist/src/index.js","../webpack://github-action-for-generator/./node_modules/agent-base/dist/src/promisify.js","../webpack://github-action-for-generator/./node_modules/agentkeepalive/index.js","../webpack://github-action-for-generator/./node_modules/agentkeepalive/lib/agent.js","../webpack://github-action-for-generator/./node_modules/agentkeepalive/lib/constants.js","../webpack://github-action-for-generator/./node_modules/agentkeepalive/lib/https_agent.js","../webpack://github-action-for-generator/./node_modules/aggregate-error/index.js","../webpack://github-action-for-generator/./node_modules/aggregate-error/node_modules/indent-string/index.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/ajv.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/cache.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/compile/async.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/compile/error_classes.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/compile/formats.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/compile/index.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/compile/resolve.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/compile/rules.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/compile/schema_obj.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/compile/ucs2length.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/compile/util.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/data.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/definition_schema.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/_limit.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/_limitItems.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/_limitLength.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/_limitProperties.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/allOf.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/anyOf.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/comment.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/const.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/contains.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/custom.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/dependencies.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/enum.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/format.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/if.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/index.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/items.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/multipleOf.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/not.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/oneOf.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/pattern.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/properties.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/propertyNames.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/ref.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/required.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/uniqueItems.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/dotjs/validate.js","../webpack://github-action-for-generator/./node_modules/ajv/lib/keyword.js","../webpack://github-action-for-generator/./node_modules/ajv/node_modules/fast-deep-equal/index.js","../webpack://github-action-for-generator/./node_modules/ajv/node_modules/json-schema-traverse/index.js","../webpack://github-action-for-generator/./node_modules/ansi-styles/index.js","../webpack://github-action-for-generator/./node_modules/arg/index.js","../webpack://github-action-for-generator/./node_modules/asap/asap.js","../webpack://github-action-for-generator/./node_modules/asap/raw.js","../webpack://github-action-for-generator/./node_modules/balanced-match/index.js","../webpack://github-action-for-generator/./node_modules/bin-links/index.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/bin-target.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/check-bin.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/check-bins.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/fix-bin.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/get-node-modules.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/get-paths.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/get-prefix.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/is-windows.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/link-bin.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/link-bins.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/link-gently.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/link-mans.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/man-target.js","../webpack://github-action-for-generator/./node_modules/bin-links/lib/shim-bin.js","../webpack://github-action-for-generator/./node_modules/binary-extensions/index.js","../webpack://github-action-for-generator/./node_modules/brace-expansion/index.js","../webpack://github-action-for-generator/./node_modules/braces/index.js","../webpack://github-action-for-generator/./node_modules/braces/lib/compile.js","../webpack://github-action-for-generator/./node_modules/braces/lib/constants.js","../webpack://github-action-for-generator/./node_modules/braces/lib/expand.js","../webpack://github-action-for-generator/./node_modules/braces/lib/parse.js","../webpack://github-action-for-generator/./node_modules/braces/lib/stringify.js","../webpack://github-action-for-generator/./node_modules/braces/lib/utils.js","../webpack://github-action-for-generator/./node_modules/buffer-from/index.js","../webpack://github-action-for-generator/./node_modules/cacache/get.js","../webpack://github-action-for-generator/./node_modules/cacache/index.js","../webpack://github-action-for-generator/./node_modules/cacache/lib/content/path.js","../webpack://github-action-for-generator/./node_modules/cacache/lib/content/read.js","../webpack://github-action-for-generator/./node_modules/cacache/lib/content/rm.js","../webpack://github-action-for-generator/./node_modules/cacache/lib/content/write.js","../webpack://github-action-for-generator/./node_modules/cacache/lib/entry-index.js","../webpack://github-action-for-generator/./node_modules/cacache/lib/memoization.js","../webpack://github-action-for-generator/./node_modules/cacache/lib/util/disposer.js","../webpack://github-action-for-generator/./node_modules/cacache/lib/util/fix-owner.js","../webpack://github-action-for-generator/./node_modules/cacache/lib/util/hash-to-segments.js","../webpack://github-action-for-generator/./node_modules/cacache/lib/util/move-file.js","../webpack://github-action-for-generator/./node_modules/cacache/lib/util/tmp.js","../webpack://github-action-for-generator/./node_modules/cacache/lib/verify.js","../webpack://github-action-for-generator/./node_modules/cacache/ls.js","../webpack://github-action-for-generator/./node_modules/cacache/node_modules/p-map/index.js","../webpack://github-action-for-generator/./node_modules/cacache/put.js","../webpack://github-action-for-generator/./node_modules/cacache/rm.js","../webpack://github-action-for-generator/./node_modules/cacache/verify.js","../webpack://github-action-for-generator/./node_modules/call-me-maybe/index.js","../webpack://github-action-for-generator/./node_modules/chalk/index.js","../webpack://github-action-for-generator/./node_modules/chalk/templates.js","../webpack://github-action-for-generator/./node_modules/chokidar/index.js","../webpack://github-action-for-generator/./node_modules/chokidar/lib/constants.js","../webpack://github-action-for-generator/./node_modules/chokidar/lib/fsevents-handler.js","../webpack://github-action-for-generator/./node_modules/chokidar/lib/nodefs-handler.js","../webpack://github-action-for-generator/./node_modules/chokidar/node_modules/anymatch/index.js","../webpack://github-action-for-generator/./node_modules/chokidar/node_modules/fsevents/fsevents.js","../webpack://github-action-for-generator/./node_modules/chownr/chownr.js","../webpack://github-action-for-generator/./node_modules/clean-stack/index.js","../webpack://github-action-for-generator/./node_modules/cmd-shim/index.js","../webpack://github-action-for-generator/./node_modules/cmd-shim/lib/to-batch-syntax.js","../webpack://github-action-for-generator/./node_modules/co/index.js","../webpack://github-action-for-generator/./node_modules/color-convert/conversions.js","../webpack://github-action-for-generator/./node_modules/color-convert/index.js","../webpack://github-action-for-generator/./node_modules/color-convert/route.js","../webpack://github-action-for-generator/./node_modules/color-name/index.js","../webpack://github-action-for-generator/./node_modules/common-ancestor-path/index.js","../webpack://github-action-for-generator/./node_modules/concat-map/index.js","../webpack://github-action-for-generator/./node_modules/convert-source-map/index.js","../webpack://github-action-for-generator/./node_modules/create-require/create-require.js","../webpack://github-action-for-generator/./node_modules/debug/src/browser.js","../webpack://github-action-for-generator/./node_modules/debug/src/common.js","../webpack://github-action-for-generator/./node_modules/debug/src/index.js","../webpack://github-action-for-generator/./node_modules/debug/src/node.js","../webpack://github-action-for-generator/./node_modules/debuglog/debuglog.js","../webpack://github-action-for-generator/./node_modules/depd/index.js","../webpack://github-action-for-generator/./node_modules/depd/lib/compat/callsite-tostring.js","../webpack://github-action-for-generator/./node_modules/depd/lib/compat/event-listener-count.js","../webpack://github-action-for-generator/./node_modules/depd/lib/compat/index.js","../webpack://github-action-for-generator/./node_modules/dezalgo/dezalgo.js","../webpack://github-action-for-generator/./node_modules/diff/lib/convert/dmp.js","../webpack://github-action-for-generator/./node_modules/diff/lib/convert/xml.js","../webpack://github-action-for-generator/./node_modules/diff/lib/diff/array.js","../webpack://github-action-for-generator/./node_modules/diff/lib/diff/base.js","../webpack://github-action-for-generator/./node_modules/diff/lib/diff/character.js","../webpack://github-action-for-generator/./node_modules/diff/lib/diff/css.js","../webpack://github-action-for-generator/./node_modules/diff/lib/diff/json.js","../webpack://github-action-for-generator/./node_modules/diff/lib/diff/line.js","../webpack://github-action-for-generator/./node_modules/diff/lib/diff/sentence.js","../webpack://github-action-for-generator/./node_modules/diff/lib/diff/word.js","../webpack://github-action-for-generator/./node_modules/diff/lib/index.js","../webpack://github-action-for-generator/./node_modules/diff/lib/patch/apply.js","../webpack://github-action-for-generator/./node_modules/diff/lib/patch/create.js","../webpack://github-action-for-generator/./node_modules/diff/lib/patch/merge.js","../webpack://github-action-for-generator/./node_modules/diff/lib/patch/parse.js","../webpack://github-action-for-generator/./node_modules/diff/lib/util/array.js","../webpack://github-action-for-generator/./node_modules/diff/lib/util/distance-iterator.js","../webpack://github-action-for-generator/./node_modules/diff/lib/util/params.js","../webpack://github-action-for-generator/./node_modules/encoding/lib/encoding.js","../webpack://github-action-for-generator/./node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-codec.js","../webpack://github-action-for-generator/./node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-data.js","../webpack://github-action-for-generator/./node_modules/encoding/node_modules/iconv-lite/encodings/index.js","../webpack://github-action-for-generator/./node_modules/encoding/node_modules/iconv-lite/encodings/internal.js","../webpack://github-action-for-generator/./node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-codec.js","../webpack://github-action-for-generator/./node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js","../webpack://github-action-for-generator/./node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data.js","../webpack://github-action-for-generator/./node_modules/encoding/node_modules/iconv-lite/encodings/utf16.js","../webpack://github-action-for-generator/./node_modules/encoding/node_modules/iconv-lite/encodings/utf32.js","../webpack://github-action-for-generator/./node_modules/encoding/node_modules/iconv-lite/encodings/utf7.js","../webpack://github-action-for-generator/./node_modules/encoding/node_modules/iconv-lite/lib/bom-handling.js","../webpack://github-action-for-generator/./node_modules/encoding/node_modules/iconv-lite/lib/index.js","../webpack://github-action-for-generator/./node_modules/encoding/node_modules/iconv-lite/lib/streams.js","../webpack://github-action-for-generator/./node_modules/err-code/index.js","../webpack://github-action-for-generator/./node_modules/escape-string-regexp/index.js","../webpack://github-action-for-generator/./node_modules/fast-deep-equal/index.js","../webpack://github-action-for-generator/./node_modules/fast-json-stable-stringify/index.js","../webpack://github-action-for-generator/./node_modules/filename-reserved-regex/index.js","../webpack://github-action-for-generator/./node_modules/filenamify/filenamify-path.js","../webpack://github-action-for-generator/./node_modules/filenamify/filenamify.js","../webpack://github-action-for-generator/./node_modules/filenamify/index.js","../webpack://github-action-for-generator/./node_modules/fill-range/index.js","../webpack://github-action-for-generator/./node_modules/foreachasync/forEachAsync.js","../webpack://github-action-for-generator/./node_modules/fs-extra/lib/copy.js","../webpack://github-action-for-generator/./node_modules/fs-extra/lib/create.js","../webpack://github-action-for-generator/./node_modules/fs-extra/lib/index.js","../webpack://github-action-for-generator/./node_modules/fs-extra/lib/json.js","../webpack://github-action-for-generator/./node_modules/fs-extra/lib/mkdir.js","../webpack://github-action-for-generator/./node_modules/fs-extra/lib/output.js","../webpack://github-action-for-generator/./node_modules/fs-extra/lib/remove.js","../webpack://github-action-for-generator/./node_modules/fs-extra/node_modules/mkdirp/index.js","../webpack://github-action-for-generator/./node_modules/fs-extra/node_modules/rimraf/rimraf.js","../webpack://github-action-for-generator/./node_modules/fs-minipass/index.js","../webpack://github-action-for-generator/./node_modules/fs.extra/fs.copy-recursive.js","../webpack://github-action-for-generator/./node_modules/fs.extra/fs.copy.js","../webpack://github-action-for-generator/./node_modules/fs.extra/fs.extra.js","../webpack://github-action-for-generator/./node_modules/fs.extra/fs.move.js","../webpack://github-action-for-generator/./node_modules/fs.extra/node_modules/mkdirp/index.js","../webpack://github-action-for-generator/./node_modules/fs.realpath/index.js","../webpack://github-action-for-generator/./node_modules/fs.realpath/old.js","../webpack://github-action-for-generator/./node_modules/gensync/index.js","../webpack://github-action-for-generator/./node_modules/glob-parent/index.js","../webpack://github-action-for-generator/./node_modules/glob/common.js","../webpack://github-action-for-generator/./node_modules/glob/glob.js","../webpack://github-action-for-generator/./node_modules/glob/sync.js","../webpack://github-action-for-generator/./node_modules/global-dirs/index.js","../webpack://github-action-for-generator/./node_modules/global-dirs/node_modules/ini/ini.js","../webpack://github-action-for-generator/./node_modules/graceful-fs/clone.js","../webpack://github-action-for-generator/./node_modules/graceful-fs/graceful-fs.js","../webpack://github-action-for-generator/./node_modules/graceful-fs/legacy-streams.js","../webpack://github-action-for-generator/./node_modules/graceful-fs/polyfills.js","../webpack://github-action-for-generator/./node_modules/has-flag/index.js","../webpack://github-action-for-generator/./node_modules/hosted-git-info/git-host-info.js","../webpack://github-action-for-generator/./node_modules/hosted-git-info/git-host.js","../webpack://github-action-for-generator/./node_modules/hosted-git-info/index.js","../webpack://github-action-for-generator/./node_modules/http-cache-semantics/index.js","../webpack://github-action-for-generator/./node_modules/http-proxy-agent/dist/agent.js","../webpack://github-action-for-generator/./node_modules/http-proxy-agent/dist/index.js","../webpack://github-action-for-generator/./node_modules/https-proxy-agent/dist/agent.js","../webpack://github-action-for-generator/./node_modules/https-proxy-agent/dist/index.js","../webpack://github-action-for-generator/./node_modules/https-proxy-agent/dist/parse-proxy-response.js","../webpack://github-action-for-generator/./node_modules/humanize-ms/index.js","../webpack://github-action-for-generator/./node_modules/ignore-walk/index.js","../webpack://github-action-for-generator/./node_modules/imurmurhash/imurmurhash.js","../webpack://github-action-for-generator/./node_modules/infer-owner/index.js","../webpack://github-action-for-generator/./node_modules/inflight/inflight.js","../webpack://github-action-for-generator/./node_modules/inherits/inherits.js","../webpack://github-action-for-generator/./node_modules/inherits/inherits_browser.js","../webpack://github-action-for-generator/./node_modules/ip/lib/ip.js","../webpack://github-action-for-generator/./node_modules/is-binary-path/index.js","../webpack://github-action-for-generator/./node_modules/is-extglob/index.js","../webpack://github-action-for-generator/./node_modules/is-glob/index.js","../webpack://github-action-for-generator/./node_modules/is-lambda/index.js","../webpack://github-action-for-generator/./node_modules/is-number/index.js","../webpack://github-action-for-generator/./node_modules/is-typedarray/index.js","../webpack://github-action-for-generator/./node_modules/isexe/index.js","../webpack://github-action-for-generator/./node_modules/isexe/mode.js","../webpack://github-action-for-generator/./node_modules/isexe/windows.js","../webpack://github-action-for-generator/./node_modules/jmespath/jmespath.js","../webpack://github-action-for-generator/./node_modules/js-tokens/index.js","../webpack://github-action-for-generator/./node_modules/js-yaml/index.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/common.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/dumper.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/exception.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/loader.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/mark.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/schema.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/schema/core.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/schema/default_full.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/schema/default_safe.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/schema/failsafe.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/schema/json.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/binary.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/bool.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/float.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/int.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/js/function.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/js/regexp.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/js/undefined.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/map.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/merge.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/null.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/omap.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/pairs.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/seq.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/set.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/str.js","../webpack://github-action-for-generator/./node_modules/js-yaml/lib/js-yaml/type/timestamp.js","../webpack://github-action-for-generator/./node_modules/jsesc/jsesc.js","../webpack://github-action-for-generator/./node_modules/json-parse-even-better-errors/index.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/lib/index.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/$data.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/ajv.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/cache.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/compile/_rules.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/compile/async.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/compile/error_classes.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/compile/formats.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/compile/index.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/compile/resolve.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/compile/rules.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/compile/schema_obj.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/compile/ucs2length.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/compile/util.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/_limit.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/_limitItems.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/_limitLength.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/_limitProperties.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/allOf.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/anyOf.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/const.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/contains.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/custom.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/dependencies.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/enum.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/format.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/items.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/multipleOf.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/not.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/oneOf.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/pattern.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/properties.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/propertyNames.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/ref.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/required.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/uniqueItems.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/validate.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/keyword.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/ajv/lib/patternGroups.js","../webpack://github-action-for-generator/./node_modules/json-schema-migrate/node_modules/fast-deep-equal/index.js","../webpack://github-action-for-generator/./node_modules/json-schema-traverse/index.js","../webpack://github-action-for-generator/./node_modules/json-stringify-nice/index.js","../webpack://github-action-for-generator/./node_modules/json-to-ast/build.js","../webpack://github-action-for-generator/./node_modules/json5/lib/index.js","../webpack://github-action-for-generator/./node_modules/json5/lib/parse.js","../webpack://github-action-for-generator/./node_modules/json5/lib/stringify.js","../webpack://github-action-for-generator/./node_modules/json5/lib/unicode.js","../webpack://github-action-for-generator/./node_modules/json5/lib/util.js","../webpack://github-action-for-generator/./node_modules/jsonfile/lib/jsonfile.js","../webpack://github-action-for-generator/./node_modules/jsonparse/jsonparse.js","../webpack://github-action-for-generator/./node_modules/just-diff-apply/index.js","../webpack://github-action-for-generator/./node_modules/just-diff/index.js","../webpack://github-action-for-generator/./node_modules/levenshtein-edit-distance/index.js","../webpack://github-action-for-generator/./node_modules/lodash.clonedeep/index.js","../webpack://github-action-for-generator/./node_modules/lodash/_DataView.js","../webpack://github-action-for-generator/./node_modules/lodash/_Hash.js","../webpack://github-action-for-generator/./node_modules/lodash/_ListCache.js","../webpack://github-action-for-generator/./node_modules/lodash/_Map.js","../webpack://github-action-for-generator/./node_modules/lodash/_MapCache.js","../webpack://github-action-for-generator/./node_modules/lodash/_Promise.js","../webpack://github-action-for-generator/./node_modules/lodash/_Set.js","../webpack://github-action-for-generator/./node_modules/lodash/_SetCache.js","../webpack://github-action-for-generator/./node_modules/lodash/_Stack.js","../webpack://github-action-for-generator/./node_modules/lodash/_Symbol.js","../webpack://github-action-for-generator/./node_modules/lodash/_Uint8Array.js","../webpack://github-action-for-generator/./node_modules/lodash/_WeakMap.js","../webpack://github-action-for-generator/./node_modules/lodash/_apply.js","../webpack://github-action-for-generator/./node_modules/lodash/_arrayEach.js","../webpack://github-action-for-generator/./node_modules/lodash/_arrayFilter.js","../webpack://github-action-for-generator/./node_modules/lodash/_arrayLikeKeys.js","../webpack://github-action-for-generator/./node_modules/lodash/_arrayMap.js","../webpack://github-action-for-generator/./node_modules/lodash/_arrayPush.js","../webpack://github-action-for-generator/./node_modules/lodash/_arraySome.js","../webpack://github-action-for-generator/./node_modules/lodash/_assignValue.js","../webpack://github-action-for-generator/./node_modules/lodash/_assocIndexOf.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseAssign.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseAssignIn.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseAssignValue.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseClone.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseCreate.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseEach.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseFlatten.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseFor.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseForOwn.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseGet.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseGetAllKeys.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseGetTag.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseHasIn.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseIsArguments.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseIsEqual.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseIsEqualDeep.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseIsMap.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseIsMatch.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseIsNative.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseIsRegExp.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseIsSet.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseIsTypedArray.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseIteratee.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseKeys.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseKeysIn.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseMap.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseMatches.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseMatchesProperty.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseOrderBy.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseProperty.js","../webpack://github-action-for-generator/./node_modules/lodash/_basePropertyDeep.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseRest.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseSetToString.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseSlice.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseSortBy.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseTimes.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseToString.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseTrim.js","../webpack://github-action-for-generator/./node_modules/lodash/_baseUnary.js","../webpack://github-action-for-generator/./node_modules/lodash/_cacheHas.js","../webpack://github-action-for-generator/./node_modules/lodash/_castPath.js","../webpack://github-action-for-generator/./node_modules/lodash/_cloneArrayBuffer.js","../webpack://github-action-for-generator/./node_modules/lodash/_cloneBuffer.js","../webpack://github-action-for-generator/./node_modules/lodash/_cloneDataView.js","../webpack://github-action-for-generator/./node_modules/lodash/_cloneRegExp.js","../webpack://github-action-for-generator/./node_modules/lodash/_cloneSymbol.js","../webpack://github-action-for-generator/./node_modules/lodash/_cloneTypedArray.js","../webpack://github-action-for-generator/./node_modules/lodash/_compareAscending.js","../webpack://github-action-for-generator/./node_modules/lodash/_compareMultiple.js","../webpack://github-action-for-generator/./node_modules/lodash/_copyArray.js","../webpack://github-action-for-generator/./node_modules/lodash/_copyObject.js","../webpack://github-action-for-generator/./node_modules/lodash/_copySymbols.js","../webpack://github-action-for-generator/./node_modules/lodash/_copySymbolsIn.js","../webpack://github-action-for-generator/./node_modules/lodash/_coreJsData.js","../webpack://github-action-for-generator/./node_modules/lodash/_createBaseEach.js","../webpack://github-action-for-generator/./node_modules/lodash/_createBaseFor.js","../webpack://github-action-for-generator/./node_modules/lodash/_defineProperty.js","../webpack://github-action-for-generator/./node_modules/lodash/_equalArrays.js","../webpack://github-action-for-generator/./node_modules/lodash/_equalByTag.js","../webpack://github-action-for-generator/./node_modules/lodash/_equalObjects.js","../webpack://github-action-for-generator/./node_modules/lodash/_freeGlobal.js","../webpack://github-action-for-generator/./node_modules/lodash/_getAllKeys.js","../webpack://github-action-for-generator/./node_modules/lodash/_getAllKeysIn.js","../webpack://github-action-for-generator/./node_modules/lodash/_getMapData.js","../webpack://github-action-for-generator/./node_modules/lodash/_getMatchData.js","../webpack://github-action-for-generator/./node_modules/lodash/_getNative.js","../webpack://github-action-for-generator/./node_modules/lodash/_getPrototype.js","../webpack://github-action-for-generator/./node_modules/lodash/_getRawTag.js","../webpack://github-action-for-generator/./node_modules/lodash/_getSymbols.js","../webpack://github-action-for-generator/./node_modules/lodash/_getSymbolsIn.js","../webpack://github-action-for-generator/./node_modules/lodash/_getTag.js","../webpack://github-action-for-generator/./node_modules/lodash/_getValue.js","../webpack://github-action-for-generator/./node_modules/lodash/_hasPath.js","../webpack://github-action-for-generator/./node_modules/lodash/_hashClear.js","../webpack://github-action-for-generator/./node_modules/lodash/_hashDelete.js","../webpack://github-action-for-generator/./node_modules/lodash/_hashGet.js","../webpack://github-action-for-generator/./node_modules/lodash/_hashHas.js","../webpack://github-action-for-generator/./node_modules/lodash/_hashSet.js","../webpack://github-action-for-generator/./node_modules/lodash/_initCloneArray.js","../webpack://github-action-for-generator/./node_modules/lodash/_initCloneByTag.js","../webpack://github-action-for-generator/./node_modules/lodash/_initCloneObject.js","../webpack://github-action-for-generator/./node_modules/lodash/_isFlattenable.js","../webpack://github-action-for-generator/./node_modules/lodash/_isIndex.js","../webpack://github-action-for-generator/./node_modules/lodash/_isIterateeCall.js","../webpack://github-action-for-generator/./node_modules/lodash/_isKey.js","../webpack://github-action-for-generator/./node_modules/lodash/_isKeyable.js","../webpack://github-action-for-generator/./node_modules/lodash/_isMasked.js","../webpack://github-action-for-generator/./node_modules/lodash/_isPrototype.js","../webpack://github-action-for-generator/./node_modules/lodash/_isStrictComparable.js","../webpack://github-action-for-generator/./node_modules/lodash/_listCacheClear.js","../webpack://github-action-for-generator/./node_modules/lodash/_listCacheDelete.js","../webpack://github-action-for-generator/./node_modules/lodash/_listCacheGet.js","../webpack://github-action-for-generator/./node_modules/lodash/_listCacheHas.js","../webpack://github-action-for-generator/./node_modules/lodash/_listCacheSet.js","../webpack://github-action-for-generator/./node_modules/lodash/_mapCacheClear.js","../webpack://github-action-for-generator/./node_modules/lodash/_mapCacheDelete.js","../webpack://github-action-for-generator/./node_modules/lodash/_mapCacheGet.js","../webpack://github-action-for-generator/./node_modules/lodash/_mapCacheHas.js","../webpack://github-action-for-generator/./node_modules/lodash/_mapCacheSet.js","../webpack://github-action-for-generator/./node_modules/lodash/_mapToArray.js","../webpack://github-action-for-generator/./node_modules/lodash/_matchesStrictComparable.js","../webpack://github-action-for-generator/./node_modules/lodash/_memoizeCapped.js","../webpack://github-action-for-generator/./node_modules/lodash/_nativeCreate.js","../webpack://github-action-for-generator/./node_modules/lodash/_nativeKeys.js","../webpack://github-action-for-generator/./node_modules/lodash/_nativeKeysIn.js","../webpack://github-action-for-generator/./node_modules/lodash/_nodeUtil.js","../webpack://github-action-for-generator/./node_modules/lodash/_objectToString.js","../webpack://github-action-for-generator/./node_modules/lodash/_overArg.js","../webpack://github-action-for-generator/./node_modules/lodash/_overRest.js","../webpack://github-action-for-generator/./node_modules/lodash/_root.js","../webpack://github-action-for-generator/./node_modules/lodash/_setCacheAdd.js","../webpack://github-action-for-generator/./node_modules/lodash/_setCacheHas.js","../webpack://github-action-for-generator/./node_modules/lodash/_setToArray.js","../webpack://github-action-for-generator/./node_modules/lodash/_setToString.js","../webpack://github-action-for-generator/./node_modules/lodash/_shortOut.js","../webpack://github-action-for-generator/./node_modules/lodash/_stackClear.js","../webpack://github-action-for-generator/./node_modules/lodash/_stackDelete.js","../webpack://github-action-for-generator/./node_modules/lodash/_stackGet.js","../webpack://github-action-for-generator/./node_modules/lodash/_stackHas.js","../webpack://github-action-for-generator/./node_modules/lodash/_stackSet.js","../webpack://github-action-for-generator/./node_modules/lodash/_stringToPath.js","../webpack://github-action-for-generator/./node_modules/lodash/_toKey.js","../webpack://github-action-for-generator/./node_modules/lodash/_toSource.js","../webpack://github-action-for-generator/./node_modules/lodash/_trimmedEndIndex.js","../webpack://github-action-for-generator/./node_modules/lodash/chunk.js","../webpack://github-action-for-generator/./node_modules/lodash/clone.js","../webpack://github-action-for-generator/./node_modules/lodash/cloneDeep.js","../webpack://github-action-for-generator/./node_modules/lodash/constant.js","../webpack://github-action-for-generator/./node_modules/lodash/eq.js","../webpack://github-action-for-generator/./node_modules/lodash/escapeRegExp.js","../webpack://github-action-for-generator/./node_modules/lodash/get.js","../webpack://github-action-for-generator/./node_modules/lodash/hasIn.js","../webpack://github-action-for-generator/./node_modules/lodash/identity.js","../webpack://github-action-for-generator/./node_modules/lodash/isArguments.js","../webpack://github-action-for-generator/./node_modules/lodash/isArray.js","../webpack://github-action-for-generator/./node_modules/lodash/isArrayLike.js","../webpack://github-action-for-generator/./node_modules/lodash/isBuffer.js","../webpack://github-action-for-generator/./node_modules/lodash/isFunction.js","../webpack://github-action-for-generator/./node_modules/lodash/isLength.js","../webpack://github-action-for-generator/./node_modules/lodash/isMap.js","../webpack://github-action-for-generator/./node_modules/lodash/isObject.js","../webpack://github-action-for-generator/./node_modules/lodash/isObjectLike.js","../webpack://github-action-for-generator/./node_modules/lodash/isPlainObject.js","../webpack://github-action-for-generator/./node_modules/lodash/isRegExp.js","../webpack://github-action-for-generator/./node_modules/lodash/isSet.js","../webpack://github-action-for-generator/./node_modules/lodash/isSymbol.js","../webpack://github-action-for-generator/./node_modules/lodash/isTypedArray.js","../webpack://github-action-for-generator/./node_modules/lodash/keys.js","../webpack://github-action-for-generator/./node_modules/lodash/keysIn.js","../webpack://github-action-for-generator/./node_modules/lodash/memoize.js","../webpack://github-action-for-generator/./node_modules/lodash/property.js","../webpack://github-action-for-generator/./node_modules/lodash/sortBy.js","../webpack://github-action-for-generator/./node_modules/lodash/stubArray.js","../webpack://github-action-for-generator/./node_modules/lodash/stubFalse.js","../webpack://github-action-for-generator/./node_modules/lodash/toFinite.js","../webpack://github-action-for-generator/./node_modules/lodash/toInteger.js","../webpack://github-action-for-generator/./node_modules/lodash/toNumber.js","../webpack://github-action-for-generator/./node_modules/lodash/toString.js","../webpack://github-action-for-generator/./node_modules/loglevel/lib/loglevel.js","../webpack://github-action-for-generator/./node_modules/lru-cache/index.js","../webpack://github-action-for-generator/./node_modules/make-error/index.js","../webpack://github-action-for-generator/./node_modules/make-fetch-happen/lib/agent.js","../webpack://github-action-for-generator/./node_modules/make-fetch-happen/lib/cache/entry.js","../webpack://github-action-for-generator/./node_modules/make-fetch-happen/lib/cache/errors.js","../webpack://github-action-for-generator/./node_modules/make-fetch-happen/lib/cache/index.js","../webpack://github-action-for-generator/./node_modules/make-fetch-happen/lib/cache/key.js","../webpack://github-action-for-generator/./node_modules/make-fetch-happen/lib/cache/policy.js","../webpack://github-action-for-generator/./node_modules/make-fetch-happen/lib/fetch.js","../webpack://github-action-for-generator/./node_modules/make-fetch-happen/lib/index.js","../webpack://github-action-for-generator/./node_modules/make-fetch-happen/lib/options.js","../webpack://github-action-for-generator/./node_modules/make-fetch-happen/lib/remote.js","../webpack://github-action-for-generator/./node_modules/minimatch/minimatch.js","../webpack://github-action-for-generator/./node_modules/minipass-collect/index.js","../webpack://github-action-for-generator/./node_modules/minipass-fetch/lib/abort-error.js","../webpack://github-action-for-generator/./node_modules/minipass-fetch/lib/blob.js","../webpack://github-action-for-generator/./node_modules/minipass-fetch/lib/body.js","../webpack://github-action-for-generator/./node_modules/minipass-fetch/lib/fetch-error.js","../webpack://github-action-for-generator/./node_modules/minipass-fetch/lib/headers.js","../webpack://github-action-for-generator/./node_modules/minipass-fetch/lib/index.js","../webpack://github-action-for-generator/./node_modules/minipass-fetch/lib/request.js","../webpack://github-action-for-generator/./node_modules/minipass-fetch/lib/response.js","../webpack://github-action-for-generator/./node_modules/minipass-flush/index.js","../webpack://github-action-for-generator/./node_modules/minipass-json-stream/index.js","../webpack://github-action-for-generator/./node_modules/minipass-pipeline/index.js","../webpack://github-action-for-generator/./node_modules/minipass-sized/index.js","../webpack://github-action-for-generator/./node_modules/minipass/index.js","../webpack://github-action-for-generator/./node_modules/minizlib/constants.js","../webpack://github-action-for-generator/./node_modules/minizlib/index.js","../webpack://github-action-for-generator/./node_modules/mkdirp-infer-owner/index.js","../webpack://github-action-for-generator/./node_modules/mkdirp/index.js","../webpack://github-action-for-generator/./node_modules/mkdirp/lib/find-made.js","../webpack://github-action-for-generator/./node_modules/mkdirp/lib/mkdirp-manual.js","../webpack://github-action-for-generator/./node_modules/mkdirp/lib/mkdirp-native.js","../webpack://github-action-for-generator/./node_modules/mkdirp/lib/opts-arg.js","../webpack://github-action-for-generator/./node_modules/mkdirp/lib/path-arg.js","../webpack://github-action-for-generator/./node_modules/mkdirp/lib/use-native.js","../webpack://github-action-for-generator/./node_modules/ms/index.js","../webpack://github-action-for-generator/./node_modules/ncp/lib/ncp.js","../webpack://github-action-for-generator/./node_modules/negotiator/index.js","../webpack://github-action-for-generator/./node_modules/negotiator/lib/charset.js","../webpack://github-action-for-generator/./node_modules/negotiator/lib/encoding.js","../webpack://github-action-for-generator/./node_modules/negotiator/lib/language.js","../webpack://github-action-for-generator/./node_modules/negotiator/lib/mediaType.js","../webpack://github-action-for-generator/./node_modules/node-fetch/lib/index.js","../webpack://github-action-for-generator/./node_modules/normalize-path/index.js","../webpack://github-action-for-generator/./node_modules/npm-bundled/index.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/index.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/classes/comparator.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/classes/range.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/classes/semver.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/clean.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/cmp.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/coerce.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/compare-build.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/compare-loose.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/compare.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/diff.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/eq.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/gt.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/gte.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/inc.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/lt.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/lte.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/major.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/minor.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/neq.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/parse.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/patch.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/prerelease.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/rcompare.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/rsort.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/satisfies.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/sort.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/functions/valid.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/index.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/internal/constants.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/internal/debug.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/internal/identifiers.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/internal/parse-options.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/internal/re.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/ranges/gtr.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/ranges/intersects.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/ranges/ltr.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/ranges/max-satisfying.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/ranges/min-satisfying.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/ranges/min-version.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/ranges/outside.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/ranges/simplify.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/ranges/subset.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/ranges/to-comparators.js","../webpack://github-action-for-generator/./node_modules/npm-install-checks/node_modules/semver/ranges/valid.js","../webpack://github-action-for-generator/./node_modules/npm-normalize-package-bin/index.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/classes/comparator.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/classes/range.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/classes/semver.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/clean.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/cmp.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/coerce.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/compare-build.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/compare-loose.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/compare.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/diff.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/eq.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/gt.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/gte.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/inc.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/lt.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/lte.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/major.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/minor.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/neq.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/parse.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/patch.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/prerelease.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/rcompare.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/rsort.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/satisfies.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/sort.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/functions/valid.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/index.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/internal/constants.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/internal/debug.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/internal/identifiers.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/internal/parse-options.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/internal/re.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/ranges/gtr.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/ranges/intersects.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/ranges/ltr.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/ranges/max-satisfying.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/ranges/min-satisfying.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/ranges/min-version.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/ranges/outside.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/ranges/simplify.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/ranges/subset.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/ranges/to-comparators.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/node_modules/semver/ranges/valid.js","../webpack://github-action-for-generator/./node_modules/npm-package-arg/npa.js","../webpack://github-action-for-generator/./node_modules/npm-packlist/index.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/index.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/classes/comparator.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/classes/range.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/classes/semver.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/clean.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/cmp.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/coerce.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/compare-build.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/compare-loose.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/compare.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/diff.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/eq.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/gt.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/gte.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/inc.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/lt.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/lte.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/major.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/minor.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/neq.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/parse.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/patch.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/prerelease.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/rcompare.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/rsort.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/satisfies.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/sort.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/functions/valid.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/index.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/internal/constants.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/internal/debug.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/internal/identifiers.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/internal/parse-options.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/internal/re.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/ranges/gtr.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/ranges/intersects.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/ranges/ltr.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/ranges/max-satisfying.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/ranges/min-satisfying.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/ranges/min-version.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/ranges/outside.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/ranges/simplify.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/ranges/subset.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/ranges/to-comparators.js","../webpack://github-action-for-generator/./node_modules/npm-pick-manifest/node_modules/semver/ranges/valid.js","../webpack://github-action-for-generator/./node_modules/npm-registry-fetch/auth.js","../webpack://github-action-for-generator/./node_modules/npm-registry-fetch/check-response.js","../webpack://github-action-for-generator/./node_modules/npm-registry-fetch/default-opts.js","../webpack://github-action-for-generator/./node_modules/npm-registry-fetch/errors.js","../webpack://github-action-for-generator/./node_modules/npm-registry-fetch/index.js","../webpack://github-action-for-generator/./node_modules/npm-registry-fetch/silentlog.js","../webpack://github-action-for-generator/./node_modules/nunjucks/index.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/compiler.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/environment.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/express-app.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/filters.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/globals.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/jinja-compat.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/lexer.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/lib.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/loader.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/loaders.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/node-loaders.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/nodes.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/object.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/parser.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/precompile-global.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/precompile.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/precompiled-loader.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/runtime.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/tests.js","../webpack://github-action-for-generator/./node_modules/nunjucks/src/transformer.js","../webpack://github-action-for-generator/./node_modules/object-assign/index.js","../webpack://github-action-for-generator/./node_modules/once/once.js","../webpack://github-action-for-generator/./node_modules/pacote/lib/dir.js","../webpack://github-action-for-generator/./node_modules/pacote/lib/fetcher.js","../webpack://github-action-for-generator/./node_modules/pacote/lib/file.js","../webpack://github-action-for-generator/./node_modules/pacote/lib/git.js","../webpack://github-action-for-generator/./node_modules/pacote/lib/index.js","../webpack://github-action-for-generator/./node_modules/pacote/lib/registry.js","../webpack://github-action-for-generator/./node_modules/pacote/lib/remote.js","../webpack://github-action-for-generator/./node_modules/pacote/lib/util/add-git-sha.js","../webpack://github-action-for-generator/./node_modules/pacote/lib/util/cache-dir.js","../webpack://github-action-for-generator/./node_modules/pacote/lib/util/is-package-bin.js","../webpack://github-action-for-generator/./node_modules/pacote/lib/util/npm.js","../webpack://github-action-for-generator/./node_modules/pacote/lib/util/proc-log.js","../webpack://github-action-for-generator/./node_modules/pacote/lib/util/tar-create-options.js","../webpack://github-action-for-generator/./node_modules/parse-conflict-json/index.js","../webpack://github-action-for-generator/./node_modules/path-is-absolute/index.js","../webpack://github-action-for-generator/./node_modules/path-parse/index.js","../webpack://github-action-for-generator/./node_modules/picomatch/index.js","../webpack://github-action-for-generator/./node_modules/picomatch/lib/constants.js","../webpack://github-action-for-generator/./node_modules/picomatch/lib/parse.js","../webpack://github-action-for-generator/./node_modules/picomatch/lib/picomatch.js","../webpack://github-action-for-generator/./node_modules/picomatch/lib/scan.js","../webpack://github-action-for-generator/./node_modules/picomatch/lib/utils.js","../webpack://github-action-for-generator/./node_modules/proc-log/index.js","../webpack://github-action-for-generator/./node_modules/promise-all-reject-late/index.js","../webpack://github-action-for-generator/./node_modules/promise-call-limit/index.js","../webpack://github-action-for-generator/./node_modules/promise-inflight/inflight.js","../webpack://github-action-for-generator/./node_modules/promise-retry/index.js","../webpack://github-action-for-generator/./node_modules/prop-types/checkPropTypes.js","../webpack://github-action-for-generator/./node_modules/prop-types/factoryWithThrowingShims.js","../webpack://github-action-for-generator/./node_modules/prop-types/factoryWithTypeCheckers.js","../webpack://github-action-for-generator/./node_modules/prop-types/index.js","../webpack://github-action-for-generator/./node_modules/prop-types/lib/ReactPropTypesSecret.js","../webpack://github-action-for-generator/./node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js","../webpack://github-action-for-generator/./node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js","../webpack://github-action-for-generator/./node_modules/prop-types/node_modules/react-is/index.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/index.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/common.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/dumper.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/exception.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/loader.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/mark.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/core.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/default_full.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/json.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/binary.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/bool.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/float.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/int.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/js/function.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/map.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/merge.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/null.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/omap.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/pairs.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/seq.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/set.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/str.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/timestamp.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/src/dt2js.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/src/index.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/src/js2dt.js","../webpack://github-action-for-generator/./node_modules/ramldt2jsonschema/src/utils.js","../webpack://github-action-for-generator/./node_modules/react/cjs/react-jsx-runtime.development.js","../webpack://github-action-for-generator/./node_modules/react/cjs/react-jsx-runtime.production.min.js","../webpack://github-action-for-generator/./node_modules/react/cjs/react.development.js","../webpack://github-action-for-generator/./node_modules/react/cjs/react.production.min.js","../webpack://github-action-for-generator/./node_modules/react/index.js","../webpack://github-action-for-generator/./node_modules/react/jsx-runtime.js","../webpack://github-action-for-generator/./node_modules/read-cmd-shim/index.js","../webpack://github-action-for-generator/./node_modules/read-package-json-fast/index.js","../webpack://github-action-for-generator/./node_modules/readdir-scoped-modules/readdir.js","../webpack://github-action-for-generator/./node_modules/readdirp/index.js","../webpack://github-action-for-generator/./node_modules/resolve-from/index.js","../webpack://github-action-for-generator/./node_modules/resolve-pkg/index.js","../webpack://github-action-for-generator/./node_modules/resolve/index.js","../webpack://github-action-for-generator/./node_modules/resolve/lib/async.js","../webpack://github-action-for-generator/./node_modules/resolve/lib/caller.js","../webpack://github-action-for-generator/./node_modules/resolve/lib/core.js","../webpack://github-action-for-generator/./node_modules/resolve/lib/is-core.js","../webpack://github-action-for-generator/./node_modules/resolve/lib/node-modules-paths.js","../webpack://github-action-for-generator/./node_modules/resolve/lib/normalize-options.js","../webpack://github-action-for-generator/./node_modules/resolve/lib/sync.js","../webpack://github-action-for-generator/./node_modules/retry/index.js","../webpack://github-action-for-generator/./node_modules/retry/lib/retry.js","../webpack://github-action-for-generator/./node_modules/retry/lib/retry_operation.js","../webpack://github-action-for-generator/./node_modules/rimraf/rimraf.js","../webpack://github-action-for-generator/./node_modules/rollup/dist/rollup.js","../webpack://github-action-for-generator/./node_modules/rollup/dist/shared/index.js","../webpack://github-action-for-generator/./node_modules/rollup/dist/shared/mergeOptions.js","../webpack://github-action-for-generator/./node_modules/rollup/dist/shared/rollup.js","../webpack://github-action-for-generator/./node_modules/rollup/dist/shared/watch.js","../webpack://github-action-for-generator/./node_modules/rollup/node_modules/fsevents/fsevents.js","../webpack://github-action-for-generator/./node_modules/safe-buffer/index.js","../webpack://github-action-for-generator/./node_modules/safer-buffer/safer.js","../webpack://github-action-for-generator/./node_modules/semver/semver.js","../webpack://github-action-for-generator/./node_modules/signal-exit/index.js","../webpack://github-action-for-generator/./node_modules/signal-exit/signals.js","../webpack://github-action-for-generator/./node_modules/simple-git/promise.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/git.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/index.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/responses/BranchDeleteSummary.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/responses/BranchSummary.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/responses/CommitSummary.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/responses/DiffSummary.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/responses/FetchSummary.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/responses/FileStatusSummary.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/responses/ListLogSummary.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/responses/MergeSummary.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/responses/MoveSummary.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/responses/PullSummary.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/responses/StatusSummary.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/responses/TagList.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/responses/index.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/util/deferred.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/util/dependencies.js","../webpack://github-action-for-generator/./node_modules/simple-git/src/util/exists.js","../webpack://github-action-for-generator/./node_modules/smart-buffer/build/smartbuffer.js","../webpack://github-action-for-generator/./node_modules/smart-buffer/build/utils.js","../webpack://github-action-for-generator/./node_modules/socks-proxy-agent/dist/agent.js","../webpack://github-action-for-generator/./node_modules/socks-proxy-agent/dist/index.js","../webpack://github-action-for-generator/./node_modules/socks-proxy-agent/node_modules/agent-base/dist/src/index.js","../webpack://github-action-for-generator/./node_modules/socks-proxy-agent/node_modules/agent-base/dist/src/promisify.js","../webpack://github-action-for-generator/./node_modules/socks/build/client/socksclient.js","../webpack://github-action-for-generator/./node_modules/socks/build/common/constants.js","../webpack://github-action-for-generator/./node_modules/socks/build/common/helpers.js","../webpack://github-action-for-generator/./node_modules/socks/build/common/receivebuffer.js","../webpack://github-action-for-generator/./node_modules/socks/build/common/util.js","../webpack://github-action-for-generator/./node_modules/socks/build/index.js","../webpack://github-action-for-generator/./node_modules/source-map-support/source-map-support.js","../webpack://github-action-for-generator/./node_modules/source-map/lib/array-set.js","../webpack://github-action-for-generator/./node_modules/source-map/lib/base64-vlq.js","../webpack://github-action-for-generator/./node_modules/source-map/lib/base64.js","../webpack://github-action-for-generator/./node_modules/source-map/lib/binary-search.js","../webpack://github-action-for-generator/./node_modules/source-map/lib/mapping-list.js","../webpack://github-action-for-generator/./node_modules/source-map/lib/quick-sort.js","../webpack://github-action-for-generator/./node_modules/source-map/lib/source-map-consumer.js","../webpack://github-action-for-generator/./node_modules/source-map/lib/source-map-generator.js","../webpack://github-action-for-generator/./node_modules/source-map/lib/source-node.js","../webpack://github-action-for-generator/./node_modules/source-map/lib/util.js","../webpack://github-action-for-generator/./node_modules/source-map/source-map.js","../webpack://github-action-for-generator/./node_modules/ssri/index.js","../webpack://github-action-for-generator/./node_modules/strip-outer/index.js","../webpack://github-action-for-generator/./node_modules/supports-color/index.js","../webpack://github-action-for-generator/./node_modules/tar/index.js","../webpack://github-action-for-generator/./node_modules/tar/lib/create.js","../webpack://github-action-for-generator/./node_modules/tar/lib/extract.js","../webpack://github-action-for-generator/./node_modules/tar/lib/get-write-flag.js","../webpack://github-action-for-generator/./node_modules/tar/lib/header.js","../webpack://github-action-for-generator/./node_modules/tar/lib/high-level-opt.js","../webpack://github-action-for-generator/./node_modules/tar/lib/large-numbers.js","../webpack://github-action-for-generator/./node_modules/tar/lib/list.js","../webpack://github-action-for-generator/./node_modules/tar/lib/mkdir.js","../webpack://github-action-for-generator/./node_modules/tar/lib/mode-fix.js","../webpack://github-action-for-generator/./node_modules/tar/lib/pack.js","../webpack://github-action-for-generator/./node_modules/tar/lib/parse.js","../webpack://github-action-for-generator/./node_modules/tar/lib/path-reservations.js","../webpack://github-action-for-generator/./node_modules/tar/lib/pax.js","../webpack://github-action-for-generator/./node_modules/tar/lib/read-entry.js","../webpack://github-action-for-generator/./node_modules/tar/lib/replace.js","../webpack://github-action-for-generator/./node_modules/tar/lib/types.js","../webpack://github-action-for-generator/./node_modules/tar/lib/unpack.js","../webpack://github-action-for-generator/./node_modules/tar/lib/update.js","../webpack://github-action-for-generator/./node_modules/tar/lib/warn-mixin.js","../webpack://github-action-for-generator/./node_modules/tar/lib/winchars.js","../webpack://github-action-for-generator/./node_modules/tar/lib/write-entry.js","../webpack://github-action-for-generator/./node_modules/tiny-merge-patch/cjs/index.js","../webpack://github-action-for-generator/./node_modules/to-fast-properties/index.js","../webpack://github-action-for-generator/./node_modules/to-regex-range/index.js","../webpack://github-action-for-generator/./node_modules/treeverse/index.js","../webpack://github-action-for-generator/./node_modules/treeverse/lib/breadth.js","../webpack://github-action-for-generator/./node_modules/treeverse/lib/depth-descent.js","../webpack://github-action-for-generator/./node_modules/treeverse/lib/depth.js","../webpack://github-action-for-generator/./node_modules/trim-repeated/index.js","../webpack://github-action-for-generator/./node_modules/ts-node/dist-raw/node-cjs-loader-utils.js","../webpack://github-action-for-generator/./node_modules/ts-node/dist-raw/node-internal-fs.js","../webpack://github-action-for-generator/./node_modules/ts-node/dist-raw/node-options.js","../webpack://github-action-for-generator/./node_modules/ts-node/dist-raw/node-package-json-reader.js","../webpack://github-action-for-generator/./node_modules/ts-node/dist-raw/node-primordials.js","../webpack://github-action-for-generator/./node_modules/ts-node/dist/index.js","../webpack://github-action-for-generator/./node_modules/ts-node/dist/repl.js","../webpack://github-action-for-generator/./node_modules/typedarray-to-buffer/index.js","../webpack://github-action-for-generator/./node_modules/unique-filename/index.js","../webpack://github-action-for-generator/./node_modules/unique-slug/index.js","../webpack://github-action-for-generator/./node_modules/uri-js/dist/es5/uri.all.js","../webpack://github-action-for-generator/./node_modules/validate-npm-package-name/index.js","../webpack://github-action-for-generator/./node_modules/walk-up-path/index.js","../webpack://github-action-for-generator/./node_modules/walk/lib/node-type-emitter.js","../webpack://github-action-for-generator/./node_modules/walk/lib/walk.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/ajv.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/cache.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/compile/async.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/compile/error_classes.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/compile/formats.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/compile/index.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/compile/resolve.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/compile/rules.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/compile/schema_obj.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/compile/ucs2length.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/compile/util.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/data.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/_limit.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/_limitItems.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/_limitLength.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/_limitProperties.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/allOf.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/anyOf.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/comment.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/const.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/contains.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/custom.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/dependencies.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/enum.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/format.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/if.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/index.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/items.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/multipleOf.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/not.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/oneOf.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/pattern.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/properties.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/propertyNames.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/ref.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/required.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/uniqueItems.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/dotjs/validate.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/ajv/lib/keyword.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/fast-deep-equal/index.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/node_modules/json-schema-traverse/index.js","../webpack://github-action-for-generator/./node_modules/webapi-parser/webapi-parser.js","../webpack://github-action-for-generator/./node_modules/wrappy/wrappy.js","../webpack://github-action-for-generator/./node_modules/write-file-atomic/index.js","../webpack://github-action-for-generator/./node_modules/yallist/iterator.js","../webpack://github-action-for-generator/./node_modules/yallist/yallist.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/common.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/dumper.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/exception.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/index.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/loader.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/mark.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/scalarInference.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/schema.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/schema/core.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/schema/default_full.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/schema/default_safe.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/schema/failsafe.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/schema/json.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/binary.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/bool.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/float.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/int.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/js/regexp.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/js/undefined.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/map.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/merge.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/null.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/omap.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/pairs.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/seq.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/set.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/str.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/type/timestamp.js","../webpack://github-action-for-generator/./node_modules/yaml-ast-parser/dist/src/yamlAST.js","../webpack://github-action-for-generator/./node_modules/yn/index.js","../webpack://github-action-for-generator/./node_modules/yn/lenient.js","../webpack://github-action-for-generator/./node_modules/chokidar/node_modules/fsevents/fsevents.node","../webpack://github-action-for-generator/./node_modules/rollup/node_modules/fsevents/fsevents.node","../webpack://github-action-for-generator/./node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack://github-action-for-generator/external \"@npmcli/run-script\"","../webpack://github-action-for-generator/external \"assert\"","../webpack://github-action-for-generator/external \"buffer\"","../webpack://github-action-for-generator/external \"child_process\"","../webpack://github-action-for-generator/external \"console\"","../webpack://github-action-for-generator/external \"constants\"","../webpack://github-action-for-generator/external \"crypto\"","../webpack://github-action-for-generator/external \"dns\"","../webpack://github-action-for-generator/external \"domain\"","../webpack://github-action-for-generator/external \"events\"","../webpack://github-action-for-generator/external \"fs\"","../webpack://github-action-for-generator/external \"http\"","../webpack://github-action-for-generator/external \"https\"","../webpack://github-action-for-generator/external \"module\"","../webpack://github-action-for-generator/external \"net\"","../webpack://github-action-for-generator/external \"os\"","../webpack://github-action-for-generator/external \"path\"","../webpack://github-action-for-generator/external \"querystring\"","../webpack://github-action-for-generator/external \"repl\"","../webpack://github-action-for-generator/external \"stream\"","../webpack://github-action-for-generator/external \"string_decoder\"","../webpack://github-action-for-generator/external \"tls\"","../webpack://github-action-for-generator/external \"tty\"","../webpack://github-action-for-generator/external \"url\"","../webpack://github-action-for-generator/external \"util\"","../webpack://github-action-for-generator/external \"vm\"","../webpack://github-action-for-generator/external \"worker_threads\"","../webpack://github-action-for-generator/external \"zlib\"","../webpack://github-action-for-generator/webpack/bootstrap","../webpack://github-action-for-generator/webpack/runtime/hasOwnProperty shorthand","../webpack://github-action-for-generator/webpack/runtime/node module decorator","../webpack://github-action-for-generator/webpack/runtime/compat","../webpack://github-action-for-generator/./lib/index.js"],"sourcesContent":["function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(() => {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = () => ([]);\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = 74884;\nmodule.exports = webpackEmptyAsyncContext;","const fs = require('fs');\n\nconst paramParser = function(input) {\n const params = {};\n \n if (!input) return params;\n if (!input.includes('=')) throw new Error(`Invalid param ${input}. It must be in the format of name=value.`);\n \n input.split(' ').forEach(el => {\n const chunks = el.split('=');\n const paramName = chunks[0];\n const paramValue = chunks[1];\n params[paramName] = paramValue; \n });\n \n return params;\n};\n\nconst createOutputDir = function(dir) {\n if (typeof dir === 'string' && !fs.existsSync(dir)) {\n fs.mkdirSync(dir);\n }\n return dir;\n};\n \nmodule.exports = {\n paramParser, \n createOutputDir\n};\n","\"use strict\";\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = '_GitHubActionsFileCommandDelimeter_';\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input. The value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n */\nfunction error(message) {\n command_1.issue('error', message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds an warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n */\nfunction warning(message) {\n command_1.issue('warning', message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n//# sourceMappingURL=utils.js.map","\"use strict\";\n\nconst $Ref = require(\"./ref\");\nconst Pointer = require(\"./pointer\");\nconst url = require(\"./util/url\");\n\nmodule.exports = bundle;\n\n/**\n * Bundles all external JSON references into the main JSON schema, thus resulting in a schema that\n * only has *internal* references, not any *external* references.\n * This method mutates the JSON schema object, adding new references and re-mapping existing ones.\n *\n * @param {$RefParser} parser\n * @param {$RefParserOptions} options\n */\nfunction bundle (parser, options) {\n // console.log('Bundling $ref pointers in %s', parser.$refs._root$Ref.path);\n\n // Build an inventory of all $ref pointers in the JSON Schema\n let inventory = [];\n crawl(parser, \"schema\", parser.$refs._root$Ref.path + \"#\", \"#\", 0, inventory, parser.$refs, options);\n\n // Remap all $ref pointers\n remap(inventory);\n}\n\n/**\n * Recursively crawls the given value, and inventories all JSON references.\n *\n * @param {object} parent - The object containing the value to crawl. If the value is not an object or array, it will be ignored.\n * @param {string} key - The property key of `parent` to be crawled\n * @param {string} path - The full path of the property being crawled, possibly with a JSON Pointer in the hash\n * @param {string} pathFromRoot - The path of the property being crawled, from the schema root\n * @param {object[]} inventory - An array of already-inventoried $ref pointers\n * @param {$Refs} $refs\n * @param {$RefParserOptions} options\n */\nfunction crawl (parent, key, path, pathFromRoot, indirections, inventory, $refs, options) {\n let obj = key === null ? parent : parent[key];\n\n if (obj && typeof obj === \"object\" && !ArrayBuffer.isView(obj)) {\n if ($Ref.isAllowed$Ref(obj)) {\n inventory$Ref(parent, key, path, pathFromRoot, indirections, inventory, $refs, options);\n }\n else {\n // Crawl the object in a specific order that's optimized for bundling.\n // This is important because it determines how `pathFromRoot` gets built,\n // which later determines which keys get dereferenced and which ones get remapped\n let keys = Object.keys(obj)\n .sort((a, b) => {\n // Most people will expect references to be bundled into the the \"definitions\" property,\n // so we always crawl that property first, if it exists.\n if (a === \"definitions\") {\n return -1;\n }\n else if (b === \"definitions\") {\n return 1;\n }\n else {\n // Otherwise, crawl the keys based on their length.\n // This produces the shortest possible bundled references\n return a.length - b.length;\n }\n });\n\n // eslint-disable-next-line no-shadow\n for (let key of keys) {\n let keyPath = Pointer.join(path, key);\n let keyPathFromRoot = Pointer.join(pathFromRoot, key);\n let value = obj[key];\n\n if ($Ref.isAllowed$Ref(value)) {\n inventory$Ref(obj, key, path, keyPathFromRoot, indirections, inventory, $refs, options);\n }\n else {\n crawl(obj, key, keyPath, keyPathFromRoot, indirections, inventory, $refs, options);\n }\n }\n }\n }\n}\n\n/**\n * Inventories the given JSON Reference (i.e. records detailed information about it so we can\n * optimize all $refs in the schema), and then crawls the resolved value.\n *\n * @param {object} $refParent - The object that contains a JSON Reference as one of its keys\n * @param {string} $refKey - The key in `$refParent` that is a JSON Reference\n * @param {string} path - The full path of the JSON Reference at `$refKey`, possibly with a JSON Pointer in the hash\n * @param {string} pathFromRoot - The path of the JSON Reference at `$refKey`, from the schema root\n * @param {object[]} inventory - An array of already-inventoried $ref pointers\n * @param {$Refs} $refs\n * @param {$RefParserOptions} options\n */\nfunction inventory$Ref ($refParent, $refKey, path, pathFromRoot, indirections, inventory, $refs, options) {\n let $ref = $refKey === null ? $refParent : $refParent[$refKey];\n let $refPath = url.resolve(path, $ref.$ref);\n let pointer = $refs._resolve($refPath, pathFromRoot, options);\n if (pointer === null) {\n return;\n }\n\n let depth = Pointer.parse(pathFromRoot).length;\n let file = url.stripHash(pointer.path);\n let hash = url.getHash(pointer.path);\n let external = file !== $refs._root$Ref.path;\n let extended = $Ref.isExtended$Ref($ref);\n indirections += pointer.indirections;\n\n let existingEntry = findInInventory(inventory, $refParent, $refKey);\n if (existingEntry) {\n // This $Ref has already been inventoried, so we don't need to process it again\n if (depth < existingEntry.depth || indirections < existingEntry.indirections) {\n removeFromInventory(inventory, existingEntry);\n }\n else {\n return;\n }\n }\n\n inventory.push({\n $ref, // The JSON Reference (e.g. {$ref: string})\n parent: $refParent, // The object that contains this $ref pointer\n key: $refKey, // The key in `parent` that is the $ref pointer\n pathFromRoot, // The path to the $ref pointer, from the JSON Schema root\n depth, // How far from the JSON Schema root is this $ref pointer?\n file, // The file that the $ref pointer resolves to\n hash, // The hash within `file` that the $ref pointer resolves to\n value: pointer.value, // The resolved value of the $ref pointer\n circular: pointer.circular, // Is this $ref pointer DIRECTLY circular? (i.e. it references itself)\n extended, // Does this $ref extend its resolved value? (i.e. it has extra properties, in addition to \"$ref\")\n external, // Does this $ref pointer point to a file other than the main JSON Schema file?\n indirections, // The number of indirect references that were traversed to resolve the value\n });\n\n // Recursively crawl the resolved value\n if (!existingEntry) {\n crawl(pointer.value, null, pointer.path, pathFromRoot, indirections + 1, inventory, $refs, options);\n }\n}\n\n/**\n * Re-maps every $ref pointer, so that they're all relative to the root of the JSON Schema.\n * Each referenced value is dereferenced EXACTLY ONCE. All subsequent references to the same\n * value are re-mapped to point to the first reference.\n *\n * @example:\n * {\n * first: { $ref: somefile.json#/some/part },\n * second: { $ref: somefile.json#/another/part },\n * third: { $ref: somefile.json },\n * fourth: { $ref: somefile.json#/some/part/sub/part }\n * }\n *\n * In this example, there are four references to the same file, but since the third reference points\n * to the ENTIRE file, that's the only one we need to dereference. The other three can just be\n * remapped to point inside the third one.\n *\n * On the other hand, if the third reference DIDN'T exist, then the first and second would both need\n * to be dereferenced, since they point to different parts of the file. The fourth reference does NOT\n * need to be dereferenced, because it can be remapped to point inside the first one.\n *\n * @param {object[]} inventory\n */\nfunction remap (inventory) {\n // Group & sort all the $ref pointers, so they're in the order that we need to dereference/remap them\n inventory.sort((a, b) => {\n if (a.file !== b.file) {\n // Group all the $refs that point to the same file\n return a.file < b.file ? -1 : +1;\n }\n else if (a.hash !== b.hash) {\n // Group all the $refs that point to the same part of the file\n return a.hash < b.hash ? -1 : +1;\n }\n else if (a.circular !== b.circular) {\n // If the $ref points to itself, then sort it higher than other $refs that point to this $ref\n return a.circular ? -1 : +1;\n }\n else if (a.extended !== b.extended) {\n // If the $ref extends the resolved value, then sort it lower than other $refs that don't extend the value\n return a.extended ? +1 : -1;\n }\n else if (a.indirections !== b.indirections) {\n // Sort direct references higher than indirect references\n return a.indirections - b.indirections;\n }\n else if (a.depth !== b.depth) {\n // Sort $refs by how close they are to the JSON Schema root\n return a.depth - b.depth;\n }\n else {\n // Determine how far each $ref is from the \"definitions\" property.\n // Most people will expect references to be bundled into the the \"definitions\" property if possible.\n let aDefinitionsIndex = a.pathFromRoot.lastIndexOf(\"/definitions\");\n let bDefinitionsIndex = b.pathFromRoot.lastIndexOf(\"/definitions\");\n\n if (aDefinitionsIndex !== bDefinitionsIndex) {\n // Give higher priority to the $ref that's closer to the \"definitions\" property\n return bDefinitionsIndex - aDefinitionsIndex;\n }\n else {\n // All else is equal, so use the shorter path, which will produce the shortest possible reference\n return a.pathFromRoot.length - b.pathFromRoot.length;\n }\n }\n });\n\n let file, hash, pathFromRoot;\n for (let entry of inventory) {\n // console.log('Re-mapping $ref pointer \"%s\" at %s', entry.$ref.$ref, entry.pathFromRoot);\n\n if (!entry.external) {\n // This $ref already resolves to the main JSON Schema file\n entry.$ref.$ref = entry.hash;\n }\n else if (entry.file === file && entry.hash === hash) {\n // This $ref points to the same value as the prevous $ref, so remap it to the same path\n entry.$ref.$ref = pathFromRoot;\n }\n else if (entry.file === file && entry.hash.indexOf(hash + \"/\") === 0) {\n // This $ref points to a sub-value of the prevous $ref, so remap it beneath that path\n entry.$ref.$ref = Pointer.join(pathFromRoot, Pointer.parse(entry.hash.replace(hash, \"#\")));\n }\n else {\n // We've moved to a new file or new hash\n file = entry.file;\n hash = entry.hash;\n pathFromRoot = entry.pathFromRoot;\n\n // This is the first $ref to point to this value, so dereference the value.\n // Any other $refs that point to the same value will point to this $ref instead\n entry.$ref = entry.parent[entry.key] = $Ref.dereference(entry.$ref, entry.value);\n\n if (entry.circular) {\n // This $ref points to itself\n entry.$ref.$ref = entry.pathFromRoot;\n }\n }\n\n // console.log(' new value: %s', (entry.$ref && entry.$ref.$ref) ? entry.$ref.$ref : '[object Object]');\n }\n}\n\n/**\n * TODO\n */\nfunction findInInventory (inventory, $refParent, $refKey) {\n for (let i = 0; i < inventory.length; i++) {\n let existingEntry = inventory[i];\n if (existingEntry.parent === $refParent && existingEntry.key === $refKey) {\n return existingEntry;\n }\n }\n}\n\nfunction removeFromInventory (inventory, entry) {\n let index = inventory.indexOf(entry);\n inventory.splice(index, 1);\n}\n","\"use strict\";\n\nconst $Ref = require(\"./ref\");\nconst Pointer = require(\"./pointer\");\nconst { ono } = require(\"@jsdevtools/ono\");\nconst url = require(\"./util/url\");\n\nmodule.exports = dereference;\n\n/**\n * Crawls the JSON schema, finds all JSON references, and dereferences them.\n * This method mutates the JSON schema object, replacing JSON references with their resolved value.\n *\n * @param {$RefParser} parser\n * @param {$RefParserOptions} options\n */\nfunction dereference (parser, options) {\n // console.log('Dereferencing $ref pointers in %s', parser.$refs._root$Ref.path);\n let dereferenced = crawl(parser.schema, parser.$refs._root$Ref.path, \"#\", new Set(), new Set(), new Map(), parser.$refs, options);\n parser.$refs.circular = dereferenced.circular;\n parser.schema = dereferenced.value;\n}\n\n/**\n * Recursively crawls the given value, and dereferences any JSON references.\n *\n * @param {*} obj - The value to crawl. If it's not an object or array, it will be ignored.\n * @param {string} path - The full path of `obj`, possibly with a JSON Pointer in the hash\n * @param {string} pathFromRoot - The path of `obj` from the schema root\n * @param {Set} parents - An array of the parent objects that have already been dereferenced\n * @param {Set} processedObjects - An array of all the objects that have already been processed\n * @param {Map} dereferencedCache - An map of all the dereferenced objects\n * @param {$Refs} $refs\n * @param {$RefParserOptions} options\n * @returns {{value: object, circular: boolean}}\n */\nfunction crawl (obj, path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options) {\n let dereferenced;\n let result = {\n value: obj,\n circular: false\n };\n\n if (options.dereference.circular === \"ignore\" || !processedObjects.has(obj)) {\n if (obj && typeof obj === \"object\" && !ArrayBuffer.isView(obj)) {\n parents.add(obj);\n processedObjects.add(obj);\n\n if ($Ref.isAllowed$Ref(obj, options)) {\n dereferenced = dereference$Ref(obj, path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options);\n result.circular = dereferenced.circular;\n result.value = dereferenced.value;\n }\n else {\n for (const key of Object.keys(obj)) {\n let keyPath = Pointer.join(path, key);\n let keyPathFromRoot = Pointer.join(pathFromRoot, key);\n let value = obj[key];\n let circular = false;\n\n if ($Ref.isAllowed$Ref(value, options)) {\n dereferenced = dereference$Ref(value, keyPath, keyPathFromRoot, parents, processedObjects, dereferencedCache, $refs, options);\n circular = dereferenced.circular;\n // Avoid pointless mutations; breaks frozen objects to no profit\n if (obj[key] !== dereferenced.value) {\n obj[key] = dereferenced.value;\n }\n }\n else {\n if (!parents.has(value)) {\n dereferenced = crawl(value, keyPath, keyPathFromRoot, parents, processedObjects, dereferencedCache, $refs, options);\n circular = dereferenced.circular;\n // Avoid pointless mutations; breaks frozen objects to no profit\n if (obj[key] !== dereferenced.value) {\n obj[key] = dereferenced.value;\n }\n }\n else {\n circular = foundCircularReference(keyPath, $refs, options);\n }\n }\n\n // Set the \"isCircular\" flag if this or any other property is circular\n result.circular = result.circular || circular;\n }\n }\n\n parents.delete(obj);\n }\n }\n\n return result;\n}\n\n/**\n * Dereferences the given JSON Reference, and then crawls the resulting value.\n *\n * @param {{$ref: string}} $ref - The JSON Reference to resolve\n * @param {string} path - The full path of `$ref`, possibly with a JSON Pointer in the hash\n * @param {string} pathFromRoot - The path of `$ref` from the schema root\n * @param {Set} parents - An array of the parent objects that have already been dereferenced\n * @param {Set} processedObjects - An array of all the objects that have already been dereferenced\n * @param {Map} dereferencedCache - An map of all the dereferenced objects\n * @param {$Refs} $refs\n * @param {$RefParserOptions} options\n * @returns {{value: object, circular: boolean}}\n */\nfunction dereference$Ref ($ref, path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options) {\n // console.log('Dereferencing $ref pointer \"%s\" at %s', $ref.$ref, path);\n\n let $refPath = url.resolve(path, $ref.$ref);\n\n const cache = dereferencedCache.get($refPath);\n if (cache) {\n const refKeys = Object.keys($ref);\n if (refKeys.length > 1) {\n const extraKeys = {};\n for (let key of refKeys) {\n if (key !== \"$ref\" && !(key in cache.value)) {\n extraKeys[key] = $ref[key];\n }\n }\n return {\n circular: cache.circular,\n value: Object.assign({}, cache.value, extraKeys),\n };\n }\n\n return cache;\n }\n\n\n let pointer = $refs._resolve($refPath, path, options);\n\n if (pointer === null) {\n return {\n circular: false,\n value: null,\n };\n }\n\n // Check for circular references\n let directCircular = pointer.circular;\n let circular = directCircular || parents.has(pointer.value);\n circular && foundCircularReference(path, $refs, options);\n\n // Dereference the JSON reference\n let dereferencedValue = $Ref.dereference($ref, pointer.value);\n\n // Crawl the dereferenced value (unless it's circular)\n if (!circular) {\n // Determine if the dereferenced value is circular\n let dereferenced = crawl(dereferencedValue, pointer.path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options);\n circular = dereferenced.circular;\n dereferencedValue = dereferenced.value;\n }\n\n if (circular && !directCircular && options.dereference.circular === \"ignore\") {\n // The user has chosen to \"ignore\" circular references, so don't change the value\n dereferencedValue = $ref;\n }\n\n if (directCircular) {\n // The pointer is a DIRECT circular reference (i.e. it references itself).\n // So replace the $ref path with the absolute path from the JSON Schema root\n dereferencedValue.$ref = pathFromRoot;\n }\n\n\n const dereferencedObject = {\n circular,\n value: dereferencedValue\n };\n\n // only cache if no extra properties than $ref\n if (Object.keys($ref).length === 1) {\n dereferencedCache.set($refPath, dereferencedObject);\n }\n\n return dereferencedObject;\n}\n\n/**\n * Called when a circular reference is found.\n * It sets the {@link $Refs#circular} flag, and throws an error if options.dereference.circular is false.\n *\n * @param {string} keyPath - The JSON Reference path of the circular reference\n * @param {$Refs} $refs\n * @param {$RefParserOptions} options\n * @returns {boolean} - always returns true, to indicate that a circular reference was found\n */\nfunction foundCircularReference (keyPath, $refs, options) {\n $refs.circular = true;\n if (!options.dereference.circular) {\n throw ono.reference(`Circular $ref pointer found at ${keyPath}`);\n }\n return true;\n}\n","/* eslint-disable no-unused-vars */\n\"use strict\";\n\nconst $Refs = require(\"./refs\");\nconst _parse = require(\"./parse\");\nconst normalizeArgs = require(\"./normalize-args\");\nconst resolveExternal = require(\"./resolve-external\");\nconst _bundle = require(\"./bundle\");\nconst _dereference = require(\"./dereference\");\nconst url = require(\"./util/url\");\nconst { JSONParserError, InvalidPointerError, MissingPointerError, ResolverError, ParserError, UnmatchedParserError, UnmatchedResolverError, isHandledError, JSONParserErrorGroup } = require(\"./util/errors\");\nconst maybe = require(\"call-me-maybe\");\nconst { ono } = require(\"@jsdevtools/ono\");\n\nmodule.exports = $RefParser;\nmodule.exports.default = $RefParser;\nmodule.exports.JSONParserError = JSONParserError;\nmodule.exports.InvalidPointerError = InvalidPointerError;\nmodule.exports.MissingPointerError = MissingPointerError;\nmodule.exports.ResolverError = ResolverError;\nmodule.exports.ParserError = ParserError;\nmodule.exports.UnmatchedParserError = UnmatchedParserError;\nmodule.exports.UnmatchedResolverError = UnmatchedResolverError;\n\n/**\n * This class parses a JSON schema, builds a map of its JSON references and their resolved values,\n * and provides methods for traversing, manipulating, and dereferencing those references.\n *\n * @constructor\n */\nfunction $RefParser () {\n /**\n * The parsed (and possibly dereferenced) JSON schema object\n *\n * @type {object}\n * @readonly\n */\n this.schema = null;\n\n /**\n * The resolved JSON references\n *\n * @type {$Refs}\n * @readonly\n */\n this.$refs = new $Refs();\n}\n\n/**\n * Parses the given JSON schema.\n * This method does not resolve any JSON references.\n * It just reads a single file in JSON or YAML format, and parse it as a JavaScript object.\n *\n * @param {string} [path] - The file path or URL of the JSON schema\n * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`.\n * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed\n * @param {function} [callback] - An error-first callback. The second parameter is the parsed JSON schema object.\n * @returns {Promise} - The returned promise resolves with the parsed JSON schema object.\n */\n$RefParser.parse = function parse (path, schema, options, callback) {\n let Class = this; // eslint-disable-line consistent-this\n let instance = new Class();\n return instance.parse.apply(instance, arguments);\n};\n\n/**\n * Parses the given JSON schema.\n * This method does not resolve any JSON references.\n * It just reads a single file in JSON or YAML format, and parse it as a JavaScript object.\n *\n * @param {string} [path] - The file path or URL of the JSON schema\n * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`.\n * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed\n * @param {function} [callback] - An error-first callback. The second parameter is the parsed JSON schema object.\n * @returns {Promise} - The returned promise resolves with the parsed JSON schema object.\n */\n$RefParser.prototype.parse = async function parse (path, schema, options, callback) {\n let args = normalizeArgs(arguments);\n let promise;\n\n if (!args.path && !args.schema) {\n let err = ono(`Expected a file path, URL, or object. Got ${args.path || args.schema}`);\n return maybe(args.callback, Promise.reject(err));\n }\n\n // Reset everything\n this.schema = null;\n this.$refs = new $Refs();\n\n // If the path is a filesystem path, then convert it to a URL.\n // NOTE: According to the JSON Reference spec, these should already be URLs,\n // but, in practice, many people use local filesystem paths instead.\n // So we're being generous here and doing the conversion automatically.\n // This is not intended to be a 100% bulletproof solution.\n // If it doesn't work for your use-case, then use a URL instead.\n let pathType = \"http\";\n if (url.isFileSystemPath(args.path)) {\n args.path = url.fromFileSystemPath(args.path);\n pathType = \"file\";\n }\n\n // Resolve the absolute path of the schema\n args.path = url.resolve(url.cwd(), args.path);\n\n if (args.schema && typeof args.schema === \"object\") {\n // A schema object was passed-in.\n // So immediately add a new $Ref with the schema object as its value\n let $ref = this.$refs._add(args.path);\n $ref.value = args.schema;\n $ref.pathType = pathType;\n promise = Promise.resolve(args.schema);\n }\n else {\n // Parse the schema file/url\n promise = _parse(args.path, this.$refs, args.options);\n }\n\n let me = this;\n try {\n let result = await promise;\n\n if (result !== null && typeof result === \"object\" && !Buffer.isBuffer(result)) {\n me.schema = result;\n return maybe(args.callback, Promise.resolve(me.schema));\n }\n else if (args.options.continueOnError) {\n me.schema = null; // it's already set to null at line 79, but let's set it again for the sake of readability\n return maybe(args.callback, Promise.resolve(me.schema));\n }\n else {\n throw ono.syntax(`\"${me.$refs._root$Ref.path || result}\" is not a valid JSON Schema`);\n }\n }\n catch (err) {\n if (!args.options.continueOnError || !isHandledError(err)) {\n return maybe(args.callback, Promise.reject(err));\n }\n\n if (this.$refs._$refs[url.stripHash(args.path)]) {\n this.$refs._$refs[url.stripHash(args.path)].addError(err);\n }\n\n return maybe(args.callback, Promise.resolve(null));\n }\n};\n\n/**\n * Parses the given JSON schema and resolves any JSON references, including references in\n * externally-referenced files.\n *\n * @param {string} [path] - The file path or URL of the JSON schema\n * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`.\n * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed and resolved\n * @param {function} [callback]\n * - An error-first callback. The second parameter is a {@link $Refs} object containing the resolved JSON references\n *\n * @returns {Promise}\n * The returned promise resolves with a {@link $Refs} object containing the resolved JSON references\n */\n$RefParser.resolve = function resolve (path, schema, options, callback) {\n let Class = this; // eslint-disable-line consistent-this\n let instance = new Class();\n return instance.resolve.apply(instance, arguments);\n};\n\n/**\n * Parses the given JSON schema and resolves any JSON references, including references in\n * externally-referenced files.\n *\n * @param {string} [path] - The file path or URL of the JSON schema\n * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`.\n * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed and resolved\n * @param {function} [callback]\n * - An error-first callback. The second parameter is a {@link $Refs} object containing the resolved JSON references\n *\n * @returns {Promise}\n * The returned promise resolves with a {@link $Refs} object containing the resolved JSON references\n */\n$RefParser.prototype.resolve = async function resolve (path, schema, options, callback) {\n let me = this;\n let args = normalizeArgs(arguments);\n\n try {\n await this.parse(args.path, args.schema, args.options);\n await resolveExternal(me, args.options);\n finalize(me);\n return maybe(args.callback, Promise.resolve(me.$refs));\n }\n catch (err) {\n return maybe(args.callback, Promise.reject(err));\n }\n};\n\n/**\n * Parses the given JSON schema, resolves any JSON references, and bundles all external references\n * into the main JSON schema. This produces a JSON schema that only has *internal* references,\n * not any *external* references.\n *\n * @param {string} [path] - The file path or URL of the JSON schema\n * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`.\n * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed, resolved, and dereferenced\n * @param {function} [callback] - An error-first callback. The second parameter is the bundled JSON schema object\n * @returns {Promise} - The returned promise resolves with the bundled JSON schema object.\n */\n$RefParser.bundle = function bundle (path, schema, options, callback) {\n let Class = this; // eslint-disable-line consistent-this\n let instance = new Class();\n return instance.bundle.apply(instance, arguments);\n};\n\n/**\n * Parses the given JSON schema, resolves any JSON references, and bundles all external references\n * into the main JSON schema. This produces a JSON schema that only has *internal* references,\n * not any *external* references.\n *\n * @param {string} [path] - The file path or URL of the JSON schema\n * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`.\n * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed, resolved, and dereferenced\n * @param {function} [callback] - An error-first callback. The second parameter is the bundled JSON schema object\n * @returns {Promise} - The returned promise resolves with the bundled JSON schema object.\n */\n$RefParser.prototype.bundle = async function bundle (path, schema, options, callback) {\n let me = this;\n let args = normalizeArgs(arguments);\n\n try {\n await this.resolve(args.path, args.schema, args.options);\n _bundle(me, args.options);\n finalize(me);\n return maybe(args.callback, Promise.resolve(me.schema));\n }\n catch (err) {\n return maybe(args.callback, Promise.reject(err));\n }\n};\n\n/**\n * Parses the given JSON schema, resolves any JSON references, and dereferences the JSON schema.\n * That is, all JSON references are replaced with their resolved values.\n *\n * @param {string} [path] - The file path or URL of the JSON schema\n * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`.\n * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed, resolved, and dereferenced\n * @param {function} [callback] - An error-first callback. The second parameter is the dereferenced JSON schema object\n * @returns {Promise} - The returned promise resolves with the dereferenced JSON schema object.\n */\n$RefParser.dereference = function dereference (path, schema, options, callback) {\n let Class = this; // eslint-disable-line consistent-this\n let instance = new Class();\n return instance.dereference.apply(instance, arguments);\n};\n\n/**\n * Parses the given JSON schema, resolves any JSON references, and dereferences the JSON schema.\n * That is, all JSON references are replaced with their resolved values.\n *\n * @param {string} [path] - The file path or URL of the JSON schema\n * @param {object} [schema] - A JSON schema object. This object will be used instead of reading from `path`.\n * @param {$RefParserOptions} [options] - Options that determine how the schema is parsed, resolved, and dereferenced\n * @param {function} [callback] - An error-first callback. The second parameter is the dereferenced JSON schema object\n * @returns {Promise} - The returned promise resolves with the dereferenced JSON schema object.\n */\n$RefParser.prototype.dereference = async function dereference (path, schema, options, callback) {\n let me = this;\n let args = normalizeArgs(arguments);\n\n try {\n await this.resolve(args.path, args.schema, args.options);\n _dereference(me, args.options);\n finalize(me);\n return maybe(args.callback, Promise.resolve(me.schema));\n }\n catch (err) {\n return maybe(args.callback, Promise.reject(err));\n }\n};\n\nfunction finalize (parser) {\n const errors = JSONParserErrorGroup.getParserErrors(parser);\n if (errors.length > 0) {\n throw new JSONParserErrorGroup(parser);\n }\n}\n","\"use strict\";\n\nconst Options = require(\"./options\");\n\nmodule.exports = normalizeArgs;\n\n/**\n * Normalizes the given arguments, accounting for optional args.\n *\n * @param {Arguments} args\n * @returns {object}\n */\nfunction normalizeArgs (args) {\n let path, schema, options, callback;\n args = Array.prototype.slice.call(args);\n\n if (typeof args[args.length - 1] === \"function\") {\n // The last parameter is a callback function\n callback = args.pop();\n }\n\n if (typeof args[0] === \"string\") {\n // The first parameter is the path\n path = args[0];\n if (typeof args[2] === \"object\") {\n // The second parameter is the schema, and the third parameter is the options\n schema = args[1];\n options = args[2];\n }\n else {\n // The second parameter is the options\n schema = undefined;\n options = args[1];\n }\n }\n else {\n // The first parameter is the schema\n path = \"\";\n schema = args[0];\n options = args[1];\n }\n\n if (!(options instanceof Options)) {\n options = new Options(options);\n }\n\n return {\n path,\n schema,\n options,\n callback\n };\n}\n","/* eslint lines-around-comment: [2, {beforeBlockComment: false}] */\n\"use strict\";\n\nconst jsonParser = require(\"./parsers/json\");\nconst yamlParser = require(\"./parsers/yaml\");\nconst textParser = require(\"./parsers/text\");\nconst binaryParser = require(\"./parsers/binary\");\nconst fileResolver = require(\"./resolvers/file\");\nconst httpResolver = require(\"./resolvers/http\");\n\nmodule.exports = $RefParserOptions;\n\n/**\n * Options that determine how JSON schemas are parsed, resolved, and dereferenced.\n *\n * @param {object|$RefParserOptions} [options] - Overridden options\n * @constructor\n */\nfunction $RefParserOptions (options) {\n merge(this, $RefParserOptions.defaults);\n merge(this, options);\n}\n\n$RefParserOptions.defaults = {\n /**\n * Determines how different types of files will be parsed.\n *\n * You can add additional parsers of your own, replace an existing one with\n * your own implementation, or disable any parser by setting it to false.\n */\n parse: {\n json: jsonParser,\n yaml: yamlParser,\n text: textParser,\n binary: binaryParser,\n },\n\n /**\n * Determines how JSON References will be resolved.\n *\n * You can add additional resolvers of your own, replace an existing one with\n * your own implementation, or disable any resolver by setting it to false.\n */\n resolve: {\n file: fileResolver,\n http: httpResolver,\n\n /**\n * Determines whether external $ref pointers will be resolved.\n * If this option is disabled, then none of above resolvers will be called.\n * Instead, external $ref pointers will simply be ignored.\n *\n * @type {boolean}\n */\n external: true,\n },\n\n /**\n * By default, JSON Schema $Ref Parser throws the first error it encounters. Setting `continueOnError` to `true`\n * causes it to keep processing as much as possible and then throw a single error that contains all errors\n * that were encountered.\n */\n continueOnError: false,\n\n /**\n * Determines the types of JSON references that are allowed.\n */\n dereference: {\n /**\n * Dereference circular (recursive) JSON references?\n * If false, then a {@link ReferenceError} will be thrown if a circular reference is found.\n * If \"ignore\", then circular references will not be dereferenced.\n *\n * @type {boolean|string}\n */\n circular: true\n },\n};\n\n/**\n * Merges the properties of the source object into the target object.\n *\n * @param {object} target - The object that we're populating\n * @param {?object} source - The options that are being merged\n * @returns {object}\n */\nfunction merge (target, source) {\n if (isMergeable(source)) {\n let keys = Object.keys(source);\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n let sourceSetting = source[key];\n let targetSetting = target[key];\n\n if (isMergeable(sourceSetting)) {\n // It's a nested object, so merge it recursively\n target[key] = merge(targetSetting || {}, sourceSetting);\n }\n else if (sourceSetting !== undefined) {\n // It's a scalar value, function, or array. No merging necessary. Just overwrite the target value.\n target[key] = sourceSetting;\n }\n }\n }\n return target;\n}\n\n/**\n * Determines whether the given value can be merged,\n * or if it is a scalar value that should just override the target value.\n *\n * @param {*} val\n * @returns {Boolean}\n */\nfunction isMergeable (val) {\n return val &&\n (typeof val === \"object\") &&\n !Array.isArray(val) &&\n !(val instanceof RegExp) &&\n !(val instanceof Date);\n}\n","\"use strict\";\n\nconst { ono } = require(\"@jsdevtools/ono\");\nconst url = require(\"./util/url\");\nconst plugins = require(\"./util/plugins\");\nconst { ResolverError, ParserError, UnmatchedParserError, UnmatchedResolverError, isHandledError } = require(\"./util/errors\");\n\nmodule.exports = parse;\n\n/**\n * Reads and parses the specified file path or URL.\n *\n * @param {string} path - This path MUST already be resolved, since `read` doesn't know the resolution context\n * @param {$Refs} $refs\n * @param {$RefParserOptions} options\n *\n * @returns {Promise}\n * The promise resolves with the parsed file contents, NOT the raw (Buffer) contents.\n */\nasync function parse (path, $refs, options) {\n // Remove the URL fragment, if any\n path = url.stripHash(path);\n\n // Add a new $Ref for this file, even though we don't have the value yet.\n // This ensures that we don't simultaneously read & parse the same file multiple times\n let $ref = $refs._add(path);\n\n // This \"file object\" will be passed to all resolvers and parsers.\n let file = {\n url: path,\n extension: url.getExtension(path),\n };\n\n // Read the file and then parse the data\n try {\n const resolver = await readFile(file, options, $refs);\n $ref.pathType = resolver.plugin.name;\n file.data = resolver.result;\n\n const parser = await parseFile(file, options, $refs);\n $ref.value = parser.result;\n\n return parser.result;\n }\n catch (err) {\n if (isHandledError(err)) {\n $ref.value = err;\n }\n\n throw err;\n }\n}\n\n/**\n * Reads the given file, using the configured resolver plugins\n *\n * @param {object} file - An object containing information about the referenced file\n * @param {string} file.url - The full URL of the referenced file\n * @param {string} file.extension - The lowercased file extension (e.g. \".txt\", \".html\", etc.)\n * @param {$RefParserOptions} options\n *\n * @returns {Promise}\n * The promise resolves with the raw file contents and the resolver that was used.\n */\nfunction readFile (file, options, $refs) {\n return new Promise(((resolve, reject) => {\n // console.log('Reading %s', file.url);\n\n // Find the resolvers that can read this file\n let resolvers = plugins.all(options.resolve);\n resolvers = plugins.filter(resolvers, \"canRead\", file);\n\n // Run the resolvers, in order, until one of them succeeds\n plugins.sort(resolvers);\n plugins.run(resolvers, \"read\", file, $refs)\n .then(resolve, onError);\n\n function onError (err) {\n if (!err && options.continueOnError) {\n // No resolver could be matched\n reject(new UnmatchedResolverError(file.url));\n }\n else if (!err || !(\"error\" in err)) {\n // Throw a generic, friendly error.\n reject(ono.syntax(`Unable to resolve $ref pointer \"${file.url}\"`));\n }\n // Throw the original error, if it's one of our own (user-friendly) errors.\n else if (err.error instanceof ResolverError) {\n reject(err.error);\n }\n else {\n reject(new ResolverError(err, file.url));\n }\n }\n }));\n}\n\n/**\n * Parses the given file's contents, using the configured parser plugins.\n *\n * @param {object} file - An object containing information about the referenced file\n * @param {string} file.url - The full URL of the referenced file\n * @param {string} file.extension - The lowercased file extension (e.g. \".txt\", \".html\", etc.)\n * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver\n * @param {$RefParserOptions} options\n *\n * @returns {Promise}\n * The promise resolves with the parsed file contents and the parser that was used.\n */\nfunction parseFile (file, options, $refs) {\n return new Promise(((resolve, reject) => {\n // console.log('Parsing %s', file.url);\n\n // Find the parsers that can read this file type.\n // If none of the parsers are an exact match for this file, then we'll try ALL of them.\n // This handles situations where the file IS a supported type, just with an unknown extension.\n let allParsers = plugins.all(options.parse);\n let filteredParsers = plugins.filter(allParsers, \"canParse\", file);\n let parsers = filteredParsers.length > 0 ? filteredParsers : allParsers;\n\n // Run the parsers, in order, until one of them succeeds\n plugins.sort(parsers);\n plugins.run(parsers, \"parse\", file, $refs)\n .then(onParsed, onError);\n\n function onParsed (parser) {\n if (!parser.plugin.allowEmpty && isEmpty(parser.result)) {\n reject(ono.syntax(`Error parsing \"${file.url}\" as ${parser.plugin.name}. \\nParsed value is empty`));\n }\n else {\n resolve(parser);\n }\n }\n\n function onError (err) {\n if (!err && options.continueOnError) {\n // No resolver could be matched\n reject(new UnmatchedParserError(file.url));\n }\n else if (!err || !(\"error\" in err)) {\n reject(ono.syntax(`Unable to parse ${file.url}`));\n }\n else if (err.error instanceof ParserError) {\n reject(err.error);\n }\n else {\n reject(new ParserError(err.error.message, file.url));\n }\n }\n }));\n}\n\n/**\n * Determines whether the parsed value is \"empty\".\n *\n * @param {*} value\n * @returns {boolean}\n */\nfunction isEmpty (value) {\n return value === undefined ||\n (typeof value === \"object\" && Object.keys(value).length === 0) ||\n (typeof value === \"string\" && value.trim().length === 0) ||\n (Buffer.isBuffer(value) && value.length === 0);\n}\n","\"use strict\";\n\nlet BINARY_REGEXP = /\\.(jpeg|jpg|gif|png|bmp|ico)$/i;\n\nmodule.exports = {\n /**\n * The order that this parser will run, in relation to other parsers.\n *\n * @type {number}\n */\n order: 400,\n\n /**\n * Whether to allow \"empty\" files (zero bytes).\n *\n * @type {boolean}\n */\n allowEmpty: true,\n\n /**\n * Determines whether this parser can parse a given file reference.\n * Parsers that return true will be tried, in order, until one successfully parses the file.\n * Parsers that return false will be skipped, UNLESS all parsers returned false, in which case\n * every parser will be tried.\n *\n * @param {object} file - An object containing information about the referenced file\n * @param {string} file.url - The full URL of the referenced file\n * @param {string} file.extension - The lowercased file extension (e.g. \".txt\", \".html\", etc.)\n * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver\n * @returns {boolean}\n */\n canParse (file) {\n // Use this parser if the file is a Buffer, and has a known binary extension\n return Buffer.isBuffer(file.data) && BINARY_REGEXP.test(file.url);\n },\n\n /**\n * Parses the given data as a Buffer (byte array).\n *\n * @param {object} file - An object containing information about the referenced file\n * @param {string} file.url - The full URL of the referenced file\n * @param {string} file.extension - The lowercased file extension (e.g. \".txt\", \".html\", etc.)\n * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver\n * @returns {Buffer}\n */\n parse (file) {\n if (Buffer.isBuffer(file.data)) {\n return file.data;\n }\n else {\n // This will reject if data is anything other than a string or typed array\n return Buffer.from(file.data);\n }\n }\n};\n","\"use strict\";\n\nconst { ParserError } = require(\"../util/errors\");\n\nmodule.exports = {\n /**\n * The order that this parser will run, in relation to other parsers.\n *\n * @type {number}\n */\n order: 100,\n\n /**\n * Whether to allow \"empty\" files. This includes zero-byte files, as well as empty JSON objects.\n *\n * @type {boolean}\n */\n allowEmpty: true,\n\n /**\n * Determines whether this parser can parse a given file reference.\n * Parsers that match will be tried, in order, until one successfully parses the file.\n * Parsers that don't match will be skipped, UNLESS none of the parsers match, in which case\n * every parser will be tried.\n *\n * @type {RegExp|string|string[]|function}\n */\n canParse: \".json\",\n\n /**\n * Parses the given file as JSON\n *\n * @param {object} file - An object containing information about the referenced file\n * @param {string} file.url - The full URL of the referenced file\n * @param {string} file.extension - The lowercased file extension (e.g. \".txt\", \".html\", etc.)\n * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver\n * @returns {Promise}\n */\n async parse (file) { // eslint-disable-line require-await\n let data = file.data;\n if (Buffer.isBuffer(data)) {\n data = data.toString();\n }\n\n if (typeof data === \"string\") {\n if (data.trim().length === 0) {\n return; // This mirrors the YAML behavior\n }\n else {\n try {\n return JSON.parse(data);\n }\n catch (e) {\n throw new ParserError(e.message, file.url);\n }\n }\n }\n else {\n // data is already a JavaScript value (object, array, number, null, NaN, etc.)\n return data;\n }\n }\n};\n","\"use strict\";\n\nconst { ParserError } = require(\"../util/errors\");\n\nlet TEXT_REGEXP = /\\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;\n\nmodule.exports = {\n /**\n * The order that this parser will run, in relation to other parsers.\n *\n * @type {number}\n */\n order: 300,\n\n /**\n * Whether to allow \"empty\" files (zero bytes).\n *\n * @type {boolean}\n */\n allowEmpty: true,\n\n /**\n * The encoding that the text is expected to be in.\n *\n * @type {string}\n */\n encoding: \"utf8\",\n\n /**\n * Determines whether this parser can parse a given file reference.\n * Parsers that return true will be tried, in order, until one successfully parses the file.\n * Parsers that return false will be skipped, UNLESS all parsers returned false, in which case\n * every parser will be tried.\n *\n * @param {object} file - An object containing information about the referenced file\n * @param {string} file.url - The full URL of the referenced file\n * @param {string} file.extension - The lowercased file extension (e.g. \".txt\", \".html\", etc.)\n * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver\n * @returns {boolean}\n */\n canParse (file) {\n // Use this parser if the file is a string or Buffer, and has a known text-based extension\n return (typeof file.data === \"string\" || Buffer.isBuffer(file.data)) && TEXT_REGEXP.test(file.url);\n },\n\n /**\n * Parses the given file as text\n *\n * @param {object} file - An object containing information about the referenced file\n * @param {string} file.url - The full URL of the referenced file\n * @param {string} file.extension - The lowercased file extension (e.g. \".txt\", \".html\", etc.)\n * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver\n * @returns {string}\n */\n parse (file) {\n if (typeof file.data === \"string\") {\n return file.data;\n }\n else if (Buffer.isBuffer(file.data)) {\n return file.data.toString(this.encoding);\n }\n else {\n throw new ParserError(\"data is not text\", file.url);\n }\n }\n};\n","\"use strict\";\n\nconst { ParserError } = require(\"../util/errors\");\nconst yaml = require(\"js-yaml\");\n\nmodule.exports = {\n /**\n * The order that this parser will run, in relation to other parsers.\n *\n * @type {number}\n */\n order: 200,\n\n /**\n * Whether to allow \"empty\" files. This includes zero-byte files, as well as empty JSON objects.\n *\n * @type {boolean}\n */\n allowEmpty: true,\n\n /**\n * Determines whether this parser can parse a given file reference.\n * Parsers that match will be tried, in order, until one successfully parses the file.\n * Parsers that don't match will be skipped, UNLESS none of the parsers match, in which case\n * every parser will be tried.\n *\n * @type {RegExp|string[]|function}\n */\n canParse: [\".yaml\", \".yml\", \".json\"], // JSON is valid YAML\n\n /**\n * Parses the given file as YAML\n *\n * @param {object} file - An object containing information about the referenced file\n * @param {string} file.url - The full URL of the referenced file\n * @param {string} file.extension - The lowercased file extension (e.g. \".txt\", \".html\", etc.)\n * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver\n * @returns {Promise}\n */\n async parse (file) { // eslint-disable-line require-await\n let data = file.data;\n if (Buffer.isBuffer(data)) {\n data = data.toString();\n }\n\n if (typeof data === \"string\") {\n try {\n return yaml.load(data);\n }\n catch (e) {\n throw new ParserError(e.message, file.url);\n }\n }\n else {\n // data is already a JavaScript value (object, array, number, null, NaN, etc.)\n return data;\n }\n }\n};\n","\"use strict\";\n\nmodule.exports = Pointer;\n\nconst $Ref = require(\"./ref\");\nconst url = require(\"./util/url\");\nconst { JSONParserError, InvalidPointerError, MissingPointerError, isHandledError } = require(\"./util/errors\");\nconst slashes = /\\//g;\nconst tildes = /~/g;\nconst escapedSlash = /~1/g;\nconst escapedTilde = /~0/g;\n\n/**\n * This class represents a single JSON pointer and its resolved value.\n *\n * @param {$Ref} $ref\n * @param {string} path\n * @param {string} [friendlyPath] - The original user-specified path (used for error messages)\n * @constructor\n */\nfunction Pointer ($ref, path, friendlyPath) {\n /**\n * The {@link $Ref} object that contains this {@link Pointer} object.\n * @type {$Ref}\n */\n this.$ref = $ref;\n\n /**\n * The file path or URL, containing the JSON pointer in the hash.\n * This path is relative to the path of the main JSON schema file.\n * @type {string}\n */\n this.path = path;\n\n /**\n * The original path or URL, used for error messages.\n * @type {string}\n */\n this.originalPath = friendlyPath || path;\n\n /**\n * The value of the JSON pointer.\n * Can be any JSON type, not just objects. Unknown file types are represented as Buffers (byte arrays).\n * @type {?*}\n */\n this.value = undefined;\n\n /**\n * Indicates whether the pointer references itself.\n * @type {boolean}\n */\n this.circular = false;\n\n /**\n * The number of indirect references that were traversed to resolve the value.\n * Resolving a single pointer may require resolving multiple $Refs.\n * @type {number}\n */\n this.indirections = 0;\n}\n\n/**\n * Resolves the value of a nested property within the given object.\n *\n * @param {*} obj - The object that will be crawled\n * @param {$RefParserOptions} options\n * @param {string} pathFromRoot - the path of place that initiated resolving\n *\n * @returns {Pointer}\n * Returns a JSON pointer whose {@link Pointer#value} is the resolved value.\n * If resolving this value required resolving other JSON references, then\n * the {@link Pointer#$ref} and {@link Pointer#path} will reflect the resolution path\n * of the resolved value.\n */\nPointer.prototype.resolve = function (obj, options, pathFromRoot) {\n let tokens = Pointer.parse(this.path, this.originalPath);\n\n // Crawl the object, one token at a time\n this.value = unwrapOrThrow(obj);\n\n for (let i = 0; i < tokens.length; i++) {\n if (resolveIf$Ref(this, options)) {\n // The $ref path has changed, so append the remaining tokens to the path\n this.path = Pointer.join(this.path, tokens.slice(i));\n }\n\n if (typeof this.value === \"object\" && this.value !== null && \"$ref\" in this.value) {\n return this;\n }\n\n let token = tokens[i];\n if (this.value[token] === undefined || this.value[token] === null) {\n this.value = null;\n throw new MissingPointerError(token, this.originalPath);\n }\n else {\n this.value = this.value[token];\n }\n }\n\n // Resolve the final value\n if (!this.value || this.value.$ref && url.resolve(this.path, this.value.$ref) !== pathFromRoot) {\n resolveIf$Ref(this, options);\n }\n\n return this;\n};\n\n/**\n * Sets the value of a nested property within the given object.\n *\n * @param {*} obj - The object that will be crawled\n * @param {*} value - the value to assign\n * @param {$RefParserOptions} options\n *\n * @returns {*}\n * Returns the modified object, or an entirely new object if the entire object is overwritten.\n */\nPointer.prototype.set = function (obj, value, options) {\n let tokens = Pointer.parse(this.path);\n let token;\n\n if (tokens.length === 0) {\n // There are no tokens, replace the entire object with the new value\n this.value = value;\n return value;\n }\n\n // Crawl the object, one token at a time\n this.value = unwrapOrThrow(obj);\n\n for (let i = 0; i < tokens.length - 1; i++) {\n resolveIf$Ref(this, options);\n\n token = tokens[i];\n if (this.value && this.value[token] !== undefined) {\n // The token exists\n this.value = this.value[token];\n }\n else {\n // The token doesn't exist, so create it\n this.value = setValue(this, token, {});\n }\n }\n\n // Set the value of the final token\n resolveIf$Ref(this, options);\n token = tokens[tokens.length - 1];\n setValue(this, token, value);\n\n // Return the updated object\n return obj;\n};\n\n/**\n * Parses a JSON pointer (or a path containing a JSON pointer in the hash)\n * and returns an array of the pointer's tokens.\n * (e.g. \"schema.json#/definitions/person/name\" => [\"definitions\", \"person\", \"name\"])\n *\n * The pointer is parsed according to RFC 6901\n * {@link https://tools.ietf.org/html/rfc6901#section-3}\n *\n * @param {string} path\n * @param {string} [originalPath]\n * @returns {string[]}\n */\nPointer.parse = function (path, originalPath) {\n // Get the JSON pointer from the path's hash\n let pointer = url.getHash(path).substr(1);\n\n // If there's no pointer, then there are no tokens,\n // so return an empty array\n if (!pointer) {\n return [];\n }\n\n // Split into an array\n pointer = pointer.split(\"/\");\n\n // Decode each part, according to RFC 6901\n for (let i = 0; i < pointer.length; i++) {\n pointer[i] = decodeURIComponent(pointer[i].replace(escapedSlash, \"/\").replace(escapedTilde, \"~\"));\n }\n\n if (pointer[0] !== \"\") {\n throw new InvalidPointerError(pointer, originalPath === undefined ? path : originalPath);\n }\n\n return pointer.slice(1);\n};\n\n/**\n * Creates a JSON pointer path, by joining one or more tokens to a base path.\n *\n * @param {string} base - The base path (e.g. \"schema.json#/definitions/person\")\n * @param {string|string[]} tokens - The token(s) to append (e.g. [\"name\", \"first\"])\n * @returns {string}\n */\nPointer.join = function (base, tokens) {\n // Ensure that the base path contains a hash\n if (base.indexOf(\"#\") === -1) {\n base += \"#\";\n }\n\n // Append each token to the base path\n tokens = Array.isArray(tokens) ? tokens : [tokens];\n for (let i = 0; i < tokens.length; i++) {\n let token = tokens[i];\n // Encode the token, according to RFC 6901\n base += \"/\" + encodeURIComponent(token.replace(tildes, \"~0\").replace(slashes, \"~1\"));\n }\n\n return base;\n};\n\n/**\n * If the given pointer's {@link Pointer#value} is a JSON reference,\n * then the reference is resolved and {@link Pointer#value} is replaced with the resolved value.\n * In addition, {@link Pointer#path} and {@link Pointer#$ref} are updated to reflect the\n * resolution path of the new value.\n *\n * @param {Pointer} pointer\n * @param {$RefParserOptions} options\n * @returns {boolean} - Returns `true` if the resolution path changed\n */\nfunction resolveIf$Ref (pointer, options) {\n // Is the value a JSON reference? (and allowed?)\n\n if ($Ref.isAllowed$Ref(pointer.value, options)) {\n let $refPath = url.resolve(pointer.path, pointer.value.$ref);\n\n if ($refPath === pointer.path) {\n // The value is a reference to itself, so there's nothing to do.\n pointer.circular = true;\n }\n else {\n let resolved = pointer.$ref.$refs._resolve($refPath, pointer.path, options);\n if (resolved === null) {\n return false;\n }\n\n pointer.indirections += resolved.indirections + 1;\n\n if ($Ref.isExtended$Ref(pointer.value)) {\n // This JSON reference \"extends\" the resolved value, rather than simply pointing to it.\n // So the resolved path does NOT change. Just the value does.\n pointer.value = $Ref.dereference(pointer.value, resolved.value);\n return false;\n }\n else {\n // Resolve the reference\n pointer.$ref = resolved.$ref;\n pointer.path = resolved.path;\n pointer.value = resolved.value;\n }\n\n return true;\n }\n }\n}\n\n/**\n * Sets the specified token value of the {@link Pointer#value}.\n *\n * The token is evaluated according to RFC 6901.\n * {@link https://tools.ietf.org/html/rfc6901#section-4}\n *\n * @param {Pointer} pointer - The JSON Pointer whose value will be modified\n * @param {string} token - A JSON Pointer token that indicates how to modify `obj`\n * @param {*} value - The value to assign\n * @returns {*} - Returns the assigned value\n */\nfunction setValue (pointer, token, value) {\n if (pointer.value && typeof pointer.value === \"object\") {\n if (token === \"-\" && Array.isArray(pointer.value)) {\n pointer.value.push(value);\n }\n else {\n pointer.value[token] = value;\n }\n }\n else {\n throw new JSONParserError(`Error assigning $ref pointer \"${pointer.path}\". \\nCannot set \"${token}\" of a non-object.`);\n }\n return value;\n}\n\n\nfunction unwrapOrThrow (value) {\n if (isHandledError(value)) {\n throw value;\n }\n\n return value;\n}\n","\"use strict\";\n\nmodule.exports = $Ref;\n\nconst Pointer = require(\"./pointer\");\nconst { InvalidPointerError, isHandledError, normalizeError } = require(\"./util/errors\");\nconst { safePointerToPath, stripHash, getHash } = require(\"./util/url\");\n\n/**\n * This class represents a single JSON reference and its resolved value.\n *\n * @class\n */\nfunction $Ref () {\n /**\n * The file path or URL of the referenced file.\n * This path is relative to the path of the main JSON schema file.\n *\n * This path does NOT contain document fragments (JSON pointers). It always references an ENTIRE file.\n * Use methods such as {@link $Ref#get}, {@link $Ref#resolve}, and {@link $Ref#exists} to get\n * specific JSON pointers within the file.\n *\n * @type {string}\n */\n this.path = undefined;\n\n /**\n * The resolved value of the JSON reference.\n * Can be any JSON type, not just objects. Unknown file types are represented as Buffers (byte arrays).\n *\n * @type {?*}\n */\n this.value = undefined;\n\n /**\n * The {@link $Refs} object that contains this {@link $Ref} object.\n *\n * @type {$Refs}\n */\n this.$refs = undefined;\n\n /**\n * Indicates the type of {@link $Ref#path} (e.g. \"file\", \"http\", etc.)\n *\n * @type {?string}\n */\n this.pathType = undefined;\n\n /**\n * List of all errors. Undefined if no errors.\n *\n * @type {Array}\n */\n this.errors = undefined;\n}\n\n/**\n * Pushes an error to errors array.\n *\n * @param {Array} err - The error to be pushed\n * @returns {void}\n */\n$Ref.prototype.addError = function (err) {\n if (this.errors === undefined) {\n this.errors = [];\n }\n\n const existingErrors = this.errors.map(({ footprint }) => footprint);\n\n // the path has been almost certainly set at this point,\n // but just in case something went wrong, normalizeError injects path if necessary\n // moreover, certain errors might point at the same spot, so filter them out to reduce noise\n if (Array.isArray(err.errors)) {\n this.errors.push(...err.errors\n .map(normalizeError)\n .filter(({ footprint }) => !existingErrors.includes(footprint)),\n );\n }\n else if (!existingErrors.includes(err.footprint)) {\n this.errors.push(normalizeError(err));\n }\n};\n\n/**\n * Determines whether the given JSON reference exists within this {@link $Ref#value}.\n *\n * @param {string} path - The full path being resolved, optionally with a JSON pointer in the hash\n * @param {$RefParserOptions} options\n * @returns {boolean}\n */\n$Ref.prototype.exists = function (path, options) {\n try {\n this.resolve(path, options);\n return true;\n }\n catch (e) {\n return false;\n }\n};\n\n/**\n * Resolves the given JSON reference within this {@link $Ref#value} and returns the resolved value.\n *\n * @param {string} path - The full path being resolved, optionally with a JSON pointer in the hash\n * @param {$RefParserOptions} options\n * @returns {*} - Returns the resolved value\n */\n$Ref.prototype.get = function (path, options) {\n return this.resolve(path, options).value;\n};\n\n/**\n * Resolves the given JSON reference within this {@link $Ref#value}.\n *\n * @param {string} path - The full path being resolved, optionally with a JSON pointer in the hash\n * @param {$RefParserOptions} options\n * @param {string} friendlyPath - The original user-specified path (used for error messages)\n * @param {string} pathFromRoot - The path of `obj` from the schema root\n * @returns {Pointer | null}\n */\n$Ref.prototype.resolve = function (path, options, friendlyPath, pathFromRoot) {\n let pointer = new Pointer(this, path, friendlyPath);\n try {\n return pointer.resolve(this.value, options, pathFromRoot);\n }\n catch (err) {\n if (!options || !options.continueOnError || !isHandledError(err)) {\n throw err;\n }\n\n if (err.path === null) {\n err.path = safePointerToPath(getHash(pathFromRoot));\n }\n\n if (err instanceof InvalidPointerError) {\n // this is a special case - InvalidPointerError is thrown when dereferencing external file,\n // but the issue is caused by the source file that referenced the file that undergoes dereferencing\n err.source = stripHash(pathFromRoot);\n }\n\n this.addError(err);\n return null;\n }\n};\n\n/**\n * Sets the value of a nested property within this {@link $Ref#value}.\n * If the property, or any of its parents don't exist, they will be created.\n *\n * @param {string} path - The full path of the property to set, optionally with a JSON pointer in the hash\n * @param {*} value - The value to assign\n */\n$Ref.prototype.set = function (path, value) {\n let pointer = new Pointer(this, path);\n this.value = pointer.set(this.value, value);\n};\n\n/**\n * Determines whether the given value is a JSON reference.\n *\n * @param {*} value - The value to inspect\n * @returns {boolean}\n */\n$Ref.is$Ref = function (value) {\n return value && typeof value === \"object\" && typeof value.$ref === \"string\" && value.$ref.length > 0;\n};\n\n/**\n * Determines whether the given value is an external JSON reference.\n *\n * @param {*} value - The value to inspect\n * @returns {boolean}\n */\n$Ref.isExternal$Ref = function (value) {\n return $Ref.is$Ref(value) && value.$ref[0] !== \"#\";\n};\n\n/**\n * Determines whether the given value is a JSON reference, and whether it is allowed by the options.\n * For example, if it references an external file, then options.resolve.external must be true.\n *\n * @param {*} value - The value to inspect\n * @param {$RefParserOptions} options\n * @returns {boolean}\n */\n$Ref.isAllowed$Ref = function (value, options) {\n if ($Ref.is$Ref(value)) {\n if (value.$ref.substr(0, 2) === \"#/\" || value.$ref === \"#\") {\n // It's a JSON Pointer reference, which is always allowed\n return true;\n }\n else if (value.$ref[0] !== \"#\" && (!options || options.resolve.external)) {\n // It's an external reference, which is allowed by the options\n return true;\n }\n }\n};\n\n/**\n * Determines whether the given value is a JSON reference that \"extends\" its resolved value.\n * That is, it has extra properties (in addition to \"$ref\"), so rather than simply pointing to\n * an existing value, this $ref actually creates a NEW value that is a shallow copy of the resolved\n * value, plus the extra properties.\n *\n * @example:\n * {\n * person: {\n * properties: {\n * firstName: { type: string }\n * lastName: { type: string }\n * }\n * }\n * employee: {\n * properties: {\n * $ref: #/person/properties\n * salary: { type: number }\n * }\n * }\n * }\n *\n * In this example, \"employee\" is an extended $ref, since it extends \"person\" with an additional\n * property (salary). The result is a NEW value that looks like this:\n *\n * {\n * properties: {\n * firstName: { type: string }\n * lastName: { type: string }\n * salary: { type: number }\n * }\n * }\n *\n * @param {*} value - The value to inspect\n * @returns {boolean}\n */\n$Ref.isExtended$Ref = function (value) {\n return $Ref.is$Ref(value) && Object.keys(value).length > 1;\n};\n\n/**\n * Returns the resolved value of a JSON Reference.\n * If necessary, the resolved value is merged with the JSON Reference to create a new object\n *\n * @example:\n * {\n * person: {\n * properties: {\n * firstName: { type: string }\n * lastName: { type: string }\n * }\n * }\n * employee: {\n * properties: {\n * $ref: #/person/properties\n * salary: { type: number }\n * }\n * }\n * }\n *\n * When \"person\" and \"employee\" are merged, you end up with the following object:\n *\n * {\n * properties: {\n * firstName: { type: string }\n * lastName: { type: string }\n * salary: { type: number }\n * }\n * }\n *\n * @param {object} $ref - The JSON reference object (the one with the \"$ref\" property)\n * @param {*} resolvedValue - The resolved value, which can be any type\n * @returns {*} - Returns the dereferenced value\n */\n$Ref.dereference = function ($ref, resolvedValue) {\n if (resolvedValue && typeof resolvedValue === \"object\" && $Ref.isExtended$Ref($ref)) {\n let merged = {};\n for (let key of Object.keys($ref)) {\n if (key !== \"$ref\") {\n merged[key] = $ref[key];\n }\n }\n\n for (let key of Object.keys(resolvedValue)) {\n if (!(key in merged)) {\n merged[key] = resolvedValue[key];\n }\n }\n\n return merged;\n }\n else {\n // Completely replace the original reference with the resolved value\n return resolvedValue;\n }\n};\n","\"use strict\";\n\nconst { ono } = require(\"@jsdevtools/ono\");\nconst $Ref = require(\"./ref\");\nconst url = require(\"./util/url\");\n\nmodule.exports = $Refs;\n\n/**\n * This class is a map of JSON references and their resolved values.\n */\nfunction $Refs () {\n /**\n * Indicates whether the schema contains any circular references.\n *\n * @type {boolean}\n */\n this.circular = false;\n\n /**\n * A map of paths/urls to {@link $Ref} objects\n *\n * @type {object}\n * @protected\n */\n this._$refs = {};\n\n /**\n * The {@link $Ref} object that is the root of the JSON schema.\n *\n * @type {$Ref}\n * @protected\n */\n this._root$Ref = null;\n}\n\n/**\n * Returns the paths of all the files/URLs that are referenced by the JSON schema,\n * including the schema itself.\n *\n * @param {...string|string[]} [types] - Only return paths of the given types (\"file\", \"http\", etc.)\n * @returns {string[]}\n */\n$Refs.prototype.paths = function (types) { // eslint-disable-line no-unused-vars\n let paths = getPaths(this._$refs, arguments);\n return paths.map((path) => {\n return path.decoded;\n });\n};\n\n/**\n * Returns the map of JSON references and their resolved values.\n *\n * @param {...string|string[]} [types] - Only return references of the given types (\"file\", \"http\", etc.)\n * @returns {object}\n */\n$Refs.prototype.values = function (types) { // eslint-disable-line no-unused-vars\n let $refs = this._$refs;\n let paths = getPaths($refs, arguments);\n return paths.reduce((obj, path) => {\n obj[path.decoded] = $refs[path.encoded].value;\n return obj;\n }, {});\n};\n\n/**\n * Returns a POJO (plain old JavaScript object) for serialization as JSON.\n *\n * @returns {object}\n */\n$Refs.prototype.toJSON = $Refs.prototype.values;\n\n/**\n * Determines whether the given JSON reference exists.\n *\n * @param {string} path - The path being resolved, optionally with a JSON pointer in the hash\n * @param {$RefParserOptions} [options]\n * @returns {boolean}\n */\n$Refs.prototype.exists = function (path, options) {\n try {\n this._resolve(path, \"\", options);\n return true;\n }\n catch (e) {\n return false;\n }\n};\n\n/**\n * Resolves the given JSON reference and returns the resolved value.\n *\n * @param {string} path - The path being resolved, with a JSON pointer in the hash\n * @param {$RefParserOptions} [options]\n * @returns {*} - Returns the resolved value\n */\n$Refs.prototype.get = function (path, options) {\n return this._resolve(path, \"\", options).value;\n};\n\n/**\n * Sets the value of a nested property within this {@link $Ref#value}.\n * If the property, or any of its parents don't exist, they will be created.\n *\n * @param {string} path - The path of the property to set, optionally with a JSON pointer in the hash\n * @param {*} value - The value to assign\n */\n$Refs.prototype.set = function (path, value) {\n let absPath = url.resolve(this._root$Ref.path, path);\n let withoutHash = url.stripHash(absPath);\n let $ref = this._$refs[withoutHash];\n\n if (!$ref) {\n throw ono(`Error resolving $ref pointer \"${path}\". \\n\"${withoutHash}\" not found.`);\n }\n\n $ref.set(absPath, value);\n};\n\n/**\n * Creates a new {@link $Ref} object and adds it to this {@link $Refs} object.\n *\n * @param {string} path - The file path or URL of the referenced file\n */\n$Refs.prototype._add = function (path) {\n let withoutHash = url.stripHash(path);\n\n let $ref = new $Ref();\n $ref.path = withoutHash;\n $ref.$refs = this;\n\n this._$refs[withoutHash] = $ref;\n this._root$Ref = this._root$Ref || $ref;\n\n return $ref;\n};\n\n/**\n * Resolves the given JSON reference.\n *\n * @param {string} path - The path being resolved, optionally with a JSON pointer in the hash\n * @param {string} pathFromRoot - The path of `obj` from the schema root\n * @param {$RefParserOptions} [options]\n * @returns {Pointer}\n * @protected\n */\n$Refs.prototype._resolve = function (path, pathFromRoot, options) {\n let absPath = url.resolve(this._root$Ref.path, path);\n let withoutHash = url.stripHash(absPath);\n let $ref = this._$refs[withoutHash];\n\n if (!$ref) {\n throw ono(`Error resolving $ref pointer \"${path}\". \\n\"${withoutHash}\" not found.`);\n }\n\n return $ref.resolve(absPath, options, path, pathFromRoot);\n};\n\n/**\n * Returns the specified {@link $Ref} object, or undefined.\n *\n * @param {string} path - The path being resolved, optionally with a JSON pointer in the hash\n * @returns {$Ref|undefined}\n * @protected\n */\n$Refs.prototype._get$Ref = function (path) {\n path = url.resolve(this._root$Ref.path, path);\n let withoutHash = url.stripHash(path);\n return this._$refs[withoutHash];\n};\n\n/**\n * Returns the encoded and decoded paths keys of the given object.\n *\n * @param {object} $refs - The object whose keys are URL-encoded paths\n * @param {...string|string[]} [types] - Only return paths of the given types (\"file\", \"http\", etc.)\n * @returns {object[]}\n */\nfunction getPaths ($refs, types) {\n let paths = Object.keys($refs);\n\n // Filter the paths by type\n types = Array.isArray(types[0]) ? types[0] : Array.prototype.slice.call(types);\n if (types.length > 0 && types[0]) {\n paths = paths.filter((key) => {\n return types.indexOf($refs[key].pathType) !== -1;\n });\n }\n\n // Decode local filesystem paths\n return paths.map((path) => {\n return {\n encoded: path,\n decoded: $refs[path].pathType === \"file\" ? url.toFileSystemPath(path, true) : path\n };\n });\n}\n","\"use strict\";\n\nconst $Ref = require(\"./ref\");\nconst Pointer = require(\"./pointer\");\nconst parse = require(\"./parse\");\nconst url = require(\"./util/url\");\nconst { isHandledError } = require(\"./util/errors\");\n\nmodule.exports = resolveExternal;\n\n/**\n * Crawls the JSON schema, finds all external JSON references, and resolves their values.\n * This method does not mutate the JSON schema. The resolved values are added to {@link $RefParser#$refs}.\n *\n * NOTE: We only care about EXTERNAL references here. INTERNAL references are only relevant when dereferencing.\n *\n * @param {$RefParser} parser\n * @param {$RefParserOptions} options\n *\n * @returns {Promise}\n * The promise resolves once all JSON references in the schema have been resolved,\n * including nested references that are contained in externally-referenced files.\n */\nfunction resolveExternal (parser, options) {\n if (!options.resolve.external) {\n // Nothing to resolve, so exit early\n return Promise.resolve();\n }\n\n try {\n // console.log('Resolving $ref pointers in %s', parser.$refs._root$Ref.path);\n let promises = crawl(parser.schema, parser.$refs._root$Ref.path + \"#\", parser.$refs, options);\n return Promise.all(promises);\n }\n catch (e) {\n return Promise.reject(e);\n }\n}\n\n/**\n * Recursively crawls the given value, and resolves any external JSON references.\n *\n * @param {*} obj - The value to crawl. If it's not an object or array, it will be ignored.\n * @param {string} path - The full path of `obj`, possibly with a JSON Pointer in the hash\n * @param {$Refs} $refs\n * @param {$RefParserOptions} options\n * @param {Set} seen - Internal.\n *\n * @returns {Promise[]}\n * Returns an array of promises. There will be one promise for each JSON reference in `obj`.\n * If `obj` does not contain any JSON references, then the array will be empty.\n * If any of the JSON references point to files that contain additional JSON references,\n * then the corresponding promise will internally reference an array of promises.\n */\nfunction crawl (obj, path, $refs, options, seen) {\n seen = seen || new Set();\n let promises = [];\n\n if (obj && typeof obj === \"object\" && !ArrayBuffer.isView(obj) && !seen.has(obj)) {\n seen.add(obj); // Track previously seen objects to avoid infinite recursion\n if ($Ref.isExternal$Ref(obj)) {\n promises.push(resolve$Ref(obj, path, $refs, options));\n }\n else {\n for (let key of Object.keys(obj)) {\n let keyPath = Pointer.join(path, key);\n let value = obj[key];\n\n if ($Ref.isExternal$Ref(value)) {\n promises.push(resolve$Ref(value, keyPath, $refs, options));\n }\n else {\n promises = promises.concat(crawl(value, keyPath, $refs, options, seen));\n }\n }\n }\n }\n\n return promises;\n}\n\n/**\n * Resolves the given JSON Reference, and then crawls the resulting value.\n *\n * @param {{$ref: string}} $ref - The JSON Reference to resolve\n * @param {string} path - The full path of `$ref`, possibly with a JSON Pointer in the hash\n * @param {$Refs} $refs\n * @param {$RefParserOptions} options\n *\n * @returns {Promise}\n * The promise resolves once all JSON references in the object have been resolved,\n * including nested references that are contained in externally-referenced files.\n */\nasync function resolve$Ref ($ref, path, $refs, options) {\n // console.log('Resolving $ref pointer \"%s\" at %s', $ref.$ref, path);\n\n let resolvedPath = url.resolve(path, $ref.$ref);\n let withoutHash = url.stripHash(resolvedPath);\n\n // Do we already have this $ref?\n $ref = $refs._$refs[withoutHash];\n if ($ref) {\n // We've already parsed this $ref, so use the existing value\n return Promise.resolve($ref.value);\n }\n\n // Parse the $referenced file/url\n try {\n const result = await parse(resolvedPath, $refs, options);\n\n // Crawl the parsed value\n // console.log('Resolving $ref pointers in %s', withoutHash);\n let promises = crawl(result, withoutHash + \"#\", $refs, options);\n\n return Promise.all(promises);\n }\n catch (err) {\n if (!options.continueOnError || !isHandledError(err)) {\n throw err;\n }\n\n if ($refs._$refs[withoutHash]) {\n err.source = url.stripHash(path);\n err.path = url.safePointerToPath(url.getHash(path));\n }\n\n return [];\n }\n}\n","\"use strict\";\nconst fs = require(\"fs\");\nconst { ono } = require(\"@jsdevtools/ono\");\nconst url = require(\"../util/url\");\nconst { ResolverError } = require(\"../util/errors\");\n\nmodule.exports = {\n /**\n * The order that this resolver will run, in relation to other resolvers.\n *\n * @type {number}\n */\n order: 100,\n\n /**\n * Determines whether this resolver can read a given file reference.\n * Resolvers that return true will be tried, in order, until one successfully resolves the file.\n * Resolvers that return false will not be given a chance to resolve the file.\n *\n * @param {object} file - An object containing information about the referenced file\n * @param {string} file.url - The full URL of the referenced file\n * @param {string} file.extension - The lowercased file extension (e.g. \".txt\", \".html\", etc.)\n * @returns {boolean}\n */\n canRead (file) {\n return url.isFileSystemPath(file.url);\n },\n\n /**\n * Reads the given file and returns its raw contents as a Buffer.\n *\n * @param {object} file - An object containing information about the referenced file\n * @param {string} file.url - The full URL of the referenced file\n * @param {string} file.extension - The lowercased file extension (e.g. \".txt\", \".html\", etc.)\n * @returns {Promise}\n */\n read (file) {\n return new Promise(((resolve, reject) => {\n let path;\n try {\n path = url.toFileSystemPath(file.url);\n }\n catch (err) {\n reject(new ResolverError(ono.uri(err, `Malformed URI: ${file.url}`), file.url));\n }\n\n // console.log('Opening file: %s', path);\n\n try {\n fs.readFile(path, (err, data) => {\n if (err) {\n reject(new ResolverError(ono(err, `Error opening file \"${path}\"`), path));\n }\n else {\n resolve(data);\n }\n });\n }\n catch (err) {\n reject(new ResolverError(ono(err, `Error opening file \"${path}\"`), path));\n }\n }));\n }\n};\n","\"use strict\";\n\nconst http = require(\"http\");\nconst https = require(\"https\");\nconst { ono } = require(\"@jsdevtools/ono\");\nconst url = require(\"../util/url\");\nconst { ResolverError } = require(\"../util/errors\");\n\nmodule.exports = {\n /**\n * The order that this resolver will run, in relation to other resolvers.\n *\n * @type {number}\n */\n order: 200,\n\n /**\n * HTTP headers to send when downloading files.\n *\n * @example:\n * {\n * \"User-Agent\": \"JSON Schema $Ref Parser\",\n * Accept: \"application/json\"\n * }\n *\n * @type {object}\n */\n headers: null,\n\n /**\n * HTTP request timeout (in milliseconds).\n *\n * @type {number}\n */\n timeout: 5000, // 5 seconds\n\n /**\n * The maximum number of HTTP redirects to follow.\n * To disable automatic following of redirects, set this to zero.\n *\n * @type {number}\n */\n redirects: 5,\n\n /**\n * The `withCredentials` option of XMLHttpRequest.\n * Set this to `true` if you're downloading files from a CORS-enabled server that requires authentication\n *\n * @type {boolean}\n */\n withCredentials: false,\n\n /**\n * Determines whether this resolver can read a given file reference.\n * Resolvers that return true will be tried in order, until one successfully resolves the file.\n * Resolvers that return false will not be given a chance to resolve the file.\n *\n * @param {object} file - An object containing information about the referenced file\n * @param {string} file.url - The full URL of the referenced file\n * @param {string} file.extension - The lowercased file extension (e.g. \".txt\", \".html\", etc.)\n * @returns {boolean}\n */\n canRead (file) {\n return url.isHttp(file.url);\n },\n\n /**\n * Reads the given URL and returns its raw contents as a Buffer.\n *\n * @param {object} file - An object containing information about the referenced file\n * @param {string} file.url - The full URL of the referenced file\n * @param {string} file.extension - The lowercased file extension (e.g. \".txt\", \".html\", etc.)\n * @returns {Promise}\n */\n read (file) {\n let u = url.parse(file.url);\n\n if (process.browser && !u.protocol) {\n // Use the protocol of the current page\n u.protocol = url.parse(location.href).protocol;\n }\n\n return download(u, this);\n }\n};\n\n/**\n * Downloads the given file.\n *\n * @param {Url|string} u - The url to download (can be a parsed {@link Url} object)\n * @param {object} httpOptions - The `options.resolve.http` object\n * @param {number} [redirects] - The redirect URLs that have already been followed\n *\n * @returns {Promise}\n * The promise resolves with the raw downloaded data, or rejects if there is an HTTP error.\n */\nfunction download (u, httpOptions, redirects) {\n return new Promise(((resolve, reject) => {\n u = url.parse(u);\n redirects = redirects || [];\n redirects.push(u.href);\n\n get(u, httpOptions)\n .then((res) => {\n if (res.statusCode >= 400) {\n throw ono({ status: res.statusCode }, `HTTP ERROR ${res.statusCode}`);\n }\n else if (res.statusCode >= 300) {\n if (redirects.length > httpOptions.redirects) {\n reject(new ResolverError(ono({ status: res.statusCode },\n `Error downloading ${redirects[0]}. \\nToo many redirects: \\n ${redirects.join(\" \\n \")}`)));\n }\n else if (!res.headers.location) {\n throw ono({ status: res.statusCode }, `HTTP ${res.statusCode} redirect with no location header`);\n }\n else {\n // console.log('HTTP %d redirect %s -> %s', res.statusCode, u.href, res.headers.location);\n let redirectTo = url.resolve(u, res.headers.location);\n download(redirectTo, httpOptions, redirects).then(resolve, reject);\n }\n }\n else {\n resolve(res.body || Buffer.alloc(0));\n }\n })\n .catch((err) => {\n reject(new ResolverError(ono(err, `Error downloading ${u.href}`), u.href));\n });\n }));\n}\n\n/**\n * Sends an HTTP GET request.\n *\n * @param {Url} u - A parsed {@link Url} object\n * @param {object} httpOptions - The `options.resolve.http` object\n *\n * @returns {Promise}\n * The promise resolves with the HTTP Response object.\n */\nfunction get (u, httpOptions) {\n return new Promise(((resolve, reject) => {\n // console.log('GET', u.href);\n\n let protocol = u.protocol === \"https:\" ? https : http;\n let req = protocol.get({\n hostname: u.hostname,\n port: u.port,\n path: u.path,\n auth: u.auth,\n protocol: u.protocol,\n headers: httpOptions.headers || {},\n withCredentials: httpOptions.withCredentials\n });\n\n if (typeof req.setTimeout === \"function\") {\n req.setTimeout(httpOptions.timeout);\n }\n\n req.on(\"timeout\", () => {\n req.abort();\n });\n\n req.on(\"error\", reject);\n\n req.once(\"response\", (res) => {\n res.body = Buffer.alloc(0);\n\n res.on(\"data\", (data) => {\n res.body = Buffer.concat([res.body, Buffer.from(data)]);\n });\n\n res.on(\"error\", reject);\n\n res.on(\"end\", () => {\n resolve(res);\n });\n });\n }));\n}\n","\"use strict\";\n\nconst { Ono } = require(\"@jsdevtools/ono\");\n\nconst { stripHash, toFileSystemPath } = require(\"./url\");\n\nconst JSONParserError = exports.JSONParserError = class JSONParserError extends Error {\n constructor (message, source) {\n super();\n\n this.code = \"EUNKNOWN\";\n this.message = message;\n this.source = source;\n this.path = null;\n\n Ono.extend(this);\n }\n\n get footprint () {\n return `${this.path}+${this.source}+${this.code}+${this.message}`;\n }\n};\n\nsetErrorName(JSONParserError);\n\nconst JSONParserErrorGroup = exports.JSONParserErrorGroup = class JSONParserErrorGroup extends Error {\n constructor (parser) {\n super();\n\n this.files = parser;\n this.message = `${this.errors.length} error${this.errors.length > 1 ? \"s\" : \"\"} occurred while reading '${toFileSystemPath(parser.$refs._root$Ref.path)}'`;\n\n Ono.extend(this);\n }\n\n static getParserErrors (parser) {\n const errors = [];\n\n for (const $ref of Object.values(parser.$refs._$refs)) {\n if ($ref.errors) {\n errors.push(...$ref.errors);\n }\n }\n\n return errors;\n }\n\n get errors () {\n return JSONParserErrorGroup.getParserErrors(this.files);\n }\n};\n\nsetErrorName(JSONParserErrorGroup);\n\nconst ParserError = exports.ParserError = class ParserError extends JSONParserError {\n constructor (message, source) {\n super(`Error parsing ${source}: ${message}`, source);\n\n this.code = \"EPARSER\";\n }\n};\n\nsetErrorName(ParserError);\n\nconst UnmatchedParserError = exports.UnmatchedParserError = class UnmatchedParserError extends JSONParserError {\n constructor (source) {\n super(`Could not find parser for \"${source}\"`, source);\n\n this.code = \"EUNMATCHEDPARSER\";\n }\n};\n\nsetErrorName(UnmatchedParserError);\n\nconst ResolverError = exports.ResolverError = class ResolverError extends JSONParserError {\n constructor (ex, source) {\n super(ex.message || `Error reading file \"${source}\"`, source);\n\n this.code = \"ERESOLVER\";\n\n if (\"code\" in ex) {\n this.ioErrorCode = String(ex.code);\n }\n }\n};\n\nsetErrorName(ResolverError);\n\nconst UnmatchedResolverError = exports.UnmatchedResolverError = class UnmatchedResolverError extends JSONParserError {\n constructor (source) {\n super(`Could not find resolver for \"${source}\"`, source);\n\n this.code = \"EUNMATCHEDRESOLVER\";\n }\n};\n\nsetErrorName(UnmatchedResolverError);\n\nconst MissingPointerError = exports.MissingPointerError = class MissingPointerError extends JSONParserError {\n constructor (token, path) {\n super(`Token \"${token}\" does not exist.`, stripHash(path));\n\n this.code = \"EMISSINGPOINTER\";\n }\n};\n\nsetErrorName(MissingPointerError);\n\nconst InvalidPointerError = exports.InvalidPointerError = class InvalidPointerError extends JSONParserError {\n constructor (pointer, path) {\n super(`Invalid $ref pointer \"${pointer}\". Pointers must begin with \"#/\"`, stripHash(path));\n\n this.code = \"EINVALIDPOINTER\";\n }\n};\n\nsetErrorName(InvalidPointerError);\n\nfunction setErrorName (err) {\n Object.defineProperty(err.prototype, \"name\", {\n value: err.name,\n enumerable: true,\n });\n}\n\nexports.isHandledError = function (err) {\n return err instanceof JSONParserError || err instanceof JSONParserErrorGroup;\n};\n\nexports.normalizeError = function (err) {\n if (err.path === null) {\n err.path = [];\n }\n\n return err;\n};\n","\"use strict\";\n\n/**\n * Returns the given plugins as an array, rather than an object map.\n * All other methods in this module expect an array of plugins rather than an object map.\n *\n * @param {object} plugins - A map of plugin objects\n * @return {object[]}\n */\nexports.all = function (plugins) {\n return Object.keys(plugins)\n .filter((key) => {\n return typeof plugins[key] === \"object\";\n })\n .map((key) => {\n plugins[key].name = key;\n return plugins[key];\n });\n};\n\n/**\n * Filters the given plugins, returning only the ones return `true` for the given method.\n *\n * @param {object[]} plugins - An array of plugin objects\n * @param {string} method - The name of the filter method to invoke for each plugin\n * @param {object} file - A file info object, which will be passed to each method\n * @return {object[]}\n */\nexports.filter = function (plugins, method, file) {\n return plugins\n .filter((plugin) => {\n return !!getResult(plugin, method, file);\n });\n};\n\n/**\n * Sorts the given plugins, in place, by their `order` property.\n *\n * @param {object[]} plugins - An array of plugin objects\n * @returns {object[]}\n */\nexports.sort = function (plugins) {\n for (let plugin of plugins) {\n plugin.order = plugin.order || Number.MAX_SAFE_INTEGER;\n }\n\n return plugins.sort((a, b) => { return a.order - b.order; });\n};\n\n/**\n * Runs the specified method of the given plugins, in order, until one of them returns a successful result.\n * Each method can return a synchronous value, a Promise, or call an error-first callback.\n * If the promise resolves successfully, or the callback is called without an error, then the result\n * is immediately returned and no further plugins are called.\n * If the promise rejects, or the callback is called with an error, then the next plugin is called.\n * If ALL plugins fail, then the last error is thrown.\n *\n * @param {object[]} plugins - An array of plugin objects\n * @param {string} method - The name of the method to invoke for each plugin\n * @param {object} file - A file info object, which will be passed to each method\n * @returns {Promise}\n */\nexports.run = function (plugins, method, file, $refs) {\n let plugin, lastError, index = 0;\n\n return new Promise(((resolve, reject) => {\n runNextPlugin();\n\n function runNextPlugin () {\n plugin = plugins[index++];\n if (!plugin) {\n // There are no more functions, so re-throw the last error\n return reject(lastError);\n }\n\n try {\n // console.log(' %s', plugin.name);\n let result = getResult(plugin, method, file, callback, $refs);\n if (result && typeof result.then === \"function\") {\n // A promise was returned\n result.then(onSuccess, onError);\n }\n else if (result !== undefined) {\n // A synchronous result was returned\n onSuccess(result);\n }\n else if (index === plugins.length) {\n throw new Error(\"No promise has been returned or callback has been called.\");\n }\n }\n catch (e) {\n onError(e);\n }\n }\n\n function callback (err, result) {\n if (err) {\n onError(err);\n }\n else {\n onSuccess(result);\n }\n }\n\n function onSuccess (result) {\n // console.log(' success');\n resolve({\n plugin,\n result\n });\n }\n\n function onError (error) {\n // console.log(' %s', err.message || err);\n lastError = {\n plugin,\n error,\n };\n runNextPlugin();\n }\n }));\n};\n\n/**\n * Returns the value of the given property.\n * If the property is a function, then the result of the function is returned.\n * If the value is a RegExp, then it will be tested against the file URL.\n * If the value is an aray, then it will be compared against the file extension.\n *\n * @param {object} obj - The object whose property/method is called\n * @param {string} prop - The name of the property/method to invoke\n * @param {object} file - A file info object, which will be passed to the method\n * @param {function} [callback] - A callback function, which will be passed to the method\n * @returns {*}\n */\nfunction getResult (obj, prop, file, callback, $refs) {\n let value = obj[prop];\n\n if (typeof value === \"function\") {\n return value.apply(obj, [file, callback, $refs]);\n }\n\n if (!callback) {\n // The synchronous plugin functions (canParse and canRead)\n // allow a \"shorthand\" syntax, where the user can match\n // files by RegExp or by file extension.\n if (value instanceof RegExp) {\n return value.test(file.url);\n }\n else if (typeof value === \"string\") {\n return value === file.extension;\n }\n else if (Array.isArray(value)) {\n return value.indexOf(file.extension) !== -1;\n }\n }\n\n return value;\n}\n","\"use strict\";\n\nlet isWindows = /^win/.test(process.platform),\n forwardSlashPattern = /\\//g,\n protocolPattern = /^(\\w{2,}):\\/\\//i,\n url = module.exports,\n jsonPointerSlash = /~1/g,\n jsonPointerTilde = /~0/g;\n\n// RegExp patterns to URL-encode special characters in local filesystem paths\nlet urlEncodePatterns = [\n /\\?/g, \"%3F\",\n /\\#/g, \"%23\",\n];\n\n// RegExp patterns to URL-decode special characters for local filesystem paths\nlet urlDecodePatterns = [\n /\\%23/g, \"#\",\n /\\%24/g, \"$\",\n /\\%26/g, \"&\",\n /\\%2C/g, \",\",\n /\\%40/g, \"@\"\n];\n\nexports.parse = require(\"url\").parse;\nexports.resolve = require(\"url\").resolve;\n\n/**\n * Returns the current working directory (in Node) or the current page URL (in browsers).\n *\n * @returns {string}\n */\nexports.cwd = function cwd () {\n if (process.browser) {\n return location.href;\n }\n\n let path = process.cwd();\n\n let lastChar = path.slice(-1);\n if (lastChar === \"/\" || lastChar === \"\\\\\") {\n return path;\n }\n else {\n return path + \"/\";\n }\n};\n\n/**\n * Returns the protocol of the given URL, or `undefined` if it has no protocol.\n *\n * @param {string} path\n * @returns {?string}\n */\nexports.getProtocol = function getProtocol (path) {\n let match = protocolPattern.exec(path);\n if (match) {\n return match[1].toLowerCase();\n }\n};\n\n/**\n * Returns the lowercased file extension of the given URL,\n * or an empty string if it has no extension.\n *\n * @param {string} path\n * @returns {string}\n */\nexports.getExtension = function getExtension (path) {\n let lastDot = path.lastIndexOf(\".\");\n if (lastDot >= 0) {\n return url.stripQuery(path.substr(lastDot).toLowerCase());\n }\n return \"\";\n};\n\n/**\n * Removes the query, if any, from the given path.\n *\n * @param {string} path\n * @returns {string}\n */\nexports.stripQuery = function stripQuery (path) {\n let queryIndex = path.indexOf(\"?\");\n if (queryIndex >= 0) {\n path = path.substr(0, queryIndex);\n }\n return path;\n};\n\n/**\n * Returns the hash (URL fragment), of the given path.\n * If there is no hash, then the root hash (\"#\") is returned.\n *\n * @param {string} path\n * @returns {string}\n */\nexports.getHash = function getHash (path) {\n let hashIndex = path.indexOf(\"#\");\n if (hashIndex >= 0) {\n return path.substr(hashIndex);\n }\n return \"#\";\n};\n\n/**\n * Removes the hash (URL fragment), if any, from the given path.\n *\n * @param {string} path\n * @returns {string}\n */\nexports.stripHash = function stripHash (path) {\n let hashIndex = path.indexOf(\"#\");\n if (hashIndex >= 0) {\n path = path.substr(0, hashIndex);\n }\n return path;\n};\n\n/**\n * Determines whether the given path is an HTTP(S) URL.\n *\n * @param {string} path\n * @returns {boolean}\n */\nexports.isHttp = function isHttp (path) {\n let protocol = url.getProtocol(path);\n if (protocol === \"http\" || protocol === \"https\") {\n return true;\n }\n else if (protocol === undefined) {\n // There is no protocol. If we're running in a browser, then assume it's HTTP.\n return process.browser;\n }\n else {\n // It's some other protocol, such as \"ftp://\", \"mongodb://\", etc.\n return false;\n }\n};\n\n/**\n * Determines whether the given path is a filesystem path.\n * This includes \"file://\" URLs.\n *\n * @param {string} path\n * @returns {boolean}\n */\nexports.isFileSystemPath = function isFileSystemPath (path) {\n if (process.browser) {\n // We're running in a browser, so assume that all paths are URLs.\n // This way, even relative paths will be treated as URLs rather than as filesystem paths\n return false;\n }\n\n let protocol = url.getProtocol(path);\n return protocol === undefined || protocol === \"file\";\n};\n\n/**\n * Converts a filesystem path to a properly-encoded URL.\n *\n * This is intended to handle situations where JSON Schema $Ref Parser is called\n * with a filesystem path that contains characters which are not allowed in URLs.\n *\n * @example\n * The following filesystem paths would be converted to the following URLs:\n *\n * <\"!@#$%^&*+=?'>.json ==> %3C%22!@%23$%25%5E&*+=%3F\\'%3E.json\n * C:\\\\My Documents\\\\File (1).json ==> C:/My%20Documents/File%20(1).json\n * file://Project #42/file.json ==> file://Project%20%2342/file.json\n *\n * @param {string} path\n * @returns {string}\n */\nexports.fromFileSystemPath = function fromFileSystemPath (path) {\n // Step 1: On Windows, replace backslashes with forward slashes,\n // rather than encoding them as \"%5C\"\n if (isWindows) {\n path = path.replace(/\\\\/g, \"/\");\n }\n\n // Step 2: `encodeURI` will take care of MOST characters\n path = encodeURI(path);\n\n // Step 3: Manually encode characters that are not encoded by `encodeURI`.\n // This includes characters such as \"#\" and \"?\", which have special meaning in URLs,\n // but are just normal characters in a filesystem path.\n for (let i = 0; i < urlEncodePatterns.length; i += 2) {\n path = path.replace(urlEncodePatterns[i], urlEncodePatterns[i + 1]);\n }\n\n return path;\n};\n\n/**\n * Converts a URL to a local filesystem path.\n *\n * @param {string} path\n * @param {boolean} [keepFileProtocol] - If true, then \"file://\" will NOT be stripped\n * @returns {string}\n */\nexports.toFileSystemPath = function toFileSystemPath (path, keepFileProtocol) {\n // Step 1: `decodeURI` will decode characters such as Cyrillic characters, spaces, etc.\n path = decodeURI(path);\n\n // Step 2: Manually decode characters that are not decoded by `decodeURI`.\n // This includes characters such as \"#\" and \"?\", which have special meaning in URLs,\n // but are just normal characters in a filesystem path.\n for (let i = 0; i < urlDecodePatterns.length; i += 2) {\n path = path.replace(urlDecodePatterns[i], urlDecodePatterns[i + 1]);\n }\n\n // Step 3: If it's a \"file://\" URL, then format it consistently\n // or convert it to a local filesystem path\n let isFileUrl = path.substr(0, 7).toLowerCase() === \"file://\";\n if (isFileUrl) {\n // Strip-off the protocol, and the initial \"/\", if there is one\n path = path[7] === \"/\" ? path.substr(8) : path.substr(7);\n\n // insert a colon (\":\") after the drive letter on Windows\n if (isWindows && path[1] === \"/\") {\n path = path[0] + \":\" + path.substr(1);\n }\n\n if (keepFileProtocol) {\n // Return the consistently-formatted \"file://\" URL\n path = \"file:///\" + path;\n }\n else {\n // Convert the \"file://\" URL to a local filesystem path.\n // On Windows, it will start with something like \"C:/\".\n // On Posix, it will start with \"/\"\n isFileUrl = false;\n path = isWindows ? path : \"/\" + path;\n }\n }\n\n // Step 4: Normalize Windows paths (unless it's a \"file://\" URL)\n if (isWindows && !isFileUrl) {\n // Replace forward slashes with backslashes\n path = path.replace(forwardSlashPattern, \"\\\\\");\n\n // Capitalize the drive letter\n if (path.substr(1, 2) === \":\\\\\") {\n path = path[0].toUpperCase() + path.substr(1);\n }\n }\n\n return path;\n};\n\n/**\n * Converts a $ref pointer to a valid JSON Path.\n *\n * @param {string} pointer\n * @returns {Array}\n */\nexports.safePointerToPath = function safePointerToPath (pointer) {\n if (pointer.length <= 1 || pointer[0] !== \"#\" || pointer[1] !== \"/\") {\n return [];\n }\n\n return pointer\n .slice(2)\n .split(\"/\")\n .map((value) => {\n return decodeURIComponent(value)\n .replace(jsonPointerSlash, \"/\")\n .replace(jsonPointerTilde, \"~\");\n });\n};\n","'use strict';\n\n\nvar loader = require('./lib/loader');\nvar dumper = require('./lib/dumper');\n\n\nfunction renamed(from, to) {\n return function () {\n throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +\n 'Use yaml.' + to + ' instead, which is now safe by default.');\n };\n}\n\n\nmodule.exports.Type = require('./lib/type');\nmodule.exports.Schema = require('./lib/schema');\nmodule.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe');\nmodule.exports.JSON_SCHEMA = require('./lib/schema/json');\nmodule.exports.CORE_SCHEMA = require('./lib/schema/core');\nmodule.exports.DEFAULT_SCHEMA = require('./lib/schema/default');\nmodule.exports.load = loader.load;\nmodule.exports.loadAll = loader.loadAll;\nmodule.exports.dump = dumper.dump;\nmodule.exports.YAMLException = require('./lib/exception');\n\n// Re-export all types in case user wants to create custom schema\nmodule.exports.types = {\n binary: require('./lib/type/binary'),\n float: require('./lib/type/float'),\n map: require('./lib/type/map'),\n null: require('./lib/type/null'),\n pairs: require('./lib/type/pairs'),\n set: require('./lib/type/set'),\n timestamp: require('./lib/type/timestamp'),\n bool: require('./lib/type/bool'),\n int: require('./lib/type/int'),\n merge: require('./lib/type/merge'),\n omap: require('./lib/type/omap'),\n seq: require('./lib/type/seq'),\n str: require('./lib/type/str')\n};\n\n// Removed functions from JS-YAML 3.0.x\nmodule.exports.safeLoad = renamed('safeLoad', 'load');\nmodule.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll');\nmodule.exports.safeDump = renamed('safeDump', 'dump');\n","'use strict';\n\n\nfunction isNothing(subject) {\n return (typeof subject === 'undefined') || (subject === null);\n}\n\n\nfunction isObject(subject) {\n return (typeof subject === 'object') && (subject !== null);\n}\n\n\nfunction toArray(sequence) {\n if (Array.isArray(sequence)) return sequence;\n else if (isNothing(sequence)) return [];\n\n return [ sequence ];\n}\n\n\nfunction extend(target, source) {\n var index, length, key, sourceKeys;\n\n if (source) {\n sourceKeys = Object.keys(source);\n\n for (index = 0, length = sourceKeys.length; index < length; index += 1) {\n key = sourceKeys[index];\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\n\nfunction repeat(string, count) {\n var result = '', cycle;\n\n for (cycle = 0; cycle < count; cycle += 1) {\n result += string;\n }\n\n return result;\n}\n\n\nfunction isNegativeZero(number) {\n return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);\n}\n\n\nmodule.exports.isNothing = isNothing;\nmodule.exports.isObject = isObject;\nmodule.exports.toArray = toArray;\nmodule.exports.repeat = repeat;\nmodule.exports.isNegativeZero = isNegativeZero;\nmodule.exports.extend = extend;\n","'use strict';\n\n/*eslint-disable no-use-before-define*/\n\nvar common = require('./common');\nvar YAMLException = require('./exception');\nvar DEFAULT_SCHEMA = require('./schema/default');\n\nvar _toString = Object.prototype.toString;\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar CHAR_BOM = 0xFEFF;\nvar CHAR_TAB = 0x09; /* Tab */\nvar CHAR_LINE_FEED = 0x0A; /* LF */\nvar CHAR_CARRIAGE_RETURN = 0x0D; /* CR */\nvar CHAR_SPACE = 0x20; /* Space */\nvar CHAR_EXCLAMATION = 0x21; /* ! */\nvar CHAR_DOUBLE_QUOTE = 0x22; /* \" */\nvar CHAR_SHARP = 0x23; /* # */\nvar CHAR_PERCENT = 0x25; /* % */\nvar CHAR_AMPERSAND = 0x26; /* & */\nvar CHAR_SINGLE_QUOTE = 0x27; /* ' */\nvar CHAR_ASTERISK = 0x2A; /* * */\nvar CHAR_COMMA = 0x2C; /* , */\nvar CHAR_MINUS = 0x2D; /* - */\nvar CHAR_COLON = 0x3A; /* : */\nvar CHAR_EQUALS = 0x3D; /* = */\nvar CHAR_GREATER_THAN = 0x3E; /* > */\nvar CHAR_QUESTION = 0x3F; /* ? */\nvar CHAR_COMMERCIAL_AT = 0x40; /* @ */\nvar CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */\nvar CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */\nvar CHAR_GRAVE_ACCENT = 0x60; /* ` */\nvar CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */\nvar CHAR_VERTICAL_LINE = 0x7C; /* | */\nvar CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */\n\nvar ESCAPE_SEQUENCES = {};\n\nESCAPE_SEQUENCES[0x00] = '\\\\0';\nESCAPE_SEQUENCES[0x07] = '\\\\a';\nESCAPE_SEQUENCES[0x08] = '\\\\b';\nESCAPE_SEQUENCES[0x09] = '\\\\t';\nESCAPE_SEQUENCES[0x0A] = '\\\\n';\nESCAPE_SEQUENCES[0x0B] = '\\\\v';\nESCAPE_SEQUENCES[0x0C] = '\\\\f';\nESCAPE_SEQUENCES[0x0D] = '\\\\r';\nESCAPE_SEQUENCES[0x1B] = '\\\\e';\nESCAPE_SEQUENCES[0x22] = '\\\\\"';\nESCAPE_SEQUENCES[0x5C] = '\\\\\\\\';\nESCAPE_SEQUENCES[0x85] = '\\\\N';\nESCAPE_SEQUENCES[0xA0] = '\\\\_';\nESCAPE_SEQUENCES[0x2028] = '\\\\L';\nESCAPE_SEQUENCES[0x2029] = '\\\\P';\n\nvar DEPRECATED_BOOLEANS_SYNTAX = [\n 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',\n 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'\n];\n\nvar DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/;\n\nfunction compileStyleMap(schema, map) {\n var result, keys, index, length, tag, style, type;\n\n if (map === null) return {};\n\n result = {};\n keys = Object.keys(map);\n\n for (index = 0, length = keys.length; index < length; index += 1) {\n tag = keys[index];\n style = String(map[tag]);\n\n if (tag.slice(0, 2) === '!!') {\n tag = 'tag:yaml.org,2002:' + tag.slice(2);\n }\n type = schema.compiledTypeMap['fallback'][tag];\n\n if (type && _hasOwnProperty.call(type.styleAliases, style)) {\n style = type.styleAliases[style];\n }\n\n result[tag] = style;\n }\n\n return result;\n}\n\nfunction encodeHex(character) {\n var string, handle, length;\n\n string = character.toString(16).toUpperCase();\n\n if (character <= 0xFF) {\n handle = 'x';\n length = 2;\n } else if (character <= 0xFFFF) {\n handle = 'u';\n length = 4;\n } else if (character <= 0xFFFFFFFF) {\n handle = 'U';\n length = 8;\n } else {\n throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');\n }\n\n return '\\\\' + handle + common.repeat('0', length - string.length) + string;\n}\n\n\nvar QUOTING_TYPE_SINGLE = 1,\n QUOTING_TYPE_DOUBLE = 2;\n\nfunction State(options) {\n this.schema = options['schema'] || DEFAULT_SCHEMA;\n this.indent = Math.max(1, (options['indent'] || 2));\n this.noArrayIndent = options['noArrayIndent'] || false;\n this.skipInvalid = options['skipInvalid'] || false;\n this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);\n this.styleMap = compileStyleMap(this.schema, options['styles'] || null);\n this.sortKeys = options['sortKeys'] || false;\n this.lineWidth = options['lineWidth'] || 80;\n this.noRefs = options['noRefs'] || false;\n this.noCompatMode = options['noCompatMode'] || false;\n this.condenseFlow = options['condenseFlow'] || false;\n this.quotingType = options['quotingType'] === '\"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;\n this.forceQuotes = options['forceQuotes'] || false;\n this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null;\n\n this.implicitTypes = this.schema.compiledImplicit;\n this.explicitTypes = this.schema.compiledExplicit;\n\n this.tag = null;\n this.result = '';\n\n this.duplicates = [];\n this.usedDuplicates = null;\n}\n\n// Indents every line in a string. Empty lines (\\n only) are not indented.\nfunction indentString(string, spaces) {\n var ind = common.repeat(' ', spaces),\n position = 0,\n next = -1,\n result = '',\n line,\n length = string.length;\n\n while (position < length) {\n next = string.indexOf('\\n', position);\n if (next === -1) {\n line = string.slice(position);\n position = length;\n } else {\n line = string.slice(position, next + 1);\n position = next + 1;\n }\n\n if (line.length && line !== '\\n') result += ind;\n\n result += line;\n }\n\n return result;\n}\n\nfunction generateNextLine(state, level) {\n return '\\n' + common.repeat(' ', state.indent * level);\n}\n\nfunction testImplicitResolving(state, str) {\n var index, length, type;\n\n for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {\n type = state.implicitTypes[index];\n\n if (type.resolve(str)) {\n return true;\n }\n }\n\n return false;\n}\n\n// [33] s-white ::= s-space | s-tab\nfunction isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}\n\n// Returns true if the character can be printed without escaping.\n// From YAML 1.2: \"any allowed characters known to be non-printable\n// should also be escaped. [However,] This isn’t mandatory\"\n// Derived from nb-char - \\t - #x85 - #xA0 - #x2028 - #x2029.\nfunction isPrintable(c) {\n return (0x00020 <= c && c <= 0x00007E)\n || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)\n || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM)\n || (0x10000 <= c && c <= 0x10FFFF);\n}\n\n// [34] ns-char ::= nb-char - s-white\n// [27] nb-char ::= c-printable - b-char - c-byte-order-mark\n// [26] b-char ::= b-line-feed | b-carriage-return\n// Including s-white (for some reason, examples doesn't match specs in this aspect)\n// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark\nfunction isNsCharOrWhitespace(c) {\n return isPrintable(c)\n && c !== CHAR_BOM\n // - b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}\n\n// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out\n// c = flow-in ⇒ ns-plain-safe-in\n// c = block-key ⇒ ns-plain-safe-out\n// c = flow-key ⇒ ns-plain-safe-in\n// [128] ns-plain-safe-out ::= ns-char\n// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator\n// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” )\n// | ( /* An ns-char preceding */ “#” )\n// | ( “:” /* Followed by an ns-plain-safe(c) */ )\nfunction isPlainSafe(c, prev, inblock) {\n var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);\n var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);\n return (\n // ns-plain-safe\n inblock ? // c = flow-in\n cIsNsCharOrWhitespace\n : cIsNsCharOrWhitespace\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n )\n // ns-plain-char\n && c !== CHAR_SHARP // false on '#'\n && !(prev === CHAR_COLON && !cIsNsChar) // false on ': '\n || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#'\n || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]'\n}\n\n// Simplified test for values allowed as the first character in plain style.\nfunction isPlainSafeFirst(c) {\n // Uses a subset of ns-char - c-indicator\n // where ns-char = nb-char - s-white.\n // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part\n return isPrintable(c) && c !== CHAR_BOM\n && !isWhitespace(c) // - s-white\n // - (c-indicator ::=\n // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n && c !== CHAR_MINUS\n && c !== CHAR_QUESTION\n && c !== CHAR_COLON\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “\"”\n && c !== CHAR_SHARP\n && c !== CHAR_AMPERSAND\n && c !== CHAR_ASTERISK\n && c !== CHAR_EXCLAMATION\n && c !== CHAR_VERTICAL_LINE\n && c !== CHAR_EQUALS\n && c !== CHAR_GREATER_THAN\n && c !== CHAR_SINGLE_QUOTE\n && c !== CHAR_DOUBLE_QUOTE\n // | “%” | “@” | “`”)\n && c !== CHAR_PERCENT\n && c !== CHAR_COMMERCIAL_AT\n && c !== CHAR_GRAVE_ACCENT;\n}\n\n// Simplified test for values allowed as the last character in plain style.\nfunction isPlainSafeLast(c) {\n // just not whitespace or colon, it will be checked to be plain character later\n return !isWhitespace(c) && c !== CHAR_COLON;\n}\n\n// Same as 'string'.codePointAt(pos), but works in older browsers.\nfunction codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}\n\n// Determines whether block indentation indicator is required.\nfunction needIndentIndicator(string) {\n var leadingSpaceRe = /^\\n* /;\n return leadingSpaceRe.test(string);\n}\n\nvar STYLE_PLAIN = 1,\n STYLE_SINGLE = 2,\n STYLE_LITERAL = 3,\n STYLE_FOLDED = 4,\n STYLE_DOUBLE = 5;\n\n// Determines which scalar styles are possible and returns the preferred style.\n// lineWidth = -1 => no limit.\n// Pre-conditions: str.length > 0.\n// Post-conditions:\n// STYLE_PLAIN or STYLE_SINGLE => no \\n are in the string.\n// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).\n// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).\nfunction chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,\n testAmbiguousType, quotingType, forceQuotes, inblock) {\n\n var i;\n var char = 0;\n var prevChar = null;\n var hasLineBreak = false;\n var hasFoldableLine = false; // only checked if shouldTrackWidth\n var shouldTrackWidth = lineWidth !== -1;\n var previousLineBreak = -1; // count the first line correctly\n var plain = isPlainSafeFirst(codePointAt(string, 0))\n && isPlainSafeLast(codePointAt(string, string.length - 1));\n\n if (singleLineOnly || forceQuotes) {\n // Case: no block styles.\n // Check for disallowed characters to rule out plain and single.\n for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n if (!isPrintable(char)) {\n return STYLE_DOUBLE;\n }\n plain = plain && isPlainSafe(char, prevChar, inblock);\n prevChar = char;\n }\n } else {\n // Case: block styles permitted.\n for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n if (char === CHAR_LINE_FEED) {\n hasLineBreak = true;\n // Check if any line can be folded.\n if (shouldTrackWidth) {\n hasFoldableLine = hasFoldableLine ||\n // Foldable line = too long, and not more-indented.\n (i - previousLineBreak - 1 > lineWidth &&\n string[previousLineBreak + 1] !== ' ');\n previousLineBreak = i;\n }\n } else if (!isPrintable(char)) {\n return STYLE_DOUBLE;\n }\n plain = plain && isPlainSafe(char, prevChar, inblock);\n prevChar = char;\n }\n // in case the end is missing a \\n\n hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&\n (i - previousLineBreak - 1 > lineWidth &&\n string[previousLineBreak + 1] !== ' '));\n }\n // Although every style can represent \\n without escaping, prefer block styles\n // for multiline, since they're more readable and they don't add empty lines.\n // Also prefer folding a super-long line.\n if (!hasLineBreak && !hasFoldableLine) {\n // Strings interpretable as another type have to be quoted;\n // e.g. the string 'true' vs. the boolean true.\n if (plain && !forceQuotes && !testAmbiguousType(string)) {\n return STYLE_PLAIN;\n }\n return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;\n }\n // Edge case: block indentation indicator can only have one digit.\n if (indentPerLevel > 9 && needIndentIndicator(string)) {\n return STYLE_DOUBLE;\n }\n // At this point we know block styles are valid.\n // Prefer literal style unless we want to fold.\n if (!forceQuotes) {\n return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;\n }\n return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;\n}\n\n// Note: line breaking/folding is implemented for only the folded style.\n// NB. We drop the last trailing newline (if any) of a returned block scalar\n// since the dumper adds its own newline. This always works:\n// • No ending newline => unaffected; already using strip \"-\" chomping.\n// • Ending newline => removed then restored.\n// Importantly, this keeps the \"+\" chomp indicator from gaining an extra line.\nfunction writeScalar(state, string, level, iskey, inblock) {\n state.dump = (function () {\n if (string.length === 0) {\n return state.quotingType === QUOTING_TYPE_DOUBLE ? '\"\"' : \"''\";\n }\n if (!state.noCompatMode) {\n if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {\n return state.quotingType === QUOTING_TYPE_DOUBLE ? ('\"' + string + '\"') : (\"'\" + string + \"'\");\n }\n }\n\n var indent = state.indent * Math.max(1, level); // no 0-indent scalars\n // As indentation gets deeper, let the width decrease monotonically\n // to the lower bound min(state.lineWidth, 40).\n // Note that this implies\n // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.\n // state.lineWidth > 40 + state.indent: width decreases until the lower bound.\n // This behaves better than a constant minimum width which disallows narrower options,\n // or an indent threshold which causes the width to suddenly increase.\n var lineWidth = state.lineWidth === -1\n ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);\n\n // Without knowing if keys are implicit/explicit, assume implicit for safety.\n var singleLineOnly = iskey\n // No block styles in flow mode.\n || (state.flowLevel > -1 && level >= state.flowLevel);\n function testAmbiguity(string) {\n return testImplicitResolving(state, string);\n }\n\n switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,\n testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {\n\n case STYLE_PLAIN:\n return string;\n case STYLE_SINGLE:\n return \"'\" + string.replace(/'/g, \"''\") + \"'\";\n case STYLE_LITERAL:\n return '|' + blockHeader(string, state.indent)\n + dropEndingNewline(indentString(string, indent));\n case STYLE_FOLDED:\n return '>' + blockHeader(string, state.indent)\n + dropEndingNewline(indentString(foldString(string, lineWidth), indent));\n case STYLE_DOUBLE:\n return '\"' + escapeString(string, lineWidth) + '\"';\n default:\n throw new YAMLException('impossible error: invalid scalar style');\n }\n }());\n}\n\n// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.\nfunction blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}\n\n// (See the note for writeScalar.)\nfunction dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}\n\n// Note: a long line without a suitable break point will exceed the width limit.\n// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.\nfunction foldString(string, width) {\n // In folded style, $k$ consecutive newlines output as $k+1$ newlines—\n // unless they're before or after a more-indented line, or at the very\n // beginning or end, in which case $k$ maps to $k$.\n // Therefore, parse each chunk as newline(s) followed by a content line.\n var lineRe = /(\\n+)([^\\n]*)/g;\n\n // first line (possibly an empty line)\n var result = (function () {\n var nextLF = string.indexOf('\\n');\n nextLF = nextLF !== -1 ? nextLF : string.length;\n lineRe.lastIndex = nextLF;\n return foldLine(string.slice(0, nextLF), width);\n }());\n // If we haven't reached the first content line yet, don't add an extra \\n.\n var prevMoreIndented = string[0] === '\\n' || string[0] === ' ';\n var moreIndented;\n\n // rest of the lines\n var match;\n while ((match = lineRe.exec(string))) {\n var prefix = match[1], line = match[2];\n moreIndented = (line[0] === ' ');\n result += prefix\n + (!prevMoreIndented && !moreIndented && line !== ''\n ? '\\n' : '')\n + foldLine(line, width);\n prevMoreIndented = moreIndented;\n }\n\n return result;\n}\n\n// Greedy line breaking.\n// Picks the longest line under the limit each time,\n// otherwise settles for the shortest line over the limit.\n// NB. More-indented lines *cannot* be folded, as that would add an extra \\n.\nfunction foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}\n\n// Escapes a double-quoted string.\nfunction escapeString(string) {\n var result = '';\n var char = 0;\n var escapeSeq;\n\n for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n escapeSeq = ESCAPE_SEQUENCES[char];\n\n if (!escapeSeq && isPrintable(char)) {\n result += string[i];\n if (char >= 0x10000) result += string[i + 1];\n } else {\n result += escapeSeq || encodeHex(char);\n }\n }\n\n return result;\n}\n\nfunction writeFlowSequence(state, level, object) {\n var _result = '',\n _tag = state.tag,\n index,\n length,\n value;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n value = object[index];\n\n if (state.replacer) {\n value = state.replacer.call(object, String(index), value);\n }\n\n // Write only valid elements, put null instead of invalid elements.\n if (writeNode(state, level, value, false, false) ||\n (typeof value === 'undefined' &&\n writeNode(state, level, null, false, false))) {\n\n if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '');\n _result += state.dump;\n }\n }\n\n state.tag = _tag;\n state.dump = '[' + _result + ']';\n}\n\nfunction writeBlockSequence(state, level, object, compact) {\n var _result = '',\n _tag = state.tag,\n index,\n length,\n value;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n value = object[index];\n\n if (state.replacer) {\n value = state.replacer.call(object, String(index), value);\n }\n\n // Write only valid elements, put null instead of invalid elements.\n if (writeNode(state, level + 1, value, true, true, false, true) ||\n (typeof value === 'undefined' &&\n writeNode(state, level + 1, null, true, true, false, true))) {\n\n if (!compact || _result !== '') {\n _result += generateNextLine(state, level);\n }\n\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n _result += '-';\n } else {\n _result += '- ';\n }\n\n _result += state.dump;\n }\n }\n\n state.tag = _tag;\n state.dump = _result || '[]'; // Empty sequence if no valid values.\n}\n\nfunction writeFlowMapping(state, level, object) {\n var _result = '',\n _tag = state.tag,\n objectKeyList = Object.keys(object),\n index,\n length,\n objectKey,\n objectValue,\n pairBuffer;\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n\n pairBuffer = '';\n if (_result !== '') pairBuffer += ', ';\n\n if (state.condenseFlow) pairBuffer += '\"';\n\n objectKey = objectKeyList[index];\n objectValue = object[objectKey];\n\n if (state.replacer) {\n objectValue = state.replacer.call(object, objectKey, objectValue);\n }\n\n if (!writeNode(state, level, objectKey, false, false)) {\n continue; // Skip this pair because of invalid key;\n }\n\n if (state.dump.length > 1024) pairBuffer += '? ';\n\n pairBuffer += state.dump + (state.condenseFlow ? '\"' : '') + ':' + (state.condenseFlow ? '' : ' ');\n\n if (!writeNode(state, level, objectValue, false, false)) {\n continue; // Skip this pair because of invalid value.\n }\n\n pairBuffer += state.dump;\n\n // Both key and value are valid.\n _result += pairBuffer;\n }\n\n state.tag = _tag;\n state.dump = '{' + _result + '}';\n}\n\nfunction writeBlockMapping(state, level, object, compact) {\n var _result = '',\n _tag = state.tag,\n objectKeyList = Object.keys(object),\n index,\n length,\n objectKey,\n objectValue,\n explicitPair,\n pairBuffer;\n\n // Allow sorting keys so that the output file is deterministic\n if (state.sortKeys === true) {\n // Default sorting\n objectKeyList.sort();\n } else if (typeof state.sortKeys === 'function') {\n // Custom sort function\n objectKeyList.sort(state.sortKeys);\n } else if (state.sortKeys) {\n // Something is wrong\n throw new YAMLException('sortKeys must be a boolean or a function');\n }\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n pairBuffer = '';\n\n if (!compact || _result !== '') {\n pairBuffer += generateNextLine(state, level);\n }\n\n objectKey = objectKeyList[index];\n objectValue = object[objectKey];\n\n if (state.replacer) {\n objectValue = state.replacer.call(object, objectKey, objectValue);\n }\n\n if (!writeNode(state, level + 1, objectKey, true, true, true)) {\n continue; // Skip this pair because of invalid key.\n }\n\n explicitPair = (state.tag !== null && state.tag !== '?') ||\n (state.dump && state.dump.length > 1024);\n\n if (explicitPair) {\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n pairBuffer += '?';\n } else {\n pairBuffer += '? ';\n }\n }\n\n pairBuffer += state.dump;\n\n if (explicitPair) {\n pairBuffer += generateNextLine(state, level);\n }\n\n if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {\n continue; // Skip this pair because of invalid value.\n }\n\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n pairBuffer += ':';\n } else {\n pairBuffer += ': ';\n }\n\n pairBuffer += state.dump;\n\n // Both key and value are valid.\n _result += pairBuffer;\n }\n\n state.tag = _tag;\n state.dump = _result || '{}'; // Empty mapping if no valid pairs.\n}\n\nfunction detectType(state, object, explicit) {\n var _result, typeList, index, length, type, style;\n\n typeList = explicit ? state.explicitTypes : state.implicitTypes;\n\n for (index = 0, length = typeList.length; index < length; index += 1) {\n type = typeList[index];\n\n if ((type.instanceOf || type.predicate) &&\n (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&\n (!type.predicate || type.predicate(object))) {\n\n if (explicit) {\n if (type.multi && type.representName) {\n state.tag = type.representName(object);\n } else {\n state.tag = type.tag;\n }\n } else {\n state.tag = '?';\n }\n\n if (type.represent) {\n style = state.styleMap[type.tag] || type.defaultStyle;\n\n if (_toString.call(type.represent) === '[object Function]') {\n _result = type.represent(object, style);\n } else if (_hasOwnProperty.call(type.represent, style)) {\n _result = type.represent[style](object, style);\n } else {\n throw new YAMLException('!<' + type.tag + '> tag resolver accepts not \"' + style + '\" style');\n }\n\n state.dump = _result;\n }\n\n return true;\n }\n }\n\n return false;\n}\n\n// Serializes `object` and writes it to global `result`.\n// Returns true on success, or false on invalid object.\n//\nfunction writeNode(state, level, object, block, compact, iskey, isblockseq) {\n state.tag = null;\n state.dump = object;\n\n if (!detectType(state, object, false)) {\n detectType(state, object, true);\n }\n\n var type = _toString.call(state.dump);\n var inblock = block;\n var tagStr;\n\n if (block) {\n block = (state.flowLevel < 0 || state.flowLevel > level);\n }\n\n var objectOrArray = type === '[object Object]' || type === '[object Array]',\n duplicateIndex,\n duplicate;\n\n if (objectOrArray) {\n duplicateIndex = state.duplicates.indexOf(object);\n duplicate = duplicateIndex !== -1;\n }\n\n if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {\n compact = false;\n }\n\n if (duplicate && state.usedDuplicates[duplicateIndex]) {\n state.dump = '*ref_' + duplicateIndex;\n } else {\n if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {\n state.usedDuplicates[duplicateIndex] = true;\n }\n if (type === '[object Object]') {\n if (block && (Object.keys(state.dump).length !== 0)) {\n writeBlockMapping(state, level, state.dump, compact);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + state.dump;\n }\n } else {\n writeFlowMapping(state, level, state.dump);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;\n }\n }\n } else if (type === '[object Array]') {\n if (block && (state.dump.length !== 0)) {\n if (state.noArrayIndent && !isblockseq && level > 0) {\n writeBlockSequence(state, level - 1, state.dump, compact);\n } else {\n writeBlockSequence(state, level, state.dump, compact);\n }\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + state.dump;\n }\n } else {\n writeFlowSequence(state, level, state.dump);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;\n }\n }\n } else if (type === '[object String]') {\n if (state.tag !== '?') {\n writeScalar(state, state.dump, level, iskey, inblock);\n }\n } else if (type === '[object Undefined]') {\n return false;\n } else {\n if (state.skipInvalid) return false;\n throw new YAMLException('unacceptable kind of an object to dump ' + type);\n }\n\n if (state.tag !== null && state.tag !== '?') {\n // Need to encode all characters except those allowed by the spec:\n //\n // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */\n // [36] ns-hex-digit ::= ns-dec-digit\n // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */\n // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */\n // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-”\n // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#”\n // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,”\n // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]”\n //\n // Also need to encode '!' because it has special meaning (end of tag prefix).\n //\n tagStr = encodeURI(\n state.tag[0] === '!' ? state.tag.slice(1) : state.tag\n ).replace(/!/g, '%21');\n\n if (state.tag[0] === '!') {\n tagStr = '!' + tagStr;\n } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {\n tagStr = '!!' + tagStr.slice(18);\n } else {\n tagStr = '!<' + tagStr + '>';\n }\n\n state.dump = tagStr + ' ' + state.dump;\n }\n }\n\n return true;\n}\n\nfunction getDuplicateReferences(object, state) {\n var objects = [],\n duplicatesIndexes = [],\n index,\n length;\n\n inspectNode(object, objects, duplicatesIndexes);\n\n for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {\n state.duplicates.push(objects[duplicatesIndexes[index]]);\n }\n state.usedDuplicates = new Array(length);\n}\n\nfunction inspectNode(object, objects, duplicatesIndexes) {\n var objectKeyList,\n index,\n length;\n\n if (object !== null && typeof object === 'object') {\n index = objects.indexOf(object);\n if (index !== -1) {\n if (duplicatesIndexes.indexOf(index) === -1) {\n duplicatesIndexes.push(index);\n }\n } else {\n objects.push(object);\n\n if (Array.isArray(object)) {\n for (index = 0, length = object.length; index < length; index += 1) {\n inspectNode(object[index], objects, duplicatesIndexes);\n }\n } else {\n objectKeyList = Object.keys(object);\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);\n }\n }\n }\n }\n}\n\nfunction dump(input, options) {\n options = options || {};\n\n var state = new State(options);\n\n if (!state.noRefs) getDuplicateReferences(input, state);\n\n var value = input;\n\n if (state.replacer) {\n value = state.replacer.call({ '': value }, '', value);\n }\n\n if (writeNode(state, 0, value, true, true)) return state.dump + '\\n';\n\n return '';\n}\n\nmodule.exports.dump = dump;\n","// YAML error class. http://stackoverflow.com/questions/8458984\n//\n'use strict';\n\n\nfunction formatError(exception, compact) {\n var where = '', message = exception.reason || '(unknown reason)';\n\n if (!exception.mark) return message;\n\n if (exception.mark.name) {\n where += 'in \"' + exception.mark.name + '\" ';\n }\n\n where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')';\n\n if (!compact && exception.mark.snippet) {\n where += '\\n\\n' + exception.mark.snippet;\n }\n\n return message + ' ' + where;\n}\n\n\nfunction YAMLException(reason, mark) {\n // Super constructor\n Error.call(this);\n\n this.name = 'YAMLException';\n this.reason = reason;\n this.mark = mark;\n this.message = formatError(this, false);\n\n // Include stack trace in error object\n if (Error.captureStackTrace) {\n // Chrome and NodeJS\n Error.captureStackTrace(this, this.constructor);\n } else {\n // FF, IE 10+ and Safari 6+. Fallback for others\n this.stack = (new Error()).stack || '';\n }\n}\n\n\n// Inherit from Error\nYAMLException.prototype = Object.create(Error.prototype);\nYAMLException.prototype.constructor = YAMLException;\n\n\nYAMLException.prototype.toString = function toString(compact) {\n return this.name + ': ' + formatError(this, compact);\n};\n\n\nmodule.exports = YAMLException;\n","'use strict';\n\n/*eslint-disable max-len,no-use-before-define*/\n\nvar common = require('./common');\nvar YAMLException = require('./exception');\nvar makeSnippet = require('./snippet');\nvar DEFAULT_SCHEMA = require('./schema/default');\n\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\n\nvar CONTEXT_FLOW_IN = 1;\nvar CONTEXT_FLOW_OUT = 2;\nvar CONTEXT_BLOCK_IN = 3;\nvar CONTEXT_BLOCK_OUT = 4;\n\n\nvar CHOMPING_CLIP = 1;\nvar CHOMPING_STRIP = 2;\nvar CHOMPING_KEEP = 3;\n\n\nvar PATTERN_NON_PRINTABLE = /[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/;\nvar PATTERN_NON_ASCII_LINE_BREAKS = /[\\x85\\u2028\\u2029]/;\nvar PATTERN_FLOW_INDICATORS = /[,\\[\\]\\{\\}]/;\nvar PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\\-]+!)$/i;\nvar PATTERN_TAG_URI = /^(?:!|[^,\\[\\]\\{\\}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;\\/\\?:@&=\\+\\$,_\\.!~\\*'\\(\\)\\[\\]])*$/i;\n\n\nfunction _class(obj) { return Object.prototype.toString.call(obj); }\n\nfunction is_EOL(c) {\n return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);\n}\n\nfunction is_WHITE_SPACE(c) {\n return (c === 0x09/* Tab */) || (c === 0x20/* Space */);\n}\n\nfunction is_WS_OR_EOL(c) {\n return (c === 0x09/* Tab */) ||\n (c === 0x20/* Space */) ||\n (c === 0x0A/* LF */) ||\n (c === 0x0D/* CR */);\n}\n\nfunction is_FLOW_INDICATOR(c) {\n return c === 0x2C/* , */ ||\n c === 0x5B/* [ */ ||\n c === 0x5D/* ] */ ||\n c === 0x7B/* { */ ||\n c === 0x7D/* } */;\n}\n\nfunction fromHexCode(c) {\n var lc;\n\n if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {\n return c - 0x30;\n }\n\n /*eslint-disable no-bitwise*/\n lc = c | 0x20;\n\n if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {\n return lc - 0x61 + 10;\n }\n\n return -1;\n}\n\nfunction escapedHexLen(c) {\n if (c === 0x78/* x */) { return 2; }\n if (c === 0x75/* u */) { return 4; }\n if (c === 0x55/* U */) { return 8; }\n return 0;\n}\n\nfunction fromDecimalCode(c) {\n if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {\n return c - 0x30;\n }\n\n return -1;\n}\n\nfunction simpleEscapeSequence(c) {\n /* eslint-disable indent */\n return (c === 0x30/* 0 */) ? '\\x00' :\n (c === 0x61/* a */) ? '\\x07' :\n (c === 0x62/* b */) ? '\\x08' :\n (c === 0x74/* t */) ? '\\x09' :\n (c === 0x09/* Tab */) ? '\\x09' :\n (c === 0x6E/* n */) ? '\\x0A' :\n (c === 0x76/* v */) ? '\\x0B' :\n (c === 0x66/* f */) ? '\\x0C' :\n (c === 0x72/* r */) ? '\\x0D' :\n (c === 0x65/* e */) ? '\\x1B' :\n (c === 0x20/* Space */) ? ' ' :\n (c === 0x22/* \" */) ? '\\x22' :\n (c === 0x2F/* / */) ? '/' :\n (c === 0x5C/* \\ */) ? '\\x5C' :\n (c === 0x4E/* N */) ? '\\x85' :\n (c === 0x5F/* _ */) ? '\\xA0' :\n (c === 0x4C/* L */) ? '\\u2028' :\n (c === 0x50/* P */) ? '\\u2029' : '';\n}\n\nfunction charFromCodepoint(c) {\n if (c <= 0xFFFF) {\n return String.fromCharCode(c);\n }\n // Encode UTF-16 surrogate pair\n // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF\n return String.fromCharCode(\n ((c - 0x010000) >> 10) + 0xD800,\n ((c - 0x010000) & 0x03FF) + 0xDC00\n );\n}\n\nvar simpleEscapeCheck = new Array(256); // integer, for fast access\nvar simpleEscapeMap = new Array(256);\nfor (var i = 0; i < 256; i++) {\n simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;\n simpleEscapeMap[i] = simpleEscapeSequence(i);\n}\n\n\nfunction State(input, options) {\n this.input = input;\n\n this.filename = options['filename'] || null;\n this.schema = options['schema'] || DEFAULT_SCHEMA;\n this.onWarning = options['onWarning'] || null;\n // (Hidden) Remove? makes the loader to expect YAML 1.1 documents\n // if such documents have no explicit %YAML directive\n this.legacy = options['legacy'] || false;\n\n this.json = options['json'] || false;\n this.listener = options['listener'] || null;\n\n this.implicitTypes = this.schema.compiledImplicit;\n this.typeMap = this.schema.compiledTypeMap;\n\n this.length = input.length;\n this.position = 0;\n this.line = 0;\n this.lineStart = 0;\n this.lineIndent = 0;\n\n // position of first leading tab in the current line,\n // used to make sure there are no tabs in the indentation\n this.firstTabInLine = -1;\n\n this.documents = [];\n\n /*\n this.version;\n this.checkLineBreaks;\n this.tagMap;\n this.anchorMap;\n this.tag;\n this.anchor;\n this.kind;\n this.result;*/\n\n}\n\n\nfunction generateError(state, message) {\n var mark = {\n name: state.filename,\n buffer: state.input.slice(0, -1), // omit trailing \\0\n position: state.position,\n line: state.line,\n column: state.position - state.lineStart\n };\n\n mark.snippet = makeSnippet(mark);\n\n return new YAMLException(message, mark);\n}\n\nfunction throwError(state, message) {\n throw generateError(state, message);\n}\n\nfunction throwWarning(state, message) {\n if (state.onWarning) {\n state.onWarning.call(null, generateError(state, message));\n }\n}\n\n\nvar directiveHandlers = {\n\n YAML: function handleYamlDirective(state, name, args) {\n\n var match, major, minor;\n\n if (state.version !== null) {\n throwError(state, 'duplication of %YAML directive');\n }\n\n if (args.length !== 1) {\n throwError(state, 'YAML directive accepts exactly one argument');\n }\n\n match = /^([0-9]+)\\.([0-9]+)$/.exec(args[0]);\n\n if (match === null) {\n throwError(state, 'ill-formed argument of the YAML directive');\n }\n\n major = parseInt(match[1], 10);\n minor = parseInt(match[2], 10);\n\n if (major !== 1) {\n throwError(state, 'unacceptable YAML version of the document');\n }\n\n state.version = args[0];\n state.checkLineBreaks = (minor < 2);\n\n if (minor !== 1 && minor !== 2) {\n throwWarning(state, 'unsupported YAML version of the document');\n }\n },\n\n TAG: function handleTagDirective(state, name, args) {\n\n var handle, prefix;\n\n if (args.length !== 2) {\n throwError(state, 'TAG directive accepts exactly two arguments');\n }\n\n handle = args[0];\n prefix = args[1];\n\n if (!PATTERN_TAG_HANDLE.test(handle)) {\n throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');\n }\n\n if (_hasOwnProperty.call(state.tagMap, handle)) {\n throwError(state, 'there is a previously declared suffix for \"' + handle + '\" tag handle');\n }\n\n if (!PATTERN_TAG_URI.test(prefix)) {\n throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');\n }\n\n try {\n prefix = decodeURIComponent(prefix);\n } catch (err) {\n throwError(state, 'tag prefix is malformed: ' + prefix);\n }\n\n state.tagMap[handle] = prefix;\n }\n};\n\n\nfunction captureSegment(state, start, end, checkJson) {\n var _position, _length, _character, _result;\n\n if (start < end) {\n _result = state.input.slice(start, end);\n\n if (checkJson) {\n for (_position = 0, _length = _result.length; _position < _length; _position += 1) {\n _character = _result.charCodeAt(_position);\n if (!(_character === 0x09 ||\n (0x20 <= _character && _character <= 0x10FFFF))) {\n throwError(state, 'expected valid JSON character');\n }\n }\n } else if (PATTERN_NON_PRINTABLE.test(_result)) {\n throwError(state, 'the stream contains non-printable characters');\n }\n\n state.result += _result;\n }\n}\n\nfunction mergeMappings(state, destination, source, overridableKeys) {\n var sourceKeys, key, index, quantity;\n\n if (!common.isObject(source)) {\n throwError(state, 'cannot merge mappings; the provided source object is unacceptable');\n }\n\n sourceKeys = Object.keys(source);\n\n for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {\n key = sourceKeys[index];\n\n if (!_hasOwnProperty.call(destination, key)) {\n destination[key] = source[key];\n overridableKeys[key] = true;\n }\n }\n}\n\nfunction storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode,\n startLine, startLineStart, startPos) {\n\n var index, quantity;\n\n // The output is a plain object here, so keys can only be strings.\n // We need to convert keyNode to a string, but doing so can hang the process\n // (deeply nested arrays that explode exponentially using aliases).\n if (Array.isArray(keyNode)) {\n keyNode = Array.prototype.slice.call(keyNode);\n\n for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {\n if (Array.isArray(keyNode[index])) {\n throwError(state, 'nested arrays are not supported inside keys');\n }\n\n if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {\n keyNode[index] = '[object Object]';\n }\n }\n }\n\n // Avoid code execution in load() via toString property\n // (still use its own toString for arrays, timestamps,\n // and whatever user schema extensions happen to have @@toStringTag)\n if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {\n keyNode = '[object Object]';\n }\n\n\n keyNode = String(keyNode);\n\n if (_result === null) {\n _result = {};\n }\n\n if (keyTag === 'tag:yaml.org,2002:merge') {\n if (Array.isArray(valueNode)) {\n for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {\n mergeMappings(state, _result, valueNode[index], overridableKeys);\n }\n } else {\n mergeMappings(state, _result, valueNode, overridableKeys);\n }\n } else {\n if (!state.json &&\n !_hasOwnProperty.call(overridableKeys, keyNode) &&\n _hasOwnProperty.call(_result, keyNode)) {\n state.line = startLine || state.line;\n state.lineStart = startLineStart || state.lineStart;\n state.position = startPos || state.position;\n throwError(state, 'duplicated mapping key');\n }\n\n // used for this specific key only because Object.defineProperty is slow\n if (keyNode === '__proto__') {\n Object.defineProperty(_result, keyNode, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: valueNode\n });\n } else {\n _result[keyNode] = valueNode;\n }\n delete overridableKeys[keyNode];\n }\n\n return _result;\n}\n\nfunction readLineBreak(state) {\n var ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x0A/* LF */) {\n state.position++;\n } else if (ch === 0x0D/* CR */) {\n state.position++;\n if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {\n state.position++;\n }\n } else {\n throwError(state, 'a line break is expected');\n }\n\n state.line += 1;\n state.lineStart = state.position;\n state.firstTabInLine = -1;\n}\n\nfunction skipSeparationSpace(state, allowComments, checkIndent) {\n var lineBreaks = 0,\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n while (is_WHITE_SPACE(ch)) {\n if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {\n state.firstTabInLine = state.position;\n }\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (allowComments && ch === 0x23/* # */) {\n do {\n ch = state.input.charCodeAt(++state.position);\n } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);\n }\n\n if (is_EOL(ch)) {\n readLineBreak(state);\n\n ch = state.input.charCodeAt(state.position);\n lineBreaks++;\n state.lineIndent = 0;\n\n while (ch === 0x20/* Space */) {\n state.lineIndent++;\n ch = state.input.charCodeAt(++state.position);\n }\n } else {\n break;\n }\n }\n\n if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {\n throwWarning(state, 'deficient indentation');\n }\n\n return lineBreaks;\n}\n\nfunction testDocumentSeparator(state) {\n var _position = state.position,\n ch;\n\n ch = state.input.charCodeAt(_position);\n\n // Condition state.position === state.lineStart is tested\n // in parent on each call, for efficiency. No needs to test here again.\n if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&\n ch === state.input.charCodeAt(_position + 1) &&\n ch === state.input.charCodeAt(_position + 2)) {\n\n _position += 3;\n\n ch = state.input.charCodeAt(_position);\n\n if (ch === 0 || is_WS_OR_EOL(ch)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction writeFoldedLines(state, count) {\n if (count === 1) {\n state.result += ' ';\n } else if (count > 1) {\n state.result += common.repeat('\\n', count - 1);\n }\n}\n\n\nfunction readPlainScalar(state, nodeIndent, withinFlowCollection) {\n var preceding,\n following,\n captureStart,\n captureEnd,\n hasPendingContent,\n _line,\n _lineStart,\n _lineIndent,\n _kind = state.kind,\n _result = state.result,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (is_WS_OR_EOL(ch) ||\n is_FLOW_INDICATOR(ch) ||\n ch === 0x23/* # */ ||\n ch === 0x26/* & */ ||\n ch === 0x2A/* * */ ||\n ch === 0x21/* ! */ ||\n ch === 0x7C/* | */ ||\n ch === 0x3E/* > */ ||\n ch === 0x27/* ' */ ||\n ch === 0x22/* \" */ ||\n ch === 0x25/* % */ ||\n ch === 0x40/* @ */ ||\n ch === 0x60/* ` */) {\n return false;\n }\n\n if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following) ||\n withinFlowCollection && is_FLOW_INDICATOR(following)) {\n return false;\n }\n }\n\n state.kind = 'scalar';\n state.result = '';\n captureStart = captureEnd = state.position;\n hasPendingContent = false;\n\n while (ch !== 0) {\n if (ch === 0x3A/* : */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following) ||\n withinFlowCollection && is_FLOW_INDICATOR(following)) {\n break;\n }\n\n } else if (ch === 0x23/* # */) {\n preceding = state.input.charCodeAt(state.position - 1);\n\n if (is_WS_OR_EOL(preceding)) {\n break;\n }\n\n } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||\n withinFlowCollection && is_FLOW_INDICATOR(ch)) {\n break;\n\n } else if (is_EOL(ch)) {\n _line = state.line;\n _lineStart = state.lineStart;\n _lineIndent = state.lineIndent;\n skipSeparationSpace(state, false, -1);\n\n if (state.lineIndent >= nodeIndent) {\n hasPendingContent = true;\n ch = state.input.charCodeAt(state.position);\n continue;\n } else {\n state.position = captureEnd;\n state.line = _line;\n state.lineStart = _lineStart;\n state.lineIndent = _lineIndent;\n break;\n }\n }\n\n if (hasPendingContent) {\n captureSegment(state, captureStart, captureEnd, false);\n writeFoldedLines(state, state.line - _line);\n captureStart = captureEnd = state.position;\n hasPendingContent = false;\n }\n\n if (!is_WHITE_SPACE(ch)) {\n captureEnd = state.position + 1;\n }\n\n ch = state.input.charCodeAt(++state.position);\n }\n\n captureSegment(state, captureStart, captureEnd, false);\n\n if (state.result) {\n return true;\n }\n\n state.kind = _kind;\n state.result = _result;\n return false;\n}\n\nfunction readSingleQuotedScalar(state, nodeIndent) {\n var ch,\n captureStart, captureEnd;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x27/* ' */) {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n state.position++;\n captureStart = captureEnd = state.position;\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n if (ch === 0x27/* ' */) {\n captureSegment(state, captureStart, state.position, true);\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x27/* ' */) {\n captureStart = state.position;\n state.position++;\n captureEnd = state.position;\n } else {\n return true;\n }\n\n } else if (is_EOL(ch)) {\n captureSegment(state, captureStart, captureEnd, true);\n writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));\n captureStart = captureEnd = state.position;\n\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a single quoted scalar');\n\n } else {\n state.position++;\n captureEnd = state.position;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a single quoted scalar');\n}\n\nfunction readDoubleQuotedScalar(state, nodeIndent) {\n var captureStart,\n captureEnd,\n hexLength,\n hexResult,\n tmp,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x22/* \" */) {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n state.position++;\n captureStart = captureEnd = state.position;\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n if (ch === 0x22/* \" */) {\n captureSegment(state, captureStart, state.position, true);\n state.position++;\n return true;\n\n } else if (ch === 0x5C/* \\ */) {\n captureSegment(state, captureStart, state.position, true);\n ch = state.input.charCodeAt(++state.position);\n\n if (is_EOL(ch)) {\n skipSeparationSpace(state, false, nodeIndent);\n\n // TODO: rework to inline fn with no type cast?\n } else if (ch < 256 && simpleEscapeCheck[ch]) {\n state.result += simpleEscapeMap[ch];\n state.position++;\n\n } else if ((tmp = escapedHexLen(ch)) > 0) {\n hexLength = tmp;\n hexResult = 0;\n\n for (; hexLength > 0; hexLength--) {\n ch = state.input.charCodeAt(++state.position);\n\n if ((tmp = fromHexCode(ch)) >= 0) {\n hexResult = (hexResult << 4) + tmp;\n\n } else {\n throwError(state, 'expected hexadecimal character');\n }\n }\n\n state.result += charFromCodepoint(hexResult);\n\n state.position++;\n\n } else {\n throwError(state, 'unknown escape sequence');\n }\n\n captureStart = captureEnd = state.position;\n\n } else if (is_EOL(ch)) {\n captureSegment(state, captureStart, captureEnd, true);\n writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));\n captureStart = captureEnd = state.position;\n\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a double quoted scalar');\n\n } else {\n state.position++;\n captureEnd = state.position;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a double quoted scalar');\n}\n\nfunction readFlowCollection(state, nodeIndent) {\n var readNext = true,\n _line,\n _lineStart,\n _pos,\n _tag = state.tag,\n _result,\n _anchor = state.anchor,\n following,\n terminator,\n isPair,\n isExplicitPair,\n isMapping,\n overridableKeys = Object.create(null),\n keyNode,\n keyTag,\n valueNode,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x5B/* [ */) {\n terminator = 0x5D;/* ] */\n isMapping = false;\n _result = [];\n } else if (ch === 0x7B/* { */) {\n terminator = 0x7D;/* } */\n isMapping = true;\n _result = {};\n } else {\n return false;\n }\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(++state.position);\n\n while (ch !== 0) {\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === terminator) {\n state.position++;\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = isMapping ? 'mapping' : 'sequence';\n state.result = _result;\n return true;\n } else if (!readNext) {\n throwError(state, 'missed comma between flow collection entries');\n } else if (ch === 0x2C/* , */) {\n // \"flow collection entries can never be completely empty\", as per YAML 1.2, section 7.4\n throwError(state, \"expected the node content, but found ','\");\n }\n\n keyTag = keyNode = valueNode = null;\n isPair = isExplicitPair = false;\n\n if (ch === 0x3F/* ? */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following)) {\n isPair = isExplicitPair = true;\n state.position++;\n skipSeparationSpace(state, true, nodeIndent);\n }\n }\n\n _line = state.line; // Save the current line.\n _lineStart = state.lineStart;\n _pos = state.position;\n composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);\n keyTag = state.tag;\n keyNode = state.result;\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {\n isPair = true;\n ch = state.input.charCodeAt(++state.position);\n skipSeparationSpace(state, true, nodeIndent);\n composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);\n valueNode = state.result;\n }\n\n if (isMapping) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);\n } else if (isPair) {\n _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));\n } else {\n _result.push(keyNode);\n }\n\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x2C/* , */) {\n readNext = true;\n ch = state.input.charCodeAt(++state.position);\n } else {\n readNext = false;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a flow collection');\n}\n\nfunction readBlockScalar(state, nodeIndent) {\n var captureStart,\n folding,\n chomping = CHOMPING_CLIP,\n didReadContent = false,\n detectedIndent = false,\n textIndent = nodeIndent,\n emptyLines = 0,\n atMoreIndented = false,\n tmp,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x7C/* | */) {\n folding = false;\n } else if (ch === 0x3E/* > */) {\n folding = true;\n } else {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n\n while (ch !== 0) {\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {\n if (CHOMPING_CLIP === chomping) {\n chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;\n } else {\n throwError(state, 'repeat of a chomping mode identifier');\n }\n\n } else if ((tmp = fromDecimalCode(ch)) >= 0) {\n if (tmp === 0) {\n throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');\n } else if (!detectedIndent) {\n textIndent = nodeIndent + tmp - 1;\n detectedIndent = true;\n } else {\n throwError(state, 'repeat of an indentation width identifier');\n }\n\n } else {\n break;\n }\n }\n\n if (is_WHITE_SPACE(ch)) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (is_WHITE_SPACE(ch));\n\n if (ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (!is_EOL(ch) && (ch !== 0));\n }\n }\n\n while (ch !== 0) {\n readLineBreak(state);\n state.lineIndent = 0;\n\n ch = state.input.charCodeAt(state.position);\n\n while ((!detectedIndent || state.lineIndent < textIndent) &&\n (ch === 0x20/* Space */)) {\n state.lineIndent++;\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (!detectedIndent && state.lineIndent > textIndent) {\n textIndent = state.lineIndent;\n }\n\n if (is_EOL(ch)) {\n emptyLines++;\n continue;\n }\n\n // End of the scalar.\n if (state.lineIndent < textIndent) {\n\n // Perform the chomping.\n if (chomping === CHOMPING_KEEP) {\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n } else if (chomping === CHOMPING_CLIP) {\n if (didReadContent) { // i.e. only if the scalar is not empty.\n state.result += '\\n';\n }\n }\n\n // Break this `while` cycle and go to the funciton's epilogue.\n break;\n }\n\n // Folded style: use fancy rules to handle line breaks.\n if (folding) {\n\n // Lines starting with white space characters (more-indented lines) are not folded.\n if (is_WHITE_SPACE(ch)) {\n atMoreIndented = true;\n // except for the first content line (cf. Example 8.1)\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n\n // End of more-indented block.\n } else if (atMoreIndented) {\n atMoreIndented = false;\n state.result += common.repeat('\\n', emptyLines + 1);\n\n // Just one line break - perceive as the same line.\n } else if (emptyLines === 0) {\n if (didReadContent) { // i.e. only if we have already read some scalar content.\n state.result += ' ';\n }\n\n // Several line breaks - perceive as different lines.\n } else {\n state.result += common.repeat('\\n', emptyLines);\n }\n\n // Literal style: just add exact number of line breaks between content lines.\n } else {\n // Keep all line breaks except the header line break.\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n }\n\n didReadContent = true;\n detectedIndent = true;\n emptyLines = 0;\n captureStart = state.position;\n\n while (!is_EOL(ch) && (ch !== 0)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n captureSegment(state, captureStart, state.position, false);\n }\n\n return true;\n}\n\nfunction readBlockSequence(state, nodeIndent) {\n var _line,\n _tag = state.tag,\n _anchor = state.anchor,\n _result = [],\n following,\n detected = false,\n ch;\n\n // there is a leading tab before this token, so it can't be a block sequence/mapping;\n // it can still be flow sequence/mapping or a scalar\n if (state.firstTabInLine !== -1) return false;\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n if (state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine;\n throwError(state, 'tab characters must not be used in indentation');\n }\n\n if (ch !== 0x2D/* - */) {\n break;\n }\n\n following = state.input.charCodeAt(state.position + 1);\n\n if (!is_WS_OR_EOL(following)) {\n break;\n }\n\n detected = true;\n state.position++;\n\n if (skipSeparationSpace(state, true, -1)) {\n if (state.lineIndent <= nodeIndent) {\n _result.push(null);\n ch = state.input.charCodeAt(state.position);\n continue;\n }\n }\n\n _line = state.line;\n composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);\n _result.push(state.result);\n skipSeparationSpace(state, true, -1);\n\n ch = state.input.charCodeAt(state.position);\n\n if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n throwError(state, 'bad indentation of a sequence entry');\n } else if (state.lineIndent < nodeIndent) {\n break;\n }\n }\n\n if (detected) {\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = 'sequence';\n state.result = _result;\n return true;\n }\n return false;\n}\n\nfunction readBlockMapping(state, nodeIndent, flowIndent) {\n var following,\n allowCompact,\n _line,\n _keyLine,\n _keyLineStart,\n _keyPos,\n _tag = state.tag,\n _anchor = state.anchor,\n _result = {},\n overridableKeys = Object.create(null),\n keyTag = null,\n keyNode = null,\n valueNode = null,\n atExplicitKey = false,\n detected = false,\n ch;\n\n // there is a leading tab before this token, so it can't be a block sequence/mapping;\n // it can still be flow sequence/mapping or a scalar\n if (state.firstTabInLine !== -1) return false;\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n if (!atExplicitKey && state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine;\n throwError(state, 'tab characters must not be used in indentation');\n }\n\n following = state.input.charCodeAt(state.position + 1);\n _line = state.line; // Save the current line.\n\n //\n // Explicit notation case. There are two separate blocks:\n // first for the key (denoted by \"?\") and second for the value (denoted by \":\")\n //\n if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {\n\n if (ch === 0x3F/* ? */) {\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);\n keyTag = keyNode = valueNode = null;\n }\n\n detected = true;\n atExplicitKey = true;\n allowCompact = true;\n\n } else if (atExplicitKey) {\n // i.e. 0x3A/* : */ === character after the explicit key.\n atExplicitKey = false;\n allowCompact = true;\n\n } else {\n throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');\n }\n\n state.position += 1;\n ch = following;\n\n //\n // Implicit notation case. Flow-style node as the key first, then \":\", and the value.\n //\n } else {\n _keyLine = state.line;\n _keyLineStart = state.lineStart;\n _keyPos = state.position;\n\n if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {\n // Neither implicit nor explicit notation.\n // Reading is done. Go to the epilogue.\n break;\n }\n\n if (state.line === _line) {\n ch = state.input.charCodeAt(state.position);\n\n while (is_WHITE_SPACE(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (ch === 0x3A/* : */) {\n ch = state.input.charCodeAt(++state.position);\n\n if (!is_WS_OR_EOL(ch)) {\n throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');\n }\n\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);\n keyTag = keyNode = valueNode = null;\n }\n\n detected = true;\n atExplicitKey = false;\n allowCompact = false;\n keyTag = state.tag;\n keyNode = state.result;\n\n } else if (detected) {\n throwError(state, 'can not read an implicit mapping pair; a colon is missed');\n\n } else {\n state.tag = _tag;\n state.anchor = _anchor;\n return true; // Keep the result of `composeNode`.\n }\n\n } else if (detected) {\n throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');\n\n } else {\n state.tag = _tag;\n state.anchor = _anchor;\n return true; // Keep the result of `composeNode`.\n }\n }\n\n //\n // Common reading code for both explicit and implicit notations.\n //\n if (state.line === _line || state.lineIndent > nodeIndent) {\n if (atExplicitKey) {\n _keyLine = state.line;\n _keyLineStart = state.lineStart;\n _keyPos = state.position;\n }\n\n if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {\n if (atExplicitKey) {\n keyNode = state.result;\n } else {\n valueNode = state.result;\n }\n }\n\n if (!atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);\n keyTag = keyNode = valueNode = null;\n }\n\n skipSeparationSpace(state, true, -1);\n ch = state.input.charCodeAt(state.position);\n }\n\n if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n throwError(state, 'bad indentation of a mapping entry');\n } else if (state.lineIndent < nodeIndent) {\n break;\n }\n }\n\n //\n // Epilogue.\n //\n\n // Special case: last mapping's node contains only the key in explicit notation.\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);\n }\n\n // Expose the resulting mapping.\n if (detected) {\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = 'mapping';\n state.result = _result;\n }\n\n return detected;\n}\n\nfunction readTagProperty(state) {\n var _position,\n isVerbatim = false,\n isNamed = false,\n tagHandle,\n tagName,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x21/* ! */) return false;\n\n if (state.tag !== null) {\n throwError(state, 'duplication of a tag property');\n }\n\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x3C/* < */) {\n isVerbatim = true;\n ch = state.input.charCodeAt(++state.position);\n\n } else if (ch === 0x21/* ! */) {\n isNamed = true;\n tagHandle = '!!';\n ch = state.input.charCodeAt(++state.position);\n\n } else {\n tagHandle = '!';\n }\n\n _position = state.position;\n\n if (isVerbatim) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (ch !== 0 && ch !== 0x3E/* > */);\n\n if (state.position < state.length) {\n tagName = state.input.slice(_position, state.position);\n ch = state.input.charCodeAt(++state.position);\n } else {\n throwError(state, 'unexpected end of the stream within a verbatim tag');\n }\n } else {\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n\n if (ch === 0x21/* ! */) {\n if (!isNamed) {\n tagHandle = state.input.slice(_position - 1, state.position + 1);\n\n if (!PATTERN_TAG_HANDLE.test(tagHandle)) {\n throwError(state, 'named tag handle cannot contain such characters');\n }\n\n isNamed = true;\n _position = state.position + 1;\n } else {\n throwError(state, 'tag suffix cannot contain exclamation marks');\n }\n }\n\n ch = state.input.charCodeAt(++state.position);\n }\n\n tagName = state.input.slice(_position, state.position);\n\n if (PATTERN_FLOW_INDICATORS.test(tagName)) {\n throwError(state, 'tag suffix cannot contain flow indicator characters');\n }\n }\n\n if (tagName && !PATTERN_TAG_URI.test(tagName)) {\n throwError(state, 'tag name cannot contain such characters: ' + tagName);\n }\n\n try {\n tagName = decodeURIComponent(tagName);\n } catch (err) {\n throwError(state, 'tag name is malformed: ' + tagName);\n }\n\n if (isVerbatim) {\n state.tag = tagName;\n\n } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {\n state.tag = state.tagMap[tagHandle] + tagName;\n\n } else if (tagHandle === '!') {\n state.tag = '!' + tagName;\n\n } else if (tagHandle === '!!') {\n state.tag = 'tag:yaml.org,2002:' + tagName;\n\n } else {\n throwError(state, 'undeclared tag handle \"' + tagHandle + '\"');\n }\n\n return true;\n}\n\nfunction readAnchorProperty(state) {\n var _position,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x26/* & */) return false;\n\n if (state.anchor !== null) {\n throwError(state, 'duplication of an anchor property');\n }\n\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (state.position === _position) {\n throwError(state, 'name of an anchor node must contain at least one character');\n }\n\n state.anchor = state.input.slice(_position, state.position);\n return true;\n}\n\nfunction readAlias(state) {\n var _position, alias,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x2A/* * */) return false;\n\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (state.position === _position) {\n throwError(state, 'name of an alias node must contain at least one character');\n }\n\n alias = state.input.slice(_position, state.position);\n\n if (!_hasOwnProperty.call(state.anchorMap, alias)) {\n throwError(state, 'unidentified alias \"' + alias + '\"');\n }\n\n state.result = state.anchorMap[alias];\n skipSeparationSpace(state, true, -1);\n return true;\n}\n\nfunction composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {\n var allowBlockStyles,\n allowBlockScalars,\n allowBlockCollections,\n indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) {\n indentStatus = 1;\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0;\n } else if (state.lineIndent < parentIndent) {\n indentStatus = -1;\n }\n }\n }\n\n if (indentStatus === 1) {\n while (readTagProperty(state) || readAnchorProperty(state)) {\n if (skipSeparationSpace(state, true, -1)) {\n atNewLine = true;\n allowBlockCollections = allowBlockStyles;\n\n if (state.lineIndent > parentIndent) {\n indentStatus = 1;\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0;\n } else if (state.lineIndent < parentIndent) {\n indentStatus = -1;\n }\n } else {\n allowBlockCollections = false;\n }\n }\n }\n\n if (allowBlockCollections) {\n allowBlockCollections = atNewLine || allowCompact;\n }\n\n if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {\n if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {\n flowIndent = parentIndent;\n } else {\n flowIndent = parentIndent + 1;\n }\n\n blockIndent = state.position - state.lineStart;\n\n if (indentStatus === 1) {\n if (allowBlockCollections &&\n (readBlockSequence(state, blockIndent) ||\n readBlockMapping(state, blockIndent, flowIndent)) ||\n readFlowCollection(state, flowIndent)) {\n hasContent = true;\n } else {\n if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||\n readSingleQuotedScalar(state, flowIndent) ||\n readDoubleQuotedScalar(state, flowIndent)) {\n hasContent = true;\n\n } else if (readAlias(state)) {\n hasContent = true;\n\n if (state.tag !== null || state.anchor !== null) {\n throwError(state, 'alias node should not have any properties');\n }\n\n } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {\n hasContent = true;\n\n if (state.tag === null) {\n state.tag = '?';\n }\n }\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n }\n } else if (indentStatus === 0) {\n // Special case: block sequences are allowed to have same indentation level as the parent.\n // http://www.yaml.org/spec/1.2/spec.html#id2799784\n hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);\n }\n }\n\n if (state.tag === null) {\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n\n } else if (state.tag === '?') {\n // Implicit resolving is not allowed for non-scalar types, and '?'\n // non-specific tag is only automatically assigned to plain scalars.\n //\n // We only need to check kind conformity in case user explicitly assigns '?'\n // tag, for example like this: \"! [0]\"\n //\n if (state.result !== null && state.kind !== 'scalar') {\n throwError(state, 'unacceptable node kind for ! tag; it should be \"scalar\", not \"' + state.kind + '\"');\n }\n\n for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {\n type = state.implicitTypes[typeIndex];\n\n if (type.resolve(state.result)) { // `state.result` updated in resolver if matched\n state.result = type.construct(state.result);\n state.tag = type.tag;\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n break;\n }\n }\n } else if (state.tag !== '!') {\n if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {\n type = state.typeMap[state.kind || 'fallback'][state.tag];\n } else {\n // looking for multi type\n type = null;\n typeList = state.typeMap.multi[state.kind || 'fallback'];\n\n for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {\n if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {\n type = typeList[typeIndex];\n break;\n }\n }\n }\n\n if (!type) {\n throwError(state, 'unknown tag !<' + state.tag + '>');\n }\n\n if (state.result !== null && type.kind !== state.kind) {\n throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be \"' + type.kind + '\", not \"' + state.kind + '\"');\n }\n\n if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched\n throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');\n } else {\n state.result = type.construct(state.result, state.tag);\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n }\n }\n\n if (state.listener !== null) {\n state.listener('close', state);\n }\n return state.tag !== null || state.anchor !== null || hasContent;\n}\n\nfunction readDocument(state) {\n var documentStart = state.position,\n _position,\n directiveName,\n directiveArgs,\n hasDirectives = false,\n ch;\n\n state.version = null;\n state.checkLineBreaks = state.legacy;\n state.tagMap = Object.create(null);\n state.anchorMap = Object.create(null);\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n skipSeparationSpace(state, true, -1);\n\n ch = state.input.charCodeAt(state.position);\n\n if (state.lineIndent > 0 || ch !== 0x25/* % */) {\n break;\n }\n\n hasDirectives = true;\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n directiveName = state.input.slice(_position, state.position);\n directiveArgs = [];\n\n if (directiveName.length < 1) {\n throwError(state, 'directive name must not be less than one character in length');\n }\n\n while (ch !== 0) {\n while (is_WHITE_SPACE(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (ch !== 0 && !is_EOL(ch));\n break;\n }\n\n if (is_EOL(ch)) break;\n\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n directiveArgs.push(state.input.slice(_position, state.position));\n }\n\n if (ch !== 0) readLineBreak(state);\n\n if (_hasOwnProperty.call(directiveHandlers, directiveName)) {\n directiveHandlers[directiveName](state, directiveName, directiveArgs);\n } else {\n throwWarning(state, 'unknown document directive \"' + directiveName + '\"');\n }\n }\n\n skipSeparationSpace(state, true, -1);\n\n if (state.lineIndent === 0 &&\n state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {\n state.position += 3;\n skipSeparationSpace(state, true, -1);\n\n } else if (hasDirectives) {\n throwError(state, 'directives end mark is expected');\n }\n\n composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);\n skipSeparationSpace(state, true, -1);\n\n if (state.checkLineBreaks &&\n PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {\n throwWarning(state, 'non-ASCII line breaks are interpreted as content');\n }\n\n state.documents.push(state.result);\n\n if (state.position === state.lineStart && testDocumentSeparator(state)) {\n\n if (state.input.charCodeAt(state.position) === 0x2E/* . */) {\n state.position += 3;\n skipSeparationSpace(state, true, -1);\n }\n return;\n }\n\n if (state.position < (state.length - 1)) {\n throwError(state, 'end of the stream or a document separator is expected');\n } else {\n return;\n }\n}\n\n\nfunction loadDocuments(input, options) {\n input = String(input);\n options = options || {};\n\n if (input.length !== 0) {\n\n // Add tailing `\\n` if not exists\n if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&\n input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {\n input += '\\n';\n }\n\n // Strip BOM\n if (input.charCodeAt(0) === 0xFEFF) {\n input = input.slice(1);\n }\n }\n\n var state = new State(input, options);\n\n var nullpos = input.indexOf('\\0');\n\n if (nullpos !== -1) {\n state.position = nullpos;\n throwError(state, 'null byte is not allowed in input');\n }\n\n // Use 0 as string terminator. That significantly simplifies bounds check.\n state.input += '\\0';\n\n while (state.input.charCodeAt(state.position) === 0x20/* Space */) {\n state.lineIndent += 1;\n state.position += 1;\n }\n\n while (state.position < (state.length - 1)) {\n readDocument(state);\n }\n\n return state.documents;\n}\n\n\nfunction loadAll(input, iterator, options) {\n if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {\n options = iterator;\n iterator = null;\n }\n\n var documents = loadDocuments(input, options);\n\n if (typeof iterator !== 'function') {\n return documents;\n }\n\n for (var index = 0, length = documents.length; index < length; index += 1) {\n iterator(documents[index]);\n }\n}\n\n\nfunction load(input, options) {\n var documents = loadDocuments(input, options);\n\n if (documents.length === 0) {\n /*eslint-disable no-undefined*/\n return undefined;\n } else if (documents.length === 1) {\n return documents[0];\n }\n throw new YAMLException('expected a single document in the stream, but found more');\n}\n\n\nmodule.exports.loadAll = loadAll;\nmodule.exports.load = load;\n","'use strict';\n\n/*eslint-disable max-len*/\n\nvar YAMLException = require('./exception');\nvar Type = require('./type');\n\n\nfunction compileList(schema, name) {\n var result = [];\n\n schema[name].forEach(function (currentType) {\n var newIndex = result.length;\n\n result.forEach(function (previousType, previousIndex) {\n if (previousType.tag === currentType.tag &&\n previousType.kind === currentType.kind &&\n previousType.multi === currentType.multi) {\n\n newIndex = previousIndex;\n }\n });\n\n result[newIndex] = currentType;\n });\n\n return result;\n}\n\n\nfunction compileMap(/* lists... */) {\n var result = {\n scalar: {},\n sequence: {},\n mapping: {},\n fallback: {},\n multi: {\n scalar: [],\n sequence: [],\n mapping: [],\n fallback: []\n }\n }, index, length;\n\n function collectType(type) {\n if (type.multi) {\n result.multi[type.kind].push(type);\n result.multi['fallback'].push(type);\n } else {\n result[type.kind][type.tag] = result['fallback'][type.tag] = type;\n }\n }\n\n for (index = 0, length = arguments.length; index < length; index += 1) {\n arguments[index].forEach(collectType);\n }\n return result;\n}\n\n\nfunction Schema(definition) {\n return this.extend(definition);\n}\n\n\nSchema.prototype.extend = function extend(definition) {\n var implicit = [];\n var explicit = [];\n\n if (definition instanceof Type) {\n // Schema.extend(type)\n explicit.push(definition);\n\n } else if (Array.isArray(definition)) {\n // Schema.extend([ type1, type2, ... ])\n explicit = explicit.concat(definition);\n\n } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {\n // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })\n if (definition.implicit) implicit = implicit.concat(definition.implicit);\n if (definition.explicit) explicit = explicit.concat(definition.explicit);\n\n } else {\n throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' +\n 'or a schema definition ({ implicit: [...], explicit: [...] })');\n }\n\n implicit.forEach(function (type) {\n if (!(type instanceof Type)) {\n throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');\n }\n\n if (type.loadKind && type.loadKind !== 'scalar') {\n throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');\n }\n\n if (type.multi) {\n throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.');\n }\n });\n\n explicit.forEach(function (type) {\n if (!(type instanceof Type)) {\n throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');\n }\n });\n\n var result = Object.create(Schema.prototype);\n\n result.implicit = (this.implicit || []).concat(implicit);\n result.explicit = (this.explicit || []).concat(explicit);\n\n result.compiledImplicit = compileList(result, 'implicit');\n result.compiledExplicit = compileList(result, 'explicit');\n result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);\n\n return result;\n};\n\n\nmodule.exports = Schema;\n","// Standard YAML's Core schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2804923\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, Core schema has no distinctions from JSON schema is JS-YAML.\n\n\n'use strict';\n\n\nmodule.exports = require('./json');\n","// JS-YAML's default schema for `safeLoad` function.\n// It is not described in the YAML specification.\n//\n// This schema is based on standard YAML's Core schema and includes most of\n// extra types described at YAML tag repository. (http://yaml.org/type/)\n\n\n'use strict';\n\n\nmodule.exports = require('./core').extend({\n implicit: [\n require('../type/timestamp'),\n require('../type/merge')\n ],\n explicit: [\n require('../type/binary'),\n require('../type/omap'),\n require('../type/pairs'),\n require('../type/set')\n ]\n});\n","// Standard YAML's Failsafe schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2802346\n\n\n'use strict';\n\n\nvar Schema = require('../schema');\n\n\nmodule.exports = new Schema({\n explicit: [\n require('../type/str'),\n require('../type/seq'),\n require('../type/map')\n ]\n});\n","// Standard YAML's JSON schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2803231\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, this schema is not such strict as defined in the YAML specification.\n// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.\n\n\n'use strict';\n\n\nmodule.exports = require('./failsafe').extend({\n implicit: [\n require('../type/null'),\n require('../type/bool'),\n require('../type/int'),\n require('../type/float')\n ]\n});\n","'use strict';\n\n\nvar common = require('./common');\n\n\n// get snippet for a single line, respecting maxLength\nfunction getLine(buffer, lineStart, lineEnd, position, maxLineLength) {\n var head = '';\n var tail = '';\n var maxHalfLength = Math.floor(maxLineLength / 2) - 1;\n\n if (position - lineStart > maxHalfLength) {\n head = ' ... ';\n lineStart = position - maxHalfLength + head.length;\n }\n\n if (lineEnd - position > maxHalfLength) {\n tail = ' ...';\n lineEnd = position + maxHalfLength - tail.length;\n }\n\n return {\n str: head + buffer.slice(lineStart, lineEnd).replace(/\\t/g, '→') + tail,\n pos: position - lineStart + head.length // relative position\n };\n}\n\n\nfunction padStart(string, max) {\n return common.repeat(' ', max - string.length) + string;\n}\n\n\nfunction makeSnippet(mark, options) {\n options = Object.create(options || null);\n\n if (!mark.buffer) return null;\n\n if (!options.maxLength) options.maxLength = 79;\n if (typeof options.indent !== 'number') options.indent = 1;\n if (typeof options.linesBefore !== 'number') options.linesBefore = 3;\n if (typeof options.linesAfter !== 'number') options.linesAfter = 2;\n\n var re = /\\r?\\n|\\r|\\0/g;\n var lineStarts = [ 0 ];\n var lineEnds = [];\n var match;\n var foundLineNo = -1;\n\n while ((match = re.exec(mark.buffer))) {\n lineEnds.push(match.index);\n lineStarts.push(match.index + match[0].length);\n\n if (mark.position <= match.index && foundLineNo < 0) {\n foundLineNo = lineStarts.length - 2;\n }\n }\n\n if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;\n\n var result = '', i, line;\n var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;\n var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);\n\n for (i = 1; i <= options.linesBefore; i++) {\n if (foundLineNo - i < 0) break;\n line = getLine(\n mark.buffer,\n lineStarts[foundLineNo - i],\n lineEnds[foundLineNo - i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),\n maxLineLength\n );\n result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n' + result;\n }\n\n line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);\n result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n';\n result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\\n';\n\n for (i = 1; i <= options.linesAfter; i++) {\n if (foundLineNo + i >= lineEnds.length) break;\n line = getLine(\n mark.buffer,\n lineStarts[foundLineNo + i],\n lineEnds[foundLineNo + i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),\n maxLineLength\n );\n result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n';\n }\n\n return result.replace(/\\n$/, '');\n}\n\n\nmodule.exports = makeSnippet;\n","'use strict';\n\nvar YAMLException = require('./exception');\n\nvar TYPE_CONSTRUCTOR_OPTIONS = [\n 'kind',\n 'multi',\n 'resolve',\n 'construct',\n 'instanceOf',\n 'predicate',\n 'represent',\n 'representName',\n 'defaultStyle',\n 'styleAliases'\n];\n\nvar YAML_NODE_KINDS = [\n 'scalar',\n 'sequence',\n 'mapping'\n];\n\nfunction compileStyleAliases(map) {\n var result = {};\n\n if (map !== null) {\n Object.keys(map).forEach(function (style) {\n map[style].forEach(function (alias) {\n result[String(alias)] = style;\n });\n });\n }\n\n return result;\n}\n\nfunction Type(tag, options) {\n options = options || {};\n\n Object.keys(options).forEach(function (name) {\n if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {\n throw new YAMLException('Unknown option \"' + name + '\" is met in definition of \"' + tag + '\" YAML type.');\n }\n });\n\n // TODO: Add tag format check.\n this.options = options; // keep original options in case user wants to extend this type later\n this.tag = tag;\n this.kind = options['kind'] || null;\n this.resolve = options['resolve'] || function () { return true; };\n this.construct = options['construct'] || function (data) { return data; };\n this.instanceOf = options['instanceOf'] || null;\n this.predicate = options['predicate'] || null;\n this.represent = options['represent'] || null;\n this.representName = options['representName'] || null;\n this.defaultStyle = options['defaultStyle'] || null;\n this.multi = options['multi'] || false;\n this.styleAliases = compileStyleAliases(options['styleAliases'] || null);\n\n if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {\n throw new YAMLException('Unknown kind \"' + this.kind + '\" is specified for \"' + tag + '\" YAML type.');\n }\n}\n\nmodule.exports = Type;\n","'use strict';\n\n/*eslint-disable no-bitwise*/\n\n\nvar Type = require('../type');\n\n\n// [ 64, 65, 66 ] -> [ padding, CR, LF ]\nvar BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\\n\\r';\n\n\nfunction resolveYamlBinary(data) {\n if (data === null) return false;\n\n var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;\n\n // Convert one by one.\n for (idx = 0; idx < max; idx++) {\n code = map.indexOf(data.charAt(idx));\n\n // Skip CR/LF\n if (code > 64) continue;\n\n // Fail on illegal characters\n if (code < 0) return false;\n\n bitlen += 6;\n }\n\n // If there are any bits left, source was corrupted\n return (bitlen % 8) === 0;\n}\n\nfunction constructYamlBinary(data) {\n var idx, tailbits,\n input = data.replace(/[\\r\\n=]/g, ''), // remove CR/LF & padding to simplify scan\n max = input.length,\n map = BASE64_MAP,\n bits = 0,\n result = [];\n\n // Collect by 6*4 bits (3 bytes)\n\n for (idx = 0; idx < max; idx++) {\n if ((idx % 4 === 0) && idx) {\n result.push((bits >> 16) & 0xFF);\n result.push((bits >> 8) & 0xFF);\n result.push(bits & 0xFF);\n }\n\n bits = (bits << 6) | map.indexOf(input.charAt(idx));\n }\n\n // Dump tail\n\n tailbits = (max % 4) * 6;\n\n if (tailbits === 0) {\n result.push((bits >> 16) & 0xFF);\n result.push((bits >> 8) & 0xFF);\n result.push(bits & 0xFF);\n } else if (tailbits === 18) {\n result.push((bits >> 10) & 0xFF);\n result.push((bits >> 2) & 0xFF);\n } else if (tailbits === 12) {\n result.push((bits >> 4) & 0xFF);\n }\n\n return new Uint8Array(result);\n}\n\nfunction representYamlBinary(object /*, style*/) {\n var result = '', bits = 0, idx, tail,\n max = object.length,\n map = BASE64_MAP;\n\n // Convert every three bytes to 4 ASCII characters.\n\n for (idx = 0; idx < max; idx++) {\n if ((idx % 3 === 0) && idx) {\n result += map[(bits >> 18) & 0x3F];\n result += map[(bits >> 12) & 0x3F];\n result += map[(bits >> 6) & 0x3F];\n result += map[bits & 0x3F];\n }\n\n bits = (bits << 8) + object[idx];\n }\n\n // Dump tail\n\n tail = max % 3;\n\n if (tail === 0) {\n result += map[(bits >> 18) & 0x3F];\n result += map[(bits >> 12) & 0x3F];\n result += map[(bits >> 6) & 0x3F];\n result += map[bits & 0x3F];\n } else if (tail === 2) {\n result += map[(bits >> 10) & 0x3F];\n result += map[(bits >> 4) & 0x3F];\n result += map[(bits << 2) & 0x3F];\n result += map[64];\n } else if (tail === 1) {\n result += map[(bits >> 2) & 0x3F];\n result += map[(bits << 4) & 0x3F];\n result += map[64];\n result += map[64];\n }\n\n return result;\n}\n\nfunction isBinary(obj) {\n return Object.prototype.toString.call(obj) === '[object Uint8Array]';\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:binary', {\n kind: 'scalar',\n resolve: resolveYamlBinary,\n construct: constructYamlBinary,\n predicate: isBinary,\n represent: representYamlBinary\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlBoolean(data) {\n if (data === null) return false;\n\n var max = data.length;\n\n return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||\n (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));\n}\n\nfunction constructYamlBoolean(data) {\n return data === 'true' ||\n data === 'True' ||\n data === 'TRUE';\n}\n\nfunction isBoolean(object) {\n return Object.prototype.toString.call(object) === '[object Boolean]';\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:bool', {\n kind: 'scalar',\n resolve: resolveYamlBoolean,\n construct: constructYamlBoolean,\n predicate: isBoolean,\n represent: {\n lowercase: function (object) { return object ? 'true' : 'false'; },\n uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },\n camelcase: function (object) { return object ? 'True' : 'False'; }\n },\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar common = require('../common');\nvar Type = require('../type');\n\nvar YAML_FLOAT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +\n // .2e4, .2\n // special case, seems not from spec\n '|\\\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +\n // .inf\n '|[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$');\n\nfunction resolveYamlFloat(data) {\n if (data === null) return false;\n\n if (!YAML_FLOAT_PATTERN.test(data) ||\n // Quick hack to not allow integers end with `_`\n // Probably should update regexp & check speed\n data[data.length - 1] === '_') {\n return false;\n }\n\n return true;\n}\n\nfunction constructYamlFloat(data) {\n var value, sign;\n\n value = data.replace(/_/g, '').toLowerCase();\n sign = value[0] === '-' ? -1 : 1;\n\n if ('+-'.indexOf(value[0]) >= 0) {\n value = value.slice(1);\n }\n\n if (value === '.inf') {\n return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;\n\n } else if (value === '.nan') {\n return NaN;\n }\n return sign * parseFloat(value, 10);\n}\n\n\nvar SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;\n\nfunction representYamlFloat(object, style) {\n var res;\n\n if (isNaN(object)) {\n switch (style) {\n case 'lowercase': return '.nan';\n case 'uppercase': return '.NAN';\n case 'camelcase': return '.NaN';\n }\n } else if (Number.POSITIVE_INFINITY === object) {\n switch (style) {\n case 'lowercase': return '.inf';\n case 'uppercase': return '.INF';\n case 'camelcase': return '.Inf';\n }\n } else if (Number.NEGATIVE_INFINITY === object) {\n switch (style) {\n case 'lowercase': return '-.inf';\n case 'uppercase': return '-.INF';\n case 'camelcase': return '-.Inf';\n }\n } else if (common.isNegativeZero(object)) {\n return '-0.0';\n }\n\n res = object.toString(10);\n\n // JS stringifier can build scientific format without dots: 5e-100,\n // while YAML requres dot: 5.e-100. Fix it with simple hack\n\n return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;\n}\n\nfunction isFloat(object) {\n return (Object.prototype.toString.call(object) === '[object Number]') &&\n (object % 1 !== 0 || common.isNegativeZero(object));\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:float', {\n kind: 'scalar',\n resolve: resolveYamlFloat,\n construct: constructYamlFloat,\n predicate: isFloat,\n represent: representYamlFloat,\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar common = require('../common');\nvar Type = require('../type');\n\nfunction isHexCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||\n ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||\n ((0x61/* a */ <= c) && (c <= 0x66/* f */));\n}\n\nfunction isOctCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));\n}\n\nfunction isDecCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));\n}\n\nfunction resolveYamlInteger(data) {\n if (data === null) return false;\n\n var max = data.length,\n index = 0,\n hasDigits = false,\n ch;\n\n if (!max) return false;\n\n ch = data[index];\n\n // sign\n if (ch === '-' || ch === '+') {\n ch = data[++index];\n }\n\n if (ch === '0') {\n // 0\n if (index + 1 === max) return true;\n ch = data[++index];\n\n // base 2, base 8, base 16\n\n if (ch === 'b') {\n // base 2\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (ch !== '0' && ch !== '1') return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n\n\n if (ch === 'x') {\n // base 16\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isHexCode(data.charCodeAt(index))) return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n\n\n if (ch === 'o') {\n // base 8\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isOctCode(data.charCodeAt(index))) return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n }\n\n // base 10 (except 0)\n\n // value should not start with `_`;\n if (ch === '_') return false;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isDecCode(data.charCodeAt(index))) {\n return false;\n }\n hasDigits = true;\n }\n\n // Should have digits and should not end with `_`\n if (!hasDigits || ch === '_') return false;\n\n return true;\n}\n\nfunction constructYamlInteger(data) {\n var value = data, sign = 1, ch;\n\n if (value.indexOf('_') !== -1) {\n value = value.replace(/_/g, '');\n }\n\n ch = value[0];\n\n if (ch === '-' || ch === '+') {\n if (ch === '-') sign = -1;\n value = value.slice(1);\n ch = value[0];\n }\n\n if (value === '0') return 0;\n\n if (ch === '0') {\n if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);\n if (value[1] === 'x') return sign * parseInt(value.slice(2), 16);\n if (value[1] === 'o') return sign * parseInt(value.slice(2), 8);\n }\n\n return sign * parseInt(value, 10);\n}\n\nfunction isInteger(object) {\n return (Object.prototype.toString.call(object)) === '[object Number]' &&\n (object % 1 === 0 && !common.isNegativeZero(object));\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:int', {\n kind: 'scalar',\n resolve: resolveYamlInteger,\n construct: constructYamlInteger,\n predicate: isInteger,\n represent: {\n binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },\n octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); },\n decimal: function (obj) { return obj.toString(10); },\n /* eslint-disable max-len */\n hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }\n },\n defaultStyle: 'decimal',\n styleAliases: {\n binary: [ 2, 'bin' ],\n octal: [ 8, 'oct' ],\n decimal: [ 10, 'dec' ],\n hexadecimal: [ 16, 'hex' ]\n }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:map', {\n kind: 'mapping',\n construct: function (data) { return data !== null ? data : {}; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlMerge(data) {\n return data === '<<' || data === null;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:merge', {\n kind: 'scalar',\n resolve: resolveYamlMerge\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlNull(data) {\n if (data === null) return true;\n\n var max = data.length;\n\n return (max === 1 && data === '~') ||\n (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));\n}\n\nfunction constructYamlNull() {\n return null;\n}\n\nfunction isNull(object) {\n return object === null;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:null', {\n kind: 'scalar',\n resolve: resolveYamlNull,\n construct: constructYamlNull,\n predicate: isNull,\n represent: {\n canonical: function () { return '~'; },\n lowercase: function () { return 'null'; },\n uppercase: function () { return 'NULL'; },\n camelcase: function () { return 'Null'; },\n empty: function () { return ''; }\n },\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\nvar _toString = Object.prototype.toString;\n\nfunction resolveYamlOmap(data) {\n if (data === null) return true;\n\n var objectKeys = [], index, length, pair, pairKey, pairHasKey,\n object = data;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n pairHasKey = false;\n\n if (_toString.call(pair) !== '[object Object]') return false;\n\n for (pairKey in pair) {\n if (_hasOwnProperty.call(pair, pairKey)) {\n if (!pairHasKey) pairHasKey = true;\n else return false;\n }\n }\n\n if (!pairHasKey) return false;\n\n if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);\n else return false;\n }\n\n return true;\n}\n\nfunction constructYamlOmap(data) {\n return data !== null ? data : [];\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:omap', {\n kind: 'sequence',\n resolve: resolveYamlOmap,\n construct: constructYamlOmap\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _toString = Object.prototype.toString;\n\nfunction resolveYamlPairs(data) {\n if (data === null) return true;\n\n var index, length, pair, keys, result,\n object = data;\n\n result = new Array(object.length);\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n\n if (_toString.call(pair) !== '[object Object]') return false;\n\n keys = Object.keys(pair);\n\n if (keys.length !== 1) return false;\n\n result[index] = [ keys[0], pair[keys[0]] ];\n }\n\n return true;\n}\n\nfunction constructYamlPairs(data) {\n if (data === null) return [];\n\n var index, length, pair, keys, result,\n object = data;\n\n result = new Array(object.length);\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n\n keys = Object.keys(pair);\n\n result[index] = [ keys[0], pair[keys[0]] ];\n }\n\n return result;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:pairs', {\n kind: 'sequence',\n resolve: resolveYamlPairs,\n construct: constructYamlPairs\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:seq', {\n kind: 'sequence',\n construct: function (data) { return data !== null ? data : []; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction resolveYamlSet(data) {\n if (data === null) return true;\n\n var key, object = data;\n\n for (key in object) {\n if (_hasOwnProperty.call(object, key)) {\n if (object[key] !== null) return false;\n }\n }\n\n return true;\n}\n\nfunction constructYamlSet(data) {\n return data !== null ? data : {};\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:set', {\n kind: 'mapping',\n resolve: resolveYamlSet,\n construct: constructYamlSet\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:str', {\n kind: 'scalar',\n construct: function (data) { return data !== null ? data : ''; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar YAML_DATE_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9])' + // [2] month\n '-([0-9][0-9])$'); // [3] day\n\nvar YAML_TIMESTAMP_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9]?)' + // [2] month\n '-([0-9][0-9]?)' + // [3] day\n '(?:[Tt]|[ \\\\t]+)' + // ...\n '([0-9][0-9]?)' + // [4] hour\n ':([0-9][0-9])' + // [5] minute\n ':([0-9][0-9])' + // [6] second\n '(?:\\\\.([0-9]*))?' + // [7] fraction\n '(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour\n '(?::([0-9][0-9]))?))?$'); // [11] tz_minute\n\nfunction resolveYamlTimestamp(data) {\n if (data === null) return false;\n if (YAML_DATE_REGEXP.exec(data) !== null) return true;\n if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;\n return false;\n}\n\nfunction constructYamlTimestamp(data) {\n var match, year, month, day, hour, minute, second, fraction = 0,\n delta = null, tz_hour, tz_minute, date;\n\n match = YAML_DATE_REGEXP.exec(data);\n if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);\n\n if (match === null) throw new Error('Date resolve error');\n\n // match: [1] year [2] month [3] day\n\n year = +(match[1]);\n month = +(match[2]) - 1; // JS month starts with 0\n day = +(match[3]);\n\n if (!match[4]) { // no hour\n return new Date(Date.UTC(year, month, day));\n }\n\n // match: [4] hour [5] minute [6] second [7] fraction\n\n hour = +(match[4]);\n minute = +(match[5]);\n second = +(match[6]);\n\n if (match[7]) {\n fraction = match[7].slice(0, 3);\n while (fraction.length < 3) { // milli-seconds\n fraction += '0';\n }\n fraction = +fraction;\n }\n\n // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute\n\n if (match[9]) {\n tz_hour = +(match[10]);\n tz_minute = +(match[11] || 0);\n delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds\n if (match[9] === '-') delta = -delta;\n }\n\n date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));\n\n if (delta) date.setTime(date.getTime() - delta);\n\n return date;\n}\n\nfunction representYamlTimestamp(object /*, style*/) {\n return object.toISOString();\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:timestamp', {\n kind: 'scalar',\n resolve: resolveYamlTimestamp,\n construct: constructYamlTimestamp,\n instanceOf: Date,\n represent: representYamlTimestamp\n});\n","const { avroToJsonSchema } = require('./to-json-schema.js');\n\nmodule.exports.parse = async ({ message, defaultSchemaFormat }) => {\n const transformed = await avroToJsonSchema(message.payload);\n\n message['x-parser-original-schema-format'] = message.schemaFormat || defaultSchemaFormat;\n message['x-parser-original-payload'] = message.payload;\n message.payload = transformed;\n delete message.schemaFormat;\n};\n\nmodule.exports.getMimeTypes = () => {\n return [\n 'application/vnd.apache.avro;version=1.9.0',\n 'application/vnd.apache.avro+json;version=1.9.0',\n 'application/vnd.apache.avro+yaml;version=1.9.0',\n 'application/vnd.apache.avro;version=1.8.2',\n 'application/vnd.apache.avro+json;version=1.8.2',\n 'application/vnd.apache.avro+yaml;version=1.8.2'\n ];\n};\n","const BYTES_PATTERN = '^[\\u0000-\\u00ff]*$';\nconst INT_MIN = Math.pow(-2, 31);\nconst INT_MAX = Math.pow(2, 31) - 1;\nconst LONG_MIN = Math.pow(-2, 63);\nconst LONG_MAX = Math.pow(2, 63) - 1;\n\nconst typeMappings = {\n null: 'null',\n boolean: 'boolean',\n int: 'integer',\n long: 'integer',\n float: 'number',\n double: 'number',\n bytes: 'string',\n string: 'string',\n fixed: 'string',\n map: 'object',\n array: 'array',\n enum: 'string',\n record: 'object',\n uuid: 'string',\n};\n\nmodule.exports.avroToJsonSchema = async function avroToJsonSchema(avroDefinition) {\n const jsonSchema = {};\n const isUnion = Array.isArray(avroDefinition);\n\n if (isUnion) {\n jsonSchema.oneOf = [];\n for (const avroDef of avroDefinition) {\n const def = await avroToJsonSchema(avroDef);\n jsonSchema.oneOf.push(def);\n }\n\n return jsonSchema;\n }\n \n // Avro definition can be a string (e.g. \"int\")\n // or an object like { type: \"int\" }\n const type = avroDefinition.type || avroDefinition;\n jsonSchema.type = typeMappings[type];\n \n switch (type) {\n case 'int':\n jsonSchema.minimum = INT_MIN;\n jsonSchema.maximum = INT_MAX;\n break;\n case 'long':\n jsonSchema.minimum = LONG_MIN;\n jsonSchema.maximum = LONG_MAX;\n break;\n case 'bytes':\n jsonSchema.pattern = BYTES_PATTERN;\n break;\n case 'fixed':\n jsonSchema.pattern = BYTES_PATTERN;\n jsonSchema.minLength = avroDefinition.size;\n jsonSchema.maxLength = avroDefinition.size;\n break;\n case 'map':\n jsonSchema.additionalProperties = await avroToJsonSchema(avroDefinition.values);\n break;\n case 'array':\n jsonSchema.items = await avroToJsonSchema(avroDefinition.items);\n break;\n case 'enum':\n jsonSchema.enum = avroDefinition.symbols;\n break;\n case 'record':\n const propsMap = new Map();\n for (const field of avroDefinition.fields) {\n const def = await avroToJsonSchema(field.type);\n if (field.doc) def.description = field.doc;\n if (field.default) def.default = field.default;\n propsMap.set(field.name, def);\n }\n jsonSchema.properties = Object.fromEntries(propsMap.entries());\n break;\n }\n\n if (avroDefinition.doc) jsonSchema.description = avroDefinition.doc;\n if (avroDefinition.default !== undefined) jsonSchema.default = avroDefinition.default;\n\n return jsonSchema;\n};\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FilePropTypes = void 0;\nvar jsx_runtime_1 = require(\"react/jsx-runtime\");\nvar prop_types_1 = __importDefault(require(\"prop-types\"));\nexports.FilePropTypes = {\n /**\n * `name` prop describes the filename for which should be used when generating the file. If none is specified the filename for the template are used.\n */\n name: prop_types_1.default.string,\n /**\n * `permissions` prop describes the permissions the file should be created with. This is interpreted as an octal number such as 0o777\n */\n permissions: prop_types_1.default.number,\n};\n/**\n * Component is used to describe to the generator that you want a file to be created and rendered based on the defined children.\n *\n * @component\n * @example\n * const name = \"test.js\"\n * const permissions = 0o777\n * return (\n * Test\n * )\n */\nvar File = function (_a) {\n var children = _a.children;\n return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: children }, void 0);\n};\nFile.propTypes = __assign({}, exports.FilePropTypes);\nexports.default = File;\n//# sourceMappingURL=File.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IndentPropTypes = void 0;\nvar jsx_runtime_1 = require(\"react/jsx-runtime\");\nvar prop_types_1 = __importDefault(require(\"prop-types\"));\nvar utils_1 = require(\"../utils\");\nexports.IndentPropTypes = {\n /**\n * `size` prop expects a string which format should be a number which represent the number of `type`'s to indent each content. Default to no indentation.\n */\n size: prop_types_1.default.number,\n /**\n * `type` prop expects a string, you can use the `IndentationTypes` enum, as either `TABS` or `SPACES`. The `type` defaults to `SPACES`.\n */\n type: prop_types_1.default.oneOf(Object.values(utils_1.IndentationTypes)),\n};\n/**\n * Component is for wrapping multiple components and apply an indentation on those.\n *\n * It supports any form of nested components as well, meaning you can have as many nested `Indent` components as you would like.\n *\n * @component\n * @example\n * const size = 4\n * const type = IndentationTypes.SPACES\n * return (\n * test\n * )\n */\nvar Indent = function (_a) {\n var _b = _a.size, size = _b === void 0 ? 0 : _b, _c = _a.type, type = _c === void 0 ? utils_1.IndentationTypes.SPACES : _c, childrenContent = _a.childrenContent;\n return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: utils_1.withIndendation(childrenContent, size, type) }, void 0);\n};\nIndent.propTypes = __assign({}, exports.IndentPropTypes);\nexports.default = Indent;\n//# sourceMappingURL=Indent.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TextPropTypes = void 0;\nvar jsx_runtime_1 = require(\"react/jsx-runtime\");\nvar prop_types_1 = __importDefault(require(\"prop-types\"));\nvar utils_1 = require(\"../utils\");\nexports.TextPropTypes = {\n /**\n * `size` prop expects a string which format should be a number which represent the number of `type`'s to indent each content. Default to no indentation.\n */\n size: prop_types_1.default.number,\n /**\n * `type` prop expects a string, you can use the `IndentationTypes` enum, as either `TABS` or `SPACES`. The `type` defaults to `SPACES`.\n */\n type: prop_types_1.default.oneOf(Object.values(utils_1.IndentationTypes)),\n /**\n * `newLines` prop represents the number of appended new lines. Default to one new line.\n */\n newLines: prop_types_1.default.number,\n};\n/**\n * Component is for defining a group of text which should be rendered on the same line.\n *\n * @component\n * @example\n * const indent = 4\n * const type = IndentationTypes.SPACES\n * const newLines = 2\n * return (\n * Test\n * )\n */\nvar Text = function (_a) {\n var _b = _a.indent, indent = _b === void 0 ? 0 : _b, _c = _a.type, type = _c === void 0 ? utils_1.IndentationTypes.SPACES : _c, _d = _a.newLines, newLines = _d === void 0 ? 1 : _d, childrenContent = _a.childrenContent;\n var contentWithLines = utils_1.withNewLines(childrenContent, newLines);\n return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: utils_1.withIndendation(contentWithLines, indent, type) }, void 0);\n};\nText.propTypes = __assign({}, exports.TextPropTypes);\nexports.default = Text;\n//# sourceMappingURL=Text.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Indent = exports.Text = exports.File = void 0;\nvar File_1 = require(\"./File\");\nObject.defineProperty(exports, \"File\", { enumerable: true, get: function () { return __importDefault(File_1).default; } });\nvar Text_1 = require(\"./Text\");\nObject.defineProperty(exports, \"Text\", { enumerable: true, get: function () { return __importDefault(Text_1).default; } });\nvar Indent_1 = require(\"./Indent\");\nObject.defineProperty(exports, \"Indent\", { enumerable: true, get: function () { return __importDefault(Indent_1).default; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.withNewLines = exports.withIndendation = exports.IndentationTypes = void 0;\n__exportStar(require(\"./components\"), exports);\n__exportStar(require(\"./renderer\"), exports);\n__exportStar(require(\"./transpiler\"), exports);\n__exportStar(require(\"./types\"), exports);\nvar utils_1 = require(\"./utils\");\nObject.defineProperty(exports, \"IndentationTypes\", { enumerable: true, get: function () { return utils_1.IndentationTypes; } });\nObject.defineProperty(exports, \"withIndendation\", { enumerable: true, get: function () { return utils_1.withIndendation; } });\nObject.defineProperty(exports, \"withNewLines\", { enumerable: true, get: function () { return utils_1.withNewLines; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./renderer\"), exports);\n__exportStar(require(\"./template\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.render = void 0;\n/**\n * Normalizes given props with render children to string and save value to `childrenContent` prop\n * @private\n * @param {Any} props\n * @returns {Any} normalized props.\n */\nfunction normalizeProps(props) {\n return __assign(__assign({}, props), { childrenContent: render(props.children) });\n}\n/**\n * Executes a `render` method on a given component (in the case of a class component)\n * or executes the component itself (a functional component) to get pure string or complex value for the next operations\n * @private\n * @param {React.ReactElement} element a given component or complex form\n * @returns {(React.ReactElement | string)}\n */\nfunction createElement(element) {\n if (!element) {\n return \"\";\n }\n var typeOf = typeof element.type;\n if (typeOf === 'string') {\n // HTML (also not standard) tags case\n throw new Error(\"HTML tags is not supported yet.\");\n }\n else if (typeOf === 'symbol') {\n // internal React types like Fragments, Portal etc. We skip them.\n return render(element.props.children);\n }\n else if (typeOf === 'function') {\n // custom components case\n var type = element.type;\n var prototype = type.prototype;\n // Class component case\n if (prototype && typeof prototype.isReactComponent === \"object\") {\n var clazzComp = new type(normalizeProps(element.props));\n return createElement(clazzComp.render());\n }\n // Function component case\n return createElement(type(normalizeProps(element.props)));\n }\n return element || \"\";\n}\n/**\n * Renders given component to string\n *\n * @param {ReactNode} component a given component to rendering\n * @example\n * function Component({ textProp }) {\n * return <>{textProp}\n * }\n * render()\n * @returns {string}\n */\nfunction render(component) {\n var content = \"\";\n var typeOf = typeof component;\n if (typeOf === 'string') {\n content += component;\n }\n else if (Array.isArray(component)) {\n content += component.map(function (child) {\n var childValue = createElement(child);\n return render(childValue);\n }).join(\"\");\n }\n else if (typeOf === \"object\") {\n content += createElement(component);\n }\n return content;\n}\nexports.render = render;\n//# sourceMappingURL=renderer.js.map",null,"\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./transpiler\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.transpileFiles = void 0;\nvar path_1 = __importDefault(require(\"path\"));\nvar rollup_1 = require(\"rollup\");\nvar plugin_babel_1 = __importDefault(require(\"@rollup/plugin-babel\"));\nvar utils_1 = require(\"../utils\");\nvar ROOT_DIR = path_1.default.resolve(__dirname, '../..');\n/**\n * Transpile files in a given directory (and sub directory if recursive option are passed) and write it to an output directory, if no errors are thrown it completed successfully.\n *\n * @param directory to transpile.\n * @param outputDir to write the transpiled files to.\n * @param options any extra options that should be passed.\n */\nfunction transpileFiles(directory, outputDir, options) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, files, dirs, bundles, _i, dirs_1, subdir, subdirPath;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, utils_1.getStatsInDir(directory)];\n case 1:\n _a = _b.sent(), files = _a.files, dirs = _a.dirs;\n if (!files.length) return [3 /*break*/, 4];\n return [4 /*yield*/, rollup_1.rollup({\n input: files,\n onwarn: function () { },\n plugins: [\n plugin_babel_1.default({\n cwd: ROOT_DIR,\n babelHelpers: \"bundled\",\n plugins: [\n \"source-map-support\",\n ],\n presets: [\n [\"@babel/preset-env\", {\n targets: { node: \"12.16\" },\n }],\n [\"@babel/preset-react\", {\n runtime: \"automatic\",\n }],\n ],\n })\n ]\n })];\n case 2:\n bundles = _b.sent();\n return [4 /*yield*/, bundles.write({\n format: \"commonjs\",\n sourcemap: true,\n dir: outputDir,\n exports: \"auto\",\n paths: {\n 'react/jsx-runtime': 'react/cjs/react-jsx-runtime.production.min',\n }\n })];\n case 3:\n _b.sent();\n _b.label = 4;\n case 4:\n if (!((options === null || options === void 0 ? void 0 : options.recursive) === true && dirs.length > 0)) return [3 /*break*/, 8];\n _i = 0, dirs_1 = dirs;\n _b.label = 5;\n case 5:\n if (!(_i < dirs_1.length)) return [3 /*break*/, 8];\n subdir = dirs_1[_i];\n subdirPath = path_1.default.parse(subdir);\n return [4 /*yield*/, transpileFiles(subdir, path_1.default.resolve(outputDir, subdirPath.base), options)];\n case 6:\n _b.sent();\n _b.label = 7;\n case 7:\n _i++;\n return [3 /*break*/, 5];\n case 8: return [2 /*return*/];\n }\n });\n });\n}\nexports.transpileFiles = transpileFiles;\n//# sourceMappingURL=transpiler.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nvar react_1 = __importDefault(require(\"react\"));\nvar Component = /** @class */ (function (_super) {\n __extends(Component, _super);\n function Component() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return Component;\n}(react_1.default.Component));\nexports.Component = Component;\n//# sourceMappingURL=types.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getStatsInDir = void 0;\nvar path_1 = __importDefault(require(\"path\"));\nvar fs_1 = __importDefault(require(\"fs\"));\nvar util_1 = require(\"util\");\nvar _1 = require(\".\");\nvar readdir = util_1.promisify(fs_1.default.readdir);\nvar stat = util_1.promisify(fs_1.default.stat);\nvar GetFilesResponse = /** @class */ (function () {\n function GetFilesResponse(files, dirs) {\n this.files = files;\n this.dirs = dirs;\n }\n return GetFilesResponse;\n}());\n/**\n * Function which finds all the files and dirs in folders\n * @private\n * @param dir directory to find files and dirs in.\n * @param includeSubDirs should the function iterate through subdirectories to search for files and dirs?\n */\nfunction getStatsInDir(dir) {\n return __awaiter(this, void 0, void 0, function () {\n var allFiles, files, dirs, _i, allFiles_1, filename, res, stats, resolveFilenameCallback;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, readdir(dir)];\n case 1:\n allFiles = _a.sent();\n files = [];\n dirs = [];\n _i = 0, allFiles_1 = allFiles;\n _a.label = 2;\n case 2:\n if (!(_i < allFiles_1.length)) return [3 /*break*/, 5];\n filename = allFiles_1[_i];\n res = path_1.default.resolve(dir, filename);\n return [4 /*yield*/, stat(res)];\n case 3:\n stats = _a.sent();\n if (stats.isDirectory()) {\n dirs.push(res);\n }\n else if (_1.isJsFile(filename)) {\n files.push(res);\n }\n _a.label = 4;\n case 4:\n _i++;\n return [3 /*break*/, 2];\n case 5:\n resolveFilenameCallback = function (filename) {\n return path_1.default.resolve(dir, filename);\n };\n files = files.map(resolveFilenameCallback);\n dirs = dirs.map(resolveFilenameCallback);\n return [2 /*return*/, new GetFilesResponse(files, dirs)];\n }\n });\n });\n}\nexports.getStatsInDir = getStatsInDir;\n//# sourceMappingURL=getStatsInDir.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./getStatsInDir\"), exports);\n__exportStar(require(\"./isJsFile\"), exports);\n__exportStar(require(\"./withIndendation\"), exports);\n__exportStar(require(\"./withNewLines\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isJsFile = void 0;\nvar ALLOWED_EXTS = ['js', 'jsx', 'cjs'];\n/**\n * Function which checks if file is JS file\n * @private\n * @param {string} filename\n * @returns {boolean}\n */\nfunction isJsFile(filename) {\n if (filename === void 0) { filename = ''; }\n var ext = filename.split('.').pop() || '';\n return ALLOWED_EXTS.includes(ext);\n}\nexports.isJsFile = isJsFile;\n//# sourceMappingURL=isJsFile.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.withIndendation = exports.IndentationTypes = void 0;\n/**\n * Type of indentation to use\n * @readonly\n * @enum {string}\n * @property {string} TABS - indicate to use tabs as separator\n * @property {string} SPACES - indicate to use spaces as separator\n */\nvar IndentationTypes;\n(function (IndentationTypes) {\n IndentationTypes[\"TABS\"] = \"tabs\";\n IndentationTypes[\"SPACES\"] = \"spaces\";\n})(IndentationTypes = exports.IndentationTypes || (exports.IndentationTypes = {}));\n/**\n * Ensures indentations are prepended to content.\n * @private\n * @param {string} content to prepend the indentation\n * @param {number} size the number of indendations to use\n * @param {IndentationTypes} type the type of indendations to use. SPACES by default.\n * @returns {string}\n */\nfunction withIndendation(content, size, type) {\n if (content === void 0) { content = ''; }\n if (type === void 0) { type = IndentationTypes.SPACES; }\n if (size < 1) {\n return content;\n }\n // if the content includes new lines ensure that they have the added indentation as well.\n if (content.includes('\\n')) {\n var newLineArray = content.split('\\n');\n return newLineArray.reduce(function (accumulator, value) {\n var newValue = value.trim() === '' ? value : \"\" + getIndentation(size, type) + value;\n return accumulator === \"\" ? newValue : accumulator + \"\\n\" + newValue;\n }, \"\");\n }\n return \"\" + getIndentation(size, type) + content;\n}\nexports.withIndendation = withIndendation;\n/**\n * Get the indendation string based on how many and which type of indentation are requested.\n * @private\n * @param {number} size the number of indendations to use\n * @param {IndentationTypes} type the type of indendations to use. SPACES by default.\n * @returns {string}\n */\nfunction getIndentation(size, type) {\n if (size === void 0) { size = 0; }\n if (type === void 0) { type = IndentationTypes.SPACES; }\n var whitespaceChar = type === IndentationTypes.SPACES ? ' ' : '\\t';\n return Array(size).fill(whitespaceChar).join(\"\");\n}\n//# sourceMappingURL=withIndendation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.withNewLines = void 0;\n/**\n * Prepend given number of the new lines to content.\n * @private\n * @param {string} content\n * @param {number} number\n * @returns {string}\n */\nfunction withNewLines(content, number) {\n if (content === void 0) { content = ''; }\n if (number === void 0) { number = 0; }\n var newLines = Array(number).fill('\\n').join('');\n return content + newLines;\n}\nexports.withNewLines = withNewLines;\n//# sourceMappingURL=withNewLines.js.map",null,"const path = require('path');\nconst fs = require('fs');\nconst xfs = require('fs.extra');\nconst minimatch = require('minimatch');\nconst parser = require('@asyncapi/parser');\nconst { configureReact, renderReact, saveRenderedReactContent } = require('./renderer/react');\nconst { configureNunjucks, renderNunjucks } = require('./renderer/nunjucks');\nconst { parse, AsyncAPIDocument } = parser;\nconst ramlDtParser = require('@asyncapi/raml-dt-schema-parser');\nconst openapiSchemaParser = require('@asyncapi/openapi-schema-parser');\nconst avroSchemaParser = require('@asyncapi/avro-schema-parser');\nconst jmespath = require('jmespath');\nconst filenamify = require('filenamify');\nconst git = require('simple-git/promise');\nconst log = require('loglevel');\nconst Arborist = require('@npmcli/arborist');\nconst { validateTemplateConfig } = require('./templateConfigValidator');\nconst {\n convertMapToObject,\n isFileSystemPath,\n readFile,\n readDir,\n writeFile,\n copyFile,\n exists,\n fetchSpec,\n getInvalidOptions,\n isReactTemplate,\n isJsFile,\n registerSourceMap,\n registerTypeScript,\n getTemplateDetails,\n getMapBaseUrlToFolderResolver\n} = require('./utils');\nconst { registerFilters } = require('./filtersRegistry');\nconst { registerHooks } = require('./hooksRegistry');\n\nconst FILTERS_DIRNAME = 'filters';\nconst HOOKS_DIRNAME = 'hooks';\nconst CONFIG_FILENAME = 'package.json';\nconst PACKAGE_JSON_FILENAME = 'package.json';\nconst GIT_IGNORE_FILENAME = '{.gitignore}';\nconst NPM_IGNORE_FILENAME = '{.npmignore}';\nconst ROOT_DIR = path.resolve(__dirname, '..');\nconst DEFAULT_TEMPLATES_DIR = path.resolve(ROOT_DIR, 'node_modules');\n\nconst TRANSPILED_TEMPLATE_LOCATION = '__transpiled';\nconst TEMPLATE_CONTENT_DIRNAME = 'template';\nconst GENERATOR_OPTIONS = ['debug', 'disabledHooks', 'entrypoint', 'forceWrite', 'install', 'noOverwriteGlobs', 'output', 'templateParams', 'mapBaseUrlToFolder'];\n\nconst logMessage = require('./logMessages');\n\nconst shouldIgnoreFile = filePath =>\n filePath.startsWith(`.git${path.sep}`);\n\nconst shouldIgnoreDir = dirPath =>\n dirPath === '.git'\n || dirPath.startsWith(`.git${path.sep}`);\n\nparser.registerSchemaParser(openapiSchemaParser);\nparser.registerSchemaParser(ramlDtParser);\nparser.registerSchemaParser(avroSchemaParser);\nregisterSourceMap();\nregisterTypeScript();\n\nclass Generator {\n /**\n * Instantiates a new Generator object.\n *\n * @example\n * const path = require('path');\n * const generator = new Generator('@asyncapi/html-template', path.resolve(__dirname, 'example'));\n *\n * @example Passing custom params to the template\n * const path = require('path');\n * const generator = new Generator('@asyncapi/html-template', path.resolve(__dirname, 'example'), {\n * templateParams: {\n * sidebarOrganization: 'byTags'\n * }\n * });\n *\n * @param {String} templateName Name of the template to generate.\n * @param {String} targetDir Path to the directory where the files will be generated.\n * @param {Object} options\n * @param {String} [options.templateParams] Optional parameters to pass to the template. Each template define their own params.\n * @param {String} [options.entrypoint] Name of the file to use as the entry point for the rendering process. Use in case you want to use only a specific template file. Note: this potentially avoids rendering every file in the template.\n * @param {String[]} [options.noOverwriteGlobs] List of globs to skip when regenerating the template.\n * @param {Object} [options.disabledHooks] Object with hooks to disable. The key is a hook type. If key has \"true\" value, then the generator skips all hooks from the given type. If the value associated with a key is a string with the name of a single hook, then the generator skips only this single hook name. If the value associated with a key is an array of strings, then the generator skips only hooks from the array.\n * @param {String} [options.output='fs'] Type of output. Can be either 'fs' (default) or 'string'. Only available when entrypoint is set.\n * @param {Boolean} [options.forceWrite=false] Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir. Default is set to false.\n * @param {Boolean} [options.install=false] Install the template and its dependencies, even when the template has already been installed.\n * @param {Boolean} [options.debug=false] Enable more specific errors in the console. At the moment it only shows specific errors about filters. Keep in mind that as a result errors about template are less descriptive.\n * @param {Object} [options.mapBaseUrlToFolder] Optional parameter to map schema references from a base url to a local base folder e.g. url=https://schema.example.com/crm/ folder=./test/docs/ .\n */\n constructor(templateName, targetDir, { templateParams = {}, entrypoint, noOverwriteGlobs, disabledHooks, output = 'fs', forceWrite = false, install = false, debug = false, mapBaseUrlToFolder = {} } = {}) {\n const invalidOptions = getInvalidOptions(GENERATOR_OPTIONS, arguments[arguments.length - 1] || []);\n if (invalidOptions.length) throw new Error(`These options are not supported by the generator: ${invalidOptions.join(', ')}`);\n if (!templateName) throw new Error('No template name has been specified.');\n if (!entrypoint && !targetDir) throw new Error('No target directory has been specified.');\n if (!['fs', 'string'].includes(output)) throw new Error(`Invalid output type ${output}. Valid values are 'fs' and 'string'.`);\n\n /** @type {String} Name of the template to generate. */\n this.templateName = templateName;\n /** @type {String} Path to the directory where the files will be generated. */\n this.targetDir = targetDir;\n /** @type {String} Name of the file to use as the entry point for the rendering process. Use in case you want to use only a specific template file. Note: this potentially avoids rendering every file in the template. */\n this.entrypoint = entrypoint;\n /** @type {String[]} List of globs to skip when regenerating the template. */\n this.noOverwriteGlobs = noOverwriteGlobs || [];\n /** @type {Object} Object with hooks to disable. The key is a hook type. If key has \"true\" value, then the generator skips all hooks from the given type. If the value associated with a key is a string with the name of a single hook, then the generator skips only this single hook name. If the value associated with a key is an array of strings, then the generator skips only hooks from the array. */\n this.disabledHooks = disabledHooks || {};\n /** @type {String} Type of output. Can be either 'fs' (default) or 'string'. Only available when entrypoint is set. */\n this.output = output;\n /** @type {Boolean} Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir. Default is set to false. */\n this.forceWrite = forceWrite;\n /** @type {Boolean} Enable more specific errors in the console. At the moment it only shows specific errors about filters. Keep in mind that as a result errors about template are less descriptive. */\n this.debug = debug;\n /** @type {Boolean} Install the template and its dependencies, even when the template has already been installed. */\n this.install = install;\n /** @type {Object} The template configuration. */\n this.templateConfig = {};\n /** @type {Object} Hooks object with hooks functions grouped by the hook type. */\n this.hooks = {};\n /** @type {Object} Maps schema URL to folder. */\n this.mapBaseUrlToFolder = mapBaseUrlToFolder;\n\n // Load template configuration\n /** @type {Object} The template parameters. The structure for this object is based on each individual template. */\n this.templateParams = {};\n Object.keys(templateParams).forEach(key => {\n const self = this;\n Object.defineProperty(this.templateParams, key, {\n enumerable: true,\n get() {\n if (!self.templateConfig.parameters || !self.templateConfig.parameters[key]) {\n throw new Error(`Template parameter \"${key}\" has not been defined in the package.json file under generator property. Please make sure it's listed there before you use it in your template.`);\n }\n return templateParams[key];\n }\n });\n });\n }\n\n /**\n * Generates files from a given template and an AsyncAPIDocument object.\n *\n * @example\n * generator\n * .generate(myAsyncAPIdocument)\n * .then(() => {\n * console.log('Done!');\n * })\n * .catch(console.error);\n *\n * @example Using async/await\n * try {\n * await generator.generate(myAsyncAPIdocument);\n * console.log('Done!');\n * } catch (e) {\n * console.error(e);\n * }\n *\n * @param {AsyncAPIDocument} asyncapiDocument AsyncAPIDocument object to use as source.\n * @return {Promise}\n */\n async generate(asyncapiDocument) {\n if (!(asyncapiDocument instanceof AsyncAPIDocument)) throw new Error('Parameter \"asyncapiDocument\" must be an AsyncAPIDocument object.');\n\n if (this.output === 'fs') {\n xfs.mkdirpSync(this.targetDir);\n if (!this.forceWrite) await this.verifyTargetDir(this.targetDir);\n } else if (this.output === 'string' && this.entrypoint === undefined) {\n throw new Error('Parameter entrypoint is required when using output = \"string\"');\n }\n\n if (this.debug) log.setLevel('debug');\n\n const { name: templatePkgName, path: templatePkgPath } = await this.installTemplate(this.install);\n this.templateDir = templatePkgPath;\n this.templateName = templatePkgName;\n this.templateContentDir = path.resolve(this.templateDir, TEMPLATE_CONTENT_DIRNAME);\n await this.loadTemplateConfig();\n validateTemplateConfig(this.templateConfig, this.templateParams, asyncapiDocument);\n await this.configureTemplate();\n\n if (!isReactTemplate(this.templateConfig)) {\n await registerFilters(this.nunjucks, this.templateConfig, this.templateDir, FILTERS_DIRNAME);\n }\n await registerHooks(this.hooks, this.templateConfig, this.templateDir, HOOKS_DIRNAME);\n await this.launchHook('generate:before');\n\n if (this.entrypoint) {\n const entrypointPath = path.resolve(this.templateContentDir, this.entrypoint);\n if (!(await exists(entrypointPath))) throw new Error(`Template entrypoint \"${entrypointPath}\" couldn't be found.`);\n if (this.output === 'fs') {\n await this.generateFile(asyncapiDocument, path.basename(entrypointPath), path.dirname(entrypointPath));\n await this.launchHook('generate:after');\n } else if (this.output === 'string') {\n return this.renderFile(asyncapiDocument, entrypointPath);\n }\n } else {\n await this.generateDirectoryStructure(asyncapiDocument);\n await this.launchHook('generate:after');\n }\n }\n\n /**\n * Configure the templates based the desired renderer.\n */\n async configureTemplate() {\n if (isReactTemplate(this.templateConfig)) {\n await configureReact(this.templateDir, this.templateContentDir, TRANSPILED_TEMPLATE_LOCATION);\n } else {\n this.nunjucks = configureNunjucks(this.debug, this.templateDir);\n }\n }\n\n /**\n * Generates files from a given template and AsyncAPI string.\n *\n * @example\n * const asyncapiString = `\n * asyncapi: '2.0.0'\n * info:\n * title: Example\n * version: 1.0.0\n * ...\n * `;\n * generator\n * .generateFromString(asyncapiString)\n * .then(() => {\n * console.log('Done!');\n * })\n * .catch(console.error);\n *\n * @example Using async/await\n * const asyncapiString = `\n * asyncapi: '2.0.0'\n * info:\n * title: Example\n * version: 1.0.0\n * ...\n * `;\n *\n * try {\n * await generator.generateFromString(asyncapiString);\n * console.log('Done!');\n * } catch (e) {\n * console.error(e);\n * }\n *\n * @param {String} asyncapiString AsyncAPI string to use as source.\n * @param {Object} [parserOptions={}] AsyncAPI parser options. Check out {@link https://www.github.com/asyncapi/parser-js|@asyncapi/parser} for more information.\n * @return {Promise}\n */\n async generateFromString(asyncapiString, parserOptions = {}) {\n if (!asyncapiString || typeof asyncapiString !== 'string') throw new Error('Parameter \"asyncapiString\" must be a non-empty string.');\n\n /** @type {String} AsyncAPI string to use as a source. */\n this.originalAsyncAPI = asyncapiString;\n\n /** @type {AsyncAPIDocument} Parsed AsyncAPI schema. See {@link https://github.com/asyncapi/parser-js/blob/master/API.md#module_@asyncapi/parser+AsyncAPIDocument|AsyncAPIDocument} for details on object structure. */\n this.asyncapi = await parse(asyncapiString, parserOptions);\n return this.generate(this.asyncapi);\n }\n\n /**\n * Generates files from a given template and AsyncAPI file stored on external server.\n *\n * @example\n * generator\n * .generateFromURL('https://example.com/asyncapi.yaml')\n * .then(() => {\n * console.log('Done!');\n * })\n * .catch(console.error);\n *\n * @example Using async/await\n * try {\n * await generator.generateFromURL('https://example.com/asyncapi.yaml');\n * console.log('Done!');\n * } catch (e) {\n * console.error(e);\n * }\n *\n * @param {String} asyncapiURL Link to AsyncAPI file\n * @return {Promise}\n */\n async generateFromURL(asyncapiURL) {\n const doc = await fetchSpec(asyncapiURL);\n const parserOptions = {};\n if (this.mapBaseUrlToFolder.url) {\n parserOptions.resolve = {resolver: getMapBaseUrlToFolderResolver(this.mapBaseUrlToFolder)};\n }\n\n return this.generateFromString(doc, parserOptions);\n }\n\n /**\n * Generates files from a given template and AsyncAPI file.\n *\n * @example\n * generator\n * .generateFromFile('asyncapi.yaml')\n * .then(() => {\n * console.log('Done!');\n * })\n * .catch(console.error);\n *\n * @example Using async/await\n * try {\n * await generator.generateFromFile('asyncapi.yaml');\n * console.log('Done!');\n * } catch (e) {\n * console.error(e);\n * }\n *\n * @param {String} asyncapiFile AsyncAPI file to use as source.\n * @return {Promise}\n */\n async generateFromFile(asyncapiFile) {\n const doc = await readFile(asyncapiFile, { encoding: 'utf8' });\n const parserOptions = { path: asyncapiFile };\n if (this.mapBaseUrlToFolder.url) {\n parserOptions.resolve = {resolver: getMapBaseUrlToFolderResolver(this.mapBaseUrlToFolder)};\n }\n\n return this.generateFromString(doc, parserOptions);\n }\n\n /**\n * Returns the content of a given template file.\n *\n * @example\n * const Generator = require('asyncapi-generator');\n * const content = await Generator.getTemplateFile('@asyncapi/html-template', 'partials/content.html');\n *\n * @example Using a custom `templatesDir`\n * const Generator = require('asyncapi-generator');\n * const content = await Generator.getTemplateFile('@asyncapi/html-template', 'partials/content.html', '~/my-templates');\n *\n * @static\n * @param {String} templateName Name of the template to generate.\n * @param {String} filePath Path to the file to render. Relative to the template directory.\n * @param {String} [templatesDir=DEFAULT_TEMPLATES_DIR] Path to the directory where the templates are installed.\n * @return {Promise}\n */\n static async getTemplateFile(templateName, filePath, templatesDir = DEFAULT_TEMPLATES_DIR) {\n return await readFile(path.resolve(templatesDir, templateName, filePath), 'utf8');\n }\n\n /**\n * Downloads and installs a template and its dependencies\n *\n * @param {Boolean} [force=false] Whether to force installation (and skip cache) or not.\n */\n installTemplate(force = false) {\n return new Promise(async (resolve, reject) => {\n if (!force) {\n let pkgPath;\n let installedPkg;\n let packageVersion;\n\n try {\n installedPkg = getTemplateDetails(this.templateName, PACKAGE_JSON_FILENAME);\n pkgPath = installedPkg && installedPkg.pkgPath;\n packageVersion = installedPkg && installedPkg.version;\n log.debug(logMessage.templateSource(pkgPath));\n if (packageVersion) log.debug(logMessage.templateVersion(packageVersion));\n\n return resolve({\n name: installedPkg.name,\n path: pkgPath\n });\n } catch (e) {\n log.debug(logMessage.packageNotAvailable(pkgPath), e);\n // We did our best. Proceed with installation...\n }\n }\n\n const debugMessage = force ? logMessage.TEMPLATE_INSTALL_FLAG_MSG : logMessage.TEMPLATE_INSTALL_DISK_MSG;\n log.debug(logMessage.installationDebugMessage(debugMessage));\n\n if (isFileSystemPath(this.templateName)) log.debug(logMessage.NPM_INSTALL_TRIGGER);\n\n const arb = new Arborist({\n path: ROOT_DIR\n });\n\n try {\n const installResult = await arb.reify({\n add: [this.templateName],\n saveType: 'prod',\n save: false\n });\n\n const addResult = arb[Symbol.for('resolvedAdd')];\n if (!addResult) return reject('Unable to resolve the name of the added package. It was most probably not added to node_modules successfully');\n\n const packageName = addResult[0].name;\n const packageVersion = installResult.children.get(packageName).version;\n const packagePath = installResult.children.get(packageName).path;\n\n if (!isFileSystemPath(this.templateName)) log.debug(logMessage.templateSuccessfullyInstalled(packageName, packagePath));\n if (packageVersion) log.debug(logMessage.templateVersion(packageVersion));\n\n return resolve({\n name: packageName,\n path: packagePath,\n });\n } catch (err) {\n reject(err);\n }\n });\n }\n\n /**\n * Returns all the parameters on the AsyncAPI document.\n *\n * @private\n * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source.\n */\n getAllParameters(asyncapiDocument) {\n const parameters = new Map();\n\n if (asyncapiDocument.hasChannels()) {\n asyncapiDocument.channelNames().forEach(channelName => {\n const channel = asyncapiDocument.channel(channelName);\n for (const [key, value] of Object.entries(channel.parameters())) {\n parameters.set(key, value);\n }\n });\n }\n\n if (asyncapiDocument.hasComponents()) {\n for (const [key, value] of Object.entries(asyncapiDocument.components().parameters())) {\n parameters.set(key, value);\n }\n }\n\n return parameters;\n }\n\n /**\n * Generates the directory structure.\n *\n * @private\n * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source.\n * @return {Promise}\n */\n generateDirectoryStructure(asyncapiDocument) {\n const objectMap = {};\n asyncapiDocument.allSchemas().forEach((schema, schemaId) => { if (schema.type() === 'object') objectMap[schemaId] = schema; });\n\n return new Promise((resolve, reject) => {\n xfs.mkdirpSync(this.targetDir);\n\n const walker = xfs.walk(this.templateContentDir, {\n followLinks: false\n });\n\n walker.on('file', async (root, stats, next) => {\n try {\n await this.filesGenerationHandler(asyncapiDocument, objectMap, root, stats, next);\n } catch (e) {\n reject(e);\n }\n });\n\n walker.on('directory', async (root, stats, next) => {\n try {\n this.ignoredDirHandler(root, stats, next);\n } catch (e) {\n reject(e);\n }\n });\n\n walker.on('errors', (root, nodeStatsArray) => {\n reject(nodeStatsArray);\n });\n\n walker.on('end', async () => {\n resolve();\n });\n });\n }\n\n /**\n * Makes sure that during directory structure generation ignored dirs are not modified\n * @private\n *\n * @param {String} root Dir name.\n * @param {String} stats Information about the file.\n * @param {Function} next Callback function\n */\n ignoredDirHandler(root, stats, next) {\n const relativeDir = path.relative(this.templateContentDir, path.resolve(root, stats.name));\n const dirPath = path.resolve(this.targetDir, relativeDir);\n if (!shouldIgnoreDir(relativeDir)) {\n xfs.mkdirpSync(dirPath);\n }\n next();\n }\n\n /**\n * Makes sure that during directory structure generation ignored dirs are not modified\n * @private\n *\n * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source.\n * @param {String} objectMap Map of schemas of type object\n * @param {String} root Dir name.\n * @param {String} stats Information about the file.\n * @param {Function} next Callback function\n */\n async filesGenerationHandler(asyncapiDocument, objectMap, root, stats, next) {\n const fileNamesForSeparation = {\n channel: asyncapiDocument.channels(),\n message: convertMapToObject(asyncapiDocument.allMessages()),\n securityScheme: asyncapiDocument.components() ? asyncapiDocument.components().securitySchemes() : {},\n schema: asyncapiDocument.components() ? asyncapiDocument.components().schemas() : {},\n objectSchema: objectMap,\n parameter: convertMapToObject(this.getAllParameters(asyncapiDocument)),\n everySchema: convertMapToObject(asyncapiDocument.allSchemas()),\n };\n\n // Check if the filename dictates it should be separated\n let wasSeparated = false;\n for (const prop in fileNamesForSeparation) {\n if (Object.prototype.hasOwnProperty.call(fileNamesForSeparation, prop) && stats.name.includes(`$$${prop}$$`)) {\n await this.generateSeparateFiles(asyncapiDocument, fileNamesForSeparation[prop], prop, stats.name, root);\n const templateFilePath = path.relative(this.templateContentDir, path.resolve(root, stats.name));\n fs.unlink(path.resolve(this.targetDir, templateFilePath), next);\n wasSeparated = true;\n //The filename can only contain 1 specifier (message, scheme etc)\n break;\n }\n }\n // If it was not separated process normally\n if (!wasSeparated) {\n await this.generateFile(asyncapiDocument, stats.name, root);\n next();\n }\n }\n\n /**\n * Generates all the files for each in array\n *\n * @private\n * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source.\n * @param {Array} array The components/channels to generate the separeted files for.\n * @param {String} template The template filename to replace.\n * @param {String} fileName Name of the file to generate for each security schema.\n * @param {String} baseDir Base directory of the given file name.\n * @returns {Promise}\n */\n generateSeparateFiles(asyncapiDocument, array, template, fileName, baseDir) {\n const promises = [];\n\n Object.keys(array).forEach((name) => {\n const component = array[name];\n promises.push(this.generateSeparateFile(asyncapiDocument, name, component, template, fileName, baseDir));\n });\n\n return Promise.all(promises);\n }\n\n /**\n * Generates a file for a component/channel\n *\n * @private\n * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source.\n * @param {String} name The name of the component (filename to use)\n * @param {Object} component The component/channel object used to generate the file.\n * @param {String} template The template filename to replace.\n * @param {String} fileName Name of the file to generate for each security schema.\n * @param {String} baseDir Base directory of the given file name.\n * @returns {Promise}\n */\n async generateSeparateFile(asyncapiDocument, name, component, template, fileName, baseDir) {\n const relativeBaseDir = path.relative(this.templateContentDir, baseDir);\n\n const setFileTemplateNameHookName = 'setFileTemplateName';\n let filename = name;\n if (this.isHookAvailable(setFileTemplateNameHookName)) {\n const filenamesFromHooks = await this.launchHook(setFileTemplateNameHookName, { originalFilename: filename });\n //Use the result of the first hook\n filename = filenamesFromHooks[0];\n } else {\n filename = filenamify(filename, { replacement: '-', maxLength: 255 });\n }\n\n const newFileName = fileName.replace(`\\$\\$${template}\\$\\$`, filename);\n const targetFile = path.resolve(this.targetDir, relativeBaseDir, newFileName);\n const relativeTargetFile = path.relative(this.targetDir, targetFile);\n const shouldOverwriteFile = this.shouldOverwriteFile(relativeTargetFile);\n if (!shouldOverwriteFile) return;\n //Ensure the same object are parsed to the renderFile method as before.\n const temp = {};\n const key = template === 'everySchema' || template === 'objectSchema' ? 'schema' : template;\n temp[`${key}Name`] = name;\n temp[key] = component;\n await this.renderAndWriteToFile(asyncapiDocument, path.resolve(baseDir, fileName), targetFile, temp);\n }\n\n /**\n * Renders a template and writes the result into a file.\n *\n * @private\n * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to pass to the template.\n * @param {String} templateFilePath Path to the input file being rendered.\n * @param {String} outputPath Path to the resulting rendered file.\n * @param {Object} [extraTemplateData] Extra data to pass to the template.\n */\n async renderAndWriteToFile(asyncapiDocument, templateFilePath, outputpath, extraTemplateData) {\n const renderContent = await this.renderFile(asyncapiDocument, templateFilePath, extraTemplateData);\n if (renderContent === undefined) {\n return;\n } else if (isReactTemplate(this.templateConfig)) {\n await saveRenderedReactContent(renderContent, outputpath);\n } else {\n await writeFile(outputpath, renderContent);\n }\n }\n\n /**\n * Generates a file.\n *\n * @private\n * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to use as the source.\n * @param {String} fileName Name of the file to generate for each channel.\n * @param {String} baseDir Base directory of the given file name.\n * @return {Promise}\n */\n async generateFile(asyncapiDocument, fileName, baseDir) {\n const sourceFile = path.resolve(baseDir, fileName);\n const relativeSourceFile = path.relative(this.templateContentDir, sourceFile);\n const targetFile = path.resolve(this.targetDir, this.maybeRenameSourceFile(relativeSourceFile));\n const relativeTargetFile = path.relative(this.targetDir, targetFile);\n\n if (shouldIgnoreFile(relativeSourceFile)) return;\n\n const shouldOverwriteFile = this.shouldOverwriteFile(relativeTargetFile);\n if (!shouldOverwriteFile) return;\n\n if (this.templateConfig.conditionalFiles && this.templateConfig.conditionalFiles[relativeSourceFile]) {\n const server = this.templateParams.server && asyncapiDocument.server(this.templateParams.server);\n const source = jmespath.search({\n ...asyncapiDocument.json(),\n ...{\n server: server ? server.json() : undefined,\n },\n }, this.templateConfig.conditionalFiles[relativeSourceFile].subject);\n\n if (!source) return log.debug(logMessage.relativeSourceFileNotGenerated(relativeSourceFile, this.templateConfig.conditionalFiles[relativeSourceFile].subject));\n\n if (source) {\n const validate = this.templateConfig.conditionalFiles[relativeSourceFile].validate;\n const valid = validate(source);\n if (!valid) return log.debug(logMessage.conditionalFilesMatched(relativeSourceFile));\n }\n }\n\n if (this.isNonRenderableFile(relativeSourceFile)) return await copyFile(sourceFile, targetFile);\n\n await this.renderAndWriteToFile(asyncapiDocument, sourceFile, targetFile);\n }\n\n /**\n * It may rename the source file name in cases where special names are not supported, like .gitignore or .npmignore.\n *\n * Since we're using npm to install templates, these files are never downloaded (that's npm behavior we can't change).\n * @private\n * @param {String} sourceFile Path to the source file\n * @returns {String} New path name\n */\n maybeRenameSourceFile(sourceFile) {\n switch (path.basename(sourceFile)) {\n case GIT_IGNORE_FILENAME:\n return path.join(path.dirname(sourceFile), '.gitignore');\n case NPM_IGNORE_FILENAME:\n return path.join(path.dirname(sourceFile), '.npmignore');\n default:\n return sourceFile;\n }\n }\n\n /**\n * Renders the content of a file and outputs it.\n *\n * @private\n * @param {AsyncAPIDocument} asyncapiDocument AsyncAPI document to pass to the template.\n * @param {String} filePath Path to the file you want to render.\n * @param {Object} [extraTemplateData] Extra data to pass to the template.\n * @return {Promise|undefined>}\n */\n async renderFile(asyncapiDocument, filePath, extraTemplateData = {}) {\n if (isReactTemplate(this.templateConfig)) {\n return await renderReact(asyncapiDocument, filePath, extraTemplateData, this.templateDir, this.templateContentDir, TRANSPILED_TEMPLATE_LOCATION, this.templateParams, this.debug, this.originalAsyncAPI);\n }\n const templateString = await readFile(filePath, 'utf8');\n return renderNunjucks(asyncapiDocument, templateString, filePath, extraTemplateData, this.templateParams, this.originalAsyncAPI, this.nunjucks);\n }\n\n /**\n * Checks if a given file name matches the list of non-renderable files.\n *\n * @private\n * @param {string} fileName Name of the file to check against a list of glob patterns.\n * @return {boolean}\n */\n isNonRenderableFile(fileName) {\n const nonRenderableFiles = this.templateConfig.nonRenderableFiles || [];\n if (!Array.isArray(nonRenderableFiles)) return false;\n if (nonRenderableFiles.some(globExp => minimatch(fileName, globExp))) return true;\n if (isReactTemplate(this.templateConfig) && !isJsFile(fileName)) return true;\n return false;\n }\n\n /**\n * Checks if a given file should be overwritten.\n *\n * @private\n * @param {string} filePath Path to the file to check against a list of glob patterns.\n * @return {boolean}\n */\n async shouldOverwriteFile(filePath) {\n if (!Array.isArray(this.noOverwriteGlobs)) return true;\n const fileExists = await exists(path.resolve(this.targetDir, filePath));\n if (!fileExists) return true;\n\n return !this.noOverwriteGlobs.some(globExp => minimatch(filePath, globExp));\n }\n\n /**\n * Loads the template configuration.\n * @private\n */\n async loadTemplateConfig() {\n try {\n const configPath = path.resolve(this.templateDir, CONFIG_FILENAME);\n if (!fs.existsSync(configPath)) {\n this.templateConfig = {};\n return;\n }\n\n const json = await readFile(configPath, { encoding: 'utf8' });\n const generatorProp = JSON.parse(json).generator;\n this.templateConfig = generatorProp || {};\n } catch (e) {\n this.templateConfig = {};\n }\n await this.loadDefaultValues();\n }\n\n /**\n * Loads default values of parameters from template config. If value was already set as parameter it will not be\n * overriden.\n * @private\n */\n async loadDefaultValues() {\n const parameters = this.templateConfig.parameters;\n const defaultValues = Object.keys(parameters || {}).filter(key => parameters[key].default);\n\n defaultValues.filter(dv => this.templateParams[dv] === undefined).forEach(dv =>\n Object.defineProperty(this.templateParams, dv, {\n enumerable: true,\n get() {\n return parameters[dv].default;\n }\n })\n );\n }\n\n /**\n * Launches all the hooks registered at a given hook point/name.\n *\n * @param {string} hookName\n * @param {*} hookArguments\n * @private\n */\n async launchHook(hookName, hookArguments) {\n let disabledHooks = this.disabledHooks[hookName] || [];\n if (disabledHooks === true) return;\n if (typeof disabledHooks === 'string') disabledHooks = [disabledHooks];\n\n const hooks = this.hooks[hookName];\n if (!Array.isArray(hooks)) return;\n const promises = hooks.map(async (hook) => {\n if (typeof hook !== 'function') return;\n if (disabledHooks.includes(hook.name)) return;\n return await hook(this, hookArguments);\n }).filter(Boolean);\n\n return Promise.all(promises);\n }\n\n /**\n * Check if any hooks are available\n *\n * @param {string} hookName\n * @private\n */\n isHookAvailable(hookName) {\n const hooks = this.hooks[hookName];\n\n if (this.disabledHooks[hookName] === true\n || !Array.isArray(hooks)\n || hooks.length === 0) return false;\n\n let disabledHooks = this.disabledHooks[hookName] || [];\n if (typeof disabledHooks === 'string') disabledHooks = [disabledHooks];\n\n return !!hooks.filter(h => !disabledHooks.includes(h.name)).length;\n }\n\n /**\n * Check if given directory is a git repo with unstaged changes and is not in .gitignore or is not empty\n * @private\n * @param {String} dir Directory that needs to be tested for a given condition.\n */\n async verifyTargetDir(dir) {\n const isGitRepo = await git(dir).checkIsRepo();\n\n if (isGitRepo) {\n //Need to figure out root of the repository to properly verify .gitignore\n const root = await git(dir).revparse(['--show-toplevel']);\n const gitInfo = git(root);\n\n //Skipping verification if workDir inside repo is declared in .gitignore\n const workDir = path.relative(root, dir);\n if (workDir) {\n const checkGitIgnore = await gitInfo.checkIgnore(workDir);\n if (checkGitIgnore.length !== 0) return;\n }\n\n const gitStatus = await gitInfo.status();\n //New files are not tracked and not visible as modified\n const hasUntrackedUnstagedFiles = gitStatus.not_added.length !== 0;\n\n const stagedFiles = gitStatus.staged;\n const modifiedFiles = gitStatus.modified;\n const hasModifiedUstagedFiles = (modifiedFiles.filter(e => stagedFiles.indexOf(e) === -1)).length !== 0;\n\n if (hasModifiedUstagedFiles || hasUntrackedUnstagedFiles) throw new Error(`\"${this.targetDir}\" is in a git repository with unstaged changes. Please commit your changes before proceeding or add proper directory to .gitignore file. You can also use the --force-write flag to skip this rule (not recommended).`);\n } else {\n const isDirEmpty = (await readDir(dir)).length === 0;\n\n if (!isDirEmpty) throw new Error(`\"${this.targetDir}\" is not an empty directory. You might override your work. To skip this rule, please make your code a git repository or use the --force-write flag (not recommended).`);\n }\n }\n}\n\nGenerator.DEFAULT_TEMPLATES_DIR = DEFAULT_TEMPLATES_DIR;\nGenerator.TRANSPILED_TEMPLATE_LOCATION = TRANSPILED_TEMPLATE_LOCATION;\n\nmodule.exports = Generator;\n",null,"const TEMPLATE_INSTALL_FLAG_MSG = 'because you passed --install flag';\n\nconst TEMPLATE_INSTALL_DISK_MSG = 'because the template cannot be found on disk';\n\nconst NODE_MODULES_INSTALL ='Remember that your local template must have its own node_modules installed first, \\\"npm install\\\" is not triggered by the generator.';\n\nconst NPM_INSTALL_TRIGGER = 'Installation of template located on disk technically means symlink creation betweed node_modules of the generator and template sources. Your local template must have its own node_modules, \"npm install\" is not triggered.';\n\nfunction templateVersion(ver) { \n return `Version of used template is ${ver}.`;\n} \n\nfunction templateSource(localHtmlTemplate) {\n return `Template sources taken from ${localHtmlTemplate}.`;\n} \n\nfunction templateNotFound(templateName) {\n return `${templateName} not found in local dependencies but found it installed as a global package.`;\n} \n\nfunction packageNotAvailable(pkgPath) {\n return `Unable to resolve template location at ${pkgPath}. Package is not available locally.`;\n}\n\nfunction installationDebugMessage(debugMessage) {\n return `Template installation started ${debugMessage}.`;\n}\n\nfunction templateSuccessfullyInstalled(packageName, packagePath) {\n return `Template ${packageName} successfully installed in ${packagePath}.`;\n}\n\nfunction relativeSourceFileNotGenerated(relativeSourceFile , subject) {\n return `${relativeSourceFile} was not generated because ${subject} specified in template configuration in conditionalFiles was not found in provided AsyncAPI specification file.`;\n}\n\nfunction conditionalFilesMatched(relativeSourceFile) {\n return `${relativeSourceFile} was not generated because condition specified for this file in template configuration in conditionalFiles matched.`;\n}\n\nmodule.exports = {\n TEMPLATE_INSTALL_FLAG_MSG,\n TEMPLATE_INSTALL_DISK_MSG,\n NODE_MODULES_INSTALL,\n NPM_INSTALL_TRIGGER,\n templateVersion,\n templateSource,\n templateNotFound,\n packageNotAvailable,\n installationDebugMessage,\n templateSuccessfullyInstalled,\n relativeSourceFileNotGenerated,\n conditionalFilesMatched\n\n};","const Nunjucks = require('nunjucks');\nconst nunjucksExport = module.exports;\n\n/**\n * Configures Nunjucks templating system\n * \n * @private\n * @param {boolean} debug flag\n * @param {string} templateDir path\n */\nnunjucksExport.configureNunjucks = (debug, templateDir) => {\n const config = {};\n if (debug) config.dev = true;\n\n return new Nunjucks.Environment(new Nunjucks.FileSystemLoader(templateDir), config);\n};\n\n/**\n * Renders the template with nunjucks and returns a string.\n * \n * @param {import('@asyncapi/parser').AsyncAPIDocument} asyncapiDocument \n * @param {string} templateString template filecontent to be rendered with nunjucks\n * @param {string} filePath path to the template file\n * @param {Object} extraTemplateData Extra data to pass to the template.\n * @param {Object} templateParams provided template parameters\n * @param {string} originalAsyncAPI \n * @param {} nunjucks instance\n * @return {Promise}\n */\nnunjucksExport.renderNunjucks = (asyncapiDocument, templateString, filePath, extraTemplateData, templateParams, originalAsyncAPI, nunjucks) => {\n return new Promise((resolve, reject) => {\n nunjucks.renderString(templateString, {\n asyncapi: asyncapiDocument,\n params: templateParams,\n originalAsyncAPI,\n ...extraTemplateData\n }, { path: filePath }, (err, result) => {\n if (err) return reject(err);\n resolve(result);\n });\n });\n};\n","const path = require('path');\nconst AsyncReactSDK = require('@asyncapi/generator-react-sdk');\nconst {\n writeFile\n} = require('../utils');\n\nconst reactExport = module.exports;\n\n/**\n * Configures React templating system, this handles all the transpilation work.\n * \n * @private\n * @param {string} templateLocation located for thetemplate\n * @param {string} templateContentDir where the template content are located\n * @param {string} transpiledTemplateLocation folder for the transpiled code\n */\nreactExport.configureReact = async (templateLocation, templateContentDir, transpiledTemplateLocation) => {\n const outputDir = path.resolve(templateLocation, `./${transpiledTemplateLocation}`);\n await AsyncReactSDK.transpileFiles(templateContentDir, outputDir, {\n recursive: true\n });\n};\n\n/**\n * Renders the template with react and returns the content and meta data for the file.\n * \n * @private\n * @param {AsyncAPIDocument} asyncapiDocument \n * @param {string} filePath path to the template file\n * @param {Object} extraTemplateData Extra data to pass to the template.\n * @param {string} templateLocation located for thetemplate\n * @param {string} templateContentDir where the template content are located\n * @param {string} transpiledTemplateLocation folder for the transpiled code\n * @param {Object} templateParams provided template parameters\n * @param {boolean} debug flag\n * @param {string} originalAsyncAPI \n * @return {Promise}\n */\nreactExport.renderReact = async (asyncapiDocument, filePath, extraTemplateData, templateLocation, templateContentDir, transpiledTemplateLocation, templateParams, debug, originalAsyncAPI) => {\n extraTemplateData = extraTemplateData || {};\n filePath = filePath.replace(templateContentDir, path.resolve(templateLocation, transpiledTemplateLocation));\n return await AsyncReactSDK.renderTemplate(\n filePath, \n {\n asyncapi: asyncapiDocument,\n params: templateParams,\n originalAsyncAPI,\n ...extraTemplateData\n }, \n debug\n );\n};\n\n/**\n * Save the single rendered react content based on the meta data available.\n * \n * @private\n * @param {TemplateRenderResult} renderedContent the react content rendered\n * @param {String} outputPath Path to the file being rendered.\n */\nconst saveContentToFile = async (renderedContent, outputPath) => {\n let filePath = outputPath;\n // Might be the same as in the `fs` package, but is an active choice for our default file permission for any rendered files. \n let permissions = 0o666;\n const content = renderedContent.content;\n\n if (content === undefined || typeof content !== 'string') {\n throw Error(`Template file not rendered correctly, was rendered as ${content}`);\n }\n if (renderedContent.metadata !== undefined) {\n if (renderedContent.metadata.permissions !== undefined) {\n permissions = renderedContent.metadata.permissions;\n }\n if (renderedContent.metadata.fileName !== undefined) {\n const newFileName = renderedContent.metadata.fileName.trim();\n const basepath = path.basename(filePath);\n filePath = filePath.replace(basepath, newFileName);\n }\n }\n\n await writeFile(filePath, content, {\n mode: permissions\n });\n};\n\n/**\n * Save the rendered react content based on the meta data available.\n * \n * @private\n * @param {TemplateRenderResult[] | TemplateRenderResult} renderedContent the react content rendered\n * @param {String} outputPath Path to the file being rendered.\n */\nreactExport.saveRenderedReactContent = async (renderedContent, outputPath) => {\n if (Array.isArray(renderedContent)) {\n return Promise.all(renderedContent.map(content => saveContentToFile(content, outputPath)));\n }\n return saveContentToFile(renderedContent, outputPath);\n};\n","const semver = require('semver');\nconst Ajv = require('ajv');\nconst { getGeneratorVersion } = require('./utils');\nconst levenshtein = require('levenshtein-edit-distance');\n\nconst ajv = new Ajv({ allErrors: true });\n\n/**\n * Validates the template configuration.\n *\n * @param {Object} templateConfig Template configuration.\n * @param {Object} templateParams Params specified when running generator.\n * @param {AsyncAPIDocument} asyncapiDocument AsyncAPIDocument object to use as source.\n * @return {Boolean}\n */\nmodule.exports.validateTemplateConfig = (templateConfig, templateParams, asyncapiDocument) => {\n const { parameters, supportedProtocols, conditionalFiles, generator } = templateConfig;\n \n validateConditionalFiles(conditionalFiles);\n isTemplateCompatible(generator);\n isRequiredParamProvided(parameters, templateParams);\n isProvidedTemplateRendererSupported(templateConfig);\n if (asyncapiDocument) {\n const server = asyncapiDocument.server(templateParams.server);\n isServerProvidedInDocument(server, templateParams.server);\n isServerProtocolSupported(server, supportedProtocols, templateParams.server);\n }\n\n isProvidedParameterSupported(parameters, templateParams);\n\n return true;\n};\n\n/**\n * Checks if template is compatible with the version of the generator that is used\n * @private\n * @param {String} generator Information about supported generator version that is part of the template configuration\n */\nfunction isTemplateCompatible(generator) {\n const generatorVersion = getGeneratorVersion();\n if (typeof generator === 'string' && !semver.satisfies(generatorVersion, generator, {includePrerelease: true})) {\n throw new Error(`This template is not compatible with the current version of the generator (${generatorVersion}). This template is compatible with the following version range: ${generator}.`);\n } \n}\n\n/**\n * Checks if parameters described in template configuration as required are passed to the generator\n * @private\n * @param {Object} configParams Parameters specified in template configuration\n * @param {Object} templateParams All parameters provided to generator \n */\nfunction isRequiredParamProvided(configParams, templateParams) {\n const missingParams = Object.keys(configParams || {})\n .filter(key => configParams[key].required && !templateParams[key]);\n \n if (missingParams.length) {\n throw new Error(`This template requires the following missing params: ${missingParams}.`);\n }\n}\n\n/**\n * Provides a hint for a user about correct parameter name.\n * @private\n * @param {Object} wrongParam Incorrectly written parameter\n * @param {Object} configParams Parameters specified in template configuration\n */\nfunction getParamSuggestion(wrongParam, configParams) {\n const sortInt = (a, b) => {\n return a[0] - b[0];\n };\n const arr = Object.keys(configParams).map(param => [levenshtein(wrongParam, param), param]);\n\n return arr.sort(sortInt)[0][1];\n}\n\n/**\n * Checks if parameters provided to generator is supported by the template\n * @private\n * @param {Object} configParams Parameters specified in template configuration\n * @param {Object} templateParams All parameters provided to generator \n */\nfunction isProvidedParameterSupported(configParams, templateParams) {\n const wrongParams = Object.keys(templateParams || {}).filter(key => !configParams || !configParams[key]);\n \n if (!wrongParams.length) return;\n if (!configParams) throw new Error('This template doesn\\'t have any params.');\n\n let suggestionsString = '';\n \n wrongParams.forEach(wp => { \n suggestionsString += `\\nDid you mean \"${getParamSuggestion(wp,configParams)}\" instead of \"${wp}\"?`;\n });\n\n throw new Error(`This template doesn't have the following params: ${wrongParams}.${suggestionsString}`);\n}\n \n/**\n * Checks if given AsyncAPI document has servers with protocol that is supported by the template\n * @private\n * @param {Object} server Server object from AsyncAPI file\n * @param {String[]} supportedProtocols Supported protocols specified in template configuration\n * @param {String} paramsServerName Name of the server specified as a param for the generator \n */\nfunction isServerProtocolSupported(server, supportedProtocols, paramsServerName) {\n if (server && Array.isArray(supportedProtocols) && !supportedProtocols.includes(server.protocol())) {\n throw new Error(`Server \"${paramsServerName}\" uses the ${server.protocol()} protocol but this template only supports the following ones: ${supportedProtocols}.`);\n }\n}\n\n/**\n * Checks if the the provided renderer are supported (no renderer are also supported, defaults to nunjucks)\n * \n * @param {Object} templateConfig Template configuration.\n */\nfunction isProvidedTemplateRendererSupported(templateConfig) {\n const supportedRenderers = [undefined, 'react', 'nunjucks'];\n if (supportedRenderers.includes(templateConfig.renderer)) {\n return;\n }\n \n throw new Error(`We do not support '${templateConfig.renderer}' as a renderer for a template. Only 'react' or 'nunjucks' are supported.`);\n}\n\n/**\n * Checks if given AsyncAPI document has servers with protocol that is supported by the template\n * @private\n * @param {Object} server Server object from AsyncAPI file\n * @param {String} paramsServerName Name of the server specified as a param for the generator\n */\nfunction isServerProvidedInDocument(server, paramsServerName) {\n if (typeof paramsServerName === 'string' && !server) throw new Error(`Couldn't find server with name ${paramsServerName}.`);\n}\n\n/**\n * Checks if conditional files are specified properly in the template\n * @private\n * @param {Object} conditionalFiles conditions specified in the template config\n */\nfunction validateConditionalFiles(conditionalFiles) {\n if (typeof conditionalFiles === 'object') {\n const fileNames = Object.keys(conditionalFiles);\n \n fileNames.forEach(fileName => {\n const def = conditionalFiles[fileName];\n if (typeof def.subject !== 'string') throw new Error(`Invalid conditional file subject for ${fileName}: ${def.subject}.`);\n if (typeof def.validation !== 'object') throw new Error(`Invalid conditional file validation object for ${fileName}: ${def.validation}.`);\n conditionalFiles[fileName].validate = ajv.compile(conditionalFiles[fileName].validation);\n });\n }\n}",null,"const ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n const sameDirectionIncreasing =\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '>=' || comp.operator === '>')\n const sameDirectionDecreasing =\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '<=' || comp.operator === '<')\n const sameSemVer = this.semver.version === comp.semver.version\n const differentDirectionsInclusive =\n (this.operator === '>=' || this.operator === '<=') &&\n (comp.operator === '>=' || comp.operator === '<=')\n const oppositeDirectionsLessThan =\n cmp(this.semver, '<', comp.semver, options) &&\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '<=' || comp.operator === '<')\n const oppositeDirectionsGreaterThan =\n cmp(this.semver, '>', comp.semver, options) &&\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '>=' || comp.operator === '>')\n\n return (\n sameDirectionIncreasing ||\n sameDirectionDecreasing ||\n (sameSemVer && differentDirectionsInclusive) ||\n oppositeDirectionsLessThan ||\n oppositeDirectionsGreaterThan\n )\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst {re, t} = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.format()\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First, split based on boolean or ||\n this.raw = range\n this.set = range\n .split(/\\s*\\|\\|\\s*/)\n // map the range to a 2d array of comparators\n .map(range => this.parseRange(range.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${range}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0)\n this.set = [first]\n else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.format()\n }\n\n format () {\n this.range = this.set\n .map((comps) => {\n return comps.join(' ').trim()\n })\n .join('||')\n .trim()\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n range = range.trim()\n\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts = Object.keys(this.options).join(',')\n const memoKey = `parseRange:${memoOpts}:${range}`\n const cached = cache.get(memoKey)\n if (cached)\n return cached\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range, re[t.COMPARATORTRIM])\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n\n // normalize spaces\n range = range.split(/\\s+/).join(' ')\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n // in loose mode, throw out any that are not valid comparators\n .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true)\n .map(comp => new Comparator(comp, this.options))\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const l = rangeList.length\n const rangeMap = new Map()\n for (const comp of rangeList) {\n if (isNullSet(comp))\n return [comp]\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has(''))\n rangeMap.delete('')\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\nmodule.exports = Range\n\nconst LRU = require('lru-cache')\nconst cache = new LRU({ max: 1000 })\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace\n} = require('../internal/re')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\nconst replaceTildes = (comp, options) =>\n comp.trim().split(/\\s+/).map((comp) => {\n return replaceTilde(comp, options)\n }).join(' ')\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\nconst replaceCarets = (comp, options) =>\n comp.trim().split(/\\s+/).map((comp) => {\n return replaceCaret(comp, options)\n }).join(' ')\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp.split(/\\s+/).map((comp) => {\n return replaceXRange(comp, options)\n }).join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<')\n pr = '-0'\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp.trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return (`${from} ${to}`).trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }\n}\n\nmodule.exports = SemVer\n","const parse = require('./parse')\nconst clean = (version, options) => {\n const s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\nmodule.exports = clean\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst {re, t} = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n let next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null)\n return null\n\n return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)\n}\nmodule.exports = coerce\n","const SemVer = require('../classes/semver')\nconst compareBuild = (a, b, loose) => {\n const versionA = new SemVer(a, loose)\n const versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\nmodule.exports = compareBuild\n","const compare = require('./compare')\nconst compareLoose = (a, b) => compare(a, b, true)\nmodule.exports = compareLoose\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const parse = require('./parse')\nconst eq = require('./eq')\n\nconst diff = (version1, version2) => {\n if (eq(version1, version2)) {\n return null\n } else {\n const v1 = parse(version1)\n const v2 = parse(version2)\n const hasPre = v1.prerelease.length || v2.prerelease.length\n const prefix = hasPre ? 'pre' : ''\n const defaultResult = hasPre ? 'prerelease' : ''\n for (const key in v1) {\n if (key === 'major' || key === 'minor' || key === 'patch') {\n if (v1[key] !== v2[key]) {\n return prefix + key\n }\n }\n }\n return defaultResult // may be undefined\n }\n}\nmodule.exports = diff\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const SemVer = require('../classes/semver')\n\nconst inc = (version, release, options, identifier) => {\n if (typeof (options) === 'string') {\n identifier = options\n options = undefined\n }\n\n try {\n return new SemVer(version, options).inc(release, identifier).version\n } catch (er) {\n return null\n }\n}\nmodule.exports = inc\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const SemVer = require('../classes/semver')\nconst major = (a, loose) => new SemVer(a, loose).major\nmodule.exports = major\n","const SemVer = require('../classes/semver')\nconst minor = (a, loose) => new SemVer(a, loose).minor\nmodule.exports = minor\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const {MAX_LENGTH} = require('../internal/constants')\nconst { re, t } = require('../internal/re')\nconst SemVer = require('../classes/semver')\n\nconst parseOptions = require('../internal/parse-options')\nconst parse = (version, options) => {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n const r = options.loose ? re[t.LOOSE] : re[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nmodule.exports = parse\n","const SemVer = require('../classes/semver')\nconst patch = (a, loose) => new SemVer(a, loose).patch\nmodule.exports = patch\n","const parse = require('./parse')\nconst prerelease = (version, options) => {\n const parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\nmodule.exports = prerelease\n","const compare = require('./compare')\nconst rcompare = (a, b, loose) => compare(b, a, loose)\nmodule.exports = rcompare\n","const compareBuild = require('./compare-build')\nconst rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))\nmodule.exports = rsort\n","const Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","const compareBuild = require('./compare-build')\nconst sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))\nmodule.exports = sort\n","const parse = require('./parse')\nconst valid = (version, options) => {\n const v = parse(version, options)\n return v ? v.version : null\n}\nmodule.exports = valid\n","// just pre-load all the stuff that index.js lazily exports\nconst internalRe = require('./internal/re')\nmodule.exports = {\n re: internalRe.re,\n src: internalRe.src,\n tokens: internalRe.t,\n SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION,\n SemVer: require('./classes/semver'),\n compareIdentifiers: require('./internal/identifiers').compareIdentifiers,\n rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers,\n parse: require('./functions/parse'),\n valid: require('./functions/valid'),\n clean: require('./functions/clean'),\n inc: require('./functions/inc'),\n diff: require('./functions/diff'),\n major: require('./functions/major'),\n minor: require('./functions/minor'),\n patch: require('./functions/patch'),\n prerelease: require('./functions/prerelease'),\n compare: require('./functions/compare'),\n rcompare: require('./functions/rcompare'),\n compareLoose: require('./functions/compare-loose'),\n compareBuild: require('./functions/compare-build'),\n sort: require('./functions/sort'),\n rsort: require('./functions/rsort'),\n gt: require('./functions/gt'),\n lt: require('./functions/lt'),\n eq: require('./functions/eq'),\n neq: require('./functions/neq'),\n gte: require('./functions/gte'),\n lte: require('./functions/lte'),\n cmp: require('./functions/cmp'),\n coerce: require('./functions/coerce'),\n Comparator: require('./classes/comparator'),\n Range: require('./classes/range'),\n satisfies: require('./functions/satisfies'),\n toComparators: require('./ranges/to-comparators'),\n maxSatisfying: require('./ranges/max-satisfying'),\n minSatisfying: require('./ranges/min-satisfying'),\n minVersion: require('./ranges/min-version'),\n validRange: require('./ranges/valid'),\n outside: require('./ranges/outside'),\n gtr: require('./ranges/gtr'),\n ltr: require('./ranges/ltr'),\n intersects: require('./ranges/intersects'),\n simplifyRange: require('./ranges/simplify'),\n subset: require('./ranges/subset'),\n}\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\nmodule.exports = {\n SEMVER_SPEC_VERSION,\n MAX_LENGTH,\n MAX_SAFE_INTEGER,\n MAX_SAFE_COMPONENT_LENGTH\n}\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers\n}\n","// parse out just the options we care about so we always get a consistent\n// obj with keys in a consistent order.\nconst opts = ['includePrerelease', 'loose', 'rtl']\nconst parseOptions = options =>\n !options ? {}\n : typeof options !== 'object' ? { loose: true }\n : opts.filter(k => options[k]).reduce((options, k) => {\n options[k] = true\n return options\n }, {})\nmodule.exports = parseOptions\n","const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst createToken = (name, value, isGlobal) => {\n const index = R++\n debug(index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '[0-9]+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*')\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCE', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\.0\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\.0\\.0-0\\\\s*$')\n","// Determine if version is greater than all the versions possible in the range.\nconst outside = require('./outside')\nconst gtr = (version, range, options) => outside(version, range, '>', options)\nmodule.exports = gtr\n","const Range = require('../classes/range')\nconst intersects = (r1, r2, options) => {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2)\n}\nmodule.exports = intersects\n","const outside = require('./outside')\n// Determine if version is less than all the versions possible in the range\nconst ltr = (version, range, options) => outside(version, range, '<', options)\nmodule.exports = ltr\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\n\nconst maxSatisfying = (versions, range, options) => {\n let max = null\n let maxSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\nmodule.exports = maxSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst minSatisfying = (versions, range, options) => {\n let min = null\n let minSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\nmodule.exports = minSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst gt = require('../functions/gt')\n\nconst minVersion = (range, loose) => {\n range = new Range(range, loose)\n\n let minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let setMin = null\n comparators.forEach((comparator) => {\n // Clone to avoid manipulating the comparator's semver object.\n const compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!setMin || gt(compver, setMin)) {\n setMin = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error(`Unexpected operation: ${comparator.operator}`)\n }\n })\n if (setMin && (!minver || gt(minver, setMin)))\n minver = setMin\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\nmodule.exports = minVersion\n","const SemVer = require('../classes/semver')\nconst Comparator = require('../classes/comparator')\nconst {ANY} = Comparator\nconst Range = require('../classes/range')\nconst satisfies = require('../functions/satisfies')\nconst gt = require('../functions/gt')\nconst lt = require('../functions/lt')\nconst lte = require('../functions/lte')\nconst gte = require('../functions/gte')\n\nconst outside = (version, range, hilo, options) => {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n let gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisfies the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let high = null\n let low = null\n\n comparators.forEach((comparator) => {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nmodule.exports = outside\n","// given a set of versions and a range, create a \"simplified\" range\n// that includes the same versions that the original range does\n// If the original range is shorter than the simplified one, return that.\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\nmodule.exports = (versions, range, options) => {\n const set = []\n let min = null\n let prev = null\n const v = versions.sort((a, b) => compare(a, b, options))\n for (const version of v) {\n const included = satisfies(version, range, options)\n if (included) {\n prev = version\n if (!min)\n min = version\n } else {\n if (prev) {\n set.push([min, prev])\n }\n prev = null\n min = null\n }\n }\n if (min)\n set.push([min, null])\n\n const ranges = []\n for (const [min, max] of set) {\n if (min === max)\n ranges.push(min)\n else if (!max && min === v[0])\n ranges.push('*')\n else if (!max)\n ranges.push(`>=${min}`)\n else if (min === v[0])\n ranges.push(`<=${max}`)\n else\n ranges.push(`${min} - ${max}`)\n }\n const simplified = ranges.join(' || ')\n const original = typeof range.raw === 'string' ? range.raw : String(range)\n return simplified.length < original.length ? simplified : range\n}\n","const Range = require('../classes/range.js')\nconst Comparator = require('../classes/comparator.js')\nconst { ANY } = Comparator\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\n\n// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:\n// - Every simple range `r1, r2, ...` is a null set, OR\n// - Every simple range `r1, r2, ...` which is not a null set is a subset of\n// some `R1, R2, ...`\n//\n// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:\n// - If c is only the ANY comparator\n// - If C is only the ANY comparator, return true\n// - Else if in prerelease mode, return false\n// - else replace c with `[>=0.0.0]`\n// - If C is only the ANY comparator\n// - if in prerelease mode, return true\n// - else replace C with `[>=0.0.0]`\n// - Let EQ be the set of = comparators in c\n// - If EQ is more than one, return true (null set)\n// - Let GT be the highest > or >= comparator in c\n// - Let LT be the lowest < or <= comparator in c\n// - If GT and LT, and GT.semver > LT.semver, return true (null set)\n// - If any C is a = range, and GT or LT are set, return false\n// - If EQ\n// - If GT, and EQ does not satisfy GT, return true (null set)\n// - If LT, and EQ does not satisfy LT, return true (null set)\n// - If EQ satisfies every C, return true\n// - Else return false\n// - If GT\n// - If GT.semver is lower than any > or >= comp in C, return false\n// - If GT is >=, and GT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the GT.semver tuple, return false\n// - If LT\n// - If LT.semver is greater than any < or <= comp in C, return false\n// - If LT is <=, and LT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the LT.semver tuple, return false\n// - Else return true\n\nconst subset = (sub, dom, options = {}) => {\n if (sub === dom)\n return true\n\n sub = new Range(sub, options)\n dom = new Range(dom, options)\n let sawNonNull = false\n\n OUTER: for (const simpleSub of sub.set) {\n for (const simpleDom of dom.set) {\n const isSub = simpleSubset(simpleSub, simpleDom, options)\n sawNonNull = sawNonNull || isSub !== null\n if (isSub)\n continue OUTER\n }\n // the null set is a subset of everything, but null simple ranges in\n // a complex range should be ignored. so if we saw a non-null range,\n // then we know this isn't a subset, but if EVERY simple range was null,\n // then it is a subset.\n if (sawNonNull)\n return false\n }\n return true\n}\n\nconst simpleSubset = (sub, dom, options) => {\n if (sub === dom)\n return true\n\n if (sub.length === 1 && sub[0].semver === ANY) {\n if (dom.length === 1 && dom[0].semver === ANY)\n return true\n else if (options.includePrerelease)\n sub = [ new Comparator('>=0.0.0-0') ]\n else\n sub = [ new Comparator('>=0.0.0') ]\n }\n\n if (dom.length === 1 && dom[0].semver === ANY) {\n if (options.includePrerelease)\n return true\n else\n dom = [ new Comparator('>=0.0.0') ]\n }\n\n const eqSet = new Set()\n let gt, lt\n for (const c of sub) {\n if (c.operator === '>' || c.operator === '>=')\n gt = higherGT(gt, c, options)\n else if (c.operator === '<' || c.operator === '<=')\n lt = lowerLT(lt, c, options)\n else\n eqSet.add(c.semver)\n }\n\n if (eqSet.size > 1)\n return null\n\n let gtltComp\n if (gt && lt) {\n gtltComp = compare(gt.semver, lt.semver, options)\n if (gtltComp > 0)\n return null\n else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<='))\n return null\n }\n\n // will iterate one or zero times\n for (const eq of eqSet) {\n if (gt && !satisfies(eq, String(gt), options))\n return null\n\n if (lt && !satisfies(eq, String(lt), options))\n return null\n\n for (const c of dom) {\n if (!satisfies(eq, String(c), options))\n return false\n }\n\n return true\n }\n\n let higher, lower\n let hasDomLT, hasDomGT\n // if the subset has a prerelease, we need a comparator in the superset\n // with the same tuple and a prerelease, or it's not a subset\n let needDomLTPre = lt &&\n !options.includePrerelease &&\n lt.semver.prerelease.length ? lt.semver : false\n let needDomGTPre = gt &&\n !options.includePrerelease &&\n gt.semver.prerelease.length ? gt.semver : false\n // exception: <1.2.3-0 is the same as <1.2.3\n if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&\n lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {\n needDomLTPre = false\n }\n\n for (const c of dom) {\n hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='\n hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='\n if (gt) {\n if (needDomGTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomGTPre.major &&\n c.semver.minor === needDomGTPre.minor &&\n c.semver.patch === needDomGTPre.patch) {\n needDomGTPre = false\n }\n }\n if (c.operator === '>' || c.operator === '>=') {\n higher = higherGT(gt, c, options)\n if (higher === c && higher !== gt)\n return false\n } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options))\n return false\n }\n if (lt) {\n if (needDomLTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomLTPre.major &&\n c.semver.minor === needDomLTPre.minor &&\n c.semver.patch === needDomLTPre.patch) {\n needDomLTPre = false\n }\n }\n if (c.operator === '<' || c.operator === '<=') {\n lower = lowerLT(lt, c, options)\n if (lower === c && lower !== lt)\n return false\n } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options))\n return false\n }\n if (!c.operator && (lt || gt) && gtltComp !== 0)\n return false\n }\n\n // if there was a < or >, and nothing in the dom, then must be false\n // UNLESS it was limited by another range in the other direction.\n // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0\n if (gt && hasDomLT && !lt && gtltComp !== 0)\n return false\n\n if (lt && hasDomGT && !gt && gtltComp !== 0)\n return false\n\n // we needed a prerelease range in a specific tuple, but didn't get one\n // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,\n // because it includes prereleases in the 1.2.3 tuple\n if (needDomGTPre || needDomLTPre)\n return false\n\n return true\n}\n\n// >=1.2.3 is lower than >1.2.3\nconst higherGT = (a, b, options) => {\n if (!a)\n return b\n const comp = compare(a.semver, b.semver, options)\n return comp > 0 ? a\n : comp < 0 ? b\n : b.operator === '>' && a.operator === '>=' ? b\n : a\n}\n\n// <=1.2.3 is higher than <1.2.3\nconst lowerLT = (a, b, options) => {\n if (!a)\n return b\n const comp = compare(a.semver, b.semver, options)\n return comp < 0 ? a\n : comp > 0 ? b\n : b.operator === '<' && a.operator === '<=' ? b\n : a\n}\n\nmodule.exports = subset\n","const Range = require('../classes/range')\n\n// Mostly just for testing and legacy API reasons\nconst toComparators = (range, options) =>\n new Range(range, options).set\n .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))\n\nmodule.exports = toComparators\n","const Range = require('../classes/range')\nconst validRange = (range, options) => {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\nmodule.exports = validRange\n","const toJsonSchema = require('@openapi-contrib/openapi-schema-to-json-schema');\n\nmodule.exports = {\n parse,\n getMimeTypes\n};\n\nasync function parse({ message, defaultSchemaFormat }) {\n const transformed = toJsonSchema(message.payload, {\n cloneSchema: true,\n keepNotSupported: [\n 'discriminator',\n 'readOnly',\n 'writeOnly',\n 'deprecated',\n 'xml',\n 'example',\n ],\n });\n\n iterateSchema(transformed);\n\n message['x-parser-original-schema-format'] = message.schemaFormat || defaultSchemaFormat;\n message['x-parser-original-payload'] = message.payload;\n message.payload = transformed;\n delete message.schemaFormat;\n}\n\nfunction iterateSchema(schema) {\n if (schema.example !== undefined) {\n const examples = schema.examples || [];\n examples.push(schema.example);\n schema.examples = examples;\n delete schema.example;\n }\n\n if (schema.$schema !== undefined) {\n delete schema.$schema;\n }\n\n aliasProps(schema.properties);\n aliasProps(schema.patternProperties);\n aliasProps(schema.additionalProperties);\n aliasProps(schema.items);\n aliasProps(schema.additionalItems);\n aliasProps(schema.oneOf);\n aliasProps(schema.anyOf);\n aliasProps(schema.allOf);\n aliasProps(schema.not);\n}\n\nfunction aliasProps(obj) {\n for (const key in obj) {\n const prop = obj[key];\n\n if (prop.xml !== undefined) {\n prop['x-xml'] = prop.xml;\n delete prop.xml;\n }\n\n iterateSchema(obj[key]);\n }\n}\n\nfunction getMimeTypes() {\n return [\n 'application/vnd.oai.openapi;version=3.0.0',\n 'application/vnd.oai.openapi+json;version=3.0.0',\n 'application/vnd.oai.openapi+yaml;version=3.0.0',\n ];\n}\n","const {xParserMessageName, xParserSchemaId} = require('./constants');\nconst {traverseAsyncApiDocument} = require('./iterators');\n\n/**\n * Assign message keys as message name to all the component messages.\n * \n * @private\n * @param {AsyncAPIDocument} doc \n */\nfunction assignNameToComponentMessages(doc) {\n if (doc.hasComponents()) {\n for (const [key, m] of Object.entries(doc.components().messages())) {\n if (m.name() === undefined) {\n m.json()[String(xParserMessageName)] = key;\n }\n }\n }\n}\n\n/**\n * Assign ids based on parameter keys.\n * \n * @private\n * @param {Record} parameterObject \n */\nfunction assignIdToParameters(parameterObject) {\n for (const [parameterKey, parameter] of Object.entries(parameterObject)) {\n if (parameter.schema()) {\n parameter.schema().json()[String(xParserSchemaId)] = parameterKey;\n }\n }\n}\n\n/**\n * Assign parameter keys as uid for the parameter schema.\n * \n * @private\n * @param {AsyncAPIDocument} doc \n */\nfunction assignUidToParameterSchemas(doc) {\n doc.channelNames().forEach(channelName => {\n const channel = doc.channel(channelName);\n assignIdToParameters(channel.parameters());\n });\n}\n \n/**\n * Assign uid to component schemas. \n * \n * @private\n * @param {AsyncAPIDocument} doc \n */\nfunction assignUidToComponentSchemas(doc) {\n if (doc.hasComponents()) {\n for (const [key, s] of Object.entries(doc.components().schemas())) {\n s.json()[String(xParserSchemaId)] = key;\n }\n }\n}\n\n/**\n * Assign uid to component parameters schemas\n * \n * @private\n * @param {AsyncAPIDocument} doc \n */\nfunction assignUidToComponentParameterSchemas(doc) {\n if (doc.hasComponents()) {\n assignIdToParameters(doc.components().parameters());\n }\n}\n \n/**\n * Assign anonymous names to nameless messages.\n * \n * @private\n * @param {AsyncAPIDocument} doc \n */\nfunction assignNameToAnonymousMessages(doc) {\n let anonymousMessageCounter = 0;\n \n if (doc.hasChannels()) {\n doc.channelNames().forEach(channelName => {\n const channel = doc.channel(channelName);\n if (channel.hasPublish()) addNameToKey(channel.publish().messages(), ++anonymousMessageCounter);\n if (channel.hasSubscribe()) addNameToKey(channel.subscribe().messages(), ++anonymousMessageCounter);\n });\n }\n}\n \n/**\n * Add anonymous name to key if no name provided.\n * \n * @private\n * @param {Message} map of messages \n */\nfunction addNameToKey(messages, number) {\n messages.forEach(m => {\n if (m.name() === undefined && m.ext(xParserMessageName) === undefined) {\n m.json()[String(xParserMessageName)] = ``;\n }\n });\n}\n \n/**\n * Gives schemas id to all anonymous schemas.\n * \n * @private\n * @param {AsyncAPIDocument} doc \n */\nfunction assignIdToAnonymousSchemas(doc) {\n let anonymousSchemaCounter = 0;\n const callback = (schema) => {\n if (!schema.uid()) {\n schema.json()[String(xParserSchemaId)] = ``;\n }\n };\n traverseAsyncApiDocument(doc, callback);\n}\n\nmodule.exports = {\n assignNameToComponentMessages,\n assignUidToParameterSchemas,\n assignUidToComponentSchemas,\n assignUidToComponentParameterSchemas,\n assignNameToAnonymousMessages,\n assignIdToAnonymousSchemas\n};\n","const Ajv = require('ajv');\nconst ParserError = require('./errors/parser-error');\nconst asyncapi = require('@asyncapi/specs');\nconst { improveAjvErrors } = require('./utils');\nconst cloneDeep = require('lodash.clonedeep');\n\nmodule.exports = {\n parse,\n getMimeTypes\n};\n\n/**\n * @private\n */\nasync function parse({ message, originalAsyncAPIDocument, fileFormat, parsedAsyncAPIDocument, pathToPayload, defaultSchemaFormat }) {\n const payload = message.payload;\n if (!payload) return;\n\n message['x-parser-original-schema-format'] = message.schemaFormat || defaultSchemaFormat;\n message['x-parser-original-payload'] = cloneDeep(message.payload);\n\n const ajv = new Ajv({\n jsonPointers: true,\n allErrors: true,\n schemaId: 'id',\n logger: false,\n });\n const payloadSchema = preparePayloadSchema(asyncapi[parsedAsyncAPIDocument.asyncapi]);\n const validate = ajv.compile(payloadSchema);\n const valid = validate(payload);\n\n if (!valid) throw new ParserError({\n type: 'schema-validation-errors',\n title: 'This is not a valid AsyncAPI Schema Object.',\n parsedJSON: parsedAsyncAPIDocument,\n validationErrors: improveAjvErrors(addFullPathToDataPath(validate.errors, pathToPayload), originalAsyncAPIDocument, fileFormat),\n });\n}\n\n/**\n * @private\n */\nfunction getMimeTypes() {\n return [\n 'application/vnd.aai.asyncapi;version=2.0.0',\n 'application/vnd.aai.asyncapi+json;version=2.0.0',\n 'application/vnd.aai.asyncapi+yaml;version=2.0.0',\n 'application/schema;version=draft-07',\n 'application/schema+json;version=draft-07',\n 'application/schema+yaml;version=draft-07',\n ];\n}\n\n/**\n * To validate schema of the payload we just need a small portion of official AsyncAPI spec JSON Schema, the definition of the schema must be\n * a main part of the JSON Schema\n * \n * @private\n * @param {Object} asyncapiSchema AsyncAPI specification JSON Schema\n * @returns {Object} valid JSON Schema document describing format of AsyncAPI-valid schema for message payload\n */\nfunction preparePayloadSchema(asyncapiSchema) {\n return {\n $ref: '#/definitions/schema',\n definitions: asyncapiSchema.definitions\n };\n}\n\n/**\n * Errors from Ajv contain dataPath information about parameter relative to parsed payload message. \n * This function enriches dataPath with additional information on where is the parameter located in AsyncAPI document\n * \n * @private\n * @param {Array} errors Ajv errors\n * @param {String} path Path to location of the payload schema in AsyncAPI Document\n * @returns {Array} same object as received in input but with modified datePath property so it contain full path relative to AsyncAPI document\n */\nfunction addFullPathToDataPath(errors, path) {\n return errors.map((err) => ({\n ...err,\n ...{\n dataPath: `${path}${err.dataPath}`\n }\n }));\n}\n\n","const xParserSpecParsed = 'x-parser-spec-parsed';\nconst xParserMessageName = 'x-parser-message-name';\nconst xParserSchemaId = 'x-parser-schema-id';\nconst xParserCircle = 'x-parser-circular';\nconst xParserCircleProps = 'x-parser-circular-props';\n\nmodule.exports = {\n xParserSpecParsed,\n xParserMessageName,\n xParserSchemaId,\n xParserCircle,\n xParserCircleProps\n};","const ParserError = require('./errors/parser-error');\nconst {\n parseUrlVariables,\n getMissingProps,\n groupValidationErrors,\n tilde,\n parseUrlQueryParameters,\n setNotProvidedParams\n} = require('./utils');\nconst validationError = 'validation-errors';\n\n/**\n * Validates if variables provided in the url have corresponding variable object defined and if example is correct\n * @private\n * @param {Object} parsedJSON parsed AsyncAPI document\n * @param {String} asyncapiYAMLorJSON AsyncAPI document in string\n * @param {String} initialFormat information of the document was oryginally JSON or YAML\n * @returns {Boolean} true in case the document is valid, otherwise throws ParserError\n */\nfunction validateServerVariables(\n parsedJSON,\n asyncapiYAMLorJSON,\n initialFormat\n) {\n const srvs = parsedJSON.servers;\n if (!srvs) return true;\n\n const srvsMap = new Map(Object.entries(srvs));\n const notProvidedVariables = new Map();\n const notProvidedExamplesInEnum = new Map();\n\n srvsMap.forEach((srvr, srvrName) => {\n const variables = parseUrlVariables(srvr.url);\n const variablesObj = srvr.variables;\n const notProvidedServerVars = notProvidedVariables.get(tilde(srvrName));\n if (!variables) return;\n\n const missingServerVariables = getMissingProps(variables, variablesObj);\n if (missingServerVariables.length) {\n notProvidedVariables.set(\n tilde(srvrName),\n notProvidedServerVars\n ? notProvidedServerVars.concat(missingServerVariables)\n : missingServerVariables\n );\n }\n\n if (variablesObj) {\n setNotValidExamples(variablesObj, srvrName, notProvidedExamplesInEnum);\n }\n });\n\n if (notProvidedVariables.size) {\n throw new ParserError({\n type: validationError,\n title: 'Not all server variables are described with variable object',\n parsedJSON,\n validationErrors: groupValidationErrors(\n 'servers',\n 'server does not have a corresponding variable object for',\n notProvidedVariables,\n asyncapiYAMLorJSON,\n initialFormat\n ),\n });\n }\n\n if (notProvidedExamplesInEnum.size) {\n throw new ParserError({\n type: validationError,\n title:\n 'Check your server variables. The example does not match the enum list',\n parsedJSON,\n validationErrors: groupValidationErrors(\n 'servers',\n 'server variable provides an example that does not match the enum list',\n notProvidedExamplesInEnum,\n asyncapiYAMLorJSON,\n initialFormat\n ),\n });\n }\n\n return true;\n}\n\n/**\n * extend map with info about examples that are not part of the enum\n *\n * @function setNotValidExamples\n * @private\n * @param {Array} variables server variables object\n * @param {String} srvrName name of the server where variables object is located \n * @param {Map} notProvidedExamplesInEnum result map of all wrong examples and what variable they belong to\n */\nfunction setNotValidExamples(variables, srvrName, notProvidedExamplesInEnum) {\n const variablesMap = new Map(Object.entries(variables));\n variablesMap.forEach((variable, variableName) => {\n if (variable.enum && variable.examples) {\n const wrongExamples = variable.examples.filter(r => !variable.enum.includes(r));\n if (wrongExamples.length) {\n notProvidedExamplesInEnum.set(\n `${tilde(srvrName)}/variables/${tilde(variableName)}`,\n wrongExamples\n );\n }\n }\n });\n};\n\n/**\n * Validates if operationIds are duplicated in the document\n *\n * @private\n * @param {Object} parsedJSON parsed AsyncAPI document\n * @param {String} asyncapiYAMLorJSON AsyncAPI document in string\n * @param {String} initialFormat information of the document was oryginally JSON or YAML\n * @returns {Boolean} true in case the document is valid, otherwise throws ParserError\n */\nfunction validateOperationId(\n parsedJSON,\n asyncapiYAMLorJSON,\n initialFormat,\n operations\n) {\n const chnls = parsedJSON.channels;\n if (!chnls) return true;\n const chnlsMap = new Map(Object.entries(chnls));\n //it is a map of paths, the one that is a duplicate and the one that is duplicated\n const duplicatedOperations = new Map();\n //is is a 2-dimentional array that holds information with operationId value and its path\n const allOperations = [];\n\n const addDuplicateToMap = (op, channelName, opName) => {\n const operationId = op.operationId;\n if (!operationId) return;\n\n const operationPath = `${tilde(channelName)}/${opName}/operationId`;\n const isOperationIdDuplicated = allOperations.filter(\n (v) => v[0] === operationId\n );\n if (!isOperationIdDuplicated.length)\n return allOperations.push([operationId, operationPath]);\n\n //isOperationIdDuplicated always holds one record and it is an array of paths, the one that is a duplicate and the one that is duplicated\n duplicatedOperations.set(operationPath, isOperationIdDuplicated[0][1]);\n };\n\n chnlsMap.forEach((chnlObj, chnlName) => {\n operations.forEach((opName) => {\n const op = chnlObj[String(opName)];\n if (op) addDuplicateToMap(op, chnlName, opName);\n });\n });\n\n if (duplicatedOperations.size) {\n throw new ParserError({\n type: validationError,\n title: 'operationId must be unique across all the operations.',\n parsedJSON,\n validationErrors: groupValidationErrors(\n 'channels',\n 'is a duplicate of',\n duplicatedOperations,\n asyncapiYAMLorJSON,\n initialFormat\n ),\n });\n }\n\n return true;\n}\n\n/**\n * Validates if server security is declared properly and the name has a corresponding security schema definition in components with the same name\n *\n * @private\n * @param {Object} parsedJSON parsed AsyncAPI document\n * @param {String} asyncapiYAMLorJSON AsyncAPI document in string\n * @param {String} initialFormat information of the document was oryginally JSON or YAML\n * @param {String[]} specialSecTypes list of security types that can have data in array\n * @returns {Boolean} true in case the document is valid, otherwise throws ParserError\n */\nfunction validateServerSecurity(\n parsedJSON,\n asyncapiYAMLorJSON,\n initialFormat,\n specialSecTypes\n) {\n const srvs = parsedJSON.servers;\n if (!srvs) return true;\n\n const root = 'servers';\n const srvsMap = new Map(Object.entries(srvs));\n\n const missingSecSchema = new Map(),\n invalidSecurityValues = new Map();\n\n //we need to validate every server specified in the document\n srvsMap.forEach((server, serverName) => {\n const serverSecInfo = server.security;\n\n if (!serverSecInfo) return true;\n\n //server security info is an array of many possible values\n serverSecInfo.forEach((secObj) => {\n Object.keys(secObj).forEach((secName) => {\n //security schema is located in components object, we need to find if there is security schema with the same name as the server security info object\n const schema = findSecuritySchema(secName, parsedJSON.components);\n const srvrSecurityPath = `${serverName}/security/${secName}`;\n\n if (!schema.length) return missingSecSchema.set(srvrSecurityPath);\n\n //findSecuritySchema returns type always on index 1. Type is needed further to validate if server security info can be or not an empty array\n const schemaType = schema[1];\n if (!isSrvrSecProperArray(schemaType, specialSecTypes, secObj, secName))\n invalidSecurityValues.set(srvrSecurityPath, schemaType);\n });\n });\n });\n\n if (missingSecSchema.size) {\n throw new ParserError({\n type: validationError,\n title:\n 'Server security name must correspond to a security scheme which is declared in the security schemes under the components object.',\n parsedJSON,\n validationErrors: groupValidationErrors(\n root,\n 'doesn\\'t have a corresponding security schema under the components object',\n missingSecSchema,\n asyncapiYAMLorJSON,\n initialFormat\n ),\n });\n }\n\n if (invalidSecurityValues.size) {\n throw new ParserError({\n type: validationError,\n title:\n 'Server security value must be an empty array if corresponding security schema type is not oauth2 or openIdConnect.',\n parsedJSON,\n validationErrors: groupValidationErrors(\n root,\n 'security info must have an empty array because its corresponding security schema type is',\n invalidSecurityValues,\n asyncapiYAMLorJSON,\n initialFormat\n ),\n });\n }\n\n return true;\n}\n\n/**\n * Searches for server security corresponding object in security schema object\n * @private\n * @param {String} securityName name of the server security element that you want to localize in the security schema object\n * @param {Object} components components object from the AsyncAPI document\n * @returns {String[]} there are 2 elements in array, index 0 is the name of the security schema object and index 1 is it's type\n */\nfunction findSecuritySchema(securityName, components) {\n const secSchemes = components && components.securitySchemes;\n const secSchemesMap = secSchemes\n ? new Map(Object.entries(secSchemes))\n : new Map();\n const schemaInfo = [];\n\n //using for loop here as there is no point to iterate over all entries as it is enough to find first matching element\n for (const [schemaName, schema] of secSchemesMap.entries()) {\n if (schemaName === securityName) {\n schemaInfo.push(schemaName, schema.type);\n return schemaInfo;\n }\n }\n return schemaInfo;\n}\n\n/**\n * Validates if given server security is a proper empty array when security type requires it\n * @private\n * @param {String} schemaType security type, like httpApiKey or userPassword\n * @param {String[]} specialSecTypes list of special types that do not have to be an empty array\n * @param {Object} secObj server security object\n * @param {String} secName name os server security object\n * @returns {String[]} there are 2 elements in array, index 0 is the name of the security schema object and index 1 is it's type\n */\nfunction isSrvrSecProperArray(schemaType, specialSecTypes, secObj, secName) {\n if (!specialSecTypes.includes(schemaType)) {\n const securityObjValue = secObj[String(secName)];\n\n return !securityObjValue.length;\n }\n\n return true;\n}\n\n/**\n * Validates if parameters specified in the channel have corresponding parameters object defined and if name does not contain url parameters\n *\n * @private\n * @param {Object} parsedJSON parsed AsyncAPI document\n * @param {String} asyncapiYAMLorJSON AsyncAPI document in string\n * @param {String} initialFormat information of the document was oryginally JSON or YAML\n * @returns {Boolean} true in case the document is valid, otherwise throws ParserError\n */\nfunction validateChannels(parsedJSON, asyncapiYAMLorJSON, initialFormat) {\n const chnls = parsedJSON.channels;\n if (!chnls) return true;\n\n const chnlsMap = new Map(Object.entries(chnls));\n const notProvidedParams = new Map(); //return object for missing parameters\n const invalidChannelName = new Map(); //return object for invalid channel names with query parameters\n\n chnlsMap.forEach((val, key) => {\n const variables = parseUrlVariables(key);\n const notProvidedChannelParams = notProvidedParams.get(tilde(key));\n const queryParameters = parseUrlQueryParameters(key);\n\n //channel variable validation: fill return obeject with missing parameters\n if (variables) {\n setNotProvidedParams(\n variables,\n val,\n key,\n notProvidedChannelParams,\n notProvidedParams\n );\n }\n\n //channel name validation: fill return object with channels containing query parameters\n if (queryParameters) {\n invalidChannelName.set(tilde(key), queryParameters);\n }\n });\n\n //combine validation errors of both checks and output them as one array\n const parameterValidationErrors = groupValidationErrors(\n 'channels',\n 'channel does not have a corresponding parameter object for',\n notProvidedParams,\n asyncapiYAMLorJSON,\n initialFormat\n );\n const nameValidationErrors = groupValidationErrors(\n 'channels',\n 'channel contains invalid name with url query parameters',\n invalidChannelName,\n asyncapiYAMLorJSON,\n initialFormat\n );\n const allValidationErrors = parameterValidationErrors.concat(\n nameValidationErrors\n );\n\n //channel variable validation: throw exception if channel validation failes\n if (notProvidedParams.size || invalidChannelName.size) {\n throw new ParserError({\n type: validationError,\n title: 'Channel validation failed',\n parsedJSON,\n validationErrors: allValidationErrors,\n });\n }\n\n return true;\n}\n\nmodule.exports = {\n validateServerVariables,\n validateOperationId,\n validateServerSecurity,\n validateChannels,\n};\n","const ERROR_URL_PREFIX = 'https://github.com/asyncapi/parser-js/';\n\nconst buildError = (from, to) => {\n to.type = from.type.startsWith(ERROR_URL_PREFIX) ? from.type : `${ERROR_URL_PREFIX}${from.type}`;\n to.title = from.title;\n if (from.detail) to.detail = from.detail;\n if (from.validationErrors) to.validationErrors = from.validationErrors;\n if (from.parsedJSON) to.parsedJSON = from.parsedJSON;\n if (from.location) to.location = from.location;\n if (from.refs) to.refs = from.refs;\n return to;\n};\n\n/**\n * Represents an error while trying to parse an AsyncAPI document.\n * @alias module:@asyncapi/parser#ParserError\n * @extends Error\n */\nclass ParserError extends Error {\n /**\n * Instantiates an error\n * @param {Object} definition\n * @param {String} definition.type The type of the error.\n * @param {String} definition.title The message of the error.\n * @param {String} [definition.detail] A string containing more detailed information about the error.\n * @param {Object} [definition.parsedJSON] The resulting JSON after YAML transformation. Or the JSON object if the this was the initial format.\n * @param {Object[]} [definition.validationErrors] The errors resulting from the validation. For more information, see https://www.npmjs.com/package/better-ajv-errors.\n * @param {String} definition.validationErrors.title A validation error message.\n * @param {String} definition.validationErrors.jsonPointer The path to the field that contains the error. Uses JSON Pointer format.\n * @param {Number} definition.validationErrors.startLine The line where the error starts in the AsyncAPI document.\n * @param {Number} definition.validationErrors.startColumn The column where the error starts in the AsyncAPI document.\n * @param {Number} definition.validationErrors.startOffset The offset (starting from the beginning of the document) where the error starts in the AsyncAPI document.\n * @param {Number} definition.validationErrors.endLine The line where the error ends in the AsyncAPI document.\n * @param {Number} definition.validationErrors.endColumn The column where the error ends in the AsyncAPI document.\n * @param {Number} definition.validationErrors.endOffset The offset (starting from the beginning of the document) where the error ends in the AsyncAPI document.\n * @param {Object} [definition.location] Error location details after trying to parse an invalid JSON or YAML document.\n * @param {Number} definition.location.startLine The line of the YAML/JSON document where the error starts.\n * @param {Number} definition.location.startColumn The column of the YAML/JSON document where the error starts.\n * @param {Number} definition.location.startOffset The offset (starting from the beginning of the document) where the error starts in the YAML/JSON AsyncAPI document.\n * @param {Object[]} [definition.refs] Error details after trying to resolve $ref's.\n * @param {String} definition.refs.title A validation error message.\n * @param {String} definition.refs.jsonPointer The path to the field that contains the error. Uses JSON Pointer format.\n * @param {Number} definition.refs.startLine The line where the error starts in the AsyncAPI document.\n * @param {Number} definition.refs.startColumn The column where the error starts in the AsyncAPI document.\n * @param {Number} definition.refs.startOffset The offset (starting from the beginning of the document) where the error starts in the AsyncAPI document.\n * @param {Number} definition.refs.endLine The line where the error ends in the AsyncAPI document.\n * @param {Number} definition.refs.endColumn The column where the error ends in the AsyncAPI document.\n * @param {Number} definition.refs.endOffset The offset (starting from the beginning of the document) where the error ends in the AsyncAPI document.\n */\n constructor(def) {\n super();\n buildError(def, this);\n this.message = def.title;\n }\n\n /**\n * Returns a JS object representation of the error.\n */\n toJS() {\n return buildError(this, {});\n }\n}\n\nmodule.exports = ParserError;\n","const parser = require('./parser');\nconst defaultAsyncAPISchemaParser = require('./asyncapiSchemaFormatParser');\n\nparser.registerSchemaParser(defaultAsyncAPISchemaParser);\n\nmodule.exports = parser;\n","/**\n * @readonly\n * @enum {SchemaIteratorCallbackType}\n */\n\n/**\n * The different kind of stages when crawling a schema. \n * \n * @typedef SchemaIteratorCallbackType\n * @property {string} NEW_SCHEMA The crawler just started crawling a schema.\n * @property {string} END_SCHEMA The crawler just finished crawling a schema.\n */\nconst SchemaIteratorCallbackType = Object.freeze({\n NEW_SCHEMA: 'NEW_SCHEMA',\n END_SCHEMA: 'END_SCHEMA'\n});\n\n/**\n *\n * @readonly\n * @enum {SchemaTypesToIterate}\n */\n\n/**\n * The different types of schemas you can iterate \n * \n * @typedef SchemaTypesToIterate\n * @property {string} parameters Crawl all schemas in parameters\n * @property {string} payloads Crawl all schemas in payloads\n * @property {string} headers Crawl all schemas in headers\n * @property {string} components Crawl all schemas in components\n * @property {string} objects Crawl all schemas of type object\n * @property {string} arrays Crawl all schemas of type array\n * @property {string} oneOfs Crawl all schemas in oneOf's\n * @property {string} allOfs Crawl all schemas in allOf's\n * @property {string} anyOfs Crawl all schemas in anyOf's\n */\nconst SchemaTypesToIterate = Object.freeze({\n parameters: 'parameters',\n payloads: 'payloads',\n headers: 'headers',\n components: 'components',\n objects: 'objects',\n arrays: 'arrays',\n oneOfs: 'oneOfs',\n allOfs: 'allOfs',\n anyOfs: 'anyOfs'\n});\n\n/**\n * Traverse current schema and all nested schemas.\n * \n * @private\n * @param {Schema} schemaContent schema.\n * @param {TraverseSchemas} callback \n * @param {SchemaTypesToIterate[]} schemaTypesToIterate\n */\nfunction traverseSchema(schema, callback, prop, schemaTypesToIterate) {\n if (schema === null) return;\n if (!schemaTypesToIterate.includes(SchemaTypesToIterate.arrays) && schema.type() === 'array') return;\n if (!schemaTypesToIterate.includes(SchemaTypesToIterate.objects) && schema.type() === 'object') return;\n if (schema.isCircular()) return;\n if (callback(schema, prop, SchemaIteratorCallbackType.NEW_SCHEMA) === false) return;\n \n if (schema.type() !== undefined) {\n switch (schema.type()) {\n case 'object':\n recursiveSchemaObject(schema, callback, schemaTypesToIterate);\n break;\n case 'array':\n recursiveSchemaArray(schema, callback, schemaTypesToIterate);\n break;\n }\n } else {\n traverseCombinedSchemas(schema, callback, schemaTypesToIterate);\n }\n callback(schema, prop, SchemaIteratorCallbackType.END_SCHEMA);\n}\n \n/**\n * Traverse combined notions\n * \n * @private\n * @param {Schema} schemaContent schema.\n * @param {TraverseSchemas} callback \n * @param {SchemaTypesToIterate[]} schemaTypesToIterate\n */\nfunction traverseCombinedSchemas(schema, callback, schemaTypesToIterate) {\n //check for allOf, oneOf, anyOf\n const checkCombiningSchemas = (combineArray) => {\n (combineArray || []).forEach(combineSchema => {\n traverseSchema(combineSchema, callback, null, schemaTypesToIterate);\n });\n };\n if (schemaTypesToIterate.includes(SchemaTypesToIterate.allOfs)) {\n checkCombiningSchemas(schema.allOf());\n }\n if (schemaTypesToIterate.includes(SchemaTypesToIterate.anyOfs)) {\n checkCombiningSchemas(schema.anyOf());\n }\n if (schemaTypesToIterate.includes(SchemaTypesToIterate.oneOfs)) {\n checkCombiningSchemas(schema.oneOf());\n }\n}\n \n/**\n * Go through each channel and for each parameter, and message payload and headers recursively call the callback for each schema.\n * \n * @private\n * @param {AsyncAPIDocument} doc \n * @param {FoundSchemaCallback} callback\n * @param {SchemaTypesToIterate[]} schemaTypesToIterate\n */\nfunction traverseAsyncApiDocument(doc, callback, schemaTypesToIterate) {\n if (!schemaTypesToIterate) {\n schemaTypesToIterate = Object.values(SchemaTypesToIterate);\n }\n if (doc.hasChannels()) {\n doc.channelNames().forEach(channelName => {\n const channel = doc.channel(channelName);\n traverseChannel(channel, callback, schemaTypesToIterate);\n });\n }\n if (doc.hasComponents() && schemaTypesToIterate.includes(SchemaTypesToIterate.components)) {\n Object.values(doc.components().schemas()).forEach(s => {\n traverseSchema(s, callback, null, schemaTypesToIterate);\n });\n Object.values(doc.components().messages()).forEach(m => {\n traverseMessage(m, callback, schemaTypesToIterate);\n });\n }\n}\n \n/**\n * Go through each schema in channel\n * \n * @private\n * @param {Channel} channel \n * @param {FoundSchemaCallback} callback\n * @param {SchemaTypesToIterate[]} schemaTypesToIterate\n */\nfunction traverseChannel(channel, callback, schemaTypesToIterate) {\n if (schemaTypesToIterate.includes(SchemaTypesToIterate.parameters)) {\n Object.values(channel.parameters()).forEach(p => {\n traverseSchema(p.schema(), callback, null, schemaTypesToIterate);\n });\n }\n if (channel.hasPublish()) {\n channel.publish().messages().forEach(m => {\n traverseMessage(m, callback, schemaTypesToIterate);\n });\n }\n if (channel.hasSubscribe()) {\n channel.subscribe().messages().forEach(m => {\n traverseMessage(m, callback, schemaTypesToIterate);\n });\n }\n}\n/**\n * Go through each schema in a message\n * \n * @private\n * @param {Message} message \n * @param {FoundSchemaCallback} callback\n * @param {SchemaTypesToIterate[]} schemaTypesToIterate\n */\nfunction traverseMessage(message, callback, schemaTypesToIterate) {\n if (message === null) return;\n if (schemaTypesToIterate.includes(SchemaTypesToIterate.headers)) {\n traverseSchema(message.headers(), callback, null, schemaTypesToIterate);\n }\n if (schemaTypesToIterate.includes(SchemaTypesToIterate.payloads)) {\n traverseSchema(message.payload(), callback, null, schemaTypesToIterate);\n }\n}\n \n/**\n * Recursively go through schema of object type and execute callback.\n * \n * @private\n * @param {Schema} schema Object type.\n * @param {TraverseSchemas} callback \n * @param {SchemaTypesToIterate[]} schemaTypesToIterate\n */\nfunction recursiveSchemaObject(schema, callback, schemaTypesToIterate) {\n if (schema.additionalProperties() !== undefined && typeof schema.additionalProperties() !== 'boolean') {\n const additionalSchema = schema.additionalProperties();\n traverseSchema(additionalSchema, callback, null, schemaTypesToIterate);\n }\n if (schema.properties() !== null) {\n const props = schema.properties();\n for (const [prop, propertySchema] of Object.entries(props)) {\n const circularProps = schema.circularProps();\n if (circularProps !== undefined && circularProps.includes(prop)) continue;\n traverseSchema(propertySchema, callback, prop, schemaTypesToIterate);\n }\n }\n}\n \n/**\n * Recursively go through schema of array type and execute callback.\n * \n * @private\n * @param {Schema} schema Array type.\n * @param {TraverseSchemas} callback \n * @param {SchemaTypesToIterate[]} schemaTypesToIterate\n */\nfunction recursiveSchemaArray(schema, callback, schemaTypesToIterate) {\n if (schema.additionalItems() !== undefined) {\n const additionalArrayItems = schema.additionalItems();\n traverseSchema(additionalArrayItems, callback, null, schemaTypesToIterate);\n }\n \n if (schema.items() !== null) {\n if (Array.isArray(schema.items())) {\n schema.items().forEach(arraySchema => {\n traverseSchema(arraySchema, callback, null, schemaTypesToIterate);\n });\n } else {\n traverseSchema(schema.items(), callback, null, schemaTypesToIterate);\n }\n }\n}\n\nmodule.exports = {\n SchemaIteratorCallbackType,\n SchemaTypesToIterate,\n traverseSchema,\n traverseAsyncApiDocument,\n traverseChannel,\n traverseMessage, \n recursiveSchemaObject,\n recursiveSchemaArray\n};\n","module.exports = (txt, reviver, context = 20) => {\n try {\n return JSON.parse(txt, reviver);\n } catch (e) {\n handleJsonNotString(txt);\n const syntaxErr = e.message.match(/^Unexpected token.*position\\s+(\\d+)/i);\n const errIdxBrokenJson = e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1 : null;\n const errIdx = syntaxErr ? +syntaxErr[1] : errIdxBrokenJson;\n handleErrIdxNotNull(e, txt, errIdx, context);\n e.offset = errIdx;\n const lines = txt.substr(0, errIdx).split('\\n');\n e.startLine = lines.length;\n e.startColumn = lines[lines.length - 1].length;\n throw e;\n }\n};\n\nfunction handleJsonNotString(txt) {\n if (typeof txt !== 'string') {\n const isEmptyArray = Array.isArray(txt) && txt.length === 0;\n const errorMessage = `Cannot parse ${ \n isEmptyArray ? 'an empty array' : String(txt)}`;\n throw new TypeError(errorMessage);\n }\n}\n\nfunction handleErrIdxNotNull(e, txt, errIdx, context) {\n if (errIdx !== null) {\n const start = errIdx <= context\n ? 0\n : errIdx - context;\n const end = errIdx + context >= txt.length\n ? txt.length\n : errIdx + context;\n e.message += ` while parsing near '${\n start === 0 ? '' : '...'\n }${txt.slice(start, end)}${\n end === txt.length ? '' : '...'\n }'`;\n } else {\n e.message += ` while parsing '${txt.slice(0, context * 2)}'`;\n }\n}\n","const { getMapValueByKey } = require('../models/utils');\n\n/**\n * Implements functions to deal with the common Bindings object.\n * @mixin\n */\nconst MixinBindings = {\n /**\n * @returns {boolean}\n */\n hasBindings() {\n return !!(this._json.bindings && Object.keys(this._json.bindings).length);\n },\n\n /**\n * @returns {Object}\n */\n bindings() {\n return this.hasBindings() ? this._json.bindings : {};\n },\n\n /**\n * @returns {string[]}\n */\n bindingProtocols() {\n return Object.keys(this.bindings());\n },\n\n /**\n * @param {string} name - Name of the binding.\n * @returns {boolean}\n */\n hasBinding(name) {\n return this.hasBindings() && !!this._json.bindings[String(name)];\n },\n\n /**\n * @param {string} name - Name of the binding.\n * @returns {(Object | null)}\n */\n binding(name) {\n return getMapValueByKey(this._json.bindings, name);\n },\n};\n\nmodule.exports = MixinBindings;\n","const { getMapValueByKey } = require('../models/utils');\n\n/**\n * Implements functions to deal with the description field.\n * @mixin\n */\nconst MixinDescription = {\n /**\n * @returns {boolean}\n */\n hasDescription() {\n return !!this._json.description;\n },\n\n /**\n * @returns {(string | null)}\n */\n description() {\n return getMapValueByKey(this._json, 'description');\n },\n};\n\nmodule.exports = MixinDescription;\n","const { getMapValueOfType } = require('../models/utils');\n\nconst ExternalDocs = require('../models/external-docs');\n\n/**\n * Implements functions to deal with the ExternalDocs object.\n * @mixin\n */\nconst MixinExternalDocs = {\n /**\n * @returns {boolean}\n */\n hasExternalDocs() {\n return !!(this._json.externalDocs && Object.keys(this._json.externalDocs).length);\n },\n\n /**\n * @returns {(ExternalDocs | null)}\n */\n externalDocs() {\n return getMapValueOfType(this._json, 'externalDocs', ExternalDocs);\n },\n};\n\nmodule.exports = MixinExternalDocs;\n","/**\n * Implements functions to deal with the SpecificationExtensions object.\n * @mixin\n */\nconst MixinSpecificationExtensions = {\n /**\n * @returns {boolean}\n */\n hasExtensions() {\n return !!this.extensionKeys().length;\n },\n\n /**\n * @returns {Object}\n */\n extensions() {\n const result = {};\n Object.entries(this._json).forEach(([key, value]) => {\n if ((/^x-[\\w\\d\\.\\-\\_]+$/).test(key)) {\n result[String(key)] = value;\n }\n });\n return result;\n },\n\n /**\n * @returns {string[]}\n */\n extensionKeys() {\n return Object.keys(this.extensions());\n },\n\n /**\n * @returns {string[]}\n */\n extKeys() {\n return this.extensionKeys();\n },\n\n /**\n * @param {string} key - Extension key.\n * @returns {boolean}\n */\n hasExtension(key) {\n if (!key.startsWith('x-')) {\n return false;\n }\n return !!this._json[String(key)];\n },\n\n /**\n * @param {string} key - Extension key.\n * @returns {any}\n */\n extension(key) {\n if (!key.startsWith('x-')) {\n return null;\n }\n return this._json[String(key)];\n },\n\n /**\n * @param {string} key - Extension key.\n * @returns {boolean}\n */ \n hasExt(key) {\n return this.hasExtension(key);\n },\n\n /**\n * @param {string} key - Extension key.\n * @returns {any}\n */\n ext(key) {\n return this.extension(key);\n },\n};\n\nmodule.exports = MixinSpecificationExtensions;\n","const Tag = require('../models/tag');\n\n/**\n * Implements functions to deal with the Tags object.\n * @mixin\n */\nconst MixinTags = {\n /**\n * @returns {boolean}\n */\n hasTags() {\n return !!(Array.isArray(this._json.tags) && this._json.tags.length);\n },\n\n /**\n * @returns {Tag[]}\n */\n tags() {\n return this.hasTags() ? this._json.tags.map(t => new Tag(t)) : [];\n },\n\n /**\n * @returns {string[]}\n */\n tagNames() {\n return this.hasTags() ? this._json.tags.map(t => t.name) : [];\n },\n\n /**\n * @param {string} name - Name of the tag.\n * @returns {boolean}\n */\n hasTag(name) {\n return this.hasTags() && this._json.tags.some(t => t.name === name);\n },\n\n /**\n * @param {string} name - Name of the tag.\n * @returns {(Tag | null)}\n */\n tag(name) {\n const tg = this.hasTags() && this._json.tags.find(t => t.name === name);\n return tg ? new Tag(tg) : null;\n },\n};\n\nmodule.exports = MixinTags;\n","const { createMapOfType, getMapValueOfType, mix } = require('./utils');\n\nconst Base = require('./base');\nconst Info = require('./info');\nconst Server = require('./server');\nconst Channel = require('./channel');\nconst Components = require('./components');\nconst MixinExternalDocs = require('../mixins/external-docs');\nconst MixinTags = require('../mixins/tags');\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\nconst {xParserSpecParsed, xParserCircle, xParserCircleProps} = require('../constants');\nconst {assignNameToAnonymousMessages, assignNameToComponentMessages, assignUidToComponentSchemas, assignUidToParameterSchemas, assignIdToAnonymousSchemas, assignUidToComponentParameterSchemas} = require('../anonymousNaming');\nconst {traverseAsyncApiDocument, SchemaIteratorCallbackType} = require('../iterators');\n\n/**\n * Implements functions to deal with the AsyncAPI document. \n * @class\n * @alias module:@asyncapi/parser#AsyncAPIDocument\n * @extends Base\n * @mixes MixinTags\n * @mixes MixinExternalDocs\n * @mixes MixinSpecificationExtensions\n * @returns {AsyncAPIDocument}\n */\nclass AsyncAPIDocument extends Base {\n /**\n * @constructor\n */\n constructor(...args) {\n super(...args);\n\n if (this.ext(xParserSpecParsed) === true) {\n return;\n }\n\n assignNameToComponentMessages(this);\n assignNameToAnonymousMessages(this);\n\n markCircularSchemas(this);\n assignUidToComponentSchemas(this);\n assignUidToComponentParameterSchemas(this);\n assignUidToParameterSchemas(this);\n assignIdToAnonymousSchemas(this);\n\n // We add `x-parser-spec-parsed=true` extension to determine that the specification is parsed and validated \n // and when the specification is re-passed to the AsyncAPIDocument constructor,\n // there is no need to perform the same operations.\n this.json()[String(xParserSpecParsed)] = true;\n }\n\n /**\n * @returns {string}\n */\n version() {\n return this._json.asyncapi;\n }\n\n /**\n * @returns {Info}\n */\n info() {\n return new Info(this._json.info);\n }\n\n /**\n * @returns {string}\n */\n id() {\n return this._json.id;\n }\n\n /**\n * @returns {boolean}\n */\n hasServers() {\n return !!this._json.servers;\n }\n\n /**\n * @returns {Object}\n */\n servers() {\n return createMapOfType(this._json.servers, Server);\n }\n\n /**\n * @returns {string[]}\n */\n serverNames() {\n if (!this._json.servers) return [];\n return Object.keys(this._json.servers);\n }\n\n /**\n * @param {string} name - Name of the server.\n * @returns {Server}\n */\n server(name) {\n return getMapValueOfType(this._json.servers, name, Server);\n }\n\n /**\n * @returns {boolean}\n */\n hasDefaultContentType() {\n return !!this._json.defaultContentType;\n }\n\n /**\n * @returns {string|null}\n */\n defaultContentType() {\n return this._json.defaultContentType || null;\n }\n\n /**\n * @returns {boolean}\n */\n hasChannels() {\n return !!this._json.channels;\n }\n\n /**\n * @returns {Object}\n */\n channels() {\n return createMapOfType(this._json.channels, Channel, this);\n }\n\n /**\n * @returns {string[]}\n */\n channelNames() {\n if (!this._json.channels) return [];\n return Object.keys(this._json.channels);\n }\n\n /**\n * @param {string} name - Name of the channel.\n * @returns {Channel}\n */\n channel(name) {\n return getMapValueOfType(this._json.channels, name, Channel, this);\n }\n\n /**\n * @returns {boolean}\n */\n hasComponents() {\n return !!this._json.components;\n }\n\n /**\n * @returns {Components}\n */\n components() {\n if (!this._json.components) return null;\n return new Components(this._json.components);\n }\n\n /**\n * @returns {boolean}\n */\n hasMessages() {\n return !!this.allMessages().size;\n }\n\n /**\n * @returns {Map}\n */\n allMessages() {\n const messages = new Map();\n\n if (this.hasChannels()) {\n this.channelNames().forEach(channelName => {\n const channel = this.channel(channelName);\n if (channel.hasPublish()) {\n channel.publish().messages().forEach(m => {\n messages.set(m.uid(), m);\n });\n }\n if (channel.hasSubscribe()) {\n channel.subscribe().messages().forEach(m => {\n messages.set(m.uid(), m);\n });\n }\n });\n }\n\n if (this.hasComponents()) {\n Object.values(this.components().messages()).forEach(m => {\n messages.set(m.uid(), m);\n });\n }\n\n return messages;\n }\n\n /**\n * @returns {Map}\n */\n allSchemas() {\n const schemas = new Map();\n const allSchemasCallback = (schema) => {\n if (schema.uid()) {\n schemas.set(schema.uid(), schema);\n }\n };\n traverseAsyncApiDocument(this, allSchemasCallback);\n return schemas;\n }\n\n /**\n * @returns {boolean}\n */\n hasCircular() {\n return !!this._json[String(xParserCircle)];\n }\n\n /**\n * Callback used when crawling a schema.\n * @callback module:@asyncapi/parser.TraverseSchemas\n * @param {Schema} schema which is being crawled\n * @param {String} propName if the schema is from a property get the name of such\n * @param {SchemaIteratorCallbackType} callbackType is the schema a new one or is the crawler finishing one.\n * @returns {boolean} should the crawler continue crawling the schema?\n */\n\n /**\n * Traverse schemas in the document and select which types of schemas to include.\n * By default all schemas are iterated\n * @param {TraverseSchemas} callback\n * @param {SchemaTypesToIterate[]} schemaTypesToIterate\n */\n traverseSchemas(callback, schemaTypesToIterate) {\n traverseAsyncApiDocument(this, callback, schemaTypesToIterate);\n }\n}\n\n/**\n * Marks all recursive schemas as recursive.\n * \n * @private\n * @param {AsyncAPIDocument} doc \n */\nfunction markCircularSchemas(doc) {\n const seenObj = [];\n const lastSchema = [];\n\n //Mark the schema as recursive\n const markCircular = (schema, prop) => {\n if (schema.type() === 'array') return schema.json()[String(xParserCircle)] = true;\n const circPropsList = schema.json()[String(xParserCircleProps)] || [];\n if (prop !== undefined) {\n circPropsList.push(prop);\n }\n schema.json()[String(xParserCircleProps)] = circPropsList;\n };\n\n //callback to use for iterating through the schemas\n const circularCheckCallback = (schema, propName, type) => {\n switch (type) {\n case SchemaIteratorCallbackType.END_SCHEMA:\n lastSchema.pop();\n seenObj.pop();\n break;\n case SchemaIteratorCallbackType.NEW_SCHEMA:\n const schemaJson = schema.json();\n if (seenObj.includes(schemaJson)) {\n const schemaToUse = lastSchema.length > 0 ? lastSchema[lastSchema.length - 1] : schema;\n markCircular(schemaToUse, propName);\n return false;\n }\n //Save a list of seen objects and last schema which should be marked if its recursive\n seenObj.push(schemaJson);\n lastSchema.push(schema);\n return true;\n }\n };\n traverseAsyncApiDocument(doc, circularCheckCallback);\n}\n\nmodule.exports = mix(AsyncAPIDocument, MixinTags, MixinExternalDocs, MixinSpecificationExtensions);\n","const ParserError = require('../errors/parser-error');\n\n/**\n * Implements common functionality for all the models.\n * @class\n * @alias module:@asyncapi/parser#Base\n * @returns {Base}\n */\nclass Base {\n constructor (json) {\n if (json === undefined || json === null) throw new ParserError(`Invalid JSON to instantiate the ${this.constructor.name} object.`);\n this._json = json;\n }\n\n /**\n * @returns {any}\n */\n json(key) {\n if (key === undefined) return this._json;\n if (!this._json) return;\n return this._json[String(key)];\n }\n}\n\nmodule.exports = Base;\n","const { mix } = require('./utils');\n\nconst Base = require('./base');\nconst Schema = require('./schema');\n\nconst MixinDescription = require('../mixins/description');\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with a ChannelParameter object.\n * @class\n * @alias module:@asyncapi/parser#ChannelParameter\n * @extends Base\n * @mixes MixinDescription\n * @mixes MixinSpecificationExtensions\n * @returns {ChannelParameter}\n */\nclass ChannelParameter extends Base {\n /**\n * @returns {string}\n */\n location() {\n return this._json.location;\n }\n \n /**\n * @returns {Schema}\n */\n schema() {\n if (!this._json.schema) return null;\n return new Schema(this._json.schema);\n }\n}\n\nmodule.exports = mix(ChannelParameter, MixinDescription, MixinSpecificationExtensions);\n","const { createMapOfType, getMapValueOfType, mix } = require('./utils');\n\nconst Base = require('./base');\nconst ChannelParameter = require('./channel-parameter');\nconst PublishOperation = require('./publish-operation');\nconst SubscribeOperation = require('./subscribe-operation');\n\nconst MixinDescription = require('../mixins/description');\nconst MixinBindings = require('../mixins/bindings');\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with a Channel object.\n * @class\n * @alias module:@asyncapi/parser#Channel\n * @extends Base\n * @mixes MixinDescription\n * @mixes MixinBindings\n * @mixes MixinSpecificationExtensions\n * @returns {Channel}\n */\nclass Channel extends Base {\n /**\n * @returns {Object}\n */\n parameters() {\n return createMapOfType(this._json.parameters, ChannelParameter);\n }\n\n /**\n * @param {string} name - Name of the parameter.\n * @returns {ChannelParameter}\n */\n parameter(name) {\n return getMapValueOfType(this._json.parameters, name, ChannelParameter);\n }\n\n /**\n * @returns {boolean}\n */\n hasParameters() {\n return !!this._json.parameters;\n }\n\n /**\n * @returns {PublishOperation}\n */\n publish() {\n if (!this._json.publish) return null;\n return new PublishOperation(this._json.publish);\n }\n\n /**\n * @returns {SubscribeOperation}\n */\n subscribe() {\n if (!this._json.subscribe) return null;\n return new SubscribeOperation(this._json.subscribe);\n }\n\n /**\n * @returns {boolean}\n */\n hasPublish() {\n return !!this._json.publish;\n }\n\n /**\n * @returns {boolean}\n */\n hasSubscribe() {\n return !!this._json.subscribe;\n }\n}\n\nmodule.exports = mix(Channel, MixinDescription, MixinBindings, MixinSpecificationExtensions);\n","const { createMapOfType, getMapValueOfType, mix } = require('./utils');\n\nconst Base = require('./base');\nconst Message = require('./message');\nconst Schema = require('./schema');\nconst SecurityScheme = require('./security-scheme');\nconst ChannelParameter = require('./channel-parameter');\nconst CorrelationId = require('./correlation-id');\nconst OperationTrait = require('./operation-trait');\nconst MessageTrait = require('./message-trait');\n\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with a Components object.\n * @class\n * @alias module:@asyncapi/parser#Components\n * @extends Base\n * @mixes MixinSpecificationExtensions\n * @returns {Components}\n */\nclass Components extends Base {\n /**\n * @returns {Object}\n */\n messages() {\n return createMapOfType(this._json.messages, Message);\n }\n\n /**\n * @returns {boolean}\n */\n hasMessages() {\n return !!this._json.messages;\n }\n\n /**\n * @param {string} name - Name of the message.\n * @returns {Message}\n */\n message(name) {\n return getMapValueOfType(this._json.messages, name, Message);\n }\n \n /**\n * @returns {Object}\n */\n schemas() {\n return createMapOfType(this._json.schemas, Schema);\n }\n\n /**\n * @returns {boolean}\n */\n hasSchemas() {\n return !!this._json.schemas;\n }\n\n /**\n * @param {string} name - Name of the schema.\n * @returns {Schema}\n */\n schema(name) {\n return getMapValueOfType(this._json.schemas, name, Schema);\n }\n \n /**\n * @returns {Object}\n */\n securitySchemes() {\n return createMapOfType(this._json.securitySchemes, SecurityScheme);\n }\n\n /**\n * @returns {boolean}\n */\n hasSecuritySchemes() {\n return !!this._json.securitySchemes;\n }\n \n /**\n * @param {string} name - Name of the security schema.\n * @returns {SecurityScheme}\n */\n securityScheme(name) {\n return getMapValueOfType(this._json.securitySchemes, name, SecurityScheme);\n }\n \n /**\n * @returns {Object}\n */\n parameters() {\n return createMapOfType(this._json.parameters, ChannelParameter);\n }\n\n /**\n * @returns {boolean}\n */\n hasParameters() {\n return !!this._json.parameters;\n }\n\n /**\n * @param {string} name - Name of the channel parameter.\n * @returns {ChannelParameter}\n */\n parameter(name) {\n return getMapValueOfType(this._json.parameters, name, ChannelParameter);\n }\n \n /**\n * @returns {Object}\n */\n correlationIds() {\n return createMapOfType(this._json.correlationIds, CorrelationId);\n }\n\n /**\n * @returns {boolean}\n */\n hasCorrelationIds() {\n return !!this._json.correlationIds;\n }\n\n /**\n * @param {string} name - Name of the correlationId.\n * @returns {CorrelationId}\n */\n correlationId(name) {\n return getMapValueOfType(this._json.correlationIds, name, CorrelationId);\n }\n \n /**\n * @returns {Object}\n */\n operationTraits() {\n return createMapOfType(this._json.operationTraits, OperationTrait);\n }\n\n /**\n * @returns {boolean}\n */\n hasOperationTraits() {\n return !!this._json.operationTraits;\n }\n\n /**\n * @param {string} name - Name of the operation trait.\n * @returns {OperationTrait}\n */\n operationTrait(name) {\n return getMapValueOfType(this._json.operationTraits, name, OperationTrait);\n }\n \n /**\n * @returns {Object}\n */\n messageTraits() {\n return createMapOfType(this._json.messageTraits, MessageTrait);\n }\n\n /**\n * @returns {boolean}\n */\n hasMessageTraits() {\n return !!this._json.messageTraits;\n }\n\n /**\n * @param {string} name - Name of the message trait.\n * @returns {MessageTrait}\n */\n messageTrait(name) {\n return getMapValueOfType(this._json.messageTraits, name, MessageTrait);\n }\n}\n\nmodule.exports = mix(Components, MixinSpecificationExtensions);\n"," \nconst { mix } = require('./utils');\n\nconst Base = require('./base');\n\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with the Contact object.\n * @class\n * @alias module:@asyncapi/parser#Contact\n * @extends Base\n * @mixes MixinSpecificationExtensions\n * @returns {Contact}\n */\nclass Contact extends Base {\n /**\n * @returns {string}\n */\n name() {\n return this._json.name;\n }\n \n /**\n * @returns {string}\n */\n url() {\n return this._json.url;\n }\n \n /**\n * @returns {string}\n */\n email() {\n return this._json.email;\n }\n}\n\nmodule.exports = mix(Contact, MixinSpecificationExtensions);\n","const { mix } = require('./utils');\n\nconst Base = require('./base');\n\nconst MixinDescription = require('../mixins/description');\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with a CorrelationId object.\n * @class\n * @alias module:@asyncapi/parser#CorrelationId\n * @extends Base\n * @mixes MixinDescription\n * @mixes MixinSpecificationExtensions\n * @returns {CorrelationId}\n */\nclass CorrelationId extends Base {\n /**\n * @returns {string}\n */\n location() {\n return this._json.location;\n }\n}\n\nmodule.exports = mix(CorrelationId, MixinSpecificationExtensions, MixinDescription);\n","const { mix } = require('./utils');\n\nconst Base = require('./base');\n\nconst MixinDescription = require('../mixins/description');\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with an ExternalDocs object.\n * @class\n * @alias module:@asyncapi/parser#ExternalDocs\n * @extends Base\n * @mixes MixinDescription\n * @mixes MixinSpecificationExtensions\n * @returns {ExternalDocs}\n */\nclass ExternalDocs extends Base {\n /**\n * @returns {string}\n */\n url() {\n return this._json.url;\n }\n}\n\nmodule.exports = mix(ExternalDocs, MixinDescription, MixinSpecificationExtensions);\n","const { mix } = require('./utils');\n\nconst Base = require('./base');\nconst License = require('./license');\nconst Contact = require('./contact');\n\nconst MixinDescription = require('../mixins/description');\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with the Info object.\n * @class\n * @alias module:@asyncapi/parser#Info\n * @extends Base\n * @mixes MixinDescription\n * @mixes MixinSpecificationExtensions\n * @returns {Info}\n */\nclass Info extends Base {\n /**\n * @returns {string}\n */\n title() {\n return this._json.title;\n }\n \n /**\n * @returns {string}\n */\n version() {\n return this._json.version;\n }\n\n /**\n * @returns {(string | undefined)}\n */\n termsOfService() {\n return this._json.termsOfService;\n }\n\n /**\n * @returns {License}\n */\n license() {\n if (!this._json.license) return null;\n return new License(this._json.license);\n }\n\n /**\n * @returns {Contact}\n */\n contact() {\n if (!this._json.contact) return null;\n return new Contact(this._json.contact);\n }\n}\n\nmodule.exports = mix(Info, MixinDescription, MixinSpecificationExtensions);\n","const { mix } = require('./utils');\n\nconst Base = require('./base');\n\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with the License object.\n * @class\n * @alias module:@asyncapi/parser#License\n * @extends Base\n * @mixes MixinSpecificationExtensions\n * @returns {License}\n */\nclass License extends Base {\n /**\n * @returns {string}\n */\n name() {\n return this._json.name;\n }\n \n /**\n * @returns {string}\n */\n url() {\n return this._json.url;\n }\n}\n\nmodule.exports = mix(License, MixinSpecificationExtensions);\n","const MessageTraitable = require('./message-traitable');\n\n/**\n * Implements functions to deal with a MessageTrait object.\n * @class\n * @alias module:@asyncapi/parser#MessageTrait\n * @extends MessageTraitable\n * @returns {MessageTrait}\n */\nclass MessageTrait extends MessageTraitable {\n}\n\nmodule.exports = MessageTrait;\n","const { getMapValueOfType, mix } = require('./utils');\n\nconst Base = require('./base');\nconst Schema = require('./schema');\nconst CorrelationId = require('./correlation-id');\n\nconst MixinDescription = require('../mixins/description');\nconst MixinExternalDocs = require('../mixins/external-docs');\nconst MixinTags = require('../mixins/tags');\nconst MixinBindings = require('../mixins/bindings');\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with a the common properties that Message and MessageTrait objects have.\n * @class\n * @alias module:@asyncapi/parser#MessageTraitable\n * @extends Base\n * @mixes MixinDescription\n * @mixes MixinTags\n * @mixes MixinExternalDocs\n * @mixes MixinBindings\n * @mixes MixinSpecificationExtensions\n * @returns {MessageTraitable}\n */\nclass MessageTraitable extends Base {\n /**\n * @returns {Schema}\n */\n headers() {\n if (!this._json.headers) return null;\n return new Schema(this._json.headers);\n }\n\n /**\n * @param {string} name - Name of the header.\n * @returns {Schema}\n */\n header(name) {\n if (!this._json.headers) return null;\n return getMapValueOfType(this._json.headers.properties, name, Schema);\n }\n\n /**\n * @returns {CorrelationId}\n */\n correlationId() {\n if (!this._json.correlationId) return null;\n return new CorrelationId(this._json.correlationId);\n }\n\n /**\n * @returns {string}\n */\n schemaFormat() {\n return 'application/schema+json;version=draft-07';\n }\n\n /**\n * @returns {string}\n */\n contentType() {\n return this._json.contentType;\n }\n\n /**\n * @returns {string}\n */\n name() {\n return this._json.name;\n }\n\n /**\n * @returns {string}\n */\n title() {\n return this._json.title;\n }\n\n /**\n * @returns {string}\n */\n summary() {\n return this._json.summary;\n }\n\n /**\n * @returns {any[]}\n */\n examples() {\n return this._json.examples;\n }\n}\n\nmodule.exports = mix(MessageTraitable, MixinDescription, MixinTags, MixinExternalDocs, MixinBindings, MixinSpecificationExtensions);\n","const MessageTraitable = require('./message-traitable');\nconst Schema = require('./schema');\n\n/**\n * Implements functions to deal with a Message object.\n * @class\n * @alias module:@asyncapi/parser#Message\n * @extends MessageTraitable\n * @returns {Message}\n */\nclass Message extends MessageTraitable {\n /**\n * @returns {string}\n */\n uid() {\n return this.name() || this.ext('x-parser-message-name') || Buffer.from(JSON.stringify(this._json)).toString('base64');\n }\n\n /**\n * @returns {Schema}\n */\n payload() {\n if (!this._json.payload) return null;\n return new Schema(this._json.payload);\n }\n\n /**\n * @returns {any}\n */\n originalPayload() {\n return this._json['x-parser-original-payload'] || this.payload();\n }\n\n /**\n * @returns {string}\n */\n originalSchemaFormat() {\n return this._json['x-parser-original-schema-format'] || this.schemaFormat();\n }\n}\n\nmodule.exports = Message;\n","const { mix } = require('./utils');\n\nconst Base = require('./base');\n\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with a OAuthFlow object.\n * @class\n * @alias module:@asyncapi/parser#OAuthFlow\n * @extends Base\n * @mixes MixinSpecificationExtensions\n * @returns {OAuthFlow}\n */\nclass OAuthFlow extends Base {\n /**\n * @returns {string}\n */\n authorizationUrl() {\n return this._json.authorizationUrl;\n }\n\n /**\n * @returns {string}\n */\n tokenUrl() {\n return this._json.tokenUrl;\n }\n\n /**\n * @returns {string}\n */\n refreshUrl() {\n return this._json.refreshUrl;\n }\n\n /**\n * @returns {Object}\n */\n scopes() {\n return this._json.scopes;\n }\n}\n\nmodule.exports = mix(OAuthFlow, MixinSpecificationExtensions);\n","const OperationTraitable = require('./operation-traitable');\n\n/**\n * Implements functions to deal with a OperationTrait object.\n * @class\n * @alias module:@asyncapi/parser#OperationTrait\n * @extends OperationTraitable\n * @returns {OperationTrait}\n */\nclass OperationTrait extends OperationTraitable {\n}\n\nmodule.exports = OperationTrait;\n","const { mix } = require('./utils');\n\nconst Base = require('./base');\n\nconst MixinDescription = require('../mixins/description');\nconst MixinTags = require('../mixins/tags');\nconst MixinExternalDocs = require('../mixins/external-docs');\nconst MixinBindings = require('../mixins/bindings');\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with the common properties Operation and OperationTrait object have.\n * @class\n * @alias module:@asyncapi/parser#OperationTraitable\n * @extends Base\n * @mixes MixinDescription\n * @mixes MixinTags\n * @mixes MixinExternalDocs\n * @mixes MixinBindings\n * @mixes MixinSpecificationExtensions\n * @returns {OperationTraitable}\n */\nclass OperationTraitable extends Base {\n /**\n * @returns {string}\n */\n id() {\n return this._json.operationId;\n }\n \n /**\n * @returns {string}\n */\n summary() {\n return this._json.summary;\n }\n}\n\nmodule.exports = mix(OperationTraitable, MixinDescription, MixinTags, MixinExternalDocs, MixinBindings, MixinSpecificationExtensions);\n","const OperationTraitable = require('./operation-traitable');\nconst Message = require('./message');\n\n/**\n * Implements functions to deal with an Operation object.\n * @class\n * @alias module:@asyncapi/parser#Operation\n * @extends OperationTraitable\n * @returns {Operation}\n */\nclass Operation extends OperationTraitable {\n /**\n * @returns {boolean}\n */\n hasMultipleMessages() {\n if (this._json.message && this._json.message.oneOf && this._json.message.oneOf.length > 1) return true;\n if (!this._json.message) return false;\n return false;\n }\n \n /**\n * @returns {Message[]}\n */\n messages() {\n if (!this._json.message) return [];\n if (this._json.message.oneOf) return this._json.message.oneOf.map(m => new Message(m));\n return [new Message(this._json.message)];\n }\n \n /**\n * @returns {Message}\n */\n message(index) {\n if (!this._json.message) return null;\n if (!this._json.message.oneOf) return new Message(this._json.message);\n if (typeof index !== 'number') return null;\n if (index > this._json.message.oneOf.length - 1) return null;\n return new Message(this._json.message.oneOf[+index]);\n }\n}\n\nmodule.exports = Operation;\n","const Operation = require('./operation');\n\n/**\n * Implements functions to deal with a PublishOperation object.\n * @class\n * @alias module:@asyncapi/parser#PublishOperation\n * @extends Operation\n * @returns {PublishOperation}\n */\nclass PublishOperation extends Operation {\n /**\n * @returns {boolean}\n */\n isPublish() {\n return true;\n }\n \n /**\n * @returns {boolean}\n */\n isSubscribe() {\n return false;\n }\n\n /**\n * @returns {string}\n */\n kind() {\n return 'publish';\n }\n}\n\nmodule.exports = PublishOperation;\n","const { createMapOfType, getMapValueOfType, mix } = require('./utils');\n\nconst Base = require('./base');\n\nconst MixinDescription = require('../mixins/description');\nconst MixinExternalDocs = require('../mixins/external-docs');\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with a Schema object.\n * @class\n * @alias module:@asyncapi/parser#Schema\n * @extends Base\n * @mixes MixinDescription\n * @mixes MixinExternalDocs\n * @mixes MixinSpecificationExtensions\n * @returns {Schema}\n */\nclass Schema extends Base {\n /**\n * @returns {string}\n */\n uid() {\n return this.$id() || this.ext('x-parser-schema-id');\n }\n \n /**\n * @returns {string}\n */\n $id() {\n return this._json.$id;\n }\n \n /**\n * @returns {number}\n */\n multipleOf() {\n return this._json.multipleOf;\n }\n \n /**\n * @returns {number}\n */\n maximum() {\n return this._json.maximum;\n }\n \n /**\n * @returns {number}\n */\n exclusiveMaximum() {\n return this._json.exclusiveMaximum;\n }\n \n /**\n * @returns {number}\n */\n minimum() {\n return this._json.minimum;\n }\n \n /**\n * @returns {number}\n */\n exclusiveMinimum() {\n return this._json.exclusiveMinimum;\n }\n \n /**\n * @returns {number}\n */\n maxLength() {\n return this._json.maxLength;\n }\n \n /**\n * @returns {number}\n */\n minLength() {\n return this._json.minLength;\n }\n \n /**\n * @returns {string}\n */\n pattern() {\n return this._json.pattern;\n }\n \n /**\n * @returns {number}\n */\n maxItems() {\n return this._json.maxItems;\n }\n \n /**\n * @returns {number}\n */\n minItems() {\n return this._json.minItems;\n }\n \n /**\n * @returns {boolean}\n */\n uniqueItems() {\n return !!this._json.uniqueItems;\n }\n \n /**\n * @returns {number}\n */\n maxProperties() {\n return this._json.maxProperties;\n }\n \n /**\n * @returns {number}\n */\n minProperties() {\n return this._json.minProperties;\n }\n \n /**\n * @returns {string[]}\n */\n required() {\n return this._json.required;\n }\n \n /**\n * @returns {any[]}\n */\n enum() {\n return this._json.enum;\n }\n \n /**\n * @returns {string|string[]}\n */\n type() {\n return this._json.type;\n }\n \n /**\n * @returns {Schema[]}\n */\n allOf() {\n if (!this._json.allOf) return null;\n return this._json.allOf.map(s => new Schema(s));\n }\n \n /**\n * @returns {Schema[]}\n */\n oneOf() {\n if (!this._json.oneOf) return null;\n return this._json.oneOf.map(s => new Schema(s));\n }\n \n /**\n * @returns {Schema[]}\n */\n anyOf() {\n if (!this._json.anyOf) return null;\n return this._json.anyOf.map(s => new Schema(s));\n }\n \n /**\n * @returns {Schema}\n */\n not() {\n if (!this._json.not) return null;\n return new Schema(this._json.not);\n }\n \n /**\n * @returns {Schema|Schema[]}\n */\n items() {\n if (!this._json.items) return null;\n if (Array.isArray(this._json.items)) {\n return this._json.items.map(s => new Schema(s));\n }\n return new Schema(this._json.items);\n }\n \n /**\n * @returns {Object}\n */\n properties() {\n return createMapOfType(this._json.properties, Schema);\n }\n\n /**\n * @param {string} name - Name of the property.\n * @returns {Schema}\n */\n property(name) {\n return getMapValueOfType(this._json.properties, name, Schema);\n }\n \n /**\n * @returns {boolean|Schema}\n */\n additionalProperties() {\n const ap = this._json.additionalProperties;\n if (ap === undefined || ap === null) return;\n if (typeof ap === 'boolean') return ap;\n return new Schema(ap);\n }\n \n /**\n * @returns {Schema}\n */\n additionalItems() {\n const ai = this._json.additionalItems;\n if (ai === undefined || ai === null) return;\n return new Schema(ai);\n }\n \n /**\n * @returns {Object}\n */\n patternProperties() {\n return createMapOfType(this._json.patternProperties, Schema);\n }\n\n /**\n * @returns {any}\n */\n const() {\n return this._json.const;\n }\n\n /**\n * @returns {Schema}\n */\n contains() {\n if (!this._json.contains) return null;\n return new Schema(this._json.contains);\n }\n\n /**\n * @returns {Object}\n */\n dependencies() {\n if (!this._json.dependencies) return null;\n const result = {};\n Object.entries(this._json.dependencies).forEach(([key, value]) => {\n result[String(key)] = !Array.isArray(value) ? new Schema(value) : value;\n });\n return result;\n }\n\n /**\n * @returns {Schema}\n */\n propertyNames() {\n if (!this._json.propertyNames) return null;\n return new Schema(this._json.propertyNames);\n }\n\n /**\n * @returns {Schema}\n */\n if() {\n if (!this._json.if) return null;\n return new Schema(this._json.if);\n }\n\n /**\n * @returns {Schema}\n */\n then() {\n if (!this._json.then) return null;\n return new Schema(this._json.then);\n }\n\n /**\n * @returns {Schema}\n */\n else() {\n if (!this._json.else) return null;\n return new Schema(this._json.else);\n }\n\n /**\n * @returns {string}\n */\n format() {\n return this._json.format;\n }\n\n /**\n * @returns {string}\n */\n contentEncoding() {\n return this._json.contentEncoding;\n }\n\n /**\n * @returns {string}\n */\n contentMediaType() {\n return this._json.contentMediaType;\n }\n\n /**\n * @returns {Object}\n */\n definitions() {\n return createMapOfType(this._json.definitions, Schema);\n }\n\n /**\n * @returns {string}\n */\n title() {\n return this._json.title;\n }\n\n /**\n * @returns {any}\n */\n default() {\n return this._json.default;\n }\n\n /**\n * @returns {boolean}\n */\n deprecated() {\n return this._json.deprecated;\n }\n\n /**\n * @returns {string}\n */\n discriminator() {\n return this._json.discriminator;\n }\n /**\n * @returns {boolean}\n */\n readOnly() {\n return !!this._json.readOnly;\n }\n\n /**\n * @returns {boolean}\n */\n writeOnly() {\n return !!this._json.writeOnly;\n }\n\n /**\n * @returns {any[]}\n */\n examples() {\n return this._json.examples;\n }\n\n /**\n * @returns {boolean}\n */\n isBooleanSchema() {\n return typeof this._json === 'boolean';\n }\n\n /**\n * @returns {boolean}\n */\n isCircular() {\n return !!this.ext('x-parser-circular');\n }\n\n /**\n * @returns {boolean}\n */\n hasCircularProps() {\n return !!this.ext('x-parser-circular-props');\n }\n\n /**\n * @returns {string[]}\n */\n circularProps() {\n return this.ext('x-parser-circular-props');\n }\n}\n\nmodule.exports = mix(Schema, MixinDescription, MixinExternalDocs, MixinSpecificationExtensions);\n","const { createMapOfType, mix } = require('./utils');\n\nconst Base = require('./base');\nconst OAuthFlow = require('./oauth-flow');\n\nconst MixinDescription = require('../mixins/description');\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with a SecurityScheme object.\n * @class\n * @alias module:@asyncapi/parser#SecurityScheme\n * @extends Base\n * @mixes MixinDescription\n * @mixes MixinSpecificationExtensions\n * @returns {SecurityScheme}\n */\nclass SecurityScheme extends Base {\n /**\n * @returns {string}\n */\n type() {\n return this._json.type;\n }\n \n /**\n * @returns {string}\n */\n name() {\n return this._json.name;\n }\n \n /**\n * @returns {string}\n */\n in() {\n return this._json.in;\n }\n \n /**\n * @returns {string}\n */\n scheme() {\n return this._json.scheme;\n }\n \n /**\n * @returns {string}\n */\n bearerFormat() {\n return this._json.bearerFormat;\n }\n \n /**\n * @returns {string}\n */\n openIdConnectUrl() {\n return this._json.openIdConnectUrl;\n }\n \n /**\n * @returns {Object}\n */\n flows() {\n return createMapOfType(this._json.flows, OAuthFlow);\n }\n}\n\nmodule.exports = mix(SecurityScheme, MixinDescription, MixinSpecificationExtensions);\n","const Base = require('./base');\n\n/**\n * Implements functions to deal with a ServerSecurityRequirement object.\n * @class\n * @alias module:@asyncapi/parser#ServerSecurityRequirement\n * @extends Base\n * @returns {ServerSecurityRequirement}\n */\nclass ServerSecurityRequirement extends Base {\n}\n\nmodule.exports = ServerSecurityRequirement;\n","const { mix } = require('./utils');\n\nconst Base = require('./base');\n\nconst MixinDescription = require('../mixins/description');\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with a ServerVariable object.\n * @class\n * @alias module:@asyncapi/parser#ServerVariable\n * @extends Base\n * @mixes MixinDescription\n * @mixes MixinSpecificationExtensions\n * @returns {ServerVariable}\n */\nclass ServerVariable extends Base {\n /**\n * @returns {any[]}\n */\n allowedValues() {\n return this._json.enum;\n }\n\n /**\n * @param {string} name - Name of the variable.\n * @returns {boolean}\n */\n allows(name) {\n if (this._json.enum === undefined) return true;\n return this._json.enum.includes(name);\n }\n\n /**\n * @returns {boolean}\n */\n hasAllowedValues() {\n return this._json.enum !== undefined;\n }\n\n /**\n * @returns {string}\n */\n defaultValue() {\n return this._json.default;\n }\n\n /**\n * @returns {boolean}\n */\n hasDefaultValue() {\n return this._json.default !== undefined;\n }\n\n /**\n * @returns {string[]}\n */\n examples() {\n return this._json.examples;\n }\n}\n\nmodule.exports = mix(ServerVariable, MixinDescription, MixinSpecificationExtensions);\n","const { createMapOfType, getMapValueOfType, mix } = require('./utils');\n\nconst Base = require('./base');\nconst ServerVariable = require('./server-variable');\nconst ServerSecurityRequirement = require('./server-security-requirement');\n\nconst MixinDescription = require('../mixins/description');\nconst MixinBindings = require('../mixins/bindings');\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with a Server object.\n * @class\n * @alias module:@asyncapi/parser#Server\n * @extends Base\n * @mixes MixinDescription\n * @mixes MixinBindings\n * @mixes MixinSpecificationExtensions\n * @returns {Server}\n */\nclass Server extends Base {\n /**\n * @returns {string}\n */\n url() {\n return this._json.url;\n }\n\n /**\n * @returns {string}\n */\n protocol() {\n return this._json.protocol;\n }\n\n /**\n * @returns {string}\n */\n protocolVersion() {\n return this._json.protocolVersion;\n }\n\n /**\n * @returns {Object}\n */\n variables() {\n return createMapOfType(this._json.variables, ServerVariable);\n }\n\n /**\n * @param {string} name - Name of the server variable.\n * @returns {ServerVariable}\n */\n variable(name) {\n return getMapValueOfType(this._json.variables, name, ServerVariable);\n }\n\n /**\n * @returns {boolean}\n */\n hasVariables() {\n return !!this._json.variables;\n }\n\n /**\n * @returns {ServerSecurityRequirement[]}\n */\n security() {\n if (!this._json.security) return null;\n return this._json.security.map(sec => new ServerSecurityRequirement(sec));\n }\n}\n\nmodule.exports = mix(Server, MixinDescription, MixinBindings, MixinSpecificationExtensions);\n","const Operation = require('./operation');\n\n/**\n * Implements functions to deal with a SubscribeOperation object.\n * @class\n * @alias module:@asyncapi/parser#SubscribeOperation\n * @extends Operation\n * @returns {SubscribeOperation}\n */\nclass SubscribeOperation extends Operation {\n /**\n * @returns {boolean}\n */\n isPublish() {\n return false;\n }\n \n /**\n * @returns {boolean}\n */\n isSubscribe() {\n return true;\n }\n\n /**\n * @returns {string}\n */\n kind() {\n return 'subscribe';\n }\n}\n\nmodule.exports = SubscribeOperation;\n","const { mix } = require('./utils');\n\nconst Base = require('./base');\n\nconst MixinDescription = require('../mixins/description');\nconst MixinExternalDocs = require('../mixins/external-docs');\nconst MixinSpecificationExtensions = require('../mixins/specification-extensions');\n\n/**\n * Implements functions to deal with a Tag object.\n * @class\n * @alias module:@asyncapi/parser#Tag\n * @extends Base\n * @mixes MixinDescription\n * @mixes MixinExternalDocs\n * @mixes MixinSpecificationExtensions\n * @returns {Tag}\n */\nclass Tag extends Base {\n /**\n * @returns {string}\n */\n name() {\n return this._json.name;\n }\n}\n\nmodule.exports = mix(Tag, MixinDescription, MixinExternalDocs, MixinSpecificationExtensions);\n","const utils = module.exports;\n\nconst getMapValue = (obj, key, Type) => {\n if (typeof key !== 'string' || !obj) return null;\n const v = obj[String(key)];\n if (v === undefined) return null;\n return Type ? new Type(v) : v;\n};\n\n/**\n * Creates map of given type from object.\n * @private\n * @param {Object} obj\n * @param {Any} Type\n */\nutils.createMapOfType = (obj, Type) => {\n const result = {};\n if (!obj) return result;\n\n Object.entries(obj).forEach(([key, value]) => {\n result[String(key)] = new Type(value);\n });\n\n return result;\n};\n\n/**\n * Creates given type from value retrieved from object by key.\n * @private\n * @param {Object} obj\n * @param {string} key\n * @param {Any} Type\n */\nutils.getMapValueOfType = (obj, key, Type) => {\n return getMapValue(obj, key, Type);\n};\n\n/**\n * Retrieves value from object by key.\n * @private\n * @param {Object} obj\n * @param {string} key\n */\nutils.getMapValueByKey = (obj, key) => {\n return getMapValue(obj, key);\n};\n\n/**\n * Extends a given model with additional methods related to frequently recurring models.\n * @function mix\n * @private\n * @param {Object} model model to extend\n * @param {Array} mixins array with mixins to extend the model with\n */\nutils.mix = (model, ...mixins) => {\n let duplicatedMethods = false;\n function checkDuplication(mixin) {\n // check duplication of model in mixins array\n if (model === mixin) return true;\n // check duplication of model's methods\n duplicatedMethods = Object.keys(mixin).some(mixinMethod => model.prototype.hasOwnProperty(mixinMethod));\n return duplicatedMethods;\n }\n \n if (mixins.some(checkDuplication)) {\n if (duplicatedMethods) {\n throw new Error(`invalid mix function: model ${model.name} has at least one method that it is trying to replace by mixin`);\n } else {\n throw new Error(`invalid mix function: cannot use the model ${model.name} as a mixin`);\n }\n }\n mixins.forEach(mixin => Object.assign(model.prototype, mixin));\n return model;\n};\n","const path = require('path');\nconst Ajv = require('ajv');\nconst fetch = require('node-fetch');\nconst asyncapi = require('@asyncapi/specs');\nconst $RefParser = require('@apidevtools/json-schema-ref-parser');\nconst mergePatch = require('tiny-merge-patch').apply;\nconst ParserError = require('./errors/parser-error');\nconst { validateChannels, validateServerVariables, validateOperationId, validateServerSecurity } = require('./customValidators.js');\nconst { toJS, findRefs, getLocationOf, improveAjvErrors } = require('./utils');\nconst AsyncAPIDocument = require('./models/asyncapi');\n\nconst DEFAULT_SCHEMA_FORMAT = 'application/vnd.aai.asyncapi;version=2.0.0';\nconst OPERATIONS = ['publish', 'subscribe'];\n//the only security types that can have a non empty array in the server security item\nconst SPECIAL_SECURITY_TYPES = ['oauth2', 'openIdConnect'];\nconst PARSERS = {};\nconst xParserCircle = 'x-parser-circular';\nconst xParserMessageParsed = 'x-parser-message-parsed';\n\n/**\n * @module @asyncapi/parser\n */\nmodule.exports = {\n parse,\n parseFromUrl,\n registerSchemaParser,\n ParserError,\n AsyncAPIDocument,\n};\n\n/**\n * Parses and validate an AsyncAPI document from YAML or JSON.\n * \n * @param {(String | Object)} asyncapiYAMLorJSON An AsyncAPI document in JSON or YAML format.\n * @param {Object} [options] Configuration options.\n * @param {String} [options.path] Path to the AsyncAPI document. It will be used to resolve relative references. Defaults to current working dir.\n * @param {Object} [options.parse] Options object to pass to {@link https://apidevtools.org/json-schema-ref-parser/docs/options.html|json-schema-ref-parser}.\n * @param {Object} [options.resolve] Options object to pass to {@link https://apidevtools.org/json-schema-ref-parser/docs/options.html|json-schema-ref-parser}.\n * @param {Object} [options.applyTraits=true] Whether to resolve and apply traits or not.\n * @returns {Promise} The parsed AsyncAPI document.\n */\nasync function parse(asyncapiYAMLorJSON, options = {}) {\n let parsedJSON;\n let initialFormat;\n\n options.path = options.path || `${process.cwd()}${path.sep}`;\n\n try {\n ({ initialFormat, parsedJSON } = toJS(asyncapiYAMLorJSON));\n\n if (typeof parsedJSON !== 'object') {\n throw new ParserError({\n type: 'impossible-to-convert-to-json',\n title: 'Could not convert AsyncAPI to JSON.',\n detail: 'Most probably the AsyncAPI document contains invalid YAML or YAML features not supported in JSON.'\n });\n }\n \n if (!parsedJSON.asyncapi) {\n throw new ParserError({\n type: 'missing-asyncapi-field',\n title: 'The `asyncapi` field is missing.',\n parsedJSON,\n });\n }\n \n if (parsedJSON.asyncapi.startsWith('1.') || !asyncapi[parsedJSON.asyncapi]) {\n throw new ParserError({\n type: 'unsupported-version',\n title: `Version ${parsedJSON.asyncapi} is not supported.`,\n detail: 'Please use latest version of the specification.',\n parsedJSON,\n validationErrors: [getLocationOf('/asyncapi', asyncapiYAMLorJSON, initialFormat)],\n });\n }\n\n if (options.applyTraits === undefined) options.applyTraits = true;\n\n const refParser = new $RefParser;\n //because of Ajv lacks support for circular refs, parser should not resolve them before Ajv validation and first needs to ignore them and leave circular $refs to successfully validate the document\n //this is done pair to advice from Ajv creator https://github.com/ajv-validator/ajv/issues/1122#issuecomment-559378449\n //later we perform full dereference of circular refs if they occure\n await dereference(refParser, parsedJSON, initialFormat, asyncapiYAMLorJSON, { ...options, dereference: { circular: 'ignore' } });\n\n const ajv = new Ajv({\n jsonPointers: true,\n allErrors: true,\n schemaId: 'id',\n logger: false,\n });\n \n ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json'));\n \n const validate = ajv.compile(asyncapi[parsedJSON.asyncapi]);\n const valid = validate(parsedJSON);\n if (!valid) throw new ParserError({\n type: 'validation-errors',\n title: 'There were errors validating the AsyncAPI document.',\n parsedJSON,\n validationErrors: improveAjvErrors(validate.errors, asyncapiYAMLorJSON, initialFormat),\n });\n\n await customDocumentOperations(parsedJSON, asyncapiYAMLorJSON, initialFormat, options);\n if (refParser.$refs.circular) await handleCircularRefs(refParser, parsedJSON, initialFormat, asyncapiYAMLorJSON, options);\n } catch (e) {\n if (e instanceof ParserError) throw e;\n throw new ParserError({\n type: 'unexpected-error',\n title: e.message,\n parsedJSON,\n });\n }\n\n return new AsyncAPIDocument(parsedJSON);\n}\n\n/**\n * Fetches an AsyncAPI document from the given URL and passes its content to the `parse` method.\n * \n * @param {String} url URL where the AsyncAPI document is located.\n * @param {Object} [fetchOptions] Configuration to pass to the {@link https://developer.mozilla.org/en-US/docs/Web/API/Request|fetch} call.\n * @param {Object} [options] Configuration to pass to the {@link module:Parser#parse} method.\n * @returns {Promise} The parsed AsyncAPI document.\n */\nfunction parseFromUrl(url, fetchOptions, options) {\n //Why not just addinga default to the arguments list?\n //All function parameters with default values should be declared after the function parameters without default values. Otherwise, it makes it impossible for callers to take advantage of defaults; they must re-specify the defaulted values or pass undefined in order to \"get to\" the non-default parameters.\n //To not break the API by changing argument position and to silet the linter it is just better to move adding\n if (!fetchOptions) fetchOptions = {};\n\n return new Promise((resolve, reject) => {\n fetch(url, fetchOptions)\n .then(res => res.text())\n .then(doc => parse(doc, options))\n .then(result => resolve(result))\n .catch(e => {\n if (e instanceof ParserError) return reject(e);\n return reject(new ParserError({\n type: 'fetch-url-error',\n title: e.message,\n }));\n });\n });\n}\n\nasync function dereference(refParser, parsedJSON, initialFormat, asyncapiYAMLorJSON, options) {\n try {\n return await refParser.dereference(options.path, parsedJSON, {\n continueOnError: true,\n parse: options.parse,\n resolve: options.resolve,\n dereference: options.dereference,\n });\n } catch (err) {\n throw new ParserError({\n type: 'dereference-error',\n title: err.errors[0].message,\n parsedJSON,\n refs: findRefs(err.errors, initialFormat, asyncapiYAMLorJSON),\n });\n }\n}\n\n/*\n * In case of circular refs, this function dereferences the spec again to dereference circular dependencies\n * Special property is added to the document that indicates it contains circular refs\n*/\nasync function handleCircularRefs(refParser, parsedJSON, initialFormat, asyncapiYAMLorJSON, options) {\n await dereference(refParser, parsedJSON, initialFormat, asyncapiYAMLorJSON, { ...options, dereference: { circular: true } });\n //mark entire document as containing circular references\n parsedJSON[String(xParserCircle)] = true;\n}\n\nasync function customDocumentOperations(parsedJSON, asyncapiYAMLorJSON, initialFormat, options) {\n validateServerVariables(parsedJSON, asyncapiYAMLorJSON, initialFormat);\n validateServerSecurity(parsedJSON, asyncapiYAMLorJSON, initialFormat, SPECIAL_SECURITY_TYPES);\n\n if (!parsedJSON.channels) return;\n\n validateChannels(parsedJSON, asyncapiYAMLorJSON, initialFormat);\n validateOperationId(parsedJSON, asyncapiYAMLorJSON, initialFormat, OPERATIONS);\n\n await customComponentsMsgOperations(parsedJSON, asyncapiYAMLorJSON, initialFormat, options);\n await customChannelsOperations(parsedJSON, asyncapiYAMLorJSON, initialFormat, options);\n}\n\nasync function validateAndConvertMessage(msg, originalAsyncAPIDocument, fileFormat, parsedAsyncAPIDocument, pathToPayload) {\n //check if the message has been parsed before\n if (xParserMessageParsed in msg && msg[String(xParserMessageParsed)] === true) return;\n\n const schemaFormat = msg.schemaFormat || DEFAULT_SCHEMA_FORMAT;\n\n await PARSERS[String(schemaFormat)]({\n schemaFormat,\n message: msg,\n defaultSchemaFormat: DEFAULT_SCHEMA_FORMAT,\n originalAsyncAPIDocument,\n parsedAsyncAPIDocument,\n fileFormat, \n pathToPayload\n });\n\n msg.schemaFormat = DEFAULT_SCHEMA_FORMAT;\n msg[String(xParserMessageParsed)] = true;\n}\n\n/**\n * Registers a new schema parser. Schema parsers are in charge of parsing and transforming payloads to AsyncAPI Schema format.\n * \n * @param {Object} parserModule The schema parser module containing parse() and getMimeTypes() functions.\n */\nfunction registerSchemaParser(parserModule) {\n if (typeof parserModule !== 'object' \n || typeof parserModule.parse !== 'function' \n || typeof parserModule.getMimeTypes !== 'function')\n throw new ParserError({\n type: 'impossible-to-register-parser',\n title: 'parserModule must have parse() and getMimeTypes() functions.'\n });\n\n parserModule.getMimeTypes().forEach((schemaFormat) => {\n PARSERS[String(schemaFormat)] = parserModule.parse;\n });\n}\n\nfunction applyTraits(js) {\n if (Array.isArray(js.traits)) {\n for (const trait of js.traits) {\n for (const key in trait) {\n js[String(key)] = mergePatch(js[String(key)], trait[String(key)]);\n }\n }\n\n js['x-parser-original-traits'] = js.traits;\n delete js.traits;\n }\n}\n\n/**\n * Triggers additional operations on the AsyncAPI channels like traits application or message validation and conversion\n *\n * @private\n * \n * @param {Object} parsedJSON parsed AsyncAPI document\n * @param {String} asyncapiYAMLorJSON AsyncAPI document in string\n * @param {String} initialFormat information of the document was originally JSON or YAML\n * @param {Object} options Configuration options.\n */\nasync function customChannelsOperations(parsedJSON, asyncapiYAMLorJSON, initialFormat, options) {\n const promisesArray = [];\n Object.entries(parsedJSON.channels).forEach(([channelName, channel]) => {\n promisesArray.push(...OPERATIONS.map(async (opName) => {\n const op = channel[String(opName)];\n if (!op) return;\n\n const messages = op.message ? (op.message.oneOf || [op.message]) : [];\n if (options.applyTraits) { \n applyTraits(op);\n messages.forEach(m => applyTraits(m));\n }\n const pathToPayload = `/channels/${channelName}/${opName}/message/payload`;\n for (const m of messages) {\n await validateAndConvertMessage(m, asyncapiYAMLorJSON, initialFormat, parsedJSON, pathToPayload);\n }\n }));\n });\n await Promise.all(promisesArray);\n}\n\n/**\n * Triggers additional operations on the AsyncAPI messages located in the components section of the document. It triggers operations like traits application, validation and conversion\n *\n * @private\n * \n * @param {Object} parsedJSON parsed AsyncAPI document\n * @param {String} asyncapiYAMLorJSON AsyncAPI document in string\n * @param {String} initialFormat information of the document was originally JSON or YAML\n * @param {Object} options Configuration options.\n */\nasync function customComponentsMsgOperations(parsedJSON, asyncapiYAMLorJSON, initialFormat, options) {\n if (!parsedJSON.components || !parsedJSON.components.messages) return;\n\n const promisesArray = [];\n\n Object.entries(parsedJSON.components.messages).forEach(([messageName, message]) => {\n if (options.applyTraits) {\n applyTraits(message);\n }\n const pathToPayload = `/components/messages/${messageName}/payload`;\n promisesArray.push(validateAndConvertMessage(message, asyncapiYAMLorJSON, initialFormat, parsedJSON, pathToPayload));\n });\n\n await Promise.all(promisesArray);\n}\n","const YAML = require('js-yaml');\nconst { yamlAST, loc } = require('@fmvilas/pseudo-yaml-ast');\nconst jsonAST = require('json-to-ast');\nconst jsonParseBetterErrors = require('../lib/json-parse');\nconst ParserError = require('./errors/parser-error');\n\nconst jsonPointerToArray = jsonPointer => (jsonPointer || '/').split('/').splice(1);\n\nconst utils = module.exports;\n\nconst getAST = (asyncapiYAMLorJSON, initialFormat) => {\n if (initialFormat === 'yaml') {\n return yamlAST(asyncapiYAMLorJSON);\n } else if (initialFormat === 'json') {\n return jsonAST(asyncapiYAMLorJSON);\n }\n};\n\nconst findNode = (obj, location) => {\n for (const key of location) {\n obj = obj ? obj[utils.untilde(key)] : null;\n }\n return obj;\n};\n\nconst findNodeInAST = (ast, location) => {\n let obj = ast;\n for (const key of location) {\n if (!Array.isArray(obj.children)) return;\n let childArray;\n\n const child = obj.children.find(c => { \n if (!c) return;\n\n if (c.type === 'Object') return childArray = c.children.find(a => a.key.value === utils.untilde(key));\n return c.type === 'Property' && c.key && c.key.value === utils.untilde(key);\n });\n\n if (!child) return;\n obj = childArray ? childArray.value : child.value;\n }\n return obj;\n};\n\nconst findLocationOf = (keys, ast, initialFormat) => {\n if (initialFormat === 'js') return { jsonPointer: `/${keys.join('/')}` };\n \n let node;\n if (initialFormat === 'yaml') {\n node = findNode(ast, keys);\n } else if (initialFormat === 'json') {\n node = findNodeInAST(ast, keys);\n }\n\n if (!node) return { jsonPointer: `/${keys.join('/')}` };\n\n let info;\n if (initialFormat === 'yaml') {\n // disable eslint because loc is a Symbol\n // eslint-disable-next-line security/detect-object-injection\n info = node[loc];\n } else if (initialFormat === 'json') {\n info = node.loc;\n }\n\n if (!info) return { jsonPointer: `/${keys.join('/')}` };\n\n return {\n jsonPointer: `/${keys.join('/')}`,\n startLine: info.start.line,\n startColumn: info.start.column + 1,\n startOffset: info.start.offset,\n endLine: info.end ? info.end.line : undefined,\n endColumn: info.end ? info.end.column + 1 : undefined,\n endOffset: info.end ? info.end.offset : undefined,\n };\n};\n\nutils.tilde = (str) => {\n return str.replace(/[~\\/]{1}/g, (m) => {\n switch (m) {\n case '/': return '~1';\n case '~': return '~0';\n }\n return m;\n });\n};\n\nutils.untilde = (str) => {\n if (!str.includes('~')) return str;\n return str.replace(/~[01]/g, (m) => {\n switch (m) {\n case '~1': return '/';\n case '~0': return '~';\n }\n return m;\n });\n};\n\nutils.toJS = (asyncapiYAMLorJSON) => {\n if (!asyncapiYAMLorJSON) {\n throw new ParserError({\n type: 'null-or-falsey-document',\n title: 'Document can\\'t be null or falsey.',\n });\n }\n\n if (asyncapiYAMLorJSON.constructor && asyncapiYAMLorJSON.constructor.name === 'Object') {\n return {\n initialFormat: 'js',\n parsedJSON: asyncapiYAMLorJSON,\n };\n }\n \n if (typeof asyncapiYAMLorJSON !== 'string') {\n throw new ParserError({\n type: 'invalid-document-type',\n title: 'The AsyncAPI document has to be either a string or a JS object.',\n });\n }\n if (asyncapiYAMLorJSON.trimLeft().startsWith('{')) {\n try {\n return {\n initialFormat: 'json',\n parsedJSON: jsonParseBetterErrors(asyncapiYAMLorJSON),\n };\n } catch (e) {\n throw new ParserError({\n type: 'invalid-json',\n title: 'The provided JSON is not valid.',\n detail: e.message,\n location: {\n startOffset: e.offset,\n startLine: e.startLine,\n startColumn: e.startColumn,\n },\n });\n }\n } else {\n try {\n return {\n initialFormat: 'yaml',\n parsedJSON: YAML.safeLoad(asyncapiYAMLorJSON),\n };\n } catch (err) {\n throw new ParserError({\n type: 'invalid-yaml',\n title: 'The provided YAML is not valid.',\n detail: err.message,\n location: {\n startOffset: err.mark.position,\n startLine: err.mark.line + 1,\n startColumn: err.mark.column + 1,\n },\n });\n }\n }\n};\n\nutils.findRefs = (errors, initialFormat, asyncapiYAMLorJSON) => {\n let refs = [];\n\n errors.map(({ path }) => refs.push({ location: [...path.map(utils.tilde), '$ref'] }));\n\n if (initialFormat === 'js') {\n return refs.map(ref => ({ jsonPointer: `/${ref.location.join('/')}` }));\n }\n\n if (initialFormat === 'yaml') {\n const pseudoAST = yamlAST(asyncapiYAMLorJSON);\n refs = refs.map(ref => findLocationOf(ref.location, pseudoAST, initialFormat));\n } else if (initialFormat === 'json') {\n const ast = jsonAST(asyncapiYAMLorJSON);\n refs = refs.map(ref => findLocationOf(ref.location, ast, initialFormat));\n }\n\n return refs;\n};\n\nutils.getLocationOf = (jsonPointer, asyncapiYAMLorJSON, initialFormat) => {\n const ast = getAST(asyncapiYAMLorJSON, initialFormat);\n if (!ast) return { jsonPointer };\n\n return findLocationOf(jsonPointerToArray(jsonPointer), ast, initialFormat);\n};\n\nutils.improveAjvErrors = (errors, asyncapiYAMLorJSON, initialFormat) => {\n const ast = getAST(asyncapiYAMLorJSON, initialFormat);\n return errors.map(error => {\n const defaultLocation = { jsonPointer: error.dataPath || '/' };\n const additionalProperty = error.params.additionalProperty;\n const jsonPointer = additionalProperty ? `${error.dataPath}/${additionalProperty}`: error.dataPath;\n return {\n title: `${error.dataPath || '/'} ${error.message}`,\n location: ast ? findLocationOf(jsonPointerToArray(jsonPointer), ast, initialFormat) : defaultLocation,\n };\n });\n};\n\n/**\n * It parses the string and returns an array with all values that are between curly braces, including braces\n * @function parseUrlVariables\n * @private\n */\nutils.parseUrlVariables = str => {\n if (typeof str !== 'string') return;\n\n return str.match(/{(.+?)}/g); \n};\n\n/**\n * It parses the string and returns url parameters as string\n * @function parseUrlQueryParameters\n * @private\n */\nutils.parseUrlQueryParameters = str => {\n if (typeof str !== 'string') return;\n \n return str.match(/\\?((.*=.*)(&?))/g); \n};\n\n/**\n * Returns an array of not existing properties in provided object with names specified in provided array\n * @function getMissingProps\n * @private\n */\nutils.getMissingProps = (arr, obj) => {\n arr = arr.map(val => val.replace(/[{}]/g, ''));\n\n if (!obj) return arr;\n \n return arr.filter(val => {\n return !obj.hasOwnProperty(val);\n });\n};\n\n/**\n * Returns array of errors messages compatible with validationErrors parameter from ParserError\n *\n * @function groupValidationErrors\n * @private\n * @param {String} root name of the root element in the AsyncAPI document, for example channels\n * @param {String} errorMessage the text of the custom error message that will follow the path that points the error\n * @param {Map} errorElements map of error elements cause the validation error might happen in many places in the document. \n * The key should have a path information where the error was found, the value holds information about error element but it is not mandatory\n * @param {String} asyncapiYAMLorJSON AsyncAPI document in string\n * @param {String} initialFormat information of the document was oryginally JSON or YAML\n * @returns {Array} Object has always 2 keys, title and location. Title is a combination of errorElement key + errorMessage + errorElement value. \n * Location is the object with information about location of the issue in the file and json Pointer\n */\nutils.groupValidationErrors = (root, errorMessage, errorElements, asyncapiYAMLorJSON, initialFormat) => {\n const errors = [];\n\n errorElements.forEach((val, key) => {\n if (typeof val === 'string') val = utils.untilde(val);\n\n errors.push({\n title: val ? `${ utils.untilde(key) } ${errorMessage}: ${val}` : `${ utils.untilde(key) } ${errorMessage}`,\n location: utils.getLocationOf(`/${root}/${key}`, asyncapiYAMLorJSON, initialFormat)\n });\n });\n\n return errors;\n};\n\n/**\n * extend map with channel params missing corresponding param object\n *\n * @function setNotProvidedParams\n * @private\n * @param {Array} variables array of all identified URL variables in a channel name\n * @param {Object} val the channel object for which to identify the missing parameters\n * @param {String} key the channel name. \n * @param {Array} notProvidedChannelParams concatinated list of missing parameters for all channels\n * @param {Map} notProvidedParams result map of all missing parameters extended by this function\n */\nutils.setNotProvidedParams = (variables, val, key, notProvidedChannelParams, notProvidedParams) => {\n const missingChannelParams = utils.getMissingProps(variables, val.parameters);\n\n if (missingChannelParams.length) {\n notProvidedParams.set(utils.tilde(key),\n notProvidedChannelParams\n ? notProvidedChannelParams.concat(missingChannelParams)\n : missingChannelParams);\n }\n};\n","const yaml = require('js-yaml');\nconst r2j = require('ramldt2jsonschema');\n\nmodule.exports = {\n parse,\n getMimeTypes\n};\n\nasync function parse({ message, defaultSchemaFormat }) {\n try {\n let payload = message.payload;\n if (typeof payload === 'object') {\n payload = `#%RAML 1.0 Library\\n${ \n yaml.safeDump({ types: { tmpType: payload } })}`;\n }\n\n // Draft 6 is compatible with 7.\n const jsonModel = await r2j.dt2js(payload, 'tmpType', { draft: '06' });\n const convertedType = jsonModel.definitions.tmpType;\n\n message['x-parser-original-schema-format'] = message.schemaFormat || defaultSchemaFormat;\n message['x-parser-original-payload'] = payload;\n message.payload = convertedType;\n delete message.schemaFormat;\n } catch (e) {\n console.error(e);\n }\n}\n\nfunction getMimeTypes() {\n return [\n 'application/raml+yaml;version=1.0',\n ];\n}\n\n","module.exports = {\n '1.0.0': require('./schemas/1.0.0.json'),\n '1.1.0': require('./schemas/1.1.0.json'),\n '1.2.0': require('./schemas/1.2.0.json'),\n '2.0.0-rc1': require('./schemas/2.0.0-rc1.json'),\n '2.0.0-rc2': require('./schemas/2.0.0-rc2.json'),\n '2.0.0': require('./schemas/2.0.0.json'),\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.makeWeakCache = makeWeakCache;\nexports.makeWeakCacheSync = makeWeakCacheSync;\nexports.makeStrongCache = makeStrongCache;\nexports.makeStrongCacheSync = makeStrongCacheSync;\nexports.assertSimpleType = assertSimpleType;\n\nfunction _gensync() {\n const data = _interopRequireDefault(require(\"gensync\"));\n\n _gensync = function () {\n return data;\n };\n\n return data;\n}\n\nvar _async = require(\"../gensync-utils/async\");\n\nvar _util = require(\"./util\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst synchronize = gen => {\n return (0, _gensync().default)(gen).sync;\n};\n\nfunction* genTrue(data) {\n return true;\n}\n\nfunction makeWeakCache(handler) {\n return makeCachedFunction(WeakMap, handler);\n}\n\nfunction makeWeakCacheSync(handler) {\n return synchronize(makeWeakCache(handler));\n}\n\nfunction makeStrongCache(handler) {\n return makeCachedFunction(Map, handler);\n}\n\nfunction makeStrongCacheSync(handler) {\n return synchronize(makeStrongCache(handler));\n}\n\nfunction makeCachedFunction(CallCache, handler) {\n const callCacheSync = new CallCache();\n const callCacheAsync = new CallCache();\n const futureCache = new CallCache();\n return function* cachedFunction(arg, data) {\n const asyncContext = yield* (0, _async.isAsync)();\n const callCache = asyncContext ? callCacheAsync : callCacheSync;\n const cached = yield* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data);\n if (cached.valid) return cached.value;\n const cache = new CacheConfigurator(data);\n const handlerResult = handler(arg, cache);\n let finishLock;\n let value;\n\n if ((0, _util.isIterableIterator)(handlerResult)) {\n const gen = handlerResult;\n value = yield* (0, _async.onFirstPause)(gen, () => {\n finishLock = setupAsyncLocks(cache, futureCache, arg);\n });\n } else {\n value = handlerResult;\n }\n\n updateFunctionCache(callCache, cache, arg, value);\n\n if (finishLock) {\n futureCache.delete(arg);\n finishLock.release(value);\n }\n\n return value;\n };\n}\n\nfunction* getCachedValue(cache, arg, data) {\n const cachedValue = cache.get(arg);\n\n if (cachedValue) {\n for (const {\n value,\n valid\n } of cachedValue) {\n if (yield* valid(data)) return {\n valid: true,\n value\n };\n }\n }\n\n return {\n valid: false,\n value: null\n };\n}\n\nfunction* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data) {\n const cached = yield* getCachedValue(callCache, arg, data);\n\n if (cached.valid) {\n return cached;\n }\n\n if (asyncContext) {\n const cached = yield* getCachedValue(futureCache, arg, data);\n\n if (cached.valid) {\n const value = yield* (0, _async.waitFor)(cached.value.promise);\n return {\n valid: true,\n value\n };\n }\n }\n\n return {\n valid: false,\n value: null\n };\n}\n\nfunction setupAsyncLocks(config, futureCache, arg) {\n const finishLock = new Lock();\n updateFunctionCache(futureCache, config, arg, finishLock);\n return finishLock;\n}\n\nfunction updateFunctionCache(cache, config, arg, value) {\n if (!config.configured()) config.forever();\n let cachedValue = cache.get(arg);\n config.deactivate();\n\n switch (config.mode()) {\n case \"forever\":\n cachedValue = [{\n value,\n valid: genTrue\n }];\n cache.set(arg, cachedValue);\n break;\n\n case \"invalidate\":\n cachedValue = [{\n value,\n valid: config.validator()\n }];\n cache.set(arg, cachedValue);\n break;\n\n case \"valid\":\n if (cachedValue) {\n cachedValue.push({\n value,\n valid: config.validator()\n });\n } else {\n cachedValue = [{\n value,\n valid: config.validator()\n }];\n cache.set(arg, cachedValue);\n }\n\n }\n}\n\nclass CacheConfigurator {\n constructor(data) {\n this._active = true;\n this._never = false;\n this._forever = false;\n this._invalidate = false;\n this._configured = false;\n this._pairs = [];\n this._data = void 0;\n this._data = data;\n }\n\n simple() {\n return makeSimpleConfigurator(this);\n }\n\n mode() {\n if (this._never) return \"never\";\n if (this._forever) return \"forever\";\n if (this._invalidate) return \"invalidate\";\n return \"valid\";\n }\n\n forever() {\n if (!this._active) {\n throw new Error(\"Cannot change caching after evaluation has completed.\");\n }\n\n if (this._never) {\n throw new Error(\"Caching has already been configured with .never()\");\n }\n\n this._forever = true;\n this._configured = true;\n }\n\n never() {\n if (!this._active) {\n throw new Error(\"Cannot change caching after evaluation has completed.\");\n }\n\n if (this._forever) {\n throw new Error(\"Caching has already been configured with .forever()\");\n }\n\n this._never = true;\n this._configured = true;\n }\n\n using(handler) {\n if (!this._active) {\n throw new Error(\"Cannot change caching after evaluation has completed.\");\n }\n\n if (this._never || this._forever) {\n throw new Error(\"Caching has already been configured with .never or .forever()\");\n }\n\n this._configured = true;\n const key = handler(this._data);\n const fn = (0, _async.maybeAsync)(handler, `You appear to be using an async cache handler, but Babel has been called synchronously`);\n\n if ((0, _async.isThenable)(key)) {\n return key.then(key => {\n this._pairs.push([key, fn]);\n\n return key;\n });\n }\n\n this._pairs.push([key, fn]);\n\n return key;\n }\n\n invalidate(handler) {\n this._invalidate = true;\n return this.using(handler);\n }\n\n validator() {\n const pairs = this._pairs;\n return function* (data) {\n for (const [key, fn] of pairs) {\n if (key !== (yield* fn(data))) return false;\n }\n\n return true;\n };\n }\n\n deactivate() {\n this._active = false;\n }\n\n configured() {\n return this._configured;\n }\n\n}\n\nfunction makeSimpleConfigurator(cache) {\n function cacheFn(val) {\n if (typeof val === \"boolean\") {\n if (val) cache.forever();else cache.never();\n return;\n }\n\n return cache.using(() => assertSimpleType(val()));\n }\n\n cacheFn.forever = () => cache.forever();\n\n cacheFn.never = () => cache.never();\n\n cacheFn.using = cb => cache.using(() => assertSimpleType(cb()));\n\n cacheFn.invalidate = cb => cache.invalidate(() => assertSimpleType(cb()));\n\n return cacheFn;\n}\n\nfunction assertSimpleType(value) {\n if ((0, _async.isThenable)(value)) {\n throw new Error(`You appear to be using an async cache handler, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously handle your caching logic.`);\n }\n\n if (value != null && typeof value !== \"string\" && typeof value !== \"boolean\" && typeof value !== \"number\") {\n throw new Error(\"Cache keys must be either string, boolean, number, null, or undefined.\");\n }\n\n return value;\n}\n\nclass Lock {\n constructor() {\n this.released = false;\n this.promise = void 0;\n this._resolve = void 0;\n this.promise = new Promise(resolve => {\n this._resolve = resolve;\n });\n }\n\n release(value) {\n this.released = true;\n\n this._resolve(value);\n }\n\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.buildPresetChain = buildPresetChain;\nexports.buildRootChain = buildRootChain;\nexports.buildPresetChainWalker = void 0;\n\nfunction _path() {\n const data = _interopRequireDefault(require(\"path\"));\n\n _path = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _debug() {\n const data = _interopRequireDefault(require(\"debug\"));\n\n _debug = function () {\n return data;\n };\n\n return data;\n}\n\nvar _options = require(\"./validation/options\");\n\nvar _patternToRegex = _interopRequireDefault(require(\"./pattern-to-regex\"));\n\nvar _printer = require(\"./printer\");\n\nvar _files = require(\"./files\");\n\nvar _caching = require(\"./caching\");\n\nvar _configDescriptors = require(\"./config-descriptors\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst debug = (0, _debug().default)(\"babel:config:config-chain\");\n\nfunction* buildPresetChain(arg, context) {\n const chain = yield* buildPresetChainWalker(arg, context);\n if (!chain) return null;\n return {\n plugins: dedupDescriptors(chain.plugins),\n presets: dedupDescriptors(chain.presets),\n options: chain.options.map(o => normalizeOptions(o)),\n files: new Set()\n };\n}\n\nconst buildPresetChainWalker = makeChainWalker({\n root: preset => loadPresetDescriptors(preset),\n env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),\n overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),\n overridesEnv: (preset, index, envName) => loadPresetOverridesEnvDescriptors(preset)(index)(envName),\n createLogger: () => () => {}\n});\nexports.buildPresetChainWalker = buildPresetChainWalker;\nconst loadPresetDescriptors = (0, _caching.makeWeakCacheSync)(preset => buildRootDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors));\nconst loadPresetEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, envName)));\nconst loadPresetOverridesDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index)));\nconst loadPresetOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index, envName))));\n\nfunction* buildRootChain(opts, context) {\n let configReport, babelRcReport;\n const programmaticLogger = new _printer.ConfigPrinter();\n const programmaticChain = yield* loadProgrammaticChain({\n options: opts,\n dirname: context.cwd\n }, context, undefined, programmaticLogger);\n if (!programmaticChain) return null;\n const programmaticReport = programmaticLogger.output();\n let configFile;\n\n if (typeof opts.configFile === \"string\") {\n configFile = yield* (0, _files.loadConfig)(opts.configFile, context.cwd, context.envName, context.caller);\n } else if (opts.configFile !== false) {\n configFile = yield* (0, _files.findRootConfig)(context.root, context.envName, context.caller);\n }\n\n let {\n babelrc,\n babelrcRoots\n } = opts;\n let babelrcRootsDirectory = context.cwd;\n const configFileChain = emptyChain();\n const configFileLogger = new _printer.ConfigPrinter();\n\n if (configFile) {\n const validatedFile = validateConfigFile(configFile);\n const result = yield* loadFileChain(validatedFile, context, undefined, configFileLogger);\n if (!result) return null;\n configReport = configFileLogger.output();\n\n if (babelrc === undefined) {\n babelrc = validatedFile.options.babelrc;\n }\n\n if (babelrcRoots === undefined) {\n babelrcRootsDirectory = validatedFile.dirname;\n babelrcRoots = validatedFile.options.babelrcRoots;\n }\n\n mergeChain(configFileChain, result);\n }\n\n const pkgData = typeof context.filename === \"string\" ? yield* (0, _files.findPackageData)(context.filename) : null;\n let ignoreFile, babelrcFile;\n let isIgnored = false;\n const fileChain = emptyChain();\n\n if ((babelrc === true || babelrc === undefined) && pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)) {\n ({\n ignore: ignoreFile,\n config: babelrcFile\n } = yield* (0, _files.findRelativeConfig)(pkgData, context.envName, context.caller));\n\n if (ignoreFile) {\n fileChain.files.add(ignoreFile.filepath);\n }\n\n if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) {\n isIgnored = true;\n }\n\n if (babelrcFile && !isIgnored) {\n const validatedFile = validateBabelrcFile(babelrcFile);\n const babelrcLogger = new _printer.ConfigPrinter();\n const result = yield* loadFileChain(validatedFile, context, undefined, babelrcLogger);\n\n if (!result) {\n isIgnored = true;\n } else {\n babelRcReport = babelrcLogger.output();\n mergeChain(fileChain, result);\n }\n }\n\n if (babelrcFile && isIgnored) {\n fileChain.files.add(babelrcFile.filepath);\n }\n }\n\n if (context.showConfig) {\n console.log(`Babel configs on \"${context.filename}\" (ascending priority):\\n` + [configReport, babelRcReport, programmaticReport].filter(x => !!x).join(\"\\n\\n\"));\n return null;\n }\n\n const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain);\n return {\n plugins: isIgnored ? [] : dedupDescriptors(chain.plugins),\n presets: isIgnored ? [] : dedupDescriptors(chain.presets),\n options: isIgnored ? [] : chain.options.map(o => normalizeOptions(o)),\n fileHandling: isIgnored ? \"ignored\" : \"transpile\",\n ignore: ignoreFile || undefined,\n babelrc: babelrcFile || undefined,\n config: configFile || undefined,\n files: chain.files\n };\n}\n\nfunction babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory) {\n if (typeof babelrcRoots === \"boolean\") return babelrcRoots;\n const absoluteRoot = context.root;\n\n if (babelrcRoots === undefined) {\n return pkgData.directories.indexOf(absoluteRoot) !== -1;\n }\n\n let babelrcPatterns = babelrcRoots;\n if (!Array.isArray(babelrcPatterns)) babelrcPatterns = [babelrcPatterns];\n babelrcPatterns = babelrcPatterns.map(pat => {\n return typeof pat === \"string\" ? _path().default.resolve(babelrcRootsDirectory, pat) : pat;\n });\n\n if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) {\n return pkgData.directories.indexOf(absoluteRoot) !== -1;\n }\n\n return babelrcPatterns.some(pat => {\n if (typeof pat === \"string\") {\n pat = (0, _patternToRegex.default)(pat, babelrcRootsDirectory);\n }\n\n return pkgData.directories.some(directory => {\n return matchPattern(pat, babelrcRootsDirectory, directory, context);\n });\n });\n}\n\nconst validateConfigFile = (0, _caching.makeWeakCacheSync)(file => ({\n filepath: file.filepath,\n dirname: file.dirname,\n options: (0, _options.validate)(\"configfile\", file.options)\n}));\nconst validateBabelrcFile = (0, _caching.makeWeakCacheSync)(file => ({\n filepath: file.filepath,\n dirname: file.dirname,\n options: (0, _options.validate)(\"babelrcfile\", file.options)\n}));\nconst validateExtendFile = (0, _caching.makeWeakCacheSync)(file => ({\n filepath: file.filepath,\n dirname: file.dirname,\n options: (0, _options.validate)(\"extendsfile\", file.options)\n}));\nconst loadProgrammaticChain = makeChainWalker({\n root: input => buildRootDescriptors(input, \"base\", _configDescriptors.createCachedDescriptors),\n env: (input, envName) => buildEnvDescriptors(input, \"base\", _configDescriptors.createCachedDescriptors, envName),\n overrides: (input, index) => buildOverrideDescriptors(input, \"base\", _configDescriptors.createCachedDescriptors, index),\n overridesEnv: (input, index, envName) => buildOverrideEnvDescriptors(input, \"base\", _configDescriptors.createCachedDescriptors, index, envName),\n createLogger: (input, context, baseLogger) => buildProgrammaticLogger(input, context, baseLogger)\n});\nconst loadFileChainWalker = makeChainWalker({\n root: file => loadFileDescriptors(file),\n env: (file, envName) => loadFileEnvDescriptors(file)(envName),\n overrides: (file, index) => loadFileOverridesDescriptors(file)(index),\n overridesEnv: (file, index, envName) => loadFileOverridesEnvDescriptors(file)(index)(envName),\n createLogger: (file, context, baseLogger) => buildFileLogger(file.filepath, context, baseLogger)\n});\n\nfunction* loadFileChain(input, context, files, baseLogger) {\n const chain = yield* loadFileChainWalker(input, context, files, baseLogger);\n\n if (chain) {\n chain.files.add(input.filepath);\n }\n\n return chain;\n}\n\nconst loadFileDescriptors = (0, _caching.makeWeakCacheSync)(file => buildRootDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors));\nconst loadFileEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, envName)));\nconst loadFileOverridesDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index)));\nconst loadFileOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index, envName))));\n\nfunction buildFileLogger(filepath, context, baseLogger) {\n if (!baseLogger) {\n return () => {};\n }\n\n return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Config, {\n filepath\n });\n}\n\nfunction buildRootDescriptors({\n dirname,\n options\n}, alias, descriptors) {\n return descriptors(dirname, options, alias);\n}\n\nfunction buildProgrammaticLogger(_, context, baseLogger) {\n var _context$caller;\n\n if (!baseLogger) {\n return () => {};\n }\n\n return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Programmatic, {\n callerName: (_context$caller = context.caller) == null ? void 0 : _context$caller.name\n });\n}\n\nfunction buildEnvDescriptors({\n dirname,\n options\n}, alias, descriptors, envName) {\n const opts = options.env && options.env[envName];\n return opts ? descriptors(dirname, opts, `${alias}.env[\"${envName}\"]`) : null;\n}\n\nfunction buildOverrideDescriptors({\n dirname,\n options\n}, alias, descriptors, index) {\n const opts = options.overrides && options.overrides[index];\n if (!opts) throw new Error(\"Assertion failure - missing override\");\n return descriptors(dirname, opts, `${alias}.overrides[${index}]`);\n}\n\nfunction buildOverrideEnvDescriptors({\n dirname,\n options\n}, alias, descriptors, index, envName) {\n const override = options.overrides && options.overrides[index];\n if (!override) throw new Error(\"Assertion failure - missing override\");\n const opts = override.env && override.env[envName];\n return opts ? descriptors(dirname, opts, `${alias}.overrides[${index}].env[\"${envName}\"]`) : null;\n}\n\nfunction makeChainWalker({\n root,\n env,\n overrides,\n overridesEnv,\n createLogger\n}) {\n return function* (input, context, files = new Set(), baseLogger) {\n const {\n dirname\n } = input;\n const flattenedConfigs = [];\n const rootOpts = root(input);\n\n if (configIsApplicable(rootOpts, dirname, context)) {\n flattenedConfigs.push({\n config: rootOpts,\n envName: undefined,\n index: undefined\n });\n const envOpts = env(input, context.envName);\n\n if (envOpts && configIsApplicable(envOpts, dirname, context)) {\n flattenedConfigs.push({\n config: envOpts,\n envName: context.envName,\n index: undefined\n });\n }\n\n (rootOpts.options.overrides || []).forEach((_, index) => {\n const overrideOps = overrides(input, index);\n\n if (configIsApplicable(overrideOps, dirname, context)) {\n flattenedConfigs.push({\n config: overrideOps,\n index,\n envName: undefined\n });\n const overrideEnvOpts = overridesEnv(input, index, context.envName);\n\n if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context)) {\n flattenedConfigs.push({\n config: overrideEnvOpts,\n index,\n envName: context.envName\n });\n }\n }\n });\n }\n\n if (flattenedConfigs.some(({\n config: {\n options: {\n ignore,\n only\n }\n }\n }) => shouldIgnore(context, ignore, only, dirname))) {\n return null;\n }\n\n const chain = emptyChain();\n const logger = createLogger(input, context, baseLogger);\n\n for (const {\n config,\n index,\n envName\n } of flattenedConfigs) {\n if (!(yield* mergeExtendsChain(chain, config.options, dirname, context, files, baseLogger))) {\n return null;\n }\n\n logger(config, index, envName);\n mergeChainOpts(chain, config);\n }\n\n return chain;\n };\n}\n\nfunction* mergeExtendsChain(chain, opts, dirname, context, files, baseLogger) {\n if (opts.extends === undefined) return true;\n const file = yield* (0, _files.loadConfig)(opts.extends, dirname, context.envName, context.caller);\n\n if (files.has(file)) {\n throw new Error(`Configuration cycle detected loading ${file.filepath}.\\n` + `File already loaded following the config chain:\\n` + Array.from(files, file => ` - ${file.filepath}`).join(\"\\n\"));\n }\n\n files.add(file);\n const fileChain = yield* loadFileChain(validateExtendFile(file), context, files, baseLogger);\n files.delete(file);\n if (!fileChain) return false;\n mergeChain(chain, fileChain);\n return true;\n}\n\nfunction mergeChain(target, source) {\n target.options.push(...source.options);\n target.plugins.push(...source.plugins);\n target.presets.push(...source.presets);\n\n for (const file of source.files) {\n target.files.add(file);\n }\n\n return target;\n}\n\nfunction mergeChainOpts(target, {\n options,\n plugins,\n presets\n}) {\n target.options.push(options);\n target.plugins.push(...plugins());\n target.presets.push(...presets());\n return target;\n}\n\nfunction emptyChain() {\n return {\n options: [],\n presets: [],\n plugins: [],\n files: new Set()\n };\n}\n\nfunction normalizeOptions(opts) {\n const options = Object.assign({}, opts);\n delete options.extends;\n delete options.env;\n delete options.overrides;\n delete options.plugins;\n delete options.presets;\n delete options.passPerPreset;\n delete options.ignore;\n delete options.only;\n delete options.test;\n delete options.include;\n delete options.exclude;\n\n if (Object.prototype.hasOwnProperty.call(options, \"sourceMap\")) {\n options.sourceMaps = options.sourceMap;\n delete options.sourceMap;\n }\n\n return options;\n}\n\nfunction dedupDescriptors(items) {\n const map = new Map();\n const descriptors = [];\n\n for (const item of items) {\n if (typeof item.value === \"function\") {\n const fnKey = item.value;\n let nameMap = map.get(fnKey);\n\n if (!nameMap) {\n nameMap = new Map();\n map.set(fnKey, nameMap);\n }\n\n let desc = nameMap.get(item.name);\n\n if (!desc) {\n desc = {\n value: item\n };\n descriptors.push(desc);\n if (!item.ownPass) nameMap.set(item.name, desc);\n } else {\n desc.value = item;\n }\n } else {\n descriptors.push({\n value: item\n });\n }\n }\n\n return descriptors.reduce((acc, desc) => {\n acc.push(desc.value);\n return acc;\n }, []);\n}\n\nfunction configIsApplicable({\n options\n}, dirname, context) {\n return (options.test === undefined || configFieldIsApplicable(context, options.test, dirname)) && (options.include === undefined || configFieldIsApplicable(context, options.include, dirname)) && (options.exclude === undefined || !configFieldIsApplicable(context, options.exclude, dirname));\n}\n\nfunction configFieldIsApplicable(context, test, dirname) {\n const patterns = Array.isArray(test) ? test : [test];\n return matchesPatterns(context, patterns, dirname);\n}\n\nfunction shouldIgnore(context, ignore, only, dirname) {\n if (ignore && matchesPatterns(context, ignore, dirname)) {\n var _context$filename;\n\n const message = `No config is applied to \"${(_context$filename = context.filename) != null ? _context$filename : \"(unknown)\"}\" because it matches one of \\`ignore: ${JSON.stringify(ignore)}\\` from \"${dirname}\"`;\n debug(message);\n\n if (context.showConfig) {\n console.log(message);\n }\n\n return true;\n }\n\n if (only && !matchesPatterns(context, only, dirname)) {\n var _context$filename2;\n\n const message = `No config is applied to \"${(_context$filename2 = context.filename) != null ? _context$filename2 : \"(unknown)\"}\" because it fails to match one of \\`only: ${JSON.stringify(only)}\\` from \"${dirname}\"`;\n debug(message);\n\n if (context.showConfig) {\n console.log(message);\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction matchesPatterns(context, patterns, dirname) {\n return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context));\n}\n\nfunction matchPattern(pattern, dirname, pathToTest, context) {\n if (typeof pattern === \"function\") {\n return !!pattern(pathToTest, {\n dirname,\n envName: context.envName,\n caller: context.caller\n });\n }\n\n if (typeof pathToTest !== \"string\") {\n throw new Error(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`);\n }\n\n if (typeof pattern === \"string\") {\n pattern = (0, _patternToRegex.default)(pattern, dirname);\n }\n\n return pattern.test(pathToTest);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createCachedDescriptors = createCachedDescriptors;\nexports.createUncachedDescriptors = createUncachedDescriptors;\nexports.createDescriptor = createDescriptor;\n\nvar _files = require(\"./files\");\n\nvar _item = require(\"./item\");\n\nvar _caching = require(\"./caching\");\n\nfunction isEqualDescriptor(a, b) {\n return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && (a.file && a.file.request) === (b.file && b.file.request) && (a.file && a.file.resolved) === (b.file && b.file.resolved);\n}\n\nfunction createCachedDescriptors(dirname, options, alias) {\n const {\n plugins,\n presets,\n passPerPreset\n } = options;\n return {\n options,\n plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => [],\n presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => []\n };\n}\n\nfunction createUncachedDescriptors(dirname, options, alias) {\n let plugins;\n let presets;\n return {\n options,\n plugins: () => {\n if (!plugins) {\n plugins = createPluginDescriptors(options.plugins || [], dirname, alias);\n }\n\n return plugins;\n },\n presets: () => {\n if (!presets) {\n presets = createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset);\n }\n\n return presets;\n }\n };\n}\n\nconst PRESET_DESCRIPTOR_CACHE = new WeakMap();\nconst createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {\n const dirname = cache.using(dir => dir);\n return (0, _caching.makeStrongCacheSync)(alias => (0, _caching.makeStrongCacheSync)(passPerPreset => createPresetDescriptors(items, dirname, alias, passPerPreset).map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc))));\n});\nconst PLUGIN_DESCRIPTOR_CACHE = new WeakMap();\nconst createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {\n const dirname = cache.using(dir => dir);\n return (0, _caching.makeStrongCacheSync)(alias => createPluginDescriptors(items, dirname, alias).map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc)));\n});\nconst DEFAULT_OPTIONS = {};\n\nfunction loadCachedDescriptor(cache, desc) {\n const {\n value,\n options = DEFAULT_OPTIONS\n } = desc;\n if (options === false) return desc;\n let cacheByOptions = cache.get(value);\n\n if (!cacheByOptions) {\n cacheByOptions = new WeakMap();\n cache.set(value, cacheByOptions);\n }\n\n let possibilities = cacheByOptions.get(options);\n\n if (!possibilities) {\n possibilities = [];\n cacheByOptions.set(options, possibilities);\n }\n\n if (possibilities.indexOf(desc) === -1) {\n const matches = possibilities.filter(possibility => isEqualDescriptor(possibility, desc));\n\n if (matches.length > 0) {\n return matches[0];\n }\n\n possibilities.push(desc);\n }\n\n return desc;\n}\n\nfunction createPresetDescriptors(items, dirname, alias, passPerPreset) {\n return createDescriptors(\"preset\", items, dirname, alias, passPerPreset);\n}\n\nfunction createPluginDescriptors(items, dirname, alias) {\n return createDescriptors(\"plugin\", items, dirname, alias);\n}\n\nfunction createDescriptors(type, items, dirname, alias, ownPass) {\n const descriptors = items.map((item, index) => createDescriptor(item, dirname, {\n type,\n alias: `${alias}$${index}`,\n ownPass: !!ownPass\n }));\n assertNoDuplicates(descriptors);\n return descriptors;\n}\n\nfunction createDescriptor(pair, dirname, {\n type,\n alias,\n ownPass\n}) {\n const desc = (0, _item.getItemDescriptor)(pair);\n\n if (desc) {\n return desc;\n }\n\n let name;\n let options;\n let value = pair;\n\n if (Array.isArray(value)) {\n if (value.length === 3) {\n [value, options, name] = value;\n } else {\n [value, options] = value;\n }\n }\n\n let file = undefined;\n let filepath = null;\n\n if (typeof value === \"string\") {\n if (typeof type !== \"string\") {\n throw new Error(\"To resolve a string-based item, the type of item must be given\");\n }\n\n const resolver = type === \"plugin\" ? _files.loadPlugin : _files.loadPreset;\n const request = value;\n ({\n filepath,\n value\n } = resolver(value, dirname));\n file = {\n request,\n resolved: filepath\n };\n }\n\n if (!value) {\n throw new Error(`Unexpected falsy value: ${String(value)}`);\n }\n\n if (typeof value === \"object\" && value.__esModule) {\n if (value.default) {\n value = value.default;\n } else {\n throw new Error(\"Must export a default export when using ES6 modules.\");\n }\n }\n\n if (typeof value !== \"object\" && typeof value !== \"function\") {\n throw new Error(`Unsupported format: ${typeof value}. Expected an object or a function.`);\n }\n\n if (filepath !== null && typeof value === \"object\" && value) {\n throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`);\n }\n\n return {\n name,\n alias: filepath || alias,\n value,\n options,\n dirname,\n ownPass,\n file\n };\n}\n\nfunction assertNoDuplicates(items) {\n const map = new Map();\n\n for (const item of items) {\n if (typeof item.value !== \"function\") continue;\n let nameMap = map.get(item.value);\n\n if (!nameMap) {\n nameMap = new Set();\n map.set(item.value, nameMap);\n }\n\n if (nameMap.has(item.name)) {\n const conflicts = items.filter(i => i.value === item.value);\n throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join(\"\\n\"));\n }\n\n nameMap.add(item.name);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.findConfigUpwards = findConfigUpwards;\nexports.findRelativeConfig = findRelativeConfig;\nexports.findRootConfig = findRootConfig;\nexports.loadConfig = loadConfig;\nexports.resolveShowConfigPath = resolveShowConfigPath;\nexports.ROOT_CONFIG_FILENAMES = void 0;\n\nfunction _debug() {\n const data = _interopRequireDefault(require(\"debug\"));\n\n _debug = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _path() {\n const data = _interopRequireDefault(require(\"path\"));\n\n _path = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _json() {\n const data = _interopRequireDefault(require(\"json5\"));\n\n _json = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _gensync() {\n const data = _interopRequireDefault(require(\"gensync\"));\n\n _gensync = function () {\n return data;\n };\n\n return data;\n}\n\nvar _caching = require(\"../caching\");\n\nvar _configApi = _interopRequireDefault(require(\"../helpers/config-api\"));\n\nvar _utils = require(\"./utils\");\n\nvar _moduleTypes = _interopRequireDefault(require(\"./module-types\"));\n\nvar _patternToRegex = _interopRequireDefault(require(\"../pattern-to-regex\"));\n\nvar fs = _interopRequireWildcard(require(\"../../gensync-utils/fs\"));\n\nvar _resolve = _interopRequireDefault(require(\"../../gensync-utils/resolve\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst debug = (0, _debug().default)(\"babel:config:loading:files:configuration\");\nconst ROOT_CONFIG_FILENAMES = [\"babel.config.js\", \"babel.config.cjs\", \"babel.config.mjs\", \"babel.config.json\"];\nexports.ROOT_CONFIG_FILENAMES = ROOT_CONFIG_FILENAMES;\nconst RELATIVE_CONFIG_FILENAMES = [\".babelrc\", \".babelrc.js\", \".babelrc.cjs\", \".babelrc.mjs\", \".babelrc.json\"];\nconst BABELIGNORE_FILENAME = \".babelignore\";\n\nfunction* findConfigUpwards(rootDir) {\n let dirname = rootDir;\n\n while (true) {\n for (const filename of ROOT_CONFIG_FILENAMES) {\n if (yield* fs.exists(_path().default.join(dirname, filename))) {\n return dirname;\n }\n }\n\n const nextDir = _path().default.dirname(dirname);\n\n if (dirname === nextDir) break;\n dirname = nextDir;\n }\n\n return null;\n}\n\nfunction* findRelativeConfig(packageData, envName, caller) {\n let config = null;\n let ignore = null;\n\n const dirname = _path().default.dirname(packageData.filepath);\n\n for (const loc of packageData.directories) {\n if (!config) {\n var _packageData$pkg;\n\n config = yield* loadOneConfig(RELATIVE_CONFIG_FILENAMES, loc, envName, caller, ((_packageData$pkg = packageData.pkg) == null ? void 0 : _packageData$pkg.dirname) === loc ? packageToBabelConfig(packageData.pkg) : null);\n }\n\n if (!ignore) {\n const ignoreLoc = _path().default.join(loc, BABELIGNORE_FILENAME);\n\n ignore = yield* readIgnoreConfig(ignoreLoc);\n\n if (ignore) {\n debug(\"Found ignore %o from %o.\", ignore.filepath, dirname);\n }\n }\n }\n\n return {\n config,\n ignore\n };\n}\n\nfunction findRootConfig(dirname, envName, caller) {\n return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller);\n}\n\nfunction* loadOneConfig(names, dirname, envName, caller, previousConfig = null) {\n const configs = yield* _gensync().default.all(names.map(filename => readConfig(_path().default.join(dirname, filename), envName, caller)));\n const config = configs.reduce((previousConfig, config) => {\n if (config && previousConfig) {\n throw new Error(`Multiple configuration files found. Please remove one:\\n` + ` - ${_path().default.basename(previousConfig.filepath)}\\n` + ` - ${config.filepath}\\n` + `from ${dirname}`);\n }\n\n return config || previousConfig;\n }, previousConfig);\n\n if (config) {\n debug(\"Found configuration %o from %o.\", config.filepath, dirname);\n }\n\n return config;\n}\n\nfunction* loadConfig(name, dirname, envName, caller) {\n const filepath = yield* (0, _resolve.default)(name, {\n basedir: dirname\n });\n const conf = yield* readConfig(filepath, envName, caller);\n\n if (!conf) {\n throw new Error(`Config file ${filepath} contains no configuration data`);\n }\n\n debug(\"Loaded config %o from %o.\", name, dirname);\n return conf;\n}\n\nfunction readConfig(filepath, envName, caller) {\n const ext = _path().default.extname(filepath);\n\n return ext === \".js\" || ext === \".cjs\" || ext === \".mjs\" ? readConfigJS(filepath, {\n envName,\n caller\n }) : readConfigJSON5(filepath);\n}\n\nconst LOADING_CONFIGS = new Set();\nconst readConfigJS = (0, _caching.makeStrongCache)(function* readConfigJS(filepath, cache) {\n if (!fs.exists.sync(filepath)) {\n cache.forever();\n return null;\n }\n\n if (LOADING_CONFIGS.has(filepath)) {\n cache.never();\n debug(\"Auto-ignoring usage of config %o.\", filepath);\n return {\n filepath,\n dirname: _path().default.dirname(filepath),\n options: {}\n };\n }\n\n let options;\n\n try {\n LOADING_CONFIGS.add(filepath);\n options = yield* (0, _moduleTypes.default)(filepath, \"You appear to be using a native ECMAScript module configuration \" + \"file, which is only supported when running Babel asynchronously.\");\n } catch (err) {\n err.message = `${filepath}: Error while loading config - ${err.message}`;\n throw err;\n } finally {\n LOADING_CONFIGS.delete(filepath);\n }\n\n let assertCache = false;\n\n if (typeof options === \"function\") {\n yield* [];\n options = options((0, _configApi.default)(cache));\n assertCache = true;\n }\n\n if (!options || typeof options !== \"object\" || Array.isArray(options)) {\n throw new Error(`${filepath}: Configuration should be an exported JavaScript object.`);\n }\n\n if (typeof options.then === \"function\") {\n throw new Error(`You appear to be using an async configuration, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously return your config.`);\n }\n\n if (assertCache && !cache.configured()) throwConfigError();\n return {\n filepath,\n dirname: _path().default.dirname(filepath),\n options\n };\n});\nconst packageToBabelConfig = (0, _caching.makeWeakCacheSync)(file => {\n const babel = file.options[\"babel\"];\n if (typeof babel === \"undefined\") return null;\n\n if (typeof babel !== \"object\" || Array.isArray(babel) || babel === null) {\n throw new Error(`${file.filepath}: .babel property must be an object`);\n }\n\n return {\n filepath: file.filepath,\n dirname: file.dirname,\n options: babel\n };\n});\nconst readConfigJSON5 = (0, _utils.makeStaticFileCache)((filepath, content) => {\n let options;\n\n try {\n options = _json().default.parse(content);\n } catch (err) {\n err.message = `${filepath}: Error while parsing config - ${err.message}`;\n throw err;\n }\n\n if (!options) throw new Error(`${filepath}: No config detected`);\n\n if (typeof options !== \"object\") {\n throw new Error(`${filepath}: Config returned typeof ${typeof options}`);\n }\n\n if (Array.isArray(options)) {\n throw new Error(`${filepath}: Expected config object but found array`);\n }\n\n return {\n filepath,\n dirname: _path().default.dirname(filepath),\n options\n };\n});\nconst readIgnoreConfig = (0, _utils.makeStaticFileCache)((filepath, content) => {\n const ignoreDir = _path().default.dirname(filepath);\n\n const ignorePatterns = content.split(\"\\n\").map(line => line.replace(/#(.*?)$/, \"\").trim()).filter(line => !!line);\n\n for (const pattern of ignorePatterns) {\n if (pattern[0] === \"!\") {\n throw new Error(`Negation of file paths is not supported.`);\n }\n }\n\n return {\n filepath,\n dirname: _path().default.dirname(filepath),\n ignore: ignorePatterns.map(pattern => (0, _patternToRegex.default)(pattern, ignoreDir))\n };\n});\n\nfunction* resolveShowConfigPath(dirname) {\n const targetPath = process.env.BABEL_SHOW_CONFIG_FOR;\n\n if (targetPath != null) {\n const absolutePath = _path().default.resolve(dirname, targetPath);\n\n const stats = yield* fs.stat(absolutePath);\n\n if (!stats.isFile()) {\n throw new Error(`${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`);\n }\n\n return absolutePath;\n }\n\n return null;\n}\n\nfunction throwConfigError() {\n throw new Error(`\\\nCaching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured\nfor various types of caching, using the first param of their handler functions:\n\nmodule.exports = function(api) {\n // The API exposes the following:\n\n // Cache the returned value forever and don't call this function again.\n api.cache(true);\n\n // Don't cache at all. Not recommended because it will be very slow.\n api.cache(false);\n\n // Cached based on the value of some function. If this function returns a value different from\n // a previously-encountered value, the plugins will re-evaluate.\n var env = api.cache(() => process.env.NODE_ENV);\n\n // If testing for a specific env, we recommend specifics to avoid instantiating a plugin for\n // any possible NODE_ENV value that might come up during plugin execution.\n var isProd = api.cache(() => process.env.NODE_ENV === \"production\");\n\n // .cache(fn) will perform a linear search though instances to find the matching plugin based\n // based on previous instantiated plugins. If you want to recreate the plugin and discard the\n // previous instance whenever something changes, you may use:\n var isProd = api.cache.invalidate(() => process.env.NODE_ENV === \"production\");\n\n // Note, we also expose the following more-verbose versions of the above examples:\n api.cache.forever(); // api.cache(true)\n api.cache.never(); // api.cache(false)\n api.cache.using(fn); // api.cache(fn)\n\n // Return the value that will be cached.\n return { };\n};`);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = import_;\n\nfunction import_(filepath) {\n return import(filepath);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"findPackageData\", {\n enumerable: true,\n get: function () {\n return _package.findPackageData;\n }\n});\nObject.defineProperty(exports, \"findConfigUpwards\", {\n enumerable: true,\n get: function () {\n return _configuration.findConfigUpwards;\n }\n});\nObject.defineProperty(exports, \"findRelativeConfig\", {\n enumerable: true,\n get: function () {\n return _configuration.findRelativeConfig;\n }\n});\nObject.defineProperty(exports, \"findRootConfig\", {\n enumerable: true,\n get: function () {\n return _configuration.findRootConfig;\n }\n});\nObject.defineProperty(exports, \"loadConfig\", {\n enumerable: true,\n get: function () {\n return _configuration.loadConfig;\n }\n});\nObject.defineProperty(exports, \"resolveShowConfigPath\", {\n enumerable: true,\n get: function () {\n return _configuration.resolveShowConfigPath;\n }\n});\nObject.defineProperty(exports, \"ROOT_CONFIG_FILENAMES\", {\n enumerable: true,\n get: function () {\n return _configuration.ROOT_CONFIG_FILENAMES;\n }\n});\nObject.defineProperty(exports, \"resolvePlugin\", {\n enumerable: true,\n get: function () {\n return _plugins.resolvePlugin;\n }\n});\nObject.defineProperty(exports, \"resolvePreset\", {\n enumerable: true,\n get: function () {\n return _plugins.resolvePreset;\n }\n});\nObject.defineProperty(exports, \"loadPlugin\", {\n enumerable: true,\n get: function () {\n return _plugins.loadPlugin;\n }\n});\nObject.defineProperty(exports, \"loadPreset\", {\n enumerable: true,\n get: function () {\n return _plugins.loadPreset;\n }\n});\n\nvar _package = require(\"./package\");\n\nvar _configuration = require(\"./configuration\");\n\nvar _plugins = require(\"./plugins\");\n\n({});",null,"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.findPackageData = findPackageData;\n\nfunction _path() {\n const data = _interopRequireDefault(require(\"path\"));\n\n _path = function () {\n return data;\n };\n\n return data;\n}\n\nvar _utils = require(\"./utils\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst PACKAGE_FILENAME = \"package.json\";\n\nfunction* findPackageData(filepath) {\n let pkg = null;\n const directories = [];\n let isPackage = true;\n\n let dirname = _path().default.dirname(filepath);\n\n while (!pkg && _path().default.basename(dirname) !== \"node_modules\") {\n directories.push(dirname);\n pkg = yield* readConfigPackage(_path().default.join(dirname, PACKAGE_FILENAME));\n\n const nextLoc = _path().default.dirname(dirname);\n\n if (dirname === nextLoc) {\n isPackage = false;\n break;\n }\n\n dirname = nextLoc;\n }\n\n return {\n filepath,\n directories,\n pkg,\n isPackage\n };\n}\n\nconst readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) => {\n let options;\n\n try {\n options = JSON.parse(content);\n } catch (err) {\n err.message = `${filepath}: Error while parsing JSON - ${err.message}`;\n throw err;\n }\n\n if (!options) throw new Error(`${filepath}: No config detected`);\n\n if (typeof options !== \"object\") {\n throw new Error(`${filepath}: Config returned typeof ${typeof options}`);\n }\n\n if (Array.isArray(options)) {\n throw new Error(`${filepath}: Expected config object but found array`);\n }\n\n return {\n filepath,\n dirname: _path().default.dirname(filepath),\n options\n };\n});",null,"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.makeStaticFileCache = makeStaticFileCache;\n\nvar _caching = require(\"../caching\");\n\nvar fs = _interopRequireWildcard(require(\"../../gensync-utils/fs\"));\n\nfunction _fs2() {\n const data = _interopRequireDefault(require(\"fs\"));\n\n _fs2 = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction makeStaticFileCache(fn) {\n return (0, _caching.makeStrongCache)(function* (filepath, cache) {\n const cached = cache.invalidate(() => fileMtime(filepath));\n\n if (cached === null) {\n return null;\n }\n\n return fn(filepath, yield* fs.readFile(filepath, \"utf8\"));\n });\n}\n\nfunction fileMtime(filepath) {\n try {\n return +_fs2().default.statSync(filepath).mtime;\n } catch (e) {\n if (e.code !== \"ENOENT\" && e.code !== \"ENOTDIR\") throw e;\n }\n\n return null;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _gensync() {\n const data = _interopRequireDefault(require(\"gensync\"));\n\n _gensync = function () {\n return data;\n };\n\n return data;\n}\n\nvar _async = require(\"../gensync-utils/async\");\n\nvar _util = require(\"./util\");\n\nvar context = _interopRequireWildcard(require(\"../index\"));\n\nvar _plugin = _interopRequireDefault(require(\"./plugin\"));\n\nvar _item = require(\"./item\");\n\nvar _configChain = require(\"./config-chain\");\n\nfunction _traverse() {\n const data = _interopRequireDefault(require(\"@babel/traverse\"));\n\n _traverse = function () {\n return data;\n };\n\n return data;\n}\n\nvar _caching = require(\"./caching\");\n\nvar _options = require(\"./validation/options\");\n\nvar _plugins = require(\"./validation/plugins\");\n\nvar _configApi = _interopRequireDefault(require(\"./helpers/config-api\"));\n\nvar _partial = _interopRequireDefault(require(\"./partial\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _default = (0, _gensync().default)(function* loadFullConfig(inputOpts) {\n const result = yield* (0, _partial.default)(inputOpts);\n\n if (!result) {\n return null;\n }\n\n const {\n options,\n context,\n fileHandling\n } = result;\n\n if (fileHandling === \"ignored\") {\n return null;\n }\n\n const optionDefaults = {};\n const {\n plugins,\n presets\n } = options;\n\n if (!plugins || !presets) {\n throw new Error(\"Assertion failure - plugins and presets exist\");\n }\n\n const toDescriptor = item => {\n const desc = (0, _item.getItemDescriptor)(item);\n\n if (!desc) {\n throw new Error(\"Assertion failure - must be config item\");\n }\n\n return desc;\n };\n\n const presetsDescriptors = presets.map(toDescriptor);\n const initialPluginsDescriptors = plugins.map(toDescriptor);\n const pluginDescriptorsByPass = [[]];\n const passes = [];\n const ignored = yield* enhanceError(context, function* recursePresetDescriptors(rawPresets, pluginDescriptorsPass) {\n const presets = [];\n\n for (let i = 0; i < rawPresets.length; i++) {\n const descriptor = rawPresets[i];\n\n if (descriptor.options !== false) {\n try {\n if (descriptor.ownPass) {\n presets.push({\n preset: yield* loadPresetDescriptor(descriptor, context),\n pass: []\n });\n } else {\n presets.unshift({\n preset: yield* loadPresetDescriptor(descriptor, context),\n pass: pluginDescriptorsPass\n });\n }\n } catch (e) {\n if (e.code === \"BABEL_UNKNOWN_OPTION\") {\n (0, _options.checkNoUnwrappedItemOptionPairs)(rawPresets, i, \"preset\", e);\n }\n\n throw e;\n }\n }\n }\n\n if (presets.length > 0) {\n pluginDescriptorsByPass.splice(1, 0, ...presets.map(o => o.pass).filter(p => p !== pluginDescriptorsPass));\n\n for (const {\n preset,\n pass\n } of presets) {\n if (!preset) return true;\n pass.push(...preset.plugins);\n const ignored = yield* recursePresetDescriptors(preset.presets, pass);\n if (ignored) return true;\n preset.options.forEach(opts => {\n (0, _util.mergeOptions)(optionDefaults, opts);\n });\n }\n }\n })(presetsDescriptors, pluginDescriptorsByPass[0]);\n if (ignored) return null;\n const opts = optionDefaults;\n (0, _util.mergeOptions)(opts, options);\n yield* enhanceError(context, function* loadPluginDescriptors() {\n pluginDescriptorsByPass[0].unshift(...initialPluginsDescriptors);\n\n for (const descs of pluginDescriptorsByPass) {\n const pass = [];\n passes.push(pass);\n\n for (let i = 0; i < descs.length; i++) {\n const descriptor = descs[i];\n\n if (descriptor.options !== false) {\n try {\n pass.push(yield* loadPluginDescriptor(descriptor, context));\n } catch (e) {\n if (e.code === \"BABEL_UNKNOWN_PLUGIN_PROPERTY\") {\n (0, _options.checkNoUnwrappedItemOptionPairs)(descs, i, \"plugin\", e);\n }\n\n throw e;\n }\n }\n }\n }\n })();\n opts.plugins = passes[0];\n opts.presets = passes.slice(1).filter(plugins => plugins.length > 0).map(plugins => ({\n plugins\n }));\n opts.passPerPreset = opts.presets.length > 0;\n return {\n options: opts,\n passes: passes\n };\n});\n\nexports.default = _default;\n\nfunction enhanceError(context, fn) {\n return function* (arg1, arg2) {\n try {\n return yield* fn(arg1, arg2);\n } catch (e) {\n if (!/^\\[BABEL\\]/.test(e.message)) {\n e.message = `[BABEL] ${context.filename || \"unknown\"}: ${e.message}`;\n }\n\n throw e;\n }\n };\n}\n\nconst loadDescriptor = (0, _caching.makeWeakCache)(function* ({\n value,\n options,\n dirname,\n alias\n}, cache) {\n if (options === false) throw new Error(\"Assertion failure\");\n options = options || {};\n let item = value;\n\n if (typeof value === \"function\") {\n const api = Object.assign({}, context, (0, _configApi.default)(cache));\n\n try {\n item = value(api, options, dirname);\n } catch (e) {\n if (alias) {\n e.message += ` (While processing: ${JSON.stringify(alias)})`;\n }\n\n throw e;\n }\n }\n\n if (!item || typeof item !== \"object\") {\n throw new Error(\"Plugin/Preset did not return an object.\");\n }\n\n if (typeof item.then === \"function\") {\n yield* [];\n throw new Error(`You appear to be using an async plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version.`);\n }\n\n return {\n value: item,\n options,\n dirname,\n alias\n };\n});\n\nfunction* loadPluginDescriptor(descriptor, context) {\n if (descriptor.value instanceof _plugin.default) {\n if (descriptor.options) {\n throw new Error(\"Passed options to an existing Plugin instance will not work.\");\n }\n\n return descriptor.value;\n }\n\n return yield* instantiatePlugin(yield* loadDescriptor(descriptor, context), context);\n}\n\nconst instantiatePlugin = (0, _caching.makeWeakCache)(function* ({\n value,\n options,\n dirname,\n alias\n}, cache) {\n const pluginObj = (0, _plugins.validatePluginObject)(value);\n const plugin = Object.assign({}, pluginObj);\n\n if (plugin.visitor) {\n plugin.visitor = _traverse().default.explode(Object.assign({}, plugin.visitor));\n }\n\n if (plugin.inherits) {\n const inheritsDescriptor = {\n name: undefined,\n alias: `${alias}$inherits`,\n value: plugin.inherits,\n options,\n dirname\n };\n const inherits = yield* (0, _async.forwardAsync)(loadPluginDescriptor, run => {\n return cache.invalidate(data => run(inheritsDescriptor, data));\n });\n plugin.pre = chain(inherits.pre, plugin.pre);\n plugin.post = chain(inherits.post, plugin.post);\n plugin.manipulateOptions = chain(inherits.manipulateOptions, plugin.manipulateOptions);\n plugin.visitor = _traverse().default.visitors.merge([inherits.visitor || {}, plugin.visitor || {}]);\n }\n\n return new _plugin.default(plugin, options, alias);\n});\n\nconst validateIfOptionNeedsFilename = (options, descriptor) => {\n if (options.test || options.include || options.exclude) {\n const formattedPresetName = descriptor.name ? `\"${descriptor.name}\"` : \"/* your preset */\";\n throw new Error([`Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`, `\\`\\`\\``, `babel.transform(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`, `\\`\\`\\``, `See https://babeljs.io/docs/en/options#filename for more information.`].join(\"\\n\"));\n }\n};\n\nconst validatePreset = (preset, context, descriptor) => {\n if (!context.filename) {\n const {\n options\n } = preset;\n validateIfOptionNeedsFilename(options, descriptor);\n\n if (options.overrides) {\n options.overrides.forEach(overrideOptions => validateIfOptionNeedsFilename(overrideOptions, descriptor));\n }\n }\n};\n\nfunction* loadPresetDescriptor(descriptor, context) {\n const preset = instantiatePreset(yield* loadDescriptor(descriptor, context));\n validatePreset(preset, context, descriptor);\n return yield* (0, _configChain.buildPresetChain)(preset, context);\n}\n\nconst instantiatePreset = (0, _caching.makeWeakCacheSync)(({\n value,\n dirname,\n alias\n}) => {\n return {\n options: (0, _options.validate)(\"preset\", value),\n alias,\n dirname\n };\n});\n\nfunction chain(a, b) {\n const fns = [a, b].filter(Boolean);\n if (fns.length <= 1) return fns[0];\n return function (...args) {\n for (const fn of fns) {\n fn.apply(this, args);\n }\n };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = makeAPI;\n\nfunction _semver() {\n const data = _interopRequireDefault(require(\"semver\"));\n\n _semver = function () {\n return data;\n };\n\n return data;\n}\n\nvar _ = require(\"../../\");\n\nvar _caching = require(\"../caching\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction makeAPI(cache) {\n const env = value => cache.using(data => {\n if (typeof value === \"undefined\") return data.envName;\n\n if (typeof value === \"function\") {\n return (0, _caching.assertSimpleType)(value(data.envName));\n }\n\n if (!Array.isArray(value)) value = [value];\n return value.some(entry => {\n if (typeof entry !== \"string\") {\n throw new Error(\"Unexpected non-string value\");\n }\n\n return entry === data.envName;\n });\n });\n\n const caller = cb => cache.using(data => (0, _caching.assertSimpleType)(cb(data.caller)));\n\n return {\n version: _.version,\n cache: cache.simple(),\n env,\n async: () => false,\n caller,\n assertVersion\n };\n}\n\nfunction assertVersion(range) {\n if (typeof range === \"number\") {\n if (!Number.isInteger(range)) {\n throw new Error(\"Expected string or integer value.\");\n }\n\n range = `^${range}.0.0-0`;\n }\n\n if (typeof range !== \"string\") {\n throw new Error(\"Expected string or integer value.\");\n }\n\n if (_semver().default.satisfies(_.version, range)) return;\n const limit = Error.stackTraceLimit;\n\n if (typeof limit === \"number\" && limit < 25) {\n Error.stackTraceLimit = 25;\n }\n\n const 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.`);\n\n if (typeof limit === \"number\") {\n Error.stackTraceLimit = limit;\n }\n\n throw Object.assign(err, {\n code: \"BABEL_VERSION_UNSUPPORTED\",\n version: _.version,\n range\n });\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getEnv = getEnv;\n\nfunction getEnv(defaultValue = \"development\") {\n return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _full.default;\n }\n});\nexports.loadOptionsAsync = exports.loadOptionsSync = exports.loadOptions = exports.loadPartialConfigAsync = exports.loadPartialConfigSync = exports.loadPartialConfig = void 0;\n\nfunction _gensync() {\n const data = _interopRequireDefault(require(\"gensync\"));\n\n _gensync = function () {\n return data;\n };\n\n return data;\n}\n\nvar _full = _interopRequireDefault(require(\"./full\"));\n\nvar _partial = require(\"./partial\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst loadOptionsRunner = (0, _gensync().default)(function* (opts) {\n var _config$options;\n\n const config = yield* (0, _full.default)(opts);\n return (_config$options = config == null ? void 0 : config.options) != null ? _config$options : null;\n});\n\nconst maybeErrback = runner => (opts, callback) => {\n if (callback === undefined && typeof opts === \"function\") {\n callback = opts;\n opts = undefined;\n }\n\n return callback ? runner.errback(opts, callback) : runner.sync(opts);\n};\n\nconst loadPartialConfig = maybeErrback(_partial.loadPartialConfig);\nexports.loadPartialConfig = loadPartialConfig;\nconst loadPartialConfigSync = _partial.loadPartialConfig.sync;\nexports.loadPartialConfigSync = loadPartialConfigSync;\nconst loadPartialConfigAsync = _partial.loadPartialConfig.async;\nexports.loadPartialConfigAsync = loadPartialConfigAsync;\nconst loadOptions = maybeErrback(loadOptionsRunner);\nexports.loadOptions = loadOptions;\nconst loadOptionsSync = loadOptionsRunner.sync;\nexports.loadOptionsSync = loadOptionsSync;\nconst loadOptionsAsync = loadOptionsRunner.async;\nexports.loadOptionsAsync = loadOptionsAsync;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createItemFromDescriptor = createItemFromDescriptor;\nexports.createConfigItem = createConfigItem;\nexports.getItemDescriptor = getItemDescriptor;\n\nfunction _path() {\n const data = _interopRequireDefault(require(\"path\"));\n\n _path = function () {\n return data;\n };\n\n return data;\n}\n\nvar _configDescriptors = require(\"./config-descriptors\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createItemFromDescriptor(desc) {\n return new ConfigItem(desc);\n}\n\nfunction createConfigItem(value, {\n dirname = \".\",\n type\n} = {}) {\n const descriptor = (0, _configDescriptors.createDescriptor)(value, _path().default.resolve(dirname), {\n type,\n alias: \"programmatic item\"\n });\n return createItemFromDescriptor(descriptor);\n}\n\nfunction getItemDescriptor(item) {\n if (item instanceof ConfigItem) {\n return item._descriptor;\n }\n\n return undefined;\n}\n\nclass ConfigItem {\n constructor(descriptor) {\n this._descriptor = void 0;\n this.value = void 0;\n this.options = void 0;\n this.dirname = void 0;\n this.name = void 0;\n this.file = void 0;\n this._descriptor = descriptor;\n Object.defineProperty(this, \"_descriptor\", {\n enumerable: false\n });\n this.value = this._descriptor.value;\n this.options = this._descriptor.options;\n this.dirname = this._descriptor.dirname;\n this.name = this._descriptor.name;\n this.file = this._descriptor.file ? {\n request: this._descriptor.file.request,\n resolved: this._descriptor.file.resolved\n } : undefined;\n Object.freeze(this);\n }\n\n}\n\nObject.freeze(ConfigItem.prototype);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = loadPrivatePartialConfig;\nexports.loadPartialConfig = void 0;\n\nfunction _path() {\n const data = _interopRequireDefault(require(\"path\"));\n\n _path = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _gensync() {\n const data = _interopRequireDefault(require(\"gensync\"));\n\n _gensync = function () {\n return data;\n };\n\n return data;\n}\n\nvar _plugin = _interopRequireDefault(require(\"./plugin\"));\n\nvar _util = require(\"./util\");\n\nvar _item = require(\"./item\");\n\nvar _configChain = require(\"./config-chain\");\n\nvar _environment = require(\"./helpers/environment\");\n\nvar _options = require(\"./validation/options\");\n\nvar _files = require(\"./files\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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; }\n\nfunction* resolveRootMode(rootDir, rootMode) {\n switch (rootMode) {\n case \"root\":\n return rootDir;\n\n case \"upward-optional\":\n {\n const upwardRootDir = yield* (0, _files.findConfigUpwards)(rootDir);\n return upwardRootDir === null ? rootDir : upwardRootDir;\n }\n\n case \"upward\":\n {\n const upwardRootDir = yield* (0, _files.findConfigUpwards)(rootDir);\n if (upwardRootDir !== null) return upwardRootDir;\n throw Object.assign(new Error(`Babel was run with rootMode:\"upward\" but a root could not ` + `be found when searching upward from \"${rootDir}\".\\n` + `One of the following config files must be in the directory tree: ` + `\"${_files.ROOT_CONFIG_FILENAMES.join(\", \")}\".`), {\n code: \"BABEL_ROOT_NOT_FOUND\",\n dirname: rootDir\n });\n }\n\n default:\n throw new Error(`Assertion failure - unknown rootMode value.`);\n }\n}\n\nfunction* loadPrivatePartialConfig(inputOpts) {\n if (inputOpts != null && (typeof inputOpts !== \"object\" || Array.isArray(inputOpts))) {\n throw new Error(\"Babel options must be an object, null, or undefined\");\n }\n\n const args = inputOpts ? (0, _options.validate)(\"arguments\", inputOpts) : {};\n const {\n envName = (0, _environment.getEnv)(),\n cwd = \".\",\n root: rootDir = \".\",\n rootMode = \"root\",\n caller,\n cloneInputAst = true\n } = args;\n\n const absoluteCwd = _path().default.resolve(cwd);\n\n const absoluteRootDir = yield* resolveRootMode(_path().default.resolve(absoluteCwd, rootDir), rootMode);\n const filename = typeof args.filename === \"string\" ? _path().default.resolve(cwd, args.filename) : undefined;\n const showConfigPath = yield* (0, _files.resolveShowConfigPath)(absoluteCwd);\n const context = {\n filename,\n cwd: absoluteCwd,\n root: absoluteRootDir,\n envName,\n caller,\n showConfig: showConfigPath === filename\n };\n const configChain = yield* (0, _configChain.buildRootChain)(args, context);\n if (!configChain) return null;\n const options = {};\n configChain.options.forEach(opts => {\n (0, _util.mergeOptions)(options, opts);\n });\n options.cloneInputAst = cloneInputAst;\n options.babelrc = false;\n options.configFile = false;\n options.passPerPreset = false;\n options.envName = context.envName;\n options.cwd = context.cwd;\n options.root = context.root;\n options.filename = typeof context.filename === \"string\" ? context.filename : undefined;\n options.plugins = configChain.plugins.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor));\n options.presets = configChain.presets.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor));\n return {\n options,\n context,\n fileHandling: configChain.fileHandling,\n ignore: configChain.ignore,\n babelrc: configChain.babelrc,\n config: configChain.config,\n files: configChain.files\n };\n}\n\nconst loadPartialConfig = (0, _gensync().default)(function* (opts) {\n let showIgnoredFiles = false;\n\n if (typeof opts === \"object\" && opts !== null && !Array.isArray(opts)) {\n var _opts = opts;\n ({\n showIgnoredFiles\n } = _opts);\n opts = _objectWithoutPropertiesLoose(_opts, [\"showIgnoredFiles\"]);\n _opts;\n }\n\n const result = yield* loadPrivatePartialConfig(opts);\n if (!result) return null;\n const {\n options,\n babelrc,\n ignore,\n config,\n fileHandling,\n files\n } = result;\n\n if (fileHandling === \"ignored\" && !showIgnoredFiles) {\n return null;\n }\n\n (options.plugins || []).forEach(item => {\n if (item.value instanceof _plugin.default) {\n throw new Error(\"Passing cached plugin instances is not supported in \" + \"babel.loadPartialConfig()\");\n }\n });\n return new PartialConfig(options, babelrc ? babelrc.filepath : undefined, ignore ? ignore.filepath : undefined, config ? config.filepath : undefined, fileHandling, files);\n});\nexports.loadPartialConfig = loadPartialConfig;\n\nclass PartialConfig {\n constructor(options, babelrc, ignore, config, fileHandling, files) {\n this.options = void 0;\n this.babelrc = void 0;\n this.babelignore = void 0;\n this.config = void 0;\n this.fileHandling = void 0;\n this.files = void 0;\n this.options = options;\n this.babelignore = ignore;\n this.babelrc = babelrc;\n this.config = config;\n this.fileHandling = fileHandling;\n this.files = files;\n Object.freeze(this);\n }\n\n hasFilesystemConfig() {\n return this.babelrc !== undefined || this.config !== undefined;\n }\n\n}\n\nObject.freeze(PartialConfig.prototype);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = pathToPattern;\n\nfunction _path() {\n const data = _interopRequireDefault(require(\"path\"));\n\n _path = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _escapeRegExp() {\n const data = _interopRequireDefault(require(\"lodash/escapeRegExp\"));\n\n _escapeRegExp = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst sep = `\\\\${_path().default.sep}`;\nconst endSep = `(?:${sep}|$)`;\nconst substitution = `[^${sep}]+`;\nconst starPat = `(?:${substitution}${sep})`;\nconst starPatLast = `(?:${substitution}${endSep})`;\nconst starStarPat = `${starPat}*?`;\nconst starStarPatLast = `${starPat}*?${starPatLast}?`;\n\nfunction pathToPattern(pattern, dirname) {\n const parts = _path().default.resolve(dirname, pattern).split(_path().default.sep);\n\n return new RegExp([\"^\", ...parts.map((part, i) => {\n const last = i === parts.length - 1;\n if (part === \"**\") return last ? starStarPatLast : starStarPat;\n if (part === \"*\") return last ? starPatLast : starPat;\n\n if (part.indexOf(\"*.\") === 0) {\n return substitution + (0, _escapeRegExp().default)(part.slice(1)) + (last ? endSep : sep);\n }\n\n return (0, _escapeRegExp().default)(part) + (last ? endSep : sep);\n })].join(\"\"));\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nclass Plugin {\n constructor(plugin, options, key) {\n this.key = void 0;\n this.manipulateOptions = void 0;\n this.post = void 0;\n this.pre = void 0;\n this.visitor = void 0;\n this.parserOverride = void 0;\n this.generatorOverride = void 0;\n this.options = void 0;\n this.key = plugin.name || key;\n this.manipulateOptions = plugin.manipulateOptions;\n this.post = plugin.post;\n this.pre = plugin.pre;\n this.visitor = plugin.visitor || {};\n this.parserOverride = plugin.parserOverride;\n this.generatorOverride = plugin.generatorOverride;\n this.options = options;\n }\n\n}\n\nexports.default = Plugin;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ConfigPrinter = exports.ChainFormatter = void 0;\nconst ChainFormatter = {\n Programmatic: 0,\n Config: 1\n};\nexports.ChainFormatter = ChainFormatter;\nconst Formatter = {\n title(type, callerName, filepath) {\n let title = \"\";\n\n if (type === ChainFormatter.Programmatic) {\n title = \"programmatic options\";\n\n if (callerName) {\n title += \" from \" + callerName;\n }\n } else {\n title = \"config \" + filepath;\n }\n\n return title;\n },\n\n loc(index, envName) {\n let loc = \"\";\n\n if (index != null) {\n loc += `.overrides[${index}]`;\n }\n\n if (envName != null) {\n loc += `.env[\"${envName}\"]`;\n }\n\n return loc;\n },\n\n optionsAndDescriptors(opt) {\n const content = Object.assign({}, opt.options);\n delete content.overrides;\n delete content.env;\n const pluginDescriptors = [...opt.plugins()];\n\n if (pluginDescriptors.length) {\n content.plugins = pluginDescriptors.map(d => descriptorToConfig(d));\n }\n\n const presetDescriptors = [...opt.presets()];\n\n if (presetDescriptors.length) {\n content.presets = [...presetDescriptors].map(d => descriptorToConfig(d));\n }\n\n return JSON.stringify(content, undefined, 2);\n }\n\n};\n\nfunction descriptorToConfig(d) {\n var _d$file;\n\n let name = (_d$file = d.file) == null ? void 0 : _d$file.request;\n\n if (name == null) {\n if (typeof d.value === \"object\") {\n name = d.value;\n } else if (typeof d.value === \"function\") {\n name = `[Function: ${d.value.toString().substr(0, 50)} ... ]`;\n }\n }\n\n if (name == null) {\n name = \"[Unknown]\";\n }\n\n if (d.options === undefined) {\n return name;\n } else if (d.name == null) {\n return [name, d.options];\n } else {\n return [name, d.options, d.name];\n }\n}\n\nclass ConfigPrinter {\n constructor() {\n this._stack = [];\n }\n\n configure(enabled, type, {\n callerName,\n filepath\n }) {\n if (!enabled) return () => {};\n return (content, index, envName) => {\n this._stack.push({\n type,\n callerName,\n filepath,\n content,\n index,\n envName\n });\n };\n }\n\n static format(config) {\n let title = Formatter.title(config.type, config.callerName, config.filepath);\n const loc = Formatter.loc(config.index, config.envName);\n if (loc) title += ` ${loc}`;\n const content = Formatter.optionsAndDescriptors(config.content);\n return `${title}\\n${content}`;\n }\n\n output() {\n if (this._stack.length === 0) return \"\";\n return this._stack.map(s => ConfigPrinter.format(s)).join(\"\\n\\n\");\n }\n\n}\n\nexports.ConfigPrinter = ConfigPrinter;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.mergeOptions = mergeOptions;\nexports.isIterableIterator = isIterableIterator;\n\nfunction mergeOptions(target, source) {\n for (const k of Object.keys(source)) {\n if (k === \"parserOpts\" && source.parserOpts) {\n const parserOpts = source.parserOpts;\n const targetObj = target.parserOpts = target.parserOpts || {};\n mergeDefaultFields(targetObj, parserOpts);\n } else if (k === \"generatorOpts\" && source.generatorOpts) {\n const generatorOpts = source.generatorOpts;\n const targetObj = target.generatorOpts = target.generatorOpts || {};\n mergeDefaultFields(targetObj, generatorOpts);\n } else {\n const val = source[k];\n if (val !== undefined) target[k] = val;\n }\n }\n}\n\nfunction mergeDefaultFields(target, source) {\n for (const k of Object.keys(source)) {\n const val = source[k];\n if (val !== undefined) target[k] = val;\n }\n}\n\nfunction isIterableIterator(value) {\n return !!value && typeof value.next === \"function\" && typeof value[Symbol.iterator] === \"function\";\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.msg = msg;\nexports.access = access;\nexports.assertRootMode = assertRootMode;\nexports.assertSourceMaps = assertSourceMaps;\nexports.assertCompact = assertCompact;\nexports.assertSourceType = assertSourceType;\nexports.assertCallerMetadata = assertCallerMetadata;\nexports.assertInputSourceMap = assertInputSourceMap;\nexports.assertString = assertString;\nexports.assertFunction = assertFunction;\nexports.assertBoolean = assertBoolean;\nexports.assertObject = assertObject;\nexports.assertArray = assertArray;\nexports.assertIgnoreList = assertIgnoreList;\nexports.assertConfigApplicableTest = assertConfigApplicableTest;\nexports.assertConfigFileSearch = assertConfigFileSearch;\nexports.assertBabelrcSearch = assertBabelrcSearch;\nexports.assertPluginList = assertPluginList;\n\nfunction msg(loc) {\n switch (loc.type) {\n case \"root\":\n return ``;\n\n case \"env\":\n return `${msg(loc.parent)}.env[\"${loc.name}\"]`;\n\n case \"overrides\":\n return `${msg(loc.parent)}.overrides[${loc.index}]`;\n\n case \"option\":\n return `${msg(loc.parent)}.${loc.name}`;\n\n case \"access\":\n return `${msg(loc.parent)}[${JSON.stringify(loc.name)}]`;\n\n default:\n throw new Error(`Assertion failure: Unknown type ${loc.type}`);\n }\n}\n\nfunction access(loc, name) {\n return {\n type: \"access\",\n name,\n parent: loc\n };\n}\n\nfunction assertRootMode(loc, value) {\n if (value !== undefined && value !== \"root\" && value !== \"upward\" && value !== \"upward-optional\") {\n throw new Error(`${msg(loc)} must be a \"root\", \"upward\", \"upward-optional\" or undefined`);\n }\n\n return value;\n}\n\nfunction assertSourceMaps(loc, value) {\n if (value !== undefined && typeof value !== \"boolean\" && value !== \"inline\" && value !== \"both\") {\n throw new Error(`${msg(loc)} must be a boolean, \"inline\", \"both\", or undefined`);\n }\n\n return value;\n}\n\nfunction assertCompact(loc, value) {\n if (value !== undefined && typeof value !== \"boolean\" && value !== \"auto\") {\n throw new Error(`${msg(loc)} must be a boolean, \"auto\", or undefined`);\n }\n\n return value;\n}\n\nfunction assertSourceType(loc, value) {\n if (value !== undefined && value !== \"module\" && value !== \"script\" && value !== \"unambiguous\") {\n throw new Error(`${msg(loc)} must be \"module\", \"script\", \"unambiguous\", or undefined`);\n }\n\n return value;\n}\n\nfunction assertCallerMetadata(loc, value) {\n const obj = assertObject(loc, value);\n\n if (obj) {\n if (typeof obj[\"name\"] !== \"string\") {\n throw new Error(`${msg(loc)} set but does not contain \"name\" property string`);\n }\n\n for (const prop of Object.keys(obj)) {\n const propLoc = access(loc, prop);\n const value = obj[prop];\n\n if (value != null && typeof value !== \"boolean\" && typeof value !== \"string\" && typeof value !== \"number\") {\n throw new Error(`${msg(propLoc)} must be null, undefined, a boolean, a string, or a number.`);\n }\n }\n }\n\n return value;\n}\n\nfunction assertInputSourceMap(loc, value) {\n if (value !== undefined && typeof value !== \"boolean\" && (typeof value !== \"object\" || !value)) {\n throw new Error(`${msg(loc)} must be a boolean, object, or undefined`);\n }\n\n return value;\n}\n\nfunction assertString(loc, value) {\n if (value !== undefined && typeof value !== \"string\") {\n throw new Error(`${msg(loc)} must be a string, or undefined`);\n }\n\n return value;\n}\n\nfunction assertFunction(loc, value) {\n if (value !== undefined && typeof value !== \"function\") {\n throw new Error(`${msg(loc)} must be a function, or undefined`);\n }\n\n return value;\n}\n\nfunction assertBoolean(loc, value) {\n if (value !== undefined && typeof value !== \"boolean\") {\n throw new Error(`${msg(loc)} must be a boolean, or undefined`);\n }\n\n return value;\n}\n\nfunction assertObject(loc, value) {\n if (value !== undefined && (typeof value !== \"object\" || Array.isArray(value) || !value)) {\n throw new Error(`${msg(loc)} must be an object, or undefined`);\n }\n\n return value;\n}\n\nfunction assertArray(loc, value) {\n if (value != null && !Array.isArray(value)) {\n throw new Error(`${msg(loc)} must be an array, or undefined`);\n }\n\n return value;\n}\n\nfunction assertIgnoreList(loc, value) {\n const arr = assertArray(loc, value);\n\n if (arr) {\n arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item));\n }\n\n return arr;\n}\n\nfunction assertIgnoreItem(loc, value) {\n if (typeof value !== \"string\" && typeof value !== \"function\" && !(value instanceof RegExp)) {\n throw new Error(`${msg(loc)} must be an array of string/Function/RegExp values, or undefined`);\n }\n\n return value;\n}\n\nfunction assertConfigApplicableTest(loc, value) {\n if (value === undefined) return value;\n\n if (Array.isArray(value)) {\n value.forEach((item, i) => {\n if (!checkValidTest(item)) {\n throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`);\n }\n });\n } else if (!checkValidTest(value)) {\n throw new Error(`${msg(loc)} must be a string/Function/RegExp, or an array of those`);\n }\n\n return value;\n}\n\nfunction checkValidTest(value) {\n return typeof value === \"string\" || typeof value === \"function\" || value instanceof RegExp;\n}\n\nfunction assertConfigFileSearch(loc, value) {\n if (value !== undefined && typeof value !== \"boolean\" && typeof value !== \"string\") {\n throw new Error(`${msg(loc)} must be a undefined, a boolean, a string, ` + `got ${JSON.stringify(value)}`);\n }\n\n return value;\n}\n\nfunction assertBabelrcSearch(loc, value) {\n if (value === undefined || typeof value === \"boolean\") return value;\n\n if (Array.isArray(value)) {\n value.forEach((item, i) => {\n if (!checkValidTest(item)) {\n throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`);\n }\n });\n } else if (!checkValidTest(value)) {\n throw new Error(`${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` + `or an array of those, got ${JSON.stringify(value)}`);\n }\n\n return value;\n}\n\nfunction assertPluginList(loc, value) {\n const arr = assertArray(loc, value);\n\n if (arr) {\n arr.forEach((item, i) => assertPluginItem(access(loc, i), item));\n }\n\n return arr;\n}\n\nfunction assertPluginItem(loc, value) {\n if (Array.isArray(value)) {\n if (value.length === 0) {\n throw new Error(`${msg(loc)} must include an object`);\n }\n\n if (value.length > 3) {\n throw new Error(`${msg(loc)} may only be a two-tuple or three-tuple`);\n }\n\n assertPluginTarget(access(loc, 0), value[0]);\n\n if (value.length > 1) {\n const opts = value[1];\n\n if (opts !== undefined && opts !== false && (typeof opts !== \"object\" || Array.isArray(opts) || opts === null)) {\n throw new Error(`${msg(access(loc, 1))} must be an object, false, or undefined`);\n }\n }\n\n if (value.length === 3) {\n const name = value[2];\n\n if (name !== undefined && typeof name !== \"string\") {\n throw new Error(`${msg(access(loc, 2))} must be a string, or undefined`);\n }\n }\n } else {\n assertPluginTarget(loc, value);\n }\n\n return value;\n}\n\nfunction assertPluginTarget(loc, value) {\n if ((typeof value !== \"object\" || !value) && typeof value !== \"string\" && typeof value !== \"function\") {\n throw new Error(`${msg(loc)} must be a string, object, function`);\n }\n\n return value;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.validate = validate;\nexports.checkNoUnwrappedItemOptionPairs = checkNoUnwrappedItemOptionPairs;\n\nvar _plugin = _interopRequireDefault(require(\"../plugin\"));\n\nvar _removed = _interopRequireDefault(require(\"./removed\"));\n\nvar _optionAssertions = require(\"./option-assertions\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst ROOT_VALIDATORS = {\n cwd: _optionAssertions.assertString,\n root: _optionAssertions.assertString,\n rootMode: _optionAssertions.assertRootMode,\n configFile: _optionAssertions.assertConfigFileSearch,\n caller: _optionAssertions.assertCallerMetadata,\n filename: _optionAssertions.assertString,\n filenameRelative: _optionAssertions.assertString,\n code: _optionAssertions.assertBoolean,\n ast: _optionAssertions.assertBoolean,\n cloneInputAst: _optionAssertions.assertBoolean,\n envName: _optionAssertions.assertString\n};\nconst BABELRC_VALIDATORS = {\n babelrc: _optionAssertions.assertBoolean,\n babelrcRoots: _optionAssertions.assertBabelrcSearch\n};\nconst NONPRESET_VALIDATORS = {\n extends: _optionAssertions.assertString,\n ignore: _optionAssertions.assertIgnoreList,\n only: _optionAssertions.assertIgnoreList\n};\nconst COMMON_VALIDATORS = {\n inputSourceMap: _optionAssertions.assertInputSourceMap,\n presets: _optionAssertions.assertPluginList,\n plugins: _optionAssertions.assertPluginList,\n passPerPreset: _optionAssertions.assertBoolean,\n env: assertEnvSet,\n overrides: assertOverridesList,\n test: _optionAssertions.assertConfigApplicableTest,\n include: _optionAssertions.assertConfigApplicableTest,\n exclude: _optionAssertions.assertConfigApplicableTest,\n retainLines: _optionAssertions.assertBoolean,\n comments: _optionAssertions.assertBoolean,\n shouldPrintComment: _optionAssertions.assertFunction,\n compact: _optionAssertions.assertCompact,\n minified: _optionAssertions.assertBoolean,\n auxiliaryCommentBefore: _optionAssertions.assertString,\n auxiliaryCommentAfter: _optionAssertions.assertString,\n sourceType: _optionAssertions.assertSourceType,\n wrapPluginVisitorMethod: _optionAssertions.assertFunction,\n highlightCode: _optionAssertions.assertBoolean,\n sourceMaps: _optionAssertions.assertSourceMaps,\n sourceMap: _optionAssertions.assertSourceMaps,\n sourceFileName: _optionAssertions.assertString,\n sourceRoot: _optionAssertions.assertString,\n getModuleId: _optionAssertions.assertFunction,\n moduleRoot: _optionAssertions.assertString,\n moduleIds: _optionAssertions.assertBoolean,\n moduleId: _optionAssertions.assertString,\n parserOpts: _optionAssertions.assertObject,\n generatorOpts: _optionAssertions.assertObject\n};\n\nfunction getSource(loc) {\n return loc.type === \"root\" ? loc.source : getSource(loc.parent);\n}\n\nfunction validate(type, opts) {\n return validateNested({\n type: \"root\",\n source: type\n }, opts);\n}\n\nfunction validateNested(loc, opts) {\n const type = getSource(loc);\n assertNoDuplicateSourcemap(opts);\n Object.keys(opts).forEach(key => {\n const optLoc = {\n type: \"option\",\n name: key,\n parent: loc\n };\n\n if (type === \"preset\" && NONPRESET_VALIDATORS[key]) {\n throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in preset options`);\n }\n\n if (type !== \"arguments\" && ROOT_VALIDATORS[key]) {\n throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options`);\n }\n\n if (type !== \"arguments\" && type !== \"configfile\" && BABELRC_VALIDATORS[key]) {\n if (type === \"babelrcfile\" || type === \"extendsfile\") {\n throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in .babelrc or \"extends\"ed files, only in root programmatic options, ` + `or babel.config.js/config file options`);\n }\n\n throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options, or babel.config.js/config file options`);\n }\n\n const validator = COMMON_VALIDATORS[key] || NONPRESET_VALIDATORS[key] || BABELRC_VALIDATORS[key] || ROOT_VALIDATORS[key] || throwUnknownError;\n validator(optLoc, opts[key]);\n });\n return opts;\n}\n\nfunction throwUnknownError(loc) {\n const key = loc.name;\n\n if (_removed.default[key]) {\n const {\n message,\n version = 5\n } = _removed.default[key];\n throw new Error(`Using removed Babel ${version} option: ${(0, _optionAssertions.msg)(loc)} - ${message}`);\n } else {\n const unknownOptErr = new Error(`Unknown option: ${(0, _optionAssertions.msg)(loc)}. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.`);\n unknownOptErr.code = \"BABEL_UNKNOWN_OPTION\";\n throw unknownOptErr;\n }\n}\n\nfunction has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nfunction assertNoDuplicateSourcemap(opts) {\n if (has(opts, \"sourceMap\") && has(opts, \"sourceMaps\")) {\n throw new Error(\".sourceMap is an alias for .sourceMaps, cannot use both\");\n }\n}\n\nfunction assertEnvSet(loc, value) {\n if (loc.parent.type === \"env\") {\n throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside of another .env block`);\n }\n\n const parent = loc.parent;\n const obj = (0, _optionAssertions.assertObject)(loc, value);\n\n if (obj) {\n for (const envName of Object.keys(obj)) {\n const env = (0, _optionAssertions.assertObject)((0, _optionAssertions.access)(loc, envName), obj[envName]);\n if (!env) continue;\n const envLoc = {\n type: \"env\",\n name: envName,\n parent\n };\n validateNested(envLoc, env);\n }\n }\n\n return obj;\n}\n\nfunction assertOverridesList(loc, value) {\n if (loc.parent.type === \"env\") {\n throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .env block`);\n }\n\n if (loc.parent.type === \"overrides\") {\n throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .overrides block`);\n }\n\n const parent = loc.parent;\n const arr = (0, _optionAssertions.assertArray)(loc, value);\n\n if (arr) {\n for (const [index, item] of arr.entries()) {\n const objLoc = (0, _optionAssertions.access)(loc, index);\n const env = (0, _optionAssertions.assertObject)(objLoc, item);\n if (!env) throw new Error(`${(0, _optionAssertions.msg)(objLoc)} must be an object`);\n const overridesLoc = {\n type: \"overrides\",\n index,\n parent\n };\n validateNested(overridesLoc, env);\n }\n }\n\n return arr;\n}\n\nfunction checkNoUnwrappedItemOptionPairs(items, index, type, e) {\n if (index === 0) return;\n const lastItem = items[index - 1];\n const thisItem = items[index];\n\n if (lastItem.file && lastItem.options === undefined && typeof thisItem.value === \"object\") {\n e.message += `\\n- Maybe you meant to use\\n` + `\"${type}\": [\\n [\"${lastItem.file.request}\", ${JSON.stringify(thisItem.value, undefined, 2)}]\\n]\\n` + `To be a valid ${type}, its name and options should be wrapped in a pair of brackets`;\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.validatePluginObject = validatePluginObject;\n\nvar _optionAssertions = require(\"./option-assertions\");\n\nconst VALIDATORS = {\n name: _optionAssertions.assertString,\n manipulateOptions: _optionAssertions.assertFunction,\n pre: _optionAssertions.assertFunction,\n post: _optionAssertions.assertFunction,\n inherits: _optionAssertions.assertFunction,\n visitor: assertVisitorMap,\n parserOverride: _optionAssertions.assertFunction,\n generatorOverride: _optionAssertions.assertFunction\n};\n\nfunction assertVisitorMap(loc, value) {\n const obj = (0, _optionAssertions.assertObject)(loc, value);\n\n if (obj) {\n Object.keys(obj).forEach(prop => assertVisitorHandler(prop, obj[prop]));\n\n if (obj.enter || obj.exit) {\n throw new Error(`${(0, _optionAssertions.msg)(loc)} cannot contain catch-all \"enter\" or \"exit\" handlers. Please target individual nodes.`);\n }\n }\n\n return obj;\n}\n\nfunction assertVisitorHandler(key, value) {\n if (value && typeof value === \"object\") {\n Object.keys(value).forEach(handler => {\n if (handler !== \"enter\" && handler !== \"exit\") {\n throw new Error(`.visitor[\"${key}\"] may only have .enter and/or .exit handlers.`);\n }\n });\n } else if (typeof value !== \"function\") {\n throw new Error(`.visitor[\"${key}\"] must be a function`);\n }\n\n return value;\n}\n\nfunction validatePluginObject(obj) {\n const rootPath = {\n type: \"root\",\n source: \"plugin\"\n };\n Object.keys(obj).forEach(key => {\n const validator = VALIDATORS[key];\n\n if (validator) {\n const optLoc = {\n type: \"option\",\n name: key,\n parent: rootPath\n };\n validator(optLoc, obj[key]);\n } else {\n const invalidPluginPropertyError = new Error(`.${key} is not a valid Plugin property`);\n invalidPluginPropertyError.code = \"BABEL_UNKNOWN_PLUGIN_PROPERTY\";\n throw invalidPluginPropertyError;\n }\n });\n return obj;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = {\n auxiliaryComment: {\n message: \"Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`\"\n },\n blacklist: {\n message: \"Put the specific transforms you want in the `plugins` option\"\n },\n breakConfig: {\n message: \"This is not a necessary option in Babel 6\"\n },\n experimental: {\n message: \"Put the specific transforms you want in the `plugins` option\"\n },\n externalHelpers: {\n message: \"Use the `external-helpers` plugin instead. \" + \"Check out http://babeljs.io/docs/plugins/external-helpers/\"\n },\n extra: {\n message: \"\"\n },\n jsxPragma: {\n message: \"use the `pragma` option in the `react-jsx` plugin. \" + \"Check out http://babeljs.io/docs/plugins/transform-react-jsx/\"\n },\n loose: {\n message: \"Specify the `loose` option for the relevant plugin you are using \" + \"or use a preset that sets the option.\"\n },\n metadataUsedHelpers: {\n message: \"Not required anymore as this is enabled by default\"\n },\n modules: {\n message: \"Use the corresponding module transform plugin in the `plugins` option. \" + \"Check out http://babeljs.io/docs/plugins/#modules\"\n },\n nonStandard: {\n message: \"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. \" + \"Also check out the react preset http://babeljs.io/docs/plugins/preset-react/\"\n },\n optional: {\n message: \"Put the specific transforms you want in the `plugins` option\"\n },\n sourceMapName: {\n message: \"The `sourceMapName` option has been removed because it makes more sense for the \" + \"tooling that calls Babel to assign `map.file` themselves.\"\n },\n stage: {\n message: \"Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets\"\n },\n whitelist: {\n message: \"Put the specific transforms you want in the `plugins` option\"\n },\n resolveModuleSource: {\n version: 6,\n message: \"Use `babel-plugin-module-resolver@3`'s 'resolvePath' options\"\n },\n metadata: {\n version: 6,\n message: \"Generated plugin metadata is always included in the output result\"\n },\n sourceMapTarget: {\n version: 6,\n message: \"The `sourceMapTarget` option has been removed because it makes more sense for the tooling \" + \"that calls Babel to assign `map.file` themselves.\"\n }\n};\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.maybeAsync = maybeAsync;\nexports.forwardAsync = forwardAsync;\nexports.isThenable = isThenable;\nexports.waitFor = exports.onFirstPause = exports.isAsync = void 0;\n\nfunction _gensync() {\n const data = _interopRequireDefault(require(\"gensync\"));\n\n _gensync = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst id = x => x;\n\nconst runGenerator = (0, _gensync().default)(function* (item) {\n return yield* item;\n});\nconst isAsync = (0, _gensync().default)({\n sync: () => false,\n errback: cb => cb(null, true)\n});\nexports.isAsync = isAsync;\n\nfunction maybeAsync(fn, message) {\n return (0, _gensync().default)({\n sync(...args) {\n const result = fn.apply(this, args);\n if (isThenable(result)) throw new Error(message);\n return result;\n },\n\n async(...args) {\n return Promise.resolve(fn.apply(this, args));\n }\n\n });\n}\n\nconst withKind = (0, _gensync().default)({\n sync: cb => cb(\"sync\"),\n async: cb => cb(\"async\")\n});\n\nfunction forwardAsync(action, cb) {\n const g = (0, _gensync().default)(action);\n return withKind(kind => {\n const adapted = g[kind];\n return cb(adapted);\n });\n}\n\nconst onFirstPause = (0, _gensync().default)({\n name: \"onFirstPause\",\n arity: 2,\n sync: function (item) {\n return runGenerator.sync(item);\n },\n errback: function (item, firstPause, cb) {\n let completed = false;\n runGenerator.errback(item, (err, value) => {\n completed = true;\n cb(err, value);\n });\n\n if (!completed) {\n firstPause();\n }\n }\n});\nexports.onFirstPause = onFirstPause;\nconst waitFor = (0, _gensync().default)({\n sync: id,\n async: id\n});\nexports.waitFor = waitFor;\n\nfunction isThenable(val) {\n return !!val && (typeof val === \"object\" || typeof val === \"function\") && !!val.then && typeof val.then === \"function\";\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.stat = exports.exists = exports.readFile = void 0;\n\nfunction _fs() {\n const data = _interopRequireDefault(require(\"fs\"));\n\n _fs = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _gensync() {\n const data = _interopRequireDefault(require(\"gensync\"));\n\n _gensync = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst readFile = (0, _gensync().default)({\n sync: _fs().default.readFileSync,\n errback: _fs().default.readFile\n});\nexports.readFile = readFile;\nconst exists = (0, _gensync().default)({\n sync(path) {\n try {\n _fs().default.accessSync(path);\n\n return true;\n } catch (_unused) {\n return false;\n }\n },\n\n errback: (path, cb) => _fs().default.access(path, undefined, err => cb(null, !err))\n});\nexports.exists = exists;\nconst stat = (0, _gensync().default)({\n sync: _fs().default.statSync,\n errback: _fs().default.stat\n});\nexports.stat = stat;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction _resolve() {\n const data = _interopRequireDefault(require(\"resolve\"));\n\n _resolve = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _gensync() {\n const data = _interopRequireDefault(require(\"gensync\"));\n\n _gensync = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _default = (0, _gensync().default)({\n sync: _resolve().default.sync,\n errback: _resolve().default\n});\n\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Plugin = Plugin;\nObject.defineProperty(exports, \"File\", {\n enumerable: true,\n get: function () {\n return _file.default;\n }\n});\nObject.defineProperty(exports, \"buildExternalHelpers\", {\n enumerable: true,\n get: function () {\n return _buildExternalHelpers.default;\n }\n});\nObject.defineProperty(exports, \"resolvePlugin\", {\n enumerable: true,\n get: function () {\n return _files.resolvePlugin;\n }\n});\nObject.defineProperty(exports, \"resolvePreset\", {\n enumerable: true,\n get: function () {\n return _files.resolvePreset;\n }\n});\nObject.defineProperty(exports, \"version\", {\n enumerable: true,\n get: function () {\n return _package.version;\n }\n});\nObject.defineProperty(exports, \"getEnv\", {\n enumerable: true,\n get: function () {\n return _environment.getEnv;\n }\n});\nObject.defineProperty(exports, \"tokTypes\", {\n enumerable: true,\n get: function () {\n return _parser().tokTypes;\n }\n});\nObject.defineProperty(exports, \"traverse\", {\n enumerable: true,\n get: function () {\n return _traverse().default;\n }\n});\nObject.defineProperty(exports, \"template\", {\n enumerable: true,\n get: function () {\n return _template().default;\n }\n});\nObject.defineProperty(exports, \"createConfigItem\", {\n enumerable: true,\n get: function () {\n return _item.createConfigItem;\n }\n});\nObject.defineProperty(exports, \"loadPartialConfig\", {\n enumerable: true,\n get: function () {\n return _config.loadPartialConfig;\n }\n});\nObject.defineProperty(exports, \"loadPartialConfigSync\", {\n enumerable: true,\n get: function () {\n return _config.loadPartialConfigSync;\n }\n});\nObject.defineProperty(exports, \"loadPartialConfigAsync\", {\n enumerable: true,\n get: function () {\n return _config.loadPartialConfigAsync;\n }\n});\nObject.defineProperty(exports, \"loadOptions\", {\n enumerable: true,\n get: function () {\n return _config.loadOptions;\n }\n});\nObject.defineProperty(exports, \"loadOptionsSync\", {\n enumerable: true,\n get: function () {\n return _config.loadOptionsSync;\n }\n});\nObject.defineProperty(exports, \"loadOptionsAsync\", {\n enumerable: true,\n get: function () {\n return _config.loadOptionsAsync;\n }\n});\nObject.defineProperty(exports, \"transform\", {\n enumerable: true,\n get: function () {\n return _transform.transform;\n }\n});\nObject.defineProperty(exports, \"transformSync\", {\n enumerable: true,\n get: function () {\n return _transform.transformSync;\n }\n});\nObject.defineProperty(exports, \"transformAsync\", {\n enumerable: true,\n get: function () {\n return _transform.transformAsync;\n }\n});\nObject.defineProperty(exports, \"transformFile\", {\n enumerable: true,\n get: function () {\n return _transformFile.transformFile;\n }\n});\nObject.defineProperty(exports, \"transformFileSync\", {\n enumerable: true,\n get: function () {\n return _transformFile.transformFileSync;\n }\n});\nObject.defineProperty(exports, \"transformFileAsync\", {\n enumerable: true,\n get: function () {\n return _transformFile.transformFileAsync;\n }\n});\nObject.defineProperty(exports, \"transformFromAst\", {\n enumerable: true,\n get: function () {\n return _transformAst.transformFromAst;\n }\n});\nObject.defineProperty(exports, \"transformFromAstSync\", {\n enumerable: true,\n get: function () {\n return _transformAst.transformFromAstSync;\n }\n});\nObject.defineProperty(exports, \"transformFromAstAsync\", {\n enumerable: true,\n get: function () {\n return _transformAst.transformFromAstAsync;\n }\n});\nObject.defineProperty(exports, \"parse\", {\n enumerable: true,\n get: function () {\n return _parse.parse;\n }\n});\nObject.defineProperty(exports, \"parseSync\", {\n enumerable: true,\n get: function () {\n return _parse.parseSync;\n }\n});\nObject.defineProperty(exports, \"parseAsync\", {\n enumerable: true,\n get: function () {\n return _parse.parseAsync;\n }\n});\nexports.types = exports.OptionManager = exports.DEFAULT_EXTENSIONS = void 0;\n\nvar _file = _interopRequireDefault(require(\"./transformation/file/file\"));\n\nvar _buildExternalHelpers = _interopRequireDefault(require(\"./tools/build-external-helpers\"));\n\nvar _files = require(\"./config/files\");\n\nvar _package = require(\"../package.json\");\n\nvar _environment = require(\"./config/helpers/environment\");\n\nfunction _types() {\n const data = _interopRequireWildcard(require(\"@babel/types\"));\n\n _types = function () {\n return data;\n };\n\n return data;\n}\n\nObject.defineProperty(exports, \"types\", {\n enumerable: true,\n get: function () {\n return _types();\n }\n});\n\nfunction _parser() {\n const data = require(\"@babel/parser\");\n\n _parser = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _traverse() {\n const data = _interopRequireDefault(require(\"@babel/traverse\"));\n\n _traverse = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _template() {\n const data = _interopRequireDefault(require(\"@babel/template\"));\n\n _template = function () {\n return data;\n };\n\n return data;\n}\n\nvar _item = require(\"./config/item\");\n\nvar _config = require(\"./config\");\n\nvar _transform = require(\"./transform\");\n\nvar _transformFile = require(\"./transform-file\");\n\nvar _transformAst = require(\"./transform-ast\");\n\nvar _parse = require(\"./parse\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst DEFAULT_EXTENSIONS = Object.freeze([\".js\", \".jsx\", \".es6\", \".es\", \".mjs\"]);\nexports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;\n\nclass OptionManager {\n init(opts) {\n return (0, _config.loadOptions)(opts);\n }\n\n}\n\nexports.OptionManager = OptionManager;\n\nfunction Plugin(alias) {\n throw new Error(`The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.parseAsync = exports.parseSync = exports.parse = void 0;\n\nfunction _gensync() {\n const data = _interopRequireDefault(require(\"gensync\"));\n\n _gensync = function () {\n return data;\n };\n\n return data;\n}\n\nvar _config = _interopRequireDefault(require(\"./config\"));\n\nvar _parser = _interopRequireDefault(require(\"./parser\"));\n\nvar _normalizeOpts = _interopRequireDefault(require(\"./transformation/normalize-opts\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst parseRunner = (0, _gensync().default)(function* parse(code, opts) {\n const config = yield* (0, _config.default)(opts);\n\n if (config === null) {\n return null;\n }\n\n return yield* (0, _parser.default)(config.passes, (0, _normalizeOpts.default)(config), code);\n});\n\nconst parse = function parse(code, opts, callback) {\n if (typeof opts === \"function\") {\n callback = opts;\n opts = undefined;\n }\n\n if (callback === undefined) return parseRunner.sync(code, opts);\n parseRunner.errback(code, opts, callback);\n};\n\nexports.parse = parse;\nconst parseSync = parseRunner.sync;\nexports.parseSync = parseSync;\nconst parseAsync = parseRunner.async;\nexports.parseAsync = parseAsync;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = parser;\n\nfunction _parser() {\n const data = require(\"@babel/parser\");\n\n _parser = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _codeFrame() {\n const data = require(\"@babel/code-frame\");\n\n _codeFrame = function () {\n return data;\n };\n\n return data;\n}\n\nvar _missingPluginHelper = _interopRequireDefault(require(\"./util/missing-plugin-helper\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction* parser(pluginPasses, {\n parserOpts,\n highlightCode = true,\n filename = \"unknown\"\n}, code) {\n try {\n const results = [];\n\n for (const plugins of pluginPasses) {\n for (const plugin of plugins) {\n const {\n parserOverride\n } = plugin;\n\n if (parserOverride) {\n const ast = parserOverride(code, parserOpts, _parser().parse);\n if (ast !== undefined) results.push(ast);\n }\n }\n }\n\n if (results.length === 0) {\n return (0, _parser().parse)(code, parserOpts);\n } else if (results.length === 1) {\n yield* [];\n\n if (typeof results[0].then === \"function\") {\n throw new Error(`You appear to be using an async parser plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`);\n }\n\n return results[0];\n }\n\n throw new Error(\"More than one plugin attempted to override parsing.\");\n } catch (err) {\n if (err.code === \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\") {\n err.message += \"\\nConsider renaming the file to '.mjs', or setting sourceType:module \" + \"or sourceType:unambiguous in your Babel config for this file.\";\n }\n\n const {\n loc,\n missingPlugin\n } = err;\n\n if (loc) {\n const codeFrame = (0, _codeFrame().codeFrameColumns)(code, {\n start: {\n line: loc.line,\n column: loc.column + 1\n }\n }, {\n highlightCode\n });\n\n if (missingPlugin) {\n err.message = `${filename}: ` + (0, _missingPluginHelper.default)(missingPlugin[0], loc, codeFrame);\n } else {\n err.message = `${filename}: ${err.message}\\n\\n` + codeFrame;\n }\n\n err.code = \"BABEL_PARSE_ERROR\";\n }\n\n throw err;\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = generateMissingPluginMessage;\nconst pluginNameMap = {\n classProperties: {\n syntax: {\n name: \"@babel/plugin-syntax-class-properties\",\n url: \"https://git.io/vb4yQ\"\n },\n transform: {\n name: \"@babel/plugin-proposal-class-properties\",\n url: \"https://git.io/vb4SL\"\n }\n },\n classPrivateProperties: {\n syntax: {\n name: \"@babel/plugin-syntax-class-properties\",\n url: \"https://git.io/vb4yQ\"\n },\n transform: {\n name: \"@babel/plugin-proposal-class-properties\",\n url: \"https://git.io/vb4SL\"\n }\n },\n classPrivateMethods: {\n syntax: {\n name: \"@babel/plugin-syntax-class-properties\",\n url: \"https://git.io/vb4yQ\"\n },\n transform: {\n name: \"@babel/plugin-proposal-private-methods\",\n url: \"https://git.io/JvpRG\"\n }\n },\n classStaticBlock: {\n syntax: {\n name: \"@babel/plugin-syntax-class-static-block\",\n url: \"https://git.io/JTLB6\"\n },\n transform: {\n name: \"@babel/plugin-proposal-class-static-block\",\n url: \"https://git.io/JTLBP\"\n }\n },\n decimal: {\n syntax: {\n name: \"@babel/plugin-syntax-decimal\",\n url: \"https://git.io/JfKOH\"\n }\n },\n decorators: {\n syntax: {\n name: \"@babel/plugin-syntax-decorators\",\n url: \"https://git.io/vb4y9\"\n },\n transform: {\n name: \"@babel/plugin-proposal-decorators\",\n url: \"https://git.io/vb4ST\"\n }\n },\n doExpressions: {\n syntax: {\n name: \"@babel/plugin-syntax-do-expressions\",\n url: \"https://git.io/vb4yh\"\n },\n transform: {\n name: \"@babel/plugin-proposal-do-expressions\",\n url: \"https://git.io/vb4S3\"\n }\n },\n dynamicImport: {\n syntax: {\n name: \"@babel/plugin-syntax-dynamic-import\",\n url: \"https://git.io/vb4Sv\"\n }\n },\n exportDefaultFrom: {\n syntax: {\n name: \"@babel/plugin-syntax-export-default-from\",\n url: \"https://git.io/vb4SO\"\n },\n transform: {\n name: \"@babel/plugin-proposal-export-default-from\",\n url: \"https://git.io/vb4yH\"\n }\n },\n exportNamespaceFrom: {\n syntax: {\n name: \"@babel/plugin-syntax-export-namespace-from\",\n url: \"https://git.io/vb4Sf\"\n },\n transform: {\n name: \"@babel/plugin-proposal-export-namespace-from\",\n url: \"https://git.io/vb4SG\"\n }\n },\n flow: {\n syntax: {\n name: \"@babel/plugin-syntax-flow\",\n url: \"https://git.io/vb4yb\"\n },\n transform: {\n name: \"@babel/preset-flow\",\n url: \"https://git.io/JfeDn\"\n }\n },\n functionBind: {\n syntax: {\n name: \"@babel/plugin-syntax-function-bind\",\n url: \"https://git.io/vb4y7\"\n },\n transform: {\n name: \"@babel/plugin-proposal-function-bind\",\n url: \"https://git.io/vb4St\"\n }\n },\n functionSent: {\n syntax: {\n name: \"@babel/plugin-syntax-function-sent\",\n url: \"https://git.io/vb4yN\"\n },\n transform: {\n name: \"@babel/plugin-proposal-function-sent\",\n url: \"https://git.io/vb4SZ\"\n }\n },\n importMeta: {\n syntax: {\n name: \"@babel/plugin-syntax-import-meta\",\n url: \"https://git.io/vbKK6\"\n }\n },\n jsx: {\n syntax: {\n name: \"@babel/plugin-syntax-jsx\",\n url: \"https://git.io/vb4yA\"\n },\n transform: {\n name: \"@babel/preset-react\",\n url: \"https://git.io/JfeDR\"\n }\n },\n importAssertions: {\n syntax: {\n name: \"@babel/plugin-syntax-import-assertions\",\n url: \"https://git.io/JUbkv\"\n }\n },\n moduleStringNames: {\n syntax: {\n name: \"@babel/plugin-syntax-module-string-names\",\n url: \"https://git.io/JTL8G\"\n }\n },\n numericSeparator: {\n syntax: {\n name: \"@babel/plugin-syntax-numeric-separator\",\n url: \"https://git.io/vb4Sq\"\n },\n transform: {\n name: \"@babel/plugin-proposal-numeric-separator\",\n url: \"https://git.io/vb4yS\"\n }\n },\n optionalChaining: {\n syntax: {\n name: \"@babel/plugin-syntax-optional-chaining\",\n url: \"https://git.io/vb4Sc\"\n },\n transform: {\n name: \"@babel/plugin-proposal-optional-chaining\",\n url: \"https://git.io/vb4Sk\"\n }\n },\n pipelineOperator: {\n syntax: {\n name: \"@babel/plugin-syntax-pipeline-operator\",\n url: \"https://git.io/vb4yj\"\n },\n transform: {\n name: \"@babel/plugin-proposal-pipeline-operator\",\n url: \"https://git.io/vb4SU\"\n }\n },\n privateIn: {\n syntax: {\n name: \"@babel/plugin-syntax-private-property-in-object\",\n url: \"https://git.io/JfK3q\"\n },\n transform: {\n name: \"@babel/plugin-proposal-private-property-in-object\",\n url: \"https://git.io/JfK3O\"\n }\n },\n recordAndTuple: {\n syntax: {\n name: \"@babel/plugin-syntax-record-and-tuple\",\n url: \"https://git.io/JvKp3\"\n }\n },\n throwExpressions: {\n syntax: {\n name: \"@babel/plugin-syntax-throw-expressions\",\n url: \"https://git.io/vb4SJ\"\n },\n transform: {\n name: \"@babel/plugin-proposal-throw-expressions\",\n url: \"https://git.io/vb4yF\"\n }\n },\n typescript: {\n syntax: {\n name: \"@babel/plugin-syntax-typescript\",\n url: \"https://git.io/vb4SC\"\n },\n transform: {\n name: \"@babel/preset-typescript\",\n url: \"https://git.io/JfeDz\"\n }\n },\n asyncGenerators: {\n syntax: {\n name: \"@babel/plugin-syntax-async-generators\",\n url: \"https://git.io/vb4SY\"\n },\n transform: {\n name: \"@babel/plugin-proposal-async-generator-functions\",\n url: \"https://git.io/vb4yp\"\n }\n },\n logicalAssignment: {\n syntax: {\n name: \"@babel/plugin-syntax-logical-assignment-operators\",\n url: \"https://git.io/vAlBp\"\n },\n transform: {\n name: \"@babel/plugin-proposal-logical-assignment-operators\",\n url: \"https://git.io/vAlRe\"\n }\n },\n nullishCoalescingOperator: {\n syntax: {\n name: \"@babel/plugin-syntax-nullish-coalescing-operator\",\n url: \"https://git.io/vb4yx\"\n },\n transform: {\n name: \"@babel/plugin-proposal-nullish-coalescing-operator\",\n url: \"https://git.io/vb4Se\"\n }\n },\n objectRestSpread: {\n syntax: {\n name: \"@babel/plugin-syntax-object-rest-spread\",\n url: \"https://git.io/vb4y5\"\n },\n transform: {\n name: \"@babel/plugin-proposal-object-rest-spread\",\n url: \"https://git.io/vb4Ss\"\n }\n },\n optionalCatchBinding: {\n syntax: {\n name: \"@babel/plugin-syntax-optional-catch-binding\",\n url: \"https://git.io/vb4Sn\"\n },\n transform: {\n name: \"@babel/plugin-proposal-optional-catch-binding\",\n url: \"https://git.io/vb4SI\"\n }\n }\n};\npluginNameMap.privateIn.syntax = pluginNameMap.privateIn.transform;\n\nconst getNameURLCombination = ({\n name,\n url\n}) => `${name} (${url})`;\n\nfunction generateMissingPluginMessage(missingPluginName, loc, codeFrame) {\n let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` + `(${loc.line}:${loc.column + 1}):\\n\\n` + codeFrame;\n const pluginInfo = pluginNameMap[missingPluginName];\n\n if (pluginInfo) {\n const {\n syntax: syntaxPlugin,\n transform: transformPlugin\n } = pluginInfo;\n\n if (syntaxPlugin) {\n const syntaxPluginInfo = getNameURLCombination(syntaxPlugin);\n\n if (transformPlugin) {\n const transformPluginInfo = getNameURLCombination(transformPlugin);\n const sectionType = transformPlugin.name.startsWith(\"@babel/plugin\") ? \"plugins\" : \"presets\";\n helpMessage += `\\n\\nAdd ${transformPluginInfo} to the '${sectionType}' section of your Babel config to enable transformation.\nIf you want to leave it as-is, add ${syntaxPluginInfo} to the 'plugins' section to enable parsing.`;\n } else {\n helpMessage += `\\n\\nAdd ${syntaxPluginInfo} to the 'plugins' section of your Babel config ` + `to enable parsing.`;\n }\n }\n }\n\n return helpMessage;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\n\nfunction helpers() {\n const data = _interopRequireWildcard(require(\"@babel/helpers\"));\n\n helpers = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _generator() {\n const data = _interopRequireDefault(require(\"@babel/generator\"));\n\n _generator = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _template() {\n const data = _interopRequireDefault(require(\"@babel/template\"));\n\n _template = function () {\n return data;\n };\n\n return data;\n}\n\nfunction t() {\n const data = _interopRequireWildcard(require(\"@babel/types\"));\n\n t = function () {\n return data;\n };\n\n return data;\n}\n\nvar _file = _interopRequireDefault(require(\"../transformation/file/file\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nconst buildUmdWrapper = replacements => (0, _template().default)`\n (function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === \"object\") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n `(replacements);\n\nfunction buildGlobal(allowlist) {\n const namespace = t().identifier(\"babelHelpers\");\n const body = [];\n const container = t().functionExpression(null, [t().identifier(\"global\")], t().blockStatement(body));\n const tree = t().program([t().expressionStatement(t().callExpression(container, [t().conditionalExpression(t().binaryExpression(\"===\", t().unaryExpression(\"typeof\", t().identifier(\"global\")), t().stringLiteral(\"undefined\")), t().identifier(\"self\"), t().identifier(\"global\"))]))]);\n body.push(t().variableDeclaration(\"var\", [t().variableDeclarator(namespace, t().assignmentExpression(\"=\", t().memberExpression(t().identifier(\"global\"), namespace), t().objectExpression([])))]));\n buildHelpers(body, namespace, allowlist);\n return tree;\n}\n\nfunction buildModule(allowlist) {\n const body = [];\n const refs = buildHelpers(body, null, allowlist);\n body.unshift(t().exportNamedDeclaration(null, Object.keys(refs).map(name => {\n return t().exportSpecifier(t().cloneNode(refs[name]), t().identifier(name));\n })));\n return t().program(body, [], \"module\");\n}\n\nfunction buildUmd(allowlist) {\n const namespace = t().identifier(\"babelHelpers\");\n const body = [];\n body.push(t().variableDeclaration(\"var\", [t().variableDeclarator(namespace, t().identifier(\"global\"))]));\n buildHelpers(body, namespace, allowlist);\n return t().program([buildUmdWrapper({\n FACTORY_PARAMETERS: t().identifier(\"global\"),\n BROWSER_ARGUMENTS: t().assignmentExpression(\"=\", t().memberExpression(t().identifier(\"root\"), namespace), t().objectExpression([])),\n COMMON_ARGUMENTS: t().identifier(\"exports\"),\n AMD_ARGUMENTS: t().arrayExpression([t().stringLiteral(\"exports\")]),\n FACTORY_BODY: body,\n UMD_ROOT: t().identifier(\"this\")\n })]);\n}\n\nfunction buildVar(allowlist) {\n const namespace = t().identifier(\"babelHelpers\");\n const body = [];\n body.push(t().variableDeclaration(\"var\", [t().variableDeclarator(namespace, t().objectExpression([]))]));\n const tree = t().program(body);\n buildHelpers(body, namespace, allowlist);\n body.push(t().expressionStatement(namespace));\n return tree;\n}\n\nfunction buildHelpers(body, namespace, allowlist) {\n const getHelperReference = name => {\n return namespace ? t().memberExpression(namespace, t().identifier(name)) : t().identifier(`_${name}`);\n };\n\n const refs = {};\n helpers().list.forEach(function (name) {\n if (allowlist && allowlist.indexOf(name) < 0) return;\n const ref = refs[name] = getHelperReference(name);\n helpers().ensure(name, _file.default);\n const {\n nodes\n } = helpers().get(name, getHelperReference, ref);\n body.push(...nodes);\n });\n return refs;\n}\n\nfunction _default(allowlist, outputType = \"global\") {\n let tree;\n const build = {\n global: buildGlobal,\n module: buildModule,\n umd: buildUmd,\n var: buildVar\n }[outputType];\n\n if (build) {\n tree = build(allowlist);\n } else {\n throw new Error(`Unsupported output type ${outputType}`);\n }\n\n return (0, _generator().default)(tree).code;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.transformFromAstAsync = exports.transformFromAstSync = exports.transformFromAst = void 0;\n\nfunction _gensync() {\n const data = _interopRequireDefault(require(\"gensync\"));\n\n _gensync = function () {\n return data;\n };\n\n return data;\n}\n\nvar _config = _interopRequireDefault(require(\"./config\"));\n\nvar _transformation = require(\"./transformation\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst transformFromAstRunner = (0, _gensync().default)(function* (ast, code, opts) {\n const config = yield* (0, _config.default)(opts);\n if (config === null) return null;\n if (!ast) throw new Error(\"No AST given\");\n return yield* (0, _transformation.run)(config, code, ast);\n});\n\nconst transformFromAst = function transformFromAst(ast, code, opts, callback) {\n if (typeof opts === \"function\") {\n callback = opts;\n opts = undefined;\n }\n\n if (callback === undefined) {\n return transformFromAstRunner.sync(ast, code, opts);\n }\n\n transformFromAstRunner.errback(ast, code, opts, callback);\n};\n\nexports.transformFromAst = transformFromAst;\nconst transformFromAstSync = transformFromAstRunner.sync;\nexports.transformFromAstSync = transformFromAstSync;\nconst transformFromAstAsync = transformFromAstRunner.async;\nexports.transformFromAstAsync = transformFromAstAsync;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.transformFileAsync = exports.transformFileSync = exports.transformFile = void 0;\n\nfunction _gensync() {\n const data = _interopRequireDefault(require(\"gensync\"));\n\n _gensync = function () {\n return data;\n };\n\n return data;\n}\n\nvar _config = _interopRequireDefault(require(\"./config\"));\n\nvar _transformation = require(\"./transformation\");\n\nvar fs = _interopRequireWildcard(require(\"./gensync-utils/fs\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n({});\nconst transformFileRunner = (0, _gensync().default)(function* (filename, opts) {\n const options = Object.assign({}, opts, {\n filename\n });\n const config = yield* (0, _config.default)(options);\n if (config === null) return null;\n const code = yield* fs.readFile(filename, \"utf8\");\n return yield* (0, _transformation.run)(config, code);\n});\nconst transformFile = transformFileRunner.errback;\nexports.transformFile = transformFile;\nconst transformFileSync = transformFileRunner.sync;\nexports.transformFileSync = transformFileSync;\nconst transformFileAsync = transformFileRunner.async;\nexports.transformFileAsync = transformFileAsync;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.transformAsync = exports.transformSync = exports.transform = void 0;\n\nfunction _gensync() {\n const data = _interopRequireDefault(require(\"gensync\"));\n\n _gensync = function () {\n return data;\n };\n\n return data;\n}\n\nvar _config = _interopRequireDefault(require(\"./config\"));\n\nvar _transformation = require(\"./transformation\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst transformRunner = (0, _gensync().default)(function* transform(code, opts) {\n const config = yield* (0, _config.default)(opts);\n if (config === null) return null;\n return yield* (0, _transformation.run)(config, code);\n});\n\nconst transform = function transform(code, opts, callback) {\n if (typeof opts === \"function\") {\n callback = opts;\n opts = undefined;\n }\n\n if (callback === undefined) return transformRunner.sync(code, opts);\n transformRunner.errback(code, opts, callback);\n};\n\nexports.transform = transform;\nconst transformSync = transformRunner.sync;\nexports.transformSync = transformSync;\nconst transformAsync = transformRunner.async;\nexports.transformAsync = transformAsync;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = loadBlockHoistPlugin;\n\nfunction _sortBy() {\n const data = _interopRequireDefault(require(\"lodash/sortBy\"));\n\n _sortBy = function () {\n return data;\n };\n\n return data;\n}\n\nvar _config = _interopRequireDefault(require(\"../config\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nlet LOADED_PLUGIN;\n\nfunction loadBlockHoistPlugin() {\n if (!LOADED_PLUGIN) {\n const config = _config.default.sync({\n babelrc: false,\n configFile: false,\n plugins: [blockHoistPlugin]\n });\n\n LOADED_PLUGIN = config ? config.passes[0][0] : undefined;\n if (!LOADED_PLUGIN) throw new Error(\"Assertion failure\");\n }\n\n return LOADED_PLUGIN;\n}\n\nconst blockHoistPlugin = {\n name: \"internal.blockHoist\",\n visitor: {\n Block: {\n exit({\n node\n }) {\n let hasChange = false;\n\n for (let i = 0; i < node.body.length; i++) {\n const bodyNode = node.body[i];\n\n if ((bodyNode == null ? void 0 : bodyNode._blockHoist) != null) {\n hasChange = true;\n break;\n }\n }\n\n if (!hasChange) return;\n node.body = (0, _sortBy().default)(node.body, function (bodyNode) {\n let priority = bodyNode == null ? void 0 : bodyNode._blockHoist;\n if (priority == null) priority = 1;\n if (priority === true) priority = 2;\n return -1 * priority;\n });\n }\n\n }\n }\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nfunction helpers() {\n const data = _interopRequireWildcard(require(\"@babel/helpers\"));\n\n helpers = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _traverse() {\n const data = _interopRequireWildcard(require(\"@babel/traverse\"));\n\n _traverse = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _codeFrame() {\n const data = require(\"@babel/code-frame\");\n\n _codeFrame = function () {\n return data;\n };\n\n return data;\n}\n\nfunction t() {\n const data = _interopRequireWildcard(require(\"@babel/types\"));\n\n t = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _helperModuleTransforms() {\n const data = require(\"@babel/helper-module-transforms\");\n\n _helperModuleTransforms = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _semver() {\n const data = _interopRequireDefault(require(\"semver\"));\n\n _semver = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nconst errorVisitor = {\n enter(path, state) {\n const loc = path.node.loc;\n\n if (loc) {\n state.loc = loc;\n path.stop();\n }\n }\n\n};\n\nclass File {\n constructor(options, {\n code,\n ast,\n inputMap\n }) {\n this._map = new Map();\n this.opts = void 0;\n this.declarations = {};\n this.path = null;\n this.ast = {};\n this.scope = void 0;\n this.metadata = {};\n this.code = \"\";\n this.inputMap = null;\n this.hub = {\n file: this,\n getCode: () => this.code,\n getScope: () => this.scope,\n addHelper: this.addHelper.bind(this),\n buildError: this.buildCodeFrameError.bind(this)\n };\n this.opts = options;\n this.code = code;\n this.ast = ast;\n this.inputMap = inputMap;\n this.path = _traverse().NodePath.get({\n hub: this.hub,\n parentPath: null,\n parent: this.ast,\n container: this.ast,\n key: \"program\"\n }).setContext();\n this.scope = this.path.scope;\n }\n\n get shebang() {\n const {\n interpreter\n } = this.path.node;\n return interpreter ? interpreter.value : \"\";\n }\n\n set shebang(value) {\n if (value) {\n this.path.get(\"interpreter\").replaceWith(t().interpreterDirective(value));\n } else {\n this.path.get(\"interpreter\").remove();\n }\n }\n\n set(key, val) {\n if (key === \"helpersNamespace\") {\n throw new Error(\"Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility.\" + \"If you are using @babel/plugin-external-helpers you will need to use a newer \" + \"version than the one you currently have installed. \" + \"If you have your own implementation, you'll want to explore using 'helperGenerator' \" + \"alongside 'file.availableHelper()'.\");\n }\n\n this._map.set(key, val);\n }\n\n get(key) {\n return this._map.get(key);\n }\n\n has(key) {\n return this._map.has(key);\n }\n\n getModuleName() {\n return (0, _helperModuleTransforms().getModuleName)(this.opts, this.opts);\n }\n\n addImport() {\n throw new Error(\"This API has been removed. If you're looking for this \" + \"functionality in Babel 7, you should import the \" + \"'@babel/helper-module-imports' module and use the functions exposed \" + \" from that module, such as 'addNamed' or 'addDefault'.\");\n }\n\n availableHelper(name, versionRange) {\n let minVersion;\n\n try {\n minVersion = helpers().minVersion(name);\n } catch (err) {\n if (err.code !== \"BABEL_HELPER_UNKNOWN\") throw err;\n return false;\n }\n\n if (typeof versionRange !== \"string\") return true;\n if (_semver().default.valid(versionRange)) versionRange = `^${versionRange}`;\n return !_semver().default.intersects(`<${minVersion}`, versionRange) && !_semver().default.intersects(`>=8.0.0`, versionRange);\n }\n\n addHelper(name) {\n const declar = this.declarations[name];\n if (declar) return t().cloneNode(declar);\n const generator = this.get(\"helperGenerator\");\n\n if (generator) {\n const res = generator(name);\n if (res) return res;\n }\n\n helpers().ensure(name, File);\n const uid = this.declarations[name] = this.scope.generateUidIdentifier(name);\n const dependencies = {};\n\n for (const dep of helpers().getDependencies(name)) {\n dependencies[dep] = this.addHelper(dep);\n }\n\n const {\n nodes,\n globals\n } = helpers().get(name, dep => dependencies[dep], uid, Object.keys(this.scope.getAllBindings()));\n globals.forEach(name => {\n if (this.path.scope.hasBinding(name, true)) {\n this.path.scope.rename(name);\n }\n });\n nodes.forEach(node => {\n node._compact = true;\n });\n this.path.unshiftContainer(\"body\", nodes);\n this.path.get(\"body\").forEach(path => {\n if (nodes.indexOf(path.node) === -1) return;\n if (path.isVariableDeclaration()) this.scope.registerDeclaration(path);\n });\n return uid;\n }\n\n addTemplateObject() {\n throw new Error(\"This function has been moved into the template literal transform itself.\");\n }\n\n buildCodeFrameError(node, msg, Error = SyntaxError) {\n let loc = node && (node.loc || node._loc);\n\n if (!loc && node) {\n const state = {\n loc: null\n };\n (0, _traverse().default)(node, errorVisitor, this.scope, state);\n loc = state.loc;\n let txt = \"This is an error on an internal node. Probably an internal error.\";\n if (loc) txt += \" Location has been estimated.\";\n msg += ` (${txt})`;\n }\n\n if (loc) {\n const {\n highlightCode = true\n } = this.opts;\n msg += \"\\n\" + (0, _codeFrame().codeFrameColumns)(this.code, {\n start: {\n line: loc.start.line,\n column: loc.start.column + 1\n },\n end: loc.end && loc.start.line === loc.end.line ? {\n line: loc.end.line,\n column: loc.end.column + 1\n } : undefined\n }, {\n highlightCode\n });\n }\n\n return new Error(msg);\n }\n\n}\n\nexports.default = File;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = generateCode;\n\nfunction _convertSourceMap() {\n const data = _interopRequireDefault(require(\"convert-source-map\"));\n\n _convertSourceMap = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _generator() {\n const data = _interopRequireDefault(require(\"@babel/generator\"));\n\n _generator = function () {\n return data;\n };\n\n return data;\n}\n\nvar _mergeMap = _interopRequireDefault(require(\"./merge-map\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction generateCode(pluginPasses, file) {\n const {\n opts,\n ast,\n code,\n inputMap\n } = file;\n const results = [];\n\n for (const plugins of pluginPasses) {\n for (const plugin of plugins) {\n const {\n generatorOverride\n } = plugin;\n\n if (generatorOverride) {\n const result = generatorOverride(ast, opts.generatorOpts, code, _generator().default);\n if (result !== undefined) results.push(result);\n }\n }\n }\n\n let result;\n\n if (results.length === 0) {\n result = (0, _generator().default)(ast, opts.generatorOpts, code);\n } else if (results.length === 1) {\n result = results[0];\n\n if (typeof result.then === \"function\") {\n throw new Error(`You appear to be using an async codegen plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version.`);\n }\n } else {\n throw new Error(\"More than one plugin attempted to override codegen.\");\n }\n\n let {\n code: outputCode,\n map: outputMap\n } = result;\n\n if (outputMap && inputMap) {\n outputMap = (0, _mergeMap.default)(inputMap.toObject(), outputMap);\n }\n\n if (opts.sourceMaps === \"inline\" || opts.sourceMaps === \"both\") {\n outputCode += \"\\n\" + _convertSourceMap().default.fromObject(outputMap).toComment();\n }\n\n if (opts.sourceMaps === \"inline\") {\n outputMap = null;\n }\n\n return {\n outputCode,\n outputMap\n };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = mergeSourceMap;\n\nfunction _sourceMap() {\n const data = _interopRequireDefault(require(\"source-map\"));\n\n _sourceMap = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction mergeSourceMap(inputMap, map) {\n const input = buildMappingData(inputMap);\n const output = buildMappingData(map);\n const mergedGenerator = new (_sourceMap().default.SourceMapGenerator)();\n\n for (const {\n source\n } of input.sources) {\n if (typeof source.content === \"string\") {\n mergedGenerator.setSourceContent(source.path, source.content);\n }\n }\n\n if (output.sources.length === 1) {\n const defaultSource = output.sources[0];\n const insertedMappings = new Map();\n eachInputGeneratedRange(input, (generated, original, source) => {\n eachOverlappingGeneratedOutputRange(defaultSource, generated, item => {\n const key = makeMappingKey(item);\n if (insertedMappings.has(key)) return;\n insertedMappings.set(key, item);\n mergedGenerator.addMapping({\n source: source.path,\n original: {\n line: original.line,\n column: original.columnStart\n },\n generated: {\n line: item.line,\n column: item.columnStart\n },\n name: original.name\n });\n });\n });\n\n for (const item of insertedMappings.values()) {\n if (item.columnEnd === Infinity) {\n continue;\n }\n\n const clearItem = {\n line: item.line,\n columnStart: item.columnEnd\n };\n const key = makeMappingKey(clearItem);\n\n if (insertedMappings.has(key)) {\n continue;\n }\n\n mergedGenerator.addMapping({\n generated: {\n line: clearItem.line,\n column: clearItem.columnStart\n }\n });\n }\n }\n\n const result = mergedGenerator.toJSON();\n\n if (typeof input.sourceRoot === \"string\") {\n result.sourceRoot = input.sourceRoot;\n }\n\n return result;\n}\n\nfunction makeMappingKey(item) {\n return `${item.line}/${item.columnStart}`;\n}\n\nfunction eachOverlappingGeneratedOutputRange(outputFile, inputGeneratedRange, callback) {\n const overlappingOriginal = filterApplicableOriginalRanges(outputFile, inputGeneratedRange);\n\n for (const {\n generated\n } of overlappingOriginal) {\n for (const item of generated) {\n callback(item);\n }\n }\n}\n\nfunction filterApplicableOriginalRanges({\n mappings\n}, {\n line,\n columnStart,\n columnEnd\n}) {\n return filterSortedArray(mappings, ({\n original: outOriginal\n }) => {\n if (line > outOriginal.line) return -1;\n if (line < outOriginal.line) return 1;\n if (columnStart >= outOriginal.columnEnd) return -1;\n if (columnEnd <= outOriginal.columnStart) return 1;\n return 0;\n });\n}\n\nfunction eachInputGeneratedRange(map, callback) {\n for (const {\n source,\n mappings\n } of map.sources) {\n for (const {\n original,\n generated\n } of mappings) {\n for (const item of generated) {\n callback(item, original, source);\n }\n }\n }\n}\n\nfunction buildMappingData(map) {\n const consumer = new (_sourceMap().default.SourceMapConsumer)(Object.assign({}, map, {\n sourceRoot: null\n }));\n const sources = new Map();\n const mappings = new Map();\n let last = null;\n consumer.computeColumnSpans();\n consumer.eachMapping(m => {\n if (m.originalLine === null) return;\n let source = sources.get(m.source);\n\n if (!source) {\n source = {\n path: m.source,\n content: consumer.sourceContentFor(m.source, true)\n };\n sources.set(m.source, source);\n }\n\n let sourceData = mappings.get(source);\n\n if (!sourceData) {\n sourceData = {\n source,\n mappings: []\n };\n mappings.set(source, sourceData);\n }\n\n const obj = {\n line: m.originalLine,\n columnStart: m.originalColumn,\n columnEnd: Infinity,\n name: m.name\n };\n\n if (last && last.source === source && last.mapping.line === m.originalLine) {\n last.mapping.columnEnd = m.originalColumn;\n }\n\n last = {\n source,\n mapping: obj\n };\n sourceData.mappings.push({\n original: obj,\n generated: consumer.allGeneratedPositionsFor({\n source: m.source,\n line: m.originalLine,\n column: m.originalColumn\n }).map(item => ({\n line: item.line,\n columnStart: item.column,\n columnEnd: item.lastColumn + 1\n }))\n });\n }, null, _sourceMap().default.SourceMapConsumer.ORIGINAL_ORDER);\n return {\n file: map.file,\n sourceRoot: map.sourceRoot,\n sources: Array.from(mappings.values())\n };\n}\n\nfunction findInsertionLocation(array, callback) {\n let left = 0;\n let right = array.length;\n\n while (left < right) {\n const mid = Math.floor((left + right) / 2);\n const item = array[mid];\n const result = callback(item);\n\n if (result === 0) {\n left = mid;\n break;\n }\n\n if (result >= 0) {\n right = mid;\n } else {\n left = mid + 1;\n }\n }\n\n let i = left;\n\n if (i < array.length) {\n while (i >= 0 && callback(array[i]) >= 0) {\n i--;\n }\n\n return i + 1;\n }\n\n return i;\n}\n\nfunction filterSortedArray(array, callback) {\n const start = findInsertionLocation(array, callback);\n const results = [];\n\n for (let i = start; i < array.length && callback(array[i]) === 0; i++) {\n results.push(array[i]);\n }\n\n return results;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.run = run;\n\nfunction _traverse() {\n const data = _interopRequireDefault(require(\"@babel/traverse\"));\n\n _traverse = function () {\n return data;\n };\n\n return data;\n}\n\nvar _pluginPass = _interopRequireDefault(require(\"./plugin-pass\"));\n\nvar _blockHoistPlugin = _interopRequireDefault(require(\"./block-hoist-plugin\"));\n\nvar _normalizeOpts = _interopRequireDefault(require(\"./normalize-opts\"));\n\nvar _normalizeFile = _interopRequireDefault(require(\"./normalize-file\"));\n\nvar _generate = _interopRequireDefault(require(\"./file/generate\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction* run(config, code, ast) {\n const file = yield* (0, _normalizeFile.default)(config.passes, (0, _normalizeOpts.default)(config), code, ast);\n const opts = file.opts;\n\n try {\n yield* transformFile(file, config.passes);\n } catch (e) {\n var _opts$filename;\n\n e.message = `${(_opts$filename = opts.filename) != null ? _opts$filename : \"unknown\"}: ${e.message}`;\n\n if (!e.code) {\n e.code = \"BABEL_TRANSFORM_ERROR\";\n }\n\n throw e;\n }\n\n let outputCode, outputMap;\n\n try {\n if (opts.code !== false) {\n ({\n outputCode,\n outputMap\n } = (0, _generate.default)(config.passes, file));\n }\n } catch (e) {\n var _opts$filename2;\n\n e.message = `${(_opts$filename2 = opts.filename) != null ? _opts$filename2 : \"unknown\"}: ${e.message}`;\n\n if (!e.code) {\n e.code = \"BABEL_GENERATE_ERROR\";\n }\n\n throw e;\n }\n\n return {\n metadata: file.metadata,\n options: opts,\n ast: opts.ast === true ? file.ast : null,\n code: outputCode === undefined ? null : outputCode,\n map: outputMap === undefined ? null : outputMap,\n sourceType: file.ast.program.sourceType\n };\n}\n\nfunction* transformFile(file, pluginPasses) {\n for (const pluginPairs of pluginPasses) {\n const passPairs = [];\n const passes = [];\n const visitors = [];\n\n for (const plugin of pluginPairs.concat([(0, _blockHoistPlugin.default)()])) {\n const pass = new _pluginPass.default(file, plugin.key, plugin.options);\n passPairs.push([plugin, pass]);\n passes.push(pass);\n visitors.push(plugin.visitor);\n }\n\n for (const [plugin, pass] of passPairs) {\n const fn = plugin.pre;\n\n if (fn) {\n const result = fn.call(pass, file);\n yield* [];\n\n if (isThenable(result)) {\n throw new Error(`You appear to be using an plugin with an async .pre, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`);\n }\n }\n }\n\n const visitor = _traverse().default.visitors.merge(visitors, passes, file.opts.wrapPluginVisitorMethod);\n\n (0, _traverse().default)(file.ast, visitor, file.scope);\n\n for (const [plugin, pass] of passPairs) {\n const fn = plugin.post;\n\n if (fn) {\n const result = fn.call(pass, file);\n yield* [];\n\n if (isThenable(result)) {\n throw new Error(`You appear to be using an plugin with an async .post, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`);\n }\n }\n }\n }\n}\n\nfunction isThenable(val) {\n return !!val && (typeof val === \"object\" || typeof val === \"function\") && !!val.then && typeof val.then === \"function\";\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = normalizeFile;\n\nfunction _fs() {\n const data = _interopRequireDefault(require(\"fs\"));\n\n _fs = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _path() {\n const data = _interopRequireDefault(require(\"path\"));\n\n _path = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _debug() {\n const data = _interopRequireDefault(require(\"debug\"));\n\n _debug = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _cloneDeep() {\n const data = _interopRequireDefault(require(\"lodash/cloneDeep\"));\n\n _cloneDeep = function () {\n return data;\n };\n\n return data;\n}\n\nfunction t() {\n const data = _interopRequireWildcard(require(\"@babel/types\"));\n\n t = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _convertSourceMap() {\n const data = _interopRequireDefault(require(\"convert-source-map\"));\n\n _convertSourceMap = function () {\n return data;\n };\n\n return data;\n}\n\nvar _file = _interopRequireDefault(require(\"./file/file\"));\n\nvar _parser = _interopRequireDefault(require(\"../parser\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst debug = (0, _debug().default)(\"babel:transform:file\");\nconst LARGE_INPUT_SOURCEMAP_THRESHOLD = 1000000;\n\nfunction* normalizeFile(pluginPasses, options, code, ast) {\n code = `${code || \"\"}`;\n\n if (ast) {\n if (ast.type === \"Program\") {\n ast = t().file(ast, [], []);\n } else if (ast.type !== \"File\") {\n throw new Error(\"AST root must be a Program or File node\");\n }\n\n const {\n cloneInputAst\n } = options;\n\n if (cloneInputAst) {\n ast = (0, _cloneDeep().default)(ast);\n }\n } else {\n ast = yield* (0, _parser.default)(pluginPasses, options, code);\n }\n\n let inputMap = null;\n\n if (options.inputSourceMap !== false) {\n if (typeof options.inputSourceMap === \"object\") {\n inputMap = _convertSourceMap().default.fromObject(options.inputSourceMap);\n }\n\n if (!inputMap) {\n const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast);\n\n if (lastComment) {\n try {\n inputMap = _convertSourceMap().default.fromComment(lastComment);\n } catch (err) {\n debug(\"discarding unknown inline input sourcemap\", err);\n }\n }\n }\n\n if (!inputMap) {\n const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast);\n\n if (typeof options.filename === \"string\" && lastComment) {\n try {\n const match = EXTERNAL_SOURCEMAP_REGEX.exec(lastComment);\n\n const inputMapContent = _fs().default.readFileSync(_path().default.resolve(_path().default.dirname(options.filename), match[1]));\n\n if (inputMapContent.length > LARGE_INPUT_SOURCEMAP_THRESHOLD) {\n debug(\"skip merging input map > 1 MB\");\n } else {\n inputMap = _convertSourceMap().default.fromJSON(inputMapContent);\n }\n } catch (err) {\n debug(\"discarding unknown file input sourcemap\", err);\n }\n } else if (lastComment) {\n debug(\"discarding un-loadable file input sourcemap\");\n }\n }\n }\n\n return new _file.default(options, {\n code,\n ast,\n inputMap\n });\n}\n\nconst INLINE_SOURCEMAP_REGEX = /^[@#]\\s+sourceMappingURL=data:(?:application|text)\\/json;(?:charset[:=]\\S+?;)?base64,(?:.*)$/;\nconst EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \\t]+sourceMappingURL=([^\\s'\"`]+)[ \\t]*$/;\n\nfunction extractCommentsFromList(regex, comments, lastComment) {\n if (comments) {\n comments = comments.filter(({\n value\n }) => {\n if (regex.test(value)) {\n lastComment = value;\n return false;\n }\n\n return true;\n });\n }\n\n return [comments, lastComment];\n}\n\nfunction extractComments(regex, ast) {\n let lastComment = null;\n t().traverseFast(ast, node => {\n [node.leadingComments, lastComment] = extractCommentsFromList(regex, node.leadingComments, lastComment);\n [node.innerComments, lastComment] = extractCommentsFromList(regex, node.innerComments, lastComment);\n [node.trailingComments, lastComment] = extractCommentsFromList(regex, node.trailingComments, lastComment);\n });\n return lastComment;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = normalizeOptions;\n\nfunction _path() {\n const data = _interopRequireDefault(require(\"path\"));\n\n _path = function () {\n return data;\n };\n\n return data;\n}\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction normalizeOptions(config) {\n const {\n filename,\n cwd,\n filenameRelative = typeof filename === \"string\" ? _path().default.relative(cwd, filename) : \"unknown\",\n sourceType = \"module\",\n inputSourceMap,\n sourceMaps = !!inputSourceMap,\n moduleRoot,\n sourceRoot = moduleRoot,\n sourceFileName = _path().default.basename(filenameRelative),\n comments = true,\n compact = \"auto\"\n } = config.options;\n const opts = config.options;\n const options = Object.assign({}, opts, {\n parserOpts: Object.assign({\n sourceType: _path().default.extname(filenameRelative) === \".mjs\" ? \"module\" : sourceType,\n sourceFileName: filename,\n plugins: []\n }, opts.parserOpts),\n generatorOpts: Object.assign({\n filename,\n auxiliaryCommentBefore: opts.auxiliaryCommentBefore,\n auxiliaryCommentAfter: opts.auxiliaryCommentAfter,\n retainLines: opts.retainLines,\n comments,\n shouldPrintComment: opts.shouldPrintComment,\n compact,\n minified: opts.minified,\n sourceMaps,\n sourceRoot,\n sourceFileName\n }, opts.generatorOpts)\n });\n\n for (const plugins of config.passes) {\n for (const plugin of plugins) {\n if (plugin.manipulateOptions) {\n plugin.manipulateOptions(options, options.parserOpts);\n }\n }\n }\n\n return options;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nclass PluginPass {\n constructor(file, key, options) {\n this._map = new Map();\n this.key = void 0;\n this.file = void 0;\n this.opts = void 0;\n this.cwd = void 0;\n this.filename = void 0;\n this.key = key;\n this.file = file;\n this.opts = options || {};\n this.cwd = file.opts.cwd;\n this.filename = file.opts.filename;\n }\n\n set(key, val) {\n this._map.set(key, val);\n }\n\n get(key) {\n return this._map.get(key);\n }\n\n availableHelper(name, versionRange) {\n return this.file.availableHelper(name, versionRange);\n }\n\n addHelper(name) {\n return this.file.addHelper(name);\n }\n\n addImport() {\n return this.file.addImport();\n }\n\n getModuleName() {\n return this.file.getModuleName();\n }\n\n buildCodeFrameError(node, msg, Error) {\n return this.file.buildCodeFrameError(node, msg, Error);\n }\n\n}\n\nexports.default = PluginPass;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.codeFrameColumns = codeFrameColumns;\nexports.default = _default;\n\nvar _highlight = _interopRequireWildcard(require(\"@babel/highlight\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nlet deprecationWarningShown = false;\n\nfunction getDefs(chalk) {\n return {\n gutter: chalk.grey,\n marker: chalk.red.bold,\n message: chalk.red.bold\n };\n}\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\nfunction getMarkerLines(loc, source, opts) {\n const startLoc = Object.assign({\n column: 0,\n line: -1\n }, loc.start);\n const endLoc = Object.assign({}, startLoc, loc.end);\n const {\n linesAbove = 2,\n linesBelow = 3\n } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n\n if (startLine === -1) {\n start = 0;\n }\n\n if (endLine === -1) {\n end = source.length;\n }\n\n const lineDiff = endLine - startLine;\n const markerLines = {};\n\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n\n return {\n start,\n end,\n markerLines\n };\n}\n\nfunction codeFrameColumns(rawLines, loc, opts = {}) {\n const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);\n const chalk = (0, _highlight.getChalk)(opts);\n const defs = getDefs(chalk);\n\n const maybeHighlight = (chalkFn, string) => {\n return highlighted ? chalkFn(string) : string;\n };\n\n const lines = rawLines.split(NEWLINE);\n const {\n start,\n end,\n markerLines\n } = getMarkerLines(loc, lines, opts);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n const numberMaxWidth = String(end).length;\n const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;\n let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} | `;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n\n if (hasMarker) {\n let markerLine = \"\";\n\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n markerLine = [\"\\n \", maybeHighlight(defs.gutter, gutter.replace(/\\d/g, \" \")), markerSpacing, maybeHighlight(defs.marker, \"^\").repeat(numberOfMarkers)].join(\"\");\n\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + maybeHighlight(defs.message, opts.message);\n }\n }\n\n return [maybeHighlight(defs.marker, \">\"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(\"\");\n } else {\n return ` ${maybeHighlight(defs.gutter, gutter)}${line}`;\n }\n }).join(\"\\n\");\n\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n\n if (highlighted) {\n return chalk.reset(frame);\n } else {\n return frame;\n }\n}\n\nfunction _default(rawLines, lineNumber, colNumber, opts = {}) {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n const message = \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n\n if (process.emitWarning) {\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n\n colNumber = Math.max(colNumber, 0);\n const location = {\n start: {\n column: colNumber,\n line: lineNumber\n }\n };\n return codeFrameColumns(rawLines, location, opts);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isIdentifierStart = isIdentifierStart;\nexports.isIdentifierChar = isIdentifierChar;\nexports.isIdentifierName = isIdentifierName;\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u08a0-\\u08b4\\u08b6-\\u08c7\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\u9ffc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7bf\\ua7c2-\\ua7ca\\ua7f5-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u08d3-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf\\u1ac0\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1df9\\u1dfb-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\nconst nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\nconst nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\nconst astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];\nconst astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n\nfunction isInAstralSet(code, set) {\n let pos = 0x10000;\n\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n\n return false;\n}\n\nfunction isIdentifierStart(code) {\n if (code < 65) return code === 36;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));\n }\n\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\nfunction isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}\n\nfunction isIdentifierName(name) {\n let isFirst = true;\n\n for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) {\n const char = _Array$from[_i];\n const cp = char.codePointAt(0);\n\n if (isFirst) {\n if (!isIdentifierStart(cp)) {\n return false;\n }\n\n isFirst = false;\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n\n return !isFirst;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"isIdentifierName\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierName;\n }\n});\nObject.defineProperty(exports, \"isIdentifierChar\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierChar;\n }\n});\nObject.defineProperty(exports, \"isIdentifierStart\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierStart;\n }\n});\nObject.defineProperty(exports, \"isReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictBindOnlyReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictBindOnlyReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictBindReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictBindReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictReservedWord;\n }\n});\nObject.defineProperty(exports, \"isKeyword\", {\n enumerable: true,\n get: function () {\n return _keyword.isKeyword;\n }\n});\n\nvar _identifier = require(\"./identifier\");\n\nvar _keyword = require(\"./keyword\");","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isReservedWord = isReservedWord;\nexports.isStrictReservedWord = isStrictReservedWord;\nexports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;\nexports.isStrictBindReservedWord = isStrictBindReservedWord;\nexports.isKeyword = isKeyword;\nconst reservedWords = {\n keyword: [\"break\", \"case\", \"catch\", \"continue\", \"debugger\", \"default\", \"do\", \"else\", \"finally\", \"for\", \"function\", \"if\", \"return\", \"switch\", \"throw\", \"try\", \"var\", \"const\", \"while\", \"with\", \"new\", \"this\", \"super\", \"class\", \"extends\", \"export\", \"import\", \"null\", \"true\", \"false\", \"in\", \"instanceof\", \"typeof\", \"void\", \"delete\"],\n strict: [\"implements\", \"interface\", \"let\", \"package\", \"private\", \"protected\", \"public\", \"static\", \"yield\"],\n strictBind: [\"eval\", \"arguments\"]\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\nfunction isReservedWord(word, inModule) {\n return inModule && word === \"await\" || word === \"enum\";\n}\n\nfunction isStrictReservedWord(word, inModule) {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\nfunction isStrictBindOnlyReservedWord(word) {\n return reservedWordsStrictBindSet.has(word);\n}\n\nfunction isStrictBindReservedWord(word, inModule) {\n return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);\n}\n\nfunction isKeyword(word) {\n return keywords.has(word);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.shouldHighlight = shouldHighlight;\nexports.getChalk = getChalk;\nexports.default = highlight;\n\nvar _jsTokens = _interopRequireWildcard(require(\"js-tokens\"));\n\nvar _helperValidatorIdentifier = require(\"@babel/helper-validator-identifier\");\n\nvar _chalk = _interopRequireDefault(require(\"chalk\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction getDefs(chalk) {\n return {\n keyword: chalk.cyan,\n capitalized: chalk.yellow,\n jsx_tag: chalk.yellow,\n punctuator: chalk.yellow,\n number: chalk.magenta,\n string: chalk.green,\n regex: chalk.magenta,\n comment: chalk.grey,\n invalid: chalk.white.bgRed.bold\n };\n}\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\nconst JSX_TAG = /^[a-z][\\w-]*$/i;\nconst BRACKET = /^[()[\\]{}]$/;\n\nfunction getTokenType(match) {\n const [offset, text] = match.slice(-2);\n const token = (0, _jsTokens.matchToToken)(match);\n\n if (token.type === \"name\") {\n if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isReservedWord)(token.value)) {\n return \"keyword\";\n }\n\n if (JSX_TAG.test(token.value) && (text[offset - 1] === \"<\" || text.substr(offset - 2, 2) == \" colorize(str)).join(\"\\n\");\n } else {\n return args[0];\n }\n });\n}\n\nfunction shouldHighlight(options) {\n return _chalk.default.supportsColor || options.forceColor;\n}\n\nfunction getChalk(options) {\n let chalk = _chalk.default;\n\n if (options.forceColor) {\n chalk = new _chalk.default.constructor({\n enabled: true,\n level: 1\n });\n }\n\n return chalk;\n}\n\nfunction highlight(code, options = {}) {\n if (shouldHighlight(options)) {\n const chalk = getChalk(options);\n const defs = getDefs(chalk);\n return highlightTokens(defs, code);\n } else {\n return code;\n }\n}","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap)\n : new BasicSourceMapConsumer(sourceMap);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n if (source != null && sourceRoot != null) {\n source = util.join(sourceRoot, source);\n }\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: Optional. the column number in the original source.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n if (this.sourceRoot != null) {\n needle.source = util.relative(this.sourceRoot, needle.source);\n }\n if (!this._sources.has(needle.source)) {\n return [];\n }\n needle.source = this._sources.indexOf(needle.source);\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The only parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._sources.toArray().map(function (s) {\n return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;\n }, this);\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n if (this.sourceRoot != null) {\n source = util.join(this.sourceRoot, source);\n }\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n if (this.sourceRoot != null) {\n aSource = util.relative(this.sourceRoot, aSource);\n }\n\n if (this._sources.has(aSource)) {\n return this.sourcesContent[this._sources.indexOf(aSource)];\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = aSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + aSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + aSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n if (this.sourceRoot != null) {\n source = util.relative(this.sourceRoot, source);\n }\n if (!this._sources.has(source)) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n source = this._sources.indexOf(source);\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The only parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'))\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n if (section.consumer.sourceRoot !== null) {\n source = util.join(section.consumer.sourceRoot, source);\n }\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex];\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex];\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.]*)(?::(\\d+))?(\\S*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst SPACES_RE = /^[ \\t]+$/;\n\nclass Buffer {\n constructor(map) {\n this._map = null;\n this._buf = [];\n this._last = \"\";\n this._queue = [];\n this._position = {\n line: 1,\n column: 0\n };\n this._sourcePosition = {\n identifierName: null,\n line: null,\n column: null,\n filename: null\n };\n this._disallowedPop = null;\n this._map = map;\n }\n\n get() {\n this._flush();\n\n const map = this._map;\n const result = {\n code: this._buf.join(\"\").trimRight(),\n map: null,\n rawMappings: map == null ? void 0 : map.getRawMappings()\n };\n\n if (map) {\n Object.defineProperty(result, \"map\", {\n configurable: true,\n enumerable: true,\n\n get() {\n return this.map = map.get();\n },\n\n set(value) {\n Object.defineProperty(this, \"map\", {\n value,\n writable: true\n });\n }\n\n });\n }\n\n return result;\n }\n\n append(str) {\n this._flush();\n\n const {\n line,\n column,\n filename,\n identifierName,\n force\n } = this._sourcePosition;\n\n this._append(str, line, column, identifierName, filename, force);\n }\n\n queue(str) {\n if (str === \"\\n\") {\n while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) {\n this._queue.shift();\n }\n }\n\n const {\n line,\n column,\n filename,\n identifierName,\n force\n } = this._sourcePosition;\n\n this._queue.unshift([str, line, column, identifierName, filename, force]);\n }\n\n _flush() {\n let item;\n\n while (item = this._queue.pop()) this._append(...item);\n }\n\n _append(str, line, column, identifierName, filename, force) {\n this._buf.push(str);\n\n this._last = str[str.length - 1];\n let i = str.indexOf(\"\\n\");\n let last = 0;\n\n if (i !== 0) {\n this._mark(line, column, identifierName, filename, force);\n }\n\n while (i !== -1) {\n this._position.line++;\n this._position.column = 0;\n last = i + 1;\n\n if (last < str.length) {\n this._mark(++line, 0, identifierName, filename, force);\n }\n\n i = str.indexOf(\"\\n\", last);\n }\n\n this._position.column += str.length - last;\n }\n\n _mark(line, column, identifierName, filename, force) {\n var _this$_map;\n\n (_this$_map = this._map) == null ? void 0 : _this$_map.mark(this._position.line, this._position.column, line, column, identifierName, filename, force);\n }\n\n removeTrailingNewline() {\n if (this._queue.length > 0 && this._queue[0][0] === \"\\n\") {\n this._queue.shift();\n }\n }\n\n removeLastSemicolon() {\n if (this._queue.length > 0 && this._queue[0][0] === \";\") {\n this._queue.shift();\n }\n }\n\n endsWith(suffix) {\n if (suffix.length === 1) {\n let last;\n\n if (this._queue.length > 0) {\n const str = this._queue[0][0];\n last = str[str.length - 1];\n } else {\n last = this._last;\n }\n\n return last === suffix;\n }\n\n const end = this._last + this._queue.reduce((acc, item) => item[0] + acc, \"\");\n\n if (suffix.length <= end.length) {\n return end.slice(-suffix.length) === suffix;\n }\n\n return false;\n }\n\n hasContent() {\n return this._queue.length > 0 || !!this._last;\n }\n\n exactSource(loc, cb) {\n this.source(\"start\", loc, true);\n cb();\n this.source(\"end\", loc);\n\n this._disallowPop(\"start\", loc);\n }\n\n source(prop, loc, force) {\n if (prop && !loc) return;\n\n this._normalizePosition(prop, loc, this._sourcePosition, force);\n }\n\n withSource(prop, loc, cb) {\n if (!this._map) return cb();\n const originalLine = this._sourcePosition.line;\n const originalColumn = this._sourcePosition.column;\n const originalFilename = this._sourcePosition.filename;\n const originalIdentifierName = this._sourcePosition.identifierName;\n this.source(prop, loc);\n cb();\n\n if ((!this._sourcePosition.force || this._sourcePosition.line !== originalLine || this._sourcePosition.column !== originalColumn || this._sourcePosition.filename !== originalFilename) && (!this._disallowedPop || this._disallowedPop.line !== originalLine || this._disallowedPop.column !== originalColumn || this._disallowedPop.filename !== originalFilename)) {\n this._sourcePosition.line = originalLine;\n this._sourcePosition.column = originalColumn;\n this._sourcePosition.filename = originalFilename;\n this._sourcePosition.identifierName = originalIdentifierName;\n this._sourcePosition.force = false;\n this._disallowedPop = null;\n }\n }\n\n _disallowPop(prop, loc) {\n if (prop && !loc) return;\n this._disallowedPop = this._normalizePosition(prop, loc);\n }\n\n _normalizePosition(prop, loc, targetObj, force) {\n const pos = loc ? loc[prop] : null;\n\n if (targetObj === undefined) {\n targetObj = {\n identifierName: null,\n line: null,\n column: null,\n filename: null,\n force: false\n };\n }\n\n const origLine = targetObj.line;\n const origColumn = targetObj.column;\n const origFilename = targetObj.filename;\n targetObj.identifierName = prop === \"start\" && (loc == null ? void 0 : loc.identifierName) || null;\n targetObj.line = pos == null ? void 0 : pos.line;\n targetObj.column = pos == null ? void 0 : pos.column;\n targetObj.filename = loc == null ? void 0 : loc.filename;\n\n if (force || targetObj.line !== origLine || targetObj.column !== origColumn || targetObj.filename !== origFilename) {\n targetObj.force = force;\n }\n\n return targetObj;\n }\n\n getCurrentColumn() {\n const extra = this._queue.reduce((acc, item) => item[0] + acc, \"\");\n\n const lastIndex = extra.lastIndexOf(\"\\n\");\n return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex;\n }\n\n getCurrentLine() {\n const extra = this._queue.reduce((acc, item) => item[0] + acc, \"\");\n\n let count = 0;\n\n for (let i = 0; i < extra.length; i++) {\n if (extra[i] === \"\\n\") count++;\n }\n\n return this._position.line + count;\n }\n\n}\n\nexports.default = Buffer;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.File = File;\nexports.Program = Program;\nexports.BlockStatement = BlockStatement;\nexports.Noop = Noop;\nexports.Directive = Directive;\nexports.DirectiveLiteral = DirectiveLiteral;\nexports.InterpreterDirective = InterpreterDirective;\nexports.Placeholder = Placeholder;\n\nfunction File(node) {\n if (node.program) {\n this.print(node.program.interpreter, node);\n }\n\n this.print(node.program, node);\n}\n\nfunction Program(node) {\n this.printInnerComments(node, false);\n this.printSequence(node.directives, node);\n if (node.directives && node.directives.length) this.newline();\n this.printSequence(node.body, node);\n}\n\nfunction BlockStatement(node) {\n var _node$directives;\n\n this.token(\"{\");\n this.printInnerComments(node);\n const hasDirectives = (_node$directives = node.directives) == null ? void 0 : _node$directives.length;\n\n if (node.body.length || hasDirectives) {\n this.newline();\n this.printSequence(node.directives, node, {\n indent: true\n });\n if (hasDirectives) this.newline();\n this.printSequence(node.body, node, {\n indent: true\n });\n this.removeTrailingNewline();\n this.source(\"end\", node.loc);\n if (!this.endsWith(\"\\n\")) this.newline();\n this.rightBrace();\n } else {\n this.source(\"end\", node.loc);\n this.token(\"}\");\n }\n}\n\nfunction Noop() {}\n\nfunction Directive(node) {\n this.print(node.value, node);\n this.semicolon();\n}\n\nconst unescapedSingleQuoteRE = /(?:^|[^\\\\])(?:\\\\\\\\)*'/;\nconst unescapedDoubleQuoteRE = /(?:^|[^\\\\])(?:\\\\\\\\)*\"/;\n\nfunction DirectiveLiteral(node) {\n const raw = this.getPossibleRaw(node);\n\n if (raw != null) {\n this.token(raw);\n return;\n }\n\n const {\n value\n } = node;\n\n if (!unescapedDoubleQuoteRE.test(value)) {\n this.token(`\"${value}\"`);\n } else if (!unescapedSingleQuoteRE.test(value)) {\n this.token(`'${value}'`);\n } else {\n throw new Error(\"Malformed AST: it is not possible to print a directive containing\" + \" both unescaped single and double quotes.\");\n }\n}\n\nfunction InterpreterDirective(node) {\n this.token(`#!${node.value}\\n`);\n}\n\nfunction Placeholder(node) {\n this.token(\"%%\");\n this.print(node.name);\n this.token(\"%%\");\n\n if (node.expectedNode === \"Statement\") {\n this.semicolon();\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ClassExpression = exports.ClassDeclaration = ClassDeclaration;\nexports.ClassBody = ClassBody;\nexports.ClassProperty = ClassProperty;\nexports.ClassPrivateProperty = ClassPrivateProperty;\nexports.ClassMethod = ClassMethod;\nexports.ClassPrivateMethod = ClassPrivateMethod;\nexports._classMethodHead = _classMethodHead;\nexports.StaticBlock = StaticBlock;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction ClassDeclaration(node, parent) {\n if (!this.format.decoratorsBeforeExport || !t.isExportDefaultDeclaration(parent) && !t.isExportNamedDeclaration(parent)) {\n this.printJoin(node.decorators, node);\n }\n\n if (node.declare) {\n this.word(\"declare\");\n this.space();\n }\n\n if (node.abstract) {\n this.word(\"abstract\");\n this.space();\n }\n\n this.word(\"class\");\n\n if (node.id) {\n this.space();\n this.print(node.id, node);\n }\n\n this.print(node.typeParameters, node);\n\n if (node.superClass) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.superClass, node);\n this.print(node.superTypeParameters, node);\n }\n\n if (node.implements) {\n this.space();\n this.word(\"implements\");\n this.space();\n this.printList(node.implements, node);\n }\n\n this.space();\n this.print(node.body, node);\n}\n\nfunction ClassBody(node) {\n this.token(\"{\");\n this.printInnerComments(node);\n\n if (node.body.length === 0) {\n this.token(\"}\");\n } else {\n this.newline();\n this.indent();\n this.printSequence(node.body, node);\n this.dedent();\n if (!this.endsWith(\"\\n\")) this.newline();\n this.rightBrace();\n }\n}\n\nfunction ClassProperty(node) {\n this.printJoin(node.decorators, node);\n this.tsPrintClassMemberModifiers(node, true);\n\n if (node.computed) {\n this.token(\"[\");\n this.print(node.key, node);\n this.token(\"]\");\n } else {\n this._variance(node);\n\n this.print(node.key, node);\n }\n\n if (node.optional) {\n this.token(\"?\");\n }\n\n if (node.definite) {\n this.token(\"!\");\n }\n\n this.print(node.typeAnnotation, node);\n\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value, node);\n }\n\n this.semicolon();\n}\n\nfunction ClassPrivateProperty(node) {\n this.printJoin(node.decorators, node);\n\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n\n this.print(node.key, node);\n this.print(node.typeAnnotation, node);\n\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value, node);\n }\n\n this.semicolon();\n}\n\nfunction ClassMethod(node) {\n this._classMethodHead(node);\n\n this.space();\n this.print(node.body, node);\n}\n\nfunction ClassPrivateMethod(node) {\n this._classMethodHead(node);\n\n this.space();\n this.print(node.body, node);\n}\n\nfunction _classMethodHead(node) {\n this.printJoin(node.decorators, node);\n this.tsPrintClassMemberModifiers(node, false);\n\n this._methodHead(node);\n}\n\nfunction StaticBlock(node) {\n this.word(\"static\");\n this.space();\n this.token(\"{\");\n\n if (node.body.length === 0) {\n this.token(\"}\");\n } else {\n this.newline();\n this.printSequence(node.body, node, {\n indent: true\n });\n this.rightBrace();\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.UnaryExpression = UnaryExpression;\nexports.DoExpression = DoExpression;\nexports.ParenthesizedExpression = ParenthesizedExpression;\nexports.UpdateExpression = UpdateExpression;\nexports.ConditionalExpression = ConditionalExpression;\nexports.NewExpression = NewExpression;\nexports.SequenceExpression = SequenceExpression;\nexports.ThisExpression = ThisExpression;\nexports.Super = Super;\nexports.Decorator = Decorator;\nexports.OptionalMemberExpression = OptionalMemberExpression;\nexports.OptionalCallExpression = OptionalCallExpression;\nexports.CallExpression = CallExpression;\nexports.Import = Import;\nexports.EmptyStatement = EmptyStatement;\nexports.ExpressionStatement = ExpressionStatement;\nexports.AssignmentPattern = AssignmentPattern;\nexports.LogicalExpression = exports.BinaryExpression = exports.AssignmentExpression = AssignmentExpression;\nexports.BindExpression = BindExpression;\nexports.MemberExpression = MemberExpression;\nexports.MetaProperty = MetaProperty;\nexports.PrivateName = PrivateName;\nexports.V8IntrinsicIdentifier = V8IntrinsicIdentifier;\nexports.AwaitExpression = exports.YieldExpression = void 0;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar n = _interopRequireWildcard(require(\"../node\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction UnaryExpression(node) {\n if (node.operator === \"void\" || node.operator === \"delete\" || node.operator === \"typeof\" || node.operator === \"throw\") {\n this.word(node.operator);\n this.space();\n } else {\n this.token(node.operator);\n }\n\n this.print(node.argument, node);\n}\n\nfunction DoExpression(node) {\n this.word(\"do\");\n this.space();\n this.print(node.body, node);\n}\n\nfunction ParenthesizedExpression(node) {\n this.token(\"(\");\n this.print(node.expression, node);\n this.token(\")\");\n}\n\nfunction UpdateExpression(node) {\n if (node.prefix) {\n this.token(node.operator);\n this.print(node.argument, node);\n } else {\n this.startTerminatorless(true);\n this.print(node.argument, node);\n this.endTerminatorless();\n this.token(node.operator);\n }\n}\n\nfunction ConditionalExpression(node) {\n this.print(node.test, node);\n this.space();\n this.token(\"?\");\n this.space();\n this.print(node.consequent, node);\n this.space();\n this.token(\":\");\n this.space();\n this.print(node.alternate, node);\n}\n\nfunction NewExpression(node, parent) {\n this.word(\"new\");\n this.space();\n this.print(node.callee, node);\n\n if (this.format.minified && node.arguments.length === 0 && !node.optional && !t.isCallExpression(parent, {\n callee: node\n }) && !t.isMemberExpression(parent) && !t.isNewExpression(parent)) {\n return;\n }\n\n this.print(node.typeArguments, node);\n this.print(node.typeParameters, node);\n\n if (node.optional) {\n this.token(\"?.\");\n }\n\n this.token(\"(\");\n this.printList(node.arguments, node);\n this.token(\")\");\n}\n\nfunction SequenceExpression(node) {\n this.printList(node.expressions, node);\n}\n\nfunction ThisExpression() {\n this.word(\"this\");\n}\n\nfunction Super() {\n this.word(\"super\");\n}\n\nfunction Decorator(node) {\n this.token(\"@\");\n this.print(node.expression, node);\n this.newline();\n}\n\nfunction OptionalMemberExpression(node) {\n this.print(node.object, node);\n\n if (!node.computed && t.isMemberExpression(node.property)) {\n throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n }\n\n let computed = node.computed;\n\n if (t.isLiteral(node.property) && typeof node.property.value === \"number\") {\n computed = true;\n }\n\n if (node.optional) {\n this.token(\"?.\");\n }\n\n if (computed) {\n this.token(\"[\");\n this.print(node.property, node);\n this.token(\"]\");\n } else {\n if (!node.optional) {\n this.token(\".\");\n }\n\n this.print(node.property, node);\n }\n}\n\nfunction OptionalCallExpression(node) {\n this.print(node.callee, node);\n this.print(node.typeArguments, node);\n this.print(node.typeParameters, node);\n\n if (node.optional) {\n this.token(\"?.\");\n }\n\n this.token(\"(\");\n this.printList(node.arguments, node);\n this.token(\")\");\n}\n\nfunction CallExpression(node) {\n this.print(node.callee, node);\n this.print(node.typeArguments, node);\n this.print(node.typeParameters, node);\n this.token(\"(\");\n this.printList(node.arguments, node);\n this.token(\")\");\n}\n\nfunction Import() {\n this.word(\"import\");\n}\n\nfunction buildYieldAwait(keyword) {\n return function (node) {\n this.word(keyword);\n\n if (node.delegate) {\n this.token(\"*\");\n }\n\n if (node.argument) {\n this.space();\n const terminatorState = this.startTerminatorless();\n this.print(node.argument, node);\n this.endTerminatorless(terminatorState);\n }\n };\n}\n\nconst YieldExpression = buildYieldAwait(\"yield\");\nexports.YieldExpression = YieldExpression;\nconst AwaitExpression = buildYieldAwait(\"await\");\nexports.AwaitExpression = AwaitExpression;\n\nfunction EmptyStatement() {\n this.semicolon(true);\n}\n\nfunction ExpressionStatement(node) {\n this.print(node.expression, node);\n this.semicolon();\n}\n\nfunction AssignmentPattern(node) {\n this.print(node.left, node);\n if (node.left.optional) this.token(\"?\");\n this.print(node.left.typeAnnotation, node);\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.right, node);\n}\n\nfunction AssignmentExpression(node, parent) {\n const parens = this.inForStatementInitCounter && node.operator === \"in\" && !n.needsParens(node, parent);\n\n if (parens) {\n this.token(\"(\");\n }\n\n this.print(node.left, node);\n this.space();\n\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n this.word(node.operator);\n } else {\n this.token(node.operator);\n }\n\n this.space();\n this.print(node.right, node);\n\n if (parens) {\n this.token(\")\");\n }\n}\n\nfunction BindExpression(node) {\n this.print(node.object, node);\n this.token(\"::\");\n this.print(node.callee, node);\n}\n\nfunction MemberExpression(node) {\n this.print(node.object, node);\n\n if (!node.computed && t.isMemberExpression(node.property)) {\n throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n }\n\n let computed = node.computed;\n\n if (t.isLiteral(node.property) && typeof node.property.value === \"number\") {\n computed = true;\n }\n\n if (computed) {\n this.token(\"[\");\n this.print(node.property, node);\n this.token(\"]\");\n } else {\n this.token(\".\");\n this.print(node.property, node);\n }\n}\n\nfunction MetaProperty(node) {\n this.print(node.meta, node);\n this.token(\".\");\n this.print(node.property, node);\n}\n\nfunction PrivateName(node) {\n this.token(\"#\");\n this.print(node.id, node);\n}\n\nfunction V8IntrinsicIdentifier(node) {\n this.token(\"%\");\n this.word(node.name);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.AnyTypeAnnotation = AnyTypeAnnotation;\nexports.ArrayTypeAnnotation = ArrayTypeAnnotation;\nexports.BooleanTypeAnnotation = BooleanTypeAnnotation;\nexports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;\nexports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;\nexports.DeclareClass = DeclareClass;\nexports.DeclareFunction = DeclareFunction;\nexports.InferredPredicate = InferredPredicate;\nexports.DeclaredPredicate = DeclaredPredicate;\nexports.DeclareInterface = DeclareInterface;\nexports.DeclareModule = DeclareModule;\nexports.DeclareModuleExports = DeclareModuleExports;\nexports.DeclareTypeAlias = DeclareTypeAlias;\nexports.DeclareOpaqueType = DeclareOpaqueType;\nexports.DeclareVariable = DeclareVariable;\nexports.DeclareExportDeclaration = DeclareExportDeclaration;\nexports.DeclareExportAllDeclaration = DeclareExportAllDeclaration;\nexports.EnumDeclaration = EnumDeclaration;\nexports.EnumBooleanBody = EnumBooleanBody;\nexports.EnumNumberBody = EnumNumberBody;\nexports.EnumStringBody = EnumStringBody;\nexports.EnumSymbolBody = EnumSymbolBody;\nexports.EnumDefaultedMember = EnumDefaultedMember;\nexports.EnumBooleanMember = EnumBooleanMember;\nexports.EnumNumberMember = EnumNumberMember;\nexports.EnumStringMember = EnumStringMember;\nexports.ExistsTypeAnnotation = ExistsTypeAnnotation;\nexports.FunctionTypeAnnotation = FunctionTypeAnnotation;\nexports.FunctionTypeParam = FunctionTypeParam;\nexports.GenericTypeAnnotation = exports.ClassImplements = exports.InterfaceExtends = InterfaceExtends;\nexports._interfaceish = _interfaceish;\nexports._variance = _variance;\nexports.InterfaceDeclaration = InterfaceDeclaration;\nexports.InterfaceTypeAnnotation = InterfaceTypeAnnotation;\nexports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;\nexports.MixedTypeAnnotation = MixedTypeAnnotation;\nexports.EmptyTypeAnnotation = EmptyTypeAnnotation;\nexports.NullableTypeAnnotation = NullableTypeAnnotation;\nexports.NumberTypeAnnotation = NumberTypeAnnotation;\nexports.StringTypeAnnotation = StringTypeAnnotation;\nexports.ThisTypeAnnotation = ThisTypeAnnotation;\nexports.TupleTypeAnnotation = TupleTypeAnnotation;\nexports.TypeofTypeAnnotation = TypeofTypeAnnotation;\nexports.TypeAlias = TypeAlias;\nexports.TypeAnnotation = TypeAnnotation;\nexports.TypeParameterDeclaration = exports.TypeParameterInstantiation = TypeParameterInstantiation;\nexports.TypeParameter = TypeParameter;\nexports.OpaqueType = OpaqueType;\nexports.ObjectTypeAnnotation = ObjectTypeAnnotation;\nexports.ObjectTypeInternalSlot = ObjectTypeInternalSlot;\nexports.ObjectTypeCallProperty = ObjectTypeCallProperty;\nexports.ObjectTypeIndexer = ObjectTypeIndexer;\nexports.ObjectTypeProperty = ObjectTypeProperty;\nexports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;\nexports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;\nexports.SymbolTypeAnnotation = SymbolTypeAnnotation;\nexports.UnionTypeAnnotation = UnionTypeAnnotation;\nexports.TypeCastExpression = TypeCastExpression;\nexports.Variance = Variance;\nexports.VoidTypeAnnotation = VoidTypeAnnotation;\nObject.defineProperty(exports, \"NumberLiteralTypeAnnotation\", {\n enumerable: true,\n get: function () {\n return _types2.NumericLiteral;\n }\n});\nObject.defineProperty(exports, \"StringLiteralTypeAnnotation\", {\n enumerable: true,\n get: function () {\n return _types2.StringLiteral;\n }\n});\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar _modules = require(\"./modules\");\n\nvar _types2 = require(\"./types\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction AnyTypeAnnotation() {\n this.word(\"any\");\n}\n\nfunction ArrayTypeAnnotation(node) {\n this.print(node.elementType, node);\n this.token(\"[\");\n this.token(\"]\");\n}\n\nfunction BooleanTypeAnnotation() {\n this.word(\"boolean\");\n}\n\nfunction BooleanLiteralTypeAnnotation(node) {\n this.word(node.value ? \"true\" : \"false\");\n}\n\nfunction NullLiteralTypeAnnotation() {\n this.word(\"null\");\n}\n\nfunction DeclareClass(node, parent) {\n if (!t.isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n\n this.word(\"class\");\n this.space();\n\n this._interfaceish(node);\n}\n\nfunction DeclareFunction(node, parent) {\n if (!t.isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n\n this.word(\"function\");\n this.space();\n this.print(node.id, node);\n this.print(node.id.typeAnnotation.typeAnnotation, node);\n\n if (node.predicate) {\n this.space();\n this.print(node.predicate, node);\n }\n\n this.semicolon();\n}\n\nfunction InferredPredicate() {\n this.token(\"%\");\n this.word(\"checks\");\n}\n\nfunction DeclaredPredicate(node) {\n this.token(\"%\");\n this.word(\"checks\");\n this.token(\"(\");\n this.print(node.value, node);\n this.token(\")\");\n}\n\nfunction DeclareInterface(node) {\n this.word(\"declare\");\n this.space();\n this.InterfaceDeclaration(node);\n}\n\nfunction DeclareModule(node) {\n this.word(\"declare\");\n this.space();\n this.word(\"module\");\n this.space();\n this.print(node.id, node);\n this.space();\n this.print(node.body, node);\n}\n\nfunction DeclareModuleExports(node) {\n this.word(\"declare\");\n this.space();\n this.word(\"module\");\n this.token(\".\");\n this.word(\"exports\");\n this.print(node.typeAnnotation, node);\n}\n\nfunction DeclareTypeAlias(node) {\n this.word(\"declare\");\n this.space();\n this.TypeAlias(node);\n}\n\nfunction DeclareOpaqueType(node, parent) {\n if (!t.isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n\n this.OpaqueType(node);\n}\n\nfunction DeclareVariable(node, parent) {\n if (!t.isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n\n this.word(\"var\");\n this.space();\n this.print(node.id, node);\n this.print(node.id.typeAnnotation, node);\n this.semicolon();\n}\n\nfunction DeclareExportDeclaration(node) {\n this.word(\"declare\");\n this.space();\n this.word(\"export\");\n this.space();\n\n if (node.default) {\n this.word(\"default\");\n this.space();\n }\n\n FlowExportDeclaration.apply(this, arguments);\n}\n\nfunction DeclareExportAllDeclaration() {\n this.word(\"declare\");\n this.space();\n\n _modules.ExportAllDeclaration.apply(this, arguments);\n}\n\nfunction EnumDeclaration(node) {\n const {\n id,\n body\n } = node;\n this.word(\"enum\");\n this.space();\n this.print(id, node);\n this.print(body, node);\n}\n\nfunction enumExplicitType(context, name, hasExplicitType) {\n if (hasExplicitType) {\n context.space();\n context.word(\"of\");\n context.space();\n context.word(name);\n }\n\n context.space();\n}\n\nfunction enumBody(context, node) {\n const {\n members\n } = node;\n context.token(\"{\");\n context.indent();\n context.newline();\n\n for (const member of members) {\n context.print(member, node);\n context.newline();\n }\n\n context.dedent();\n context.token(\"}\");\n}\n\nfunction EnumBooleanBody(node) {\n const {\n explicitType\n } = node;\n enumExplicitType(this, \"boolean\", explicitType);\n enumBody(this, node);\n}\n\nfunction EnumNumberBody(node) {\n const {\n explicitType\n } = node;\n enumExplicitType(this, \"number\", explicitType);\n enumBody(this, node);\n}\n\nfunction EnumStringBody(node) {\n const {\n explicitType\n } = node;\n enumExplicitType(this, \"string\", explicitType);\n enumBody(this, node);\n}\n\nfunction EnumSymbolBody(node) {\n enumExplicitType(this, \"symbol\", true);\n enumBody(this, node);\n}\n\nfunction EnumDefaultedMember(node) {\n const {\n id\n } = node;\n this.print(id, node);\n this.token(\",\");\n}\n\nfunction enumInitializedMember(context, node) {\n const {\n id,\n init\n } = node;\n context.print(id, node);\n context.space();\n context.token(\"=\");\n context.space();\n context.print(init, node);\n context.token(\",\");\n}\n\nfunction EnumBooleanMember(node) {\n enumInitializedMember(this, node);\n}\n\nfunction EnumNumberMember(node) {\n enumInitializedMember(this, node);\n}\n\nfunction EnumStringMember(node) {\n enumInitializedMember(this, node);\n}\n\nfunction FlowExportDeclaration(node) {\n if (node.declaration) {\n const declar = node.declaration;\n this.print(declar, node);\n if (!t.isStatement(declar)) this.semicolon();\n } else {\n this.token(\"{\");\n\n if (node.specifiers.length) {\n this.space();\n this.printList(node.specifiers, node);\n this.space();\n }\n\n this.token(\"}\");\n\n if (node.source) {\n this.space();\n this.word(\"from\");\n this.space();\n this.print(node.source, node);\n }\n\n this.semicolon();\n }\n}\n\nfunction ExistsTypeAnnotation() {\n this.token(\"*\");\n}\n\nfunction FunctionTypeAnnotation(node, parent) {\n this.print(node.typeParameters, node);\n this.token(\"(\");\n this.printList(node.params, node);\n\n if (node.rest) {\n if (node.params.length) {\n this.token(\",\");\n this.space();\n }\n\n this.token(\"...\");\n this.print(node.rest, node);\n }\n\n this.token(\")\");\n\n if (parent.type === \"ObjectTypeCallProperty\" || parent.type === \"DeclareFunction\" || parent.type === \"ObjectTypeProperty\" && parent.method) {\n this.token(\":\");\n } else {\n this.space();\n this.token(\"=>\");\n }\n\n this.space();\n this.print(node.returnType, node);\n}\n\nfunction FunctionTypeParam(node) {\n this.print(node.name, node);\n if (node.optional) this.token(\"?\");\n\n if (node.name) {\n this.token(\":\");\n this.space();\n }\n\n this.print(node.typeAnnotation, node);\n}\n\nfunction InterfaceExtends(node) {\n this.print(node.id, node);\n this.print(node.typeParameters, node);\n}\n\nfunction _interfaceish(node) {\n this.print(node.id, node);\n this.print(node.typeParameters, node);\n\n if (node.extends.length) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.printList(node.extends, node);\n }\n\n if (node.mixins && node.mixins.length) {\n this.space();\n this.word(\"mixins\");\n this.space();\n this.printList(node.mixins, node);\n }\n\n if (node.implements && node.implements.length) {\n this.space();\n this.word(\"implements\");\n this.space();\n this.printList(node.implements, node);\n }\n\n this.space();\n this.print(node.body, node);\n}\n\nfunction _variance(node) {\n if (node.variance) {\n if (node.variance.kind === \"plus\") {\n this.token(\"+\");\n } else if (node.variance.kind === \"minus\") {\n this.token(\"-\");\n }\n }\n}\n\nfunction InterfaceDeclaration(node) {\n this.word(\"interface\");\n this.space();\n\n this._interfaceish(node);\n}\n\nfunction andSeparator() {\n this.space();\n this.token(\"&\");\n this.space();\n}\n\nfunction InterfaceTypeAnnotation(node) {\n this.word(\"interface\");\n\n if (node.extends && node.extends.length) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.printList(node.extends, node);\n }\n\n this.space();\n this.print(node.body, node);\n}\n\nfunction IntersectionTypeAnnotation(node) {\n this.printJoin(node.types, node, {\n separator: andSeparator\n });\n}\n\nfunction MixedTypeAnnotation() {\n this.word(\"mixed\");\n}\n\nfunction EmptyTypeAnnotation() {\n this.word(\"empty\");\n}\n\nfunction NullableTypeAnnotation(node) {\n this.token(\"?\");\n this.print(node.typeAnnotation, node);\n}\n\nfunction NumberTypeAnnotation() {\n this.word(\"number\");\n}\n\nfunction StringTypeAnnotation() {\n this.word(\"string\");\n}\n\nfunction ThisTypeAnnotation() {\n this.word(\"this\");\n}\n\nfunction TupleTypeAnnotation(node) {\n this.token(\"[\");\n this.printList(node.types, node);\n this.token(\"]\");\n}\n\nfunction TypeofTypeAnnotation(node) {\n this.word(\"typeof\");\n this.space();\n this.print(node.argument, node);\n}\n\nfunction TypeAlias(node) {\n this.word(\"type\");\n this.space();\n this.print(node.id, node);\n this.print(node.typeParameters, node);\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.right, node);\n this.semicolon();\n}\n\nfunction TypeAnnotation(node) {\n this.token(\":\");\n this.space();\n if (node.optional) this.token(\"?\");\n this.print(node.typeAnnotation, node);\n}\n\nfunction TypeParameterInstantiation(node) {\n this.token(\"<\");\n this.printList(node.params, node, {});\n this.token(\">\");\n}\n\nfunction TypeParameter(node) {\n this._variance(node);\n\n this.word(node.name);\n\n if (node.bound) {\n this.print(node.bound, node);\n }\n\n if (node.default) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.default, node);\n }\n}\n\nfunction OpaqueType(node) {\n this.word(\"opaque\");\n this.space();\n this.word(\"type\");\n this.space();\n this.print(node.id, node);\n this.print(node.typeParameters, node);\n\n if (node.supertype) {\n this.token(\":\");\n this.space();\n this.print(node.supertype, node);\n }\n\n if (node.impltype) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.impltype, node);\n }\n\n this.semicolon();\n}\n\nfunction ObjectTypeAnnotation(node) {\n if (node.exact) {\n this.token(\"{|\");\n } else {\n this.token(\"{\");\n }\n\n const props = node.properties.concat(node.callProperties || [], node.indexers || [], node.internalSlots || []);\n\n if (props.length) {\n this.space();\n this.printJoin(props, node, {\n addNewlines(leading) {\n if (leading && !props[0]) return 1;\n },\n\n indent: true,\n statement: true,\n iterator: () => {\n if (props.length !== 1 || node.inexact) {\n this.token(\",\");\n this.space();\n }\n }\n });\n this.space();\n }\n\n if (node.inexact) {\n this.indent();\n this.token(\"...\");\n\n if (props.length) {\n this.newline();\n }\n\n this.dedent();\n }\n\n if (node.exact) {\n this.token(\"|}\");\n } else {\n this.token(\"}\");\n }\n}\n\nfunction ObjectTypeInternalSlot(node) {\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n\n this.token(\"[\");\n this.token(\"[\");\n this.print(node.id, node);\n this.token(\"]\");\n this.token(\"]\");\n if (node.optional) this.token(\"?\");\n\n if (!node.method) {\n this.token(\":\");\n this.space();\n }\n\n this.print(node.value, node);\n}\n\nfunction ObjectTypeCallProperty(node) {\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n\n this.print(node.value, node);\n}\n\nfunction ObjectTypeIndexer(node) {\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n\n this._variance(node);\n\n this.token(\"[\");\n\n if (node.id) {\n this.print(node.id, node);\n this.token(\":\");\n this.space();\n }\n\n this.print(node.key, node);\n this.token(\"]\");\n this.token(\":\");\n this.space();\n this.print(node.value, node);\n}\n\nfunction ObjectTypeProperty(node) {\n if (node.proto) {\n this.word(\"proto\");\n this.space();\n }\n\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n\n if (node.kind === \"get\" || node.kind === \"set\") {\n this.word(node.kind);\n this.space();\n }\n\n this._variance(node);\n\n this.print(node.key, node);\n if (node.optional) this.token(\"?\");\n\n if (!node.method) {\n this.token(\":\");\n this.space();\n }\n\n this.print(node.value, node);\n}\n\nfunction ObjectTypeSpreadProperty(node) {\n this.token(\"...\");\n this.print(node.argument, node);\n}\n\nfunction QualifiedTypeIdentifier(node) {\n this.print(node.qualification, node);\n this.token(\".\");\n this.print(node.id, node);\n}\n\nfunction SymbolTypeAnnotation() {\n this.word(\"symbol\");\n}\n\nfunction orSeparator() {\n this.space();\n this.token(\"|\");\n this.space();\n}\n\nfunction UnionTypeAnnotation(node) {\n this.printJoin(node.types, node, {\n separator: orSeparator\n });\n}\n\nfunction TypeCastExpression(node) {\n this.token(\"(\");\n this.print(node.expression, node);\n this.print(node.typeAnnotation, node);\n this.token(\")\");\n}\n\nfunction Variance(node) {\n if (node.kind === \"plus\") {\n this.token(\"+\");\n } else {\n this.token(\"-\");\n }\n}\n\nfunction VoidTypeAnnotation() {\n this.word(\"void\");\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _templateLiterals = require(\"./template-literals\");\n\nObject.keys(_templateLiterals).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _templateLiterals[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _templateLiterals[key];\n }\n });\n});\n\nvar _expressions = require(\"./expressions\");\n\nObject.keys(_expressions).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _expressions[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _expressions[key];\n }\n });\n});\n\nvar _statements = require(\"./statements\");\n\nObject.keys(_statements).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _statements[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _statements[key];\n }\n });\n});\n\nvar _classes = require(\"./classes\");\n\nObject.keys(_classes).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _classes[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _classes[key];\n }\n });\n});\n\nvar _methods = require(\"./methods\");\n\nObject.keys(_methods).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _methods[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _methods[key];\n }\n });\n});\n\nvar _modules = require(\"./modules\");\n\nObject.keys(_modules).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _modules[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _modules[key];\n }\n });\n});\n\nvar _types = require(\"./types\");\n\nObject.keys(_types).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _types[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _types[key];\n }\n });\n});\n\nvar _flow = require(\"./flow\");\n\nObject.keys(_flow).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _flow[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _flow[key];\n }\n });\n});\n\nvar _base = require(\"./base\");\n\nObject.keys(_base).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _base[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _base[key];\n }\n });\n});\n\nvar _jsx = require(\"./jsx\");\n\nObject.keys(_jsx).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _jsx[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _jsx[key];\n }\n });\n});\n\nvar _typescript = require(\"./typescript\");\n\nObject.keys(_typescript).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _typescript[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _typescript[key];\n }\n });\n});","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.JSXAttribute = JSXAttribute;\nexports.JSXIdentifier = JSXIdentifier;\nexports.JSXNamespacedName = JSXNamespacedName;\nexports.JSXMemberExpression = JSXMemberExpression;\nexports.JSXSpreadAttribute = JSXSpreadAttribute;\nexports.JSXExpressionContainer = JSXExpressionContainer;\nexports.JSXSpreadChild = JSXSpreadChild;\nexports.JSXText = JSXText;\nexports.JSXElement = JSXElement;\nexports.JSXOpeningElement = JSXOpeningElement;\nexports.JSXClosingElement = JSXClosingElement;\nexports.JSXEmptyExpression = JSXEmptyExpression;\nexports.JSXFragment = JSXFragment;\nexports.JSXOpeningFragment = JSXOpeningFragment;\nexports.JSXClosingFragment = JSXClosingFragment;\n\nfunction JSXAttribute(node) {\n this.print(node.name, node);\n\n if (node.value) {\n this.token(\"=\");\n this.print(node.value, node);\n }\n}\n\nfunction JSXIdentifier(node) {\n this.word(node.name);\n}\n\nfunction JSXNamespacedName(node) {\n this.print(node.namespace, node);\n this.token(\":\");\n this.print(node.name, node);\n}\n\nfunction JSXMemberExpression(node) {\n this.print(node.object, node);\n this.token(\".\");\n this.print(node.property, node);\n}\n\nfunction JSXSpreadAttribute(node) {\n this.token(\"{\");\n this.token(\"...\");\n this.print(node.argument, node);\n this.token(\"}\");\n}\n\nfunction JSXExpressionContainer(node) {\n this.token(\"{\");\n this.print(node.expression, node);\n this.token(\"}\");\n}\n\nfunction JSXSpreadChild(node) {\n this.token(\"{\");\n this.token(\"...\");\n this.print(node.expression, node);\n this.token(\"}\");\n}\n\nfunction JSXText(node) {\n const raw = this.getPossibleRaw(node);\n\n if (raw != null) {\n this.token(raw);\n } else {\n this.token(node.value);\n }\n}\n\nfunction JSXElement(node) {\n const open = node.openingElement;\n this.print(open, node);\n if (open.selfClosing) return;\n this.indent();\n\n for (const child of node.children) {\n this.print(child, node);\n }\n\n this.dedent();\n this.print(node.closingElement, node);\n}\n\nfunction spaceSeparator() {\n this.space();\n}\n\nfunction JSXOpeningElement(node) {\n this.token(\"<\");\n this.print(node.name, node);\n this.print(node.typeParameters, node);\n\n if (node.attributes.length > 0) {\n this.space();\n this.printJoin(node.attributes, node, {\n separator: spaceSeparator\n });\n }\n\n if (node.selfClosing) {\n this.space();\n this.token(\"/>\");\n } else {\n this.token(\">\");\n }\n}\n\nfunction JSXClosingElement(node) {\n this.token(\"\");\n}\n\nfunction JSXEmptyExpression(node) {\n this.printInnerComments(node);\n}\n\nfunction JSXFragment(node) {\n this.print(node.openingFragment, node);\n this.indent();\n\n for (const child of node.children) {\n this.print(child, node);\n }\n\n this.dedent();\n this.print(node.closingFragment, node);\n}\n\nfunction JSXOpeningFragment() {\n this.token(\"<\");\n this.token(\">\");\n}\n\nfunction JSXClosingFragment() {\n this.token(\"\");\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports._params = _params;\nexports._parameters = _parameters;\nexports._param = _param;\nexports._methodHead = _methodHead;\nexports._predicate = _predicate;\nexports._functionHead = _functionHead;\nexports.FunctionDeclaration = exports.FunctionExpression = FunctionExpression;\nexports.ArrowFunctionExpression = ArrowFunctionExpression;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _params(node) {\n this.print(node.typeParameters, node);\n this.token(\"(\");\n\n this._parameters(node.params, node);\n\n this.token(\")\");\n this.print(node.returnType, node);\n}\n\nfunction _parameters(parameters, parent) {\n for (let i = 0; i < parameters.length; i++) {\n this._param(parameters[i], parent);\n\n if (i < parameters.length - 1) {\n this.token(\",\");\n this.space();\n }\n }\n}\n\nfunction _param(parameter, parent) {\n this.printJoin(parameter.decorators, parameter);\n this.print(parameter, parent);\n if (parameter.optional) this.token(\"?\");\n this.print(parameter.typeAnnotation, parameter);\n}\n\nfunction _methodHead(node) {\n const kind = node.kind;\n const key = node.key;\n\n if (kind === \"get\" || kind === \"set\") {\n this.word(kind);\n this.space();\n }\n\n if (node.async) {\n this._catchUp(\"start\", key.loc);\n\n this.word(\"async\");\n this.space();\n }\n\n if (kind === \"method\" || kind === \"init\") {\n if (node.generator) {\n this.token(\"*\");\n }\n }\n\n if (node.computed) {\n this.token(\"[\");\n this.print(key, node);\n this.token(\"]\");\n } else {\n this.print(key, node);\n }\n\n if (node.optional) {\n this.token(\"?\");\n }\n\n this._params(node);\n}\n\nfunction _predicate(node) {\n if (node.predicate) {\n if (!node.returnType) {\n this.token(\":\");\n }\n\n this.space();\n this.print(node.predicate, node);\n }\n}\n\nfunction _functionHead(node) {\n if (node.async) {\n this.word(\"async\");\n this.space();\n }\n\n this.word(\"function\");\n if (node.generator) this.token(\"*\");\n this.space();\n\n if (node.id) {\n this.print(node.id, node);\n }\n\n this._params(node);\n\n this._predicate(node);\n}\n\nfunction FunctionExpression(node) {\n this._functionHead(node);\n\n this.space();\n this.print(node.body, node);\n}\n\nfunction ArrowFunctionExpression(node) {\n if (node.async) {\n this.word(\"async\");\n this.space();\n }\n\n const firstParam = node.params[0];\n\n if (node.params.length === 1 && t.isIdentifier(firstParam) && !hasTypes(node, firstParam)) {\n if ((this.format.retainLines || node.async) && node.loc && node.body.loc && node.loc.start.line < node.body.loc.start.line) {\n this.token(\"(\");\n\n if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) {\n this.indent();\n this.print(firstParam, node);\n this.dedent();\n\n this._catchUp(\"start\", node.body.loc);\n } else {\n this.print(firstParam, node);\n }\n\n this.token(\")\");\n } else {\n this.print(firstParam, node);\n }\n } else {\n this._params(node);\n }\n\n this._predicate(node);\n\n this.space();\n this.token(\"=>\");\n this.space();\n this.print(node.body, node);\n}\n\nfunction hasTypes(node, param) {\n return node.typeParameters || node.returnType || param.typeAnnotation || param.optional || param.trailingComments;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ImportSpecifier = ImportSpecifier;\nexports.ImportDefaultSpecifier = ImportDefaultSpecifier;\nexports.ExportDefaultSpecifier = ExportDefaultSpecifier;\nexports.ExportSpecifier = ExportSpecifier;\nexports.ExportNamespaceSpecifier = ExportNamespaceSpecifier;\nexports.ExportAllDeclaration = ExportAllDeclaration;\nexports.ExportNamedDeclaration = ExportNamedDeclaration;\nexports.ExportDefaultDeclaration = ExportDefaultDeclaration;\nexports.ImportDeclaration = ImportDeclaration;\nexports.ImportAttribute = ImportAttribute;\nexports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction ImportSpecifier(node) {\n if (node.importKind === \"type\" || node.importKind === \"typeof\") {\n this.word(node.importKind);\n this.space();\n }\n\n this.print(node.imported, node);\n\n if (node.local && node.local.name !== node.imported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.local, node);\n }\n}\n\nfunction ImportDefaultSpecifier(node) {\n this.print(node.local, node);\n}\n\nfunction ExportDefaultSpecifier(node) {\n this.print(node.exported, node);\n}\n\nfunction ExportSpecifier(node) {\n this.print(node.local, node);\n\n if (node.exported && node.local.name !== node.exported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported, node);\n }\n}\n\nfunction ExportNamespaceSpecifier(node) {\n this.token(\"*\");\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported, node);\n}\n\nfunction ExportAllDeclaration(node) {\n this.word(\"export\");\n this.space();\n\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n\n this.token(\"*\");\n this.space();\n this.word(\"from\");\n this.space();\n this.print(node.source, node);\n this.printAssertions(node);\n this.semicolon();\n}\n\nfunction ExportNamedDeclaration(node) {\n if (this.format.decoratorsBeforeExport && t.isClassDeclaration(node.declaration)) {\n this.printJoin(node.declaration.decorators, node);\n }\n\n this.word(\"export\");\n this.space();\n ExportDeclaration.apply(this, arguments);\n}\n\nfunction ExportDefaultDeclaration(node) {\n if (this.format.decoratorsBeforeExport && t.isClassDeclaration(node.declaration)) {\n this.printJoin(node.declaration.decorators, node);\n }\n\n this.word(\"export\");\n this.space();\n this.word(\"default\");\n this.space();\n ExportDeclaration.apply(this, arguments);\n}\n\nfunction ExportDeclaration(node) {\n if (node.declaration) {\n const declar = node.declaration;\n this.print(declar, node);\n if (!t.isStatement(declar)) this.semicolon();\n } else {\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n\n const specifiers = node.specifiers.slice(0);\n let hasSpecial = false;\n\n for (;;) {\n const first = specifiers[0];\n\n if (t.isExportDefaultSpecifier(first) || t.isExportNamespaceSpecifier(first)) {\n hasSpecial = true;\n this.print(specifiers.shift(), node);\n\n if (specifiers.length) {\n this.token(\",\");\n this.space();\n }\n } else {\n break;\n }\n }\n\n if (specifiers.length || !specifiers.length && !hasSpecial) {\n this.token(\"{\");\n\n if (specifiers.length) {\n this.space();\n this.printList(specifiers, node);\n this.space();\n }\n\n this.token(\"}\");\n }\n\n if (node.source) {\n this.space();\n this.word(\"from\");\n this.space();\n this.print(node.source, node);\n this.printAssertions(node);\n }\n\n this.semicolon();\n }\n}\n\nfunction ImportDeclaration(node) {\n var _node$attributes;\n\n this.word(\"import\");\n this.space();\n\n if (node.importKind === \"type\" || node.importKind === \"typeof\") {\n this.word(node.importKind);\n this.space();\n }\n\n const specifiers = node.specifiers.slice(0);\n\n if (specifiers == null ? void 0 : specifiers.length) {\n for (;;) {\n const first = specifiers[0];\n\n if (t.isImportDefaultSpecifier(first) || t.isImportNamespaceSpecifier(first)) {\n this.print(specifiers.shift(), node);\n\n if (specifiers.length) {\n this.token(\",\");\n this.space();\n }\n } else {\n break;\n }\n }\n\n if (specifiers.length) {\n this.token(\"{\");\n this.space();\n this.printList(specifiers, node);\n this.space();\n this.token(\"}\");\n }\n\n this.space();\n this.word(\"from\");\n this.space();\n }\n\n this.print(node.source, node);\n this.printAssertions(node);\n\n if ((_node$attributes = node.attributes) == null ? void 0 : _node$attributes.length) {\n this.space();\n this.word(\"with\");\n this.space();\n this.printList(node.attributes, node);\n }\n\n this.semicolon();\n}\n\nfunction ImportAttribute(node) {\n this.print(node.key);\n this.token(\":\");\n this.space();\n this.print(node.value);\n}\n\nfunction ImportNamespaceSpecifier(node) {\n this.token(\"*\");\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.local, node);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.WithStatement = WithStatement;\nexports.IfStatement = IfStatement;\nexports.ForStatement = ForStatement;\nexports.WhileStatement = WhileStatement;\nexports.DoWhileStatement = DoWhileStatement;\nexports.LabeledStatement = LabeledStatement;\nexports.TryStatement = TryStatement;\nexports.CatchClause = CatchClause;\nexports.SwitchStatement = SwitchStatement;\nexports.SwitchCase = SwitchCase;\nexports.DebuggerStatement = DebuggerStatement;\nexports.VariableDeclaration = VariableDeclaration;\nexports.VariableDeclarator = VariableDeclarator;\nexports.ThrowStatement = exports.BreakStatement = exports.ReturnStatement = exports.ContinueStatement = exports.ForOfStatement = exports.ForInStatement = void 0;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction WithStatement(node) {\n this.word(\"with\");\n this.space();\n this.token(\"(\");\n this.print(node.object, node);\n this.token(\")\");\n this.printBlock(node);\n}\n\nfunction IfStatement(node) {\n this.word(\"if\");\n this.space();\n this.token(\"(\");\n this.print(node.test, node);\n this.token(\")\");\n this.space();\n const needsBlock = node.alternate && t.isIfStatement(getLastStatement(node.consequent));\n\n if (needsBlock) {\n this.token(\"{\");\n this.newline();\n this.indent();\n }\n\n this.printAndIndentOnComments(node.consequent, node);\n\n if (needsBlock) {\n this.dedent();\n this.newline();\n this.token(\"}\");\n }\n\n if (node.alternate) {\n if (this.endsWith(\"}\")) this.space();\n this.word(\"else\");\n this.space();\n this.printAndIndentOnComments(node.alternate, node);\n }\n}\n\nfunction getLastStatement(statement) {\n if (!t.isStatement(statement.body)) return statement;\n return getLastStatement(statement.body);\n}\n\nfunction ForStatement(node) {\n this.word(\"for\");\n this.space();\n this.token(\"(\");\n this.inForStatementInitCounter++;\n this.print(node.init, node);\n this.inForStatementInitCounter--;\n this.token(\";\");\n\n if (node.test) {\n this.space();\n this.print(node.test, node);\n }\n\n this.token(\";\");\n\n if (node.update) {\n this.space();\n this.print(node.update, node);\n }\n\n this.token(\")\");\n this.printBlock(node);\n}\n\nfunction WhileStatement(node) {\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test, node);\n this.token(\")\");\n this.printBlock(node);\n}\n\nconst buildForXStatement = function (op) {\n return function (node) {\n this.word(\"for\");\n this.space();\n\n if (op === \"of\" && node.await) {\n this.word(\"await\");\n this.space();\n }\n\n this.token(\"(\");\n this.print(node.left, node);\n this.space();\n this.word(op);\n this.space();\n this.print(node.right, node);\n this.token(\")\");\n this.printBlock(node);\n };\n};\n\nconst ForInStatement = buildForXStatement(\"in\");\nexports.ForInStatement = ForInStatement;\nconst ForOfStatement = buildForXStatement(\"of\");\nexports.ForOfStatement = ForOfStatement;\n\nfunction DoWhileStatement(node) {\n this.word(\"do\");\n this.space();\n this.print(node.body, node);\n this.space();\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test, node);\n this.token(\")\");\n this.semicolon();\n}\n\nfunction buildLabelStatement(prefix, key = \"label\") {\n return function (node) {\n this.word(prefix);\n const label = node[key];\n\n if (label) {\n this.space();\n const isLabel = key == \"label\";\n const terminatorState = this.startTerminatorless(isLabel);\n this.print(label, node);\n this.endTerminatorless(terminatorState);\n }\n\n this.semicolon();\n };\n}\n\nconst ContinueStatement = buildLabelStatement(\"continue\");\nexports.ContinueStatement = ContinueStatement;\nconst ReturnStatement = buildLabelStatement(\"return\", \"argument\");\nexports.ReturnStatement = ReturnStatement;\nconst BreakStatement = buildLabelStatement(\"break\");\nexports.BreakStatement = BreakStatement;\nconst ThrowStatement = buildLabelStatement(\"throw\", \"argument\");\nexports.ThrowStatement = ThrowStatement;\n\nfunction LabeledStatement(node) {\n this.print(node.label, node);\n this.token(\":\");\n this.space();\n this.print(node.body, node);\n}\n\nfunction TryStatement(node) {\n this.word(\"try\");\n this.space();\n this.print(node.block, node);\n this.space();\n\n if (node.handlers) {\n this.print(node.handlers[0], node);\n } else {\n this.print(node.handler, node);\n }\n\n if (node.finalizer) {\n this.space();\n this.word(\"finally\");\n this.space();\n this.print(node.finalizer, node);\n }\n}\n\nfunction CatchClause(node) {\n this.word(\"catch\");\n this.space();\n\n if (node.param) {\n this.token(\"(\");\n this.print(node.param, node);\n this.print(node.param.typeAnnotation, node);\n this.token(\")\");\n this.space();\n }\n\n this.print(node.body, node);\n}\n\nfunction SwitchStatement(node) {\n this.word(\"switch\");\n this.space();\n this.token(\"(\");\n this.print(node.discriminant, node);\n this.token(\")\");\n this.space();\n this.token(\"{\");\n this.printSequence(node.cases, node, {\n indent: true,\n\n addNewlines(leading, cas) {\n if (!leading && node.cases[node.cases.length - 1] === cas) return -1;\n }\n\n });\n this.token(\"}\");\n}\n\nfunction SwitchCase(node) {\n if (node.test) {\n this.word(\"case\");\n this.space();\n this.print(node.test, node);\n this.token(\":\");\n } else {\n this.word(\"default\");\n this.token(\":\");\n }\n\n if (node.consequent.length) {\n this.newline();\n this.printSequence(node.consequent, node, {\n indent: true\n });\n }\n}\n\nfunction DebuggerStatement() {\n this.word(\"debugger\");\n this.semicolon();\n}\n\nfunction variableDeclarationIndent() {\n this.token(\",\");\n this.newline();\n if (this.endsWith(\"\\n\")) for (let i = 0; i < 4; i++) this.space(true);\n}\n\nfunction constDeclarationIndent() {\n this.token(\",\");\n this.newline();\n if (this.endsWith(\"\\n\")) for (let i = 0; i < 6; i++) this.space(true);\n}\n\nfunction VariableDeclaration(node, parent) {\n if (node.declare) {\n this.word(\"declare\");\n this.space();\n }\n\n this.word(node.kind);\n this.space();\n let hasInits = false;\n\n if (!t.isFor(parent)) {\n for (const declar of node.declarations) {\n if (declar.init) {\n hasInits = true;\n }\n }\n }\n\n let separator;\n\n if (hasInits) {\n separator = node.kind === \"const\" ? constDeclarationIndent : variableDeclarationIndent;\n }\n\n this.printList(node.declarations, node, {\n separator\n });\n\n if (t.isFor(parent)) {\n if (parent.left === node || parent.init === node) return;\n }\n\n this.semicolon();\n}\n\nfunction VariableDeclarator(node) {\n this.print(node.id, node);\n if (node.definite) this.token(\"!\");\n this.print(node.id.typeAnnotation, node);\n\n if (node.init) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.init, node);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.TaggedTemplateExpression = TaggedTemplateExpression;\nexports.TemplateElement = TemplateElement;\nexports.TemplateLiteral = TemplateLiteral;\n\nfunction TaggedTemplateExpression(node) {\n this.print(node.tag, node);\n this.print(node.typeParameters, node);\n this.print(node.quasi, node);\n}\n\nfunction TemplateElement(node, parent) {\n const isFirst = parent.quasis[0] === node;\n const isLast = parent.quasis[parent.quasis.length - 1] === node;\n const value = (isFirst ? \"`\" : \"}\") + node.value.raw + (isLast ? \"`\" : \"${\");\n this.token(value);\n}\n\nfunction TemplateLiteral(node) {\n const quasis = node.quasis;\n\n for (let i = 0; i < quasis.length; i++) {\n this.print(quasis[i], node);\n\n if (i + 1 < quasis.length) {\n this.print(node.expressions[i], node);\n }\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Identifier = Identifier;\nexports.ArgumentPlaceholder = ArgumentPlaceholder;\nexports.SpreadElement = exports.RestElement = RestElement;\nexports.ObjectPattern = exports.ObjectExpression = ObjectExpression;\nexports.ObjectMethod = ObjectMethod;\nexports.ObjectProperty = ObjectProperty;\nexports.ArrayPattern = exports.ArrayExpression = ArrayExpression;\nexports.RecordExpression = RecordExpression;\nexports.TupleExpression = TupleExpression;\nexports.RegExpLiteral = RegExpLiteral;\nexports.BooleanLiteral = BooleanLiteral;\nexports.NullLiteral = NullLiteral;\nexports.NumericLiteral = NumericLiteral;\nexports.StringLiteral = StringLiteral;\nexports.BigIntLiteral = BigIntLiteral;\nexports.DecimalLiteral = DecimalLiteral;\nexports.PipelineTopicExpression = PipelineTopicExpression;\nexports.PipelineBareFunction = PipelineBareFunction;\nexports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar _jsesc = _interopRequireDefault(require(\"jsesc\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction Identifier(node) {\n this.exactSource(node.loc, () => {\n this.word(node.name);\n });\n}\n\nfunction ArgumentPlaceholder() {\n this.token(\"?\");\n}\n\nfunction RestElement(node) {\n this.token(\"...\");\n this.print(node.argument, node);\n}\n\nfunction ObjectExpression(node) {\n const props = node.properties;\n this.token(\"{\");\n this.printInnerComments(node);\n\n if (props.length) {\n this.space();\n this.printList(props, node, {\n indent: true,\n statement: true\n });\n this.space();\n }\n\n this.token(\"}\");\n}\n\nfunction ObjectMethod(node) {\n this.printJoin(node.decorators, node);\n\n this._methodHead(node);\n\n this.space();\n this.print(node.body, node);\n}\n\nfunction ObjectProperty(node) {\n this.printJoin(node.decorators, node);\n\n if (node.computed) {\n this.token(\"[\");\n this.print(node.key, node);\n this.token(\"]\");\n } else {\n if (t.isAssignmentPattern(node.value) && t.isIdentifier(node.key) && node.key.name === node.value.left.name) {\n this.print(node.value, node);\n return;\n }\n\n this.print(node.key, node);\n\n if (node.shorthand && t.isIdentifier(node.key) && t.isIdentifier(node.value) && node.key.name === node.value.name) {\n return;\n }\n }\n\n this.token(\":\");\n this.space();\n this.print(node.value, node);\n}\n\nfunction ArrayExpression(node) {\n const elems = node.elements;\n const len = elems.length;\n this.token(\"[\");\n this.printInnerComments(node);\n\n for (let i = 0; i < elems.length; i++) {\n const elem = elems[i];\n\n if (elem) {\n if (i > 0) this.space();\n this.print(elem, node);\n if (i < len - 1) this.token(\",\");\n } else {\n this.token(\",\");\n }\n }\n\n this.token(\"]\");\n}\n\nfunction RecordExpression(node) {\n const props = node.properties;\n let startToken;\n let endToken;\n\n if (this.format.recordAndTupleSyntaxType === \"bar\") {\n startToken = \"{|\";\n endToken = \"|}\";\n } else if (this.format.recordAndTupleSyntaxType === \"hash\") {\n startToken = \"#{\";\n endToken = \"}\";\n } else {\n throw new Error(`The \"recordAndTupleSyntaxType\" generator option must be \"bar\" or \"hash\" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`);\n }\n\n this.token(startToken);\n this.printInnerComments(node);\n\n if (props.length) {\n this.space();\n this.printList(props, node, {\n indent: true,\n statement: true\n });\n this.space();\n }\n\n this.token(endToken);\n}\n\nfunction TupleExpression(node) {\n const elems = node.elements;\n const len = elems.length;\n let startToken;\n let endToken;\n\n if (this.format.recordAndTupleSyntaxType === \"bar\") {\n startToken = \"[|\";\n endToken = \"|]\";\n } else if (this.format.recordAndTupleSyntaxType === \"hash\") {\n startToken = \"#[\";\n endToken = \"]\";\n } else {\n throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`);\n }\n\n this.token(startToken);\n this.printInnerComments(node);\n\n for (let i = 0; i < elems.length; i++) {\n const elem = elems[i];\n\n if (elem) {\n if (i > 0) this.space();\n this.print(elem, node);\n if (i < len - 1) this.token(\",\");\n }\n }\n\n this.token(endToken);\n}\n\nfunction RegExpLiteral(node) {\n this.word(`/${node.pattern}/${node.flags}`);\n}\n\nfunction BooleanLiteral(node) {\n this.word(node.value ? \"true\" : \"false\");\n}\n\nfunction NullLiteral() {\n this.word(\"null\");\n}\n\nfunction NumericLiteral(node) {\n const raw = this.getPossibleRaw(node);\n const opts = this.format.jsescOption;\n const value = node.value + \"\";\n\n if (opts.numbers) {\n this.number((0, _jsesc.default)(node.value, opts));\n } else if (raw == null) {\n this.number(value);\n } else if (this.format.minified) {\n this.number(raw.length < value.length ? raw : value);\n } else {\n this.number(raw);\n }\n}\n\nfunction StringLiteral(node) {\n const raw = this.getPossibleRaw(node);\n\n if (!this.format.minified && raw != null) {\n this.token(raw);\n return;\n }\n\n const opts = this.format.jsescOption;\n\n if (this.format.jsonCompatibleStrings) {\n opts.json = true;\n }\n\n const val = (0, _jsesc.default)(node.value, opts);\n return this.token(val);\n}\n\nfunction BigIntLiteral(node) {\n const raw = this.getPossibleRaw(node);\n\n if (!this.format.minified && raw != null) {\n this.token(raw);\n return;\n }\n\n this.token(node.value + \"n\");\n}\n\nfunction DecimalLiteral(node) {\n const raw = this.getPossibleRaw(node);\n\n if (!this.format.minified && raw != null) {\n this.token(raw);\n return;\n }\n\n this.token(node.value + \"m\");\n}\n\nfunction PipelineTopicExpression(node) {\n this.print(node.expression, node);\n}\n\nfunction PipelineBareFunction(node) {\n this.print(node.callee, node);\n}\n\nfunction PipelinePrimaryTopicReference() {\n this.token(\"#\");\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.TSTypeAnnotation = TSTypeAnnotation;\nexports.TSTypeParameterDeclaration = exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation;\nexports.TSTypeParameter = TSTypeParameter;\nexports.TSParameterProperty = TSParameterProperty;\nexports.TSDeclareFunction = TSDeclareFunction;\nexports.TSDeclareMethod = TSDeclareMethod;\nexports.TSQualifiedName = TSQualifiedName;\nexports.TSCallSignatureDeclaration = TSCallSignatureDeclaration;\nexports.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration;\nexports.TSPropertySignature = TSPropertySignature;\nexports.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName;\nexports.TSMethodSignature = TSMethodSignature;\nexports.TSIndexSignature = TSIndexSignature;\nexports.TSAnyKeyword = TSAnyKeyword;\nexports.TSBigIntKeyword = TSBigIntKeyword;\nexports.TSUnknownKeyword = TSUnknownKeyword;\nexports.TSNumberKeyword = TSNumberKeyword;\nexports.TSObjectKeyword = TSObjectKeyword;\nexports.TSBooleanKeyword = TSBooleanKeyword;\nexports.TSStringKeyword = TSStringKeyword;\nexports.TSSymbolKeyword = TSSymbolKeyword;\nexports.TSVoidKeyword = TSVoidKeyword;\nexports.TSUndefinedKeyword = TSUndefinedKeyword;\nexports.TSNullKeyword = TSNullKeyword;\nexports.TSNeverKeyword = TSNeverKeyword;\nexports.TSIntrinsicKeyword = TSIntrinsicKeyword;\nexports.TSThisType = TSThisType;\nexports.TSFunctionType = TSFunctionType;\nexports.TSConstructorType = TSConstructorType;\nexports.tsPrintFunctionOrConstructorType = tsPrintFunctionOrConstructorType;\nexports.TSTypeReference = TSTypeReference;\nexports.TSTypePredicate = TSTypePredicate;\nexports.TSTypeQuery = TSTypeQuery;\nexports.TSTypeLiteral = TSTypeLiteral;\nexports.tsPrintTypeLiteralOrInterfaceBody = tsPrintTypeLiteralOrInterfaceBody;\nexports.tsPrintBraced = tsPrintBraced;\nexports.TSArrayType = TSArrayType;\nexports.TSTupleType = TSTupleType;\nexports.TSOptionalType = TSOptionalType;\nexports.TSRestType = TSRestType;\nexports.TSNamedTupleMember = TSNamedTupleMember;\nexports.TSUnionType = TSUnionType;\nexports.TSIntersectionType = TSIntersectionType;\nexports.tsPrintUnionOrIntersectionType = tsPrintUnionOrIntersectionType;\nexports.TSConditionalType = TSConditionalType;\nexports.TSInferType = TSInferType;\nexports.TSParenthesizedType = TSParenthesizedType;\nexports.TSTypeOperator = TSTypeOperator;\nexports.TSIndexedAccessType = TSIndexedAccessType;\nexports.TSMappedType = TSMappedType;\nexports.TSLiteralType = TSLiteralType;\nexports.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments;\nexports.TSInterfaceDeclaration = TSInterfaceDeclaration;\nexports.TSInterfaceBody = TSInterfaceBody;\nexports.TSTypeAliasDeclaration = TSTypeAliasDeclaration;\nexports.TSAsExpression = TSAsExpression;\nexports.TSTypeAssertion = TSTypeAssertion;\nexports.TSEnumDeclaration = TSEnumDeclaration;\nexports.TSEnumMember = TSEnumMember;\nexports.TSModuleDeclaration = TSModuleDeclaration;\nexports.TSModuleBlock = TSModuleBlock;\nexports.TSImportType = TSImportType;\nexports.TSImportEqualsDeclaration = TSImportEqualsDeclaration;\nexports.TSExternalModuleReference = TSExternalModuleReference;\nexports.TSNonNullExpression = TSNonNullExpression;\nexports.TSExportAssignment = TSExportAssignment;\nexports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration;\nexports.tsPrintSignatureDeclarationBase = tsPrintSignatureDeclarationBase;\nexports.tsPrintClassMemberModifiers = tsPrintClassMemberModifiers;\n\nfunction TSTypeAnnotation(node) {\n this.token(\":\");\n this.space();\n if (node.optional) this.token(\"?\");\n this.print(node.typeAnnotation, node);\n}\n\nfunction TSTypeParameterInstantiation(node) {\n this.token(\"<\");\n this.printList(node.params, node, {});\n this.token(\">\");\n}\n\nfunction TSTypeParameter(node) {\n this.word(node.name);\n\n if (node.constraint) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.constraint, node);\n }\n\n if (node.default) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.default, node);\n }\n}\n\nfunction TSParameterProperty(node) {\n if (node.accessibility) {\n this.word(node.accessibility);\n this.space();\n }\n\n if (node.readonly) {\n this.word(\"readonly\");\n this.space();\n }\n\n this._param(node.parameter);\n}\n\nfunction TSDeclareFunction(node) {\n if (node.declare) {\n this.word(\"declare\");\n this.space();\n }\n\n this._functionHead(node);\n\n this.token(\";\");\n}\n\nfunction TSDeclareMethod(node) {\n this._classMethodHead(node);\n\n this.token(\";\");\n}\n\nfunction TSQualifiedName(node) {\n this.print(node.left, node);\n this.token(\".\");\n this.print(node.right, node);\n}\n\nfunction TSCallSignatureDeclaration(node) {\n this.tsPrintSignatureDeclarationBase(node);\n this.token(\";\");\n}\n\nfunction TSConstructSignatureDeclaration(node) {\n this.word(\"new\");\n this.space();\n this.tsPrintSignatureDeclarationBase(node);\n this.token(\";\");\n}\n\nfunction TSPropertySignature(node) {\n const {\n readonly,\n initializer\n } = node;\n\n if (readonly) {\n this.word(\"readonly\");\n this.space();\n }\n\n this.tsPrintPropertyOrMethodName(node);\n this.print(node.typeAnnotation, node);\n\n if (initializer) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(initializer, node);\n }\n\n this.token(\";\");\n}\n\nfunction tsPrintPropertyOrMethodName(node) {\n if (node.computed) {\n this.token(\"[\");\n }\n\n this.print(node.key, node);\n\n if (node.computed) {\n this.token(\"]\");\n }\n\n if (node.optional) {\n this.token(\"?\");\n }\n}\n\nfunction TSMethodSignature(node) {\n this.tsPrintPropertyOrMethodName(node);\n this.tsPrintSignatureDeclarationBase(node);\n this.token(\";\");\n}\n\nfunction TSIndexSignature(node) {\n const {\n readonly\n } = node;\n\n if (readonly) {\n this.word(\"readonly\");\n this.space();\n }\n\n this.token(\"[\");\n\n this._parameters(node.parameters, node);\n\n this.token(\"]\");\n this.print(node.typeAnnotation, node);\n this.token(\";\");\n}\n\nfunction TSAnyKeyword() {\n this.word(\"any\");\n}\n\nfunction TSBigIntKeyword() {\n this.word(\"bigint\");\n}\n\nfunction TSUnknownKeyword() {\n this.word(\"unknown\");\n}\n\nfunction TSNumberKeyword() {\n this.word(\"number\");\n}\n\nfunction TSObjectKeyword() {\n this.word(\"object\");\n}\n\nfunction TSBooleanKeyword() {\n this.word(\"boolean\");\n}\n\nfunction TSStringKeyword() {\n this.word(\"string\");\n}\n\nfunction TSSymbolKeyword() {\n this.word(\"symbol\");\n}\n\nfunction TSVoidKeyword() {\n this.word(\"void\");\n}\n\nfunction TSUndefinedKeyword() {\n this.word(\"undefined\");\n}\n\nfunction TSNullKeyword() {\n this.word(\"null\");\n}\n\nfunction TSNeverKeyword() {\n this.word(\"never\");\n}\n\nfunction TSIntrinsicKeyword() {\n this.word(\"intrinsic\");\n}\n\nfunction TSThisType() {\n this.word(\"this\");\n}\n\nfunction TSFunctionType(node) {\n this.tsPrintFunctionOrConstructorType(node);\n}\n\nfunction TSConstructorType(node) {\n this.word(\"new\");\n this.space();\n this.tsPrintFunctionOrConstructorType(node);\n}\n\nfunction tsPrintFunctionOrConstructorType(node) {\n const {\n typeParameters,\n parameters\n } = node;\n this.print(typeParameters, node);\n this.token(\"(\");\n\n this._parameters(parameters, node);\n\n this.token(\")\");\n this.space();\n this.token(\"=>\");\n this.space();\n this.print(node.typeAnnotation.typeAnnotation, node);\n}\n\nfunction TSTypeReference(node) {\n this.print(node.typeName, node);\n this.print(node.typeParameters, node);\n}\n\nfunction TSTypePredicate(node) {\n if (node.asserts) {\n this.word(\"asserts\");\n this.space();\n }\n\n this.print(node.parameterName);\n\n if (node.typeAnnotation) {\n this.space();\n this.word(\"is\");\n this.space();\n this.print(node.typeAnnotation.typeAnnotation);\n }\n}\n\nfunction TSTypeQuery(node) {\n this.word(\"typeof\");\n this.space();\n this.print(node.exprName);\n}\n\nfunction TSTypeLiteral(node) {\n this.tsPrintTypeLiteralOrInterfaceBody(node.members, node);\n}\n\nfunction tsPrintTypeLiteralOrInterfaceBody(members, node) {\n this.tsPrintBraced(members, node);\n}\n\nfunction tsPrintBraced(members, node) {\n this.token(\"{\");\n\n if (members.length) {\n this.indent();\n this.newline();\n\n for (const member of members) {\n this.print(member, node);\n this.newline();\n }\n\n this.dedent();\n this.rightBrace();\n } else {\n this.token(\"}\");\n }\n}\n\nfunction TSArrayType(node) {\n this.print(node.elementType, node);\n this.token(\"[]\");\n}\n\nfunction TSTupleType(node) {\n this.token(\"[\");\n this.printList(node.elementTypes, node);\n this.token(\"]\");\n}\n\nfunction TSOptionalType(node) {\n this.print(node.typeAnnotation, node);\n this.token(\"?\");\n}\n\nfunction TSRestType(node) {\n this.token(\"...\");\n this.print(node.typeAnnotation, node);\n}\n\nfunction TSNamedTupleMember(node) {\n this.print(node.label, node);\n if (node.optional) this.token(\"?\");\n this.token(\":\");\n this.space();\n this.print(node.elementType, node);\n}\n\nfunction TSUnionType(node) {\n this.tsPrintUnionOrIntersectionType(node, \"|\");\n}\n\nfunction TSIntersectionType(node) {\n this.tsPrintUnionOrIntersectionType(node, \"&\");\n}\n\nfunction tsPrintUnionOrIntersectionType(node, sep) {\n this.printJoin(node.types, node, {\n separator() {\n this.space();\n this.token(sep);\n this.space();\n }\n\n });\n}\n\nfunction TSConditionalType(node) {\n this.print(node.checkType);\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.extendsType);\n this.space();\n this.token(\"?\");\n this.space();\n this.print(node.trueType);\n this.space();\n this.token(\":\");\n this.space();\n this.print(node.falseType);\n}\n\nfunction TSInferType(node) {\n this.token(\"infer\");\n this.space();\n this.print(node.typeParameter);\n}\n\nfunction TSParenthesizedType(node) {\n this.token(\"(\");\n this.print(node.typeAnnotation, node);\n this.token(\")\");\n}\n\nfunction TSTypeOperator(node) {\n this.word(node.operator);\n this.space();\n this.print(node.typeAnnotation, node);\n}\n\nfunction TSIndexedAccessType(node) {\n this.print(node.objectType, node);\n this.token(\"[\");\n this.print(node.indexType, node);\n this.token(\"]\");\n}\n\nfunction TSMappedType(node) {\n const {\n nameType,\n optional,\n readonly,\n typeParameter\n } = node;\n this.token(\"{\");\n this.space();\n\n if (readonly) {\n tokenIfPlusMinus(this, readonly);\n this.word(\"readonly\");\n this.space();\n }\n\n this.token(\"[\");\n this.word(typeParameter.name);\n this.space();\n this.word(\"in\");\n this.space();\n this.print(typeParameter.constraint, typeParameter);\n\n if (nameType) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(nameType, node);\n }\n\n this.token(\"]\");\n\n if (optional) {\n tokenIfPlusMinus(this, optional);\n this.token(\"?\");\n }\n\n this.token(\":\");\n this.space();\n this.print(node.typeAnnotation, node);\n this.space();\n this.token(\"}\");\n}\n\nfunction tokenIfPlusMinus(self, tok) {\n if (tok !== true) {\n self.token(tok);\n }\n}\n\nfunction TSLiteralType(node) {\n this.print(node.literal, node);\n}\n\nfunction TSExpressionWithTypeArguments(node) {\n this.print(node.expression, node);\n this.print(node.typeParameters, node);\n}\n\nfunction TSInterfaceDeclaration(node) {\n const {\n declare,\n id,\n typeParameters,\n extends: extendz,\n body\n } = node;\n\n if (declare) {\n this.word(\"declare\");\n this.space();\n }\n\n this.word(\"interface\");\n this.space();\n this.print(id, node);\n this.print(typeParameters, node);\n\n if (extendz) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.printList(extendz, node);\n }\n\n this.space();\n this.print(body, node);\n}\n\nfunction TSInterfaceBody(node) {\n this.tsPrintTypeLiteralOrInterfaceBody(node.body, node);\n}\n\nfunction TSTypeAliasDeclaration(node) {\n const {\n declare,\n id,\n typeParameters,\n typeAnnotation\n } = node;\n\n if (declare) {\n this.word(\"declare\");\n this.space();\n }\n\n this.word(\"type\");\n this.space();\n this.print(id, node);\n this.print(typeParameters, node);\n this.space();\n this.token(\"=\");\n this.space();\n this.print(typeAnnotation, node);\n this.token(\";\");\n}\n\nfunction TSAsExpression(node) {\n const {\n expression,\n typeAnnotation\n } = node;\n this.print(expression, node);\n this.space();\n this.word(\"as\");\n this.space();\n this.print(typeAnnotation, node);\n}\n\nfunction TSTypeAssertion(node) {\n const {\n typeAnnotation,\n expression\n } = node;\n this.token(\"<\");\n this.print(typeAnnotation, node);\n this.token(\">\");\n this.space();\n this.print(expression, node);\n}\n\nfunction TSEnumDeclaration(node) {\n const {\n declare,\n const: isConst,\n id,\n members\n } = node;\n\n if (declare) {\n this.word(\"declare\");\n this.space();\n }\n\n if (isConst) {\n this.word(\"const\");\n this.space();\n }\n\n this.word(\"enum\");\n this.space();\n this.print(id, node);\n this.space();\n this.tsPrintBraced(members, node);\n}\n\nfunction TSEnumMember(node) {\n const {\n id,\n initializer\n } = node;\n this.print(id, node);\n\n if (initializer) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(initializer, node);\n }\n\n this.token(\",\");\n}\n\nfunction TSModuleDeclaration(node) {\n const {\n declare,\n id\n } = node;\n\n if (declare) {\n this.word(\"declare\");\n this.space();\n }\n\n if (!node.global) {\n this.word(id.type === \"Identifier\" ? \"namespace\" : \"module\");\n this.space();\n }\n\n this.print(id, node);\n\n if (!node.body) {\n this.token(\";\");\n return;\n }\n\n let body = node.body;\n\n while (body.type === \"TSModuleDeclaration\") {\n this.token(\".\");\n this.print(body.id, body);\n body = body.body;\n }\n\n this.space();\n this.print(body, node);\n}\n\nfunction TSModuleBlock(node) {\n this.tsPrintBraced(node.body, node);\n}\n\nfunction TSImportType(node) {\n const {\n argument,\n qualifier,\n typeParameters\n } = node;\n this.word(\"import\");\n this.token(\"(\");\n this.print(argument, node);\n this.token(\")\");\n\n if (qualifier) {\n this.token(\".\");\n this.print(qualifier, node);\n }\n\n if (typeParameters) {\n this.print(typeParameters, node);\n }\n}\n\nfunction TSImportEqualsDeclaration(node) {\n const {\n isExport,\n id,\n moduleReference\n } = node;\n\n if (isExport) {\n this.word(\"export\");\n this.space();\n }\n\n this.word(\"import\");\n this.space();\n this.print(id, node);\n this.space();\n this.token(\"=\");\n this.space();\n this.print(moduleReference, node);\n this.token(\";\");\n}\n\nfunction TSExternalModuleReference(node) {\n this.token(\"require(\");\n this.print(node.expression, node);\n this.token(\")\");\n}\n\nfunction TSNonNullExpression(node) {\n this.print(node.expression, node);\n this.token(\"!\");\n}\n\nfunction TSExportAssignment(node) {\n this.word(\"export\");\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.expression, node);\n this.token(\";\");\n}\n\nfunction TSNamespaceExportDeclaration(node) {\n this.word(\"export\");\n this.space();\n this.word(\"as\");\n this.space();\n this.word(\"namespace\");\n this.space();\n this.print(node.id, node);\n}\n\nfunction tsPrintSignatureDeclarationBase(node) {\n const {\n typeParameters,\n parameters\n } = node;\n this.print(typeParameters, node);\n this.token(\"(\");\n\n this._parameters(parameters, node);\n\n this.token(\")\");\n this.print(node.typeAnnotation, node);\n}\n\nfunction tsPrintClassMemberModifiers(node, isField) {\n if (isField && node.declare) {\n this.word(\"declare\");\n this.space();\n }\n\n if (node.accessibility) {\n this.word(node.accessibility);\n this.space();\n }\n\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n\n if (node.abstract) {\n this.word(\"abstract\");\n this.space();\n }\n\n if (isField && node.readonly) {\n this.word(\"readonly\");\n this.space();\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.CodeGenerator = void 0;\n\nvar _sourceMap = _interopRequireDefault(require(\"./source-map\"));\n\nvar _printer = _interopRequireDefault(require(\"./printer\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nclass Generator extends _printer.default {\n constructor(ast, opts = {}, code) {\n const format = normalizeOptions(code, opts);\n const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;\n super(format, map);\n this.ast = void 0;\n this.ast = ast;\n }\n\n generate() {\n return super.generate(this.ast);\n }\n\n}\n\nfunction normalizeOptions(code, opts) {\n const format = {\n auxiliaryCommentBefore: opts.auxiliaryCommentBefore,\n auxiliaryCommentAfter: opts.auxiliaryCommentAfter,\n shouldPrintComment: opts.shouldPrintComment,\n retainLines: opts.retainLines,\n retainFunctionParens: opts.retainFunctionParens,\n comments: opts.comments == null || opts.comments,\n compact: opts.compact,\n minified: opts.minified,\n concise: opts.concise,\n jsonCompatibleStrings: opts.jsonCompatibleStrings,\n indent: {\n adjustMultilineComment: true,\n style: \" \",\n base: 0\n },\n decoratorsBeforeExport: !!opts.decoratorsBeforeExport,\n jsescOption: Object.assign({\n quotes: \"double\",\n wrap: true\n }, opts.jsescOption),\n recordAndTupleSyntaxType: opts.recordAndTupleSyntaxType\n };\n\n if (format.minified) {\n format.compact = true;\n\n format.shouldPrintComment = format.shouldPrintComment || (() => format.comments);\n } else {\n format.shouldPrintComment = format.shouldPrintComment || (value => format.comments || value.indexOf(\"@license\") >= 0 || value.indexOf(\"@preserve\") >= 0);\n }\n\n if (format.compact === \"auto\") {\n format.compact = code.length > 500000;\n\n if (format.compact) {\n console.error(\"[BABEL] Note: The code generator has deoptimised the styling of \" + `${opts.filename} as it exceeds the max of ${\"500KB\"}.`);\n }\n }\n\n if (format.compact) {\n format.indent.adjustMultilineComment = false;\n }\n\n return format;\n}\n\nclass CodeGenerator {\n constructor(ast, opts, code) {\n this._generator = new Generator(ast, opts, code);\n }\n\n generate() {\n return this._generator.generate();\n }\n\n}\n\nexports.CodeGenerator = CodeGenerator;\n\nfunction _default(ast, opts, code) {\n const gen = new Generator(ast, opts, code);\n return gen.generate();\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.needsWhitespace = needsWhitespace;\nexports.needsWhitespaceBefore = needsWhitespaceBefore;\nexports.needsWhitespaceAfter = needsWhitespaceAfter;\nexports.needsParens = needsParens;\n\nvar whitespace = _interopRequireWildcard(require(\"./whitespace\"));\n\nvar parens = _interopRequireWildcard(require(\"./parentheses\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction expandAliases(obj) {\n const newObj = {};\n\n function add(type, func) {\n const fn = newObj[type];\n newObj[type] = fn ? function (node, parent, stack) {\n const result = fn(node, parent, stack);\n return result == null ? func(node, parent, stack) : result;\n } : func;\n }\n\n for (const type of Object.keys(obj)) {\n const aliases = t.FLIPPED_ALIAS_KEYS[type];\n\n if (aliases) {\n for (const alias of aliases) {\n add(alias, obj[type]);\n }\n } else {\n add(type, obj[type]);\n }\n }\n\n return newObj;\n}\n\nconst expandedParens = expandAliases(parens);\nconst expandedWhitespaceNodes = expandAliases(whitespace.nodes);\nconst expandedWhitespaceList = expandAliases(whitespace.list);\n\nfunction find(obj, node, parent, printStack) {\n const fn = obj[node.type];\n return fn ? fn(node, parent, printStack) : null;\n}\n\nfunction isOrHasCallExpression(node) {\n if (t.isCallExpression(node)) {\n return true;\n }\n\n return t.isMemberExpression(node) && isOrHasCallExpression(node.object);\n}\n\nfunction needsWhitespace(node, parent, type) {\n if (!node) return 0;\n\n if (t.isExpressionStatement(node)) {\n node = node.expression;\n }\n\n let linesInfo = find(expandedWhitespaceNodes, node, parent);\n\n if (!linesInfo) {\n const items = find(expandedWhitespaceList, node, parent);\n\n if (items) {\n for (let i = 0; i < items.length; i++) {\n linesInfo = needsWhitespace(items[i], node, type);\n if (linesInfo) break;\n }\n }\n }\n\n if (typeof linesInfo === \"object\" && linesInfo !== null) {\n return linesInfo[type] || 0;\n }\n\n return 0;\n}\n\nfunction needsWhitespaceBefore(node, parent) {\n return needsWhitespace(node, parent, \"before\");\n}\n\nfunction needsWhitespaceAfter(node, parent) {\n return needsWhitespace(node, parent, \"after\");\n}\n\nfunction needsParens(node, parent, printStack) {\n if (!parent) return false;\n\n if (t.isNewExpression(parent) && parent.callee === node) {\n if (isOrHasCallExpression(node)) return true;\n }\n\n return find(expandedParens, node, parent, printStack);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.NullableTypeAnnotation = NullableTypeAnnotation;\nexports.FunctionTypeAnnotation = FunctionTypeAnnotation;\nexports.UpdateExpression = UpdateExpression;\nexports.ObjectExpression = ObjectExpression;\nexports.DoExpression = DoExpression;\nexports.Binary = Binary;\nexports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation;\nexports.TSAsExpression = TSAsExpression;\nexports.TSTypeAssertion = TSTypeAssertion;\nexports.TSIntersectionType = exports.TSUnionType = TSUnionType;\nexports.TSInferType = TSInferType;\nexports.BinaryExpression = BinaryExpression;\nexports.SequenceExpression = SequenceExpression;\nexports.AwaitExpression = exports.YieldExpression = YieldExpression;\nexports.ClassExpression = ClassExpression;\nexports.UnaryLike = UnaryLike;\nexports.FunctionExpression = FunctionExpression;\nexports.ArrowFunctionExpression = ArrowFunctionExpression;\nexports.ConditionalExpression = ConditionalExpression;\nexports.OptionalCallExpression = exports.OptionalMemberExpression = OptionalMemberExpression;\nexports.AssignmentExpression = AssignmentExpression;\nexports.LogicalExpression = LogicalExpression;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nconst PRECEDENCE = {\n \"||\": 0,\n \"??\": 0,\n \"&&\": 1,\n \"|\": 2,\n \"^\": 3,\n \"&\": 4,\n \"==\": 5,\n \"===\": 5,\n \"!=\": 5,\n \"!==\": 5,\n \"<\": 6,\n \">\": 6,\n \"<=\": 6,\n \">=\": 6,\n in: 6,\n instanceof: 6,\n \">>\": 7,\n \"<<\": 7,\n \">>>\": 7,\n \"+\": 8,\n \"-\": 8,\n \"*\": 9,\n \"/\": 9,\n \"%\": 9,\n \"**\": 10\n};\n\nconst isClassExtendsClause = (node, parent) => (t.isClassDeclaration(parent) || t.isClassExpression(parent)) && parent.superClass === node;\n\nconst hasPostfixPart = (node, parent) => (t.isMemberExpression(parent) || t.isOptionalMemberExpression(parent)) && parent.object === node || (t.isCallExpression(parent) || t.isOptionalCallExpression(parent) || t.isNewExpression(parent)) && parent.callee === node || t.isTaggedTemplateExpression(parent) && parent.tag === node || t.isTSNonNullExpression(parent);\n\nfunction NullableTypeAnnotation(node, parent) {\n return t.isArrayTypeAnnotation(parent);\n}\n\nfunction FunctionTypeAnnotation(node, parent, printStack) {\n return t.isUnionTypeAnnotation(parent) || t.isIntersectionTypeAnnotation(parent) || t.isArrayTypeAnnotation(parent) || t.isTypeAnnotation(parent) && t.isArrowFunctionExpression(printStack[printStack.length - 3]);\n}\n\nfunction UpdateExpression(node, parent) {\n return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent);\n}\n\nfunction ObjectExpression(node, parent, printStack) {\n return isFirstInStatement(printStack, {\n considerArrow: true\n });\n}\n\nfunction DoExpression(node, parent, printStack) {\n return isFirstInStatement(printStack);\n}\n\nfunction Binary(node, parent) {\n if (node.operator === \"**\" && t.isBinaryExpression(parent, {\n operator: \"**\"\n })) {\n return parent.left === node;\n }\n\n if (isClassExtendsClause(node, parent)) {\n return true;\n }\n\n if (hasPostfixPart(node, parent) || t.isUnaryLike(parent) || t.isAwaitExpression(parent)) {\n return true;\n }\n\n if (t.isBinary(parent)) {\n const parentOp = parent.operator;\n const parentPos = PRECEDENCE[parentOp];\n const nodeOp = node.operator;\n const nodePos = PRECEDENCE[nodeOp];\n\n if (parentPos === nodePos && parent.right === node && !t.isLogicalExpression(parent) || parentPos > nodePos) {\n return true;\n }\n }\n}\n\nfunction UnionTypeAnnotation(node, parent) {\n return t.isArrayTypeAnnotation(parent) || t.isNullableTypeAnnotation(parent) || t.isIntersectionTypeAnnotation(parent) || t.isUnionTypeAnnotation(parent);\n}\n\nfunction TSAsExpression() {\n return true;\n}\n\nfunction TSTypeAssertion() {\n return true;\n}\n\nfunction TSUnionType(node, parent) {\n return t.isTSArrayType(parent) || t.isTSOptionalType(parent) || t.isTSIntersectionType(parent) || t.isTSUnionType(parent) || t.isTSRestType(parent);\n}\n\nfunction TSInferType(node, parent) {\n return t.isTSArrayType(parent) || t.isTSOptionalType(parent);\n}\n\nfunction BinaryExpression(node, parent) {\n return node.operator === \"in\" && (t.isVariableDeclarator(parent) || t.isFor(parent));\n}\n\nfunction SequenceExpression(node, parent) {\n if (t.isForStatement(parent) || t.isThrowStatement(parent) || t.isReturnStatement(parent) || t.isIfStatement(parent) && parent.test === node || t.isWhileStatement(parent) && parent.test === node || t.isForInStatement(parent) && parent.right === node || t.isSwitchStatement(parent) && parent.discriminant === node || t.isExpressionStatement(parent) && parent.expression === node) {\n return false;\n }\n\n return true;\n}\n\nfunction YieldExpression(node, parent) {\n return t.isBinary(parent) || t.isUnaryLike(parent) || hasPostfixPart(node, parent) || t.isAwaitExpression(parent) && t.isYieldExpression(node) || t.isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent);\n}\n\nfunction ClassExpression(node, parent, printStack) {\n return isFirstInStatement(printStack, {\n considerDefaultExports: true\n });\n}\n\nfunction UnaryLike(node, parent) {\n return hasPostfixPart(node, parent) || t.isBinaryExpression(parent, {\n operator: \"**\",\n left: node\n }) || isClassExtendsClause(node, parent);\n}\n\nfunction FunctionExpression(node, parent, printStack) {\n return isFirstInStatement(printStack, {\n considerDefaultExports: true\n });\n}\n\nfunction ArrowFunctionExpression(node, parent) {\n return t.isExportDeclaration(parent) || ConditionalExpression(node, parent);\n}\n\nfunction ConditionalExpression(node, parent) {\n if (t.isUnaryLike(parent) || t.isBinary(parent) || t.isConditionalExpression(parent, {\n test: node\n }) || t.isAwaitExpression(parent) || t.isTSTypeAssertion(parent) || t.isTSAsExpression(parent)) {\n return true;\n }\n\n return UnaryLike(node, parent);\n}\n\nfunction OptionalMemberExpression(node, parent) {\n return t.isCallExpression(parent, {\n callee: node\n }) || t.isMemberExpression(parent, {\n object: node\n });\n}\n\nfunction AssignmentExpression(node, parent, printStack) {\n if (t.isObjectPattern(node.left)) {\n return true;\n } else {\n return ConditionalExpression(node, parent, printStack);\n }\n}\n\nfunction LogicalExpression(node, parent) {\n switch (node.operator) {\n case \"||\":\n if (!t.isLogicalExpression(parent)) return false;\n return parent.operator === \"??\" || parent.operator === \"&&\";\n\n case \"&&\":\n return t.isLogicalExpression(parent, {\n operator: \"??\"\n });\n\n case \"??\":\n return t.isLogicalExpression(parent) && parent.operator !== \"??\";\n }\n}\n\nfunction isFirstInStatement(printStack, {\n considerArrow = false,\n considerDefaultExports = false\n} = {}) {\n let i = printStack.length - 1;\n let node = printStack[i];\n i--;\n let parent = printStack[i];\n\n while (i >= 0) {\n if (t.isExpressionStatement(parent, {\n expression: node\n }) || considerDefaultExports && t.isExportDefaultDeclaration(parent, {\n declaration: node\n }) || considerArrow && t.isArrowFunctionExpression(parent, {\n body: node\n })) {\n return true;\n }\n\n if (hasPostfixPart(node, parent) && !t.isNewExpression(parent) || t.isSequenceExpression(parent) && parent.expressions[0] === node || t.isConditional(parent, {\n test: node\n }) || t.isBinary(parent, {\n left: node\n }) || t.isAssignmentExpression(parent, {\n left: node\n })) {\n node = parent;\n i--;\n parent = printStack[i];\n } else {\n return false;\n }\n }\n\n return false;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.list = exports.nodes = void 0;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction crawl(node, state = {}) {\n if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {\n crawl(node.object, state);\n if (node.computed) crawl(node.property, state);\n } else if (t.isBinary(node) || t.isAssignmentExpression(node)) {\n crawl(node.left, state);\n crawl(node.right, state);\n } else if (t.isCallExpression(node) || t.isOptionalCallExpression(node)) {\n state.hasCall = true;\n crawl(node.callee, state);\n } else if (t.isFunction(node)) {\n state.hasFunction = true;\n } else if (t.isIdentifier(node)) {\n state.hasHelper = state.hasHelper || isHelper(node.callee);\n }\n\n return state;\n}\n\nfunction isHelper(node) {\n if (t.isMemberExpression(node)) {\n return isHelper(node.object) || isHelper(node.property);\n } else if (t.isIdentifier(node)) {\n return node.name === \"require\" || node.name[0] === \"_\";\n } else if (t.isCallExpression(node)) {\n return isHelper(node.callee);\n } else if (t.isBinary(node) || t.isAssignmentExpression(node)) {\n return t.isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right);\n } else {\n return false;\n }\n}\n\nfunction isType(node) {\n return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n}\n\nconst nodes = {\n AssignmentExpression(node) {\n const state = crawl(node.right);\n\n if (state.hasCall && state.hasHelper || state.hasFunction) {\n return {\n before: state.hasFunction,\n after: true\n };\n }\n },\n\n SwitchCase(node, parent) {\n return {\n before: node.consequent.length || parent.cases[0] === node,\n after: !node.consequent.length && parent.cases[parent.cases.length - 1] === node\n };\n },\n\n LogicalExpression(node) {\n if (t.isFunction(node.left) || t.isFunction(node.right)) {\n return {\n after: true\n };\n }\n },\n\n Literal(node) {\n if (node.value === \"use strict\") {\n return {\n after: true\n };\n }\n },\n\n CallExpression(node) {\n if (t.isFunction(node.callee) || isHelper(node)) {\n return {\n before: true,\n after: true\n };\n }\n },\n\n OptionalCallExpression(node) {\n if (t.isFunction(node.callee)) {\n return {\n before: true,\n after: true\n };\n }\n },\n\n VariableDeclaration(node) {\n for (let i = 0; i < node.declarations.length; i++) {\n const declar = node.declarations[i];\n let enabled = isHelper(declar.id) && !isType(declar.init);\n\n if (!enabled) {\n const state = crawl(declar.init);\n enabled = isHelper(declar.init) && state.hasCall || state.hasFunction;\n }\n\n if (enabled) {\n return {\n before: true,\n after: true\n };\n }\n }\n },\n\n IfStatement(node) {\n if (t.isBlockStatement(node.consequent)) {\n return {\n before: true,\n after: true\n };\n }\n }\n\n};\nexports.nodes = nodes;\n\nnodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function (node, parent) {\n if (parent.properties[0] === node) {\n return {\n before: true\n };\n }\n};\n\nnodes.ObjectTypeCallProperty = function (node, parent) {\n var _parent$properties;\n\n if (parent.callProperties[0] === node && !((_parent$properties = parent.properties) == null ? void 0 : _parent$properties.length)) {\n return {\n before: true\n };\n }\n};\n\nnodes.ObjectTypeIndexer = function (node, parent) {\n var _parent$properties2, _parent$callPropertie;\n\n if (parent.indexers[0] === node && !((_parent$properties2 = parent.properties) == null ? void 0 : _parent$properties2.length) && !((_parent$callPropertie = parent.callProperties) == null ? void 0 : _parent$callPropertie.length)) {\n return {\n before: true\n };\n }\n};\n\nnodes.ObjectTypeInternalSlot = function (node, parent) {\n var _parent$properties3, _parent$callPropertie2, _parent$indexers;\n\n if (parent.internalSlots[0] === node && !((_parent$properties3 = parent.properties) == null ? void 0 : _parent$properties3.length) && !((_parent$callPropertie2 = parent.callProperties) == null ? void 0 : _parent$callPropertie2.length) && !((_parent$indexers = parent.indexers) == null ? void 0 : _parent$indexers.length)) {\n return {\n before: true\n };\n }\n};\n\nconst list = {\n VariableDeclaration(node) {\n return node.declarations.map(decl => decl.init);\n },\n\n ArrayExpression(node) {\n return node.elements;\n },\n\n ObjectExpression(node) {\n return node.properties;\n }\n\n};\nexports.list = list;\n[[\"Function\", true], [\"Class\", true], [\"Loop\", true], [\"LabeledStatement\", true], [\"SwitchStatement\", true], [\"TryStatement\", true]].forEach(function ([type, amounts]) {\n if (typeof amounts === \"boolean\") {\n amounts = {\n after: amounts,\n before: amounts\n };\n }\n\n [type].concat(t.FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {\n nodes[type] = function () {\n return amounts;\n };\n });\n});","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _buffer = _interopRequireDefault(require(\"./buffer\"));\n\nvar n = _interopRequireWildcard(require(\"./node\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar generatorFunctions = _interopRequireWildcard(require(\"./generators\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst SCIENTIFIC_NOTATION = /e/i;\nconst ZERO_DECIMAL_INTEGER = /\\.0+$/;\nconst NON_DECIMAL_LITERAL = /^0[box]/;\nconst PURE_ANNOTATION_RE = /^\\s*[@#]__PURE__\\s*$/;\n\nclass Printer {\n constructor(format, map) {\n this.inForStatementInitCounter = 0;\n this._printStack = [];\n this._indent = 0;\n this._insideAux = false;\n this._printedCommentStarts = {};\n this._parenPushNewlineState = null;\n this._noLineTerminator = false;\n this._printAuxAfterOnNextUserNode = false;\n this._printedComments = new WeakSet();\n this._endsWithInteger = false;\n this._endsWithWord = false;\n this.format = format || {};\n this._buf = new _buffer.default(map);\n }\n\n generate(ast) {\n this.print(ast);\n\n this._maybeAddAuxComment();\n\n return this._buf.get();\n }\n\n indent() {\n if (this.format.compact || this.format.concise) return;\n this._indent++;\n }\n\n dedent() {\n if (this.format.compact || this.format.concise) return;\n this._indent--;\n }\n\n semicolon(force = false) {\n this._maybeAddAuxComment();\n\n this._append(\";\", !force);\n }\n\n rightBrace() {\n if (this.format.minified) {\n this._buf.removeLastSemicolon();\n }\n\n this.token(\"}\");\n }\n\n space(force = false) {\n if (this.format.compact) return;\n\n if (this._buf.hasContent() && !this.endsWith(\" \") && !this.endsWith(\"\\n\") || force) {\n this._space();\n }\n }\n\n word(str) {\n if (this._endsWithWord || this.endsWith(\"/\") && str.indexOf(\"/\") === 0) {\n this._space();\n }\n\n this._maybeAddAuxComment();\n\n this._append(str);\n\n this._endsWithWord = true;\n }\n\n number(str) {\n this.word(str);\n this._endsWithInteger = Number.isInteger(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== \".\";\n }\n\n token(str) {\n if (str === \"--\" && this.endsWith(\"!\") || str[0] === \"+\" && this.endsWith(\"+\") || str[0] === \"-\" && this.endsWith(\"-\") || str[0] === \".\" && this._endsWithInteger) {\n this._space();\n }\n\n this._maybeAddAuxComment();\n\n this._append(str);\n }\n\n newline(i) {\n if (this.format.retainLines || this.format.compact) return;\n\n if (this.format.concise) {\n this.space();\n return;\n }\n\n if (this.endsWith(\"\\n\\n\")) return;\n if (typeof i !== \"number\") i = 1;\n i = Math.min(2, i);\n if (this.endsWith(\"{\\n\") || this.endsWith(\":\\n\")) i--;\n if (i <= 0) return;\n\n for (let j = 0; j < i; j++) {\n this._newline();\n }\n }\n\n endsWith(str) {\n return this._buf.endsWith(str);\n }\n\n removeTrailingNewline() {\n this._buf.removeTrailingNewline();\n }\n\n exactSource(loc, cb) {\n this._catchUp(\"start\", loc);\n\n this._buf.exactSource(loc, cb);\n }\n\n source(prop, loc) {\n this._catchUp(prop, loc);\n\n this._buf.source(prop, loc);\n }\n\n withSource(prop, loc, cb) {\n this._catchUp(prop, loc);\n\n this._buf.withSource(prop, loc, cb);\n }\n\n _space() {\n this._append(\" \", true);\n }\n\n _newline() {\n this._append(\"\\n\", true);\n }\n\n _append(str, queue = false) {\n this._maybeAddParen(str);\n\n this._maybeIndent(str);\n\n if (queue) this._buf.queue(str);else this._buf.append(str);\n this._endsWithWord = false;\n this._endsWithInteger = false;\n }\n\n _maybeIndent(str) {\n if (this._indent && this.endsWith(\"\\n\") && str[0] !== \"\\n\") {\n this._buf.queue(this._getIndent());\n }\n }\n\n _maybeAddParen(str) {\n const parenPushNewlineState = this._parenPushNewlineState;\n if (!parenPushNewlineState) return;\n let i;\n\n for (i = 0; i < str.length && str[i] === \" \"; i++) continue;\n\n if (i === str.length) {\n return;\n }\n\n const cha = str[i];\n\n if (cha !== \"\\n\") {\n if (cha !== \"/\" || i + 1 === str.length) {\n this._parenPushNewlineState = null;\n return;\n }\n\n const chaPost = str[i + 1];\n\n if (chaPost === \"*\") {\n if (PURE_ANNOTATION_RE.test(str.slice(i + 2, str.length - 2))) {\n return;\n }\n } else if (chaPost !== \"/\") {\n this._parenPushNewlineState = null;\n return;\n }\n }\n\n this.token(\"(\");\n this.indent();\n parenPushNewlineState.printed = true;\n }\n\n _catchUp(prop, loc) {\n if (!this.format.retainLines) return;\n const pos = loc ? loc[prop] : null;\n\n if ((pos == null ? void 0 : pos.line) != null) {\n const count = pos.line - this._buf.getCurrentLine();\n\n for (let i = 0; i < count; i++) {\n this._newline();\n }\n }\n }\n\n _getIndent() {\n return this.format.indent.style.repeat(this._indent);\n }\n\n startTerminatorless(isLabel = false) {\n if (isLabel) {\n this._noLineTerminator = true;\n return null;\n } else {\n return this._parenPushNewlineState = {\n printed: false\n };\n }\n }\n\n endTerminatorless(state) {\n this._noLineTerminator = false;\n\n if (state == null ? void 0 : state.printed) {\n this.dedent();\n this.newline();\n this.token(\")\");\n }\n }\n\n print(node, parent) {\n if (!node) return;\n const oldConcise = this.format.concise;\n\n if (node._compact) {\n this.format.concise = true;\n }\n\n const printMethod = this[node.type];\n\n if (!printMethod) {\n throw new ReferenceError(`unknown node of type ${JSON.stringify(node.type)} with constructor ${JSON.stringify(node == null ? void 0 : node.constructor.name)}`);\n }\n\n this._printStack.push(node);\n\n const oldInAux = this._insideAux;\n this._insideAux = !node.loc;\n\n this._maybeAddAuxComment(this._insideAux && !oldInAux);\n\n let needsParens = n.needsParens(node, parent, this._printStack);\n\n if (this.format.retainFunctionParens && node.type === \"FunctionExpression\" && node.extra && node.extra.parenthesized) {\n needsParens = true;\n }\n\n if (needsParens) this.token(\"(\");\n\n this._printLeadingComments(node);\n\n const loc = t.isProgram(node) || t.isFile(node) ? null : node.loc;\n this.withSource(\"start\", loc, () => {\n printMethod.call(this, node, parent);\n });\n\n this._printTrailingComments(node);\n\n if (needsParens) this.token(\")\");\n\n this._printStack.pop();\n\n this.format.concise = oldConcise;\n this._insideAux = oldInAux;\n }\n\n _maybeAddAuxComment(enteredPositionlessNode) {\n if (enteredPositionlessNode) this._printAuxBeforeComment();\n if (!this._insideAux) this._printAuxAfterComment();\n }\n\n _printAuxBeforeComment() {\n if (this._printAuxAfterOnNextUserNode) return;\n this._printAuxAfterOnNextUserNode = true;\n const comment = this.format.auxiliaryCommentBefore;\n\n if (comment) {\n this._printComment({\n type: \"CommentBlock\",\n value: comment\n });\n }\n }\n\n _printAuxAfterComment() {\n if (!this._printAuxAfterOnNextUserNode) return;\n this._printAuxAfterOnNextUserNode = false;\n const comment = this.format.auxiliaryCommentAfter;\n\n if (comment) {\n this._printComment({\n type: \"CommentBlock\",\n value: comment\n });\n }\n }\n\n getPossibleRaw(node) {\n const extra = node.extra;\n\n if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) {\n return extra.raw;\n }\n }\n\n printJoin(nodes, parent, opts = {}) {\n if (!(nodes == null ? void 0 : nodes.length)) return;\n if (opts.indent) this.indent();\n const newlineOpts = {\n addNewlines: opts.addNewlines\n };\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (!node) continue;\n if (opts.statement) this._printNewline(true, node, parent, newlineOpts);\n this.print(node, parent);\n\n if (opts.iterator) {\n opts.iterator(node, i);\n }\n\n if (opts.separator && i < nodes.length - 1) {\n opts.separator.call(this);\n }\n\n if (opts.statement) this._printNewline(false, node, parent, newlineOpts);\n }\n\n if (opts.indent) this.dedent();\n }\n\n printAndIndentOnComments(node, parent) {\n const indent = node.leadingComments && node.leadingComments.length > 0;\n if (indent) this.indent();\n this.print(node, parent);\n if (indent) this.dedent();\n }\n\n printBlock(parent) {\n const node = parent.body;\n\n if (!t.isEmptyStatement(node)) {\n this.space();\n }\n\n this.print(node, parent);\n }\n\n _printTrailingComments(node) {\n this._printComments(this._getComments(false, node));\n }\n\n _printLeadingComments(node) {\n this._printComments(this._getComments(true, node), true);\n }\n\n printInnerComments(node, indent = true) {\n var _node$innerComments;\n\n if (!((_node$innerComments = node.innerComments) == null ? void 0 : _node$innerComments.length)) return;\n if (indent) this.indent();\n\n this._printComments(node.innerComments);\n\n if (indent) this.dedent();\n }\n\n printSequence(nodes, parent, opts = {}) {\n opts.statement = true;\n return this.printJoin(nodes, parent, opts);\n }\n\n printList(items, parent, opts = {}) {\n if (opts.separator == null) {\n opts.separator = commaSeparator;\n }\n\n return this.printJoin(items, parent, opts);\n }\n\n _printNewline(leading, node, parent, opts) {\n if (this.format.retainLines || this.format.compact) return;\n\n if (this.format.concise) {\n this.space();\n return;\n }\n\n let lines = 0;\n\n if (this._buf.hasContent()) {\n if (!leading) lines++;\n if (opts.addNewlines) lines += opts.addNewlines(leading, node) || 0;\n const needs = leading ? n.needsWhitespaceBefore : n.needsWhitespaceAfter;\n if (needs(node, parent)) lines++;\n }\n\n this.newline(lines);\n }\n\n _getComments(leading, node) {\n return node && (leading ? node.leadingComments : node.trailingComments) || [];\n }\n\n _printComment(comment, skipNewLines) {\n if (!this.format.shouldPrintComment(comment.value)) return;\n if (comment.ignore) return;\n if (this._printedComments.has(comment)) return;\n\n this._printedComments.add(comment);\n\n if (comment.start != null) {\n if (this._printedCommentStarts[comment.start]) return;\n this._printedCommentStarts[comment.start] = true;\n }\n\n const isBlockComment = comment.type === \"CommentBlock\";\n const printNewLines = isBlockComment && !skipNewLines && !this._noLineTerminator;\n if (printNewLines && this._buf.hasContent()) this.newline(1);\n if (!this.endsWith(\"[\") && !this.endsWith(\"{\")) this.space();\n let val = !isBlockComment && !this._noLineTerminator ? `//${comment.value}\\n` : `/*${comment.value}*/`;\n\n if (isBlockComment && this.format.indent.adjustMultilineComment) {\n var _comment$loc;\n\n const offset = (_comment$loc = comment.loc) == null ? void 0 : _comment$loc.start.column;\n\n if (offset) {\n const newlineRegex = new RegExp(\"\\\\n\\\\s{1,\" + offset + \"}\", \"g\");\n val = val.replace(newlineRegex, \"\\n\");\n }\n\n const indentSize = Math.max(this._getIndent().length, this.format.retainLines ? 0 : this._buf.getCurrentColumn());\n val = val.replace(/\\n(?!$)/g, `\\n${\" \".repeat(indentSize)}`);\n }\n\n if (this.endsWith(\"/\")) this._space();\n this.withSource(\"start\", comment.loc, () => {\n this._append(val);\n });\n if (printNewLines) this.newline(1);\n }\n\n _printComments(comments, inlinePureAnnotation) {\n if (!(comments == null ? void 0 : comments.length)) return;\n\n if (inlinePureAnnotation && comments.length === 1 && PURE_ANNOTATION_RE.test(comments[0].value)) {\n this._printComment(comments[0], this._buf.hasContent() && !this.endsWith(\"\\n\"));\n } else {\n for (const comment of comments) {\n this._printComment(comment);\n }\n }\n }\n\n printAssertions(node) {\n var _node$assertions;\n\n if ((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) {\n this.space();\n this.word(\"assert\");\n this.space();\n this.token(\"{\");\n this.space();\n this.printList(node.assertions, node);\n this.space();\n this.token(\"}\");\n }\n }\n\n}\n\nexports.default = Printer;\nObject.assign(Printer.prototype, generatorFunctions);\n\nfunction commaSeparator() {\n this.token(\",\");\n this.space();\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _sourceMap = _interopRequireDefault(require(\"source-map\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nclass SourceMap {\n constructor(opts, code) {\n this._cachedMap = null;\n this._code = code;\n this._opts = opts;\n this._rawMappings = [];\n }\n\n get() {\n if (!this._cachedMap) {\n const map = this._cachedMap = new _sourceMap.default.SourceMapGenerator({\n sourceRoot: this._opts.sourceRoot\n });\n const code = this._code;\n\n if (typeof code === \"string\") {\n map.setSourceContent(this._opts.sourceFileName.replace(/\\\\/g, \"/\"), code);\n } else if (typeof code === \"object\") {\n Object.keys(code).forEach(sourceFileName => {\n map.setSourceContent(sourceFileName.replace(/\\\\/g, \"/\"), code[sourceFileName]);\n });\n }\n\n this._rawMappings.forEach(mapping => map.addMapping(mapping), map);\n }\n\n return this._cachedMap.toJSON();\n }\n\n getRawMappings() {\n return this._rawMappings.slice();\n }\n\n mark(generatedLine, generatedColumn, line, column, identifierName, filename, force) {\n if (this._lastGenLine !== generatedLine && line === null) return;\n\n if (!force && this._lastGenLine === generatedLine && this._lastSourceLine === line && this._lastSourceColumn === column) {\n return;\n }\n\n this._cachedMap = null;\n this._lastGenLine = generatedLine;\n this._lastSourceLine = line;\n this._lastSourceColumn = column;\n\n this._rawMappings.push({\n name: identifierName || undefined,\n generated: {\n line: generatedLine,\n column: generatedColumn\n },\n source: line == null ? undefined : (filename || this._opts.sourceFileName).replace(/\\\\/g, \"/\"),\n original: line == null ? undefined : {\n line: line,\n column: column\n }\n });\n }\n\n}\n\nexports.default = SourceMap;","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap)\n : new BasicSourceMapConsumer(sourceMap);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n if (source != null && sourceRoot != null) {\n source = util.join(sourceRoot, source);\n }\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: Optional. the column number in the original source.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n if (this.sourceRoot != null) {\n needle.source = util.relative(this.sourceRoot, needle.source);\n }\n if (!this._sources.has(needle.source)) {\n return [];\n }\n needle.source = this._sources.indexOf(needle.source);\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The only parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._sources.toArray().map(function (s) {\n return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;\n }, this);\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n if (this.sourceRoot != null) {\n source = util.join(this.sourceRoot, source);\n }\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n if (this.sourceRoot != null) {\n aSource = util.relative(this.sourceRoot, aSource);\n }\n\n if (this._sources.has(aSource)) {\n return this.sourcesContent[this._sources.indexOf(aSource)];\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = aSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + aSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + aSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n if (this.sourceRoot != null) {\n source = util.relative(this.sourceRoot, source);\n }\n if (!this._sources.has(source)) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n source = this._sources.indexOf(source);\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The only parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'))\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n if (section.consumer.sourceRoot !== null) {\n source = util.join(section.consumer.sourceRoot, source);\n }\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex];\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex];\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.]*)(?::(\\d+))?(\\S*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\n\nvar _helperGetFunctionArity = _interopRequireDefault(require(\"@babel/helper-get-function-arity\"));\n\nvar _template = _interopRequireDefault(require(\"@babel/template\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst buildPropertyMethodAssignmentWrapper = (0, _template.default)(`\n (function (FUNCTION_KEY) {\n function FUNCTION_ID() {\n return FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n }\n\n return FUNCTION_ID;\n })(FUNCTION)\n`);\nconst buildGeneratorPropertyMethodAssignmentWrapper = (0, _template.default)(`\n (function (FUNCTION_KEY) {\n function* FUNCTION_ID() {\n return yield* FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n };\n\n return FUNCTION_ID;\n })(FUNCTION)\n`);\nconst visitor = {\n \"ReferencedIdentifier|BindingIdentifier\"(path, state) {\n if (path.node.name !== state.name) return;\n const localDeclar = path.scope.getBindingIdentifier(state.name);\n if (localDeclar !== state.outerDeclar) return;\n state.selfReference = true;\n path.stop();\n }\n\n};\n\nfunction getNameFromLiteralId(id) {\n if (t.isNullLiteral(id)) {\n return \"null\";\n }\n\n if (t.isRegExpLiteral(id)) {\n return `_${id.pattern}_${id.flags}`;\n }\n\n if (t.isTemplateLiteral(id)) {\n return id.quasis.map(quasi => quasi.value.raw).join(\"\");\n }\n\n if (id.value !== undefined) {\n return id.value + \"\";\n }\n\n return \"\";\n}\n\nfunction wrap(state, method, id, scope) {\n if (state.selfReference) {\n if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) {\n scope.rename(id.name);\n } else {\n if (!t.isFunction(method)) return;\n let build = buildPropertyMethodAssignmentWrapper;\n\n if (method.generator) {\n build = buildGeneratorPropertyMethodAssignmentWrapper;\n }\n\n const template = build({\n FUNCTION: method,\n FUNCTION_ID: id,\n FUNCTION_KEY: scope.generateUidIdentifier(id.name)\n }).expression;\n const params = template.callee.body.body[0].params;\n\n for (let i = 0, len = (0, _helperGetFunctionArity.default)(method); i < len; i++) {\n params.push(scope.generateUidIdentifier(\"x\"));\n }\n\n return template;\n }\n }\n\n method.id = id;\n scope.getProgramParent().references[id.name] = true;\n}\n\nfunction visit(node, name, scope) {\n const state = {\n selfAssignment: false,\n selfReference: false,\n outerDeclar: scope.getBindingIdentifier(name),\n references: [],\n name: name\n };\n const binding = scope.getOwnBinding(name);\n\n if (binding) {\n if (binding.kind === \"param\") {\n state.selfReference = true;\n } else {}\n } else if (state.outerDeclar || scope.hasGlobal(name)) {\n scope.traverse(node, visitor, state);\n }\n\n return state;\n}\n\nfunction _default({\n node,\n parent,\n scope,\n id\n}, localBinding = false) {\n if (node.id) return;\n\n if ((t.isObjectProperty(parent) || t.isObjectMethod(parent, {\n kind: \"method\"\n })) && (!parent.computed || t.isLiteral(parent.key))) {\n id = parent.key;\n } else if (t.isVariableDeclarator(parent)) {\n id = parent.id;\n\n if (t.isIdentifier(id) && !localBinding) {\n const binding = scope.parent.getBinding(id.name);\n\n if (binding && binding.constant && scope.getBinding(id.name) === binding) {\n node.id = t.cloneNode(id);\n node.id[t.NOT_LOCAL_BINDING] = true;\n return;\n }\n }\n } else if (t.isAssignmentExpression(parent, {\n operator: \"=\"\n })) {\n id = parent.left;\n } else if (!id) {\n return;\n }\n\n let name;\n\n if (id && t.isLiteral(id)) {\n name = getNameFromLiteralId(id);\n } else if (id && t.isIdentifier(id)) {\n name = id.name;\n }\n\n if (name === undefined) {\n return;\n }\n\n name = t.toBindingIdentifierName(name);\n id = t.identifier(name);\n id[t.NOT_LOCAL_BINDING] = true;\n const state = visit(node, name, scope);\n return wrap(state, node, id, scope) || node;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _default(node) {\n const params = node.params;\n\n for (let i = 0; i < params.length; i++) {\n const param = params[i];\n\n if (t.isAssignmentPattern(param) || t.isRestElement(param)) {\n return i;\n }\n }\n\n return params.length;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = memberExpressionToFunctions;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nclass AssignmentMemoiser {\n constructor() {\n this._map = new WeakMap();\n }\n\n has(key) {\n return this._map.has(key);\n }\n\n get(key) {\n if (!this.has(key)) return;\n\n const record = this._map.get(key);\n\n const {\n value\n } = record;\n record.count--;\n\n if (record.count === 0) {\n return t.assignmentExpression(\"=\", value, key);\n }\n\n return value;\n }\n\n set(key, value, count) {\n return this._map.set(key, {\n count,\n value\n });\n }\n\n}\n\nfunction toNonOptional(path, base) {\n const {\n node\n } = path;\n\n if (path.isOptionalMemberExpression()) {\n return t.memberExpression(base, node.property, node.computed);\n }\n\n if (path.isOptionalCallExpression()) {\n const callee = path.get(\"callee\");\n\n if (path.node.optional && callee.isOptionalMemberExpression()) {\n const {\n object\n } = callee.node;\n const context = path.scope.maybeGenerateMemoised(object) || object;\n callee.get(\"object\").replaceWith(t.assignmentExpression(\"=\", context, object));\n return t.callExpression(t.memberExpression(base, t.identifier(\"call\")), [context, ...node.arguments]);\n }\n\n return t.callExpression(base, node.arguments);\n }\n\n return path.node;\n}\n\nfunction isInDetachedTree(path) {\n while (path) {\n if (path.isProgram()) break;\n const {\n parentPath,\n container,\n listKey\n } = path;\n const parentNode = parentPath.node;\n\n if (listKey) {\n if (container !== parentNode[listKey]) return true;\n } else {\n if (container !== parentNode) return true;\n }\n\n path = parentPath;\n }\n\n return false;\n}\n\nconst handle = {\n memoise() {},\n\n handle(member) {\n const {\n node,\n parent,\n parentPath,\n scope\n } = member;\n\n if (member.isOptionalMemberExpression()) {\n if (isInDetachedTree(member)) return;\n const endPath = member.find(({\n node,\n parent,\n parentPath\n }) => {\n if (parentPath.isOptionalMemberExpression()) {\n return parent.optional || parent.object !== node;\n }\n\n if (parentPath.isOptionalCallExpression()) {\n return node !== member.node && parent.optional || parent.callee !== node;\n }\n\n return true;\n });\n\n if (scope.path.isPattern()) {\n endPath.replaceWith(t.callExpression(t.arrowFunctionExpression([], endPath.node), []));\n return;\n }\n\n const rootParentPath = endPath.parentPath;\n\n if (rootParentPath.isUpdateExpression({\n argument: node\n }) || rootParentPath.isAssignmentExpression({\n left: node\n })) {\n throw member.buildCodeFrameError(`can't handle assignment`);\n }\n\n const isDeleteOperation = rootParentPath.isUnaryExpression({\n operator: \"delete\"\n });\n\n if (isDeleteOperation && endPath.isOptionalMemberExpression() && endPath.get(\"property\").isPrivateName()) {\n throw member.buildCodeFrameError(`can't delete a private class element`);\n }\n\n let startingOptional = member;\n\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\n throw new Error(`Internal error: unexpected ${startingOptional.node.type}`);\n }\n\n const startingProp = startingOptional.isOptionalMemberExpression() ? \"object\" : \"callee\";\n const startingNode = startingOptional.node[startingProp];\n const baseNeedsMemoised = scope.maybeGenerateMemoised(startingNode);\n const baseRef = baseNeedsMemoised != null ? baseNeedsMemoised : startingNode;\n const parentIsOptionalCall = parentPath.isOptionalCallExpression({\n callee: node\n });\n const parentIsCall = parentPath.isCallExpression({\n callee: node\n });\n startingOptional.replaceWith(toNonOptional(startingOptional, baseRef));\n\n if (parentIsOptionalCall) {\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 member.replaceWith(this.boundGet(member));\n } else {\n member.replaceWith(this.get(member));\n }\n\n let regular = member.node;\n\n for (let current = member; current !== endPath;) {\n const {\n parentPath\n } = current;\n\n if (parentPath === endPath && parentIsOptionalCall && parent.optional) {\n regular = parentPath.node;\n break;\n }\n\n regular = toNonOptional(parentPath, regular);\n current = parentPath;\n }\n\n let context;\n const endParentPath = endPath.parentPath;\n\n if (t.isMemberExpression(regular) && endParentPath.isOptionalCallExpression({\n callee: endPath.node,\n optional: true\n })) {\n const {\n object\n } = regular;\n context = member.scope.maybeGenerateMemoised(object);\n\n if (context) {\n regular.object = t.assignmentExpression(\"=\", context, object);\n }\n }\n\n let replacementPath = endPath;\n\n if (isDeleteOperation) {\n replacementPath = endParentPath;\n regular = endParentPath.node;\n }\n\n replacementPath.replaceWith(t.conditionalExpression(t.logicalExpression(\"||\", t.binaryExpression(\"===\", baseNeedsMemoised ? t.assignmentExpression(\"=\", t.cloneNode(baseRef), t.cloneNode(startingNode)) : t.cloneNode(baseRef), t.nullLiteral()), t.binaryExpression(\"===\", t.cloneNode(baseRef), scope.buildUndefinedNode())), isDeleteOperation ? t.booleanLiteral(true) : scope.buildUndefinedNode(), regular));\n\n if (context) {\n const endParent = endParentPath.node;\n endParentPath.replaceWith(t.optionalCallExpression(t.optionalMemberExpression(endParent.callee, t.identifier(\"call\"), false, true), [t.cloneNode(context), ...endParent.arguments], false));\n }\n\n return;\n }\n\n if (parentPath.isUpdateExpression({\n argument: node\n })) {\n if (this.simpleSet) {\n member.replaceWith(this.simpleSet(member));\n return;\n }\n\n const {\n operator,\n prefix\n } = parent;\n this.memoise(member, 2);\n const value = t.binaryExpression(operator[0], t.unaryExpression(\"+\", this.get(member)), t.numericLiteral(1));\n\n if (prefix) {\n parentPath.replaceWith(this.set(member, value));\n } else {\n const {\n scope\n } = member;\n const ref = scope.generateUidIdentifierBasedOnNode(node);\n scope.push({\n id: ref\n });\n value.left = t.assignmentExpression(\"=\", t.cloneNode(ref), value.left);\n parentPath.replaceWith(t.sequenceExpression([this.set(member, value), t.cloneNode(ref)]));\n }\n\n return;\n }\n\n if (parentPath.isAssignmentExpression({\n left: node\n })) {\n if (this.simpleSet) {\n member.replaceWith(this.simpleSet(member));\n return;\n }\n\n const {\n operator,\n right: value\n } = parent;\n\n if (operator === \"=\") {\n parentPath.replaceWith(this.set(member, value));\n } else {\n const operatorTrunc = operator.slice(0, -1);\n\n if (t.LOGICAL_OPERATORS.includes(operatorTrunc)) {\n this.memoise(member, 1);\n parentPath.replaceWith(t.logicalExpression(operatorTrunc, this.get(member), this.set(member, value)));\n } else {\n this.memoise(member, 2);\n parentPath.replaceWith(this.set(member, t.binaryExpression(operatorTrunc, this.get(member), value)));\n }\n }\n\n return;\n }\n\n if (parentPath.isCallExpression({\n callee: node\n })) {\n parentPath.replaceWith(this.call(member, parent.arguments));\n return;\n }\n\n if (parentPath.isOptionalCallExpression({\n callee: node\n })) {\n if (scope.path.isPattern()) {\n parentPath.replaceWith(t.callExpression(t.arrowFunctionExpression([], parentPath.node), []));\n return;\n }\n\n parentPath.replaceWith(this.optionalCall(member, parent.arguments));\n return;\n }\n\n if (parentPath.isForXStatement({\n left: node\n }) || parentPath.isObjectProperty({\n value: node\n }) && parentPath.parentPath.isObjectPattern() || parentPath.isAssignmentPattern({\n left: node\n }) && parentPath.parentPath.isObjectProperty({\n value: parent\n }) && parentPath.parentPath.parentPath.isObjectPattern() || parentPath.isArrayPattern() || parentPath.isAssignmentPattern({\n left: node\n }) && parentPath.parentPath.isArrayPattern() || parentPath.isRestElement()) {\n member.replaceWith(this.destructureSet(member));\n return;\n }\n\n member.replaceWith(this.get(member));\n }\n\n};\n\nfunction memberExpressionToFunctions(path, visitor, state) {\n path.traverse(visitor, Object.assign({}, handle, state, {\n memoiser: new AssignmentMemoiser()\n }));\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _assert = _interopRequireDefault(require(\"assert\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nclass ImportBuilder {\n constructor(importedSource, scope, hub) {\n this._statements = [];\n this._resultName = null;\n this._scope = null;\n this._hub = null;\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(t.importDeclaration([], t.stringLiteral(this._importedSource)));\n\n return this;\n }\n\n require() {\n this._statements.push(t.expressionStatement(t.callExpression(t.identifier(\"require\"), [t.stringLiteral(this._importedSource)])));\n\n return this;\n }\n\n namespace(name = \"namespace\") {\n name = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n (0, _assert.default)(statement.type === \"ImportDeclaration\");\n (0, _assert.default)(statement.specifiers.length === 0);\n statement.specifiers = [t.importNamespaceSpecifier(name)];\n this._resultName = t.cloneNode(name);\n return this;\n }\n\n default(name) {\n name = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n (0, _assert.default)(statement.type === \"ImportDeclaration\");\n (0, _assert.default)(statement.specifiers.length === 0);\n statement.specifiers = [t.importDefaultSpecifier(name)];\n this._resultName = t.cloneNode(name);\n return this;\n }\n\n named(name, importName) {\n if (importName === \"default\") return this.default(name);\n name = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n (0, _assert.default)(statement.type === \"ImportDeclaration\");\n (0, _assert.default)(statement.specifiers.length === 0);\n statement.specifiers = [t.importSpecifier(name, t.identifier(importName))];\n this._resultName = t.cloneNode(name);\n return this;\n }\n\n var(name) {\n name = this._scope.generateUidIdentifier(name);\n let statement = this._statements[this._statements.length - 1];\n\n if (statement.type !== \"ExpressionStatement\") {\n (0, _assert.default)(this._resultName);\n statement = t.expressionStatement(this._resultName);\n\n this._statements.push(statement);\n }\n\n this._statements[this._statements.length - 1] = t.variableDeclaration(\"var\", [t.variableDeclarator(name, statement.expression)]);\n this._resultName = t.cloneNode(name);\n return this;\n }\n\n defaultInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireDefault\"));\n }\n\n wildcardInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireWildcard\"));\n }\n\n _interop(callee) {\n const statement = this._statements[this._statements.length - 1];\n\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = t.callExpression(callee, [statement.expression]);\n } else if (statement.type === \"VariableDeclaration\") {\n (0, _assert.default)(statement.declarations.length === 1);\n statement.declarations[0].init = t.callExpression(callee, [statement.declarations[0].init]);\n } else {\n _assert.default.fail(\"Unexpected type.\");\n }\n\n return this;\n }\n\n prop(name) {\n const statement = this._statements[this._statements.length - 1];\n\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = t.memberExpression(statement.expression, t.identifier(name));\n } else if (statement.type === \"VariableDeclaration\") {\n (0, _assert.default)(statement.declarations.length === 1);\n statement.declarations[0].init = t.memberExpression(statement.declarations[0].init, t.identifier(name));\n } else {\n _assert.default.fail(\"Unexpected type:\" + statement.type);\n }\n\n return this;\n }\n\n read(name) {\n this._resultName = t.memberExpression(this._resultName, t.identifier(name));\n }\n\n}\n\nexports.default = ImportBuilder;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _assert = _interopRequireDefault(require(\"assert\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar _importBuilder = _interopRequireDefault(require(\"./import-builder\"));\n\nvar _isModule = _interopRequireDefault(require(\"./is-module\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nclass ImportInjector {\n constructor(path, importedSource, opts) {\n this._defaultOpts = {\n importedSource: null,\n importedType: \"commonjs\",\n importedInterop: \"babel\",\n importingInterop: \"babel\",\n ensureLiveReference: false,\n ensureNoContext: false\n };\n const programPath = path.find(p => p.isProgram());\n this._programPath = programPath;\n this._programScope = programPath.scope;\n this._hub = programPath.hub;\n this._defaultOpts = this._applyDefaults(importedSource, opts, true);\n }\n\n addDefault(importedSourceIn, opts) {\n return this.addNamed(\"default\", importedSourceIn, opts);\n }\n\n addNamed(importName, importedSourceIn, opts) {\n (0, _assert.default)(typeof importName === \"string\");\n return this._generateImport(this._applyDefaults(importedSourceIn, opts), importName);\n }\n\n addNamespace(importedSourceIn, opts) {\n return this._generateImport(this._applyDefaults(importedSourceIn, opts), null);\n }\n\n addSideEffect(importedSourceIn, opts) {\n return this._generateImport(this._applyDefaults(importedSourceIn, opts), false);\n }\n\n _applyDefaults(importedSource, opts, isInit = false) {\n const optsList = [];\n\n if (typeof importedSource === \"string\") {\n optsList.push({\n importedSource\n });\n optsList.push(opts);\n } else {\n (0, _assert.default)(!opts, \"Unexpected secondary arguments.\");\n optsList.push(importedSource);\n }\n\n const newOpts = Object.assign({}, this._defaultOpts);\n\n for (const opts of optsList) {\n if (!opts) continue;\n Object.keys(newOpts).forEach(key => {\n if (opts[key] !== undefined) newOpts[key] = opts[key];\n });\n\n if (!isInit) {\n if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint;\n if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist;\n }\n }\n\n return newOpts;\n }\n\n _generateImport(opts, importName) {\n const isDefault = importName === \"default\";\n const isNamed = !!importName && !isDefault;\n const isNamespace = importName === null;\n const {\n importedSource,\n importedType,\n importedInterop,\n importingInterop,\n ensureLiveReference,\n ensureNoContext,\n nameHint,\n blockHoist\n } = opts;\n let name = nameHint || importName;\n const isMod = (0, _isModule.default)(this._programPath);\n const isModuleForNode = isMod && importingInterop === \"node\";\n const isModuleForBabel = isMod && importingInterop === \"babel\";\n const builder = new _importBuilder.default(importedSource, this._programScope, this._hub);\n\n if (importedType === \"es6\") {\n if (!isModuleForNode && !isModuleForBabel) {\n throw new Error(\"Cannot import an ES6 module from CommonJS\");\n }\n\n builder.import();\n\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 name = name !== \"default\" ? name : importedSource;\n const es6Default = `${importedSource}$es6Default`;\n builder.import();\n\n if (isNamespace) {\n builder.default(es6Default).var(name || importedSource).wildcardInterop();\n } else if (isDefault) {\n if (ensureLiveReference) {\n builder.default(es6Default).var(name || importedSource).defaultInterop().read(\"default\");\n } else {\n builder.default(es6Default).var(name).defaultInterop().prop(importName);\n }\n } else if (isNamed) {\n builder.default(es6Default).read(importName);\n }\n } else if (isModuleForBabel) {\n builder.import();\n\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n builder.require();\n\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 builder.import();\n\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 builder.import();\n\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n builder.require();\n\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 builder.import();\n\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 builder.import();\n\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 builder.require();\n\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 {\n statements,\n resultName\n } = builder.done();\n\n this._insertStatements(statements, blockHoist);\n\n if ((isDefault || isNamed) && ensureNoContext && resultName.type !== \"Identifier\") {\n return t.sequenceExpression([t.numericLiteral(0), resultName]);\n }\n\n return resultName;\n }\n\n _insertStatements(statements, blockHoist = 3) {\n statements.forEach(node => {\n node._blockHoist = blockHoist;\n });\n\n const targetPath = this._programPath.get(\"body\").find(p => {\n const val = p.node._blockHoist;\n return Number.isFinite(val) && val < 4;\n });\n\n if (targetPath) {\n targetPath.insertBefore(statements);\n } else {\n this._programPath.unshiftContainer(\"body\", statements);\n }\n }\n\n}\n\nexports.default = ImportInjector;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addDefault = addDefault;\nexports.addNamed = addNamed;\nexports.addNamespace = addNamespace;\nexports.addSideEffect = addSideEffect;\nObject.defineProperty(exports, \"ImportInjector\", {\n enumerable: true,\n get: function () {\n return _importInjector.default;\n }\n});\nObject.defineProperty(exports, \"isModule\", {\n enumerable: true,\n get: function () {\n return _isModule.default;\n }\n});\n\nvar _importInjector = _interopRequireDefault(require(\"./import-injector\"));\n\nvar _isModule = _interopRequireDefault(require(\"./is-module\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction addDefault(path, importedSource, opts) {\n return new _importInjector.default(path).addDefault(importedSource, opts);\n}\n\nfunction addNamed(path, name, importedSource, opts) {\n return new _importInjector.default(path).addNamed(name, importedSource, opts);\n}\n\nfunction addNamespace(path, importedSource, opts) {\n return new _importInjector.default(path).addNamespace(importedSource, opts);\n}\n\nfunction addSideEffect(path, importedSource, opts) {\n return new _importInjector.default(path).addSideEffect(importedSource, opts);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isModule;\n\nfunction isModule(path) {\n const {\n sourceType\n } = path.node;\n\n if (sourceType !== \"module\" && sourceType !== \"script\") {\n throw path.buildCodeFrameError(`Unknown sourceType \"${sourceType}\", cannot transform.`);\n }\n\n return path.node.sourceType === \"module\";\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getModuleName;\n\nfunction getModuleName(rootOpts, pluginOpts) {\n var _pluginOpts$moduleRoo, _rootOpts$moduleIds, _rootOpts$moduleRoot;\n\n const {\n filename,\n filenameRelative = filename,\n sourceRoot = (_pluginOpts$moduleRoo = pluginOpts.moduleRoot) != null ? _pluginOpts$moduleRoo : rootOpts.moduleRoot\n } = rootOpts;\n const {\n moduleId = rootOpts.moduleId,\n moduleIds = (_rootOpts$moduleIds = rootOpts.moduleIds) != null ? _rootOpts$moduleIds : !!moduleId,\n getModuleId = rootOpts.getModuleId,\n moduleRoot = (_rootOpts$moduleRoot = rootOpts.moduleRoot) != null ? _rootOpts$moduleRoot : sourceRoot\n } = pluginOpts;\n if (!moduleIds) return null;\n\n if (moduleId != null && !getModuleId) {\n return moduleId;\n }\n\n let moduleName = moduleRoot != null ? moduleRoot + \"/\" : \"\";\n\n if (filenameRelative) {\n const sourceRootReplacer = sourceRoot != null ? new RegExp(\"^\" + sourceRoot + \"/?\") : \"\";\n moduleName += filenameRelative.replace(sourceRootReplacer, \"\").replace(/\\.(\\w*?)$/, \"\");\n }\n\n moduleName = moduleName.replace(/\\\\/g, \"/\");\n\n if (getModuleId) {\n return getModuleId(moduleName) || moduleName;\n } else {\n return moduleName;\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.rewriteModuleStatementsAndPrepareHeader = rewriteModuleStatementsAndPrepareHeader;\nexports.ensureStatementsHoisted = ensureStatementsHoisted;\nexports.wrapInterop = wrapInterop;\nexports.buildNamespaceInitStatements = buildNamespaceInitStatements;\nObject.defineProperty(exports, \"isModule\", {\n enumerable: true,\n get: function () {\n return _helperModuleImports.isModule;\n }\n});\nObject.defineProperty(exports, \"rewriteThis\", {\n enumerable: true,\n get: function () {\n return _rewriteThis.default;\n }\n});\nObject.defineProperty(exports, \"hasExports\", {\n enumerable: true,\n get: function () {\n return _normalizeAndLoadMetadata.hasExports;\n }\n});\nObject.defineProperty(exports, \"isSideEffectImport\", {\n enumerable: true,\n get: function () {\n return _normalizeAndLoadMetadata.isSideEffectImport;\n }\n});\nObject.defineProperty(exports, \"getModuleName\", {\n enumerable: true,\n get: function () {\n return _getModuleName.default;\n }\n});\n\nvar _assert = _interopRequireDefault(require(\"assert\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar _template = _interopRequireDefault(require(\"@babel/template\"));\n\nvar _chunk = _interopRequireDefault(require(\"lodash/chunk\"));\n\nvar _helperModuleImports = require(\"@babel/helper-module-imports\");\n\nvar _rewriteThis = _interopRequireDefault(require(\"./rewrite-this\"));\n\nvar _rewriteLiveReferences = _interopRequireDefault(require(\"./rewrite-live-references\"));\n\nvar _normalizeAndLoadMetadata = _interopRequireWildcard(require(\"./normalize-and-load-metadata\"));\n\nvar _getModuleName = _interopRequireDefault(require(\"./get-module-name\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction rewriteModuleStatementsAndPrepareHeader(path, {\n exportName,\n strict,\n allowTopLevelThis,\n strictMode,\n loose,\n noInterop,\n lazy,\n esNamespaceOnly\n}) {\n (0, _assert.default)((0, _helperModuleImports.isModule)(path), \"Cannot process module statements in a script\");\n path.node.sourceType = \"script\";\n const meta = (0, _normalizeAndLoadMetadata.default)(path, exportName, {\n noInterop,\n loose,\n lazy,\n esNamespaceOnly\n });\n\n if (!allowTopLevelThis) {\n (0, _rewriteThis.default)(path);\n }\n\n (0, _rewriteLiveReferences.default)(path, meta);\n\n if (strictMode !== false) {\n const hasStrict = path.node.directives.some(directive => {\n return directive.value.value === \"use strict\";\n });\n\n if (!hasStrict) {\n path.unshiftContainer(\"directives\", t.directive(t.directiveLiteral(\"use strict\")));\n }\n }\n\n const headers = [];\n\n if ((0, _normalizeAndLoadMetadata.hasExports)(meta) && !strict) {\n headers.push(buildESModuleHeader(meta, loose));\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 headers.push(...buildExportInitializationStatements(path, meta, loose));\n return {\n meta,\n headers\n };\n}\n\nfunction ensureStatementsHoisted(statements) {\n statements.forEach(header => {\n header._blockHoist = 3;\n });\n}\n\nfunction wrapInterop(programPath, expr, type) {\n if (type === \"none\") {\n return null;\n }\n\n let helper;\n\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\nfunction buildNamespaceInitStatements(metadata, sourceMetadata, loose = false) {\n const statements = [];\n let srcNamespace = t.identifier(sourceMetadata.name);\n if (sourceMetadata.lazy) srcNamespace = t.callExpression(srcNamespace, []);\n\n for (const localName of sourceMetadata.importsNamespace) {\n if (localName === sourceMetadata.name) continue;\n statements.push(_template.default.statement`var NAME = SOURCE;`({\n NAME: localName,\n SOURCE: t.cloneNode(srcNamespace)\n }));\n }\n\n if (loose) {\n statements.push(...buildReexportsFromMeta(metadata, sourceMetadata, loose));\n }\n\n for (const exportName of sourceMetadata.reexportNamespace) {\n statements.push((sourceMetadata.lazy ? _template.default.statement`\n Object.defineProperty(EXPORTS, \"NAME\", {\n enumerable: true,\n get: function() {\n return NAMESPACE;\n }\n });\n ` : _template.default.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(metadata, t.cloneNode(srcNamespace), loose);\n statement.loc = sourceMetadata.reexportAll.loc;\n statements.push(statement);\n }\n\n return statements;\n}\n\nconst ReexportTemplate = {\n loose: _template.default.statement`EXPORTS.EXPORT_NAME = NAMESPACE_IMPORT;`,\n looseComputed: _template.default.statement`EXPORTS[\"EXPORT_NAME\"] = NAMESPACE_IMPORT;`,\n spec: (0, _template.default)`\n Object.defineProperty(EXPORTS, \"EXPORT_NAME\", {\n enumerable: true,\n get: function() {\n return NAMESPACE_IMPORT;\n },\n });\n `\n};\n\nconst buildReexportsFromMeta = (meta, metadata, loose) => {\n const namespace = metadata.lazy ? t.callExpression(t.identifier(metadata.name), []) : t.identifier(metadata.name);\n const {\n stringSpecifiers\n } = meta;\n return Array.from(metadata.reexports, ([exportName, importName]) => {\n let NAMESPACE_IMPORT;\n\n if (stringSpecifiers.has(importName)) {\n NAMESPACE_IMPORT = t.memberExpression(t.cloneNode(namespace), t.stringLiteral(importName), true);\n } else {\n NAMESPACE_IMPORT = NAMESPACE_IMPORT = t.memberExpression(t.cloneNode(namespace), t.identifier(importName));\n }\n\n const astNodes = {\n EXPORTS: meta.exportName,\n EXPORT_NAME: exportName,\n NAMESPACE_IMPORT\n };\n\n if (loose) {\n if (stringSpecifiers.has(exportName)) {\n return ReexportTemplate.looseComputed(astNodes);\n } else {\n return ReexportTemplate.loose(astNodes);\n }\n } else {\n return ReexportTemplate.spec(astNodes);\n }\n });\n};\n\nfunction buildESModuleHeader(metadata, enumerable = false) {\n return (enumerable ? _template.default.statement`\n EXPORTS.__esModule = true;\n ` : _template.default.statement`\n Object.defineProperty(EXPORTS, \"__esModule\", {\n value: true,\n });\n `)({\n EXPORTS: metadata.exportName\n });\n}\n\nfunction buildNamespaceReexport(metadata, namespace, loose) {\n return (loose ? _template.default.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 ` : _template.default.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 NAMESPACE: namespace,\n EXPORTS: metadata.exportName,\n VERIFY_NAME_LIST: metadata.exportNameListName ? (0, _template.default)`\n if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;\n `({\n EXPORTS_LIST: metadata.exportNameListName\n }) : null\n });\n}\n\nfunction buildExportNameListDeclaration(programPath, metadata) {\n const exportedVars = Object.create(null);\n\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\n for (const data of metadata.source.values()) {\n for (const exportName of data.reexports.keys()) {\n exportedVars[exportName] = true;\n }\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 const name = programPath.scope.generateUidIdentifier(\"exportNames\");\n delete exportedVars.default;\n return {\n name: name.name,\n statement: t.variableDeclaration(\"var\", [t.variableDeclarator(name, t.valueToNode(exportedVars))])\n };\n}\n\nfunction buildExportInitializationStatements(programPath, metadata, loose = false) {\n const initStatements = [];\n const exportNames = [];\n\n for (const [localName, data] of metadata.local) {\n if (data.kind === \"import\") {} else if (data.kind === \"hoisted\") {\n initStatements.push(buildInitStatement(metadata, data.names, t.identifier(localName)));\n } else {\n exportNames.push(...data.names);\n }\n }\n\n for (const data of metadata.source.values()) {\n if (!loose) {\n initStatements.push(...buildReexportsFromMeta(metadata, data, loose));\n }\n\n for (const exportName of data.reexportNamespace) {\n exportNames.push(exportName);\n }\n }\n\n initStatements.push(...(0, _chunk.default)(exportNames, 100).map(members => {\n return buildInitStatement(metadata, members, programPath.scope.buildUndefinedNode());\n }));\n return initStatements;\n}\n\nconst InitTemplate = {\n computed: _template.default.expression`EXPORTS[\"NAME\"] = VALUE`,\n default: _template.default.expression`EXPORTS.NAME = VALUE`\n};\n\nfunction buildInitStatement(metadata, exportNames, initExpr) {\n const {\n stringSpecifiers,\n exportName: EXPORTS\n } = metadata;\n return t.expressionStatement(exportNames.reduce((acc, exportName) => {\n const params = {\n EXPORTS,\n NAME: exportName,\n VALUE: acc\n };\n\n if (stringSpecifiers.has(exportName)) {\n return InitTemplate.computed(params);\n } else {\n return InitTemplate.default(params);\n }\n }, initExpr));\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.hasExports = hasExports;\nexports.isSideEffectImport = isSideEffectImport;\nexports.default = normalizeModuleAndLoadMetadata;\n\nvar _path = require(\"path\");\n\nvar _helperValidatorIdentifier = require(\"@babel/helper-validator-identifier\");\n\nvar _helperSplitExportDeclaration = _interopRequireDefault(require(\"@babel/helper-split-export-declaration\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction hasExports(metadata) {\n return metadata.hasExports;\n}\n\nfunction isSideEffectImport(source) {\n return source.imports.size === 0 && source.importsNamespace.size === 0 && source.reexports.size === 0 && source.reexportNamespace.size === 0 && !source.reexportAll;\n}\n\nfunction normalizeModuleAndLoadMetadata(programPath, exportName, {\n noInterop = false,\n loose = false,\n lazy = false,\n esNamespaceOnly = false\n} = {}) {\n if (!exportName) {\n exportName = programPath.scope.generateUidIdentifier(\"exports\").name;\n }\n\n const stringSpecifiers = new Set();\n nameAnonymousExports(programPath);\n const {\n local,\n source,\n hasExports\n } = getModuleMetadata(programPath, {\n loose,\n lazy\n }, stringSpecifiers);\n removeModuleDeclarations(programPath);\n\n for (const [, metadata] of source) {\n if (metadata.importsNamespace.size > 0) {\n metadata.name = metadata.importsNamespace.values().next().value;\n }\n\n if (noInterop) metadata.interop = \"none\";else if (esNamespaceOnly) {\n if (metadata.interop === \"namespace\") {\n metadata.interop = \"default\";\n }\n }\n }\n\n return {\n exportName,\n exportNameListName: null,\n hasExports,\n local,\n source,\n stringSpecifiers\n };\n}\n\nfunction getExportSpecifierName(path, stringSpecifiers) {\n if (path.isIdentifier()) {\n return path.node.name;\n } else if (path.isStringLiteral()) {\n const stringValue = path.node.value;\n\n if (!(0, _helperValidatorIdentifier.isIdentifierName)(stringValue)) {\n stringSpecifiers.add(stringValue);\n }\n\n return stringValue;\n } else {\n throw new Error(`Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`);\n }\n}\n\nfunction getModuleMetadata(programPath, {\n loose,\n lazy\n}, stringSpecifiers) {\n const localData = getLocalExportMetadata(programPath, loose, stringSpecifiers);\n const sourceData = new Map();\n\n const getData = sourceNode => {\n const source = sourceNode.value;\n let data = sourceData.get(source);\n\n if (!data) {\n data = {\n name: programPath.scope.generateUidIdentifier((0, _path.basename)(source, (0, _path.extname)(source))).name,\n interop: \"none\",\n loc: null,\n imports: new Map(),\n importsNamespace: new Set(),\n reexports: new Map(),\n reexportNamespace: new Set(),\n reexportAll: null,\n lazy: false\n };\n sourceData.set(source, data);\n }\n\n return data;\n };\n\n let hasExports = false;\n programPath.get(\"body\").forEach(child => {\n if (child.isImportDeclaration()) {\n const data = getData(child.node.source);\n if (!data.loc) data.loc = child.node.loc;\n child.get(\"specifiers\").forEach(spec => {\n if (spec.isImportDefaultSpecifier()) {\n const localName = spec.get(\"local\").node.name;\n data.imports.set(localName, \"default\");\n const reexport = localData.get(localName);\n\n if (reexport) {\n localData.delete(localName);\n reexport.names.forEach(name => {\n data.reexports.set(name, \"default\");\n });\n }\n } else if (spec.isImportNamespaceSpecifier()) {\n const localName = spec.get(\"local\").node.name;\n data.importsNamespace.add(localName);\n const reexport = localData.get(localName);\n\n if (reexport) {\n localData.delete(localName);\n reexport.names.forEach(name => {\n data.reexportNamespace.add(name);\n });\n }\n } else if (spec.isImportSpecifier()) {\n const importName = getExportSpecifierName(spec.get(\"imported\"), stringSpecifiers);\n const localName = spec.get(\"local\").node.name;\n data.imports.set(localName, importName);\n const reexport = localData.get(localName);\n\n if (reexport) {\n localData.delete(localName);\n reexport.names.forEach(name => {\n data.reexports.set(name, importName);\n });\n }\n }\n });\n } else if (child.isExportAllDeclaration()) {\n hasExports = true;\n const data = getData(child.node.source);\n if (!data.loc) data.loc = child.node.loc;\n data.reexportAll = {\n loc: child.node.loc\n };\n } else if (child.isExportNamedDeclaration() && child.node.source) {\n hasExports = true;\n const data = getData(child.node.source);\n if (!data.loc) data.loc = child.node.loc;\n child.get(\"specifiers\").forEach(spec => {\n if (!spec.isExportSpecifier()) {\n throw spec.buildCodeFrameError(\"Unexpected export specifier type\");\n }\n\n const importName = getExportSpecifierName(spec.get(\"local\"), stringSpecifiers);\n const exportName = getExportSpecifierName(spec.get(\"exported\"), stringSpecifiers);\n data.reexports.set(exportName, importName);\n\n if (exportName === \"__esModule\") {\n throw exportName.buildCodeFrameError('Illegal export \"__esModule\".');\n }\n });\n } else if (child.isExportNamedDeclaration() || child.isExportDefaultDeclaration()) {\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;else needsNamed = true;\n }\n\n for (const importName of metadata.reexports.values()) {\n if (importName === \"default\") needsDefault = true;else needsNamed = true;\n }\n\n if (needsDefault && needsNamed) {\n metadata.interop = \"namespace\";\n } else if (needsDefault) {\n metadata.interop = \"default\";\n }\n }\n\n for (const [source, metadata] of sourceData) {\n if (lazy !== false && !(isSideEffectImport(metadata) || metadata.reexportAll)) {\n if (lazy === true) {\n metadata.lazy = !/\\./.test(source);\n } else if (Array.isArray(lazy)) {\n metadata.lazy = lazy.indexOf(source) !== -1;\n } else if (typeof lazy === \"function\") {\n metadata.lazy = lazy(source);\n } else {\n throw new Error(`.lazy must be a boolean, string array, or function`);\n }\n }\n }\n\n return {\n hasExports,\n local: localData,\n source: sourceData\n };\n}\n\nfunction getLocalExportMetadata(programPath, loose, stringSpecifiers) {\n const bindingKindLookup = new Map();\n programPath.get(\"body\").forEach(child => {\n let kind;\n\n if (child.isImportDeclaration()) {\n kind = \"import\";\n } else {\n if (child.isExportDefaultDeclaration()) child = child.get(\"declaration\");\n\n if (child.isExportNamedDeclaration()) {\n if (child.node.declaration) {\n child = child.get(\"declaration\");\n } else if (loose && child.node.source && child.get(\"source\").isStringLiteral()) {\n child.node.specifiers.forEach(specifier => {\n bindingKindLookup.set(specifier.local.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({\n kind: \"var\"\n })) {\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 const localMetadata = new Map();\n\n const getLocalMetadata = idPath => {\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(`Exporting local \"${localName}\", which is not declared.`);\n }\n\n metadata = {\n names: [],\n kind\n };\n localMetadata.set(localName, metadata);\n }\n\n return metadata;\n };\n\n programPath.get(\"body\").forEach(child => {\n if (child.isExportNamedDeclaration() && (loose || !child.node.source)) {\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('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\n localMetadata.names.push(exportName);\n });\n }\n } else if (child.isExportDefaultDeclaration()) {\n const declaration = child.get(\"declaration\");\n\n if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) {\n getLocalMetadata(declaration.get(\"id\")).names.push(\"default\");\n } else {\n throw declaration.buildCodeFrameError(\"Unexpected default expression export.\");\n }\n }\n });\n return localMetadata;\n}\n\nfunction nameAnonymousExports(programPath) {\n programPath.get(\"body\").forEach(child => {\n if (!child.isExportDefaultDeclaration()) return;\n (0, _helperSplitExportDeclaration.default)(child);\n });\n}\n\nfunction removeModuleDeclarations(programPath) {\n programPath.get(\"body\").forEach(child => {\n if (child.isImportDeclaration()) {\n child.remove();\n } else if (child.isExportNamedDeclaration()) {\n if (child.node.declaration) {\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 const declaration = child.get(\"declaration\");\n\n if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) {\n declaration._blockHoist = child.node._blockHoist;\n child.replaceWith(declaration);\n } else {\n throw declaration.buildCodeFrameError(\"Unexpected default expression export.\");\n }\n } else if (child.isExportAllDeclaration()) {\n child.remove();\n }\n });\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rewriteLiveReferences;\n\nvar _assert = _interopRequireDefault(require(\"assert\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar _template = _interopRequireDefault(require(\"@babel/template\"));\n\nvar _helperSimpleAccess = _interopRequireDefault(require(\"@babel/helper-simple-access\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction rewriteLiveReferences(programPath, metadata) {\n const imported = new Map();\n const exported = new Map();\n\n const requeueInParent = path => {\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\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\n if (!exportMeta) {\n exportMeta = [];\n exported.set(local, exportMeta);\n }\n\n exportMeta.push(...data.names);\n }\n\n programPath.traverse(rewriteBindingInitVisitor, {\n metadata,\n requeueInParent,\n scope: programPath.scope,\n exported\n });\n (0, _helperSimpleAccess.default)(programPath, new Set([...Array.from(imported.keys()), ...Array.from(exported.keys())]));\n programPath.traverse(rewriteReferencesVisitor, {\n seen: new WeakSet(),\n metadata,\n requeueInParent,\n scope: programPath.scope,\n imported,\n exported,\n buildImportReference: ([source, importName, localName], identNode) => {\n const meta = metadata.source.get(source);\n\n if (localName) {\n if (meta.lazy) identNode = t.callExpression(identNode, []);\n return identNode;\n }\n\n let namespace = t.identifier(meta.name);\n if (meta.lazy) namespace = t.callExpression(namespace, []);\n const computed = metadata.stringSpecifiers.has(importName);\n return t.memberExpression(namespace, computed ? t.stringLiteral(importName) : t.identifier(importName), computed);\n }\n });\n}\n\nconst rewriteBindingInitVisitor = {\n Scope(path) {\n path.skip();\n },\n\n ClassDeclaration(path) {\n const {\n requeueInParent,\n exported,\n metadata\n } = this;\n const {\n id\n } = path.node;\n if (!id) throw new Error(\"Expected class to have a name\");\n const localName = id.name;\n const exportNames = exported.get(localName) || [];\n\n if (exportNames.length > 0) {\n const statement = t.expressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, t.identifier(localName)));\n statement._blockHoist = path.node._blockHoist;\n requeueInParent(path.insertAfter(statement)[0]);\n }\n },\n\n VariableDeclaration(path) {\n const {\n requeueInParent,\n exported,\n metadata\n } = this;\n Object.keys(path.getOuterBindingIdentifiers()).forEach(localName => {\n const exportNames = exported.get(localName) || [];\n\n if (exportNames.length > 0) {\n const statement = t.expressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, t.identifier(localName)));\n statement._blockHoist = path.node._blockHoist;\n requeueInParent(path.insertAfter(statement)[0]);\n }\n });\n }\n\n};\n\nconst buildBindingExportAssignmentExpression = (metadata, exportNames, localExpr) => {\n return (exportNames || []).reduce((expr, exportName) => {\n const {\n stringSpecifiers\n } = metadata;\n const computed = stringSpecifiers.has(exportName);\n return t.assignmentExpression(\"=\", t.memberExpression(t.identifier(metadata.exportName), computed ? t.stringLiteral(exportName) : t.identifier(exportName), computed), expr);\n }, localExpr);\n};\n\nconst buildImportThrow = localName => {\n return _template.default.expression.ast`\n (function() {\n throw new Error('\"' + '${localName}' + '\" is read-only.');\n })()\n `;\n};\n\nconst rewriteReferencesVisitor = {\n ReferencedIdentifier(path) {\n const {\n seen,\n buildImportReference,\n scope,\n imported,\n requeueInParent\n } = this;\n if (seen.has(path.node)) return;\n seen.add(path.node);\n const localName = path.node.name;\n const localBinding = path.scope.getBinding(localName);\n const rootBinding = scope.getBinding(localName);\n if (rootBinding !== localBinding) return;\n const importData = imported.get(localName);\n\n if (importData) {\n const ref = buildImportReference(importData, path.node);\n ref.loc = path.node.loc;\n\n if ((path.parentPath.isCallExpression({\n callee: path.node\n }) || path.parentPath.isOptionalCallExpression({\n callee: path.node\n }) || path.parentPath.isTaggedTemplateExpression({\n tag: path.node\n })) && t.isMemberExpression(ref)) {\n path.replaceWith(t.sequenceExpression([t.numericLiteral(0), ref]));\n } else if (path.isJSXIdentifier() && t.isMemberExpression(ref)) {\n const {\n object,\n property\n } = ref;\n path.replaceWith(t.JSXMemberExpression(t.JSXIdentifier(object.name), t.JSXIdentifier(property.name)));\n } else {\n path.replaceWith(ref);\n }\n\n requeueInParent(path);\n path.skip();\n }\n },\n\n AssignmentExpression: {\n exit(path) {\n const {\n scope,\n seen,\n imported,\n exported,\n requeueInParent,\n buildImportReference\n } = this;\n if (seen.has(path.node)) return;\n seen.add(path.node);\n const left = path.get(\"left\");\n if (left.isMemberExpression()) return;\n\n if (left.isIdentifier()) {\n const localName = left.node.name;\n\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 == null ? void 0 : exportedNames.length) > 0 || importData) {\n (0, _assert.default)(path.node.operator === \"=\", \"Path was not simplified\");\n const assignment = path.node;\n\n if (importData) {\n assignment.left = buildImportReference(importData, assignment.left);\n assignment.right = t.sequenceExpression([assignment.right, buildImportThrow(localName)]);\n }\n\n path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, assignment));\n requeueInParent(path);\n }\n } else {\n const ids = left.getOuterBindingIdentifiers();\n const programScopeIds = Object.keys(ids).filter(localName => scope.getBinding(localName) === path.scope.getBinding(localName));\n const id = programScopeIds.find(localName => imported.has(localName));\n\n if (id) {\n path.node.right = t.sequenceExpression([path.node.right, buildImportThrow(id)]);\n }\n\n const items = [];\n programScopeIds.forEach(localName => {\n const exportedNames = exported.get(localName) || [];\n\n if (exportedNames.length > 0) {\n items.push(buildBindingExportAssignmentExpression(this.metadata, exportedNames, t.identifier(localName)));\n }\n });\n\n if (items.length > 0) {\n let node = t.sequenceExpression(items);\n\n if (path.parentPath.isExpressionStatement()) {\n node = t.expressionStatement(node);\n node._blockHoist = path.parentPath.node._blockHoist;\n }\n\n const statement = path.insertAfter(node)[0];\n requeueInParent(statement);\n }\n }\n }\n\n },\n\n \"ForOfStatement|ForInStatement\"(path) {\n const {\n scope,\n node\n } = path;\n const {\n left\n } = node;\n const {\n exported,\n scope: programScope\n } = this;\n\n if (!t.isVariableDeclaration(left)) {\n let didTransform = false;\n const bodyPath = path.get(\"body\");\n const loopBodyScope = bodyPath.scope;\n\n for (const name of Object.keys(t.getOuterBindingIdentifiers(left))) {\n if (exported.get(name) && programScope.getBinding(name) === scope.getBinding(name)) {\n didTransform = true;\n\n if (loopBodyScope.hasOwnBinding(name)) {\n loopBodyScope.rename(name);\n }\n }\n }\n\n if (!didTransform) {\n return;\n }\n\n const newLoopId = scope.generateUidIdentifierBasedOnNode(left);\n bodyPath.unshiftContainer(\"body\", t.expressionStatement(t.assignmentExpression(\"=\", left, newLoopId)));\n path.get(\"left\").replaceWith(t.variableDeclaration(\"let\", [t.variableDeclarator(t.cloneNode(newLoopId))]));\n scope.registerDeclaration(path.get(\"left\"));\n }\n }\n\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rewriteThis;\n\nvar _helperReplaceSupers = require(\"@babel/helper-replace-supers\");\n\nvar _traverse = _interopRequireDefault(require(\"@babel/traverse\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction rewriteThis(programPath) {\n (0, _traverse.default)(programPath.node, Object.assign({}, rewriteThisVisitor, {\n noScope: true\n }));\n}\n\nconst rewriteThisVisitor = _traverse.default.visitors.merge([_helperReplaceSupers.environmentVisitor, {\n ThisExpression(path) {\n path.replaceWith(t.unaryExpression(\"void\", t.numericLiteral(0), true));\n }\n\n}]);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isIdentifierStart = isIdentifierStart;\nexports.isIdentifierChar = isIdentifierChar;\nexports.isIdentifierName = isIdentifierName;\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u08a0-\\u08b4\\u08b6-\\u08c7\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\u9ffc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7bf\\ua7c2-\\ua7ca\\ua7f5-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u08d3-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf\\u1ac0\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1df9\\u1dfb-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\nconst nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\nconst nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\nconst astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];\nconst astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n\nfunction isInAstralSet(code, set) {\n let pos = 0x10000;\n\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n\n return false;\n}\n\nfunction isIdentifierStart(code) {\n if (code < 65) return code === 36;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));\n }\n\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\nfunction isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}\n\nfunction isIdentifierName(name) {\n let isFirst = true;\n\n for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) {\n const char = _Array$from[_i];\n const cp = char.codePointAt(0);\n\n if (isFirst) {\n if (!isIdentifierStart(cp)) {\n return false;\n }\n\n isFirst = false;\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n\n return !isFirst;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"isIdentifierName\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierName;\n }\n});\nObject.defineProperty(exports, \"isIdentifierChar\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierChar;\n }\n});\nObject.defineProperty(exports, \"isIdentifierStart\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierStart;\n }\n});\nObject.defineProperty(exports, \"isReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictBindOnlyReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictBindOnlyReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictBindReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictBindReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictReservedWord;\n }\n});\nObject.defineProperty(exports, \"isKeyword\", {\n enumerable: true,\n get: function () {\n return _keyword.isKeyword;\n }\n});\n\nvar _identifier = require(\"./identifier\");\n\nvar _keyword = require(\"./keyword\");","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isReservedWord = isReservedWord;\nexports.isStrictReservedWord = isStrictReservedWord;\nexports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;\nexports.isStrictBindReservedWord = isStrictBindReservedWord;\nexports.isKeyword = isKeyword;\nconst reservedWords = {\n keyword: [\"break\", \"case\", \"catch\", \"continue\", \"debugger\", \"default\", \"do\", \"else\", \"finally\", \"for\", \"function\", \"if\", \"return\", \"switch\", \"throw\", \"try\", \"var\", \"const\", \"while\", \"with\", \"new\", \"this\", \"super\", \"class\", \"extends\", \"export\", \"import\", \"null\", \"true\", \"false\", \"in\", \"instanceof\", \"typeof\", \"void\", \"delete\"],\n strict: [\"implements\", \"interface\", \"let\", \"package\", \"private\", \"protected\", \"public\", \"static\", \"yield\"],\n strictBind: [\"eval\", \"arguments\"]\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\nfunction isReservedWord(word, inModule) {\n return inModule && word === \"await\" || word === \"enum\";\n}\n\nfunction isStrictReservedWord(word, inModule) {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\nfunction isStrictBindOnlyReservedWord(word) {\n return reservedWordsStrictBindSet.has(word);\n}\n\nfunction isStrictBindReservedWord(word, inModule) {\n return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);\n}\n\nfunction isKeyword(word) {\n return keywords.has(word);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _default(callee, thisNode, args, optional) {\n if (args.length === 1 && t.isSpreadElement(args[0]) && t.isIdentifier(args[0].argument, {\n name: \"arguments\"\n })) {\n return t.callExpression(t.memberExpression(callee, t.identifier(\"apply\")), [thisNode, args[0].argument]);\n } else {\n if (optional) {\n return t.optionalCallExpression(t.optionalMemberExpression(callee, t.identifier(\"call\"), false, true), [thisNode, ...args], false);\n }\n\n return t.callExpression(t.memberExpression(callee, t.identifier(\"call\")), [thisNode, ...args]);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.skipAllButComputedKey = skipAllButComputedKey;\nexports.default = exports.environmentVisitor = void 0;\n\nvar _traverse = _interopRequireDefault(require(\"@babel/traverse\"));\n\nvar _helperMemberExpressionToFunctions = _interopRequireDefault(require(\"@babel/helper-member-expression-to-functions\"));\n\nvar _helperOptimiseCallExpression = _interopRequireDefault(require(\"@babel/helper-optimise-call-expression\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getPrototypeOfExpression(objectRef, isStatic, file, isPrivateMethod) {\n objectRef = t.cloneNode(objectRef);\n const targetRef = isStatic || isPrivateMethod ? objectRef : t.memberExpression(objectRef, t.identifier(\"prototype\"));\n return t.callExpression(file.addHelper(\"getPrototypeOf\"), [targetRef]);\n}\n\nfunction skipAllButComputedKey(path) {\n if (!path.node.computed) {\n path.skip();\n return;\n }\n\n const keys = t.VISITOR_KEYS[path.type];\n\n for (const key of keys) {\n if (key !== \"key\") path.skipKey(key);\n }\n}\n\nconst environmentVisitor = {\n [`${t.StaticBlock ? \"StaticBlock|\" : \"\"}ClassPrivateProperty|TypeAnnotation`](path) {\n path.skip();\n },\n\n Function(path) {\n if (path.isMethod()) return;\n if (path.isArrowFunctionExpression()) return;\n path.skip();\n },\n\n \"Method|ClassProperty\"(path) {\n skipAllButComputedKey(path);\n }\n\n};\nexports.environmentVisitor = environmentVisitor;\n\nconst visitor = _traverse.default.visitors.merge([environmentVisitor, {\n Super(path, state) {\n const {\n node,\n parentPath\n } = path;\n if (!parentPath.isMemberExpression({\n object: node\n })) return;\n state.handle(parentPath);\n }\n\n}]);\n\nconst specHandlers = {\n memoise(superMember, count) {\n const {\n scope,\n node\n } = superMember;\n const {\n computed,\n property\n } = node;\n\n if (!computed) {\n return;\n }\n\n const memo = scope.maybeGenerateMemoised(property);\n\n if (!memo) {\n return;\n }\n\n this.memoiser.set(property, memo, count);\n },\n\n prop(superMember) {\n const {\n computed,\n property\n } = superMember.node;\n\n if (this.memoiser.has(property)) {\n return t.cloneNode(this.memoiser.get(property));\n }\n\n if (computed) {\n return t.cloneNode(property);\n }\n\n return t.stringLiteral(property.name);\n },\n\n get(superMember) {\n return this._get(superMember, this._getThisRefs());\n },\n\n _get(superMember, thisRefs) {\n const proto = getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod);\n return t.callExpression(this.file.addHelper(\"get\"), [thisRefs.memo ? t.sequenceExpression([thisRefs.memo, proto]) : proto, this.prop(superMember), thisRefs.this]);\n },\n\n _getThisRefs() {\n if (!this.isDerivedConstructor) {\n return {\n this: t.thisExpression()\n };\n }\n\n const thisRef = this.scope.generateDeclaredUidIdentifier(\"thisSuper\");\n return {\n memo: t.assignmentExpression(\"=\", thisRef, t.thisExpression()),\n this: t.cloneNode(thisRef)\n };\n },\n\n set(superMember, value) {\n const thisRefs = this._getThisRefs();\n\n const proto = getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod);\n return t.callExpression(this.file.addHelper(\"set\"), [thisRefs.memo ? t.sequenceExpression([thisRefs.memo, proto]) : proto, this.prop(superMember), value, thisRefs.this, t.booleanLiteral(superMember.isInStrictMode())]);\n },\n\n destructureSet(superMember) {\n throw superMember.buildCodeFrameError(`Destructuring to a super field is not supported yet.`);\n },\n\n call(superMember, args) {\n const thisRefs = this._getThisRefs();\n\n return (0, _helperOptimiseCallExpression.default)(this._get(superMember, thisRefs), t.cloneNode(thisRefs.this), args, false);\n },\n\n optionalCall(superMember, args) {\n const thisRefs = this._getThisRefs();\n\n return (0, _helperOptimiseCallExpression.default)(this._get(superMember, thisRefs), t.cloneNode(thisRefs.this), args, true);\n }\n\n};\nconst looseHandlers = Object.assign({}, specHandlers, {\n prop(superMember) {\n const {\n property\n } = superMember.node;\n\n if (this.memoiser.has(property)) {\n return t.cloneNode(this.memoiser.get(property));\n }\n\n return t.cloneNode(property);\n },\n\n get(superMember) {\n const {\n isStatic,\n superRef\n } = this;\n const {\n computed\n } = superMember.node;\n const prop = this.prop(superMember);\n let object;\n\n if (isStatic) {\n object = superRef ? t.cloneNode(superRef) : t.memberExpression(t.identifier(\"Function\"), t.identifier(\"prototype\"));\n } else {\n object = superRef ? t.memberExpression(t.cloneNode(superRef), t.identifier(\"prototype\")) : t.memberExpression(t.identifier(\"Object\"), t.identifier(\"prototype\"));\n }\n\n return t.memberExpression(object, prop, computed);\n },\n\n set(superMember, value) {\n const {\n computed\n } = superMember.node;\n const prop = this.prop(superMember);\n return t.assignmentExpression(\"=\", t.memberExpression(t.thisExpression(), prop, computed), value);\n },\n\n destructureSet(superMember) {\n const {\n computed\n } = superMember.node;\n const prop = this.prop(superMember);\n return t.memberExpression(t.thisExpression(), prop, computed);\n },\n\n call(superMember, args) {\n return (0, _helperOptimiseCallExpression.default)(this.get(superMember), t.thisExpression(), args, false);\n },\n\n optionalCall(superMember, args) {\n return (0, _helperOptimiseCallExpression.default)(this.get(superMember), t.thisExpression(), args, true);\n }\n\n});\n\nclass ReplaceSupers {\n constructor(opts) {\n const path = opts.methodPath;\n this.methodPath = path;\n this.isDerivedConstructor = path.isClassMethod({\n kind: \"constructor\"\n }) && !!opts.superRef;\n this.isStatic = path.isObjectMethod() || path.node.static;\n this.isPrivateMethod = path.isPrivate() && path.isMethod();\n this.file = opts.file;\n this.superRef = opts.superRef;\n this.isLoose = opts.isLoose;\n this.opts = opts;\n }\n\n getObjectRef() {\n return t.cloneNode(this.opts.objectRef || this.opts.getObjectRef());\n }\n\n replace() {\n const handler = this.isLoose ? looseHandlers : specHandlers;\n (0, _helperMemberExpressionToFunctions.default)(this.methodPath, visitor, Object.assign({\n file: this.file,\n scope: this.methodPath.scope,\n isDerivedConstructor: this.isDerivedConstructor,\n isStatic: this.isStatic,\n isPrivateMethod: this.isPrivateMethod,\n getObjectRef: this.getObjectRef.bind(this),\n superRef: this.superRef\n }, handler));\n }\n\n}\n\nexports.default = ReplaceSupers;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = simplifyAccess;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction simplifyAccess(path, bindingNames) {\n path.traverse(simpleAssignmentVisitor, {\n scope: path.scope,\n bindingNames,\n seen: new WeakSet()\n });\n}\n\nconst simpleAssignmentVisitor = {\n UpdateExpression: {\n exit(path) {\n const {\n scope,\n bindingNames\n } = this;\n const arg = path.get(\"argument\");\n if (!arg.isIdentifier()) return;\n const localName = arg.node.name;\n if (!bindingNames.has(localName)) return;\n\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n if (path.parentPath.isExpressionStatement() && !path.isCompletionRecord()) {\n const operator = path.node.operator == \"++\" ? \"+=\" : \"-=\";\n path.replaceWith(t.assignmentExpression(operator, arg.node, t.numericLiteral(1)));\n } else if (path.node.prefix) {\n path.replaceWith(t.assignmentExpression(\"=\", t.identifier(localName), t.binaryExpression(path.node.operator[0], t.unaryExpression(\"+\", arg.node), t.numericLiteral(1))));\n } else {\n const old = path.scope.generateUidIdentifierBasedOnNode(arg.node, \"old\");\n const varName = old.name;\n path.scope.push({\n id: old\n });\n const binary = t.binaryExpression(path.node.operator[0], t.identifier(varName), t.numericLiteral(1));\n path.replaceWith(t.sequenceExpression([t.assignmentExpression(\"=\", t.identifier(varName), t.unaryExpression(\"+\", arg.node)), t.assignmentExpression(\"=\", t.cloneNode(arg.node), binary), t.identifier(varName)]));\n }\n }\n\n },\n AssignmentExpression: {\n exit(path) {\n const {\n scope,\n seen,\n bindingNames\n } = this;\n if (path.node.operator === \"=\") return;\n if (seen.has(path.node)) return;\n seen.add(path.node);\n const left = path.get(\"left\");\n if (!left.isIdentifier()) return;\n const localName = left.node.name;\n if (!bindingNames.has(localName)) return;\n\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n path.node.right = t.binaryExpression(path.node.operator.slice(0, -1), t.cloneNode(path.node.left), path.node.right);\n path.node.operator = \"=\";\n }\n\n }\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = splitExportDeclaration;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction splitExportDeclaration(exportDeclaration) {\n if (!exportDeclaration.isExportDeclaration()) {\n throw new Error(\"Only export declarations can be split.\");\n }\n\n const isDefault = exportDeclaration.isExportDefaultDeclaration();\n const declaration = exportDeclaration.get(\"declaration\");\n const isClassDeclaration = declaration.isClassDeclaration();\n\n if (isDefault) {\n const standaloneDeclaration = declaration.isFunctionDeclaration() || isClassDeclaration;\n const scope = declaration.isScope() ? declaration.scope.parent : declaration.scope;\n let id = declaration.node.id;\n let needBindingRegistration = false;\n\n if (!id) {\n needBindingRegistration = true;\n id = scope.generateUidIdentifier(\"default\");\n\n if (standaloneDeclaration || declaration.isFunctionExpression() || declaration.isClassExpression()) {\n declaration.node.id = t.cloneNode(id);\n }\n }\n\n const updatedDeclaration = standaloneDeclaration ? declaration : t.variableDeclaration(\"var\", [t.variableDeclarator(t.cloneNode(id), declaration.node)]);\n const updatedExportDeclaration = t.exportNamedDeclaration(null, [t.exportSpecifier(t.cloneNode(id), t.identifier(\"default\"))]);\n exportDeclaration.insertAfter(updatedExportDeclaration);\n exportDeclaration.replaceWith(updatedDeclaration);\n\n if (needBindingRegistration) {\n scope.registerDeclaration(exportDeclaration);\n }\n\n return exportDeclaration;\n }\n\n if (exportDeclaration.get(\"specifiers\").length > 0) {\n throw new Error(\"It doesn't make sense to split exported specifiers.\");\n }\n\n const bindingIdentifiers = declaration.getOuterBindingIdentifiers();\n const specifiers = Object.keys(bindingIdentifiers).map(name => {\n return t.exportSpecifier(t.identifier(name), t.identifier(name));\n });\n const aliasDeclar = t.exportNamedDeclaration(null, specifiers);\n exportDeclaration.insertAfter(aliasDeclar);\n exportDeclaration.replaceWith(declaration.node);\n return exportDeclaration;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _template = _interopRequireDefault(require(\"@babel/template\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst helpers = Object.create(null);\nvar _default = helpers;\nexports.default = _default;\n\nconst helper = minVersion => tpl => ({\n minVersion,\n ast: () => _template.default.program.ast(tpl)\n});\n\nhelpers.typeof = helper(\"7.0.0-beta.0\")`\n export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) { return typeof obj; };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype\n ? \"symbol\"\n : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n`;\nhelpers.jsx = helper(\"7.0.0-beta.0\")`\n var REACT_ELEMENT_TYPE;\n\n export default function _createRawReactElement(type, props, key, children) {\n if (!REACT_ELEMENT_TYPE) {\n REACT_ELEMENT_TYPE = (\n typeof Symbol === \"function\" && Symbol[\"for\"] && Symbol[\"for\"](\"react.element\")\n ) || 0xeac7;\n }\n\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we're going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = {\n children: void 0,\n };\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = new Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : '' + key,\n ref: null,\n props: props,\n _owner: null,\n };\n }\n`;\nhelpers.asyncIterator = helper(\"7.0.0-beta.0\")`\n export default function _asyncIterator(iterable) {\n var method\n if (typeof Symbol !== \"undefined\") {\n if (Symbol.asyncIterator) {\n method = iterable[Symbol.asyncIterator]\n if (method != null) return method.call(iterable);\n }\n if (Symbol.iterator) {\n method = iterable[Symbol.iterator]\n if (method != null) return method.call(iterable);\n }\n }\n throw new TypeError(\"Object is not async iterable\");\n }\n`;\nhelpers.AwaitValue = helper(\"7.0.0-beta.0\")`\n export default function _AwaitValue(value) {\n this.wrapped = value;\n }\n`;\nhelpers.AsyncGenerator = helper(\"7.0.0-beta.0\")`\n import AwaitValue from \"AwaitValue\";\n\n export default function AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function (resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null,\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg)\n var value = result.value;\n var wrappedAwait = value instanceof AwaitValue;\n\n Promise.resolve(wrappedAwait ? value.wrapped : value).then(\n function (arg) {\n if (wrappedAwait) {\n resume(key === \"return\" ? \"return\" : \"next\", arg);\n return\n }\n\n settle(result.done ? \"return\" : \"normal\", arg);\n },\n function (err) { resume(\"throw\", err); });\n } catch (err) {\n settle(\"throw\", err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case \"return\":\n front.resolve({ value: value, done: true });\n break;\n case \"throw\":\n front.reject(value);\n break;\n default:\n front.resolve({ value: value, done: false });\n break;\n }\n\n front = front.next;\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n // Hide \"return\" method if generator return is not supported\n if (typeof gen.return !== \"function\") {\n this.return = undefined;\n }\n }\n\n if (typeof Symbol === \"function\" && Symbol.asyncIterator) {\n AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; };\n }\n\n AsyncGenerator.prototype.next = function (arg) { return this._invoke(\"next\", arg); };\n AsyncGenerator.prototype.throw = function (arg) { return this._invoke(\"throw\", arg); };\n AsyncGenerator.prototype.return = function (arg) { return this._invoke(\"return\", arg); };\n`;\nhelpers.wrapAsyncGenerator = helper(\"7.0.0-beta.0\")`\n import AsyncGenerator from \"AsyncGenerator\";\n\n export default function _wrapAsyncGenerator(fn) {\n return function () {\n return new AsyncGenerator(fn.apply(this, arguments));\n };\n }\n`;\nhelpers.awaitAsyncGenerator = helper(\"7.0.0-beta.0\")`\n import AwaitValue from \"AwaitValue\";\n\n export default function _awaitAsyncGenerator(value) {\n return new AwaitValue(value);\n }\n`;\nhelpers.asyncGeneratorDelegate = helper(\"7.0.0-beta.0\")`\n export default function _asyncGeneratorDelegate(inner, awaitWrap) {\n var iter = {}, waiting = false;\n\n function pump(key, value) {\n waiting = true;\n value = new Promise(function (resolve) { resolve(inner[key](value)); });\n return { done: false, value: awaitWrap(value) };\n };\n\n if (typeof Symbol === \"function\" && Symbol.iterator) {\n iter[Symbol.iterator] = function () { return this; };\n }\n\n iter.next = function (value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump(\"next\", value);\n };\n\n if (typeof inner.throw === \"function\") {\n iter.throw = function (value) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n return pump(\"throw\", value);\n };\n }\n\n if (typeof inner.return === \"function\") {\n iter.return = function (value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump(\"return\", value);\n };\n }\n\n return iter;\n }\n`;\nhelpers.asyncToGenerator = helper(\"7.0.0-beta.0\")`\n function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n }\n\n export default function _asyncToGenerator(fn) {\n return function () {\n var self = this, args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n }\n`;\nhelpers.classCallCheck = helper(\"7.0.0-beta.0\")`\n export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n`;\nhelpers.createClass = helper(\"7.0.0-beta.0\")`\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i ++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n export default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n`;\nhelpers.defineEnumerableProperties = helper(\"7.0.0-beta.0\")`\n export default function _defineEnumerableProperties(obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if (\"value\" in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n\n // Symbols are not enumerated over by for-in loops. If native\n // Symbols are available, fetch all of the descs object's own\n // symbol properties and define them on our target object too.\n if (Object.getOwnPropertySymbols) {\n var objectSymbols = Object.getOwnPropertySymbols(descs);\n for (var i = 0; i < objectSymbols.length; i++) {\n var sym = objectSymbols[i];\n var desc = descs[sym];\n desc.configurable = desc.enumerable = true;\n if (\"value\" in desc) desc.writable = true;\n Object.defineProperty(obj, sym, desc);\n }\n }\n return obj;\n }\n`;\nhelpers.defaults = helper(\"7.0.0-beta.0\")`\n export default function _defaults(obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n return obj;\n }\n`;\nhelpers.defineProperty = helper(\"7.0.0-beta.0\")`\n export default function _defineProperty(obj, key, value) {\n // Shortcircuit the slow defineProperty path when possible.\n // We are trying to avoid issues where setters defined on the\n // prototype cause side effects under the fast path of simple\n // assignment. By checking for existence of the property with\n // the in operator, we can optimize most of this overhead away.\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n }\n`;\nhelpers.extends = helper(\"7.0.0-beta.0\")`\n export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n\n return _extends.apply(this, arguments);\n }\n`;\nhelpers.objectSpread = helper(\"7.0.0-beta.0\")`\n import defineProperty from \"defineProperty\";\n\n export default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = (arguments[i] != null) ? Object(arguments[i]) : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n`;\nhelpers.objectSpread2 = helper(\"7.5.0\")`\n import defineProperty from \"defineProperty\";\n\n // This function is different to \"Reflect.ownKeys\". The enumerableOnly\n // filters on symbol properties only. Returned string properties are always\n // enumerable. It is good to use in objectSpread.\n\n function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n return keys;\n }\n\n export default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = (arguments[i] != null) ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(\n target,\n key,\n Object.getOwnPropertyDescriptor(source, key)\n );\n });\n }\n }\n return target;\n }\n`;\nhelpers.inherits = helper(\"7.0.0-beta.0\")`\n import setPrototypeOf from \"setPrototypeOf\";\n\n export default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n }\n`;\nhelpers.inheritsLoose = helper(\"7.0.0-beta.0\")`\n export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n }\n`;\nhelpers.getPrototypeOf = helper(\"7.0.0-beta.0\")`\n export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf\n ? Object.getPrototypeOf\n : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n`;\nhelpers.setPrototypeOf = helper(\"7.0.0-beta.0\")`\n export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n }\n`;\nhelpers.isNativeReflectConstruct = helper(\"7.9.0\")`\n export default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n\n // core-js@3\n if (Reflect.construct.sham) return false;\n\n // Proxy can't be polyfilled. Every browser implemented\n // proxies before or at the same time as Reflect.construct,\n // so if they support Proxy they also support Reflect.construct.\n if (typeof Proxy === \"function\") return true;\n\n // Since Reflect.construct can't be properly polyfilled, some\n // implementations (e.g. core-js@2) don't set the correct internal slots.\n // Those polyfills don't allow us to subclass built-ins, so we need to\n // use our fallback implementation.\n try {\n // If the internal slots aren't set, this throws an error similar to\n // TypeError: this is not a Date object.\n Date.prototype.toString.call(Reflect.construct(Date, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n }\n`;\nhelpers.construct = helper(\"7.0.0-beta.0\")`\n import setPrototypeOf from \"setPrototypeOf\";\n import isNativeReflectConstruct from \"isNativeReflectConstruct\";\n\n export default function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n // NOTE: If Parent !== Class, the correct __proto__ is set *after*\n // calling the constructor.\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n // Avoid issues with Class being present but undefined when it wasn't\n // present in the original call.\n return _construct.apply(null, arguments);\n }\n`;\nhelpers.isNativeFunction = helper(\"7.0.0-beta.0\")`\n export default function _isNativeFunction(fn) {\n // Note: This function returns \"true\" for core-js functions.\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n }\n`;\nhelpers.wrapNativeSuper = helper(\"7.0.0-beta.0\")`\n import getPrototypeOf from \"getPrototypeOf\";\n import setPrototypeOf from \"setPrototypeOf\";\n import isNativeFunction from \"isNativeFunction\";\n import construct from \"construct\";\n\n export default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor)\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true,\n }\n });\n\n return setPrototypeOf(Wrapper, Class);\n }\n\n return _wrapNativeSuper(Class)\n }\n`;\nhelpers.instanceof = helper(\"7.0.0-beta.0\")`\n export default function _instanceof(left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return !!right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n }\n`;\nhelpers.interopRequireDefault = helper(\"7.0.0-beta.0\")`\n export default function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n }\n`;\nhelpers.interopRequireWildcard = helper(\"7.0.0-beta.0\")`\n function _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n\n var cache = new WeakMap();\n _getRequireWildcardCache = function () { return cache; };\n return cache;\n }\n\n export default function _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || (typeof obj !== \"object\" && typeof obj !== \"function\")) {\n return { default: obj }\n }\n\n var cache = _getRequireWildcardCache();\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor\n ? Object.getOwnPropertyDescriptor(obj, key)\n : null;\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n newObj.default = obj;\n if (cache) {\n cache.set(obj, newObj);\n }\n return newObj;\n }\n`;\nhelpers.newArrowCheck = helper(\"7.0.0-beta.0\")`\n export default function _newArrowCheck(innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError(\"Cannot instantiate an arrow function\");\n }\n }\n`;\nhelpers.objectDestructuringEmpty = helper(\"7.0.0-beta.0\")`\n export default function _objectDestructuringEmpty(obj) {\n if (obj == null) throw new TypeError(\"Cannot destructure undefined\");\n }\n`;\nhelpers.objectWithoutPropertiesLoose = helper(\"7.0.0-beta.0\")`\n export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n }\n`;\nhelpers.objectWithoutProperties = helper(\"7.0.0-beta.0\")`\n import objectWithoutPropertiesLoose from \"objectWithoutPropertiesLoose\";\n\n export default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n }\n`;\nhelpers.assertThisInitialized = helper(\"7.0.0-beta.0\")`\n export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n }\n`;\nhelpers.possibleConstructorReturn = helper(\"7.0.0-beta.0\")`\n import assertThisInitialized from \"assertThisInitialized\";\n\n export default function _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n }\n return assertThisInitialized(self);\n }\n`;\nhelpers.createSuper = helper(\"7.9.0\")`\n import getPrototypeOf from \"getPrototypeOf\";\n import isNativeReflectConstruct from \"isNativeReflectConstruct\";\n import possibleConstructorReturn from \"possibleConstructorReturn\";\n\n export default function _createSuper(Derived) {\n var hasNativeReflectConstruct = isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = getPrototypeOf(Derived), result;\n if (hasNativeReflectConstruct) {\n // NOTE: This doesn't work if this.__proto__.constructor has been modified.\n var NewTarget = getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n return possibleConstructorReturn(this, result);\n }\n }\n `;\nhelpers.superPropBase = helper(\"7.0.0-beta.0\")`\n import getPrototypeOf from \"getPrototypeOf\";\n\n export default function _superPropBase(object, property) {\n // Yes, this throws if object is null to being with, that's on purpose.\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n return object;\n }\n`;\nhelpers.get = helper(\"7.0.0-beta.0\")`\n import superPropBase from \"superPropBase\";\n\n export default function _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n\n if (!base) return;\n\n var desc = Object.getOwnPropertyDescriptor(base, property);\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n return _get(target, property, receiver || target);\n }\n`;\nhelpers.set = helper(\"7.0.0-beta.0\")`\n import superPropBase from \"superPropBase\";\n import defineProperty from \"defineProperty\";\n\n function set(target, property, value, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.set) {\n set = Reflect.set;\n } else {\n set = function set(target, property, value, receiver) {\n var base = superPropBase(target, property);\n var desc;\n\n if (base) {\n desc = Object.getOwnPropertyDescriptor(base, property);\n if (desc.set) {\n desc.set.call(receiver, value);\n return true;\n } else if (!desc.writable) {\n // Both getter and non-writable fall into this.\n return false;\n }\n }\n\n // Without a super that defines the property, spec boils down to\n // \"define on receiver\" for some reason.\n desc = Object.getOwnPropertyDescriptor(receiver, property);\n if (desc) {\n if (!desc.writable) {\n // Setter, getter, and non-writable fall into this.\n return false;\n }\n\n desc.value = value;\n Object.defineProperty(receiver, property, desc);\n } else {\n // Avoid setters that may be defined on Sub's prototype, but not on\n // the instance.\n defineProperty(receiver, property, value);\n }\n\n return true;\n };\n }\n\n return set(target, property, value, receiver);\n }\n\n export default function _set(target, property, value, receiver, isStrict) {\n var s = set(target, property, value, receiver || target);\n if (!s && isStrict) {\n throw new Error('failed to set property');\n }\n\n return value;\n }\n`;\nhelpers.taggedTemplateLiteral = helper(\"7.0.0-beta.0\")`\n export default function _taggedTemplateLiteral(strings, raw) {\n if (!raw) { raw = strings.slice(0); }\n return Object.freeze(Object.defineProperties(strings, {\n raw: { value: Object.freeze(raw) }\n }));\n }\n`;\nhelpers.taggedTemplateLiteralLoose = helper(\"7.0.0-beta.0\")`\n export default function _taggedTemplateLiteralLoose(strings, raw) {\n if (!raw) { raw = strings.slice(0); }\n strings.raw = raw;\n return strings;\n }\n`;\nhelpers.readOnlyError = helper(\"7.0.0-beta.0\")`\n export default function _readOnlyError(name) {\n throw new TypeError(\"\\\\\"\" + name + \"\\\\\" is read-only\");\n }\n`;\nhelpers.classNameTDZError = helper(\"7.0.0-beta.0\")`\n export default function _classNameTDZError(name) {\n throw new Error(\"Class \\\\\"\" + name + \"\\\\\" cannot be referenced in computed property keys.\");\n }\n`;\nhelpers.temporalUndefined = helper(\"7.0.0-beta.0\")`\n // This function isn't mean to be called, but to be used as a reference.\n // We can't use a normal object because it isn't hoisted.\n export default function _temporalUndefined() {}\n`;\nhelpers.tdz = helper(\"7.5.5\")`\n export default function _tdzError(name) {\n throw new ReferenceError(name + \" is not defined - temporal dead zone\");\n }\n`;\nhelpers.temporalRef = helper(\"7.0.0-beta.0\")`\n import undef from \"temporalUndefined\";\n import err from \"tdz\";\n\n export default function _temporalRef(val, name) {\n return val === undef ? err(name) : val;\n }\n`;\nhelpers.slicedToArray = helper(\"7.0.0-beta.0\")`\n import arrayWithHoles from \"arrayWithHoles\";\n import iterableToArrayLimit from \"iterableToArrayLimit\";\n import unsupportedIterableToArray from \"unsupportedIterableToArray\";\n import nonIterableRest from \"nonIterableRest\";\n\n export default function _slicedToArray(arr, i) {\n return (\n arrayWithHoles(arr) ||\n iterableToArrayLimit(arr, i) ||\n unsupportedIterableToArray(arr, i) ||\n nonIterableRest()\n );\n }\n`;\nhelpers.slicedToArrayLoose = helper(\"7.0.0-beta.0\")`\n import arrayWithHoles from \"arrayWithHoles\";\n import iterableToArrayLimitLoose from \"iterableToArrayLimitLoose\";\n import unsupportedIterableToArray from \"unsupportedIterableToArray\";\n import nonIterableRest from \"nonIterableRest\";\n\n export default function _slicedToArrayLoose(arr, i) {\n return (\n arrayWithHoles(arr) ||\n iterableToArrayLimitLoose(arr, i) ||\n unsupportedIterableToArray(arr, i) ||\n nonIterableRest()\n );\n }\n`;\nhelpers.toArray = helper(\"7.0.0-beta.0\")`\n import arrayWithHoles from \"arrayWithHoles\";\n import iterableToArray from \"iterableToArray\";\n import unsupportedIterableToArray from \"unsupportedIterableToArray\";\n import nonIterableRest from \"nonIterableRest\";\n\n export default function _toArray(arr) {\n return (\n arrayWithHoles(arr) ||\n iterableToArray(arr) ||\n unsupportedIterableToArray(arr) ||\n nonIterableRest()\n );\n }\n`;\nhelpers.toConsumableArray = helper(\"7.0.0-beta.0\")`\n import arrayWithoutHoles from \"arrayWithoutHoles\";\n import iterableToArray from \"iterableToArray\";\n import unsupportedIterableToArray from \"unsupportedIterableToArray\";\n import nonIterableSpread from \"nonIterableSpread\";\n\n export default function _toConsumableArray(arr) {\n return (\n arrayWithoutHoles(arr) ||\n iterableToArray(arr) ||\n unsupportedIterableToArray(arr) ||\n nonIterableSpread()\n );\n }\n`;\nhelpers.arrayWithoutHoles = helper(\"7.0.0-beta.0\")`\n import arrayLikeToArray from \"arrayLikeToArray\";\n\n export default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n }\n`;\nhelpers.arrayWithHoles = helper(\"7.0.0-beta.0\")`\n export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n }\n`;\nhelpers.maybeArrayLike = helper(\"7.9.0\")`\n import arrayLikeToArray from \"arrayLikeToArray\";\n\n export default function _maybeArrayLike(next, arr, i) {\n if (arr && !Array.isArray(arr) && typeof arr.length === \"number\") {\n var len = arr.length;\n return arrayLikeToArray(arr, i !== void 0 && i < len ? i : len);\n }\n return next(arr, i);\n }\n`;\nhelpers.iterableToArray = helper(\"7.0.0-beta.0\")`\n export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n }\n`;\nhelpers.iterableToArrayLimit = helper(\"7.0.0-beta.0\")`\n export default function _iterableToArrayLimit(arr, i) {\n // this is an expanded form of \\`for...of\\` that properly supports abrupt completions of\n // iterators etc. variable names have been minimised to reduce the size of this massive\n // helper. sometimes spec compliance is annoying :(\n //\n // _n = _iteratorNormalCompletion\n // _d = _didIteratorError\n // _e = _iteratorError\n // _i = _iterator\n // _s = _step\n\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n`;\nhelpers.iterableToArrayLimitLoose = helper(\"7.0.0-beta.0\")`\n export default function _iterableToArrayLimitLoose(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n\n var _arr = [];\n for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {\n _arr.push(_step.value);\n if (i && _arr.length === i) break;\n }\n return _arr;\n }\n`;\nhelpers.unsupportedIterableToArray = helper(\"7.9.0\")`\n import arrayLikeToArray from \"arrayLikeToArray\";\n\n export default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))\n return arrayLikeToArray(o, minLen);\n }\n`;\nhelpers.arrayLikeToArray = helper(\"7.9.0\")`\n export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n }\n`;\nhelpers.nonIterableSpread = helper(\"7.0.0-beta.0\")`\n export default function _nonIterableSpread() {\n throw new TypeError(\n \"Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"\n );\n }\n`;\nhelpers.nonIterableRest = helper(\"7.0.0-beta.0\")`\n export default function _nonIterableRest() {\n throw new TypeError(\n \"Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"\n );\n }\n`;\nhelpers.createForOfIteratorHelper = helper(\"7.9.0\")`\n import unsupportedIterableToArray from \"unsupportedIterableToArray\";\n\n // s: start (create the iterator)\n // n: next\n // e: error (called whenever something throws)\n // f: finish (always called at the end)\n\n export default function _createForOfIteratorHelper(o, allowArrayLike) {\n var it;\n if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) {\n // Fallback for engines without symbol support\n if (\n Array.isArray(o) ||\n (it = unsupportedIterableToArray(o)) ||\n (allowArrayLike && o && typeof o.length === \"number\")\n ) {\n if (it) o = it;\n var i = 0;\n var F = function(){};\n return {\n s: F,\n n: function() {\n if (i >= o.length) return { done: true };\n return { done: false, value: o[i++] };\n },\n e: function(e) { throw e; },\n f: F,\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n var normalCompletion = true, didErr = false, err;\n\n return {\n s: function() {\n it = o[Symbol.iterator]();\n },\n n: function() {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function(e) {\n didErr = true;\n err = e;\n },\n f: function() {\n try {\n if (!normalCompletion && it.return != null) it.return();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n }\n`;\nhelpers.createForOfIteratorHelperLoose = helper(\"7.9.0\")`\n import unsupportedIterableToArray from \"unsupportedIterableToArray\";\n\n export default function _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it;\n\n if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) {\n // Fallback for engines without symbol support\n if (\n Array.isArray(o) ||\n (it = unsupportedIterableToArray(o)) ||\n (allowArrayLike && o && typeof o.length === \"number\")\n ) {\n if (it) o = it;\n var i = 0;\n return function() {\n if (i >= o.length) return { done: true };\n return { done: false, value: o[i++] };\n }\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n it = o[Symbol.iterator]();\n return it.next.bind(it);\n }\n`;\nhelpers.skipFirstGeneratorNext = helper(\"7.0.0-beta.0\")`\n export default function _skipFirstGeneratorNext(fn) {\n return function () {\n var it = fn.apply(this, arguments);\n it.next();\n return it;\n }\n }\n`;\nhelpers.toPrimitive = helper(\"7.1.5\")`\n export default function _toPrimitive(\n input,\n hint /*: \"default\" | \"string\" | \"number\" | void */\n ) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n }\n`;\nhelpers.toPropertyKey = helper(\"7.1.5\")`\n import toPrimitive from \"toPrimitive\";\n\n export default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n }\n`;\nhelpers.initializerWarningHelper = helper(\"7.0.0-beta.0\")`\n export default function _initializerWarningHelper(descriptor, context){\n throw new Error(\n 'Decorating class property failed. Please ensure that ' +\n 'proposal-class-properties is enabled and runs after the decorators transform.'\n );\n }\n`;\nhelpers.initializerDefineProperty = helper(\"7.0.0-beta.0\")`\n export default function _initializerDefineProperty(target, property, descriptor, context){\n if (!descriptor) return;\n\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0,\n });\n }\n`;\nhelpers.applyDecoratedDescriptor = helper(\"7.0.0-beta.0\")`\n export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context){\n var desc = {};\n Object.keys(descriptor).forEach(function(key){\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if ('value' in desc || desc.initializer){\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function(desc, decorator){\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0){\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0){\n Object.defineProperty(target, property, desc);\n desc = null;\n }\n\n return desc;\n }\n`;\nhelpers.classPrivateFieldLooseKey = helper(\"7.0.0-beta.0\")`\n var id = 0;\n export default function _classPrivateFieldKey(name) {\n return \"__private_\" + (id++) + \"_\" + name;\n }\n`;\nhelpers.classPrivateFieldLooseBase = helper(\"7.0.0-beta.0\")`\n export default function _classPrivateFieldBase(receiver, privateKey) {\n if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {\n throw new TypeError(\"attempted to use private field on non-instance\");\n }\n return receiver;\n }\n`;\nhelpers.classPrivateFieldGet = helper(\"7.0.0-beta.0\")`\n export default function _classPrivateFieldGet(receiver, privateMap) {\n var descriptor = privateMap.get(receiver);\n if (!descriptor) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n return descriptor.value;\n }\n`;\nhelpers.classPrivateFieldSet = helper(\"7.0.0-beta.0\")`\n export default function _classPrivateFieldSet(receiver, privateMap, value) {\n var descriptor = privateMap.get(receiver);\n if (!descriptor) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n if (descriptor.set) {\n descriptor.set.call(receiver, value);\n } else {\n if (!descriptor.writable) {\n // This should only throw in strict mode, but class bodies are\n // always strict and private fields can only be used inside\n // class bodies.\n throw new TypeError(\"attempted to set read only private field\");\n }\n\n descriptor.value = value;\n }\n\n return value;\n }\n`;\nhelpers.classPrivateFieldDestructureSet = helper(\"7.4.4\")`\n export default function _classPrivateFieldDestructureSet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n var descriptor = privateMap.get(receiver);\n if (descriptor.set) {\n if (!(\"__destrObj\" in descriptor)) {\n descriptor.__destrObj = {\n set value(v) {\n descriptor.set.call(receiver, v)\n },\n };\n }\n return descriptor.__destrObj;\n } else {\n if (!descriptor.writable) {\n // This should only throw in strict mode, but class bodies are\n // always strict and private fields can only be used inside\n // class bodies.\n throw new TypeError(\"attempted to set read only private field\");\n }\n\n return descriptor;\n }\n }\n`;\nhelpers.classStaticPrivateFieldSpecGet = helper(\"7.0.2\")`\n export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {\n if (receiver !== classConstructor) {\n throw new TypeError(\"Private static access of wrong provenance\");\n }\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n return descriptor.value;\n }\n`;\nhelpers.classStaticPrivateFieldSpecSet = helper(\"7.0.2\")`\n export default function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {\n if (receiver !== classConstructor) {\n throw new TypeError(\"Private static access of wrong provenance\");\n }\n if (descriptor.set) {\n descriptor.set.call(receiver, value);\n } else {\n if (!descriptor.writable) {\n // This should only throw in strict mode, but class bodies are\n // always strict and private fields can only be used inside\n // class bodies.\n throw new TypeError(\"attempted to set read only private field\");\n }\n descriptor.value = value;\n }\n\n return value;\n }\n`;\nhelpers.classStaticPrivateMethodGet = helper(\"7.3.2\")`\n export default function _classStaticPrivateMethodGet(receiver, classConstructor, method) {\n if (receiver !== classConstructor) {\n throw new TypeError(\"Private static access of wrong provenance\");\n }\n return method;\n }\n`;\nhelpers.classStaticPrivateMethodSet = helper(\"7.3.2\")`\n export default function _classStaticPrivateMethodSet() {\n throw new TypeError(\"attempted to set read only static private field\");\n }\n`;\nhelpers.decorate = helper(\"7.1.5\")`\n import toArray from \"toArray\";\n import toPropertyKey from \"toPropertyKey\";\n\n // These comments are stripped by @babel/template\n /*::\n type PropertyDescriptor =\n | {\n value: any,\n writable: boolean,\n configurable: boolean,\n enumerable: boolean,\n }\n | {\n get?: () => any,\n set?: (v: any) => void,\n configurable: boolean,\n enumerable: boolean,\n };\n\n type FieldDescriptor ={\n writable: boolean,\n configurable: boolean,\n enumerable: boolean,\n };\n\n type Placement = \"static\" | \"prototype\" | \"own\";\n type Key = string | symbol; // PrivateName is not supported yet.\n\n type ElementDescriptor =\n | {\n kind: \"method\",\n key: Key,\n placement: Placement,\n descriptor: PropertyDescriptor\n }\n | {\n kind: \"field\",\n key: Key,\n placement: Placement,\n descriptor: FieldDescriptor,\n initializer?: () => any,\n };\n\n // This is exposed to the user code\n type ElementObjectInput = ElementDescriptor & {\n [@@toStringTag]?: \"Descriptor\"\n };\n\n // This is exposed to the user code\n type ElementObjectOutput = ElementDescriptor & {\n [@@toStringTag]?: \"Descriptor\"\n extras?: ElementDescriptor[],\n finisher?: ClassFinisher,\n };\n\n // This is exposed to the user code\n type ClassObject = {\n [@@toStringTag]?: \"Descriptor\",\n kind: \"class\",\n elements: ElementDescriptor[],\n };\n\n type ElementDecorator = (descriptor: ElementObjectInput) => ?ElementObjectOutput;\n type ClassDecorator = (descriptor: ClassObject) => ?ClassObject;\n type ClassFinisher = (cl: Class) => Class;\n\n // Only used by Babel in the transform output, not part of the spec.\n type ElementDefinition =\n | {\n kind: \"method\",\n value: any,\n key: Key,\n static?: boolean,\n decorators?: ElementDecorator[],\n }\n | {\n kind: \"field\",\n value: () => any,\n key: Key,\n static?: boolean,\n decorators?: ElementDecorator[],\n };\n\n declare function ClassFactory(initialize: (instance: C) => void): {\n F: Class,\n d: ElementDefinition[]\n }\n\n */\n\n /*::\n // Various combinations with/without extras and with one or many finishers\n\n type ElementFinisherExtras = {\n element: ElementDescriptor,\n finisher?: ClassFinisher,\n extras?: ElementDescriptor[],\n };\n\n type ElementFinishersExtras = {\n element: ElementDescriptor,\n finishers: ClassFinisher[],\n extras: ElementDescriptor[],\n };\n\n type ElementsFinisher = {\n elements: ElementDescriptor[],\n finisher?: ClassFinisher,\n };\n\n type ElementsFinishers = {\n elements: ElementDescriptor[],\n finishers: ClassFinisher[],\n };\n\n */\n\n /*::\n\n type Placements = {\n static: Key[],\n prototype: Key[],\n own: Key[],\n };\n\n */\n\n // ClassDefinitionEvaluation (Steps 26-*)\n export default function _decorate(\n decorators /*: ClassDecorator[] */,\n factory /*: ClassFactory */,\n superClass /*: ?Class<*> */,\n mixins /*: ?Array */,\n ) /*: Class<*> */ {\n var api = _getDecoratorsApi();\n if (mixins) {\n for (var i = 0; i < mixins.length; i++) {\n api = mixins[i](api);\n }\n }\n\n var r = factory(function initialize(O) {\n api.initializeInstanceElements(O, decorated.elements);\n }, superClass);\n var decorated = api.decorateClass(\n _coalesceClassElements(r.d.map(_createElementDescriptor)),\n decorators,\n );\n\n api.initializeClassElements(r.F, decorated.elements);\n\n return api.runClassFinishers(r.F, decorated.finishers);\n }\n\n function _getDecoratorsApi() {\n _getDecoratorsApi = function() {\n return api;\n };\n\n var api = {\n elementsDefinitionOrder: [[\"method\"], [\"field\"]],\n\n // InitializeInstanceElements\n initializeInstanceElements: function(\n /*::*/ O /*: C */,\n elements /*: ElementDescriptor[] */,\n ) {\n [\"method\", \"field\"].forEach(function(kind) {\n elements.forEach(function(element /*: ElementDescriptor */) {\n if (element.kind === kind && element.placement === \"own\") {\n this.defineClassElement(O, element);\n }\n }, this);\n }, this);\n },\n\n // InitializeClassElements\n initializeClassElements: function(\n /*::*/ F /*: Class */,\n elements /*: ElementDescriptor[] */,\n ) {\n var proto = F.prototype;\n\n [\"method\", \"field\"].forEach(function(kind) {\n elements.forEach(function(element /*: ElementDescriptor */) {\n var placement = element.placement;\n if (\n element.kind === kind &&\n (placement === \"static\" || placement === \"prototype\")\n ) {\n var receiver = placement === \"static\" ? F : proto;\n this.defineClassElement(receiver, element);\n }\n }, this);\n }, this);\n },\n\n // DefineClassElement\n defineClassElement: function(\n /*::*/ receiver /*: C | Class */,\n element /*: ElementDescriptor */,\n ) {\n var descriptor /*: PropertyDescriptor */ = element.descriptor;\n if (element.kind === \"field\") {\n var initializer = element.initializer;\n descriptor = {\n enumerable: descriptor.enumerable,\n writable: descriptor.writable,\n configurable: descriptor.configurable,\n value: initializer === void 0 ? void 0 : initializer.call(receiver),\n };\n }\n Object.defineProperty(receiver, element.key, descriptor);\n },\n\n // DecorateClass\n decorateClass: function(\n elements /*: ElementDescriptor[] */,\n decorators /*: ClassDecorator[] */,\n ) /*: ElementsFinishers */ {\n var newElements /*: ElementDescriptor[] */ = [];\n var finishers /*: ClassFinisher[] */ = [];\n var placements /*: Placements */ = {\n static: [],\n prototype: [],\n own: [],\n };\n\n elements.forEach(function(element /*: ElementDescriptor */) {\n this.addElementPlacement(element, placements);\n }, this);\n\n elements.forEach(function(element /*: ElementDescriptor */) {\n if (!_hasDecorators(element)) return newElements.push(element);\n\n var elementFinishersExtras /*: ElementFinishersExtras */ = this.decorateElement(\n element,\n placements,\n );\n newElements.push(elementFinishersExtras.element);\n newElements.push.apply(newElements, elementFinishersExtras.extras);\n finishers.push.apply(finishers, elementFinishersExtras.finishers);\n }, this);\n\n if (!decorators) {\n return { elements: newElements, finishers: finishers };\n }\n\n var result /*: ElementsFinishers */ = this.decorateConstructor(\n newElements,\n decorators,\n );\n finishers.push.apply(finishers, result.finishers);\n result.finishers = finishers;\n\n return result;\n },\n\n // AddElementPlacement\n addElementPlacement: function(\n element /*: ElementDescriptor */,\n placements /*: Placements */,\n silent /*: boolean */,\n ) {\n var keys = placements[element.placement];\n if (!silent && keys.indexOf(element.key) !== -1) {\n throw new TypeError(\"Duplicated element (\" + element.key + \")\");\n }\n keys.push(element.key);\n },\n\n // DecorateElement\n decorateElement: function(\n element /*: ElementDescriptor */,\n placements /*: Placements */,\n ) /*: ElementFinishersExtras */ {\n var extras /*: ElementDescriptor[] */ = [];\n var finishers /*: ClassFinisher[] */ = [];\n\n for (\n var decorators = element.decorators, i = decorators.length - 1;\n i >= 0;\n i--\n ) {\n // (inlined) RemoveElementPlacement\n var keys = placements[element.placement];\n keys.splice(keys.indexOf(element.key), 1);\n\n var elementObject /*: ElementObjectInput */ = this.fromElementDescriptor(\n element,\n );\n var elementFinisherExtras /*: ElementFinisherExtras */ = this.toElementFinisherExtras(\n (0, decorators[i])(elementObject) /*: ElementObjectOutput */ ||\n elementObject,\n );\n\n element = elementFinisherExtras.element;\n this.addElementPlacement(element, placements);\n\n if (elementFinisherExtras.finisher) {\n finishers.push(elementFinisherExtras.finisher);\n }\n\n var newExtras /*: ElementDescriptor[] | void */ =\n elementFinisherExtras.extras;\n if (newExtras) {\n for (var j = 0; j < newExtras.length; j++) {\n this.addElementPlacement(newExtras[j], placements);\n }\n extras.push.apply(extras, newExtras);\n }\n }\n\n return { element: element, finishers: finishers, extras: extras };\n },\n\n // DecorateConstructor\n decorateConstructor: function(\n elements /*: ElementDescriptor[] */,\n decorators /*: ClassDecorator[] */,\n ) /*: ElementsFinishers */ {\n var finishers /*: ClassFinisher[] */ = [];\n\n for (var i = decorators.length - 1; i >= 0; i--) {\n var obj /*: ClassObject */ = this.fromClassDescriptor(elements);\n var elementsAndFinisher /*: ElementsFinisher */ = this.toClassDescriptor(\n (0, decorators[i])(obj) /*: ClassObject */ || obj,\n );\n\n if (elementsAndFinisher.finisher !== undefined) {\n finishers.push(elementsAndFinisher.finisher);\n }\n\n if (elementsAndFinisher.elements !== undefined) {\n elements = elementsAndFinisher.elements;\n\n for (var j = 0; j < elements.length - 1; j++) {\n for (var k = j + 1; k < elements.length; k++) {\n if (\n elements[j].key === elements[k].key &&\n elements[j].placement === elements[k].placement\n ) {\n throw new TypeError(\n \"Duplicated element (\" + elements[j].key + \")\",\n );\n }\n }\n }\n }\n }\n\n return { elements: elements, finishers: finishers };\n },\n\n // FromElementDescriptor\n fromElementDescriptor: function(\n element /*: ElementDescriptor */,\n ) /*: ElementObject */ {\n var obj /*: ElementObject */ = {\n kind: element.kind,\n key: element.key,\n placement: element.placement,\n descriptor: element.descriptor,\n };\n\n var desc = {\n value: \"Descriptor\",\n configurable: true,\n };\n Object.defineProperty(obj, Symbol.toStringTag, desc);\n\n if (element.kind === \"field\") obj.initializer = element.initializer;\n\n return obj;\n },\n\n // ToElementDescriptors\n toElementDescriptors: function(\n elementObjects /*: ElementObject[] */,\n ) /*: ElementDescriptor[] */ {\n if (elementObjects === undefined) return;\n return toArray(elementObjects).map(function(elementObject) {\n var element = this.toElementDescriptor(elementObject);\n this.disallowProperty(elementObject, \"finisher\", \"An element descriptor\");\n this.disallowProperty(elementObject, \"extras\", \"An element descriptor\");\n return element;\n }, this);\n },\n\n // ToElementDescriptor\n toElementDescriptor: function(\n elementObject /*: ElementObject */,\n ) /*: ElementDescriptor */ {\n var kind = String(elementObject.kind);\n if (kind !== \"method\" && kind !== \"field\") {\n throw new TypeError(\n 'An element descriptor\\\\'s .kind property must be either \"method\" or' +\n ' \"field\", but a decorator created an element descriptor with' +\n ' .kind \"' +\n kind +\n '\"',\n );\n }\n\n var key = toPropertyKey(elementObject.key);\n\n var placement = String(elementObject.placement);\n if (\n placement !== \"static\" &&\n placement !== \"prototype\" &&\n placement !== \"own\"\n ) {\n throw new TypeError(\n 'An element descriptor\\\\'s .placement property must be one of \"static\",' +\n ' \"prototype\" or \"own\", but a decorator created an element descriptor' +\n ' with .placement \"' +\n placement +\n '\"',\n );\n }\n\n var descriptor /*: PropertyDescriptor */ = elementObject.descriptor;\n\n this.disallowProperty(elementObject, \"elements\", \"An element descriptor\");\n\n var element /*: ElementDescriptor */ = {\n kind: kind,\n key: key,\n placement: placement,\n descriptor: Object.assign({}, descriptor),\n };\n\n if (kind !== \"field\") {\n this.disallowProperty(elementObject, \"initializer\", \"A method descriptor\");\n } else {\n this.disallowProperty(\n descriptor,\n \"get\",\n \"The property descriptor of a field descriptor\",\n );\n this.disallowProperty(\n descriptor,\n \"set\",\n \"The property descriptor of a field descriptor\",\n );\n this.disallowProperty(\n descriptor,\n \"value\",\n \"The property descriptor of a field descriptor\",\n );\n\n element.initializer = elementObject.initializer;\n }\n\n return element;\n },\n\n toElementFinisherExtras: function(\n elementObject /*: ElementObject */,\n ) /*: ElementFinisherExtras */ {\n var element /*: ElementDescriptor */ = this.toElementDescriptor(\n elementObject,\n );\n var finisher /*: ClassFinisher */ = _optionalCallableProperty(\n elementObject,\n \"finisher\",\n );\n var extras /*: ElementDescriptors[] */ = this.toElementDescriptors(\n elementObject.extras,\n );\n\n return { element: element, finisher: finisher, extras: extras };\n },\n\n // FromClassDescriptor\n fromClassDescriptor: function(\n elements /*: ElementDescriptor[] */,\n ) /*: ClassObject */ {\n var obj = {\n kind: \"class\",\n elements: elements.map(this.fromElementDescriptor, this),\n };\n\n var desc = { value: \"Descriptor\", configurable: true };\n Object.defineProperty(obj, Symbol.toStringTag, desc);\n\n return obj;\n },\n\n // ToClassDescriptor\n toClassDescriptor: function(\n obj /*: ClassObject */,\n ) /*: ElementsFinisher */ {\n var kind = String(obj.kind);\n if (kind !== \"class\") {\n throw new TypeError(\n 'A class descriptor\\\\'s .kind property must be \"class\", but a decorator' +\n ' created a class descriptor with .kind \"' +\n kind +\n '\"',\n );\n }\n\n this.disallowProperty(obj, \"key\", \"A class descriptor\");\n this.disallowProperty(obj, \"placement\", \"A class descriptor\");\n this.disallowProperty(obj, \"descriptor\", \"A class descriptor\");\n this.disallowProperty(obj, \"initializer\", \"A class descriptor\");\n this.disallowProperty(obj, \"extras\", \"A class descriptor\");\n\n var finisher = _optionalCallableProperty(obj, \"finisher\");\n var elements = this.toElementDescriptors(obj.elements);\n\n return { elements: elements, finisher: finisher };\n },\n\n // RunClassFinishers\n runClassFinishers: function(\n constructor /*: Class<*> */,\n finishers /*: ClassFinisher[] */,\n ) /*: Class<*> */ {\n for (var i = 0; i < finishers.length; i++) {\n var newConstructor /*: ?Class<*> */ = (0, finishers[i])(constructor);\n if (newConstructor !== undefined) {\n // NOTE: This should check if IsConstructor(newConstructor) is false.\n if (typeof newConstructor !== \"function\") {\n throw new TypeError(\"Finishers must return a constructor.\");\n }\n constructor = newConstructor;\n }\n }\n return constructor;\n },\n\n disallowProperty: function(obj, name, objectType) {\n if (obj[name] !== undefined) {\n throw new TypeError(objectType + \" can't have a .\" + name + \" property.\");\n }\n }\n };\n\n return api;\n }\n\n // ClassElementEvaluation\n function _createElementDescriptor(\n def /*: ElementDefinition */,\n ) /*: ElementDescriptor */ {\n var key = toPropertyKey(def.key);\n\n var descriptor /*: PropertyDescriptor */;\n if (def.kind === \"method\") {\n descriptor = {\n value: def.value,\n writable: true,\n configurable: true,\n enumerable: false,\n };\n } else if (def.kind === \"get\") {\n descriptor = { get: def.value, configurable: true, enumerable: false };\n } else if (def.kind === \"set\") {\n descriptor = { set: def.value, configurable: true, enumerable: false };\n } else if (def.kind === \"field\") {\n descriptor = { configurable: true, writable: true, enumerable: true };\n }\n\n var element /*: ElementDescriptor */ = {\n kind: def.kind === \"field\" ? \"field\" : \"method\",\n key: key,\n placement: def.static\n ? \"static\"\n : def.kind === \"field\"\n ? \"own\"\n : \"prototype\",\n descriptor: descriptor,\n };\n if (def.decorators) element.decorators = def.decorators;\n if (def.kind === \"field\") element.initializer = def.value;\n\n return element;\n }\n\n // CoalesceGetterSetter\n function _coalesceGetterSetter(\n element /*: ElementDescriptor */,\n other /*: ElementDescriptor */,\n ) {\n if (element.descriptor.get !== undefined) {\n other.descriptor.get = element.descriptor.get;\n } else {\n other.descriptor.set = element.descriptor.set;\n }\n }\n\n // CoalesceClassElements\n function _coalesceClassElements(\n elements /*: ElementDescriptor[] */,\n ) /*: ElementDescriptor[] */ {\n var newElements /*: ElementDescriptor[] */ = [];\n\n var isSameElement = function(\n other /*: ElementDescriptor */,\n ) /*: boolean */ {\n return (\n other.kind === \"method\" &&\n other.key === element.key &&\n other.placement === element.placement\n );\n };\n\n for (var i = 0; i < elements.length; i++) {\n var element /*: ElementDescriptor */ = elements[i];\n var other /*: ElementDescriptor */;\n\n if (\n element.kind === \"method\" &&\n (other = newElements.find(isSameElement))\n ) {\n if (\n _isDataDescriptor(element.descriptor) ||\n _isDataDescriptor(other.descriptor)\n ) {\n if (_hasDecorators(element) || _hasDecorators(other)) {\n throw new ReferenceError(\n \"Duplicated methods (\" + element.key + \") can't be decorated.\",\n );\n }\n other.descriptor = element.descriptor;\n } else {\n if (_hasDecorators(element)) {\n if (_hasDecorators(other)) {\n throw new ReferenceError(\n \"Decorators can't be placed on different accessors with for \" +\n \"the same property (\" +\n element.key +\n \").\",\n );\n }\n other.decorators = element.decorators;\n }\n _coalesceGetterSetter(element, other);\n }\n } else {\n newElements.push(element);\n }\n }\n\n return newElements;\n }\n\n function _hasDecorators(element /*: ElementDescriptor */) /*: boolean */ {\n return element.decorators && element.decorators.length;\n }\n\n function _isDataDescriptor(desc /*: PropertyDescriptor */) /*: boolean */ {\n return (\n desc !== undefined &&\n !(desc.value === undefined && desc.writable === undefined)\n );\n }\n\n function _optionalCallableProperty /*::*/(\n obj /*: T */,\n name /*: $Keys */,\n ) /*: ?Function */ {\n var value = obj[name];\n if (value !== undefined && typeof value !== \"function\") {\n throw new TypeError(\"Expected '\" + name + \"' to be a function\");\n }\n return value;\n }\n\n`;\nhelpers.classPrivateMethodGet = helper(\"7.1.6\")`\n export default function _classPrivateMethodGet(receiver, privateSet, fn) {\n if (!privateSet.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return fn;\n }\n`;\nhelpers.classPrivateMethodSet = helper(\"7.1.6\")`\n export default function _classPrivateMethodSet() {\n throw new TypeError(\"attempted to reassign private method\");\n }\n`;\nhelpers.wrapRegExp = helper(\"7.2.6\")`\n import wrapNativeSuper from \"wrapNativeSuper\";\n import getPrototypeOf from \"getPrototypeOf\";\n import possibleConstructorReturn from \"possibleConstructorReturn\";\n import inherits from \"inherits\";\n\n export default function _wrapRegExp(re, groups) {\n _wrapRegExp = function(re, groups) {\n return new BabelRegExp(re, undefined, groups);\n };\n\n var _RegExp = wrapNativeSuper(RegExp);\n var _super = RegExp.prototype;\n var _groups = new WeakMap();\n\n function BabelRegExp(re, flags, groups) {\n var _this = _RegExp.call(this, re, flags);\n // if the regex is recreated with 'g' flag\n _groups.set(_this, groups || _groups.get(re));\n return _this;\n }\n inherits(BabelRegExp, _RegExp);\n\n BabelRegExp.prototype.exec = function(str) {\n var result = _super.exec.call(this, str);\n if (result) result.groups = buildGroups(result, this);\n return result;\n };\n BabelRegExp.prototype[Symbol.replace] = function(str, substitution) {\n if (typeof substitution === \"string\") {\n var groups = _groups.get(this);\n return _super[Symbol.replace].call(\n this,\n str,\n substitution.replace(/\\\\$<([^>]+)>/g, function(_, name) {\n return \"$\" + groups[name];\n })\n );\n } else if (typeof substitution === \"function\") {\n var _this = this;\n return _super[Symbol.replace].call(\n this,\n str,\n function() {\n var args = [];\n args.push.apply(args, arguments);\n if (typeof args[args.length - 1] !== \"object\") {\n // Modern engines already pass result.groups as the last arg.\n args.push(buildGroups(args, _this));\n }\n return substitution.apply(this, args);\n }\n );\n } else {\n return _super[Symbol.replace].call(this, str, substitution);\n }\n }\n\n function buildGroups(result, re) {\n // NOTE: This function should return undefined if there are no groups,\n // but in that case Babel doesn't add the wrapper anyway.\n\n var g = _groups.get(re);\n return Object.keys(g).reduce(function(groups, name) {\n groups[name] = result[g[name]];\n return groups;\n }, Object.create(null));\n }\n\n return _wrapRegExp.apply(this, arguments);\n }\n`;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.get = get;\nexports.minVersion = minVersion;\nexports.getDependencies = getDependencies;\nexports.ensure = ensure;\nexports.default = exports.list = void 0;\n\nvar _traverse = _interopRequireDefault(require(\"@babel/traverse\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar _helpers = _interopRequireDefault(require(\"./helpers\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction makePath(path) {\n const parts = [];\n\n for (; path.parentPath; path = path.parentPath) {\n parts.push(path.key);\n if (path.inList) parts.push(path.listKey);\n }\n\n return parts.reverse().join(\".\");\n}\n\nlet fileClass = undefined;\n\nfunction getHelperMetadata(file) {\n const globals = new Set();\n const localBindingNames = new Set();\n const dependencies = new Map();\n let exportName;\n let exportPath;\n const exportBindingAssignments = [];\n const importPaths = [];\n const importBindingsReferences = [];\n const dependencyVisitor = {\n ImportDeclaration(child) {\n const name = child.node.source.value;\n\n if (!_helpers.default[name]) {\n throw child.buildCodeFrameError(`Unknown helper ${name}`);\n }\n\n if (child.get(\"specifiers\").length !== 1 || !child.get(\"specifiers.0\").isImportDefaultSpecifier()) {\n throw child.buildCodeFrameError(\"Helpers can only import a default value\");\n }\n\n const bindingIdentifier = child.node.specifiers[0].local;\n dependencies.set(bindingIdentifier, name);\n importPaths.push(makePath(child));\n },\n\n ExportDefaultDeclaration(child) {\n const decl = child.get(\"declaration\");\n\n if (decl.isFunctionDeclaration()) {\n if (!decl.node.id) {\n throw decl.buildCodeFrameError(\"Helpers should give names to their exported func declaration\");\n }\n\n exportName = decl.node.id.name;\n }\n\n exportPath = makePath(child);\n },\n\n ExportAllDeclaration(child) {\n throw child.buildCodeFrameError(\"Helpers can only export default\");\n },\n\n ExportNamedDeclaration(child) {\n throw child.buildCodeFrameError(\"Helpers can only export default\");\n },\n\n Statement(child) {\n if (child.isModuleDeclaration()) return;\n child.skip();\n }\n\n };\n const referenceVisitor = {\n Program(path) {\n const bindings = path.scope.getAllBindings();\n Object.keys(bindings).forEach(name => {\n if (name === exportName) return;\n if (dependencies.has(bindings[name].identifier)) return;\n localBindingNames.add(name);\n });\n },\n\n ReferencedIdentifier(child) {\n const name = child.node.name;\n const binding = child.scope.getBinding(name, true);\n\n if (!binding) {\n globals.add(name);\n } else if (dependencies.has(binding.identifier)) {\n importBindingsReferences.push(makePath(child));\n }\n },\n\n AssignmentExpression(child) {\n const left = child.get(\"left\");\n if (!(exportName in left.getBindingIdentifiers())) return;\n\n if (!left.isIdentifier()) {\n throw left.buildCodeFrameError(\"Only simple assignments to exports are allowed in helpers\");\n }\n\n const binding = child.scope.getBinding(exportName);\n\n if (binding == null ? void 0 : binding.scope.path.isProgram()) {\n exportBindingAssignments.push(makePath(child));\n }\n }\n\n };\n (0, _traverse.default)(file.ast, dependencyVisitor, file.scope);\n (0, _traverse.default)(file.ast, referenceVisitor, file.scope);\n if (!exportPath) throw new Error(\"Helpers must default-export something.\");\n exportBindingAssignments.reverse();\n return {\n globals: Array.from(globals),\n localBindingNames: Array.from(localBindingNames),\n dependencies,\n exportBindingAssignments,\n exportPath,\n exportName,\n importBindingsReferences,\n importPaths\n };\n}\n\nfunction permuteHelperAST(file, metadata, id, localBindings, getDependency) {\n if (localBindings && !id) {\n throw new Error(\"Unexpected local bindings for module-based helpers.\");\n }\n\n if (!id) return;\n const {\n localBindingNames,\n dependencies,\n exportBindingAssignments,\n exportPath,\n exportName,\n importBindingsReferences,\n importPaths\n } = metadata;\n const dependenciesRefs = {};\n dependencies.forEach((name, id) => {\n dependenciesRefs[id.name] = typeof getDependency === \"function\" && getDependency(name) || id;\n });\n const toRename = {};\n const bindings = new Set(localBindings || []);\n localBindingNames.forEach(name => {\n let newName = name;\n\n while (bindings.has(newName)) newName = \"_\" + newName;\n\n if (newName !== name) toRename[name] = newName;\n });\n\n if (id.type === \"Identifier\" && exportName !== id.name) {\n toRename[exportName] = id.name;\n }\n\n const visitor = {\n Program(path) {\n const exp = path.get(exportPath);\n const imps = importPaths.map(p => path.get(p));\n const impsBindingRefs = importBindingsReferences.map(p => path.get(p));\n const decl = exp.get(\"declaration\");\n\n if (id.type === \"Identifier\") {\n if (decl.isFunctionDeclaration()) {\n exp.replaceWith(decl);\n } else {\n exp.replaceWith(t.variableDeclaration(\"var\", [t.variableDeclarator(id, decl.node)]));\n }\n } else if (id.type === \"MemberExpression\") {\n if (decl.isFunctionDeclaration()) {\n exportBindingAssignments.forEach(assignPath => {\n const assign = path.get(assignPath);\n assign.replaceWith(t.assignmentExpression(\"=\", id, assign.node));\n });\n exp.replaceWith(decl);\n path.pushContainer(\"body\", t.expressionStatement(t.assignmentExpression(\"=\", id, t.identifier(exportName))));\n } else {\n exp.replaceWith(t.expressionStatement(t.assignmentExpression(\"=\", id, decl.node)));\n }\n } else {\n throw new Error(\"Unexpected helper format.\");\n }\n\n Object.keys(toRename).forEach(name => {\n path.scope.rename(name, toRename[name]);\n });\n\n for (const path of imps) path.remove();\n\n for (const path of impsBindingRefs) {\n const node = t.cloneNode(dependenciesRefs[path.node.name]);\n path.replaceWith(node);\n }\n\n path.stop();\n }\n\n };\n (0, _traverse.default)(file.ast, visitor, file.scope);\n}\n\nconst helperData = Object.create(null);\n\nfunction loadHelper(name) {\n if (!helperData[name]) {\n const helper = _helpers.default[name];\n\n if (!helper) {\n throw Object.assign(new ReferenceError(`Unknown helper ${name}`), {\n code: \"BABEL_HELPER_UNKNOWN\",\n helper: name\n });\n }\n\n const fn = () => {\n const file = {\n ast: t.file(helper.ast())\n };\n\n if (fileClass) {\n return new fileClass({\n filename: `babel-helper://${name}`\n }, file);\n }\n\n return file;\n };\n\n const metadata = getHelperMetadata(fn());\n helperData[name] = {\n build(getDependency, id, localBindings) {\n const file = fn();\n permuteHelperAST(file, metadata, id, localBindings, getDependency);\n return {\n nodes: file.ast.program.body,\n globals: metadata.globals\n };\n },\n\n minVersion() {\n return helper.minVersion;\n },\n\n dependencies: metadata.dependencies\n };\n }\n\n return helperData[name];\n}\n\nfunction get(name, getDependency, id, localBindings) {\n return loadHelper(name).build(getDependency, id, localBindings);\n}\n\nfunction minVersion(name) {\n return loadHelper(name).minVersion();\n}\n\nfunction getDependencies(name) {\n return Array.from(loadHelper(name).dependencies.values());\n}\n\nfunction ensure(name, newFileClass) {\n if (!fileClass) {\n fileClass = newFileClass;\n }\n\n loadHelper(name);\n}\n\nconst list = Object.keys(_helpers.default).map(name => name.replace(/^_/, \"\")).filter(name => name !== \"__esModule\");\nexports.list = list;\nvar _default = get;\nexports.default = _default;","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\nclass TokenType {\n constructor(label, conf = {}) {\n this.label = void 0;\n this.keyword = void 0;\n this.beforeExpr = void 0;\n this.startsExpr = void 0;\n this.rightAssociative = void 0;\n this.isLoop = void 0;\n this.isAssign = void 0;\n this.prefix = void 0;\n this.postfix = void 0;\n this.binop = void 0;\n this.updateContext = void 0;\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n this.updateContext = null;\n }\n\n}\nconst keywords = new Map();\n\nfunction createKeyword(name, options = {}) {\n options.keyword = name;\n const token = new TokenType(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name, binop) {\n return new TokenType(name, {\n beforeExpr,\n binop\n });\n}\n\nconst types = {\n num: new TokenType(\"num\", {\n startsExpr\n }),\n bigint: new TokenType(\"bigint\", {\n startsExpr\n }),\n decimal: new TokenType(\"decimal\", {\n startsExpr\n }),\n regexp: new TokenType(\"regexp\", {\n startsExpr\n }),\n string: new TokenType(\"string\", {\n startsExpr\n }),\n name: new TokenType(\"name\", {\n startsExpr\n }),\n eof: new TokenType(\"eof\"),\n bracketL: new TokenType(\"[\", {\n beforeExpr,\n startsExpr\n }),\n bracketHashL: new TokenType(\"#[\", {\n beforeExpr,\n startsExpr\n }),\n bracketBarL: new TokenType(\"[|\", {\n beforeExpr,\n startsExpr\n }),\n bracketR: new TokenType(\"]\"),\n bracketBarR: new TokenType(\"|]\"),\n braceL: new TokenType(\"{\", {\n beforeExpr,\n startsExpr\n }),\n braceBarL: new TokenType(\"{|\", {\n beforeExpr,\n startsExpr\n }),\n braceHashL: new TokenType(\"#{\", {\n beforeExpr,\n startsExpr\n }),\n braceR: new TokenType(\"}\"),\n braceBarR: new TokenType(\"|}\"),\n parenL: new TokenType(\"(\", {\n beforeExpr,\n startsExpr\n }),\n parenR: new TokenType(\")\"),\n comma: new TokenType(\",\", {\n beforeExpr\n }),\n semi: new TokenType(\";\", {\n beforeExpr\n }),\n colon: new TokenType(\":\", {\n beforeExpr\n }),\n doubleColon: new TokenType(\"::\", {\n beforeExpr\n }),\n dot: new TokenType(\".\"),\n question: new TokenType(\"?\", {\n beforeExpr\n }),\n questionDot: new TokenType(\"?.\"),\n arrow: new TokenType(\"=>\", {\n beforeExpr\n }),\n template: new TokenType(\"template\"),\n ellipsis: new TokenType(\"...\", {\n beforeExpr\n }),\n backQuote: new TokenType(\"`\", {\n startsExpr\n }),\n dollarBraceL: new TokenType(\"${\", {\n beforeExpr,\n startsExpr\n }),\n at: new TokenType(\"@\"),\n hash: new TokenType(\"#\", {\n startsExpr\n }),\n interpreterDirective: new TokenType(\"#!...\"),\n eq: new TokenType(\"=\", {\n beforeExpr,\n isAssign\n }),\n assign: new TokenType(\"_=\", {\n beforeExpr,\n isAssign\n }),\n incDec: new TokenType(\"++/--\", {\n prefix,\n postfix,\n startsExpr\n }),\n bang: new TokenType(\"!\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n tilde: new TokenType(\"~\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n relational: createBinop(\"/<=/>=\", 7),\n bitShift: createBinop(\"<>/>>>\", 8),\n plusMin: new TokenType(\"+/-\", {\n beforeExpr,\n binop: 9,\n prefix,\n startsExpr\n }),\n modulo: new TokenType(\"%\", {\n beforeExpr,\n binop: 10,\n startsExpr\n }),\n star: new TokenType(\"*\", {\n binop: 10\n }),\n slash: createBinop(\"/\", 10),\n exponent: new TokenType(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true\n }),\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", {\n beforeExpr\n }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", {\n beforeExpr\n }),\n _do: createKeyword(\"do\", {\n isLoop,\n beforeExpr\n }),\n _else: createKeyword(\"else\", {\n beforeExpr\n }),\n _finally: createKeyword(\"finally\"),\n _for: createKeyword(\"for\", {\n isLoop\n }),\n _function: createKeyword(\"function\", {\n startsExpr\n }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", {\n beforeExpr\n }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _while: createKeyword(\"while\", {\n isLoop\n }),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", {\n beforeExpr,\n startsExpr\n }),\n _this: createKeyword(\"this\", {\n startsExpr\n }),\n _super: createKeyword(\"super\", {\n startsExpr\n }),\n _class: createKeyword(\"class\", {\n startsExpr\n }),\n _extends: createKeyword(\"extends\", {\n beforeExpr\n }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", {\n startsExpr\n }),\n _null: createKeyword(\"null\", {\n startsExpr\n }),\n _true: createKeyword(\"true\", {\n startsExpr\n }),\n _false: createKeyword(\"false\", {\n startsExpr\n }),\n _in: createKeyword(\"in\", {\n beforeExpr,\n binop: 7\n }),\n _instanceof: createKeyword(\"instanceof\", {\n beforeExpr,\n binop: 7\n }),\n _typeof: createKeyword(\"typeof\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n _void: createKeyword(\"void\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n _delete: createKeyword(\"delete\", {\n beforeExpr,\n prefix,\n startsExpr\n })\n};\n\nconst SCOPE_OTHER = 0b00000000,\n SCOPE_PROGRAM = 0b00000001,\n SCOPE_FUNCTION = 0b00000010,\n SCOPE_ARROW = 0b00000100,\n SCOPE_SIMPLE_CATCH = 0b00001000,\n SCOPE_SUPER = 0b00010000,\n SCOPE_DIRECT_SUPER = 0b00100000,\n SCOPE_CLASS = 0b01000000,\n SCOPE_TS_MODULE = 0b10000000,\n SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;\nconst BIND_KIND_VALUE = 0b00000000001,\n BIND_KIND_TYPE = 0b00000000010,\n BIND_SCOPE_VAR = 0b00000000100,\n BIND_SCOPE_LEXICAL = 0b00000001000,\n BIND_SCOPE_FUNCTION = 0b00000010000,\n BIND_FLAGS_NONE = 0b00001000000,\n BIND_FLAGS_CLASS = 0b00010000000,\n BIND_FLAGS_TS_ENUM = 0b00100000000,\n BIND_FLAGS_TS_CONST_ENUM = 0b01000000000,\n BIND_FLAGS_TS_EXPORT_ONLY = 0b10000000000;\nconst BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS,\n BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0,\n BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0,\n BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0,\n BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS,\n BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0,\n BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,\n BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE,\n BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE,\n BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,\n BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY;\nconst CLASS_ELEMENT_FLAG_STATIC = 0b100,\n CLASS_ELEMENT_KIND_GETTER = 0b010,\n CLASS_ELEMENT_KIND_SETTER = 0b001,\n CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;\nconst CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,\n CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,\n CLASS_ELEMENT_OTHER = 0;\n\nconst lineBreak = /\\r\\n?|[\\n\\u2028\\u2029]/;\nconst lineBreakG = new RegExp(lineBreak.source, \"g\");\nfunction isNewLine(code) {\n switch (code) {\n case 10:\n case 13:\n case 8232:\n case 8233:\n return true;\n\n default:\n return false;\n }\n}\nconst skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\nfunction isWhitespace(code) {\n switch (code) {\n case 0x0009:\n case 0x000b:\n case 0x000c:\n case 32:\n case 160:\n case 5760:\n case 0x2000:\n case 0x2001:\n case 0x2002:\n case 0x2003:\n case 0x2004:\n case 0x2005:\n case 0x2006:\n case 0x2007:\n case 0x2008:\n case 0x2009:\n case 0x200a:\n case 0x202f:\n case 0x205f:\n case 0x3000:\n case 0xfeff:\n return true;\n\n default:\n return false;\n }\n}\n\nclass Position {\n constructor(line, col) {\n this.line = void 0;\n this.column = void 0;\n this.line = line;\n this.column = col;\n }\n\n}\nclass SourceLocation {\n constructor(start, end) {\n this.start = void 0;\n this.end = void 0;\n this.filename = void 0;\n this.identifierName = void 0;\n this.start = start;\n this.end = end;\n }\n\n}\nfunction getLineInfo(input, offset) {\n let line = 1;\n let lineStart = 0;\n let match;\n lineBreakG.lastIndex = 0;\n\n while ((match = lineBreakG.exec(input)) && match.index < offset) {\n line++;\n lineStart = lineBreakG.lastIndex;\n }\n\n return new Position(line, offset - lineStart);\n}\n\nclass BaseParser {\n constructor() {\n this.sawUnambiguousESM = false;\n this.ambiguousScriptDifferentAst = false;\n }\n\n hasPlugin(name) {\n return this.plugins.has(name);\n }\n\n getPluginOption(plugin, name) {\n if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name];\n }\n\n}\n\nfunction last(stack) {\n return stack[stack.length - 1];\n}\n\nclass CommentsParser extends BaseParser {\n addComment(comment) {\n if (this.filename) comment.loc.filename = this.filename;\n this.state.trailingComments.push(comment);\n this.state.leadingComments.push(comment);\n }\n\n adjustCommentsAfterTrailingComma(node, elements, takeAllComments) {\n if (this.state.leadingComments.length === 0) {\n return;\n }\n\n let lastElement = null;\n let i = elements.length;\n\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n\n if (lastElement === null) {\n return;\n }\n\n for (let j = 0; j < this.state.leadingComments.length; j++) {\n if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {\n this.state.leadingComments.splice(j, 1);\n j--;\n }\n }\n\n const newTrailingComments = [];\n\n for (let i = 0; i < this.state.leadingComments.length; i++) {\n const leadingComment = this.state.leadingComments[i];\n\n if (leadingComment.end < node.end) {\n newTrailingComments.push(leadingComment);\n\n if (!takeAllComments) {\n this.state.leadingComments.splice(i, 1);\n i--;\n }\n } else {\n if (node.trailingComments === undefined) {\n node.trailingComments = [];\n }\n\n node.trailingComments.push(leadingComment);\n }\n }\n\n if (takeAllComments) this.state.leadingComments = [];\n\n if (newTrailingComments.length > 0) {\n lastElement.trailingComments = newTrailingComments;\n } else if (lastElement.trailingComments !== undefined) {\n lastElement.trailingComments = [];\n }\n }\n\n processComment(node) {\n if (node.type === \"Program\" && node.body.length > 0) return;\n const stack = this.state.commentStack;\n let firstChild, lastChild, trailingComments, i, j;\n\n if (this.state.trailingComments.length > 0) {\n if (this.state.trailingComments[0].start >= node.end) {\n trailingComments = this.state.trailingComments;\n this.state.trailingComments = [];\n } else {\n this.state.trailingComments.length = 0;\n }\n } else if (stack.length > 0) {\n const lastInStack = last(stack);\n\n if (lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) {\n trailingComments = lastInStack.trailingComments;\n delete lastInStack.trailingComments;\n }\n }\n\n if (stack.length > 0 && last(stack).start >= node.start) {\n firstChild = stack.pop();\n }\n\n while (stack.length > 0 && last(stack).start >= node.start) {\n lastChild = stack.pop();\n }\n\n if (!lastChild && firstChild) lastChild = firstChild;\n\n if (firstChild) {\n switch (node.type) {\n case \"ObjectExpression\":\n this.adjustCommentsAfterTrailingComma(node, node.properties);\n break;\n\n case \"ObjectPattern\":\n this.adjustCommentsAfterTrailingComma(node, node.properties, true);\n break;\n\n case \"CallExpression\":\n this.adjustCommentsAfterTrailingComma(node, node.arguments);\n break;\n\n case \"ArrayExpression\":\n this.adjustCommentsAfterTrailingComma(node, node.elements);\n break;\n\n case \"ArrayPattern\":\n this.adjustCommentsAfterTrailingComma(node, node.elements, true);\n break;\n }\n } else if (this.state.commentPreviousNode && (this.state.commentPreviousNode.type === \"ImportSpecifier\" && node.type !== \"ImportSpecifier\" || this.state.commentPreviousNode.type === \"ExportSpecifier\" && node.type !== \"ExportSpecifier\")) {\n this.adjustCommentsAfterTrailingComma(node, [this.state.commentPreviousNode]);\n }\n\n if (lastChild) {\n if (lastChild.leadingComments) {\n if (lastChild !== node && lastChild.leadingComments.length > 0 && last(lastChild.leadingComments).end <= node.start) {\n node.leadingComments = lastChild.leadingComments;\n delete lastChild.leadingComments;\n } else {\n for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {\n if (lastChild.leadingComments[i].end <= node.start) {\n node.leadingComments = lastChild.leadingComments.splice(0, i + 1);\n break;\n }\n }\n }\n }\n } else if (this.state.leadingComments.length > 0) {\n if (last(this.state.leadingComments).end <= node.start) {\n if (this.state.commentPreviousNode) {\n for (j = 0; j < this.state.leadingComments.length; j++) {\n if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {\n this.state.leadingComments.splice(j, 1);\n j--;\n }\n }\n }\n\n if (this.state.leadingComments.length > 0) {\n node.leadingComments = this.state.leadingComments;\n this.state.leadingComments = [];\n }\n } else {\n for (i = 0; i < this.state.leadingComments.length; i++) {\n if (this.state.leadingComments[i].end > node.start) {\n break;\n }\n }\n\n const leadingComments = this.state.leadingComments.slice(0, i);\n\n if (leadingComments.length) {\n node.leadingComments = leadingComments;\n }\n\n trailingComments = this.state.leadingComments.slice(i);\n\n if (trailingComments.length === 0) {\n trailingComments = null;\n }\n }\n }\n\n this.state.commentPreviousNode = node;\n\n if (trailingComments) {\n if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) {\n node.innerComments = trailingComments;\n } else {\n const firstTrailingCommentIndex = trailingComments.findIndex(comment => comment.end >= node.end);\n\n if (firstTrailingCommentIndex > 0) {\n node.innerComments = trailingComments.slice(0, firstTrailingCommentIndex);\n node.trailingComments = trailingComments.slice(firstTrailingCommentIndex);\n } else {\n node.trailingComments = trailingComments;\n }\n }\n }\n\n stack.push(node);\n }\n\n}\n\nconst ErrorMessages = Object.freeze({\n AccessorIsGenerator: \"A %0ter cannot be a generator\",\n ArgumentsInClass: \"'arguments' is only allowed in functions and class methods\",\n AsyncFunctionInSingleStatementContext: \"Async functions can only be declared at the top level or inside a block\",\n AwaitBindingIdentifier: \"Can not use 'await' as identifier inside an async function\",\n AwaitExpressionFormalParameter: \"await is not allowed in async function parameters\",\n AwaitNotInAsyncContext: \"'await' is only allowed within async functions and at the top levels of modules\",\n AwaitNotInAsyncFunction: \"'await' is only allowed within async functions\",\n BadGetterArity: \"getter must not have any formal parameters\",\n BadSetterArity: \"setter must have exactly one formal parameter\",\n BadSetterRestParameter: \"setter function argument must not be a rest parameter\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'\",\n ConstructorClassPrivateField: \"Classes may not have a private field named '#constructor'\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor\",\n ConstructorIsAsync: \"Constructor can't be an async function\",\n ConstructorIsGenerator: \"Constructor can't be a generator\",\n DeclarationMissingInitializer: \"%0 require an initialization value\",\n DecoratorBeforeExport: \"Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax\",\n DecoratorConstructor: \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass: \"Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block\",\n DeletePrivateField: \"Deleting a private field is not allowed\",\n DestructureNamedImport: \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport: \"`%0` has already been exported. Exported identifiers must be unique.\",\n DuplicateProto: \"Redefinition of __proto__ property\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag\",\n DuplicateStaticBlock: \"Duplicate static block in the same class\",\n ElementAfterRest: \"Rest element must be last element\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape\",\n ExportBindingIsString: \"A string literal cannot be used as an exported binding without `from`.\\n- Did you mean `export { %0 as '%1' } from 'some-module'`?\",\n ExportDefaultFromAsIdentifier: \"'from' is not allowed as an identifier after 'export default'\",\n ForInOfLoopInitializer: \"%0 loop variable declaration may not have an initializer\",\n GeneratorInSingleStatementContext: \"Generators can only be declared at the top level or inside a block\",\n IllegalBreakContinue: \"Unsyntactic %0\",\n IllegalLanguageModeDirective: \"Illegal 'use strict' directive in function with non-simple parameter list\",\n IllegalReturn: \"'return' outside of function\",\n ImportBindingIsString: 'A string literal cannot be used as an imported binding.\\n- Did you mean `import { \"%0\" as foo }`?',\n ImportCallArgumentTrailingComma: \"Trailing comma is disallowed inside import(...) arguments\",\n ImportCallArity: \"import() requires exactly %0\",\n ImportCallNotNewExpression: \"Cannot use new with import(...)\",\n ImportCallSpreadArgument: \"... is not allowed in import()\",\n ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: \"module\"'`,\n ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n InvalidBigIntLiteral: \"Invalid BigIntLiteral\",\n InvalidCodePoint: \"Code point out of bounds\",\n InvalidDecimal: \"Invalid decimal\",\n InvalidDigit: \"Expected number in radix %0\",\n InvalidEscapeSequence: \"Bad character escape sequence\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template\",\n InvalidEscapedReservedWord: \"Escape sequence in keyword %0\",\n InvalidIdentifier: \"Invalid identifier %0\",\n InvalidLhs: \"Invalid left-hand side in %0\",\n InvalidLhsBinding: \"Binding invalid left-hand side in %0\",\n InvalidNumber: \"Invalid number\",\n InvalidOrMissingExponent: \"Floating-point numbers require a valid exponent after the 'e'\",\n InvalidOrUnexpectedToken: \"Unexpected character '%0'\",\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern\",\n InvalidPrivateFieldResolution: \"Private name #%0 is not defined\",\n InvalidPropertyBindingPattern: \"Binding member expression\",\n InvalidRecordProperty: \"Only properties and spread elements are allowed in record definitions\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument\",\n LabelRedeclaration: \"Label '%0' is already declared\",\n LetInLexicalBinding: \"'let' is not allowed to be used as a name in 'let' or 'const' declarations.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'\",\n MalformedRegExpFlags: \"Invalid regular expression flag\",\n MissingClassName: \"A class name is required\",\n MissingEqInAssignment: \"Only '=' operator can be used for specifying default value.\",\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX\",\n MixingCoalesceWithLogical: \"Nullish coalescing operator(??) requires parens when mixing with logical operators\",\n ModuleAttributeDifferentFromType: \"The only accepted module attribute is `type`\",\n ModuleAttributeInvalidValue: \"Only string literals are allowed as module attribute values\",\n ModuleAttributesWithDuplicateKeys: 'Duplicate key \"%0\" is not allowed in module attributes',\n ModuleExportNameHasLoneSurrogate: \"An export name cannot include a lone surrogate, found '\\\\u%0'\",\n ModuleExportUndefined: \"Export '%0' is not defined\",\n MultipleDefaultsInSwitch: \"Multiple default clauses\",\n NewlineAfterThrow: \"Illegal newline after throw\",\n NoCatchOrFinally: \"Missing catch or finally clause\",\n NumberIdentifier: \"Identifier directly after number\",\n NumericSeparatorInEscapeSequence: \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences\",\n ObsoleteAwaitStar: \"await* has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew: \"constructors in/after an Optional Chain are not allowed\",\n OptionalChainingNoTemplate: \"Tagged Template Literals are not allowed in optionalChain\",\n ParamDupe: \"Argument name clash\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter\",\n PatternHasMethod: \"Object pattern can't contain methods\",\n PipelineBodyNoArrow: 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized',\n PipelineBodySequenceExpression: \"Pipeline body may not be a comma-separated sequence expression\",\n PipelineHeadSequenceExpression: \"Pipeline head should not be a comma-separated sequence expression\",\n PipelineTopicUnused: \"Pipeline is in topic style but does not use topic reference\",\n PrimaryTopicNotAllowed: \"Topic reference was used in a lexical context without topic binding\",\n PrimaryTopicRequiresSmartPipeline: \"Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.\",\n PrivateInExpectedIn: \"Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`)\",\n PrivateNameRedeclaration: \"Duplicate private name #%0\",\n RecordExpressionBarIncorrectEndSyntaxType: \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'\",\n RecordExpressionBarIncorrectStartSyntaxType: \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'\",\n RecordExpressionHashIncorrectStartSyntaxType: \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions\",\n RestTrailingComma: \"Unexpected trailing comma after rest element\",\n SloppyFunction: \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement\",\n StaticPrototype: \"Classes may not have static property named prototype\",\n StrictDelete: \"Deleting local variable in strict mode\",\n StrictEvalArguments: \"Assigning to '%0' in strict mode\",\n StrictEvalArgumentsBinding: \"Binding '%0' in strict mode\",\n StrictFunction: \"In strict mode code, functions can only be declared at top level or inside a block\",\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'\",\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode\",\n StrictWith: \"'with' in strict mode\",\n SuperNotAllowed: \"super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super\",\n TrailingDecorator: \"Decorators must be attached to a class element\",\n TupleExpressionBarIncorrectEndSyntaxType: \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'\",\n TupleExpressionBarIncorrectStartSyntaxType: \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'\",\n TupleExpressionHashIncorrectStartSyntaxType: \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder\",\n UnexpectedAwaitAfterPipelineBody: 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token\",\n UnexpectedImportExport: \"'import' and 'export' may only appear at the top level\",\n UnexpectedKeyword: \"Unexpected keyword '%0'\",\n UnexpectedLeadingDecorator: \"Leading decorators must be attached to a class declaration\",\n UnexpectedLexicalDeclaration: \"Lexical declaration cannot appear in a single-statement context\",\n UnexpectedNewTarget: \"new.target can only be used in functions\",\n UnexpectedNumericSeparator: \"A numeric separator is only allowed between two digits\",\n UnexpectedPrivateField: \"Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\\n or a property of member expression (i.e. this.#p).\",\n UnexpectedReservedWord: \"Unexpected reserved word '%0'\",\n UnexpectedSuper: \"super is only allowed in object methods and classes\",\n UnexpectedToken: \"Unexpected token '%0'\",\n UnexpectedTokenUnaryExponentiation: \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport: \"A decorated export must export a class declaration\",\n UnsupportedDefaultExport: \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport: \"import can only be used in import() or import.meta\",\n UnsupportedMetaProperty: \"The only valid meta property for %0 is %0.%1\",\n UnsupportedParameterDecorator: \"Decorators cannot be used to decorate parameters\",\n UnsupportedPropertyDecorator: \"Decorators cannot be used to decorate object literal properties\",\n UnsupportedSuper: \"super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop])\",\n UnterminatedComment: \"Unterminated comment\",\n UnterminatedRegExp: \"Unterminated regular expression\",\n UnterminatedString: \"Unterminated string constant\",\n UnterminatedTemplate: \"Unterminated template\",\n VarRedeclaration: \"Identifier '%0' has already been declared\",\n YieldBindingIdentifier: \"Can not use 'yield' as identifier inside a generator\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters\",\n ZeroDigitNumericSeparator: \"Numeric separator can not be used after leading 0\"\n});\n\nclass ParserError extends CommentsParser {\n getLocationForPosition(pos) {\n let loc;\n if (pos === this.state.start) loc = this.state.startLoc;else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;else if (pos === this.state.end) loc = this.state.endLoc;else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;else loc = getLineInfo(this.input, pos);\n return loc;\n }\n\n raise(pos, errorTemplate, ...params) {\n return this.raiseWithData(pos, undefined, errorTemplate, ...params);\n }\n\n raiseWithData(pos, data, errorTemplate, ...params) {\n const loc = this.getLocationForPosition(pos);\n const message = errorTemplate.replace(/%(\\d+)/g, (_, i) => params[i]) + ` (${loc.line}:${loc.column})`;\n return this._raise(Object.assign({\n loc,\n pos\n }, data), message);\n }\n\n _raise(errorContext, message) {\n const err = new SyntaxError(message);\n Object.assign(err, errorContext);\n\n if (this.options.errorRecovery) {\n if (!this.isLookahead) this.state.errors.push(err);\n return err;\n } else {\n throw err;\n }\n }\n\n}\n\nfunction isSimpleProperty(node) {\n return node != null && node.type === \"Property\" && node.kind === \"init\" && node.method === false;\n}\n\nvar estree = (superClass => class extends superClass {\n estreeParseRegExpLiteral({\n pattern,\n flags\n }) {\n let regex = null;\n\n try {\n regex = new RegExp(pattern, flags);\n } catch (e) {}\n\n const node = this.estreeParseLiteral(regex);\n node.regex = {\n pattern,\n flags\n };\n return node;\n }\n\n estreeParseBigIntLiteral(value) {\n const bigInt = typeof BigInt !== \"undefined\" ? BigInt(value) : null;\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n return node;\n }\n\n estreeParseDecimalLiteral(value) {\n const decimal = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n return node;\n }\n\n estreeParseLiteral(value) {\n return this.parseLiteral(value, \"Literal\");\n }\n\n directiveToStmt(directive) {\n const directiveLiteral = directive.value;\n const stmt = this.startNodeAt(directive.start, directive.loc.start);\n const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start);\n expression.value = directiveLiteral.value;\n expression.raw = directiveLiteral.extra.raw;\n stmt.expression = this.finishNodeAt(expression, \"Literal\", directiveLiteral.end, directiveLiteral.loc.end);\n stmt.directive = directiveLiteral.extra.raw.slice(1, -1);\n return this.finishNodeAt(stmt, \"ExpressionStatement\", directive.end, directive.loc.end);\n }\n\n initFunction(node, isAsync) {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node) {\n if (isSimpleProperty(node)) {\n this.checkDeclaration(node.value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n getObjectOrClassMethodParams(method) {\n return method.value.params;\n }\n\n checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription, disallowLetBinding) {\n switch (expr.type) {\n case \"ObjectPattern\":\n expr.properties.forEach(prop => {\n this.checkLVal(prop.type === \"Property\" ? prop.value : prop, bindingType, checkClashes, \"object destructuring pattern\", disallowLetBinding);\n });\n break;\n\n default:\n super.checkLVal(expr, bindingType, checkClashes, contextDescription, disallowLetBinding);\n }\n }\n\n checkProto(prop, isRecord, protoRef, refExpressionErrors) {\n if (prop.method) {\n return;\n }\n\n super.checkProto(prop, isRecord, protoRef, refExpressionErrors);\n }\n\n isValidDirective(stmt) {\n var _stmt$expression$extr;\n\n return stmt.type === \"ExpressionStatement\" && stmt.expression.type === \"Literal\" && typeof stmt.expression.value === \"string\" && !((_stmt$expression$extr = stmt.expression.extra) == null ? void 0 : _stmt$expression$extr.parenthesized);\n }\n\n stmtToDirective(stmt) {\n const directive = super.stmtToDirective(stmt);\n const value = stmt.expression.value;\n directive.value.value = value;\n return directive;\n }\n\n parseBlockBody(node, allowDirectives, topLevel, end) {\n super.parseBlockBody(node, allowDirectives, topLevel, end);\n const directiveStatements = node.directives.map(d => this.directiveToStmt(d));\n node.body = directiveStatements.concat(node.body);\n delete node.directives;\n }\n\n pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {\n this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, \"ClassMethod\", true);\n\n if (method.typeParameters) {\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n\n classBody.body.push(method);\n }\n\n parseExprAtom(refExpressionErrors) {\n switch (this.state.type) {\n case types.num:\n case types.string:\n return this.estreeParseLiteral(this.state.value);\n\n case types.regexp:\n return this.estreeParseRegExpLiteral(this.state.value);\n\n case types.bigint:\n return this.estreeParseBigIntLiteral(this.state.value);\n\n case types.decimal:\n return this.estreeParseDecimalLiteral(this.state.value);\n\n case types._null:\n return this.estreeParseLiteral(null);\n\n case types._true:\n return this.estreeParseLiteral(true);\n\n case types._false:\n return this.estreeParseLiteral(false);\n\n default:\n return super.parseExprAtom(refExpressionErrors);\n }\n }\n\n parseLiteral(value, type, startPos, startLoc) {\n const node = super.parseLiteral(value, type, startPos, startLoc);\n node.raw = node.extra.raw;\n delete node.extra;\n return node;\n }\n\n parseFunctionBody(node, allowExpression, isMethod = false) {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {\n let funcNode = this.startNode();\n funcNode.kind = node.kind;\n funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n node.value = funcNode;\n type = type === \"ClassMethod\" ? \"MethodDefinition\" : type;\n return this.finishNode(node, type);\n }\n\n parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {\n const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor);\n\n if (node) {\n node.type = \"Property\";\n if (node.kind === \"method\") node.kind = \"init\";\n node.shorthand = false;\n }\n\n return node;\n }\n\n parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {\n const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);\n\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n\n return node;\n }\n\n toAssignable(node) {\n if (isSimpleProperty(node)) {\n this.toAssignable(node.value);\n return node;\n }\n\n return super.toAssignable(node);\n }\n\n toAssignableObjectExpressionProp(prop, isLast) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n throw this.raise(prop.key.start, ErrorMessages.PatternHasAccessor);\n } else if (prop.method) {\n throw this.raise(prop.key.start, ErrorMessages.PatternHasMethod);\n } else {\n super.toAssignableObjectExpressionProp(prop, isLast);\n }\n }\n\n finishCallExpression(node, optional) {\n super.finishCallExpression(node, optional);\n\n if (node.callee.type === \"Import\") {\n node.type = \"ImportExpression\";\n node.source = node.arguments[0];\n delete node.arguments;\n delete node.callee;\n }\n\n return node;\n }\n\n toReferencedArguments(node) {\n if (node.type === \"ImportExpression\") {\n return;\n }\n\n super.toReferencedArguments(node);\n }\n\n parseExport(node) {\n super.parseExport(node);\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n node.exported = null;\n break;\n\n case \"ExportNamedDeclaration\":\n if (node.specifiers.length === 1 && node.specifiers[0].type === \"ExportNamespaceSpecifier\") {\n node.type = \"ExportAllDeclaration\";\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n break;\n }\n\n return node;\n }\n\n parseSubscript(base, startPos, startLoc, noCalls, state) {\n const node = super.parseSubscript(base, startPos, startLoc, noCalls, state);\n\n if (state.optionalChainMember) {\n if (node.type === \"OptionalMemberExpression\" || node.type === \"OptionalCallExpression\") {\n node.type = node.type.substring(8);\n }\n\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (node.type === \"MemberExpression\" || node.type === \"CallExpression\") {\n node.optional = false;\n }\n\n return node;\n }\n\n});\n\nclass TokContext {\n constructor(token, isExpr, preserveSpace, override) {\n this.token = void 0;\n this.isExpr = void 0;\n this.preserveSpace = void 0;\n this.override = void 0;\n this.token = token;\n this.isExpr = !!isExpr;\n this.preserveSpace = !!preserveSpace;\n this.override = override;\n }\n\n}\nconst types$1 = {\n braceStatement: new TokContext(\"{\", false),\n braceExpression: new TokContext(\"{\", true),\n recordExpression: new TokContext(\"#{\", true),\n templateQuasi: new TokContext(\"${\", false),\n parenStatement: new TokContext(\"(\", false),\n parenExpression: new TokContext(\"(\", true),\n template: new TokContext(\"`\", true, true, p => p.readTmplToken()),\n functionExpression: new TokContext(\"function\", true),\n functionStatement: new TokContext(\"function\", false)\n};\n\ntypes.parenR.updateContext = types.braceR.updateContext = function () {\n if (this.state.context.length === 1) {\n this.state.exprAllowed = true;\n return;\n }\n\n let out = this.state.context.pop();\n\n if (out === types$1.braceStatement && this.curContext().token === \"function\") {\n out = this.state.context.pop();\n }\n\n this.state.exprAllowed = !out.isExpr;\n};\n\ntypes.name.updateContext = function (prevType) {\n let allowed = false;\n\n if (prevType !== types.dot) {\n if (this.state.value === \"of\" && !this.state.exprAllowed && prevType !== types._function && prevType !== types._class) {\n allowed = true;\n }\n }\n\n this.state.exprAllowed = allowed;\n\n if (this.state.isIterator) {\n this.state.isIterator = false;\n }\n};\n\ntypes.braceL.updateContext = function (prevType) {\n this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression);\n this.state.exprAllowed = true;\n};\n\ntypes.dollarBraceL.updateContext = function () {\n this.state.context.push(types$1.templateQuasi);\n this.state.exprAllowed = true;\n};\n\ntypes.parenL.updateContext = function (prevType) {\n const statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;\n this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression);\n this.state.exprAllowed = true;\n};\n\ntypes.incDec.updateContext = function () {};\n\ntypes._function.updateContext = types._class.updateContext = function (prevType) {\n if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && !(prevType === types._return && this.hasPrecedingLineBreak()) && !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) {\n this.state.context.push(types$1.functionExpression);\n } else {\n this.state.context.push(types$1.functionStatement);\n }\n\n this.state.exprAllowed = false;\n};\n\ntypes.backQuote.updateContext = function () {\n if (this.curContext() === types$1.template) {\n this.state.context.pop();\n } else {\n this.state.context.push(types$1.template);\n }\n\n this.state.exprAllowed = false;\n};\n\ntypes.braceHashL.updateContext = function () {\n this.state.context.push(types$1.recordExpression);\n this.state.exprAllowed = true;\n};\n\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u08a0-\\u08b4\\u08b6-\\u08c7\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\u9ffc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7bf\\ua7c2-\\ua7ca\\ua7f5-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u08d3-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf\\u1ac0\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1df9\\u1dfb-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\nconst nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\nconst nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\nconst astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];\nconst astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n\nfunction isInAstralSet(code, set) {\n let pos = 0x10000;\n\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n\n return false;\n}\n\nfunction isIdentifierStart(code) {\n if (code < 65) return code === 36;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));\n }\n\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\nfunction isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}\n\nconst reservedWords = {\n keyword: [\"break\", \"case\", \"catch\", \"continue\", \"debugger\", \"default\", \"do\", \"else\", \"finally\", \"for\", \"function\", \"if\", \"return\", \"switch\", \"throw\", \"try\", \"var\", \"const\", \"while\", \"with\", \"new\", \"this\", \"super\", \"class\", \"extends\", \"export\", \"import\", \"null\", \"true\", \"false\", \"in\", \"instanceof\", \"typeof\", \"void\", \"delete\"],\n strict: [\"implements\", \"interface\", \"let\", \"package\", \"private\", \"protected\", \"public\", \"static\", \"yield\"],\n strictBind: [\"eval\", \"arguments\"]\n};\nconst keywords$1 = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\nfunction isReservedWord(word, inModule) {\n return inModule && word === \"await\" || word === \"enum\";\n}\nfunction isStrictReservedWord(word, inModule) {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\nfunction isStrictBindOnlyReservedWord(word) {\n return reservedWordsStrictBindSet.has(word);\n}\nfunction isStrictBindReservedWord(word, inModule) {\n return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);\n}\nfunction isKeyword(word) {\n return keywords$1.has(word);\n}\n\nconst keywordRelationalOperator = /^in(stanceof)?$/;\nfunction isIteratorStart(current, next) {\n return current === 64 && next === 64;\n}\n\nconst reservedTypes = new Set([\"_\", \"any\", \"bool\", \"boolean\", \"empty\", \"extends\", \"false\", \"interface\", \"mixed\", \"null\", \"number\", \"static\", \"string\", \"true\", \"typeof\", \"void\"]);\nconst FlowErrors = Object.freeze({\n AmbiguousConditionalArrow: \"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.\",\n AmbiguousDeclareModuleKind: \"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module\",\n AssignReservedType: \"Cannot overwrite reserved type %0\",\n DeclareClassElement: \"The `declare` modifier can only appear on class fields.\",\n DeclareClassFieldInitializer: \"Initializers are not allowed in fields with the `declare` modifier.\",\n DuplicateDeclareModuleExports: \"Duplicate `declare module.exports` statement\",\n EnumBooleanMemberNotInitialized: \"Boolean enum members need to be initialized. Use either `%0 = true,` or `%0 = false,` in enum `%1`.\",\n EnumDuplicateMemberName: \"Enum member names need to be unique, but the name `%0` has already been used before in enum `%1`.\",\n EnumInconsistentMemberValues: \"Enum `%0` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.\",\n EnumInvalidExplicitType: \"Enum type `%1` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.\",\n EnumInvalidExplicitTypeUnknownSupplied: \"Supplied enum type is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.\",\n EnumInvalidMemberInitializerPrimaryType: \"Enum `%0` has type `%2`, so the initializer of `%1` needs to be a %2 literal.\",\n EnumInvalidMemberInitializerSymbolType: \"Symbol enum members cannot be initialized. Use `%1,` in enum `%0`.\",\n EnumInvalidMemberInitializerUnknownType: \"The enum member initializer for `%1` needs to be a literal (either a boolean, number, or string) in enum `%0`.\",\n EnumInvalidMemberName: \"Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%0`, consider using `%1`, in enum `%2`.\",\n EnumNumberMemberNotInitialized: \"Number enum members need to be initialized, e.g. `%1 = 1` in enum `%0`.\",\n EnumStringMemberInconsistentlyInitailized: \"String enum members need to consistently either all use initializers, or use no initializers, in enum `%0`.\",\n ImportTypeShorthandOnlyInPureImport: \"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements\",\n InexactInsideExact: \"Explicit inexact syntax cannot appear inside an explicit exact object type\",\n InexactInsideNonObject: \"Explicit inexact syntax cannot appear in class or interface definitions\",\n InexactVariance: \"Explicit inexact syntax cannot have variance\",\n InvalidNonTypeImportInDeclareModule: \"Imports within a `declare module` body must always be `import type` or `import typeof`\",\n MissingTypeParamDefault: \"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.\",\n NestedDeclareModule: \"`declare module` cannot be used inside another `declare module`\",\n NestedFlowComment: \"Cannot have a flow comment inside another flow comment\",\n OptionalBindingPattern: \"A binding pattern parameter cannot be optional in an implementation signature.\",\n SpreadVariance: \"Spread properties cannot have variance\",\n TypeBeforeInitializer: \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`\",\n TypeCastInPattern: \"The type cast expression is expected to be wrapped with parenthesis\",\n UnexpectedExplicitInexactInObject: \"Explicit inexact syntax must appear at the end of an inexact object\",\n UnexpectedReservedType: \"Unexpected reserved type %0\",\n UnexpectedReservedUnderscore: \"`_` is only allowed as a type argument to call or new\",\n UnexpectedSpaceBetweenModuloChecks: \"Spaces between `%` and `checks` are not allowed here.\",\n UnexpectedSpreadType: \"Spread operator cannot appear in class or interface definitions\",\n UnexpectedSubtractionOperand: 'Unexpected token, expected \"number\" or \"bigint\"',\n UnexpectedTokenAfterTypeParameter: \"Expected an arrow function after this type parameter declaration\",\n UnexpectedTypeParameterBeforeAsyncArrowFunction: \"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`\",\n UnsupportedDeclareExportKind: \"`declare export %0` is not supported. Use `%1` instead\",\n UnsupportedStatementInDeclareModule: \"Only declares and type imports are allowed inside declare module\",\n UnterminatedFlowComment: \"Unterminated flow-comment\"\n});\n\nfunction isEsModuleType(bodyElement) {\n return bodyElement.type === \"DeclareExportAllDeclaration\" || bodyElement.type === \"DeclareExportDeclaration\" && (!bodyElement.declaration || bodyElement.declaration.type !== \"TypeAlias\" && bodyElement.declaration.type !== \"InterfaceDeclaration\");\n}\n\nfunction hasTypeImportKind(node) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n}\n\nfunction isMaybeDefaultImport(state) {\n return (state.type === types.name || !!state.type.keyword) && state.value !== \"from\";\n}\n\nconst exportSuggestions = {\n const: \"declare export var\",\n let: \"declare export var\",\n type: \"export type\",\n interface: \"export interface\"\n};\n\nfunction partition(list, test) {\n const list1 = [];\n const list2 = [];\n\n for (let i = 0; i < list.length; i++) {\n (test(list[i], i, list) ? list1 : list2).push(list[i]);\n }\n\n return [list1, list2];\n}\n\nconst FLOW_PRAGMA_REGEX = /\\*?\\s*@((?:no)?flow)\\b/;\nvar flow = (superClass => {\n var _temp;\n\n return _temp = class extends superClass {\n constructor(options, input) {\n super(options, input);\n this.flowPragma = void 0;\n this.flowPragma = undefined;\n }\n\n shouldParseTypes() {\n return this.getPluginOption(\"flow\", \"all\") || this.flowPragma === \"flow\";\n }\n\n shouldParseEnums() {\n return !!this.getPluginOption(\"flow\", \"enums\");\n }\n\n finishToken(type, val) {\n if (type !== types.string && type !== types.semi && type !== types.interpreterDirective) {\n if (this.flowPragma === undefined) {\n this.flowPragma = null;\n }\n }\n\n return super.finishToken(type, val);\n }\n\n addComment(comment) {\n if (this.flowPragma === undefined) {\n const matches = FLOW_PRAGMA_REGEX.exec(comment.value);\n\n if (!matches) ; else if (matches[1] === \"flow\") {\n this.flowPragma = \"flow\";\n } else if (matches[1] === \"noflow\") {\n this.flowPragma = \"noflow\";\n } else {\n throw new Error(\"Unexpected flow pragma\");\n }\n }\n\n return super.addComment(comment);\n }\n\n flowParseTypeInitialiser(tok) {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tok || types.colon);\n const type = this.flowParseType();\n this.state.inType = oldInType;\n return type;\n }\n\n flowParsePredicate() {\n const node = this.startNode();\n const moduloLoc = this.state.startLoc;\n const moduloPos = this.state.start;\n this.expect(types.modulo);\n const checksLoc = this.state.startLoc;\n this.expectContextual(\"checks\");\n\n if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) {\n this.raise(moduloPos, FlowErrors.UnexpectedSpaceBetweenModuloChecks);\n }\n\n if (this.eat(types.parenL)) {\n node.value = this.parseExpression();\n this.expect(types.parenR);\n return this.finishNode(node, \"DeclaredPredicate\");\n } else {\n return this.finishNode(node, \"InferredPredicate\");\n }\n }\n\n flowParseTypeAndPredicateInitialiser() {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(types.colon);\n let type = null;\n let predicate = null;\n\n if (this.match(types.modulo)) {\n this.state.inType = oldInType;\n predicate = this.flowParsePredicate();\n } else {\n type = this.flowParseType();\n this.state.inType = oldInType;\n\n if (this.match(types.modulo)) {\n predicate = this.flowParsePredicate();\n }\n }\n\n return [type, predicate];\n }\n\n flowParseDeclareClass(node) {\n this.next();\n this.flowParseInterfaceish(node, true);\n return this.finishNode(node, \"DeclareClass\");\n }\n\n flowParseDeclareFunction(node) {\n this.next();\n const id = node.id = this.parseIdentifier();\n const typeNode = this.startNode();\n const typeContainer = this.startNode();\n\n if (this.isRelational(\"<\")) {\n typeNode.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n typeNode.typeParameters = null;\n }\n\n this.expect(types.parenL);\n const tmp = this.flowParseFunctionTypeParams();\n typeNode.params = tmp.params;\n typeNode.rest = tmp.rest;\n this.expect(types.parenR);\n [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser();\n typeContainer.typeAnnotation = this.finishNode(typeNode, \"FunctionTypeAnnotation\");\n id.typeAnnotation = this.finishNode(typeContainer, \"TypeAnnotation\");\n this.resetEndLocation(id);\n this.semicolon();\n return this.finishNode(node, \"DeclareFunction\");\n }\n\n flowParseDeclare(node, insideModule) {\n if (this.match(types._class)) {\n return this.flowParseDeclareClass(node);\n } else if (this.match(types._function)) {\n return this.flowParseDeclareFunction(node);\n } else if (this.match(types._var)) {\n return this.flowParseDeclareVariable(node);\n } else if (this.eatContextual(\"module\")) {\n if (this.match(types.dot)) {\n return this.flowParseDeclareModuleExports(node);\n } else {\n if (insideModule) {\n this.raise(this.state.lastTokStart, FlowErrors.NestedDeclareModule);\n }\n\n return this.flowParseDeclareModule(node);\n }\n } else if (this.isContextual(\"type\")) {\n return this.flowParseDeclareTypeAlias(node);\n } else if (this.isContextual(\"opaque\")) {\n return this.flowParseDeclareOpaqueType(node);\n } else if (this.isContextual(\"interface\")) {\n return this.flowParseDeclareInterface(node);\n } else if (this.match(types._export)) {\n return this.flowParseDeclareExportDeclaration(node, insideModule);\n } else {\n throw this.unexpected();\n }\n }\n\n flowParseDeclareVariable(node) {\n this.next();\n node.id = this.flowParseTypeAnnotatableIdentifier(true);\n this.scope.declareName(node.id.name, BIND_VAR, node.id.start);\n this.semicolon();\n return this.finishNode(node, \"DeclareVariable\");\n }\n\n flowParseDeclareModule(node) {\n this.scope.enter(SCOPE_OTHER);\n\n if (this.match(types.string)) {\n node.id = this.parseExprAtom();\n } else {\n node.id = this.parseIdentifier();\n }\n\n const bodyNode = node.body = this.startNode();\n const body = bodyNode.body = [];\n this.expect(types.braceL);\n\n while (!this.match(types.braceR)) {\n let bodyNode = this.startNode();\n\n if (this.match(types._import)) {\n this.next();\n\n if (!this.isContextual(\"type\") && !this.match(types._typeof)) {\n this.raise(this.state.lastTokStart, FlowErrors.InvalidNonTypeImportInDeclareModule);\n }\n\n this.parseImport(bodyNode);\n } else {\n this.expectContextual(\"declare\", FlowErrors.UnsupportedStatementInDeclareModule);\n bodyNode = this.flowParseDeclare(bodyNode, true);\n }\n\n body.push(bodyNode);\n }\n\n this.scope.exit();\n this.expect(types.braceR);\n this.finishNode(bodyNode, \"BlockStatement\");\n let kind = null;\n let hasModuleExport = false;\n body.forEach(bodyElement => {\n if (isEsModuleType(bodyElement)) {\n if (kind === \"CommonJS\") {\n this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind);\n }\n\n kind = \"ES\";\n } else if (bodyElement.type === \"DeclareModuleExports\") {\n if (hasModuleExport) {\n this.raise(bodyElement.start, FlowErrors.DuplicateDeclareModuleExports);\n }\n\n if (kind === \"ES\") {\n this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind);\n }\n\n kind = \"CommonJS\";\n hasModuleExport = true;\n }\n });\n node.kind = kind || \"CommonJS\";\n return this.finishNode(node, \"DeclareModule\");\n }\n\n flowParseDeclareExportDeclaration(node, insideModule) {\n this.expect(types._export);\n\n if (this.eat(types._default)) {\n if (this.match(types._function) || this.match(types._class)) {\n node.declaration = this.flowParseDeclare(this.startNode());\n } else {\n node.declaration = this.flowParseType();\n this.semicolon();\n }\n\n node.default = true;\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else {\n if (this.match(types._const) || this.isLet() || (this.isContextual(\"type\") || this.isContextual(\"interface\")) && !insideModule) {\n const label = this.state.value;\n const suggestion = exportSuggestions[label];\n throw this.raise(this.state.start, FlowErrors.UnsupportedDeclareExportKind, label, suggestion);\n }\n\n if (this.match(types._var) || this.match(types._function) || this.match(types._class) || this.isContextual(\"opaque\")) {\n node.declaration = this.flowParseDeclare(this.startNode());\n node.default = false;\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else if (this.match(types.star) || this.match(types.braceL) || this.isContextual(\"interface\") || this.isContextual(\"type\") || this.isContextual(\"opaque\")) {\n node = this.parseExport(node);\n\n if (node.type === \"ExportNamedDeclaration\") {\n node.type = \"ExportDeclaration\";\n node.default = false;\n delete node.exportKind;\n }\n\n node.type = \"Declare\" + node.type;\n return node;\n }\n }\n\n throw this.unexpected();\n }\n\n flowParseDeclareModuleExports(node) {\n this.next();\n this.expectContextual(\"exports\");\n node.typeAnnotation = this.flowParseTypeAnnotation();\n this.semicolon();\n return this.finishNode(node, \"DeclareModuleExports\");\n }\n\n flowParseDeclareTypeAlias(node) {\n this.next();\n this.flowParseTypeAlias(node);\n node.type = \"DeclareTypeAlias\";\n return node;\n }\n\n flowParseDeclareOpaqueType(node) {\n this.next();\n this.flowParseOpaqueType(node, true);\n node.type = \"DeclareOpaqueType\";\n return node;\n }\n\n flowParseDeclareInterface(node) {\n this.next();\n this.flowParseInterfaceish(node);\n return this.finishNode(node, \"DeclareInterface\");\n }\n\n flowParseInterfaceish(node, isClass = false) {\n node.id = this.flowParseRestrictedIdentifier(!isClass, true);\n this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.start);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.extends = [];\n node.implements = [];\n node.mixins = [];\n\n if (this.eat(types._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (!isClass && this.eat(types.comma));\n }\n\n if (this.isContextual(\"mixins\")) {\n this.next();\n\n do {\n node.mixins.push(this.flowParseInterfaceExtends());\n } while (this.eat(types.comma));\n }\n\n if (this.isContextual(\"implements\")) {\n this.next();\n\n do {\n node.implements.push(this.flowParseInterfaceExtends());\n } while (this.eat(types.comma));\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: isClass,\n allowExact: false,\n allowSpread: false,\n allowProto: isClass,\n allowInexact: false\n });\n }\n\n flowParseInterfaceExtends() {\n const node = this.startNode();\n node.id = this.flowParseQualifiedTypeIdentifier();\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n\n return this.finishNode(node, \"InterfaceExtends\");\n }\n\n flowParseInterface(node) {\n this.flowParseInterfaceish(node);\n return this.finishNode(node, \"InterfaceDeclaration\");\n }\n\n checkNotUnderscore(word) {\n if (word === \"_\") {\n this.raise(this.state.start, FlowErrors.UnexpectedReservedUnderscore);\n }\n }\n\n checkReservedType(word, startLoc, declaration) {\n if (!reservedTypes.has(word)) return;\n this.raise(startLoc, declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, word);\n }\n\n flowParseRestrictedIdentifier(liberal, declaration) {\n this.checkReservedType(this.state.value, this.state.start, declaration);\n return this.parseIdentifier(liberal);\n }\n\n flowParseTypeAlias(node) {\n node.id = this.flowParseRestrictedIdentifier(false, true);\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.right = this.flowParseTypeInitialiser(types.eq);\n this.semicolon();\n return this.finishNode(node, \"TypeAlias\");\n }\n\n flowParseOpaqueType(node, declare) {\n this.expectContextual(\"type\");\n node.id = this.flowParseRestrictedIdentifier(true, true);\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.supertype = null;\n\n if (this.match(types.colon)) {\n node.supertype = this.flowParseTypeInitialiser(types.colon);\n }\n\n node.impltype = null;\n\n if (!declare) {\n node.impltype = this.flowParseTypeInitialiser(types.eq);\n }\n\n this.semicolon();\n return this.finishNode(node, \"OpaqueType\");\n }\n\n flowParseTypeParameter(requireDefault = false) {\n const nodeStart = this.state.start;\n const node = this.startNode();\n const variance = this.flowParseVariance();\n const ident = this.flowParseTypeAnnotatableIdentifier();\n node.name = ident.name;\n node.variance = variance;\n node.bound = ident.typeAnnotation;\n\n if (this.match(types.eq)) {\n this.eat(types.eq);\n node.default = this.flowParseType();\n } else {\n if (requireDefault) {\n this.raise(nodeStart, FlowErrors.MissingTypeParamDefault);\n }\n }\n\n return this.finishNode(node, \"TypeParameter\");\n }\n\n flowParseTypeParameterDeclaration() {\n const oldInType = this.state.inType;\n const node = this.startNode();\n node.params = [];\n this.state.inType = true;\n\n if (this.isRelational(\"<\") || this.match(types.jsxTagStart)) {\n this.next();\n } else {\n this.unexpected();\n }\n\n let defaultRequired = false;\n\n do {\n const typeParameter = this.flowParseTypeParameter(defaultRequired);\n node.params.push(typeParameter);\n\n if (typeParameter.default) {\n defaultRequired = true;\n }\n\n if (!this.isRelational(\">\")) {\n this.expect(types.comma);\n }\n } while (!this.isRelational(\">\"));\n\n this.expectRelational(\">\");\n this.state.inType = oldInType;\n return this.finishNode(node, \"TypeParameterDeclaration\");\n }\n\n flowParseTypeParameterInstantiation() {\n const node = this.startNode();\n const oldInType = this.state.inType;\n node.params = [];\n this.state.inType = true;\n this.expectRelational(\"<\");\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = false;\n\n while (!this.isRelational(\">\")) {\n node.params.push(this.flowParseType());\n\n if (!this.isRelational(\">\")) {\n this.expect(types.comma);\n }\n }\n\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n this.expectRelational(\">\");\n this.state.inType = oldInType;\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseTypeParameterInstantiationCallOrNew() {\n const node = this.startNode();\n const oldInType = this.state.inType;\n node.params = [];\n this.state.inType = true;\n this.expectRelational(\"<\");\n\n while (!this.isRelational(\">\")) {\n node.params.push(this.flowParseTypeOrImplicitInstantiation());\n\n if (!this.isRelational(\">\")) {\n this.expect(types.comma);\n }\n }\n\n this.expectRelational(\">\");\n this.state.inType = oldInType;\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseInterfaceType() {\n const node = this.startNode();\n this.expectContextual(\"interface\");\n node.extends = [];\n\n if (this.eat(types._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (this.eat(types.comma));\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: false,\n allowProto: false,\n allowInexact: false\n });\n return this.finishNode(node, \"InterfaceTypeAnnotation\");\n }\n\n flowParseObjectPropertyKey() {\n return this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true);\n }\n\n flowParseObjectTypeIndexer(node, isStatic, variance) {\n node.static = isStatic;\n\n if (this.lookahead().type === types.colon) {\n node.id = this.flowParseObjectPropertyKey();\n node.key = this.flowParseTypeInitialiser();\n } else {\n node.id = null;\n node.key = this.flowParseType();\n }\n\n this.expect(types.bracketR);\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n return this.finishNode(node, \"ObjectTypeIndexer\");\n }\n\n flowParseObjectTypeInternalSlot(node, isStatic) {\n node.static = isStatic;\n node.id = this.flowParseObjectPropertyKey();\n this.expect(types.bracketR);\n this.expect(types.bracketR);\n\n if (this.isRelational(\"<\") || this.match(types.parenL)) {\n node.method = true;\n node.optional = false;\n node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));\n } else {\n node.method = false;\n\n if (this.eat(types.question)) {\n node.optional = true;\n }\n\n node.value = this.flowParseTypeInitialiser();\n }\n\n return this.finishNode(node, \"ObjectTypeInternalSlot\");\n }\n\n flowParseObjectTypeMethodish(node) {\n node.params = [];\n node.rest = null;\n node.typeParameters = null;\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n this.expect(types.parenL);\n\n while (!this.match(types.parenR) && !this.match(types.ellipsis)) {\n node.params.push(this.flowParseFunctionTypeParam());\n\n if (!this.match(types.parenR)) {\n this.expect(types.comma);\n }\n }\n\n if (this.eat(types.ellipsis)) {\n node.rest = this.flowParseFunctionTypeParam();\n }\n\n this.expect(types.parenR);\n node.returnType = this.flowParseTypeInitialiser();\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n\n flowParseObjectTypeCallProperty(node, isStatic) {\n const valueNode = this.startNode();\n node.static = isStatic;\n node.value = this.flowParseObjectTypeMethodish(valueNode);\n return this.finishNode(node, \"ObjectTypeCallProperty\");\n }\n\n flowParseObjectType({\n allowStatic,\n allowExact,\n allowSpread,\n allowProto,\n allowInexact\n }) {\n const oldInType = this.state.inType;\n this.state.inType = true;\n const nodeStart = this.startNode();\n nodeStart.callProperties = [];\n nodeStart.properties = [];\n nodeStart.indexers = [];\n nodeStart.internalSlots = [];\n let endDelim;\n let exact;\n let inexact = false;\n\n if (allowExact && this.match(types.braceBarL)) {\n this.expect(types.braceBarL);\n endDelim = types.braceBarR;\n exact = true;\n } else {\n this.expect(types.braceL);\n endDelim = types.braceR;\n exact = false;\n }\n\n nodeStart.exact = exact;\n\n while (!this.match(endDelim)) {\n let isStatic = false;\n let protoStart = null;\n let inexactStart = null;\n const node = this.startNode();\n\n if (allowProto && this.isContextual(\"proto\")) {\n const lookahead = this.lookahead();\n\n if (lookahead.type !== types.colon && lookahead.type !== types.question) {\n this.next();\n protoStart = this.state.start;\n allowStatic = false;\n }\n }\n\n if (allowStatic && this.isContextual(\"static\")) {\n const lookahead = this.lookahead();\n\n if (lookahead.type !== types.colon && lookahead.type !== types.question) {\n this.next();\n isStatic = true;\n }\n }\n\n const variance = this.flowParseVariance();\n\n if (this.eat(types.bracketL)) {\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n\n if (this.eat(types.bracketL)) {\n if (variance) {\n this.unexpected(variance.start);\n }\n\n nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic));\n } else {\n nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));\n }\n } else if (this.match(types.parenL) || this.isRelational(\"<\")) {\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n\n if (variance) {\n this.unexpected(variance.start);\n }\n\n nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));\n } else {\n let kind = \"init\";\n\n if (this.isContextual(\"get\") || this.isContextual(\"set\")) {\n const lookahead = this.lookahead();\n\n if (lookahead.type === types.name || lookahead.type === types.string || lookahead.type === types.num) {\n kind = this.state.value;\n this.next();\n }\n }\n\n const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact);\n\n if (propOrInexact === null) {\n inexact = true;\n inexactStart = this.state.lastTokStart;\n } else {\n nodeStart.properties.push(propOrInexact);\n }\n }\n\n this.flowObjectTypeSemicolon();\n\n if (inexactStart && !this.match(types.braceR) && !this.match(types.braceBarR)) {\n this.raise(inexactStart, FlowErrors.UnexpectedExplicitInexactInObject);\n }\n }\n\n this.expect(endDelim);\n\n if (allowSpread) {\n nodeStart.inexact = inexact;\n }\n\n const out = this.finishNode(nodeStart, \"ObjectTypeAnnotation\");\n this.state.inType = oldInType;\n return out;\n }\n\n flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact) {\n if (this.eat(types.ellipsis)) {\n const isInexactToken = this.match(types.comma) || this.match(types.semi) || this.match(types.braceR) || this.match(types.braceBarR);\n\n if (isInexactToken) {\n if (!allowSpread) {\n this.raise(this.state.lastTokStart, FlowErrors.InexactInsideNonObject);\n } else if (!allowInexact) {\n this.raise(this.state.lastTokStart, FlowErrors.InexactInsideExact);\n }\n\n if (variance) {\n this.raise(variance.start, FlowErrors.InexactVariance);\n }\n\n return null;\n }\n\n if (!allowSpread) {\n this.raise(this.state.lastTokStart, FlowErrors.UnexpectedSpreadType);\n }\n\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n\n if (variance) {\n this.raise(variance.start, FlowErrors.SpreadVariance);\n }\n\n node.argument = this.flowParseType();\n return this.finishNode(node, \"ObjectTypeSpreadProperty\");\n } else {\n node.key = this.flowParseObjectPropertyKey();\n node.static = isStatic;\n node.proto = protoStart != null;\n node.kind = kind;\n let optional = false;\n\n if (this.isRelational(\"<\") || this.match(types.parenL)) {\n node.method = true;\n\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n\n if (variance) {\n this.unexpected(variance.start);\n }\n\n node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));\n\n if (kind === \"get\" || kind === \"set\") {\n this.flowCheckGetterSetterParams(node);\n }\n } else {\n if (kind !== \"init\") this.unexpected();\n node.method = false;\n\n if (this.eat(types.question)) {\n optional = true;\n }\n\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n }\n\n node.optional = optional;\n return this.finishNode(node, \"ObjectTypeProperty\");\n }\n }\n\n flowCheckGetterSetterParams(property) {\n const paramCount = property.kind === \"get\" ? 0 : 1;\n const start = property.start;\n const length = property.value.params.length + (property.value.rest ? 1 : 0);\n\n if (length !== paramCount) {\n if (property.kind === \"get\") {\n this.raise(start, ErrorMessages.BadGetterArity);\n } else {\n this.raise(start, ErrorMessages.BadSetterArity);\n }\n }\n\n if (property.kind === \"set\" && property.value.rest) {\n this.raise(start, ErrorMessages.BadSetterRestParameter);\n }\n }\n\n flowObjectTypeSemicolon() {\n if (!this.eat(types.semi) && !this.eat(types.comma) && !this.match(types.braceR) && !this.match(types.braceBarR)) {\n this.unexpected();\n }\n }\n\n flowParseQualifiedTypeIdentifier(startPos, startLoc, id) {\n startPos = startPos || this.state.start;\n startLoc = startLoc || this.state.startLoc;\n let node = id || this.flowParseRestrictedIdentifier(true);\n\n while (this.eat(types.dot)) {\n const node2 = this.startNodeAt(startPos, startLoc);\n node2.qualification = node;\n node2.id = this.flowParseRestrictedIdentifier(true);\n node = this.finishNode(node2, \"QualifiedTypeIdentifier\");\n }\n\n return node;\n }\n\n flowParseGenericType(startPos, startLoc, id) {\n const node = this.startNodeAt(startPos, startLoc);\n node.typeParameters = null;\n node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n }\n\n return this.finishNode(node, \"GenericTypeAnnotation\");\n }\n\n flowParseTypeofType() {\n const node = this.startNode();\n this.expect(types._typeof);\n node.argument = this.flowParsePrimaryType();\n return this.finishNode(node, \"TypeofTypeAnnotation\");\n }\n\n flowParseTupleType() {\n const node = this.startNode();\n node.types = [];\n this.expect(types.bracketL);\n\n while (this.state.pos < this.length && !this.match(types.bracketR)) {\n node.types.push(this.flowParseType());\n if (this.match(types.bracketR)) break;\n this.expect(types.comma);\n }\n\n this.expect(types.bracketR);\n return this.finishNode(node, \"TupleTypeAnnotation\");\n }\n\n flowParseFunctionTypeParam() {\n let name = null;\n let optional = false;\n let typeAnnotation = null;\n const node = this.startNode();\n const lh = this.lookahead();\n\n if (lh.type === types.colon || lh.type === types.question) {\n name = this.parseIdentifier();\n\n if (this.eat(types.question)) {\n optional = true;\n }\n\n typeAnnotation = this.flowParseTypeInitialiser();\n } else {\n typeAnnotation = this.flowParseType();\n }\n\n node.name = name;\n node.optional = optional;\n node.typeAnnotation = typeAnnotation;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n reinterpretTypeAsFunctionTypeParam(type) {\n const node = this.startNodeAt(type.start, type.loc.start);\n node.name = null;\n node.optional = false;\n node.typeAnnotation = type;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n flowParseFunctionTypeParams(params = []) {\n let rest = null;\n\n while (!this.match(types.parenR) && !this.match(types.ellipsis)) {\n params.push(this.flowParseFunctionTypeParam());\n\n if (!this.match(types.parenR)) {\n this.expect(types.comma);\n }\n }\n\n if (this.eat(types.ellipsis)) {\n rest = this.flowParseFunctionTypeParam();\n }\n\n return {\n params,\n rest\n };\n }\n\n flowIdentToTypeAnnotation(startPos, startLoc, node, id) {\n switch (id.name) {\n case \"any\":\n return this.finishNode(node, \"AnyTypeAnnotation\");\n\n case \"bool\":\n case \"boolean\":\n return this.finishNode(node, \"BooleanTypeAnnotation\");\n\n case \"mixed\":\n return this.finishNode(node, \"MixedTypeAnnotation\");\n\n case \"empty\":\n return this.finishNode(node, \"EmptyTypeAnnotation\");\n\n case \"number\":\n return this.finishNode(node, \"NumberTypeAnnotation\");\n\n case \"string\":\n return this.finishNode(node, \"StringTypeAnnotation\");\n\n case \"symbol\":\n return this.finishNode(node, \"SymbolTypeAnnotation\");\n\n default:\n this.checkNotUnderscore(id.name);\n return this.flowParseGenericType(startPos, startLoc, id);\n }\n }\n\n flowParsePrimaryType() {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const node = this.startNode();\n let tmp;\n let type;\n let isGroupedType = false;\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n\n switch (this.state.type) {\n case types.name:\n if (this.isContextual(\"interface\")) {\n return this.flowParseInterfaceType();\n }\n\n return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier());\n\n case types.braceL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: true,\n allowProto: false,\n allowInexact: true\n });\n\n case types.braceBarL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: true,\n allowSpread: true,\n allowProto: false,\n allowInexact: false\n });\n\n case types.bracketL:\n this.state.noAnonFunctionType = false;\n type = this.flowParseTupleType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n return type;\n\n case types.relational:\n if (this.state.value === \"<\") {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n this.expect(types.parenL);\n tmp = this.flowParseFunctionTypeParams();\n node.params = tmp.params;\n node.rest = tmp.rest;\n this.expect(types.parenR);\n this.expect(types.arrow);\n node.returnType = this.flowParseType();\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n\n break;\n\n case types.parenL:\n this.next();\n\n if (!this.match(types.parenR) && !this.match(types.ellipsis)) {\n if (this.match(types.name)) {\n const token = this.lookahead().type;\n isGroupedType = token !== types.question && token !== types.colon;\n } else {\n isGroupedType = true;\n }\n }\n\n if (isGroupedType) {\n this.state.noAnonFunctionType = false;\n type = this.flowParseType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n if (this.state.noAnonFunctionType || !(this.match(types.comma) || this.match(types.parenR) && this.lookahead().type === types.arrow)) {\n this.expect(types.parenR);\n return type;\n } else {\n this.eat(types.comma);\n }\n }\n\n if (type) {\n tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);\n } else {\n tmp = this.flowParseFunctionTypeParams();\n }\n\n node.params = tmp.params;\n node.rest = tmp.rest;\n this.expect(types.parenR);\n this.expect(types.arrow);\n node.returnType = this.flowParseType();\n node.typeParameters = null;\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n\n case types.string:\n return this.parseLiteral(this.state.value, \"StringLiteralTypeAnnotation\");\n\n case types._true:\n case types._false:\n node.value = this.match(types._true);\n this.next();\n return this.finishNode(node, \"BooleanLiteralTypeAnnotation\");\n\n case types.plusMin:\n if (this.state.value === \"-\") {\n this.next();\n\n if (this.match(types.num)) {\n return this.parseLiteral(-this.state.value, \"NumberLiteralTypeAnnotation\", node.start, node.loc.start);\n }\n\n if (this.match(types.bigint)) {\n return this.parseLiteral(-this.state.value, \"BigIntLiteralTypeAnnotation\", node.start, node.loc.start);\n }\n\n throw this.raise(this.state.start, FlowErrors.UnexpectedSubtractionOperand);\n }\n\n throw this.unexpected();\n\n case types.num:\n return this.parseLiteral(this.state.value, \"NumberLiteralTypeAnnotation\");\n\n case types.bigint:\n return this.parseLiteral(this.state.value, \"BigIntLiteralTypeAnnotation\");\n\n case types._void:\n this.next();\n return this.finishNode(node, \"VoidTypeAnnotation\");\n\n case types._null:\n this.next();\n return this.finishNode(node, \"NullLiteralTypeAnnotation\");\n\n case types._this:\n this.next();\n return this.finishNode(node, \"ThisTypeAnnotation\");\n\n case types.star:\n this.next();\n return this.finishNode(node, \"ExistsTypeAnnotation\");\n\n default:\n if (this.state.type.keyword === \"typeof\") {\n return this.flowParseTypeofType();\n } else if (this.state.type.keyword) {\n const label = this.state.type.label;\n this.next();\n return super.createIdentifier(node, label);\n }\n\n }\n\n throw this.unexpected();\n }\n\n flowParsePostfixType() {\n const startPos = this.state.start,\n startLoc = this.state.startLoc;\n let type = this.flowParsePrimaryType();\n\n while (this.match(types.bracketL) && !this.canInsertSemicolon()) {\n const node = this.startNodeAt(startPos, startLoc);\n node.elementType = type;\n this.expect(types.bracketL);\n this.expect(types.bracketR);\n type = this.finishNode(node, \"ArrayTypeAnnotation\");\n }\n\n return type;\n }\n\n flowParsePrefixType() {\n const node = this.startNode();\n\n if (this.eat(types.question)) {\n node.typeAnnotation = this.flowParsePrefixType();\n return this.finishNode(node, \"NullableTypeAnnotation\");\n } else {\n return this.flowParsePostfixType();\n }\n }\n\n flowParseAnonFunctionWithoutParens() {\n const param = this.flowParsePrefixType();\n\n if (!this.state.noAnonFunctionType && this.eat(types.arrow)) {\n const node = this.startNodeAt(param.start, param.loc.start);\n node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];\n node.rest = null;\n node.returnType = this.flowParseType();\n node.typeParameters = null;\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n\n return param;\n }\n\n flowParseIntersectionType() {\n const node = this.startNode();\n this.eat(types.bitwiseAND);\n const type = this.flowParseAnonFunctionWithoutParens();\n node.types = [type];\n\n while (this.eat(types.bitwiseAND)) {\n node.types.push(this.flowParseAnonFunctionWithoutParens());\n }\n\n return node.types.length === 1 ? type : this.finishNode(node, \"IntersectionTypeAnnotation\");\n }\n\n flowParseUnionType() {\n const node = this.startNode();\n this.eat(types.bitwiseOR);\n const type = this.flowParseIntersectionType();\n node.types = [type];\n\n while (this.eat(types.bitwiseOR)) {\n node.types.push(this.flowParseIntersectionType());\n }\n\n return node.types.length === 1 ? type : this.finishNode(node, \"UnionTypeAnnotation\");\n }\n\n flowParseType() {\n const oldInType = this.state.inType;\n this.state.inType = true;\n const type = this.flowParseUnionType();\n this.state.inType = oldInType;\n this.state.exprAllowed = this.state.exprAllowed || this.state.noAnonFunctionType;\n return type;\n }\n\n flowParseTypeOrImplicitInstantiation() {\n if (this.state.type === types.name && this.state.value === \"_\") {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const node = this.parseIdentifier();\n return this.flowParseGenericType(startPos, startLoc, node);\n } else {\n return this.flowParseType();\n }\n }\n\n flowParseTypeAnnotation() {\n const node = this.startNode();\n node.typeAnnotation = this.flowParseTypeInitialiser();\n return this.finishNode(node, \"TypeAnnotation\");\n }\n\n flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {\n const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();\n\n if (this.match(types.colon)) {\n ident.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(ident);\n }\n\n return ident;\n }\n\n typeCastToParameter(node) {\n node.expression.typeAnnotation = node.typeAnnotation;\n this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end);\n return node.expression;\n }\n\n flowParseVariance() {\n let variance = null;\n\n if (this.match(types.plusMin)) {\n variance = this.startNode();\n\n if (this.state.value === \"+\") {\n variance.kind = \"plus\";\n } else {\n variance.kind = \"minus\";\n }\n\n this.next();\n this.finishNode(variance, \"Variance\");\n }\n\n return variance;\n }\n\n parseFunctionBody(node, allowExpressionBody, isMethod = false) {\n if (allowExpressionBody) {\n return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod));\n }\n\n return super.parseFunctionBody(node, false, isMethod);\n }\n\n parseFunctionBodyAndFinish(node, type, isMethod = false) {\n if (this.match(types.colon)) {\n const typeNode = this.startNode();\n [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();\n node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, \"TypeAnnotation\") : null;\n }\n\n super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n parseStatement(context, topLevel) {\n if (this.state.strict && this.match(types.name) && this.state.value === \"interface\") {\n const lookahead = this.lookahead();\n\n if (lookahead.type === types.name || isKeyword(lookahead.value)) {\n const node = this.startNode();\n this.next();\n return this.flowParseInterface(node);\n }\n } else if (this.shouldParseEnums() && this.isContextual(\"enum\")) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n\n const stmt = super.parseStatement(context, topLevel);\n\n if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {\n this.flowPragma = null;\n }\n\n return stmt;\n }\n\n parseExpressionStatement(node, expr) {\n if (expr.type === \"Identifier\") {\n if (expr.name === \"declare\") {\n if (this.match(types._class) || this.match(types.name) || this.match(types._function) || this.match(types._var) || this.match(types._export)) {\n return this.flowParseDeclare(node);\n }\n } else if (this.match(types.name)) {\n if (expr.name === \"interface\") {\n return this.flowParseInterface(node);\n } else if (expr.name === \"type\") {\n return this.flowParseTypeAlias(node);\n } else if (expr.name === \"opaque\") {\n return this.flowParseOpaqueType(node, false);\n }\n }\n }\n\n return super.parseExpressionStatement(node, expr);\n }\n\n shouldParseExportDeclaration() {\n return this.isContextual(\"type\") || this.isContextual(\"interface\") || this.isContextual(\"opaque\") || this.shouldParseEnums() && this.isContextual(\"enum\") || super.shouldParseExportDeclaration();\n }\n\n isExportDefaultSpecifier() {\n if (this.match(types.name) && (this.state.value === \"type\" || this.state.value === \"interface\" || this.state.value === \"opaque\" || this.shouldParseEnums() && this.state.value === \"enum\")) {\n return false;\n }\n\n return super.isExportDefaultSpecifier();\n }\n\n parseExportDefaultExpression() {\n if (this.shouldParseEnums() && this.isContextual(\"enum\")) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n\n return super.parseExportDefaultExpression();\n }\n\n parseConditional(expr, startPos, startLoc, refNeedsArrowPos) {\n if (!this.match(types.question)) return expr;\n\n if (refNeedsArrowPos) {\n const result = this.tryParse(() => super.parseConditional(expr, startPos, startLoc));\n\n if (!result.node) {\n refNeedsArrowPos.start = result.error.pos || this.state.start;\n return expr;\n }\n\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n this.expect(types.question);\n const state = this.state.clone();\n const originalNoArrowAt = this.state.noArrowAt;\n const node = this.startNodeAt(startPos, startLoc);\n let {\n consequent,\n failed\n } = this.tryParseConditionalConsequent();\n let [valid, invalid] = this.getArrowLikeExpressions(consequent);\n\n if (failed || invalid.length > 0) {\n const noArrowAt = [...originalNoArrowAt];\n\n if (invalid.length > 0) {\n this.state = state;\n this.state.noArrowAt = noArrowAt;\n\n for (let i = 0; i < invalid.length; i++) {\n noArrowAt.push(invalid[i].start);\n }\n\n ({\n consequent,\n failed\n } = this.tryParseConditionalConsequent());\n [valid, invalid] = this.getArrowLikeExpressions(consequent);\n }\n\n if (failed && valid.length > 1) {\n this.raise(state.start, FlowErrors.AmbiguousConditionalArrow);\n }\n\n if (failed && valid.length === 1) {\n this.state = state;\n this.state.noArrowAt = noArrowAt.concat(valid[0].start);\n ({\n consequent,\n failed\n } = this.tryParseConditionalConsequent());\n }\n }\n\n this.getArrowLikeExpressions(consequent, true);\n this.state.noArrowAt = originalNoArrowAt;\n this.expect(types.colon);\n node.test = expr;\n node.consequent = consequent;\n node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined, undefined));\n return this.finishNode(node, \"ConditionalExpression\");\n }\n\n tryParseConditionalConsequent() {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n const consequent = this.parseMaybeAssignAllowIn();\n const failed = !this.match(types.colon);\n this.state.noArrowParamsConversionAt.pop();\n return {\n consequent,\n failed\n };\n }\n\n getArrowLikeExpressions(node, disallowInvalid) {\n const stack = [node];\n const arrows = [];\n\n while (stack.length !== 0) {\n const node = stack.pop();\n\n if (node.type === \"ArrowFunctionExpression\") {\n if (node.typeParameters || !node.returnType) {\n this.finishArrowValidation(node);\n } else {\n arrows.push(node);\n }\n\n stack.push(node.body);\n } else if (node.type === \"ConditionalExpression\") {\n stack.push(node.consequent);\n stack.push(node.alternate);\n }\n }\n\n if (disallowInvalid) {\n arrows.forEach(node => this.finishArrowValidation(node));\n return [arrows, []];\n }\n\n return partition(arrows, node => node.params.every(param => this.isAssignable(param, true)));\n }\n\n finishArrowValidation(node) {\n var _node$extra;\n\n this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingComma);\n this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);\n super.checkParams(node, false, true);\n this.scope.exit();\n }\n\n forwardNoArrowParamsConversionAt(node, parse) {\n let result;\n\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n result = parse();\n this.state.noArrowParamsConversionAt.pop();\n } else {\n result = parse();\n }\n\n return result;\n }\n\n parseParenItem(node, startPos, startLoc) {\n node = super.parseParenItem(node, startPos, startLoc);\n\n if (this.eat(types.question)) {\n node.optional = true;\n this.resetEndLocation(node);\n }\n\n if (this.match(types.colon)) {\n const typeCastNode = this.startNodeAt(startPos, startLoc);\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();\n return this.finishNode(typeCastNode, \"TypeCastExpression\");\n }\n\n return node;\n }\n\n assertModuleNodeAllowed(node) {\n if (node.type === \"ImportDeclaration\" && (node.importKind === \"type\" || node.importKind === \"typeof\") || node.type === \"ExportNamedDeclaration\" && node.exportKind === \"type\" || node.type === \"ExportAllDeclaration\" && node.exportKind === \"type\") {\n return;\n }\n\n super.assertModuleNodeAllowed(node);\n }\n\n parseExport(node) {\n const decl = super.parseExport(node);\n\n if (decl.type === \"ExportNamedDeclaration\" || decl.type === \"ExportAllDeclaration\") {\n decl.exportKind = decl.exportKind || \"value\";\n }\n\n return decl;\n }\n\n parseExportDeclaration(node) {\n if (this.isContextual(\"type\")) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n\n if (this.match(types.braceL)) {\n node.specifiers = this.parseExportSpecifiers();\n this.parseExportFrom(node);\n return null;\n } else {\n return this.flowParseTypeAlias(declarationNode);\n }\n } else if (this.isContextual(\"opaque\")) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseOpaqueType(declarationNode, false);\n } else if (this.isContextual(\"interface\")) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseInterface(declarationNode);\n } else if (this.shouldParseEnums() && this.isContextual(\"enum\")) {\n node.exportKind = \"value\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(declarationNode);\n } else {\n return super.parseExportDeclaration(node);\n }\n }\n\n eatExportStar(node) {\n if (super.eatExportStar(...arguments)) return true;\n\n if (this.isContextual(\"type\") && this.lookahead().type === types.star) {\n node.exportKind = \"type\";\n this.next();\n this.next();\n return true;\n }\n\n return false;\n }\n\n maybeParseExportNamespaceSpecifier(node) {\n const pos = this.state.start;\n const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);\n\n if (hasNamespace && node.exportKind === \"type\") {\n this.unexpected(pos);\n }\n\n return hasNamespace;\n }\n\n parseClassId(node, isStatement, optionalId) {\n super.parseClassId(node, isStatement, optionalId);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n }\n\n parseClassMember(classBody, member, state) {\n const pos = this.state.start;\n\n if (this.isContextual(\"declare\")) {\n if (this.parseClassMemberFromModifier(classBody, member)) {\n return;\n }\n\n member.declare = true;\n }\n\n super.parseClassMember(classBody, member, state);\n\n if (member.declare) {\n if (member.type !== \"ClassProperty\" && member.type !== \"ClassPrivateProperty\") {\n this.raise(pos, FlowErrors.DeclareClassElement);\n } else if (member.value) {\n this.raise(member.value.start, FlowErrors.DeclareClassFieldInitializer);\n }\n }\n }\n\n getTokenFromCode(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (code === 123 && next === 124) {\n return this.finishOp(types.braceBarL, 2);\n } else if (this.state.inType && (code === 62 || code === 60)) {\n return this.finishOp(types.relational, 1);\n } else if (this.state.inType && code === 63) {\n return this.finishOp(types.question, 1);\n } else if (isIteratorStart(code, next)) {\n this.state.isIterator = true;\n return super.readWord();\n } else {\n return super.getTokenFromCode(code);\n }\n }\n\n isAssignable(node, isBinding) {\n switch (node.type) {\n case \"Identifier\":\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n return true;\n\n case \"ObjectExpression\":\n {\n const last = node.properties.length - 1;\n return node.properties.every((prop, i) => {\n return prop.type !== \"ObjectMethod\" && (i === last || prop.type === \"SpreadElement\") && this.isAssignable(prop);\n });\n }\n\n case \"ObjectProperty\":\n return this.isAssignable(node.value);\n\n case \"SpreadElement\":\n return this.isAssignable(node.argument);\n\n case \"ArrayExpression\":\n return node.elements.every(element => this.isAssignable(element));\n\n case \"AssignmentExpression\":\n return node.operator === \"=\";\n\n case \"ParenthesizedExpression\":\n case \"TypeCastExpression\":\n return this.isAssignable(node.expression);\n\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n return !isBinding;\n\n default:\n return false;\n }\n }\n\n toAssignable(node) {\n if (node.type === \"TypeCastExpression\") {\n return super.toAssignable(this.typeCastToParameter(node));\n } else {\n return super.toAssignable(node);\n }\n }\n\n toAssignableList(exprList, trailingCommaPos) {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n\n if ((expr == null ? void 0 : expr.type) === \"TypeCastExpression\") {\n exprList[i] = this.typeCastToParameter(expr);\n }\n }\n\n return super.toAssignableList(exprList, trailingCommaPos);\n }\n\n toReferencedList(exprList, isParenthesizedExpr) {\n for (let i = 0; i < exprList.length; i++) {\n var _expr$extra;\n\n const expr = exprList[i];\n\n if (expr && expr.type === \"TypeCastExpression\" && !((_expr$extra = expr.extra) == null ? void 0 : _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {\n this.raise(expr.typeAnnotation.start, FlowErrors.TypeCastInPattern);\n }\n }\n\n return exprList;\n }\n\n parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {\n const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors);\n\n if (canBePattern && !this.state.maybeInArrowParameters) {\n this.toReferencedList(node.elements);\n }\n\n return node;\n }\n\n checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) {\n if (expr.type !== \"TypeCastExpression\") {\n return super.checkLVal(expr, bindingType, checkClashes, contextDescription);\n }\n }\n\n parseClassProperty(node) {\n if (this.match(types.colon)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n\n return super.parseClassProperty(node);\n }\n\n parseClassPrivateProperty(node) {\n if (this.match(types.colon)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n\n return super.parseClassPrivateProperty(node);\n }\n\n isClassMethod() {\n return this.isRelational(\"<\") || super.isClassMethod();\n }\n\n isClassProperty() {\n return this.match(types.colon) || super.isClassProperty();\n }\n\n isNonstaticConstructor(method) {\n return !this.match(types.colon) && super.isNonstaticConstructor(method);\n }\n\n pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {\n if (method.variance) {\n this.unexpected(method.variance.start);\n }\n\n delete method.variance;\n\n if (this.isRelational(\"<\")) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);\n }\n\n pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {\n if (method.variance) {\n this.unexpected(method.variance.start);\n }\n\n delete method.variance;\n\n if (this.isRelational(\"<\")) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n parseClassSuper(node) {\n super.parseClassSuper(node);\n\n if (node.superClass && this.isRelational(\"<\")) {\n node.superTypeParameters = this.flowParseTypeParameterInstantiation();\n }\n\n if (this.isContextual(\"implements\")) {\n this.next();\n const implemented = node.implements = [];\n\n do {\n const node = this.startNode();\n node.id = this.flowParseRestrictedIdentifier(true);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n\n implemented.push(this.finishNode(node, \"ClassImplements\"));\n } while (this.eat(types.comma));\n }\n }\n\n parsePropertyName(node, isPrivateNameAllowed) {\n const variance = this.flowParseVariance();\n const key = super.parsePropertyName(node, isPrivateNameAllowed);\n node.variance = variance;\n return key;\n }\n\n parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {\n if (prop.variance) {\n this.unexpected(prop.variance.start);\n }\n\n delete prop.variance;\n let typeParameters;\n\n if (this.isRelational(\"<\") && !isAccessor) {\n typeParameters = this.flowParseTypeParameterDeclaration();\n if (!this.match(types.parenL)) this.unexpected();\n }\n\n super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);\n\n if (typeParameters) {\n (prop.value || prop).typeParameters = typeParameters;\n }\n }\n\n parseAssignableListItemTypes(param) {\n if (this.eat(types.question)) {\n if (param.type !== \"Identifier\") {\n this.raise(param.start, FlowErrors.OptionalBindingPattern);\n }\n\n param.optional = true;\n }\n\n if (this.match(types.colon)) {\n param.typeAnnotation = this.flowParseTypeAnnotation();\n }\n\n this.resetEndLocation(param);\n return param;\n }\n\n parseMaybeDefault(startPos, startLoc, left) {\n const node = super.parseMaybeDefault(startPos, startLoc, left);\n\n if (node.type === \"AssignmentPattern\" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {\n this.raise(node.typeAnnotation.start, FlowErrors.TypeBeforeInitializer);\n }\n\n return node;\n }\n\n shouldParseDefaultImport(node) {\n if (!hasTypeImportKind(node)) {\n return super.shouldParseDefaultImport(node);\n }\n\n return isMaybeDefaultImport(this.state);\n }\n\n parseImportSpecifierLocal(node, specifier, type, contextDescription) {\n specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier();\n this.checkLVal(specifier.local, BIND_LEXICAL, undefined, contextDescription);\n node.specifiers.push(this.finishNode(specifier, type));\n }\n\n maybeParseDefaultImportSpecifier(node) {\n node.importKind = \"value\";\n let kind = null;\n\n if (this.match(types._typeof)) {\n kind = \"typeof\";\n } else if (this.isContextual(\"type\")) {\n kind = \"type\";\n }\n\n if (kind) {\n const lh = this.lookahead();\n\n if (kind === \"type\" && lh.type === types.star) {\n this.unexpected(lh.start);\n }\n\n if (isMaybeDefaultImport(lh) || lh.type === types.braceL || lh.type === types.star) {\n this.next();\n node.importKind = kind;\n }\n }\n\n return super.maybeParseDefaultImportSpecifier(node);\n }\n\n parseImportSpecifier(node) {\n const specifier = this.startNode();\n const firstIdentLoc = this.state.start;\n const firstIdent = this.parseModuleExportName();\n let specifierTypeKind = null;\n\n if (firstIdent.type === \"Identifier\") {\n if (firstIdent.name === \"type\") {\n specifierTypeKind = \"type\";\n } else if (firstIdent.name === \"typeof\") {\n specifierTypeKind = \"typeof\";\n }\n }\n\n let isBinding = false;\n\n if (this.isContextual(\"as\") && !this.isLookaheadContextual(\"as\")) {\n const as_ident = this.parseIdentifier(true);\n\n if (specifierTypeKind !== null && !this.match(types.name) && !this.state.type.keyword) {\n specifier.imported = as_ident;\n specifier.importKind = specifierTypeKind;\n specifier.local = as_ident.__clone();\n } else {\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = this.parseIdentifier();\n }\n } else if (specifierTypeKind !== null && (this.match(types.name) || this.state.type.keyword)) {\n specifier.imported = this.parseIdentifier(true);\n specifier.importKind = specifierTypeKind;\n\n if (this.eatContextual(\"as\")) {\n specifier.local = this.parseIdentifier();\n } else {\n isBinding = true;\n specifier.local = specifier.imported.__clone();\n }\n } else {\n if (firstIdent.type === \"StringLiteral\") {\n throw this.raise(specifier.start, ErrorMessages.ImportBindingIsString, firstIdent.value);\n }\n\n isBinding = true;\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = specifier.imported.__clone();\n }\n\n const nodeIsTypeImport = hasTypeImportKind(node);\n const specifierIsTypeImport = hasTypeImportKind(specifier);\n\n if (nodeIsTypeImport && specifierIsTypeImport) {\n this.raise(firstIdentLoc, FlowErrors.ImportTypeShorthandOnlyInPureImport);\n }\n\n if (nodeIsTypeImport || specifierIsTypeImport) {\n this.checkReservedType(specifier.local.name, specifier.local.start, true);\n }\n\n if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) {\n this.checkReservedWord(specifier.local.name, specifier.start, true, true);\n }\n\n this.checkLVal(specifier.local, BIND_LEXICAL, undefined, \"import specifier\");\n node.specifiers.push(this.finishNode(specifier, \"ImportSpecifier\"));\n }\n\n parseFunctionParams(node, allowModifiers) {\n const kind = node.kind;\n\n if (kind !== \"get\" && kind !== \"set\" && this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.parseFunctionParams(node, allowModifiers);\n }\n\n parseVarId(decl, kind) {\n super.parseVarId(decl, kind);\n\n if (this.match(types.colon)) {\n decl.id.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(decl.id);\n }\n }\n\n parseAsyncArrowFromCallExpression(node, call) {\n if (this.match(types.colon)) {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n node.returnType = this.flowParseTypeAnnotation();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n }\n\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n shouldParseAsyncArrow() {\n return this.match(types.colon) || super.shouldParseAsyncArrow();\n }\n\n parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos) {\n var _jsx;\n\n let state = null;\n let jsx;\n\n if (this.hasPlugin(\"jsx\") && (this.match(types.jsxTagStart) || this.isRelational(\"<\"))) {\n state = this.state.clone();\n jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos), state);\n if (!jsx.error) return jsx.node;\n const {\n context\n } = this.state;\n\n if (context[context.length - 1] === types$1.j_oTag) {\n context.length -= 2;\n } else if (context[context.length - 1] === types$1.j_expr) {\n context.length -= 1;\n }\n }\n\n if (((_jsx = jsx) == null ? void 0 : _jsx.error) || this.isRelational(\"<\")) {\n var _jsx2, _jsx3;\n\n state = state || this.state.clone();\n let typeParameters;\n const arrow = this.tryParse(abort => {\n var _arrowExpression$extr;\n\n typeParameters = this.flowParseTypeParameterDeclaration();\n const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => {\n const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos);\n this.resetStartLocationFromNode(result, typeParameters);\n return result;\n });\n\n if (arrowExpression.type !== \"ArrowFunctionExpression\" && ((_arrowExpression$extr = arrowExpression.extra) == null ? void 0 : _arrowExpression$extr.parenthesized)) {\n abort();\n }\n\n const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);\n expr.typeParameters = typeParameters;\n this.resetStartLocationFromNode(expr, typeParameters);\n return arrowExpression;\n }, state);\n let arrowExpression = null;\n\n if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === \"ArrowFunctionExpression\") {\n if (!arrow.error && !arrow.aborted) {\n if (arrow.node.async) {\n this.raise(typeParameters.start, FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction);\n }\n\n return arrow.node;\n }\n\n arrowExpression = arrow.node;\n }\n\n if ((_jsx2 = jsx) == null ? void 0 : _jsx2.node) {\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrowExpression) {\n this.state = arrow.failState;\n return arrowExpression;\n }\n\n if ((_jsx3 = jsx) == null ? void 0 : _jsx3.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n throw this.raise(typeParameters.start, FlowErrors.UnexpectedTokenAfterTypeParameter);\n }\n\n return super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos);\n }\n\n parseArrow(node) {\n if (this.match(types.colon)) {\n const result = this.tryParse(() => {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n const typeNode = this.startNode();\n [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n if (this.canInsertSemicolon()) this.unexpected();\n if (!this.match(types.arrow)) this.unexpected();\n return typeNode;\n });\n if (result.thrown) return null;\n if (result.error) this.state = result.failState;\n node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, \"TypeAnnotation\") : null;\n }\n\n return super.parseArrow(node);\n }\n\n shouldParseArrow() {\n return this.match(types.colon) || super.shouldParseArrow();\n }\n\n setArrowFunctionParameters(node, params) {\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n node.params = params;\n } else {\n super.setArrowFunctionParameters(node, params);\n }\n }\n\n checkParams(node, allowDuplicates, isArrowFunction) {\n if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n return;\n }\n\n return super.checkParams(...arguments);\n }\n\n parseParenAndDistinguishExpression(canBeArrow) {\n return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1);\n }\n\n parseSubscripts(base, startPos, startLoc, noCalls) {\n if (base.type === \"Identifier\" && base.name === \"async\" && this.state.noArrowAt.indexOf(startPos) !== -1) {\n this.next();\n const node = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n node.arguments = this.parseCallExpressionArguments(types.parenR, false);\n base = this.finishNode(node, \"CallExpression\");\n } else if (base.type === \"Identifier\" && base.name === \"async\" && this.isRelational(\"<\")) {\n const state = this.state.clone();\n const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort(), state);\n if (!arrow.error && !arrow.aborted) return arrow.node;\n const result = this.tryParse(() => super.parseSubscripts(base, startPos, startLoc, noCalls), state);\n if (result.node && !result.error) return result.node;\n\n if (arrow.node) {\n this.state = arrow.failState;\n return arrow.node;\n }\n\n if (result.node) {\n this.state = result.failState;\n return result.node;\n }\n\n throw arrow.error || result.error;\n }\n\n return super.parseSubscripts(base, startPos, startLoc, noCalls);\n }\n\n parseSubscript(base, startPos, startLoc, noCalls, subscriptState) {\n if (this.match(types.questionDot) && this.isLookaheadToken_lt()) {\n subscriptState.optionalChainMember = true;\n\n if (noCalls) {\n subscriptState.stop = true;\n return base;\n }\n\n this.next();\n const node = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n node.typeArguments = this.flowParseTypeParameterInstantiation();\n this.expect(types.parenL);\n node.arguments = this.parseCallExpressionArguments(types.parenR, false);\n node.optional = true;\n return this.finishCallExpression(node, true);\n } else if (!noCalls && this.shouldParseTypes() && this.isRelational(\"<\")) {\n const node = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n const result = this.tryParse(() => {\n node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();\n this.expect(types.parenL);\n node.arguments = this.parseCallExpressionArguments(types.parenR, false);\n if (subscriptState.optionalChainMember) node.optional = false;\n return this.finishCallExpression(node, subscriptState.optionalChainMember);\n });\n\n if (result.node) {\n if (result.error) this.state = result.failState;\n return result.node;\n }\n }\n\n return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState);\n }\n\n parseNewArguments(node) {\n let targs = null;\n\n if (this.shouldParseTypes() && this.isRelational(\"<\")) {\n targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node;\n }\n\n node.typeArguments = targs;\n super.parseNewArguments(node);\n }\n\n parseAsyncArrowWithTypeParameters(startPos, startLoc) {\n const node = this.startNodeAt(startPos, startLoc);\n this.parseFunctionParams(node);\n if (!this.parseArrow(node)) return;\n return this.parseArrowExpression(node, undefined, true);\n }\n\n readToken_mult_modulo(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (code === 42 && next === 47 && this.state.hasFlowComment) {\n this.state.hasFlowComment = false;\n this.state.pos += 2;\n this.nextToken();\n return;\n }\n\n super.readToken_mult_modulo(code);\n }\n\n readToken_pipe_amp(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (code === 124 && next === 125) {\n this.finishOp(types.braceBarR, 2);\n return;\n }\n\n super.readToken_pipe_amp(code);\n }\n\n parseTopLevel(file, program) {\n const fileNode = super.parseTopLevel(file, program);\n\n if (this.state.hasFlowComment) {\n this.raise(this.state.pos, FlowErrors.UnterminatedFlowComment);\n }\n\n return fileNode;\n }\n\n skipBlockComment() {\n if (this.hasPlugin(\"flowComments\") && this.skipFlowComment()) {\n if (this.state.hasFlowComment) {\n this.unexpected(null, FlowErrors.NestedFlowComment);\n }\n\n this.hasFlowCommentCompletion();\n this.state.pos += this.skipFlowComment();\n this.state.hasFlowComment = true;\n return;\n }\n\n if (this.state.hasFlowComment) {\n const end = this.input.indexOf(\"*-/\", this.state.pos += 2);\n\n if (end === -1) {\n throw this.raise(this.state.pos - 2, ErrorMessages.UnterminatedComment);\n }\n\n this.state.pos = end + 3;\n return;\n }\n\n super.skipBlockComment();\n }\n\n skipFlowComment() {\n const {\n pos\n } = this.state;\n let shiftToFirstNonWhiteSpace = 2;\n\n while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {\n shiftToFirstNonWhiteSpace++;\n }\n\n const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);\n const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);\n\n if (ch2 === 58 && ch3 === 58) {\n return shiftToFirstNonWhiteSpace + 2;\n }\n\n if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === \"flow-include\") {\n return shiftToFirstNonWhiteSpace + 12;\n }\n\n if (ch2 === 58 && ch3 !== 58) {\n return shiftToFirstNonWhiteSpace;\n }\n\n return false;\n }\n\n hasFlowCommentCompletion() {\n const end = this.input.indexOf(\"*/\", this.state.pos);\n\n if (end === -1) {\n throw this.raise(this.state.pos, ErrorMessages.UnterminatedComment);\n }\n }\n\n flowEnumErrorBooleanMemberNotInitialized(pos, {\n enumName,\n memberName\n }) {\n this.raise(pos, FlowErrors.EnumBooleanMemberNotInitialized, memberName, enumName);\n }\n\n flowEnumErrorInvalidMemberName(pos, {\n enumName,\n memberName\n }) {\n const suggestion = memberName[0].toUpperCase() + memberName.slice(1);\n this.raise(pos, FlowErrors.EnumInvalidMemberName, memberName, suggestion, enumName);\n }\n\n flowEnumErrorDuplicateMemberName(pos, {\n enumName,\n memberName\n }) {\n this.raise(pos, FlowErrors.EnumDuplicateMemberName, memberName, enumName);\n }\n\n flowEnumErrorInconsistentMemberValues(pos, {\n enumName\n }) {\n this.raise(pos, FlowErrors.EnumInconsistentMemberValues, enumName);\n }\n\n flowEnumErrorInvalidExplicitType(pos, {\n enumName,\n suppliedType\n }) {\n return this.raise(pos, suppliedType === null ? FlowErrors.EnumInvalidExplicitTypeUnknownSupplied : FlowErrors.EnumInvalidExplicitType, enumName, suppliedType);\n }\n\n flowEnumErrorInvalidMemberInitializer(pos, {\n enumName,\n explicitType,\n memberName\n }) {\n let message = null;\n\n switch (explicitType) {\n case \"boolean\":\n case \"number\":\n case \"string\":\n message = FlowErrors.EnumInvalidMemberInitializerPrimaryType;\n break;\n\n case \"symbol\":\n message = FlowErrors.EnumInvalidMemberInitializerSymbolType;\n break;\n\n default:\n message = FlowErrors.EnumInvalidMemberInitializerUnknownType;\n }\n\n return this.raise(pos, message, enumName, memberName, explicitType);\n }\n\n flowEnumErrorNumberMemberNotInitialized(pos, {\n enumName,\n memberName\n }) {\n this.raise(pos, FlowErrors.EnumNumberMemberNotInitialized, enumName, memberName);\n }\n\n flowEnumErrorStringMemberInconsistentlyInitailized(pos, {\n enumName\n }) {\n this.raise(pos, FlowErrors.EnumStringMemberInconsistentlyInitailized, enumName);\n }\n\n flowEnumMemberInit() {\n const startPos = this.state.start;\n\n const endOfInit = () => this.match(types.comma) || this.match(types.braceR);\n\n switch (this.state.type) {\n case types.num:\n {\n const literal = this.parseLiteral(this.state.value, \"NumericLiteral\");\n\n if (endOfInit()) {\n return {\n type: \"number\",\n pos: literal.start,\n value: literal\n };\n }\n\n return {\n type: \"invalid\",\n pos: startPos\n };\n }\n\n case types.string:\n {\n const literal = this.parseLiteral(this.state.value, \"StringLiteral\");\n\n if (endOfInit()) {\n return {\n type: \"string\",\n pos: literal.start,\n value: literal\n };\n }\n\n return {\n type: \"invalid\",\n pos: startPos\n };\n }\n\n case types._true:\n case types._false:\n {\n const literal = this.parseBooleanLiteral();\n\n if (endOfInit()) {\n return {\n type: \"boolean\",\n pos: literal.start,\n value: literal\n };\n }\n\n return {\n type: \"invalid\",\n pos: startPos\n };\n }\n\n default:\n return {\n type: \"invalid\",\n pos: startPos\n };\n }\n }\n\n flowEnumMemberRaw() {\n const pos = this.state.start;\n const id = this.parseIdentifier(true);\n const init = this.eat(types.eq) ? this.flowEnumMemberInit() : {\n type: \"none\",\n pos\n };\n return {\n id,\n init\n };\n }\n\n flowEnumCheckExplicitTypeMismatch(pos, context, expectedType) {\n const {\n explicitType\n } = context;\n\n if (explicitType === null) {\n return;\n }\n\n if (explicitType !== expectedType) {\n this.flowEnumErrorInvalidMemberInitializer(pos, context);\n }\n }\n\n flowEnumMembers({\n enumName,\n explicitType\n }) {\n const seenNames = new Set();\n const members = {\n booleanMembers: [],\n numberMembers: [],\n stringMembers: [],\n defaultedMembers: []\n };\n\n while (!this.match(types.braceR)) {\n const memberNode = this.startNode();\n const {\n id,\n init\n } = this.flowEnumMemberRaw();\n const memberName = id.name;\n\n if (memberName === \"\") {\n continue;\n }\n\n if (/^[a-z]/.test(memberName)) {\n this.flowEnumErrorInvalidMemberName(id.start, {\n enumName,\n memberName\n });\n }\n\n if (seenNames.has(memberName)) {\n this.flowEnumErrorDuplicateMemberName(id.start, {\n enumName,\n memberName\n });\n }\n\n seenNames.add(memberName);\n const context = {\n enumName,\n explicitType,\n memberName\n };\n memberNode.id = id;\n\n switch (init.type) {\n case \"boolean\":\n {\n this.flowEnumCheckExplicitTypeMismatch(init.pos, context, \"boolean\");\n memberNode.init = init.value;\n members.booleanMembers.push(this.finishNode(memberNode, \"EnumBooleanMember\"));\n break;\n }\n\n case \"number\":\n {\n this.flowEnumCheckExplicitTypeMismatch(init.pos, context, \"number\");\n memberNode.init = init.value;\n members.numberMembers.push(this.finishNode(memberNode, \"EnumNumberMember\"));\n break;\n }\n\n case \"string\":\n {\n this.flowEnumCheckExplicitTypeMismatch(init.pos, context, \"string\");\n memberNode.init = init.value;\n members.stringMembers.push(this.finishNode(memberNode, \"EnumStringMember\"));\n break;\n }\n\n case \"invalid\":\n {\n throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context);\n }\n\n case \"none\":\n {\n switch (explicitType) {\n case \"boolean\":\n this.flowEnumErrorBooleanMemberNotInitialized(init.pos, context);\n break;\n\n case \"number\":\n this.flowEnumErrorNumberMemberNotInitialized(init.pos, context);\n break;\n\n default:\n members.defaultedMembers.push(this.finishNode(memberNode, \"EnumDefaultedMember\"));\n }\n }\n }\n\n if (!this.match(types.braceR)) {\n this.expect(types.comma);\n }\n }\n\n return members;\n }\n\n flowEnumStringMembers(initializedMembers, defaultedMembers, {\n enumName\n }) {\n if (initializedMembers.length === 0) {\n return defaultedMembers;\n } else if (defaultedMembers.length === 0) {\n return initializedMembers;\n } else if (defaultedMembers.length > initializedMembers.length) {\n for (let _i = 0; _i < initializedMembers.length; _i++) {\n const member = initializedMembers[_i];\n this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, {\n enumName\n });\n }\n\n return defaultedMembers;\n } else {\n for (let _i2 = 0; _i2 < defaultedMembers.length; _i2++) {\n const member = defaultedMembers[_i2];\n this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, {\n enumName\n });\n }\n\n return initializedMembers;\n }\n }\n\n flowEnumParseExplicitType({\n enumName\n }) {\n if (this.eatContextual(\"of\")) {\n if (!this.match(types.name)) {\n throw this.flowEnumErrorInvalidExplicitType(this.state.start, {\n enumName,\n suppliedType: null\n });\n }\n\n const {\n value\n } = this.state;\n this.next();\n\n if (value !== \"boolean\" && value !== \"number\" && value !== \"string\" && value !== \"symbol\") {\n this.flowEnumErrorInvalidExplicitType(this.state.start, {\n enumName,\n suppliedType: value\n });\n }\n\n return value;\n }\n\n return null;\n }\n\n flowEnumBody(node, {\n enumName,\n nameLoc\n }) {\n const explicitType = this.flowEnumParseExplicitType({\n enumName\n });\n this.expect(types.braceL);\n const members = this.flowEnumMembers({\n enumName,\n explicitType\n });\n\n switch (explicitType) {\n case \"boolean\":\n node.explicitType = true;\n node.members = members.booleanMembers;\n this.expect(types.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n\n case \"number\":\n node.explicitType = true;\n node.members = members.numberMembers;\n this.expect(types.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n\n case \"string\":\n node.explicitType = true;\n node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {\n enumName\n });\n this.expect(types.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n\n case \"symbol\":\n node.members = members.defaultedMembers;\n this.expect(types.braceR);\n return this.finishNode(node, \"EnumSymbolBody\");\n\n default:\n {\n const empty = () => {\n node.members = [];\n this.expect(types.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n };\n\n node.explicitType = false;\n const boolsLen = members.booleanMembers.length;\n const numsLen = members.numberMembers.length;\n const strsLen = members.stringMembers.length;\n const defaultedLen = members.defaultedMembers.length;\n\n if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {\n return empty();\n } else if (!boolsLen && !numsLen) {\n node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {\n enumName\n });\n this.expect(types.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {\n for (let _i3 = 0, _members$defaultedMem = members.defaultedMembers; _i3 < _members$defaultedMem.length; _i3++) {\n const member = _members$defaultedMem[_i3];\n this.flowEnumErrorBooleanMemberNotInitialized(member.start, {\n enumName,\n memberName: member.id.name\n });\n }\n\n node.members = members.booleanMembers;\n this.expect(types.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {\n for (let _i4 = 0, _members$defaultedMem2 = members.defaultedMembers; _i4 < _members$defaultedMem2.length; _i4++) {\n const member = _members$defaultedMem2[_i4];\n this.flowEnumErrorNumberMemberNotInitialized(member.start, {\n enumName,\n memberName: member.id.name\n });\n }\n\n node.members = members.numberMembers;\n this.expect(types.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n } else {\n this.flowEnumErrorInconsistentMemberValues(nameLoc, {\n enumName\n });\n return empty();\n }\n }\n }\n }\n\n flowParseEnumDeclaration(node) {\n const id = this.parseIdentifier();\n node.id = id;\n node.body = this.flowEnumBody(this.startNode(), {\n enumName: id.name,\n nameLoc: id.start\n });\n return this.finishNode(node, \"EnumDeclaration\");\n }\n\n updateContext(prevType) {\n if (this.match(types.name) && this.state.value === \"of\" && prevType === types.name && this.input.slice(this.state.lastTokStart, this.state.lastTokEnd) === \"interface\") {\n this.state.exprAllowed = false;\n } else {\n super.updateContext(prevType);\n }\n }\n\n isLookaheadToken_lt() {\n const next = this.nextTokenStart();\n\n if (this.input.charCodeAt(next) === 60) {\n const afterNext = this.input.charCodeAt(next + 1);\n return afterNext !== 60 && afterNext !== 61;\n }\n\n return false;\n }\n\n maybeUnwrapTypeCastExpression(node) {\n return node.type === \"TypeCastExpression\" ? node.expression : node;\n }\n\n }, _temp;\n});\n\nconst entities = {\n quot: \"\\u0022\",\n amp: \"&\",\n apos: \"\\u0027\",\n lt: \"<\",\n gt: \">\",\n nbsp: \"\\u00A0\",\n iexcl: \"\\u00A1\",\n cent: \"\\u00A2\",\n pound: \"\\u00A3\",\n curren: \"\\u00A4\",\n yen: \"\\u00A5\",\n brvbar: \"\\u00A6\",\n sect: \"\\u00A7\",\n uml: \"\\u00A8\",\n copy: \"\\u00A9\",\n ordf: \"\\u00AA\",\n laquo: \"\\u00AB\",\n not: \"\\u00AC\",\n shy: \"\\u00AD\",\n reg: \"\\u00AE\",\n macr: \"\\u00AF\",\n deg: \"\\u00B0\",\n plusmn: \"\\u00B1\",\n sup2: \"\\u00B2\",\n sup3: \"\\u00B3\",\n acute: \"\\u00B4\",\n micro: \"\\u00B5\",\n para: \"\\u00B6\",\n middot: \"\\u00B7\",\n cedil: \"\\u00B8\",\n sup1: \"\\u00B9\",\n ordm: \"\\u00BA\",\n raquo: \"\\u00BB\",\n frac14: \"\\u00BC\",\n frac12: \"\\u00BD\",\n frac34: \"\\u00BE\",\n iquest: \"\\u00BF\",\n Agrave: \"\\u00C0\",\n Aacute: \"\\u00C1\",\n Acirc: \"\\u00C2\",\n Atilde: \"\\u00C3\",\n Auml: \"\\u00C4\",\n Aring: \"\\u00C5\",\n AElig: \"\\u00C6\",\n Ccedil: \"\\u00C7\",\n Egrave: \"\\u00C8\",\n Eacute: \"\\u00C9\",\n Ecirc: \"\\u00CA\",\n Euml: \"\\u00CB\",\n Igrave: \"\\u00CC\",\n Iacute: \"\\u00CD\",\n Icirc: \"\\u00CE\",\n Iuml: \"\\u00CF\",\n ETH: \"\\u00D0\",\n Ntilde: \"\\u00D1\",\n Ograve: \"\\u00D2\",\n Oacute: \"\\u00D3\",\n Ocirc: \"\\u00D4\",\n Otilde: \"\\u00D5\",\n Ouml: \"\\u00D6\",\n times: \"\\u00D7\",\n Oslash: \"\\u00D8\",\n Ugrave: \"\\u00D9\",\n Uacute: \"\\u00DA\",\n Ucirc: \"\\u00DB\",\n Uuml: \"\\u00DC\",\n Yacute: \"\\u00DD\",\n THORN: \"\\u00DE\",\n szlig: \"\\u00DF\",\n agrave: \"\\u00E0\",\n aacute: \"\\u00E1\",\n acirc: \"\\u00E2\",\n atilde: \"\\u00E3\",\n auml: \"\\u00E4\",\n aring: \"\\u00E5\",\n aelig: \"\\u00E6\",\n ccedil: \"\\u00E7\",\n egrave: \"\\u00E8\",\n eacute: \"\\u00E9\",\n ecirc: \"\\u00EA\",\n euml: \"\\u00EB\",\n igrave: \"\\u00EC\",\n iacute: \"\\u00ED\",\n icirc: \"\\u00EE\",\n iuml: \"\\u00EF\",\n eth: \"\\u00F0\",\n ntilde: \"\\u00F1\",\n ograve: \"\\u00F2\",\n oacute: \"\\u00F3\",\n ocirc: \"\\u00F4\",\n otilde: \"\\u00F5\",\n ouml: \"\\u00F6\",\n divide: \"\\u00F7\",\n oslash: \"\\u00F8\",\n ugrave: \"\\u00F9\",\n uacute: \"\\u00FA\",\n ucirc: \"\\u00FB\",\n uuml: \"\\u00FC\",\n yacute: \"\\u00FD\",\n thorn: \"\\u00FE\",\n yuml: \"\\u00FF\",\n OElig: \"\\u0152\",\n oelig: \"\\u0153\",\n Scaron: \"\\u0160\",\n scaron: \"\\u0161\",\n Yuml: \"\\u0178\",\n fnof: \"\\u0192\",\n circ: \"\\u02C6\",\n tilde: \"\\u02DC\",\n Alpha: \"\\u0391\",\n Beta: \"\\u0392\",\n Gamma: \"\\u0393\",\n Delta: \"\\u0394\",\n Epsilon: \"\\u0395\",\n Zeta: \"\\u0396\",\n Eta: \"\\u0397\",\n Theta: \"\\u0398\",\n Iota: \"\\u0399\",\n Kappa: \"\\u039A\",\n Lambda: \"\\u039B\",\n Mu: \"\\u039C\",\n Nu: \"\\u039D\",\n Xi: \"\\u039E\",\n Omicron: \"\\u039F\",\n Pi: \"\\u03A0\",\n Rho: \"\\u03A1\",\n Sigma: \"\\u03A3\",\n Tau: \"\\u03A4\",\n Upsilon: \"\\u03A5\",\n Phi: \"\\u03A6\",\n Chi: \"\\u03A7\",\n Psi: \"\\u03A8\",\n Omega: \"\\u03A9\",\n alpha: \"\\u03B1\",\n beta: \"\\u03B2\",\n gamma: \"\\u03B3\",\n delta: \"\\u03B4\",\n epsilon: \"\\u03B5\",\n zeta: \"\\u03B6\",\n eta: \"\\u03B7\",\n theta: \"\\u03B8\",\n iota: \"\\u03B9\",\n kappa: \"\\u03BA\",\n lambda: \"\\u03BB\",\n mu: \"\\u03BC\",\n nu: \"\\u03BD\",\n xi: \"\\u03BE\",\n omicron: \"\\u03BF\",\n pi: \"\\u03C0\",\n rho: \"\\u03C1\",\n sigmaf: \"\\u03C2\",\n sigma: \"\\u03C3\",\n tau: \"\\u03C4\",\n upsilon: \"\\u03C5\",\n phi: \"\\u03C6\",\n chi: \"\\u03C7\",\n psi: \"\\u03C8\",\n omega: \"\\u03C9\",\n thetasym: \"\\u03D1\",\n upsih: \"\\u03D2\",\n piv: \"\\u03D6\",\n ensp: \"\\u2002\",\n emsp: \"\\u2003\",\n thinsp: \"\\u2009\",\n zwnj: \"\\u200C\",\n zwj: \"\\u200D\",\n lrm: \"\\u200E\",\n rlm: \"\\u200F\",\n ndash: \"\\u2013\",\n mdash: \"\\u2014\",\n lsquo: \"\\u2018\",\n rsquo: \"\\u2019\",\n sbquo: \"\\u201A\",\n ldquo: \"\\u201C\",\n rdquo: \"\\u201D\",\n bdquo: \"\\u201E\",\n dagger: \"\\u2020\",\n Dagger: \"\\u2021\",\n bull: \"\\u2022\",\n hellip: \"\\u2026\",\n permil: \"\\u2030\",\n prime: \"\\u2032\",\n Prime: \"\\u2033\",\n lsaquo: \"\\u2039\",\n rsaquo: \"\\u203A\",\n oline: \"\\u203E\",\n frasl: \"\\u2044\",\n euro: \"\\u20AC\",\n image: \"\\u2111\",\n weierp: \"\\u2118\",\n real: \"\\u211C\",\n trade: \"\\u2122\",\n alefsym: \"\\u2135\",\n larr: \"\\u2190\",\n uarr: \"\\u2191\",\n rarr: \"\\u2192\",\n darr: \"\\u2193\",\n harr: \"\\u2194\",\n crarr: \"\\u21B5\",\n lArr: \"\\u21D0\",\n uArr: \"\\u21D1\",\n rArr: \"\\u21D2\",\n dArr: \"\\u21D3\",\n hArr: \"\\u21D4\",\n forall: \"\\u2200\",\n part: \"\\u2202\",\n exist: \"\\u2203\",\n empty: \"\\u2205\",\n nabla: \"\\u2207\",\n isin: \"\\u2208\",\n notin: \"\\u2209\",\n ni: \"\\u220B\",\n prod: \"\\u220F\",\n sum: \"\\u2211\",\n minus: \"\\u2212\",\n lowast: \"\\u2217\",\n radic: \"\\u221A\",\n prop: \"\\u221D\",\n infin: \"\\u221E\",\n ang: \"\\u2220\",\n and: \"\\u2227\",\n or: \"\\u2228\",\n cap: \"\\u2229\",\n cup: \"\\u222A\",\n int: \"\\u222B\",\n there4: \"\\u2234\",\n sim: \"\\u223C\",\n cong: \"\\u2245\",\n asymp: \"\\u2248\",\n ne: \"\\u2260\",\n equiv: \"\\u2261\",\n le: \"\\u2264\",\n ge: \"\\u2265\",\n sub: \"\\u2282\",\n sup: \"\\u2283\",\n nsub: \"\\u2284\",\n sube: \"\\u2286\",\n supe: \"\\u2287\",\n oplus: \"\\u2295\",\n otimes: \"\\u2297\",\n perp: \"\\u22A5\",\n sdot: \"\\u22C5\",\n lceil: \"\\u2308\",\n rceil: \"\\u2309\",\n lfloor: \"\\u230A\",\n rfloor: \"\\u230B\",\n lang: \"\\u2329\",\n rang: \"\\u232A\",\n loz: \"\\u25CA\",\n spades: \"\\u2660\",\n clubs: \"\\u2663\",\n hearts: \"\\u2665\",\n diams: \"\\u2666\"\n};\n\nconst HEX_NUMBER = /^[\\da-fA-F]+$/;\nconst DECIMAL_NUMBER = /^\\d+$/;\nconst JsxErrors = Object.freeze({\n AttributeIsEmpty: \"JSX attributes must only be assigned a non-empty expression\",\n MissingClosingTagFragment: \"Expected corresponding JSX closing tag for <>\",\n MissingClosingTagElement: \"Expected corresponding JSX closing tag for <%0>\",\n UnsupportedJsxValue: \"JSX value should be either an expression or a quoted JSX text\",\n UnterminatedJsxContent: \"Unterminated JSX contents\",\n UnwrappedAdjacentJSXElements: \"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?\"\n});\ntypes$1.j_oTag = new TokContext(\"...\", true, true);\ntypes.jsxName = new TokenType(\"jsxName\");\ntypes.jsxText = new TokenType(\"jsxText\", {\n beforeExpr: true\n});\ntypes.jsxTagStart = new TokenType(\"jsxTagStart\", {\n startsExpr: true\n});\ntypes.jsxTagEnd = new TokenType(\"jsxTagEnd\");\n\ntypes.jsxTagStart.updateContext = function () {\n this.state.context.push(types$1.j_expr);\n this.state.context.push(types$1.j_oTag);\n this.state.exprAllowed = false;\n};\n\ntypes.jsxTagEnd.updateContext = function (prevType) {\n const out = this.state.context.pop();\n\n if (out === types$1.j_oTag && prevType === types.slash || out === types$1.j_cTag) {\n this.state.context.pop();\n this.state.exprAllowed = this.curContext() === types$1.j_expr;\n } else {\n this.state.exprAllowed = true;\n }\n};\n\nfunction isFragment(object) {\n return object ? object.type === \"JSXOpeningFragment\" || object.type === \"JSXClosingFragment\" : false;\n}\n\nfunction getQualifiedJSXName(object) {\n if (object.type === \"JSXIdentifier\") {\n return object.name;\n }\n\n if (object.type === \"JSXNamespacedName\") {\n return object.namespace.name + \":\" + object.name.name;\n }\n\n if (object.type === \"JSXMemberExpression\") {\n return getQualifiedJSXName(object.object) + \".\" + getQualifiedJSXName(object.property);\n }\n\n throw new Error(\"Node had unexpected type: \" + object.type);\n}\n\nvar jsx = (superClass => class extends superClass {\n jsxReadToken() {\n let out = \"\";\n let chunkStart = this.state.pos;\n\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(this.state.start, JsxErrors.UnterminatedJsxContent);\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n\n switch (ch) {\n case 60:\n case 123:\n if (this.state.pos === this.state.start) {\n if (ch === 60 && this.state.exprAllowed) {\n ++this.state.pos;\n return this.finishToken(types.jsxTagStart);\n }\n\n return super.getTokenFromCode(ch);\n }\n\n out += this.input.slice(chunkStart, this.state.pos);\n return this.finishToken(types.jsxText, out);\n\n case 38:\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n break;\n\n default:\n if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(true);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n\n }\n }\n }\n\n jsxReadNewLine(normalizeCRLF) {\n const ch = this.input.charCodeAt(this.state.pos);\n let out;\n ++this.state.pos;\n\n if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {\n ++this.state.pos;\n out = normalizeCRLF ? \"\\n\" : \"\\r\\n\";\n } else {\n out = String.fromCharCode(ch);\n }\n\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n return out;\n }\n\n jsxReadString(quote) {\n let out = \"\";\n let chunkStart = ++this.state.pos;\n\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(this.state.start, ErrorMessages.UnterminatedString);\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n if (ch === quote) break;\n\n if (ch === 38) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(false);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n\n out += this.input.slice(chunkStart, this.state.pos++);\n return this.finishToken(types.string, out);\n }\n\n jsxReadEntity() {\n let str = \"\";\n let count = 0;\n let entity;\n let ch = this.input[this.state.pos];\n const startPos = ++this.state.pos;\n\n while (this.state.pos < this.length && count++ < 10) {\n ch = this.input[this.state.pos++];\n\n if (ch === \";\") {\n if (str[0] === \"#\") {\n if (str[1] === \"x\") {\n str = str.substr(2);\n\n if (HEX_NUMBER.test(str)) {\n entity = String.fromCodePoint(parseInt(str, 16));\n }\n } else {\n str = str.substr(1);\n\n if (DECIMAL_NUMBER.test(str)) {\n entity = String.fromCodePoint(parseInt(str, 10));\n }\n }\n } else {\n entity = entities[str];\n }\n\n break;\n }\n\n str += ch;\n }\n\n if (!entity) {\n this.state.pos = startPos;\n return \"&\";\n }\n\n return entity;\n }\n\n jsxReadWord() {\n let ch;\n const start = this.state.pos;\n\n do {\n ch = this.input.charCodeAt(++this.state.pos);\n } while (isIdentifierChar(ch) || ch === 45);\n\n return this.finishToken(types.jsxName, this.input.slice(start, this.state.pos));\n }\n\n jsxParseIdentifier() {\n const node = this.startNode();\n\n if (this.match(types.jsxName)) {\n node.name = this.state.value;\n } else if (this.state.type.keyword) {\n node.name = this.state.type.keyword;\n } else {\n this.unexpected();\n }\n\n this.next();\n return this.finishNode(node, \"JSXIdentifier\");\n }\n\n jsxParseNamespacedName() {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const name = this.jsxParseIdentifier();\n if (!this.eat(types.colon)) return name;\n const node = this.startNodeAt(startPos, startLoc);\n node.namespace = name;\n node.name = this.jsxParseIdentifier();\n return this.finishNode(node, \"JSXNamespacedName\");\n }\n\n jsxParseElementName() {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n let node = this.jsxParseNamespacedName();\n\n if (node.type === \"JSXNamespacedName\") {\n return node;\n }\n\n while (this.eat(types.dot)) {\n const newNode = this.startNodeAt(startPos, startLoc);\n newNode.object = node;\n newNode.property = this.jsxParseIdentifier();\n node = this.finishNode(newNode, \"JSXMemberExpression\");\n }\n\n return node;\n }\n\n jsxParseAttributeValue() {\n let node;\n\n switch (this.state.type) {\n case types.braceL:\n node = this.startNode();\n this.next();\n node = this.jsxParseExpressionContainer(node);\n\n if (node.expression.type === \"JSXEmptyExpression\") {\n this.raise(node.start, JsxErrors.AttributeIsEmpty);\n }\n\n return node;\n\n case types.jsxTagStart:\n case types.string:\n return this.parseExprAtom();\n\n default:\n throw this.raise(this.state.start, JsxErrors.UnsupportedJsxValue);\n }\n }\n\n jsxParseEmptyExpression() {\n const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc);\n return this.finishNodeAt(node, \"JSXEmptyExpression\", this.state.start, this.state.startLoc);\n }\n\n jsxParseSpreadChild(node) {\n this.next();\n node.expression = this.parseExpression();\n this.expect(types.braceR);\n return this.finishNode(node, \"JSXSpreadChild\");\n }\n\n jsxParseExpressionContainer(node) {\n if (this.match(types.braceR)) {\n node.expression = this.jsxParseEmptyExpression();\n } else {\n node.expression = this.parseExpression();\n }\n\n this.expect(types.braceR);\n return this.finishNode(node, \"JSXExpressionContainer\");\n }\n\n jsxParseAttribute() {\n const node = this.startNode();\n\n if (this.eat(types.braceL)) {\n this.expect(types.ellipsis);\n node.argument = this.parseMaybeAssignAllowIn();\n this.expect(types.braceR);\n return this.finishNode(node, \"JSXSpreadAttribute\");\n }\n\n node.name = this.jsxParseNamespacedName();\n node.value = this.eat(types.eq) ? this.jsxParseAttributeValue() : null;\n return this.finishNode(node, \"JSXAttribute\");\n }\n\n jsxParseOpeningElementAt(startPos, startLoc) {\n const node = this.startNodeAt(startPos, startLoc);\n\n if (this.match(types.jsxTagEnd)) {\n this.expect(types.jsxTagEnd);\n return this.finishNode(node, \"JSXOpeningFragment\");\n }\n\n node.name = this.jsxParseElementName();\n return this.jsxParseOpeningElementAfterName(node);\n }\n\n jsxParseOpeningElementAfterName(node) {\n const attributes = [];\n\n while (!this.match(types.slash) && !this.match(types.jsxTagEnd)) {\n attributes.push(this.jsxParseAttribute());\n }\n\n node.attributes = attributes;\n node.selfClosing = this.eat(types.slash);\n this.expect(types.jsxTagEnd);\n return this.finishNode(node, \"JSXOpeningElement\");\n }\n\n jsxParseClosingElementAt(startPos, startLoc) {\n const node = this.startNodeAt(startPos, startLoc);\n\n if (this.match(types.jsxTagEnd)) {\n this.expect(types.jsxTagEnd);\n return this.finishNode(node, \"JSXClosingFragment\");\n }\n\n node.name = this.jsxParseElementName();\n this.expect(types.jsxTagEnd);\n return this.finishNode(node, \"JSXClosingElement\");\n }\n\n jsxParseElementAt(startPos, startLoc) {\n const node = this.startNodeAt(startPos, startLoc);\n const children = [];\n const openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);\n let closingElement = null;\n\n if (!openingElement.selfClosing) {\n contents: for (;;) {\n switch (this.state.type) {\n case types.jsxTagStart:\n startPos = this.state.start;\n startLoc = this.state.startLoc;\n this.next();\n\n if (this.eat(types.slash)) {\n closingElement = this.jsxParseClosingElementAt(startPos, startLoc);\n break contents;\n }\n\n children.push(this.jsxParseElementAt(startPos, startLoc));\n break;\n\n case types.jsxText:\n children.push(this.parseExprAtom());\n break;\n\n case types.braceL:\n {\n const node = this.startNode();\n this.next();\n\n if (this.match(types.ellipsis)) {\n children.push(this.jsxParseSpreadChild(node));\n } else {\n children.push(this.jsxParseExpressionContainer(node));\n }\n\n break;\n }\n\n default:\n throw this.unexpected();\n }\n }\n\n if (isFragment(openingElement) && !isFragment(closingElement)) {\n this.raise(closingElement.start, JsxErrors.MissingClosingTagFragment);\n } else if (!isFragment(openingElement) && isFragment(closingElement)) {\n this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name));\n } else if (!isFragment(openingElement) && !isFragment(closingElement)) {\n if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {\n this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name));\n }\n }\n }\n\n if (isFragment(openingElement)) {\n node.openingFragment = openingElement;\n node.closingFragment = closingElement;\n } else {\n node.openingElement = openingElement;\n node.closingElement = closingElement;\n }\n\n node.children = children;\n\n if (this.isRelational(\"<\")) {\n throw this.raise(this.state.start, JsxErrors.UnwrappedAdjacentJSXElements);\n }\n\n return isFragment(openingElement) ? this.finishNode(node, \"JSXFragment\") : this.finishNode(node, \"JSXElement\");\n }\n\n jsxParseElement() {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n this.next();\n return this.jsxParseElementAt(startPos, startLoc);\n }\n\n parseExprAtom(refExpressionErrors) {\n if (this.match(types.jsxText)) {\n return this.parseLiteral(this.state.value, \"JSXText\");\n } else if (this.match(types.jsxTagStart)) {\n return this.jsxParseElement();\n } else if (this.isRelational(\"<\") && this.input.charCodeAt(this.state.pos) !== 33) {\n this.finishToken(types.jsxTagStart);\n return this.jsxParseElement();\n } else {\n return super.parseExprAtom(refExpressionErrors);\n }\n }\n\n getTokenFromCode(code) {\n if (this.state.inPropertyName) return super.getTokenFromCode(code);\n const context = this.curContext();\n\n if (context === types$1.j_expr) {\n return this.jsxReadToken();\n }\n\n if (context === types$1.j_oTag || context === types$1.j_cTag) {\n if (isIdentifierStart(code)) {\n return this.jsxReadWord();\n }\n\n if (code === 62) {\n ++this.state.pos;\n return this.finishToken(types.jsxTagEnd);\n }\n\n if ((code === 34 || code === 39) && context === types$1.j_oTag) {\n return this.jsxReadString(code);\n }\n }\n\n if (code === 60 && this.state.exprAllowed && this.input.charCodeAt(this.state.pos + 1) !== 33) {\n ++this.state.pos;\n return this.finishToken(types.jsxTagStart);\n }\n\n return super.getTokenFromCode(code);\n }\n\n updateContext(prevType) {\n if (this.match(types.braceL)) {\n const curContext = this.curContext();\n\n if (curContext === types$1.j_oTag) {\n this.state.context.push(types$1.braceExpression);\n } else if (curContext === types$1.j_expr) {\n this.state.context.push(types$1.templateQuasi);\n } else {\n super.updateContext(prevType);\n }\n\n this.state.exprAllowed = true;\n } else if (this.match(types.slash) && prevType === types.jsxTagStart) {\n this.state.context.length -= 2;\n this.state.context.push(types$1.j_cTag);\n this.state.exprAllowed = false;\n } else {\n return super.updateContext(prevType);\n }\n }\n\n});\n\nclass Scope {\n constructor(flags) {\n this.flags = void 0;\n this.var = [];\n this.lexical = [];\n this.functions = [];\n this.flags = flags;\n }\n\n}\nclass ScopeHandler {\n constructor(raise, inModule) {\n this.scopeStack = [];\n this.undefinedExports = new Map();\n this.undefinedPrivateNames = new Map();\n this.raise = raise;\n this.inModule = inModule;\n }\n\n get inFunction() {\n return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;\n }\n\n get allowSuper() {\n return (this.currentThisScope().flags & SCOPE_SUPER) > 0;\n }\n\n get allowDirectSuper() {\n return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0;\n }\n\n get inClass() {\n return (this.currentThisScope().flags & SCOPE_CLASS) > 0;\n }\n\n get inNonArrowFunction() {\n return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0;\n }\n\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n\n createScope(flags) {\n return new Scope(flags);\n }\n\n enter(flags) {\n this.scopeStack.push(this.createScope(flags));\n }\n\n exit() {\n this.scopeStack.pop();\n }\n\n treatFunctionsAsVarInScope(scope) {\n return !!(scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_PROGRAM);\n }\n\n declareName(name, bindingType, pos) {\n let scope = this.currentScope();\n\n if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n scope.functions.push(name);\n } else {\n scope.lexical.push(name);\n }\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BIND_SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n scope.var.push(name);\n this.maybeExportDefined(scope, name);\n if (scope.flags & SCOPE_VAR) break;\n }\n }\n\n if (this.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n maybeExportDefined(scope, name) {\n if (this.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n checkRedeclarationInScope(scope, name, bindingType, pos) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.raise(pos, ErrorMessages.VarRedeclaration, name);\n }\n }\n\n isRedeclaredInScope(scope, name, bindingType) {\n if (!(bindingType & BIND_KIND_VALUE)) return false;\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n return scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;\n }\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n return scope.lexical.indexOf(name) > -1 || !this.treatFunctionsAsVarInScope(scope) && scope.var.indexOf(name) > -1;\n }\n\n return scope.lexical.indexOf(name) > -1 && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.indexOf(name) > -1;\n }\n\n checkLocalExport(id) {\n if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1 && this.scopeStack[0].functions.indexOf(id.name) === -1) {\n this.undefinedExports.set(id.name, id.start);\n }\n }\n\n currentScope() {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n\n currentVarScope() {\n for (let i = this.scopeStack.length - 1;; i--) {\n const scope = this.scopeStack[i];\n\n if (scope.flags & SCOPE_VAR) {\n return scope;\n }\n }\n }\n\n currentThisScope() {\n for (let i = this.scopeStack.length - 1;; i--) {\n const scope = this.scopeStack[i];\n\n if ((scope.flags & SCOPE_VAR || scope.flags & SCOPE_CLASS) && !(scope.flags & SCOPE_ARROW)) {\n return scope;\n }\n }\n }\n\n}\n\nclass TypeScriptScope extends Scope {\n constructor(...args) {\n super(...args);\n this.types = [];\n this.enums = [];\n this.constEnums = [];\n this.classes = [];\n this.exportOnlyBindings = [];\n }\n\n}\n\nclass TypeScriptScopeHandler extends ScopeHandler {\n createScope(flags) {\n return new TypeScriptScope(flags);\n }\n\n declareName(name, bindingType, pos) {\n const scope = this.currentScope();\n\n if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {\n this.maybeExportDefined(scope, name);\n scope.exportOnlyBindings.push(name);\n return;\n }\n\n super.declareName(...arguments);\n\n if (bindingType & BIND_KIND_TYPE) {\n if (!(bindingType & BIND_KIND_VALUE)) {\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n this.maybeExportDefined(scope, name);\n }\n\n scope.types.push(name);\n }\n\n if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.push(name);\n if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.push(name);\n if (bindingType & BIND_FLAGS_CLASS) scope.classes.push(name);\n }\n\n isRedeclaredInScope(scope, name, bindingType) {\n if (scope.enums.indexOf(name) > -1) {\n if (bindingType & BIND_FLAGS_TS_ENUM) {\n const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);\n const wasConst = scope.constEnums.indexOf(name) > -1;\n return isConst !== wasConst;\n }\n\n return true;\n }\n\n if (bindingType & BIND_FLAGS_CLASS && scope.classes.indexOf(name) > -1) {\n if (scope.lexical.indexOf(name) > -1) {\n return !!(bindingType & BIND_KIND_VALUE);\n } else {\n return false;\n }\n }\n\n if (bindingType & BIND_KIND_TYPE && scope.types.indexOf(name) > -1) {\n return true;\n }\n\n return super.isRedeclaredInScope(...arguments);\n }\n\n checkLocalExport(id) {\n if (this.scopeStack[0].types.indexOf(id.name) === -1 && this.scopeStack[0].exportOnlyBindings.indexOf(id.name) === -1) {\n super.checkLocalExport(id);\n }\n }\n\n}\n\nconst PARAM = 0b0000,\n PARAM_YIELD = 0b0001,\n PARAM_AWAIT = 0b0010,\n PARAM_RETURN = 0b0100,\n PARAM_IN = 0b1000;\nclass ProductionParameterHandler {\n constructor() {\n this.stacks = [];\n }\n\n enter(flags) {\n this.stacks.push(flags);\n }\n\n exit() {\n this.stacks.pop();\n }\n\n currentFlags() {\n return this.stacks[this.stacks.length - 1];\n }\n\n get hasAwait() {\n return (this.currentFlags() & PARAM_AWAIT) > 0;\n }\n\n get hasYield() {\n return (this.currentFlags() & PARAM_YIELD) > 0;\n }\n\n get hasReturn() {\n return (this.currentFlags() & PARAM_RETURN) > 0;\n }\n\n get hasIn() {\n return (this.currentFlags() & PARAM_IN) > 0;\n }\n\n}\nfunction functionFlags(isAsync, isGenerator) {\n return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);\n}\n\nfunction nonNull(x) {\n if (x == null) {\n throw new Error(`Unexpected ${x} value.`);\n }\n\n return x;\n}\n\nfunction assert(x) {\n if (!x) {\n throw new Error(\"Assert fail\");\n }\n}\n\nconst TSErrors = Object.freeze({\n ClassMethodHasDeclare: \"Class methods cannot have the 'declare' modifier\",\n ClassMethodHasReadonly: \"Class methods cannot have the 'readonly' modifier\",\n ConstructorHasTypeParameters: \"Type parameters cannot appear on a constructor declaration.\",\n DeclareClassFieldHasInitializer: \"Initializers are not allowed in ambient contexts.\",\n DeclareFunctionHasImplementation: \"An implementation cannot be declared in ambient contexts.\",\n DuplicateModifier: \"Duplicate modifier: '%0'\",\n EmptyHeritageClauseType: \"'%0' list cannot be empty.\",\n EmptyTypeArguments: \"Type argument list cannot be empty.\",\n EmptyTypeParameters: \"Type parameter list cannot be empty.\",\n IndexSignatureHasAbstract: \"Index signatures cannot have the 'abstract' modifier\",\n IndexSignatureHasAccessibility: \"Index signatures cannot have an accessibility modifier ('%0')\",\n IndexSignatureHasStatic: \"Index signatures cannot have the 'static' modifier\",\n IndexSignatureHasDeclare: \"Index signatures cannot have the 'declare' modifier\",\n InvalidTupleMemberLabel: \"Tuple members must be labeled with a simple identifier.\",\n MixedLabeledAndUnlabeledElements: \"Tuple members must all have names or all not have names.\",\n OptionalTypeBeforeRequired: \"A required element cannot follow an optional element.\",\n PatternIsOptional: \"A binding pattern parameter cannot be optional in an implementation signature.\",\n PrivateElementHasAbstract: \"Private elements cannot have the 'abstract' modifier.\",\n PrivateElementHasAccessibility: \"Private elements cannot have an accessibility modifier ('%0')\",\n TypeAnnotationAfterAssign: \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`\",\n UnexpectedParameterModifier: \"A parameter property is only allowed in a constructor implementation.\",\n UnexpectedReadonly: \"'readonly' type modifier is only permitted on array and tuple literal types.\",\n UnexpectedTypeAnnotation: \"Did not expect a type annotation here.\",\n UnexpectedTypeCastInParameter: \"Unexpected type cast in parameter position.\",\n UnsupportedImportTypeArgument: \"Argument in a type import must be a string literal\",\n UnsupportedParameterPropertyKind: \"A parameter property may not be declared using a binding pattern.\",\n UnsupportedSignatureParameterKind: \"Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got %0\"\n});\n\nfunction keywordTypeFromName(value) {\n switch (value) {\n case \"any\":\n return \"TSAnyKeyword\";\n\n case \"boolean\":\n return \"TSBooleanKeyword\";\n\n case \"bigint\":\n return \"TSBigIntKeyword\";\n\n case \"never\":\n return \"TSNeverKeyword\";\n\n case \"number\":\n return \"TSNumberKeyword\";\n\n case \"object\":\n return \"TSObjectKeyword\";\n\n case \"string\":\n return \"TSStringKeyword\";\n\n case \"symbol\":\n return \"TSSymbolKeyword\";\n\n case \"undefined\":\n return \"TSUndefinedKeyword\";\n\n case \"unknown\":\n return \"TSUnknownKeyword\";\n\n default:\n return undefined;\n }\n}\n\nvar typescript = (superClass => class extends superClass {\n getScopeHandler() {\n return TypeScriptScopeHandler;\n }\n\n tsIsIdentifier() {\n return this.match(types.name);\n }\n\n tsNextTokenCanFollowModifier() {\n this.next();\n return !this.hasPrecedingLineBreak() && !this.match(types.parenL) && !this.match(types.parenR) && !this.match(types.colon) && !this.match(types.eq) && !this.match(types.question) && !this.match(types.bang);\n }\n\n tsParseModifier(allowedModifiers) {\n if (!this.match(types.name)) {\n return undefined;\n }\n\n const modifier = this.state.value;\n\n if (allowedModifiers.indexOf(modifier) !== -1 && this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {\n return modifier;\n }\n\n return undefined;\n }\n\n tsParseModifiers(modified, allowedModifiers) {\n for (;;) {\n const startPos = this.state.start;\n const modifier = this.tsParseModifier(allowedModifiers);\n if (!modifier) break;\n\n if (Object.hasOwnProperty.call(modified, modifier)) {\n this.raise(startPos, TSErrors.DuplicateModifier, modifier);\n }\n\n modified[modifier] = true;\n }\n }\n\n tsIsListTerminator(kind) {\n switch (kind) {\n case \"EnumMembers\":\n case \"TypeMembers\":\n return this.match(types.braceR);\n\n case \"HeritageClauseElement\":\n return this.match(types.braceL);\n\n case \"TupleElementTypes\":\n return this.match(types.bracketR);\n\n case \"TypeParametersOrArguments\":\n return this.isRelational(\">\");\n }\n\n throw new Error(\"Unreachable\");\n }\n\n tsParseList(kind, parseElement) {\n const result = [];\n\n while (!this.tsIsListTerminator(kind)) {\n result.push(parseElement());\n }\n\n return result;\n }\n\n tsParseDelimitedList(kind, parseElement) {\n return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true));\n }\n\n tsParseDelimitedListWorker(kind, parseElement, expectSuccess) {\n const result = [];\n\n for (;;) {\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n\n const element = parseElement();\n\n if (element == null) {\n return undefined;\n }\n\n result.push(element);\n\n if (this.eat(types.comma)) {\n continue;\n }\n\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n\n if (expectSuccess) {\n this.expect(types.comma);\n }\n\n return undefined;\n }\n\n return result;\n }\n\n tsParseBracketedList(kind, parseElement, bracket, skipFirstToken) {\n if (!skipFirstToken) {\n if (bracket) {\n this.expect(types.bracketL);\n } else {\n this.expectRelational(\"<\");\n }\n }\n\n const result = this.tsParseDelimitedList(kind, parseElement);\n\n if (bracket) {\n this.expect(types.bracketR);\n } else {\n this.expectRelational(\">\");\n }\n\n return result;\n }\n\n tsParseImportType() {\n const node = this.startNode();\n this.expect(types._import);\n this.expect(types.parenL);\n\n if (!this.match(types.string)) {\n this.raise(this.state.start, TSErrors.UnsupportedImportTypeArgument);\n }\n\n node.argument = this.parseExprAtom();\n this.expect(types.parenR);\n\n if (this.eat(types.dot)) {\n node.qualifier = this.tsParseEntityName(true);\n }\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n\n return this.finishNode(node, \"TSImportType\");\n }\n\n tsParseEntityName(allowReservedWords) {\n let entity = this.parseIdentifier();\n\n while (this.eat(types.dot)) {\n const node = this.startNodeAtNode(entity);\n node.left = entity;\n node.right = this.parseIdentifier(allowReservedWords);\n entity = this.finishNode(node, \"TSQualifiedName\");\n }\n\n return entity;\n }\n\n tsParseTypeReference() {\n const node = this.startNode();\n node.typeName = this.tsParseEntityName(false);\n\n if (!this.hasPrecedingLineBreak() && this.isRelational(\"<\")) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n\n return this.finishNode(node, \"TSTypeReference\");\n }\n\n tsParseThisTypePredicate(lhs) {\n this.next();\n const node = this.startNodeAtNode(lhs);\n node.parameterName = lhs;\n node.typeAnnotation = this.tsParseTypeAnnotation(false);\n return this.finishNode(node, \"TSTypePredicate\");\n }\n\n tsParseThisTypeNode() {\n const node = this.startNode();\n this.next();\n return this.finishNode(node, \"TSThisType\");\n }\n\n tsParseTypeQuery() {\n const node = this.startNode();\n this.expect(types._typeof);\n\n if (this.match(types._import)) {\n node.exprName = this.tsParseImportType();\n } else {\n node.exprName = this.tsParseEntityName(true);\n }\n\n return this.finishNode(node, \"TSTypeQuery\");\n }\n\n tsParseTypeParameter() {\n const node = this.startNode();\n node.name = this.parseIdentifierName(node.start);\n node.constraint = this.tsEatThenParseType(types._extends);\n node.default = this.tsEatThenParseType(types.eq);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n\n tsTryParseTypeParameters() {\n if (this.isRelational(\"<\")) {\n return this.tsParseTypeParameters();\n }\n }\n\n tsParseTypeParameters() {\n const node = this.startNode();\n\n if (this.isRelational(\"<\") || this.match(types.jsxTagStart)) {\n this.next();\n } else {\n this.unexpected();\n }\n\n node.params = this.tsParseBracketedList(\"TypeParametersOrArguments\", this.tsParseTypeParameter.bind(this), false, true);\n\n if (node.params.length === 0) {\n this.raise(node.start, TSErrors.EmptyTypeParameters);\n }\n\n return this.finishNode(node, \"TSTypeParameterDeclaration\");\n }\n\n tsTryNextParseConstantContext() {\n if (this.lookahead().type === types._const) {\n this.next();\n return this.tsParseTypeReference();\n }\n\n return null;\n }\n\n tsFillSignature(returnToken, signature) {\n const returnTokenRequired = returnToken === types.arrow;\n signature.typeParameters = this.tsTryParseTypeParameters();\n this.expect(types.parenL);\n signature.parameters = this.tsParseBindingListForSignature();\n\n if (returnTokenRequired) {\n signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);\n } else if (this.match(returnToken)) {\n signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);\n }\n }\n\n tsParseBindingListForSignature() {\n return this.parseBindingList(types.parenR, 41).map(pattern => {\n if (pattern.type !== \"Identifier\" && pattern.type !== \"RestElement\" && pattern.type !== \"ObjectPattern\" && pattern.type !== \"ArrayPattern\") {\n this.raise(pattern.start, TSErrors.UnsupportedSignatureParameterKind, pattern.type);\n }\n\n return pattern;\n });\n }\n\n tsParseTypeMemberSemicolon() {\n if (!this.eat(types.comma)) {\n this.semicolon();\n }\n }\n\n tsParseSignatureMember(kind, node) {\n this.tsFillSignature(types.colon, node);\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, kind);\n }\n\n tsIsUnambiguouslyIndexSignature() {\n this.next();\n return this.eat(types.name) && this.match(types.colon);\n }\n\n tsTryParseIndexSignature(node) {\n if (!(this.match(types.bracketL) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) {\n return undefined;\n }\n\n this.expect(types.bracketL);\n const id = this.parseIdentifier();\n id.typeAnnotation = this.tsParseTypeAnnotation();\n this.resetEndLocation(id);\n this.expect(types.bracketR);\n node.parameters = [id];\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, \"TSIndexSignature\");\n }\n\n tsParsePropertyOrMethodSignature(node, readonly) {\n if (this.eat(types.question)) node.optional = true;\n const nodeAny = node;\n\n if (!readonly && (this.match(types.parenL) || this.isRelational(\"<\"))) {\n const method = nodeAny;\n this.tsFillSignature(types.colon, method);\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(method, \"TSMethodSignature\");\n } else {\n const property = nodeAny;\n if (readonly) property.readonly = true;\n const type = this.tsTryParseTypeAnnotation();\n if (type) property.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(property, \"TSPropertySignature\");\n }\n }\n\n tsParseTypeMember() {\n const node = this.startNode();\n\n if (this.match(types.parenL) || this.isRelational(\"<\")) {\n return this.tsParseSignatureMember(\"TSCallSignatureDeclaration\", node);\n }\n\n if (this.match(types._new)) {\n const id = this.startNode();\n this.next();\n\n if (this.match(types.parenL) || this.isRelational(\"<\")) {\n return this.tsParseSignatureMember(\"TSConstructSignatureDeclaration\", node);\n } else {\n node.key = this.createIdentifier(id, \"new\");\n return this.tsParsePropertyOrMethodSignature(node, false);\n }\n }\n\n const readonly = !!this.tsParseModifier([\"readonly\"]);\n const idx = this.tsTryParseIndexSignature(node);\n\n if (idx) {\n if (readonly) node.readonly = true;\n return idx;\n }\n\n this.parsePropertyName(node, false);\n return this.tsParsePropertyOrMethodSignature(node, readonly);\n }\n\n tsParseTypeLiteral() {\n const node = this.startNode();\n node.members = this.tsParseObjectTypeMembers();\n return this.finishNode(node, \"TSTypeLiteral\");\n }\n\n tsParseObjectTypeMembers() {\n this.expect(types.braceL);\n const members = this.tsParseList(\"TypeMembers\", this.tsParseTypeMember.bind(this));\n this.expect(types.braceR);\n return members;\n }\n\n tsIsStartOfMappedType() {\n this.next();\n\n if (this.eat(types.plusMin)) {\n return this.isContextual(\"readonly\");\n }\n\n if (this.isContextual(\"readonly\")) {\n this.next();\n }\n\n if (!this.match(types.bracketL)) {\n return false;\n }\n\n this.next();\n\n if (!this.tsIsIdentifier()) {\n return false;\n }\n\n this.next();\n return this.match(types._in);\n }\n\n tsParseMappedTypeParameter() {\n const node = this.startNode();\n node.name = this.parseIdentifierName(node.start);\n node.constraint = this.tsExpectThenParseType(types._in);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n\n tsParseMappedType() {\n const node = this.startNode();\n this.expect(types.braceL);\n\n if (this.match(types.plusMin)) {\n node.readonly = this.state.value;\n this.next();\n this.expectContextual(\"readonly\");\n } else if (this.eatContextual(\"readonly\")) {\n node.readonly = true;\n }\n\n this.expect(types.bracketL);\n node.typeParameter = this.tsParseMappedTypeParameter();\n node.nameType = this.eatContextual(\"as\") ? this.tsParseType() : null;\n this.expect(types.bracketR);\n\n if (this.match(types.plusMin)) {\n node.optional = this.state.value;\n this.next();\n this.expect(types.question);\n } else if (this.eat(types.question)) {\n node.optional = true;\n }\n\n node.typeAnnotation = this.tsTryParseType();\n this.semicolon();\n this.expect(types.braceR);\n return this.finishNode(node, \"TSMappedType\");\n }\n\n tsParseTupleType() {\n const node = this.startNode();\n node.elementTypes = this.tsParseBracketedList(\"TupleElementTypes\", this.tsParseTupleElementType.bind(this), true, false);\n let seenOptionalElement = false;\n let labeledElements = null;\n node.elementTypes.forEach(elementNode => {\n var _labeledElements;\n\n let {\n type\n } = elementNode;\n\n if (seenOptionalElement && type !== \"TSRestType\" && type !== \"TSOptionalType\" && !(type === \"TSNamedTupleMember\" && elementNode.optional)) {\n this.raise(elementNode.start, TSErrors.OptionalTypeBeforeRequired);\n }\n\n seenOptionalElement = seenOptionalElement || type === \"TSNamedTupleMember\" && elementNode.optional || type === \"TSOptionalType\";\n\n if (type === \"TSRestType\") {\n elementNode = elementNode.typeAnnotation;\n type = elementNode.type;\n }\n\n const isLabeled = type === \"TSNamedTupleMember\";\n labeledElements = (_labeledElements = labeledElements) != null ? _labeledElements : isLabeled;\n\n if (labeledElements !== isLabeled) {\n this.raise(elementNode.start, TSErrors.MixedLabeledAndUnlabeledElements);\n }\n });\n return this.finishNode(node, \"TSTupleType\");\n }\n\n tsParseTupleElementType() {\n const {\n start: startPos,\n startLoc\n } = this.state;\n const rest = this.eat(types.ellipsis);\n let type = this.tsParseType();\n const optional = this.eat(types.question);\n const labeled = this.eat(types.colon);\n\n if (labeled) {\n const labeledNode = this.startNodeAtNode(type);\n labeledNode.optional = optional;\n\n if (type.type === \"TSTypeReference\" && !type.typeParameters && type.typeName.type === \"Identifier\") {\n labeledNode.label = type.typeName;\n } else {\n this.raise(type.start, TSErrors.InvalidTupleMemberLabel);\n labeledNode.label = type;\n }\n\n labeledNode.elementType = this.tsParseType();\n type = this.finishNode(labeledNode, \"TSNamedTupleMember\");\n } else if (optional) {\n const optionalTypeNode = this.startNodeAtNode(type);\n optionalTypeNode.typeAnnotation = type;\n type = this.finishNode(optionalTypeNode, \"TSOptionalType\");\n }\n\n if (rest) {\n const restNode = this.startNodeAt(startPos, startLoc);\n restNode.typeAnnotation = type;\n type = this.finishNode(restNode, \"TSRestType\");\n }\n\n return type;\n }\n\n tsParseParenthesizedType() {\n const node = this.startNode();\n this.expect(types.parenL);\n node.typeAnnotation = this.tsParseType();\n this.expect(types.parenR);\n return this.finishNode(node, \"TSParenthesizedType\");\n }\n\n tsParseFunctionOrConstructorType(type) {\n const node = this.startNode();\n\n if (type === \"TSConstructorType\") {\n this.expect(types._new);\n }\n\n this.tsFillSignature(types.arrow, node);\n return this.finishNode(node, type);\n }\n\n tsParseLiteralTypeNode() {\n const node = this.startNode();\n\n node.literal = (() => {\n switch (this.state.type) {\n case types.num:\n case types.bigint:\n case types.string:\n case types._true:\n case types._false:\n return this.parseExprAtom();\n\n default:\n throw this.unexpected();\n }\n })();\n\n return this.finishNode(node, \"TSLiteralType\");\n }\n\n tsParseTemplateLiteralType() {\n const node = this.startNode();\n node.literal = this.parseTemplate(false);\n return this.finishNode(node, \"TSLiteralType\");\n }\n\n parseTemplateSubstitution() {\n if (this.state.inType) return this.tsParseType();\n return super.parseTemplateSubstitution();\n }\n\n tsParseThisTypeOrThisTypePredicate() {\n const thisKeyword = this.tsParseThisTypeNode();\n\n if (this.isContextual(\"is\") && !this.hasPrecedingLineBreak()) {\n return this.tsParseThisTypePredicate(thisKeyword);\n } else {\n return thisKeyword;\n }\n }\n\n tsParseNonArrayType() {\n switch (this.state.type) {\n case types.name:\n case types._void:\n case types._null:\n {\n const type = this.match(types._void) ? \"TSVoidKeyword\" : this.match(types._null) ? \"TSNullKeyword\" : keywordTypeFromName(this.state.value);\n\n if (type !== undefined && this.lookaheadCharCode() !== 46) {\n const node = this.startNode();\n this.next();\n return this.finishNode(node, type);\n }\n\n return this.tsParseTypeReference();\n }\n\n case types.string:\n case types.num:\n case types.bigint:\n case types._true:\n case types._false:\n return this.tsParseLiteralTypeNode();\n\n case types.plusMin:\n if (this.state.value === \"-\") {\n const node = this.startNode();\n const nextToken = this.lookahead();\n\n if (nextToken.type !== types.num && nextToken.type !== types.bigint) {\n throw this.unexpected();\n }\n\n node.literal = this.parseMaybeUnary();\n return this.finishNode(node, \"TSLiteralType\");\n }\n\n break;\n\n case types._this:\n return this.tsParseThisTypeOrThisTypePredicate();\n\n case types._typeof:\n return this.tsParseTypeQuery();\n\n case types._import:\n return this.tsParseImportType();\n\n case types.braceL:\n return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();\n\n case types.bracketL:\n return this.tsParseTupleType();\n\n case types.parenL:\n return this.tsParseParenthesizedType();\n\n case types.backQuote:\n return this.tsParseTemplateLiteralType();\n }\n\n throw this.unexpected();\n }\n\n tsParseArrayTypeOrHigher() {\n let type = this.tsParseNonArrayType();\n\n while (!this.hasPrecedingLineBreak() && this.eat(types.bracketL)) {\n if (this.match(types.bracketR)) {\n const node = this.startNodeAtNode(type);\n node.elementType = type;\n this.expect(types.bracketR);\n type = this.finishNode(node, \"TSArrayType\");\n } else {\n const node = this.startNodeAtNode(type);\n node.objectType = type;\n node.indexType = this.tsParseType();\n this.expect(types.bracketR);\n type = this.finishNode(node, \"TSIndexedAccessType\");\n }\n }\n\n return type;\n }\n\n tsParseTypeOperator(operator) {\n const node = this.startNode();\n this.expectContextual(operator);\n node.operator = operator;\n node.typeAnnotation = this.tsParseTypeOperatorOrHigher();\n\n if (operator === \"readonly\") {\n this.tsCheckTypeAnnotationForReadOnly(node);\n }\n\n return this.finishNode(node, \"TSTypeOperator\");\n }\n\n tsCheckTypeAnnotationForReadOnly(node) {\n switch (node.typeAnnotation.type) {\n case \"TSTupleType\":\n case \"TSArrayType\":\n return;\n\n default:\n this.raise(node.start, TSErrors.UnexpectedReadonly);\n }\n }\n\n tsParseInferType() {\n const node = this.startNode();\n this.expectContextual(\"infer\");\n const typeParameter = this.startNode();\n typeParameter.name = this.parseIdentifierName(typeParameter.start);\n node.typeParameter = this.finishNode(typeParameter, \"TSTypeParameter\");\n return this.finishNode(node, \"TSInferType\");\n }\n\n tsParseTypeOperatorOrHigher() {\n const operator = [\"keyof\", \"unique\", \"readonly\"].find(kw => this.isContextual(kw));\n return operator ? this.tsParseTypeOperator(operator) : this.isContextual(\"infer\") ? this.tsParseInferType() : this.tsParseArrayTypeOrHigher();\n }\n\n tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {\n this.eat(operator);\n let type = parseConstituentType();\n\n if (this.match(operator)) {\n const types = [type];\n\n while (this.eat(operator)) {\n types.push(parseConstituentType());\n }\n\n const node = this.startNodeAtNode(type);\n node.types = types;\n type = this.finishNode(node, kind);\n }\n\n return type;\n }\n\n tsParseIntersectionTypeOrHigher() {\n return this.tsParseUnionOrIntersectionType(\"TSIntersectionType\", this.tsParseTypeOperatorOrHigher.bind(this), types.bitwiseAND);\n }\n\n tsParseUnionTypeOrHigher() {\n return this.tsParseUnionOrIntersectionType(\"TSUnionType\", this.tsParseIntersectionTypeOrHigher.bind(this), types.bitwiseOR);\n }\n\n tsIsStartOfFunctionType() {\n if (this.isRelational(\"<\")) {\n return true;\n }\n\n return this.match(types.parenL) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));\n }\n\n tsSkipParameterStart() {\n if (this.match(types.name) || this.match(types._this)) {\n this.next();\n return true;\n }\n\n if (this.match(types.braceL)) {\n let braceStackCounter = 1;\n this.next();\n\n while (braceStackCounter > 0) {\n if (this.match(types.braceL)) {\n ++braceStackCounter;\n } else if (this.match(types.braceR)) {\n --braceStackCounter;\n }\n\n this.next();\n }\n\n return true;\n }\n\n if (this.match(types.bracketL)) {\n let braceStackCounter = 1;\n this.next();\n\n while (braceStackCounter > 0) {\n if (this.match(types.bracketL)) {\n ++braceStackCounter;\n } else if (this.match(types.bracketR)) {\n --braceStackCounter;\n }\n\n this.next();\n }\n\n return true;\n }\n\n return false;\n }\n\n tsIsUnambiguouslyStartOfFunctionType() {\n this.next();\n\n if (this.match(types.parenR) || this.match(types.ellipsis)) {\n return true;\n }\n\n if (this.tsSkipParameterStart()) {\n if (this.match(types.colon) || this.match(types.comma) || this.match(types.question) || this.match(types.eq)) {\n return true;\n }\n\n if (this.match(types.parenR)) {\n this.next();\n\n if (this.match(types.arrow)) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n tsParseTypeOrTypePredicateAnnotation(returnToken) {\n return this.tsInType(() => {\n const t = this.startNode();\n this.expect(returnToken);\n const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));\n\n if (asserts && this.match(types._this)) {\n let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();\n\n if (thisTypePredicate.type === \"TSThisType\") {\n const node = this.startNodeAtNode(t);\n node.parameterName = thisTypePredicate;\n node.asserts = true;\n thisTypePredicate = this.finishNode(node, \"TSTypePredicate\");\n } else {\n thisTypePredicate.asserts = true;\n }\n\n t.typeAnnotation = thisTypePredicate;\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));\n\n if (!typePredicateVariable) {\n if (!asserts) {\n return this.tsParseTypeAnnotation(false, t);\n }\n\n const node = this.startNodeAtNode(t);\n node.parameterName = this.parseIdentifier();\n node.asserts = asserts;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n const type = this.tsParseTypeAnnotation(false);\n const node = this.startNodeAtNode(t);\n node.parameterName = typePredicateVariable;\n node.typeAnnotation = type;\n node.asserts = asserts;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n });\n }\n\n tsTryParseTypeOrTypePredicateAnnotation() {\n return this.match(types.colon) ? this.tsParseTypeOrTypePredicateAnnotation(types.colon) : undefined;\n }\n\n tsTryParseTypeAnnotation() {\n return this.match(types.colon) ? this.tsParseTypeAnnotation() : undefined;\n }\n\n tsTryParseType() {\n return this.tsEatThenParseType(types.colon);\n }\n\n tsParseTypePredicatePrefix() {\n const id = this.parseIdentifier();\n\n if (this.isContextual(\"is\") && !this.hasPrecedingLineBreak()) {\n this.next();\n return id;\n }\n }\n\n tsParseTypePredicateAsserts() {\n if (!this.match(types.name) || this.state.value !== \"asserts\" || this.hasPrecedingLineBreak()) {\n return false;\n }\n\n const containsEsc = this.state.containsEsc;\n this.next();\n\n if (!this.match(types.name) && !this.match(types._this)) {\n return false;\n }\n\n if (containsEsc) {\n this.raise(this.state.lastTokStart, ErrorMessages.InvalidEscapedReservedWord, \"asserts\");\n }\n\n return true;\n }\n\n tsParseTypeAnnotation(eatColon = true, t = this.startNode()) {\n this.tsInType(() => {\n if (eatColon) this.expect(types.colon);\n t.typeAnnotation = this.tsParseType();\n });\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n tsParseType() {\n assert(this.state.inType);\n const type = this.tsParseNonConditionalType();\n\n if (this.hasPrecedingLineBreak() || !this.eat(types._extends)) {\n return type;\n }\n\n const node = this.startNodeAtNode(type);\n node.checkType = type;\n node.extendsType = this.tsParseNonConditionalType();\n this.expect(types.question);\n node.trueType = this.tsParseType();\n this.expect(types.colon);\n node.falseType = this.tsParseType();\n return this.finishNode(node, \"TSConditionalType\");\n }\n\n tsParseNonConditionalType() {\n if (this.tsIsStartOfFunctionType()) {\n return this.tsParseFunctionOrConstructorType(\"TSFunctionType\");\n }\n\n if (this.match(types._new)) {\n return this.tsParseFunctionOrConstructorType(\"TSConstructorType\");\n }\n\n return this.tsParseUnionTypeOrHigher();\n }\n\n tsParseTypeAssertion() {\n const node = this.startNode();\n\n const _const = this.tsTryNextParseConstantContext();\n\n node.typeAnnotation = _const || this.tsNextThenParseType();\n this.expectRelational(\">\");\n node.expression = this.parseMaybeUnary();\n return this.finishNode(node, \"TSTypeAssertion\");\n }\n\n tsParseHeritageClause(descriptor) {\n const originalStart = this.state.start;\n const delimitedList = this.tsParseDelimitedList(\"HeritageClauseElement\", this.tsParseExpressionWithTypeArguments.bind(this));\n\n if (!delimitedList.length) {\n this.raise(originalStart, TSErrors.EmptyHeritageClauseType, descriptor);\n }\n\n return delimitedList;\n }\n\n tsParseExpressionWithTypeArguments() {\n const node = this.startNode();\n node.expression = this.tsParseEntityName(false);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n\n return this.finishNode(node, \"TSExpressionWithTypeArguments\");\n }\n\n tsParseInterfaceDeclaration(node) {\n node.id = this.parseIdentifier();\n this.checkLVal(node.id, BIND_TS_INTERFACE, undefined, \"typescript interface declaration\");\n node.typeParameters = this.tsTryParseTypeParameters();\n\n if (this.eat(types._extends)) {\n node.extends = this.tsParseHeritageClause(\"extends\");\n }\n\n const body = this.startNode();\n body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));\n node.body = this.finishNode(body, \"TSInterfaceBody\");\n return this.finishNode(node, \"TSInterfaceDeclaration\");\n }\n\n tsParseTypeAliasDeclaration(node) {\n node.id = this.parseIdentifier();\n this.checkLVal(node.id, BIND_TS_TYPE, undefined, \"typescript type alias\");\n node.typeParameters = this.tsTryParseTypeParameters();\n node.typeAnnotation = this.tsInType(() => {\n this.expect(types.eq);\n\n if (this.isContextual(\"intrinsic\") && this.lookahead().type !== types.dot) {\n const node = this.startNode();\n this.next();\n return this.finishNode(node, \"TSIntrinsicKeyword\");\n }\n\n return this.tsParseType();\n });\n this.semicolon();\n return this.finishNode(node, \"TSTypeAliasDeclaration\");\n }\n\n tsInNoContext(cb) {\n const oldContext = this.state.context;\n this.state.context = [oldContext[0]];\n\n try {\n return cb();\n } finally {\n this.state.context = oldContext;\n }\n }\n\n tsInType(cb) {\n const oldInType = this.state.inType;\n this.state.inType = true;\n\n try {\n return cb();\n } finally {\n this.state.inType = oldInType;\n }\n }\n\n tsEatThenParseType(token) {\n return !this.match(token) ? undefined : this.tsNextThenParseType();\n }\n\n tsExpectThenParseType(token) {\n return this.tsDoThenParseType(() => this.expect(token));\n }\n\n tsNextThenParseType() {\n return this.tsDoThenParseType(() => this.next());\n }\n\n tsDoThenParseType(cb) {\n return this.tsInType(() => {\n cb();\n return this.tsParseType();\n });\n }\n\n tsParseEnumMember() {\n const node = this.startNode();\n node.id = this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true);\n\n if (this.eat(types.eq)) {\n node.initializer = this.parseMaybeAssignAllowIn();\n }\n\n return this.finishNode(node, \"TSEnumMember\");\n }\n\n tsParseEnumDeclaration(node, isConst) {\n if (isConst) node.const = true;\n node.id = this.parseIdentifier();\n this.checkLVal(node.id, isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM, undefined, \"typescript enum declaration\");\n this.expect(types.braceL);\n node.members = this.tsParseDelimitedList(\"EnumMembers\", this.tsParseEnumMember.bind(this));\n this.expect(types.braceR);\n return this.finishNode(node, \"TSEnumDeclaration\");\n }\n\n tsParseModuleBlock() {\n const node = this.startNode();\n this.scope.enter(SCOPE_OTHER);\n this.expect(types.braceL);\n this.parseBlockOrModuleBlockBody(node.body = [], undefined, true, types.braceR);\n this.scope.exit();\n return this.finishNode(node, \"TSModuleBlock\");\n }\n\n tsParseModuleOrNamespaceDeclaration(node, nested = false) {\n node.id = this.parseIdentifier();\n\n if (!nested) {\n this.checkLVal(node.id, BIND_TS_NAMESPACE, null, \"module or namespace declaration\");\n }\n\n if (this.eat(types.dot)) {\n const inner = this.startNode();\n this.tsParseModuleOrNamespaceDeclaration(inner, true);\n node.body = inner;\n } else {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n }\n\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n\n tsParseAmbientExternalModuleDeclaration(node) {\n if (this.isContextual(\"global\")) {\n node.global = true;\n node.id = this.parseIdentifier();\n } else if (this.match(types.string)) {\n node.id = this.parseExprAtom();\n } else {\n this.unexpected();\n }\n\n if (this.match(types.braceL)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n } else {\n this.semicolon();\n }\n\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n\n tsParseImportEqualsDeclaration(node, isExport) {\n node.isExport = isExport || false;\n node.id = this.parseIdentifier();\n this.checkLVal(node.id, BIND_LEXICAL, undefined, \"import equals declaration\");\n this.expect(types.eq);\n node.moduleReference = this.tsParseModuleReference();\n this.semicolon();\n return this.finishNode(node, \"TSImportEqualsDeclaration\");\n }\n\n tsIsExternalModuleReference() {\n return this.isContextual(\"require\") && this.lookaheadCharCode() === 40;\n }\n\n tsParseModuleReference() {\n return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false);\n }\n\n tsParseExternalModuleReference() {\n const node = this.startNode();\n this.expectContextual(\"require\");\n this.expect(types.parenL);\n\n if (!this.match(types.string)) {\n throw this.unexpected();\n }\n\n node.expression = this.parseExprAtom();\n this.expect(types.parenR);\n return this.finishNode(node, \"TSExternalModuleReference\");\n }\n\n tsLookAhead(f) {\n const state = this.state.clone();\n const res = f();\n this.state = state;\n return res;\n }\n\n tsTryParseAndCatch(f) {\n const result = this.tryParse(abort => f() || abort());\n if (result.aborted || !result.node) return undefined;\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n tsTryParse(f) {\n const state = this.state.clone();\n const result = f();\n\n if (result !== undefined && result !== false) {\n return result;\n } else {\n this.state = state;\n return undefined;\n }\n }\n\n tsTryParseDeclare(nany) {\n if (this.isLineTerminator()) {\n return;\n }\n\n let starttype = this.state.type;\n let kind;\n\n if (this.isContextual(\"let\")) {\n starttype = types._var;\n kind = \"let\";\n }\n\n return this.tsInDeclareContext(() => {\n switch (starttype) {\n case types._function:\n nany.declare = true;\n return this.parseFunctionStatement(nany, false, true);\n\n case types._class:\n nany.declare = true;\n return this.parseClass(nany, true, false);\n\n case types._const:\n if (this.match(types._const) && this.isLookaheadContextual(\"enum\")) {\n this.expect(types._const);\n this.expectContextual(\"enum\");\n return this.tsParseEnumDeclaration(nany, true);\n }\n\n case types._var:\n kind = kind || this.state.value;\n return this.parseVarStatement(nany, kind);\n\n case types.name:\n {\n const value = this.state.value;\n\n if (value === \"global\") {\n return this.tsParseAmbientExternalModuleDeclaration(nany);\n } else {\n return this.tsParseDeclaration(nany, value, true);\n }\n }\n }\n });\n }\n\n tsTryParseExportDeclaration() {\n return this.tsParseDeclaration(this.startNode(), this.state.value, true);\n }\n\n tsParseExpressionStatement(node, expr) {\n switch (expr.name) {\n case \"declare\":\n {\n const declaration = this.tsTryParseDeclare(node);\n\n if (declaration) {\n declaration.declare = true;\n return declaration;\n }\n\n break;\n }\n\n case \"global\":\n if (this.match(types.braceL)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n const mod = node;\n mod.global = true;\n mod.id = expr;\n mod.body = this.tsParseModuleBlock();\n this.scope.exit();\n this.prodParam.exit();\n return this.finishNode(mod, \"TSModuleDeclaration\");\n }\n\n break;\n\n default:\n return this.tsParseDeclaration(node, expr.name, false);\n }\n }\n\n tsParseDeclaration(node, value, next) {\n switch (value) {\n case \"abstract\":\n if (this.tsCheckLineTerminatorAndMatch(types._class, next)) {\n const cls = node;\n cls.abstract = true;\n\n if (next) {\n this.next();\n\n if (!this.match(types._class)) {\n this.unexpected(null, types._class);\n }\n }\n\n return this.parseClass(cls, true, false);\n }\n\n break;\n\n case \"enum\":\n if (next || this.match(types.name)) {\n if (next) this.next();\n return this.tsParseEnumDeclaration(node, false);\n }\n\n break;\n\n case \"interface\":\n if (this.tsCheckLineTerminatorAndMatch(types.name, next)) {\n if (next) this.next();\n return this.tsParseInterfaceDeclaration(node);\n }\n\n break;\n\n case \"module\":\n if (next) this.next();\n\n if (this.match(types.string)) {\n return this.tsParseAmbientExternalModuleDeclaration(node);\n } else if (this.tsCheckLineTerminatorAndMatch(types.name, next)) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n\n break;\n\n case \"namespace\":\n if (this.tsCheckLineTerminatorAndMatch(types.name, next)) {\n if (next) this.next();\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n\n break;\n\n case \"type\":\n if (this.tsCheckLineTerminatorAndMatch(types.name, next)) {\n if (next) this.next();\n return this.tsParseTypeAliasDeclaration(node);\n }\n\n break;\n }\n }\n\n tsCheckLineTerminatorAndMatch(tokenType, next) {\n return (next || this.match(tokenType)) && !this.isLineTerminator();\n }\n\n tsTryParseGenericAsyncArrowFunction(startPos, startLoc) {\n if (!this.isRelational(\"<\")) {\n return undefined;\n }\n\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n this.state.maybeInArrowParameters = true;\n const res = this.tsTryParseAndCatch(() => {\n const node = this.startNodeAt(startPos, startLoc);\n node.typeParameters = this.tsParseTypeParameters();\n super.parseFunctionParams(node);\n node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();\n this.expect(types.arrow);\n return node;\n });\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n\n if (!res) {\n return undefined;\n }\n\n return this.parseArrowExpression(res, null, true);\n }\n\n tsParseTypeArguments() {\n const node = this.startNode();\n node.params = this.tsInType(() => this.tsInNoContext(() => {\n this.expectRelational(\"<\");\n return this.tsParseDelimitedList(\"TypeParametersOrArguments\", this.tsParseType.bind(this));\n }));\n\n if (node.params.length === 0) {\n this.raise(node.start, TSErrors.EmptyTypeArguments);\n }\n\n this.state.exprAllowed = false;\n this.expectRelational(\">\");\n return this.finishNode(node, \"TSTypeParameterInstantiation\");\n }\n\n tsIsDeclarationStart() {\n if (this.match(types.name)) {\n switch (this.state.value) {\n case \"abstract\":\n case \"declare\":\n case \"enum\":\n case \"interface\":\n case \"module\":\n case \"namespace\":\n case \"type\":\n return true;\n }\n }\n\n return false;\n }\n\n isExportDefaultSpecifier() {\n if (this.tsIsDeclarationStart()) return false;\n return super.isExportDefaultSpecifier();\n }\n\n parseAssignableListItem(allowModifiers, decorators) {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n let accessibility;\n let readonly = false;\n\n if (allowModifiers !== undefined) {\n accessibility = this.parseAccessModifier();\n readonly = !!this.tsParseModifier([\"readonly\"]);\n\n if (allowModifiers === false && (accessibility || readonly)) {\n this.raise(startPos, TSErrors.UnexpectedParameterModifier);\n }\n }\n\n const left = this.parseMaybeDefault();\n this.parseAssignableListItemTypes(left);\n const elt = this.parseMaybeDefault(left.start, left.loc.start, left);\n\n if (accessibility || readonly) {\n const pp = this.startNodeAt(startPos, startLoc);\n\n if (decorators.length) {\n pp.decorators = decorators;\n }\n\n if (accessibility) pp.accessibility = accessibility;\n if (readonly) pp.readonly = readonly;\n\n if (elt.type !== \"Identifier\" && elt.type !== \"AssignmentPattern\") {\n this.raise(pp.start, TSErrors.UnsupportedParameterPropertyKind);\n }\n\n pp.parameter = elt;\n return this.finishNode(pp, \"TSParameterProperty\");\n }\n\n if (decorators.length) {\n left.decorators = decorators;\n }\n\n return elt;\n }\n\n parseFunctionBodyAndFinish(node, type, isMethod = false) {\n if (this.match(types.colon)) {\n node.returnType = this.tsParseTypeOrTypePredicateAnnotation(types.colon);\n }\n\n const bodilessType = type === \"FunctionDeclaration\" ? \"TSDeclareFunction\" : type === \"ClassMethod\" ? \"TSDeclareMethod\" : undefined;\n\n if (bodilessType && !this.match(types.braceL) && this.isLineTerminator()) {\n this.finishNode(node, bodilessType);\n return;\n }\n\n if (bodilessType === \"TSDeclareFunction\" && this.state.isDeclareContext) {\n this.raise(node.start, TSErrors.DeclareFunctionHasImplementation);\n\n if (node.declare) {\n super.parseFunctionBodyAndFinish(node, bodilessType, isMethod);\n return;\n }\n }\n\n super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n registerFunctionStatementId(node) {\n if (!node.body && node.id) {\n this.checkLVal(node.id, BIND_TS_AMBIENT, null, \"function name\");\n } else {\n super.registerFunctionStatementId(...arguments);\n }\n }\n\n tsCheckForInvalidTypeCasts(items) {\n items.forEach(node => {\n if ((node == null ? void 0 : node.type) === \"TSTypeCastExpression\") {\n this.raise(node.typeAnnotation.start, TSErrors.UnexpectedTypeAnnotation);\n }\n });\n }\n\n toReferencedList(exprList, isInParens) {\n this.tsCheckForInvalidTypeCasts(exprList);\n return exprList;\n }\n\n parseArrayLike(...args) {\n const node = super.parseArrayLike(...args);\n\n if (node.type === \"ArrayExpression\") {\n this.tsCheckForInvalidTypeCasts(node.elements);\n }\n\n return node;\n }\n\n parseSubscript(base, startPos, startLoc, noCalls, state) {\n if (!this.hasPrecedingLineBreak() && this.match(types.bang)) {\n this.state.exprAllowed = false;\n this.next();\n const nonNullExpression = this.startNodeAt(startPos, startLoc);\n nonNullExpression.expression = base;\n return this.finishNode(nonNullExpression, \"TSNonNullExpression\");\n }\n\n if (this.isRelational(\"<\")) {\n const result = this.tsTryParseAndCatch(() => {\n if (!noCalls && this.atPossibleAsyncArrow(base)) {\n const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startPos, startLoc);\n\n if (asyncArrowFn) {\n return asyncArrowFn;\n }\n }\n\n const node = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n const typeArguments = this.tsParseTypeArguments();\n\n if (typeArguments) {\n if (!noCalls && this.eat(types.parenL)) {\n node.arguments = this.parseCallExpressionArguments(types.parenR, false);\n this.tsCheckForInvalidTypeCasts(node.arguments);\n node.typeParameters = typeArguments;\n return this.finishCallExpression(node, state.optionalChainMember);\n } else if (this.match(types.backQuote)) {\n const result = this.parseTaggedTemplateExpression(base, startPos, startLoc, state);\n result.typeParameters = typeArguments;\n return result;\n }\n }\n\n this.unexpected();\n });\n if (result) return result;\n }\n\n return super.parseSubscript(base, startPos, startLoc, noCalls, state);\n }\n\n parseNewArguments(node) {\n if (this.isRelational(\"<\")) {\n const typeParameters = this.tsTryParseAndCatch(() => {\n const args = this.tsParseTypeArguments();\n if (!this.match(types.parenL)) this.unexpected();\n return args;\n });\n\n if (typeParameters) {\n node.typeParameters = typeParameters;\n }\n }\n\n super.parseNewArguments(node);\n }\n\n parseExprOp(left, leftStartPos, leftStartLoc, minPrec) {\n if (nonNull(types._in.binop) > minPrec && !this.hasPrecedingLineBreak() && this.isContextual(\"as\")) {\n const node = this.startNodeAt(leftStartPos, leftStartLoc);\n node.expression = left;\n\n const _const = this.tsTryNextParseConstantContext();\n\n if (_const) {\n node.typeAnnotation = _const;\n } else {\n node.typeAnnotation = this.tsNextThenParseType();\n }\n\n this.finishNode(node, \"TSAsExpression\");\n this.reScan_lt_gt();\n return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec);\n }\n\n return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec);\n }\n\n checkReservedWord(word, startLoc, checkKeywords, isBinding) {}\n\n checkDuplicateExports() {}\n\n parseImport(node) {\n if (this.match(types.name) || this.match(types.star) || this.match(types.braceL)) {\n const ahead = this.lookahead();\n\n if (this.match(types.name) && ahead.type === types.eq) {\n return this.tsParseImportEqualsDeclaration(node);\n }\n\n if (this.isContextual(\"type\") && ahead.type !== types.comma && !(ahead.type === types.name && ahead.value === \"from\")) {\n node.importKind = \"type\";\n this.next();\n }\n }\n\n if (!node.importKind) {\n node.importKind = \"value\";\n }\n\n const importNode = super.parseImport(node);\n\n if (importNode.importKind === \"type\" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === \"ImportDefaultSpecifier\") {\n this.raise(importNode.start, \"A type-only import can specify a default import or named bindings, but not both.\");\n }\n\n return importNode;\n }\n\n parseExport(node) {\n if (this.match(types._import)) {\n this.expect(types._import);\n return this.tsParseImportEqualsDeclaration(node, true);\n } else if (this.eat(types.eq)) {\n const assign = node;\n assign.expression = this.parseExpression();\n this.semicolon();\n return this.finishNode(assign, \"TSExportAssignment\");\n } else if (this.eatContextual(\"as\")) {\n const decl = node;\n this.expectContextual(\"namespace\");\n decl.id = this.parseIdentifier();\n this.semicolon();\n return this.finishNode(decl, \"TSNamespaceExportDeclaration\");\n } else {\n if (this.isContextual(\"type\") && this.lookahead().type === types.braceL) {\n this.next();\n node.exportKind = \"type\";\n } else {\n node.exportKind = \"value\";\n }\n\n return super.parseExport(node);\n }\n }\n\n isAbstractClass() {\n return this.isContextual(\"abstract\") && this.lookahead().type === types._class;\n }\n\n parseExportDefaultExpression() {\n if (this.isAbstractClass()) {\n const cls = this.startNode();\n this.next();\n this.parseClass(cls, true, true);\n cls.abstract = true;\n return cls;\n }\n\n if (this.state.value === \"interface\") {\n const result = this.tsParseDeclaration(this.startNode(), this.state.value, true);\n if (result) return result;\n }\n\n return super.parseExportDefaultExpression();\n }\n\n parseStatementContent(context, topLevel) {\n if (this.state.type === types._const) {\n const ahead = this.lookahead();\n\n if (ahead.type === types.name && ahead.value === \"enum\") {\n const node = this.startNode();\n this.expect(types._const);\n this.expectContextual(\"enum\");\n return this.tsParseEnumDeclaration(node, true);\n }\n }\n\n return super.parseStatementContent(context, topLevel);\n }\n\n parseAccessModifier() {\n return this.tsParseModifier([\"public\", \"protected\", \"private\"]);\n }\n\n parseClassMember(classBody, member, state) {\n this.tsParseModifiers(member, [\"declare\"]);\n const accessibility = this.parseAccessModifier();\n if (accessibility) member.accessibility = accessibility;\n this.tsParseModifiers(member, [\"declare\"]);\n\n const callParseClassMember = () => {\n super.parseClassMember(classBody, member, state);\n };\n\n if (member.declare) {\n this.tsInDeclareContext(callParseClassMember);\n } else {\n callParseClassMember();\n }\n }\n\n parseClassMemberWithIsStatic(classBody, member, state, isStatic) {\n this.tsParseModifiers(member, [\"abstract\", \"readonly\", \"declare\"]);\n const idx = this.tsTryParseIndexSignature(member);\n\n if (idx) {\n classBody.body.push(idx);\n\n if (member.abstract) {\n this.raise(member.start, TSErrors.IndexSignatureHasAbstract);\n }\n\n if (isStatic) {\n this.raise(member.start, TSErrors.IndexSignatureHasStatic);\n }\n\n if (member.accessibility) {\n this.raise(member.start, TSErrors.IndexSignatureHasAccessibility, member.accessibility);\n }\n\n if (member.declare) {\n this.raise(member.start, TSErrors.IndexSignatureHasDeclare);\n }\n\n return;\n }\n\n super.parseClassMemberWithIsStatic(classBody, member, state, isStatic);\n }\n\n parsePostMemberNameModifiers(methodOrProp) {\n const optional = this.eat(types.question);\n if (optional) methodOrProp.optional = true;\n\n if (methodOrProp.readonly && this.match(types.parenL)) {\n this.raise(methodOrProp.start, TSErrors.ClassMethodHasReadonly);\n }\n\n if (methodOrProp.declare && this.match(types.parenL)) {\n this.raise(methodOrProp.start, TSErrors.ClassMethodHasDeclare);\n }\n }\n\n parseExpressionStatement(node, expr) {\n const decl = expr.type === \"Identifier\" ? this.tsParseExpressionStatement(node, expr) : undefined;\n return decl || super.parseExpressionStatement(node, expr);\n }\n\n shouldParseExportDeclaration() {\n if (this.tsIsDeclarationStart()) return true;\n return super.shouldParseExportDeclaration();\n }\n\n parseConditional(expr, startPos, startLoc, refNeedsArrowPos) {\n if (!refNeedsArrowPos || !this.match(types.question)) {\n return super.parseConditional(expr, startPos, startLoc, refNeedsArrowPos);\n }\n\n const result = this.tryParse(() => super.parseConditional(expr, startPos, startLoc));\n\n if (!result.node) {\n refNeedsArrowPos.start = result.error.pos || this.state.start;\n return expr;\n }\n\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n parseParenItem(node, startPos, startLoc) {\n node = super.parseParenItem(node, startPos, startLoc);\n\n if (this.eat(types.question)) {\n node.optional = true;\n this.resetEndLocation(node);\n }\n\n if (this.match(types.colon)) {\n const typeCastNode = this.startNodeAt(startPos, startLoc);\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();\n return this.finishNode(typeCastNode, \"TSTypeCastExpression\");\n }\n\n return node;\n }\n\n parseExportDeclaration(node) {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const isDeclare = this.eatContextual(\"declare\");\n let declaration;\n\n if (this.match(types.name)) {\n declaration = this.tsTryParseExportDeclaration();\n }\n\n if (!declaration) {\n declaration = super.parseExportDeclaration(node);\n }\n\n if (declaration && (declaration.type === \"TSInterfaceDeclaration\" || declaration.type === \"TSTypeAliasDeclaration\" || isDeclare)) {\n node.exportKind = \"type\";\n }\n\n if (declaration && isDeclare) {\n this.resetStartLocation(declaration, startPos, startLoc);\n declaration.declare = true;\n }\n\n return declaration;\n }\n\n parseClassId(node, isStatement, optionalId) {\n if ((!isStatement || optionalId) && this.isContextual(\"implements\")) {\n return;\n }\n\n super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS);\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) node.typeParameters = typeParameters;\n }\n\n parseClassPropertyAnnotation(node) {\n if (!node.optional && this.eat(types.bang)) {\n node.definite = true;\n }\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n }\n\n parseClassProperty(node) {\n this.parseClassPropertyAnnotation(node);\n\n if (this.state.isDeclareContext && this.match(types.eq)) {\n this.raise(this.state.start, TSErrors.DeclareClassFieldHasInitializer);\n }\n\n return super.parseClassProperty(node);\n }\n\n parseClassPrivateProperty(node) {\n if (node.abstract) {\n this.raise(node.start, TSErrors.PrivateElementHasAbstract);\n }\n\n if (node.accessibility) {\n this.raise(node.start, TSErrors.PrivateElementHasAccessibility, node.accessibility);\n }\n\n this.parseClassPropertyAnnotation(node);\n return super.parseClassPrivateProperty(node);\n }\n\n pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {\n const typeParameters = this.tsTryParseTypeParameters();\n\n if (typeParameters && isConstructor) {\n this.raise(typeParameters.start, TSErrors.ConstructorHasTypeParameters);\n }\n\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);\n }\n\n pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n parseClassSuper(node) {\n super.parseClassSuper(node);\n\n if (node.superClass && this.isRelational(\"<\")) {\n node.superTypeParameters = this.tsParseTypeArguments();\n }\n\n if (this.eatContextual(\"implements\")) {\n node.implements = this.tsParseHeritageClause(\"implements\");\n }\n }\n\n parseObjPropValue(prop, ...args) {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) prop.typeParameters = typeParameters;\n super.parseObjPropValue(prop, ...args);\n }\n\n parseFunctionParams(node, allowModifiers) {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) node.typeParameters = typeParameters;\n super.parseFunctionParams(node, allowModifiers);\n }\n\n parseVarId(decl, kind) {\n super.parseVarId(decl, kind);\n\n if (decl.id.type === \"Identifier\" && this.eat(types.bang)) {\n decl.definite = true;\n }\n\n const type = this.tsTryParseTypeAnnotation();\n\n if (type) {\n decl.id.typeAnnotation = type;\n this.resetEndLocation(decl.id);\n }\n }\n\n parseAsyncArrowFromCallExpression(node, call) {\n if (this.match(types.colon)) {\n node.returnType = this.tsParseTypeAnnotation();\n }\n\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n parseMaybeAssign(...args) {\n var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3;\n\n let state;\n let jsx;\n let typeCast;\n\n if (this.match(types.jsxTagStart)) {\n state = this.state.clone();\n jsx = this.tryParse(() => super.parseMaybeAssign(...args), state);\n if (!jsx.error) return jsx.node;\n const {\n context\n } = this.state;\n\n if (context[context.length - 1] === types$1.j_oTag) {\n context.length -= 2;\n } else if (context[context.length - 1] === types$1.j_expr) {\n context.length -= 1;\n }\n }\n\n if (!((_jsx = jsx) == null ? void 0 : _jsx.error) && !this.isRelational(\"<\")) {\n return super.parseMaybeAssign(...args);\n }\n\n let typeParameters;\n state = state || this.state.clone();\n const arrow = this.tryParse(abort => {\n var _typeParameters;\n\n typeParameters = this.tsParseTypeParameters();\n const expr = super.parseMaybeAssign(...args);\n\n if (expr.type !== \"ArrowFunctionExpression\" || expr.extra && expr.extra.parenthesized) {\n abort();\n }\n\n if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) {\n this.resetStartLocationFromNode(expr, typeParameters);\n }\n\n expr.typeParameters = typeParameters;\n return expr;\n }, state);\n if (!arrow.error && !arrow.aborted) return arrow.node;\n\n if (!jsx) {\n assert(!this.hasPlugin(\"jsx\"));\n typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state);\n if (!typeCast.error) return typeCast.node;\n }\n\n if ((_jsx2 = jsx) == null ? void 0 : _jsx2.node) {\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrow.node) {\n this.state = arrow.failState;\n return arrow.node;\n }\n\n if ((_typeCast = typeCast) == null ? void 0 : _typeCast.node) {\n this.state = typeCast.failState;\n return typeCast.node;\n }\n\n if ((_jsx3 = jsx) == null ? void 0 : _jsx3.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n if ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.thrown) throw typeCast.error;\n throw ((_jsx4 = jsx) == null ? void 0 : _jsx4.error) || arrow.error || ((_typeCast3 = typeCast) == null ? void 0 : _typeCast3.error);\n }\n\n parseMaybeUnary(refExpressionErrors) {\n if (!this.hasPlugin(\"jsx\") && this.isRelational(\"<\")) {\n return this.tsParseTypeAssertion();\n } else {\n return super.parseMaybeUnary(refExpressionErrors);\n }\n }\n\n parseArrow(node) {\n if (this.match(types.colon)) {\n const result = this.tryParse(abort => {\n const returnType = this.tsParseTypeOrTypePredicateAnnotation(types.colon);\n if (this.canInsertSemicolon() || !this.match(types.arrow)) abort();\n return returnType;\n });\n if (result.aborted) return;\n\n if (!result.thrown) {\n if (result.error) this.state = result.failState;\n node.returnType = result.node;\n }\n }\n\n return super.parseArrow(node);\n }\n\n parseAssignableListItemTypes(param) {\n if (this.eat(types.question)) {\n if (param.type !== \"Identifier\" && !this.state.isDeclareContext && !this.state.inType) {\n this.raise(param.start, TSErrors.PatternIsOptional);\n }\n\n param.optional = true;\n }\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) param.typeAnnotation = type;\n this.resetEndLocation(param);\n return param;\n }\n\n toAssignable(node) {\n switch (node.type) {\n case \"TSTypeCastExpression\":\n return super.toAssignable(this.typeCastToParameter(node));\n\n case \"TSParameterProperty\":\n return super.toAssignable(node);\n\n case \"TSAsExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n node.expression = this.toAssignable(node.expression);\n return node;\n\n default:\n return super.toAssignable(node);\n }\n }\n\n checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) {\n switch (expr.type) {\n case \"TSTypeCastExpression\":\n return;\n\n case \"TSParameterProperty\":\n this.checkLVal(expr.parameter, bindingType, checkClashes, \"parameter property\");\n return;\n\n case \"TSAsExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n this.checkLVal(expr.expression, bindingType, checkClashes, contextDescription);\n return;\n\n default:\n super.checkLVal(expr, bindingType, checkClashes, contextDescription);\n return;\n }\n }\n\n parseBindingAtom() {\n switch (this.state.type) {\n case types._this:\n return this.parseIdentifier(true);\n\n default:\n return super.parseBindingAtom();\n }\n }\n\n parseMaybeDecoratorArguments(expr) {\n if (this.isRelational(\"<\")) {\n const typeArguments = this.tsParseTypeArguments();\n\n if (this.match(types.parenL)) {\n const call = super.parseMaybeDecoratorArguments(expr);\n call.typeParameters = typeArguments;\n return call;\n }\n\n this.unexpected(this.state.start, types.parenL);\n }\n\n return super.parseMaybeDecoratorArguments(expr);\n }\n\n isClassMethod() {\n return this.isRelational(\"<\") || super.isClassMethod();\n }\n\n isClassProperty() {\n return this.match(types.bang) || this.match(types.colon) || super.isClassProperty();\n }\n\n parseMaybeDefault(...args) {\n const node = super.parseMaybeDefault(...args);\n\n if (node.type === \"AssignmentPattern\" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {\n this.raise(node.typeAnnotation.start, TSErrors.TypeAnnotationAfterAssign);\n }\n\n return node;\n }\n\n getTokenFromCode(code) {\n if (this.state.inType && (code === 62 || code === 60)) {\n return this.finishOp(types.relational, 1);\n } else {\n return super.getTokenFromCode(code);\n }\n }\n\n reScan_lt_gt() {\n if (this.match(types.relational)) {\n const code = this.input.charCodeAt(this.state.start);\n\n if (code === 60 || code === 62) {\n this.state.pos -= 1;\n this.readToken_lt_gt(code);\n }\n }\n }\n\n toAssignableList(exprList) {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (!expr) continue;\n\n switch (expr.type) {\n case \"TSTypeCastExpression\":\n exprList[i] = this.typeCastToParameter(expr);\n break;\n\n case \"TSAsExpression\":\n case \"TSTypeAssertion\":\n if (!this.state.maybeInArrowParameters) {\n exprList[i] = this.typeCastToParameter(expr);\n } else {\n this.raise(expr.start, TSErrors.UnexpectedTypeCastInParameter);\n }\n\n break;\n }\n }\n\n return super.toAssignableList(...arguments);\n }\n\n typeCastToParameter(node) {\n node.expression.typeAnnotation = node.typeAnnotation;\n this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end);\n return node.expression;\n }\n\n shouldParseArrow() {\n return this.match(types.colon) || super.shouldParseArrow();\n }\n\n shouldParseAsyncArrow() {\n return this.match(types.colon) || super.shouldParseAsyncArrow();\n }\n\n canHaveLeadingDecorator() {\n return super.canHaveLeadingDecorator() || this.isAbstractClass();\n }\n\n jsxParseOpeningElementAfterName(node) {\n if (this.isRelational(\"<\")) {\n const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArguments());\n if (typeArguments) node.typeParameters = typeArguments;\n }\n\n return super.jsxParseOpeningElementAfterName(node);\n }\n\n getGetterSetterExpectedParamCount(method) {\n const baseCount = super.getGetterSetterExpectedParamCount(method);\n const firstParam = method.params[0];\n const hasContextParam = firstParam && firstParam.type === \"Identifier\" && firstParam.name === \"this\";\n return hasContextParam ? baseCount + 1 : baseCount;\n }\n\n parseCatchClauseParam() {\n const param = super.parseCatchClauseParam();\n const type = this.tsTryParseTypeAnnotation();\n\n if (type) {\n param.typeAnnotation = type;\n this.resetEndLocation(param);\n }\n\n return param;\n }\n\n tsInDeclareContext(cb) {\n const oldIsDeclareContext = this.state.isDeclareContext;\n this.state.isDeclareContext = true;\n\n try {\n return cb();\n } finally {\n this.state.isDeclareContext = oldIsDeclareContext;\n }\n }\n\n});\n\ntypes.placeholder = new TokenType(\"%%\", {\n startsExpr: true\n});\nvar placeholders = (superClass => class extends superClass {\n parsePlaceholder(expectedNode) {\n if (this.match(types.placeholder)) {\n const node = this.startNode();\n this.next();\n this.assertNoSpace(\"Unexpected space in placeholder.\");\n node.name = super.parseIdentifier(true);\n this.assertNoSpace(\"Unexpected space in placeholder.\");\n this.expect(types.placeholder);\n return this.finishPlaceholder(node, expectedNode);\n }\n }\n\n finishPlaceholder(node, expectedNode) {\n const isFinished = !!(node.expectedNode && node.type === \"Placeholder\");\n node.expectedNode = expectedNode;\n return isFinished ? node : this.finishNode(node, \"Placeholder\");\n }\n\n getTokenFromCode(code) {\n if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {\n return this.finishOp(types.placeholder, 2);\n }\n\n return super.getTokenFromCode(...arguments);\n }\n\n parseExprAtom() {\n return this.parsePlaceholder(\"Expression\") || super.parseExprAtom(...arguments);\n }\n\n parseIdentifier() {\n return this.parsePlaceholder(\"Identifier\") || super.parseIdentifier(...arguments);\n }\n\n checkReservedWord(word) {\n if (word !== undefined) super.checkReservedWord(...arguments);\n }\n\n parseBindingAtom() {\n return this.parsePlaceholder(\"Pattern\") || super.parseBindingAtom(...arguments);\n }\n\n checkLVal(expr) {\n if (expr.type !== \"Placeholder\") super.checkLVal(...arguments);\n }\n\n toAssignable(node) {\n if (node && node.type === \"Placeholder\" && node.expectedNode === \"Expression\") {\n node.expectedNode = \"Pattern\";\n return node;\n }\n\n return super.toAssignable(...arguments);\n }\n\n verifyBreakContinue(node) {\n if (node.label && node.label.type === \"Placeholder\") return;\n super.verifyBreakContinue(...arguments);\n }\n\n parseExpressionStatement(node, expr) {\n if (expr.type !== \"Placeholder\" || expr.extra && expr.extra.parenthesized) {\n return super.parseExpressionStatement(...arguments);\n }\n\n if (this.match(types.colon)) {\n const stmt = node;\n stmt.label = this.finishPlaceholder(expr, \"Identifier\");\n this.next();\n stmt.body = this.parseStatement(\"label\");\n return this.finishNode(stmt, \"LabeledStatement\");\n }\n\n this.semicolon();\n node.name = expr.name;\n return this.finishPlaceholder(node, \"Statement\");\n }\n\n parseBlock() {\n return this.parsePlaceholder(\"BlockStatement\") || super.parseBlock(...arguments);\n }\n\n parseFunctionId() {\n return this.parsePlaceholder(\"Identifier\") || super.parseFunctionId(...arguments);\n }\n\n parseClass(node, isStatement, optionalId) {\n const type = isStatement ? \"ClassDeclaration\" : \"ClassExpression\";\n this.next();\n this.takeDecorators(node);\n const oldStrict = this.state.strict;\n const placeholder = this.parsePlaceholder(\"Identifier\");\n\n if (placeholder) {\n if (this.match(types._extends) || this.match(types.placeholder) || this.match(types.braceL)) {\n node.id = placeholder;\n } else if (optionalId || !isStatement) {\n node.id = null;\n node.body = this.finishPlaceholder(placeholder, \"ClassBody\");\n return this.finishNode(node, type);\n } else {\n this.unexpected(null, \"A class name is required\");\n }\n } else {\n this.parseClassId(node, isStatement, optionalId);\n }\n\n this.parseClassSuper(node);\n node.body = this.parsePlaceholder(\"ClassBody\") || this.parseClassBody(!!node.superClass, oldStrict);\n return this.finishNode(node, type);\n }\n\n parseExport(node) {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseExport(...arguments);\n\n if (!this.isContextual(\"from\") && !this.match(types.comma)) {\n node.specifiers = [];\n node.source = null;\n node.declaration = this.finishPlaceholder(placeholder, \"Declaration\");\n return this.finishNode(node, \"ExportNamedDeclaration\");\n }\n\n this.expectPlugin(\"exportDefaultFrom\");\n const specifier = this.startNode();\n specifier.exported = placeholder;\n node.specifiers = [this.finishNode(specifier, \"ExportDefaultSpecifier\")];\n return super.parseExport(node);\n }\n\n isExportDefaultSpecifier() {\n if (this.match(types._default)) {\n const next = this.nextTokenStart();\n\n if (this.isUnparsedContextual(next, \"from\")) {\n if (this.input.startsWith(types.placeholder.label, this.nextTokenStartSince(next + 4))) {\n return true;\n }\n }\n }\n\n return super.isExportDefaultSpecifier();\n }\n\n maybeParseExportDefaultSpecifier(node) {\n if (node.specifiers && node.specifiers.length > 0) {\n return true;\n }\n\n return super.maybeParseExportDefaultSpecifier(...arguments);\n }\n\n checkExport(node) {\n const {\n specifiers\n } = node;\n\n if (specifiers == null ? void 0 : specifiers.length) {\n node.specifiers = specifiers.filter(node => node.exported.type === \"Placeholder\");\n }\n\n super.checkExport(node);\n node.specifiers = specifiers;\n }\n\n parseImport(node) {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseImport(...arguments);\n node.specifiers = [];\n\n if (!this.isContextual(\"from\") && !this.match(types.comma)) {\n node.source = this.finishPlaceholder(placeholder, \"StringLiteral\");\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n const specifier = this.startNodeAtNode(placeholder);\n specifier.local = placeholder;\n this.finishNode(specifier, \"ImportDefaultSpecifier\");\n node.specifiers.push(specifier);\n\n if (this.eat(types.comma)) {\n const hasStarImport = this.maybeParseStarImportSpecifier(node);\n if (!hasStarImport) this.parseNamedImportSpecifiers(node);\n }\n\n this.expectContextual(\"from\");\n node.source = this.parseImportSource();\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n parseImportSource() {\n return this.parsePlaceholder(\"StringLiteral\") || super.parseImportSource(...arguments);\n }\n\n});\n\nvar v8intrinsic = (superClass => class extends superClass {\n parseV8Intrinsic() {\n if (this.match(types.modulo)) {\n const v8IntrinsicStart = this.state.start;\n const node = this.startNode();\n this.eat(types.modulo);\n\n if (this.match(types.name)) {\n const name = this.parseIdentifierName(this.state.start);\n const identifier = this.createIdentifier(node, name);\n identifier.type = \"V8IntrinsicIdentifier\";\n\n if (this.match(types.parenL)) {\n return identifier;\n }\n }\n\n this.unexpected(v8IntrinsicStart);\n }\n }\n\n parseExprAtom() {\n return this.parseV8Intrinsic() || super.parseExprAtom(...arguments);\n }\n\n});\n\nfunction hasPlugin(plugins, name) {\n return plugins.some(plugin => {\n if (Array.isArray(plugin)) {\n return plugin[0] === name;\n } else {\n return plugin === name;\n }\n });\n}\nfunction getPluginOption(plugins, name, option) {\n const plugin = plugins.find(plugin => {\n if (Array.isArray(plugin)) {\n return plugin[0] === name;\n } else {\n return plugin === name;\n }\n });\n\n if (plugin && Array.isArray(plugin)) {\n return plugin[1][option];\n }\n\n return null;\n}\nconst PIPELINE_PROPOSALS = [\"minimal\", \"smart\", \"fsharp\"];\nconst RECORD_AND_TUPLE_SYNTAX_TYPES = [\"hash\", \"bar\"];\nfunction validatePlugins(plugins) {\n if (hasPlugin(plugins, \"decorators\")) {\n if (hasPlugin(plugins, \"decorators-legacy\")) {\n throw new Error(\"Cannot use the decorators and decorators-legacy plugin together\");\n }\n\n const decoratorsBeforeExport = getPluginOption(plugins, \"decorators\", \"decoratorsBeforeExport\");\n\n if (decoratorsBeforeExport == null) {\n throw new Error(\"The 'decorators' plugin requires a 'decoratorsBeforeExport' option,\" + \" whose value must be a boolean. If you are migrating from\" + \" Babylon/Babel 6 or want to use the old decorators proposal, you\" + \" should use the 'decorators-legacy' plugin instead of 'decorators'.\");\n } else if (typeof decoratorsBeforeExport !== \"boolean\") {\n throw new Error(\"'decoratorsBeforeExport' must be a boolean.\");\n }\n }\n\n if (hasPlugin(plugins, \"flow\") && hasPlugin(plugins, \"typescript\")) {\n throw new Error(\"Cannot combine flow and typescript plugins.\");\n }\n\n if (hasPlugin(plugins, \"placeholders\") && hasPlugin(plugins, \"v8intrinsic\")) {\n throw new Error(\"Cannot combine placeholders and v8intrinsic plugins.\");\n }\n\n if (hasPlugin(plugins, \"pipelineOperator\") && !PIPELINE_PROPOSALS.includes(getPluginOption(plugins, \"pipelineOperator\", \"proposal\"))) {\n throw new Error(\"'pipelineOperator' requires 'proposal' option whose value should be one of: \" + PIPELINE_PROPOSALS.map(p => `'${p}'`).join(\", \"));\n }\n\n if (hasPlugin(plugins, \"moduleAttributes\")) {\n if (hasPlugin(plugins, \"importAssertions\")) {\n throw new Error(\"Cannot combine importAssertions and moduleAttributes plugins.\");\n }\n\n const moduleAttributesVerionPluginOption = getPluginOption(plugins, \"moduleAttributes\", \"version\");\n\n if (moduleAttributesVerionPluginOption !== \"may-2020\") {\n throw new Error(\"The 'moduleAttributes' plugin requires a 'version' option,\" + \" representing the last proposal update. Currently, the\" + \" only supported value is 'may-2020'.\");\n }\n }\n\n if (hasPlugin(plugins, \"recordAndTuple\") && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, \"recordAndTuple\", \"syntaxType\"))) {\n throw new Error(\"'recordAndTuple' requires 'syntaxType' option whose value should be one of: \" + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(\", \"));\n }\n}\nconst mixinPlugins = {\n estree,\n jsx,\n flow,\n typescript,\n v8intrinsic,\n placeholders\n};\nconst mixinPluginNames = Object.keys(mixinPlugins);\n\nconst defaultOptions = {\n sourceType: \"script\",\n sourceFilename: undefined,\n startLine: 1,\n allowAwaitOutsideFunction: false,\n allowReturnOutsideFunction: false,\n allowImportExportEverywhere: false,\n allowSuperOutsideMethod: false,\n allowUndeclaredExports: false,\n plugins: [],\n strictMode: null,\n ranges: false,\n tokens: false,\n createParenthesizedExpressions: false,\n errorRecovery: false\n};\nfunction getOptions(opts) {\n const options = {};\n\n for (let _i = 0, _Object$keys = Object.keys(defaultOptions); _i < _Object$keys.length; _i++) {\n const key = _Object$keys[_i];\n options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];\n }\n\n return options;\n}\n\nclass State {\n constructor() {\n this.strict = void 0;\n this.curLine = void 0;\n this.startLoc = void 0;\n this.endLoc = void 0;\n this.errors = [];\n this.potentialArrowAt = -1;\n this.noArrowAt = [];\n this.noArrowParamsConversionAt = [];\n this.maybeInArrowParameters = false;\n this.inPipeline = false;\n this.inType = false;\n this.noAnonFunctionType = false;\n this.inPropertyName = false;\n this.hasFlowComment = false;\n this.isIterator = false;\n this.isDeclareContext = false;\n this.topicContext = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null\n };\n this.soloAwait = false;\n this.inFSharpPipelineDirectBody = false;\n this.labels = [];\n this.decoratorStack = [[]];\n this.comments = [];\n this.trailingComments = [];\n this.leadingComments = [];\n this.commentStack = [];\n this.commentPreviousNode = null;\n this.pos = 0;\n this.lineStart = 0;\n this.type = types.eof;\n this.value = null;\n this.start = 0;\n this.end = 0;\n this.lastTokEndLoc = null;\n this.lastTokStartLoc = null;\n this.lastTokStart = 0;\n this.lastTokEnd = 0;\n this.context = [types$1.braceStatement];\n this.exprAllowed = true;\n this.containsEsc = false;\n this.octalPositions = [];\n this.exportedIdentifiers = [];\n this.tokensLength = 0;\n }\n\n init(options) {\n this.strict = options.strictMode === false ? false : options.sourceType === \"module\";\n this.curLine = options.startLine;\n this.startLoc = this.endLoc = this.curPosition();\n }\n\n curPosition() {\n return new Position(this.curLine, this.pos - this.lineStart);\n }\n\n clone(skipArrays) {\n const state = new State();\n const keys = Object.keys(this);\n\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n let val = this[key];\n\n if (!skipArrays && Array.isArray(val)) {\n val = val.slice();\n }\n\n state[key] = val;\n }\n\n return state;\n }\n\n}\n\nvar _isDigit = function isDigit(code) {\n return code >= 48 && code <= 57;\n};\nconst VALID_REGEX_FLAGS = new Set([\"g\", \"m\", \"s\", \"i\", \"y\", \"u\"]);\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: [46, 66, 69, 79, 95, 98, 101, 111],\n hex: [46, 88, 95, 120]\n};\nconst allowedNumericSeparatorSiblings = {};\nallowedNumericSeparatorSiblings.bin = [48, 49];\nallowedNumericSeparatorSiblings.oct = [...allowedNumericSeparatorSiblings.bin, 50, 51, 52, 53, 54, 55];\nallowedNumericSeparatorSiblings.dec = [...allowedNumericSeparatorSiblings.oct, 56, 57];\nallowedNumericSeparatorSiblings.hex = [...allowedNumericSeparatorSiblings.dec, 65, 66, 67, 68, 69, 70, 97, 98, 99, 100, 101, 102];\nclass Token {\n constructor(state) {\n this.type = state.type;\n this.value = state.value;\n this.start = state.start;\n this.end = state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n}\nclass Tokenizer extends ParserError {\n constructor(options, input) {\n super();\n this.isLookahead = void 0;\n this.tokens = [];\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.isLookahead = false;\n }\n\n pushToken(token) {\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n next() {\n if (!this.isLookahead) {\n this.checkKeywordEscapes();\n\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n }\n\n this.state.lastTokEnd = this.state.end;\n this.state.lastTokStart = this.state.start;\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n eat(type) {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n match(type) {\n return this.state.type === type;\n }\n\n lookahead() {\n const old = this.state;\n this.state = old.clone(true);\n this.isLookahead = true;\n this.next();\n this.isLookahead = false;\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart() {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos) {\n skipWhiteSpace.lastIndex = pos;\n const skip = skipWhiteSpace.exec(this.input);\n return pos + skip[0].length;\n }\n\n lookaheadCharCode() {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n\n setStrict(strict) {\n this.state.strict = strict;\n if (!this.match(types.num) && !this.match(types.string)) return;\n this.state.pos = this.state.start;\n\n while (this.state.pos < this.state.lineStart) {\n this.state.lineStart = this.input.lastIndexOf(\"\\n\", this.state.lineStart - 2) + 1;\n --this.state.curLine;\n }\n\n this.nextToken();\n }\n\n curContext() {\n return this.state.context[this.state.context.length - 1];\n }\n\n nextToken() {\n const curContext = this.curContext();\n if (!(curContext == null ? void 0 : curContext.preserveSpace)) this.skipSpace();\n this.state.octalPositions = [];\n this.state.start = this.state.pos;\n this.state.startLoc = this.state.curPosition();\n\n if (this.state.pos >= this.length) {\n this.finishToken(types.eof);\n return;\n }\n\n const override = curContext == null ? void 0 : curContext.override;\n\n if (override) {\n override(this);\n } else {\n this.getTokenFromCode(this.input.codePointAt(this.state.pos));\n }\n }\n\n pushComment(block, text, start, end, startLoc, endLoc) {\n const comment = {\n type: block ? \"CommentBlock\" : \"CommentLine\",\n value: text,\n start: start,\n end: end,\n loc: new SourceLocation(startLoc, endLoc)\n };\n if (this.options.tokens) this.pushToken(comment);\n this.state.comments.push(comment);\n this.addComment(comment);\n }\n\n skipBlockComment() {\n const startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(\"*/\", this.state.pos + 2);\n if (end === -1) throw this.raise(start, ErrorMessages.UnterminatedComment);\n this.state.pos = end + 2;\n lineBreakG.lastIndex = start;\n let match;\n\n while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) {\n ++this.state.curLine;\n this.state.lineStart = match.index + match[0].length;\n }\n\n if (this.isLookahead) return;\n this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition());\n }\n\n skipLineComment(startSkip) {\n const start = this.state.pos;\n const startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt(this.state.pos += startSkip);\n\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n if (this.isLookahead) return;\n this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition());\n }\n\n skipSpace() {\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n\n switch (ch) {\n case 32:\n case 160:\n case 9:\n ++this.state.pos;\n break;\n\n case 13:\n if (this.input.charCodeAt(this.state.pos + 1) === 10) {\n ++this.state.pos;\n }\n\n case 10:\n case 8232:\n case 8233:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case 47:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case 42:\n this.skipBlockComment();\n break;\n\n case 47:\n this.skipLineComment(2);\n break;\n\n default:\n break loop;\n }\n\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else {\n break loop;\n }\n\n }\n }\n }\n\n finishToken(type, val) {\n this.state.end = this.state.pos;\n this.state.endLoc = this.state.curPosition();\n const prevType = this.state.type;\n this.state.type = type;\n this.state.value = val;\n if (!this.isLookahead) this.updateContext(prevType);\n }\n\n readToken_numberSign() {\n if (this.state.pos === 0 && this.readToken_interpreter()) {\n return;\n }\n\n const nextPos = this.state.pos + 1;\n const next = this.input.charCodeAt(nextPos);\n\n if (next >= 48 && next <= 57) {\n throw this.raise(this.state.pos, ErrorMessages.UnexpectedDigitAfterHash);\n }\n\n if (next === 123 || next === 91 && this.hasPlugin(\"recordAndTuple\")) {\n this.expectPlugin(\"recordAndTuple\");\n\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"hash\") {\n throw this.raise(this.state.pos, next === 123 ? ErrorMessages.RecordExpressionHashIncorrectStartSyntaxType : ErrorMessages.TupleExpressionHashIncorrectStartSyntaxType);\n }\n\n if (next === 123) {\n this.finishToken(types.braceHashL);\n } else {\n this.finishToken(types.bracketHashL);\n }\n\n this.state.pos += 2;\n } else {\n this.finishOp(types.hash, 1);\n }\n }\n\n readToken_dot() {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next >= 48 && next <= 57) {\n this.readNumber(true);\n return;\n }\n\n if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {\n this.state.pos += 3;\n this.finishToken(types.ellipsis);\n } else {\n ++this.state.pos;\n this.finishToken(types.dot);\n }\n }\n\n readToken_slash() {\n if (this.state.exprAllowed && !this.state.inType) {\n ++this.state.pos;\n this.readRegexp();\n return;\n }\n\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === 61) {\n this.finishOp(types.assign, 2);\n } else {\n this.finishOp(types.slash, 1);\n }\n }\n\n readToken_interpreter() {\n if (this.state.pos !== 0 || this.length < 2) return false;\n let ch = this.input.charCodeAt(this.state.pos + 1);\n if (ch !== 33) return false;\n const start = this.state.pos;\n this.state.pos += 1;\n\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n\n const value = this.input.slice(start + 2, this.state.pos);\n this.finishToken(types.interpreterDirective, value);\n return true;\n }\n\n readToken_mult_modulo(code) {\n let type = code === 42 ? types.star : types.modulo;\n let width = 1;\n let next = this.input.charCodeAt(this.state.pos + 1);\n const exprAllowed = this.state.exprAllowed;\n\n if (code === 42 && next === 42) {\n width++;\n next = this.input.charCodeAt(this.state.pos + 2);\n type = types.exponent;\n }\n\n if (next === 61 && !exprAllowed) {\n width++;\n type = types.assign;\n }\n\n this.finishOp(type, width);\n }\n\n readToken_pipe_amp(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === code) {\n if (this.input.charCodeAt(this.state.pos + 2) === 61) {\n this.finishOp(types.assign, 3);\n } else {\n this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2);\n }\n\n return;\n }\n\n if (code === 124) {\n if (next === 62) {\n this.finishOp(types.pipeline, 2);\n return;\n }\n\n if (this.hasPlugin(\"recordAndTuple\") && next === 125) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(this.state.pos, ErrorMessages.RecordExpressionBarIncorrectEndSyntaxType);\n }\n\n this.finishOp(types.braceBarR, 2);\n return;\n }\n\n if (this.hasPlugin(\"recordAndTuple\") && next === 93) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(this.state.pos, ErrorMessages.TupleExpressionBarIncorrectEndSyntaxType);\n }\n\n this.finishOp(types.bracketBarR, 2);\n return;\n }\n }\n\n if (next === 61) {\n this.finishOp(types.assign, 2);\n return;\n }\n\n this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1);\n }\n\n readToken_caret() {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === 61) {\n this.finishOp(types.assign, 2);\n } else {\n this.finishOp(types.bitwiseXOR, 1);\n }\n }\n\n readToken_plus_min(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === code) {\n if (next === 45 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 62 && (this.state.lastTokEnd === 0 || this.hasPrecedingLineBreak())) {\n this.skipLineComment(3);\n this.skipSpace();\n this.nextToken();\n return;\n }\n\n this.finishOp(types.incDec, 2);\n return;\n }\n\n if (next === 61) {\n this.finishOp(types.assign, 2);\n } else {\n this.finishOp(types.plusMin, 1);\n }\n }\n\n readToken_lt_gt(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n let size = 1;\n\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2;\n\n if (this.input.charCodeAt(this.state.pos + size) === 61) {\n this.finishOp(types.assign, size + 1);\n return;\n }\n\n this.finishOp(types.bitShift, size);\n return;\n }\n\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) {\n this.skipLineComment(4);\n this.skipSpace();\n this.nextToken();\n return;\n }\n\n if (next === 61) {\n size = 2;\n }\n\n this.finishOp(types.relational, size);\n }\n\n readToken_eq_excl(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === 61) {\n this.finishOp(types.equality, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);\n return;\n }\n\n if (code === 61 && next === 62) {\n this.state.pos += 2;\n this.finishToken(types.arrow);\n return;\n }\n\n this.finishOp(code === 61 ? types.eq : types.bang, 1);\n }\n\n readToken_question() {\n const next = this.input.charCodeAt(this.state.pos + 1);\n const next2 = this.input.charCodeAt(this.state.pos + 2);\n\n if (next === 63) {\n if (next2 === 61) {\n this.finishOp(types.assign, 3);\n } else {\n this.finishOp(types.nullishCoalescing, 2);\n }\n } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {\n this.state.pos += 2;\n this.finishToken(types.questionDot);\n } else {\n ++this.state.pos;\n this.finishToken(types.question);\n }\n }\n\n getTokenFromCode(code) {\n switch (code) {\n case 46:\n this.readToken_dot();\n return;\n\n case 40:\n ++this.state.pos;\n this.finishToken(types.parenL);\n return;\n\n case 41:\n ++this.state.pos;\n this.finishToken(types.parenR);\n return;\n\n case 59:\n ++this.state.pos;\n this.finishToken(types.semi);\n return;\n\n case 44:\n ++this.state.pos;\n this.finishToken(types.comma);\n return;\n\n case 91:\n if (this.hasPlugin(\"recordAndTuple\") && this.input.charCodeAt(this.state.pos + 1) === 124) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(this.state.pos, ErrorMessages.TupleExpressionBarIncorrectStartSyntaxType);\n }\n\n this.finishToken(types.bracketBarL);\n this.state.pos += 2;\n } else {\n ++this.state.pos;\n this.finishToken(types.bracketL);\n }\n\n return;\n\n case 93:\n ++this.state.pos;\n this.finishToken(types.bracketR);\n return;\n\n case 123:\n if (this.hasPlugin(\"recordAndTuple\") && this.input.charCodeAt(this.state.pos + 1) === 124) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(this.state.pos, ErrorMessages.RecordExpressionBarIncorrectStartSyntaxType);\n }\n\n this.finishToken(types.braceBarL);\n this.state.pos += 2;\n } else {\n ++this.state.pos;\n this.finishToken(types.braceL);\n }\n\n return;\n\n case 125:\n ++this.state.pos;\n this.finishToken(types.braceR);\n return;\n\n case 58:\n if (this.hasPlugin(\"functionBind\") && this.input.charCodeAt(this.state.pos + 1) === 58) {\n this.finishOp(types.doubleColon, 2);\n } else {\n ++this.state.pos;\n this.finishToken(types.colon);\n }\n\n return;\n\n case 63:\n this.readToken_question();\n return;\n\n case 96:\n ++this.state.pos;\n this.finishToken(types.backQuote);\n return;\n\n case 48:\n {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === 120 || next === 88) {\n this.readRadixNumber(16);\n return;\n }\n\n if (next === 111 || next === 79) {\n this.readRadixNumber(8);\n return;\n }\n\n if (next === 98 || next === 66) {\n this.readRadixNumber(2);\n return;\n }\n }\n\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n this.readNumber(false);\n return;\n\n case 34:\n case 39:\n this.readString(code);\n return;\n\n case 47:\n this.readToken_slash();\n return;\n\n case 37:\n case 42:\n this.readToken_mult_modulo(code);\n return;\n\n case 124:\n case 38:\n this.readToken_pipe_amp(code);\n return;\n\n case 94:\n this.readToken_caret();\n return;\n\n case 43:\n case 45:\n this.readToken_plus_min(code);\n return;\n\n case 60:\n case 62:\n this.readToken_lt_gt(code);\n return;\n\n case 61:\n case 33:\n this.readToken_eq_excl(code);\n return;\n\n case 126:\n this.finishOp(types.tilde, 1);\n return;\n\n case 64:\n ++this.state.pos;\n this.finishToken(types.at);\n return;\n\n case 35:\n this.readToken_numberSign();\n return;\n\n case 92:\n this.readWord();\n return;\n\n default:\n if (isIdentifierStart(code)) {\n this.readWord();\n return;\n }\n\n }\n\n throw this.raise(this.state.pos, ErrorMessages.InvalidOrUnexpectedToken, String.fromCodePoint(code));\n }\n\n finishOp(type, size) {\n const str = this.input.slice(this.state.pos, this.state.pos + size);\n this.state.pos += size;\n this.finishToken(type, str);\n }\n\n readRegexp() {\n const start = this.state.pos;\n let escaped, inClass;\n\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(start, ErrorMessages.UnterminatedRegExp);\n }\n\n const ch = this.input.charAt(this.state.pos);\n\n if (lineBreak.test(ch)) {\n throw this.raise(start, ErrorMessages.UnterminatedRegExp);\n }\n\n if (escaped) {\n escaped = false;\n } else {\n if (ch === \"[\") {\n inClass = true;\n } else if (ch === \"]\" && inClass) {\n inClass = false;\n } else if (ch === \"/\" && !inClass) {\n break;\n }\n\n escaped = ch === \"\\\\\";\n }\n\n ++this.state.pos;\n }\n\n const content = this.input.slice(start, this.state.pos);\n ++this.state.pos;\n let mods = \"\";\n\n while (this.state.pos < this.length) {\n const char = this.input[this.state.pos];\n const charCode = this.input.codePointAt(this.state.pos);\n\n if (VALID_REGEX_FLAGS.has(char)) {\n if (mods.indexOf(char) > -1) {\n this.raise(this.state.pos + 1, ErrorMessages.DuplicateRegExpFlags);\n }\n } else if (isIdentifierChar(charCode) || charCode === 92) {\n this.raise(this.state.pos + 1, ErrorMessages.MalformedRegExpFlags);\n } else {\n break;\n }\n\n ++this.state.pos;\n mods += char;\n }\n\n this.finishToken(types.regexp, {\n pattern: content,\n flags: mods\n });\n }\n\n readInt(radix, len, forceLen, allowNumSeparator = true) {\n const start = this.state.pos;\n const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;\n const allowedSiblings = radix === 16 ? allowedNumericSeparatorSiblings.hex : radix === 10 ? allowedNumericSeparatorSiblings.dec : radix === 8 ? allowedNumericSeparatorSiblings.oct : allowedNumericSeparatorSiblings.bin;\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = this.input.charCodeAt(this.state.pos);\n let val;\n\n if (code === 95) {\n const prev = this.input.charCodeAt(this.state.pos - 1);\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (allowedSiblings.indexOf(next) === -1) {\n this.raise(this.state.pos, ErrorMessages.UnexpectedNumericSeparator);\n } else if (forbiddenSiblings.indexOf(prev) > -1 || forbiddenSiblings.indexOf(next) > -1 || Number.isNaN(next)) {\n this.raise(this.state.pos, ErrorMessages.UnexpectedNumericSeparator);\n }\n\n if (!allowNumSeparator) {\n this.raise(this.state.pos, ErrorMessages.NumericSeparatorInEscapeSequence);\n }\n\n ++this.state.pos;\n continue;\n }\n\n if (code >= 97) {\n val = code - 97 + 10;\n } else if (code >= 65) {\n val = code - 65 + 10;\n } else if (_isDigit(code)) {\n val = code - 48;\n } else {\n val = Infinity;\n }\n\n if (val >= radix) {\n if (this.options.errorRecovery && val <= 9) {\n val = 0;\n this.raise(this.state.start + i + 2, ErrorMessages.InvalidDigit, radix);\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n\n ++this.state.pos;\n total = total * radix + val;\n }\n\n if (this.state.pos === start || len != null && this.state.pos - start !== len || invalid) {\n return null;\n }\n\n return total;\n }\n\n readRadixNumber(radix) {\n const start = this.state.pos;\n let isBigInt = false;\n this.state.pos += 2;\n const val = this.readInt(radix);\n\n if (val == null) {\n this.raise(this.state.start + 2, ErrorMessages.InvalidDigit, radix);\n }\n\n const next = this.input.charCodeAt(this.state.pos);\n\n if (next === 110) {\n ++this.state.pos;\n isBigInt = true;\n } else if (next === 109) {\n throw this.raise(start, ErrorMessages.InvalidDecimal);\n }\n\n if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {\n throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier);\n }\n\n if (isBigInt) {\n const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, \"\");\n this.finishToken(types.bigint, str);\n return;\n }\n\n this.finishToken(types.num, val);\n }\n\n readNumber(startsWithDot) {\n const start = this.state.pos;\n let isFloat = false;\n let isBigInt = false;\n let isDecimal = false;\n let hasExponent = false;\n let isOctal = false;\n\n if (!startsWithDot && this.readInt(10) === null) {\n this.raise(start, ErrorMessages.InvalidNumber);\n }\n\n const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;\n\n if (hasLeadingZero) {\n const integer = this.input.slice(start, this.state.pos);\n\n if (this.state.strict) {\n this.raise(start, ErrorMessages.StrictOctalLiteral);\n } else {\n const underscorePos = integer.indexOf(\"_\");\n\n if (underscorePos > 0) {\n this.raise(underscorePos + start, ErrorMessages.ZeroDigitNumericSeparator);\n }\n }\n\n isOctal = hasLeadingZero && !/[89]/.test(integer);\n }\n\n let next = this.input.charCodeAt(this.state.pos);\n\n if (next === 46 && !isOctal) {\n ++this.state.pos;\n this.readInt(10);\n isFloat = true;\n next = this.input.charCodeAt(this.state.pos);\n }\n\n if ((next === 69 || next === 101) && !isOctal) {\n next = this.input.charCodeAt(++this.state.pos);\n\n if (next === 43 || next === 45) {\n ++this.state.pos;\n }\n\n if (this.readInt(10) === null) {\n this.raise(start, ErrorMessages.InvalidOrMissingExponent);\n }\n\n isFloat = true;\n hasExponent = true;\n next = this.input.charCodeAt(this.state.pos);\n }\n\n if (next === 110) {\n if (isFloat || hasLeadingZero) {\n this.raise(start, ErrorMessages.InvalidBigIntLiteral);\n }\n\n ++this.state.pos;\n isBigInt = true;\n }\n\n if (next === 109) {\n this.expectPlugin(\"decimal\", this.state.pos);\n\n if (hasExponent || hasLeadingZero) {\n this.raise(start, ErrorMessages.InvalidDecimal);\n }\n\n ++this.state.pos;\n isDecimal = true;\n }\n\n if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {\n throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier);\n }\n\n const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, \"\");\n\n if (isBigInt) {\n this.finishToken(types.bigint, str);\n return;\n }\n\n if (isDecimal) {\n this.finishToken(types.decimal, str);\n return;\n }\n\n const val = isOctal ? parseInt(str, 8) : parseFloat(str);\n this.finishToken(types.num, val);\n }\n\n readCodePoint(throwOnInvalid) {\n const ch = this.input.charCodeAt(this.state.pos);\n let code;\n\n if (ch === 123) {\n const codePos = ++this.state.pos;\n code = this.readHexChar(this.input.indexOf(\"}\", this.state.pos) - this.state.pos, true, throwOnInvalid);\n ++this.state.pos;\n\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n this.raise(codePos, ErrorMessages.InvalidCodePoint);\n } else {\n return null;\n }\n }\n } else {\n code = this.readHexChar(4, false, throwOnInvalid);\n }\n\n return code;\n }\n\n readString(quote) {\n let out = \"\",\n chunkStart = ++this.state.pos;\n\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(this.state.start, ErrorMessages.UnterminatedString);\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n if (ch === quote) break;\n\n if (ch === 92) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.readEscapedChar(false);\n chunkStart = this.state.pos;\n } else if (ch === 8232 || ch === 8233) {\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n } else if (isNewLine(ch)) {\n throw this.raise(this.state.start, ErrorMessages.UnterminatedString);\n } else {\n ++this.state.pos;\n }\n }\n\n out += this.input.slice(chunkStart, this.state.pos++);\n this.finishToken(types.string, out);\n }\n\n readTmplToken() {\n let out = \"\",\n chunkStart = this.state.pos,\n containsInvalid = false;\n\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(this.state.start, ErrorMessages.UnterminatedTemplate);\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n\n if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) {\n if (this.state.pos === this.state.start && this.match(types.template)) {\n if (ch === 36) {\n this.state.pos += 2;\n this.finishToken(types.dollarBraceL);\n return;\n } else {\n ++this.state.pos;\n this.finishToken(types.backQuote);\n return;\n }\n }\n\n out += this.input.slice(chunkStart, this.state.pos);\n this.finishToken(types.template, containsInvalid ? null : out);\n return;\n }\n\n if (ch === 92) {\n out += this.input.slice(chunkStart, this.state.pos);\n const escaped = this.readEscapedChar(true);\n\n if (escaped === null) {\n containsInvalid = true;\n } else {\n out += escaped;\n }\n\n chunkStart = this.state.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n ++this.state.pos;\n\n switch (ch) {\n case 13:\n if (this.input.charCodeAt(this.state.pos) === 10) {\n ++this.state.pos;\n }\n\n case 10:\n out += \"\\n\";\n break;\n\n default:\n out += String.fromCharCode(ch);\n break;\n }\n\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n }\n\n readEscapedChar(inTemplate) {\n const throwOnInvalid = !inTemplate;\n const ch = this.input.charCodeAt(++this.state.pos);\n ++this.state.pos;\n\n switch (ch) {\n case 110:\n return \"\\n\";\n\n case 114:\n return \"\\r\";\n\n case 120:\n {\n const code = this.readHexChar(2, false, throwOnInvalid);\n return code === null ? null : String.fromCharCode(code);\n }\n\n case 117:\n {\n const code = this.readCodePoint(throwOnInvalid);\n return code === null ? null : String.fromCodePoint(code);\n }\n\n case 116:\n return \"\\t\";\n\n case 98:\n return \"\\b\";\n\n case 118:\n return \"\\u000b\";\n\n case 102:\n return \"\\f\";\n\n case 13:\n if (this.input.charCodeAt(this.state.pos) === 10) {\n ++this.state.pos;\n }\n\n case 10:\n this.state.lineStart = this.state.pos;\n ++this.state.curLine;\n\n case 8232:\n case 8233:\n return \"\";\n\n case 56:\n case 57:\n if (inTemplate) {\n return null;\n } else if (this.state.strict) {\n this.raise(this.state.pos - 1, ErrorMessages.StrictNumericEscape);\n }\n\n default:\n if (ch >= 48 && ch <= 55) {\n const codePos = this.state.pos - 1;\n const match = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/);\n let octalStr = match[0];\n let octal = parseInt(octalStr, 8);\n\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n\n this.state.pos += octalStr.length - 1;\n const next = this.input.charCodeAt(this.state.pos);\n\n if (octalStr !== \"0\" || next === 56 || next === 57) {\n if (inTemplate) {\n return null;\n } else if (this.state.strict) {\n this.raise(codePos, ErrorMessages.StrictNumericEscape);\n } else {\n this.state.octalPositions.push(codePos);\n }\n }\n\n return String.fromCharCode(octal);\n }\n\n return String.fromCharCode(ch);\n }\n }\n\n readHexChar(len, forceLen, throwOnInvalid) {\n const codePos = this.state.pos;\n const n = this.readInt(16, len, forceLen, false);\n\n if (n === null) {\n if (throwOnInvalid) {\n this.raise(codePos, ErrorMessages.InvalidEscapeSequence);\n } else {\n this.state.pos = codePos - 1;\n }\n }\n\n return n;\n }\n\n readWord1() {\n let word = \"\";\n this.state.containsEsc = false;\n const start = this.state.pos;\n let chunkStart = this.state.pos;\n\n while (this.state.pos < this.length) {\n const ch = this.input.codePointAt(this.state.pos);\n\n if (isIdentifierChar(ch)) {\n this.state.pos += ch <= 0xffff ? 1 : 2;\n } else if (this.state.isIterator && ch === 64) {\n ++this.state.pos;\n } else if (ch === 92) {\n this.state.containsEsc = true;\n word += this.input.slice(chunkStart, this.state.pos);\n const escStart = this.state.pos;\n const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar;\n\n if (this.input.charCodeAt(++this.state.pos) !== 117) {\n this.raise(this.state.pos, ErrorMessages.MissingUnicodeEscape);\n continue;\n }\n\n ++this.state.pos;\n const esc = this.readCodePoint(true);\n\n if (esc !== null) {\n if (!identifierCheck(esc)) {\n this.raise(escStart, ErrorMessages.EscapedCharNotAnIdentifier);\n }\n\n word += String.fromCodePoint(esc);\n }\n\n chunkStart = this.state.pos;\n } else {\n break;\n }\n }\n\n return word + this.input.slice(chunkStart, this.state.pos);\n }\n\n isIterator(word) {\n return word === \"@@iterator\" || word === \"@@asyncIterator\";\n }\n\n readWord() {\n const word = this.readWord1();\n const type = keywords.get(word) || types.name;\n\n if (this.state.isIterator && (!this.isIterator(word) || !this.state.inType)) {\n this.raise(this.state.pos, ErrorMessages.InvalidIdentifier, word);\n }\n\n this.finishToken(type, word);\n }\n\n checkKeywordEscapes() {\n const kw = this.state.type.keyword;\n\n if (kw && this.state.containsEsc) {\n this.raise(this.state.start, ErrorMessages.InvalidEscapedReservedWord, kw);\n }\n }\n\n braceIsBlock(prevType) {\n const parent = this.curContext();\n\n if (parent === types$1.functionExpression || parent === types$1.functionStatement) {\n return true;\n }\n\n if (prevType === types.colon && (parent === types$1.braceStatement || parent === types$1.braceExpression)) {\n return !parent.isExpr;\n }\n\n if (prevType === types._return || prevType === types.name && this.state.exprAllowed) {\n return this.hasPrecedingLineBreak();\n }\n\n if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) {\n return true;\n }\n\n if (prevType === types.braceL) {\n return parent === types$1.braceStatement;\n }\n\n if (prevType === types._var || prevType === types._const || prevType === types.name) {\n return false;\n }\n\n if (prevType === types.relational) {\n return true;\n }\n\n return !this.state.exprAllowed;\n }\n\n updateContext(prevType) {\n const type = this.state.type;\n let update;\n\n if (type.keyword && (prevType === types.dot || prevType === types.questionDot)) {\n this.state.exprAllowed = false;\n } else if (update = type.updateContext) {\n update.call(this, prevType);\n } else {\n this.state.exprAllowed = type.beforeExpr;\n }\n }\n\n}\n\nclass UtilParser extends Tokenizer {\n addExtra(node, key, val) {\n if (!node) return;\n const extra = node.extra = node.extra || {};\n extra[key] = val;\n }\n\n isRelational(op) {\n return this.match(types.relational) && this.state.value === op;\n }\n\n expectRelational(op) {\n if (this.isRelational(op)) {\n this.next();\n } else {\n this.unexpected(null, types.relational);\n }\n }\n\n isContextual(name) {\n return this.match(types.name) && this.state.value === name && !this.state.containsEsc;\n }\n\n isUnparsedContextual(nameStart, name) {\n const nameEnd = nameStart + name.length;\n return this.input.slice(nameStart, nameEnd) === name && (nameEnd === this.input.length || !isIdentifierChar(this.input.charCodeAt(nameEnd)));\n }\n\n isLookaheadContextual(name) {\n const next = this.nextTokenStart();\n return this.isUnparsedContextual(next, name);\n }\n\n eatContextual(name) {\n return this.isContextual(name) && this.eat(types.name);\n }\n\n expectContextual(name, message) {\n if (!this.eatContextual(name)) this.unexpected(null, message);\n }\n\n canInsertSemicolon() {\n return this.match(types.eof) || this.match(types.braceR) || this.hasPrecedingLineBreak();\n }\n\n hasPrecedingLineBreak() {\n return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));\n }\n\n isLineTerminator() {\n return this.eat(types.semi) || this.canInsertSemicolon();\n }\n\n semicolon() {\n if (!this.isLineTerminator()) this.unexpected(null, types.semi);\n }\n\n expect(type, pos) {\n this.eat(type) || this.unexpected(pos, type);\n }\n\n assertNoSpace(message = \"Unexpected space.\") {\n if (this.state.start > this.state.lastTokEnd) {\n this.raise(this.state.lastTokEnd, message);\n }\n }\n\n unexpected(pos, messageOrType = \"Unexpected token\") {\n if (typeof messageOrType !== \"string\") {\n messageOrType = `Unexpected token, expected \"${messageOrType.label}\"`;\n }\n\n throw this.raise(pos != null ? pos : this.state.start, messageOrType);\n }\n\n expectPlugin(name, pos) {\n if (!this.hasPlugin(name)) {\n throw this.raiseWithData(pos != null ? pos : this.state.start, {\n missingPlugin: [name]\n }, `This experimental syntax requires enabling the parser plugin: '${name}'`);\n }\n\n return true;\n }\n\n expectOnePlugin(names, pos) {\n if (!names.some(n => this.hasPlugin(n))) {\n throw this.raiseWithData(pos != null ? pos : this.state.start, {\n missingPlugin: names\n }, `This experimental syntax requires enabling one of the following parser plugin(s): '${names.join(\", \")}'`);\n }\n }\n\n tryParse(fn, oldState = this.state.clone()) {\n const abortSignal = {\n node: null\n };\n\n try {\n const node = fn((node = null) => {\n abortSignal.node = node;\n throw abortSignal;\n });\n\n if (this.state.errors.length > oldState.errors.length) {\n const failState = this.state;\n this.state = oldState;\n return {\n node,\n error: failState.errors[oldState.errors.length],\n thrown: false,\n aborted: false,\n failState\n };\n }\n\n return {\n node,\n error: null,\n thrown: false,\n aborted: false,\n failState: null\n };\n } catch (error) {\n const failState = this.state;\n this.state = oldState;\n\n if (error instanceof SyntaxError) {\n return {\n node: null,\n error,\n thrown: true,\n aborted: false,\n failState\n };\n }\n\n if (error === abortSignal) {\n return {\n node: abortSignal.node,\n error: null,\n thrown: false,\n aborted: true,\n failState\n };\n }\n\n throw error;\n }\n }\n\n checkExpressionErrors(refExpressionErrors, andThrow) {\n if (!refExpressionErrors) return false;\n const {\n shorthandAssign,\n doubleProto\n } = refExpressionErrors;\n if (!andThrow) return shorthandAssign >= 0 || doubleProto >= 0;\n\n if (shorthandAssign >= 0) {\n this.unexpected(shorthandAssign);\n }\n\n if (doubleProto >= 0) {\n this.raise(doubleProto, ErrorMessages.DuplicateProto);\n }\n }\n\n isLiteralPropertyName() {\n return this.match(types.name) || !!this.state.type.keyword || this.match(types.string) || this.match(types.num) || this.match(types.bigint) || this.match(types.decimal);\n }\n\n}\nclass ExpressionErrors {\n constructor() {\n this.shorthandAssign = -1;\n this.doubleProto = -1;\n }\n\n}\n\nclass Node {\n constructor(parser, pos, loc) {\n this.type = void 0;\n this.start = void 0;\n this.end = void 0;\n this.loc = void 0;\n this.range = void 0;\n this.leadingComments = void 0;\n this.trailingComments = void 0;\n this.innerComments = void 0;\n this.extra = void 0;\n this.type = \"\";\n this.start = pos;\n this.end = 0;\n this.loc = new SourceLocation(loc);\n if (parser == null ? void 0 : parser.options.ranges) this.range = [pos, 0];\n if (parser == null ? void 0 : parser.filename) this.loc.filename = parser.filename;\n }\n\n __clone() {\n const newNode = new Node();\n const keys = Object.keys(this);\n\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n\n if (key !== \"leadingComments\" && key !== \"trailingComments\" && key !== \"innerComments\") {\n newNode[key] = this[key];\n }\n }\n\n return newNode;\n }\n\n}\n\nclass NodeUtils extends UtilParser {\n startNode() {\n return new Node(this, this.state.start, this.state.startLoc);\n }\n\n startNodeAt(pos, loc) {\n return new Node(this, pos, loc);\n }\n\n startNodeAtNode(type) {\n return this.startNodeAt(type.start, type.loc.start);\n }\n\n finishNode(node, type) {\n return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc);\n }\n\n finishNodeAt(node, type, pos, loc) {\n\n node.type = type;\n node.end = pos;\n node.loc.end = loc;\n if (this.options.ranges) node.range[1] = pos;\n this.processComment(node);\n return node;\n }\n\n resetStartLocation(node, start, startLoc) {\n node.start = start;\n node.loc.start = startLoc;\n if (this.options.ranges) node.range[0] = start;\n }\n\n resetEndLocation(node, end = this.state.lastTokEnd, endLoc = this.state.lastTokEndLoc) {\n node.end = end;\n node.loc.end = endLoc;\n if (this.options.ranges) node.range[1] = end;\n }\n\n resetStartLocationFromNode(node, locationNode) {\n this.resetStartLocation(node, locationNode.start, locationNode.loc.start);\n }\n\n}\n\nconst unwrapParenthesizedExpression = node => {\n return node.type === \"ParenthesizedExpression\" ? unwrapParenthesizedExpression(node.expression) : node;\n};\n\nclass LValParser extends NodeUtils {\n toAssignable(node) {\n var _node$extra, _node$extra3;\n\n let parenthesized = undefined;\n\n if (node.type === \"ParenthesizedExpression\" || ((_node$extra = node.extra) == null ? void 0 : _node$extra.parenthesized)) {\n parenthesized = unwrapParenthesizedExpression(node);\n\n if (parenthesized.type !== \"Identifier\" && parenthesized.type !== \"MemberExpression\") {\n this.raise(node.start, ErrorMessages.InvalidParenthesizedAssignment);\n }\n }\n\n switch (node.type) {\n case \"Identifier\":\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n break;\n\n case \"ObjectExpression\":\n node.type = \"ObjectPattern\";\n\n for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) {\n var _node$extra2;\n\n const prop = node.properties[i];\n const isLast = i === last;\n this.toAssignableObjectExpressionProp(prop, isLast);\n\n if (isLast && prop.type === \"RestElement\" && ((_node$extra2 = node.extra) == null ? void 0 : _node$extra2.trailingComma)) {\n this.raiseRestNotLast(node.extra.trailingComma);\n }\n }\n\n break;\n\n case \"ObjectProperty\":\n this.toAssignable(node.value);\n break;\n\n case \"SpreadElement\":\n {\n this.checkToRestConversion(node);\n node.type = \"RestElement\";\n const arg = node.argument;\n this.toAssignable(arg);\n break;\n }\n\n case \"ArrayExpression\":\n node.type = \"ArrayPattern\";\n this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingComma);\n break;\n\n case \"AssignmentExpression\":\n if (node.operator !== \"=\") {\n this.raise(node.left.end, ErrorMessages.MissingEqInAssignment);\n }\n\n node.type = \"AssignmentPattern\";\n delete node.operator;\n this.toAssignable(node.left);\n break;\n\n case \"ParenthesizedExpression\":\n this.toAssignable(parenthesized);\n break;\n }\n\n return node;\n }\n\n toAssignableObjectExpressionProp(prop, isLast) {\n if (prop.type === \"ObjectMethod\") {\n const error = prop.kind === \"get\" || prop.kind === \"set\" ? ErrorMessages.PatternHasAccessor : ErrorMessages.PatternHasMethod;\n this.raise(prop.key.start, error);\n } else if (prop.type === \"SpreadElement\" && !isLast) {\n this.raiseRestNotLast(prop.start);\n } else {\n this.toAssignable(prop);\n }\n }\n\n toAssignableList(exprList, trailingCommaPos) {\n let end = exprList.length;\n\n if (end) {\n const last = exprList[end - 1];\n\n if ((last == null ? void 0 : last.type) === \"RestElement\") {\n --end;\n } else if ((last == null ? void 0 : last.type) === \"SpreadElement\") {\n last.type = \"RestElement\";\n const arg = last.argument;\n this.toAssignable(arg);\n\n if (arg.type !== \"Identifier\" && arg.type !== \"MemberExpression\" && arg.type !== \"ArrayPattern\" && arg.type !== \"ObjectPattern\") {\n this.unexpected(arg.start);\n }\n\n if (trailingCommaPos) {\n this.raiseTrailingCommaAfterRest(trailingCommaPos);\n }\n\n --end;\n }\n }\n\n for (let i = 0; i < end; i++) {\n const elt = exprList[i];\n\n if (elt) {\n this.toAssignable(elt);\n\n if (elt.type === \"RestElement\") {\n this.raiseRestNotLast(elt.start);\n }\n }\n }\n\n return exprList;\n }\n\n toReferencedList(exprList, isParenthesizedExpr) {\n return exprList;\n }\n\n toReferencedListDeep(exprList, isParenthesizedExpr) {\n this.toReferencedList(exprList, isParenthesizedExpr);\n\n for (let _i = 0; _i < exprList.length; _i++) {\n const expr = exprList[_i];\n\n if ((expr == null ? void 0 : expr.type) === \"ArrayExpression\") {\n this.toReferencedListDeep(expr.elements);\n }\n }\n }\n\n parseSpread(refExpressionErrors, refNeedsArrowPos) {\n const node = this.startNode();\n this.next();\n node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined, refNeedsArrowPos);\n return this.finishNode(node, \"SpreadElement\");\n }\n\n parseRestBinding() {\n const node = this.startNode();\n this.next();\n node.argument = this.parseBindingAtom();\n return this.finishNode(node, \"RestElement\");\n }\n\n parseBindingAtom() {\n switch (this.state.type) {\n case types.bracketL:\n {\n const node = this.startNode();\n this.next();\n node.elements = this.parseBindingList(types.bracketR, 93, true);\n return this.finishNode(node, \"ArrayPattern\");\n }\n\n case types.braceL:\n return this.parseObjectLike(types.braceR, true);\n }\n\n return this.parseIdentifier();\n }\n\n parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) {\n const elts = [];\n let first = true;\n\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(types.comma);\n }\n\n if (allowEmpty && this.match(types.comma)) {\n elts.push(null);\n } else if (this.eat(close)) {\n break;\n } else if (this.match(types.ellipsis)) {\n elts.push(this.parseAssignableListItemTypes(this.parseRestBinding()));\n this.checkCommaAfterRest(closeCharCode);\n this.expect(close);\n break;\n } else {\n const decorators = [];\n\n if (this.match(types.at) && this.hasPlugin(\"decorators\")) {\n this.raise(this.state.start, ErrorMessages.UnsupportedParameterDecorator);\n }\n\n while (this.match(types.at)) {\n decorators.push(this.parseDecorator());\n }\n\n elts.push(this.parseAssignableListItem(allowModifiers, decorators));\n }\n }\n\n return elts;\n }\n\n parseAssignableListItem(allowModifiers, decorators) {\n const left = this.parseMaybeDefault();\n this.parseAssignableListItemTypes(left);\n const elt = this.parseMaybeDefault(left.start, left.loc.start, left);\n\n if (decorators.length) {\n left.decorators = decorators;\n }\n\n return elt;\n }\n\n parseAssignableListItemTypes(param) {\n return param;\n }\n\n parseMaybeDefault(startPos, startLoc, left) {\n var _startLoc, _startPos, _left;\n\n startLoc = (_startLoc = startLoc) != null ? _startLoc : this.state.startLoc;\n startPos = (_startPos = startPos) != null ? _startPos : this.state.start;\n left = (_left = left) != null ? _left : this.parseBindingAtom();\n if (!this.eat(types.eq)) return left;\n const node = this.startNodeAt(startPos, startLoc);\n node.left = left;\n node.right = this.parseMaybeAssignAllowIn();\n return this.finishNode(node, \"AssignmentPattern\");\n }\n\n checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription, disallowLetBinding, strictModeChanged = false) {\n switch (expr.type) {\n case \"Identifier\":\n if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(expr.name, this.inModule) : isStrictBindOnlyReservedWord(expr.name))) {\n this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.StrictEvalArguments : ErrorMessages.StrictEvalArgumentsBinding, expr.name);\n }\n\n if (checkClashes) {\n const key = `_${expr.name}`;\n\n if (checkClashes[key]) {\n this.raise(expr.start, ErrorMessages.ParamDupe);\n } else {\n checkClashes[key] = true;\n }\n }\n\n if (disallowLetBinding && expr.name === \"let\") {\n this.raise(expr.start, ErrorMessages.LetInLexicalBinding);\n }\n\n if (!(bindingType & BIND_NONE)) {\n this.scope.declareName(expr.name, bindingType, expr.start);\n }\n\n break;\n\n case \"MemberExpression\":\n if (bindingType !== BIND_NONE) {\n this.raise(expr.start, ErrorMessages.InvalidPropertyBindingPattern);\n }\n\n break;\n\n case \"ObjectPattern\":\n for (let _i2 = 0, _expr$properties = expr.properties; _i2 < _expr$properties.length; _i2++) {\n let prop = _expr$properties[_i2];\n if (prop.type === \"ObjectProperty\") prop = prop.value;else if (prop.type === \"ObjectMethod\") continue;\n this.checkLVal(prop, bindingType, checkClashes, \"object destructuring pattern\", disallowLetBinding);\n }\n\n break;\n\n case \"ArrayPattern\":\n for (let _i3 = 0, _expr$elements = expr.elements; _i3 < _expr$elements.length; _i3++) {\n const elem = _expr$elements[_i3];\n\n if (elem) {\n this.checkLVal(elem, bindingType, checkClashes, \"array destructuring pattern\", disallowLetBinding);\n }\n }\n\n break;\n\n case \"AssignmentPattern\":\n this.checkLVal(expr.left, bindingType, checkClashes, \"assignment pattern\");\n break;\n\n case \"RestElement\":\n this.checkLVal(expr.argument, bindingType, checkClashes, \"rest element\");\n break;\n\n case \"ParenthesizedExpression\":\n this.checkLVal(expr.expression, bindingType, checkClashes, \"parenthesized expression\");\n break;\n\n default:\n {\n this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.InvalidLhs : ErrorMessages.InvalidLhsBinding, contextDescription);\n }\n }\n }\n\n checkToRestConversion(node) {\n if (node.argument.type !== \"Identifier\" && node.argument.type !== \"MemberExpression\") {\n this.raise(node.argument.start, ErrorMessages.InvalidRestAssignmentPattern);\n }\n }\n\n checkCommaAfterRest(close) {\n if (this.match(types.comma)) {\n if (this.lookaheadCharCode() === close) {\n this.raiseTrailingCommaAfterRest(this.state.start);\n } else {\n this.raiseRestNotLast(this.state.start);\n }\n }\n }\n\n raiseRestNotLast(pos) {\n throw this.raise(pos, ErrorMessages.ElementAfterRest);\n }\n\n raiseTrailingCommaAfterRest(pos) {\n this.raise(pos, ErrorMessages.RestTrailingComma);\n }\n\n}\n\nconst kExpression = 0,\n kMaybeArrowParameterDeclaration = 1,\n kMaybeAsyncArrowParameterDeclaration = 2,\n kParameterDeclaration = 3;\n\nclass ExpressionScope {\n constructor(type = kExpression) {\n this.type = void 0;\n this.type = type;\n }\n\n canBeArrowParameterDeclaration() {\n return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration;\n }\n\n isCertainlyParameterDeclaration() {\n return this.type === kParameterDeclaration;\n }\n\n}\n\nclass ArrowHeadParsingScope extends ExpressionScope {\n constructor(type) {\n super(type);\n this.errors = new Map();\n }\n\n recordDeclarationError(pos, message) {\n this.errors.set(pos, message);\n }\n\n clearDeclarationError(pos) {\n this.errors.delete(pos);\n }\n\n iterateErrors(iterator) {\n this.errors.forEach(iterator);\n }\n\n}\n\nclass ExpressionScopeHandler {\n constructor(raise) {\n this.stack = [new ExpressionScope()];\n this.raise = raise;\n }\n\n enter(scope) {\n this.stack.push(scope);\n }\n\n exit() {\n this.stack.pop();\n }\n\n recordParameterInitializerError(pos, message) {\n const {\n stack\n } = this;\n let i = stack.length - 1;\n let scope = stack[i];\n\n while (!scope.isCertainlyParameterDeclaration()) {\n if (scope.canBeArrowParameterDeclaration()) {\n scope.recordDeclarationError(pos, message);\n } else {\n return;\n }\n\n scope = stack[--i];\n }\n\n this.raise(pos, message);\n }\n\n recordAsyncArrowParametersError(pos, message) {\n const {\n stack\n } = this;\n let i = stack.length - 1;\n let scope = stack[i];\n\n while (scope.canBeArrowParameterDeclaration()) {\n if (scope.type === kMaybeAsyncArrowParameterDeclaration) {\n scope.recordDeclarationError(pos, message);\n }\n\n scope = stack[--i];\n }\n }\n\n validateAsPattern() {\n const {\n stack\n } = this;\n const currentScope = stack[stack.length - 1];\n if (!currentScope.canBeArrowParameterDeclaration()) return;\n currentScope.iterateErrors((message, pos) => {\n this.raise(pos, message);\n let i = stack.length - 2;\n let scope = stack[i];\n\n while (scope.canBeArrowParameterDeclaration()) {\n scope.clearDeclarationError(pos);\n scope = stack[--i];\n }\n });\n }\n\n}\nfunction newParameterDeclarationScope() {\n return new ExpressionScope(kParameterDeclaration);\n}\nfunction newArrowHeadScope() {\n return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration);\n}\nfunction newAsyncArrowScope() {\n return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration);\n}\nfunction newExpressionScope() {\n return new ExpressionScope();\n}\n\nclass ExpressionParser extends LValParser {\n checkProto(prop, isRecord, protoRef, refExpressionErrors) {\n if (prop.type === \"SpreadElement\" || prop.type === \"ObjectMethod\" || prop.computed || prop.shorthand) {\n return;\n }\n\n const key = prop.key;\n const name = key.type === \"Identifier\" ? key.name : key.value;\n\n if (name === \"__proto__\") {\n if (isRecord) {\n this.raise(key.start, ErrorMessages.RecordNoProto);\n return;\n }\n\n if (protoRef.used) {\n if (refExpressionErrors) {\n if (refExpressionErrors.doubleProto === -1) {\n refExpressionErrors.doubleProto = key.start;\n }\n } else {\n this.raise(key.start, ErrorMessages.DuplicateProto);\n }\n }\n\n protoRef.used = true;\n }\n }\n\n shouldExitDescending(expr, potentialArrowAt) {\n return expr.type === \"ArrowFunctionExpression\" && expr.start === potentialArrowAt;\n }\n\n getExpression() {\n let paramFlags = PARAM;\n\n if (this.hasPlugin(\"topLevelAwait\") && this.inModule) {\n paramFlags |= PARAM_AWAIT;\n }\n\n this.scope.enter(SCOPE_PROGRAM);\n this.prodParam.enter(paramFlags);\n this.nextToken();\n const expr = this.parseExpression();\n\n if (!this.match(types.eof)) {\n this.unexpected();\n }\n\n expr.comments = this.state.comments;\n expr.errors = this.state.errors;\n return expr;\n }\n\n parseExpression(disallowIn, refExpressionErrors) {\n if (disallowIn) {\n return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors));\n }\n\n return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));\n }\n\n parseExpressionBase(refExpressionErrors) {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const expr = this.parseMaybeAssign(refExpressionErrors);\n\n if (this.match(types.comma)) {\n const node = this.startNodeAt(startPos, startLoc);\n node.expressions = [expr];\n\n while (this.eat(types.comma)) {\n node.expressions.push(this.parseMaybeAssign(refExpressionErrors));\n }\n\n this.toReferencedList(node.expressions);\n return this.finishNode(node, \"SequenceExpression\");\n }\n\n return expr;\n }\n\n parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse, refNeedsArrowPos) {\n return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos));\n }\n\n parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse, refNeedsArrowPos) {\n return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos));\n }\n\n parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos) {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n\n if (this.isContextual(\"yield\")) {\n if (this.prodParam.hasYield) {\n this.state.exprAllowed = true;\n let left = this.parseYield();\n\n if (afterLeftParse) {\n left = afterLeftParse.call(this, left, startPos, startLoc);\n }\n\n return left;\n }\n }\n\n let ownExpressionErrors;\n\n if (refExpressionErrors) {\n ownExpressionErrors = false;\n } else {\n refExpressionErrors = new ExpressionErrors();\n ownExpressionErrors = true;\n }\n\n if (this.match(types.parenL) || this.match(types.name)) {\n this.state.potentialArrowAt = this.state.start;\n }\n\n let left = this.parseMaybeConditional(refExpressionErrors, refNeedsArrowPos);\n\n if (afterLeftParse) {\n left = afterLeftParse.call(this, left, startPos, startLoc);\n }\n\n if (this.state.type.isAssign) {\n const node = this.startNodeAt(startPos, startLoc);\n const operator = this.state.value;\n node.operator = operator;\n\n if (this.match(types.eq)) {\n node.left = this.toAssignable(left);\n refExpressionErrors.doubleProto = -1;\n } else {\n node.left = left;\n }\n\n if (refExpressionErrors.shorthandAssign >= node.left.start) {\n refExpressionErrors.shorthandAssign = -1;\n }\n\n this.checkLVal(left, undefined, undefined, \"assignment expression\");\n this.next();\n node.right = this.parseMaybeAssign();\n return this.finishNode(node, \"AssignmentExpression\");\n } else if (ownExpressionErrors) {\n this.checkExpressionErrors(refExpressionErrors, true);\n }\n\n return left;\n }\n\n parseMaybeConditional(refExpressionErrors, refNeedsArrowPos) {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseExprOps(refExpressionErrors);\n\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n\n return this.parseConditional(expr, startPos, startLoc, refNeedsArrowPos);\n }\n\n parseConditional(expr, startPos, startLoc, refNeedsArrowPos) {\n if (this.eat(types.question)) {\n const node = this.startNodeAt(startPos, startLoc);\n node.test = expr;\n node.consequent = this.parseMaybeAssignAllowIn();\n this.expect(types.colon);\n node.alternate = this.parseMaybeAssign();\n return this.finishNode(node, \"ConditionalExpression\");\n }\n\n return expr;\n }\n\n parseExprOps(refExpressionErrors) {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseMaybeUnary(refExpressionErrors);\n\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n\n return this.parseExprOp(expr, startPos, startLoc, -1);\n }\n\n parseExprOp(left, leftStartPos, leftStartLoc, minPrec) {\n let prec = this.state.type.binop;\n\n if (prec != null && (this.prodParam.hasIn || !this.match(types._in))) {\n if (prec > minPrec) {\n const op = this.state.type;\n\n if (op === types.pipeline) {\n this.expectPlugin(\"pipelineOperator\");\n\n if (this.state.inFSharpPipelineDirectBody) {\n return left;\n }\n\n this.state.inPipeline = true;\n this.checkPipelineAtInfixOperator(left, leftStartPos);\n }\n\n const node = this.startNodeAt(leftStartPos, leftStartLoc);\n node.left = left;\n node.operator = this.state.value;\n\n if (op === types.exponent && left.type === \"UnaryExpression\" && (this.options.createParenthesizedExpressions || !(left.extra && left.extra.parenthesized))) {\n this.raise(left.argument.start, ErrorMessages.UnexpectedTokenUnaryExponentiation);\n }\n\n const logical = op === types.logicalOR || op === types.logicalAND;\n const coalesce = op === types.nullishCoalescing;\n\n if (coalesce) {\n prec = types.logicalAND.binop;\n }\n\n this.next();\n\n if (op === types.pipeline && this.getPluginOption(\"pipelineOperator\", \"proposal\") === \"minimal\") {\n if (this.match(types.name) && this.state.value === \"await\" && this.prodParam.hasAwait) {\n throw this.raise(this.state.start, ErrorMessages.UnexpectedAwaitAfterPipelineBody);\n }\n }\n\n node.right = this.parseExprOpRightExpr(op, prec);\n this.finishNode(node, logical || coalesce ? \"LogicalExpression\" : \"BinaryExpression\");\n const nextOp = this.state.type;\n\n if (coalesce && (nextOp === types.logicalOR || nextOp === types.logicalAND) || logical && nextOp === types.nullishCoalescing) {\n throw this.raise(this.state.start, ErrorMessages.MixingCoalesceWithLogical);\n }\n\n return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec);\n }\n }\n\n return left;\n }\n\n parseExprOpRightExpr(op, prec) {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n\n switch (op) {\n case types.pipeline:\n switch (this.getPluginOption(\"pipelineOperator\", \"proposal\")) {\n case \"smart\":\n return this.withTopicPermittingContext(() => {\n return this.parseSmartPipelineBody(this.parseExprOpBaseRightExpr(op, prec), startPos, startLoc);\n });\n\n case \"fsharp\":\n return this.withSoloAwaitPermittingContext(() => {\n return this.parseFSharpPipelineBody(prec);\n });\n }\n\n default:\n return this.parseExprOpBaseRightExpr(op, prec);\n }\n }\n\n parseExprOpBaseRightExpr(op, prec) {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n return this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec);\n }\n\n parseMaybeUnary(refExpressionErrors) {\n if (this.isContextual(\"await\") && this.isAwaitAllowed()) {\n return this.parseAwait();\n }\n\n const update = this.match(types.incDec);\n const node = this.startNode();\n\n if (this.state.type.prefix) {\n node.operator = this.state.value;\n node.prefix = true;\n\n if (this.match(types._throw)) {\n this.expectPlugin(\"throwExpressions\");\n }\n\n const isDelete = this.match(types._delete);\n this.next();\n node.argument = this.parseMaybeUnary();\n this.checkExpressionErrors(refExpressionErrors, true);\n\n if (this.state.strict && isDelete) {\n const arg = node.argument;\n\n if (arg.type === \"Identifier\") {\n this.raise(node.start, ErrorMessages.StrictDelete);\n } else if ((arg.type === \"MemberExpression\" || arg.type === \"OptionalMemberExpression\") && arg.property.type === \"PrivateName\") {\n this.raise(node.start, ErrorMessages.DeletePrivateField);\n }\n }\n\n if (!update) {\n return this.finishNode(node, \"UnaryExpression\");\n }\n }\n\n return this.parseUpdate(node, update, refExpressionErrors);\n }\n\n parseUpdate(node, update, refExpressionErrors) {\n if (update) {\n this.checkLVal(node.argument, undefined, undefined, \"prefix operation\");\n return this.finishNode(node, \"UpdateExpression\");\n }\n\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n let expr = this.parseExprSubscripts(refExpressionErrors);\n if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;\n\n while (this.state.type.postfix && !this.canInsertSemicolon()) {\n const node = this.startNodeAt(startPos, startLoc);\n node.operator = this.state.value;\n node.prefix = false;\n node.argument = expr;\n this.checkLVal(expr, undefined, undefined, \"postfix operation\");\n this.next();\n expr = this.finishNode(node, \"UpdateExpression\");\n }\n\n return expr;\n }\n\n parseExprSubscripts(refExpressionErrors) {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseExprAtom(refExpressionErrors);\n\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n\n return this.parseSubscripts(expr, startPos, startLoc);\n }\n\n parseSubscripts(base, startPos, startLoc, noCalls) {\n const state = {\n optionalChainMember: false,\n maybeAsyncArrow: this.atPossibleAsyncArrow(base),\n stop: false\n };\n\n do {\n base = this.parseSubscript(base, startPos, startLoc, noCalls, state);\n state.maybeAsyncArrow = false;\n } while (!state.stop);\n\n return base;\n }\n\n parseSubscript(base, startPos, startLoc, noCalls, state) {\n if (!noCalls && this.eat(types.doubleColon)) {\n return this.parseBind(base, startPos, startLoc, noCalls, state);\n } else if (this.match(types.backQuote)) {\n return this.parseTaggedTemplateExpression(base, startPos, startLoc, state);\n }\n\n let optional = false;\n\n if (this.match(types.questionDot)) {\n state.optionalChainMember = optional = true;\n\n if (noCalls && this.lookaheadCharCode() === 40) {\n state.stop = true;\n return base;\n }\n\n this.next();\n }\n\n if (!noCalls && this.match(types.parenL)) {\n return this.parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional);\n } else if (optional || this.match(types.bracketL) || this.eat(types.dot)) {\n return this.parseMember(base, startPos, startLoc, state, optional);\n } else {\n state.stop = true;\n return base;\n }\n }\n\n parseMember(base, startPos, startLoc, state, optional) {\n const node = this.startNodeAt(startPos, startLoc);\n const computed = this.eat(types.bracketL);\n node.object = base;\n node.computed = computed;\n const property = computed ? this.parseExpression() : this.parseMaybePrivateName(true);\n\n if (property.type === \"PrivateName\") {\n if (node.object.type === \"Super\") {\n this.raise(startPos, ErrorMessages.SuperPrivateField);\n }\n\n this.classScope.usePrivateName(property.id.name, property.start);\n }\n\n node.property = property;\n\n if (computed) {\n this.expect(types.bracketR);\n }\n\n if (state.optionalChainMember) {\n node.optional = optional;\n return this.finishNode(node, \"OptionalMemberExpression\");\n } else {\n return this.finishNode(node, \"MemberExpression\");\n }\n }\n\n parseBind(base, startPos, startLoc, noCalls, state) {\n const node = this.startNodeAt(startPos, startLoc);\n node.object = base;\n node.callee = this.parseNoCallExpr();\n state.stop = true;\n return this.parseSubscripts(this.finishNode(node, \"BindExpression\"), startPos, startLoc, noCalls);\n }\n\n parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional) {\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n this.state.maybeInArrowParameters = true;\n this.next();\n let node = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n\n if (state.maybeAsyncArrow) {\n this.expressionScope.enter(newAsyncArrowScope());\n }\n\n if (state.optionalChainMember) {\n node.optional = optional;\n }\n\n if (optional) {\n node.arguments = this.parseCallExpressionArguments(types.parenR, false);\n } else {\n node.arguments = this.parseCallExpressionArguments(types.parenR, state.maybeAsyncArrow, base.type === \"Import\", base.type !== \"Super\", node);\n }\n\n this.finishCallExpression(node, state.optionalChainMember);\n\n if (state.maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {\n state.stop = true;\n this.expressionScope.validateAsPattern();\n this.expressionScope.exit();\n node = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node);\n } else {\n if (state.maybeAsyncArrow) {\n this.expressionScope.exit();\n }\n\n this.toReferencedArguments(node);\n }\n\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n return node;\n }\n\n toReferencedArguments(node, isParenthesizedExpr) {\n this.toReferencedListDeep(node.arguments, isParenthesizedExpr);\n }\n\n parseTaggedTemplateExpression(base, startPos, startLoc, state) {\n const node = this.startNodeAt(startPos, startLoc);\n node.tag = base;\n node.quasi = this.parseTemplate(true);\n\n if (state.optionalChainMember) {\n this.raise(startPos, ErrorMessages.OptionalChainingNoTemplate);\n }\n\n return this.finishNode(node, \"TaggedTemplateExpression\");\n }\n\n atPossibleAsyncArrow(base) {\n return base.type === \"Identifier\" && base.name === \"async\" && this.state.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt;\n }\n\n finishCallExpression(node, optional) {\n if (node.callee.type === \"Import\") {\n if (node.arguments.length === 2) {\n if (!this.hasPlugin(\"moduleAttributes\")) {\n this.expectPlugin(\"importAssertions\");\n }\n }\n\n if (node.arguments.length === 0 || node.arguments.length > 2) {\n this.raise(node.start, ErrorMessages.ImportCallArity, this.hasPlugin(\"importAssertions\") || this.hasPlugin(\"moduleAttributes\") ? \"one or two arguments\" : \"one argument\");\n } else {\n for (let _i = 0, _node$arguments = node.arguments; _i < _node$arguments.length; _i++) {\n const arg = _node$arguments[_i];\n\n if (arg.type === \"SpreadElement\") {\n this.raise(arg.start, ErrorMessages.ImportCallSpreadArgument);\n }\n }\n }\n }\n\n return this.finishNode(node, optional ? \"OptionalCallExpression\" : \"CallExpression\");\n }\n\n parseCallExpressionArguments(close, possibleAsyncArrow, dynamicImport, allowPlaceholder, nodeForExtra) {\n const elts = [];\n let innerParenStart;\n let first = true;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(types.comma);\n\n if (this.match(close)) {\n if (dynamicImport && !this.hasPlugin(\"importAssertions\") && !this.hasPlugin(\"moduleAttributes\")) {\n this.raise(this.state.lastTokStart, ErrorMessages.ImportCallArgumentTrailingComma);\n }\n\n if (nodeForExtra) {\n this.addExtra(nodeForExtra, \"trailingComma\", this.state.lastTokStart);\n }\n\n this.next();\n break;\n }\n }\n\n if (this.match(types.parenL) && !innerParenStart) {\n innerParenStart = this.state.start;\n }\n\n elts.push(this.parseExprListItem(false, possibleAsyncArrow ? new ExpressionErrors() : undefined, possibleAsyncArrow ? {\n start: 0\n } : undefined, allowPlaceholder));\n }\n\n if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) {\n this.unexpected();\n }\n\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n return elts;\n }\n\n shouldParseAsyncArrow() {\n return this.match(types.arrow) && !this.canInsertSemicolon();\n }\n\n parseAsyncArrowFromCallExpression(node, call) {\n var _call$extra;\n\n this.expect(types.arrow);\n this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingComma);\n return node;\n }\n\n parseNoCallExpr() {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);\n }\n\n parseExprAtom(refExpressionErrors) {\n if (this.state.type === types.slash) this.readRegexp();\n const canBeArrow = this.state.potentialArrowAt === this.state.start;\n let node;\n\n switch (this.state.type) {\n case types._super:\n return this.parseSuper();\n\n case types._import:\n node = this.startNode();\n this.next();\n\n if (this.match(types.dot)) {\n return this.parseImportMetaProperty(node);\n }\n\n if (!this.match(types.parenL)) {\n this.raise(this.state.lastTokStart, ErrorMessages.UnsupportedImport);\n }\n\n return this.finishNode(node, \"Import\");\n\n case types._this:\n node = this.startNode();\n this.next();\n return this.finishNode(node, \"ThisExpression\");\n\n case types.name:\n {\n const containsEsc = this.state.containsEsc;\n const id = this.parseIdentifier();\n\n if (!containsEsc && id.name === \"async\" && !this.canInsertSemicolon()) {\n if (this.match(types._function)) {\n const last = this.state.context.length - 1;\n\n if (this.state.context[last] !== types$1.functionStatement) {\n throw new Error(\"Internal error\");\n }\n\n this.state.context[last] = types$1.functionExpression;\n this.next();\n return this.parseFunction(this.startNodeAtNode(id), undefined, true);\n } else if (this.match(types.name)) {\n return this.parseAsyncArrowUnaryFunction(id);\n }\n }\n\n if (canBeArrow && this.match(types.arrow) && !this.canInsertSemicolon()) {\n this.next();\n return this.parseArrowExpression(this.startNodeAtNode(id), [id], false);\n }\n\n return id;\n }\n\n case types._do:\n {\n return this.parseDo();\n }\n\n case types.regexp:\n {\n const value = this.state.value;\n node = this.parseLiteral(value.value, \"RegExpLiteral\");\n node.pattern = value.pattern;\n node.flags = value.flags;\n return node;\n }\n\n case types.num:\n return this.parseLiteral(this.state.value, \"NumericLiteral\");\n\n case types.bigint:\n return this.parseLiteral(this.state.value, \"BigIntLiteral\");\n\n case types.decimal:\n return this.parseLiteral(this.state.value, \"DecimalLiteral\");\n\n case types.string:\n return this.parseLiteral(this.state.value, \"StringLiteral\");\n\n case types._null:\n node = this.startNode();\n this.next();\n return this.finishNode(node, \"NullLiteral\");\n\n case types._true:\n case types._false:\n return this.parseBooleanLiteral();\n\n case types.parenL:\n return this.parseParenAndDistinguishExpression(canBeArrow);\n\n case types.bracketBarL:\n case types.bracketHashL:\n {\n return this.parseArrayLike(this.state.type === types.bracketBarL ? types.bracketBarR : types.bracketR, false, true, refExpressionErrors);\n }\n\n case types.bracketL:\n {\n return this.parseArrayLike(types.bracketR, true, false, refExpressionErrors);\n }\n\n case types.braceBarL:\n case types.braceHashL:\n {\n return this.parseObjectLike(this.state.type === types.braceBarL ? types.braceBarR : types.braceR, false, true, refExpressionErrors);\n }\n\n case types.braceL:\n {\n return this.parseObjectLike(types.braceR, false, false, refExpressionErrors);\n }\n\n case types._function:\n return this.parseFunctionOrFunctionSent();\n\n case types.at:\n this.parseDecorators();\n\n case types._class:\n node = this.startNode();\n this.takeDecorators(node);\n return this.parseClass(node, false);\n\n case types._new:\n return this.parseNewOrNewTarget();\n\n case types.backQuote:\n return this.parseTemplate(false);\n\n case types.doubleColon:\n {\n node = this.startNode();\n this.next();\n node.object = null;\n const callee = node.callee = this.parseNoCallExpr();\n\n if (callee.type === \"MemberExpression\") {\n return this.finishNode(node, \"BindExpression\");\n } else {\n throw this.raise(callee.start, ErrorMessages.UnsupportedBind);\n }\n }\n\n case types.hash:\n {\n if (this.state.inPipeline) {\n node = this.startNode();\n\n if (this.getPluginOption(\"pipelineOperator\", \"proposal\") !== \"smart\") {\n this.raise(node.start, ErrorMessages.PrimaryTopicRequiresSmartPipeline);\n }\n\n this.next();\n\n if (!this.primaryTopicReferenceIsAllowedInCurrentTopicContext()) {\n this.raise(node.start, ErrorMessages.PrimaryTopicNotAllowed);\n }\n\n this.registerTopicReference();\n return this.finishNode(node, \"PipelinePrimaryTopicReference\");\n }\n\n const nextCh = this.input.codePointAt(this.state.end);\n\n if (isIdentifierStart(nextCh) || nextCh === 92) {\n const start = this.state.start;\n node = this.parseMaybePrivateName(true);\n\n if (this.match(types._in)) {\n this.expectPlugin(\"privateIn\");\n this.classScope.usePrivateName(node.id.name, node.start);\n } else if (this.hasPlugin(\"privateIn\")) {\n this.raise(this.state.start, ErrorMessages.PrivateInExpectedIn, node.id.name);\n } else {\n throw this.unexpected(start);\n }\n\n return node;\n }\n }\n\n case types.relational:\n {\n if (this.state.value === \"<\") {\n const lookaheadCh = this.input.codePointAt(this.nextTokenStart());\n\n if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) {\n this.expectOnePlugin([\"jsx\", \"flow\", \"typescript\"]);\n }\n }\n }\n\n default:\n throw this.unexpected();\n }\n }\n\n parseAsyncArrowUnaryFunction(id) {\n const node = this.startNodeAtNode(id);\n this.prodParam.enter(functionFlags(true, this.prodParam.hasYield));\n const params = [this.parseIdentifier()];\n this.prodParam.exit();\n\n if (this.hasPrecedingLineBreak()) {\n this.raise(this.state.pos, ErrorMessages.LineTerminatorBeforeArrow);\n }\n\n this.expect(types.arrow);\n this.parseArrowExpression(node, params, true);\n return node;\n }\n\n parseDo() {\n this.expectPlugin(\"doExpressions\");\n const node = this.startNode();\n this.next();\n const oldLabels = this.state.labels;\n this.state.labels = [];\n node.body = this.parseBlock();\n this.state.labels = oldLabels;\n return this.finishNode(node, \"DoExpression\");\n }\n\n parseSuper() {\n const node = this.startNode();\n this.next();\n\n if (this.match(types.parenL) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {\n this.raise(node.start, ErrorMessages.SuperNotAllowed);\n } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {\n this.raise(node.start, ErrorMessages.UnexpectedSuper);\n }\n\n if (!this.match(types.parenL) && !this.match(types.bracketL) && !this.match(types.dot)) {\n this.raise(node.start, ErrorMessages.UnsupportedSuper);\n }\n\n return this.finishNode(node, \"Super\");\n }\n\n parseBooleanLiteral() {\n const node = this.startNode();\n node.value = this.match(types._true);\n this.next();\n return this.finishNode(node, \"BooleanLiteral\");\n }\n\n parseMaybePrivateName(isPrivateNameAllowed) {\n const isPrivate = this.match(types.hash);\n\n if (isPrivate) {\n this.expectOnePlugin([\"classPrivateProperties\", \"classPrivateMethods\"]);\n\n if (!isPrivateNameAllowed) {\n this.raise(this.state.pos, ErrorMessages.UnexpectedPrivateField);\n }\n\n const node = this.startNode();\n this.next();\n this.assertNoSpace(\"Unexpected space between # and identifier\");\n node.id = this.parseIdentifier(true);\n return this.finishNode(node, \"PrivateName\");\n } else {\n return this.parseIdentifier(true);\n }\n }\n\n parseFunctionOrFunctionSent() {\n const node = this.startNode();\n this.next();\n\n if (this.prodParam.hasYield && this.match(types.dot)) {\n const meta = this.createIdentifier(this.startNodeAtNode(node), \"function\");\n this.next();\n return this.parseMetaProperty(node, meta, \"sent\");\n }\n\n return this.parseFunction(node);\n }\n\n parseMetaProperty(node, meta, propertyName) {\n node.meta = meta;\n\n if (meta.name === \"function\" && propertyName === \"sent\") {\n if (this.isContextual(propertyName)) {\n this.expectPlugin(\"functionSent\");\n } else if (!this.hasPlugin(\"functionSent\")) {\n this.unexpected();\n }\n }\n\n const containsEsc = this.state.containsEsc;\n node.property = this.parseIdentifier(true);\n\n if (node.property.name !== propertyName || containsEsc) {\n this.raise(node.property.start, ErrorMessages.UnsupportedMetaProperty, meta.name, propertyName);\n }\n\n return this.finishNode(node, \"MetaProperty\");\n }\n\n parseImportMetaProperty(node) {\n const id = this.createIdentifier(this.startNodeAtNode(node), \"import\");\n this.next();\n\n if (this.isContextual(\"meta\")) {\n if (!this.inModule) {\n this.raiseWithData(id.start, {\n code: \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\"\n }, ErrorMessages.ImportMetaOutsideModule);\n }\n\n this.sawUnambiguousESM = true;\n }\n\n return this.parseMetaProperty(node, id, \"meta\");\n }\n\n parseLiteral(value, type, startPos, startLoc) {\n startPos = startPos || this.state.start;\n startLoc = startLoc || this.state.startLoc;\n const node = this.startNodeAt(startPos, startLoc);\n this.addExtra(node, \"rawValue\", value);\n this.addExtra(node, \"raw\", this.input.slice(startPos, this.state.end));\n node.value = value;\n this.next();\n return this.finishNode(node, type);\n }\n\n parseParenAndDistinguishExpression(canBeArrow) {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n let val;\n this.next();\n this.expressionScope.enter(newArrowHeadScope());\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.maybeInArrowParameters = true;\n this.state.inFSharpPipelineDirectBody = false;\n const innerStartPos = this.state.start;\n const innerStartLoc = this.state.startLoc;\n const exprList = [];\n const refExpressionErrors = new ExpressionErrors();\n const refNeedsArrowPos = {\n start: 0\n };\n let first = true;\n let spreadStart;\n let optionalCommaStart;\n\n while (!this.match(types.parenR)) {\n if (first) {\n first = false;\n } else {\n this.expect(types.comma, refNeedsArrowPos.start || null);\n\n if (this.match(types.parenR)) {\n optionalCommaStart = this.state.start;\n break;\n }\n }\n\n if (this.match(types.ellipsis)) {\n const spreadNodeStartPos = this.state.start;\n const spreadNodeStartLoc = this.state.startLoc;\n spreadStart = this.state.start;\n exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartPos, spreadNodeStartLoc));\n this.checkCommaAfterRest(41);\n break;\n } else {\n exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem, refNeedsArrowPos));\n }\n }\n\n const innerEndPos = this.state.lastTokEnd;\n const innerEndLoc = this.state.lastTokEndLoc;\n this.expect(types.parenR);\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n let arrowNode = this.startNodeAt(startPos, startLoc);\n\n if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) {\n this.expressionScope.validateAsPattern();\n this.expressionScope.exit();\n\n for (let _i2 = 0; _i2 < exprList.length; _i2++) {\n const param = exprList[_i2];\n\n if (param.extra && param.extra.parenthesized) {\n this.unexpected(param.extra.parenStart);\n }\n }\n\n this.parseArrowExpression(arrowNode, exprList, false);\n return arrowNode;\n }\n\n this.expressionScope.exit();\n\n if (!exprList.length) {\n this.unexpected(this.state.lastTokStart);\n }\n\n if (optionalCommaStart) this.unexpected(optionalCommaStart);\n if (spreadStart) this.unexpected(spreadStart);\n this.checkExpressionErrors(refExpressionErrors, true);\n if (refNeedsArrowPos.start) this.unexpected(refNeedsArrowPos.start);\n this.toReferencedListDeep(exprList, true);\n\n if (exprList.length > 1) {\n val = this.startNodeAt(innerStartPos, innerStartLoc);\n val.expressions = exprList;\n this.finishNodeAt(val, \"SequenceExpression\", innerEndPos, innerEndLoc);\n } else {\n val = exprList[0];\n }\n\n if (!this.options.createParenthesizedExpressions) {\n this.addExtra(val, \"parenthesized\", true);\n this.addExtra(val, \"parenStart\", startPos);\n return val;\n }\n\n const parenExpression = this.startNodeAt(startPos, startLoc);\n parenExpression.expression = val;\n this.finishNode(parenExpression, \"ParenthesizedExpression\");\n return parenExpression;\n }\n\n shouldParseArrow() {\n return !this.canInsertSemicolon();\n }\n\n parseArrow(node) {\n if (this.eat(types.arrow)) {\n return node;\n }\n }\n\n parseParenItem(node, startPos, startLoc) {\n return node;\n }\n\n parseNewOrNewTarget() {\n const node = this.startNode();\n this.next();\n\n if (this.match(types.dot)) {\n const meta = this.createIdentifier(this.startNodeAtNode(node), \"new\");\n this.next();\n const metaProp = this.parseMetaProperty(node, meta, \"target\");\n\n if (!this.scope.inNonArrowFunction && !this.scope.inClass) {\n let error = ErrorMessages.UnexpectedNewTarget;\n\n if (this.hasPlugin(\"classProperties\")) {\n error += \" or class properties\";\n }\n\n this.raise(metaProp.start, error);\n }\n\n return metaProp;\n }\n\n return this.parseNew(node);\n }\n\n parseNew(node) {\n node.callee = this.parseNoCallExpr();\n\n if (node.callee.type === \"Import\") {\n this.raise(node.callee.start, ErrorMessages.ImportCallNotNewExpression);\n } else if (node.callee.type === \"OptionalMemberExpression\" || node.callee.type === \"OptionalCallExpression\") {\n this.raise(this.state.lastTokEnd, ErrorMessages.OptionalChainingNoNew);\n } else if (this.eat(types.questionDot)) {\n this.raise(this.state.start, ErrorMessages.OptionalChainingNoNew);\n }\n\n this.parseNewArguments(node);\n return this.finishNode(node, \"NewExpression\");\n }\n\n parseNewArguments(node) {\n if (this.eat(types.parenL)) {\n const args = this.parseExprList(types.parenR);\n this.toReferencedList(args);\n node.arguments = args;\n } else {\n node.arguments = [];\n }\n }\n\n parseTemplateElement(isTagged) {\n const elem = this.startNode();\n\n if (this.state.value === null) {\n if (!isTagged) {\n this.raise(this.state.start + 1, ErrorMessages.InvalidEscapeSequenceTemplate);\n }\n }\n\n elem.value = {\n raw: this.input.slice(this.state.start, this.state.end).replace(/\\r\\n?/g, \"\\n\"),\n cooked: this.state.value\n };\n this.next();\n elem.tail = this.match(types.backQuote);\n return this.finishNode(elem, \"TemplateElement\");\n }\n\n parseTemplate(isTagged) {\n const node = this.startNode();\n this.next();\n node.expressions = [];\n let curElt = this.parseTemplateElement(isTagged);\n node.quasis = [curElt];\n\n while (!curElt.tail) {\n this.expect(types.dollarBraceL);\n node.expressions.push(this.parseTemplateSubstitution());\n this.expect(types.braceR);\n node.quasis.push(curElt = this.parseTemplateElement(isTagged));\n }\n\n this.next();\n return this.finishNode(node, \"TemplateLiteral\");\n }\n\n parseTemplateSubstitution() {\n return this.parseExpression();\n }\n\n parseObjectLike(close, isPattern, isRecord, refExpressionErrors) {\n if (isRecord) {\n this.expectPlugin(\"recordAndTuple\");\n }\n\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n const propHash = Object.create(null);\n let first = true;\n const node = this.startNode();\n node.properties = [];\n this.next();\n\n while (!this.match(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(types.comma);\n\n if (this.match(close)) {\n this.addExtra(node, \"trailingComma\", this.state.lastTokStart);\n break;\n }\n }\n\n const prop = this.parsePropertyDefinition(isPattern, refExpressionErrors);\n\n if (!isPattern) {\n this.checkProto(prop, isRecord, propHash, refExpressionErrors);\n }\n\n if (isRecord && prop.type !== \"ObjectProperty\" && prop.type !== \"SpreadElement\") {\n this.raise(prop.start, ErrorMessages.InvalidRecordProperty);\n }\n\n if (prop.shorthand) {\n this.addExtra(prop, \"shorthand\", true);\n }\n\n node.properties.push(prop);\n }\n\n this.state.exprAllowed = false;\n this.next();\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n let type = \"ObjectExpression\";\n\n if (isPattern) {\n type = \"ObjectPattern\";\n } else if (isRecord) {\n type = \"RecordExpression\";\n }\n\n return this.finishNode(node, type);\n }\n\n maybeAsyncOrAccessorProp(prop) {\n return !prop.computed && prop.key.type === \"Identifier\" && (this.isLiteralPropertyName() || this.match(types.bracketL) || this.match(types.star));\n }\n\n parsePropertyDefinition(isPattern, refExpressionErrors) {\n let decorators = [];\n\n if (this.match(types.at)) {\n if (this.hasPlugin(\"decorators\")) {\n this.raise(this.state.start, ErrorMessages.UnsupportedPropertyDecorator);\n }\n\n while (this.match(types.at)) {\n decorators.push(this.parseDecorator());\n }\n }\n\n const prop = this.startNode();\n let isGenerator = false;\n let isAsync = false;\n let isAccessor = false;\n let startPos;\n let startLoc;\n\n if (this.match(types.ellipsis)) {\n if (decorators.length) this.unexpected();\n\n if (isPattern) {\n this.next();\n prop.argument = this.parseIdentifier();\n this.checkCommaAfterRest(125);\n return this.finishNode(prop, \"RestElement\");\n }\n\n return this.parseSpread();\n }\n\n if (decorators.length) {\n prop.decorators = decorators;\n decorators = [];\n }\n\n prop.method = false;\n\n if (isPattern || refExpressionErrors) {\n startPos = this.state.start;\n startLoc = this.state.startLoc;\n }\n\n if (!isPattern) {\n isGenerator = this.eat(types.star);\n }\n\n const containsEsc = this.state.containsEsc;\n const key = this.parsePropertyName(prop, false);\n\n if (!isPattern && !isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) {\n const keyName = key.name;\n\n if (keyName === \"async\" && !this.hasPrecedingLineBreak()) {\n isAsync = true;\n isGenerator = this.eat(types.star);\n this.parsePropertyName(prop, false);\n }\n\n if (keyName === \"get\" || keyName === \"set\") {\n isAccessor = true;\n prop.kind = keyName;\n\n if (this.match(types.star)) {\n isGenerator = true;\n this.raise(this.state.pos, ErrorMessages.AccessorIsGenerator, keyName);\n this.next();\n }\n\n this.parsePropertyName(prop, false);\n }\n }\n\n this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);\n return prop;\n }\n\n getGetterSetterExpectedParamCount(method) {\n return method.kind === \"get\" ? 0 : 1;\n }\n\n getObjectOrClassMethodParams(method) {\n return method.params;\n }\n\n checkGetterSetterParams(method) {\n var _params;\n\n const paramCount = this.getGetterSetterExpectedParamCount(method);\n const params = this.getObjectOrClassMethodParams(method);\n const start = method.start;\n\n if (params.length !== paramCount) {\n if (method.kind === \"get\") {\n this.raise(start, ErrorMessages.BadGetterArity);\n } else {\n this.raise(start, ErrorMessages.BadSetterArity);\n }\n }\n\n if (method.kind === \"set\" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === \"RestElement\") {\n this.raise(start, ErrorMessages.BadSetterRestParameter);\n }\n }\n\n parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {\n if (isAccessor) {\n this.parseMethod(prop, isGenerator, false, false, false, \"ObjectMethod\");\n this.checkGetterSetterParams(prop);\n return prop;\n }\n\n if (isAsync || isGenerator || this.match(types.parenL)) {\n if (isPattern) this.unexpected();\n prop.kind = \"method\";\n prop.method = true;\n return this.parseMethod(prop, isGenerator, isAsync, false, false, \"ObjectMethod\");\n }\n }\n\n parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {\n prop.shorthand = false;\n\n if (this.eat(types.colon)) {\n prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors);\n return this.finishNode(prop, \"ObjectProperty\");\n }\n\n if (!prop.computed && prop.key.type === \"Identifier\") {\n this.checkReservedWord(prop.key.name, prop.key.start, true, false);\n\n if (isPattern) {\n prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());\n } else if (this.match(types.eq) && refExpressionErrors) {\n if (refExpressionErrors.shorthandAssign === -1) {\n refExpressionErrors.shorthandAssign = this.state.start;\n }\n\n prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());\n } else {\n prop.value = prop.key.__clone();\n }\n\n prop.shorthand = true;\n return this.finishNode(prop, \"ObjectProperty\");\n }\n }\n\n parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {\n const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);\n if (!node) this.unexpected();\n return node;\n }\n\n parsePropertyName(prop, isPrivateNameAllowed) {\n if (this.eat(types.bracketL)) {\n prop.computed = true;\n prop.key = this.parseMaybeAssignAllowIn();\n this.expect(types.bracketR);\n } else {\n const oldInPropertyName = this.state.inPropertyName;\n this.state.inPropertyName = true;\n prop.key = this.match(types.num) || this.match(types.string) || this.match(types.bigint) || this.match(types.decimal) ? this.parseExprAtom() : this.parseMaybePrivateName(isPrivateNameAllowed);\n\n if (prop.key.type !== \"PrivateName\") {\n prop.computed = false;\n }\n\n this.state.inPropertyName = oldInPropertyName;\n }\n\n return prop.key;\n }\n\n initFunction(node, isAsync) {\n node.id = null;\n node.generator = false;\n node.async = !!isAsync;\n }\n\n parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {\n this.initFunction(node, isAsync);\n node.generator = !!isGenerator;\n const allowModifiers = isConstructor;\n this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));\n this.prodParam.enter(functionFlags(isAsync, node.generator));\n this.parseFunctionParams(node, allowModifiers);\n this.parseFunctionBodyAndFinish(node, type, true);\n this.prodParam.exit();\n this.scope.exit();\n return node;\n }\n\n parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {\n if (isTuple) {\n this.expectPlugin(\"recordAndTuple\");\n }\n\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n const node = this.startNode();\n this.next();\n node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node);\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n return this.finishNode(node, isTuple ? \"TupleExpression\" : \"ArrayExpression\");\n }\n\n parseArrowExpression(node, params, isAsync, trailingCommaPos) {\n this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);\n let flags = functionFlags(isAsync, false);\n\n if (!this.match(types.bracketL) && this.prodParam.hasIn) {\n flags |= PARAM_IN;\n }\n\n this.prodParam.enter(flags);\n this.initFunction(node, isAsync);\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n\n if (params) {\n this.state.maybeInArrowParameters = true;\n this.setArrowFunctionParameters(node, params, trailingCommaPos);\n }\n\n this.state.maybeInArrowParameters = false;\n this.parseFunctionBody(node, true);\n this.prodParam.exit();\n this.scope.exit();\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n return this.finishNode(node, \"ArrowFunctionExpression\");\n }\n\n setArrowFunctionParameters(node, params, trailingCommaPos) {\n node.params = this.toAssignableList(params, trailingCommaPos);\n }\n\n parseFunctionBodyAndFinish(node, type, isMethod = false) {\n this.parseFunctionBody(node, false, isMethod);\n this.finishNode(node, type);\n }\n\n parseFunctionBody(node, allowExpression, isMethod = false) {\n const isExpression = allowExpression && !this.match(types.braceL);\n this.expressionScope.enter(newExpressionScope());\n\n if (isExpression) {\n node.body = this.parseMaybeAssign();\n this.checkParams(node, false, allowExpression, false);\n } else {\n const oldStrict = this.state.strict;\n const oldLabels = this.state.labels;\n this.state.labels = [];\n this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN);\n node.body = this.parseBlock(true, false, hasStrictModeDirective => {\n const nonSimple = !this.isSimpleParamList(node.params);\n\n if (hasStrictModeDirective && nonSimple) {\n const errorPos = (node.kind === \"method\" || node.kind === \"constructor\") && !!node.key ? node.key.end : node.start;\n this.raise(errorPos, ErrorMessages.IllegalLanguageModeDirective);\n }\n\n const strictModeChanged = !oldStrict && this.state.strict;\n this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);\n\n if (this.state.strict && node.id) {\n this.checkLVal(node.id, BIND_OUTSIDE, undefined, \"function name\", undefined, strictModeChanged);\n }\n });\n this.prodParam.exit();\n this.expressionScope.exit();\n this.state.labels = oldLabels;\n }\n }\n\n isSimpleParamList(params) {\n for (let i = 0, len = params.length; i < len; i++) {\n if (params[i].type !== \"Identifier\") return false;\n }\n\n return true;\n }\n\n checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {\n const nameHash = Object.create(null);\n\n for (let i = 0; i < node.params.length; i++) {\n this.checkLVal(node.params[i], BIND_VAR, allowDuplicates ? null : nameHash, \"function parameter list\", undefined, strictModeChanged);\n }\n }\n\n parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) {\n const elts = [];\n let first = true;\n\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(types.comma);\n\n if (this.match(close)) {\n if (nodeForExtra) {\n this.addExtra(nodeForExtra, \"trailingComma\", this.state.lastTokStart);\n }\n\n this.next();\n break;\n }\n }\n\n elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));\n }\n\n return elts;\n }\n\n parseExprListItem(allowEmpty, refExpressionErrors, refNeedsArrowPos, allowPlaceholder) {\n let elt;\n\n if (this.match(types.comma)) {\n if (!allowEmpty) {\n this.raise(this.state.pos, ErrorMessages.UnexpectedToken, \",\");\n }\n\n elt = null;\n } else if (this.match(types.ellipsis)) {\n const spreadNodeStartPos = this.state.start;\n const spreadNodeStartLoc = this.state.startLoc;\n elt = this.parseParenItem(this.parseSpread(refExpressionErrors, refNeedsArrowPos), spreadNodeStartPos, spreadNodeStartLoc);\n } else if (this.match(types.question)) {\n this.expectPlugin(\"partialApplication\");\n\n if (!allowPlaceholder) {\n this.raise(this.state.start, ErrorMessages.UnexpectedArgumentPlaceholder);\n }\n\n const node = this.startNode();\n this.next();\n elt = this.finishNode(node, \"ArgumentPlaceholder\");\n } else {\n elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem, refNeedsArrowPos);\n }\n\n return elt;\n }\n\n parseIdentifier(liberal) {\n const node = this.startNode();\n const name = this.parseIdentifierName(node.start, liberal);\n return this.createIdentifier(node, name);\n }\n\n createIdentifier(node, name) {\n node.name = name;\n node.loc.identifierName = name;\n return this.finishNode(node, \"Identifier\");\n }\n\n parseIdentifierName(pos, liberal) {\n let name;\n const {\n start,\n type\n } = this.state;\n\n if (type === types.name) {\n name = this.state.value;\n } else if (type.keyword) {\n name = type.keyword;\n const curContext = this.curContext();\n\n if ((type === types._class || type === types._function) && (curContext === types$1.functionStatement || curContext === types$1.functionExpression)) {\n this.state.context.pop();\n }\n } else {\n throw this.unexpected();\n }\n\n if (liberal) {\n this.state.type = types.name;\n } else {\n this.checkReservedWord(name, start, !!type.keyword, false);\n }\n\n this.next();\n return name;\n }\n\n checkReservedWord(word, startLoc, checkKeywords, isBinding) {\n if (this.prodParam.hasYield && word === \"yield\") {\n this.raise(startLoc, ErrorMessages.YieldBindingIdentifier);\n return;\n }\n\n if (word === \"await\") {\n if (this.prodParam.hasAwait) {\n this.raise(startLoc, ErrorMessages.AwaitBindingIdentifier);\n return;\n } else {\n this.expressionScope.recordAsyncArrowParametersError(startLoc, ErrorMessages.AwaitBindingIdentifier);\n }\n }\n\n if (this.scope.inClass && !this.scope.inNonArrowFunction && word === \"arguments\") {\n this.raise(startLoc, ErrorMessages.ArgumentsInClass);\n return;\n }\n\n if (checkKeywords && isKeyword(word)) {\n this.raise(startLoc, ErrorMessages.UnexpectedKeyword, word);\n return;\n }\n\n const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord;\n\n if (reservedTest(word, this.inModule)) {\n if (!this.prodParam.hasAwait && word === \"await\") {\n this.raise(startLoc, this.hasPlugin(\"topLevelAwait\") ? ErrorMessages.AwaitNotInAsyncContext : ErrorMessages.AwaitNotInAsyncFunction);\n } else {\n this.raise(startLoc, ErrorMessages.UnexpectedReservedWord, word);\n }\n }\n }\n\n isAwaitAllowed() {\n if (this.scope.inFunction) return this.prodParam.hasAwait;\n if (this.options.allowAwaitOutsideFunction) return true;\n\n if (this.hasPlugin(\"topLevelAwait\")) {\n return this.inModule && this.prodParam.hasAwait;\n }\n\n return false;\n }\n\n parseAwait() {\n const node = this.startNode();\n this.next();\n this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.AwaitExpressionFormalParameter);\n\n if (this.eat(types.star)) {\n this.raise(node.start, ErrorMessages.ObsoleteAwaitStar);\n }\n\n if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {\n if (this.hasPrecedingLineBreak() || this.match(types.plusMin) || this.match(types.parenL) || this.match(types.bracketL) || this.match(types.backQuote) || this.match(types.regexp) || this.match(types.slash) || this.hasPlugin(\"v8intrinsic\") && this.match(types.modulo)) {\n this.ambiguousScriptDifferentAst = true;\n } else {\n this.sawUnambiguousESM = true;\n }\n }\n\n if (!this.state.soloAwait) {\n node.argument = this.parseMaybeUnary();\n }\n\n return this.finishNode(node, \"AwaitExpression\");\n }\n\n parseYield() {\n const node = this.startNode();\n this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.YieldInParameter);\n this.next();\n\n if (this.match(types.semi) || !this.match(types.star) && !this.state.type.startsExpr || this.hasPrecedingLineBreak()) {\n node.delegate = false;\n node.argument = null;\n } else {\n node.delegate = this.eat(types.star);\n node.argument = this.parseMaybeAssign();\n }\n\n return this.finishNode(node, \"YieldExpression\");\n }\n\n checkPipelineAtInfixOperator(left, leftStartPos) {\n if (this.getPluginOption(\"pipelineOperator\", \"proposal\") === \"smart\") {\n if (left.type === \"SequenceExpression\") {\n this.raise(leftStartPos, ErrorMessages.PipelineHeadSequenceExpression);\n }\n }\n }\n\n parseSmartPipelineBody(childExpression, startPos, startLoc) {\n this.checkSmartPipelineBodyEarlyErrors(childExpression, startPos);\n return this.parseSmartPipelineBodyInStyle(childExpression, startPos, startLoc);\n }\n\n checkSmartPipelineBodyEarlyErrors(childExpression, startPos) {\n if (this.match(types.arrow)) {\n throw this.raise(this.state.start, ErrorMessages.PipelineBodyNoArrow);\n } else if (childExpression.type === \"SequenceExpression\") {\n this.raise(startPos, ErrorMessages.PipelineBodySequenceExpression);\n }\n }\n\n parseSmartPipelineBodyInStyle(childExpression, startPos, startLoc) {\n const bodyNode = this.startNodeAt(startPos, startLoc);\n const isSimpleReference = this.isSimpleReference(childExpression);\n\n if (isSimpleReference) {\n bodyNode.callee = childExpression;\n } else {\n if (!this.topicReferenceWasUsedInCurrentTopicContext()) {\n this.raise(startPos, ErrorMessages.PipelineTopicUnused);\n }\n\n bodyNode.expression = childExpression;\n }\n\n return this.finishNode(bodyNode, isSimpleReference ? \"PipelineBareFunction\" : \"PipelineTopicExpression\");\n }\n\n isSimpleReference(expression) {\n switch (expression.type) {\n case \"MemberExpression\":\n return !expression.computed && this.isSimpleReference(expression.object);\n\n case \"Identifier\":\n return true;\n\n default:\n return false;\n }\n }\n\n withTopicPermittingContext(callback) {\n const outerContextTopicState = this.state.topicContext;\n this.state.topicContext = {\n maxNumOfResolvableTopics: 1,\n maxTopicIndex: null\n };\n\n try {\n return callback();\n } finally {\n this.state.topicContext = outerContextTopicState;\n }\n }\n\n withTopicForbiddingContext(callback) {\n const outerContextTopicState = this.state.topicContext;\n this.state.topicContext = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null\n };\n\n try {\n return callback();\n } finally {\n this.state.topicContext = outerContextTopicState;\n }\n }\n\n withSoloAwaitPermittingContext(callback) {\n const outerContextSoloAwaitState = this.state.soloAwait;\n this.state.soloAwait = true;\n\n try {\n return callback();\n } finally {\n this.state.soloAwait = outerContextSoloAwaitState;\n }\n }\n\n allowInAnd(callback) {\n const flags = this.prodParam.currentFlags();\n const prodParamToSet = PARAM_IN & ~flags;\n\n if (prodParamToSet) {\n this.prodParam.enter(flags | PARAM_IN);\n\n try {\n return callback();\n } finally {\n this.prodParam.exit();\n }\n }\n\n return callback();\n }\n\n disallowInAnd(callback) {\n const flags = this.prodParam.currentFlags();\n const prodParamToClear = PARAM_IN & flags;\n\n if (prodParamToClear) {\n this.prodParam.enter(flags & ~PARAM_IN);\n\n try {\n return callback();\n } finally {\n this.prodParam.exit();\n }\n }\n\n return callback();\n }\n\n registerTopicReference() {\n this.state.topicContext.maxTopicIndex = 0;\n }\n\n primaryTopicReferenceIsAllowedInCurrentTopicContext() {\n return this.state.topicContext.maxNumOfResolvableTopics >= 1;\n }\n\n topicReferenceWasUsedInCurrentTopicContext() {\n return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0;\n }\n\n parseFSharpPipelineBody(prec) {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n this.state.potentialArrowAt = this.state.start;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = true;\n const ret = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, prec);\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n return ret;\n }\n\n}\n\nconst loopLabel = {\n kind: \"loop\"\n},\n switchLabel = {\n kind: \"switch\"\n};\nconst FUNC_NO_FLAGS = 0b000,\n FUNC_STATEMENT = 0b001,\n FUNC_HANGING_STATEMENT = 0b010,\n FUNC_NULLABLE_ID = 0b100;\nconst loneSurrogate = /[\\uD800-\\uDFFF]/u;\nclass StatementParser extends ExpressionParser {\n parseTopLevel(file, program) {\n program.sourceType = this.options.sourceType;\n program.interpreter = this.parseInterpreterDirective();\n this.parseBlockBody(program, true, true, types.eof);\n\n if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) {\n for (let _i = 0, _Array$from = Array.from(this.scope.undefinedExports); _i < _Array$from.length; _i++) {\n const [name] = _Array$from[_i];\n const pos = this.scope.undefinedExports.get(name);\n this.raise(pos, ErrorMessages.ModuleExportUndefined, name);\n }\n }\n\n file.program = this.finishNode(program, \"Program\");\n file.comments = this.state.comments;\n if (this.options.tokens) file.tokens = this.tokens;\n return this.finishNode(file, \"File\");\n }\n\n stmtToDirective(stmt) {\n const expr = stmt.expression;\n const directiveLiteral = this.startNodeAt(expr.start, expr.loc.start);\n const directive = this.startNodeAt(stmt.start, stmt.loc.start);\n const raw = this.input.slice(expr.start, expr.end);\n const val = directiveLiteral.value = raw.slice(1, -1);\n this.addExtra(directiveLiteral, \"raw\", raw);\n this.addExtra(directiveLiteral, \"rawValue\", val);\n directive.value = this.finishNodeAt(directiveLiteral, \"DirectiveLiteral\", expr.end, expr.loc.end);\n return this.finishNodeAt(directive, \"Directive\", stmt.end, stmt.loc.end);\n }\n\n parseInterpreterDirective() {\n if (!this.match(types.interpreterDirective)) {\n return null;\n }\n\n const node = this.startNode();\n node.value = this.state.value;\n this.next();\n return this.finishNode(node, \"InterpreterDirective\");\n }\n\n isLet(context) {\n if (!this.isContextual(\"let\")) {\n return false;\n }\n\n const next = this.nextTokenStart();\n const nextCh = this.input.charCodeAt(next);\n if (nextCh === 91) return true;\n if (context) return false;\n if (nextCh === 123) return true;\n\n if (isIdentifierStart(nextCh)) {\n let pos = next + 1;\n\n while (isIdentifierChar(this.input.charCodeAt(pos))) {\n ++pos;\n }\n\n const ident = this.input.slice(next, pos);\n if (!keywordRelationalOperator.test(ident)) return true;\n }\n\n return false;\n }\n\n parseStatement(context, topLevel) {\n if (this.match(types.at)) {\n this.parseDecorators(true);\n }\n\n return this.parseStatementContent(context, topLevel);\n }\n\n parseStatementContent(context, topLevel) {\n let starttype = this.state.type;\n const node = this.startNode();\n let kind;\n\n if (this.isLet(context)) {\n starttype = types._var;\n kind = \"let\";\n }\n\n switch (starttype) {\n case types._break:\n case types._continue:\n return this.parseBreakContinueStatement(node, starttype.keyword);\n\n case types._debugger:\n return this.parseDebuggerStatement(node);\n\n case types._do:\n return this.parseDoStatement(node);\n\n case types._for:\n return this.parseForStatement(node);\n\n case types._function:\n if (this.lookaheadCharCode() === 46) break;\n\n if (context) {\n if (this.state.strict) {\n this.raise(this.state.start, ErrorMessages.StrictFunction);\n } else if (context !== \"if\" && context !== \"label\") {\n this.raise(this.state.start, ErrorMessages.SloppyFunction);\n }\n }\n\n return this.parseFunctionStatement(node, false, !context);\n\n case types._class:\n if (context) this.unexpected();\n return this.parseClass(node, true);\n\n case types._if:\n return this.parseIfStatement(node);\n\n case types._return:\n return this.parseReturnStatement(node);\n\n case types._switch:\n return this.parseSwitchStatement(node);\n\n case types._throw:\n return this.parseThrowStatement(node);\n\n case types._try:\n return this.parseTryStatement(node);\n\n case types._const:\n case types._var:\n kind = kind || this.state.value;\n\n if (context && kind !== \"var\") {\n this.raise(this.state.start, ErrorMessages.UnexpectedLexicalDeclaration);\n }\n\n return this.parseVarStatement(node, kind);\n\n case types._while:\n return this.parseWhileStatement(node);\n\n case types._with:\n return this.parseWithStatement(node);\n\n case types.braceL:\n return this.parseBlock();\n\n case types.semi:\n return this.parseEmptyStatement(node);\n\n case types._import:\n {\n const nextTokenCharCode = this.lookaheadCharCode();\n\n if (nextTokenCharCode === 40 || nextTokenCharCode === 46) {\n break;\n }\n }\n\n case types._export:\n {\n if (!this.options.allowImportExportEverywhere && !topLevel) {\n this.raise(this.state.start, ErrorMessages.UnexpectedImportExport);\n }\n\n this.next();\n let result;\n\n if (starttype === types._import) {\n result = this.parseImport(node);\n\n if (result.type === \"ImportDeclaration\" && (!result.importKind || result.importKind === \"value\")) {\n this.sawUnambiguousESM = true;\n }\n } else {\n result = this.parseExport(node);\n\n if (result.type === \"ExportNamedDeclaration\" && (!result.exportKind || result.exportKind === \"value\") || result.type === \"ExportAllDeclaration\" && (!result.exportKind || result.exportKind === \"value\") || result.type === \"ExportDefaultDeclaration\") {\n this.sawUnambiguousESM = true;\n }\n }\n\n this.assertModuleNodeAllowed(node);\n return result;\n }\n\n default:\n {\n if (this.isAsyncFunction()) {\n if (context) {\n this.raise(this.state.start, ErrorMessages.AsyncFunctionInSingleStatementContext);\n }\n\n this.next();\n return this.parseFunctionStatement(node, true, !context);\n }\n }\n }\n\n const maybeName = this.state.value;\n const expr = this.parseExpression();\n\n if (starttype === types.name && expr.type === \"Identifier\" && this.eat(types.colon)) {\n return this.parseLabeledStatement(node, maybeName, expr, context);\n } else {\n return this.parseExpressionStatement(node, expr);\n }\n }\n\n assertModuleNodeAllowed(node) {\n if (!this.options.allowImportExportEverywhere && !this.inModule) {\n this.raiseWithData(node.start, {\n code: \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\"\n }, ErrorMessages.ImportOutsideModule);\n }\n }\n\n takeDecorators(node) {\n const decorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];\n\n if (decorators.length) {\n node.decorators = decorators;\n this.resetStartLocationFromNode(node, decorators[0]);\n this.state.decoratorStack[this.state.decoratorStack.length - 1] = [];\n }\n }\n\n canHaveLeadingDecorator() {\n return this.match(types._class);\n }\n\n parseDecorators(allowExport) {\n const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];\n\n while (this.match(types.at)) {\n const decorator = this.parseDecorator();\n currentContextDecorators.push(decorator);\n }\n\n if (this.match(types._export)) {\n if (!allowExport) {\n this.unexpected();\n }\n\n if (this.hasPlugin(\"decorators\") && !this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\")) {\n this.raise(this.state.start, ErrorMessages.DecoratorExportClass);\n }\n } else if (!this.canHaveLeadingDecorator()) {\n throw this.raise(this.state.start, ErrorMessages.UnexpectedLeadingDecorator);\n }\n }\n\n parseDecorator() {\n this.expectOnePlugin([\"decorators-legacy\", \"decorators\"]);\n const node = this.startNode();\n this.next();\n\n if (this.hasPlugin(\"decorators\")) {\n this.state.decoratorStack.push([]);\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n let expr;\n\n if (this.eat(types.parenL)) {\n expr = this.parseExpression();\n this.expect(types.parenR);\n } else {\n expr = this.parseIdentifier(false);\n\n while (this.eat(types.dot)) {\n const node = this.startNodeAt(startPos, startLoc);\n node.object = expr;\n node.property = this.parseIdentifier(true);\n node.computed = false;\n expr = this.finishNode(node, \"MemberExpression\");\n }\n }\n\n node.expression = this.parseMaybeDecoratorArguments(expr);\n this.state.decoratorStack.pop();\n } else {\n node.expression = this.parseExprSubscripts();\n }\n\n return this.finishNode(node, \"Decorator\");\n }\n\n parseMaybeDecoratorArguments(expr) {\n if (this.eat(types.parenL)) {\n const node = this.startNodeAtNode(expr);\n node.callee = expr;\n node.arguments = this.parseCallExpressionArguments(types.parenR, false);\n this.toReferencedList(node.arguments);\n return this.finishNode(node, \"CallExpression\");\n }\n\n return expr;\n }\n\n parseBreakContinueStatement(node, keyword) {\n const isBreak = keyword === \"break\";\n this.next();\n\n if (this.isLineTerminator()) {\n node.label = null;\n } else {\n node.label = this.parseIdentifier();\n this.semicolon();\n }\n\n this.verifyBreakContinue(node, keyword);\n return this.finishNode(node, isBreak ? \"BreakStatement\" : \"ContinueStatement\");\n }\n\n verifyBreakContinue(node, keyword) {\n const isBreak = keyword === \"break\";\n let i;\n\n for (i = 0; i < this.state.labels.length; ++i) {\n const lab = this.state.labels[i];\n\n if (node.label == null || lab.name === node.label.name) {\n if (lab.kind != null && (isBreak || lab.kind === \"loop\")) break;\n if (node.label && isBreak) break;\n }\n }\n\n if (i === this.state.labels.length) {\n this.raise(node.start, ErrorMessages.IllegalBreakContinue, keyword);\n }\n }\n\n parseDebuggerStatement(node) {\n this.next();\n this.semicolon();\n return this.finishNode(node, \"DebuggerStatement\");\n }\n\n parseHeaderExpression() {\n this.expect(types.parenL);\n const val = this.parseExpression();\n this.expect(types.parenR);\n return val;\n }\n\n parseDoStatement(node) {\n this.next();\n this.state.labels.push(loopLabel);\n node.body = this.withTopicForbiddingContext(() => this.parseStatement(\"do\"));\n this.state.labels.pop();\n this.expect(types._while);\n node.test = this.parseHeaderExpression();\n this.eat(types.semi);\n return this.finishNode(node, \"DoWhileStatement\");\n }\n\n parseForStatement(node) {\n this.next();\n this.state.labels.push(loopLabel);\n let awaitAt = -1;\n\n if (this.isAwaitAllowed() && this.eatContextual(\"await\")) {\n awaitAt = this.state.lastTokStart;\n }\n\n this.scope.enter(SCOPE_OTHER);\n this.expect(types.parenL);\n\n if (this.match(types.semi)) {\n if (awaitAt > -1) {\n this.unexpected(awaitAt);\n }\n\n return this.parseFor(node, null);\n }\n\n const isLet = this.isLet();\n\n if (this.match(types._var) || this.match(types._const) || isLet) {\n const init = this.startNode();\n const kind = isLet ? \"let\" : this.state.value;\n this.next();\n this.parseVar(init, true, kind);\n this.finishNode(init, \"VariableDeclaration\");\n\n if ((this.match(types._in) || this.isContextual(\"of\")) && init.declarations.length === 1) {\n return this.parseForIn(node, init, awaitAt);\n }\n\n if (awaitAt > -1) {\n this.unexpected(awaitAt);\n }\n\n return this.parseFor(node, init);\n }\n\n const refExpressionErrors = new ExpressionErrors();\n const init = this.parseExpression(true, refExpressionErrors);\n\n if (this.match(types._in) || this.isContextual(\"of\")) {\n this.toAssignable(init);\n const description = this.isContextual(\"of\") ? \"for-of statement\" : \"for-in statement\";\n this.checkLVal(init, undefined, undefined, description);\n return this.parseForIn(node, init, awaitAt);\n } else {\n this.checkExpressionErrors(refExpressionErrors, true);\n }\n\n if (awaitAt > -1) {\n this.unexpected(awaitAt);\n }\n\n return this.parseFor(node, init);\n }\n\n parseFunctionStatement(node, isAsync, declarationPosition) {\n this.next();\n return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), isAsync);\n }\n\n parseIfStatement(node) {\n this.next();\n node.test = this.parseHeaderExpression();\n node.consequent = this.parseStatement(\"if\");\n node.alternate = this.eat(types._else) ? this.parseStatement(\"if\") : null;\n return this.finishNode(node, \"IfStatement\");\n }\n\n parseReturnStatement(node) {\n if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {\n this.raise(this.state.start, ErrorMessages.IllegalReturn);\n }\n\n this.next();\n\n if (this.isLineTerminator()) {\n node.argument = null;\n } else {\n node.argument = this.parseExpression();\n this.semicolon();\n }\n\n return this.finishNode(node, \"ReturnStatement\");\n }\n\n parseSwitchStatement(node) {\n this.next();\n node.discriminant = this.parseHeaderExpression();\n const cases = node.cases = [];\n this.expect(types.braceL);\n this.state.labels.push(switchLabel);\n this.scope.enter(SCOPE_OTHER);\n let cur;\n\n for (let sawDefault; !this.match(types.braceR);) {\n if (this.match(types._case) || this.match(types._default)) {\n const isCase = this.match(types._case);\n if (cur) this.finishNode(cur, \"SwitchCase\");\n cases.push(cur = this.startNode());\n cur.consequent = [];\n this.next();\n\n if (isCase) {\n cur.test = this.parseExpression();\n } else {\n if (sawDefault) {\n this.raise(this.state.lastTokStart, ErrorMessages.MultipleDefaultsInSwitch);\n }\n\n sawDefault = true;\n cur.test = null;\n }\n\n this.expect(types.colon);\n } else {\n if (cur) {\n cur.consequent.push(this.parseStatement(null));\n } else {\n this.unexpected();\n }\n }\n }\n\n this.scope.exit();\n if (cur) this.finishNode(cur, \"SwitchCase\");\n this.next();\n this.state.labels.pop();\n return this.finishNode(node, \"SwitchStatement\");\n }\n\n parseThrowStatement(node) {\n this.next();\n\n if (this.hasPrecedingLineBreak()) {\n this.raise(this.state.lastTokEnd, ErrorMessages.NewlineAfterThrow);\n }\n\n node.argument = this.parseExpression();\n this.semicolon();\n return this.finishNode(node, \"ThrowStatement\");\n }\n\n parseCatchClauseParam() {\n const param = this.parseBindingAtom();\n const simple = param.type === \"Identifier\";\n this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0);\n this.checkLVal(param, BIND_LEXICAL, null, \"catch clause\");\n return param;\n }\n\n parseTryStatement(node) {\n this.next();\n node.block = this.parseBlock();\n node.handler = null;\n\n if (this.match(types._catch)) {\n const clause = this.startNode();\n this.next();\n\n if (this.match(types.parenL)) {\n this.expect(types.parenL);\n clause.param = this.parseCatchClauseParam();\n this.expect(types.parenR);\n } else {\n clause.param = null;\n this.scope.enter(SCOPE_OTHER);\n }\n\n clause.body = this.withTopicForbiddingContext(() => this.parseBlock(false, false));\n this.scope.exit();\n node.handler = this.finishNode(clause, \"CatchClause\");\n }\n\n node.finalizer = this.eat(types._finally) ? this.parseBlock() : null;\n\n if (!node.handler && !node.finalizer) {\n this.raise(node.start, ErrorMessages.NoCatchOrFinally);\n }\n\n return this.finishNode(node, \"TryStatement\");\n }\n\n parseVarStatement(node, kind) {\n this.next();\n this.parseVar(node, false, kind);\n this.semicolon();\n return this.finishNode(node, \"VariableDeclaration\");\n }\n\n parseWhileStatement(node) {\n this.next();\n node.test = this.parseHeaderExpression();\n this.state.labels.push(loopLabel);\n node.body = this.withTopicForbiddingContext(() => this.parseStatement(\"while\"));\n this.state.labels.pop();\n return this.finishNode(node, \"WhileStatement\");\n }\n\n parseWithStatement(node) {\n if (this.state.strict) {\n this.raise(this.state.start, ErrorMessages.StrictWith);\n }\n\n this.next();\n node.object = this.parseHeaderExpression();\n node.body = this.withTopicForbiddingContext(() => this.parseStatement(\"with\"));\n return this.finishNode(node, \"WithStatement\");\n }\n\n parseEmptyStatement(node) {\n this.next();\n return this.finishNode(node, \"EmptyStatement\");\n }\n\n parseLabeledStatement(node, maybeName, expr, context) {\n for (let _i2 = 0, _this$state$labels = this.state.labels; _i2 < _this$state$labels.length; _i2++) {\n const label = _this$state$labels[_i2];\n\n if (label.name === maybeName) {\n this.raise(expr.start, ErrorMessages.LabelRedeclaration, maybeName);\n }\n }\n\n const kind = this.state.type.isLoop ? \"loop\" : this.match(types._switch) ? \"switch\" : null;\n\n for (let i = this.state.labels.length - 1; i >= 0; i--) {\n const label = this.state.labels[i];\n\n if (label.statementStart === node.start) {\n label.statementStart = this.state.start;\n label.kind = kind;\n } else {\n break;\n }\n }\n\n this.state.labels.push({\n name: maybeName,\n kind: kind,\n statementStart: this.state.start\n });\n node.body = this.parseStatement(context ? context.indexOf(\"label\") === -1 ? context + \"label\" : context : \"label\");\n this.state.labels.pop();\n node.label = expr;\n return this.finishNode(node, \"LabeledStatement\");\n }\n\n parseExpressionStatement(node, expr) {\n node.expression = expr;\n this.semicolon();\n return this.finishNode(node, \"ExpressionStatement\");\n }\n\n parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) {\n const node = this.startNode();\n this.expect(types.braceL);\n\n if (createNewLexicalScope) {\n this.scope.enter(SCOPE_OTHER);\n }\n\n this.parseBlockBody(node, allowDirectives, false, types.braceR, afterBlockParse);\n\n if (createNewLexicalScope) {\n this.scope.exit();\n }\n\n return this.finishNode(node, \"BlockStatement\");\n }\n\n isValidDirective(stmt) {\n return stmt.type === \"ExpressionStatement\" && stmt.expression.type === \"StringLiteral\" && !stmt.expression.extra.parenthesized;\n }\n\n parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {\n const body = node.body = [];\n const directives = node.directives = [];\n this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse);\n }\n\n parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) {\n const octalPositions = [];\n const oldStrict = this.state.strict;\n let hasStrictModeDirective = false;\n let parsedNonDirective = false;\n\n while (!this.match(end)) {\n if (!parsedNonDirective && this.state.octalPositions.length) {\n octalPositions.push(...this.state.octalPositions);\n }\n\n const stmt = this.parseStatement(null, topLevel);\n\n if (directives && !parsedNonDirective && this.isValidDirective(stmt)) {\n const directive = this.stmtToDirective(stmt);\n directives.push(directive);\n\n if (!hasStrictModeDirective && directive.value.value === \"use strict\") {\n hasStrictModeDirective = true;\n this.setStrict(true);\n }\n\n continue;\n }\n\n parsedNonDirective = true;\n body.push(stmt);\n }\n\n if (this.state.strict && octalPositions.length) {\n for (let _i3 = 0; _i3 < octalPositions.length; _i3++) {\n const pos = octalPositions[_i3];\n this.raise(pos, ErrorMessages.StrictOctalLiteral);\n }\n }\n\n if (afterBlockParse) {\n afterBlockParse.call(this, hasStrictModeDirective);\n }\n\n if (!oldStrict) {\n this.setStrict(false);\n }\n\n this.next();\n }\n\n parseFor(node, init) {\n node.init = init;\n this.expect(types.semi);\n node.test = this.match(types.semi) ? null : this.parseExpression();\n this.expect(types.semi);\n node.update = this.match(types.parenR) ? null : this.parseExpression();\n this.expect(types.parenR);\n node.body = this.withTopicForbiddingContext(() => this.parseStatement(\"for\"));\n this.scope.exit();\n this.state.labels.pop();\n return this.finishNode(node, \"ForStatement\");\n }\n\n parseForIn(node, init, awaitAt) {\n const isForIn = this.match(types._in);\n this.next();\n\n if (isForIn) {\n if (awaitAt > -1) this.unexpected(awaitAt);\n } else {\n node.await = awaitAt > -1;\n }\n\n if (init.type === \"VariableDeclaration\" && init.declarations[0].init != null && (!isForIn || this.state.strict || init.kind !== \"var\" || init.declarations[0].id.type !== \"Identifier\")) {\n this.raise(init.start, ErrorMessages.ForInOfLoopInitializer, isForIn ? \"for-in\" : \"for-of\");\n } else if (init.type === \"AssignmentPattern\") {\n this.raise(init.start, ErrorMessages.InvalidLhs, \"for-loop\");\n }\n\n node.left = init;\n node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();\n this.expect(types.parenR);\n node.body = this.withTopicForbiddingContext(() => this.parseStatement(\"for\"));\n this.scope.exit();\n this.state.labels.pop();\n return this.finishNode(node, isForIn ? \"ForInStatement\" : \"ForOfStatement\");\n }\n\n parseVar(node, isFor, kind) {\n const declarations = node.declarations = [];\n const isTypescript = this.hasPlugin(\"typescript\");\n node.kind = kind;\n\n for (;;) {\n const decl = this.startNode();\n this.parseVarId(decl, kind);\n\n if (this.eat(types.eq)) {\n decl.init = isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn();\n } else {\n if (kind === \"const\" && !(this.match(types._in) || this.isContextual(\"of\"))) {\n if (!isTypescript) {\n this.raise(this.state.lastTokEnd, ErrorMessages.DeclarationMissingInitializer, \"Const declarations\");\n }\n } else if (decl.id.type !== \"Identifier\" && !(isFor && (this.match(types._in) || this.isContextual(\"of\")))) {\n this.raise(this.state.lastTokEnd, ErrorMessages.DeclarationMissingInitializer, \"Complex binding patterns\");\n }\n\n decl.init = null;\n }\n\n declarations.push(this.finishNode(decl, \"VariableDeclarator\"));\n if (!this.eat(types.comma)) break;\n }\n\n return node;\n }\n\n parseVarId(decl, kind) {\n decl.id = this.parseBindingAtom();\n this.checkLVal(decl.id, kind === \"var\" ? BIND_VAR : BIND_LEXICAL, undefined, \"variable declaration\", kind !== \"var\");\n }\n\n parseFunction(node, statement = FUNC_NO_FLAGS, isAsync = false) {\n const isStatement = statement & FUNC_STATEMENT;\n const isHangingStatement = statement & FUNC_HANGING_STATEMENT;\n const requireId = !!isStatement && !(statement & FUNC_NULLABLE_ID);\n this.initFunction(node, isAsync);\n\n if (this.match(types.star) && isHangingStatement) {\n this.raise(this.state.start, ErrorMessages.GeneratorInSingleStatementContext);\n }\n\n node.generator = this.eat(types.star);\n\n if (isStatement) {\n node.id = this.parseFunctionId(requireId);\n }\n\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n this.state.maybeInArrowParameters = false;\n this.scope.enter(SCOPE_FUNCTION);\n this.prodParam.enter(functionFlags(isAsync, node.generator));\n\n if (!isStatement) {\n node.id = this.parseFunctionId();\n }\n\n this.parseFunctionParams(node, false);\n this.withTopicForbiddingContext(() => {\n this.parseFunctionBodyAndFinish(node, isStatement ? \"FunctionDeclaration\" : \"FunctionExpression\");\n });\n this.prodParam.exit();\n this.scope.exit();\n\n if (isStatement && !isHangingStatement) {\n this.registerFunctionStatementId(node);\n }\n\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n return node;\n }\n\n parseFunctionId(requireId) {\n return requireId || this.match(types.name) ? this.parseIdentifier() : null;\n }\n\n parseFunctionParams(node, allowModifiers) {\n this.expect(types.parenL);\n this.expressionScope.enter(newParameterDeclarationScope());\n node.params = this.parseBindingList(types.parenR, 41, false, allowModifiers);\n this.expressionScope.exit();\n }\n\n registerFunctionStatementId(node) {\n if (!node.id) return;\n this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.start);\n }\n\n parseClass(node, isStatement, optionalId) {\n this.next();\n this.takeDecorators(node);\n const oldStrict = this.state.strict;\n this.state.strict = true;\n this.parseClassId(node, isStatement, optionalId);\n this.parseClassSuper(node);\n node.body = this.parseClassBody(!!node.superClass, oldStrict);\n return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\");\n }\n\n isClassProperty() {\n return this.match(types.eq) || this.match(types.semi) || this.match(types.braceR);\n }\n\n isClassMethod() {\n return this.match(types.parenL);\n }\n\n isNonstaticConstructor(method) {\n return !method.computed && !method.static && (method.key.name === \"constructor\" || method.key.value === \"constructor\");\n }\n\n parseClassBody(constructorAllowsSuper, oldStrict) {\n this.classScope.enter();\n const state = {\n constructorAllowsSuper,\n hadConstructor: false,\n hadStaticBlock: false\n };\n let decorators = [];\n const classBody = this.startNode();\n classBody.body = [];\n this.expect(types.braceL);\n this.withTopicForbiddingContext(() => {\n while (!this.match(types.braceR)) {\n if (this.eat(types.semi)) {\n if (decorators.length > 0) {\n throw this.raise(this.state.lastTokEnd, ErrorMessages.DecoratorSemicolon);\n }\n\n continue;\n }\n\n if (this.match(types.at)) {\n decorators.push(this.parseDecorator());\n continue;\n }\n\n const member = this.startNode();\n\n if (decorators.length) {\n member.decorators = decorators;\n this.resetStartLocationFromNode(member, decorators[0]);\n decorators = [];\n }\n\n this.parseClassMember(classBody, member, state);\n\n if (member.kind === \"constructor\" && member.decorators && member.decorators.length > 0) {\n this.raise(member.start, ErrorMessages.DecoratorConstructor);\n }\n }\n });\n this.state.strict = oldStrict;\n this.next();\n\n if (decorators.length) {\n throw this.raise(this.state.start, ErrorMessages.TrailingDecorator);\n }\n\n this.classScope.exit();\n return this.finishNode(classBody, \"ClassBody\");\n }\n\n parseClassMemberFromModifier(classBody, member) {\n const key = this.parseIdentifier(true);\n\n if (this.isClassMethod()) {\n const method = member;\n method.kind = \"method\";\n method.computed = false;\n method.key = key;\n method.static = false;\n this.pushClassMethod(classBody, method, false, false, false, false);\n return true;\n } else if (this.isClassProperty()) {\n const prop = member;\n prop.computed = false;\n prop.key = key;\n prop.static = false;\n classBody.body.push(this.parseClassProperty(prop));\n return true;\n }\n\n return false;\n }\n\n parseClassMember(classBody, member, state) {\n const isStatic = this.isContextual(\"static\");\n\n if (isStatic) {\n if (this.parseClassMemberFromModifier(classBody, member)) {\n return;\n }\n\n if (this.eat(types.braceL)) {\n this.parseClassStaticBlock(classBody, member, state);\n return;\n }\n }\n\n this.parseClassMemberWithIsStatic(classBody, member, state, isStatic);\n }\n\n parseClassMemberWithIsStatic(classBody, member, state, isStatic) {\n const publicMethod = member;\n const privateMethod = member;\n const publicProp = member;\n const privateProp = member;\n const method = publicMethod;\n const publicMember = publicMethod;\n member.static = isStatic;\n\n if (this.eat(types.star)) {\n method.kind = \"method\";\n this.parseClassElementName(method);\n\n if (method.key.type === \"PrivateName\") {\n this.pushClassPrivateMethod(classBody, privateMethod, true, false);\n return;\n }\n\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsGenerator);\n }\n\n this.pushClassMethod(classBody, publicMethod, true, false, false, false);\n return;\n }\n\n const containsEsc = this.state.containsEsc;\n const key = this.parseClassElementName(member);\n const isPrivate = key.type === \"PrivateName\";\n const isSimple = key.type === \"Identifier\";\n const maybeQuestionTokenStart = this.state.start;\n this.parsePostMemberNameModifiers(publicMember);\n\n if (this.isClassMethod()) {\n method.kind = \"method\";\n\n if (isPrivate) {\n this.pushClassPrivateMethod(classBody, privateMethod, false, false);\n return;\n }\n\n const isConstructor = this.isNonstaticConstructor(publicMethod);\n let allowsDirectSuper = false;\n\n if (isConstructor) {\n publicMethod.kind = \"constructor\";\n\n if (state.hadConstructor && !this.hasPlugin(\"typescript\")) {\n this.raise(key.start, ErrorMessages.DuplicateConstructor);\n }\n\n state.hadConstructor = true;\n allowsDirectSuper = state.constructorAllowsSuper;\n }\n\n this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);\n } else if (this.isClassProperty()) {\n if (isPrivate) {\n this.pushClassPrivateProperty(classBody, privateProp);\n } else {\n this.pushClassProperty(classBody, publicProp);\n }\n } else if (isSimple && key.name === \"async\" && !containsEsc && !this.isLineTerminator()) {\n const isGenerator = this.eat(types.star);\n\n if (publicMember.optional) {\n this.unexpected(maybeQuestionTokenStart);\n }\n\n method.kind = \"method\";\n this.parseClassElementName(method);\n this.parsePostMemberNameModifiers(publicMember);\n\n if (method.key.type === \"PrivateName\") {\n this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);\n } else {\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsAsync);\n }\n\n this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);\n }\n } else if (isSimple && (key.name === \"get\" || key.name === \"set\") && !containsEsc && !(this.match(types.star) && this.isLineTerminator())) {\n method.kind = key.name;\n this.parseClassElementName(publicMethod);\n\n if (method.key.type === \"PrivateName\") {\n this.pushClassPrivateMethod(classBody, privateMethod, false, false);\n } else {\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsAccessor);\n }\n\n this.pushClassMethod(classBody, publicMethod, false, false, false, false);\n }\n\n this.checkGetterSetterParams(publicMethod);\n } else if (this.isLineTerminator()) {\n if (isPrivate) {\n this.pushClassPrivateProperty(classBody, privateProp);\n } else {\n this.pushClassProperty(classBody, publicProp);\n }\n } else {\n this.unexpected();\n }\n }\n\n parseClassElementName(member) {\n const key = this.parsePropertyName(member, true);\n\n if (!member.computed && member.static && (key.name === \"prototype\" || key.value === \"prototype\")) {\n this.raise(key.start, ErrorMessages.StaticPrototype);\n }\n\n if (key.type === \"PrivateName\" && key.id.name === \"constructor\") {\n this.raise(key.start, ErrorMessages.ConstructorClassPrivateField);\n }\n\n return key;\n }\n\n parseClassStaticBlock(classBody, member, state) {\n var _member$decorators;\n\n this.expectPlugin(\"classStaticBlock\", member.start);\n this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);\n this.expressionScope.enter(newExpressionScope());\n const oldLabels = this.state.labels;\n this.state.labels = [];\n this.prodParam.enter(PARAM);\n const body = member.body = [];\n this.parseBlockOrModuleBlockBody(body, undefined, false, types.braceR);\n this.prodParam.exit();\n this.expressionScope.exit();\n this.scope.exit();\n this.state.labels = oldLabels;\n classBody.body.push(this.finishNode(member, \"StaticBlock\"));\n\n if (state.hadStaticBlock) {\n this.raise(member.start, ErrorMessages.DuplicateStaticBlock);\n }\n\n if ((_member$decorators = member.decorators) == null ? void 0 : _member$decorators.length) {\n this.raise(member.start, ErrorMessages.DecoratorStaticBlock);\n }\n\n state.hadStaticBlock = true;\n }\n\n pushClassProperty(classBody, prop) {\n if (!prop.computed && (prop.key.name === \"constructor\" || prop.key.value === \"constructor\")) {\n this.raise(prop.key.start, ErrorMessages.ConstructorClassField);\n }\n\n classBody.body.push(this.parseClassProperty(prop));\n }\n\n pushClassPrivateProperty(classBody, prop) {\n this.expectPlugin(\"classPrivateProperties\", prop.key.start);\n const node = this.parseClassPrivateProperty(prop);\n classBody.body.push(node);\n this.classScope.declarePrivateName(node.key.id.name, CLASS_ELEMENT_OTHER, node.key.start);\n }\n\n pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {\n classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, \"ClassMethod\", true));\n }\n\n pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {\n this.expectPlugin(\"classPrivateMethods\", method.key.start);\n const node = this.parseMethod(method, isGenerator, isAsync, false, false, \"ClassPrivateMethod\", true);\n classBody.body.push(node);\n const kind = node.kind === \"get\" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === \"set\" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER;\n this.classScope.declarePrivateName(node.key.id.name, kind, node.key.start);\n }\n\n parsePostMemberNameModifiers(methodOrProp) {}\n\n parseClassPrivateProperty(node) {\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassPrivateProperty\");\n }\n\n parseClassProperty(node) {\n if (!node.typeAnnotation || this.match(types.eq)) {\n this.expectPlugin(\"classProperties\");\n }\n\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassProperty\");\n }\n\n parseInitializer(node) {\n this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);\n this.expressionScope.enter(newExpressionScope());\n this.prodParam.enter(PARAM);\n node.value = this.eat(types.eq) ? this.parseMaybeAssignAllowIn() : null;\n this.expressionScope.exit();\n this.prodParam.exit();\n this.scope.exit();\n }\n\n parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) {\n if (this.match(types.name)) {\n node.id = this.parseIdentifier();\n\n if (isStatement) {\n this.checkLVal(node.id, bindingType, undefined, \"class name\");\n }\n } else {\n if (optionalId || !isStatement) {\n node.id = null;\n } else {\n this.unexpected(null, ErrorMessages.MissingClassName);\n }\n }\n }\n\n parseClassSuper(node) {\n node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;\n }\n\n parseExport(node) {\n const hasDefault = this.maybeParseExportDefaultSpecifier(node);\n const parseAfterDefault = !hasDefault || this.eat(types.comma);\n const hasStar = parseAfterDefault && this.eatExportStar(node);\n const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node);\n const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(types.comma));\n const isFromRequired = hasDefault || hasStar;\n\n if (hasStar && !hasNamespace) {\n if (hasDefault) this.unexpected();\n this.parseExportFrom(node, true);\n return this.finishNode(node, \"ExportAllDeclaration\");\n }\n\n const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node);\n\n if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) {\n throw this.unexpected(null, types.braceL);\n }\n\n let hasDeclaration;\n\n if (isFromRequired || hasSpecifiers) {\n hasDeclaration = false;\n this.parseExportFrom(node, isFromRequired);\n } else {\n hasDeclaration = this.maybeParseExportDeclaration(node);\n }\n\n if (isFromRequired || hasSpecifiers || hasDeclaration) {\n this.checkExport(node, true, false, !!node.source);\n return this.finishNode(node, \"ExportNamedDeclaration\");\n }\n\n if (this.eat(types._default)) {\n node.declaration = this.parseExportDefaultExpression();\n this.checkExport(node, true, true);\n return this.finishNode(node, \"ExportDefaultDeclaration\");\n }\n\n throw this.unexpected(null, types.braceL);\n }\n\n eatExportStar(node) {\n return this.eat(types.star);\n }\n\n maybeParseExportDefaultSpecifier(node) {\n if (this.isExportDefaultSpecifier()) {\n this.expectPlugin(\"exportDefaultFrom\");\n const specifier = this.startNode();\n specifier.exported = this.parseIdentifier(true);\n node.specifiers = [this.finishNode(specifier, \"ExportDefaultSpecifier\")];\n return true;\n }\n\n return false;\n }\n\n maybeParseExportNamespaceSpecifier(node) {\n if (this.isContextual(\"as\")) {\n if (!node.specifiers) node.specifiers = [];\n const specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc);\n this.next();\n specifier.exported = this.parseModuleExportName();\n node.specifiers.push(this.finishNode(specifier, \"ExportNamespaceSpecifier\"));\n return true;\n }\n\n return false;\n }\n\n maybeParseExportNamedSpecifiers(node) {\n if (this.match(types.braceL)) {\n if (!node.specifiers) node.specifiers = [];\n node.specifiers.push(...this.parseExportSpecifiers());\n node.source = null;\n node.declaration = null;\n return true;\n }\n\n return false;\n }\n\n maybeParseExportDeclaration(node) {\n if (this.shouldParseExportDeclaration()) {\n node.specifiers = [];\n node.source = null;\n node.declaration = this.parseExportDeclaration(node);\n return true;\n }\n\n return false;\n }\n\n isAsyncFunction() {\n if (!this.isContextual(\"async\")) return false;\n const next = this.nextTokenStart();\n return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, \"function\");\n }\n\n parseExportDefaultExpression() {\n const expr = this.startNode();\n const isAsync = this.isAsyncFunction();\n\n if (this.match(types._function) || isAsync) {\n this.next();\n\n if (isAsync) {\n this.next();\n }\n\n return this.parseFunction(expr, FUNC_STATEMENT | FUNC_NULLABLE_ID, isAsync);\n } else if (this.match(types._class)) {\n return this.parseClass(expr, true, true);\n } else if (this.match(types.at)) {\n if (this.hasPlugin(\"decorators\") && this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\")) {\n this.raise(this.state.start, ErrorMessages.DecoratorBeforeExport);\n }\n\n this.parseDecorators(false);\n return this.parseClass(expr, true, true);\n } else if (this.match(types._const) || this.match(types._var) || this.isLet()) {\n throw this.raise(this.state.start, ErrorMessages.UnsupportedDefaultExport);\n } else {\n const res = this.parseMaybeAssignAllowIn();\n this.semicolon();\n return res;\n }\n }\n\n parseExportDeclaration(node) {\n return this.parseStatement(null);\n }\n\n isExportDefaultSpecifier() {\n if (this.match(types.name)) {\n const value = this.state.value;\n\n if (value === \"async\" && !this.state.containsEsc || value === \"let\") {\n return false;\n }\n\n if ((value === \"type\" || value === \"interface\") && !this.state.containsEsc) {\n const l = this.lookahead();\n\n if (l.type === types.name && l.value !== \"from\" || l.type === types.braceL) {\n this.expectOnePlugin([\"flow\", \"typescript\"]);\n return false;\n }\n }\n } else if (!this.match(types._default)) {\n return false;\n }\n\n const next = this.nextTokenStart();\n const hasFrom = this.isUnparsedContextual(next, \"from\");\n\n if (this.input.charCodeAt(next) === 44 || this.match(types.name) && hasFrom) {\n return true;\n }\n\n if (this.match(types._default) && hasFrom) {\n const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4));\n return nextAfterFrom === 34 || nextAfterFrom === 39;\n }\n\n return false;\n }\n\n parseExportFrom(node, expect) {\n if (this.eatContextual(\"from\")) {\n node.source = this.parseImportSource();\n this.checkExport(node);\n const assertions = this.maybeParseImportAssertions();\n\n if (assertions) {\n node.assertions = assertions;\n }\n } else {\n if (expect) {\n this.unexpected();\n } else {\n node.source = null;\n }\n }\n\n this.semicolon();\n }\n\n shouldParseExportDeclaration() {\n if (this.match(types.at)) {\n this.expectOnePlugin([\"decorators\", \"decorators-legacy\"]);\n\n if (this.hasPlugin(\"decorators\")) {\n if (this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\")) {\n this.unexpected(this.state.start, ErrorMessages.DecoratorBeforeExport);\n } else {\n return true;\n }\n }\n }\n\n return this.state.type.keyword === \"var\" || this.state.type.keyword === \"const\" || this.state.type.keyword === \"function\" || this.state.type.keyword === \"class\" || this.isLet() || this.isAsyncFunction();\n }\n\n checkExport(node, checkNames, isDefault, isFrom) {\n if (checkNames) {\n if (isDefault) {\n this.checkDuplicateExports(node, \"default\");\n\n if (this.hasPlugin(\"exportDefaultFrom\")) {\n var _declaration$extra;\n\n const declaration = node.declaration;\n\n if (declaration.type === \"Identifier\" && declaration.name === \"from\" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) == null ? void 0 : _declaration$extra.parenthesized)) {\n this.raise(declaration.start, ErrorMessages.ExportDefaultFromAsIdentifier);\n }\n }\n } else if (node.specifiers && node.specifiers.length) {\n for (let _i4 = 0, _node$specifiers = node.specifiers; _i4 < _node$specifiers.length; _i4++) {\n const specifier = _node$specifiers[_i4];\n const {\n exported\n } = specifier;\n const exportedName = exported.type === \"Identifier\" ? exported.name : exported.value;\n this.checkDuplicateExports(specifier, exportedName);\n\n if (!isFrom && specifier.local) {\n const {\n local\n } = specifier;\n\n if (local.type === \"StringLiteral\") {\n this.raise(specifier.start, ErrorMessages.ExportBindingIsString, local.extra.raw, exportedName);\n } else {\n this.checkReservedWord(local.name, local.start, true, false);\n this.scope.checkLocalExport(local);\n }\n }\n }\n } else if (node.declaration) {\n if (node.declaration.type === \"FunctionDeclaration\" || node.declaration.type === \"ClassDeclaration\") {\n const id = node.declaration.id;\n if (!id) throw new Error(\"Assertion failure\");\n this.checkDuplicateExports(node, id.name);\n } else if (node.declaration.type === \"VariableDeclaration\") {\n for (let _i5 = 0, _node$declaration$dec = node.declaration.declarations; _i5 < _node$declaration$dec.length; _i5++) {\n const declaration = _node$declaration$dec[_i5];\n this.checkDeclaration(declaration.id);\n }\n }\n }\n }\n\n const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];\n\n if (currentContextDecorators.length) {\n throw this.raise(node.start, ErrorMessages.UnsupportedDecoratorExport);\n }\n }\n\n checkDeclaration(node) {\n if (node.type === \"Identifier\") {\n this.checkDuplicateExports(node, node.name);\n } else if (node.type === \"ObjectPattern\") {\n for (let _i6 = 0, _node$properties = node.properties; _i6 < _node$properties.length; _i6++) {\n const prop = _node$properties[_i6];\n this.checkDeclaration(prop);\n }\n } else if (node.type === \"ArrayPattern\") {\n for (let _i7 = 0, _node$elements = node.elements; _i7 < _node$elements.length; _i7++) {\n const elem = _node$elements[_i7];\n\n if (elem) {\n this.checkDeclaration(elem);\n }\n }\n } else if (node.type === \"ObjectProperty\") {\n this.checkDeclaration(node.value);\n } else if (node.type === \"RestElement\") {\n this.checkDeclaration(node.argument);\n } else if (node.type === \"AssignmentPattern\") {\n this.checkDeclaration(node.left);\n }\n }\n\n checkDuplicateExports(node, name) {\n if (this.state.exportedIdentifiers.indexOf(name) > -1) {\n this.raise(node.start, name === \"default\" ? ErrorMessages.DuplicateDefaultExport : ErrorMessages.DuplicateExport, name);\n }\n\n this.state.exportedIdentifiers.push(name);\n }\n\n parseExportSpecifiers() {\n const nodes = [];\n let first = true;\n this.expect(types.braceL);\n\n while (!this.eat(types.braceR)) {\n if (first) {\n first = false;\n } else {\n this.expect(types.comma);\n if (this.eat(types.braceR)) break;\n }\n\n const node = this.startNode();\n node.local = this.parseModuleExportName();\n node.exported = this.eatContextual(\"as\") ? this.parseModuleExportName() : node.local.__clone();\n nodes.push(this.finishNode(node, \"ExportSpecifier\"));\n }\n\n return nodes;\n }\n\n parseModuleExportName() {\n if (this.match(types.string)) {\n this.expectPlugin(\"moduleStringNames\");\n const result = this.parseLiteral(this.state.value, \"StringLiteral\");\n const surrogate = result.value.match(loneSurrogate);\n\n if (surrogate) {\n this.raise(result.start, ErrorMessages.ModuleExportNameHasLoneSurrogate, surrogate[0].charCodeAt(0).toString(16));\n }\n\n return result;\n }\n\n return this.parseIdentifier(true);\n }\n\n parseImport(node) {\n node.specifiers = [];\n\n if (!this.match(types.string)) {\n const hasDefault = this.maybeParseDefaultImportSpecifier(node);\n const parseNext = !hasDefault || this.eat(types.comma);\n const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);\n if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);\n this.expectContextual(\"from\");\n }\n\n node.source = this.parseImportSource();\n const assertions = this.maybeParseImportAssertions();\n\n if (assertions) {\n node.assertions = assertions;\n } else {\n const attributes = this.maybeParseModuleAttributes();\n\n if (attributes) {\n node.attributes = attributes;\n }\n }\n\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n parseImportSource() {\n if (!this.match(types.string)) this.unexpected();\n return this.parseExprAtom();\n }\n\n shouldParseDefaultImport(node) {\n return this.match(types.name);\n }\n\n parseImportSpecifierLocal(node, specifier, type, contextDescription) {\n specifier.local = this.parseIdentifier();\n this.checkLVal(specifier.local, BIND_LEXICAL, undefined, contextDescription);\n node.specifiers.push(this.finishNode(specifier, type));\n }\n\n parseAssertEntries() {\n const attrs = [];\n const attrNames = new Set();\n\n do {\n if (this.match(types.braceR)) {\n break;\n }\n\n const node = this.startNode();\n const keyName = this.state.value;\n\n if (this.match(types.string)) {\n node.key = this.parseLiteral(keyName, \"StringLiteral\");\n } else {\n node.key = this.parseIdentifier(true);\n }\n\n this.expect(types.colon);\n\n if (keyName !== \"type\") {\n this.raise(node.key.start, ErrorMessages.ModuleAttributeDifferentFromType, keyName);\n }\n\n if (attrNames.has(keyName)) {\n this.raise(node.key.start, ErrorMessages.ModuleAttributesWithDuplicateKeys, keyName);\n }\n\n attrNames.add(keyName);\n\n if (!this.match(types.string)) {\n throw this.unexpected(this.state.start, ErrorMessages.ModuleAttributeInvalidValue);\n }\n\n node.value = this.parseLiteral(this.state.value, \"StringLiteral\");\n this.finishNode(node, \"ImportAttribute\");\n attrs.push(node);\n } while (this.eat(types.comma));\n\n return attrs;\n }\n\n maybeParseModuleAttributes() {\n if (this.match(types._with) && !this.hasPrecedingLineBreak()) {\n this.expectPlugin(\"moduleAttributes\");\n this.next();\n } else {\n if (this.hasPlugin(\"moduleAttributes\")) return [];\n return null;\n }\n\n const attrs = [];\n const attributes = new Set();\n\n do {\n const node = this.startNode();\n node.key = this.parseIdentifier(true);\n\n if (node.key.name !== \"type\") {\n this.raise(node.key.start, ErrorMessages.ModuleAttributeDifferentFromType, node.key.name);\n }\n\n if (attributes.has(node.key.name)) {\n this.raise(node.key.start, ErrorMessages.ModuleAttributesWithDuplicateKeys, node.key.name);\n }\n\n attributes.add(node.key.name);\n this.expect(types.colon);\n\n if (!this.match(types.string)) {\n throw this.unexpected(this.state.start, ErrorMessages.ModuleAttributeInvalidValue);\n }\n\n node.value = this.parseLiteral(this.state.value, \"StringLiteral\");\n this.finishNode(node, \"ImportAttribute\");\n attrs.push(node);\n } while (this.eat(types.comma));\n\n return attrs;\n }\n\n maybeParseImportAssertions() {\n if (this.isContextual(\"assert\") && !this.hasPrecedingLineBreak()) {\n this.expectPlugin(\"importAssertions\");\n this.next();\n } else {\n if (this.hasPlugin(\"importAssertions\")) return [];\n return null;\n }\n\n this.eat(types.braceL);\n const attrs = this.parseAssertEntries();\n this.eat(types.braceR);\n return attrs;\n }\n\n maybeParseDefaultImportSpecifier(node) {\n if (this.shouldParseDefaultImport(node)) {\n this.parseImportSpecifierLocal(node, this.startNode(), \"ImportDefaultSpecifier\", \"default import specifier\");\n return true;\n }\n\n return false;\n }\n\n maybeParseStarImportSpecifier(node) {\n if (this.match(types.star)) {\n const specifier = this.startNode();\n this.next();\n this.expectContextual(\"as\");\n this.parseImportSpecifierLocal(node, specifier, \"ImportNamespaceSpecifier\", \"import namespace specifier\");\n return true;\n }\n\n return false;\n }\n\n parseNamedImportSpecifiers(node) {\n let first = true;\n this.expect(types.braceL);\n\n while (!this.eat(types.braceR)) {\n if (first) {\n first = false;\n } else {\n if (this.eat(types.colon)) {\n throw this.raise(this.state.start, ErrorMessages.DestructureNamedImport);\n }\n\n this.expect(types.comma);\n if (this.eat(types.braceR)) break;\n }\n\n this.parseImportSpecifier(node);\n }\n }\n\n parseImportSpecifier(node) {\n const specifier = this.startNode();\n specifier.imported = this.parseModuleExportName();\n\n if (this.eatContextual(\"as\")) {\n specifier.local = this.parseIdentifier();\n } else {\n const {\n imported\n } = specifier;\n\n if (imported.type === \"StringLiteral\") {\n throw this.raise(specifier.start, ErrorMessages.ImportBindingIsString, imported.value);\n }\n\n this.checkReservedWord(imported.name, specifier.start, true, true);\n specifier.local = imported.__clone();\n }\n\n this.checkLVal(specifier.local, BIND_LEXICAL, undefined, \"import specifier\");\n node.specifiers.push(this.finishNode(specifier, \"ImportSpecifier\"));\n }\n\n}\n\nclass ClassScope {\n constructor() {\n this.privateNames = new Set();\n this.loneAccessors = new Map();\n this.undefinedPrivateNames = new Map();\n }\n\n}\nclass ClassScopeHandler {\n constructor(raise) {\n this.stack = [];\n this.undefinedPrivateNames = new Map();\n this.raise = raise;\n }\n\n current() {\n return this.stack[this.stack.length - 1];\n }\n\n enter() {\n this.stack.push(new ClassScope());\n }\n\n exit() {\n const oldClassScope = this.stack.pop();\n const current = this.current();\n\n for (let _i = 0, _Array$from = Array.from(oldClassScope.undefinedPrivateNames); _i < _Array$from.length; _i++) {\n const [name, pos] = _Array$from[_i];\n\n if (current) {\n if (!current.undefinedPrivateNames.has(name)) {\n current.undefinedPrivateNames.set(name, pos);\n }\n } else {\n this.raise(pos, ErrorMessages.InvalidPrivateFieldResolution, name);\n }\n }\n }\n\n declarePrivateName(name, elementType, pos) {\n const classScope = this.current();\n let redefined = classScope.privateNames.has(name);\n\n if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {\n const accessor = redefined && classScope.loneAccessors.get(name);\n\n if (accessor) {\n const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;\n const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;\n const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR;\n const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;\n redefined = oldKind === newKind || oldStatic !== newStatic;\n if (!redefined) classScope.loneAccessors.delete(name);\n } else if (!redefined) {\n classScope.loneAccessors.set(name, elementType);\n }\n }\n\n if (redefined) {\n this.raise(pos, ErrorMessages.PrivateNameRedeclaration, name);\n }\n\n classScope.privateNames.add(name);\n classScope.undefinedPrivateNames.delete(name);\n }\n\n usePrivateName(name, pos) {\n let classScope;\n\n for (let _i2 = 0, _this$stack = this.stack; _i2 < _this$stack.length; _i2++) {\n classScope = _this$stack[_i2];\n if (classScope.privateNames.has(name)) return;\n }\n\n if (classScope) {\n classScope.undefinedPrivateNames.set(name, pos);\n } else {\n this.raise(pos, ErrorMessages.InvalidPrivateFieldResolution, name);\n }\n }\n\n}\n\nclass Parser extends StatementParser {\n constructor(options, input) {\n options = getOptions(options);\n super(options, input);\n const ScopeHandler = this.getScopeHandler();\n this.options = options;\n this.inModule = this.options.sourceType === \"module\";\n this.scope = new ScopeHandler(this.raise.bind(this), this.inModule);\n this.prodParam = new ProductionParameterHandler();\n this.classScope = new ClassScopeHandler(this.raise.bind(this));\n this.expressionScope = new ExpressionScopeHandler(this.raise.bind(this));\n this.plugins = pluginsMap(this.options.plugins);\n this.filename = options.sourceFilename;\n }\n\n getScopeHandler() {\n return ScopeHandler;\n }\n\n parse() {\n let paramFlags = PARAM;\n\n if (this.hasPlugin(\"topLevelAwait\") && this.inModule) {\n paramFlags |= PARAM_AWAIT;\n }\n\n this.scope.enter(SCOPE_PROGRAM);\n this.prodParam.enter(paramFlags);\n const file = this.startNode();\n const program = this.startNode();\n this.nextToken();\n file.errors = null;\n this.parseTopLevel(file, program);\n file.errors = this.state.errors;\n return file;\n }\n\n}\n\nfunction pluginsMap(plugins) {\n const pluginMap = new Map();\n\n for (let _i = 0; _i < plugins.length; _i++) {\n const plugin = plugins[_i];\n const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];\n if (!pluginMap.has(name)) pluginMap.set(name, options || {});\n }\n\n return pluginMap;\n}\n\nfunction parse(input, options) {\n var _options;\n\n if (((_options = options) == null ? void 0 : _options.sourceType) === \"unambiguous\") {\n options = Object.assign({}, options);\n\n try {\n options.sourceType = \"module\";\n const parser = getParser(options, input);\n const ast = parser.parse();\n\n if (parser.sawUnambiguousESM) {\n return ast;\n }\n\n if (parser.ambiguousScriptDifferentAst) {\n try {\n options.sourceType = \"script\";\n return getParser(options, input).parse();\n } catch (_unused) {}\n } else {\n ast.program.sourceType = \"script\";\n }\n\n return ast;\n } catch (moduleError) {\n try {\n options.sourceType = \"script\";\n return getParser(options, input).parse();\n } catch (_unused2) {}\n\n throw moduleError;\n }\n } else {\n return getParser(options, input).parse();\n }\n}\nfunction parseExpression(input, options) {\n const parser = getParser(options, input);\n\n if (parser.options.strictMode) {\n parser.state.strict = true;\n }\n\n return parser.getExpression();\n}\n\nfunction getParser(options, input) {\n let cls = Parser;\n\n if (options == null ? void 0 : options.plugins) {\n validatePlugins(options.plugins);\n cls = getParserClass(options.plugins);\n }\n\n return new cls(options, input);\n}\n\nconst parserClassCache = {};\n\nfunction getParserClass(pluginsFromOptions) {\n const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name));\n const key = pluginList.join(\"/\");\n let cls = parserClassCache[key];\n\n if (!cls) {\n cls = Parser;\n\n for (let _i = 0; _i < pluginList.length; _i++) {\n const plugin = pluginList[_i];\n cls = mixinPlugins[plugin](cls);\n }\n\n parserClassCache[key] = cls;\n }\n\n return cls;\n}\n\nexports.parse = parse;\nexports.parseExpression = parseExpression;\nexports.tokTypes = types;\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createTemplateBuilder;\n\nvar _options = require(\"./options\");\n\nvar _string = _interopRequireDefault(require(\"./string\"));\n\nvar _literal = _interopRequireDefault(require(\"./literal\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst NO_PLACEHOLDER = (0, _options.validate)({\n placeholderPattern: false\n});\n\nfunction createTemplateBuilder(formatter, defaultOpts) {\n const templateFnCache = new WeakMap();\n const templateAstCache = new WeakMap();\n const cachedOpts = defaultOpts || (0, _options.validate)(null);\n return Object.assign((tpl, ...args) => {\n if (typeof tpl === \"string\") {\n if (args.length > 1) throw new Error(\"Unexpected extra params.\");\n return extendedTrace((0, _string.default)(formatter, tpl, (0, _options.merge)(cachedOpts, (0, _options.validate)(args[0]))));\n } else if (Array.isArray(tpl)) {\n let builder = templateFnCache.get(tpl);\n\n if (!builder) {\n builder = (0, _literal.default)(formatter, tpl, cachedOpts);\n templateFnCache.set(tpl, builder);\n }\n\n return extendedTrace(builder(args));\n } else if (typeof tpl === \"object\" && tpl) {\n if (args.length > 0) throw new Error(\"Unexpected extra params.\");\n return createTemplateBuilder(formatter, (0, _options.merge)(cachedOpts, (0, _options.validate)(tpl)));\n }\n\n throw new Error(`Unexpected template param ${typeof tpl}`);\n }, {\n ast: (tpl, ...args) => {\n if (typeof tpl === \"string\") {\n if (args.length > 1) throw new Error(\"Unexpected extra params.\");\n return (0, _string.default)(formatter, tpl, (0, _options.merge)((0, _options.merge)(cachedOpts, (0, _options.validate)(args[0])), NO_PLACEHOLDER))();\n } else if (Array.isArray(tpl)) {\n let builder = templateAstCache.get(tpl);\n\n if (!builder) {\n builder = (0, _literal.default)(formatter, tpl, (0, _options.merge)(cachedOpts, NO_PLACEHOLDER));\n templateAstCache.set(tpl, builder);\n }\n\n return builder(args)();\n }\n\n throw new Error(`Unexpected template param ${typeof tpl}`);\n }\n });\n}\n\nfunction extendedTrace(fn) {\n let rootStack = \"\";\n\n try {\n throw new Error();\n } catch (error) {\n if (error.stack) {\n rootStack = error.stack.split(\"\\n\").slice(3).join(\"\\n\");\n }\n }\n\n return arg => {\n try {\n return fn(arg);\n } catch (err) {\n err.stack += `\\n =============\\n${rootStack}`;\n throw err;\n }\n };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.program = exports.expression = exports.statement = exports.statements = exports.smart = void 0;\n\nfunction makeStatementFormatter(fn) {\n return {\n code: str => `/* @babel/template */;\\n${str}`,\n validate: () => {},\n unwrap: ast => {\n return fn(ast.program.body.slice(1));\n }\n };\n}\n\nconst smart = makeStatementFormatter(body => {\n if (body.length > 1) {\n return body;\n } else {\n return body[0];\n }\n});\nexports.smart = smart;\nconst statements = makeStatementFormatter(body => body);\nexports.statements = statements;\nconst statement = makeStatementFormatter(body => {\n if (body.length === 0) {\n throw new Error(\"Found nothing to return.\");\n }\n\n if (body.length > 1) {\n throw new Error(\"Found multiple statements but wanted one\");\n }\n\n return body[0];\n});\nexports.statement = statement;\nconst expression = {\n code: str => `(\\n${str}\\n)`,\n validate: ({\n program\n }) => {\n if (program.body.length > 1) {\n throw new Error(\"Found multiple statements but wanted one\");\n }\n\n const expression = program.body[0].expression;\n\n if (expression.start === 0) {\n throw new Error(\"Parse result included parens.\");\n }\n },\n unwrap: ast => ast.program.body[0].expression\n};\nexports.expression = expression;\nconst program = {\n code: str => str,\n validate: () => {},\n unwrap: ast => ast.program\n};\nexports.program = program;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.program = exports.expression = exports.statements = exports.statement = exports.smart = void 0;\n\nvar formatters = _interopRequireWildcard(require(\"./formatters\"));\n\nvar _builder = _interopRequireDefault(require(\"./builder\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nconst smart = (0, _builder.default)(formatters.smart);\nexports.smart = smart;\nconst statement = (0, _builder.default)(formatters.statement);\nexports.statement = statement;\nconst statements = (0, _builder.default)(formatters.statements);\nexports.statements = statements;\nconst expression = (0, _builder.default)(formatters.expression);\nexports.expression = expression;\nconst program = (0, _builder.default)(formatters.program);\nexports.program = program;\n\nvar _default = Object.assign(smart.bind(undefined), {\n smart,\n statement,\n statements,\n expression,\n program,\n ast: smart.ast\n});\n\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = literalTemplate;\n\nvar _options = require(\"./options\");\n\nvar _parse = _interopRequireDefault(require(\"./parse\"));\n\nvar _populate = _interopRequireDefault(require(\"./populate\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction literalTemplate(formatter, tpl, opts) {\n const {\n metadata,\n names\n } = buildLiteralData(formatter, tpl, opts);\n return arg => {\n const defaultReplacements = arg.reduce((acc, replacement, i) => {\n acc[names[i]] = replacement;\n return acc;\n }, {});\n return arg => {\n const replacements = (0, _options.normalizeReplacements)(arg);\n\n if (replacements) {\n Object.keys(replacements).forEach(key => {\n if (Object.prototype.hasOwnProperty.call(defaultReplacements, key)) {\n throw new Error(\"Unexpected replacement overlap.\");\n }\n });\n }\n\n return formatter.unwrap((0, _populate.default)(metadata, replacements ? Object.assign(replacements, defaultReplacements) : defaultReplacements));\n };\n };\n}\n\nfunction buildLiteralData(formatter, tpl, opts) {\n let names;\n let nameSet;\n let metadata;\n let prefix = \"\";\n\n do {\n prefix += \"$\";\n const result = buildTemplateCode(tpl, prefix);\n names = result.names;\n nameSet = new Set(names);\n metadata = (0, _parse.default)(formatter, formatter.code(result.code), {\n parser: opts.parser,\n placeholderWhitelist: new Set(result.names.concat(opts.placeholderWhitelist ? Array.from(opts.placeholderWhitelist) : [])),\n placeholderPattern: opts.placeholderPattern,\n preserveComments: opts.preserveComments,\n syntacticPlaceholders: opts.syntacticPlaceholders\n });\n } while (metadata.placeholders.some(placeholder => placeholder.isDuplicate && nameSet.has(placeholder.name)));\n\n return {\n metadata,\n names\n };\n}\n\nfunction buildTemplateCode(tpl, prefix) {\n const names = [];\n let code = tpl[0];\n\n for (let i = 1; i < tpl.length; i++) {\n const value = `${prefix}${i - 1}`;\n names.push(value);\n code += value + tpl[i];\n }\n\n return {\n names,\n code\n };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.merge = merge;\nexports.validate = validate;\nexports.normalizeReplacements = normalizeReplacements;\n\nfunction _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; }\n\nfunction merge(a, b) {\n const {\n placeholderWhitelist = a.placeholderWhitelist,\n placeholderPattern = a.placeholderPattern,\n preserveComments = a.preserveComments,\n syntacticPlaceholders = a.syntacticPlaceholders\n } = b;\n return {\n parser: Object.assign({}, a.parser, b.parser),\n placeholderWhitelist,\n placeholderPattern,\n preserveComments,\n syntacticPlaceholders\n };\n}\n\nfunction validate(opts) {\n if (opts != null && typeof opts !== \"object\") {\n throw new Error(\"Unknown template options.\");\n }\n\n const _ref = opts || {},\n {\n placeholderWhitelist,\n placeholderPattern,\n preserveComments,\n syntacticPlaceholders\n } = _ref,\n parser = _objectWithoutPropertiesLoose(_ref, [\"placeholderWhitelist\", \"placeholderPattern\", \"preserveComments\", \"syntacticPlaceholders\"]);\n\n if (placeholderWhitelist != null && !(placeholderWhitelist instanceof Set)) {\n throw new Error(\"'.placeholderWhitelist' must be a Set, null, or undefined\");\n }\n\n if (placeholderPattern != null && !(placeholderPattern instanceof RegExp) && placeholderPattern !== false) {\n throw new Error(\"'.placeholderPattern' must be a RegExp, false, null, or undefined\");\n }\n\n if (preserveComments != null && typeof preserveComments !== \"boolean\") {\n throw new Error(\"'.preserveComments' must be a boolean, null, or undefined\");\n }\n\n if (syntacticPlaceholders != null && typeof syntacticPlaceholders !== \"boolean\") {\n throw new Error(\"'.syntacticPlaceholders' must be a boolean, null, or undefined\");\n }\n\n if (syntacticPlaceholders === true && (placeholderWhitelist != null || placeholderPattern != null)) {\n throw new Error(\"'.placeholderWhitelist' and '.placeholderPattern' aren't compatible\" + \" with '.syntacticPlaceholders: true'\");\n }\n\n return {\n parser,\n placeholderWhitelist: placeholderWhitelist || undefined,\n placeholderPattern: placeholderPattern == null ? undefined : placeholderPattern,\n preserveComments: preserveComments == null ? undefined : preserveComments,\n syntacticPlaceholders: syntacticPlaceholders == null ? undefined : syntacticPlaceholders\n };\n}\n\nfunction normalizeReplacements(replacements) {\n if (Array.isArray(replacements)) {\n return replacements.reduce((acc, replacement, i) => {\n acc[\"$\" + i] = replacement;\n return acc;\n }, {});\n } else if (typeof replacements === \"object\" || replacements == null) {\n return replacements || undefined;\n }\n\n throw new Error(\"Template replacements must be an array, object, null, or undefined\");\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = parseAndBuildMetadata;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar _parser = require(\"@babel/parser\");\n\nvar _codeFrame = require(\"@babel/code-frame\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nconst PATTERN = /^[_$A-Z0-9]+$/;\n\nfunction parseAndBuildMetadata(formatter, code, opts) {\n const {\n placeholderWhitelist,\n placeholderPattern,\n preserveComments,\n syntacticPlaceholders\n } = opts;\n const ast = parseWithCodeFrame(code, opts.parser, syntacticPlaceholders);\n t.removePropertiesDeep(ast, {\n preserveComments\n });\n formatter.validate(ast);\n const syntactic = {\n placeholders: [],\n placeholderNames: new Set()\n };\n const legacy = {\n placeholders: [],\n placeholderNames: new Set()\n };\n const isLegacyRef = {\n value: undefined\n };\n t.traverse(ast, placeholderVisitorHandler, {\n syntactic,\n legacy,\n isLegacyRef,\n placeholderWhitelist,\n placeholderPattern,\n syntacticPlaceholders\n });\n return Object.assign({\n ast\n }, isLegacyRef.value ? legacy : syntactic);\n}\n\nfunction placeholderVisitorHandler(node, ancestors, state) {\n var _state$placeholderWhi;\n\n let name;\n\n if (t.isPlaceholder(node)) {\n if (state.syntacticPlaceholders === false) {\n throw new Error(\"%%foo%%-style placeholders can't be used when \" + \"'.syntacticPlaceholders' is false.\");\n } else {\n name = node.name.name;\n state.isLegacyRef.value = false;\n }\n } else if (state.isLegacyRef.value === false || state.syntacticPlaceholders) {\n return;\n } else if (t.isIdentifier(node) || t.isJSXIdentifier(node)) {\n name = node.name;\n state.isLegacyRef.value = true;\n } else if (t.isStringLiteral(node)) {\n name = node.value;\n state.isLegacyRef.value = true;\n } else {\n return;\n }\n\n if (!state.isLegacyRef.value && (state.placeholderPattern != null || state.placeholderWhitelist != null)) {\n throw new Error(\"'.placeholderWhitelist' and '.placeholderPattern' aren't compatible\" + \" with '.syntacticPlaceholders: true'\");\n }\n\n if (state.isLegacyRef.value && (state.placeholderPattern === false || !(state.placeholderPattern || PATTERN).test(name)) && !((_state$placeholderWhi = state.placeholderWhitelist) == null ? void 0 : _state$placeholderWhi.has(name))) {\n return;\n }\n\n ancestors = ancestors.slice();\n const {\n node: parent,\n key\n } = ancestors[ancestors.length - 1];\n let type;\n\n if (t.isStringLiteral(node) || t.isPlaceholder(node, {\n expectedNode: \"StringLiteral\"\n })) {\n type = \"string\";\n } else if (t.isNewExpression(parent) && key === \"arguments\" || t.isCallExpression(parent) && key === \"arguments\" || t.isFunction(parent) && key === \"params\") {\n type = \"param\";\n } else if (t.isExpressionStatement(parent) && !t.isPlaceholder(node)) {\n type = \"statement\";\n ancestors = ancestors.slice(0, -1);\n } else if (t.isStatement(node) && t.isPlaceholder(node)) {\n type = \"statement\";\n } else {\n type = \"other\";\n }\n\n const {\n placeholders,\n placeholderNames\n } = state.isLegacyRef.value ? state.legacy : state.syntactic;\n placeholders.push({\n name,\n type,\n resolve: ast => resolveAncestors(ast, ancestors),\n isDuplicate: placeholderNames.has(name)\n });\n placeholderNames.add(name);\n}\n\nfunction resolveAncestors(ast, ancestors) {\n let parent = ast;\n\n for (let i = 0; i < ancestors.length - 1; i++) {\n const {\n key,\n index\n } = ancestors[i];\n\n if (index === undefined) {\n parent = parent[key];\n } else {\n parent = parent[key][index];\n }\n }\n\n const {\n key,\n index\n } = ancestors[ancestors.length - 1];\n return {\n parent,\n key,\n index\n };\n}\n\nfunction parseWithCodeFrame(code, parserOpts, syntacticPlaceholders) {\n const plugins = (parserOpts.plugins || []).slice();\n\n if (syntacticPlaceholders !== false) {\n plugins.push(\"placeholders\");\n }\n\n parserOpts = Object.assign({\n allowReturnOutsideFunction: true,\n allowSuperOutsideMethod: true,\n sourceType: \"module\"\n }, parserOpts, {\n plugins\n });\n\n try {\n return (0, _parser.parse)(code, parserOpts);\n } catch (err) {\n const loc = err.loc;\n\n if (loc) {\n err.message += \"\\n\" + (0, _codeFrame.codeFrameColumns)(code, {\n start: loc\n });\n err.code = \"BABEL_TEMPLATE_PARSE_ERROR\";\n }\n\n throw err;\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = populatePlaceholders;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction populatePlaceholders(metadata, replacements) {\n const ast = t.cloneNode(metadata.ast);\n\n if (replacements) {\n metadata.placeholders.forEach(placeholder => {\n if (!Object.prototype.hasOwnProperty.call(replacements, placeholder.name)) {\n const placeholderName = placeholder.name;\n throw new Error(`Error: No substitution given for \"${placeholderName}\". If this is not meant to be a\n placeholder you may want to consider passing one of the following options to @babel/template:\n - { placeholderPattern: false, placeholderWhitelist: new Set(['${placeholderName}'])}\n - { placeholderPattern: /^${placeholderName}$/ }`);\n }\n });\n Object.keys(replacements).forEach(key => {\n if (!metadata.placeholderNames.has(key)) {\n throw new Error(`Unknown substitution \"${key}\" given`);\n }\n });\n }\n\n metadata.placeholders.slice().reverse().forEach(placeholder => {\n try {\n applyReplacement(placeholder, ast, replacements && replacements[placeholder.name] || null);\n } catch (e) {\n e.message = `@babel/template placeholder \"${placeholder.name}\": ${e.message}`;\n throw e;\n }\n });\n return ast;\n}\n\nfunction applyReplacement(placeholder, ast, replacement) {\n if (placeholder.isDuplicate) {\n if (Array.isArray(replacement)) {\n replacement = replacement.map(node => t.cloneNode(node));\n } else if (typeof replacement === \"object\") {\n replacement = t.cloneNode(replacement);\n }\n }\n\n const {\n parent,\n key,\n index\n } = placeholder.resolve(ast);\n\n if (placeholder.type === \"string\") {\n if (typeof replacement === \"string\") {\n replacement = t.stringLiteral(replacement);\n }\n\n if (!replacement || !t.isStringLiteral(replacement)) {\n throw new Error(\"Expected string substitution\");\n }\n } else if (placeholder.type === \"statement\") {\n if (index === undefined) {\n if (!replacement) {\n replacement = t.emptyStatement();\n } else if (Array.isArray(replacement)) {\n replacement = t.blockStatement(replacement);\n } else if (typeof replacement === \"string\") {\n replacement = t.expressionStatement(t.identifier(replacement));\n } else if (!t.isStatement(replacement)) {\n replacement = t.expressionStatement(replacement);\n }\n } else {\n if (replacement && !Array.isArray(replacement)) {\n if (typeof replacement === \"string\") {\n replacement = t.identifier(replacement);\n }\n\n if (!t.isStatement(replacement)) {\n replacement = t.expressionStatement(replacement);\n }\n }\n }\n } else if (placeholder.type === \"param\") {\n if (typeof replacement === \"string\") {\n replacement = t.identifier(replacement);\n }\n\n if (index === undefined) throw new Error(\"Assertion failure.\");\n } else {\n if (typeof replacement === \"string\") {\n replacement = t.identifier(replacement);\n }\n\n if (Array.isArray(replacement)) {\n throw new Error(\"Cannot replace single expression with an array.\");\n }\n }\n\n if (index === undefined) {\n t.validate(parent, key, replacement);\n parent[key] = replacement;\n } else {\n const items = parent[key].slice();\n\n if (placeholder.type === \"statement\" || placeholder.type === \"param\") {\n if (replacement == null) {\n items.splice(index, 1);\n } else if (Array.isArray(replacement)) {\n items.splice(index, 1, ...replacement);\n } else {\n items[index] = replacement;\n }\n } else {\n items[index] = replacement;\n }\n\n t.validate(parent, key, items);\n parent[key] = items;\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = stringTemplate;\n\nvar _options = require(\"./options\");\n\nvar _parse = _interopRequireDefault(require(\"./parse\"));\n\nvar _populate = _interopRequireDefault(require(\"./populate\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction stringTemplate(formatter, code, opts) {\n code = formatter.code(code);\n let metadata;\n return arg => {\n const replacements = (0, _options.normalizeReplacements)(arg);\n if (!metadata) metadata = (0, _parse.default)(formatter, code, opts);\n return formatter.unwrap((0, _populate.default)(metadata, replacements));\n };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.codeFrameColumns = codeFrameColumns;\nexports.default = _default;\n\nvar _highlight = _interopRequireWildcard(require(\"@babel/highlight\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nlet deprecationWarningShown = false;\n\nfunction getDefs(chalk) {\n return {\n gutter: chalk.grey,\n marker: chalk.red.bold,\n message: chalk.red.bold\n };\n}\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\nfunction getMarkerLines(loc, source, opts) {\n const startLoc = Object.assign({\n column: 0,\n line: -1\n }, loc.start);\n const endLoc = Object.assign({}, startLoc, loc.end);\n const {\n linesAbove = 2,\n linesBelow = 3\n } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n\n if (startLine === -1) {\n start = 0;\n }\n\n if (endLine === -1) {\n end = source.length;\n }\n\n const lineDiff = endLine - startLine;\n const markerLines = {};\n\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n\n return {\n start,\n end,\n markerLines\n };\n}\n\nfunction codeFrameColumns(rawLines, loc, opts = {}) {\n const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);\n const chalk = (0, _highlight.getChalk)(opts);\n const defs = getDefs(chalk);\n\n const maybeHighlight = (chalkFn, string) => {\n return highlighted ? chalkFn(string) : string;\n };\n\n const lines = rawLines.split(NEWLINE);\n const {\n start,\n end,\n markerLines\n } = getMarkerLines(loc, lines, opts);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n const numberMaxWidth = String(end).length;\n const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;\n let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} | `;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n\n if (hasMarker) {\n let markerLine = \"\";\n\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n markerLine = [\"\\n \", maybeHighlight(defs.gutter, gutter.replace(/\\d/g, \" \")), markerSpacing, maybeHighlight(defs.marker, \"^\").repeat(numberOfMarkers)].join(\"\");\n\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + maybeHighlight(defs.message, opts.message);\n }\n }\n\n return [maybeHighlight(defs.marker, \">\"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(\"\");\n } else {\n return ` ${maybeHighlight(defs.gutter, gutter)}${line}`;\n }\n }).join(\"\\n\");\n\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n\n if (highlighted) {\n return chalk.reset(frame);\n } else {\n return frame;\n }\n}\n\nfunction _default(rawLines, lineNumber, colNumber, opts = {}) {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n const message = \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n\n if (process.emitWarning) {\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n\n colNumber = Math.max(colNumber, 0);\n const location = {\n start: {\n column: colNumber,\n line: lineNumber\n }\n };\n return codeFrameColumns(rawLines, location, opts);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isIdentifierStart = isIdentifierStart;\nexports.isIdentifierChar = isIdentifierChar;\nexports.isIdentifierName = isIdentifierName;\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u08a0-\\u08b4\\u08b6-\\u08c7\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\u9ffc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7bf\\ua7c2-\\ua7ca\\ua7f5-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u08d3-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf\\u1ac0\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1df9\\u1dfb-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\nconst nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\nconst nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\nconst astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];\nconst astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n\nfunction isInAstralSet(code, set) {\n let pos = 0x10000;\n\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n\n return false;\n}\n\nfunction isIdentifierStart(code) {\n if (code < 65) return code === 36;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));\n }\n\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\nfunction isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}\n\nfunction isIdentifierName(name) {\n let isFirst = true;\n\n for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) {\n const char = _Array$from[_i];\n const cp = char.codePointAt(0);\n\n if (isFirst) {\n if (!isIdentifierStart(cp)) {\n return false;\n }\n\n isFirst = false;\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n\n return !isFirst;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"isIdentifierName\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierName;\n }\n});\nObject.defineProperty(exports, \"isIdentifierChar\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierChar;\n }\n});\nObject.defineProperty(exports, \"isIdentifierStart\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierStart;\n }\n});\nObject.defineProperty(exports, \"isReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictBindOnlyReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictBindOnlyReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictBindReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictBindReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictReservedWord;\n }\n});\nObject.defineProperty(exports, \"isKeyword\", {\n enumerable: true,\n get: function () {\n return _keyword.isKeyword;\n }\n});\n\nvar _identifier = require(\"./identifier\");\n\nvar _keyword = require(\"./keyword\");","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isReservedWord = isReservedWord;\nexports.isStrictReservedWord = isStrictReservedWord;\nexports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;\nexports.isStrictBindReservedWord = isStrictBindReservedWord;\nexports.isKeyword = isKeyword;\nconst reservedWords = {\n keyword: [\"break\", \"case\", \"catch\", \"continue\", \"debugger\", \"default\", \"do\", \"else\", \"finally\", \"for\", \"function\", \"if\", \"return\", \"switch\", \"throw\", \"try\", \"var\", \"const\", \"while\", \"with\", \"new\", \"this\", \"super\", \"class\", \"extends\", \"export\", \"import\", \"null\", \"true\", \"false\", \"in\", \"instanceof\", \"typeof\", \"void\", \"delete\"],\n strict: [\"implements\", \"interface\", \"let\", \"package\", \"private\", \"protected\", \"public\", \"static\", \"yield\"],\n strictBind: [\"eval\", \"arguments\"]\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\nfunction isReservedWord(word, inModule) {\n return inModule && word === \"await\" || word === \"enum\";\n}\n\nfunction isStrictReservedWord(word, inModule) {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\nfunction isStrictBindOnlyReservedWord(word) {\n return reservedWordsStrictBindSet.has(word);\n}\n\nfunction isStrictBindReservedWord(word, inModule) {\n return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);\n}\n\nfunction isKeyword(word) {\n return keywords.has(word);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.shouldHighlight = shouldHighlight;\nexports.getChalk = getChalk;\nexports.default = highlight;\n\nvar _jsTokens = _interopRequireWildcard(require(\"js-tokens\"));\n\nvar _helperValidatorIdentifier = require(\"@babel/helper-validator-identifier\");\n\nvar _chalk = _interopRequireDefault(require(\"chalk\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction getDefs(chalk) {\n return {\n keyword: chalk.cyan,\n capitalized: chalk.yellow,\n jsx_tag: chalk.yellow,\n punctuator: chalk.yellow,\n number: chalk.magenta,\n string: chalk.green,\n regex: chalk.magenta,\n comment: chalk.grey,\n invalid: chalk.white.bgRed.bold\n };\n}\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\nconst JSX_TAG = /^[a-z][\\w-]*$/i;\nconst BRACKET = /^[()[\\]{}]$/;\n\nfunction getTokenType(match) {\n const [offset, text] = match.slice(-2);\n const token = (0, _jsTokens.matchToToken)(match);\n\n if (token.type === \"name\") {\n if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isReservedWord)(token.value)) {\n return \"keyword\";\n }\n\n if (JSX_TAG.test(token.value) && (text[offset - 1] === \"<\" || text.substr(offset - 2, 2) == \" colorize(str)).join(\"\\n\");\n } else {\n return args[0];\n }\n });\n}\n\nfunction shouldHighlight(options) {\n return _chalk.default.supportsColor || options.forceColor;\n}\n\nfunction getChalk(options) {\n let chalk = _chalk.default;\n\n if (options.forceColor) {\n chalk = new _chalk.default.constructor({\n enabled: true,\n level: 1\n });\n }\n\n return chalk;\n}\n\nfunction highlight(code, options = {}) {\n if (shouldHighlight(options)) {\n const chalk = getChalk(options);\n const defs = getDefs(chalk);\n return highlightTokens(defs, code);\n } else {\n return code;\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.clear = clear;\nexports.clearPath = clearPath;\nexports.clearScope = clearScope;\nexports.scope = exports.path = void 0;\nlet path = new WeakMap();\nexports.path = path;\nlet scope = new WeakMap();\nexports.scope = scope;\n\nfunction clear() {\n clearPath();\n clearScope();\n}\n\nfunction clearPath() {\n exports.path = path = new WeakMap();\n}\n\nfunction clearScope() {\n exports.scope = scope = new WeakMap();\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _path = _interopRequireDefault(require(\"./path\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst testing = process.env.NODE_ENV === \"test\";\n\nclass TraversalContext {\n constructor(scope, opts, state, parentPath) {\n this.queue = null;\n this.parentPath = parentPath;\n this.scope = scope;\n this.state = state;\n this.opts = opts;\n }\n\n shouldVisit(node) {\n const opts = this.opts;\n if (opts.enter || opts.exit) return true;\n if (opts[node.type]) return true;\n const keys = t.VISITOR_KEYS[node.type];\n if (!(keys == null ? void 0 : keys.length)) return false;\n\n for (const key of keys) {\n if (node[key]) return true;\n }\n\n return false;\n }\n\n create(node, obj, key, listKey) {\n return _path.default.get({\n parentPath: this.parentPath,\n parent: node,\n container: obj,\n key: key,\n listKey\n });\n }\n\n maybeQueue(path, notPriority) {\n if (this.trap) {\n throw new Error(\"Infinite cycle detected\");\n }\n\n if (this.queue) {\n if (notPriority) {\n this.queue.push(path);\n } else {\n this.priorityQueue.push(path);\n }\n }\n }\n\n visitMultiple(container, parent, listKey) {\n if (container.length === 0) return false;\n const queue = [];\n\n for (let key = 0; key < container.length; key++) {\n const node = container[key];\n\n if (node && this.shouldVisit(node)) {\n queue.push(this.create(parent, container, key, listKey));\n }\n }\n\n return this.visitQueue(queue);\n }\n\n visitSingle(node, key) {\n if (this.shouldVisit(node[key])) {\n return this.visitQueue([this.create(node, node, key)]);\n } else {\n return false;\n }\n }\n\n visitQueue(queue) {\n this.queue = queue;\n this.priorityQueue = [];\n const visited = [];\n let stop = false;\n\n for (const path of queue) {\n path.resync();\n\n if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) {\n path.pushContext(this);\n }\n\n if (path.key === null) continue;\n\n if (testing && queue.length >= 10000) {\n this.trap = true;\n }\n\n if (visited.indexOf(path.node) >= 0) continue;\n visited.push(path.node);\n\n if (path.visit()) {\n stop = true;\n break;\n }\n\n if (this.priorityQueue.length) {\n stop = this.visitQueue(this.priorityQueue);\n this.priorityQueue = [];\n this.queue = queue;\n if (stop) break;\n }\n }\n\n for (const path of queue) {\n path.popContext();\n }\n\n this.queue = null;\n return stop;\n }\n\n visit(node, key) {\n const nodes = node[key];\n if (!nodes) return false;\n\n if (Array.isArray(nodes)) {\n return this.visitMultiple(nodes, node, key);\n } else {\n return this.visitSingle(node, key);\n }\n }\n\n}\n\nexports.default = TraversalContext;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nclass Hub {\n getCode() {}\n\n getScope() {}\n\n addHelper() {\n throw new Error(\"Helpers are not supported by the default hub.\");\n }\n\n buildError(node, msg, Error = TypeError) {\n return new Error(msg);\n }\n\n}\n\nexports.default = Hub;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = traverse;\nObject.defineProperty(exports, \"NodePath\", {\n enumerable: true,\n get: function () {\n return _path.default;\n }\n});\nObject.defineProperty(exports, \"Scope\", {\n enumerable: true,\n get: function () {\n return _scope.default;\n }\n});\nObject.defineProperty(exports, \"Hub\", {\n enumerable: true,\n get: function () {\n return _hub.default;\n }\n});\nexports.visitors = void 0;\n\nvar _context = _interopRequireDefault(require(\"./context\"));\n\nvar visitors = _interopRequireWildcard(require(\"./visitors\"));\n\nexports.visitors = visitors;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar cache = _interopRequireWildcard(require(\"./cache\"));\n\nvar _path = _interopRequireDefault(require(\"./path\"));\n\nvar _scope = _interopRequireDefault(require(\"./scope\"));\n\nvar _hub = _interopRequireDefault(require(\"./hub\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction traverse(parent, opts, scope, state, parentPath) {\n if (!parent) return;\n if (!opts) opts = {};\n\n if (!opts.noScope && !scope) {\n if (parent.type !== \"Program\" && parent.type !== \"File\") {\n throw new Error(\"You must pass a scope and parentPath unless traversing a Program/File. \" + `Instead of that you tried to traverse a ${parent.type} node without ` + \"passing scope and parentPath.\");\n }\n }\n\n if (!t.VISITOR_KEYS[parent.type]) {\n return;\n }\n\n visitors.explode(opts);\n traverse.node(parent, opts, scope, state, parentPath);\n}\n\ntraverse.visitors = visitors;\ntraverse.verify = visitors.verify;\ntraverse.explode = visitors.explode;\n\ntraverse.cheap = function (node, enter) {\n return t.traverseFast(node, enter);\n};\n\ntraverse.node = function (node, opts, scope, state, parentPath, skipKeys) {\n const keys = t.VISITOR_KEYS[node.type];\n if (!keys) return;\n const context = new _context.default(scope, opts, state, parentPath);\n\n for (const key of keys) {\n if (skipKeys && skipKeys[key]) continue;\n if (context.visit(node, key)) return;\n }\n};\n\ntraverse.clearNode = function (node, opts) {\n t.removeProperties(node, opts);\n cache.path.delete(node);\n};\n\ntraverse.removeProperties = function (tree, opts) {\n t.traverseFast(tree, traverse.clearNode, opts);\n return tree;\n};\n\nfunction hasDenylistedType(path, state) {\n if (path.node.type === state.type) {\n state.has = true;\n path.stop();\n }\n}\n\ntraverse.hasType = function (tree, type, denylistTypes) {\n if (denylistTypes == null ? void 0 : denylistTypes.includes(tree.type)) return false;\n if (tree.type === type) return true;\n const state = {\n has: false,\n type: type\n };\n traverse(tree, {\n noScope: true,\n denylist: denylistTypes,\n enter: hasDenylistedType\n }, null, state);\n return state.has;\n};\n\ntraverse.cache = cache;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.findParent = findParent;\nexports.find = find;\nexports.getFunctionParent = getFunctionParent;\nexports.getStatementParent = getStatementParent;\nexports.getEarliestCommonAncestorFrom = getEarliestCommonAncestorFrom;\nexports.getDeepestCommonAncestorFrom = getDeepestCommonAncestorFrom;\nexports.getAncestry = getAncestry;\nexports.isAncestor = isAncestor;\nexports.isDescendant = isDescendant;\nexports.inType = inType;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar _index = _interopRequireDefault(require(\"./index\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction findParent(callback) {\n let path = this;\n\n while (path = path.parentPath) {\n if (callback(path)) return path;\n }\n\n return null;\n}\n\nfunction find(callback) {\n let path = this;\n\n do {\n if (callback(path)) return path;\n } while (path = path.parentPath);\n\n return null;\n}\n\nfunction getFunctionParent() {\n return this.findParent(p => p.isFunction());\n}\n\nfunction getStatementParent() {\n let path = this;\n\n do {\n if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {\n break;\n } else {\n path = path.parentPath;\n }\n } while (path);\n\n if (path && (path.isProgram() || path.isFile())) {\n throw new Error(\"File/Program node, we can't possibly find a statement parent to this\");\n }\n\n return path;\n}\n\nfunction getEarliestCommonAncestorFrom(paths) {\n return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) {\n let earliest;\n const keys = t.VISITOR_KEYS[deepest.type];\n\n for (const ancestry of ancestries) {\n const path = ancestry[i + 1];\n\n if (!earliest) {\n earliest = path;\n continue;\n }\n\n if (path.listKey && earliest.listKey === path.listKey) {\n if (path.key < earliest.key) {\n earliest = path;\n continue;\n }\n }\n\n const earliestKeyIndex = keys.indexOf(earliest.parentKey);\n const currentKeyIndex = keys.indexOf(path.parentKey);\n\n if (earliestKeyIndex > currentKeyIndex) {\n earliest = path;\n }\n }\n\n return earliest;\n });\n}\n\nfunction getDeepestCommonAncestorFrom(paths, filter) {\n if (!paths.length) {\n return this;\n }\n\n if (paths.length === 1) {\n return paths[0];\n }\n\n let minDepth = Infinity;\n let lastCommonIndex, lastCommon;\n const ancestries = paths.map(path => {\n const ancestry = [];\n\n do {\n ancestry.unshift(path);\n } while ((path = path.parentPath) && path !== this);\n\n if (ancestry.length < minDepth) {\n minDepth = ancestry.length;\n }\n\n return ancestry;\n });\n const first = ancestries[0];\n\n depthLoop: for (let i = 0; i < minDepth; i++) {\n const shouldMatch = first[i];\n\n for (const ancestry of ancestries) {\n if (ancestry[i] !== shouldMatch) {\n break depthLoop;\n }\n }\n\n lastCommonIndex = i;\n lastCommon = shouldMatch;\n }\n\n if (lastCommon) {\n if (filter) {\n return filter(lastCommon, lastCommonIndex, ancestries);\n } else {\n return lastCommon;\n }\n } else {\n throw new Error(\"Couldn't find intersection\");\n }\n}\n\nfunction getAncestry() {\n let path = this;\n const paths = [];\n\n do {\n paths.push(path);\n } while (path = path.parentPath);\n\n return paths;\n}\n\nfunction isAncestor(maybeDescendant) {\n return maybeDescendant.isDescendant(this);\n}\n\nfunction isDescendant(maybeAncestor) {\n return !!this.findParent(parent => parent === maybeAncestor);\n}\n\nfunction inType() {\n let path = this;\n\n while (path) {\n for (const type of arguments) {\n if (path.node.type === type) return true;\n }\n\n path = path.parentPath;\n }\n\n return false;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.shareCommentsWithSiblings = shareCommentsWithSiblings;\nexports.addComment = addComment;\nexports.addComments = addComments;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction shareCommentsWithSiblings() {\n if (typeof this.key === \"string\") return;\n const node = this.node;\n if (!node) return;\n const trailing = node.trailingComments;\n const leading = node.leadingComments;\n if (!trailing && !leading) return;\n const prev = this.getSibling(this.key - 1);\n const next = this.getSibling(this.key + 1);\n const hasPrev = Boolean(prev.node);\n const hasNext = Boolean(next.node);\n\n if (hasPrev && !hasNext) {\n prev.addComments(\"trailing\", trailing);\n } else if (hasNext && !hasPrev) {\n next.addComments(\"leading\", leading);\n }\n}\n\nfunction addComment(type, content, line) {\n t.addComment(this.node, type, content, line);\n}\n\nfunction addComments(type, comments) {\n t.addComments(this.node, type, comments);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.call = call;\nexports._call = _call;\nexports.isBlacklisted = exports.isDenylisted = isDenylisted;\nexports.visit = visit;\nexports.skip = skip;\nexports.skipKey = skipKey;\nexports.stop = stop;\nexports.setScope = setScope;\nexports.setContext = setContext;\nexports.resync = resync;\nexports._resyncParent = _resyncParent;\nexports._resyncKey = _resyncKey;\nexports._resyncList = _resyncList;\nexports._resyncRemoved = _resyncRemoved;\nexports.popContext = popContext;\nexports.pushContext = pushContext;\nexports.setup = setup;\nexports.setKey = setKey;\nexports.requeue = requeue;\nexports._getQueueContexts = _getQueueContexts;\n\nvar _index = _interopRequireDefault(require(\"../index\"));\n\nvar _index2 = require(\"./index\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction call(key) {\n const opts = this.opts;\n this.debug(key);\n\n if (this.node) {\n if (this._call(opts[key])) return true;\n }\n\n if (this.node) {\n return this._call(opts[this.node.type] && opts[this.node.type][key]);\n }\n\n return false;\n}\n\nfunction _call(fns) {\n if (!fns) return false;\n\n for (const fn of fns) {\n if (!fn) continue;\n const node = this.node;\n if (!node) return true;\n const ret = fn.call(this.state, this, this.state);\n\n if (ret && typeof ret === \"object\" && typeof ret.then === \"function\") {\n throw new Error(`You appear to be using a plugin with an async traversal visitor, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`);\n }\n\n if (ret) {\n throw new Error(`Unexpected return value from visitor method ${fn}`);\n }\n\n if (this.node !== node) return true;\n if (this._traverseFlags > 0) return true;\n }\n\n return false;\n}\n\nfunction isDenylisted() {\n var _this$opts$denylist;\n\n const denylist = (_this$opts$denylist = this.opts.denylist) != null ? _this$opts$denylist : this.opts.blacklist;\n return denylist && denylist.indexOf(this.node.type) > -1;\n}\n\nfunction visit() {\n if (!this.node) {\n return false;\n }\n\n if (this.isDenylisted()) {\n return false;\n }\n\n if (this.opts.shouldSkip && this.opts.shouldSkip(this)) {\n return false;\n }\n\n if (this.shouldSkip || this.call(\"enter\") || this.shouldSkip) {\n this.debug(\"Skip...\");\n return this.shouldStop;\n }\n\n this.debug(\"Recursing into...\");\n\n _index.default.node(this.node, this.opts, this.scope, this.state, this, this.skipKeys);\n\n this.call(\"exit\");\n return this.shouldStop;\n}\n\nfunction skip() {\n this.shouldSkip = true;\n}\n\nfunction skipKey(key) {\n if (this.skipKeys == null) {\n this.skipKeys = {};\n }\n\n this.skipKeys[key] = true;\n}\n\nfunction stop() {\n this._traverseFlags |= _index2.SHOULD_SKIP | _index2.SHOULD_STOP;\n}\n\nfunction setScope() {\n if (this.opts && this.opts.noScope) return;\n let path = this.parentPath;\n let target;\n\n while (path && !target) {\n if (path.opts && path.opts.noScope) return;\n target = path.scope;\n path = path.parentPath;\n }\n\n this.scope = this.getScope(target);\n if (this.scope) this.scope.init();\n}\n\nfunction setContext(context) {\n if (this.skipKeys != null) {\n this.skipKeys = {};\n }\n\n this._traverseFlags = 0;\n\n if (context) {\n this.context = context;\n this.state = context.state;\n this.opts = context.opts;\n }\n\n this.setScope();\n return this;\n}\n\nfunction resync() {\n if (this.removed) return;\n\n this._resyncParent();\n\n this._resyncList();\n\n this._resyncKey();\n}\n\nfunction _resyncParent() {\n if (this.parentPath) {\n this.parent = this.parentPath.node;\n }\n}\n\nfunction _resyncKey() {\n if (!this.container) return;\n if (this.node === this.container[this.key]) return;\n\n if (Array.isArray(this.container)) {\n for (let i = 0; i < this.container.length; i++) {\n if (this.container[i] === this.node) {\n return this.setKey(i);\n }\n }\n } else {\n for (const key of Object.keys(this.container)) {\n if (this.container[key] === this.node) {\n return this.setKey(key);\n }\n }\n }\n\n this.key = null;\n}\n\nfunction _resyncList() {\n if (!this.parent || !this.inList) return;\n const newContainer = this.parent[this.listKey];\n if (this.container === newContainer) return;\n this.container = newContainer || null;\n}\n\nfunction _resyncRemoved() {\n if (this.key == null || !this.container || this.container[this.key] !== this.node) {\n this._markRemoved();\n }\n}\n\nfunction popContext() {\n this.contexts.pop();\n\n if (this.contexts.length > 0) {\n this.setContext(this.contexts[this.contexts.length - 1]);\n } else {\n this.setContext(undefined);\n }\n}\n\nfunction pushContext(context) {\n this.contexts.push(context);\n this.setContext(context);\n}\n\nfunction setup(parentPath, container, listKey, key) {\n this.listKey = listKey;\n this.container = container;\n this.parentPath = parentPath || this.parentPath;\n this.setKey(key);\n}\n\nfunction setKey(key) {\n var _this$node;\n\n this.key = key;\n this.node = this.container[this.key];\n this.type = (_this$node = this.node) == null ? void 0 : _this$node.type;\n}\n\nfunction requeue(pathToQueue = this) {\n if (pathToQueue.removed) return;\n const contexts = this.contexts;\n\n for (const context of contexts) {\n context.maybeQueue(pathToQueue);\n }\n}\n\nfunction _getQueueContexts() {\n let path = this;\n let contexts = this.contexts;\n\n while (!contexts.length) {\n path = path.parentPath;\n if (!path) break;\n contexts = path.contexts;\n }\n\n return contexts;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.toComputedKey = toComputedKey;\nexports.ensureBlock = ensureBlock;\nexports.arrowFunctionToShadowed = arrowFunctionToShadowed;\nexports.unwrapFunctionEnvironment = unwrapFunctionEnvironment;\nexports.arrowFunctionToExpression = arrowFunctionToExpression;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar _helperFunctionName = _interopRequireDefault(require(\"@babel/helper-function-name\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction toComputedKey() {\n const node = this.node;\n let key;\n\n if (this.isMemberExpression()) {\n key = node.property;\n } else if (this.isProperty() || this.isMethod()) {\n key = node.key;\n } else {\n throw new ReferenceError(\"todo\");\n }\n\n if (!node.computed) {\n if (t.isIdentifier(key)) key = t.stringLiteral(key.name);\n }\n\n return key;\n}\n\nfunction ensureBlock() {\n const body = this.get(\"body\");\n const bodyNode = body.node;\n\n if (Array.isArray(body)) {\n throw new Error(\"Can't convert array path to a block statement\");\n }\n\n if (!bodyNode) {\n throw new Error(\"Can't convert node without a body\");\n }\n\n if (body.isBlockStatement()) {\n return bodyNode;\n }\n\n const statements = [];\n let stringPath = \"body\";\n let key;\n let listKey;\n\n if (body.isStatement()) {\n listKey = \"body\";\n key = 0;\n statements.push(body.node);\n } else {\n stringPath += \".body.0\";\n\n if (this.isFunction()) {\n key = \"argument\";\n statements.push(t.returnStatement(body.node));\n } else {\n key = \"expression\";\n statements.push(t.expressionStatement(body.node));\n }\n }\n\n this.node.body = t.blockStatement(statements);\n const parentPath = this.get(stringPath);\n body.setup(parentPath, listKey ? parentPath.node[listKey] : parentPath.node, listKey, key);\n return this.node;\n}\n\nfunction arrowFunctionToShadowed() {\n if (!this.isArrowFunctionExpression()) return;\n this.arrowFunctionToExpression();\n}\n\nfunction unwrapFunctionEnvironment() {\n if (!this.isArrowFunctionExpression() && !this.isFunctionExpression() && !this.isFunctionDeclaration()) {\n throw this.buildCodeFrameError(\"Can only unwrap the environment of a function.\");\n }\n\n hoistFunctionEnvironment(this);\n}\n\nfunction arrowFunctionToExpression({\n allowInsertArrow = true,\n specCompliant = false\n} = {}) {\n if (!this.isArrowFunctionExpression()) {\n throw this.buildCodeFrameError(\"Cannot convert non-arrow function to a function expression.\");\n }\n\n const thisBinding = hoistFunctionEnvironment(this, specCompliant, allowInsertArrow);\n this.ensureBlock();\n this.node.type = \"FunctionExpression\";\n\n if (specCompliant) {\n const checkBinding = thisBinding ? null : this.parentPath.scope.generateUidIdentifier(\"arrowCheckId\");\n\n if (checkBinding) {\n this.parentPath.scope.push({\n id: checkBinding,\n init: t.objectExpression([])\n });\n }\n\n this.get(\"body\").unshiftContainer(\"body\", t.expressionStatement(t.callExpression(this.hub.addHelper(\"newArrowCheck\"), [t.thisExpression(), checkBinding ? t.identifier(checkBinding.name) : t.identifier(thisBinding)])));\n this.replaceWith(t.callExpression(t.memberExpression((0, _helperFunctionName.default)(this, true) || this.node, t.identifier(\"bind\")), [checkBinding ? t.identifier(checkBinding.name) : t.thisExpression()]));\n }\n}\n\nfunction hoistFunctionEnvironment(fnPath, specCompliant = false, allowInsertArrow = true) {\n const thisEnvFn = fnPath.findParent(p => {\n return p.isFunction() && !p.isArrowFunctionExpression() || p.isProgram() || p.isClassProperty({\n static: false\n });\n });\n const inConstructor = (thisEnvFn == null ? void 0 : thisEnvFn.node.kind) === \"constructor\";\n\n if (thisEnvFn.isClassProperty()) {\n throw fnPath.buildCodeFrameError(\"Unable to transform arrow inside class property\");\n }\n\n const {\n thisPaths,\n argumentsPaths,\n newTargetPaths,\n superProps,\n superCalls\n } = getScopeInformation(fnPath);\n\n if (inConstructor && superCalls.length > 0) {\n if (!allowInsertArrow) {\n throw superCalls[0].buildCodeFrameError(\"Unable to handle nested super() usage in arrow\");\n }\n\n const allSuperCalls = [];\n thisEnvFn.traverse({\n Function(child) {\n if (child.isArrowFunctionExpression()) return;\n child.skip();\n },\n\n ClassProperty(child) {\n child.skip();\n },\n\n CallExpression(child) {\n if (!child.get(\"callee\").isSuper()) return;\n allSuperCalls.push(child);\n }\n\n });\n const superBinding = getSuperBinding(thisEnvFn);\n allSuperCalls.forEach(superCall => {\n const callee = t.identifier(superBinding);\n callee.loc = superCall.node.callee.loc;\n superCall.get(\"callee\").replaceWith(callee);\n });\n }\n\n if (argumentsPaths.length > 0) {\n const argumentsBinding = getBinding(thisEnvFn, \"arguments\", () => t.identifier(\"arguments\"));\n argumentsPaths.forEach(argumentsChild => {\n const argsRef = t.identifier(argumentsBinding);\n argsRef.loc = argumentsChild.node.loc;\n argumentsChild.replaceWith(argsRef);\n });\n }\n\n if (newTargetPaths.length > 0) {\n const newTargetBinding = getBinding(thisEnvFn, \"newtarget\", () => t.metaProperty(t.identifier(\"new\"), t.identifier(\"target\")));\n newTargetPaths.forEach(targetChild => {\n const targetRef = t.identifier(newTargetBinding);\n targetRef.loc = targetChild.node.loc;\n targetChild.replaceWith(targetRef);\n });\n }\n\n if (superProps.length > 0) {\n if (!allowInsertArrow) {\n throw superProps[0].buildCodeFrameError(\"Unable to handle nested super.prop usage\");\n }\n\n const flatSuperProps = superProps.reduce((acc, superProp) => acc.concat(standardizeSuperProperty(superProp)), []);\n flatSuperProps.forEach(superProp => {\n const key = superProp.node.computed ? \"\" : superProp.get(\"property\").node.name;\n const isAssignment = superProp.parentPath.isAssignmentExpression({\n left: superProp.node\n });\n const isCall = superProp.parentPath.isCallExpression({\n callee: superProp.node\n });\n const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key);\n const args = [];\n\n if (superProp.node.computed) {\n args.push(superProp.get(\"property\").node);\n }\n\n if (isAssignment) {\n const value = superProp.parentPath.node.right;\n args.push(value);\n }\n\n const call = t.callExpression(t.identifier(superBinding), args);\n\n if (isCall) {\n superProp.parentPath.unshiftContainer(\"arguments\", t.thisExpression());\n superProp.replaceWith(t.memberExpression(call, t.identifier(\"call\")));\n thisPaths.push(superProp.parentPath.get(\"arguments.0\"));\n } else if (isAssignment) {\n superProp.parentPath.replaceWith(call);\n } else {\n superProp.replaceWith(call);\n }\n });\n }\n\n let thisBinding;\n\n if (thisPaths.length > 0 || specCompliant) {\n thisBinding = getThisBinding(thisEnvFn, inConstructor);\n\n if (!specCompliant || inConstructor && hasSuperClass(thisEnvFn)) {\n thisPaths.forEach(thisChild => {\n const thisRef = thisChild.isJSX() ? t.jsxIdentifier(thisBinding) : t.identifier(thisBinding);\n thisRef.loc = thisChild.node.loc;\n thisChild.replaceWith(thisRef);\n });\n if (specCompliant) thisBinding = null;\n }\n }\n\n return thisBinding;\n}\n\nfunction standardizeSuperProperty(superProp) {\n if (superProp.parentPath.isAssignmentExpression() && superProp.parentPath.node.operator !== \"=\") {\n const assignmentPath = superProp.parentPath;\n const op = assignmentPath.node.operator.slice(0, -1);\n const value = assignmentPath.node.right;\n assignmentPath.node.operator = \"=\";\n\n if (superProp.node.computed) {\n const tmp = superProp.scope.generateDeclaredUidIdentifier(\"tmp\");\n assignmentPath.get(\"left\").replaceWith(t.memberExpression(superProp.node.object, t.assignmentExpression(\"=\", tmp, superProp.node.property), true));\n assignmentPath.get(\"right\").replaceWith(t.binaryExpression(op, t.memberExpression(superProp.node.object, t.identifier(tmp.name), true), value));\n } else {\n assignmentPath.get(\"left\").replaceWith(t.memberExpression(superProp.node.object, superProp.node.property));\n assignmentPath.get(\"right\").replaceWith(t.binaryExpression(op, t.memberExpression(superProp.node.object, t.identifier(superProp.node.property.name)), value));\n }\n\n return [assignmentPath.get(\"left\"), assignmentPath.get(\"right\").get(\"left\")];\n } else if (superProp.parentPath.isUpdateExpression()) {\n const updateExpr = superProp.parentPath;\n const tmp = superProp.scope.generateDeclaredUidIdentifier(\"tmp\");\n const computedKey = superProp.node.computed ? superProp.scope.generateDeclaredUidIdentifier(\"prop\") : null;\n const parts = [t.assignmentExpression(\"=\", tmp, t.memberExpression(superProp.node.object, computedKey ? t.assignmentExpression(\"=\", computedKey, superProp.node.property) : superProp.node.property, superProp.node.computed)), t.assignmentExpression(\"=\", t.memberExpression(superProp.node.object, computedKey ? t.identifier(computedKey.name) : superProp.node.property, superProp.node.computed), t.binaryExpression(\"+\", t.identifier(tmp.name), t.numericLiteral(1)))];\n\n if (!superProp.parentPath.node.prefix) {\n parts.push(t.identifier(tmp.name));\n }\n\n updateExpr.replaceWith(t.sequenceExpression(parts));\n const left = updateExpr.get(\"expressions.0.right\");\n const right = updateExpr.get(\"expressions.1.left\");\n return [left, right];\n }\n\n return [superProp];\n}\n\nfunction hasSuperClass(thisEnvFn) {\n return thisEnvFn.isClassMethod() && !!thisEnvFn.parentPath.parentPath.node.superClass;\n}\n\nfunction getThisBinding(thisEnvFn, inConstructor) {\n return getBinding(thisEnvFn, \"this\", thisBinding => {\n if (!inConstructor || !hasSuperClass(thisEnvFn)) return t.thisExpression();\n const supers = new WeakSet();\n thisEnvFn.traverse({\n Function(child) {\n if (child.isArrowFunctionExpression()) return;\n child.skip();\n },\n\n ClassProperty(child) {\n child.skip();\n },\n\n CallExpression(child) {\n if (!child.get(\"callee\").isSuper()) return;\n if (supers.has(child.node)) return;\n supers.add(child.node);\n child.replaceWithMultiple([child.node, t.assignmentExpression(\"=\", t.identifier(thisBinding), t.identifier(\"this\"))]);\n }\n\n });\n });\n}\n\nfunction getSuperBinding(thisEnvFn) {\n return getBinding(thisEnvFn, \"supercall\", () => {\n const argsBinding = thisEnvFn.scope.generateUidIdentifier(\"args\");\n return t.arrowFunctionExpression([t.restElement(argsBinding)], t.callExpression(t.super(), [t.spreadElement(t.identifier(argsBinding.name))]));\n });\n}\n\nfunction getSuperPropBinding(thisEnvFn, isAssignment, propName) {\n const op = isAssignment ? \"set\" : \"get\";\n return getBinding(thisEnvFn, `superprop_${op}:${propName || \"\"}`, () => {\n const argsList = [];\n let fnBody;\n\n if (propName) {\n fnBody = t.memberExpression(t.super(), t.identifier(propName));\n } else {\n const method = thisEnvFn.scope.generateUidIdentifier(\"prop\");\n argsList.unshift(method);\n fnBody = t.memberExpression(t.super(), t.identifier(method.name), true);\n }\n\n if (isAssignment) {\n const valueIdent = thisEnvFn.scope.generateUidIdentifier(\"value\");\n argsList.push(valueIdent);\n fnBody = t.assignmentExpression(\"=\", fnBody, t.identifier(valueIdent.name));\n }\n\n return t.arrowFunctionExpression(argsList, fnBody);\n });\n}\n\nfunction getBinding(thisEnvFn, key, init) {\n const cacheKey = \"binding:\" + key;\n let data = thisEnvFn.getData(cacheKey);\n\n if (!data) {\n const id = thisEnvFn.scope.generateUidIdentifier(key);\n data = id.name;\n thisEnvFn.setData(cacheKey, data);\n thisEnvFn.scope.push({\n id: id,\n init: init(data)\n });\n }\n\n return data;\n}\n\nfunction getScopeInformation(fnPath) {\n const thisPaths = [];\n const argumentsPaths = [];\n const newTargetPaths = [];\n const superProps = [];\n const superCalls = [];\n fnPath.traverse({\n ClassProperty(child) {\n child.skip();\n },\n\n Function(child) {\n if (child.isArrowFunctionExpression()) return;\n child.skip();\n },\n\n ThisExpression(child) {\n thisPaths.push(child);\n },\n\n JSXIdentifier(child) {\n if (child.node.name !== \"this\") return;\n\n if (!child.parentPath.isJSXMemberExpression({\n object: child.node\n }) && !child.parentPath.isJSXOpeningElement({\n name: child.node\n })) {\n return;\n }\n\n thisPaths.push(child);\n },\n\n CallExpression(child) {\n if (child.get(\"callee\").isSuper()) superCalls.push(child);\n },\n\n MemberExpression(child) {\n if (child.get(\"object\").isSuper()) superProps.push(child);\n },\n\n ReferencedIdentifier(child) {\n if (child.node.name !== \"arguments\") return;\n argumentsPaths.push(child);\n },\n\n MetaProperty(child) {\n if (!child.get(\"meta\").isIdentifier({\n name: \"new\"\n })) return;\n if (!child.get(\"property\").isIdentifier({\n name: \"target\"\n })) return;\n newTargetPaths.push(child);\n }\n\n });\n return {\n thisPaths,\n argumentsPaths,\n newTargetPaths,\n superProps,\n superCalls\n };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.evaluateTruthy = evaluateTruthy;\nexports.evaluate = evaluate;\nconst VALID_CALLEES = [\"String\", \"Number\", \"Math\"];\nconst INVALID_METHODS = [\"random\"];\n\nfunction evaluateTruthy() {\n const res = this.evaluate();\n if (res.confident) return !!res.value;\n}\n\nfunction deopt(path, state) {\n if (!state.confident) return;\n state.deoptPath = path;\n state.confident = false;\n}\n\nfunction evaluateCached(path, state) {\n const {\n node\n } = path;\n const {\n seen\n } = state;\n\n if (seen.has(node)) {\n const existing = seen.get(node);\n\n if (existing.resolved) {\n return existing.value;\n } else {\n deopt(path, state);\n return;\n }\n } else {\n const item = {\n resolved: false\n };\n seen.set(node, item);\n\n const val = _evaluate(path, state);\n\n if (state.confident) {\n item.resolved = true;\n item.value = val;\n }\n\n return val;\n }\n}\n\nfunction _evaluate(path, state) {\n if (!state.confident) return;\n const {\n node\n } = path;\n\n if (path.isSequenceExpression()) {\n const exprs = path.get(\"expressions\");\n return evaluateCached(exprs[exprs.length - 1], state);\n }\n\n if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) {\n return node.value;\n }\n\n if (path.isNullLiteral()) {\n return null;\n }\n\n if (path.isTemplateLiteral()) {\n return evaluateQuasis(path, node.quasis, state);\n }\n\n if (path.isTaggedTemplateExpression() && path.get(\"tag\").isMemberExpression()) {\n const object = path.get(\"tag.object\");\n const {\n node: {\n name\n }\n } = object;\n const property = path.get(\"tag.property\");\n\n if (object.isIdentifier() && name === \"String\" && !path.scope.getBinding(name, true) && property.isIdentifier && property.node.name === \"raw\") {\n return evaluateQuasis(path, node.quasi.quasis, state, true);\n }\n }\n\n if (path.isConditionalExpression()) {\n const testResult = evaluateCached(path.get(\"test\"), state);\n if (!state.confident) return;\n\n if (testResult) {\n return evaluateCached(path.get(\"consequent\"), state);\n } else {\n return evaluateCached(path.get(\"alternate\"), state);\n }\n }\n\n if (path.isExpressionWrapper()) {\n return evaluateCached(path.get(\"expression\"), state);\n }\n\n if (path.isMemberExpression() && !path.parentPath.isCallExpression({\n callee: node\n })) {\n const property = path.get(\"property\");\n const object = path.get(\"object\");\n\n if (object.isLiteral() && property.isIdentifier()) {\n const value = object.node.value;\n const type = typeof value;\n\n if (type === \"number\" || type === \"string\") {\n return value[property.node.name];\n }\n }\n }\n\n if (path.isReferencedIdentifier()) {\n const binding = path.scope.getBinding(node.name);\n\n if (binding && binding.constantViolations.length > 0) {\n return deopt(binding.path, state);\n }\n\n if (binding && path.node.start < binding.path.node.end) {\n return deopt(binding.path, state);\n }\n\n if (binding == null ? void 0 : binding.hasValue) {\n return binding.value;\n } else {\n if (node.name === \"undefined\") {\n return binding ? deopt(binding.path, state) : undefined;\n } else if (node.name === \"Infinity\") {\n return binding ? deopt(binding.path, state) : Infinity;\n } else if (node.name === \"NaN\") {\n return binding ? deopt(binding.path, state) : NaN;\n }\n\n const resolved = path.resolve();\n\n if (resolved === path) {\n return deopt(path, state);\n } else {\n return evaluateCached(resolved, state);\n }\n }\n }\n\n if (path.isUnaryExpression({\n prefix: true\n })) {\n if (node.operator === \"void\") {\n return undefined;\n }\n\n const argument = path.get(\"argument\");\n\n if (node.operator === \"typeof\" && (argument.isFunction() || argument.isClass())) {\n return \"function\";\n }\n\n const arg = evaluateCached(argument, state);\n if (!state.confident) return;\n\n switch (node.operator) {\n case \"!\":\n return !arg;\n\n case \"+\":\n return +arg;\n\n case \"-\":\n return -arg;\n\n case \"~\":\n return ~arg;\n\n case \"typeof\":\n return typeof arg;\n }\n }\n\n if (path.isArrayExpression()) {\n const arr = [];\n const elems = path.get(\"elements\");\n\n for (const elem of elems) {\n const elemValue = elem.evaluate();\n\n if (elemValue.confident) {\n arr.push(elemValue.value);\n } else {\n return deopt(elemValue.deopt, state);\n }\n }\n\n return arr;\n }\n\n if (path.isObjectExpression()) {\n const obj = {};\n const props = path.get(\"properties\");\n\n for (const prop of props) {\n if (prop.isObjectMethod() || prop.isSpreadElement()) {\n return deopt(prop, state);\n }\n\n const keyPath = prop.get(\"key\");\n let key = keyPath;\n\n if (prop.node.computed) {\n key = key.evaluate();\n\n if (!key.confident) {\n return deopt(key.deopt, state);\n }\n\n key = key.value;\n } else if (key.isIdentifier()) {\n key = key.node.name;\n } else {\n key = key.node.value;\n }\n\n const valuePath = prop.get(\"value\");\n let value = valuePath.evaluate();\n\n if (!value.confident) {\n return deopt(value.deopt, state);\n }\n\n value = value.value;\n obj[key] = value;\n }\n\n return obj;\n }\n\n if (path.isLogicalExpression()) {\n const wasConfident = state.confident;\n const left = evaluateCached(path.get(\"left\"), state);\n const leftConfident = state.confident;\n state.confident = wasConfident;\n const right = evaluateCached(path.get(\"right\"), state);\n const rightConfident = state.confident;\n\n switch (node.operator) {\n case \"||\":\n state.confident = leftConfident && (!!left || rightConfident);\n if (!state.confident) return;\n return left || right;\n\n case \"&&\":\n state.confident = leftConfident && (!left || rightConfident);\n if (!state.confident) return;\n return left && right;\n }\n }\n\n if (path.isBinaryExpression()) {\n const left = evaluateCached(path.get(\"left\"), state);\n if (!state.confident) return;\n const right = evaluateCached(path.get(\"right\"), state);\n if (!state.confident) return;\n\n switch (node.operator) {\n case \"-\":\n return left - right;\n\n case \"+\":\n return left + right;\n\n case \"/\":\n return left / right;\n\n case \"*\":\n return left * right;\n\n case \"%\":\n return left % right;\n\n case \"**\":\n return Math.pow(left, right);\n\n case \"<\":\n return left < right;\n\n case \">\":\n return left > right;\n\n case \"<=\":\n return left <= right;\n\n case \">=\":\n return left >= right;\n\n case \"==\":\n return left == right;\n\n case \"!=\":\n return left != right;\n\n case \"===\":\n return left === right;\n\n case \"!==\":\n return left !== right;\n\n case \"|\":\n return left | right;\n\n case \"&\":\n return left & right;\n\n case \"^\":\n return left ^ right;\n\n case \"<<\":\n return left << right;\n\n case \">>\":\n return left >> right;\n\n case \">>>\":\n return left >>> right;\n }\n }\n\n if (path.isCallExpression()) {\n const callee = path.get(\"callee\");\n let context;\n let func;\n\n if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name, true) && VALID_CALLEES.indexOf(callee.node.name) >= 0) {\n func = global[node.callee.name];\n }\n\n if (callee.isMemberExpression()) {\n const object = callee.get(\"object\");\n const property = callee.get(\"property\");\n\n if (object.isIdentifier() && property.isIdentifier() && VALID_CALLEES.indexOf(object.node.name) >= 0 && INVALID_METHODS.indexOf(property.node.name) < 0) {\n context = global[object.node.name];\n func = context[property.node.name];\n }\n\n if (object.isLiteral() && property.isIdentifier()) {\n const type = typeof object.node.value;\n\n if (type === \"string\" || type === \"number\") {\n context = object.node.value;\n func = context[property.node.name];\n }\n }\n }\n\n if (func) {\n const args = path.get(\"arguments\").map(arg => evaluateCached(arg, state));\n if (!state.confident) return;\n return func.apply(context, args);\n }\n }\n\n deopt(path, state);\n}\n\nfunction evaluateQuasis(path, quasis, state, raw = false) {\n let str = \"\";\n let i = 0;\n const exprs = path.get(\"expressions\");\n\n for (const elem of quasis) {\n if (!state.confident) break;\n str += raw ? elem.value.raw : elem.value.cooked;\n const expr = exprs[i++];\n if (expr) str += String(evaluateCached(expr, state));\n }\n\n if (!state.confident) return;\n return str;\n}\n\nfunction evaluate() {\n const state = {\n confident: true,\n deoptPath: null,\n seen: new Map()\n };\n let value = evaluateCached(this, state);\n if (!state.confident) value = undefined;\n return {\n confident: state.confident,\n deopt: state.deoptPath,\n value: value\n };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getOpposite = getOpposite;\nexports.getCompletionRecords = getCompletionRecords;\nexports.getSibling = getSibling;\nexports.getPrevSibling = getPrevSibling;\nexports.getNextSibling = getNextSibling;\nexports.getAllNextSiblings = getAllNextSiblings;\nexports.getAllPrevSiblings = getAllPrevSiblings;\nexports.get = get;\nexports._getKey = _getKey;\nexports._getPattern = _getPattern;\nexports.getBindingIdentifiers = getBindingIdentifiers;\nexports.getOuterBindingIdentifiers = getOuterBindingIdentifiers;\nexports.getBindingIdentifierPaths = getBindingIdentifierPaths;\nexports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths;\n\nvar _index = _interopRequireDefault(require(\"./index\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getOpposite() {\n if (this.key === \"left\") {\n return this.getSibling(\"right\");\n } else if (this.key === \"right\") {\n return this.getSibling(\"left\");\n }\n}\n\nfunction addCompletionRecords(path, paths) {\n if (path) return paths.concat(path.getCompletionRecords());\n return paths;\n}\n\nfunction findBreak(statements) {\n let breakStatement;\n\n if (!Array.isArray(statements)) {\n statements = [statements];\n }\n\n for (const statement of statements) {\n if (statement.isDoExpression() || statement.isProgram() || statement.isBlockStatement() || statement.isCatchClause() || statement.isLabeledStatement()) {\n breakStatement = findBreak(statement.get(\"body\"));\n } else if (statement.isIfStatement()) {\n var _findBreak;\n\n breakStatement = (_findBreak = findBreak(statement.get(\"consequent\"))) != null ? _findBreak : findBreak(statement.get(\"alternate\"));\n } else if (statement.isTryStatement()) {\n var _findBreak2;\n\n breakStatement = (_findBreak2 = findBreak(statement.get(\"block\"))) != null ? _findBreak2 : findBreak(statement.get(\"handler\"));\n } else if (statement.isBreakStatement()) {\n breakStatement = statement;\n }\n\n if (breakStatement) {\n return breakStatement;\n }\n }\n\n return null;\n}\n\nfunction completionRecordForSwitch(cases, paths) {\n let isLastCaseWithConsequent = true;\n\n for (let i = cases.length - 1; i >= 0; i--) {\n const switchCase = cases[i];\n const consequent = switchCase.get(\"consequent\");\n let breakStatement = findBreak(consequent);\n\n if (breakStatement) {\n while (breakStatement.key === 0 && breakStatement.parentPath.isBlockStatement()) {\n breakStatement = breakStatement.parentPath;\n }\n\n const prevSibling = breakStatement.getPrevSibling();\n\n if (breakStatement.key > 0 && (prevSibling.isExpressionStatement() || prevSibling.isBlockStatement())) {\n paths = addCompletionRecords(prevSibling, paths);\n breakStatement.remove();\n } else {\n breakStatement.replaceWith(breakStatement.scope.buildUndefinedNode());\n paths = addCompletionRecords(breakStatement, paths);\n }\n } else if (isLastCaseWithConsequent) {\n const statementFinder = statement => !statement.isBlockStatement() || statement.get(\"body\").some(statementFinder);\n\n const hasConsequent = consequent.some(statementFinder);\n\n if (hasConsequent) {\n paths = addCompletionRecords(consequent[consequent.length - 1], paths);\n isLastCaseWithConsequent = false;\n }\n }\n }\n\n return paths;\n}\n\nfunction getCompletionRecords() {\n let paths = [];\n\n if (this.isIfStatement()) {\n paths = addCompletionRecords(this.get(\"consequent\"), paths);\n paths = addCompletionRecords(this.get(\"alternate\"), paths);\n } else if (this.isDoExpression() || this.isFor() || this.isWhile()) {\n paths = addCompletionRecords(this.get(\"body\"), paths);\n } else if (this.isProgram() || this.isBlockStatement()) {\n paths = addCompletionRecords(this.get(\"body\").pop(), paths);\n } else if (this.isFunction()) {\n return this.get(\"body\").getCompletionRecords();\n } else if (this.isTryStatement()) {\n paths = addCompletionRecords(this.get(\"block\"), paths);\n paths = addCompletionRecords(this.get(\"handler\"), paths);\n } else if (this.isCatchClause()) {\n paths = addCompletionRecords(this.get(\"body\"), paths);\n } else if (this.isSwitchStatement()) {\n paths = completionRecordForSwitch(this.get(\"cases\"), paths);\n } else {\n paths.push(this);\n }\n\n return paths;\n}\n\nfunction getSibling(key) {\n return _index.default.get({\n parentPath: this.parentPath,\n parent: this.parent,\n container: this.container,\n listKey: this.listKey,\n key: key\n });\n}\n\nfunction getPrevSibling() {\n return this.getSibling(this.key - 1);\n}\n\nfunction getNextSibling() {\n return this.getSibling(this.key + 1);\n}\n\nfunction getAllNextSiblings() {\n let _key = this.key;\n let sibling = this.getSibling(++_key);\n const siblings = [];\n\n while (sibling.node) {\n siblings.push(sibling);\n sibling = this.getSibling(++_key);\n }\n\n return siblings;\n}\n\nfunction getAllPrevSiblings() {\n let _key = this.key;\n let sibling = this.getSibling(--_key);\n const siblings = [];\n\n while (sibling.node) {\n siblings.push(sibling);\n sibling = this.getSibling(--_key);\n }\n\n return siblings;\n}\n\nfunction get(key, context) {\n if (context === true) context = this.context;\n const parts = key.split(\".\");\n\n if (parts.length === 1) {\n return this._getKey(key, context);\n } else {\n return this._getPattern(parts, context);\n }\n}\n\nfunction _getKey(key, context) {\n const node = this.node;\n const container = node[key];\n\n if (Array.isArray(container)) {\n return container.map((_, i) => {\n return _index.default.get({\n listKey: key,\n parentPath: this,\n parent: node,\n container: container,\n key: i\n }).setContext(context);\n });\n } else {\n return _index.default.get({\n parentPath: this,\n parent: node,\n container: node,\n key: key\n }).setContext(context);\n }\n}\n\nfunction _getPattern(parts, context) {\n let path = this;\n\n for (const part of parts) {\n if (part === \".\") {\n path = path.parentPath;\n } else {\n if (Array.isArray(path)) {\n path = path[part];\n } else {\n path = path.get(part, context);\n }\n }\n }\n\n return path;\n}\n\nfunction getBindingIdentifiers(duplicates) {\n return t.getBindingIdentifiers(this.node, duplicates);\n}\n\nfunction getOuterBindingIdentifiers(duplicates) {\n return t.getOuterBindingIdentifiers(this.node, duplicates);\n}\n\nfunction getBindingIdentifierPaths(duplicates = false, outerOnly = false) {\n const path = this;\n let search = [].concat(path);\n const ids = Object.create(null);\n\n while (search.length) {\n const id = search.shift();\n if (!id) continue;\n if (!id.node) continue;\n const keys = t.getBindingIdentifiers.keys[id.node.type];\n\n if (id.isIdentifier()) {\n if (duplicates) {\n const _ids = ids[id.node.name] = ids[id.node.name] || [];\n\n _ids.push(id);\n } else {\n ids[id.node.name] = id;\n }\n\n continue;\n }\n\n if (id.isExportDeclaration()) {\n const declaration = id.get(\"declaration\");\n\n if (declaration.isDeclaration()) {\n search.push(declaration);\n }\n\n continue;\n }\n\n if (outerOnly) {\n if (id.isFunctionDeclaration()) {\n search.push(id.get(\"id\"));\n continue;\n }\n\n if (id.isFunctionExpression()) {\n continue;\n }\n }\n\n if (keys) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const child = id.get(key);\n\n if (Array.isArray(child) || child.node) {\n search = search.concat(child);\n }\n }\n }\n }\n\n return ids;\n}\n\nfunction getOuterBindingIdentifierPaths(duplicates) {\n return this.getBindingIdentifierPaths(duplicates, true);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.SHOULD_SKIP = exports.SHOULD_STOP = exports.REMOVED = void 0;\n\nvar virtualTypes = _interopRequireWildcard(require(\"./lib/virtual-types\"));\n\nvar _debug = _interopRequireDefault(require(\"debug\"));\n\nvar _index = _interopRequireDefault(require(\"../index\"));\n\nvar _scope = _interopRequireDefault(require(\"../scope\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar _cache = require(\"../cache\");\n\nvar _generator = _interopRequireDefault(require(\"@babel/generator\"));\n\nvar NodePath_ancestry = _interopRequireWildcard(require(\"./ancestry\"));\n\nvar NodePath_inference = _interopRequireWildcard(require(\"./inference\"));\n\nvar NodePath_replacement = _interopRequireWildcard(require(\"./replacement\"));\n\nvar NodePath_evaluation = _interopRequireWildcard(require(\"./evaluation\"));\n\nvar NodePath_conversion = _interopRequireWildcard(require(\"./conversion\"));\n\nvar NodePath_introspection = _interopRequireWildcard(require(\"./introspection\"));\n\nvar NodePath_context = _interopRequireWildcard(require(\"./context\"));\n\nvar NodePath_removal = _interopRequireWildcard(require(\"./removal\"));\n\nvar NodePath_modification = _interopRequireWildcard(require(\"./modification\"));\n\nvar NodePath_family = _interopRequireWildcard(require(\"./family\"));\n\nvar NodePath_comments = _interopRequireWildcard(require(\"./comments\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nconst debug = (0, _debug.default)(\"babel\");\nconst REMOVED = 1 << 0;\nexports.REMOVED = REMOVED;\nconst SHOULD_STOP = 1 << 1;\nexports.SHOULD_STOP = SHOULD_STOP;\nconst SHOULD_SKIP = 1 << 2;\nexports.SHOULD_SKIP = SHOULD_SKIP;\n\nclass NodePath {\n constructor(hub, parent) {\n this.contexts = [];\n this.state = null;\n this.opts = null;\n this._traverseFlags = 0;\n this.skipKeys = null;\n this.parentPath = null;\n this.container = null;\n this.listKey = null;\n this.key = null;\n this.node = null;\n this.type = null;\n this.parent = parent;\n this.hub = hub;\n this.data = null;\n this.context = null;\n this.scope = null;\n }\n\n static get({\n hub,\n parentPath,\n parent,\n container,\n listKey,\n key\n }) {\n if (!hub && parentPath) {\n hub = parentPath.hub;\n }\n\n if (!parent) {\n throw new Error(\"To get a node path the parent needs to exist\");\n }\n\n const targetNode = container[key];\n const paths = _cache.path.get(parent) || [];\n\n if (!_cache.path.has(parent)) {\n _cache.path.set(parent, paths);\n }\n\n let path;\n\n for (let i = 0; i < paths.length; i++) {\n const pathCheck = paths[i];\n\n if (pathCheck.node === targetNode) {\n path = pathCheck;\n break;\n }\n }\n\n if (!path) {\n path = new NodePath(hub, parent);\n paths.push(path);\n }\n\n path.setup(parentPath, container, listKey, key);\n return path;\n }\n\n getScope(scope) {\n return this.isScope() ? new _scope.default(this) : scope;\n }\n\n setData(key, val) {\n if (this.data == null) {\n this.data = Object.create(null);\n }\n\n return this.data[key] = val;\n }\n\n getData(key, def) {\n if (this.data == null) {\n this.data = Object.create(null);\n }\n\n let val = this.data[key];\n if (val === undefined && def !== undefined) val = this.data[key] = def;\n return val;\n }\n\n buildCodeFrameError(msg, Error = SyntaxError) {\n return this.hub.buildError(this.node, msg, Error);\n }\n\n traverse(visitor, state) {\n (0, _index.default)(this.node, visitor, this.scope, state, this);\n }\n\n set(key, node) {\n t.validate(this.node, key, node);\n this.node[key] = node;\n }\n\n getPathLocation() {\n const parts = [];\n let path = this;\n\n do {\n let key = path.key;\n if (path.inList) key = `${path.listKey}[${key}]`;\n parts.unshift(key);\n } while (path = path.parentPath);\n\n return parts.join(\".\");\n }\n\n debug(message) {\n if (!debug.enabled) return;\n debug(`${this.getPathLocation()} ${this.type}: ${message}`);\n }\n\n toString() {\n return (0, _generator.default)(this.node).code;\n }\n\n get inList() {\n return !!this.listKey;\n }\n\n set inList(inList) {\n if (!inList) {\n this.listKey = null;\n }\n }\n\n get parentKey() {\n return this.listKey || this.key;\n }\n\n get shouldSkip() {\n return !!(this._traverseFlags & SHOULD_SKIP);\n }\n\n set shouldSkip(v) {\n if (v) {\n this._traverseFlags |= SHOULD_SKIP;\n } else {\n this._traverseFlags &= ~SHOULD_SKIP;\n }\n }\n\n get shouldStop() {\n return !!(this._traverseFlags & SHOULD_STOP);\n }\n\n set shouldStop(v) {\n if (v) {\n this._traverseFlags |= SHOULD_STOP;\n } else {\n this._traverseFlags &= ~SHOULD_STOP;\n }\n }\n\n get removed() {\n return !!(this._traverseFlags & REMOVED);\n }\n\n set removed(v) {\n if (v) {\n this._traverseFlags |= REMOVED;\n } else {\n this._traverseFlags &= ~REMOVED;\n }\n }\n\n}\n\nexports.default = NodePath;\nObject.assign(NodePath.prototype, NodePath_ancestry, NodePath_inference, NodePath_replacement, NodePath_evaluation, NodePath_conversion, NodePath_introspection, NodePath_context, NodePath_removal, NodePath_modification, NodePath_family, NodePath_comments);\n\nfor (const type of t.TYPES) {\n const typeKey = `is${type}`;\n const fn = t[typeKey];\n\n NodePath.prototype[typeKey] = function (opts) {\n return fn(this.node, opts);\n };\n\n NodePath.prototype[`assert${type}`] = function (opts) {\n if (!fn(this.node, opts)) {\n throw new TypeError(`Expected node path of type ${type}`);\n }\n };\n}\n\nfor (const type of Object.keys(virtualTypes)) {\n if (type[0] === \"_\") continue;\n if (t.TYPES.indexOf(type) < 0) t.TYPES.push(type);\n const virtualType = virtualTypes[type];\n\n NodePath.prototype[`is${type}`] = function (opts) {\n return virtualType.checkPath(this, opts);\n };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getTypeAnnotation = getTypeAnnotation;\nexports._getTypeAnnotation = _getTypeAnnotation;\nexports.isBaseType = isBaseType;\nexports.couldBeBaseType = couldBeBaseType;\nexports.baseTypeStrictlyMatches = baseTypeStrictlyMatches;\nexports.isGenericType = isGenericType;\n\nvar inferers = _interopRequireWildcard(require(\"./inferers\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction getTypeAnnotation() {\n if (this.typeAnnotation) return this.typeAnnotation;\n let type = this._getTypeAnnotation() || t.anyTypeAnnotation();\n if (t.isTypeAnnotation(type)) type = type.typeAnnotation;\n return this.typeAnnotation = type;\n}\n\nfunction _getTypeAnnotation() {\n var _inferer;\n\n const node = this.node;\n\n if (!node) {\n if (this.key === \"init\" && this.parentPath.isVariableDeclarator()) {\n const declar = this.parentPath.parentPath;\n const declarParent = declar.parentPath;\n\n if (declar.key === \"left\" && declarParent.isForInStatement()) {\n return t.stringTypeAnnotation();\n }\n\n if (declar.key === \"left\" && declarParent.isForOfStatement()) {\n return t.anyTypeAnnotation();\n }\n\n return t.voidTypeAnnotation();\n } else {\n return;\n }\n }\n\n if (node.typeAnnotation) {\n return node.typeAnnotation;\n }\n\n let inferer = inferers[node.type];\n\n if (inferer) {\n return inferer.call(this, node);\n }\n\n inferer = inferers[this.parentPath.type];\n\n if ((_inferer = inferer) == null ? void 0 : _inferer.validParent) {\n return this.parentPath.getTypeAnnotation();\n }\n}\n\nfunction isBaseType(baseName, soft) {\n return _isBaseType(baseName, this.getTypeAnnotation(), soft);\n}\n\nfunction _isBaseType(baseName, type, soft) {\n if (baseName === \"string\") {\n return t.isStringTypeAnnotation(type);\n } else if (baseName === \"number\") {\n return t.isNumberTypeAnnotation(type);\n } else if (baseName === \"boolean\") {\n return t.isBooleanTypeAnnotation(type);\n } else if (baseName === \"any\") {\n return t.isAnyTypeAnnotation(type);\n } else if (baseName === \"mixed\") {\n return t.isMixedTypeAnnotation(type);\n } else if (baseName === \"empty\") {\n return t.isEmptyTypeAnnotation(type);\n } else if (baseName === \"void\") {\n return t.isVoidTypeAnnotation(type);\n } else {\n if (soft) {\n return false;\n } else {\n throw new Error(`Unknown base type ${baseName}`);\n }\n }\n}\n\nfunction couldBeBaseType(name) {\n const type = this.getTypeAnnotation();\n if (t.isAnyTypeAnnotation(type)) return true;\n\n if (t.isUnionTypeAnnotation(type)) {\n for (const type2 of type.types) {\n if (t.isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) {\n return true;\n }\n }\n\n return false;\n } else {\n return _isBaseType(name, type, true);\n }\n}\n\nfunction baseTypeStrictlyMatches(right) {\n const left = this.getTypeAnnotation();\n right = right.getTypeAnnotation();\n\n if (!t.isAnyTypeAnnotation(left) && t.isFlowBaseAnnotation(left)) {\n return right.type === left.type;\n }\n}\n\nfunction isGenericType(genericName) {\n const type = this.getTypeAnnotation();\n return t.isGenericTypeAnnotation(type) && t.isIdentifier(type.id, {\n name: genericName\n });\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _default(node) {\n if (!this.isReferenced()) return;\n const binding = this.scope.getBinding(node.name);\n\n if (binding) {\n if (binding.identifier.typeAnnotation) {\n return binding.identifier.typeAnnotation;\n } else {\n return getTypeAnnotationBindingConstantViolations(binding, this, node.name);\n }\n }\n\n if (node.name === \"undefined\") {\n return t.voidTypeAnnotation();\n } else if (node.name === \"NaN\" || node.name === \"Infinity\") {\n return t.numberTypeAnnotation();\n } else if (node.name === \"arguments\") {}\n}\n\nfunction getTypeAnnotationBindingConstantViolations(binding, path, name) {\n const types = [];\n const functionConstantViolations = [];\n let constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations);\n const testType = getConditionalAnnotation(binding, path, name);\n\n if (testType) {\n const testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement);\n constantViolations = constantViolations.filter(path => testConstantViolations.indexOf(path) < 0);\n types.push(testType.typeAnnotation);\n }\n\n if (constantViolations.length) {\n constantViolations = constantViolations.concat(functionConstantViolations);\n\n for (const violation of constantViolations) {\n types.push(violation.getTypeAnnotation());\n }\n }\n\n if (!types.length) {\n return;\n }\n\n if (t.isTSTypeAnnotation(types[0]) && t.createTSUnionType) {\n return t.createTSUnionType(types);\n }\n\n if (t.createFlowUnionType) {\n return t.createFlowUnionType(types);\n }\n\n return t.createUnionTypeAnnotation(types);\n}\n\nfunction getConstantViolationsBefore(binding, path, functions) {\n const violations = binding.constantViolations.slice();\n violations.unshift(binding.path);\n return violations.filter(violation => {\n violation = violation.resolve();\n\n const status = violation._guessExecutionStatusRelativeTo(path);\n\n if (functions && status === \"unknown\") functions.push(violation);\n return status === \"before\";\n });\n}\n\nfunction inferAnnotationFromBinaryExpression(name, path) {\n const operator = path.node.operator;\n const right = path.get(\"right\").resolve();\n const left = path.get(\"left\").resolve();\n let target;\n\n if (left.isIdentifier({\n name\n })) {\n target = right;\n } else if (right.isIdentifier({\n name\n })) {\n target = left;\n }\n\n if (target) {\n if (operator === \"===\") {\n return target.getTypeAnnotation();\n }\n\n if (t.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {\n return t.numberTypeAnnotation();\n }\n\n return;\n }\n\n if (operator !== \"===\" && operator !== \"==\") return;\n let typeofPath;\n let typePath;\n\n if (left.isUnaryExpression({\n operator: \"typeof\"\n })) {\n typeofPath = left;\n typePath = right;\n } else if (right.isUnaryExpression({\n operator: \"typeof\"\n })) {\n typeofPath = right;\n typePath = left;\n }\n\n if (!typeofPath) return;\n if (!typeofPath.get(\"argument\").isIdentifier({\n name\n })) return;\n typePath = typePath.resolve();\n if (!typePath.isLiteral()) return;\n const typeValue = typePath.node.value;\n if (typeof typeValue !== \"string\") return;\n return t.createTypeAnnotationBasedOnTypeof(typeValue);\n}\n\nfunction getParentConditionalPath(binding, path, name) {\n let parentPath;\n\n while (parentPath = path.parentPath) {\n if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) {\n if (path.key === \"test\") {\n return;\n }\n\n return parentPath;\n }\n\n if (parentPath.isFunction()) {\n if (parentPath.parentPath.scope.getBinding(name) !== binding) return;\n }\n\n path = parentPath;\n }\n}\n\nfunction getConditionalAnnotation(binding, path, name) {\n const ifStatement = getParentConditionalPath(binding, path, name);\n if (!ifStatement) return;\n const test = ifStatement.get(\"test\");\n const paths = [test];\n const types = [];\n\n for (let i = 0; i < paths.length; i++) {\n const path = paths[i];\n\n if (path.isLogicalExpression()) {\n if (path.node.operator === \"&&\") {\n paths.push(path.get(\"left\"));\n paths.push(path.get(\"right\"));\n }\n } else if (path.isBinaryExpression()) {\n const type = inferAnnotationFromBinaryExpression(name, path);\n if (type) types.push(type);\n }\n }\n\n if (types.length) {\n if (t.isTSTypeAnnotation(types[0]) && t.createTSUnionType) {\n return {\n typeAnnotation: t.createTSUnionType(types),\n ifStatement\n };\n }\n\n if (t.createFlowUnionType) {\n return {\n typeAnnotation: t.createFlowUnionType(types),\n ifStatement\n };\n }\n\n return {\n typeAnnotation: t.createUnionTypeAnnotation(types),\n ifStatement\n };\n }\n\n return getConditionalAnnotation(ifStatement, name);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.VariableDeclarator = VariableDeclarator;\nexports.TypeCastExpression = TypeCastExpression;\nexports.NewExpression = NewExpression;\nexports.TemplateLiteral = TemplateLiteral;\nexports.UnaryExpression = UnaryExpression;\nexports.BinaryExpression = BinaryExpression;\nexports.LogicalExpression = LogicalExpression;\nexports.ConditionalExpression = ConditionalExpression;\nexports.SequenceExpression = SequenceExpression;\nexports.ParenthesizedExpression = ParenthesizedExpression;\nexports.AssignmentExpression = AssignmentExpression;\nexports.UpdateExpression = UpdateExpression;\nexports.StringLiteral = StringLiteral;\nexports.NumericLiteral = NumericLiteral;\nexports.BooleanLiteral = BooleanLiteral;\nexports.NullLiteral = NullLiteral;\nexports.RegExpLiteral = RegExpLiteral;\nexports.ObjectExpression = ObjectExpression;\nexports.ArrayExpression = ArrayExpression;\nexports.RestElement = RestElement;\nexports.ClassDeclaration = exports.ClassExpression = exports.FunctionDeclaration = exports.ArrowFunctionExpression = exports.FunctionExpression = Func;\nexports.CallExpression = CallExpression;\nexports.TaggedTemplateExpression = TaggedTemplateExpression;\nObject.defineProperty(exports, \"Identifier\", {\n enumerable: true,\n get: function () {\n return _infererReference.default;\n }\n});\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar _infererReference = _interopRequireDefault(require(\"./inferer-reference\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction VariableDeclarator() {\n var _type;\n\n const id = this.get(\"id\");\n if (!id.isIdentifier()) return;\n const init = this.get(\"init\");\n let type = init.getTypeAnnotation();\n\n if (((_type = type) == null ? void 0 : _type.type) === \"AnyTypeAnnotation\") {\n if (init.isCallExpression() && init.get(\"callee\").isIdentifier({\n name: \"Array\"\n }) && !init.scope.hasBinding(\"Array\", true)) {\n type = ArrayExpression();\n }\n }\n\n return type;\n}\n\nfunction TypeCastExpression(node) {\n return node.typeAnnotation;\n}\n\nTypeCastExpression.validParent = true;\n\nfunction NewExpression(node) {\n if (this.get(\"callee\").isIdentifier()) {\n return t.genericTypeAnnotation(node.callee);\n }\n}\n\nfunction TemplateLiteral() {\n return t.stringTypeAnnotation();\n}\n\nfunction UnaryExpression(node) {\n const operator = node.operator;\n\n if (operator === \"void\") {\n return t.voidTypeAnnotation();\n } else if (t.NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) {\n return t.numberTypeAnnotation();\n } else if (t.STRING_UNARY_OPERATORS.indexOf(operator) >= 0) {\n return t.stringTypeAnnotation();\n } else if (t.BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) {\n return t.booleanTypeAnnotation();\n }\n}\n\nfunction BinaryExpression(node) {\n const operator = node.operator;\n\n if (t.NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {\n return t.numberTypeAnnotation();\n } else if (t.BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) {\n return t.booleanTypeAnnotation();\n } else if (operator === \"+\") {\n const right = this.get(\"right\");\n const left = this.get(\"left\");\n\n if (left.isBaseType(\"number\") && right.isBaseType(\"number\")) {\n return t.numberTypeAnnotation();\n } else if (left.isBaseType(\"string\") || right.isBaseType(\"string\")) {\n return t.stringTypeAnnotation();\n }\n\n return t.unionTypeAnnotation([t.stringTypeAnnotation(), t.numberTypeAnnotation()]);\n }\n}\n\nfunction LogicalExpression() {\n const argumentTypes = [this.get(\"left\").getTypeAnnotation(), this.get(\"right\").getTypeAnnotation()];\n\n if (t.isTSTypeAnnotation(argumentTypes[0]) && t.createTSUnionType) {\n return t.createTSUnionType(argumentTypes);\n }\n\n if (t.createFlowUnionType) {\n return t.createFlowUnionType(argumentTypes);\n }\n\n return t.createUnionTypeAnnotation(argumentTypes);\n}\n\nfunction ConditionalExpression() {\n const argumentTypes = [this.get(\"consequent\").getTypeAnnotation(), this.get(\"alternate\").getTypeAnnotation()];\n\n if (t.isTSTypeAnnotation(argumentTypes[0]) && t.createTSUnionType) {\n return t.createTSUnionType(argumentTypes);\n }\n\n if (t.createFlowUnionType) {\n return t.createFlowUnionType(argumentTypes);\n }\n\n return t.createUnionTypeAnnotation(argumentTypes);\n}\n\nfunction SequenceExpression() {\n return this.get(\"expressions\").pop().getTypeAnnotation();\n}\n\nfunction ParenthesizedExpression() {\n return this.get(\"expression\").getTypeAnnotation();\n}\n\nfunction AssignmentExpression() {\n return this.get(\"right\").getTypeAnnotation();\n}\n\nfunction UpdateExpression(node) {\n const operator = node.operator;\n\n if (operator === \"++\" || operator === \"--\") {\n return t.numberTypeAnnotation();\n }\n}\n\nfunction StringLiteral() {\n return t.stringTypeAnnotation();\n}\n\nfunction NumericLiteral() {\n return t.numberTypeAnnotation();\n}\n\nfunction BooleanLiteral() {\n return t.booleanTypeAnnotation();\n}\n\nfunction NullLiteral() {\n return t.nullLiteralTypeAnnotation();\n}\n\nfunction RegExpLiteral() {\n return t.genericTypeAnnotation(t.identifier(\"RegExp\"));\n}\n\nfunction ObjectExpression() {\n return t.genericTypeAnnotation(t.identifier(\"Object\"));\n}\n\nfunction ArrayExpression() {\n return t.genericTypeAnnotation(t.identifier(\"Array\"));\n}\n\nfunction RestElement() {\n return ArrayExpression();\n}\n\nRestElement.validParent = true;\n\nfunction Func() {\n return t.genericTypeAnnotation(t.identifier(\"Function\"));\n}\n\nconst isArrayFrom = t.buildMatchMemberExpression(\"Array.from\");\nconst isObjectKeys = t.buildMatchMemberExpression(\"Object.keys\");\nconst isObjectValues = t.buildMatchMemberExpression(\"Object.values\");\nconst isObjectEntries = t.buildMatchMemberExpression(\"Object.entries\");\n\nfunction CallExpression() {\n const {\n callee\n } = this.node;\n\n if (isObjectKeys(callee)) {\n return t.arrayTypeAnnotation(t.stringTypeAnnotation());\n } else if (isArrayFrom(callee) || isObjectValues(callee)) {\n return t.arrayTypeAnnotation(t.anyTypeAnnotation());\n } else if (isObjectEntries(callee)) {\n return t.arrayTypeAnnotation(t.tupleTypeAnnotation([t.stringTypeAnnotation(), t.anyTypeAnnotation()]));\n }\n\n return resolveCall(this.get(\"callee\"));\n}\n\nfunction TaggedTemplateExpression() {\n return resolveCall(this.get(\"tag\"));\n}\n\nfunction resolveCall(callee) {\n callee = callee.resolve();\n\n if (callee.isFunction()) {\n if (callee.is(\"async\")) {\n if (callee.is(\"generator\")) {\n return t.genericTypeAnnotation(t.identifier(\"AsyncIterator\"));\n } else {\n return t.genericTypeAnnotation(t.identifier(\"Promise\"));\n }\n } else {\n if (callee.node.returnType) {\n return callee.node.returnType;\n } else {}\n }\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.matchesPattern = matchesPattern;\nexports.has = has;\nexports.isStatic = isStatic;\nexports.isnt = isnt;\nexports.equals = equals;\nexports.isNodeType = isNodeType;\nexports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression;\nexports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement;\nexports.isCompletionRecord = isCompletionRecord;\nexports.isStatementOrBlock = isStatementOrBlock;\nexports.referencesImport = referencesImport;\nexports.getSource = getSource;\nexports.willIMaybeExecuteBefore = willIMaybeExecuteBefore;\nexports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo;\nexports._guessExecutionStatusRelativeToDifferentFunctions = _guessExecutionStatusRelativeToDifferentFunctions;\nexports.resolve = resolve;\nexports._resolve = _resolve;\nexports.isConstantExpression = isConstantExpression;\nexports.isInStrictMode = isInStrictMode;\nexports.is = void 0;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction matchesPattern(pattern, allowPartial) {\n return t.matchesPattern(this.node, pattern, allowPartial);\n}\n\nfunction has(key) {\n const val = this.node && this.node[key];\n\n if (val && Array.isArray(val)) {\n return !!val.length;\n } else {\n return !!val;\n }\n}\n\nfunction isStatic() {\n return this.scope.isStatic(this.node);\n}\n\nconst is = has;\nexports.is = is;\n\nfunction isnt(key) {\n return !this.has(key);\n}\n\nfunction equals(key, value) {\n return this.node[key] === value;\n}\n\nfunction isNodeType(type) {\n return t.isType(this.type, type);\n}\n\nfunction canHaveVariableDeclarationOrExpression() {\n return (this.key === \"init\" || this.key === \"left\") && this.parentPath.isFor();\n}\n\nfunction canSwapBetweenExpressionAndStatement(replacement) {\n if (this.key !== \"body\" || !this.parentPath.isArrowFunctionExpression()) {\n return false;\n }\n\n if (this.isExpression()) {\n return t.isBlockStatement(replacement);\n } else if (this.isBlockStatement()) {\n return t.isExpression(replacement);\n }\n\n return false;\n}\n\nfunction isCompletionRecord(allowInsideFunction) {\n let path = this;\n let first = true;\n\n do {\n const container = path.container;\n\n if (path.isFunction() && !first) {\n return !!allowInsideFunction;\n }\n\n first = false;\n\n if (Array.isArray(container) && path.key !== container.length - 1) {\n return false;\n }\n } while ((path = path.parentPath) && !path.isProgram());\n\n return true;\n}\n\nfunction isStatementOrBlock() {\n if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) {\n return false;\n } else {\n return t.STATEMENT_OR_BLOCK_KEYS.includes(this.key);\n }\n}\n\nfunction referencesImport(moduleSource, importName) {\n if (!this.isReferencedIdentifier()) return false;\n const binding = this.scope.getBinding(this.node.name);\n if (!binding || binding.kind !== \"module\") return false;\n const path = binding.path;\n const parent = path.parentPath;\n if (!parent.isImportDeclaration()) return false;\n\n if (parent.node.source.value === moduleSource) {\n if (!importName) return true;\n } else {\n return false;\n }\n\n if (path.isImportDefaultSpecifier() && importName === \"default\") {\n return true;\n }\n\n if (path.isImportNamespaceSpecifier() && importName === \"*\") {\n return true;\n }\n\n if (path.isImportSpecifier() && path.node.imported.name === importName) {\n return true;\n }\n\n return false;\n}\n\nfunction getSource() {\n const node = this.node;\n\n if (node.end) {\n const code = this.hub.getCode();\n if (code) return code.slice(node.start, node.end);\n }\n\n return \"\";\n}\n\nfunction willIMaybeExecuteBefore(target) {\n return this._guessExecutionStatusRelativeTo(target) !== \"after\";\n}\n\nfunction getOuterFunction(path) {\n return (path.scope.getFunctionParent() || path.scope.getProgramParent()).path;\n}\n\nfunction isExecutionUncertain(type, key) {\n switch (type) {\n case \"LogicalExpression\":\n return key === \"right\";\n\n case \"ConditionalExpression\":\n case \"IfStatement\":\n return key === \"consequent\" || key === \"alternate\";\n\n case \"WhileStatement\":\n case \"DoWhileStatement\":\n case \"ForInStatement\":\n case \"ForOfStatement\":\n return key === \"body\";\n\n case \"ForStatement\":\n return key === \"body\" || key === \"update\";\n\n case \"SwitchStatement\":\n return key === \"cases\";\n\n case \"TryStatement\":\n return key === \"handler\";\n\n case \"AssignmentPattern\":\n return key === \"right\";\n\n case \"OptionalMemberExpression\":\n return key === \"property\";\n\n case \"OptionalCallExpression\":\n return key === \"arguments\";\n\n default:\n return false;\n }\n}\n\nfunction isExecutionUncertainInList(paths, maxIndex) {\n for (let i = 0; i < maxIndex; i++) {\n const path = paths[i];\n\n if (isExecutionUncertain(path.parent.type, path.parentKey)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction _guessExecutionStatusRelativeTo(target) {\n const funcParent = {\n this: getOuterFunction(this),\n target: getOuterFunction(target)\n };\n\n if (funcParent.target.node !== funcParent.this.node) {\n return this._guessExecutionStatusRelativeToDifferentFunctions(funcParent.target);\n }\n\n const paths = {\n target: target.getAncestry(),\n this: this.getAncestry()\n };\n if (paths.target.indexOf(this) >= 0) return \"after\";\n if (paths.this.indexOf(target) >= 0) return \"before\";\n let commonPath;\n const commonIndex = {\n target: 0,\n this: 0\n };\n\n while (!commonPath && commonIndex.this < paths.this.length) {\n const path = paths.this[commonIndex.this];\n commonIndex.target = paths.target.indexOf(path);\n\n if (commonIndex.target >= 0) {\n commonPath = path;\n } else {\n commonIndex.this++;\n }\n }\n\n if (!commonPath) {\n throw new Error(\"Internal Babel error - The two compared nodes\" + \" don't appear to belong to the same program.\");\n }\n\n if (isExecutionUncertainInList(paths.this, commonIndex.this - 1) || isExecutionUncertainInList(paths.target, commonIndex.target - 1)) {\n return \"unknown\";\n }\n\n const divergence = {\n this: paths.this[commonIndex.this - 1],\n target: paths.target[commonIndex.target - 1]\n };\n\n if (divergence.target.listKey && divergence.this.listKey && divergence.target.container === divergence.this.container) {\n return divergence.target.key > divergence.this.key ? \"before\" : \"after\";\n }\n\n const keys = t.VISITOR_KEYS[commonPath.type];\n const keyPosition = {\n this: keys.indexOf(divergence.this.parentKey),\n target: keys.indexOf(divergence.target.parentKey)\n };\n return keyPosition.target > keyPosition.this ? \"before\" : \"after\";\n}\n\nconst executionOrderCheckedNodes = new WeakSet();\n\nfunction _guessExecutionStatusRelativeToDifferentFunctions(target) {\n if (!target.isFunctionDeclaration() || target.parentPath.isExportDeclaration()) {\n return \"unknown\";\n }\n\n const binding = target.scope.getBinding(target.node.id.name);\n if (!binding.references) return \"before\";\n const referencePaths = binding.referencePaths;\n let allStatus;\n\n for (const path of referencePaths) {\n const childOfFunction = !!path.find(path => path.node === target.node);\n if (childOfFunction) continue;\n\n if (path.key !== \"callee\" || !path.parentPath.isCallExpression()) {\n return \"unknown\";\n }\n\n if (executionOrderCheckedNodes.has(path.node)) continue;\n executionOrderCheckedNodes.add(path.node);\n\n const status = this._guessExecutionStatusRelativeTo(path);\n\n executionOrderCheckedNodes.delete(path.node);\n\n if (allStatus && allStatus !== status) {\n return \"unknown\";\n } else {\n allStatus = status;\n }\n }\n\n return allStatus;\n}\n\nfunction resolve(dangerous, resolved) {\n return this._resolve(dangerous, resolved) || this;\n}\n\nfunction _resolve(dangerous, resolved) {\n if (resolved && resolved.indexOf(this) >= 0) return;\n resolved = resolved || [];\n resolved.push(this);\n\n if (this.isVariableDeclarator()) {\n if (this.get(\"id\").isIdentifier()) {\n return this.get(\"init\").resolve(dangerous, resolved);\n } else {}\n } else if (this.isReferencedIdentifier()) {\n const binding = this.scope.getBinding(this.node.name);\n if (!binding) return;\n if (!binding.constant) return;\n if (binding.kind === \"module\") return;\n\n if (binding.path !== this) {\n const ret = binding.path.resolve(dangerous, resolved);\n if (this.find(parent => parent.node === ret.node)) return;\n return ret;\n }\n } else if (this.isTypeCastExpression()) {\n return this.get(\"expression\").resolve(dangerous, resolved);\n } else if (dangerous && this.isMemberExpression()) {\n const targetKey = this.toComputedKey();\n if (!t.isLiteral(targetKey)) return;\n const targetName = targetKey.value;\n const target = this.get(\"object\").resolve(dangerous, resolved);\n\n if (target.isObjectExpression()) {\n const props = target.get(\"properties\");\n\n for (const prop of props) {\n if (!prop.isProperty()) continue;\n const key = prop.get(\"key\");\n let match = prop.isnt(\"computed\") && key.isIdentifier({\n name: targetName\n });\n match = match || key.isLiteral({\n value: targetName\n });\n if (match) return prop.get(\"value\").resolve(dangerous, resolved);\n }\n } else if (target.isArrayExpression() && !isNaN(+targetName)) {\n const elems = target.get(\"elements\");\n const elem = elems[targetName];\n if (elem) return elem.resolve(dangerous, resolved);\n }\n }\n}\n\nfunction isConstantExpression() {\n if (this.isIdentifier()) {\n const binding = this.scope.getBinding(this.node.name);\n if (!binding) return false;\n return binding.constant;\n }\n\n if (this.isLiteral()) {\n if (this.isRegExpLiteral()) {\n return false;\n }\n\n if (this.isTemplateLiteral()) {\n return this.get(\"expressions\").every(expression => expression.isConstantExpression());\n }\n\n return true;\n }\n\n if (this.isUnaryExpression()) {\n if (this.get(\"operator\").node !== \"void\") {\n return false;\n }\n\n return this.get(\"argument\").isConstantExpression();\n }\n\n if (this.isBinaryExpression()) {\n return this.get(\"left\").isConstantExpression() && this.get(\"right\").isConstantExpression();\n }\n\n return false;\n}\n\nfunction isInStrictMode() {\n const start = this.isProgram() ? this : this.parentPath;\n const strictParent = start.find(path => {\n if (path.isProgram({\n sourceType: \"module\"\n })) return true;\n if (path.isClass()) return true;\n if (!path.isProgram() && !path.isFunction()) return false;\n\n if (path.isArrowFunctionExpression() && !path.get(\"body\").isBlockStatement()) {\n return false;\n }\n\n let {\n node\n } = path;\n if (path.isFunction()) node = node.body;\n\n for (const directive of node.directives) {\n if (directive.value.value === \"use strict\") {\n return true;\n }\n }\n });\n return !!strictParent;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nconst referenceVisitor = {\n ReferencedIdentifier(path, state) {\n if (path.isJSXIdentifier() && t.react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) {\n return;\n }\n\n if (path.node.name === \"this\") {\n let scope = path.scope;\n\n do {\n if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) {\n break;\n }\n } while (scope = scope.parent);\n\n if (scope) state.breakOnScopePaths.push(scope.path);\n }\n\n const binding = path.scope.getBinding(path.node.name);\n if (!binding) return;\n\n for (const violation of binding.constantViolations) {\n if (violation.scope !== binding.path.scope) {\n state.mutableBinding = true;\n path.stop();\n return;\n }\n }\n\n if (binding !== state.scope.getBinding(path.node.name)) return;\n state.bindings[path.node.name] = binding;\n }\n\n};\n\nclass PathHoister {\n constructor(path, scope) {\n this.breakOnScopePaths = [];\n this.bindings = {};\n this.mutableBinding = false;\n this.scopes = [];\n this.scope = scope;\n this.path = path;\n this.attachAfter = false;\n }\n\n isCompatibleScope(scope) {\n for (const key of Object.keys(this.bindings)) {\n const binding = this.bindings[key];\n\n if (!scope.bindingIdentifierEquals(key, binding.identifier)) {\n return false;\n }\n }\n\n return true;\n }\n\n getCompatibleScopes() {\n let scope = this.path.scope;\n\n do {\n if (this.isCompatibleScope(scope)) {\n this.scopes.push(scope);\n } else {\n break;\n }\n\n if (this.breakOnScopePaths.indexOf(scope.path) >= 0) {\n break;\n }\n } while (scope = scope.parent);\n }\n\n getAttachmentPath() {\n let path = this._getAttachmentPath();\n\n if (!path) return;\n let targetScope = path.scope;\n\n if (targetScope.path === path) {\n targetScope = path.scope.parent;\n }\n\n if (targetScope.path.isProgram() || targetScope.path.isFunction()) {\n for (const name of Object.keys(this.bindings)) {\n if (!targetScope.hasOwnBinding(name)) continue;\n const binding = this.bindings[name];\n\n if (binding.kind === \"param\" || binding.path.parentKey === \"params\") {\n continue;\n }\n\n const bindingParentPath = this.getAttachmentParentForPath(binding.path);\n\n if (bindingParentPath.key >= path.key) {\n this.attachAfter = true;\n path = binding.path;\n\n for (const violationPath of binding.constantViolations) {\n if (this.getAttachmentParentForPath(violationPath).key > path.key) {\n path = violationPath;\n }\n }\n }\n }\n }\n\n return path;\n }\n\n _getAttachmentPath() {\n const scopes = this.scopes;\n const scope = scopes.pop();\n if (!scope) return;\n\n if (scope.path.isFunction()) {\n if (this.hasOwnParamBindings(scope)) {\n if (this.scope === scope) return;\n const bodies = scope.path.get(\"body\").get(\"body\");\n\n for (let i = 0; i < bodies.length; i++) {\n if (bodies[i].node._blockHoist) continue;\n return bodies[i];\n }\n } else {\n return this.getNextScopeAttachmentParent();\n }\n } else if (scope.path.isProgram()) {\n return this.getNextScopeAttachmentParent();\n }\n }\n\n getNextScopeAttachmentParent() {\n const scope = this.scopes.pop();\n if (scope) return this.getAttachmentParentForPath(scope.path);\n }\n\n getAttachmentParentForPath(path) {\n do {\n if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {\n return path;\n }\n } while (path = path.parentPath);\n }\n\n hasOwnParamBindings(scope) {\n for (const name of Object.keys(this.bindings)) {\n if (!scope.hasOwnBinding(name)) continue;\n const binding = this.bindings[name];\n if (binding.kind === \"param\" && binding.constant) return true;\n }\n\n return false;\n }\n\n run() {\n this.path.traverse(referenceVisitor, this);\n if (this.mutableBinding) return;\n this.getCompatibleScopes();\n const attachTo = this.getAttachmentPath();\n if (!attachTo) return;\n if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return;\n let uid = attachTo.scope.generateUidIdentifier(\"ref\");\n const declarator = t.variableDeclarator(uid, this.path.node);\n const insertFn = this.attachAfter ? \"insertAfter\" : \"insertBefore\";\n const [attached] = attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : t.variableDeclaration(\"var\", [declarator])]);\n const parent = this.path.parentPath;\n\n if (parent.isJSXElement() && this.path.container === parent.node.children) {\n uid = t.JSXExpressionContainer(uid);\n }\n\n this.path.replaceWith(t.cloneNode(uid));\n return attachTo.isVariableDeclarator() ? attached.get(\"init\") : attached.get(\"declarations.0.init\");\n }\n\n}\n\nexports.default = PathHoister;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.hooks = void 0;\nconst hooks = [function (self, parent) {\n const removeParent = self.key === \"test\" && (parent.isWhile() || parent.isSwitchCase()) || self.key === \"declaration\" && parent.isExportDeclaration() || self.key === \"body\" && parent.isLabeledStatement() || self.listKey === \"declarations\" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === \"expression\" && parent.isExpressionStatement();\n\n if (removeParent) {\n parent.remove();\n return true;\n }\n}, function (self, parent) {\n if (parent.isSequenceExpression() && parent.node.expressions.length === 1) {\n parent.replaceWith(parent.node.expressions[0]);\n return true;\n }\n}, function (self, parent) {\n if (parent.isBinary()) {\n if (self.key === \"left\") {\n parent.replaceWith(parent.node.right);\n } else {\n parent.replaceWith(parent.node.left);\n }\n\n return true;\n }\n}, function (self, parent) {\n if (parent.isIfStatement() && (self.key === \"consequent\" || self.key === \"alternate\") || self.key === \"body\" && (parent.isLoop() || parent.isArrowFunctionExpression())) {\n self.replaceWith({\n type: \"BlockStatement\",\n body: []\n });\n return true;\n }\n}];\nexports.hooks = hooks;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ForAwaitStatement = exports.NumericLiteralTypeAnnotation = exports.ExistentialTypeParam = exports.SpreadProperty = exports.RestProperty = exports.Flow = exports.Pure = exports.Generated = exports.User = exports.Var = exports.BlockScoped = exports.Referenced = exports.Scope = exports.Expression = exports.Statement = exports.BindingIdentifier = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = void 0;\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nconst ReferencedIdentifier = {\n types: [\"Identifier\", \"JSXIdentifier\"],\n\n checkPath(path, opts) {\n const {\n node,\n parent\n } = path;\n\n if (!t.isIdentifier(node, opts) && !t.isJSXMemberExpression(parent, opts)) {\n if (t.isJSXIdentifier(node, opts)) {\n if (t.react.isCompatTag(node.name)) return false;\n } else {\n return false;\n }\n }\n\n return t.isReferenced(node, parent, path.parentPath.parent);\n }\n\n};\nexports.ReferencedIdentifier = ReferencedIdentifier;\nconst ReferencedMemberExpression = {\n types: [\"MemberExpression\"],\n\n checkPath({\n node,\n parent\n }) {\n return t.isMemberExpression(node) && t.isReferenced(node, parent);\n }\n\n};\nexports.ReferencedMemberExpression = ReferencedMemberExpression;\nconst BindingIdentifier = {\n types: [\"Identifier\"],\n\n checkPath(path) {\n const {\n node,\n parent\n } = path;\n const grandparent = path.parentPath.parent;\n return t.isIdentifier(node) && t.isBinding(node, parent, grandparent);\n }\n\n};\nexports.BindingIdentifier = BindingIdentifier;\nconst Statement = {\n types: [\"Statement\"],\n\n checkPath({\n node,\n parent\n }) {\n if (t.isStatement(node)) {\n if (t.isVariableDeclaration(node)) {\n if (t.isForXStatement(parent, {\n left: node\n })) return false;\n if (t.isForStatement(parent, {\n init: node\n })) return false;\n }\n\n return true;\n } else {\n return false;\n }\n }\n\n};\nexports.Statement = Statement;\nconst Expression = {\n types: [\"Expression\"],\n\n checkPath(path) {\n if (path.isIdentifier()) {\n return path.isReferencedIdentifier();\n } else {\n return t.isExpression(path.node);\n }\n }\n\n};\nexports.Expression = Expression;\nconst Scope = {\n types: [\"Scopable\", \"Pattern\"],\n\n checkPath(path) {\n return t.isScope(path.node, path.parent);\n }\n\n};\nexports.Scope = Scope;\nconst Referenced = {\n checkPath(path) {\n return t.isReferenced(path.node, path.parent);\n }\n\n};\nexports.Referenced = Referenced;\nconst BlockScoped = {\n checkPath(path) {\n return t.isBlockScoped(path.node);\n }\n\n};\nexports.BlockScoped = BlockScoped;\nconst Var = {\n types: [\"VariableDeclaration\"],\n\n checkPath(path) {\n return t.isVar(path.node);\n }\n\n};\nexports.Var = Var;\nconst User = {\n checkPath(path) {\n return path.node && !!path.node.loc;\n }\n\n};\nexports.User = User;\nconst Generated = {\n checkPath(path) {\n return !path.isUser();\n }\n\n};\nexports.Generated = Generated;\nconst Pure = {\n checkPath(path, opts) {\n return path.scope.isPure(path.node, opts);\n }\n\n};\nexports.Pure = Pure;\nconst Flow = {\n types: [\"Flow\", \"ImportDeclaration\", \"ExportDeclaration\", \"ImportSpecifier\"],\n\n checkPath({\n node\n }) {\n if (t.isFlow(node)) {\n return true;\n } else if (t.isImportDeclaration(node)) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n } else if (t.isExportDeclaration(node)) {\n return node.exportKind === \"type\";\n } else if (t.isImportSpecifier(node)) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n } else {\n return false;\n }\n }\n\n};\nexports.Flow = Flow;\nconst RestProperty = {\n types: [\"RestElement\"],\n\n checkPath(path) {\n return path.parentPath && path.parentPath.isObjectPattern();\n }\n\n};\nexports.RestProperty = RestProperty;\nconst SpreadProperty = {\n types: [\"RestElement\"],\n\n checkPath(path) {\n return path.parentPath && path.parentPath.isObjectExpression();\n }\n\n};\nexports.SpreadProperty = SpreadProperty;\nconst ExistentialTypeParam = {\n types: [\"ExistsTypeAnnotation\"]\n};\nexports.ExistentialTypeParam = ExistentialTypeParam;\nconst NumericLiteralTypeAnnotation = {\n types: [\"NumberLiteralTypeAnnotation\"]\n};\nexports.NumericLiteralTypeAnnotation = NumericLiteralTypeAnnotation;\nconst ForAwaitStatement = {\n types: [\"ForOfStatement\"],\n\n checkPath({\n node\n }) {\n return node.await === true;\n }\n\n};\nexports.ForAwaitStatement = ForAwaitStatement;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.insertBefore = insertBefore;\nexports._containerInsert = _containerInsert;\nexports._containerInsertBefore = _containerInsertBefore;\nexports._containerInsertAfter = _containerInsertAfter;\nexports.insertAfter = insertAfter;\nexports.updateSiblingKeys = updateSiblingKeys;\nexports._verifyNodeList = _verifyNodeList;\nexports.unshiftContainer = unshiftContainer;\nexports.pushContainer = pushContainer;\nexports.hoist = hoist;\n\nvar _cache = require(\"../cache\");\n\nvar _hoister = _interopRequireDefault(require(\"./lib/hoister\"));\n\nvar _index = _interopRequireDefault(require(\"./index\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction insertBefore(nodes) {\n this._assertUnremoved();\n\n nodes = this._verifyNodeList(nodes);\n const {\n parentPath\n } = this;\n\n if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {\n return parentPath.insertBefore(nodes);\n } else if (this.isNodeType(\"Expression\") && !this.isJSXElement() || parentPath.isForStatement() && this.key === \"init\") {\n if (this.node) nodes.push(this.node);\n return this.replaceExpressionWithStatements(nodes);\n } else if (Array.isArray(this.container)) {\n return this._containerInsertBefore(nodes);\n } else if (this.isStatementOrBlock()) {\n const shouldInsertCurrentNode = this.node && (!this.isExpressionStatement() || this.node.expression != null);\n this.replaceWith(t.blockStatement(shouldInsertCurrentNode ? [this.node] : []));\n return this.unshiftContainer(\"body\", nodes);\n } else {\n throw new Error(\"We don't know what to do with this node type. \" + \"We were previously a Statement but we can't fit in here?\");\n }\n}\n\nfunction _containerInsert(from, nodes) {\n this.updateSiblingKeys(from, nodes.length);\n const paths = [];\n this.container.splice(from, 0, ...nodes);\n\n for (let i = 0; i < nodes.length; i++) {\n const to = from + i;\n const path = this.getSibling(to);\n paths.push(path);\n\n if (this.context && this.context.queue) {\n path.pushContext(this.context);\n }\n }\n\n const contexts = this._getQueueContexts();\n\n for (const path of paths) {\n path.setScope();\n path.debug(\"Inserted.\");\n\n for (const context of contexts) {\n context.maybeQueue(path, true);\n }\n }\n\n return paths;\n}\n\nfunction _containerInsertBefore(nodes) {\n return this._containerInsert(this.key, nodes);\n}\n\nfunction _containerInsertAfter(nodes) {\n return this._containerInsert(this.key + 1, nodes);\n}\n\nfunction insertAfter(nodes) {\n this._assertUnremoved();\n\n nodes = this._verifyNodeList(nodes);\n const {\n parentPath\n } = this;\n\n if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {\n return parentPath.insertAfter(nodes.map(node => {\n return t.isExpression(node) ? t.expressionStatement(node) : node;\n }));\n } else if (this.isNodeType(\"Expression\") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === \"init\") {\n if (this.node) {\n let {\n scope\n } = this;\n\n if (parentPath.isMethod({\n computed: true,\n key: this.node\n })) {\n scope = scope.parent;\n }\n\n const temp = scope.generateDeclaredUidIdentifier();\n nodes.unshift(t.expressionStatement(t.assignmentExpression(\"=\", t.cloneNode(temp), this.node)));\n nodes.push(t.expressionStatement(t.cloneNode(temp)));\n }\n\n return this.replaceExpressionWithStatements(nodes);\n } else if (Array.isArray(this.container)) {\n return this._containerInsertAfter(nodes);\n } else if (this.isStatementOrBlock()) {\n const shouldInsertCurrentNode = this.node && (!this.isExpressionStatement() || this.node.expression != null);\n this.replaceWith(t.blockStatement(shouldInsertCurrentNode ? [this.node] : []));\n return this.pushContainer(\"body\", nodes);\n } else {\n throw new Error(\"We don't know what to do with this node type. \" + \"We were previously a Statement but we can't fit in here?\");\n }\n}\n\nfunction updateSiblingKeys(fromIndex, incrementBy) {\n if (!this.parent) return;\n\n const paths = _cache.path.get(this.parent);\n\n for (let i = 0; i < paths.length; i++) {\n const path = paths[i];\n\n if (path.key >= fromIndex) {\n path.key += incrementBy;\n }\n }\n}\n\nfunction _verifyNodeList(nodes) {\n if (!nodes) {\n return [];\n }\n\n if (nodes.constructor !== Array) {\n nodes = [nodes];\n }\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n let msg;\n\n if (!node) {\n msg = \"has falsy node\";\n } else if (typeof node !== \"object\") {\n msg = \"contains a non-object node\";\n } else if (!node.type) {\n msg = \"without a type\";\n } else if (node instanceof _index.default) {\n msg = \"has a NodePath when it expected a raw object\";\n }\n\n if (msg) {\n const type = Array.isArray(node) ? \"array\" : typeof node;\n throw new Error(`Node list ${msg} with the index of ${i} and type of ${type}`);\n }\n }\n\n return nodes;\n}\n\nfunction unshiftContainer(listKey, nodes) {\n this._assertUnremoved();\n\n nodes = this._verifyNodeList(nodes);\n\n const path = _index.default.get({\n parentPath: this,\n parent: this.node,\n container: this.node[listKey],\n listKey,\n key: 0\n });\n\n return path._containerInsertBefore(nodes);\n}\n\nfunction pushContainer(listKey, nodes) {\n this._assertUnremoved();\n\n nodes = this._verifyNodeList(nodes);\n const container = this.node[listKey];\n\n const path = _index.default.get({\n parentPath: this,\n parent: this.node,\n container: container,\n listKey,\n key: container.length\n });\n\n return path.replaceWithMultiple(nodes);\n}\n\nfunction hoist(scope = this.scope) {\n const hoister = new _hoister.default(this, scope);\n return hoister.run();\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.remove = remove;\nexports._removeFromScope = _removeFromScope;\nexports._callRemovalHooks = _callRemovalHooks;\nexports._remove = _remove;\nexports._markRemoved = _markRemoved;\nexports._assertUnremoved = _assertUnremoved;\n\nvar _removalHooks = require(\"./lib/removal-hooks\");\n\nvar _index = require(\"./index\");\n\nfunction remove() {\n var _this$opts;\n\n this._assertUnremoved();\n\n this.resync();\n\n if (!((_this$opts = this.opts) == null ? void 0 : _this$opts.noScope)) {\n this._removeFromScope();\n }\n\n if (this._callRemovalHooks()) {\n this._markRemoved();\n\n return;\n }\n\n this.shareCommentsWithSiblings();\n\n this._remove();\n\n this._markRemoved();\n}\n\nfunction _removeFromScope() {\n const bindings = this.getBindingIdentifiers();\n Object.keys(bindings).forEach(name => this.scope.removeBinding(name));\n}\n\nfunction _callRemovalHooks() {\n for (const fn of _removalHooks.hooks) {\n if (fn(this, this.parentPath)) return true;\n }\n}\n\nfunction _remove() {\n if (Array.isArray(this.container)) {\n this.container.splice(this.key, 1);\n this.updateSiblingKeys(this.key, -1);\n } else {\n this._replaceWith(null);\n }\n}\n\nfunction _markRemoved() {\n this._traverseFlags |= _index.SHOULD_SKIP | _index.REMOVED;\n this.node = null;\n}\n\nfunction _assertUnremoved() {\n if (this.removed) {\n throw this.buildCodeFrameError(\"NodePath has been removed so is read-only.\");\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.replaceWithMultiple = replaceWithMultiple;\nexports.replaceWithSourceString = replaceWithSourceString;\nexports.replaceWith = replaceWith;\nexports._replaceWith = _replaceWith;\nexports.replaceExpressionWithStatements = replaceExpressionWithStatements;\nexports.replaceInline = replaceInline;\n\nvar _codeFrame = require(\"@babel/code-frame\");\n\nvar _index = _interopRequireDefault(require(\"../index\"));\n\nvar _index2 = _interopRequireDefault(require(\"./index\"));\n\nvar _parser = require(\"@babel/parser\");\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst hoistVariablesVisitor = {\n Function(path) {\n path.skip();\n },\n\n VariableDeclaration(path) {\n if (path.node.kind !== \"var\") return;\n const bindings = path.getBindingIdentifiers();\n\n for (const key of Object.keys(bindings)) {\n path.scope.push({\n id: bindings[key]\n });\n }\n\n const exprs = [];\n\n for (const declar of path.node.declarations) {\n if (declar.init) {\n exprs.push(t.expressionStatement(t.assignmentExpression(\"=\", declar.id, declar.init)));\n }\n }\n\n path.replaceWithMultiple(exprs);\n }\n\n};\n\nfunction replaceWithMultiple(nodes) {\n this.resync();\n nodes = this._verifyNodeList(nodes);\n t.inheritLeadingComments(nodes[0], this.node);\n t.inheritTrailingComments(nodes[nodes.length - 1], this.node);\n this.node = this.container[this.key] = null;\n const paths = this.insertAfter(nodes);\n\n if (this.node) {\n this.requeue();\n } else {\n this.remove();\n }\n\n return paths;\n}\n\nfunction replaceWithSourceString(replacement) {\n this.resync();\n\n try {\n replacement = `(${replacement})`;\n replacement = (0, _parser.parse)(replacement);\n } catch (err) {\n const loc = err.loc;\n\n if (loc) {\n err.message += \" - make sure this is an expression.\\n\" + (0, _codeFrame.codeFrameColumns)(replacement, {\n start: {\n line: loc.line,\n column: loc.column + 1\n }\n });\n err.code = \"BABEL_REPLACE_SOURCE_ERROR\";\n }\n\n throw err;\n }\n\n replacement = replacement.program.body[0].expression;\n\n _index.default.removeProperties(replacement);\n\n return this.replaceWith(replacement);\n}\n\nfunction replaceWith(replacement) {\n this.resync();\n\n if (this.removed) {\n throw new Error(\"You can't replace this node, we've already removed it\");\n }\n\n if (replacement instanceof _index2.default) {\n replacement = replacement.node;\n }\n\n if (!replacement) {\n throw new Error(\"You passed `path.replaceWith()` a falsy node, use `path.remove()` instead\");\n }\n\n if (this.node === replacement) {\n return [this];\n }\n\n if (this.isProgram() && !t.isProgram(replacement)) {\n throw new Error(\"You can only replace a Program root node with another Program node\");\n }\n\n if (Array.isArray(replacement)) {\n throw new Error(\"Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`\");\n }\n\n if (typeof replacement === \"string\") {\n throw new Error(\"Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`\");\n }\n\n let nodePath = \"\";\n\n if (this.isNodeType(\"Statement\") && t.isExpression(replacement)) {\n if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement) && !this.parentPath.isExportDefaultDeclaration()) {\n replacement = t.expressionStatement(replacement);\n nodePath = \"expression\";\n }\n }\n\n if (this.isNodeType(\"Expression\") && t.isStatement(replacement)) {\n if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) {\n return this.replaceExpressionWithStatements([replacement]);\n }\n }\n\n const oldNode = this.node;\n\n if (oldNode) {\n t.inheritsComments(replacement, oldNode);\n t.removeComments(oldNode);\n }\n\n this._replaceWith(replacement);\n\n this.type = replacement.type;\n this.setScope();\n this.requeue();\n return [nodePath ? this.get(nodePath) : this];\n}\n\nfunction _replaceWith(node) {\n if (!this.container) {\n throw new ReferenceError(\"Container is falsy\");\n }\n\n if (this.inList) {\n t.validate(this.parent, this.key, [node]);\n } else {\n t.validate(this.parent, this.key, node);\n }\n\n this.debug(`Replace with ${node == null ? void 0 : node.type}`);\n this.node = this.container[this.key] = node;\n}\n\nfunction replaceExpressionWithStatements(nodes) {\n this.resync();\n const toSequenceExpression = t.toSequenceExpression(nodes, this.scope);\n\n if (toSequenceExpression) {\n return this.replaceWith(toSequenceExpression)[0].get(\"expressions\");\n }\n\n const functionParent = this.getFunctionParent();\n const isParentAsync = functionParent == null ? void 0 : functionParent.is(\"async\");\n const container = t.arrowFunctionExpression([], t.blockStatement(nodes));\n this.replaceWith(t.callExpression(container, []));\n this.traverse(hoistVariablesVisitor);\n const completionRecords = this.get(\"callee\").getCompletionRecords();\n\n for (const path of completionRecords) {\n if (!path.isExpressionStatement()) continue;\n const loop = path.findParent(path => path.isLoop());\n\n if (loop) {\n let uid = loop.getData(\"expressionReplacementReturnUid\");\n\n if (!uid) {\n const callee = this.get(\"callee\");\n uid = callee.scope.generateDeclaredUidIdentifier(\"ret\");\n callee.get(\"body\").pushContainer(\"body\", t.returnStatement(t.cloneNode(uid)));\n loop.setData(\"expressionReplacementReturnUid\", uid);\n } else {\n uid = t.identifier(uid.name);\n }\n\n path.get(\"expression\").replaceWith(t.assignmentExpression(\"=\", t.cloneNode(uid), path.node.expression));\n } else {\n path.replaceWith(t.returnStatement(path.node.expression));\n }\n }\n\n const callee = this.get(\"callee\");\n callee.arrowFunctionToExpression();\n\n if (isParentAsync && _index.default.hasType(this.get(\"callee.body\").node, \"AwaitExpression\", t.FUNCTION_TYPES)) {\n callee.set(\"async\", true);\n this.replaceWith(t.awaitExpression(this.node));\n }\n\n return callee.get(\"body.body\");\n}\n\nfunction replaceInline(nodes) {\n this.resync();\n\n if (Array.isArray(nodes)) {\n if (Array.isArray(this.container)) {\n nodes = this._verifyNodeList(nodes);\n\n const paths = this._containerInsertAfter(nodes);\n\n this.remove();\n return paths;\n } else {\n return this.replaceWithMultiple(nodes);\n }\n } else {\n return this.replaceWith(nodes);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nclass Binding {\n constructor({\n identifier,\n scope,\n path,\n kind\n }) {\n this.constantViolations = [];\n this.constant = true;\n this.referencePaths = [];\n this.referenced = false;\n this.references = 0;\n this.identifier = identifier;\n this.scope = scope;\n this.path = path;\n this.kind = kind;\n this.clearValue();\n }\n\n deoptValue() {\n this.clearValue();\n this.hasDeoptedValue = true;\n }\n\n setValue(value) {\n if (this.hasDeoptedValue) return;\n this.hasValue = true;\n this.value = value;\n }\n\n clearValue() {\n this.hasDeoptedValue = false;\n this.hasValue = false;\n this.value = null;\n }\n\n reassign(path) {\n this.constant = false;\n\n if (this.constantViolations.indexOf(path) !== -1) {\n return;\n }\n\n this.constantViolations.push(path);\n }\n\n reference(path) {\n if (this.referencePaths.indexOf(path) !== -1) {\n return;\n }\n\n this.referenced = true;\n this.references++;\n this.referencePaths.push(path);\n }\n\n dereference() {\n this.references--;\n this.referenced = !!this.references;\n }\n\n}\n\nexports.default = Binding;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _renamer = _interopRequireDefault(require(\"./lib/renamer\"));\n\nvar _index = _interopRequireDefault(require(\"../index\"));\n\nvar _binding = _interopRequireDefault(require(\"./binding\"));\n\nvar _globals = _interopRequireDefault(require(\"globals\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nvar _cache = require(\"../cache\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction gatherNodeParts(node, parts) {\n switch (node == null ? void 0 : node.type) {\n default:\n if (t.isModuleDeclaration(node)) {\n if (node.source) {\n gatherNodeParts(node.source, parts);\n } else if (node.specifiers && node.specifiers.length) {\n for (const e of node.specifiers) gatherNodeParts(e, parts);\n } else if (node.declaration) {\n gatherNodeParts(node.declaration, parts);\n }\n } else if (t.isModuleSpecifier(node)) {\n gatherNodeParts(node.local, parts);\n } else if (t.isLiteral(node)) {\n parts.push(node.value);\n }\n\n break;\n\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n case \"JSXMemberExpression\":\n gatherNodeParts(node.object, parts);\n gatherNodeParts(node.property, parts);\n break;\n\n case \"Identifier\":\n case \"JSXIdentifier\":\n parts.push(node.name);\n break;\n\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n case \"NewExpression\":\n gatherNodeParts(node.callee, parts);\n break;\n\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n for (const e of node.properties) {\n gatherNodeParts(e, parts);\n }\n\n break;\n\n case \"SpreadElement\":\n case \"RestElement\":\n gatherNodeParts(node.argument, parts);\n break;\n\n case \"ObjectProperty\":\n case \"ObjectMethod\":\n case \"ClassProperty\":\n case \"ClassMethod\":\n case \"ClassPrivateProperty\":\n case \"ClassPrivateMethod\":\n gatherNodeParts(node.key, parts);\n break;\n\n case \"ThisExpression\":\n parts.push(\"this\");\n break;\n\n case \"Super\":\n parts.push(\"super\");\n break;\n\n case \"Import\":\n parts.push(\"import\");\n break;\n\n case \"DoExpression\":\n parts.push(\"do\");\n break;\n\n case \"YieldExpression\":\n parts.push(\"yield\");\n gatherNodeParts(node.argument, parts);\n break;\n\n case \"AwaitExpression\":\n parts.push(\"await\");\n gatherNodeParts(node.argument, parts);\n break;\n\n case \"AssignmentExpression\":\n gatherNodeParts(node.left, parts);\n break;\n\n case \"VariableDeclarator\":\n gatherNodeParts(node.id, parts);\n break;\n\n case \"FunctionExpression\":\n case \"FunctionDeclaration\":\n case \"ClassExpression\":\n case \"ClassDeclaration\":\n gatherNodeParts(node.id, parts);\n break;\n\n case \"PrivateName\":\n gatherNodeParts(node.id, parts);\n break;\n\n case \"ParenthesizedExpression\":\n gatherNodeParts(node.expression, parts);\n break;\n\n case \"UnaryExpression\":\n case \"UpdateExpression\":\n gatherNodeParts(node.argument, parts);\n break;\n\n case \"MetaProperty\":\n gatherNodeParts(node.meta, parts);\n gatherNodeParts(node.property, parts);\n break;\n\n case \"JSXElement\":\n gatherNodeParts(node.openingElement, parts);\n break;\n\n case \"JSXOpeningElement\":\n parts.push(node.name);\n break;\n\n case \"JSXFragment\":\n gatherNodeParts(node.openingFragment, parts);\n break;\n\n case \"JSXOpeningFragment\":\n parts.push(\"Fragment\");\n break;\n\n case \"JSXNamespacedName\":\n gatherNodeParts(node.namespace, parts);\n gatherNodeParts(node.name, parts);\n break;\n }\n}\n\nconst collectorVisitor = {\n For(path) {\n for (const key of t.FOR_INIT_KEYS) {\n const declar = path.get(key);\n\n if (declar.isVar()) {\n const parentScope = path.scope.getFunctionParent() || path.scope.getProgramParent();\n parentScope.registerBinding(\"var\", declar);\n }\n }\n },\n\n Declaration(path) {\n if (path.isBlockScoped()) return;\n\n if (path.isExportDeclaration() && path.get(\"declaration\").isDeclaration()) {\n return;\n }\n\n const parent = path.scope.getFunctionParent() || path.scope.getProgramParent();\n parent.registerDeclaration(path);\n },\n\n ReferencedIdentifier(path, state) {\n state.references.push(path);\n },\n\n ForXStatement(path, state) {\n const left = path.get(\"left\");\n\n if (left.isPattern() || left.isIdentifier()) {\n state.constantViolations.push(path);\n }\n },\n\n ExportDeclaration: {\n exit(path) {\n const {\n node,\n scope\n } = path;\n const declar = node.declaration;\n\n if (t.isClassDeclaration(declar) || t.isFunctionDeclaration(declar)) {\n const id = declar.id;\n if (!id) return;\n const binding = scope.getBinding(id.name);\n if (binding) binding.reference(path);\n } else if (t.isVariableDeclaration(declar)) {\n for (const decl of declar.declarations) {\n for (const name of Object.keys(t.getBindingIdentifiers(decl))) {\n const binding = scope.getBinding(name);\n if (binding) binding.reference(path);\n }\n }\n }\n }\n\n },\n\n LabeledStatement(path) {\n path.scope.getProgramParent().addGlobal(path.node);\n path.scope.getBlockParent().registerDeclaration(path);\n },\n\n AssignmentExpression(path, state) {\n state.assignments.push(path);\n },\n\n UpdateExpression(path, state) {\n state.constantViolations.push(path);\n },\n\n UnaryExpression(path, state) {\n if (path.node.operator === \"delete\") {\n state.constantViolations.push(path);\n }\n },\n\n BlockScoped(path) {\n let scope = path.scope;\n if (scope.path === path) scope = scope.parent;\n const parent = scope.getBlockParent();\n parent.registerDeclaration(path);\n\n if (path.isClassDeclaration() && path.node.id) {\n const id = path.node.id;\n const name = id.name;\n path.scope.bindings[name] = path.scope.parent.getBinding(name);\n }\n },\n\n Block(path) {\n const paths = path.get(\"body\");\n\n for (const bodyPath of paths) {\n if (bodyPath.isFunctionDeclaration()) {\n path.scope.getBlockParent().registerDeclaration(bodyPath);\n }\n }\n },\n\n CatchClause(path) {\n path.scope.registerBinding(\"let\", path);\n },\n\n Function(path) {\n if (path.isFunctionExpression() && path.has(\"id\") && !path.get(\"id\").node[t.NOT_LOCAL_BINDING]) {\n path.scope.registerBinding(\"local\", path.get(\"id\"), path);\n }\n\n const params = path.get(\"params\");\n\n for (const param of params) {\n path.scope.registerBinding(\"param\", param);\n }\n },\n\n ClassExpression(path) {\n if (path.has(\"id\") && !path.get(\"id\").node[t.NOT_LOCAL_BINDING]) {\n path.scope.registerBinding(\"local\", path);\n }\n }\n\n};\nlet uid = 0;\n\nclass Scope {\n constructor(path) {\n const {\n node\n } = path;\n\n const cached = _cache.scope.get(node);\n\n if ((cached == null ? void 0 : cached.path) === path) {\n return cached;\n }\n\n _cache.scope.set(node, this);\n\n this.uid = uid++;\n this.block = node;\n this.path = path;\n this.labels = new Map();\n this.inited = false;\n }\n\n get parent() {\n const parent = this.path.findParent(p => p.isScope());\n return parent == null ? void 0 : parent.scope;\n }\n\n get parentBlock() {\n return this.path.parent;\n }\n\n get hub() {\n return this.path.hub;\n }\n\n traverse(node, opts, state) {\n (0, _index.default)(node, opts, this, state, this.path);\n }\n\n generateDeclaredUidIdentifier(name) {\n const id = this.generateUidIdentifier(name);\n this.push({\n id\n });\n return t.cloneNode(id);\n }\n\n generateUidIdentifier(name) {\n return t.identifier(this.generateUid(name));\n }\n\n generateUid(name = \"temp\") {\n name = t.toIdentifier(name).replace(/^_+/, \"\").replace(/[0-9]+$/g, \"\");\n let uid;\n let i = 1;\n\n do {\n uid = this._generateUid(name, i);\n i++;\n } while (this.hasLabel(uid) || this.hasBinding(uid) || this.hasGlobal(uid) || this.hasReference(uid));\n\n const program = this.getProgramParent();\n program.references[uid] = true;\n program.uids[uid] = true;\n return uid;\n }\n\n _generateUid(name, i) {\n let id = name;\n if (i > 1) id += i;\n return `_${id}`;\n }\n\n generateUidBasedOnNode(node, defaultName) {\n const parts = [];\n gatherNodeParts(node, parts);\n let id = parts.join(\"$\");\n id = id.replace(/^_/, \"\") || defaultName || \"ref\";\n return this.generateUid(id.slice(0, 20));\n }\n\n generateUidIdentifierBasedOnNode(node, defaultName) {\n return t.identifier(this.generateUidBasedOnNode(node, defaultName));\n }\n\n isStatic(node) {\n if (t.isThisExpression(node) || t.isSuper(node)) {\n return true;\n }\n\n if (t.isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n\n if (binding) {\n return binding.constant;\n } else {\n return this.hasBinding(node.name);\n }\n }\n\n return false;\n }\n\n maybeGenerateMemoised(node, dontPush) {\n if (this.isStatic(node)) {\n return null;\n } else {\n const id = this.generateUidIdentifierBasedOnNode(node);\n\n if (!dontPush) {\n this.push({\n id\n });\n return t.cloneNode(id);\n }\n\n return id;\n }\n }\n\n checkBlockScopedCollisions(local, kind, name, id) {\n if (kind === \"param\") return;\n if (local.kind === \"local\") return;\n const duplicate = kind === \"let\" || local.kind === \"let\" || local.kind === \"const\" || local.kind === \"module\" || local.kind === \"param\" && (kind === \"let\" || kind === \"const\");\n\n if (duplicate) {\n throw this.hub.buildError(id, `Duplicate declaration \"${name}\"`, TypeError);\n }\n }\n\n rename(oldName, newName, block) {\n const binding = this.getBinding(oldName);\n\n if (binding) {\n newName = newName || this.generateUidIdentifier(oldName).name;\n return new _renamer.default(binding, oldName, newName).rename(block);\n }\n }\n\n _renameFromMap(map, oldName, newName, value) {\n if (map[oldName]) {\n map[newName] = value;\n map[oldName] = null;\n }\n }\n\n dump() {\n const sep = \"-\".repeat(60);\n console.log(sep);\n let scope = this;\n\n do {\n console.log(\"#\", scope.block.type);\n\n for (const name of Object.keys(scope.bindings)) {\n const binding = scope.bindings[name];\n console.log(\" -\", name, {\n constant: binding.constant,\n references: binding.references,\n violations: binding.constantViolations.length,\n kind: binding.kind\n });\n }\n } while (scope = scope.parent);\n\n console.log(sep);\n }\n\n toArray(node, i, allowArrayLike) {\n if (t.isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n\n if ((binding == null ? void 0 : binding.constant) && binding.path.isGenericType(\"Array\")) {\n return node;\n }\n }\n\n if (t.isArrayExpression(node)) {\n return node;\n }\n\n if (t.isIdentifier(node, {\n name: \"arguments\"\n })) {\n return t.callExpression(t.memberExpression(t.memberExpression(t.memberExpression(t.identifier(\"Array\"), t.identifier(\"prototype\")), t.identifier(\"slice\")), t.identifier(\"call\")), [node]);\n }\n\n let helperName;\n const args = [node];\n\n if (i === true) {\n helperName = \"toConsumableArray\";\n } else if (i) {\n args.push(t.numericLiteral(i));\n helperName = \"slicedToArray\";\n } else {\n helperName = \"toArray\";\n }\n\n if (allowArrayLike) {\n args.unshift(this.hub.addHelper(helperName));\n helperName = \"maybeArrayLike\";\n }\n\n return t.callExpression(this.hub.addHelper(helperName), args);\n }\n\n hasLabel(name) {\n return !!this.getLabel(name);\n }\n\n getLabel(name) {\n return this.labels.get(name);\n }\n\n registerLabel(path) {\n this.labels.set(path.node.label.name, path);\n }\n\n registerDeclaration(path) {\n if (path.isLabeledStatement()) {\n this.registerLabel(path);\n } else if (path.isFunctionDeclaration()) {\n this.registerBinding(\"hoisted\", path.get(\"id\"), path);\n } else if (path.isVariableDeclaration()) {\n const declarations = path.get(\"declarations\");\n\n for (const declar of declarations) {\n this.registerBinding(path.node.kind, declar);\n }\n } else if (path.isClassDeclaration()) {\n this.registerBinding(\"let\", path);\n } else if (path.isImportDeclaration()) {\n const specifiers = path.get(\"specifiers\");\n\n for (const specifier of specifiers) {\n this.registerBinding(\"module\", specifier);\n }\n } else if (path.isExportDeclaration()) {\n const declar = path.get(\"declaration\");\n\n if (declar.isClassDeclaration() || declar.isFunctionDeclaration() || declar.isVariableDeclaration()) {\n this.registerDeclaration(declar);\n }\n } else {\n this.registerBinding(\"unknown\", path);\n }\n }\n\n buildUndefinedNode() {\n return t.unaryExpression(\"void\", t.numericLiteral(0), true);\n }\n\n registerConstantViolation(path) {\n const ids = path.getBindingIdentifiers();\n\n for (const name of Object.keys(ids)) {\n const binding = this.getBinding(name);\n if (binding) binding.reassign(path);\n }\n }\n\n registerBinding(kind, path, bindingPath = path) {\n if (!kind) throw new ReferenceError(\"no `kind`\");\n\n if (path.isVariableDeclaration()) {\n const declarators = path.get(\"declarations\");\n\n for (const declar of declarators) {\n this.registerBinding(kind, declar);\n }\n\n return;\n }\n\n const parent = this.getProgramParent();\n const ids = path.getOuterBindingIdentifiers(true);\n\n for (const name of Object.keys(ids)) {\n parent.references[name] = true;\n\n for (const id of ids[name]) {\n const local = this.getOwnBinding(name);\n\n if (local) {\n if (local.identifier === id) continue;\n this.checkBlockScopedCollisions(local, kind, name, id);\n }\n\n if (local) {\n this.registerConstantViolation(bindingPath);\n } else {\n this.bindings[name] = new _binding.default({\n identifier: id,\n scope: this,\n path: bindingPath,\n kind: kind\n });\n }\n }\n }\n }\n\n addGlobal(node) {\n this.globals[node.name] = node;\n }\n\n hasUid(name) {\n let scope = this;\n\n do {\n if (scope.uids[name]) return true;\n } while (scope = scope.parent);\n\n return false;\n }\n\n hasGlobal(name) {\n let scope = this;\n\n do {\n if (scope.globals[name]) return true;\n } while (scope = scope.parent);\n\n return false;\n }\n\n hasReference(name) {\n return !!this.getProgramParent().references[name];\n }\n\n isPure(node, constantsOnly) {\n if (t.isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n if (!binding) return false;\n if (constantsOnly) return binding.constant;\n return true;\n } else if (t.isClass(node)) {\n if (node.superClass && !this.isPure(node.superClass, constantsOnly)) {\n return false;\n }\n\n return this.isPure(node.body, constantsOnly);\n } else if (t.isClassBody(node)) {\n for (const method of node.body) {\n if (!this.isPure(method, constantsOnly)) return false;\n }\n\n return true;\n } else if (t.isBinary(node)) {\n return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly);\n } else if (t.isArrayExpression(node)) {\n for (const elem of node.elements) {\n if (!this.isPure(elem, constantsOnly)) return false;\n }\n\n return true;\n } else if (t.isObjectExpression(node)) {\n for (const prop of node.properties) {\n if (!this.isPure(prop, constantsOnly)) return false;\n }\n\n return true;\n } else if (t.isMethod(node)) {\n if (node.computed && !this.isPure(node.key, constantsOnly)) return false;\n if (node.kind === \"get\" || node.kind === \"set\") return false;\n return true;\n } else if (t.isProperty(node)) {\n if (node.computed && !this.isPure(node.key, constantsOnly)) return false;\n return this.isPure(node.value, constantsOnly);\n } else if (t.isUnaryExpression(node)) {\n return this.isPure(node.argument, constantsOnly);\n } else if (t.isTaggedTemplateExpression(node)) {\n return t.matchesPattern(node.tag, \"String.raw\") && !this.hasBinding(\"String\", true) && this.isPure(node.quasi, constantsOnly);\n } else if (t.isTemplateLiteral(node)) {\n for (const expression of node.expressions) {\n if (!this.isPure(expression, constantsOnly)) return false;\n }\n\n return true;\n } else {\n return t.isPureish(node);\n }\n }\n\n setData(key, val) {\n return this.data[key] = val;\n }\n\n getData(key) {\n let scope = this;\n\n do {\n const data = scope.data[key];\n if (data != null) return data;\n } while (scope = scope.parent);\n }\n\n removeData(key) {\n let scope = this;\n\n do {\n const data = scope.data[key];\n if (data != null) scope.data[key] = null;\n } while (scope = scope.parent);\n }\n\n init() {\n if (!this.inited) {\n this.inited = true;\n this.crawl();\n }\n }\n\n crawl() {\n const path = this.path;\n this.references = Object.create(null);\n this.bindings = Object.create(null);\n this.globals = Object.create(null);\n this.uids = Object.create(null);\n this.data = Object.create(null);\n\n if (path.isFunction()) {\n if (path.isFunctionExpression() && path.has(\"id\") && !path.get(\"id\").node[t.NOT_LOCAL_BINDING]) {\n this.registerBinding(\"local\", path.get(\"id\"), path);\n }\n\n const params = path.get(\"params\");\n\n for (const param of params) {\n this.registerBinding(\"param\", param);\n }\n }\n\n const programParent = this.getProgramParent();\n if (programParent.crawling) return;\n const state = {\n references: [],\n constantViolations: [],\n assignments: []\n };\n this.crawling = true;\n path.traverse(collectorVisitor, state);\n this.crawling = false;\n\n for (const path of state.assignments) {\n const ids = path.getBindingIdentifiers();\n\n for (const name of Object.keys(ids)) {\n if (path.scope.getBinding(name)) continue;\n programParent.addGlobal(ids[name]);\n }\n\n path.scope.registerConstantViolation(path);\n }\n\n for (const ref of state.references) {\n const binding = ref.scope.getBinding(ref.node.name);\n\n if (binding) {\n binding.reference(ref);\n } else {\n programParent.addGlobal(ref.node);\n }\n }\n\n for (const path of state.constantViolations) {\n path.scope.registerConstantViolation(path);\n }\n }\n\n push(opts) {\n let path = this.path;\n\n if (!path.isBlockStatement() && !path.isProgram()) {\n path = this.getBlockParent().path;\n }\n\n if (path.isSwitchStatement()) {\n path = (this.getFunctionParent() || this.getProgramParent()).path;\n }\n\n if (path.isLoop() || path.isCatchClause() || path.isFunction()) {\n path.ensureBlock();\n path = path.get(\"body\");\n }\n\n const unique = opts.unique;\n const kind = opts.kind || \"var\";\n const blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;\n const dataKey = `declaration:${kind}:${blockHoist}`;\n let declarPath = !unique && path.getData(dataKey);\n\n if (!declarPath) {\n const declar = t.variableDeclaration(kind, []);\n declar._blockHoist = blockHoist;\n [declarPath] = path.unshiftContainer(\"body\", [declar]);\n if (!unique) path.setData(dataKey, declarPath);\n }\n\n const declarator = t.variableDeclarator(opts.id, opts.init);\n declarPath.node.declarations.push(declarator);\n this.registerBinding(kind, declarPath.get(\"declarations\").pop());\n }\n\n getProgramParent() {\n let scope = this;\n\n do {\n if (scope.path.isProgram()) {\n return scope;\n }\n } while (scope = scope.parent);\n\n throw new Error(\"Couldn't find a Program\");\n }\n\n getFunctionParent() {\n let scope = this;\n\n do {\n if (scope.path.isFunctionParent()) {\n return scope;\n }\n } while (scope = scope.parent);\n\n return null;\n }\n\n getBlockParent() {\n let scope = this;\n\n do {\n if (scope.path.isBlockParent()) {\n return scope;\n }\n } while (scope = scope.parent);\n\n throw new Error(\"We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...\");\n }\n\n getAllBindings() {\n const ids = Object.create(null);\n let scope = this;\n\n do {\n for (const key of Object.keys(scope.bindings)) {\n if (key in ids === false) {\n ids[key] = scope.bindings[key];\n }\n }\n\n scope = scope.parent;\n } while (scope);\n\n return ids;\n }\n\n getAllBindingsOfKind() {\n const ids = Object.create(null);\n\n for (const kind of arguments) {\n let scope = this;\n\n do {\n for (const name of Object.keys(scope.bindings)) {\n const binding = scope.bindings[name];\n if (binding.kind === kind) ids[name] = binding;\n }\n\n scope = scope.parent;\n } while (scope);\n }\n\n return ids;\n }\n\n bindingIdentifierEquals(name, node) {\n return this.getBindingIdentifier(name) === node;\n }\n\n getBinding(name) {\n let scope = this;\n let previousPath;\n\n do {\n const binding = scope.getOwnBinding(name);\n\n if (binding) {\n var _previousPath;\n\n if (((_previousPath = previousPath) == null ? void 0 : _previousPath.isPattern()) && binding.kind !== \"param\") {} else {\n return binding;\n }\n }\n\n previousPath = scope.path;\n } while (scope = scope.parent);\n }\n\n getOwnBinding(name) {\n return this.bindings[name];\n }\n\n getBindingIdentifier(name) {\n var _this$getBinding;\n\n return (_this$getBinding = this.getBinding(name)) == null ? void 0 : _this$getBinding.identifier;\n }\n\n getOwnBindingIdentifier(name) {\n const binding = this.bindings[name];\n return binding == null ? void 0 : binding.identifier;\n }\n\n hasOwnBinding(name) {\n return !!this.getOwnBinding(name);\n }\n\n hasBinding(name, noGlobals) {\n if (!name) return false;\n if (this.hasOwnBinding(name)) return true;\n if (this.parentHasBinding(name, noGlobals)) return true;\n if (this.hasUid(name)) return true;\n if (!noGlobals && Scope.globals.includes(name)) return true;\n if (!noGlobals && Scope.contextVariables.includes(name)) return true;\n return false;\n }\n\n parentHasBinding(name, noGlobals) {\n var _this$parent;\n\n return (_this$parent = this.parent) == null ? void 0 : _this$parent.hasBinding(name, noGlobals);\n }\n\n moveBindingTo(name, scope) {\n const info = this.getBinding(name);\n\n if (info) {\n info.scope.removeOwnBinding(name);\n info.scope = scope;\n scope.bindings[name] = info;\n }\n }\n\n removeOwnBinding(name) {\n delete this.bindings[name];\n }\n\n removeBinding(name) {\n var _this$getBinding2;\n\n (_this$getBinding2 = this.getBinding(name)) == null ? void 0 : _this$getBinding2.scope.removeOwnBinding(name);\n let scope = this;\n\n do {\n if (scope.uids[name]) {\n scope.uids[name] = false;\n }\n } while (scope = scope.parent);\n }\n\n}\n\nexports.default = Scope;\nScope.globals = Object.keys(_globals.default.builtin);\nScope.contextVariables = [\"arguments\", \"undefined\", \"Infinity\", \"NaN\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _binding = _interopRequireDefault(require(\"../binding\"));\n\nvar _helperSplitExportDeclaration = _interopRequireDefault(require(\"@babel/helper-split-export-declaration\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst renameVisitor = {\n ReferencedIdentifier({\n node\n }, state) {\n if (node.name === state.oldName) {\n node.name = state.newName;\n }\n },\n\n Scope(path, state) {\n if (!path.scope.bindingIdentifierEquals(state.oldName, state.binding.identifier)) {\n path.skip();\n }\n },\n\n \"AssignmentExpression|Declaration|VariableDeclarator\"(path, state) {\n if (path.isVariableDeclaration()) return;\n const ids = path.getOuterBindingIdentifiers();\n\n for (const name in ids) {\n if (name === state.oldName) ids[name].name = state.newName;\n }\n }\n\n};\n\nclass Renamer {\n constructor(binding, oldName, newName) {\n this.newName = newName;\n this.oldName = oldName;\n this.binding = binding;\n }\n\n maybeConvertFromExportDeclaration(parentDeclar) {\n const maybeExportDeclar = parentDeclar.parentPath;\n\n if (!maybeExportDeclar.isExportDeclaration()) {\n return;\n }\n\n if (maybeExportDeclar.isExportDefaultDeclaration() && !maybeExportDeclar.get(\"declaration\").node.id) {\n return;\n }\n\n (0, _helperSplitExportDeclaration.default)(maybeExportDeclar);\n }\n\n maybeConvertFromClassFunctionDeclaration(path) {\n return;\n if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return;\n if (this.binding.kind !== \"hoisted\") return;\n path.node.id = t.identifier(this.oldName);\n path.node._blockHoist = 3;\n path.replaceWith(t.variableDeclaration(\"let\", [t.variableDeclarator(t.identifier(this.newName), t.toExpression(path.node))]));\n }\n\n maybeConvertFromClassFunctionExpression(path) {\n return;\n if (!path.isFunctionExpression() && !path.isClassExpression()) return;\n if (this.binding.kind !== \"local\") return;\n path.node.id = t.identifier(this.oldName);\n this.binding.scope.parent.push({\n id: t.identifier(this.newName)\n });\n path.replaceWith(t.assignmentExpression(\"=\", t.identifier(this.newName), path.node));\n }\n\n rename(block) {\n const {\n binding,\n oldName,\n newName\n } = this;\n const {\n scope,\n path\n } = binding;\n const parentDeclar = path.find(path => path.isDeclaration() || path.isFunctionExpression() || path.isClassExpression());\n\n if (parentDeclar) {\n const bindingIds = parentDeclar.getOuterBindingIdentifiers();\n\n if (bindingIds[oldName] === binding.identifier) {\n this.maybeConvertFromExportDeclaration(parentDeclar);\n }\n }\n\n scope.traverse(block || scope.block, renameVisitor, this);\n\n if (!block) {\n scope.removeOwnBinding(oldName);\n scope.bindings[newName] = binding;\n this.binding.identifier.name = newName;\n }\n\n if (binding.type === \"hoisted\") {}\n\n if (parentDeclar) {\n this.maybeConvertFromClassFunctionDeclaration(parentDeclar);\n this.maybeConvertFromClassFunctionExpression(parentDeclar);\n }\n }\n\n}\n\nexports.default = Renamer;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.explode = explode;\nexports.verify = verify;\nexports.merge = merge;\n\nvar virtualTypes = _interopRequireWildcard(require(\"./path/lib/virtual-types\"));\n\nvar t = _interopRequireWildcard(require(\"@babel/types\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction explode(visitor) {\n if (visitor._exploded) return visitor;\n visitor._exploded = true;\n\n for (const nodeType of Object.keys(visitor)) {\n if (shouldIgnoreKey(nodeType)) continue;\n const parts = nodeType.split(\"|\");\n if (parts.length === 1) continue;\n const fns = visitor[nodeType];\n delete visitor[nodeType];\n\n for (const part of parts) {\n visitor[part] = fns;\n }\n }\n\n verify(visitor);\n delete visitor.__esModule;\n ensureEntranceObjects(visitor);\n ensureCallbackArrays(visitor);\n\n for (const nodeType of Object.keys(visitor)) {\n if (shouldIgnoreKey(nodeType)) continue;\n const wrapper = virtualTypes[nodeType];\n if (!wrapper) continue;\n const fns = visitor[nodeType];\n\n for (const type of Object.keys(fns)) {\n fns[type] = wrapCheck(wrapper, fns[type]);\n }\n\n delete visitor[nodeType];\n\n if (wrapper.types) {\n for (const type of wrapper.types) {\n if (visitor[type]) {\n mergePair(visitor[type], fns);\n } else {\n visitor[type] = fns;\n }\n }\n } else {\n mergePair(visitor, fns);\n }\n }\n\n for (const nodeType of Object.keys(visitor)) {\n if (shouldIgnoreKey(nodeType)) continue;\n const fns = visitor[nodeType];\n let aliases = t.FLIPPED_ALIAS_KEYS[nodeType];\n const deprecratedKey = t.DEPRECATED_KEYS[nodeType];\n\n if (deprecratedKey) {\n console.trace(`Visitor defined for ${nodeType} but it has been renamed to ${deprecratedKey}`);\n aliases = [deprecratedKey];\n }\n\n if (!aliases) continue;\n delete visitor[nodeType];\n\n for (const alias of aliases) {\n const existing = visitor[alias];\n\n if (existing) {\n mergePair(existing, fns);\n } else {\n visitor[alias] = Object.assign({}, fns);\n }\n }\n }\n\n for (const nodeType of Object.keys(visitor)) {\n if (shouldIgnoreKey(nodeType)) continue;\n ensureCallbackArrays(visitor[nodeType]);\n }\n\n return visitor;\n}\n\nfunction verify(visitor) {\n if (visitor._verified) return;\n\n if (typeof visitor === \"function\") {\n throw new Error(\"You passed `traverse()` a function when it expected a visitor object, \" + \"are you sure you didn't mean `{ enter: Function }`?\");\n }\n\n for (const nodeType of Object.keys(visitor)) {\n if (nodeType === \"enter\" || nodeType === \"exit\") {\n validateVisitorMethods(nodeType, visitor[nodeType]);\n }\n\n if (shouldIgnoreKey(nodeType)) continue;\n\n if (t.TYPES.indexOf(nodeType) < 0) {\n throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type`);\n }\n\n const visitors = visitor[nodeType];\n\n if (typeof visitors === \"object\") {\n for (const visitorKey of Object.keys(visitors)) {\n if (visitorKey === \"enter\" || visitorKey === \"exit\") {\n validateVisitorMethods(`${nodeType}.${visitorKey}`, visitors[visitorKey]);\n } else {\n throw new Error(\"You passed `traverse()` a visitor object with the property \" + `${nodeType} that has the invalid property ${visitorKey}`);\n }\n }\n }\n }\n\n visitor._verified = true;\n}\n\nfunction validateVisitorMethods(path, val) {\n const fns = [].concat(val);\n\n for (const fn of fns) {\n if (typeof fn !== \"function\") {\n throw new TypeError(`Non-function found defined in ${path} with type ${typeof fn}`);\n }\n }\n}\n\nfunction merge(visitors, states = [], wrapper) {\n const rootVisitor = {};\n\n for (let i = 0; i < visitors.length; i++) {\n const visitor = visitors[i];\n const state = states[i];\n explode(visitor);\n\n for (const type of Object.keys(visitor)) {\n let visitorType = visitor[type];\n\n if (state || wrapper) {\n visitorType = wrapWithStateOrWrapper(visitorType, state, wrapper);\n }\n\n const nodeVisitor = rootVisitor[type] = rootVisitor[type] || {};\n mergePair(nodeVisitor, visitorType);\n }\n }\n\n return rootVisitor;\n}\n\nfunction wrapWithStateOrWrapper(oldVisitor, state, wrapper) {\n const newVisitor = {};\n\n for (const key of Object.keys(oldVisitor)) {\n let fns = oldVisitor[key];\n if (!Array.isArray(fns)) continue;\n fns = fns.map(function (fn) {\n let newFn = fn;\n\n if (state) {\n newFn = function (path) {\n return fn.call(state, path, state);\n };\n }\n\n if (wrapper) {\n newFn = wrapper(state.key, key, newFn);\n }\n\n if (newFn !== fn) {\n newFn.toString = () => fn.toString();\n }\n\n return newFn;\n });\n newVisitor[key] = fns;\n }\n\n return newVisitor;\n}\n\nfunction ensureEntranceObjects(obj) {\n for (const key of Object.keys(obj)) {\n if (shouldIgnoreKey(key)) continue;\n const fns = obj[key];\n\n if (typeof fns === \"function\") {\n obj[key] = {\n enter: fns\n };\n }\n }\n}\n\nfunction ensureCallbackArrays(obj) {\n if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter];\n if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit];\n}\n\nfunction wrapCheck(wrapper, fn) {\n const newFn = function (path) {\n if (wrapper.checkPath(path)) {\n return fn.apply(this, arguments);\n }\n };\n\n newFn.toString = () => fn.toString();\n\n return newFn;\n}\n\nfunction shouldIgnoreKey(key) {\n if (key[0] === \"_\") return true;\n if (key === \"enter\" || key === \"exit\" || key === \"shouldSkip\") return true;\n\n if (key === \"denylist\" || key === \"noScope\" || key === \"skipKeys\" || key === \"blacklist\") {\n return true;\n }\n\n return false;\n}\n\nfunction mergePair(dest, src) {\n for (const key of Object.keys(src)) {\n dest[key] = [].concat(dest[key] || [], src[key]);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.codeFrameColumns = codeFrameColumns;\nexports.default = _default;\n\nvar _highlight = _interopRequireWildcard(require(\"@babel/highlight\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nlet deprecationWarningShown = false;\n\nfunction getDefs(chalk) {\n return {\n gutter: chalk.grey,\n marker: chalk.red.bold,\n message: chalk.red.bold\n };\n}\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\nfunction getMarkerLines(loc, source, opts) {\n const startLoc = Object.assign({\n column: 0,\n line: -1\n }, loc.start);\n const endLoc = Object.assign({}, startLoc, loc.end);\n const {\n linesAbove = 2,\n linesBelow = 3\n } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n\n if (startLine === -1) {\n start = 0;\n }\n\n if (endLine === -1) {\n end = source.length;\n }\n\n const lineDiff = endLine - startLine;\n const markerLines = {};\n\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n\n return {\n start,\n end,\n markerLines\n };\n}\n\nfunction codeFrameColumns(rawLines, loc, opts = {}) {\n const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);\n const chalk = (0, _highlight.getChalk)(opts);\n const defs = getDefs(chalk);\n\n const maybeHighlight = (chalkFn, string) => {\n return highlighted ? chalkFn(string) : string;\n };\n\n const lines = rawLines.split(NEWLINE);\n const {\n start,\n end,\n markerLines\n } = getMarkerLines(loc, lines, opts);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n const numberMaxWidth = String(end).length;\n const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;\n let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} | `;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n\n if (hasMarker) {\n let markerLine = \"\";\n\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n markerLine = [\"\\n \", maybeHighlight(defs.gutter, gutter.replace(/\\d/g, \" \")), markerSpacing, maybeHighlight(defs.marker, \"^\").repeat(numberOfMarkers)].join(\"\");\n\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + maybeHighlight(defs.message, opts.message);\n }\n }\n\n return [maybeHighlight(defs.marker, \">\"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(\"\");\n } else {\n return ` ${maybeHighlight(defs.gutter, gutter)}${line}`;\n }\n }).join(\"\\n\");\n\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n\n if (highlighted) {\n return chalk.reset(frame);\n } else {\n return frame;\n }\n}\n\nfunction _default(rawLines, lineNumber, colNumber, opts = {}) {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n const message = \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n\n if (process.emitWarning) {\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n\n colNumber = Math.max(colNumber, 0);\n const location = {\n start: {\n column: colNumber,\n line: lineNumber\n }\n };\n return codeFrameColumns(rawLines, location, opts);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isIdentifierStart = isIdentifierStart;\nexports.isIdentifierChar = isIdentifierChar;\nexports.isIdentifierName = isIdentifierName;\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u08a0-\\u08b4\\u08b6-\\u08c7\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\u9ffc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7bf\\ua7c2-\\ua7ca\\ua7f5-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u08d3-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf\\u1ac0\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1df9\\u1dfb-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\nconst nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\nconst nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\nconst astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];\nconst astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n\nfunction isInAstralSet(code, set) {\n let pos = 0x10000;\n\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n\n return false;\n}\n\nfunction isIdentifierStart(code) {\n if (code < 65) return code === 36;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));\n }\n\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\nfunction isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}\n\nfunction isIdentifierName(name) {\n let isFirst = true;\n\n for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) {\n const char = _Array$from[_i];\n const cp = char.codePointAt(0);\n\n if (isFirst) {\n if (!isIdentifierStart(cp)) {\n return false;\n }\n\n isFirst = false;\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n\n return !isFirst;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"isIdentifierName\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierName;\n }\n});\nObject.defineProperty(exports, \"isIdentifierChar\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierChar;\n }\n});\nObject.defineProperty(exports, \"isIdentifierStart\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierStart;\n }\n});\nObject.defineProperty(exports, \"isReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictBindOnlyReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictBindOnlyReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictBindReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictBindReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictReservedWord;\n }\n});\nObject.defineProperty(exports, \"isKeyword\", {\n enumerable: true,\n get: function () {\n return _keyword.isKeyword;\n }\n});\n\nvar _identifier = require(\"./identifier\");\n\nvar _keyword = require(\"./keyword\");","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isReservedWord = isReservedWord;\nexports.isStrictReservedWord = isStrictReservedWord;\nexports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;\nexports.isStrictBindReservedWord = isStrictBindReservedWord;\nexports.isKeyword = isKeyword;\nconst reservedWords = {\n keyword: [\"break\", \"case\", \"catch\", \"continue\", \"debugger\", \"default\", \"do\", \"else\", \"finally\", \"for\", \"function\", \"if\", \"return\", \"switch\", \"throw\", \"try\", \"var\", \"const\", \"while\", \"with\", \"new\", \"this\", \"super\", \"class\", \"extends\", \"export\", \"import\", \"null\", \"true\", \"false\", \"in\", \"instanceof\", \"typeof\", \"void\", \"delete\"],\n strict: [\"implements\", \"interface\", \"let\", \"package\", \"private\", \"protected\", \"public\", \"static\", \"yield\"],\n strictBind: [\"eval\", \"arguments\"]\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\nfunction isReservedWord(word, inModule) {\n return inModule && word === \"await\" || word === \"enum\";\n}\n\nfunction isStrictReservedWord(word, inModule) {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\nfunction isStrictBindOnlyReservedWord(word) {\n return reservedWordsStrictBindSet.has(word);\n}\n\nfunction isStrictBindReservedWord(word, inModule) {\n return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);\n}\n\nfunction isKeyword(word) {\n return keywords.has(word);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.shouldHighlight = shouldHighlight;\nexports.getChalk = getChalk;\nexports.default = highlight;\n\nvar _jsTokens = _interopRequireWildcard(require(\"js-tokens\"));\n\nvar _helperValidatorIdentifier = require(\"@babel/helper-validator-identifier\");\n\nvar _chalk = _interopRequireDefault(require(\"chalk\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction getDefs(chalk) {\n return {\n keyword: chalk.cyan,\n capitalized: chalk.yellow,\n jsx_tag: chalk.yellow,\n punctuator: chalk.yellow,\n number: chalk.magenta,\n string: chalk.green,\n regex: chalk.magenta,\n comment: chalk.grey,\n invalid: chalk.white.bgRed.bold\n };\n}\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\nconst JSX_TAG = /^[a-z][\\w-]*$/i;\nconst BRACKET = /^[()[\\]{}]$/;\n\nfunction getTokenType(match) {\n const [offset, text] = match.slice(-2);\n const token = (0, _jsTokens.matchToToken)(match);\n\n if (token.type === \"name\") {\n if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isReservedWord)(token.value)) {\n return \"keyword\";\n }\n\n if (JSX_TAG.test(token.value) && (text[offset - 1] === \"<\" || text.substr(offset - 2, 2) == \" colorize(str)).join(\"\\n\");\n } else {\n return args[0];\n }\n });\n}\n\nfunction shouldHighlight(options) {\n return _chalk.default.supportsColor || options.forceColor;\n}\n\nfunction getChalk(options) {\n let chalk = _chalk.default;\n\n if (options.forceColor) {\n chalk = new _chalk.default.constructor({\n enabled: true,\n level: 1\n });\n }\n\n return chalk;\n}\n\nfunction highlight(code, options = {}) {\n if (shouldHighlight(options)) {\n const chalk = getChalk(options);\n const defs = getDefs(chalk);\n return highlightTokens(defs, code);\n } else {\n return code;\n }\n}","'use strict';\nmodule.exports = require('./globals.json');\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = assertNode;\n\nvar _isNode = _interopRequireDefault(require(\"../validators/isNode\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction assertNode(node) {\n if (!(0, _isNode.default)(node)) {\n var _node$type;\n\n const type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node);\n throw new TypeError(`Not a valid node of type \"${type}\"`);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.assertArrayExpression = assertArrayExpression;\nexports.assertAssignmentExpression = assertAssignmentExpression;\nexports.assertBinaryExpression = assertBinaryExpression;\nexports.assertInterpreterDirective = assertInterpreterDirective;\nexports.assertDirective = assertDirective;\nexports.assertDirectiveLiteral = assertDirectiveLiteral;\nexports.assertBlockStatement = assertBlockStatement;\nexports.assertBreakStatement = assertBreakStatement;\nexports.assertCallExpression = assertCallExpression;\nexports.assertCatchClause = assertCatchClause;\nexports.assertConditionalExpression = assertConditionalExpression;\nexports.assertContinueStatement = assertContinueStatement;\nexports.assertDebuggerStatement = assertDebuggerStatement;\nexports.assertDoWhileStatement = assertDoWhileStatement;\nexports.assertEmptyStatement = assertEmptyStatement;\nexports.assertExpressionStatement = assertExpressionStatement;\nexports.assertFile = assertFile;\nexports.assertForInStatement = assertForInStatement;\nexports.assertForStatement = assertForStatement;\nexports.assertFunctionDeclaration = assertFunctionDeclaration;\nexports.assertFunctionExpression = assertFunctionExpression;\nexports.assertIdentifier = assertIdentifier;\nexports.assertIfStatement = assertIfStatement;\nexports.assertLabeledStatement = assertLabeledStatement;\nexports.assertStringLiteral = assertStringLiteral;\nexports.assertNumericLiteral = assertNumericLiteral;\nexports.assertNullLiteral = assertNullLiteral;\nexports.assertBooleanLiteral = assertBooleanLiteral;\nexports.assertRegExpLiteral = assertRegExpLiteral;\nexports.assertLogicalExpression = assertLogicalExpression;\nexports.assertMemberExpression = assertMemberExpression;\nexports.assertNewExpression = assertNewExpression;\nexports.assertProgram = assertProgram;\nexports.assertObjectExpression = assertObjectExpression;\nexports.assertObjectMethod = assertObjectMethod;\nexports.assertObjectProperty = assertObjectProperty;\nexports.assertRestElement = assertRestElement;\nexports.assertReturnStatement = assertReturnStatement;\nexports.assertSequenceExpression = assertSequenceExpression;\nexports.assertParenthesizedExpression = assertParenthesizedExpression;\nexports.assertSwitchCase = assertSwitchCase;\nexports.assertSwitchStatement = assertSwitchStatement;\nexports.assertThisExpression = assertThisExpression;\nexports.assertThrowStatement = assertThrowStatement;\nexports.assertTryStatement = assertTryStatement;\nexports.assertUnaryExpression = assertUnaryExpression;\nexports.assertUpdateExpression = assertUpdateExpression;\nexports.assertVariableDeclaration = assertVariableDeclaration;\nexports.assertVariableDeclarator = assertVariableDeclarator;\nexports.assertWhileStatement = assertWhileStatement;\nexports.assertWithStatement = assertWithStatement;\nexports.assertAssignmentPattern = assertAssignmentPattern;\nexports.assertArrayPattern = assertArrayPattern;\nexports.assertArrowFunctionExpression = assertArrowFunctionExpression;\nexports.assertClassBody = assertClassBody;\nexports.assertClassExpression = assertClassExpression;\nexports.assertClassDeclaration = assertClassDeclaration;\nexports.assertExportAllDeclaration = assertExportAllDeclaration;\nexports.assertExportDefaultDeclaration = assertExportDefaultDeclaration;\nexports.assertExportNamedDeclaration = assertExportNamedDeclaration;\nexports.assertExportSpecifier = assertExportSpecifier;\nexports.assertForOfStatement = assertForOfStatement;\nexports.assertImportDeclaration = assertImportDeclaration;\nexports.assertImportDefaultSpecifier = assertImportDefaultSpecifier;\nexports.assertImportNamespaceSpecifier = assertImportNamespaceSpecifier;\nexports.assertImportSpecifier = assertImportSpecifier;\nexports.assertMetaProperty = assertMetaProperty;\nexports.assertClassMethod = assertClassMethod;\nexports.assertObjectPattern = assertObjectPattern;\nexports.assertSpreadElement = assertSpreadElement;\nexports.assertSuper = assertSuper;\nexports.assertTaggedTemplateExpression = assertTaggedTemplateExpression;\nexports.assertTemplateElement = assertTemplateElement;\nexports.assertTemplateLiteral = assertTemplateLiteral;\nexports.assertYieldExpression = assertYieldExpression;\nexports.assertAwaitExpression = assertAwaitExpression;\nexports.assertImport = assertImport;\nexports.assertBigIntLiteral = assertBigIntLiteral;\nexports.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier;\nexports.assertOptionalMemberExpression = assertOptionalMemberExpression;\nexports.assertOptionalCallExpression = assertOptionalCallExpression;\nexports.assertAnyTypeAnnotation = assertAnyTypeAnnotation;\nexports.assertArrayTypeAnnotation = assertArrayTypeAnnotation;\nexports.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation;\nexports.assertBooleanLiteralTypeAnnotation = assertBooleanLiteralTypeAnnotation;\nexports.assertNullLiteralTypeAnnotation = assertNullLiteralTypeAnnotation;\nexports.assertClassImplements = assertClassImplements;\nexports.assertDeclareClass = assertDeclareClass;\nexports.assertDeclareFunction = assertDeclareFunction;\nexports.assertDeclareInterface = assertDeclareInterface;\nexports.assertDeclareModule = assertDeclareModule;\nexports.assertDeclareModuleExports = assertDeclareModuleExports;\nexports.assertDeclareTypeAlias = assertDeclareTypeAlias;\nexports.assertDeclareOpaqueType = assertDeclareOpaqueType;\nexports.assertDeclareVariable = assertDeclareVariable;\nexports.assertDeclareExportDeclaration = assertDeclareExportDeclaration;\nexports.assertDeclareExportAllDeclaration = assertDeclareExportAllDeclaration;\nexports.assertDeclaredPredicate = assertDeclaredPredicate;\nexports.assertExistsTypeAnnotation = assertExistsTypeAnnotation;\nexports.assertFunctionTypeAnnotation = assertFunctionTypeAnnotation;\nexports.assertFunctionTypeParam = assertFunctionTypeParam;\nexports.assertGenericTypeAnnotation = assertGenericTypeAnnotation;\nexports.assertInferredPredicate = assertInferredPredicate;\nexports.assertInterfaceExtends = assertInterfaceExtends;\nexports.assertInterfaceDeclaration = assertInterfaceDeclaration;\nexports.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation;\nexports.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation;\nexports.assertMixedTypeAnnotation = assertMixedTypeAnnotation;\nexports.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation;\nexports.assertNullableTypeAnnotation = assertNullableTypeAnnotation;\nexports.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation;\nexports.assertNumberTypeAnnotation = assertNumberTypeAnnotation;\nexports.assertObjectTypeAnnotation = assertObjectTypeAnnotation;\nexports.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot;\nexports.assertObjectTypeCallProperty = assertObjectTypeCallProperty;\nexports.assertObjectTypeIndexer = assertObjectTypeIndexer;\nexports.assertObjectTypeProperty = assertObjectTypeProperty;\nexports.assertObjectTypeSpreadProperty = assertObjectTypeSpreadProperty;\nexports.assertOpaqueType = assertOpaqueType;\nexports.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier;\nexports.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation;\nexports.assertStringTypeAnnotation = assertStringTypeAnnotation;\nexports.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation;\nexports.assertThisTypeAnnotation = assertThisTypeAnnotation;\nexports.assertTupleTypeAnnotation = assertTupleTypeAnnotation;\nexports.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation;\nexports.assertTypeAlias = assertTypeAlias;\nexports.assertTypeAnnotation = assertTypeAnnotation;\nexports.assertTypeCastExpression = assertTypeCastExpression;\nexports.assertTypeParameter = assertTypeParameter;\nexports.assertTypeParameterDeclaration = assertTypeParameterDeclaration;\nexports.assertTypeParameterInstantiation = assertTypeParameterInstantiation;\nexports.assertUnionTypeAnnotation = assertUnionTypeAnnotation;\nexports.assertVariance = assertVariance;\nexports.assertVoidTypeAnnotation = assertVoidTypeAnnotation;\nexports.assertEnumDeclaration = assertEnumDeclaration;\nexports.assertEnumBooleanBody = assertEnumBooleanBody;\nexports.assertEnumNumberBody = assertEnumNumberBody;\nexports.assertEnumStringBody = assertEnumStringBody;\nexports.assertEnumSymbolBody = assertEnumSymbolBody;\nexports.assertEnumBooleanMember = assertEnumBooleanMember;\nexports.assertEnumNumberMember = assertEnumNumberMember;\nexports.assertEnumStringMember = assertEnumStringMember;\nexports.assertEnumDefaultedMember = assertEnumDefaultedMember;\nexports.assertJSXAttribute = assertJSXAttribute;\nexports.assertJSXClosingElement = assertJSXClosingElement;\nexports.assertJSXElement = assertJSXElement;\nexports.assertJSXEmptyExpression = assertJSXEmptyExpression;\nexports.assertJSXExpressionContainer = assertJSXExpressionContainer;\nexports.assertJSXSpreadChild = assertJSXSpreadChild;\nexports.assertJSXIdentifier = assertJSXIdentifier;\nexports.assertJSXMemberExpression = assertJSXMemberExpression;\nexports.assertJSXNamespacedName = assertJSXNamespacedName;\nexports.assertJSXOpeningElement = assertJSXOpeningElement;\nexports.assertJSXSpreadAttribute = assertJSXSpreadAttribute;\nexports.assertJSXText = assertJSXText;\nexports.assertJSXFragment = assertJSXFragment;\nexports.assertJSXOpeningFragment = assertJSXOpeningFragment;\nexports.assertJSXClosingFragment = assertJSXClosingFragment;\nexports.assertNoop = assertNoop;\nexports.assertPlaceholder = assertPlaceholder;\nexports.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier;\nexports.assertArgumentPlaceholder = assertArgumentPlaceholder;\nexports.assertBindExpression = assertBindExpression;\nexports.assertClassProperty = assertClassProperty;\nexports.assertPipelineTopicExpression = assertPipelineTopicExpression;\nexports.assertPipelineBareFunction = assertPipelineBareFunction;\nexports.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference;\nexports.assertClassPrivateProperty = assertClassPrivateProperty;\nexports.assertClassPrivateMethod = assertClassPrivateMethod;\nexports.assertImportAttribute = assertImportAttribute;\nexports.assertDecorator = assertDecorator;\nexports.assertDoExpression = assertDoExpression;\nexports.assertExportDefaultSpecifier = assertExportDefaultSpecifier;\nexports.assertPrivateName = assertPrivateName;\nexports.assertRecordExpression = assertRecordExpression;\nexports.assertTupleExpression = assertTupleExpression;\nexports.assertDecimalLiteral = assertDecimalLiteral;\nexports.assertStaticBlock = assertStaticBlock;\nexports.assertTSParameterProperty = assertTSParameterProperty;\nexports.assertTSDeclareFunction = assertTSDeclareFunction;\nexports.assertTSDeclareMethod = assertTSDeclareMethod;\nexports.assertTSQualifiedName = assertTSQualifiedName;\nexports.assertTSCallSignatureDeclaration = assertTSCallSignatureDeclaration;\nexports.assertTSConstructSignatureDeclaration = assertTSConstructSignatureDeclaration;\nexports.assertTSPropertySignature = assertTSPropertySignature;\nexports.assertTSMethodSignature = assertTSMethodSignature;\nexports.assertTSIndexSignature = assertTSIndexSignature;\nexports.assertTSAnyKeyword = assertTSAnyKeyword;\nexports.assertTSBooleanKeyword = assertTSBooleanKeyword;\nexports.assertTSBigIntKeyword = assertTSBigIntKeyword;\nexports.assertTSIntrinsicKeyword = assertTSIntrinsicKeyword;\nexports.assertTSNeverKeyword = assertTSNeverKeyword;\nexports.assertTSNullKeyword = assertTSNullKeyword;\nexports.assertTSNumberKeyword = assertTSNumberKeyword;\nexports.assertTSObjectKeyword = assertTSObjectKeyword;\nexports.assertTSStringKeyword = assertTSStringKeyword;\nexports.assertTSSymbolKeyword = assertTSSymbolKeyword;\nexports.assertTSUndefinedKeyword = assertTSUndefinedKeyword;\nexports.assertTSUnknownKeyword = assertTSUnknownKeyword;\nexports.assertTSVoidKeyword = assertTSVoidKeyword;\nexports.assertTSThisType = assertTSThisType;\nexports.assertTSFunctionType = assertTSFunctionType;\nexports.assertTSConstructorType = assertTSConstructorType;\nexports.assertTSTypeReference = assertTSTypeReference;\nexports.assertTSTypePredicate = assertTSTypePredicate;\nexports.assertTSTypeQuery = assertTSTypeQuery;\nexports.assertTSTypeLiteral = assertTSTypeLiteral;\nexports.assertTSArrayType = assertTSArrayType;\nexports.assertTSTupleType = assertTSTupleType;\nexports.assertTSOptionalType = assertTSOptionalType;\nexports.assertTSRestType = assertTSRestType;\nexports.assertTSNamedTupleMember = assertTSNamedTupleMember;\nexports.assertTSUnionType = assertTSUnionType;\nexports.assertTSIntersectionType = assertTSIntersectionType;\nexports.assertTSConditionalType = assertTSConditionalType;\nexports.assertTSInferType = assertTSInferType;\nexports.assertTSParenthesizedType = assertTSParenthesizedType;\nexports.assertTSTypeOperator = assertTSTypeOperator;\nexports.assertTSIndexedAccessType = assertTSIndexedAccessType;\nexports.assertTSMappedType = assertTSMappedType;\nexports.assertTSLiteralType = assertTSLiteralType;\nexports.assertTSExpressionWithTypeArguments = assertTSExpressionWithTypeArguments;\nexports.assertTSInterfaceDeclaration = assertTSInterfaceDeclaration;\nexports.assertTSInterfaceBody = assertTSInterfaceBody;\nexports.assertTSTypeAliasDeclaration = assertTSTypeAliasDeclaration;\nexports.assertTSAsExpression = assertTSAsExpression;\nexports.assertTSTypeAssertion = assertTSTypeAssertion;\nexports.assertTSEnumDeclaration = assertTSEnumDeclaration;\nexports.assertTSEnumMember = assertTSEnumMember;\nexports.assertTSModuleDeclaration = assertTSModuleDeclaration;\nexports.assertTSModuleBlock = assertTSModuleBlock;\nexports.assertTSImportType = assertTSImportType;\nexports.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration;\nexports.assertTSExternalModuleReference = assertTSExternalModuleReference;\nexports.assertTSNonNullExpression = assertTSNonNullExpression;\nexports.assertTSExportAssignment = assertTSExportAssignment;\nexports.assertTSNamespaceExportDeclaration = assertTSNamespaceExportDeclaration;\nexports.assertTSTypeAnnotation = assertTSTypeAnnotation;\nexports.assertTSTypeParameterInstantiation = assertTSTypeParameterInstantiation;\nexports.assertTSTypeParameterDeclaration = assertTSTypeParameterDeclaration;\nexports.assertTSTypeParameter = assertTSTypeParameter;\nexports.assertExpression = assertExpression;\nexports.assertBinary = assertBinary;\nexports.assertScopable = assertScopable;\nexports.assertBlockParent = assertBlockParent;\nexports.assertBlock = assertBlock;\nexports.assertStatement = assertStatement;\nexports.assertTerminatorless = assertTerminatorless;\nexports.assertCompletionStatement = assertCompletionStatement;\nexports.assertConditional = assertConditional;\nexports.assertLoop = assertLoop;\nexports.assertWhile = assertWhile;\nexports.assertExpressionWrapper = assertExpressionWrapper;\nexports.assertFor = assertFor;\nexports.assertForXStatement = assertForXStatement;\nexports.assertFunction = assertFunction;\nexports.assertFunctionParent = assertFunctionParent;\nexports.assertPureish = assertPureish;\nexports.assertDeclaration = assertDeclaration;\nexports.assertPatternLike = assertPatternLike;\nexports.assertLVal = assertLVal;\nexports.assertTSEntityName = assertTSEntityName;\nexports.assertLiteral = assertLiteral;\nexports.assertImmutable = assertImmutable;\nexports.assertUserWhitespacable = assertUserWhitespacable;\nexports.assertMethod = assertMethod;\nexports.assertObjectMember = assertObjectMember;\nexports.assertProperty = assertProperty;\nexports.assertUnaryLike = assertUnaryLike;\nexports.assertPattern = assertPattern;\nexports.assertClass = assertClass;\nexports.assertModuleDeclaration = assertModuleDeclaration;\nexports.assertExportDeclaration = assertExportDeclaration;\nexports.assertModuleSpecifier = assertModuleSpecifier;\nexports.assertFlow = assertFlow;\nexports.assertFlowType = assertFlowType;\nexports.assertFlowBaseAnnotation = assertFlowBaseAnnotation;\nexports.assertFlowDeclaration = assertFlowDeclaration;\nexports.assertFlowPredicate = assertFlowPredicate;\nexports.assertEnumBody = assertEnumBody;\nexports.assertEnumMember = assertEnumMember;\nexports.assertJSX = assertJSX;\nexports.assertPrivate = assertPrivate;\nexports.assertTSTypeElement = assertTSTypeElement;\nexports.assertTSType = assertTSType;\nexports.assertTSBaseType = assertTSBaseType;\nexports.assertNumberLiteral = assertNumberLiteral;\nexports.assertRegexLiteral = assertRegexLiteral;\nexports.assertRestProperty = assertRestProperty;\nexports.assertSpreadProperty = assertSpreadProperty;\n\nvar _is = _interopRequireDefault(require(\"../../validators/is\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction assert(type, node, opts) {\n if (!(0, _is.default)(type, node, opts)) {\n throw new Error(`Expected type \"${type}\" with option ${JSON.stringify(opts)}, ` + `but instead got \"${node.type}\".`);\n }\n}\n\nfunction assertArrayExpression(node, opts = {}) {\n assert(\"ArrayExpression\", node, opts);\n}\n\nfunction assertAssignmentExpression(node, opts = {}) {\n assert(\"AssignmentExpression\", node, opts);\n}\n\nfunction assertBinaryExpression(node, opts = {}) {\n assert(\"BinaryExpression\", node, opts);\n}\n\nfunction assertInterpreterDirective(node, opts = {}) {\n assert(\"InterpreterDirective\", node, opts);\n}\n\nfunction assertDirective(node, opts = {}) {\n assert(\"Directive\", node, opts);\n}\n\nfunction assertDirectiveLiteral(node, opts = {}) {\n assert(\"DirectiveLiteral\", node, opts);\n}\n\nfunction assertBlockStatement(node, opts = {}) {\n assert(\"BlockStatement\", node, opts);\n}\n\nfunction assertBreakStatement(node, opts = {}) {\n assert(\"BreakStatement\", node, opts);\n}\n\nfunction assertCallExpression(node, opts = {}) {\n assert(\"CallExpression\", node, opts);\n}\n\nfunction assertCatchClause(node, opts = {}) {\n assert(\"CatchClause\", node, opts);\n}\n\nfunction assertConditionalExpression(node, opts = {}) {\n assert(\"ConditionalExpression\", node, opts);\n}\n\nfunction assertContinueStatement(node, opts = {}) {\n assert(\"ContinueStatement\", node, opts);\n}\n\nfunction assertDebuggerStatement(node, opts = {}) {\n assert(\"DebuggerStatement\", node, opts);\n}\n\nfunction assertDoWhileStatement(node, opts = {}) {\n assert(\"DoWhileStatement\", node, opts);\n}\n\nfunction assertEmptyStatement(node, opts = {}) {\n assert(\"EmptyStatement\", node, opts);\n}\n\nfunction assertExpressionStatement(node, opts = {}) {\n assert(\"ExpressionStatement\", node, opts);\n}\n\nfunction assertFile(node, opts = {}) {\n assert(\"File\", node, opts);\n}\n\nfunction assertForInStatement(node, opts = {}) {\n assert(\"ForInStatement\", node, opts);\n}\n\nfunction assertForStatement(node, opts = {}) {\n assert(\"ForStatement\", node, opts);\n}\n\nfunction assertFunctionDeclaration(node, opts = {}) {\n assert(\"FunctionDeclaration\", node, opts);\n}\n\nfunction assertFunctionExpression(node, opts = {}) {\n assert(\"FunctionExpression\", node, opts);\n}\n\nfunction assertIdentifier(node, opts = {}) {\n assert(\"Identifier\", node, opts);\n}\n\nfunction assertIfStatement(node, opts = {}) {\n assert(\"IfStatement\", node, opts);\n}\n\nfunction assertLabeledStatement(node, opts = {}) {\n assert(\"LabeledStatement\", node, opts);\n}\n\nfunction assertStringLiteral(node, opts = {}) {\n assert(\"StringLiteral\", node, opts);\n}\n\nfunction assertNumericLiteral(node, opts = {}) {\n assert(\"NumericLiteral\", node, opts);\n}\n\nfunction assertNullLiteral(node, opts = {}) {\n assert(\"NullLiteral\", node, opts);\n}\n\nfunction assertBooleanLiteral(node, opts = {}) {\n assert(\"BooleanLiteral\", node, opts);\n}\n\nfunction assertRegExpLiteral(node, opts = {}) {\n assert(\"RegExpLiteral\", node, opts);\n}\n\nfunction assertLogicalExpression(node, opts = {}) {\n assert(\"LogicalExpression\", node, opts);\n}\n\nfunction assertMemberExpression(node, opts = {}) {\n assert(\"MemberExpression\", node, opts);\n}\n\nfunction assertNewExpression(node, opts = {}) {\n assert(\"NewExpression\", node, opts);\n}\n\nfunction assertProgram(node, opts = {}) {\n assert(\"Program\", node, opts);\n}\n\nfunction assertObjectExpression(node, opts = {}) {\n assert(\"ObjectExpression\", node, opts);\n}\n\nfunction assertObjectMethod(node, opts = {}) {\n assert(\"ObjectMethod\", node, opts);\n}\n\nfunction assertObjectProperty(node, opts = {}) {\n assert(\"ObjectProperty\", node, opts);\n}\n\nfunction assertRestElement(node, opts = {}) {\n assert(\"RestElement\", node, opts);\n}\n\nfunction assertReturnStatement(node, opts = {}) {\n assert(\"ReturnStatement\", node, opts);\n}\n\nfunction assertSequenceExpression(node, opts = {}) {\n assert(\"SequenceExpression\", node, opts);\n}\n\nfunction assertParenthesizedExpression(node, opts = {}) {\n assert(\"ParenthesizedExpression\", node, opts);\n}\n\nfunction assertSwitchCase(node, opts = {}) {\n assert(\"SwitchCase\", node, opts);\n}\n\nfunction assertSwitchStatement(node, opts = {}) {\n assert(\"SwitchStatement\", node, opts);\n}\n\nfunction assertThisExpression(node, opts = {}) {\n assert(\"ThisExpression\", node, opts);\n}\n\nfunction assertThrowStatement(node, opts = {}) {\n assert(\"ThrowStatement\", node, opts);\n}\n\nfunction assertTryStatement(node, opts = {}) {\n assert(\"TryStatement\", node, opts);\n}\n\nfunction assertUnaryExpression(node, opts = {}) {\n assert(\"UnaryExpression\", node, opts);\n}\n\nfunction assertUpdateExpression(node, opts = {}) {\n assert(\"UpdateExpression\", node, opts);\n}\n\nfunction assertVariableDeclaration(node, opts = {}) {\n assert(\"VariableDeclaration\", node, opts);\n}\n\nfunction assertVariableDeclarator(node, opts = {}) {\n assert(\"VariableDeclarator\", node, opts);\n}\n\nfunction assertWhileStatement(node, opts = {}) {\n assert(\"WhileStatement\", node, opts);\n}\n\nfunction assertWithStatement(node, opts = {}) {\n assert(\"WithStatement\", node, opts);\n}\n\nfunction assertAssignmentPattern(node, opts = {}) {\n assert(\"AssignmentPattern\", node, opts);\n}\n\nfunction assertArrayPattern(node, opts = {}) {\n assert(\"ArrayPattern\", node, opts);\n}\n\nfunction assertArrowFunctionExpression(node, opts = {}) {\n assert(\"ArrowFunctionExpression\", node, opts);\n}\n\nfunction assertClassBody(node, opts = {}) {\n assert(\"ClassBody\", node, opts);\n}\n\nfunction assertClassExpression(node, opts = {}) {\n assert(\"ClassExpression\", node, opts);\n}\n\nfunction assertClassDeclaration(node, opts = {}) {\n assert(\"ClassDeclaration\", node, opts);\n}\n\nfunction assertExportAllDeclaration(node, opts = {}) {\n assert(\"ExportAllDeclaration\", node, opts);\n}\n\nfunction assertExportDefaultDeclaration(node, opts = {}) {\n assert(\"ExportDefaultDeclaration\", node, opts);\n}\n\nfunction assertExportNamedDeclaration(node, opts = {}) {\n assert(\"ExportNamedDeclaration\", node, opts);\n}\n\nfunction assertExportSpecifier(node, opts = {}) {\n assert(\"ExportSpecifier\", node, opts);\n}\n\nfunction assertForOfStatement(node, opts = {}) {\n assert(\"ForOfStatement\", node, opts);\n}\n\nfunction assertImportDeclaration(node, opts = {}) {\n assert(\"ImportDeclaration\", node, opts);\n}\n\nfunction assertImportDefaultSpecifier(node, opts = {}) {\n assert(\"ImportDefaultSpecifier\", node, opts);\n}\n\nfunction assertImportNamespaceSpecifier(node, opts = {}) {\n assert(\"ImportNamespaceSpecifier\", node, opts);\n}\n\nfunction assertImportSpecifier(node, opts = {}) {\n assert(\"ImportSpecifier\", node, opts);\n}\n\nfunction assertMetaProperty(node, opts = {}) {\n assert(\"MetaProperty\", node, opts);\n}\n\nfunction assertClassMethod(node, opts = {}) {\n assert(\"ClassMethod\", node, opts);\n}\n\nfunction assertObjectPattern(node, opts = {}) {\n assert(\"ObjectPattern\", node, opts);\n}\n\nfunction assertSpreadElement(node, opts = {}) {\n assert(\"SpreadElement\", node, opts);\n}\n\nfunction assertSuper(node, opts = {}) {\n assert(\"Super\", node, opts);\n}\n\nfunction assertTaggedTemplateExpression(node, opts = {}) {\n assert(\"TaggedTemplateExpression\", node, opts);\n}\n\nfunction assertTemplateElement(node, opts = {}) {\n assert(\"TemplateElement\", node, opts);\n}\n\nfunction assertTemplateLiteral(node, opts = {}) {\n assert(\"TemplateLiteral\", node, opts);\n}\n\nfunction assertYieldExpression(node, opts = {}) {\n assert(\"YieldExpression\", node, opts);\n}\n\nfunction assertAwaitExpression(node, opts = {}) {\n assert(\"AwaitExpression\", node, opts);\n}\n\nfunction assertImport(node, opts = {}) {\n assert(\"Import\", node, opts);\n}\n\nfunction assertBigIntLiteral(node, opts = {}) {\n assert(\"BigIntLiteral\", node, opts);\n}\n\nfunction assertExportNamespaceSpecifier(node, opts = {}) {\n assert(\"ExportNamespaceSpecifier\", node, opts);\n}\n\nfunction assertOptionalMemberExpression(node, opts = {}) {\n assert(\"OptionalMemberExpression\", node, opts);\n}\n\nfunction assertOptionalCallExpression(node, opts = {}) {\n assert(\"OptionalCallExpression\", node, opts);\n}\n\nfunction assertAnyTypeAnnotation(node, opts = {}) {\n assert(\"AnyTypeAnnotation\", node, opts);\n}\n\nfunction assertArrayTypeAnnotation(node, opts = {}) {\n assert(\"ArrayTypeAnnotation\", node, opts);\n}\n\nfunction assertBooleanTypeAnnotation(node, opts = {}) {\n assert(\"BooleanTypeAnnotation\", node, opts);\n}\n\nfunction assertBooleanLiteralTypeAnnotation(node, opts = {}) {\n assert(\"BooleanLiteralTypeAnnotation\", node, opts);\n}\n\nfunction assertNullLiteralTypeAnnotation(node, opts = {}) {\n assert(\"NullLiteralTypeAnnotation\", node, opts);\n}\n\nfunction assertClassImplements(node, opts = {}) {\n assert(\"ClassImplements\", node, opts);\n}\n\nfunction assertDeclareClass(node, opts = {}) {\n assert(\"DeclareClass\", node, opts);\n}\n\nfunction assertDeclareFunction(node, opts = {}) {\n assert(\"DeclareFunction\", node, opts);\n}\n\nfunction assertDeclareInterface(node, opts = {}) {\n assert(\"DeclareInterface\", node, opts);\n}\n\nfunction assertDeclareModule(node, opts = {}) {\n assert(\"DeclareModule\", node, opts);\n}\n\nfunction assertDeclareModuleExports(node, opts = {}) {\n assert(\"DeclareModuleExports\", node, opts);\n}\n\nfunction assertDeclareTypeAlias(node, opts = {}) {\n assert(\"DeclareTypeAlias\", node, opts);\n}\n\nfunction assertDeclareOpaqueType(node, opts = {}) {\n assert(\"DeclareOpaqueType\", node, opts);\n}\n\nfunction assertDeclareVariable(node, opts = {}) {\n assert(\"DeclareVariable\", node, opts);\n}\n\nfunction assertDeclareExportDeclaration(node, opts = {}) {\n assert(\"DeclareExportDeclaration\", node, opts);\n}\n\nfunction assertDeclareExportAllDeclaration(node, opts = {}) {\n assert(\"DeclareExportAllDeclaration\", node, opts);\n}\n\nfunction assertDeclaredPredicate(node, opts = {}) {\n assert(\"DeclaredPredicate\", node, opts);\n}\n\nfunction assertExistsTypeAnnotation(node, opts = {}) {\n assert(\"ExistsTypeAnnotation\", node, opts);\n}\n\nfunction assertFunctionTypeAnnotation(node, opts = {}) {\n assert(\"FunctionTypeAnnotation\", node, opts);\n}\n\nfunction assertFunctionTypeParam(node, opts = {}) {\n assert(\"FunctionTypeParam\", node, opts);\n}\n\nfunction assertGenericTypeAnnotation(node, opts = {}) {\n assert(\"GenericTypeAnnotation\", node, opts);\n}\n\nfunction assertInferredPredicate(node, opts = {}) {\n assert(\"InferredPredicate\", node, opts);\n}\n\nfunction assertInterfaceExtends(node, opts = {}) {\n assert(\"InterfaceExtends\", node, opts);\n}\n\nfunction assertInterfaceDeclaration(node, opts = {}) {\n assert(\"InterfaceDeclaration\", node, opts);\n}\n\nfunction assertInterfaceTypeAnnotation(node, opts = {}) {\n assert(\"InterfaceTypeAnnotation\", node, opts);\n}\n\nfunction assertIntersectionTypeAnnotation(node, opts = {}) {\n assert(\"IntersectionTypeAnnotation\", node, opts);\n}\n\nfunction assertMixedTypeAnnotation(node, opts = {}) {\n assert(\"MixedTypeAnnotation\", node, opts);\n}\n\nfunction assertEmptyTypeAnnotation(node, opts = {}) {\n assert(\"EmptyTypeAnnotation\", node, opts);\n}\n\nfunction assertNullableTypeAnnotation(node, opts = {}) {\n assert(\"NullableTypeAnnotation\", node, opts);\n}\n\nfunction assertNumberLiteralTypeAnnotation(node, opts = {}) {\n assert(\"NumberLiteralTypeAnnotation\", node, opts);\n}\n\nfunction assertNumberTypeAnnotation(node, opts = {}) {\n assert(\"NumberTypeAnnotation\", node, opts);\n}\n\nfunction assertObjectTypeAnnotation(node, opts = {}) {\n assert(\"ObjectTypeAnnotation\", node, opts);\n}\n\nfunction assertObjectTypeInternalSlot(node, opts = {}) {\n assert(\"ObjectTypeInternalSlot\", node, opts);\n}\n\nfunction assertObjectTypeCallProperty(node, opts = {}) {\n assert(\"ObjectTypeCallProperty\", node, opts);\n}\n\nfunction assertObjectTypeIndexer(node, opts = {}) {\n assert(\"ObjectTypeIndexer\", node, opts);\n}\n\nfunction assertObjectTypeProperty(node, opts = {}) {\n assert(\"ObjectTypeProperty\", node, opts);\n}\n\nfunction assertObjectTypeSpreadProperty(node, opts = {}) {\n assert(\"ObjectTypeSpreadProperty\", node, opts);\n}\n\nfunction assertOpaqueType(node, opts = {}) {\n assert(\"OpaqueType\", node, opts);\n}\n\nfunction assertQualifiedTypeIdentifier(node, opts = {}) {\n assert(\"QualifiedTypeIdentifier\", node, opts);\n}\n\nfunction assertStringLiteralTypeAnnotation(node, opts = {}) {\n assert(\"StringLiteralTypeAnnotation\", node, opts);\n}\n\nfunction assertStringTypeAnnotation(node, opts = {}) {\n assert(\"StringTypeAnnotation\", node, opts);\n}\n\nfunction assertSymbolTypeAnnotation(node, opts = {}) {\n assert(\"SymbolTypeAnnotation\", node, opts);\n}\n\nfunction assertThisTypeAnnotation(node, opts = {}) {\n assert(\"ThisTypeAnnotation\", node, opts);\n}\n\nfunction assertTupleTypeAnnotation(node, opts = {}) {\n assert(\"TupleTypeAnnotation\", node, opts);\n}\n\nfunction assertTypeofTypeAnnotation(node, opts = {}) {\n assert(\"TypeofTypeAnnotation\", node, opts);\n}\n\nfunction assertTypeAlias(node, opts = {}) {\n assert(\"TypeAlias\", node, opts);\n}\n\nfunction assertTypeAnnotation(node, opts = {}) {\n assert(\"TypeAnnotation\", node, opts);\n}\n\nfunction assertTypeCastExpression(node, opts = {}) {\n assert(\"TypeCastExpression\", node, opts);\n}\n\nfunction assertTypeParameter(node, opts = {}) {\n assert(\"TypeParameter\", node, opts);\n}\n\nfunction assertTypeParameterDeclaration(node, opts = {}) {\n assert(\"TypeParameterDeclaration\", node, opts);\n}\n\nfunction assertTypeParameterInstantiation(node, opts = {}) {\n assert(\"TypeParameterInstantiation\", node, opts);\n}\n\nfunction assertUnionTypeAnnotation(node, opts = {}) {\n assert(\"UnionTypeAnnotation\", node, opts);\n}\n\nfunction assertVariance(node, opts = {}) {\n assert(\"Variance\", node, opts);\n}\n\nfunction assertVoidTypeAnnotation(node, opts = {}) {\n assert(\"VoidTypeAnnotation\", node, opts);\n}\n\nfunction assertEnumDeclaration(node, opts = {}) {\n assert(\"EnumDeclaration\", node, opts);\n}\n\nfunction assertEnumBooleanBody(node, opts = {}) {\n assert(\"EnumBooleanBody\", node, opts);\n}\n\nfunction assertEnumNumberBody(node, opts = {}) {\n assert(\"EnumNumberBody\", node, opts);\n}\n\nfunction assertEnumStringBody(node, opts = {}) {\n assert(\"EnumStringBody\", node, opts);\n}\n\nfunction assertEnumSymbolBody(node, opts = {}) {\n assert(\"EnumSymbolBody\", node, opts);\n}\n\nfunction assertEnumBooleanMember(node, opts = {}) {\n assert(\"EnumBooleanMember\", node, opts);\n}\n\nfunction assertEnumNumberMember(node, opts = {}) {\n assert(\"EnumNumberMember\", node, opts);\n}\n\nfunction assertEnumStringMember(node, opts = {}) {\n assert(\"EnumStringMember\", node, opts);\n}\n\nfunction assertEnumDefaultedMember(node, opts = {}) {\n assert(\"EnumDefaultedMember\", node, opts);\n}\n\nfunction assertJSXAttribute(node, opts = {}) {\n assert(\"JSXAttribute\", node, opts);\n}\n\nfunction assertJSXClosingElement(node, opts = {}) {\n assert(\"JSXClosingElement\", node, opts);\n}\n\nfunction assertJSXElement(node, opts = {}) {\n assert(\"JSXElement\", node, opts);\n}\n\nfunction assertJSXEmptyExpression(node, opts = {}) {\n assert(\"JSXEmptyExpression\", node, opts);\n}\n\nfunction assertJSXExpressionContainer(node, opts = {}) {\n assert(\"JSXExpressionContainer\", node, opts);\n}\n\nfunction assertJSXSpreadChild(node, opts = {}) {\n assert(\"JSXSpreadChild\", node, opts);\n}\n\nfunction assertJSXIdentifier(node, opts = {}) {\n assert(\"JSXIdentifier\", node, opts);\n}\n\nfunction assertJSXMemberExpression(node, opts = {}) {\n assert(\"JSXMemberExpression\", node, opts);\n}\n\nfunction assertJSXNamespacedName(node, opts = {}) {\n assert(\"JSXNamespacedName\", node, opts);\n}\n\nfunction assertJSXOpeningElement(node, opts = {}) {\n assert(\"JSXOpeningElement\", node, opts);\n}\n\nfunction assertJSXSpreadAttribute(node, opts = {}) {\n assert(\"JSXSpreadAttribute\", node, opts);\n}\n\nfunction assertJSXText(node, opts = {}) {\n assert(\"JSXText\", node, opts);\n}\n\nfunction assertJSXFragment(node, opts = {}) {\n assert(\"JSXFragment\", node, opts);\n}\n\nfunction assertJSXOpeningFragment(node, opts = {}) {\n assert(\"JSXOpeningFragment\", node, opts);\n}\n\nfunction assertJSXClosingFragment(node, opts = {}) {\n assert(\"JSXClosingFragment\", node, opts);\n}\n\nfunction assertNoop(node, opts = {}) {\n assert(\"Noop\", node, opts);\n}\n\nfunction assertPlaceholder(node, opts = {}) {\n assert(\"Placeholder\", node, opts);\n}\n\nfunction assertV8IntrinsicIdentifier(node, opts = {}) {\n assert(\"V8IntrinsicIdentifier\", node, opts);\n}\n\nfunction assertArgumentPlaceholder(node, opts = {}) {\n assert(\"ArgumentPlaceholder\", node, opts);\n}\n\nfunction assertBindExpression(node, opts = {}) {\n assert(\"BindExpression\", node, opts);\n}\n\nfunction assertClassProperty(node, opts = {}) {\n assert(\"ClassProperty\", node, opts);\n}\n\nfunction assertPipelineTopicExpression(node, opts = {}) {\n assert(\"PipelineTopicExpression\", node, opts);\n}\n\nfunction assertPipelineBareFunction(node, opts = {}) {\n assert(\"PipelineBareFunction\", node, opts);\n}\n\nfunction assertPipelinePrimaryTopicReference(node, opts = {}) {\n assert(\"PipelinePrimaryTopicReference\", node, opts);\n}\n\nfunction assertClassPrivateProperty(node, opts = {}) {\n assert(\"ClassPrivateProperty\", node, opts);\n}\n\nfunction assertClassPrivateMethod(node, opts = {}) {\n assert(\"ClassPrivateMethod\", node, opts);\n}\n\nfunction assertImportAttribute(node, opts = {}) {\n assert(\"ImportAttribute\", node, opts);\n}\n\nfunction assertDecorator(node, opts = {}) {\n assert(\"Decorator\", node, opts);\n}\n\nfunction assertDoExpression(node, opts = {}) {\n assert(\"DoExpression\", node, opts);\n}\n\nfunction assertExportDefaultSpecifier(node, opts = {}) {\n assert(\"ExportDefaultSpecifier\", node, opts);\n}\n\nfunction assertPrivateName(node, opts = {}) {\n assert(\"PrivateName\", node, opts);\n}\n\nfunction assertRecordExpression(node, opts = {}) {\n assert(\"RecordExpression\", node, opts);\n}\n\nfunction assertTupleExpression(node, opts = {}) {\n assert(\"TupleExpression\", node, opts);\n}\n\nfunction assertDecimalLiteral(node, opts = {}) {\n assert(\"DecimalLiteral\", node, opts);\n}\n\nfunction assertStaticBlock(node, opts = {}) {\n assert(\"StaticBlock\", node, opts);\n}\n\nfunction assertTSParameterProperty(node, opts = {}) {\n assert(\"TSParameterProperty\", node, opts);\n}\n\nfunction assertTSDeclareFunction(node, opts = {}) {\n assert(\"TSDeclareFunction\", node, opts);\n}\n\nfunction assertTSDeclareMethod(node, opts = {}) {\n assert(\"TSDeclareMethod\", node, opts);\n}\n\nfunction assertTSQualifiedName(node, opts = {}) {\n assert(\"TSQualifiedName\", node, opts);\n}\n\nfunction assertTSCallSignatureDeclaration(node, opts = {}) {\n assert(\"TSCallSignatureDeclaration\", node, opts);\n}\n\nfunction assertTSConstructSignatureDeclaration(node, opts = {}) {\n assert(\"TSConstructSignatureDeclaration\", node, opts);\n}\n\nfunction assertTSPropertySignature(node, opts = {}) {\n assert(\"TSPropertySignature\", node, opts);\n}\n\nfunction assertTSMethodSignature(node, opts = {}) {\n assert(\"TSMethodSignature\", node, opts);\n}\n\nfunction assertTSIndexSignature(node, opts = {}) {\n assert(\"TSIndexSignature\", node, opts);\n}\n\nfunction assertTSAnyKeyword(node, opts = {}) {\n assert(\"TSAnyKeyword\", node, opts);\n}\n\nfunction assertTSBooleanKeyword(node, opts = {}) {\n assert(\"TSBooleanKeyword\", node, opts);\n}\n\nfunction assertTSBigIntKeyword(node, opts = {}) {\n assert(\"TSBigIntKeyword\", node, opts);\n}\n\nfunction assertTSIntrinsicKeyword(node, opts = {}) {\n assert(\"TSIntrinsicKeyword\", node, opts);\n}\n\nfunction assertTSNeverKeyword(node, opts = {}) {\n assert(\"TSNeverKeyword\", node, opts);\n}\n\nfunction assertTSNullKeyword(node, opts = {}) {\n assert(\"TSNullKeyword\", node, opts);\n}\n\nfunction assertTSNumberKeyword(node, opts = {}) {\n assert(\"TSNumberKeyword\", node, opts);\n}\n\nfunction assertTSObjectKeyword(node, opts = {}) {\n assert(\"TSObjectKeyword\", node, opts);\n}\n\nfunction assertTSStringKeyword(node, opts = {}) {\n assert(\"TSStringKeyword\", node, opts);\n}\n\nfunction assertTSSymbolKeyword(node, opts = {}) {\n assert(\"TSSymbolKeyword\", node, opts);\n}\n\nfunction assertTSUndefinedKeyword(node, opts = {}) {\n assert(\"TSUndefinedKeyword\", node, opts);\n}\n\nfunction assertTSUnknownKeyword(node, opts = {}) {\n assert(\"TSUnknownKeyword\", node, opts);\n}\n\nfunction assertTSVoidKeyword(node, opts = {}) {\n assert(\"TSVoidKeyword\", node, opts);\n}\n\nfunction assertTSThisType(node, opts = {}) {\n assert(\"TSThisType\", node, opts);\n}\n\nfunction assertTSFunctionType(node, opts = {}) {\n assert(\"TSFunctionType\", node, opts);\n}\n\nfunction assertTSConstructorType(node, opts = {}) {\n assert(\"TSConstructorType\", node, opts);\n}\n\nfunction assertTSTypeReference(node, opts = {}) {\n assert(\"TSTypeReference\", node, opts);\n}\n\nfunction assertTSTypePredicate(node, opts = {}) {\n assert(\"TSTypePredicate\", node, opts);\n}\n\nfunction assertTSTypeQuery(node, opts = {}) {\n assert(\"TSTypeQuery\", node, opts);\n}\n\nfunction assertTSTypeLiteral(node, opts = {}) {\n assert(\"TSTypeLiteral\", node, opts);\n}\n\nfunction assertTSArrayType(node, opts = {}) {\n assert(\"TSArrayType\", node, opts);\n}\n\nfunction assertTSTupleType(node, opts = {}) {\n assert(\"TSTupleType\", node, opts);\n}\n\nfunction assertTSOptionalType(node, opts = {}) {\n assert(\"TSOptionalType\", node, opts);\n}\n\nfunction assertTSRestType(node, opts = {}) {\n assert(\"TSRestType\", node, opts);\n}\n\nfunction assertTSNamedTupleMember(node, opts = {}) {\n assert(\"TSNamedTupleMember\", node, opts);\n}\n\nfunction assertTSUnionType(node, opts = {}) {\n assert(\"TSUnionType\", node, opts);\n}\n\nfunction assertTSIntersectionType(node, opts = {}) {\n assert(\"TSIntersectionType\", node, opts);\n}\n\nfunction assertTSConditionalType(node, opts = {}) {\n assert(\"TSConditionalType\", node, opts);\n}\n\nfunction assertTSInferType(node, opts = {}) {\n assert(\"TSInferType\", node, opts);\n}\n\nfunction assertTSParenthesizedType(node, opts = {}) {\n assert(\"TSParenthesizedType\", node, opts);\n}\n\nfunction assertTSTypeOperator(node, opts = {}) {\n assert(\"TSTypeOperator\", node, opts);\n}\n\nfunction assertTSIndexedAccessType(node, opts = {}) {\n assert(\"TSIndexedAccessType\", node, opts);\n}\n\nfunction assertTSMappedType(node, opts = {}) {\n assert(\"TSMappedType\", node, opts);\n}\n\nfunction assertTSLiteralType(node, opts = {}) {\n assert(\"TSLiteralType\", node, opts);\n}\n\nfunction assertTSExpressionWithTypeArguments(node, opts = {}) {\n assert(\"TSExpressionWithTypeArguments\", node, opts);\n}\n\nfunction assertTSInterfaceDeclaration(node, opts = {}) {\n assert(\"TSInterfaceDeclaration\", node, opts);\n}\n\nfunction assertTSInterfaceBody(node, opts = {}) {\n assert(\"TSInterfaceBody\", node, opts);\n}\n\nfunction assertTSTypeAliasDeclaration(node, opts = {}) {\n assert(\"TSTypeAliasDeclaration\", node, opts);\n}\n\nfunction assertTSAsExpression(node, opts = {}) {\n assert(\"TSAsExpression\", node, opts);\n}\n\nfunction assertTSTypeAssertion(node, opts = {}) {\n assert(\"TSTypeAssertion\", node, opts);\n}\n\nfunction assertTSEnumDeclaration(node, opts = {}) {\n assert(\"TSEnumDeclaration\", node, opts);\n}\n\nfunction assertTSEnumMember(node, opts = {}) {\n assert(\"TSEnumMember\", node, opts);\n}\n\nfunction assertTSModuleDeclaration(node, opts = {}) {\n assert(\"TSModuleDeclaration\", node, opts);\n}\n\nfunction assertTSModuleBlock(node, opts = {}) {\n assert(\"TSModuleBlock\", node, opts);\n}\n\nfunction assertTSImportType(node, opts = {}) {\n assert(\"TSImportType\", node, opts);\n}\n\nfunction assertTSImportEqualsDeclaration(node, opts = {}) {\n assert(\"TSImportEqualsDeclaration\", node, opts);\n}\n\nfunction assertTSExternalModuleReference(node, opts = {}) {\n assert(\"TSExternalModuleReference\", node, opts);\n}\n\nfunction assertTSNonNullExpression(node, opts = {}) {\n assert(\"TSNonNullExpression\", node, opts);\n}\n\nfunction assertTSExportAssignment(node, opts = {}) {\n assert(\"TSExportAssignment\", node, opts);\n}\n\nfunction assertTSNamespaceExportDeclaration(node, opts = {}) {\n assert(\"TSNamespaceExportDeclaration\", node, opts);\n}\n\nfunction assertTSTypeAnnotation(node, opts = {}) {\n assert(\"TSTypeAnnotation\", node, opts);\n}\n\nfunction assertTSTypeParameterInstantiation(node, opts = {}) {\n assert(\"TSTypeParameterInstantiation\", node, opts);\n}\n\nfunction assertTSTypeParameterDeclaration(node, opts = {}) {\n assert(\"TSTypeParameterDeclaration\", node, opts);\n}\n\nfunction assertTSTypeParameter(node, opts = {}) {\n assert(\"TSTypeParameter\", node, opts);\n}\n\nfunction assertExpression(node, opts = {}) {\n assert(\"Expression\", node, opts);\n}\n\nfunction assertBinary(node, opts = {}) {\n assert(\"Binary\", node, opts);\n}\n\nfunction assertScopable(node, opts = {}) {\n assert(\"Scopable\", node, opts);\n}\n\nfunction assertBlockParent(node, opts = {}) {\n assert(\"BlockParent\", node, opts);\n}\n\nfunction assertBlock(node, opts = {}) {\n assert(\"Block\", node, opts);\n}\n\nfunction assertStatement(node, opts = {}) {\n assert(\"Statement\", node, opts);\n}\n\nfunction assertTerminatorless(node, opts = {}) {\n assert(\"Terminatorless\", node, opts);\n}\n\nfunction assertCompletionStatement(node, opts = {}) {\n assert(\"CompletionStatement\", node, opts);\n}\n\nfunction assertConditional(node, opts = {}) {\n assert(\"Conditional\", node, opts);\n}\n\nfunction assertLoop(node, opts = {}) {\n assert(\"Loop\", node, opts);\n}\n\nfunction assertWhile(node, opts = {}) {\n assert(\"While\", node, opts);\n}\n\nfunction assertExpressionWrapper(node, opts = {}) {\n assert(\"ExpressionWrapper\", node, opts);\n}\n\nfunction assertFor(node, opts = {}) {\n assert(\"For\", node, opts);\n}\n\nfunction assertForXStatement(node, opts = {}) {\n assert(\"ForXStatement\", node, opts);\n}\n\nfunction assertFunction(node, opts = {}) {\n assert(\"Function\", node, opts);\n}\n\nfunction assertFunctionParent(node, opts = {}) {\n assert(\"FunctionParent\", node, opts);\n}\n\nfunction assertPureish(node, opts = {}) {\n assert(\"Pureish\", node, opts);\n}\n\nfunction assertDeclaration(node, opts = {}) {\n assert(\"Declaration\", node, opts);\n}\n\nfunction assertPatternLike(node, opts = {}) {\n assert(\"PatternLike\", node, opts);\n}\n\nfunction assertLVal(node, opts = {}) {\n assert(\"LVal\", node, opts);\n}\n\nfunction assertTSEntityName(node, opts = {}) {\n assert(\"TSEntityName\", node, opts);\n}\n\nfunction assertLiteral(node, opts = {}) {\n assert(\"Literal\", node, opts);\n}\n\nfunction assertImmutable(node, opts = {}) {\n assert(\"Immutable\", node, opts);\n}\n\nfunction assertUserWhitespacable(node, opts = {}) {\n assert(\"UserWhitespacable\", node, opts);\n}\n\nfunction assertMethod(node, opts = {}) {\n assert(\"Method\", node, opts);\n}\n\nfunction assertObjectMember(node, opts = {}) {\n assert(\"ObjectMember\", node, opts);\n}\n\nfunction assertProperty(node, opts = {}) {\n assert(\"Property\", node, opts);\n}\n\nfunction assertUnaryLike(node, opts = {}) {\n assert(\"UnaryLike\", node, opts);\n}\n\nfunction assertPattern(node, opts = {}) {\n assert(\"Pattern\", node, opts);\n}\n\nfunction assertClass(node, opts = {}) {\n assert(\"Class\", node, opts);\n}\n\nfunction assertModuleDeclaration(node, opts = {}) {\n assert(\"ModuleDeclaration\", node, opts);\n}\n\nfunction assertExportDeclaration(node, opts = {}) {\n assert(\"ExportDeclaration\", node, opts);\n}\n\nfunction assertModuleSpecifier(node, opts = {}) {\n assert(\"ModuleSpecifier\", node, opts);\n}\n\nfunction assertFlow(node, opts = {}) {\n assert(\"Flow\", node, opts);\n}\n\nfunction assertFlowType(node, opts = {}) {\n assert(\"FlowType\", node, opts);\n}\n\nfunction assertFlowBaseAnnotation(node, opts = {}) {\n assert(\"FlowBaseAnnotation\", node, opts);\n}\n\nfunction assertFlowDeclaration(node, opts = {}) {\n assert(\"FlowDeclaration\", node, opts);\n}\n\nfunction assertFlowPredicate(node, opts = {}) {\n assert(\"FlowPredicate\", node, opts);\n}\n\nfunction assertEnumBody(node, opts = {}) {\n assert(\"EnumBody\", node, opts);\n}\n\nfunction assertEnumMember(node, opts = {}) {\n assert(\"EnumMember\", node, opts);\n}\n\nfunction assertJSX(node, opts = {}) {\n assert(\"JSX\", node, opts);\n}\n\nfunction assertPrivate(node, opts = {}) {\n assert(\"Private\", node, opts);\n}\n\nfunction assertTSTypeElement(node, opts = {}) {\n assert(\"TSTypeElement\", node, opts);\n}\n\nfunction assertTSType(node, opts = {}) {\n assert(\"TSType\", node, opts);\n}\n\nfunction assertTSBaseType(node, opts = {}) {\n assert(\"TSBaseType\", node, opts);\n}\n\nfunction assertNumberLiteral(node, opts) {\n console.trace(\"The node type NumberLiteral has been renamed to NumericLiteral\");\n assert(\"NumberLiteral\", node, opts);\n}\n\nfunction assertRegexLiteral(node, opts) {\n console.trace(\"The node type RegexLiteral has been renamed to RegExpLiteral\");\n assert(\"RegexLiteral\", node, opts);\n}\n\nfunction assertRestProperty(node, opts) {\n console.trace(\"The node type RestProperty has been renamed to RestElement\");\n assert(\"RestProperty\", node, opts);\n}\n\nfunction assertSpreadProperty(node, opts) {\n console.trace(\"The node type SpreadProperty has been renamed to SpreadElement\");\n assert(\"SpreadProperty\", node, opts);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = builder;\n\nvar _clone = _interopRequireDefault(require(\"lodash/clone\"));\n\nvar _definitions = require(\"../definitions\");\n\nvar _validate = _interopRequireDefault(require(\"../validators/validate\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction builder(type, ...args) {\n const keys = _definitions.BUILDER_KEYS[type];\n const countArgs = args.length;\n\n if (countArgs > keys.length) {\n throw new Error(`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`);\n }\n\n const node = {\n type\n };\n let i = 0;\n keys.forEach(key => {\n const field = _definitions.NODE_FIELDS[type][key];\n let arg;\n if (i < countArgs) arg = args[i];\n if (arg === undefined) arg = (0, _clone.default)(field.default);\n node[key] = arg;\n i++;\n });\n\n for (const key of Object.keys(node)) {\n (0, _validate.default)(node, key, node[key]);\n }\n\n return node;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createFlowUnionType;\n\nvar _generated = require(\"../generated\");\n\nvar _removeTypeDuplicates = _interopRequireDefault(require(\"../../modifications/flow/removeTypeDuplicates\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createFlowUnionType(types) {\n const flattened = (0, _removeTypeDuplicates.default)(types);\n\n if (flattened.length === 1) {\n return flattened[0];\n } else {\n return (0, _generated.unionTypeAnnotation)(flattened);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createTypeAnnotationBasedOnTypeof;\n\nvar _generated = require(\"../generated\");\n\nfunction createTypeAnnotationBasedOnTypeof(type) {\n if (type === \"string\") {\n return (0, _generated.stringTypeAnnotation)();\n } else if (type === \"number\") {\n return (0, _generated.numberTypeAnnotation)();\n } else if (type === \"undefined\") {\n return (0, _generated.voidTypeAnnotation)();\n } else if (type === \"boolean\") {\n return (0, _generated.booleanTypeAnnotation)();\n } else if (type === \"function\") {\n return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)(\"Function\"));\n } else if (type === \"object\") {\n return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)(\"Object\"));\n } else if (type === \"symbol\") {\n return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)(\"Symbol\"));\n } else {\n throw new Error(\"Invalid typeof value\");\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ArrayExpression = exports.arrayExpression = arrayExpression;\nexports.AssignmentExpression = exports.assignmentExpression = assignmentExpression;\nexports.BinaryExpression = exports.binaryExpression = binaryExpression;\nexports.InterpreterDirective = exports.interpreterDirective = interpreterDirective;\nexports.Directive = exports.directive = directive;\nexports.DirectiveLiteral = exports.directiveLiteral = directiveLiteral;\nexports.BlockStatement = exports.blockStatement = blockStatement;\nexports.BreakStatement = exports.breakStatement = breakStatement;\nexports.CallExpression = exports.callExpression = callExpression;\nexports.CatchClause = exports.catchClause = catchClause;\nexports.ConditionalExpression = exports.conditionalExpression = conditionalExpression;\nexports.ContinueStatement = exports.continueStatement = continueStatement;\nexports.DebuggerStatement = exports.debuggerStatement = debuggerStatement;\nexports.DoWhileStatement = exports.doWhileStatement = doWhileStatement;\nexports.EmptyStatement = exports.emptyStatement = emptyStatement;\nexports.ExpressionStatement = exports.expressionStatement = expressionStatement;\nexports.File = exports.file = file;\nexports.ForInStatement = exports.forInStatement = forInStatement;\nexports.ForStatement = exports.forStatement = forStatement;\nexports.FunctionDeclaration = exports.functionDeclaration = functionDeclaration;\nexports.FunctionExpression = exports.functionExpression = functionExpression;\nexports.Identifier = exports.identifier = identifier;\nexports.IfStatement = exports.ifStatement = ifStatement;\nexports.LabeledStatement = exports.labeledStatement = labeledStatement;\nexports.StringLiteral = exports.stringLiteral = stringLiteral;\nexports.NumericLiteral = exports.numericLiteral = numericLiteral;\nexports.NullLiteral = exports.nullLiteral = nullLiteral;\nexports.BooleanLiteral = exports.booleanLiteral = booleanLiteral;\nexports.RegExpLiteral = exports.regExpLiteral = regExpLiteral;\nexports.LogicalExpression = exports.logicalExpression = logicalExpression;\nexports.MemberExpression = exports.memberExpression = memberExpression;\nexports.NewExpression = exports.newExpression = newExpression;\nexports.Program = exports.program = program;\nexports.ObjectExpression = exports.objectExpression = objectExpression;\nexports.ObjectMethod = exports.objectMethod = objectMethod;\nexports.ObjectProperty = exports.objectProperty = objectProperty;\nexports.RestElement = exports.restElement = restElement;\nexports.ReturnStatement = exports.returnStatement = returnStatement;\nexports.SequenceExpression = exports.sequenceExpression = sequenceExpression;\nexports.ParenthesizedExpression = exports.parenthesizedExpression = parenthesizedExpression;\nexports.SwitchCase = exports.switchCase = switchCase;\nexports.SwitchStatement = exports.switchStatement = switchStatement;\nexports.ThisExpression = exports.thisExpression = thisExpression;\nexports.ThrowStatement = exports.throwStatement = throwStatement;\nexports.TryStatement = exports.tryStatement = tryStatement;\nexports.UnaryExpression = exports.unaryExpression = unaryExpression;\nexports.UpdateExpression = exports.updateExpression = updateExpression;\nexports.VariableDeclaration = exports.variableDeclaration = variableDeclaration;\nexports.VariableDeclarator = exports.variableDeclarator = variableDeclarator;\nexports.WhileStatement = exports.whileStatement = whileStatement;\nexports.WithStatement = exports.withStatement = withStatement;\nexports.AssignmentPattern = exports.assignmentPattern = assignmentPattern;\nexports.ArrayPattern = exports.arrayPattern = arrayPattern;\nexports.ArrowFunctionExpression = exports.arrowFunctionExpression = arrowFunctionExpression;\nexports.ClassBody = exports.classBody = classBody;\nexports.ClassExpression = exports.classExpression = classExpression;\nexports.ClassDeclaration = exports.classDeclaration = classDeclaration;\nexports.ExportAllDeclaration = exports.exportAllDeclaration = exportAllDeclaration;\nexports.ExportDefaultDeclaration = exports.exportDefaultDeclaration = exportDefaultDeclaration;\nexports.ExportNamedDeclaration = exports.exportNamedDeclaration = exportNamedDeclaration;\nexports.ExportSpecifier = exports.exportSpecifier = exportSpecifier;\nexports.ForOfStatement = exports.forOfStatement = forOfStatement;\nexports.ImportDeclaration = exports.importDeclaration = importDeclaration;\nexports.ImportDefaultSpecifier = exports.importDefaultSpecifier = importDefaultSpecifier;\nexports.ImportNamespaceSpecifier = exports.importNamespaceSpecifier = importNamespaceSpecifier;\nexports.ImportSpecifier = exports.importSpecifier = importSpecifier;\nexports.MetaProperty = exports.metaProperty = metaProperty;\nexports.ClassMethod = exports.classMethod = classMethod;\nexports.ObjectPattern = exports.objectPattern = objectPattern;\nexports.SpreadElement = exports.spreadElement = spreadElement;\nexports.super = exports.Super = _super;\nexports.TaggedTemplateExpression = exports.taggedTemplateExpression = taggedTemplateExpression;\nexports.TemplateElement = exports.templateElement = templateElement;\nexports.TemplateLiteral = exports.templateLiteral = templateLiteral;\nexports.YieldExpression = exports.yieldExpression = yieldExpression;\nexports.AwaitExpression = exports.awaitExpression = awaitExpression;\nexports.import = exports.Import = _import;\nexports.BigIntLiteral = exports.bigIntLiteral = bigIntLiteral;\nexports.ExportNamespaceSpecifier = exports.exportNamespaceSpecifier = exportNamespaceSpecifier;\nexports.OptionalMemberExpression = exports.optionalMemberExpression = optionalMemberExpression;\nexports.OptionalCallExpression = exports.optionalCallExpression = optionalCallExpression;\nexports.AnyTypeAnnotation = exports.anyTypeAnnotation = anyTypeAnnotation;\nexports.ArrayTypeAnnotation = exports.arrayTypeAnnotation = arrayTypeAnnotation;\nexports.BooleanTypeAnnotation = exports.booleanTypeAnnotation = booleanTypeAnnotation;\nexports.BooleanLiteralTypeAnnotation = exports.booleanLiteralTypeAnnotation = booleanLiteralTypeAnnotation;\nexports.NullLiteralTypeAnnotation = exports.nullLiteralTypeAnnotation = nullLiteralTypeAnnotation;\nexports.ClassImplements = exports.classImplements = classImplements;\nexports.DeclareClass = exports.declareClass = declareClass;\nexports.DeclareFunction = exports.declareFunction = declareFunction;\nexports.DeclareInterface = exports.declareInterface = declareInterface;\nexports.DeclareModule = exports.declareModule = declareModule;\nexports.DeclareModuleExports = exports.declareModuleExports = declareModuleExports;\nexports.DeclareTypeAlias = exports.declareTypeAlias = declareTypeAlias;\nexports.DeclareOpaqueType = exports.declareOpaqueType = declareOpaqueType;\nexports.DeclareVariable = exports.declareVariable = declareVariable;\nexports.DeclareExportDeclaration = exports.declareExportDeclaration = declareExportDeclaration;\nexports.DeclareExportAllDeclaration = exports.declareExportAllDeclaration = declareExportAllDeclaration;\nexports.DeclaredPredicate = exports.declaredPredicate = declaredPredicate;\nexports.ExistsTypeAnnotation = exports.existsTypeAnnotation = existsTypeAnnotation;\nexports.FunctionTypeAnnotation = exports.functionTypeAnnotation = functionTypeAnnotation;\nexports.FunctionTypeParam = exports.functionTypeParam = functionTypeParam;\nexports.GenericTypeAnnotation = exports.genericTypeAnnotation = genericTypeAnnotation;\nexports.InferredPredicate = exports.inferredPredicate = inferredPredicate;\nexports.InterfaceExtends = exports.interfaceExtends = interfaceExtends;\nexports.InterfaceDeclaration = exports.interfaceDeclaration = interfaceDeclaration;\nexports.InterfaceTypeAnnotation = exports.interfaceTypeAnnotation = interfaceTypeAnnotation;\nexports.IntersectionTypeAnnotation = exports.intersectionTypeAnnotation = intersectionTypeAnnotation;\nexports.MixedTypeAnnotation = exports.mixedTypeAnnotation = mixedTypeAnnotation;\nexports.EmptyTypeAnnotation = exports.emptyTypeAnnotation = emptyTypeAnnotation;\nexports.NullableTypeAnnotation = exports.nullableTypeAnnotation = nullableTypeAnnotation;\nexports.NumberLiteralTypeAnnotation = exports.numberLiteralTypeAnnotation = numberLiteralTypeAnnotation;\nexports.NumberTypeAnnotation = exports.numberTypeAnnotation = numberTypeAnnotation;\nexports.ObjectTypeAnnotation = exports.objectTypeAnnotation = objectTypeAnnotation;\nexports.ObjectTypeInternalSlot = exports.objectTypeInternalSlot = objectTypeInternalSlot;\nexports.ObjectTypeCallProperty = exports.objectTypeCallProperty = objectTypeCallProperty;\nexports.ObjectTypeIndexer = exports.objectTypeIndexer = objectTypeIndexer;\nexports.ObjectTypeProperty = exports.objectTypeProperty = objectTypeProperty;\nexports.ObjectTypeSpreadProperty = exports.objectTypeSpreadProperty = objectTypeSpreadProperty;\nexports.OpaqueType = exports.opaqueType = opaqueType;\nexports.QualifiedTypeIdentifier = exports.qualifiedTypeIdentifier = qualifiedTypeIdentifier;\nexports.StringLiteralTypeAnnotation = exports.stringLiteralTypeAnnotation = stringLiteralTypeAnnotation;\nexports.StringTypeAnnotation = exports.stringTypeAnnotation = stringTypeAnnotation;\nexports.SymbolTypeAnnotation = exports.symbolTypeAnnotation = symbolTypeAnnotation;\nexports.ThisTypeAnnotation = exports.thisTypeAnnotation = thisTypeAnnotation;\nexports.TupleTypeAnnotation = exports.tupleTypeAnnotation = tupleTypeAnnotation;\nexports.TypeofTypeAnnotation = exports.typeofTypeAnnotation = typeofTypeAnnotation;\nexports.TypeAlias = exports.typeAlias = typeAlias;\nexports.TypeAnnotation = exports.typeAnnotation = typeAnnotation;\nexports.TypeCastExpression = exports.typeCastExpression = typeCastExpression;\nexports.TypeParameter = exports.typeParameter = typeParameter;\nexports.TypeParameterDeclaration = exports.typeParameterDeclaration = typeParameterDeclaration;\nexports.TypeParameterInstantiation = exports.typeParameterInstantiation = typeParameterInstantiation;\nexports.UnionTypeAnnotation = exports.unionTypeAnnotation = unionTypeAnnotation;\nexports.Variance = exports.variance = variance;\nexports.VoidTypeAnnotation = exports.voidTypeAnnotation = voidTypeAnnotation;\nexports.EnumDeclaration = exports.enumDeclaration = enumDeclaration;\nexports.EnumBooleanBody = exports.enumBooleanBody = enumBooleanBody;\nexports.EnumNumberBody = exports.enumNumberBody = enumNumberBody;\nexports.EnumStringBody = exports.enumStringBody = enumStringBody;\nexports.EnumSymbolBody = exports.enumSymbolBody = enumSymbolBody;\nexports.EnumBooleanMember = exports.enumBooleanMember = enumBooleanMember;\nexports.EnumNumberMember = exports.enumNumberMember = enumNumberMember;\nexports.EnumStringMember = exports.enumStringMember = enumStringMember;\nexports.EnumDefaultedMember = exports.enumDefaultedMember = enumDefaultedMember;\nexports.jSXAttribute = exports.JSXAttribute = exports.jsxAttribute = jsxAttribute;\nexports.jSXClosingElement = exports.JSXClosingElement = exports.jsxClosingElement = jsxClosingElement;\nexports.jSXElement = exports.JSXElement = exports.jsxElement = jsxElement;\nexports.jSXEmptyExpression = exports.JSXEmptyExpression = exports.jsxEmptyExpression = jsxEmptyExpression;\nexports.jSXExpressionContainer = exports.JSXExpressionContainer = exports.jsxExpressionContainer = jsxExpressionContainer;\nexports.jSXSpreadChild = exports.JSXSpreadChild = exports.jsxSpreadChild = jsxSpreadChild;\nexports.jSXIdentifier = exports.JSXIdentifier = exports.jsxIdentifier = jsxIdentifier;\nexports.jSXMemberExpression = exports.JSXMemberExpression = exports.jsxMemberExpression = jsxMemberExpression;\nexports.jSXNamespacedName = exports.JSXNamespacedName = exports.jsxNamespacedName = jsxNamespacedName;\nexports.jSXOpeningElement = exports.JSXOpeningElement = exports.jsxOpeningElement = jsxOpeningElement;\nexports.jSXSpreadAttribute = exports.JSXSpreadAttribute = exports.jsxSpreadAttribute = jsxSpreadAttribute;\nexports.jSXText = exports.JSXText = exports.jsxText = jsxText;\nexports.jSXFragment = exports.JSXFragment = exports.jsxFragment = jsxFragment;\nexports.jSXOpeningFragment = exports.JSXOpeningFragment = exports.jsxOpeningFragment = jsxOpeningFragment;\nexports.jSXClosingFragment = exports.JSXClosingFragment = exports.jsxClosingFragment = jsxClosingFragment;\nexports.Noop = exports.noop = noop;\nexports.Placeholder = exports.placeholder = placeholder;\nexports.V8IntrinsicIdentifier = exports.v8IntrinsicIdentifier = v8IntrinsicIdentifier;\nexports.ArgumentPlaceholder = exports.argumentPlaceholder = argumentPlaceholder;\nexports.BindExpression = exports.bindExpression = bindExpression;\nexports.ClassProperty = exports.classProperty = classProperty;\nexports.PipelineTopicExpression = exports.pipelineTopicExpression = pipelineTopicExpression;\nexports.PipelineBareFunction = exports.pipelineBareFunction = pipelineBareFunction;\nexports.PipelinePrimaryTopicReference = exports.pipelinePrimaryTopicReference = pipelinePrimaryTopicReference;\nexports.ClassPrivateProperty = exports.classPrivateProperty = classPrivateProperty;\nexports.ClassPrivateMethod = exports.classPrivateMethod = classPrivateMethod;\nexports.ImportAttribute = exports.importAttribute = importAttribute;\nexports.Decorator = exports.decorator = decorator;\nexports.DoExpression = exports.doExpression = doExpression;\nexports.ExportDefaultSpecifier = exports.exportDefaultSpecifier = exportDefaultSpecifier;\nexports.PrivateName = exports.privateName = privateName;\nexports.RecordExpression = exports.recordExpression = recordExpression;\nexports.TupleExpression = exports.tupleExpression = tupleExpression;\nexports.DecimalLiteral = exports.decimalLiteral = decimalLiteral;\nexports.StaticBlock = exports.staticBlock = staticBlock;\nexports.tSParameterProperty = exports.TSParameterProperty = exports.tsParameterProperty = tsParameterProperty;\nexports.tSDeclareFunction = exports.TSDeclareFunction = exports.tsDeclareFunction = tsDeclareFunction;\nexports.tSDeclareMethod = exports.TSDeclareMethod = exports.tsDeclareMethod = tsDeclareMethod;\nexports.tSQualifiedName = exports.TSQualifiedName = exports.tsQualifiedName = tsQualifiedName;\nexports.tSCallSignatureDeclaration = exports.TSCallSignatureDeclaration = exports.tsCallSignatureDeclaration = tsCallSignatureDeclaration;\nexports.tSConstructSignatureDeclaration = exports.TSConstructSignatureDeclaration = exports.tsConstructSignatureDeclaration = tsConstructSignatureDeclaration;\nexports.tSPropertySignature = exports.TSPropertySignature = exports.tsPropertySignature = tsPropertySignature;\nexports.tSMethodSignature = exports.TSMethodSignature = exports.tsMethodSignature = tsMethodSignature;\nexports.tSIndexSignature = exports.TSIndexSignature = exports.tsIndexSignature = tsIndexSignature;\nexports.tSAnyKeyword = exports.TSAnyKeyword = exports.tsAnyKeyword = tsAnyKeyword;\nexports.tSBooleanKeyword = exports.TSBooleanKeyword = exports.tsBooleanKeyword = tsBooleanKeyword;\nexports.tSBigIntKeyword = exports.TSBigIntKeyword = exports.tsBigIntKeyword = tsBigIntKeyword;\nexports.tSIntrinsicKeyword = exports.TSIntrinsicKeyword = exports.tsIntrinsicKeyword = tsIntrinsicKeyword;\nexports.tSNeverKeyword = exports.TSNeverKeyword = exports.tsNeverKeyword = tsNeverKeyword;\nexports.tSNullKeyword = exports.TSNullKeyword = exports.tsNullKeyword = tsNullKeyword;\nexports.tSNumberKeyword = exports.TSNumberKeyword = exports.tsNumberKeyword = tsNumberKeyword;\nexports.tSObjectKeyword = exports.TSObjectKeyword = exports.tsObjectKeyword = tsObjectKeyword;\nexports.tSStringKeyword = exports.TSStringKeyword = exports.tsStringKeyword = tsStringKeyword;\nexports.tSSymbolKeyword = exports.TSSymbolKeyword = exports.tsSymbolKeyword = tsSymbolKeyword;\nexports.tSUndefinedKeyword = exports.TSUndefinedKeyword = exports.tsUndefinedKeyword = tsUndefinedKeyword;\nexports.tSUnknownKeyword = exports.TSUnknownKeyword = exports.tsUnknownKeyword = tsUnknownKeyword;\nexports.tSVoidKeyword = exports.TSVoidKeyword = exports.tsVoidKeyword = tsVoidKeyword;\nexports.tSThisType = exports.TSThisType = exports.tsThisType = tsThisType;\nexports.tSFunctionType = exports.TSFunctionType = exports.tsFunctionType = tsFunctionType;\nexports.tSConstructorType = exports.TSConstructorType = exports.tsConstructorType = tsConstructorType;\nexports.tSTypeReference = exports.TSTypeReference = exports.tsTypeReference = tsTypeReference;\nexports.tSTypePredicate = exports.TSTypePredicate = exports.tsTypePredicate = tsTypePredicate;\nexports.tSTypeQuery = exports.TSTypeQuery = exports.tsTypeQuery = tsTypeQuery;\nexports.tSTypeLiteral = exports.TSTypeLiteral = exports.tsTypeLiteral = tsTypeLiteral;\nexports.tSArrayType = exports.TSArrayType = exports.tsArrayType = tsArrayType;\nexports.tSTupleType = exports.TSTupleType = exports.tsTupleType = tsTupleType;\nexports.tSOptionalType = exports.TSOptionalType = exports.tsOptionalType = tsOptionalType;\nexports.tSRestType = exports.TSRestType = exports.tsRestType = tsRestType;\nexports.tSNamedTupleMember = exports.TSNamedTupleMember = exports.tsNamedTupleMember = tsNamedTupleMember;\nexports.tSUnionType = exports.TSUnionType = exports.tsUnionType = tsUnionType;\nexports.tSIntersectionType = exports.TSIntersectionType = exports.tsIntersectionType = tsIntersectionType;\nexports.tSConditionalType = exports.TSConditionalType = exports.tsConditionalType = tsConditionalType;\nexports.tSInferType = exports.TSInferType = exports.tsInferType = tsInferType;\nexports.tSParenthesizedType = exports.TSParenthesizedType = exports.tsParenthesizedType = tsParenthesizedType;\nexports.tSTypeOperator = exports.TSTypeOperator = exports.tsTypeOperator = tsTypeOperator;\nexports.tSIndexedAccessType = exports.TSIndexedAccessType = exports.tsIndexedAccessType = tsIndexedAccessType;\nexports.tSMappedType = exports.TSMappedType = exports.tsMappedType = tsMappedType;\nexports.tSLiteralType = exports.TSLiteralType = exports.tsLiteralType = tsLiteralType;\nexports.tSExpressionWithTypeArguments = exports.TSExpressionWithTypeArguments = exports.tsExpressionWithTypeArguments = tsExpressionWithTypeArguments;\nexports.tSInterfaceDeclaration = exports.TSInterfaceDeclaration = exports.tsInterfaceDeclaration = tsInterfaceDeclaration;\nexports.tSInterfaceBody = exports.TSInterfaceBody = exports.tsInterfaceBody = tsInterfaceBody;\nexports.tSTypeAliasDeclaration = exports.TSTypeAliasDeclaration = exports.tsTypeAliasDeclaration = tsTypeAliasDeclaration;\nexports.tSAsExpression = exports.TSAsExpression = exports.tsAsExpression = tsAsExpression;\nexports.tSTypeAssertion = exports.TSTypeAssertion = exports.tsTypeAssertion = tsTypeAssertion;\nexports.tSEnumDeclaration = exports.TSEnumDeclaration = exports.tsEnumDeclaration = tsEnumDeclaration;\nexports.tSEnumMember = exports.TSEnumMember = exports.tsEnumMember = tsEnumMember;\nexports.tSModuleDeclaration = exports.TSModuleDeclaration = exports.tsModuleDeclaration = tsModuleDeclaration;\nexports.tSModuleBlock = exports.TSModuleBlock = exports.tsModuleBlock = tsModuleBlock;\nexports.tSImportType = exports.TSImportType = exports.tsImportType = tsImportType;\nexports.tSImportEqualsDeclaration = exports.TSImportEqualsDeclaration = exports.tsImportEqualsDeclaration = tsImportEqualsDeclaration;\nexports.tSExternalModuleReference = exports.TSExternalModuleReference = exports.tsExternalModuleReference = tsExternalModuleReference;\nexports.tSNonNullExpression = exports.TSNonNullExpression = exports.tsNonNullExpression = tsNonNullExpression;\nexports.tSExportAssignment = exports.TSExportAssignment = exports.tsExportAssignment = tsExportAssignment;\nexports.tSNamespaceExportDeclaration = exports.TSNamespaceExportDeclaration = exports.tsNamespaceExportDeclaration = tsNamespaceExportDeclaration;\nexports.tSTypeAnnotation = exports.TSTypeAnnotation = exports.tsTypeAnnotation = tsTypeAnnotation;\nexports.tSTypeParameterInstantiation = exports.TSTypeParameterInstantiation = exports.tsTypeParameterInstantiation = tsTypeParameterInstantiation;\nexports.tSTypeParameterDeclaration = exports.TSTypeParameterDeclaration = exports.tsTypeParameterDeclaration = tsTypeParameterDeclaration;\nexports.tSTypeParameter = exports.TSTypeParameter = exports.tsTypeParameter = tsTypeParameter;\nexports.numberLiteral = exports.NumberLiteral = NumberLiteral;\nexports.regexLiteral = exports.RegexLiteral = RegexLiteral;\nexports.restProperty = exports.RestProperty = RestProperty;\nexports.spreadProperty = exports.SpreadProperty = SpreadProperty;\n\nvar _builder = _interopRequireDefault(require(\"../builder\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction arrayExpression(...args) {\n return (0, _builder.default)(\"ArrayExpression\", ...args);\n}\n\nfunction assignmentExpression(...args) {\n return (0, _builder.default)(\"AssignmentExpression\", ...args);\n}\n\nfunction binaryExpression(...args) {\n return (0, _builder.default)(\"BinaryExpression\", ...args);\n}\n\nfunction interpreterDirective(...args) {\n return (0, _builder.default)(\"InterpreterDirective\", ...args);\n}\n\nfunction directive(...args) {\n return (0, _builder.default)(\"Directive\", ...args);\n}\n\nfunction directiveLiteral(...args) {\n return (0, _builder.default)(\"DirectiveLiteral\", ...args);\n}\n\nfunction blockStatement(...args) {\n return (0, _builder.default)(\"BlockStatement\", ...args);\n}\n\nfunction breakStatement(...args) {\n return (0, _builder.default)(\"BreakStatement\", ...args);\n}\n\nfunction callExpression(...args) {\n return (0, _builder.default)(\"CallExpression\", ...args);\n}\n\nfunction catchClause(...args) {\n return (0, _builder.default)(\"CatchClause\", ...args);\n}\n\nfunction conditionalExpression(...args) {\n return (0, _builder.default)(\"ConditionalExpression\", ...args);\n}\n\nfunction continueStatement(...args) {\n return (0, _builder.default)(\"ContinueStatement\", ...args);\n}\n\nfunction debuggerStatement(...args) {\n return (0, _builder.default)(\"DebuggerStatement\", ...args);\n}\n\nfunction doWhileStatement(...args) {\n return (0, _builder.default)(\"DoWhileStatement\", ...args);\n}\n\nfunction emptyStatement(...args) {\n return (0, _builder.default)(\"EmptyStatement\", ...args);\n}\n\nfunction expressionStatement(...args) {\n return (0, _builder.default)(\"ExpressionStatement\", ...args);\n}\n\nfunction file(...args) {\n return (0, _builder.default)(\"File\", ...args);\n}\n\nfunction forInStatement(...args) {\n return (0, _builder.default)(\"ForInStatement\", ...args);\n}\n\nfunction forStatement(...args) {\n return (0, _builder.default)(\"ForStatement\", ...args);\n}\n\nfunction functionDeclaration(...args) {\n return (0, _builder.default)(\"FunctionDeclaration\", ...args);\n}\n\nfunction functionExpression(...args) {\n return (0, _builder.default)(\"FunctionExpression\", ...args);\n}\n\nfunction identifier(...args) {\n return (0, _builder.default)(\"Identifier\", ...args);\n}\n\nfunction ifStatement(...args) {\n return (0, _builder.default)(\"IfStatement\", ...args);\n}\n\nfunction labeledStatement(...args) {\n return (0, _builder.default)(\"LabeledStatement\", ...args);\n}\n\nfunction stringLiteral(...args) {\n return (0, _builder.default)(\"StringLiteral\", ...args);\n}\n\nfunction numericLiteral(...args) {\n return (0, _builder.default)(\"NumericLiteral\", ...args);\n}\n\nfunction nullLiteral(...args) {\n return (0, _builder.default)(\"NullLiteral\", ...args);\n}\n\nfunction booleanLiteral(...args) {\n return (0, _builder.default)(\"BooleanLiteral\", ...args);\n}\n\nfunction regExpLiteral(...args) {\n return (0, _builder.default)(\"RegExpLiteral\", ...args);\n}\n\nfunction logicalExpression(...args) {\n return (0, _builder.default)(\"LogicalExpression\", ...args);\n}\n\nfunction memberExpression(...args) {\n return (0, _builder.default)(\"MemberExpression\", ...args);\n}\n\nfunction newExpression(...args) {\n return (0, _builder.default)(\"NewExpression\", ...args);\n}\n\nfunction program(...args) {\n return (0, _builder.default)(\"Program\", ...args);\n}\n\nfunction objectExpression(...args) {\n return (0, _builder.default)(\"ObjectExpression\", ...args);\n}\n\nfunction objectMethod(...args) {\n return (0, _builder.default)(\"ObjectMethod\", ...args);\n}\n\nfunction objectProperty(...args) {\n return (0, _builder.default)(\"ObjectProperty\", ...args);\n}\n\nfunction restElement(...args) {\n return (0, _builder.default)(\"RestElement\", ...args);\n}\n\nfunction returnStatement(...args) {\n return (0, _builder.default)(\"ReturnStatement\", ...args);\n}\n\nfunction sequenceExpression(...args) {\n return (0, _builder.default)(\"SequenceExpression\", ...args);\n}\n\nfunction parenthesizedExpression(...args) {\n return (0, _builder.default)(\"ParenthesizedExpression\", ...args);\n}\n\nfunction switchCase(...args) {\n return (0, _builder.default)(\"SwitchCase\", ...args);\n}\n\nfunction switchStatement(...args) {\n return (0, _builder.default)(\"SwitchStatement\", ...args);\n}\n\nfunction thisExpression(...args) {\n return (0, _builder.default)(\"ThisExpression\", ...args);\n}\n\nfunction throwStatement(...args) {\n return (0, _builder.default)(\"ThrowStatement\", ...args);\n}\n\nfunction tryStatement(...args) {\n return (0, _builder.default)(\"TryStatement\", ...args);\n}\n\nfunction unaryExpression(...args) {\n return (0, _builder.default)(\"UnaryExpression\", ...args);\n}\n\nfunction updateExpression(...args) {\n return (0, _builder.default)(\"UpdateExpression\", ...args);\n}\n\nfunction variableDeclaration(...args) {\n return (0, _builder.default)(\"VariableDeclaration\", ...args);\n}\n\nfunction variableDeclarator(...args) {\n return (0, _builder.default)(\"VariableDeclarator\", ...args);\n}\n\nfunction whileStatement(...args) {\n return (0, _builder.default)(\"WhileStatement\", ...args);\n}\n\nfunction withStatement(...args) {\n return (0, _builder.default)(\"WithStatement\", ...args);\n}\n\nfunction assignmentPattern(...args) {\n return (0, _builder.default)(\"AssignmentPattern\", ...args);\n}\n\nfunction arrayPattern(...args) {\n return (0, _builder.default)(\"ArrayPattern\", ...args);\n}\n\nfunction arrowFunctionExpression(...args) {\n return (0, _builder.default)(\"ArrowFunctionExpression\", ...args);\n}\n\nfunction classBody(...args) {\n return (0, _builder.default)(\"ClassBody\", ...args);\n}\n\nfunction classExpression(...args) {\n return (0, _builder.default)(\"ClassExpression\", ...args);\n}\n\nfunction classDeclaration(...args) {\n return (0, _builder.default)(\"ClassDeclaration\", ...args);\n}\n\nfunction exportAllDeclaration(...args) {\n return (0, _builder.default)(\"ExportAllDeclaration\", ...args);\n}\n\nfunction exportDefaultDeclaration(...args) {\n return (0, _builder.default)(\"ExportDefaultDeclaration\", ...args);\n}\n\nfunction exportNamedDeclaration(...args) {\n return (0, _builder.default)(\"ExportNamedDeclaration\", ...args);\n}\n\nfunction exportSpecifier(...args) {\n return (0, _builder.default)(\"ExportSpecifier\", ...args);\n}\n\nfunction forOfStatement(...args) {\n return (0, _builder.default)(\"ForOfStatement\", ...args);\n}\n\nfunction importDeclaration(...args) {\n return (0, _builder.default)(\"ImportDeclaration\", ...args);\n}\n\nfunction importDefaultSpecifier(...args) {\n return (0, _builder.default)(\"ImportDefaultSpecifier\", ...args);\n}\n\nfunction importNamespaceSpecifier(...args) {\n return (0, _builder.default)(\"ImportNamespaceSpecifier\", ...args);\n}\n\nfunction importSpecifier(...args) {\n return (0, _builder.default)(\"ImportSpecifier\", ...args);\n}\n\nfunction metaProperty(...args) {\n return (0, _builder.default)(\"MetaProperty\", ...args);\n}\n\nfunction classMethod(...args) {\n return (0, _builder.default)(\"ClassMethod\", ...args);\n}\n\nfunction objectPattern(...args) {\n return (0, _builder.default)(\"ObjectPattern\", ...args);\n}\n\nfunction spreadElement(...args) {\n return (0, _builder.default)(\"SpreadElement\", ...args);\n}\n\nfunction _super(...args) {\n return (0, _builder.default)(\"Super\", ...args);\n}\n\nfunction taggedTemplateExpression(...args) {\n return (0, _builder.default)(\"TaggedTemplateExpression\", ...args);\n}\n\nfunction templateElement(...args) {\n return (0, _builder.default)(\"TemplateElement\", ...args);\n}\n\nfunction templateLiteral(...args) {\n return (0, _builder.default)(\"TemplateLiteral\", ...args);\n}\n\nfunction yieldExpression(...args) {\n return (0, _builder.default)(\"YieldExpression\", ...args);\n}\n\nfunction awaitExpression(...args) {\n return (0, _builder.default)(\"AwaitExpression\", ...args);\n}\n\nfunction _import(...args) {\n return (0, _builder.default)(\"Import\", ...args);\n}\n\nfunction bigIntLiteral(...args) {\n return (0, _builder.default)(\"BigIntLiteral\", ...args);\n}\n\nfunction exportNamespaceSpecifier(...args) {\n return (0, _builder.default)(\"ExportNamespaceSpecifier\", ...args);\n}\n\nfunction optionalMemberExpression(...args) {\n return (0, _builder.default)(\"OptionalMemberExpression\", ...args);\n}\n\nfunction optionalCallExpression(...args) {\n return (0, _builder.default)(\"OptionalCallExpression\", ...args);\n}\n\nfunction anyTypeAnnotation(...args) {\n return (0, _builder.default)(\"AnyTypeAnnotation\", ...args);\n}\n\nfunction arrayTypeAnnotation(...args) {\n return (0, _builder.default)(\"ArrayTypeAnnotation\", ...args);\n}\n\nfunction booleanTypeAnnotation(...args) {\n return (0, _builder.default)(\"BooleanTypeAnnotation\", ...args);\n}\n\nfunction booleanLiteralTypeAnnotation(...args) {\n return (0, _builder.default)(\"BooleanLiteralTypeAnnotation\", ...args);\n}\n\nfunction nullLiteralTypeAnnotation(...args) {\n return (0, _builder.default)(\"NullLiteralTypeAnnotation\", ...args);\n}\n\nfunction classImplements(...args) {\n return (0, _builder.default)(\"ClassImplements\", ...args);\n}\n\nfunction declareClass(...args) {\n return (0, _builder.default)(\"DeclareClass\", ...args);\n}\n\nfunction declareFunction(...args) {\n return (0, _builder.default)(\"DeclareFunction\", ...args);\n}\n\nfunction declareInterface(...args) {\n return (0, _builder.default)(\"DeclareInterface\", ...args);\n}\n\nfunction declareModule(...args) {\n return (0, _builder.default)(\"DeclareModule\", ...args);\n}\n\nfunction declareModuleExports(...args) {\n return (0, _builder.default)(\"DeclareModuleExports\", ...args);\n}\n\nfunction declareTypeAlias(...args) {\n return (0, _builder.default)(\"DeclareTypeAlias\", ...args);\n}\n\nfunction declareOpaqueType(...args) {\n return (0, _builder.default)(\"DeclareOpaqueType\", ...args);\n}\n\nfunction declareVariable(...args) {\n return (0, _builder.default)(\"DeclareVariable\", ...args);\n}\n\nfunction declareExportDeclaration(...args) {\n return (0, _builder.default)(\"DeclareExportDeclaration\", ...args);\n}\n\nfunction declareExportAllDeclaration(...args) {\n return (0, _builder.default)(\"DeclareExportAllDeclaration\", ...args);\n}\n\nfunction declaredPredicate(...args) {\n return (0, _builder.default)(\"DeclaredPredicate\", ...args);\n}\n\nfunction existsTypeAnnotation(...args) {\n return (0, _builder.default)(\"ExistsTypeAnnotation\", ...args);\n}\n\nfunction functionTypeAnnotation(...args) {\n return (0, _builder.default)(\"FunctionTypeAnnotation\", ...args);\n}\n\nfunction functionTypeParam(...args) {\n return (0, _builder.default)(\"FunctionTypeParam\", ...args);\n}\n\nfunction genericTypeAnnotation(...args) {\n return (0, _builder.default)(\"GenericTypeAnnotation\", ...args);\n}\n\nfunction inferredPredicate(...args) {\n return (0, _builder.default)(\"InferredPredicate\", ...args);\n}\n\nfunction interfaceExtends(...args) {\n return (0, _builder.default)(\"InterfaceExtends\", ...args);\n}\n\nfunction interfaceDeclaration(...args) {\n return (0, _builder.default)(\"InterfaceDeclaration\", ...args);\n}\n\nfunction interfaceTypeAnnotation(...args) {\n return (0, _builder.default)(\"InterfaceTypeAnnotation\", ...args);\n}\n\nfunction intersectionTypeAnnotation(...args) {\n return (0, _builder.default)(\"IntersectionTypeAnnotation\", ...args);\n}\n\nfunction mixedTypeAnnotation(...args) {\n return (0, _builder.default)(\"MixedTypeAnnotation\", ...args);\n}\n\nfunction emptyTypeAnnotation(...args) {\n return (0, _builder.default)(\"EmptyTypeAnnotation\", ...args);\n}\n\nfunction nullableTypeAnnotation(...args) {\n return (0, _builder.default)(\"NullableTypeAnnotation\", ...args);\n}\n\nfunction numberLiteralTypeAnnotation(...args) {\n return (0, _builder.default)(\"NumberLiteralTypeAnnotation\", ...args);\n}\n\nfunction numberTypeAnnotation(...args) {\n return (0, _builder.default)(\"NumberTypeAnnotation\", ...args);\n}\n\nfunction objectTypeAnnotation(...args) {\n return (0, _builder.default)(\"ObjectTypeAnnotation\", ...args);\n}\n\nfunction objectTypeInternalSlot(...args) {\n return (0, _builder.default)(\"ObjectTypeInternalSlot\", ...args);\n}\n\nfunction objectTypeCallProperty(...args) {\n return (0, _builder.default)(\"ObjectTypeCallProperty\", ...args);\n}\n\nfunction objectTypeIndexer(...args) {\n return (0, _builder.default)(\"ObjectTypeIndexer\", ...args);\n}\n\nfunction objectTypeProperty(...args) {\n return (0, _builder.default)(\"ObjectTypeProperty\", ...args);\n}\n\nfunction objectTypeSpreadProperty(...args) {\n return (0, _builder.default)(\"ObjectTypeSpreadProperty\", ...args);\n}\n\nfunction opaqueType(...args) {\n return (0, _builder.default)(\"OpaqueType\", ...args);\n}\n\nfunction qualifiedTypeIdentifier(...args) {\n return (0, _builder.default)(\"QualifiedTypeIdentifier\", ...args);\n}\n\nfunction stringLiteralTypeAnnotation(...args) {\n return (0, _builder.default)(\"StringLiteralTypeAnnotation\", ...args);\n}\n\nfunction stringTypeAnnotation(...args) {\n return (0, _builder.default)(\"StringTypeAnnotation\", ...args);\n}\n\nfunction symbolTypeAnnotation(...args) {\n return (0, _builder.default)(\"SymbolTypeAnnotation\", ...args);\n}\n\nfunction thisTypeAnnotation(...args) {\n return (0, _builder.default)(\"ThisTypeAnnotation\", ...args);\n}\n\nfunction tupleTypeAnnotation(...args) {\n return (0, _builder.default)(\"TupleTypeAnnotation\", ...args);\n}\n\nfunction typeofTypeAnnotation(...args) {\n return (0, _builder.default)(\"TypeofTypeAnnotation\", ...args);\n}\n\nfunction typeAlias(...args) {\n return (0, _builder.default)(\"TypeAlias\", ...args);\n}\n\nfunction typeAnnotation(...args) {\n return (0, _builder.default)(\"TypeAnnotation\", ...args);\n}\n\nfunction typeCastExpression(...args) {\n return (0, _builder.default)(\"TypeCastExpression\", ...args);\n}\n\nfunction typeParameter(...args) {\n return (0, _builder.default)(\"TypeParameter\", ...args);\n}\n\nfunction typeParameterDeclaration(...args) {\n return (0, _builder.default)(\"TypeParameterDeclaration\", ...args);\n}\n\nfunction typeParameterInstantiation(...args) {\n return (0, _builder.default)(\"TypeParameterInstantiation\", ...args);\n}\n\nfunction unionTypeAnnotation(...args) {\n return (0, _builder.default)(\"UnionTypeAnnotation\", ...args);\n}\n\nfunction variance(...args) {\n return (0, _builder.default)(\"Variance\", ...args);\n}\n\nfunction voidTypeAnnotation(...args) {\n return (0, _builder.default)(\"VoidTypeAnnotation\", ...args);\n}\n\nfunction enumDeclaration(...args) {\n return (0, _builder.default)(\"EnumDeclaration\", ...args);\n}\n\nfunction enumBooleanBody(...args) {\n return (0, _builder.default)(\"EnumBooleanBody\", ...args);\n}\n\nfunction enumNumberBody(...args) {\n return (0, _builder.default)(\"EnumNumberBody\", ...args);\n}\n\nfunction enumStringBody(...args) {\n return (0, _builder.default)(\"EnumStringBody\", ...args);\n}\n\nfunction enumSymbolBody(...args) {\n return (0, _builder.default)(\"EnumSymbolBody\", ...args);\n}\n\nfunction enumBooleanMember(...args) {\n return (0, _builder.default)(\"EnumBooleanMember\", ...args);\n}\n\nfunction enumNumberMember(...args) {\n return (0, _builder.default)(\"EnumNumberMember\", ...args);\n}\n\nfunction enumStringMember(...args) {\n return (0, _builder.default)(\"EnumStringMember\", ...args);\n}\n\nfunction enumDefaultedMember(...args) {\n return (0, _builder.default)(\"EnumDefaultedMember\", ...args);\n}\n\nfunction jsxAttribute(...args) {\n return (0, _builder.default)(\"JSXAttribute\", ...args);\n}\n\nfunction jsxClosingElement(...args) {\n return (0, _builder.default)(\"JSXClosingElement\", ...args);\n}\n\nfunction jsxElement(...args) {\n return (0, _builder.default)(\"JSXElement\", ...args);\n}\n\nfunction jsxEmptyExpression(...args) {\n return (0, _builder.default)(\"JSXEmptyExpression\", ...args);\n}\n\nfunction jsxExpressionContainer(...args) {\n return (0, _builder.default)(\"JSXExpressionContainer\", ...args);\n}\n\nfunction jsxSpreadChild(...args) {\n return (0, _builder.default)(\"JSXSpreadChild\", ...args);\n}\n\nfunction jsxIdentifier(...args) {\n return (0, _builder.default)(\"JSXIdentifier\", ...args);\n}\n\nfunction jsxMemberExpression(...args) {\n return (0, _builder.default)(\"JSXMemberExpression\", ...args);\n}\n\nfunction jsxNamespacedName(...args) {\n return (0, _builder.default)(\"JSXNamespacedName\", ...args);\n}\n\nfunction jsxOpeningElement(...args) {\n return (0, _builder.default)(\"JSXOpeningElement\", ...args);\n}\n\nfunction jsxSpreadAttribute(...args) {\n return (0, _builder.default)(\"JSXSpreadAttribute\", ...args);\n}\n\nfunction jsxText(...args) {\n return (0, _builder.default)(\"JSXText\", ...args);\n}\n\nfunction jsxFragment(...args) {\n return (0, _builder.default)(\"JSXFragment\", ...args);\n}\n\nfunction jsxOpeningFragment(...args) {\n return (0, _builder.default)(\"JSXOpeningFragment\", ...args);\n}\n\nfunction jsxClosingFragment(...args) {\n return (0, _builder.default)(\"JSXClosingFragment\", ...args);\n}\n\nfunction noop(...args) {\n return (0, _builder.default)(\"Noop\", ...args);\n}\n\nfunction placeholder(...args) {\n return (0, _builder.default)(\"Placeholder\", ...args);\n}\n\nfunction v8IntrinsicIdentifier(...args) {\n return (0, _builder.default)(\"V8IntrinsicIdentifier\", ...args);\n}\n\nfunction argumentPlaceholder(...args) {\n return (0, _builder.default)(\"ArgumentPlaceholder\", ...args);\n}\n\nfunction bindExpression(...args) {\n return (0, _builder.default)(\"BindExpression\", ...args);\n}\n\nfunction classProperty(...args) {\n return (0, _builder.default)(\"ClassProperty\", ...args);\n}\n\nfunction pipelineTopicExpression(...args) {\n return (0, _builder.default)(\"PipelineTopicExpression\", ...args);\n}\n\nfunction pipelineBareFunction(...args) {\n return (0, _builder.default)(\"PipelineBareFunction\", ...args);\n}\n\nfunction pipelinePrimaryTopicReference(...args) {\n return (0, _builder.default)(\"PipelinePrimaryTopicReference\", ...args);\n}\n\nfunction classPrivateProperty(...args) {\n return (0, _builder.default)(\"ClassPrivateProperty\", ...args);\n}\n\nfunction classPrivateMethod(...args) {\n return (0, _builder.default)(\"ClassPrivateMethod\", ...args);\n}\n\nfunction importAttribute(...args) {\n return (0, _builder.default)(\"ImportAttribute\", ...args);\n}\n\nfunction decorator(...args) {\n return (0, _builder.default)(\"Decorator\", ...args);\n}\n\nfunction doExpression(...args) {\n return (0, _builder.default)(\"DoExpression\", ...args);\n}\n\nfunction exportDefaultSpecifier(...args) {\n return (0, _builder.default)(\"ExportDefaultSpecifier\", ...args);\n}\n\nfunction privateName(...args) {\n return (0, _builder.default)(\"PrivateName\", ...args);\n}\n\nfunction recordExpression(...args) {\n return (0, _builder.default)(\"RecordExpression\", ...args);\n}\n\nfunction tupleExpression(...args) {\n return (0, _builder.default)(\"TupleExpression\", ...args);\n}\n\nfunction decimalLiteral(...args) {\n return (0, _builder.default)(\"DecimalLiteral\", ...args);\n}\n\nfunction staticBlock(...args) {\n return (0, _builder.default)(\"StaticBlock\", ...args);\n}\n\nfunction tsParameterProperty(...args) {\n return (0, _builder.default)(\"TSParameterProperty\", ...args);\n}\n\nfunction tsDeclareFunction(...args) {\n return (0, _builder.default)(\"TSDeclareFunction\", ...args);\n}\n\nfunction tsDeclareMethod(...args) {\n return (0, _builder.default)(\"TSDeclareMethod\", ...args);\n}\n\nfunction tsQualifiedName(...args) {\n return (0, _builder.default)(\"TSQualifiedName\", ...args);\n}\n\nfunction tsCallSignatureDeclaration(...args) {\n return (0, _builder.default)(\"TSCallSignatureDeclaration\", ...args);\n}\n\nfunction tsConstructSignatureDeclaration(...args) {\n return (0, _builder.default)(\"TSConstructSignatureDeclaration\", ...args);\n}\n\nfunction tsPropertySignature(...args) {\n return (0, _builder.default)(\"TSPropertySignature\", ...args);\n}\n\nfunction tsMethodSignature(...args) {\n return (0, _builder.default)(\"TSMethodSignature\", ...args);\n}\n\nfunction tsIndexSignature(...args) {\n return (0, _builder.default)(\"TSIndexSignature\", ...args);\n}\n\nfunction tsAnyKeyword(...args) {\n return (0, _builder.default)(\"TSAnyKeyword\", ...args);\n}\n\nfunction tsBooleanKeyword(...args) {\n return (0, _builder.default)(\"TSBooleanKeyword\", ...args);\n}\n\nfunction tsBigIntKeyword(...args) {\n return (0, _builder.default)(\"TSBigIntKeyword\", ...args);\n}\n\nfunction tsIntrinsicKeyword(...args) {\n return (0, _builder.default)(\"TSIntrinsicKeyword\", ...args);\n}\n\nfunction tsNeverKeyword(...args) {\n return (0, _builder.default)(\"TSNeverKeyword\", ...args);\n}\n\nfunction tsNullKeyword(...args) {\n return (0, _builder.default)(\"TSNullKeyword\", ...args);\n}\n\nfunction tsNumberKeyword(...args) {\n return (0, _builder.default)(\"TSNumberKeyword\", ...args);\n}\n\nfunction tsObjectKeyword(...args) {\n return (0, _builder.default)(\"TSObjectKeyword\", ...args);\n}\n\nfunction tsStringKeyword(...args) {\n return (0, _builder.default)(\"TSStringKeyword\", ...args);\n}\n\nfunction tsSymbolKeyword(...args) {\n return (0, _builder.default)(\"TSSymbolKeyword\", ...args);\n}\n\nfunction tsUndefinedKeyword(...args) {\n return (0, _builder.default)(\"TSUndefinedKeyword\", ...args);\n}\n\nfunction tsUnknownKeyword(...args) {\n return (0, _builder.default)(\"TSUnknownKeyword\", ...args);\n}\n\nfunction tsVoidKeyword(...args) {\n return (0, _builder.default)(\"TSVoidKeyword\", ...args);\n}\n\nfunction tsThisType(...args) {\n return (0, _builder.default)(\"TSThisType\", ...args);\n}\n\nfunction tsFunctionType(...args) {\n return (0, _builder.default)(\"TSFunctionType\", ...args);\n}\n\nfunction tsConstructorType(...args) {\n return (0, _builder.default)(\"TSConstructorType\", ...args);\n}\n\nfunction tsTypeReference(...args) {\n return (0, _builder.default)(\"TSTypeReference\", ...args);\n}\n\nfunction tsTypePredicate(...args) {\n return (0, _builder.default)(\"TSTypePredicate\", ...args);\n}\n\nfunction tsTypeQuery(...args) {\n return (0, _builder.default)(\"TSTypeQuery\", ...args);\n}\n\nfunction tsTypeLiteral(...args) {\n return (0, _builder.default)(\"TSTypeLiteral\", ...args);\n}\n\nfunction tsArrayType(...args) {\n return (0, _builder.default)(\"TSArrayType\", ...args);\n}\n\nfunction tsTupleType(...args) {\n return (0, _builder.default)(\"TSTupleType\", ...args);\n}\n\nfunction tsOptionalType(...args) {\n return (0, _builder.default)(\"TSOptionalType\", ...args);\n}\n\nfunction tsRestType(...args) {\n return (0, _builder.default)(\"TSRestType\", ...args);\n}\n\nfunction tsNamedTupleMember(...args) {\n return (0, _builder.default)(\"TSNamedTupleMember\", ...args);\n}\n\nfunction tsUnionType(...args) {\n return (0, _builder.default)(\"TSUnionType\", ...args);\n}\n\nfunction tsIntersectionType(...args) {\n return (0, _builder.default)(\"TSIntersectionType\", ...args);\n}\n\nfunction tsConditionalType(...args) {\n return (0, _builder.default)(\"TSConditionalType\", ...args);\n}\n\nfunction tsInferType(...args) {\n return (0, _builder.default)(\"TSInferType\", ...args);\n}\n\nfunction tsParenthesizedType(...args) {\n return (0, _builder.default)(\"TSParenthesizedType\", ...args);\n}\n\nfunction tsTypeOperator(...args) {\n return (0, _builder.default)(\"TSTypeOperator\", ...args);\n}\n\nfunction tsIndexedAccessType(...args) {\n return (0, _builder.default)(\"TSIndexedAccessType\", ...args);\n}\n\nfunction tsMappedType(...args) {\n return (0, _builder.default)(\"TSMappedType\", ...args);\n}\n\nfunction tsLiteralType(...args) {\n return (0, _builder.default)(\"TSLiteralType\", ...args);\n}\n\nfunction tsExpressionWithTypeArguments(...args) {\n return (0, _builder.default)(\"TSExpressionWithTypeArguments\", ...args);\n}\n\nfunction tsInterfaceDeclaration(...args) {\n return (0, _builder.default)(\"TSInterfaceDeclaration\", ...args);\n}\n\nfunction tsInterfaceBody(...args) {\n return (0, _builder.default)(\"TSInterfaceBody\", ...args);\n}\n\nfunction tsTypeAliasDeclaration(...args) {\n return (0, _builder.default)(\"TSTypeAliasDeclaration\", ...args);\n}\n\nfunction tsAsExpression(...args) {\n return (0, _builder.default)(\"TSAsExpression\", ...args);\n}\n\nfunction tsTypeAssertion(...args) {\n return (0, _builder.default)(\"TSTypeAssertion\", ...args);\n}\n\nfunction tsEnumDeclaration(...args) {\n return (0, _builder.default)(\"TSEnumDeclaration\", ...args);\n}\n\nfunction tsEnumMember(...args) {\n return (0, _builder.default)(\"TSEnumMember\", ...args);\n}\n\nfunction tsModuleDeclaration(...args) {\n return (0, _builder.default)(\"TSModuleDeclaration\", ...args);\n}\n\nfunction tsModuleBlock(...args) {\n return (0, _builder.default)(\"TSModuleBlock\", ...args);\n}\n\nfunction tsImportType(...args) {\n return (0, _builder.default)(\"TSImportType\", ...args);\n}\n\nfunction tsImportEqualsDeclaration(...args) {\n return (0, _builder.default)(\"TSImportEqualsDeclaration\", ...args);\n}\n\nfunction tsExternalModuleReference(...args) {\n return (0, _builder.default)(\"TSExternalModuleReference\", ...args);\n}\n\nfunction tsNonNullExpression(...args) {\n return (0, _builder.default)(\"TSNonNullExpression\", ...args);\n}\n\nfunction tsExportAssignment(...args) {\n return (0, _builder.default)(\"TSExportAssignment\", ...args);\n}\n\nfunction tsNamespaceExportDeclaration(...args) {\n return (0, _builder.default)(\"TSNamespaceExportDeclaration\", ...args);\n}\n\nfunction tsTypeAnnotation(...args) {\n return (0, _builder.default)(\"TSTypeAnnotation\", ...args);\n}\n\nfunction tsTypeParameterInstantiation(...args) {\n return (0, _builder.default)(\"TSTypeParameterInstantiation\", ...args);\n}\n\nfunction tsTypeParameterDeclaration(...args) {\n return (0, _builder.default)(\"TSTypeParameterDeclaration\", ...args);\n}\n\nfunction tsTypeParameter(...args) {\n return (0, _builder.default)(\"TSTypeParameter\", ...args);\n}\n\nfunction NumberLiteral(...args) {\n console.trace(\"The node type NumberLiteral has been renamed to NumericLiteral\");\n return (0, _builder.default)(\"NumberLiteral\", ...args);\n}\n\nfunction RegexLiteral(...args) {\n console.trace(\"The node type RegexLiteral has been renamed to RegExpLiteral\");\n return (0, _builder.default)(\"RegexLiteral\", ...args);\n}\n\nfunction RestProperty(...args) {\n console.trace(\"The node type RestProperty has been renamed to RestElement\");\n return (0, _builder.default)(\"RestProperty\", ...args);\n}\n\nfunction SpreadProperty(...args) {\n console.trace(\"The node type SpreadProperty has been renamed to SpreadElement\");\n return (0, _builder.default)(\"SpreadProperty\", ...args);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = buildChildren;\n\nvar _generated = require(\"../../validators/generated\");\n\nvar _cleanJSXElementLiteralChild = _interopRequireDefault(require(\"../../utils/react/cleanJSXElementLiteralChild\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction buildChildren(node) {\n const elements = [];\n\n for (let i = 0; i < node.children.length; i++) {\n let child = node.children[i];\n\n if ((0, _generated.isJSXText)(child)) {\n (0, _cleanJSXElementLiteralChild.default)(child, elements);\n continue;\n }\n\n if ((0, _generated.isJSXExpressionContainer)(child)) child = child.expression;\n if ((0, _generated.isJSXEmptyExpression)(child)) continue;\n elements.push(child);\n }\n\n return elements;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createTSUnionType;\n\nvar _generated = require(\"../generated\");\n\nvar _removeTypeDuplicates = _interopRequireDefault(require(\"../../modifications/typescript/removeTypeDuplicates\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createTSUnionType(typeAnnotations) {\n const types = typeAnnotations.map(type => type.typeAnnotations);\n const flattened = (0, _removeTypeDuplicates.default)(types);\n\n if (flattened.length === 1) {\n return flattened[0];\n } else {\n return (0, _generated.tsUnionType)(flattened);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = clone;\n\nvar _cloneNode = _interopRequireDefault(require(\"./cloneNode\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction clone(node) {\n return (0, _cloneNode.default)(node, false);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = cloneDeep;\n\nvar _cloneNode = _interopRequireDefault(require(\"./cloneNode\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction cloneDeep(node) {\n return (0, _cloneNode.default)(node);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = cloneDeepWithoutLoc;\n\nvar _cloneNode = _interopRequireDefault(require(\"./cloneNode\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction cloneDeepWithoutLoc(node) {\n return (0, _cloneNode.default)(node, true, true);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = cloneNode;\n\nvar _definitions = require(\"../definitions\");\n\nconst has = Function.call.bind(Object.prototype.hasOwnProperty);\n\nfunction cloneIfNode(obj, deep, withoutLoc) {\n if (obj && typeof obj.type === \"string\") {\n return cloneNode(obj, deep, withoutLoc);\n }\n\n return obj;\n}\n\nfunction cloneIfNodeOrArray(obj, deep, withoutLoc) {\n if (Array.isArray(obj)) {\n return obj.map(node => cloneIfNode(node, deep, withoutLoc));\n }\n\n return cloneIfNode(obj, deep, withoutLoc);\n}\n\nfunction cloneNode(node, deep = true, withoutLoc = false) {\n if (!node) return node;\n const {\n type\n } = node;\n const newNode = {\n type\n };\n\n if (type === \"Identifier\") {\n newNode.name = node.name;\n\n if (has(node, \"optional\") && typeof node.optional === \"boolean\") {\n newNode.optional = node.optional;\n }\n\n if (has(node, \"typeAnnotation\")) {\n newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc) : node.typeAnnotation;\n }\n } else if (!has(_definitions.NODE_FIELDS, type)) {\n throw new Error(`Unknown node type: \"${type}\"`);\n } else {\n for (const field of Object.keys(_definitions.NODE_FIELDS[type])) {\n if (has(node, field)) {\n if (deep) {\n newNode[field] = type === \"File\" && field === \"comments\" ? maybeCloneComments(node.comments, deep, withoutLoc) : cloneIfNodeOrArray(node[field], true, withoutLoc);\n } else {\n newNode[field] = node[field];\n }\n }\n }\n }\n\n if (has(node, \"loc\")) {\n if (withoutLoc) {\n newNode.loc = null;\n } else {\n newNode.loc = node.loc;\n }\n }\n\n if (has(node, \"leadingComments\")) {\n newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc);\n }\n\n if (has(node, \"innerComments\")) {\n newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc);\n }\n\n if (has(node, \"trailingComments\")) {\n newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc);\n }\n\n if (has(node, \"extra\")) {\n newNode.extra = Object.assign({}, node.extra);\n }\n\n return newNode;\n}\n\nfunction cloneCommentsWithoutLoc(comments) {\n return comments.map(({\n type,\n value\n }) => ({\n type,\n value,\n loc: null\n }));\n}\n\nfunction maybeCloneComments(comments, deep, withoutLoc) {\n return deep && withoutLoc ? cloneCommentsWithoutLoc(comments) : comments;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = cloneWithoutLoc;\n\nvar _cloneNode = _interopRequireDefault(require(\"./cloneNode\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction cloneWithoutLoc(node) {\n return (0, _cloneNode.default)(node, false, true);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = addComment;\n\nvar _addComments = _interopRequireDefault(require(\"./addComments\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction addComment(node, type, content, line) {\n return (0, _addComments.default)(node, type, [{\n type: line ? \"CommentLine\" : \"CommentBlock\",\n value: content\n }]);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = addComments;\n\nfunction addComments(node, type, comments) {\n if (!comments || !node) return node;\n const key = `${type}Comments`;\n\n if (node[key]) {\n if (type === \"leading\") {\n node[key] = comments.concat(node[key]);\n } else {\n node[key] = node[key].concat(comments);\n }\n } else {\n node[key] = comments;\n }\n\n return node;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = inheritInnerComments;\n\nvar _inherit = _interopRequireDefault(require(\"../utils/inherit\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction inheritInnerComments(child, parent) {\n (0, _inherit.default)(\"innerComments\", child, parent);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = inheritLeadingComments;\n\nvar _inherit = _interopRequireDefault(require(\"../utils/inherit\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction inheritLeadingComments(child, parent) {\n (0, _inherit.default)(\"leadingComments\", child, parent);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = inheritTrailingComments;\n\nvar _inherit = _interopRequireDefault(require(\"../utils/inherit\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction inheritTrailingComments(child, parent) {\n (0, _inherit.default)(\"trailingComments\", child, parent);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = inheritsComments;\n\nvar _inheritTrailingComments = _interopRequireDefault(require(\"./inheritTrailingComments\"));\n\nvar _inheritLeadingComments = _interopRequireDefault(require(\"./inheritLeadingComments\"));\n\nvar _inheritInnerComments = _interopRequireDefault(require(\"./inheritInnerComments\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction inheritsComments(child, parent) {\n (0, _inheritTrailingComments.default)(child, parent);\n (0, _inheritLeadingComments.default)(child, parent);\n (0, _inheritInnerComments.default)(child, parent);\n return child;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = removeComments;\n\nvar _constants = require(\"../constants\");\n\nfunction removeComments(node) {\n _constants.COMMENT_KEYS.forEach(key => {\n node[key] = null;\n });\n\n return node;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.TSBASETYPE_TYPES = exports.TSTYPE_TYPES = exports.TSTYPEELEMENT_TYPES = exports.PRIVATE_TYPES = exports.JSX_TYPES = exports.ENUMMEMBER_TYPES = exports.ENUMBODY_TYPES = exports.FLOWPREDICATE_TYPES = exports.FLOWDECLARATION_TYPES = exports.FLOWBASEANNOTATION_TYPES = exports.FLOWTYPE_TYPES = exports.FLOW_TYPES = exports.MODULESPECIFIER_TYPES = exports.EXPORTDECLARATION_TYPES = exports.MODULEDECLARATION_TYPES = exports.CLASS_TYPES = exports.PATTERN_TYPES = exports.UNARYLIKE_TYPES = exports.PROPERTY_TYPES = exports.OBJECTMEMBER_TYPES = exports.METHOD_TYPES = exports.USERWHITESPACABLE_TYPES = exports.IMMUTABLE_TYPES = exports.LITERAL_TYPES = exports.TSENTITYNAME_TYPES = exports.LVAL_TYPES = exports.PATTERNLIKE_TYPES = exports.DECLARATION_TYPES = exports.PUREISH_TYPES = exports.FUNCTIONPARENT_TYPES = exports.FUNCTION_TYPES = exports.FORXSTATEMENT_TYPES = exports.FOR_TYPES = exports.EXPRESSIONWRAPPER_TYPES = exports.WHILE_TYPES = exports.LOOP_TYPES = exports.CONDITIONAL_TYPES = exports.COMPLETIONSTATEMENT_TYPES = exports.TERMINATORLESS_TYPES = exports.STATEMENT_TYPES = exports.BLOCK_TYPES = exports.BLOCKPARENT_TYPES = exports.SCOPABLE_TYPES = exports.BINARY_TYPES = exports.EXPRESSION_TYPES = void 0;\n\nvar _definitions = require(\"../../definitions\");\n\nconst EXPRESSION_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Expression\"];\nexports.EXPRESSION_TYPES = EXPRESSION_TYPES;\nconst BINARY_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Binary\"];\nexports.BINARY_TYPES = BINARY_TYPES;\nconst SCOPABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Scopable\"];\nexports.SCOPABLE_TYPES = SCOPABLE_TYPES;\nconst BLOCKPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"BlockParent\"];\nexports.BLOCKPARENT_TYPES = BLOCKPARENT_TYPES;\nconst BLOCK_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Block\"];\nexports.BLOCK_TYPES = BLOCK_TYPES;\nconst STATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Statement\"];\nexports.STATEMENT_TYPES = STATEMENT_TYPES;\nconst TERMINATORLESS_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Terminatorless\"];\nexports.TERMINATORLESS_TYPES = TERMINATORLESS_TYPES;\nconst COMPLETIONSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"CompletionStatement\"];\nexports.COMPLETIONSTATEMENT_TYPES = COMPLETIONSTATEMENT_TYPES;\nconst CONDITIONAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Conditional\"];\nexports.CONDITIONAL_TYPES = CONDITIONAL_TYPES;\nconst LOOP_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Loop\"];\nexports.LOOP_TYPES = LOOP_TYPES;\nconst WHILE_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"While\"];\nexports.WHILE_TYPES = WHILE_TYPES;\nconst EXPRESSIONWRAPPER_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"ExpressionWrapper\"];\nexports.EXPRESSIONWRAPPER_TYPES = EXPRESSIONWRAPPER_TYPES;\nconst FOR_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"For\"];\nexports.FOR_TYPES = FOR_TYPES;\nconst FORXSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"ForXStatement\"];\nexports.FORXSTATEMENT_TYPES = FORXSTATEMENT_TYPES;\nconst FUNCTION_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Function\"];\nexports.FUNCTION_TYPES = FUNCTION_TYPES;\nconst FUNCTIONPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"FunctionParent\"];\nexports.FUNCTIONPARENT_TYPES = FUNCTIONPARENT_TYPES;\nconst PUREISH_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Pureish\"];\nexports.PUREISH_TYPES = PUREISH_TYPES;\nconst DECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Declaration\"];\nexports.DECLARATION_TYPES = DECLARATION_TYPES;\nconst PATTERNLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"PatternLike\"];\nexports.PATTERNLIKE_TYPES = PATTERNLIKE_TYPES;\nconst LVAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"LVal\"];\nexports.LVAL_TYPES = LVAL_TYPES;\nconst TSENTITYNAME_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"TSEntityName\"];\nexports.TSENTITYNAME_TYPES = TSENTITYNAME_TYPES;\nconst LITERAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Literal\"];\nexports.LITERAL_TYPES = LITERAL_TYPES;\nconst IMMUTABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Immutable\"];\nexports.IMMUTABLE_TYPES = IMMUTABLE_TYPES;\nconst USERWHITESPACABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"UserWhitespacable\"];\nexports.USERWHITESPACABLE_TYPES = USERWHITESPACABLE_TYPES;\nconst METHOD_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Method\"];\nexports.METHOD_TYPES = METHOD_TYPES;\nconst OBJECTMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"ObjectMember\"];\nexports.OBJECTMEMBER_TYPES = OBJECTMEMBER_TYPES;\nconst PROPERTY_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Property\"];\nexports.PROPERTY_TYPES = PROPERTY_TYPES;\nconst UNARYLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"UnaryLike\"];\nexports.UNARYLIKE_TYPES = UNARYLIKE_TYPES;\nconst PATTERN_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Pattern\"];\nexports.PATTERN_TYPES = PATTERN_TYPES;\nconst CLASS_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Class\"];\nexports.CLASS_TYPES = CLASS_TYPES;\nconst MODULEDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"ModuleDeclaration\"];\nexports.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES;\nconst EXPORTDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"ExportDeclaration\"];\nexports.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES;\nconst MODULESPECIFIER_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"ModuleSpecifier\"];\nexports.MODULESPECIFIER_TYPES = MODULESPECIFIER_TYPES;\nconst FLOW_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Flow\"];\nexports.FLOW_TYPES = FLOW_TYPES;\nconst FLOWTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"FlowType\"];\nexports.FLOWTYPE_TYPES = FLOWTYPE_TYPES;\nconst FLOWBASEANNOTATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"FlowBaseAnnotation\"];\nexports.FLOWBASEANNOTATION_TYPES = FLOWBASEANNOTATION_TYPES;\nconst FLOWDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"FlowDeclaration\"];\nexports.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES;\nconst FLOWPREDICATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"FlowPredicate\"];\nexports.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES;\nconst ENUMBODY_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"EnumBody\"];\nexports.ENUMBODY_TYPES = ENUMBODY_TYPES;\nconst ENUMMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"EnumMember\"];\nexports.ENUMMEMBER_TYPES = ENUMMEMBER_TYPES;\nconst JSX_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"JSX\"];\nexports.JSX_TYPES = JSX_TYPES;\nconst PRIVATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"Private\"];\nexports.PRIVATE_TYPES = PRIVATE_TYPES;\nconst TSTYPEELEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"TSTypeElement\"];\nexports.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES;\nconst TSTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"TSType\"];\nexports.TSTYPE_TYPES = TSTYPE_TYPES;\nconst TSBASETYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS[\"TSBaseType\"];\nexports.TSBASETYPE_TYPES = TSBASETYPE_TYPES;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.ASSIGNMENT_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = void 0;\nconst STATEMENT_OR_BLOCK_KEYS = [\"consequent\", \"body\", \"alternate\"];\nexports.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS;\nconst FLATTENABLE_KEYS = [\"body\", \"expressions\"];\nexports.FLATTENABLE_KEYS = FLATTENABLE_KEYS;\nconst FOR_INIT_KEYS = [\"left\", \"init\"];\nexports.FOR_INIT_KEYS = FOR_INIT_KEYS;\nconst COMMENT_KEYS = [\"leadingComments\", \"trailingComments\", \"innerComments\"];\nexports.COMMENT_KEYS = COMMENT_KEYS;\nconst LOGICAL_OPERATORS = [\"||\", \"&&\", \"??\"];\nexports.LOGICAL_OPERATORS = LOGICAL_OPERATORS;\nconst UPDATE_OPERATORS = [\"++\", \"--\"];\nexports.UPDATE_OPERATORS = UPDATE_OPERATORS;\nconst BOOLEAN_NUMBER_BINARY_OPERATORS = [\">\", \"<\", \">=\", \"<=\"];\nexports.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS;\nconst EQUALITY_BINARY_OPERATORS = [\"==\", \"===\", \"!=\", \"!==\"];\nexports.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS;\nconst COMPARISON_BINARY_OPERATORS = [...EQUALITY_BINARY_OPERATORS, \"in\", \"instanceof\"];\nexports.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS;\nconst BOOLEAN_BINARY_OPERATORS = [...COMPARISON_BINARY_OPERATORS, ...BOOLEAN_NUMBER_BINARY_OPERATORS];\nexports.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS;\nconst NUMBER_BINARY_OPERATORS = [\"-\", \"/\", \"%\", \"*\", \"**\", \"&\", \"|\", \">>\", \">>>\", \"<<\", \"^\"];\nexports.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS;\nconst BINARY_OPERATORS = [\"+\", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS];\nexports.BINARY_OPERATORS = BINARY_OPERATORS;\nconst ASSIGNMENT_OPERATORS = [\"=\", \"+=\", ...NUMBER_BINARY_OPERATORS.map(op => op + \"=\"), ...LOGICAL_OPERATORS.map(op => op + \"=\")];\nexports.ASSIGNMENT_OPERATORS = ASSIGNMENT_OPERATORS;\nconst BOOLEAN_UNARY_OPERATORS = [\"delete\", \"!\"];\nexports.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS;\nconst NUMBER_UNARY_OPERATORS = [\"+\", \"-\", \"~\"];\nexports.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS;\nconst STRING_UNARY_OPERATORS = [\"typeof\"];\nexports.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS;\nconst UNARY_OPERATORS = [\"void\", \"throw\", ...BOOLEAN_UNARY_OPERATORS, ...NUMBER_UNARY_OPERATORS, ...STRING_UNARY_OPERATORS];\nexports.UNARY_OPERATORS = UNARY_OPERATORS;\nconst INHERIT_KEYS = {\n optional: [\"typeAnnotation\", \"typeParameters\", \"returnType\"],\n force: [\"start\", \"loc\", \"end\"]\n};\nexports.INHERIT_KEYS = INHERIT_KEYS;\nconst BLOCK_SCOPED_SYMBOL = Symbol.for(\"var used to be block scoped\");\nexports.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL;\nconst NOT_LOCAL_BINDING = Symbol.for(\"should not be considered a local binding\");\nexports.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = ensureBlock;\n\nvar _toBlock = _interopRequireDefault(require(\"./toBlock\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ensureBlock(node, key = \"body\") {\n return node[key] = (0, _toBlock.default)(node[key], node);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = gatherSequenceExpressions;\n\nvar _getBindingIdentifiers = _interopRequireDefault(require(\"../retrievers/getBindingIdentifiers\"));\n\nvar _generated = require(\"../validators/generated\");\n\nvar _generated2 = require(\"../builders/generated\");\n\nvar _cloneNode = _interopRequireDefault(require(\"../clone/cloneNode\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction gatherSequenceExpressions(nodes, scope, declars) {\n const exprs = [];\n let ensureLastUndefined = true;\n\n for (const node of nodes) {\n if (!(0, _generated.isEmptyStatement)(node)) {\n ensureLastUndefined = false;\n }\n\n if ((0, _generated.isExpression)(node)) {\n exprs.push(node);\n } else if ((0, _generated.isExpressionStatement)(node)) {\n exprs.push(node.expression);\n } else if ((0, _generated.isVariableDeclaration)(node)) {\n if (node.kind !== \"var\") return;\n\n for (const declar of node.declarations) {\n const bindings = (0, _getBindingIdentifiers.default)(declar);\n\n for (const key of Object.keys(bindings)) {\n declars.push({\n kind: node.kind,\n id: (0, _cloneNode.default)(bindings[key])\n });\n }\n\n if (declar.init) {\n exprs.push((0, _generated2.assignmentExpression)(\"=\", declar.id, declar.init));\n }\n }\n\n ensureLastUndefined = true;\n } else if ((0, _generated.isIfStatement)(node)) {\n const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode();\n const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode();\n if (!consequent || !alternate) return;\n exprs.push((0, _generated2.conditionalExpression)(node.test, consequent, alternate));\n } else if ((0, _generated.isBlockStatement)(node)) {\n const body = gatherSequenceExpressions(node.body, scope, declars);\n if (!body) return;\n exprs.push(body);\n } else if ((0, _generated.isEmptyStatement)(node)) {\n if (nodes.indexOf(node) === 0) {\n ensureLastUndefined = true;\n }\n } else {\n return;\n }\n }\n\n if (ensureLastUndefined) {\n exprs.push(scope.buildUndefinedNode());\n }\n\n if (exprs.length === 1) {\n return exprs[0];\n } else {\n return (0, _generated2.sequenceExpression)(exprs);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = toBindingIdentifierName;\n\nvar _toIdentifier = _interopRequireDefault(require(\"./toIdentifier\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction toBindingIdentifierName(name) {\n name = (0, _toIdentifier.default)(name);\n if (name === \"eval\" || name === \"arguments\") name = \"_\" + name;\n return name;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = toBlock;\n\nvar _generated = require(\"../validators/generated\");\n\nvar _generated2 = require(\"../builders/generated\");\n\nfunction toBlock(node, parent) {\n if ((0, _generated.isBlockStatement)(node)) {\n return node;\n }\n\n let blockNodes = [];\n\n if ((0, _generated.isEmptyStatement)(node)) {\n blockNodes = [];\n } else {\n if (!(0, _generated.isStatement)(node)) {\n if ((0, _generated.isFunction)(parent)) {\n node = (0, _generated2.returnStatement)(node);\n } else {\n node = (0, _generated2.expressionStatement)(node);\n }\n }\n\n blockNodes = [node];\n }\n\n return (0, _generated2.blockStatement)(blockNodes);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = toComputedKey;\n\nvar _generated = require(\"../validators/generated\");\n\nvar _generated2 = require(\"../builders/generated\");\n\nfunction toComputedKey(node, key = node.key || node.property) {\n if (!node.computed && (0, _generated.isIdentifier)(key)) key = (0, _generated2.stringLiteral)(key.name);\n return key;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = toExpression;\n\nvar _generated = require(\"../validators/generated\");\n\nfunction toExpression(node) {\n if ((0, _generated.isExpressionStatement)(node)) {\n node = node.expression;\n }\n\n if ((0, _generated.isExpression)(node)) {\n return node;\n }\n\n if ((0, _generated.isClass)(node)) {\n node.type = \"ClassExpression\";\n } else if ((0, _generated.isFunction)(node)) {\n node.type = \"FunctionExpression\";\n }\n\n if (!(0, _generated.isExpression)(node)) {\n throw new Error(`cannot turn ${node.type} to an expression`);\n }\n\n return node;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = toIdentifier;\n\nvar _isValidIdentifier = _interopRequireDefault(require(\"../validators/isValidIdentifier\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction toIdentifier(name) {\n name = name + \"\";\n name = name.replace(/[^a-zA-Z0-9$_]/g, \"-\");\n name = name.replace(/^[-0-9]+/, \"\");\n name = name.replace(/[-\\s]+(.)?/g, function (match, c) {\n return c ? c.toUpperCase() : \"\";\n });\n\n if (!(0, _isValidIdentifier.default)(name)) {\n name = `_${name}`;\n }\n\n return name || \"_\";\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = toKeyAlias;\n\nvar _generated = require(\"../validators/generated\");\n\nvar _cloneNode = _interopRequireDefault(require(\"../clone/cloneNode\"));\n\nvar _removePropertiesDeep = _interopRequireDefault(require(\"../modifications/removePropertiesDeep\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction toKeyAlias(node, key = node.key) {\n let alias;\n\n if (node.kind === \"method\") {\n return toKeyAlias.increment() + \"\";\n } else if ((0, _generated.isIdentifier)(key)) {\n alias = key.name;\n } else if ((0, _generated.isStringLiteral)(key)) {\n alias = JSON.stringify(key.value);\n } else {\n alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode.default)(key)));\n }\n\n if (node.computed) {\n alias = `[${alias}]`;\n }\n\n if (node.static) {\n alias = `static:${alias}`;\n }\n\n return alias;\n}\n\ntoKeyAlias.uid = 0;\n\ntoKeyAlias.increment = function () {\n if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {\n return toKeyAlias.uid = 0;\n } else {\n return toKeyAlias.uid++;\n }\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = toSequenceExpression;\n\nvar _gatherSequenceExpressions = _interopRequireDefault(require(\"./gatherSequenceExpressions\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction toSequenceExpression(nodes, scope) {\n if (!(nodes == null ? void 0 : nodes.length)) return;\n const declars = [];\n const result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars);\n if (!result) return;\n\n for (const declar of declars) {\n scope.push(declar);\n }\n\n return result;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = toStatement;\n\nvar _generated = require(\"../validators/generated\");\n\nvar _generated2 = require(\"../builders/generated\");\n\nfunction toStatement(node, ignore) {\n if ((0, _generated.isStatement)(node)) {\n return node;\n }\n\n let mustHaveId = false;\n let newType;\n\n if ((0, _generated.isClass)(node)) {\n mustHaveId = true;\n newType = \"ClassDeclaration\";\n } else if ((0, _generated.isFunction)(node)) {\n mustHaveId = true;\n newType = \"FunctionDeclaration\";\n } else if ((0, _generated.isAssignmentExpression)(node)) {\n return (0, _generated2.expressionStatement)(node);\n }\n\n if (mustHaveId && !node.id) {\n newType = false;\n }\n\n if (!newType) {\n if (ignore) {\n return false;\n } else {\n throw new Error(`cannot turn ${node.type} to a statement`);\n }\n }\n\n node.type = newType;\n return node;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = valueToNode;\n\nvar _isPlainObject = _interopRequireDefault(require(\"lodash/isPlainObject\"));\n\nvar _isRegExp = _interopRequireDefault(require(\"lodash/isRegExp\"));\n\nvar _isValidIdentifier = _interopRequireDefault(require(\"../validators/isValidIdentifier\"));\n\nvar _generated = require(\"../builders/generated\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction valueToNode(value) {\n if (value === undefined) {\n return (0, _generated.identifier)(\"undefined\");\n }\n\n if (value === true || value === false) {\n return (0, _generated.booleanLiteral)(value);\n }\n\n if (value === null) {\n return (0, _generated.nullLiteral)();\n }\n\n if (typeof value === \"string\") {\n return (0, _generated.stringLiteral)(value);\n }\n\n if (typeof value === \"number\") {\n let result;\n\n if (Number.isFinite(value)) {\n result = (0, _generated.numericLiteral)(Math.abs(value));\n } else {\n let numerator;\n\n if (Number.isNaN(value)) {\n numerator = (0, _generated.numericLiteral)(0);\n } else {\n numerator = (0, _generated.numericLiteral)(1);\n }\n\n result = (0, _generated.binaryExpression)(\"/\", numerator, (0, _generated.numericLiteral)(0));\n }\n\n if (value < 0 || Object.is(value, -0)) {\n result = (0, _generated.unaryExpression)(\"-\", result);\n }\n\n return result;\n }\n\n if ((0, _isRegExp.default)(value)) {\n const pattern = value.source;\n const flags = value.toString().match(/\\/([a-z]+|)$/)[1];\n return (0, _generated.regExpLiteral)(pattern, flags);\n }\n\n if (Array.isArray(value)) {\n return (0, _generated.arrayExpression)(value.map(valueToNode));\n }\n\n if ((0, _isPlainObject.default)(value)) {\n const props = [];\n\n for (const key of Object.keys(value)) {\n let nodeKey;\n\n if ((0, _isValidIdentifier.default)(key)) {\n nodeKey = (0, _generated.identifier)(key);\n } else {\n nodeKey = (0, _generated.stringLiteral)(key);\n }\n\n props.push((0, _generated.objectProperty)(nodeKey, valueToNode(value[key])));\n }\n\n return (0, _generated.objectExpression)(props);\n }\n\n throw new Error(\"don't know how to turn this value into a node\");\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.classMethodOrDeclareMethodCommon = exports.classMethodOrPropertyCommon = exports.patternLikeCommon = exports.functionDeclarationCommon = exports.functionTypeAnnotationCommon = exports.functionCommon = void 0;\n\nvar _is = _interopRequireDefault(require(\"../validators/is\"));\n\nvar _isValidIdentifier = _interopRequireDefault(require(\"../validators/isValidIdentifier\"));\n\nvar _helperValidatorIdentifier = require(\"@babel/helper-validator-identifier\");\n\nvar _constants = require(\"../constants\");\n\nvar _utils = _interopRequireWildcard(require(\"./utils\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n(0, _utils.default)(\"ArrayExpression\", {\n fields: {\n elements: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)(\"null\", \"Expression\", \"SpreadElement\"))),\n default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined\n }\n },\n visitor: [\"elements\"],\n aliases: [\"Expression\"]\n});\n(0, _utils.default)(\"AssignmentExpression\", {\n fields: {\n operator: {\n validate: function () {\n if (!process.env.BABEL_TYPES_8_BREAKING) {\n return (0, _utils.assertValueType)(\"string\");\n }\n\n const identifier = (0, _utils.assertOneOf)(..._constants.ASSIGNMENT_OPERATORS);\n const pattern = (0, _utils.assertOneOf)(\"=\");\n return function (node, key, val) {\n const validator = (0, _is.default)(\"Pattern\", node.left) ? pattern : identifier;\n validator(node, key, val);\n };\n }()\n },\n left: {\n validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)(\"LVal\") : (0, _utils.assertNodeType)(\"Identifier\", \"MemberExpression\", \"ArrayPattern\", \"ObjectPattern\")\n },\n right: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n },\n builder: [\"operator\", \"left\", \"right\"],\n visitor: [\"left\", \"right\"],\n aliases: [\"Expression\"]\n});\n(0, _utils.default)(\"BinaryExpression\", {\n builder: [\"operator\", \"left\", \"right\"],\n fields: {\n operator: {\n validate: (0, _utils.assertOneOf)(..._constants.BINARY_OPERATORS)\n },\n left: {\n validate: function () {\n const expression = (0, _utils.assertNodeType)(\"Expression\");\n const inOp = (0, _utils.assertNodeType)(\"Expression\", \"PrivateName\");\n\n const validator = function (node, key, val) {\n const validator = node.operator === \"in\" ? inOp : expression;\n validator(node, key, val);\n };\n\n validator.oneOfNodeTypes = [\"Expression\", \"PrivateName\"];\n return validator;\n }()\n },\n right: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n },\n visitor: [\"left\", \"right\"],\n aliases: [\"Binary\", \"Expression\"]\n});\n(0, _utils.default)(\"InterpreterDirective\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: (0, _utils.assertValueType)(\"string\")\n }\n }\n});\n(0, _utils.default)(\"Directive\", {\n visitor: [\"value\"],\n fields: {\n value: {\n validate: (0, _utils.assertNodeType)(\"DirectiveLiteral\")\n }\n }\n});\n(0, _utils.default)(\"DirectiveLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: (0, _utils.assertValueType)(\"string\")\n }\n }\n});\n(0, _utils.default)(\"BlockStatement\", {\n builder: [\"body\", \"directives\"],\n visitor: [\"directives\", \"body\"],\n fields: {\n directives: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Directive\"))),\n default: []\n },\n body: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Statement\")))\n }\n },\n aliases: [\"Scopable\", \"BlockParent\", \"Block\", \"Statement\"]\n});\n(0, _utils.default)(\"BreakStatement\", {\n visitor: [\"label\"],\n fields: {\n label: {\n validate: (0, _utils.assertNodeType)(\"Identifier\"),\n optional: true\n }\n },\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"]\n});\n(0, _utils.default)(\"CallExpression\", {\n visitor: [\"callee\", \"arguments\", \"typeParameters\", \"typeArguments\"],\n builder: [\"callee\", \"arguments\"],\n aliases: [\"Expression\"],\n fields: Object.assign({\n callee: {\n validate: (0, _utils.assertNodeType)(\"Expression\", \"V8IntrinsicIdentifier\")\n },\n arguments: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Expression\", \"SpreadElement\", \"JSXNamespacedName\", \"ArgumentPlaceholder\")))\n }\n }, !process.env.BABEL_TYPES_8_BREAKING ? {\n optional: {\n validate: (0, _utils.assertOneOf)(true, false),\n optional: true\n }\n } : {}, {\n typeArguments: {\n validate: (0, _utils.assertNodeType)(\"TypeParameterInstantiation\"),\n optional: true\n },\n typeParameters: {\n validate: (0, _utils.assertNodeType)(\"TSTypeParameterInstantiation\"),\n optional: true\n }\n })\n});\n(0, _utils.default)(\"CatchClause\", {\n visitor: [\"param\", \"body\"],\n fields: {\n param: {\n validate: (0, _utils.assertNodeType)(\"Identifier\", \"ArrayPattern\", \"ObjectPattern\"),\n optional: true\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"BlockStatement\")\n }\n },\n aliases: [\"Scopable\", \"BlockParent\"]\n});\n(0, _utils.default)(\"ConditionalExpression\", {\n visitor: [\"test\", \"consequent\", \"alternate\"],\n fields: {\n test: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n consequent: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n alternate: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n },\n aliases: [\"Expression\", \"Conditional\"]\n});\n(0, _utils.default)(\"ContinueStatement\", {\n visitor: [\"label\"],\n fields: {\n label: {\n validate: (0, _utils.assertNodeType)(\"Identifier\"),\n optional: true\n }\n },\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"]\n});\n(0, _utils.default)(\"DebuggerStatement\", {\n aliases: [\"Statement\"]\n});\n(0, _utils.default)(\"DoWhileStatement\", {\n visitor: [\"test\", \"body\"],\n fields: {\n test: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"Statement\")\n }\n },\n aliases: [\"Statement\", \"BlockParent\", \"Loop\", \"While\", \"Scopable\"]\n});\n(0, _utils.default)(\"EmptyStatement\", {\n aliases: [\"Statement\"]\n});\n(0, _utils.default)(\"ExpressionStatement\", {\n visitor: [\"expression\"],\n fields: {\n expression: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n },\n aliases: [\"Statement\", \"ExpressionWrapper\"]\n});\n(0, _utils.default)(\"File\", {\n builder: [\"program\", \"comments\", \"tokens\"],\n visitor: [\"program\"],\n fields: {\n program: {\n validate: (0, _utils.assertNodeType)(\"Program\")\n },\n comments: {\n validate: !process.env.BABEL_TYPES_8_BREAKING ? Object.assign(() => {}, {\n each: {\n oneOfNodeTypes: [\"CommentBlock\", \"CommentLine\"]\n }\n }) : (0, _utils.assertEach)((0, _utils.assertNodeType)(\"CommentBlock\", \"CommentLine\")),\n optional: true\n },\n tokens: {\n validate: (0, _utils.assertEach)(Object.assign(() => {}, {\n type: \"any\"\n })),\n optional: true\n }\n }\n});\n(0, _utils.default)(\"ForInStatement\", {\n visitor: [\"left\", \"right\", \"body\"],\n aliases: [\"Scopable\", \"Statement\", \"For\", \"BlockParent\", \"Loop\", \"ForXStatement\"],\n fields: {\n left: {\n validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)(\"VariableDeclaration\", \"LVal\") : (0, _utils.assertNodeType)(\"VariableDeclaration\", \"Identifier\", \"MemberExpression\", \"ArrayPattern\", \"ObjectPattern\")\n },\n right: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"Statement\")\n }\n }\n});\n(0, _utils.default)(\"ForStatement\", {\n visitor: [\"init\", \"test\", \"update\", \"body\"],\n aliases: [\"Scopable\", \"Statement\", \"For\", \"BlockParent\", \"Loop\"],\n fields: {\n init: {\n validate: (0, _utils.assertNodeType)(\"VariableDeclaration\", \"Expression\"),\n optional: true\n },\n test: {\n validate: (0, _utils.assertNodeType)(\"Expression\"),\n optional: true\n },\n update: {\n validate: (0, _utils.assertNodeType)(\"Expression\"),\n optional: true\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"Statement\")\n }\n }\n});\nconst functionCommon = {\n params: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Identifier\", \"Pattern\", \"RestElement\", \"TSParameterProperty\")))\n },\n generator: {\n default: false\n },\n async: {\n default: false\n }\n};\nexports.functionCommon = functionCommon;\nconst functionTypeAnnotationCommon = {\n returnType: {\n validate: (0, _utils.assertNodeType)(\"TypeAnnotation\", \"TSTypeAnnotation\", \"Noop\"),\n optional: true\n },\n typeParameters: {\n validate: (0, _utils.assertNodeType)(\"TypeParameterDeclaration\", \"TSTypeParameterDeclaration\", \"Noop\"),\n optional: true\n }\n};\nexports.functionTypeAnnotationCommon = functionTypeAnnotationCommon;\nconst functionDeclarationCommon = Object.assign({}, functionCommon, {\n declare: {\n validate: (0, _utils.assertValueType)(\"boolean\"),\n optional: true\n },\n id: {\n validate: (0, _utils.assertNodeType)(\"Identifier\"),\n optional: true\n }\n});\nexports.functionDeclarationCommon = functionDeclarationCommon;\n(0, _utils.default)(\"FunctionDeclaration\", {\n builder: [\"id\", \"params\", \"body\", \"generator\", \"async\"],\n visitor: [\"id\", \"params\", \"body\", \"returnType\", \"typeParameters\"],\n fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, {\n body: {\n validate: (0, _utils.assertNodeType)(\"BlockStatement\")\n }\n }),\n aliases: [\"Scopable\", \"Function\", \"BlockParent\", \"FunctionParent\", \"Statement\", \"Pureish\", \"Declaration\"],\n validate: function () {\n if (!process.env.BABEL_TYPES_8_BREAKING) return () => {};\n const identifier = (0, _utils.assertNodeType)(\"Identifier\");\n return function (parent, key, node) {\n if (!(0, _is.default)(\"ExportDefaultDeclaration\", parent)) {\n identifier(node, \"id\", node.id);\n }\n };\n }()\n});\n(0, _utils.default)(\"FunctionExpression\", {\n inherits: \"FunctionDeclaration\",\n aliases: [\"Scopable\", \"Function\", \"BlockParent\", \"FunctionParent\", \"Expression\", \"Pureish\"],\n fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {\n id: {\n validate: (0, _utils.assertNodeType)(\"Identifier\"),\n optional: true\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"BlockStatement\")\n }\n })\n});\nconst patternLikeCommon = {\n typeAnnotation: {\n validate: (0, _utils.assertNodeType)(\"TypeAnnotation\", \"TSTypeAnnotation\", \"Noop\"),\n optional: true\n },\n decorators: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Decorator\")))\n }\n};\nexports.patternLikeCommon = patternLikeCommon;\n(0, _utils.default)(\"Identifier\", {\n builder: [\"name\"],\n visitor: [\"typeAnnotation\", \"decorators\"],\n aliases: [\"Expression\", \"PatternLike\", \"LVal\", \"TSEntityName\"],\n fields: Object.assign({}, patternLikeCommon, {\n name: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"string\"), Object.assign(function (node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (!(0, _isValidIdentifier.default)(val, false)) {\n throw new TypeError(`\"${val}\" is not a valid identifier name`);\n }\n }, {\n type: \"string\"\n }))\n },\n optional: {\n validate: (0, _utils.assertValueType)(\"boolean\"),\n optional: true\n }\n }),\n\n validate(parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n const match = /\\.(\\w+)$/.exec(key);\n if (!match) return;\n const [, parentKey] = match;\n const nonComp = {\n computed: false\n };\n\n if (parentKey === \"property\") {\n if ((0, _is.default)(\"MemberExpression\", parent, nonComp)) return;\n if ((0, _is.default)(\"OptionalMemberExpression\", parent, nonComp)) return;\n } else if (parentKey === \"key\") {\n if ((0, _is.default)(\"Property\", parent, nonComp)) return;\n if ((0, _is.default)(\"Method\", parent, nonComp)) return;\n } else if (parentKey === \"exported\") {\n if ((0, _is.default)(\"ExportSpecifier\", parent)) return;\n } else if (parentKey === \"imported\") {\n if ((0, _is.default)(\"ImportSpecifier\", parent, {\n imported: node\n })) return;\n } else if (parentKey === \"meta\") {\n if ((0, _is.default)(\"MetaProperty\", parent, {\n meta: node\n })) return;\n }\n\n if (((0, _helperValidatorIdentifier.isKeyword)(node.name) || (0, _helperValidatorIdentifier.isReservedWord)(node.name)) && node.name !== \"this\") {\n throw new TypeError(`\"${node.name}\" is not a valid identifier`);\n }\n }\n\n});\n(0, _utils.default)(\"IfStatement\", {\n visitor: [\"test\", \"consequent\", \"alternate\"],\n aliases: [\"Statement\", \"Conditional\"],\n fields: {\n test: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n consequent: {\n validate: (0, _utils.assertNodeType)(\"Statement\")\n },\n alternate: {\n optional: true,\n validate: (0, _utils.assertNodeType)(\"Statement\")\n }\n }\n});\n(0, _utils.default)(\"LabeledStatement\", {\n visitor: [\"label\", \"body\"],\n aliases: [\"Statement\"],\n fields: {\n label: {\n validate: (0, _utils.assertNodeType)(\"Identifier\")\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"Statement\")\n }\n }\n});\n(0, _utils.default)(\"StringLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: (0, _utils.assertValueType)(\"string\")\n }\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"]\n});\n(0, _utils.default)(\"NumericLiteral\", {\n builder: [\"value\"],\n deprecatedAlias: \"NumberLiteral\",\n fields: {\n value: {\n validate: (0, _utils.assertValueType)(\"number\")\n }\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"]\n});\n(0, _utils.default)(\"NullLiteral\", {\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"]\n});\n(0, _utils.default)(\"BooleanLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: (0, _utils.assertValueType)(\"boolean\")\n }\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"]\n});\n(0, _utils.default)(\"RegExpLiteral\", {\n builder: [\"pattern\", \"flags\"],\n deprecatedAlias: \"RegexLiteral\",\n aliases: [\"Expression\", \"Pureish\", \"Literal\"],\n fields: {\n pattern: {\n validate: (0, _utils.assertValueType)(\"string\")\n },\n flags: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"string\"), Object.assign(function (node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n const invalid = /[^gimsuy]/.exec(val);\n\n if (invalid) {\n throw new TypeError(`\"${invalid[0]}\" is not a valid RegExp flag`);\n }\n }, {\n type: \"string\"\n })),\n default: \"\"\n }\n }\n});\n(0, _utils.default)(\"LogicalExpression\", {\n builder: [\"operator\", \"left\", \"right\"],\n visitor: [\"left\", \"right\"],\n aliases: [\"Binary\", \"Expression\"],\n fields: {\n operator: {\n validate: (0, _utils.assertOneOf)(..._constants.LOGICAL_OPERATORS)\n },\n left: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n right: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"MemberExpression\", {\n builder: [\"object\", \"property\", \"computed\", \"optional\"],\n visitor: [\"object\", \"property\"],\n aliases: [\"Expression\", \"LVal\"],\n fields: Object.assign({\n object: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n property: {\n validate: function () {\n const normal = (0, _utils.assertNodeType)(\"Identifier\", \"PrivateName\");\n const computed = (0, _utils.assertNodeType)(\"Expression\");\n\n const validator = function (node, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n\n validator.oneOfNodeTypes = [\"Expression\", \"Identifier\", \"PrivateName\"];\n return validator;\n }()\n },\n computed: {\n default: false\n }\n }, !process.env.BABEL_TYPES_8_BREAKING ? {\n optional: {\n validate: (0, _utils.assertOneOf)(true, false),\n optional: true\n }\n } : {})\n});\n(0, _utils.default)(\"NewExpression\", {\n inherits: \"CallExpression\"\n});\n(0, _utils.default)(\"Program\", {\n visitor: [\"directives\", \"body\"],\n builder: [\"body\", \"directives\", \"sourceType\", \"interpreter\"],\n fields: {\n sourceFile: {\n validate: (0, _utils.assertValueType)(\"string\")\n },\n sourceType: {\n validate: (0, _utils.assertOneOf)(\"script\", \"module\"),\n default: \"script\"\n },\n interpreter: {\n validate: (0, _utils.assertNodeType)(\"InterpreterDirective\"),\n default: null,\n optional: true\n },\n directives: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Directive\"))),\n default: []\n },\n body: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Statement\")))\n }\n },\n aliases: [\"Scopable\", \"BlockParent\", \"Block\"]\n});\n(0, _utils.default)(\"ObjectExpression\", {\n visitor: [\"properties\"],\n aliases: [\"Expression\"],\n fields: {\n properties: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"ObjectMethod\", \"ObjectProperty\", \"SpreadElement\")))\n }\n }\n});\n(0, _utils.default)(\"ObjectMethod\", {\n builder: [\"kind\", \"key\", \"params\", \"body\", \"computed\", \"generator\", \"async\"],\n fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {\n kind: Object.assign({\n validate: (0, _utils.assertOneOf)(\"method\", \"get\", \"set\")\n }, !process.env.BABEL_TYPES_8_BREAKING ? {\n default: \"method\"\n } : {}),\n computed: {\n default: false\n },\n key: {\n validate: function () {\n const normal = (0, _utils.assertNodeType)(\"Identifier\", \"StringLiteral\", \"NumericLiteral\");\n const computed = (0, _utils.assertNodeType)(\"Expression\");\n\n const validator = function (node, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n\n validator.oneOfNodeTypes = [\"Expression\", \"Identifier\", \"StringLiteral\", \"NumericLiteral\"];\n return validator;\n }()\n },\n decorators: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Decorator\"))),\n optional: true\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"BlockStatement\")\n }\n }),\n visitor: [\"key\", \"params\", \"body\", \"decorators\", \"returnType\", \"typeParameters\"],\n aliases: [\"UserWhitespacable\", \"Function\", \"Scopable\", \"BlockParent\", \"FunctionParent\", \"Method\", \"ObjectMember\"]\n});\n(0, _utils.default)(\"ObjectProperty\", {\n builder: [\"key\", \"value\", \"computed\", \"shorthand\", ...(!process.env.BABEL_TYPES_8_BREAKING ? [\"decorators\"] : [])],\n fields: {\n computed: {\n default: false\n },\n key: {\n validate: function () {\n const normal = (0, _utils.assertNodeType)(\"Identifier\", \"StringLiteral\", \"NumericLiteral\");\n const computed = (0, _utils.assertNodeType)(\"Expression\");\n\n const validator = function (node, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n\n validator.oneOfNodeTypes = [\"Expression\", \"Identifier\", \"StringLiteral\", \"NumericLiteral\"];\n return validator;\n }()\n },\n value: {\n validate: (0, _utils.assertNodeType)(\"Expression\", \"PatternLike\")\n },\n shorthand: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"boolean\"), Object.assign(function (node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && node.computed) {\n throw new TypeError(\"Property shorthand of ObjectProperty cannot be true if computed is true\");\n }\n }, {\n type: \"boolean\"\n }), function (node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && !(0, _is.default)(\"Identifier\", node.key)) {\n throw new TypeError(\"Property shorthand of ObjectProperty cannot be true if key is not an Identifier\");\n }\n }),\n default: false\n },\n decorators: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Decorator\"))),\n optional: true\n }\n },\n visitor: [\"key\", \"value\", \"decorators\"],\n aliases: [\"UserWhitespacable\", \"Property\", \"ObjectMember\"],\n validate: function () {\n const pattern = (0, _utils.assertNodeType)(\"Identifier\", \"Pattern\");\n const expression = (0, _utils.assertNodeType)(\"Expression\");\n return function (parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n const validator = (0, _is.default)(\"ObjectPattern\", parent) ? pattern : expression;\n validator(node, \"value\", node.value);\n };\n }()\n});\n(0, _utils.default)(\"RestElement\", {\n visitor: [\"argument\", \"typeAnnotation\"],\n builder: [\"argument\"],\n aliases: [\"LVal\", \"PatternLike\"],\n deprecatedAlias: \"RestProperty\",\n fields: Object.assign({}, patternLikeCommon, {\n argument: {\n validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)(\"LVal\") : (0, _utils.assertNodeType)(\"Identifier\", \"Pattern\", \"MemberExpression\")\n }\n }),\n\n validate(parent, key) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n const match = /(\\w+)\\[(\\d+)\\]/.exec(key);\n if (!match) throw new Error(\"Internal Babel error: malformed key.\");\n const [, listKey, index] = match;\n\n if (parent[listKey].length > index + 1) {\n throw new TypeError(`RestElement must be last element of ${listKey}`);\n }\n }\n\n});\n(0, _utils.default)(\"ReturnStatement\", {\n visitor: [\"argument\"],\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n fields: {\n argument: {\n validate: (0, _utils.assertNodeType)(\"Expression\"),\n optional: true\n }\n }\n});\n(0, _utils.default)(\"SequenceExpression\", {\n visitor: [\"expressions\"],\n fields: {\n expressions: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Expression\")))\n }\n },\n aliases: [\"Expression\"]\n});\n(0, _utils.default)(\"ParenthesizedExpression\", {\n visitor: [\"expression\"],\n aliases: [\"Expression\", \"ExpressionWrapper\"],\n fields: {\n expression: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"SwitchCase\", {\n visitor: [\"test\", \"consequent\"],\n fields: {\n test: {\n validate: (0, _utils.assertNodeType)(\"Expression\"),\n optional: true\n },\n consequent: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Statement\")))\n }\n }\n});\n(0, _utils.default)(\"SwitchStatement\", {\n visitor: [\"discriminant\", \"cases\"],\n aliases: [\"Statement\", \"BlockParent\", \"Scopable\"],\n fields: {\n discriminant: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n cases: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"SwitchCase\")))\n }\n }\n});\n(0, _utils.default)(\"ThisExpression\", {\n aliases: [\"Expression\"]\n});\n(0, _utils.default)(\"ThrowStatement\", {\n visitor: [\"argument\"],\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n fields: {\n argument: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"TryStatement\", {\n visitor: [\"block\", \"handler\", \"finalizer\"],\n aliases: [\"Statement\"],\n fields: {\n block: {\n validate: (0, _utils.chain)((0, _utils.assertNodeType)(\"BlockStatement\"), Object.assign(function (node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (!node.handler && !node.finalizer) {\n throw new TypeError(\"TryStatement expects either a handler or finalizer, or both\");\n }\n }, {\n oneOfNodeTypes: [\"BlockStatement\"]\n }))\n },\n handler: {\n optional: true,\n validate: (0, _utils.assertNodeType)(\"CatchClause\")\n },\n finalizer: {\n optional: true,\n validate: (0, _utils.assertNodeType)(\"BlockStatement\")\n }\n }\n});\n(0, _utils.default)(\"UnaryExpression\", {\n builder: [\"operator\", \"argument\", \"prefix\"],\n fields: {\n prefix: {\n default: true\n },\n argument: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n operator: {\n validate: (0, _utils.assertOneOf)(..._constants.UNARY_OPERATORS)\n }\n },\n visitor: [\"argument\"],\n aliases: [\"UnaryLike\", \"Expression\"]\n});\n(0, _utils.default)(\"UpdateExpression\", {\n builder: [\"operator\", \"argument\", \"prefix\"],\n fields: {\n prefix: {\n default: false\n },\n argument: {\n validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)(\"Expression\") : (0, _utils.assertNodeType)(\"Identifier\", \"MemberExpression\")\n },\n operator: {\n validate: (0, _utils.assertOneOf)(..._constants.UPDATE_OPERATORS)\n }\n },\n visitor: [\"argument\"],\n aliases: [\"Expression\"]\n});\n(0, _utils.default)(\"VariableDeclaration\", {\n builder: [\"kind\", \"declarations\"],\n visitor: [\"declarations\"],\n aliases: [\"Statement\", \"Declaration\"],\n fields: {\n declare: {\n validate: (0, _utils.assertValueType)(\"boolean\"),\n optional: true\n },\n kind: {\n validate: (0, _utils.assertOneOf)(\"var\", \"let\", \"const\")\n },\n declarations: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"VariableDeclarator\")))\n }\n },\n\n validate(parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n if (!(0, _is.default)(\"ForXStatement\", parent, {\n left: node\n })) return;\n\n if (node.declarations.length !== 1) {\n throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`);\n }\n }\n\n});\n(0, _utils.default)(\"VariableDeclarator\", {\n visitor: [\"id\", \"init\"],\n fields: {\n id: {\n validate: function () {\n if (!process.env.BABEL_TYPES_8_BREAKING) {\n return (0, _utils.assertNodeType)(\"LVal\");\n }\n\n const normal = (0, _utils.assertNodeType)(\"Identifier\", \"ArrayPattern\", \"ObjectPattern\");\n const without = (0, _utils.assertNodeType)(\"Identifier\");\n return function (node, key, val) {\n const validator = node.init ? normal : without;\n validator(node, key, val);\n };\n }()\n },\n definite: {\n optional: true,\n validate: (0, _utils.assertValueType)(\"boolean\")\n },\n init: {\n optional: true,\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"WhileStatement\", {\n visitor: [\"test\", \"body\"],\n aliases: [\"Statement\", \"BlockParent\", \"Loop\", \"While\", \"Scopable\"],\n fields: {\n test: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"Statement\")\n }\n }\n});\n(0, _utils.default)(\"WithStatement\", {\n visitor: [\"object\", \"body\"],\n aliases: [\"Statement\"],\n fields: {\n object: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"Statement\")\n }\n }\n});\n(0, _utils.default)(\"AssignmentPattern\", {\n visitor: [\"left\", \"right\", \"decorators\"],\n builder: [\"left\", \"right\"],\n aliases: [\"Pattern\", \"PatternLike\", \"LVal\"],\n fields: Object.assign({}, patternLikeCommon, {\n left: {\n validate: (0, _utils.assertNodeType)(\"Identifier\", \"ObjectPattern\", \"ArrayPattern\", \"MemberExpression\")\n },\n right: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n decorators: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Decorator\"))),\n optional: true\n }\n })\n});\n(0, _utils.default)(\"ArrayPattern\", {\n visitor: [\"elements\", \"typeAnnotation\"],\n builder: [\"elements\"],\n aliases: [\"Pattern\", \"PatternLike\", \"LVal\"],\n fields: Object.assign({}, patternLikeCommon, {\n elements: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)(\"null\", \"PatternLike\")))\n },\n decorators: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Decorator\"))),\n optional: true\n }\n })\n});\n(0, _utils.default)(\"ArrowFunctionExpression\", {\n builder: [\"params\", \"body\", \"async\"],\n visitor: [\"params\", \"body\", \"returnType\", \"typeParameters\"],\n aliases: [\"Scopable\", \"Function\", \"BlockParent\", \"FunctionParent\", \"Expression\", \"Pureish\"],\n fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {\n expression: {\n validate: (0, _utils.assertValueType)(\"boolean\")\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"BlockStatement\", \"Expression\")\n }\n })\n});\n(0, _utils.default)(\"ClassBody\", {\n visitor: [\"body\"],\n fields: {\n body: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"ClassMethod\", \"ClassPrivateMethod\", \"ClassProperty\", \"ClassPrivateProperty\", \"TSDeclareMethod\", \"TSIndexSignature\")))\n }\n }\n});\n(0, _utils.default)(\"ClassExpression\", {\n builder: [\"id\", \"superClass\", \"body\", \"decorators\"],\n visitor: [\"id\", \"body\", \"superClass\", \"mixins\", \"typeParameters\", \"superTypeParameters\", \"implements\", \"decorators\"],\n aliases: [\"Scopable\", \"Class\", \"Expression\"],\n fields: {\n id: {\n validate: (0, _utils.assertNodeType)(\"Identifier\"),\n optional: true\n },\n typeParameters: {\n validate: (0, _utils.assertNodeType)(\"TypeParameterDeclaration\", \"TSTypeParameterDeclaration\", \"Noop\"),\n optional: true\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"ClassBody\")\n },\n superClass: {\n optional: true,\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n superTypeParameters: {\n validate: (0, _utils.assertNodeType)(\"TypeParameterInstantiation\", \"TSTypeParameterInstantiation\"),\n optional: true\n },\n implements: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"TSExpressionWithTypeArguments\", \"ClassImplements\"))),\n optional: true\n },\n decorators: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Decorator\"))),\n optional: true\n },\n mixins: {\n validate: (0, _utils.assertNodeType)(\"InterfaceExtends\"),\n optional: true\n }\n }\n});\n(0, _utils.default)(\"ClassDeclaration\", {\n inherits: \"ClassExpression\",\n aliases: [\"Scopable\", \"Class\", \"Statement\", \"Declaration\"],\n fields: {\n id: {\n validate: (0, _utils.assertNodeType)(\"Identifier\")\n },\n typeParameters: {\n validate: (0, _utils.assertNodeType)(\"TypeParameterDeclaration\", \"TSTypeParameterDeclaration\", \"Noop\"),\n optional: true\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"ClassBody\")\n },\n superClass: {\n optional: true,\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n superTypeParameters: {\n validate: (0, _utils.assertNodeType)(\"TypeParameterInstantiation\", \"TSTypeParameterInstantiation\"),\n optional: true\n },\n implements: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"TSExpressionWithTypeArguments\", \"ClassImplements\"))),\n optional: true\n },\n decorators: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Decorator\"))),\n optional: true\n },\n mixins: {\n validate: (0, _utils.assertNodeType)(\"InterfaceExtends\"),\n optional: true\n },\n declare: {\n validate: (0, _utils.assertValueType)(\"boolean\"),\n optional: true\n },\n abstract: {\n validate: (0, _utils.assertValueType)(\"boolean\"),\n optional: true\n }\n },\n validate: function () {\n const identifier = (0, _utils.assertNodeType)(\"Identifier\");\n return function (parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (!(0, _is.default)(\"ExportDefaultDeclaration\", parent)) {\n identifier(node, \"id\", node.id);\n }\n };\n }()\n});\n(0, _utils.default)(\"ExportAllDeclaration\", {\n visitor: [\"source\"],\n aliases: [\"Statement\", \"Declaration\", \"ModuleDeclaration\", \"ExportDeclaration\"],\n fields: {\n source: {\n validate: (0, _utils.assertNodeType)(\"StringLiteral\")\n },\n assertions: {\n optional: true,\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertNodeType)(\"ImportAttribute\"))\n }\n }\n});\n(0, _utils.default)(\"ExportDefaultDeclaration\", {\n visitor: [\"declaration\"],\n aliases: [\"Statement\", \"Declaration\", \"ModuleDeclaration\", \"ExportDeclaration\"],\n fields: {\n declaration: {\n validate: (0, _utils.assertNodeType)(\"FunctionDeclaration\", \"TSDeclareFunction\", \"ClassDeclaration\", \"Expression\")\n }\n }\n});\n(0, _utils.default)(\"ExportNamedDeclaration\", {\n visitor: [\"declaration\", \"specifiers\", \"source\"],\n aliases: [\"Statement\", \"Declaration\", \"ModuleDeclaration\", \"ExportDeclaration\"],\n fields: {\n declaration: {\n optional: true,\n validate: (0, _utils.chain)((0, _utils.assertNodeType)(\"Declaration\"), Object.assign(function (node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && node.specifiers.length) {\n throw new TypeError(\"Only declaration or specifiers is allowed on ExportNamedDeclaration\");\n }\n }, {\n oneOfNodeTypes: [\"Declaration\"]\n }), function (node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && node.source) {\n throw new TypeError(\"Cannot export a declaration from a source\");\n }\n })\n },\n assertions: {\n optional: true,\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertNodeType)(\"ImportAttribute\"))\n },\n specifiers: {\n default: [],\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)(function () {\n const sourced = (0, _utils.assertNodeType)(\"ExportSpecifier\", \"ExportDefaultSpecifier\", \"ExportNamespaceSpecifier\");\n const sourceless = (0, _utils.assertNodeType)(\"ExportSpecifier\");\n if (!process.env.BABEL_TYPES_8_BREAKING) return sourced;\n return function (node, key, val) {\n const validator = node.source ? sourced : sourceless;\n validator(node, key, val);\n };\n }()))\n },\n source: {\n validate: (0, _utils.assertNodeType)(\"StringLiteral\"),\n optional: true\n },\n exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)(\"type\", \"value\"))\n }\n});\n(0, _utils.default)(\"ExportSpecifier\", {\n visitor: [\"local\", \"exported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: (0, _utils.assertNodeType)(\"Identifier\")\n },\n exported: {\n validate: (0, _utils.assertNodeType)(\"Identifier\", \"StringLiteral\")\n }\n }\n});\n(0, _utils.default)(\"ForOfStatement\", {\n visitor: [\"left\", \"right\", \"body\"],\n builder: [\"left\", \"right\", \"body\", \"await\"],\n aliases: [\"Scopable\", \"Statement\", \"For\", \"BlockParent\", \"Loop\", \"ForXStatement\"],\n fields: {\n left: {\n validate: function () {\n if (!process.env.BABEL_TYPES_8_BREAKING) {\n return (0, _utils.assertNodeType)(\"VariableDeclaration\", \"LVal\");\n }\n\n const declaration = (0, _utils.assertNodeType)(\"VariableDeclaration\");\n const lval = (0, _utils.assertNodeType)(\"Identifier\", \"MemberExpression\", \"ArrayPattern\", \"ObjectPattern\");\n return function (node, key, val) {\n if ((0, _is.default)(\"VariableDeclaration\", val)) {\n declaration(node, key, val);\n } else {\n lval(node, key, val);\n }\n };\n }()\n },\n right: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"Statement\")\n },\n await: {\n default: false\n }\n }\n});\n(0, _utils.default)(\"ImportDeclaration\", {\n visitor: [\"specifiers\", \"source\"],\n aliases: [\"Statement\", \"Declaration\", \"ModuleDeclaration\"],\n fields: {\n assertions: {\n optional: true,\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertNodeType)(\"ImportAttribute\"))\n },\n specifiers: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"ImportSpecifier\", \"ImportDefaultSpecifier\", \"ImportNamespaceSpecifier\")))\n },\n source: {\n validate: (0, _utils.assertNodeType)(\"StringLiteral\")\n },\n importKind: {\n validate: (0, _utils.assertOneOf)(\"type\", \"typeof\", \"value\"),\n optional: true\n }\n }\n});\n(0, _utils.default)(\"ImportDefaultSpecifier\", {\n visitor: [\"local\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: (0, _utils.assertNodeType)(\"Identifier\")\n }\n }\n});\n(0, _utils.default)(\"ImportNamespaceSpecifier\", {\n visitor: [\"local\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: (0, _utils.assertNodeType)(\"Identifier\")\n }\n }\n});\n(0, _utils.default)(\"ImportSpecifier\", {\n visitor: [\"local\", \"imported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: (0, _utils.assertNodeType)(\"Identifier\")\n },\n imported: {\n validate: (0, _utils.assertNodeType)(\"Identifier\", \"StringLiteral\")\n },\n importKind: {\n validate: (0, _utils.assertOneOf)(\"type\", \"typeof\"),\n optional: true\n }\n }\n});\n(0, _utils.default)(\"MetaProperty\", {\n visitor: [\"meta\", \"property\"],\n aliases: [\"Expression\"],\n fields: {\n meta: {\n validate: (0, _utils.chain)((0, _utils.assertNodeType)(\"Identifier\"), Object.assign(function (node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n let property;\n\n switch (val.name) {\n case \"function\":\n property = \"sent\";\n break;\n\n case \"new\":\n property = \"target\";\n break;\n\n case \"import\":\n property = \"meta\";\n break;\n }\n\n if (!(0, _is.default)(\"Identifier\", node.property, {\n name: property\n })) {\n throw new TypeError(\"Unrecognised MetaProperty\");\n }\n }, {\n oneOfNodeTypes: [\"Identifier\"]\n }))\n },\n property: {\n validate: (0, _utils.assertNodeType)(\"Identifier\")\n }\n }\n});\nconst classMethodOrPropertyCommon = {\n abstract: {\n validate: (0, _utils.assertValueType)(\"boolean\"),\n optional: true\n },\n accessibility: {\n validate: (0, _utils.assertOneOf)(\"public\", \"private\", \"protected\"),\n optional: true\n },\n static: {\n default: false\n },\n computed: {\n default: false\n },\n optional: {\n validate: (0, _utils.assertValueType)(\"boolean\"),\n optional: true\n },\n key: {\n validate: (0, _utils.chain)(function () {\n const normal = (0, _utils.assertNodeType)(\"Identifier\", \"StringLiteral\", \"NumericLiteral\");\n const computed = (0, _utils.assertNodeType)(\"Expression\");\n return function (node, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n }(), (0, _utils.assertNodeType)(\"Identifier\", \"StringLiteral\", \"NumericLiteral\", \"Expression\"))\n }\n};\nexports.classMethodOrPropertyCommon = classMethodOrPropertyCommon;\nconst classMethodOrDeclareMethodCommon = Object.assign({}, functionCommon, classMethodOrPropertyCommon, {\n kind: {\n validate: (0, _utils.assertOneOf)(\"get\", \"set\", \"method\", \"constructor\"),\n default: \"method\"\n },\n access: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"string\"), (0, _utils.assertOneOf)(\"public\", \"private\", \"protected\")),\n optional: true\n },\n decorators: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Decorator\"))),\n optional: true\n }\n});\nexports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon;\n(0, _utils.default)(\"ClassMethod\", {\n aliases: [\"Function\", \"Scopable\", \"BlockParent\", \"FunctionParent\", \"Method\"],\n builder: [\"kind\", \"key\", \"params\", \"body\", \"computed\", \"static\", \"generator\", \"async\"],\n visitor: [\"key\", \"params\", \"body\", \"decorators\", \"returnType\", \"typeParameters\"],\n fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, {\n body: {\n validate: (0, _utils.assertNodeType)(\"BlockStatement\")\n }\n })\n});\n(0, _utils.default)(\"ObjectPattern\", {\n visitor: [\"properties\", \"typeAnnotation\", \"decorators\"],\n builder: [\"properties\"],\n aliases: [\"Pattern\", \"PatternLike\", \"LVal\"],\n fields: Object.assign({}, patternLikeCommon, {\n properties: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"RestElement\", \"ObjectProperty\")))\n }\n })\n});\n(0, _utils.default)(\"SpreadElement\", {\n visitor: [\"argument\"],\n aliases: [\"UnaryLike\"],\n deprecatedAlias: \"SpreadProperty\",\n fields: {\n argument: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"Super\", {\n aliases: [\"Expression\"]\n});\n(0, _utils.default)(\"TaggedTemplateExpression\", {\n visitor: [\"tag\", \"quasi\"],\n aliases: [\"Expression\"],\n fields: {\n tag: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n quasi: {\n validate: (0, _utils.assertNodeType)(\"TemplateLiteral\")\n },\n typeParameters: {\n validate: (0, _utils.assertNodeType)(\"TypeParameterInstantiation\", \"TSTypeParameterInstantiation\"),\n optional: true\n }\n }\n});\n(0, _utils.default)(\"TemplateElement\", {\n builder: [\"value\", \"tail\"],\n fields: {\n value: {\n validate: (0, _utils.assertShape)({\n raw: {\n validate: (0, _utils.assertValueType)(\"string\")\n },\n cooked: {\n validate: (0, _utils.assertValueType)(\"string\"),\n optional: true\n }\n })\n },\n tail: {\n default: false\n }\n }\n});\n(0, _utils.default)(\"TemplateLiteral\", {\n visitor: [\"quasis\", \"expressions\"],\n aliases: [\"Expression\", \"Literal\"],\n fields: {\n quasis: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"TemplateElement\")))\n },\n expressions: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Expression\", \"TSType\")), function (node, key, val) {\n if (node.quasis.length !== val.length + 1) {\n throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of expressions.\\nExpected ${val.length + 1} quasis but got ${node.quasis.length}`);\n }\n })\n }\n }\n});\n(0, _utils.default)(\"YieldExpression\", {\n builder: [\"argument\", \"delegate\"],\n visitor: [\"argument\"],\n aliases: [\"Expression\", \"Terminatorless\"],\n fields: {\n delegate: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"boolean\"), Object.assign(function (node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && !node.argument) {\n throw new TypeError(\"Property delegate of YieldExpression cannot be true if there is no argument\");\n }\n }, {\n type: \"boolean\"\n })),\n default: false\n },\n argument: {\n optional: true,\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"AwaitExpression\", {\n builder: [\"argument\"],\n visitor: [\"argument\"],\n aliases: [\"Expression\", \"Terminatorless\"],\n fields: {\n argument: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"Import\", {\n aliases: [\"Expression\"]\n});\n(0, _utils.default)(\"BigIntLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: (0, _utils.assertValueType)(\"string\")\n }\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"]\n});\n(0, _utils.default)(\"ExportNamespaceSpecifier\", {\n visitor: [\"exported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n exported: {\n validate: (0, _utils.assertNodeType)(\"Identifier\")\n }\n }\n});\n(0, _utils.default)(\"OptionalMemberExpression\", {\n builder: [\"object\", \"property\", \"computed\", \"optional\"],\n visitor: [\"object\", \"property\"],\n aliases: [\"Expression\"],\n fields: {\n object: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n property: {\n validate: function () {\n const normal = (0, _utils.assertNodeType)(\"Identifier\");\n const computed = (0, _utils.assertNodeType)(\"Expression\");\n\n const validator = function (node, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n\n validator.oneOfNodeTypes = [\"Expression\", \"Identifier\"];\n return validator;\n }()\n },\n computed: {\n default: false\n },\n optional: {\n validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)(\"boolean\") : (0, _utils.chain)((0, _utils.assertValueType)(\"boolean\"), (0, _utils.assertOptionalChainStart)())\n }\n }\n});\n(0, _utils.default)(\"OptionalCallExpression\", {\n visitor: [\"callee\", \"arguments\", \"typeParameters\", \"typeArguments\"],\n builder: [\"callee\", \"arguments\", \"optional\"],\n aliases: [\"Expression\"],\n fields: {\n callee: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n arguments: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Expression\", \"SpreadElement\", \"JSXNamespacedName\")))\n },\n optional: {\n validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)(\"boolean\") : (0, _utils.chain)((0, _utils.assertValueType)(\"boolean\"), (0, _utils.assertOptionalChainStart)())\n },\n typeArguments: {\n validate: (0, _utils.assertNodeType)(\"TypeParameterInstantiation\"),\n optional: true\n },\n typeParameters: {\n validate: (0, _utils.assertNodeType)(\"TSTypeParameterInstantiation\"),\n optional: true\n }\n }\n});","\"use strict\";\n\nvar _utils = _interopRequireWildcard(require(\"./utils\"));\n\nvar _core = require(\"./core\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\n(0, _utils.default)(\"ArgumentPlaceholder\", {});\n(0, _utils.default)(\"BindExpression\", {\n visitor: [\"object\", \"callee\"],\n aliases: [\"Expression\"],\n fields: !process.env.BABEL_TYPES_8_BREAKING ? {\n object: {\n validate: Object.assign(() => {}, {\n oneOfNodeTypes: [\"Expression\"]\n })\n },\n callee: {\n validate: Object.assign(() => {}, {\n oneOfNodeTypes: [\"Expression\"]\n })\n }\n } : {\n object: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n },\n callee: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"ClassProperty\", {\n visitor: [\"key\", \"value\", \"typeAnnotation\", \"decorators\"],\n builder: [\"key\", \"value\", \"typeAnnotation\", \"decorators\", \"computed\", \"static\"],\n aliases: [\"Property\"],\n fields: Object.assign({}, _core.classMethodOrPropertyCommon, {\n value: {\n validate: (0, _utils.assertNodeType)(\"Expression\"),\n optional: true\n },\n definite: {\n validate: (0, _utils.assertValueType)(\"boolean\"),\n optional: true\n },\n typeAnnotation: {\n validate: (0, _utils.assertNodeType)(\"TypeAnnotation\", \"TSTypeAnnotation\", \"Noop\"),\n optional: true\n },\n decorators: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Decorator\"))),\n optional: true\n },\n readonly: {\n validate: (0, _utils.assertValueType)(\"boolean\"),\n optional: true\n },\n declare: {\n validate: (0, _utils.assertValueType)(\"boolean\"),\n optional: true\n }\n })\n});\n(0, _utils.default)(\"PipelineTopicExpression\", {\n builder: [\"expression\"],\n visitor: [\"expression\"],\n fields: {\n expression: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"PipelineBareFunction\", {\n builder: [\"callee\"],\n visitor: [\"callee\"],\n fields: {\n callee: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"PipelinePrimaryTopicReference\", {\n aliases: [\"Expression\"]\n});\n(0, _utils.default)(\"ClassPrivateProperty\", {\n visitor: [\"key\", \"value\", \"decorators\"],\n builder: [\"key\", \"value\", \"decorators\", \"static\"],\n aliases: [\"Property\", \"Private\"],\n fields: {\n key: {\n validate: (0, _utils.assertNodeType)(\"PrivateName\")\n },\n value: {\n validate: (0, _utils.assertNodeType)(\"Expression\"),\n optional: true\n },\n decorators: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Decorator\"))),\n optional: true\n }\n }\n});\n(0, _utils.default)(\"ClassPrivateMethod\", {\n builder: [\"kind\", \"key\", \"params\", \"body\", \"static\"],\n visitor: [\"key\", \"params\", \"body\", \"decorators\", \"returnType\", \"typeParameters\"],\n aliases: [\"Function\", \"Scopable\", \"BlockParent\", \"FunctionParent\", \"Method\", \"Private\"],\n fields: Object.assign({}, _core.classMethodOrDeclareMethodCommon, _core.functionTypeAnnotationCommon, {\n key: {\n validate: (0, _utils.assertNodeType)(\"PrivateName\")\n },\n body: {\n validate: (0, _utils.assertNodeType)(\"BlockStatement\")\n }\n })\n});\n(0, _utils.default)(\"ImportAttribute\", {\n visitor: [\"key\", \"value\"],\n fields: {\n key: {\n validate: (0, _utils.assertNodeType)(\"Identifier\", \"StringLiteral\")\n },\n value: {\n validate: (0, _utils.assertNodeType)(\"StringLiteral\")\n }\n }\n});\n(0, _utils.default)(\"Decorator\", {\n visitor: [\"expression\"],\n fields: {\n expression: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"DoExpression\", {\n visitor: [\"body\"],\n aliases: [\"Expression\"],\n fields: {\n body: {\n validate: (0, _utils.assertNodeType)(\"BlockStatement\")\n }\n }\n});\n(0, _utils.default)(\"ExportDefaultSpecifier\", {\n visitor: [\"exported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n exported: {\n validate: (0, _utils.assertNodeType)(\"Identifier\")\n }\n }\n});\n(0, _utils.default)(\"PrivateName\", {\n visitor: [\"id\"],\n aliases: [\"Private\"],\n fields: {\n id: {\n validate: (0, _utils.assertNodeType)(\"Identifier\")\n }\n }\n});\n(0, _utils.default)(\"RecordExpression\", {\n visitor: [\"properties\"],\n aliases: [\"Expression\"],\n fields: {\n properties: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"ObjectProperty\", \"SpreadElement\")))\n }\n }\n});\n(0, _utils.default)(\"TupleExpression\", {\n fields: {\n elements: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Expression\", \"SpreadElement\"))),\n default: []\n }\n },\n visitor: [\"elements\"],\n aliases: [\"Expression\"]\n});\n(0, _utils.default)(\"DecimalLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: (0, _utils.assertValueType)(\"string\")\n }\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"]\n});\n(0, _utils.default)(\"StaticBlock\", {\n visitor: [\"body\"],\n fields: {\n body: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"Statement\")))\n }\n },\n aliases: [\"Scopable\", \"BlockParent\"]\n});","\"use strict\";\n\nvar _utils = _interopRequireWildcard(require(\"./utils\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nconst defineInterfaceishType = (name, typeParameterType = \"TypeParameterDeclaration\") => {\n (0, _utils.default)(name, {\n builder: [\"id\", \"typeParameters\", \"extends\", \"body\"],\n visitor: [\"id\", \"typeParameters\", \"extends\", \"mixins\", \"implements\", \"body\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\"),\n typeParameters: (0, _utils.validateOptionalType)(typeParameterType),\n extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)(\"InterfaceExtends\")),\n mixins: (0, _utils.validateOptional)((0, _utils.arrayOfType)(\"InterfaceExtends\")),\n implements: (0, _utils.validateOptional)((0, _utils.arrayOfType)(\"ClassImplements\")),\n body: (0, _utils.validateType)(\"ObjectTypeAnnotation\")\n }\n });\n};\n\n(0, _utils.default)(\"AnyTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"]\n});\n(0, _utils.default)(\"ArrayTypeAnnotation\", {\n visitor: [\"elementType\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n elementType: (0, _utils.validateType)(\"FlowType\")\n }\n});\n(0, _utils.default)(\"BooleanTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"]\n});\n(0, _utils.default)(\"BooleanLiteralTypeAnnotation\", {\n builder: [\"value\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n value: (0, _utils.validate)((0, _utils.assertValueType)(\"boolean\"))\n }\n});\n(0, _utils.default)(\"NullLiteralTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"]\n});\n(0, _utils.default)(\"ClassImplements\", {\n visitor: [\"id\", \"typeParameters\"],\n aliases: [\"Flow\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\"),\n typeParameters: (0, _utils.validateOptionalType)(\"TypeParameterInstantiation\")\n }\n});\ndefineInterfaceishType(\"DeclareClass\");\n(0, _utils.default)(\"DeclareFunction\", {\n visitor: [\"id\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\"),\n predicate: (0, _utils.validateOptionalType)(\"DeclaredPredicate\")\n }\n});\ndefineInterfaceishType(\"DeclareInterface\");\n(0, _utils.default)(\"DeclareModule\", {\n builder: [\"id\", \"body\", \"kind\"],\n visitor: [\"id\", \"body\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: (0, _utils.validateType)([\"Identifier\", \"StringLiteral\"]),\n body: (0, _utils.validateType)(\"BlockStatement\"),\n kind: (0, _utils.validateOptional)((0, _utils.assertOneOf)(\"CommonJS\", \"ES\"))\n }\n});\n(0, _utils.default)(\"DeclareModuleExports\", {\n visitor: [\"typeAnnotation\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n typeAnnotation: (0, _utils.validateType)(\"TypeAnnotation\")\n }\n});\n(0, _utils.default)(\"DeclareTypeAlias\", {\n visitor: [\"id\", \"typeParameters\", \"right\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\"),\n typeParameters: (0, _utils.validateOptionalType)(\"TypeParameterDeclaration\"),\n right: (0, _utils.validateType)(\"FlowType\")\n }\n});\n(0, _utils.default)(\"DeclareOpaqueType\", {\n visitor: [\"id\", \"typeParameters\", \"supertype\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\"),\n typeParameters: (0, _utils.validateOptionalType)(\"TypeParameterDeclaration\"),\n supertype: (0, _utils.validateOptionalType)(\"FlowType\")\n }\n});\n(0, _utils.default)(\"DeclareVariable\", {\n visitor: [\"id\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\")\n }\n});\n(0, _utils.default)(\"DeclareExportDeclaration\", {\n visitor: [\"declaration\", \"specifiers\", \"source\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n declaration: (0, _utils.validateOptionalType)(\"Flow\"),\n specifiers: (0, _utils.validateOptional)((0, _utils.arrayOfType)([\"ExportSpecifier\", \"ExportNamespaceSpecifier\"])),\n source: (0, _utils.validateOptionalType)(\"StringLiteral\"),\n default: (0, _utils.validateOptional)((0, _utils.assertValueType)(\"boolean\"))\n }\n});\n(0, _utils.default)(\"DeclareExportAllDeclaration\", {\n visitor: [\"source\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n source: (0, _utils.validateType)(\"StringLiteral\"),\n exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)(\"type\", \"value\"))\n }\n});\n(0, _utils.default)(\"DeclaredPredicate\", {\n visitor: [\"value\"],\n aliases: [\"Flow\", \"FlowPredicate\"],\n fields: {\n value: (0, _utils.validateType)(\"Flow\")\n }\n});\n(0, _utils.default)(\"ExistsTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\"]\n});\n(0, _utils.default)(\"FunctionTypeAnnotation\", {\n visitor: [\"typeParameters\", \"params\", \"rest\", \"returnType\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n typeParameters: (0, _utils.validateOptionalType)(\"TypeParameterDeclaration\"),\n params: (0, _utils.validate)((0, _utils.arrayOfType)(\"FunctionTypeParam\")),\n rest: (0, _utils.validateOptionalType)(\"FunctionTypeParam\"),\n returnType: (0, _utils.validateType)(\"FlowType\")\n }\n});\n(0, _utils.default)(\"FunctionTypeParam\", {\n visitor: [\"name\", \"typeAnnotation\"],\n aliases: [\"Flow\"],\n fields: {\n name: (0, _utils.validateOptionalType)(\"Identifier\"),\n typeAnnotation: (0, _utils.validateType)(\"FlowType\"),\n optional: (0, _utils.validateOptional)((0, _utils.assertValueType)(\"boolean\"))\n }\n});\n(0, _utils.default)(\"GenericTypeAnnotation\", {\n visitor: [\"id\", \"typeParameters\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n id: (0, _utils.validateType)([\"Identifier\", \"QualifiedTypeIdentifier\"]),\n typeParameters: (0, _utils.validateOptionalType)(\"TypeParameterInstantiation\")\n }\n});\n(0, _utils.default)(\"InferredPredicate\", {\n aliases: [\"Flow\", \"FlowPredicate\"]\n});\n(0, _utils.default)(\"InterfaceExtends\", {\n visitor: [\"id\", \"typeParameters\"],\n aliases: [\"Flow\"],\n fields: {\n id: (0, _utils.validateType)([\"Identifier\", \"QualifiedTypeIdentifier\"]),\n typeParameters: (0, _utils.validateOptionalType)(\"TypeParameterInstantiation\")\n }\n});\ndefineInterfaceishType(\"InterfaceDeclaration\");\n(0, _utils.default)(\"InterfaceTypeAnnotation\", {\n visitor: [\"extends\", \"body\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)(\"InterfaceExtends\")),\n body: (0, _utils.validateType)(\"ObjectTypeAnnotation\")\n }\n});\n(0, _utils.default)(\"IntersectionTypeAnnotation\", {\n visitor: [\"types\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n types: (0, _utils.validate)((0, _utils.arrayOfType)(\"FlowType\"))\n }\n});\n(0, _utils.default)(\"MixedTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"]\n});\n(0, _utils.default)(\"EmptyTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"]\n});\n(0, _utils.default)(\"NullableTypeAnnotation\", {\n visitor: [\"typeAnnotation\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n typeAnnotation: (0, _utils.validateType)(\"FlowType\")\n }\n});\n(0, _utils.default)(\"NumberLiteralTypeAnnotation\", {\n builder: [\"value\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n value: (0, _utils.validate)((0, _utils.assertValueType)(\"number\"))\n }\n});\n(0, _utils.default)(\"NumberTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"]\n});\n(0, _utils.default)(\"ObjectTypeAnnotation\", {\n visitor: [\"properties\", \"indexers\", \"callProperties\", \"internalSlots\"],\n aliases: [\"Flow\", \"FlowType\"],\n builder: [\"properties\", \"indexers\", \"callProperties\", \"internalSlots\", \"exact\"],\n fields: {\n properties: (0, _utils.validate)((0, _utils.arrayOfType)([\"ObjectTypeProperty\", \"ObjectTypeSpreadProperty\"])),\n indexers: (0, _utils.validateOptional)((0, _utils.arrayOfType)(\"ObjectTypeIndexer\")),\n callProperties: (0, _utils.validateOptional)((0, _utils.arrayOfType)(\"ObjectTypeCallProperty\")),\n internalSlots: (0, _utils.validateOptional)((0, _utils.arrayOfType)(\"ObjectTypeInternalSlot\")),\n exact: {\n validate: (0, _utils.assertValueType)(\"boolean\"),\n default: false\n },\n inexact: (0, _utils.validateOptional)((0, _utils.assertValueType)(\"boolean\"))\n }\n});\n(0, _utils.default)(\"ObjectTypeInternalSlot\", {\n visitor: [\"id\", \"value\", \"optional\", \"static\", \"method\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\"),\n value: (0, _utils.validateType)(\"FlowType\"),\n optional: (0, _utils.validate)((0, _utils.assertValueType)(\"boolean\")),\n static: (0, _utils.validate)((0, _utils.assertValueType)(\"boolean\")),\n method: (0, _utils.validate)((0, _utils.assertValueType)(\"boolean\"))\n }\n});\n(0, _utils.default)(\"ObjectTypeCallProperty\", {\n visitor: [\"value\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n value: (0, _utils.validateType)(\"FlowType\"),\n static: (0, _utils.validate)((0, _utils.assertValueType)(\"boolean\"))\n }\n});\n(0, _utils.default)(\"ObjectTypeIndexer\", {\n visitor: [\"id\", \"key\", \"value\", \"variance\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n id: (0, _utils.validateOptionalType)(\"Identifier\"),\n key: (0, _utils.validateType)(\"FlowType\"),\n value: (0, _utils.validateType)(\"FlowType\"),\n static: (0, _utils.validate)((0, _utils.assertValueType)(\"boolean\")),\n variance: (0, _utils.validateOptionalType)(\"Variance\")\n }\n});\n(0, _utils.default)(\"ObjectTypeProperty\", {\n visitor: [\"key\", \"value\", \"variance\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n key: (0, _utils.validateType)([\"Identifier\", \"StringLiteral\"]),\n value: (0, _utils.validateType)(\"FlowType\"),\n kind: (0, _utils.validate)((0, _utils.assertOneOf)(\"init\", \"get\", \"set\")),\n static: (0, _utils.validate)((0, _utils.assertValueType)(\"boolean\")),\n proto: (0, _utils.validate)((0, _utils.assertValueType)(\"boolean\")),\n optional: (0, _utils.validate)((0, _utils.assertValueType)(\"boolean\")),\n variance: (0, _utils.validateOptionalType)(\"Variance\")\n }\n});\n(0, _utils.default)(\"ObjectTypeSpreadProperty\", {\n visitor: [\"argument\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n argument: (0, _utils.validateType)(\"FlowType\")\n }\n});\n(0, _utils.default)(\"OpaqueType\", {\n visitor: [\"id\", \"typeParameters\", \"supertype\", \"impltype\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\"),\n typeParameters: (0, _utils.validateOptionalType)(\"TypeParameterDeclaration\"),\n supertype: (0, _utils.validateOptionalType)(\"FlowType\"),\n impltype: (0, _utils.validateType)(\"FlowType\")\n }\n});\n(0, _utils.default)(\"QualifiedTypeIdentifier\", {\n visitor: [\"id\", \"qualification\"],\n aliases: [\"Flow\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\"),\n qualification: (0, _utils.validateType)([\"Identifier\", \"QualifiedTypeIdentifier\"])\n }\n});\n(0, _utils.default)(\"StringLiteralTypeAnnotation\", {\n builder: [\"value\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n value: (0, _utils.validate)((0, _utils.assertValueType)(\"string\"))\n }\n});\n(0, _utils.default)(\"StringTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"]\n});\n(0, _utils.default)(\"SymbolTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"]\n});\n(0, _utils.default)(\"ThisTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"]\n});\n(0, _utils.default)(\"TupleTypeAnnotation\", {\n visitor: [\"types\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n types: (0, _utils.validate)((0, _utils.arrayOfType)(\"FlowType\"))\n }\n});\n(0, _utils.default)(\"TypeofTypeAnnotation\", {\n visitor: [\"argument\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n argument: (0, _utils.validateType)(\"FlowType\")\n }\n});\n(0, _utils.default)(\"TypeAlias\", {\n visitor: [\"id\", \"typeParameters\", \"right\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\"),\n typeParameters: (0, _utils.validateOptionalType)(\"TypeParameterDeclaration\"),\n right: (0, _utils.validateType)(\"FlowType\")\n }\n});\n(0, _utils.default)(\"TypeAnnotation\", {\n aliases: [\"Flow\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: (0, _utils.validateType)(\"FlowType\")\n }\n});\n(0, _utils.default)(\"TypeCastExpression\", {\n visitor: [\"expression\", \"typeAnnotation\"],\n aliases: [\"Flow\", \"ExpressionWrapper\", \"Expression\"],\n fields: {\n expression: (0, _utils.validateType)(\"Expression\"),\n typeAnnotation: (0, _utils.validateType)(\"TypeAnnotation\")\n }\n});\n(0, _utils.default)(\"TypeParameter\", {\n aliases: [\"Flow\"],\n visitor: [\"bound\", \"default\", \"variance\"],\n fields: {\n name: (0, _utils.validate)((0, _utils.assertValueType)(\"string\")),\n bound: (0, _utils.validateOptionalType)(\"TypeAnnotation\"),\n default: (0, _utils.validateOptionalType)(\"FlowType\"),\n variance: (0, _utils.validateOptionalType)(\"Variance\")\n }\n});\n(0, _utils.default)(\"TypeParameterDeclaration\", {\n aliases: [\"Flow\"],\n visitor: [\"params\"],\n fields: {\n params: (0, _utils.validate)((0, _utils.arrayOfType)(\"TypeParameter\"))\n }\n});\n(0, _utils.default)(\"TypeParameterInstantiation\", {\n aliases: [\"Flow\"],\n visitor: [\"params\"],\n fields: {\n params: (0, _utils.validate)((0, _utils.arrayOfType)(\"FlowType\"))\n }\n});\n(0, _utils.default)(\"UnionTypeAnnotation\", {\n visitor: [\"types\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n types: (0, _utils.validate)((0, _utils.arrayOfType)(\"FlowType\"))\n }\n});\n(0, _utils.default)(\"Variance\", {\n aliases: [\"Flow\"],\n builder: [\"kind\"],\n fields: {\n kind: (0, _utils.validate)((0, _utils.assertOneOf)(\"minus\", \"plus\"))\n }\n});\n(0, _utils.default)(\"VoidTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"]\n});\n(0, _utils.default)(\"EnumDeclaration\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"body\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\"),\n body: (0, _utils.validateType)([\"EnumBooleanBody\", \"EnumNumberBody\", \"EnumStringBody\", \"EnumSymbolBody\"])\n }\n});\n(0, _utils.default)(\"EnumBooleanBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n explicit: (0, _utils.validate)((0, _utils.assertValueType)(\"boolean\")),\n members: (0, _utils.validateArrayOfType)(\"EnumBooleanMember\")\n }\n});\n(0, _utils.default)(\"EnumNumberBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n explicit: (0, _utils.validate)((0, _utils.assertValueType)(\"boolean\")),\n members: (0, _utils.validateArrayOfType)(\"EnumNumberMember\")\n }\n});\n(0, _utils.default)(\"EnumStringBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n explicit: (0, _utils.validate)((0, _utils.assertValueType)(\"boolean\")),\n members: (0, _utils.validateArrayOfType)([\"EnumStringMember\", \"EnumDefaultedMember\"])\n }\n});\n(0, _utils.default)(\"EnumSymbolBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n members: (0, _utils.validateArrayOfType)(\"EnumDefaultedMember\")\n }\n});\n(0, _utils.default)(\"EnumBooleanMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\"),\n init: (0, _utils.validateType)(\"BooleanLiteral\")\n }\n});\n(0, _utils.default)(\"EnumNumberMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\", \"init\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\"),\n init: (0, _utils.validateType)(\"NumericLiteral\")\n }\n});\n(0, _utils.default)(\"EnumStringMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\", \"init\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\"),\n init: (0, _utils.validateType)(\"StringLiteral\")\n }\n});\n(0, _utils.default)(\"EnumDefaultedMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\")\n }\n});","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"VISITOR_KEYS\", {\n enumerable: true,\n get: function () {\n return _utils.VISITOR_KEYS;\n }\n});\nObject.defineProperty(exports, \"ALIAS_KEYS\", {\n enumerable: true,\n get: function () {\n return _utils.ALIAS_KEYS;\n }\n});\nObject.defineProperty(exports, \"FLIPPED_ALIAS_KEYS\", {\n enumerable: true,\n get: function () {\n return _utils.FLIPPED_ALIAS_KEYS;\n }\n});\nObject.defineProperty(exports, \"NODE_FIELDS\", {\n enumerable: true,\n get: function () {\n return _utils.NODE_FIELDS;\n }\n});\nObject.defineProperty(exports, \"BUILDER_KEYS\", {\n enumerable: true,\n get: function () {\n return _utils.BUILDER_KEYS;\n }\n});\nObject.defineProperty(exports, \"DEPRECATED_KEYS\", {\n enumerable: true,\n get: function () {\n return _utils.DEPRECATED_KEYS;\n }\n});\nObject.defineProperty(exports, \"NODE_PARENT_VALIDATIONS\", {\n enumerable: true,\n get: function () {\n return _utils.NODE_PARENT_VALIDATIONS;\n }\n});\nObject.defineProperty(exports, \"PLACEHOLDERS\", {\n enumerable: true,\n get: function () {\n return _placeholders.PLACEHOLDERS;\n }\n});\nObject.defineProperty(exports, \"PLACEHOLDERS_ALIAS\", {\n enumerable: true,\n get: function () {\n return _placeholders.PLACEHOLDERS_ALIAS;\n }\n});\nObject.defineProperty(exports, \"PLACEHOLDERS_FLIPPED_ALIAS\", {\n enumerable: true,\n get: function () {\n return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS;\n }\n});\nexports.TYPES = void 0;\n\nvar _toFastProperties = _interopRequireDefault(require(\"to-fast-properties\"));\n\nrequire(\"./core\");\n\nrequire(\"./flow\");\n\nrequire(\"./jsx\");\n\nrequire(\"./misc\");\n\nrequire(\"./experimental\");\n\nrequire(\"./typescript\");\n\nvar _utils = require(\"./utils\");\n\nvar _placeholders = require(\"./placeholders\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n(0, _toFastProperties.default)(_utils.VISITOR_KEYS);\n(0, _toFastProperties.default)(_utils.ALIAS_KEYS);\n(0, _toFastProperties.default)(_utils.FLIPPED_ALIAS_KEYS);\n(0, _toFastProperties.default)(_utils.NODE_FIELDS);\n(0, _toFastProperties.default)(_utils.BUILDER_KEYS);\n(0, _toFastProperties.default)(_utils.DEPRECATED_KEYS);\n(0, _toFastProperties.default)(_placeholders.PLACEHOLDERS_ALIAS);\n(0, _toFastProperties.default)(_placeholders.PLACEHOLDERS_FLIPPED_ALIAS);\nconst TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS));\nexports.TYPES = TYPES;","\"use strict\";\n\nvar _utils = _interopRequireWildcard(require(\"./utils\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\n(0, _utils.default)(\"JSXAttribute\", {\n visitor: [\"name\", \"value\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n name: {\n validate: (0, _utils.assertNodeType)(\"JSXIdentifier\", \"JSXNamespacedName\")\n },\n value: {\n optional: true,\n validate: (0, _utils.assertNodeType)(\"JSXElement\", \"JSXFragment\", \"StringLiteral\", \"JSXExpressionContainer\")\n }\n }\n});\n(0, _utils.default)(\"JSXClosingElement\", {\n visitor: [\"name\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n name: {\n validate: (0, _utils.assertNodeType)(\"JSXIdentifier\", \"JSXMemberExpression\", \"JSXNamespacedName\")\n }\n }\n});\n(0, _utils.default)(\"JSXElement\", {\n builder: [\"openingElement\", \"closingElement\", \"children\", \"selfClosing\"],\n visitor: [\"openingElement\", \"children\", \"closingElement\"],\n aliases: [\"JSX\", \"Immutable\", \"Expression\"],\n fields: {\n openingElement: {\n validate: (0, _utils.assertNodeType)(\"JSXOpeningElement\")\n },\n closingElement: {\n optional: true,\n validate: (0, _utils.assertNodeType)(\"JSXClosingElement\")\n },\n children: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"JSXText\", \"JSXExpressionContainer\", \"JSXSpreadChild\", \"JSXElement\", \"JSXFragment\")))\n },\n selfClosing: {\n validate: (0, _utils.assertValueType)(\"boolean\"),\n optional: true\n }\n }\n});\n(0, _utils.default)(\"JSXEmptyExpression\", {\n aliases: [\"JSX\"]\n});\n(0, _utils.default)(\"JSXExpressionContainer\", {\n visitor: [\"expression\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n expression: {\n validate: (0, _utils.assertNodeType)(\"Expression\", \"JSXEmptyExpression\")\n }\n }\n});\n(0, _utils.default)(\"JSXSpreadChild\", {\n visitor: [\"expression\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n expression: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"JSXIdentifier\", {\n builder: [\"name\"],\n aliases: [\"JSX\"],\n fields: {\n name: {\n validate: (0, _utils.assertValueType)(\"string\")\n }\n }\n});\n(0, _utils.default)(\"JSXMemberExpression\", {\n visitor: [\"object\", \"property\"],\n aliases: [\"JSX\"],\n fields: {\n object: {\n validate: (0, _utils.assertNodeType)(\"JSXMemberExpression\", \"JSXIdentifier\")\n },\n property: {\n validate: (0, _utils.assertNodeType)(\"JSXIdentifier\")\n }\n }\n});\n(0, _utils.default)(\"JSXNamespacedName\", {\n visitor: [\"namespace\", \"name\"],\n aliases: [\"JSX\"],\n fields: {\n namespace: {\n validate: (0, _utils.assertNodeType)(\"JSXIdentifier\")\n },\n name: {\n validate: (0, _utils.assertNodeType)(\"JSXIdentifier\")\n }\n }\n});\n(0, _utils.default)(\"JSXOpeningElement\", {\n builder: [\"name\", \"attributes\", \"selfClosing\"],\n visitor: [\"name\", \"attributes\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n name: {\n validate: (0, _utils.assertNodeType)(\"JSXIdentifier\", \"JSXMemberExpression\", \"JSXNamespacedName\")\n },\n selfClosing: {\n default: false\n },\n attributes: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"JSXAttribute\", \"JSXSpreadAttribute\")))\n },\n typeParameters: {\n validate: (0, _utils.assertNodeType)(\"TypeParameterInstantiation\", \"TSTypeParameterInstantiation\"),\n optional: true\n }\n }\n});\n(0, _utils.default)(\"JSXSpreadAttribute\", {\n visitor: [\"argument\"],\n aliases: [\"JSX\"],\n fields: {\n argument: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"JSXText\", {\n aliases: [\"JSX\", \"Immutable\"],\n builder: [\"value\"],\n fields: {\n value: {\n validate: (0, _utils.assertValueType)(\"string\")\n }\n }\n});\n(0, _utils.default)(\"JSXFragment\", {\n builder: [\"openingFragment\", \"closingFragment\", \"children\"],\n visitor: [\"openingFragment\", \"children\", \"closingFragment\"],\n aliases: [\"JSX\", \"Immutable\", \"Expression\"],\n fields: {\n openingFragment: {\n validate: (0, _utils.assertNodeType)(\"JSXOpeningFragment\")\n },\n closingFragment: {\n validate: (0, _utils.assertNodeType)(\"JSXClosingFragment\")\n },\n children: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"JSXText\", \"JSXExpressionContainer\", \"JSXSpreadChild\", \"JSXElement\", \"JSXFragment\")))\n }\n }\n});\n(0, _utils.default)(\"JSXOpeningFragment\", {\n aliases: [\"JSX\", \"Immutable\"]\n});\n(0, _utils.default)(\"JSXClosingFragment\", {\n aliases: [\"JSX\", \"Immutable\"]\n});","\"use strict\";\n\nvar _utils = _interopRequireWildcard(require(\"./utils\"));\n\nvar _placeholders = require(\"./placeholders\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\n(0, _utils.default)(\"Noop\", {\n visitor: []\n});\n(0, _utils.default)(\"Placeholder\", {\n visitor: [],\n builder: [\"expectedNode\", \"name\"],\n fields: {\n name: {\n validate: (0, _utils.assertNodeType)(\"Identifier\")\n },\n expectedNode: {\n validate: (0, _utils.assertOneOf)(..._placeholders.PLACEHOLDERS)\n }\n }\n});\n(0, _utils.default)(\"V8IntrinsicIdentifier\", {\n builder: [\"name\"],\n fields: {\n name: {\n validate: (0, _utils.assertValueType)(\"string\")\n }\n }\n});","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.PLACEHOLDERS_FLIPPED_ALIAS = exports.PLACEHOLDERS_ALIAS = exports.PLACEHOLDERS = void 0;\n\nvar _utils = require(\"./utils\");\n\nconst PLACEHOLDERS = [\"Identifier\", \"StringLiteral\", \"Expression\", \"Statement\", \"Declaration\", \"BlockStatement\", \"ClassBody\", \"Pattern\"];\nexports.PLACEHOLDERS = PLACEHOLDERS;\nconst PLACEHOLDERS_ALIAS = {\n Declaration: [\"Statement\"],\n Pattern: [\"PatternLike\", \"LVal\"]\n};\nexports.PLACEHOLDERS_ALIAS = PLACEHOLDERS_ALIAS;\n\nfor (const type of PLACEHOLDERS) {\n const alias = _utils.ALIAS_KEYS[type];\n if (alias == null ? void 0 : alias.length) PLACEHOLDERS_ALIAS[type] = alias;\n}\n\nconst PLACEHOLDERS_FLIPPED_ALIAS = {};\nexports.PLACEHOLDERS_FLIPPED_ALIAS = PLACEHOLDERS_FLIPPED_ALIAS;\nObject.keys(PLACEHOLDERS_ALIAS).forEach(type => {\n PLACEHOLDERS_ALIAS[type].forEach(alias => {\n if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {\n PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];\n }\n\n PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);\n });\n});","\"use strict\";\n\nvar _utils = _interopRequireWildcard(require(\"./utils\"));\n\nvar _core = require(\"./core\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }\n\nconst bool = (0, _utils.assertValueType)(\"boolean\");\nconst tSFunctionTypeAnnotationCommon = {\n returnType: {\n validate: (0, _utils.assertNodeType)(\"TSTypeAnnotation\", \"Noop\"),\n optional: true\n },\n typeParameters: {\n validate: (0, _utils.assertNodeType)(\"TSTypeParameterDeclaration\", \"Noop\"),\n optional: true\n }\n};\n(0, _utils.default)(\"TSParameterProperty\", {\n aliases: [\"LVal\"],\n visitor: [\"parameter\"],\n fields: {\n accessibility: {\n validate: (0, _utils.assertOneOf)(\"public\", \"private\", \"protected\"),\n optional: true\n },\n readonly: {\n validate: (0, _utils.assertValueType)(\"boolean\"),\n optional: true\n },\n parameter: {\n validate: (0, _utils.assertNodeType)(\"Identifier\", \"AssignmentPattern\")\n }\n }\n});\n(0, _utils.default)(\"TSDeclareFunction\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"typeParameters\", \"params\", \"returnType\"],\n fields: Object.assign({}, _core.functionDeclarationCommon, tSFunctionTypeAnnotationCommon)\n});\n(0, _utils.default)(\"TSDeclareMethod\", {\n visitor: [\"decorators\", \"key\", \"typeParameters\", \"params\", \"returnType\"],\n fields: Object.assign({}, _core.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon)\n});\n(0, _utils.default)(\"TSQualifiedName\", {\n aliases: [\"TSEntityName\"],\n visitor: [\"left\", \"right\"],\n fields: {\n left: (0, _utils.validateType)(\"TSEntityName\"),\n right: (0, _utils.validateType)(\"Identifier\")\n }\n});\nconst signatureDeclarationCommon = {\n typeParameters: (0, _utils.validateOptionalType)(\"TSTypeParameterDeclaration\"),\n parameters: (0, _utils.validateArrayOfType)([\"Identifier\", \"RestElement\"]),\n typeAnnotation: (0, _utils.validateOptionalType)(\"TSTypeAnnotation\")\n};\nconst callConstructSignatureDeclaration = {\n aliases: [\"TSTypeElement\"],\n visitor: [\"typeParameters\", \"parameters\", \"typeAnnotation\"],\n fields: signatureDeclarationCommon\n};\n(0, _utils.default)(\"TSCallSignatureDeclaration\", callConstructSignatureDeclaration);\n(0, _utils.default)(\"TSConstructSignatureDeclaration\", callConstructSignatureDeclaration);\nconst namedTypeElementCommon = {\n key: (0, _utils.validateType)(\"Expression\"),\n computed: (0, _utils.validate)(bool),\n optional: (0, _utils.validateOptional)(bool)\n};\n(0, _utils.default)(\"TSPropertySignature\", {\n aliases: [\"TSTypeElement\"],\n visitor: [\"key\", \"typeAnnotation\", \"initializer\"],\n fields: Object.assign({}, namedTypeElementCommon, {\n readonly: (0, _utils.validateOptional)(bool),\n typeAnnotation: (0, _utils.validateOptionalType)(\"TSTypeAnnotation\"),\n initializer: (0, _utils.validateOptionalType)(\"Expression\")\n })\n});\n(0, _utils.default)(\"TSMethodSignature\", {\n aliases: [\"TSTypeElement\"],\n visitor: [\"key\", \"typeParameters\", \"parameters\", \"typeAnnotation\"],\n fields: Object.assign({}, signatureDeclarationCommon, namedTypeElementCommon)\n});\n(0, _utils.default)(\"TSIndexSignature\", {\n aliases: [\"TSTypeElement\"],\n visitor: [\"parameters\", \"typeAnnotation\"],\n fields: {\n readonly: (0, _utils.validateOptional)(bool),\n parameters: (0, _utils.validateArrayOfType)(\"Identifier\"),\n typeAnnotation: (0, _utils.validateOptionalType)(\"TSTypeAnnotation\")\n }\n});\nconst tsKeywordTypes = [\"TSAnyKeyword\", \"TSBooleanKeyword\", \"TSBigIntKeyword\", \"TSIntrinsicKeyword\", \"TSNeverKeyword\", \"TSNullKeyword\", \"TSNumberKeyword\", \"TSObjectKeyword\", \"TSStringKeyword\", \"TSSymbolKeyword\", \"TSUndefinedKeyword\", \"TSUnknownKeyword\", \"TSVoidKeyword\"];\n\nfor (const type of tsKeywordTypes) {\n (0, _utils.default)(type, {\n aliases: [\"TSType\", \"TSBaseType\"],\n visitor: [],\n fields: {}\n });\n}\n\n(0, _utils.default)(\"TSThisType\", {\n aliases: [\"TSType\", \"TSBaseType\"],\n visitor: [],\n fields: {}\n});\nconst fnOrCtr = {\n aliases: [\"TSType\"],\n visitor: [\"typeParameters\", \"parameters\", \"typeAnnotation\"],\n fields: signatureDeclarationCommon\n};\n(0, _utils.default)(\"TSFunctionType\", fnOrCtr);\n(0, _utils.default)(\"TSConstructorType\", fnOrCtr);\n(0, _utils.default)(\"TSTypeReference\", {\n aliases: [\"TSType\"],\n visitor: [\"typeName\", \"typeParameters\"],\n fields: {\n typeName: (0, _utils.validateType)(\"TSEntityName\"),\n typeParameters: (0, _utils.validateOptionalType)(\"TSTypeParameterInstantiation\")\n }\n});\n(0, _utils.default)(\"TSTypePredicate\", {\n aliases: [\"TSType\"],\n visitor: [\"parameterName\", \"typeAnnotation\"],\n builder: [\"parameterName\", \"typeAnnotation\", \"asserts\"],\n fields: {\n parameterName: (0, _utils.validateType)([\"Identifier\", \"TSThisType\"]),\n typeAnnotation: (0, _utils.validateOptionalType)(\"TSTypeAnnotation\"),\n asserts: (0, _utils.validateOptional)(bool)\n }\n});\n(0, _utils.default)(\"TSTypeQuery\", {\n aliases: [\"TSType\"],\n visitor: [\"exprName\"],\n fields: {\n exprName: (0, _utils.validateType)([\"TSEntityName\", \"TSImportType\"])\n }\n});\n(0, _utils.default)(\"TSTypeLiteral\", {\n aliases: [\"TSType\"],\n visitor: [\"members\"],\n fields: {\n members: (0, _utils.validateArrayOfType)(\"TSTypeElement\")\n }\n});\n(0, _utils.default)(\"TSArrayType\", {\n aliases: [\"TSType\"],\n visitor: [\"elementType\"],\n fields: {\n elementType: (0, _utils.validateType)(\"TSType\")\n }\n});\n(0, _utils.default)(\"TSTupleType\", {\n aliases: [\"TSType\"],\n visitor: [\"elementTypes\"],\n fields: {\n elementTypes: (0, _utils.validateArrayOfType)([\"TSType\", \"TSNamedTupleMember\"])\n }\n});\n(0, _utils.default)(\"TSOptionalType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: (0, _utils.validateType)(\"TSType\")\n }\n});\n(0, _utils.default)(\"TSRestType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: (0, _utils.validateType)(\"TSType\")\n }\n});\n(0, _utils.default)(\"TSNamedTupleMember\", {\n visitor: [\"label\", \"elementType\"],\n builder: [\"label\", \"elementType\", \"optional\"],\n fields: {\n label: (0, _utils.validateType)(\"Identifier\"),\n optional: {\n validate: bool,\n default: false\n },\n elementType: (0, _utils.validateType)(\"TSType\")\n }\n});\nconst unionOrIntersection = {\n aliases: [\"TSType\"],\n visitor: [\"types\"],\n fields: {\n types: (0, _utils.validateArrayOfType)(\"TSType\")\n }\n};\n(0, _utils.default)(\"TSUnionType\", unionOrIntersection);\n(0, _utils.default)(\"TSIntersectionType\", unionOrIntersection);\n(0, _utils.default)(\"TSConditionalType\", {\n aliases: [\"TSType\"],\n visitor: [\"checkType\", \"extendsType\", \"trueType\", \"falseType\"],\n fields: {\n checkType: (0, _utils.validateType)(\"TSType\"),\n extendsType: (0, _utils.validateType)(\"TSType\"),\n trueType: (0, _utils.validateType)(\"TSType\"),\n falseType: (0, _utils.validateType)(\"TSType\")\n }\n});\n(0, _utils.default)(\"TSInferType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeParameter\"],\n fields: {\n typeParameter: (0, _utils.validateType)(\"TSTypeParameter\")\n }\n});\n(0, _utils.default)(\"TSParenthesizedType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: (0, _utils.validateType)(\"TSType\")\n }\n});\n(0, _utils.default)(\"TSTypeOperator\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n operator: (0, _utils.validate)((0, _utils.assertValueType)(\"string\")),\n typeAnnotation: (0, _utils.validateType)(\"TSType\")\n }\n});\n(0, _utils.default)(\"TSIndexedAccessType\", {\n aliases: [\"TSType\"],\n visitor: [\"objectType\", \"indexType\"],\n fields: {\n objectType: (0, _utils.validateType)(\"TSType\"),\n indexType: (0, _utils.validateType)(\"TSType\")\n }\n});\n(0, _utils.default)(\"TSMappedType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeParameter\", \"typeAnnotation\", \"nameType\"],\n fields: {\n readonly: (0, _utils.validateOptional)(bool),\n typeParameter: (0, _utils.validateType)(\"TSTypeParameter\"),\n optional: (0, _utils.validateOptional)(bool),\n typeAnnotation: (0, _utils.validateOptionalType)(\"TSType\"),\n nameType: (0, _utils.validateOptionalType)(\"TSType\")\n }\n});\n(0, _utils.default)(\"TSLiteralType\", {\n aliases: [\"TSType\", \"TSBaseType\"],\n visitor: [\"literal\"],\n fields: {\n literal: (0, _utils.validateType)([\"NumericLiteral\", \"StringLiteral\", \"BooleanLiteral\", \"BigIntLiteral\"])\n }\n});\n(0, _utils.default)(\"TSExpressionWithTypeArguments\", {\n aliases: [\"TSType\"],\n visitor: [\"expression\", \"typeParameters\"],\n fields: {\n expression: (0, _utils.validateType)(\"TSEntityName\"),\n typeParameters: (0, _utils.validateOptionalType)(\"TSTypeParameterInstantiation\")\n }\n});\n(0, _utils.default)(\"TSInterfaceDeclaration\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"typeParameters\", \"extends\", \"body\"],\n fields: {\n declare: (0, _utils.validateOptional)(bool),\n id: (0, _utils.validateType)(\"Identifier\"),\n typeParameters: (0, _utils.validateOptionalType)(\"TSTypeParameterDeclaration\"),\n extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)(\"TSExpressionWithTypeArguments\")),\n body: (0, _utils.validateType)(\"TSInterfaceBody\")\n }\n});\n(0, _utils.default)(\"TSInterfaceBody\", {\n visitor: [\"body\"],\n fields: {\n body: (0, _utils.validateArrayOfType)(\"TSTypeElement\")\n }\n});\n(0, _utils.default)(\"TSTypeAliasDeclaration\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"typeParameters\", \"typeAnnotation\"],\n fields: {\n declare: (0, _utils.validateOptional)(bool),\n id: (0, _utils.validateType)(\"Identifier\"),\n typeParameters: (0, _utils.validateOptionalType)(\"TSTypeParameterDeclaration\"),\n typeAnnotation: (0, _utils.validateType)(\"TSType\")\n }\n});\n(0, _utils.default)(\"TSAsExpression\", {\n aliases: [\"Expression\"],\n visitor: [\"expression\", \"typeAnnotation\"],\n fields: {\n expression: (0, _utils.validateType)(\"Expression\"),\n typeAnnotation: (0, _utils.validateType)(\"TSType\")\n }\n});\n(0, _utils.default)(\"TSTypeAssertion\", {\n aliases: [\"Expression\"],\n visitor: [\"typeAnnotation\", \"expression\"],\n fields: {\n typeAnnotation: (0, _utils.validateType)(\"TSType\"),\n expression: (0, _utils.validateType)(\"Expression\")\n }\n});\n(0, _utils.default)(\"TSEnumDeclaration\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"members\"],\n fields: {\n declare: (0, _utils.validateOptional)(bool),\n const: (0, _utils.validateOptional)(bool),\n id: (0, _utils.validateType)(\"Identifier\"),\n members: (0, _utils.validateArrayOfType)(\"TSEnumMember\"),\n initializer: (0, _utils.validateOptionalType)(\"Expression\")\n }\n});\n(0, _utils.default)(\"TSEnumMember\", {\n visitor: [\"id\", \"initializer\"],\n fields: {\n id: (0, _utils.validateType)([\"Identifier\", \"StringLiteral\"]),\n initializer: (0, _utils.validateOptionalType)(\"Expression\")\n }\n});\n(0, _utils.default)(\"TSModuleDeclaration\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"body\"],\n fields: {\n declare: (0, _utils.validateOptional)(bool),\n global: (0, _utils.validateOptional)(bool),\n id: (0, _utils.validateType)([\"Identifier\", \"StringLiteral\"]),\n body: (0, _utils.validateType)([\"TSModuleBlock\", \"TSModuleDeclaration\"])\n }\n});\n(0, _utils.default)(\"TSModuleBlock\", {\n aliases: [\"Scopable\", \"Block\", \"BlockParent\"],\n visitor: [\"body\"],\n fields: {\n body: (0, _utils.validateArrayOfType)(\"Statement\")\n }\n});\n(0, _utils.default)(\"TSImportType\", {\n aliases: [\"TSType\"],\n visitor: [\"argument\", \"qualifier\", \"typeParameters\"],\n fields: {\n argument: (0, _utils.validateType)(\"StringLiteral\"),\n qualifier: (0, _utils.validateOptionalType)(\"TSEntityName\"),\n typeParameters: (0, _utils.validateOptionalType)(\"TSTypeParameterInstantiation\")\n }\n});\n(0, _utils.default)(\"TSImportEqualsDeclaration\", {\n aliases: [\"Statement\"],\n visitor: [\"id\", \"moduleReference\"],\n fields: {\n isExport: (0, _utils.validate)(bool),\n id: (0, _utils.validateType)(\"Identifier\"),\n moduleReference: (0, _utils.validateType)([\"TSEntityName\", \"TSExternalModuleReference\"])\n }\n});\n(0, _utils.default)(\"TSExternalModuleReference\", {\n visitor: [\"expression\"],\n fields: {\n expression: (0, _utils.validateType)(\"StringLiteral\")\n }\n});\n(0, _utils.default)(\"TSNonNullExpression\", {\n aliases: [\"Expression\"],\n visitor: [\"expression\"],\n fields: {\n expression: (0, _utils.validateType)(\"Expression\")\n }\n});\n(0, _utils.default)(\"TSExportAssignment\", {\n aliases: [\"Statement\"],\n visitor: [\"expression\"],\n fields: {\n expression: (0, _utils.validateType)(\"Expression\")\n }\n});\n(0, _utils.default)(\"TSNamespaceExportDeclaration\", {\n aliases: [\"Statement\"],\n visitor: [\"id\"],\n fields: {\n id: (0, _utils.validateType)(\"Identifier\")\n }\n});\n(0, _utils.default)(\"TSTypeAnnotation\", {\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: {\n validate: (0, _utils.assertNodeType)(\"TSType\")\n }\n }\n});\n(0, _utils.default)(\"TSTypeParameterInstantiation\", {\n visitor: [\"params\"],\n fields: {\n params: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"TSType\")))\n }\n }\n});\n(0, _utils.default)(\"TSTypeParameterDeclaration\", {\n visitor: [\"params\"],\n fields: {\n params: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"TSTypeParameter\")))\n }\n }\n});\n(0, _utils.default)(\"TSTypeParameter\", {\n builder: [\"constraint\", \"default\", \"name\"],\n visitor: [\"constraint\", \"default\"],\n fields: {\n name: {\n validate: (0, _utils.assertValueType)(\"string\")\n },\n constraint: {\n validate: (0, _utils.assertNodeType)(\"TSType\"),\n optional: true\n },\n default: {\n validate: (0, _utils.assertNodeType)(\"TSType\"),\n optional: true\n }\n }\n});","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.validate = validate;\nexports.typeIs = typeIs;\nexports.validateType = validateType;\nexports.validateOptional = validateOptional;\nexports.validateOptionalType = validateOptionalType;\nexports.arrayOf = arrayOf;\nexports.arrayOfType = arrayOfType;\nexports.validateArrayOfType = validateArrayOfType;\nexports.assertEach = assertEach;\nexports.assertOneOf = assertOneOf;\nexports.assertNodeType = assertNodeType;\nexports.assertNodeOrValueType = assertNodeOrValueType;\nexports.assertValueType = assertValueType;\nexports.assertShape = assertShape;\nexports.assertOptionalChainStart = assertOptionalChainStart;\nexports.chain = chain;\nexports.default = defineType;\nexports.NODE_PARENT_VALIDATIONS = exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.FLIPPED_ALIAS_KEYS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = void 0;\n\nvar _is = _interopRequireDefault(require(\"../validators/is\"));\n\nvar _validate = require(\"../validators/validate\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst VISITOR_KEYS = {};\nexports.VISITOR_KEYS = VISITOR_KEYS;\nconst ALIAS_KEYS = {};\nexports.ALIAS_KEYS = ALIAS_KEYS;\nconst FLIPPED_ALIAS_KEYS = {};\nexports.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS;\nconst NODE_FIELDS = {};\nexports.NODE_FIELDS = NODE_FIELDS;\nconst BUILDER_KEYS = {};\nexports.BUILDER_KEYS = BUILDER_KEYS;\nconst DEPRECATED_KEYS = {};\nexports.DEPRECATED_KEYS = DEPRECATED_KEYS;\nconst NODE_PARENT_VALIDATIONS = {};\nexports.NODE_PARENT_VALIDATIONS = NODE_PARENT_VALIDATIONS;\n\nfunction getType(val) {\n if (Array.isArray(val)) {\n return \"array\";\n } else if (val === null) {\n return \"null\";\n } else {\n return typeof val;\n }\n}\n\nfunction validate(validate) {\n return {\n validate\n };\n}\n\nfunction typeIs(typeName) {\n return typeof typeName === \"string\" ? assertNodeType(typeName) : assertNodeType(...typeName);\n}\n\nfunction validateType(typeName) {\n return validate(typeIs(typeName));\n}\n\nfunction validateOptional(validate) {\n return {\n validate,\n optional: true\n };\n}\n\nfunction validateOptionalType(typeName) {\n return {\n validate: typeIs(typeName),\n optional: true\n };\n}\n\nfunction arrayOf(elementType) {\n return chain(assertValueType(\"array\"), assertEach(elementType));\n}\n\nfunction arrayOfType(typeName) {\n return arrayOf(typeIs(typeName));\n}\n\nfunction validateArrayOfType(typeName) {\n return validate(arrayOfType(typeName));\n}\n\nfunction assertEach(callback) {\n function validator(node, key, val) {\n if (!Array.isArray(val)) return;\n\n for (let i = 0; i < val.length; i++) {\n const subkey = `${key}[${i}]`;\n const v = val[i];\n callback(node, subkey, v);\n if (process.env.BABEL_TYPES_8_BREAKING) (0, _validate.validateChild)(node, subkey, v);\n }\n }\n\n validator.each = callback;\n return validator;\n}\n\nfunction assertOneOf(...values) {\n function validate(node, key, val) {\n if (values.indexOf(val) < 0) {\n throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`);\n }\n }\n\n validate.oneOf = values;\n return validate;\n}\n\nfunction assertNodeType(...types) {\n function validate(node, key, val) {\n for (const type of types) {\n if ((0, _is.default)(type, val)) {\n (0, _validate.validateChild)(node, key, val);\n return;\n }\n }\n\n throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);\n }\n\n validate.oneOfNodeTypes = types;\n return validate;\n}\n\nfunction assertNodeOrValueType(...types) {\n function validate(node, key, val) {\n for (const type of types) {\n if (getType(val) === type || (0, _is.default)(type, val)) {\n (0, _validate.validateChild)(node, key, val);\n return;\n }\n }\n\n throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);\n }\n\n validate.oneOfNodeOrValueTypes = types;\n return validate;\n}\n\nfunction assertValueType(type) {\n function validate(node, key, val) {\n const valid = getType(val) === type;\n\n if (!valid) {\n throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`);\n }\n }\n\n validate.type = type;\n return validate;\n}\n\nfunction assertShape(shape) {\n function validate(node, key, val) {\n const errors = [];\n\n for (const property of Object.keys(shape)) {\n try {\n (0, _validate.validateField)(node, property, val[property], shape[property]);\n } catch (error) {\n if (error instanceof TypeError) {\n errors.push(error.message);\n continue;\n }\n\n throw error;\n }\n }\n\n if (errors.length) {\n throw new TypeError(`Property ${key} of ${node.type} expected to have the following:\\n${errors.join(\"\\n\")}`);\n }\n }\n\n validate.shapeOf = shape;\n return validate;\n}\n\nfunction assertOptionalChainStart() {\n function validate(node) {\n var _current;\n\n let current = node;\n\n while (node) {\n const {\n type\n } = current;\n\n if (type === \"OptionalCallExpression\") {\n if (current.optional) return;\n current = current.callee;\n continue;\n }\n\n if (type === \"OptionalMemberExpression\") {\n if (current.optional) return;\n current = current.object;\n continue;\n }\n\n break;\n }\n\n throw new TypeError(`Non-optional ${node.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${(_current = current) == null ? void 0 : _current.type}`);\n }\n\n return validate;\n}\n\nfunction chain(...fns) {\n function validate(...args) {\n for (const fn of fns) {\n fn(...args);\n }\n }\n\n validate.chainOf = fns;\n return validate;\n}\n\nconst validTypeOpts = [\"aliases\", \"builder\", \"deprecatedAlias\", \"fields\", \"inherits\", \"visitor\", \"validate\"];\nconst validFieldKeys = [\"default\", \"optional\", \"validate\"];\n\nfunction defineType(type, opts = {}) {\n const inherits = opts.inherits && store[opts.inherits] || {};\n let fields = opts.fields;\n\n if (!fields) {\n fields = {};\n\n if (inherits.fields) {\n const keys = Object.getOwnPropertyNames(inherits.fields);\n\n for (const key of keys) {\n const field = inherits.fields[key];\n fields[key] = {\n default: field.default,\n optional: field.optional,\n validate: field.validate\n };\n }\n }\n }\n\n const visitor = opts.visitor || inherits.visitor || [];\n const aliases = opts.aliases || inherits.aliases || [];\n const builder = opts.builder || inherits.builder || opts.visitor || [];\n\n for (const k of Object.keys(opts)) {\n if (validTypeOpts.indexOf(k) === -1) {\n throw new Error(`Unknown type option \"${k}\" on ${type}`);\n }\n }\n\n if (opts.deprecatedAlias) {\n DEPRECATED_KEYS[opts.deprecatedAlias] = type;\n }\n\n for (const key of visitor.concat(builder)) {\n fields[key] = fields[key] || {};\n }\n\n for (const key of Object.keys(fields)) {\n const field = fields[key];\n\n if (field.default !== undefined && builder.indexOf(key) === -1) {\n field.optional = true;\n }\n\n if (field.default === undefined) {\n field.default = null;\n } else if (!field.validate && field.default != null) {\n field.validate = assertValueType(getType(field.default));\n }\n\n for (const k of Object.keys(field)) {\n if (validFieldKeys.indexOf(k) === -1) {\n throw new Error(`Unknown field key \"${k}\" on ${type}.${key}`);\n }\n }\n }\n\n VISITOR_KEYS[type] = opts.visitor = visitor;\n BUILDER_KEYS[type] = opts.builder = builder;\n NODE_FIELDS[type] = opts.fields = fields;\n ALIAS_KEYS[type] = opts.aliases = aliases;\n aliases.forEach(alias => {\n FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];\n FLIPPED_ALIAS_KEYS[alias].push(type);\n });\n\n if (opts.validate) {\n NODE_PARENT_VALIDATIONS[type] = opts.validate;\n }\n\n store[type] = opts;\n}\n\nconst store = {};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {\n react: true,\n assertNode: true,\n createTypeAnnotationBasedOnTypeof: true,\n createUnionTypeAnnotation: true,\n createFlowUnionType: true,\n createTSUnionType: true,\n cloneNode: true,\n clone: true,\n cloneDeep: true,\n cloneDeepWithoutLoc: true,\n cloneWithoutLoc: true,\n addComment: true,\n addComments: true,\n inheritInnerComments: true,\n inheritLeadingComments: true,\n inheritsComments: true,\n inheritTrailingComments: true,\n removeComments: true,\n ensureBlock: true,\n toBindingIdentifierName: true,\n toBlock: true,\n toComputedKey: true,\n toExpression: true,\n toIdentifier: true,\n toKeyAlias: true,\n toSequenceExpression: true,\n toStatement: true,\n valueToNode: true,\n appendToMemberExpression: true,\n inherits: true,\n prependToMemberExpression: true,\n removeProperties: true,\n removePropertiesDeep: true,\n removeTypeDuplicates: true,\n getBindingIdentifiers: true,\n getOuterBindingIdentifiers: true,\n traverse: true,\n traverseFast: true,\n shallowEqual: true,\n is: true,\n isBinding: true,\n isBlockScoped: true,\n isImmutable: true,\n isLet: true,\n isNode: true,\n isNodesEquivalent: true,\n isPlaceholderType: true,\n isReferenced: true,\n isScope: true,\n isSpecifierDefault: true,\n isType: true,\n isValidES3Identifier: true,\n isValidIdentifier: true,\n isVar: true,\n matchesPattern: true,\n validate: true,\n buildMatchMemberExpression: true\n};\nObject.defineProperty(exports, \"assertNode\", {\n enumerable: true,\n get: function () {\n return _assertNode.default;\n }\n});\nObject.defineProperty(exports, \"createTypeAnnotationBasedOnTypeof\", {\n enumerable: true,\n get: function () {\n return _createTypeAnnotationBasedOnTypeof.default;\n }\n});\nObject.defineProperty(exports, \"createUnionTypeAnnotation\", {\n enumerable: true,\n get: function () {\n return _createFlowUnionType.default;\n }\n});\nObject.defineProperty(exports, \"createFlowUnionType\", {\n enumerable: true,\n get: function () {\n return _createFlowUnionType.default;\n }\n});\nObject.defineProperty(exports, \"createTSUnionType\", {\n enumerable: true,\n get: function () {\n return _createTSUnionType.default;\n }\n});\nObject.defineProperty(exports, \"cloneNode\", {\n enumerable: true,\n get: function () {\n return _cloneNode.default;\n }\n});\nObject.defineProperty(exports, \"clone\", {\n enumerable: true,\n get: function () {\n return _clone.default;\n }\n});\nObject.defineProperty(exports, \"cloneDeep\", {\n enumerable: true,\n get: function () {\n return _cloneDeep.default;\n }\n});\nObject.defineProperty(exports, \"cloneDeepWithoutLoc\", {\n enumerable: true,\n get: function () {\n return _cloneDeepWithoutLoc.default;\n }\n});\nObject.defineProperty(exports, \"cloneWithoutLoc\", {\n enumerable: true,\n get: function () {\n return _cloneWithoutLoc.default;\n }\n});\nObject.defineProperty(exports, \"addComment\", {\n enumerable: true,\n get: function () {\n return _addComment.default;\n }\n});\nObject.defineProperty(exports, \"addComments\", {\n enumerable: true,\n get: function () {\n return _addComments.default;\n }\n});\nObject.defineProperty(exports, \"inheritInnerComments\", {\n enumerable: true,\n get: function () {\n return _inheritInnerComments.default;\n }\n});\nObject.defineProperty(exports, \"inheritLeadingComments\", {\n enumerable: true,\n get: function () {\n return _inheritLeadingComments.default;\n }\n});\nObject.defineProperty(exports, \"inheritsComments\", {\n enumerable: true,\n get: function () {\n return _inheritsComments.default;\n }\n});\nObject.defineProperty(exports, \"inheritTrailingComments\", {\n enumerable: true,\n get: function () {\n return _inheritTrailingComments.default;\n }\n});\nObject.defineProperty(exports, \"removeComments\", {\n enumerable: true,\n get: function () {\n return _removeComments.default;\n }\n});\nObject.defineProperty(exports, \"ensureBlock\", {\n enumerable: true,\n get: function () {\n return _ensureBlock.default;\n }\n});\nObject.defineProperty(exports, \"toBindingIdentifierName\", {\n enumerable: true,\n get: function () {\n return _toBindingIdentifierName.default;\n }\n});\nObject.defineProperty(exports, \"toBlock\", {\n enumerable: true,\n get: function () {\n return _toBlock.default;\n }\n});\nObject.defineProperty(exports, \"toComputedKey\", {\n enumerable: true,\n get: function () {\n return _toComputedKey.default;\n }\n});\nObject.defineProperty(exports, \"toExpression\", {\n enumerable: true,\n get: function () {\n return _toExpression.default;\n }\n});\nObject.defineProperty(exports, \"toIdentifier\", {\n enumerable: true,\n get: function () {\n return _toIdentifier.default;\n }\n});\nObject.defineProperty(exports, \"toKeyAlias\", {\n enumerable: true,\n get: function () {\n return _toKeyAlias.default;\n }\n});\nObject.defineProperty(exports, \"toSequenceExpression\", {\n enumerable: true,\n get: function () {\n return _toSequenceExpression.default;\n }\n});\nObject.defineProperty(exports, \"toStatement\", {\n enumerable: true,\n get: function () {\n return _toStatement.default;\n }\n});\nObject.defineProperty(exports, \"valueToNode\", {\n enumerable: true,\n get: function () {\n return _valueToNode.default;\n }\n});\nObject.defineProperty(exports, \"appendToMemberExpression\", {\n enumerable: true,\n get: function () {\n return _appendToMemberExpression.default;\n }\n});\nObject.defineProperty(exports, \"inherits\", {\n enumerable: true,\n get: function () {\n return _inherits.default;\n }\n});\nObject.defineProperty(exports, \"prependToMemberExpression\", {\n enumerable: true,\n get: function () {\n return _prependToMemberExpression.default;\n }\n});\nObject.defineProperty(exports, \"removeProperties\", {\n enumerable: true,\n get: function () {\n return _removeProperties.default;\n }\n});\nObject.defineProperty(exports, \"removePropertiesDeep\", {\n enumerable: true,\n get: function () {\n return _removePropertiesDeep.default;\n }\n});\nObject.defineProperty(exports, \"removeTypeDuplicates\", {\n enumerable: true,\n get: function () {\n return _removeTypeDuplicates.default;\n }\n});\nObject.defineProperty(exports, \"getBindingIdentifiers\", {\n enumerable: true,\n get: function () {\n return _getBindingIdentifiers.default;\n }\n});\nObject.defineProperty(exports, \"getOuterBindingIdentifiers\", {\n enumerable: true,\n get: function () {\n return _getOuterBindingIdentifiers.default;\n }\n});\nObject.defineProperty(exports, \"traverse\", {\n enumerable: true,\n get: function () {\n return _traverse.default;\n }\n});\nObject.defineProperty(exports, \"traverseFast\", {\n enumerable: true,\n get: function () {\n return _traverseFast.default;\n }\n});\nObject.defineProperty(exports, \"shallowEqual\", {\n enumerable: true,\n get: function () {\n return _shallowEqual.default;\n }\n});\nObject.defineProperty(exports, \"is\", {\n enumerable: true,\n get: function () {\n return _is.default;\n }\n});\nObject.defineProperty(exports, \"isBinding\", {\n enumerable: true,\n get: function () {\n return _isBinding.default;\n }\n});\nObject.defineProperty(exports, \"isBlockScoped\", {\n enumerable: true,\n get: function () {\n return _isBlockScoped.default;\n }\n});\nObject.defineProperty(exports, \"isImmutable\", {\n enumerable: true,\n get: function () {\n return _isImmutable.default;\n }\n});\nObject.defineProperty(exports, \"isLet\", {\n enumerable: true,\n get: function () {\n return _isLet.default;\n }\n});\nObject.defineProperty(exports, \"isNode\", {\n enumerable: true,\n get: function () {\n return _isNode.default;\n }\n});\nObject.defineProperty(exports, \"isNodesEquivalent\", {\n enumerable: true,\n get: function () {\n return _isNodesEquivalent.default;\n }\n});\nObject.defineProperty(exports, \"isPlaceholderType\", {\n enumerable: true,\n get: function () {\n return _isPlaceholderType.default;\n }\n});\nObject.defineProperty(exports, \"isReferenced\", {\n enumerable: true,\n get: function () {\n return _isReferenced.default;\n }\n});\nObject.defineProperty(exports, \"isScope\", {\n enumerable: true,\n get: function () {\n return _isScope.default;\n }\n});\nObject.defineProperty(exports, \"isSpecifierDefault\", {\n enumerable: true,\n get: function () {\n return _isSpecifierDefault.default;\n }\n});\nObject.defineProperty(exports, \"isType\", {\n enumerable: true,\n get: function () {\n return _isType.default;\n }\n});\nObject.defineProperty(exports, \"isValidES3Identifier\", {\n enumerable: true,\n get: function () {\n return _isValidES3Identifier.default;\n }\n});\nObject.defineProperty(exports, \"isValidIdentifier\", {\n enumerable: true,\n get: function () {\n return _isValidIdentifier.default;\n }\n});\nObject.defineProperty(exports, \"isVar\", {\n enumerable: true,\n get: function () {\n return _isVar.default;\n }\n});\nObject.defineProperty(exports, \"matchesPattern\", {\n enumerable: true,\n get: function () {\n return _matchesPattern.default;\n }\n});\nObject.defineProperty(exports, \"validate\", {\n enumerable: true,\n get: function () {\n return _validate.default;\n }\n});\nObject.defineProperty(exports, \"buildMatchMemberExpression\", {\n enumerable: true,\n get: function () {\n return _buildMatchMemberExpression.default;\n }\n});\nexports.react = void 0;\n\nvar _isReactComponent = _interopRequireDefault(require(\"./validators/react/isReactComponent\"));\n\nvar _isCompatTag = _interopRequireDefault(require(\"./validators/react/isCompatTag\"));\n\nvar _buildChildren = _interopRequireDefault(require(\"./builders/react/buildChildren\"));\n\nvar _assertNode = _interopRequireDefault(require(\"./asserts/assertNode\"));\n\nvar _generated = require(\"./asserts/generated\");\n\nObject.keys(_generated).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _generated[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _generated[key];\n }\n });\n});\n\nvar _createTypeAnnotationBasedOnTypeof = _interopRequireDefault(require(\"./builders/flow/createTypeAnnotationBasedOnTypeof\"));\n\nvar _createFlowUnionType = _interopRequireDefault(require(\"./builders/flow/createFlowUnionType\"));\n\nvar _createTSUnionType = _interopRequireDefault(require(\"./builders/typescript/createTSUnionType\"));\n\nvar _generated2 = require(\"./builders/generated\");\n\nObject.keys(_generated2).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _generated2[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _generated2[key];\n }\n });\n});\n\nvar _cloneNode = _interopRequireDefault(require(\"./clone/cloneNode\"));\n\nvar _clone = _interopRequireDefault(require(\"./clone/clone\"));\n\nvar _cloneDeep = _interopRequireDefault(require(\"./clone/cloneDeep\"));\n\nvar _cloneDeepWithoutLoc = _interopRequireDefault(require(\"./clone/cloneDeepWithoutLoc\"));\n\nvar _cloneWithoutLoc = _interopRequireDefault(require(\"./clone/cloneWithoutLoc\"));\n\nvar _addComment = _interopRequireDefault(require(\"./comments/addComment\"));\n\nvar _addComments = _interopRequireDefault(require(\"./comments/addComments\"));\n\nvar _inheritInnerComments = _interopRequireDefault(require(\"./comments/inheritInnerComments\"));\n\nvar _inheritLeadingComments = _interopRequireDefault(require(\"./comments/inheritLeadingComments\"));\n\nvar _inheritsComments = _interopRequireDefault(require(\"./comments/inheritsComments\"));\n\nvar _inheritTrailingComments = _interopRequireDefault(require(\"./comments/inheritTrailingComments\"));\n\nvar _removeComments = _interopRequireDefault(require(\"./comments/removeComments\"));\n\nvar _generated3 = require(\"./constants/generated\");\n\nObject.keys(_generated3).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _generated3[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _generated3[key];\n }\n });\n});\n\nvar _constants = require(\"./constants\");\n\nObject.keys(_constants).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _constants[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _constants[key];\n }\n });\n});\n\nvar _ensureBlock = _interopRequireDefault(require(\"./converters/ensureBlock\"));\n\nvar _toBindingIdentifierName = _interopRequireDefault(require(\"./converters/toBindingIdentifierName\"));\n\nvar _toBlock = _interopRequireDefault(require(\"./converters/toBlock\"));\n\nvar _toComputedKey = _interopRequireDefault(require(\"./converters/toComputedKey\"));\n\nvar _toExpression = _interopRequireDefault(require(\"./converters/toExpression\"));\n\nvar _toIdentifier = _interopRequireDefault(require(\"./converters/toIdentifier\"));\n\nvar _toKeyAlias = _interopRequireDefault(require(\"./converters/toKeyAlias\"));\n\nvar _toSequenceExpression = _interopRequireDefault(require(\"./converters/toSequenceExpression\"));\n\nvar _toStatement = _interopRequireDefault(require(\"./converters/toStatement\"));\n\nvar _valueToNode = _interopRequireDefault(require(\"./converters/valueToNode\"));\n\nvar _definitions = require(\"./definitions\");\n\nObject.keys(_definitions).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _definitions[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _definitions[key];\n }\n });\n});\n\nvar _appendToMemberExpression = _interopRequireDefault(require(\"./modifications/appendToMemberExpression\"));\n\nvar _inherits = _interopRequireDefault(require(\"./modifications/inherits\"));\n\nvar _prependToMemberExpression = _interopRequireDefault(require(\"./modifications/prependToMemberExpression\"));\n\nvar _removeProperties = _interopRequireDefault(require(\"./modifications/removeProperties\"));\n\nvar _removePropertiesDeep = _interopRequireDefault(require(\"./modifications/removePropertiesDeep\"));\n\nvar _removeTypeDuplicates = _interopRequireDefault(require(\"./modifications/flow/removeTypeDuplicates\"));\n\nvar _getBindingIdentifiers = _interopRequireDefault(require(\"./retrievers/getBindingIdentifiers\"));\n\nvar _getOuterBindingIdentifiers = _interopRequireDefault(require(\"./retrievers/getOuterBindingIdentifiers\"));\n\nvar _traverse = _interopRequireDefault(require(\"./traverse/traverse\"));\n\nvar _traverseFast = _interopRequireDefault(require(\"./traverse/traverseFast\"));\n\nvar _shallowEqual = _interopRequireDefault(require(\"./utils/shallowEqual\"));\n\nvar _is = _interopRequireDefault(require(\"./validators/is\"));\n\nvar _isBinding = _interopRequireDefault(require(\"./validators/isBinding\"));\n\nvar _isBlockScoped = _interopRequireDefault(require(\"./validators/isBlockScoped\"));\n\nvar _isImmutable = _interopRequireDefault(require(\"./validators/isImmutable\"));\n\nvar _isLet = _interopRequireDefault(require(\"./validators/isLet\"));\n\nvar _isNode = _interopRequireDefault(require(\"./validators/isNode\"));\n\nvar _isNodesEquivalent = _interopRequireDefault(require(\"./validators/isNodesEquivalent\"));\n\nvar _isPlaceholderType = _interopRequireDefault(require(\"./validators/isPlaceholderType\"));\n\nvar _isReferenced = _interopRequireDefault(require(\"./validators/isReferenced\"));\n\nvar _isScope = _interopRequireDefault(require(\"./validators/isScope\"));\n\nvar _isSpecifierDefault = _interopRequireDefault(require(\"./validators/isSpecifierDefault\"));\n\nvar _isType = _interopRequireDefault(require(\"./validators/isType\"));\n\nvar _isValidES3Identifier = _interopRequireDefault(require(\"./validators/isValidES3Identifier\"));\n\nvar _isValidIdentifier = _interopRequireDefault(require(\"./validators/isValidIdentifier\"));\n\nvar _isVar = _interopRequireDefault(require(\"./validators/isVar\"));\n\nvar _matchesPattern = _interopRequireDefault(require(\"./validators/matchesPattern\"));\n\nvar _validate = _interopRequireDefault(require(\"./validators/validate\"));\n\nvar _buildMatchMemberExpression = _interopRequireDefault(require(\"./validators/buildMatchMemberExpression\"));\n\nvar _generated4 = require(\"./validators/generated\");\n\nObject.keys(_generated4).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _generated4[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _generated4[key];\n }\n });\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst react = {\n isReactComponent: _isReactComponent.default,\n isCompatTag: _isCompatTag.default,\n buildChildren: _buildChildren.default\n};\nexports.react = react;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = appendToMemberExpression;\n\nvar _generated = require(\"../builders/generated\");\n\nfunction appendToMemberExpression(member, append, computed = false) {\n member.object = (0, _generated.memberExpression)(member.object, member.property, member.computed);\n member.property = append;\n member.computed = !!computed;\n return member;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = removeTypeDuplicates;\n\nvar _generated = require(\"../../validators/generated\");\n\nfunction removeTypeDuplicates(nodes) {\n const generics = {};\n const bases = {};\n const typeGroups = [];\n const types = [];\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (!node) continue;\n\n if (types.indexOf(node) >= 0) {\n continue;\n }\n\n if ((0, _generated.isAnyTypeAnnotation)(node)) {\n return [node];\n }\n\n if ((0, _generated.isFlowBaseAnnotation)(node)) {\n bases[node.type] = node;\n continue;\n }\n\n if ((0, _generated.isUnionTypeAnnotation)(node)) {\n if (typeGroups.indexOf(node.types) < 0) {\n nodes = nodes.concat(node.types);\n typeGroups.push(node.types);\n }\n\n continue;\n }\n\n if ((0, _generated.isGenericTypeAnnotation)(node)) {\n const name = node.id.name;\n\n if (generics[name]) {\n let existing = generics[name];\n\n if (existing.typeParameters) {\n if (node.typeParameters) {\n existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params));\n }\n } else {\n existing = node.typeParameters;\n }\n } else {\n generics[name] = node;\n }\n\n continue;\n }\n\n types.push(node);\n }\n\n for (const type of Object.keys(bases)) {\n types.push(bases[type]);\n }\n\n for (const name of Object.keys(generics)) {\n types.push(generics[name]);\n }\n\n return types;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = inherits;\n\nvar _constants = require(\"../constants\");\n\nvar _inheritsComments = _interopRequireDefault(require(\"../comments/inheritsComments\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction inherits(child, parent) {\n if (!child || !parent) return child;\n\n for (const key of _constants.INHERIT_KEYS.optional) {\n if (child[key] == null) {\n child[key] = parent[key];\n }\n }\n\n for (const key of Object.keys(parent)) {\n if (key[0] === \"_\" && key !== \"__clone\") child[key] = parent[key];\n }\n\n for (const key of _constants.INHERIT_KEYS.force) {\n child[key] = parent[key];\n }\n\n (0, _inheritsComments.default)(child, parent);\n return child;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = prependToMemberExpression;\n\nvar _generated = require(\"../builders/generated\");\n\nfunction prependToMemberExpression(member, prepend) {\n member.object = (0, _generated.memberExpression)(prepend, member.object);\n return member;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = removeProperties;\n\nvar _constants = require(\"../constants\");\n\nconst CLEAR_KEYS = [\"tokens\", \"start\", \"end\", \"loc\", \"raw\", \"rawValue\"];\n\nconst CLEAR_KEYS_PLUS_COMMENTS = _constants.COMMENT_KEYS.concat([\"comments\"]).concat(CLEAR_KEYS);\n\nfunction removeProperties(node, opts = {}) {\n const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;\n\n for (const key of map) {\n if (node[key] != null) node[key] = undefined;\n }\n\n for (const key of Object.keys(node)) {\n if (key[0] === \"_\" && node[key] != null) node[key] = undefined;\n }\n\n const symbols = Object.getOwnPropertySymbols(node);\n\n for (const sym of symbols) {\n node[sym] = null;\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = removePropertiesDeep;\n\nvar _traverseFast = _interopRequireDefault(require(\"../traverse/traverseFast\"));\n\nvar _removeProperties = _interopRequireDefault(require(\"./removeProperties\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction removePropertiesDeep(tree, opts) {\n (0, _traverseFast.default)(tree, _removeProperties.default, opts);\n return tree;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = removeTypeDuplicates;\n\nvar _generated = require(\"../../validators/generated\");\n\nfunction removeTypeDuplicates(nodes) {\n const generics = {};\n const bases = {};\n const typeGroups = [];\n const types = [];\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (!node) continue;\n\n if (types.indexOf(node) >= 0) {\n continue;\n }\n\n if ((0, _generated.isTSAnyKeyword)(node.type)) {\n return [node];\n }\n\n if ((0, _generated.isTSBaseType)(node)) {\n bases[node.type] = node;\n continue;\n }\n\n if ((0, _generated.isTSUnionType)(node)) {\n if (typeGroups.indexOf(node.types) < 0) {\n nodes = nodes.concat(node.types);\n typeGroups.push(node.types);\n }\n\n continue;\n }\n\n types.push(node);\n }\n\n for (const type of Object.keys(bases)) {\n types.push(bases[type]);\n }\n\n for (const name of Object.keys(generics)) {\n types.push(generics[name]);\n }\n\n return types;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getBindingIdentifiers;\n\nvar _generated = require(\"../validators/generated\");\n\nfunction getBindingIdentifiers(node, duplicates, outerOnly) {\n let search = [].concat(node);\n const ids = Object.create(null);\n\n while (search.length) {\n const id = search.shift();\n if (!id) continue;\n const keys = getBindingIdentifiers.keys[id.type];\n\n if ((0, _generated.isIdentifier)(id)) {\n if (duplicates) {\n const _ids = ids[id.name] = ids[id.name] || [];\n\n _ids.push(id);\n } else {\n ids[id.name] = id;\n }\n\n continue;\n }\n\n if ((0, _generated.isExportDeclaration)(id)) {\n if ((0, _generated.isDeclaration)(id.declaration)) {\n search.push(id.declaration);\n }\n\n continue;\n }\n\n if (outerOnly) {\n if ((0, _generated.isFunctionDeclaration)(id)) {\n search.push(id.id);\n continue;\n }\n\n if ((0, _generated.isFunctionExpression)(id)) {\n continue;\n }\n }\n\n if (keys) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n\n if (id[key]) {\n search = search.concat(id[key]);\n }\n }\n }\n }\n\n return ids;\n}\n\ngetBindingIdentifiers.keys = {\n DeclareClass: [\"id\"],\n DeclareFunction: [\"id\"],\n DeclareModule: [\"id\"],\n DeclareVariable: [\"id\"],\n DeclareInterface: [\"id\"],\n DeclareTypeAlias: [\"id\"],\n DeclareOpaqueType: [\"id\"],\n InterfaceDeclaration: [\"id\"],\n TypeAlias: [\"id\"],\n OpaqueType: [\"id\"],\n CatchClause: [\"param\"],\n LabeledStatement: [\"label\"],\n UnaryExpression: [\"argument\"],\n AssignmentExpression: [\"left\"],\n ImportSpecifier: [\"local\"],\n ImportNamespaceSpecifier: [\"local\"],\n ImportDefaultSpecifier: [\"local\"],\n ImportDeclaration: [\"specifiers\"],\n ExportSpecifier: [\"exported\"],\n ExportNamespaceSpecifier: [\"exported\"],\n ExportDefaultSpecifier: [\"exported\"],\n FunctionDeclaration: [\"id\", \"params\"],\n FunctionExpression: [\"id\", \"params\"],\n ArrowFunctionExpression: [\"params\"],\n ObjectMethod: [\"params\"],\n ClassMethod: [\"params\"],\n ForInStatement: [\"left\"],\n ForOfStatement: [\"left\"],\n ClassDeclaration: [\"id\"],\n ClassExpression: [\"id\"],\n RestElement: [\"argument\"],\n UpdateExpression: [\"argument\"],\n ObjectProperty: [\"value\"],\n AssignmentPattern: [\"left\"],\n ArrayPattern: [\"elements\"],\n ObjectPattern: [\"properties\"],\n VariableDeclaration: [\"declarations\"],\n VariableDeclarator: [\"id\"]\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getOuterBindingIdentifiers;\n\nvar _getBindingIdentifiers = _interopRequireDefault(require(\"./getBindingIdentifiers\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getOuterBindingIdentifiers(node, duplicates) {\n return (0, _getBindingIdentifiers.default)(node, duplicates, true);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = traverse;\n\nvar _definitions = require(\"../definitions\");\n\nfunction traverse(node, handlers, state) {\n if (typeof handlers === \"function\") {\n handlers = {\n enter: handlers\n };\n }\n\n const {\n enter,\n exit\n } = handlers;\n traverseSimpleImpl(node, enter, exit, state, []);\n}\n\nfunction traverseSimpleImpl(node, enter, exit, state, ancestors) {\n const keys = _definitions.VISITOR_KEYS[node.type];\n if (!keys) return;\n if (enter) enter(node, ancestors, state);\n\n for (const key of keys) {\n const subNode = node[key];\n\n if (Array.isArray(subNode)) {\n for (let i = 0; i < subNode.length; i++) {\n const child = subNode[i];\n if (!child) continue;\n ancestors.push({\n node,\n key,\n index: i\n });\n traverseSimpleImpl(child, enter, exit, state, ancestors);\n ancestors.pop();\n }\n } else if (subNode) {\n ancestors.push({\n node,\n key\n });\n traverseSimpleImpl(subNode, enter, exit, state, ancestors);\n ancestors.pop();\n }\n }\n\n if (exit) exit(node, ancestors, state);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = traverseFast;\n\nvar _definitions = require(\"../definitions\");\n\nfunction traverseFast(node, enter, opts) {\n if (!node) return;\n const keys = _definitions.VISITOR_KEYS[node.type];\n if (!keys) return;\n opts = opts || {};\n enter(node, opts);\n\n for (const key of keys) {\n const subNode = node[key];\n\n if (Array.isArray(subNode)) {\n for (const node of subNode) {\n traverseFast(node, enter, opts);\n }\n } else {\n traverseFast(subNode, enter, opts);\n }\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = inherit;\n\nfunction inherit(key, child, parent) {\n if (child && parent) {\n child[key] = Array.from(new Set([].concat(child[key], parent[key]).filter(Boolean)));\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = cleanJSXElementLiteralChild;\n\nvar _generated = require(\"../../builders/generated\");\n\nfunction cleanJSXElementLiteralChild(child, args) {\n const lines = child.value.split(/\\r\\n|\\n|\\r/);\n let lastNonEmptyLine = 0;\n\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].match(/[^ \\t]/)) {\n lastNonEmptyLine = i;\n }\n }\n\n let str = \"\";\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n const isFirstLine = i === 0;\n const isLastLine = i === lines.length - 1;\n const isLastNonEmptyLine = i === lastNonEmptyLine;\n let trimmedLine = line.replace(/\\t/g, \" \");\n\n if (!isFirstLine) {\n trimmedLine = trimmedLine.replace(/^[ ]+/, \"\");\n }\n\n if (!isLastLine) {\n trimmedLine = trimmedLine.replace(/[ ]+$/, \"\");\n }\n\n if (trimmedLine) {\n if (!isLastNonEmptyLine) {\n trimmedLine += \" \";\n }\n\n str += trimmedLine;\n }\n }\n\n if (str) args.push((0, _generated.stringLiteral)(str));\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = shallowEqual;\n\nfunction shallowEqual(actual, expected) {\n const keys = Object.keys(expected);\n\n for (const key of keys) {\n if (actual[key] !== expected[key]) {\n return false;\n }\n }\n\n return true;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = buildMatchMemberExpression;\n\nvar _matchesPattern = _interopRequireDefault(require(\"./matchesPattern\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction buildMatchMemberExpression(match, allowPartial) {\n const parts = match.split(\".\");\n return member => (0, _matchesPattern.default)(member, parts, allowPartial);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isArrayExpression = isArrayExpression;\nexports.isAssignmentExpression = isAssignmentExpression;\nexports.isBinaryExpression = isBinaryExpression;\nexports.isInterpreterDirective = isInterpreterDirective;\nexports.isDirective = isDirective;\nexports.isDirectiveLiteral = isDirectiveLiteral;\nexports.isBlockStatement = isBlockStatement;\nexports.isBreakStatement = isBreakStatement;\nexports.isCallExpression = isCallExpression;\nexports.isCatchClause = isCatchClause;\nexports.isConditionalExpression = isConditionalExpression;\nexports.isContinueStatement = isContinueStatement;\nexports.isDebuggerStatement = isDebuggerStatement;\nexports.isDoWhileStatement = isDoWhileStatement;\nexports.isEmptyStatement = isEmptyStatement;\nexports.isExpressionStatement = isExpressionStatement;\nexports.isFile = isFile;\nexports.isForInStatement = isForInStatement;\nexports.isForStatement = isForStatement;\nexports.isFunctionDeclaration = isFunctionDeclaration;\nexports.isFunctionExpression = isFunctionExpression;\nexports.isIdentifier = isIdentifier;\nexports.isIfStatement = isIfStatement;\nexports.isLabeledStatement = isLabeledStatement;\nexports.isStringLiteral = isStringLiteral;\nexports.isNumericLiteral = isNumericLiteral;\nexports.isNullLiteral = isNullLiteral;\nexports.isBooleanLiteral = isBooleanLiteral;\nexports.isRegExpLiteral = isRegExpLiteral;\nexports.isLogicalExpression = isLogicalExpression;\nexports.isMemberExpression = isMemberExpression;\nexports.isNewExpression = isNewExpression;\nexports.isProgram = isProgram;\nexports.isObjectExpression = isObjectExpression;\nexports.isObjectMethod = isObjectMethod;\nexports.isObjectProperty = isObjectProperty;\nexports.isRestElement = isRestElement;\nexports.isReturnStatement = isReturnStatement;\nexports.isSequenceExpression = isSequenceExpression;\nexports.isParenthesizedExpression = isParenthesizedExpression;\nexports.isSwitchCase = isSwitchCase;\nexports.isSwitchStatement = isSwitchStatement;\nexports.isThisExpression = isThisExpression;\nexports.isThrowStatement = isThrowStatement;\nexports.isTryStatement = isTryStatement;\nexports.isUnaryExpression = isUnaryExpression;\nexports.isUpdateExpression = isUpdateExpression;\nexports.isVariableDeclaration = isVariableDeclaration;\nexports.isVariableDeclarator = isVariableDeclarator;\nexports.isWhileStatement = isWhileStatement;\nexports.isWithStatement = isWithStatement;\nexports.isAssignmentPattern = isAssignmentPattern;\nexports.isArrayPattern = isArrayPattern;\nexports.isArrowFunctionExpression = isArrowFunctionExpression;\nexports.isClassBody = isClassBody;\nexports.isClassExpression = isClassExpression;\nexports.isClassDeclaration = isClassDeclaration;\nexports.isExportAllDeclaration = isExportAllDeclaration;\nexports.isExportDefaultDeclaration = isExportDefaultDeclaration;\nexports.isExportNamedDeclaration = isExportNamedDeclaration;\nexports.isExportSpecifier = isExportSpecifier;\nexports.isForOfStatement = isForOfStatement;\nexports.isImportDeclaration = isImportDeclaration;\nexports.isImportDefaultSpecifier = isImportDefaultSpecifier;\nexports.isImportNamespaceSpecifier = isImportNamespaceSpecifier;\nexports.isImportSpecifier = isImportSpecifier;\nexports.isMetaProperty = isMetaProperty;\nexports.isClassMethod = isClassMethod;\nexports.isObjectPattern = isObjectPattern;\nexports.isSpreadElement = isSpreadElement;\nexports.isSuper = isSuper;\nexports.isTaggedTemplateExpression = isTaggedTemplateExpression;\nexports.isTemplateElement = isTemplateElement;\nexports.isTemplateLiteral = isTemplateLiteral;\nexports.isYieldExpression = isYieldExpression;\nexports.isAwaitExpression = isAwaitExpression;\nexports.isImport = isImport;\nexports.isBigIntLiteral = isBigIntLiteral;\nexports.isExportNamespaceSpecifier = isExportNamespaceSpecifier;\nexports.isOptionalMemberExpression = isOptionalMemberExpression;\nexports.isOptionalCallExpression = isOptionalCallExpression;\nexports.isAnyTypeAnnotation = isAnyTypeAnnotation;\nexports.isArrayTypeAnnotation = isArrayTypeAnnotation;\nexports.isBooleanTypeAnnotation = isBooleanTypeAnnotation;\nexports.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation;\nexports.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation;\nexports.isClassImplements = isClassImplements;\nexports.isDeclareClass = isDeclareClass;\nexports.isDeclareFunction = isDeclareFunction;\nexports.isDeclareInterface = isDeclareInterface;\nexports.isDeclareModule = isDeclareModule;\nexports.isDeclareModuleExports = isDeclareModuleExports;\nexports.isDeclareTypeAlias = isDeclareTypeAlias;\nexports.isDeclareOpaqueType = isDeclareOpaqueType;\nexports.isDeclareVariable = isDeclareVariable;\nexports.isDeclareExportDeclaration = isDeclareExportDeclaration;\nexports.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration;\nexports.isDeclaredPredicate = isDeclaredPredicate;\nexports.isExistsTypeAnnotation = isExistsTypeAnnotation;\nexports.isFunctionTypeAnnotation = isFunctionTypeAnnotation;\nexports.isFunctionTypeParam = isFunctionTypeParam;\nexports.isGenericTypeAnnotation = isGenericTypeAnnotation;\nexports.isInferredPredicate = isInferredPredicate;\nexports.isInterfaceExtends = isInterfaceExtends;\nexports.isInterfaceDeclaration = isInterfaceDeclaration;\nexports.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation;\nexports.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation;\nexports.isMixedTypeAnnotation = isMixedTypeAnnotation;\nexports.isEmptyTypeAnnotation = isEmptyTypeAnnotation;\nexports.isNullableTypeAnnotation = isNullableTypeAnnotation;\nexports.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation;\nexports.isNumberTypeAnnotation = isNumberTypeAnnotation;\nexports.isObjectTypeAnnotation = isObjectTypeAnnotation;\nexports.isObjectTypeInternalSlot = isObjectTypeInternalSlot;\nexports.isObjectTypeCallProperty = isObjectTypeCallProperty;\nexports.isObjectTypeIndexer = isObjectTypeIndexer;\nexports.isObjectTypeProperty = isObjectTypeProperty;\nexports.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty;\nexports.isOpaqueType = isOpaqueType;\nexports.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier;\nexports.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation;\nexports.isStringTypeAnnotation = isStringTypeAnnotation;\nexports.isSymbolTypeAnnotation = isSymbolTypeAnnotation;\nexports.isThisTypeAnnotation = isThisTypeAnnotation;\nexports.isTupleTypeAnnotation = isTupleTypeAnnotation;\nexports.isTypeofTypeAnnotation = isTypeofTypeAnnotation;\nexports.isTypeAlias = isTypeAlias;\nexports.isTypeAnnotation = isTypeAnnotation;\nexports.isTypeCastExpression = isTypeCastExpression;\nexports.isTypeParameter = isTypeParameter;\nexports.isTypeParameterDeclaration = isTypeParameterDeclaration;\nexports.isTypeParameterInstantiation = isTypeParameterInstantiation;\nexports.isUnionTypeAnnotation = isUnionTypeAnnotation;\nexports.isVariance = isVariance;\nexports.isVoidTypeAnnotation = isVoidTypeAnnotation;\nexports.isEnumDeclaration = isEnumDeclaration;\nexports.isEnumBooleanBody = isEnumBooleanBody;\nexports.isEnumNumberBody = isEnumNumberBody;\nexports.isEnumStringBody = isEnumStringBody;\nexports.isEnumSymbolBody = isEnumSymbolBody;\nexports.isEnumBooleanMember = isEnumBooleanMember;\nexports.isEnumNumberMember = isEnumNumberMember;\nexports.isEnumStringMember = isEnumStringMember;\nexports.isEnumDefaultedMember = isEnumDefaultedMember;\nexports.isJSXAttribute = isJSXAttribute;\nexports.isJSXClosingElement = isJSXClosingElement;\nexports.isJSXElement = isJSXElement;\nexports.isJSXEmptyExpression = isJSXEmptyExpression;\nexports.isJSXExpressionContainer = isJSXExpressionContainer;\nexports.isJSXSpreadChild = isJSXSpreadChild;\nexports.isJSXIdentifier = isJSXIdentifier;\nexports.isJSXMemberExpression = isJSXMemberExpression;\nexports.isJSXNamespacedName = isJSXNamespacedName;\nexports.isJSXOpeningElement = isJSXOpeningElement;\nexports.isJSXSpreadAttribute = isJSXSpreadAttribute;\nexports.isJSXText = isJSXText;\nexports.isJSXFragment = isJSXFragment;\nexports.isJSXOpeningFragment = isJSXOpeningFragment;\nexports.isJSXClosingFragment = isJSXClosingFragment;\nexports.isNoop = isNoop;\nexports.isPlaceholder = isPlaceholder;\nexports.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier;\nexports.isArgumentPlaceholder = isArgumentPlaceholder;\nexports.isBindExpression = isBindExpression;\nexports.isClassProperty = isClassProperty;\nexports.isPipelineTopicExpression = isPipelineTopicExpression;\nexports.isPipelineBareFunction = isPipelineBareFunction;\nexports.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference;\nexports.isClassPrivateProperty = isClassPrivateProperty;\nexports.isClassPrivateMethod = isClassPrivateMethod;\nexports.isImportAttribute = isImportAttribute;\nexports.isDecorator = isDecorator;\nexports.isDoExpression = isDoExpression;\nexports.isExportDefaultSpecifier = isExportDefaultSpecifier;\nexports.isPrivateName = isPrivateName;\nexports.isRecordExpression = isRecordExpression;\nexports.isTupleExpression = isTupleExpression;\nexports.isDecimalLiteral = isDecimalLiteral;\nexports.isStaticBlock = isStaticBlock;\nexports.isTSParameterProperty = isTSParameterProperty;\nexports.isTSDeclareFunction = isTSDeclareFunction;\nexports.isTSDeclareMethod = isTSDeclareMethod;\nexports.isTSQualifiedName = isTSQualifiedName;\nexports.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration;\nexports.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration;\nexports.isTSPropertySignature = isTSPropertySignature;\nexports.isTSMethodSignature = isTSMethodSignature;\nexports.isTSIndexSignature = isTSIndexSignature;\nexports.isTSAnyKeyword = isTSAnyKeyword;\nexports.isTSBooleanKeyword = isTSBooleanKeyword;\nexports.isTSBigIntKeyword = isTSBigIntKeyword;\nexports.isTSIntrinsicKeyword = isTSIntrinsicKeyword;\nexports.isTSNeverKeyword = isTSNeverKeyword;\nexports.isTSNullKeyword = isTSNullKeyword;\nexports.isTSNumberKeyword = isTSNumberKeyword;\nexports.isTSObjectKeyword = isTSObjectKeyword;\nexports.isTSStringKeyword = isTSStringKeyword;\nexports.isTSSymbolKeyword = isTSSymbolKeyword;\nexports.isTSUndefinedKeyword = isTSUndefinedKeyword;\nexports.isTSUnknownKeyword = isTSUnknownKeyword;\nexports.isTSVoidKeyword = isTSVoidKeyword;\nexports.isTSThisType = isTSThisType;\nexports.isTSFunctionType = isTSFunctionType;\nexports.isTSConstructorType = isTSConstructorType;\nexports.isTSTypeReference = isTSTypeReference;\nexports.isTSTypePredicate = isTSTypePredicate;\nexports.isTSTypeQuery = isTSTypeQuery;\nexports.isTSTypeLiteral = isTSTypeLiteral;\nexports.isTSArrayType = isTSArrayType;\nexports.isTSTupleType = isTSTupleType;\nexports.isTSOptionalType = isTSOptionalType;\nexports.isTSRestType = isTSRestType;\nexports.isTSNamedTupleMember = isTSNamedTupleMember;\nexports.isTSUnionType = isTSUnionType;\nexports.isTSIntersectionType = isTSIntersectionType;\nexports.isTSConditionalType = isTSConditionalType;\nexports.isTSInferType = isTSInferType;\nexports.isTSParenthesizedType = isTSParenthesizedType;\nexports.isTSTypeOperator = isTSTypeOperator;\nexports.isTSIndexedAccessType = isTSIndexedAccessType;\nexports.isTSMappedType = isTSMappedType;\nexports.isTSLiteralType = isTSLiteralType;\nexports.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments;\nexports.isTSInterfaceDeclaration = isTSInterfaceDeclaration;\nexports.isTSInterfaceBody = isTSInterfaceBody;\nexports.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration;\nexports.isTSAsExpression = isTSAsExpression;\nexports.isTSTypeAssertion = isTSTypeAssertion;\nexports.isTSEnumDeclaration = isTSEnumDeclaration;\nexports.isTSEnumMember = isTSEnumMember;\nexports.isTSModuleDeclaration = isTSModuleDeclaration;\nexports.isTSModuleBlock = isTSModuleBlock;\nexports.isTSImportType = isTSImportType;\nexports.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration;\nexports.isTSExternalModuleReference = isTSExternalModuleReference;\nexports.isTSNonNullExpression = isTSNonNullExpression;\nexports.isTSExportAssignment = isTSExportAssignment;\nexports.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration;\nexports.isTSTypeAnnotation = isTSTypeAnnotation;\nexports.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation;\nexports.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration;\nexports.isTSTypeParameter = isTSTypeParameter;\nexports.isExpression = isExpression;\nexports.isBinary = isBinary;\nexports.isScopable = isScopable;\nexports.isBlockParent = isBlockParent;\nexports.isBlock = isBlock;\nexports.isStatement = isStatement;\nexports.isTerminatorless = isTerminatorless;\nexports.isCompletionStatement = isCompletionStatement;\nexports.isConditional = isConditional;\nexports.isLoop = isLoop;\nexports.isWhile = isWhile;\nexports.isExpressionWrapper = isExpressionWrapper;\nexports.isFor = isFor;\nexports.isForXStatement = isForXStatement;\nexports.isFunction = isFunction;\nexports.isFunctionParent = isFunctionParent;\nexports.isPureish = isPureish;\nexports.isDeclaration = isDeclaration;\nexports.isPatternLike = isPatternLike;\nexports.isLVal = isLVal;\nexports.isTSEntityName = isTSEntityName;\nexports.isLiteral = isLiteral;\nexports.isImmutable = isImmutable;\nexports.isUserWhitespacable = isUserWhitespacable;\nexports.isMethod = isMethod;\nexports.isObjectMember = isObjectMember;\nexports.isProperty = isProperty;\nexports.isUnaryLike = isUnaryLike;\nexports.isPattern = isPattern;\nexports.isClass = isClass;\nexports.isModuleDeclaration = isModuleDeclaration;\nexports.isExportDeclaration = isExportDeclaration;\nexports.isModuleSpecifier = isModuleSpecifier;\nexports.isFlow = isFlow;\nexports.isFlowType = isFlowType;\nexports.isFlowBaseAnnotation = isFlowBaseAnnotation;\nexports.isFlowDeclaration = isFlowDeclaration;\nexports.isFlowPredicate = isFlowPredicate;\nexports.isEnumBody = isEnumBody;\nexports.isEnumMember = isEnumMember;\nexports.isJSX = isJSX;\nexports.isPrivate = isPrivate;\nexports.isTSTypeElement = isTSTypeElement;\nexports.isTSType = isTSType;\nexports.isTSBaseType = isTSBaseType;\nexports.isNumberLiteral = isNumberLiteral;\nexports.isRegexLiteral = isRegexLiteral;\nexports.isRestProperty = isRestProperty;\nexports.isSpreadProperty = isSpreadProperty;\n\nvar _shallowEqual = _interopRequireDefault(require(\"../../utils/shallowEqual\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction isArrayExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ArrayExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isAssignmentExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"AssignmentExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isBinaryExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"BinaryExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isInterpreterDirective(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"InterpreterDirective\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDirective(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Directive\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDirectiveLiteral(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DirectiveLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isBlockStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"BlockStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isBreakStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"BreakStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isCallExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"CallExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isCatchClause(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"CatchClause\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isConditionalExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ConditionalExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isContinueStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ContinueStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDebuggerStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DebuggerStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDoWhileStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DoWhileStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isEmptyStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"EmptyStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isExpressionStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ExpressionStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isFile(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"File\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isForInStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ForInStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isForStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ForStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isFunctionDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"FunctionDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isFunctionExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"FunctionExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isIdentifier(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Identifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isIfStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"IfStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isLabeledStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"LabeledStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isStringLiteral(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"StringLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isNumericLiteral(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"NumericLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isNullLiteral(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"NullLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isBooleanLiteral(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"BooleanLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isRegExpLiteral(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"RegExpLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isLogicalExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"LogicalExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isMemberExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"MemberExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isNewExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"NewExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isProgram(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Program\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isObjectExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ObjectExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isObjectMethod(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ObjectMethod\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isObjectProperty(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ObjectProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isRestElement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"RestElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isReturnStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ReturnStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isSequenceExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"SequenceExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isParenthesizedExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ParenthesizedExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isSwitchCase(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"SwitchCase\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isSwitchStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"SwitchStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isThisExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ThisExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isThrowStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ThrowStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTryStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TryStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isUnaryExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"UnaryExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isUpdateExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"UpdateExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isVariableDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"VariableDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isVariableDeclarator(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"VariableDeclarator\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isWhileStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"WhileStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isWithStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"WithStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isAssignmentPattern(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"AssignmentPattern\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isArrayPattern(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ArrayPattern\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isArrowFunctionExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ArrowFunctionExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isClassBody(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ClassBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isClassExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ClassExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isClassDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ClassDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isExportAllDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ExportAllDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isExportDefaultDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ExportDefaultDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isExportNamedDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ExportNamedDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isExportSpecifier(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ExportSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isForOfStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ForOfStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isImportDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ImportDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isImportDefaultSpecifier(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ImportDefaultSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isImportNamespaceSpecifier(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ImportNamespaceSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isImportSpecifier(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ImportSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isMetaProperty(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"MetaProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isClassMethod(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ClassMethod\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isObjectPattern(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ObjectPattern\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isSpreadElement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"SpreadElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isSuper(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Super\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTaggedTemplateExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TaggedTemplateExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTemplateElement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TemplateElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTemplateLiteral(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TemplateLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isYieldExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"YieldExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isAwaitExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"AwaitExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isImport(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Import\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isBigIntLiteral(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"BigIntLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isExportNamespaceSpecifier(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ExportNamespaceSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isOptionalMemberExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"OptionalMemberExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isOptionalCallExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"OptionalCallExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isAnyTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"AnyTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isArrayTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ArrayTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isBooleanTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"BooleanTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isBooleanLiteralTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"BooleanLiteralTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isNullLiteralTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"NullLiteralTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isClassImplements(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ClassImplements\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDeclareClass(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DeclareClass\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDeclareFunction(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DeclareFunction\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDeclareInterface(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DeclareInterface\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDeclareModule(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DeclareModule\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDeclareModuleExports(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DeclareModuleExports\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDeclareTypeAlias(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DeclareTypeAlias\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDeclareOpaqueType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DeclareOpaqueType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDeclareVariable(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DeclareVariable\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDeclareExportDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DeclareExportDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDeclareExportAllDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DeclareExportAllDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDeclaredPredicate(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DeclaredPredicate\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isExistsTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ExistsTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isFunctionTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"FunctionTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isFunctionTypeParam(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"FunctionTypeParam\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isGenericTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"GenericTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isInferredPredicate(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"InferredPredicate\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isInterfaceExtends(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"InterfaceExtends\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isInterfaceDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"InterfaceDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isInterfaceTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"InterfaceTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isIntersectionTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"IntersectionTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isMixedTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"MixedTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isEmptyTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"EmptyTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isNullableTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"NullableTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isNumberLiteralTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"NumberLiteralTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isNumberTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"NumberTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isObjectTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ObjectTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isObjectTypeInternalSlot(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ObjectTypeInternalSlot\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isObjectTypeCallProperty(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ObjectTypeCallProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isObjectTypeIndexer(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ObjectTypeIndexer\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isObjectTypeProperty(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ObjectTypeProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isObjectTypeSpreadProperty(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ObjectTypeSpreadProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isOpaqueType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"OpaqueType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isQualifiedTypeIdentifier(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"QualifiedTypeIdentifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isStringLiteralTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"StringLiteralTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isStringTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"StringTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isSymbolTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"SymbolTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isThisTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ThisTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTupleTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TupleTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTypeofTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TypeofTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTypeAlias(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TypeAlias\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTypeCastExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TypeCastExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTypeParameter(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TypeParameter\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTypeParameterDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TypeParameterDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTypeParameterInstantiation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TypeParameterInstantiation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isUnionTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"UnionTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isVariance(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Variance\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isVoidTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"VoidTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isEnumDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"EnumDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isEnumBooleanBody(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"EnumBooleanBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isEnumNumberBody(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"EnumNumberBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isEnumStringBody(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"EnumStringBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isEnumSymbolBody(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"EnumSymbolBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isEnumBooleanMember(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"EnumBooleanMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isEnumNumberMember(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"EnumNumberMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isEnumStringMember(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"EnumStringMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isEnumDefaultedMember(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"EnumDefaultedMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXAttribute(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXAttribute\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXClosingElement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXClosingElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXElement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXEmptyExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXEmptyExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXExpressionContainer(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXExpressionContainer\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXSpreadChild(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXSpreadChild\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXIdentifier(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXIdentifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXMemberExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXMemberExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXNamespacedName(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXNamespacedName\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXOpeningElement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXOpeningElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXSpreadAttribute(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXSpreadAttribute\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXText(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXText\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXFragment(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXFragment\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXOpeningFragment(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXOpeningFragment\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSXClosingFragment(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSXClosingFragment\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isNoop(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Noop\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isPlaceholder(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Placeholder\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isV8IntrinsicIdentifier(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"V8IntrinsicIdentifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isArgumentPlaceholder(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ArgumentPlaceholder\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isBindExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"BindExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isClassProperty(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ClassProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isPipelineTopicExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"PipelineTopicExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isPipelineBareFunction(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"PipelineBareFunction\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isPipelinePrimaryTopicReference(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"PipelinePrimaryTopicReference\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isClassPrivateProperty(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ClassPrivateProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isClassPrivateMethod(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ClassPrivateMethod\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isImportAttribute(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ImportAttribute\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDecorator(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Decorator\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDoExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DoExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isExportDefaultSpecifier(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ExportDefaultSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isPrivateName(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"PrivateName\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isRecordExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"RecordExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTupleExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TupleExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDecimalLiteral(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"DecimalLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isStaticBlock(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"StaticBlock\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSParameterProperty(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSParameterProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSDeclareFunction(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSDeclareFunction\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSDeclareMethod(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSDeclareMethod\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSQualifiedName(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSQualifiedName\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSCallSignatureDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSCallSignatureDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSConstructSignatureDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSConstructSignatureDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSPropertySignature(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSPropertySignature\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSMethodSignature(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSMethodSignature\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSIndexSignature(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSIndexSignature\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSAnyKeyword(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSAnyKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSBooleanKeyword(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSBooleanKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSBigIntKeyword(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSBigIntKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSIntrinsicKeyword(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSIntrinsicKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSNeverKeyword(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSNeverKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSNullKeyword(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSNullKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSNumberKeyword(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSNumberKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSObjectKeyword(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSObjectKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSStringKeyword(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSStringKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSSymbolKeyword(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSSymbolKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSUndefinedKeyword(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSUndefinedKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSUnknownKeyword(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSUnknownKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSVoidKeyword(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSVoidKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSThisType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSThisType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSFunctionType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSFunctionType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSConstructorType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSConstructorType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSTypeReference(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSTypeReference\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSTypePredicate(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSTypePredicate\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSTypeQuery(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSTypeQuery\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSTypeLiteral(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSTypeLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSArrayType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSArrayType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSTupleType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSTupleType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSOptionalType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSOptionalType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSRestType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSRestType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSNamedTupleMember(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSNamedTupleMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSUnionType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSUnionType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSIntersectionType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSIntersectionType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSConditionalType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSConditionalType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSInferType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSInferType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSParenthesizedType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSParenthesizedType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSTypeOperator(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSTypeOperator\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSIndexedAccessType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSIndexedAccessType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSMappedType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSMappedType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSLiteralType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSLiteralType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSExpressionWithTypeArguments(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSExpressionWithTypeArguments\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSInterfaceDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSInterfaceDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSInterfaceBody(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSInterfaceBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSTypeAliasDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSTypeAliasDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSAsExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSAsExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSTypeAssertion(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSTypeAssertion\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSEnumDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSEnumDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSEnumMember(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSEnumMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSModuleDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSModuleDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSModuleBlock(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSModuleBlock\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSImportType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSImportType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSImportEqualsDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSImportEqualsDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSExternalModuleReference(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSExternalModuleReference\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSNonNullExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSNonNullExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSExportAssignment(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSExportAssignment\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSNamespaceExportDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSNamespaceExportDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSTypeAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSTypeParameterInstantiation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSTypeParameterInstantiation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSTypeParameterDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSTypeParameterDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSTypeParameter(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSTypeParameter\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isExpression(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Expression\" || \"ArrayExpression\" === nodeType || \"AssignmentExpression\" === nodeType || \"BinaryExpression\" === nodeType || \"CallExpression\" === nodeType || \"ConditionalExpression\" === nodeType || \"FunctionExpression\" === nodeType || \"Identifier\" === nodeType || \"StringLiteral\" === nodeType || \"NumericLiteral\" === nodeType || \"NullLiteral\" === nodeType || \"BooleanLiteral\" === nodeType || \"RegExpLiteral\" === nodeType || \"LogicalExpression\" === nodeType || \"MemberExpression\" === nodeType || \"NewExpression\" === nodeType || \"ObjectExpression\" === nodeType || \"SequenceExpression\" === nodeType || \"ParenthesizedExpression\" === nodeType || \"ThisExpression\" === nodeType || \"UnaryExpression\" === nodeType || \"UpdateExpression\" === nodeType || \"ArrowFunctionExpression\" === nodeType || \"ClassExpression\" === nodeType || \"MetaProperty\" === nodeType || \"Super\" === nodeType || \"TaggedTemplateExpression\" === nodeType || \"TemplateLiteral\" === nodeType || \"YieldExpression\" === nodeType || \"AwaitExpression\" === nodeType || \"Import\" === nodeType || \"BigIntLiteral\" === nodeType || \"OptionalMemberExpression\" === nodeType || \"OptionalCallExpression\" === nodeType || \"TypeCastExpression\" === nodeType || \"JSXElement\" === nodeType || \"JSXFragment\" === nodeType || \"BindExpression\" === nodeType || \"PipelinePrimaryTopicReference\" === nodeType || \"DoExpression\" === nodeType || \"RecordExpression\" === nodeType || \"TupleExpression\" === nodeType || \"DecimalLiteral\" === nodeType || \"TSAsExpression\" === nodeType || \"TSTypeAssertion\" === nodeType || \"TSNonNullExpression\" === nodeType || nodeType === \"Placeholder\" && (\"Expression\" === node.expectedNode || \"Identifier\" === node.expectedNode || \"StringLiteral\" === node.expectedNode)) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isBinary(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Binary\" || \"BinaryExpression\" === nodeType || \"LogicalExpression\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isScopable(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Scopable\" || \"BlockStatement\" === nodeType || \"CatchClause\" === nodeType || \"DoWhileStatement\" === nodeType || \"ForInStatement\" === nodeType || \"ForStatement\" === nodeType || \"FunctionDeclaration\" === nodeType || \"FunctionExpression\" === nodeType || \"Program\" === nodeType || \"ObjectMethod\" === nodeType || \"SwitchStatement\" === nodeType || \"WhileStatement\" === nodeType || \"ArrowFunctionExpression\" === nodeType || \"ClassExpression\" === nodeType || \"ClassDeclaration\" === nodeType || \"ForOfStatement\" === nodeType || \"ClassMethod\" === nodeType || \"ClassPrivateMethod\" === nodeType || \"StaticBlock\" === nodeType || \"TSModuleBlock\" === nodeType || nodeType === \"Placeholder\" && \"BlockStatement\" === node.expectedNode) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isBlockParent(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"BlockParent\" || \"BlockStatement\" === nodeType || \"CatchClause\" === nodeType || \"DoWhileStatement\" === nodeType || \"ForInStatement\" === nodeType || \"ForStatement\" === nodeType || \"FunctionDeclaration\" === nodeType || \"FunctionExpression\" === nodeType || \"Program\" === nodeType || \"ObjectMethod\" === nodeType || \"SwitchStatement\" === nodeType || \"WhileStatement\" === nodeType || \"ArrowFunctionExpression\" === nodeType || \"ForOfStatement\" === nodeType || \"ClassMethod\" === nodeType || \"ClassPrivateMethod\" === nodeType || \"StaticBlock\" === nodeType || \"TSModuleBlock\" === nodeType || nodeType === \"Placeholder\" && \"BlockStatement\" === node.expectedNode) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isBlock(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Block\" || \"BlockStatement\" === nodeType || \"Program\" === nodeType || \"TSModuleBlock\" === nodeType || nodeType === \"Placeholder\" && \"BlockStatement\" === node.expectedNode) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Statement\" || \"BlockStatement\" === nodeType || \"BreakStatement\" === nodeType || \"ContinueStatement\" === nodeType || \"DebuggerStatement\" === nodeType || \"DoWhileStatement\" === nodeType || \"EmptyStatement\" === nodeType || \"ExpressionStatement\" === nodeType || \"ForInStatement\" === nodeType || \"ForStatement\" === nodeType || \"FunctionDeclaration\" === nodeType || \"IfStatement\" === nodeType || \"LabeledStatement\" === nodeType || \"ReturnStatement\" === nodeType || \"SwitchStatement\" === nodeType || \"ThrowStatement\" === nodeType || \"TryStatement\" === nodeType || \"VariableDeclaration\" === nodeType || \"WhileStatement\" === nodeType || \"WithStatement\" === nodeType || \"ClassDeclaration\" === nodeType || \"ExportAllDeclaration\" === nodeType || \"ExportDefaultDeclaration\" === nodeType || \"ExportNamedDeclaration\" === nodeType || \"ForOfStatement\" === nodeType || \"ImportDeclaration\" === nodeType || \"DeclareClass\" === nodeType || \"DeclareFunction\" === nodeType || \"DeclareInterface\" === nodeType || \"DeclareModule\" === nodeType || \"DeclareModuleExports\" === nodeType || \"DeclareTypeAlias\" === nodeType || \"DeclareOpaqueType\" === nodeType || \"DeclareVariable\" === nodeType || \"DeclareExportDeclaration\" === nodeType || \"DeclareExportAllDeclaration\" === nodeType || \"InterfaceDeclaration\" === nodeType || \"OpaqueType\" === nodeType || \"TypeAlias\" === nodeType || \"EnumDeclaration\" === nodeType || \"TSDeclareFunction\" === nodeType || \"TSInterfaceDeclaration\" === nodeType || \"TSTypeAliasDeclaration\" === nodeType || \"TSEnumDeclaration\" === nodeType || \"TSModuleDeclaration\" === nodeType || \"TSImportEqualsDeclaration\" === nodeType || \"TSExportAssignment\" === nodeType || \"TSNamespaceExportDeclaration\" === nodeType || nodeType === \"Placeholder\" && (\"Statement\" === node.expectedNode || \"Declaration\" === node.expectedNode || \"BlockStatement\" === node.expectedNode)) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTerminatorless(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Terminatorless\" || \"BreakStatement\" === nodeType || \"ContinueStatement\" === nodeType || \"ReturnStatement\" === nodeType || \"ThrowStatement\" === nodeType || \"YieldExpression\" === nodeType || \"AwaitExpression\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isCompletionStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"CompletionStatement\" || \"BreakStatement\" === nodeType || \"ContinueStatement\" === nodeType || \"ReturnStatement\" === nodeType || \"ThrowStatement\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isConditional(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Conditional\" || \"ConditionalExpression\" === nodeType || \"IfStatement\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isLoop(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Loop\" || \"DoWhileStatement\" === nodeType || \"ForInStatement\" === nodeType || \"ForStatement\" === nodeType || \"WhileStatement\" === nodeType || \"ForOfStatement\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isWhile(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"While\" || \"DoWhileStatement\" === nodeType || \"WhileStatement\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isExpressionWrapper(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ExpressionWrapper\" || \"ExpressionStatement\" === nodeType || \"ParenthesizedExpression\" === nodeType || \"TypeCastExpression\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isFor(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"For\" || \"ForInStatement\" === nodeType || \"ForStatement\" === nodeType || \"ForOfStatement\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isForXStatement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ForXStatement\" || \"ForInStatement\" === nodeType || \"ForOfStatement\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isFunction(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Function\" || \"FunctionDeclaration\" === nodeType || \"FunctionExpression\" === nodeType || \"ObjectMethod\" === nodeType || \"ArrowFunctionExpression\" === nodeType || \"ClassMethod\" === nodeType || \"ClassPrivateMethod\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isFunctionParent(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"FunctionParent\" || \"FunctionDeclaration\" === nodeType || \"FunctionExpression\" === nodeType || \"ObjectMethod\" === nodeType || \"ArrowFunctionExpression\" === nodeType || \"ClassMethod\" === nodeType || \"ClassPrivateMethod\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isPureish(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Pureish\" || \"FunctionDeclaration\" === nodeType || \"FunctionExpression\" === nodeType || \"StringLiteral\" === nodeType || \"NumericLiteral\" === nodeType || \"NullLiteral\" === nodeType || \"BooleanLiteral\" === nodeType || \"RegExpLiteral\" === nodeType || \"ArrowFunctionExpression\" === nodeType || \"BigIntLiteral\" === nodeType || \"DecimalLiteral\" === nodeType || nodeType === \"Placeholder\" && \"StringLiteral\" === node.expectedNode) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Declaration\" || \"FunctionDeclaration\" === nodeType || \"VariableDeclaration\" === nodeType || \"ClassDeclaration\" === nodeType || \"ExportAllDeclaration\" === nodeType || \"ExportDefaultDeclaration\" === nodeType || \"ExportNamedDeclaration\" === nodeType || \"ImportDeclaration\" === nodeType || \"DeclareClass\" === nodeType || \"DeclareFunction\" === nodeType || \"DeclareInterface\" === nodeType || \"DeclareModule\" === nodeType || \"DeclareModuleExports\" === nodeType || \"DeclareTypeAlias\" === nodeType || \"DeclareOpaqueType\" === nodeType || \"DeclareVariable\" === nodeType || \"DeclareExportDeclaration\" === nodeType || \"DeclareExportAllDeclaration\" === nodeType || \"InterfaceDeclaration\" === nodeType || \"OpaqueType\" === nodeType || \"TypeAlias\" === nodeType || \"EnumDeclaration\" === nodeType || \"TSDeclareFunction\" === nodeType || \"TSInterfaceDeclaration\" === nodeType || \"TSTypeAliasDeclaration\" === nodeType || \"TSEnumDeclaration\" === nodeType || \"TSModuleDeclaration\" === nodeType || nodeType === \"Placeholder\" && \"Declaration\" === node.expectedNode) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isPatternLike(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"PatternLike\" || \"Identifier\" === nodeType || \"RestElement\" === nodeType || \"AssignmentPattern\" === nodeType || \"ArrayPattern\" === nodeType || \"ObjectPattern\" === nodeType || nodeType === \"Placeholder\" && (\"Pattern\" === node.expectedNode || \"Identifier\" === node.expectedNode)) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isLVal(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"LVal\" || \"Identifier\" === nodeType || \"MemberExpression\" === nodeType || \"RestElement\" === nodeType || \"AssignmentPattern\" === nodeType || \"ArrayPattern\" === nodeType || \"ObjectPattern\" === nodeType || \"TSParameterProperty\" === nodeType || nodeType === \"Placeholder\" && (\"Pattern\" === node.expectedNode || \"Identifier\" === node.expectedNode)) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSEntityName(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSEntityName\" || \"Identifier\" === nodeType || \"TSQualifiedName\" === nodeType || nodeType === \"Placeholder\" && \"Identifier\" === node.expectedNode) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isLiteral(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Literal\" || \"StringLiteral\" === nodeType || \"NumericLiteral\" === nodeType || \"NullLiteral\" === nodeType || \"BooleanLiteral\" === nodeType || \"RegExpLiteral\" === nodeType || \"TemplateLiteral\" === nodeType || \"BigIntLiteral\" === nodeType || \"DecimalLiteral\" === nodeType || nodeType === \"Placeholder\" && \"StringLiteral\" === node.expectedNode) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isImmutable(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Immutable\" || \"StringLiteral\" === nodeType || \"NumericLiteral\" === nodeType || \"NullLiteral\" === nodeType || \"BooleanLiteral\" === nodeType || \"BigIntLiteral\" === nodeType || \"JSXAttribute\" === nodeType || \"JSXClosingElement\" === nodeType || \"JSXElement\" === nodeType || \"JSXExpressionContainer\" === nodeType || \"JSXSpreadChild\" === nodeType || \"JSXOpeningElement\" === nodeType || \"JSXText\" === nodeType || \"JSXFragment\" === nodeType || \"JSXOpeningFragment\" === nodeType || \"JSXClosingFragment\" === nodeType || \"DecimalLiteral\" === nodeType || nodeType === \"Placeholder\" && \"StringLiteral\" === node.expectedNode) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isUserWhitespacable(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"UserWhitespacable\" || \"ObjectMethod\" === nodeType || \"ObjectProperty\" === nodeType || \"ObjectTypeInternalSlot\" === nodeType || \"ObjectTypeCallProperty\" === nodeType || \"ObjectTypeIndexer\" === nodeType || \"ObjectTypeProperty\" === nodeType || \"ObjectTypeSpreadProperty\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isMethod(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Method\" || \"ObjectMethod\" === nodeType || \"ClassMethod\" === nodeType || \"ClassPrivateMethod\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isObjectMember(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ObjectMember\" || \"ObjectMethod\" === nodeType || \"ObjectProperty\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isProperty(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Property\" || \"ObjectProperty\" === nodeType || \"ClassProperty\" === nodeType || \"ClassPrivateProperty\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isUnaryLike(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"UnaryLike\" || \"UnaryExpression\" === nodeType || \"SpreadElement\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isPattern(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Pattern\" || \"AssignmentPattern\" === nodeType || \"ArrayPattern\" === nodeType || \"ObjectPattern\" === nodeType || nodeType === \"Placeholder\" && \"Pattern\" === node.expectedNode) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isClass(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Class\" || \"ClassExpression\" === nodeType || \"ClassDeclaration\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isModuleDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ModuleDeclaration\" || \"ExportAllDeclaration\" === nodeType || \"ExportDefaultDeclaration\" === nodeType || \"ExportNamedDeclaration\" === nodeType || \"ImportDeclaration\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isExportDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ExportDeclaration\" || \"ExportAllDeclaration\" === nodeType || \"ExportDefaultDeclaration\" === nodeType || \"ExportNamedDeclaration\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isModuleSpecifier(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"ModuleSpecifier\" || \"ExportSpecifier\" === nodeType || \"ImportDefaultSpecifier\" === nodeType || \"ImportNamespaceSpecifier\" === nodeType || \"ImportSpecifier\" === nodeType || \"ExportNamespaceSpecifier\" === nodeType || \"ExportDefaultSpecifier\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isFlow(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Flow\" || \"AnyTypeAnnotation\" === nodeType || \"ArrayTypeAnnotation\" === nodeType || \"BooleanTypeAnnotation\" === nodeType || \"BooleanLiteralTypeAnnotation\" === nodeType || \"NullLiteralTypeAnnotation\" === nodeType || \"ClassImplements\" === nodeType || \"DeclareClass\" === nodeType || \"DeclareFunction\" === nodeType || \"DeclareInterface\" === nodeType || \"DeclareModule\" === nodeType || \"DeclareModuleExports\" === nodeType || \"DeclareTypeAlias\" === nodeType || \"DeclareOpaqueType\" === nodeType || \"DeclareVariable\" === nodeType || \"DeclareExportDeclaration\" === nodeType || \"DeclareExportAllDeclaration\" === nodeType || \"DeclaredPredicate\" === nodeType || \"ExistsTypeAnnotation\" === nodeType || \"FunctionTypeAnnotation\" === nodeType || \"FunctionTypeParam\" === nodeType || \"GenericTypeAnnotation\" === nodeType || \"InferredPredicate\" === nodeType || \"InterfaceExtends\" === nodeType || \"InterfaceDeclaration\" === nodeType || \"InterfaceTypeAnnotation\" === nodeType || \"IntersectionTypeAnnotation\" === nodeType || \"MixedTypeAnnotation\" === nodeType || \"EmptyTypeAnnotation\" === nodeType || \"NullableTypeAnnotation\" === nodeType || \"NumberLiteralTypeAnnotation\" === nodeType || \"NumberTypeAnnotation\" === nodeType || \"ObjectTypeAnnotation\" === nodeType || \"ObjectTypeInternalSlot\" === nodeType || \"ObjectTypeCallProperty\" === nodeType || \"ObjectTypeIndexer\" === nodeType || \"ObjectTypeProperty\" === nodeType || \"ObjectTypeSpreadProperty\" === nodeType || \"OpaqueType\" === nodeType || \"QualifiedTypeIdentifier\" === nodeType || \"StringLiteralTypeAnnotation\" === nodeType || \"StringTypeAnnotation\" === nodeType || \"SymbolTypeAnnotation\" === nodeType || \"ThisTypeAnnotation\" === nodeType || \"TupleTypeAnnotation\" === nodeType || \"TypeofTypeAnnotation\" === nodeType || \"TypeAlias\" === nodeType || \"TypeAnnotation\" === nodeType || \"TypeCastExpression\" === nodeType || \"TypeParameter\" === nodeType || \"TypeParameterDeclaration\" === nodeType || \"TypeParameterInstantiation\" === nodeType || \"UnionTypeAnnotation\" === nodeType || \"Variance\" === nodeType || \"VoidTypeAnnotation\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isFlowType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"FlowType\" || \"AnyTypeAnnotation\" === nodeType || \"ArrayTypeAnnotation\" === nodeType || \"BooleanTypeAnnotation\" === nodeType || \"BooleanLiteralTypeAnnotation\" === nodeType || \"NullLiteralTypeAnnotation\" === nodeType || \"ExistsTypeAnnotation\" === nodeType || \"FunctionTypeAnnotation\" === nodeType || \"GenericTypeAnnotation\" === nodeType || \"InterfaceTypeAnnotation\" === nodeType || \"IntersectionTypeAnnotation\" === nodeType || \"MixedTypeAnnotation\" === nodeType || \"EmptyTypeAnnotation\" === nodeType || \"NullableTypeAnnotation\" === nodeType || \"NumberLiteralTypeAnnotation\" === nodeType || \"NumberTypeAnnotation\" === nodeType || \"ObjectTypeAnnotation\" === nodeType || \"StringLiteralTypeAnnotation\" === nodeType || \"StringTypeAnnotation\" === nodeType || \"SymbolTypeAnnotation\" === nodeType || \"ThisTypeAnnotation\" === nodeType || \"TupleTypeAnnotation\" === nodeType || \"TypeofTypeAnnotation\" === nodeType || \"UnionTypeAnnotation\" === nodeType || \"VoidTypeAnnotation\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isFlowBaseAnnotation(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"FlowBaseAnnotation\" || \"AnyTypeAnnotation\" === nodeType || \"BooleanTypeAnnotation\" === nodeType || \"NullLiteralTypeAnnotation\" === nodeType || \"MixedTypeAnnotation\" === nodeType || \"EmptyTypeAnnotation\" === nodeType || \"NumberTypeAnnotation\" === nodeType || \"StringTypeAnnotation\" === nodeType || \"SymbolTypeAnnotation\" === nodeType || \"ThisTypeAnnotation\" === nodeType || \"VoidTypeAnnotation\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isFlowDeclaration(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"FlowDeclaration\" || \"DeclareClass\" === nodeType || \"DeclareFunction\" === nodeType || \"DeclareInterface\" === nodeType || \"DeclareModule\" === nodeType || \"DeclareModuleExports\" === nodeType || \"DeclareTypeAlias\" === nodeType || \"DeclareOpaqueType\" === nodeType || \"DeclareVariable\" === nodeType || \"DeclareExportDeclaration\" === nodeType || \"DeclareExportAllDeclaration\" === nodeType || \"InterfaceDeclaration\" === nodeType || \"OpaqueType\" === nodeType || \"TypeAlias\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isFlowPredicate(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"FlowPredicate\" || \"DeclaredPredicate\" === nodeType || \"InferredPredicate\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isEnumBody(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"EnumBody\" || \"EnumBooleanBody\" === nodeType || \"EnumNumberBody\" === nodeType || \"EnumStringBody\" === nodeType || \"EnumSymbolBody\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isEnumMember(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"EnumMember\" || \"EnumBooleanMember\" === nodeType || \"EnumNumberMember\" === nodeType || \"EnumStringMember\" === nodeType || \"EnumDefaultedMember\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isJSX(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"JSX\" || \"JSXAttribute\" === nodeType || \"JSXClosingElement\" === nodeType || \"JSXElement\" === nodeType || \"JSXEmptyExpression\" === nodeType || \"JSXExpressionContainer\" === nodeType || \"JSXSpreadChild\" === nodeType || \"JSXIdentifier\" === nodeType || \"JSXMemberExpression\" === nodeType || \"JSXNamespacedName\" === nodeType || \"JSXOpeningElement\" === nodeType || \"JSXSpreadAttribute\" === nodeType || \"JSXText\" === nodeType || \"JSXFragment\" === nodeType || \"JSXOpeningFragment\" === nodeType || \"JSXClosingFragment\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isPrivate(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"Private\" || \"ClassPrivateProperty\" === nodeType || \"ClassPrivateMethod\" === nodeType || \"PrivateName\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSTypeElement(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSTypeElement\" || \"TSCallSignatureDeclaration\" === nodeType || \"TSConstructSignatureDeclaration\" === nodeType || \"TSPropertySignature\" === nodeType || \"TSMethodSignature\" === nodeType || \"TSIndexSignature\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSType\" || \"TSAnyKeyword\" === nodeType || \"TSBooleanKeyword\" === nodeType || \"TSBigIntKeyword\" === nodeType || \"TSIntrinsicKeyword\" === nodeType || \"TSNeverKeyword\" === nodeType || \"TSNullKeyword\" === nodeType || \"TSNumberKeyword\" === nodeType || \"TSObjectKeyword\" === nodeType || \"TSStringKeyword\" === nodeType || \"TSSymbolKeyword\" === nodeType || \"TSUndefinedKeyword\" === nodeType || \"TSUnknownKeyword\" === nodeType || \"TSVoidKeyword\" === nodeType || \"TSThisType\" === nodeType || \"TSFunctionType\" === nodeType || \"TSConstructorType\" === nodeType || \"TSTypeReference\" === nodeType || \"TSTypePredicate\" === nodeType || \"TSTypeQuery\" === nodeType || \"TSTypeLiteral\" === nodeType || \"TSArrayType\" === nodeType || \"TSTupleType\" === nodeType || \"TSOptionalType\" === nodeType || \"TSRestType\" === nodeType || \"TSUnionType\" === nodeType || \"TSIntersectionType\" === nodeType || \"TSConditionalType\" === nodeType || \"TSInferType\" === nodeType || \"TSParenthesizedType\" === nodeType || \"TSTypeOperator\" === nodeType || \"TSIndexedAccessType\" === nodeType || \"TSMappedType\" === nodeType || \"TSLiteralType\" === nodeType || \"TSExpressionWithTypeArguments\" === nodeType || \"TSImportType\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isTSBaseType(node, opts) {\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"TSBaseType\" || \"TSAnyKeyword\" === nodeType || \"TSBooleanKeyword\" === nodeType || \"TSBigIntKeyword\" === nodeType || \"TSIntrinsicKeyword\" === nodeType || \"TSNeverKeyword\" === nodeType || \"TSNullKeyword\" === nodeType || \"TSNumberKeyword\" === nodeType || \"TSObjectKeyword\" === nodeType || \"TSStringKeyword\" === nodeType || \"TSSymbolKeyword\" === nodeType || \"TSUndefinedKeyword\" === nodeType || \"TSUnknownKeyword\" === nodeType || \"TSVoidKeyword\" === nodeType || \"TSThisType\" === nodeType || \"TSLiteralType\" === nodeType) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isNumberLiteral(node, opts) {\n console.trace(\"The node type NumberLiteral has been renamed to NumericLiteral\");\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"NumberLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isRegexLiteral(node, opts) {\n console.trace(\"The node type RegexLiteral has been renamed to RegExpLiteral\");\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"RegexLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isRestProperty(node, opts) {\n console.trace(\"The node type RestProperty has been renamed to RestElement\");\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"RestProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}\n\nfunction isSpreadProperty(node, opts) {\n console.trace(\"The node type SpreadProperty has been renamed to SpreadElement\");\n if (!node) return false;\n const nodeType = node.type;\n\n if (nodeType === \"SpreadProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n }\n\n return false;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = is;\n\nvar _shallowEqual = _interopRequireDefault(require(\"../utils/shallowEqual\"));\n\nvar _isType = _interopRequireDefault(require(\"./isType\"));\n\nvar _isPlaceholderType = _interopRequireDefault(require(\"./isPlaceholderType\"));\n\nvar _definitions = require(\"../definitions\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction is(type, node, opts) {\n if (!node) return false;\n const matches = (0, _isType.default)(node.type, type);\n\n if (!matches) {\n if (!opts && node.type === \"Placeholder\" && type in _definitions.FLIPPED_ALIAS_KEYS) {\n return (0, _isPlaceholderType.default)(node.expectedNode, type);\n }\n\n return false;\n }\n\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return (0, _shallowEqual.default)(node, opts);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isBinding;\n\nvar _getBindingIdentifiers = _interopRequireDefault(require(\"../retrievers/getBindingIdentifiers\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction isBinding(node, parent, grandparent) {\n if (grandparent && node.type === \"Identifier\" && parent.type === \"ObjectProperty\" && grandparent.type === \"ObjectExpression\") {\n return false;\n }\n\n const keys = _getBindingIdentifiers.default.keys[parent.type];\n\n if (keys) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const val = parent[key];\n\n if (Array.isArray(val)) {\n if (val.indexOf(node) >= 0) return true;\n } else {\n if (val === node) return true;\n }\n }\n }\n\n return false;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isBlockScoped;\n\nvar _generated = require(\"./generated\");\n\nvar _isLet = _interopRequireDefault(require(\"./isLet\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction isBlockScoped(node) {\n return (0, _generated.isFunctionDeclaration)(node) || (0, _generated.isClassDeclaration)(node) || (0, _isLet.default)(node);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isImmutable;\n\nvar _isType = _interopRequireDefault(require(\"./isType\"));\n\nvar _generated = require(\"./generated\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction isImmutable(node) {\n if ((0, _isType.default)(node.type, \"Immutable\")) return true;\n\n if ((0, _generated.isIdentifier)(node)) {\n if (node.name === \"undefined\") {\n return true;\n } else {\n return false;\n }\n }\n\n return false;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isLet;\n\nvar _generated = require(\"./generated\");\n\nvar _constants = require(\"../constants\");\n\nfunction isLet(node) {\n return (0, _generated.isVariableDeclaration)(node) && (node.kind !== \"var\" || node[_constants.BLOCK_SCOPED_SYMBOL]);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isNode;\n\nvar _definitions = require(\"../definitions\");\n\nfunction isNode(node) {\n return !!(node && _definitions.VISITOR_KEYS[node.type]);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isNodesEquivalent;\n\nvar _definitions = require(\"../definitions\");\n\nfunction isNodesEquivalent(a, b) {\n if (typeof a !== \"object\" || typeof b !== \"object\" || a == null || b == null) {\n return a === b;\n }\n\n if (a.type !== b.type) {\n return false;\n }\n\n const fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type);\n const visitorKeys = _definitions.VISITOR_KEYS[a.type];\n\n for (const field of fields) {\n if (typeof a[field] !== typeof b[field]) {\n return false;\n }\n\n if (a[field] == null && b[field] == null) {\n continue;\n } else if (a[field] == null || b[field] == null) {\n return false;\n }\n\n if (Array.isArray(a[field])) {\n if (!Array.isArray(b[field])) {\n return false;\n }\n\n if (a[field].length !== b[field].length) {\n return false;\n }\n\n for (let i = 0; i < a[field].length; i++) {\n if (!isNodesEquivalent(a[field][i], b[field][i])) {\n return false;\n }\n }\n\n continue;\n }\n\n if (typeof a[field] === \"object\" && !(visitorKeys == null ? void 0 : visitorKeys.includes(field))) {\n for (const key of Object.keys(a[field])) {\n if (a[field][key] !== b[field][key]) {\n return false;\n }\n }\n\n continue;\n }\n\n if (!isNodesEquivalent(a[field], b[field])) {\n return false;\n }\n }\n\n return true;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isPlaceholderType;\n\nvar _definitions = require(\"../definitions\");\n\nfunction isPlaceholderType(placeholderType, targetType) {\n if (placeholderType === targetType) return true;\n const aliases = _definitions.PLACEHOLDERS_ALIAS[placeholderType];\n\n if (aliases) {\n for (const alias of aliases) {\n if (targetType === alias) return true;\n }\n }\n\n return false;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isReferenced;\n\nfunction isReferenced(node, parent, grandparent) {\n switch (parent.type) {\n case \"MemberExpression\":\n case \"JSXMemberExpression\":\n case \"OptionalMemberExpression\":\n if (parent.property === node) {\n return !!parent.computed;\n }\n\n return parent.object === node;\n\n case \"VariableDeclarator\":\n return parent.init === node;\n\n case \"ArrowFunctionExpression\":\n return parent.body === node;\n\n case \"ExportSpecifier\":\n if (parent.source) {\n return false;\n }\n\n return parent.local === node;\n\n case \"PrivateName\":\n return false;\n\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n case \"ObjectMethod\":\n if (parent.params.includes(node)) {\n return false;\n }\n\n case \"ObjectProperty\":\n case \"ClassProperty\":\n case \"ClassPrivateProperty\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n\n if (parent.value === node) {\n return !grandparent || grandparent.type !== \"ObjectPattern\";\n }\n\n return true;\n\n case \"ClassDeclaration\":\n case \"ClassExpression\":\n return parent.superClass === node;\n\n case \"AssignmentExpression\":\n return parent.right === node;\n\n case \"AssignmentPattern\":\n return parent.right === node;\n\n case \"LabeledStatement\":\n return false;\n\n case \"CatchClause\":\n return false;\n\n case \"RestElement\":\n return false;\n\n case \"BreakStatement\":\n case \"ContinueStatement\":\n return false;\n\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n return false;\n\n case \"ExportNamespaceSpecifier\":\n case \"ExportDefaultSpecifier\":\n return false;\n\n case \"ImportDefaultSpecifier\":\n case \"ImportNamespaceSpecifier\":\n case \"ImportSpecifier\":\n return false;\n\n case \"JSXAttribute\":\n return false;\n\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n return false;\n\n case \"MetaProperty\":\n return false;\n\n case \"ObjectTypeProperty\":\n return parent.key !== node;\n\n case \"TSEnumMember\":\n return parent.id !== node;\n\n case \"TSPropertySignature\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n\n return true;\n }\n\n return true;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isScope;\n\nvar _generated = require(\"./generated\");\n\nfunction isScope(node, parent) {\n if ((0, _generated.isBlockStatement)(node) && ((0, _generated.isFunction)(parent) || (0, _generated.isCatchClause)(parent))) {\n return false;\n }\n\n if ((0, _generated.isPattern)(node) && ((0, _generated.isFunction)(parent) || (0, _generated.isCatchClause)(parent))) {\n return true;\n }\n\n return (0, _generated.isScopable)(node);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isSpecifierDefault;\n\nvar _generated = require(\"./generated\");\n\nfunction isSpecifierDefault(specifier) {\n return (0, _generated.isImportDefaultSpecifier)(specifier) || (0, _generated.isIdentifier)(specifier.imported || specifier.exported, {\n name: \"default\"\n });\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isType;\n\nvar _definitions = require(\"../definitions\");\n\nfunction isType(nodeType, targetType) {\n if (nodeType === targetType) return true;\n if (_definitions.ALIAS_KEYS[targetType]) return false;\n const aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType];\n\n if (aliases) {\n if (aliases[0] === nodeType) return true;\n\n for (const alias of aliases) {\n if (nodeType === alias) return true;\n }\n }\n\n return false;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isValidES3Identifier;\n\nvar _isValidIdentifier = _interopRequireDefault(require(\"./isValidIdentifier\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst RESERVED_WORDS_ES3_ONLY = new Set([\"abstract\", \"boolean\", \"byte\", \"char\", \"double\", \"enum\", \"final\", \"float\", \"goto\", \"implements\", \"int\", \"interface\", \"long\", \"native\", \"package\", \"private\", \"protected\", \"public\", \"short\", \"static\", \"synchronized\", \"throws\", \"transient\", \"volatile\"]);\n\nfunction isValidES3Identifier(name) {\n return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isValidIdentifier;\n\nvar _helperValidatorIdentifier = require(\"@babel/helper-validator-identifier\");\n\nfunction isValidIdentifier(name, reserved = true) {\n if (typeof name !== \"string\") return false;\n\n if (reserved) {\n if ((0, _helperValidatorIdentifier.isKeyword)(name) || (0, _helperValidatorIdentifier.isStrictReservedWord)(name)) {\n return false;\n } else if (name === \"await\") {\n return false;\n }\n }\n\n return (0, _helperValidatorIdentifier.isIdentifierName)(name);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isVar;\n\nvar _generated = require(\"./generated\");\n\nvar _constants = require(\"../constants\");\n\nfunction isVar(node) {\n return (0, _generated.isVariableDeclaration)(node, {\n kind: \"var\"\n }) && !node[_constants.BLOCK_SCOPED_SYMBOL];\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = matchesPattern;\n\nvar _generated = require(\"./generated\");\n\nfunction matchesPattern(member, match, allowPartial) {\n if (!(0, _generated.isMemberExpression)(member)) return false;\n const parts = Array.isArray(match) ? match : match.split(\".\");\n const nodes = [];\n let node;\n\n for (node = member; (0, _generated.isMemberExpression)(node); node = node.object) {\n nodes.push(node.property);\n }\n\n nodes.push(node);\n if (nodes.length < parts.length) return false;\n if (!allowPartial && nodes.length > parts.length) return false;\n\n for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {\n const node = nodes[j];\n let value;\n\n if ((0, _generated.isIdentifier)(node)) {\n value = node.name;\n } else if ((0, _generated.isStringLiteral)(node)) {\n value = node.value;\n } else {\n return false;\n }\n\n if (parts[i] !== value) return false;\n }\n\n return true;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isCompatTag;\n\nfunction isCompatTag(tagName) {\n return !!tagName && /^[a-z]/.test(tagName);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _buildMatchMemberExpression = _interopRequireDefault(require(\"../buildMatchMemberExpression\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst isReactComponent = (0, _buildMatchMemberExpression.default)(\"React.Component\");\nvar _default = isReactComponent;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = validate;\nexports.validateField = validateField;\nexports.validateChild = validateChild;\n\nvar _definitions = require(\"../definitions\");\n\nfunction validate(node, key, val) {\n if (!node) return;\n const fields = _definitions.NODE_FIELDS[node.type];\n if (!fields) return;\n const field = fields[key];\n validateField(node, key, val, field);\n validateChild(node, key, val);\n}\n\nfunction validateField(node, key, val, field) {\n if (!(field == null ? void 0 : field.validate)) return;\n if (field.optional && val == null) return;\n field.validate(node, key, val);\n}\n\nfunction validateChild(node, key, val) {\n if (val == null) return;\n const validate = _definitions.NODE_PARENT_VALIDATIONS[val.type];\n if (!validate) return;\n validate(node, key, val);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isIdentifierStart = isIdentifierStart;\nexports.isIdentifierChar = isIdentifierChar;\nexports.isIdentifierName = isIdentifierName;\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u08a0-\\u08b4\\u08b6-\\u08c7\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\u9ffc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7bf\\ua7c2-\\ua7ca\\ua7f5-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u08d3-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf\\u1ac0\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1df9\\u1dfb-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\nconst nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\nconst nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\nconst astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];\nconst astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n\nfunction isInAstralSet(code, set) {\n let pos = 0x10000;\n\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n\n return false;\n}\n\nfunction isIdentifierStart(code) {\n if (code < 65) return code === 36;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));\n }\n\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\nfunction isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}\n\nfunction isIdentifierName(name) {\n let isFirst = true;\n\n for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) {\n const char = _Array$from[_i];\n const cp = char.codePointAt(0);\n\n if (isFirst) {\n if (!isIdentifierStart(cp)) {\n return false;\n }\n\n isFirst = false;\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n\n return !isFirst;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"isIdentifierName\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierName;\n }\n});\nObject.defineProperty(exports, \"isIdentifierChar\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierChar;\n }\n});\nObject.defineProperty(exports, \"isIdentifierStart\", {\n enumerable: true,\n get: function () {\n return _identifier.isIdentifierStart;\n }\n});\nObject.defineProperty(exports, \"isReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictBindOnlyReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictBindOnlyReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictBindReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictBindReservedWord;\n }\n});\nObject.defineProperty(exports, \"isStrictReservedWord\", {\n enumerable: true,\n get: function () {\n return _keyword.isStrictReservedWord;\n }\n});\nObject.defineProperty(exports, \"isKeyword\", {\n enumerable: true,\n get: function () {\n return _keyword.isKeyword;\n }\n});\n\nvar _identifier = require(\"./identifier\");\n\nvar _keyword = require(\"./keyword\");","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isReservedWord = isReservedWord;\nexports.isStrictReservedWord = isStrictReservedWord;\nexports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;\nexports.isStrictBindReservedWord = isStrictBindReservedWord;\nexports.isKeyword = isKeyword;\nconst reservedWords = {\n keyword: [\"break\", \"case\", \"catch\", \"continue\", \"debugger\", \"default\", \"do\", \"else\", \"finally\", \"for\", \"function\", \"if\", \"return\", \"switch\", \"throw\", \"try\", \"var\", \"const\", \"while\", \"with\", \"new\", \"this\", \"super\", \"class\", \"extends\", \"export\", \"import\", \"null\", \"true\", \"false\", \"in\", \"instanceof\", \"typeof\", \"void\", \"delete\"],\n strict: [\"implements\", \"interface\", \"let\", \"package\", \"private\", \"protected\", \"public\", \"static\", \"yield\"],\n strictBind: [\"eval\", \"arguments\"]\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\nfunction isReservedWord(word, inModule) {\n return inModule && word === \"await\" || word === \"enum\";\n}\n\nfunction isStrictReservedWord(word, inModule) {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\nfunction isStrictBindOnlyReservedWord(word) {\n return reservedWordsStrictBindSet.has(word);\n}\n\nfunction isStrictBindReservedWord(word, inModule) {\n return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);\n}\n\nfunction isKeyword(word) {\n return keywords.has(word);\n}","const { load, Kind } = require('yaml-ast-parser');\n\nconst loc = Symbol('pseudo-yaml-ast-loc');\nconst hasOwnProp = (obj, key) => (obj && typeof obj === 'object' && Object.prototype.hasOwnProperty.call(obj, key));\nconst isUndefined = v => v === undefined;\nconst isNull = v => v === null;\n\nconst isPrimitive = v =>\n Number.isNaN(v) || isNull(v) || isUndefined(v) || typeof v === 'symbol';\n\nconst isPrimitiveNode = node =>\n isPrimitive(node.value) || !hasOwnProp(node, 'value');\n\nconst isBetween = (start, pos, end) => pos <= end && pos >= start;\n\nconst getLoc = (input, { start = 0, end = 0 }) => {\n const lines = input.split(/\\n/);\n\n const loc = {\n start: {},\n end: {}\n };\n\n let sum = 0;\n\n for (const i of lines.keys()) {\n const line = lines[i];\n const ls = sum;\n const le = sum + line.length;\n\n if (isUndefined(loc.start.line) && isBetween(ls, start, le)) {\n loc.start.line = i + 1;\n loc.start.column = start - ls;\n loc.start.offset = start;\n }\n\n if (isUndefined(loc.end.line) && isBetween(ls, end, le)) {\n loc.end.line = i + 1;\n loc.end.column = end - ls;\n loc.end.offset = end;\n }\n\n sum = le + 1; // +1 because the break is also a char\n }\n\n return loc;\n};\n\nconst visitors = {\n MAP: (node = {}, input = '', ctx = {}) =>\n Object.assign(walk(node.mappings, input), {\n [loc]: getLoc(input, {\n start: node.startPosition,\n end: node.endPosition\n })\n }),\n MAPPING: (node = {}, input = '', ctx = {}) => {\n const value = walk([node.value], input);\n\n if (!isPrimitive(value)) {\n value[loc] = getLoc(input, {\n start: node.startPosition,\n end: node.endPosition\n });\n }\n\n return Object.assign(ctx, {\n [node.key.value]: value\n });\n },\n SCALAR: (node = {}, input = '') => {\n if (isPrimitiveNode(node)) {\n return node.value;\n }\n\n const _loc = getLoc(input, {\n start: node.startPosition,\n end: node.endPosition\n });\n\n const wrappable = Constructor => () => {\n const v = new Constructor(node.value);\n v[loc] = _loc;\n return v;\n };\n\n const object = () => {\n node.value[loc] = _loc;\n return node.value;\n };\n\n const types = {\n boolean: wrappable(Boolean),\n number: wrappable(Number),\n string: wrappable(String),\n function: object,\n object\n };\n\n return types[typeof node.value]();\n },\n SEQ: (node = {}, input = '') => {\n const items = walk(node.items, input, []);\n\n items[loc] = getLoc(input, {\n start: node.startPosition,\n end: node.endPosition\n });\n\n return items;\n }\n};\n\nconst walk = (nodes = [], input, ctx = {}) => {\n const onNode = (node, ctx, fallback) => {\n let visitor; \n if (node) visitor = visitors[Kind[node.kind]];\n return visitor ? visitor(node, input, ctx) : fallback;\n };\n\n const walkObj = () =>\n nodes.reduce((sum, node) => {\n return onNode(node, sum, sum);\n }, ctx);\n\n const walkArr = () =>\n nodes.map(node => onNode(node, ctx, null), ctx).filter(Boolean);\n\n return Array.isArray(ctx) ? walkArr() : walkObj();\n};\n\nmodule.exports.loc = loc;\nmodule.exports.yamlAST = input => walk([load(input)], input);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Ono = void 0;\nconst extend_error_1 = require(\"./extend-error\");\nconst normalize_1 = require(\"./normalize\");\nconst to_json_1 = require(\"./to-json\");\nconst constructor = Ono;\nexports.Ono = constructor;\n/**\n * Creates an `Ono` instance for a specifc error type.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction Ono(ErrorConstructor, options) {\n options = normalize_1.normalizeOptions(options);\n function ono(...args) {\n let { originalError, props, message } = normalize_1.normalizeArgs(args, options);\n // Create a new error of the specified type\n let newError = new ErrorConstructor(message);\n // Extend the error with the properties of the original error and the `props` object\n return extend_error_1.extendError(newError, originalError, props);\n }\n ono[Symbol.species] = ErrorConstructor;\n return ono;\n}\n/**\n * Returns an object containing all properties of the given Error object,\n * which can be used with `JSON.stringify()`.\n */\nOno.toJSON = function toJSON(error) {\n return to_json_1.toJSON.call(error);\n};\n/**\n * Extends the given Error object with enhanced Ono functionality, such as nested stack traces,\n * additional properties, and improved support for `JSON.stringify()`.\n */\nOno.extend = function extend(error, originalError, props) {\n if (props || originalError instanceof Error) {\n return extend_error_1.extendError(error, originalError, props);\n }\n else if (originalError) {\n return extend_error_1.extendError(error, undefined, originalError);\n }\n else {\n return extend_error_1.extendError(error);\n }\n};\n//# sourceMappingURL=constructor.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.extendError = void 0;\nconst isomorphic_node_1 = require(\"./isomorphic.node\");\nconst stack_1 = require(\"./stack\");\nconst to_json_1 = require(\"./to-json\");\nconst protectedProps = [\"name\", \"message\", \"stack\"];\n/**\n * Extends the new error with the properties of the original error and the `props` object.\n *\n * @param newError - The error object to extend\n * @param originalError - The original error object, if any\n * @param props - Additional properties to add, if any\n */\nfunction extendError(error, originalError, props) {\n let onoError = error;\n extendStack(onoError, originalError);\n // Copy properties from the original error\n if (originalError && typeof originalError === \"object\") {\n mergeErrors(onoError, originalError);\n }\n // The default `toJSON` method doesn't output props like `name`, `message`, `stack`, etc.\n // So replace it with one that outputs every property of the error.\n onoError.toJSON = to_json_1.toJSON;\n // On Node.js, add support for the `util.inspect()` method\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (isomorphic_node_1.addInspectMethod) {\n isomorphic_node_1.addInspectMethod(onoError);\n }\n // Finally, copy custom properties that were specified by the user.\n // These props OVERWRITE any previous props\n if (props && typeof props === \"object\") {\n Object.assign(onoError, props);\n }\n return onoError;\n}\nexports.extendError = extendError;\n/**\n * Extend the error stack to include its cause\n */\nfunction extendStack(newError, originalError) {\n let stackProp = Object.getOwnPropertyDescriptor(newError, \"stack\");\n if (stack_1.isLazyStack(stackProp)) {\n stack_1.lazyJoinStacks(stackProp, newError, originalError);\n }\n else if (stack_1.isWritableStack(stackProp)) {\n newError.stack = stack_1.joinStacks(newError, originalError);\n }\n}\n/**\n * Merges properties of the original error with the new error.\n *\n * @param newError - The error object to extend\n * @param originalError - The original error object, if any\n */\nfunction mergeErrors(newError, originalError) {\n // Get the original error's keys\n // NOTE: We specifically exclude properties that we have already set on the new error.\n // This is _especially_ important for the `stack` property, because this property has\n // a lazy getter in some environments\n let keys = to_json_1.getDeepKeys(originalError, protectedProps);\n // HACK: We have to cast the errors to `any` so we can use symbol indexers.\n // see https://github.com/Microsoft/TypeScript/issues/1863\n let _newError = newError;\n let _originalError = originalError;\n for (let key of keys) {\n if (_newError[key] === undefined) {\n try {\n _newError[key] = _originalError[key];\n }\n catch (e) {\n // This property is read-only, so it can't be copied\n }\n }\n }\n}\n//# sourceMappingURL=extend-error.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ono = void 0;\n/* eslint-env commonjs */\nconst singleton_1 = require(\"./singleton\");\nObject.defineProperty(exports, \"ono\", { enumerable: true, get: function () { return singleton_1.ono; } });\nvar constructor_1 = require(\"./constructor\");\nObject.defineProperty(exports, \"Ono\", { enumerable: true, get: function () { return constructor_1.Ono; } });\n__exportStar(require(\"./types\"), exports);\nexports.default = singleton_1.ono;\n// CommonJS default export hack\nif (typeof module === \"object\" && typeof module.exports === \"object\") {\n module.exports = Object.assign(module.exports.default, module.exports);\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addInspectMethod = exports.format = void 0;\nconst util = require(\"util\");\nconst to_json_1 = require(\"./to-json\");\n// The `inspect()` method is actually a Symbol, not a string key.\n// https://nodejs.org/api/util.html#util_util_inspect_custom\nconst inspectMethod = util.inspect.custom || Symbol.for(\"nodejs.util.inspect.custom\");\n/**\n * Ono supports Node's `util.format()` formatting for error messages.\n *\n * @see https://nodejs.org/api/util.html#util_util_format_format_args\n */\nexports.format = util.format;\n/**\n * Adds an `inspect()` method to support Node's `util.inspect()` function.\n *\n * @see https://nodejs.org/api/util.html#util_util_inspect_custom\n */\nfunction addInspectMethod(newError) {\n // @ts-expect-error - TypeScript doesn't support symbol indexers\n newError[inspectMethod] = inspect;\n}\nexports.addInspectMethod = addInspectMethod;\n/**\n * Returns a representation of the error for Node's `util.inspect()` method.\n *\n * @see https://nodejs.org/api/util.html#util_custom_inspection_functions_on_objects\n */\nfunction inspect() {\n // HACK: We have to cast the objects to `any` so we can use symbol indexers.\n // see https://github.com/Microsoft/TypeScript/issues/1863\n let pojo = {};\n let error = this;\n for (let key of to_json_1.getDeepKeys(error)) {\n let value = error[key];\n pojo[key] = value;\n }\n // Don't include the `inspect()` method on the output object,\n // otherwise it will cause `util.inspect()` to go into an infinite loop\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete pojo[inspectMethod];\n return pojo;\n}\n//# sourceMappingURL=isomorphic.node.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.normalizeArgs = exports.normalizeOptions = void 0;\nconst isomorphic_node_1 = require(\"./isomorphic.node\");\n/**\n * Normalizes Ono options, accounting for defaults and optional options.\n */\nfunction normalizeOptions(options) {\n options = options || {};\n return {\n concatMessages: options.concatMessages === undefined ? true : Boolean(options.concatMessages),\n format: options.format === undefined ? isomorphic_node_1.format\n : (typeof options.format === \"function\" ? options.format : false),\n };\n}\nexports.normalizeOptions = normalizeOptions;\n/**\n * Normalizes the Ono arguments, accounting for defaults, options, and optional arguments.\n */\nfunction normalizeArgs(args, options) {\n let originalError;\n let props;\n let formatArgs;\n let message = \"\";\n // Determine which arguments were actually specified\n if (typeof args[0] === \"string\") {\n formatArgs = args;\n }\n else if (typeof args[1] === \"string\") {\n if (args[0] instanceof Error) {\n originalError = args[0];\n }\n else {\n props = args[0];\n }\n formatArgs = args.slice(1);\n }\n else {\n originalError = args[0];\n props = args[1];\n formatArgs = args.slice(2);\n }\n // If there are any format arguments, then format the error message\n if (formatArgs.length > 0) {\n if (options.format) {\n message = options.format.apply(undefined, formatArgs);\n }\n else {\n message = formatArgs.join(\" \");\n }\n }\n if (options.concatMessages && originalError && originalError.message) {\n // The inner-error's message will be added to the new message\n message += (message ? \" \\n\" : \"\") + originalError.message;\n }\n return { originalError, props, message };\n}\nexports.normalizeArgs = normalizeArgs;\n//# sourceMappingURL=normalize.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ono = void 0;\nconst constructor_1 = require(\"./constructor\");\nconst singleton = ono;\nexports.ono = singleton;\nono.error = new constructor_1.Ono(Error);\nono.eval = new constructor_1.Ono(EvalError);\nono.range = new constructor_1.Ono(RangeError);\nono.reference = new constructor_1.Ono(ReferenceError);\nono.syntax = new constructor_1.Ono(SyntaxError);\nono.type = new constructor_1.Ono(TypeError);\nono.uri = new constructor_1.Ono(URIError);\nconst onoMap = ono;\n/**\n * Creates a new error with the specified message, properties, and/or inner error.\n * If an inner error is provided, then the new error will match its type, if possible.\n */\nfunction ono(...args) {\n let originalError = args[0];\n // Is the first argument an Error-like object?\n if (typeof originalError === \"object\" && typeof originalError.name === \"string\") {\n // Try to find an Ono singleton method that matches this error type\n for (let typedOno of Object.values(onoMap)) {\n if (typeof typedOno === \"function\" && typedOno.name === \"ono\") {\n let species = typedOno[Symbol.species];\n if (species && species !== Error && (originalError instanceof species || originalError.name === species.name)) {\n // Create an error of the same type\n return typedOno.apply(undefined, args);\n }\n }\n }\n }\n // By default, create a base Error object\n return ono.error.apply(undefined, args);\n}\n//# sourceMappingURL=singleton.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lazyJoinStacks = exports.joinStacks = exports.isWritableStack = exports.isLazyStack = void 0;\nconst newline = /\\r?\\n/;\nconst onoCall = /\\bono[ @]/;\n/**\n * Is the property lazily computed?\n */\nfunction isLazyStack(stackProp) {\n return Boolean(stackProp &&\n stackProp.configurable &&\n typeof stackProp.get === \"function\");\n}\nexports.isLazyStack = isLazyStack;\n/**\n * Is the stack property writable?\n */\nfunction isWritableStack(stackProp) {\n return Boolean(\n // If there is no stack property, then it's writable, since assigning it will create it\n !stackProp ||\n stackProp.writable ||\n typeof stackProp.set === \"function\");\n}\nexports.isWritableStack = isWritableStack;\n/**\n * Appends the original `Error.stack` property to the new Error's stack.\n */\nfunction joinStacks(newError, originalError) {\n let newStack = popStack(newError.stack);\n let originalStack = originalError ? originalError.stack : undefined;\n if (newStack && originalStack) {\n return newStack + \"\\n\\n\" + originalStack;\n }\n else {\n return newStack || originalStack;\n }\n}\nexports.joinStacks = joinStacks;\n/**\n * Calls `joinStacks` lazily, when the `Error.stack` property is accessed.\n */\nfunction lazyJoinStacks(lazyStack, newError, originalError) {\n if (originalError) {\n Object.defineProperty(newError, \"stack\", {\n get: () => {\n let newStack = lazyStack.get.apply(newError);\n return joinStacks({ stack: newStack }, originalError);\n },\n enumerable: false,\n configurable: true\n });\n }\n else {\n lazyPopStack(newError, lazyStack);\n }\n}\nexports.lazyJoinStacks = lazyJoinStacks;\n/**\n * Removes Ono from the stack, so that the stack starts at the original error location\n */\nfunction popStack(stack) {\n if (stack) {\n let lines = stack.split(newline);\n // Find the Ono call(s) in the stack, and remove them\n let onoStart;\n for (let i = 0; i < lines.length; i++) {\n let line = lines[i];\n if (onoCall.test(line)) {\n if (onoStart === undefined) {\n // We found the first Ono call in the stack trace.\n // There may be other subsequent Ono calls as well.\n onoStart = i;\n }\n }\n else if (onoStart !== undefined) {\n // We found the first non-Ono call after one or more Ono calls.\n // So remove the Ono call lines from the stack trace\n lines.splice(onoStart, i - onoStart);\n break;\n }\n }\n if (lines.length > 0) {\n return lines.join(\"\\n\");\n }\n }\n // If we get here, then the stack doesn't contain a call to `ono`.\n // This may be due to minification or some optimization of the JS engine.\n // So just return the stack as-is.\n return stack;\n}\n/**\n * Calls `popStack` lazily, when the `Error.stack` property is accessed.\n */\nfunction lazyPopStack(error, lazyStack) {\n Object.defineProperty(error, \"stack\", {\n get: () => popStack(lazyStack.get.apply(error)),\n enumerable: false,\n configurable: true\n });\n}\n//# sourceMappingURL=stack.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getDeepKeys = exports.toJSON = void 0;\nconst nonJsonTypes = [\"function\", \"symbol\", \"undefined\"];\nconst protectedProps = [\"constructor\", \"prototype\", \"__proto__\"];\nconst objectPrototype = Object.getPrototypeOf({});\n/**\n * Custom JSON serializer for Error objects.\n * Returns all built-in error properties, as well as extended properties.\n */\nfunction toJSON() {\n // HACK: We have to cast the objects to `any` so we can use symbol indexers.\n // see https://github.com/Microsoft/TypeScript/issues/1863\n let pojo = {};\n let error = this;\n for (let key of getDeepKeys(error)) {\n if (typeof key === \"string\") {\n let value = error[key];\n let type = typeof value;\n if (!nonJsonTypes.includes(type)) {\n pojo[key] = value;\n }\n }\n }\n return pojo;\n}\nexports.toJSON = toJSON;\n/**\n * Returns own, inherited, enumerable, non-enumerable, string, and symbol keys of `obj`.\n * Does NOT return members of the base Object prototype, or the specified omitted keys.\n */\nfunction getDeepKeys(obj, omit = []) {\n let keys = [];\n // Crawl the prototype chain, finding all the string and symbol keys\n while (obj && obj !== objectPrototype) {\n keys = keys.concat(Object.getOwnPropertyNames(obj), Object.getOwnPropertySymbols(obj));\n obj = Object.getPrototypeOf(obj);\n }\n // De-duplicate the list of keys\n let uniqueKeys = new Set(keys);\n // Remove any omitted keys\n for (let key of omit.concat(protectedProps)) {\n uniqueKeys.delete(key);\n }\n return uniqueKeys;\n}\nexports.getDeepKeys = getDeepKeys;\n//# sourceMappingURL=to-json.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"util\");\n//# sourceMappingURL=types.js.map","// add and remove dependency specs to/from pkg manifest\n\nconst add = ({pkg, add, saveBundle, saveType, log}) => {\n for (const spec of add)\n addSingle({pkg, spec, saveBundle, saveType, log})\n\n return pkg\n}\n\n// Canonical source of both the map between saveType and where it correlates to\n// in the package, and the names of all our dependencies attributes\nconst saveTypeMap = new Map([\n ['dev', 'devDependencies'],\n ['optional', 'optionalDependencies'],\n ['prod', 'dependencies'],\n ['peerOptional', 'peerDependencies'],\n ['peer', 'peerDependencies'],\n])\n\nconst addSingle = ({pkg, spec, saveBundle, saveType, log}) => {\n const { name, rawSpec } = spec\n\n // if the user does not give us a type, we infer which type(s)\n // to keep based on the same order of priority we do when\n // building the tree as defined in the _loadDeps method of\n // the node class.\n if (!saveType)\n saveType = inferSaveType(pkg, spec.name)\n\n if (saveType === 'prod') {\n // a production dependency can only exist as production (rpj ensures it\n // doesn't coexist w/ optional)\n deleteSubKey(pkg, 'devDependencies', name, 'dependencies', log)\n deleteSubKey(pkg, 'peerDependencies', name, 'dependencies', log)\n } else if (saveType === 'dev') {\n // a dev dependency may co-exist as peer, or optional, but not production\n deleteSubKey(pkg, 'dependencies', name, 'devDependencies', log)\n } else if (saveType === 'optional') {\n // an optional dependency may co-exist as dev (rpj ensures it doesn't\n // coexist w/ prod)\n deleteSubKey(pkg, 'peerDependencies', name, 'optionalDependencies', log)\n } else { // peer or peerOptional is all that's left\n // a peer dependency may coexist as dev\n deleteSubKey(pkg, 'dependencies', name, 'peerDependencies', log)\n deleteSubKey(pkg, 'optionalDependencies', name, 'peerDependencies', log)\n }\n\n const depType = saveTypeMap.get(saveType)\n\n pkg[depType] = pkg[depType] || {}\n if (rawSpec !== '' || pkg[depType][name] === undefined)\n pkg[depType][name] = rawSpec || '*'\n if (saveType === 'optional') {\n // Affordance for previous npm versions that require this behaviour\n pkg.dependencies = pkg.dependencies || {}\n pkg.dependencies[name] = pkg.optionalDependencies[name]\n }\n\n if (saveType === 'peer' || saveType === 'peerOptional') {\n const pdm = pkg.peerDependenciesMeta || {}\n if (saveType === 'peer' && pdm[name] && pdm[name].optional)\n pdm[name].optional = false\n else if (saveType === 'peerOptional') {\n pdm[name] = pdm[name] || {}\n pdm[name].optional = true\n pkg.peerDependenciesMeta = pdm\n }\n // peerDeps are often also a devDep, so that they can be tested when\n // using package managers that don't auto-install peer deps\n if (pkg.devDependencies && pkg.devDependencies[name] !== undefined)\n pkg.devDependencies[name] = pkg.peerDependencies[name]\n }\n\n if (saveBundle && saveType !== 'peer' && saveType !== 'peerOptional') {\n // keep it sorted, keep it unique\n const bd = new Set(pkg.bundleDependencies || [])\n bd.add(spec.name)\n pkg.bundleDependencies = [...bd].sort((a, b) => a.localeCompare(b, 'en'))\n }\n}\n\n// Finds where the package is already in the spec and infers saveType from that\nconst inferSaveType = (pkg, name) => {\n for (const saveType of saveTypeMap.keys()) {\n if (hasSubKey(pkg, saveTypeMap.get(saveType), name)) {\n if (\n saveType === 'peerOptional' &&\n (!hasSubKey(pkg, 'peerDependenciesMeta', name) ||\n !pkg.peerDependenciesMeta[name].optional)\n )\n return 'peer'\n return saveType\n }\n }\n return 'prod'\n}\n\nconst hasSubKey = (pkg, depType, name) => {\n return pkg[depType] && Object.prototype.hasOwnProperty.call(pkg[depType], name)\n}\n\n// Removes a subkey and warns about it if it's being replaced\nconst deleteSubKey = (pkg, depType, name, replacedBy, log) => {\n if (hasSubKey(pkg, depType, name)) {\n if (replacedBy && log)\n log.warn('idealTree', `Removing ${depType}.${name} in favor of ${replacedBy}.${name}`)\n delete pkg[depType][name]\n\n // clean up peerDependenciesMeta if we are removing something from peerDependencies\n if (depType === 'peerDependencies' && pkg.peerDependenciesMeta) {\n delete pkg.peerDependenciesMeta[name]\n if (!Object.keys(pkg.peerDependenciesMeta).length)\n delete pkg.peerDependenciesMeta\n }\n\n if (!Object.keys(pkg[depType]).length)\n delete pkg[depType]\n }\n}\n\nconst rm = (pkg, rm) => {\n for (const depType of new Set(saveTypeMap.values())) {\n for (const name of rm)\n deleteSubKey(pkg, depType, name)\n }\n if (pkg.bundleDependencies) {\n pkg.bundleDependencies = pkg.bundleDependencies\n .filter(name => !rm.includes(name))\n if (!pkg.bundleDependencies.length)\n delete pkg.bundleDependencies\n }\n return pkg\n}\n\nmodule.exports = { add, rm, saveTypeMap, hasSubKey }\n","// mixin implementing the audit method\n\nconst AuditReport = require('../audit-report.js')\n\n// shared with reify\nconst _global = Symbol.for('global')\nconst _workspaces = Symbol.for('workspaces')\n\nmodule.exports = cls => class Auditor extends cls {\n async audit (options = {}) {\n this.addTracker('audit')\n if (this[_global]) {\n throw Object.assign(\n new Error('`npm audit` does not support testing globals'),\n { code: 'EAUDITGLOBAL' }\n )\n }\n\n // allow the user to set options on the ctor as well.\n // XXX: deprecate separate method options objects.\n options = { ...this.options, ...options }\n\n process.emit('time', 'audit')\n const tree = await this.loadVirtual()\n if (this[_workspaces] && this[_workspaces].length)\n options.filterSet = this.workspaceDependencySet(tree, this[_workspaces])\n this.auditReport = await AuditReport.load(tree, options)\n const ret = options.fix ? this.reify(options) : this.auditReport\n process.emit('timeEnd', 'audit')\n this.finishTracker('audit')\n return ret\n }\n}\n","// mixin implementing the buildIdealTree method\nconst rpj = require('read-package-json-fast')\nconst npa = require('npm-package-arg')\nconst pacote = require('pacote')\nconst cacache = require('cacache')\nconst semver = require('semver')\nconst promiseCallLimit = require('promise-call-limit')\nconst getPeerSet = require('../peer-set.js')\nconst realpath = require('../../lib/realpath.js')\nconst { resolve, dirname } = require('path')\nconst { promisify } = require('util')\nconst treeCheck = require('../tree-check.js')\nconst readdir = promisify(require('readdir-scoped-modules'))\n\nconst debug = require('../debug.js')\nconst fromPath = require('../from-path.js')\nconst calcDepFlags = require('../calc-dep-flags.js')\nconst Shrinkwrap = require('../shrinkwrap.js')\nconst Node = require('../node.js')\nconst Link = require('../link.js')\nconst addRmPkgDeps = require('../add-rm-pkg-deps.js')\nconst gatherDepSet = require('../gather-dep-set.js')\nconst optionalSet = require('../optional-set.js')\nconst {checkEngine, checkPlatform} = require('npm-install-checks')\n\n// enum of return values for canPlaceDep.\n// No, this is a conflict, you may not put that package here\nconst CONFLICT = Symbol('CONFLICT')\n// Yes, this is fine, and should not be a problem\nconst OK = Symbol('OK')\n// No need, because the package already here is fine\nconst KEEP = Symbol('KEEP')\n// Yes, clobber the package that is already here\nconst REPLACE = Symbol('REPLACE')\n\nconst relpath = require('../relpath.js')\n\n// note: some of these symbols are shared so we can hit\n// them with unit tests and reuse them across mixins\nconst _complete = Symbol('complete')\nconst _depsSeen = Symbol('depsSeen')\nconst _depsQueue = Symbol('depsQueue')\nconst _currentDep = Symbol('currentDep')\nconst _updateAll = Symbol('updateAll')\nconst _mutateTree = Symbol('mutateTree')\nconst _flagsSuspect = Symbol.for('flagsSuspect')\nconst _workspaces = Symbol.for('workspaces')\nconst _prune = Symbol('prune')\nconst _preferDedupe = Symbol('preferDedupe')\nconst _pruneDedupable = Symbol('pruneDedupable')\nconst _legacyBundling = Symbol('legacyBundling')\nconst _parseSettings = Symbol('parseSettings')\nconst _initTree = Symbol('initTree')\nconst _applyUserRequests = Symbol('applyUserRequests')\nconst _applyUserRequestsToNode = Symbol('applyUserRequestsToNode')\nconst _inflateAncientLockfile = Symbol('inflateAncientLockfile')\nconst _buildDeps = Symbol('buildDeps')\nconst _buildDepStep = Symbol('buildDepStep')\nconst _nodeFromEdge = Symbol('nodeFromEdge')\nconst _nodeFromSpec = Symbol('nodeFromSpec')\nconst _fetchManifest = Symbol('fetchManifest')\nconst _problemEdges = Symbol('problemEdges')\nconst _manifests = Symbol('manifests')\nconst _loadWorkspaces = Symbol.for('loadWorkspaces')\nconst _linkFromSpec = Symbol('linkFromSpec')\nconst _loadPeerSet = Symbol('loadPeerSet')\nconst _updateNames = Symbol.for('updateNames')\nconst _placeDep = Symbol.for('placeDep')\nconst _canPlaceDep = Symbol.for('canPlaceDep')\nconst _canPlacePeers = Symbol('canPlacePeers')\nconst _pruneForReplacement = Symbol('pruneForReplacement')\nconst _fixDepFlags = Symbol('fixDepFlags')\nconst _resolveLinks = Symbol('resolveLinks')\nconst _rootNodeFromPackage = Symbol('rootNodeFromPackage')\nconst _add = Symbol('add')\nconst _resolvedAdd = Symbol.for('resolvedAdd')\nconst _queueNamedUpdates = Symbol('queueNamedUpdates')\nconst _queueVulnDependents = Symbol('queueVulnDependents')\nconst _avoidRange = Symbol('avoidRange')\nconst _shouldUpdateNode = Symbol('shouldUpdateNode')\nconst resetDepFlags = require('../reset-dep-flags.js')\nconst _loadFailures = Symbol('loadFailures')\nconst _pruneFailedOptional = Symbol('pruneFailedOptional')\nconst _linkNodes = Symbol('linkNodes')\nconst _follow = Symbol('follow')\nconst _globalStyle = Symbol('globalStyle')\nconst _globalRootNode = Symbol('globalRootNode')\nconst _isVulnerable = Symbol.for('isVulnerable')\nconst _usePackageLock = Symbol.for('usePackageLock')\nconst _rpcache = Symbol.for('realpathCache')\nconst _stcache = Symbol.for('statCache')\nconst _updateFilePath = Symbol('updateFilePath')\nconst _followSymlinkPath = Symbol('followSymlinkPath')\nconst _getRelpathSpec = Symbol('getRelpathSpec')\nconst _retrieveSpecName = Symbol('retrieveSpecName')\nconst _strictPeerDeps = Symbol('strictPeerDeps')\nconst _checkEngineAndPlatform = Symbol('checkEngineAndPlatform')\nconst _checkEngine = Symbol('checkEngine')\nconst _checkPlatform = Symbol('checkPlatform')\nconst _virtualRoots = Symbol('virtualRoots')\nconst _virtualRoot = Symbol('virtualRoot')\n\n// used for the ERESOLVE error to show the last peer conflict encountered\nconst _peerConflict = Symbol('peerConflict')\n\nconst _failPeerConflict = Symbol('failPeerConflict')\nconst _explainPeerConflict = Symbol('explainPeerConflict')\nconst _warnPeerConflict = Symbol('warnPeerConflict')\nconst _edgesOverridden = Symbol('edgesOverridden')\n// exposed symbol for unit testing the placeDep method directly\nconst _peerSetSource = Symbol.for('peerSetSource')\n\n// used by Reify mixin\nconst _force = Symbol.for('force')\nconst _explicitRequests = Symbol('explicitRequests')\nconst _global = Symbol.for('global')\nconst _idealTreePrune = Symbol.for('idealTreePrune')\n\nmodule.exports = cls => class IdealTreeBuilder extends cls {\n constructor (options) {\n super(options)\n\n // normalize trailing slash\n const registry = options.registry || 'https://registry.npmjs.org'\n options.registry = this.registry = registry.replace(/\\/+$/, '') + '/'\n\n const {\n idealTree = null,\n global = false,\n follow = false,\n globalStyle = false,\n legacyPeerDeps = false,\n force = false,\n packageLock = true,\n strictPeerDeps = false,\n workspaces = [],\n } = options\n\n this[_workspaces] = workspaces || []\n this[_force] = !!force\n this[_strictPeerDeps] = !!strictPeerDeps\n\n this.idealTree = idealTree\n this.legacyPeerDeps = legacyPeerDeps\n\n this[_usePackageLock] = packageLock\n this[_global] = !!global\n this[_globalStyle] = this[_global] || globalStyle\n this[_follow] = !!follow\n\n if (this[_workspaces].length && this[_global])\n throw new Error('Cannot operate on workspaces in global mode')\n\n this[_explicitRequests] = new Set()\n this[_preferDedupe] = false\n this[_legacyBundling] = false\n this[_depsSeen] = new Set()\n this[_depsQueue] = []\n this[_currentDep] = null\n this[_updateNames] = []\n this[_updateAll] = false\n this[_mutateTree] = false\n this[_loadFailures] = new Set()\n this[_linkNodes] = new Set()\n this[_manifests] = new Map()\n this[_peerConflict] = null\n this[_edgesOverridden] = new Set()\n this[_resolvedAdd] = []\n\n // a map of each module in a peer set to the thing that depended on\n // that set of peers in the first place. Use a WeakMap so that we\n // don't hold onto references for nodes that are garbage collected.\n this[_peerSetSource] = new WeakMap()\n this[_virtualRoots] = new Map()\n }\n\n get explicitRequests () {\n return new Set(this[_explicitRequests])\n }\n\n // public method\n async buildIdealTree (options = {}) {\n if (this.idealTree)\n return Promise.resolve(this.idealTree)\n\n // allow the user to set reify options on the ctor as well.\n // XXX: deprecate separate reify() options object.\n options = { ...this.options, ...options }\n\n // an empty array or any falsey value is the same as null\n if (!options.add || options.add.length === 0)\n options.add = null\n if (!options.rm || options.rm.length === 0)\n options.rm = null\n\n process.emit('time', 'idealTree')\n\n if (!options.add && !options.rm && !options.update && this[_global]) {\n const er = new Error('global requires add, rm, or update option')\n return Promise.reject(er)\n }\n\n // first get the virtual tree, if possible. If there's a lockfile, then\n // that defines the ideal tree, unless the root package.json is not\n // satisfied by what the ideal tree provides.\n // from there, we start adding nodes to it to satisfy the deps requested\n // by the package.json in the root.\n\n this[_parseSettings](options)\n\n // start tracker block\n this.addTracker('idealTree')\n\n try {\n await this[_initTree]()\n await this[_inflateAncientLockfile]()\n await this[_applyUserRequests](options)\n await this[_buildDeps]()\n await this[_fixDepFlags]()\n await this[_pruneFailedOptional]()\n await this[_checkEngineAndPlatform]()\n } finally {\n process.emit('timeEnd', 'idealTree')\n this.finishTracker('idealTree')\n }\n\n return treeCheck(this.idealTree)\n }\n\n [_checkEngineAndPlatform] () {\n // engine/platform checks throw, so start the promise chain off first\n return Promise.resolve()\n .then(() => {\n for (const node of this.idealTree.inventory.values()) {\n if (!node.optional) {\n this[_checkEngine](node)\n this[_checkPlatform](node)\n }\n }\n })\n }\n\n [_checkPlatform] (node) {\n checkPlatform(node.package, this[_force])\n }\n\n [_checkEngine] (node) {\n const { engineStrict, npmVersion, nodeVersion } = this.options\n const c = () => checkEngine(node.package, npmVersion, nodeVersion, this[_force])\n\n if (engineStrict)\n c()\n else {\n try {\n c()\n } catch (er) {\n this.log.warn(er.code, er.message, {\n package: er.pkgid,\n required: er.required,\n current: er.current,\n })\n }\n }\n }\n\n [_parseSettings] (options) {\n const update = options.update === true ? { all: true }\n : Array.isArray(options.update) ? { names: options.update }\n : options.update || {}\n\n if (update.all || !Array.isArray(update.names))\n update.names = []\n\n this[_complete] = !!options.complete\n this[_preferDedupe] = !!options.preferDedupe\n this[_legacyBundling] = !!options.legacyBundling\n this[_updateNames] = update.names\n\n this[_updateAll] = update.all\n // we prune by default unless explicitly set to boolean false\n this[_prune] = options.prune !== false\n\n // set if we add anything, but also set here if we know we'll make\n // changes and thus have to maybe prune later.\n this[_mutateTree] = !!(\n options.add ||\n options.rm ||\n update.all ||\n update.names.length\n )\n }\n\n // load the initial tree, either the virtualTree from a shrinkwrap,\n // or just the root node from a package.json\n [_initTree] () {\n process.emit('time', 'idealTree:init')\n return (\n this[_global] ? this[_globalRootNode]()\n : rpj(this.path + '/package.json').then(\n pkg => this[_rootNodeFromPackage](pkg),\n er => {\n if (er.code === 'EJSONPARSE')\n throw er\n return this[_rootNodeFromPackage]({})\n }\n ))\n .then(root => this[_loadWorkspaces](root))\n // ok to not have a virtual tree. probably initial install.\n // When updating all, we load the shrinkwrap, but don't bother\n // to build out the full virtual tree from it, since we'll be\n // reconstructing it anyway.\n .then(root => this[_global] ? root\n : !this[_usePackageLock] || this[_updateAll]\n ? Shrinkwrap.reset({ path: this.path })\n .then(meta => Object.assign(root, {meta}))\n : this.loadVirtual({ root }))\n\n // if we don't have a lockfile to go from, then start with the\n // actual tree, so we only make the minimum required changes.\n // don't do this for global installs or updates, because in those\n // cases we don't use a lockfile anyway.\n // Load on a new Arborist object, so the Nodes aren't the same,\n // or else it'll get super confusing when we change them!\n .then(async root => {\n if (!this[_updateAll] && !this[_global] && !root.meta.loadedFromDisk) {\n await new this.constructor(this.options).loadActual({ root })\n const tree = root.target || root\n // even though we didn't load it from a package-lock.json FILE,\n // we still loaded it \"from disk\", meaning we have to reset\n // dep flags before assuming that any mutations were reflected.\n if (tree.children.size)\n root.meta.loadedFromDisk = true\n }\n return root\n })\n\n .then(tree => {\n // null the virtual tree, because we're about to hack away at it\n // if you want another one, load another copy.\n this.idealTree = tree\n this.virtualTree = null\n process.emit('timeEnd', 'idealTree:init')\n })\n }\n\n async [_globalRootNode] () {\n const root = await this[_rootNodeFromPackage]({ dependencies: {} })\n // this is a gross kludge to handle the fact that we don't save\n // metadata on the root node in global installs, because the \"root\"\n // node is something like /usr/local/lib.\n const meta = new Shrinkwrap({ path: this.path })\n meta.reset()\n root.meta = meta\n return root\n }\n\n async [_rootNodeFromPackage] (pkg) {\n // if the path doesn't exist, then we explode at this point. Note that\n // this is not a problem for reify(), since it creates the root path\n // before ever loading trees.\n // TODO: make buildIdealTree() and loadActual handle a missing root path,\n // or a symlink to a missing target, and let reify() create it as needed.\n const real = await realpath(this.path, this[_rpcache], this[_stcache])\n const Cls = real === this.path ? Node : Link\n const root = new Cls({\n path: this.path,\n realpath: real,\n pkg,\n extraneous: false,\n dev: false,\n devOptional: false,\n peer: false,\n optional: false,\n global: this[_global],\n legacyPeerDeps: this.legacyPeerDeps,\n })\n if (root.isLink) {\n root.target = new Node({\n path: real,\n realpath: real,\n pkg,\n extraneous: false,\n dev: false,\n devOptional: false,\n peer: false,\n optional: false,\n global: this[_global],\n legacyPeerDeps: this.legacyPeerDeps,\n root,\n })\n }\n return root\n }\n\n // process the add/rm requests by modifying the root node, and the\n // update.names request by queueing nodes dependent on those named.\n async [_applyUserRequests] (options) {\n process.emit('time', 'idealTree:userRequests')\n const tree = this.idealTree.target || this.idealTree\n\n if (!this[_workspaces].length)\n await this[_applyUserRequestsToNode](tree, options)\n else {\n await Promise.all(this.workspaceNodes(tree, this[_workspaces])\n .map(node => this[_applyUserRequestsToNode](node, options)))\n }\n\n process.emit('timeEnd', 'idealTree:userRequests')\n }\n\n async [_applyUserRequestsToNode] (tree, options) {\n // If we have a list of package names to update, and we know it's\n // going to update them wherever they are, add any paths into those\n // named nodes to the buildIdealTree queue.\n if (!this[_global] && this[_updateNames].length)\n this[_queueNamedUpdates]()\n\n // global updates only update the globalTop nodes, but we need to know\n // that they're there, and not reinstall the world unnecessarily.\n const globalExplicitUpdateNames = []\n if (this[_global] && (this[_updateAll] || this[_updateNames].length)) {\n const nm = resolve(this.path, 'node_modules')\n for (const name of await readdir(nm).catch(() => [])) {\n tree.package.dependencies = tree.package.dependencies || {}\n const updateName = this[_updateNames].includes(name)\n if (this[_updateAll] || updateName) {\n if (updateName)\n globalExplicitUpdateNames.push(name)\n tree.package.dependencies[name] = '*'\n }\n }\n }\n\n if (this.auditReport && this.auditReport.size > 0)\n await this[_queueVulnDependents](options)\n\n const { add, rm } = options\n\n if (rm && rm.length) {\n addRmPkgDeps.rm(tree.package, rm)\n for (const name of rm)\n this[_explicitRequests].add({ from: tree, name, action: 'DELETE' })\n }\n\n if (add && add.length)\n await this[_add](tree, options)\n\n // triggers a refresh of all edgesOut. this has to be done BEFORE\n // adding the edges to explicitRequests, because the package setter\n // resets all edgesOut.\n if (add && add.length || rm && rm.length || this[_global])\n tree.package = tree.package\n\n for (const spec of this[_resolvedAdd]) {\n if (spec.tree === tree)\n this[_explicitRequests].add(tree.edgesOut.get(spec.name))\n }\n for (const name of globalExplicitUpdateNames)\n this[_explicitRequests].add(tree.edgesOut.get(name))\n\n this[_depsQueue].push(tree)\n }\n\n // This returns a promise because we might not have the name yet,\n // and need to call pacote.manifest to find the name.\n [_add] (tree, {add, saveType = null, saveBundle = false}) {\n // get the name for each of the specs in the list.\n // ie, doing `foo@bar` we just return foo\n // but if it's a url or git, we don't know the name until we\n // fetch it and look in its manifest.\n return Promise.all(add.map(async rawSpec => {\n // We do NOT provide the path to npa here, because user-additions\n // need to be resolved relative to the CWD the user is in.\n const spec = await this[_retrieveSpecName](npa(rawSpec))\n .then(spec => this[_updateFilePath](spec))\n .then(spec => this[_followSymlinkPath](spec))\n spec.tree = tree\n return spec\n })).then(add => {\n this[_resolvedAdd].push(...add)\n // now add is a list of spec objects with names.\n // find a home for each of them!\n addRmPkgDeps.add({\n pkg: tree.package,\n add,\n saveBundle,\n saveType,\n path: this.path,\n log: this.log,\n })\n })\n }\n\n async [_retrieveSpecName] (spec) {\n // if it's just @'' then we reload whatever's there, or get latest\n // if it's an explicit tag, we need to install that specific tag version\n const isTag = spec.rawSpec && spec.type === 'tag'\n\n if (spec.name && !isTag)\n return spec\n\n const mani = await pacote.manifest(spec, { ...this.options })\n // if it's a tag type, then we need to run it down to an actual version\n if (isTag)\n return npa(`${mani.name}@${mani.version}`)\n\n spec.name = mani.name\n return spec\n }\n\n async [_updateFilePath] (spec) {\n if (spec.type === 'file')\n return this[_getRelpathSpec](spec, spec.fetchSpec)\n\n return spec\n }\n\n async [_followSymlinkPath] (spec) {\n if (spec.type === 'directory') {\n const real = await (\n realpath(spec.fetchSpec, this[_rpcache], this[_stcache])\n // TODO: create synthetic test case to simulate realpath failure\n .catch(/* istanbul ignore next */() => null)\n )\n\n return this[_getRelpathSpec](spec, real)\n }\n return spec\n }\n\n [_getRelpathSpec] (spec, filepath) {\n /* istanbul ignore else - should also be covered by realpath failure */\n if (filepath) {\n const { name } = spec\n const tree = this.idealTree.target || this.idealTree\n spec = npa(`file:${relpath(tree.path, filepath)}`, tree.path)\n spec.name = name\n }\n return spec\n }\n\n // TODO: provide a way to fix bundled deps by exposing metadata about\n // what's in the bundle at each published manifest. Without that, we\n // can't possibly fix bundled deps without breaking a ton of other stuff,\n // and leaving the user subject to getting it overwritten later anyway.\n async [_queueVulnDependents] (options) {\n for (const vuln of this.auditReport.values()) {\n for (const node of vuln.nodes) {\n const bundler = node.getBundler()\n\n // XXX this belongs in the audit report itself, not here.\n // We shouldn't even get these things here, and they shouldn't\n // be printed by npm-audit-report as if they can be fixed, because\n // they can't.\n if (bundler) {\n this.log.warn(`audit fix ${node.name}@${node.version}`,\n `${node.location}\\nis a bundled dependency of\\n${\n bundler.name}@${bundler.version} at ${bundler.location}\\n` +\n 'It cannot be fixed automatically.\\n' +\n `Check for updates to the ${bundler.name} package.`)\n continue\n }\n\n for (const edge of node.edgesIn) {\n this.addTracker('idealTree', edge.from.name, edge.from.location)\n this[_depsQueue].push(edge.from)\n }\n }\n }\n\n // note any that can't be fixed at the root level without --force\n // if there's a fix, we use that. otherwise, the user has to remove it,\n // find a different thing, fix the upstream, etc.\n //\n // XXX: how to handle top nodes that aren't the root? Maybe the report\n // just tells the user to cd into that directory and fix it?\n if (this[_force] && this.auditReport && this.auditReport.topVulns.size) {\n options.add = options.add || []\n options.rm = options.rm || []\n const nodesTouched = new Set()\n for (const [name, topVuln] of this.auditReport.topVulns.entries()) {\n const {\n simpleRange,\n topNodes,\n fixAvailable,\n } = topVuln\n for (const node of topNodes) {\n if (!node.isProjectRoot && !node.isWorkspace) {\n // not something we're going to fix, sorry. have to cd into\n // that directory and fix it yourself.\n this.log.warn('audit', 'Manual fix required in linked project ' +\n `at ./${node.location} for ${name}@${simpleRange}.\\n` +\n `'cd ./${node.location}' and run 'npm audit' for details.`)\n continue\n }\n\n if (!fixAvailable) {\n this.log.warn('audit', `No fix available for ${name}@${simpleRange}`)\n continue\n }\n\n const { isSemVerMajor, version } = fixAvailable\n const breakingMessage = isSemVerMajor\n ? 'a SemVer major change'\n : 'outside your stated dependency range'\n this.log.warn('audit', `Updating ${name} to ${version},` +\n `which is ${breakingMessage}.`)\n\n await this[_add](node, { add: [`${name}@${version}`] })\n nodesTouched.add(node)\n }\n }\n for (const node of nodesTouched)\n node.package = node.package\n }\n }\n\n [_isVulnerable] (node) {\n return this.auditReport && this.auditReport.isVulnerable(node)\n }\n\n [_avoidRange] (name) {\n if (!this.auditReport)\n return null\n const vuln = this.auditReport.get(name)\n if (!vuln)\n return null\n return vuln.range\n }\n\n [_queueNamedUpdates] () {\n // ignore top nodes, since they are not loaded the same way, and\n // probably have their own project associated with them.\n\n // for every node with one of the names on the list, we add its\n // dependents to the queue to be evaluated. in buildDepStep,\n // anything on the update names list will get refreshed, even if\n // it isn't a problem.\n\n // XXX this could be faster by doing a series of inventory.query('name')\n // calls rather than walking over everything in the tree.\n const set = this.idealTree.inventory\n .filter(n => this[_shouldUpdateNode](n))\n for (const node of set) {\n for (const edge of node.edgesIn) {\n this.addTracker('idealTree', edge.from.name, edge.from.location)\n this[_depsQueue].push(edge.from)\n }\n }\n }\n\n [_shouldUpdateNode] (node) {\n return this[_updateNames].includes(node.name) &&\n !node.isTop &&\n !node.inDepBundle &&\n !node.inShrinkwrap\n }\n\n async [_inflateAncientLockfile] () {\n const { meta, inventory } = this.idealTree\n const ancient = meta.ancientLockfile\n const old = meta.loadedFromDisk && !(meta.originalLockfileVersion >= 2)\n\n if (inventory.size === 0 || !ancient && !old)\n return\n\n // if the lockfile is from node v5 or earlier, then we'll have to reload\n // all the manifests of everything we encounter. this is costly, but at\n // least it's just a one-time hit.\n process.emit('time', 'idealTree:inflate')\n\n const heading = ancient ? 'ancient lockfile' : 'old lockfile'\n this.log.warn(heading,\n `\nThe ${meta.type} file was created with an old version of npm,\nso supplemental metadata must be fetched from the registry.\n\nThis is a one-time fix-up, please be patient...\n`)\n\n this.addTracker('idealTree:inflate')\n const queue = []\n for (const node of inventory.values()) {\n if (node.isProjectRoot)\n continue\n\n queue.push(async () => {\n this.log.silly('inflate', node.location)\n const { resolved, version, path, name, location, integrity } = node\n // don't try to hit the registry for linked deps\n const useResolved = resolved && (\n !version || resolved.startsWith('file:')\n )\n const id = useResolved ? resolved\n : version || `file:${node.path}`\n const spec = npa.resolve(name, id, dirname(path))\n const sloc = location.substr('node_modules/'.length)\n const t = `idealTree:inflate:${sloc}`\n this.addTracker(t)\n await pacote.manifest(spec, {\n ...this.options,\n resolved: resolved,\n integrity: integrity,\n fullMetadata: false,\n }).then(mani => {\n node.package = { ...mani, _id: `${mani.name}@${mani.version}` }\n }).catch((er) => {\n const warning = `Could not fetch metadata for ${name}@${id}`\n this.log.warn(heading, warning, er)\n })\n this.finishTracker(t)\n })\n }\n await promiseCallLimit(queue)\n\n // have to re-calc dep flags, because the nodes don't have edges\n // until their packages get assigned, so everything looks extraneous\n calcDepFlags(this.idealTree)\n\n // yes, yes, this isn't the \"original\" version, but now that it's been\n // upgraded, we need to make sure we don't do the work to upgrade it\n // again, since it's now as new as can be.\n meta.originalLockfileVersion = 2\n this.finishTracker('idealTree:inflate')\n process.emit('timeEnd', 'idealTree:inflate')\n }\n\n // at this point we have a virtual tree with the actual root node's\n // package deps, which may be partly or entirely incomplete, invalid\n // or extraneous.\n [_buildDeps] () {\n process.emit('time', 'idealTree:buildDeps')\n const tree = this.idealTree.target || this.idealTree\n this[_depsQueue].push(tree)\n this.log.silly('idealTree', 'buildDeps')\n this.addTracker('idealTree', tree.name, '')\n return this[_buildDepStep]()\n .then(() => process.emit('timeEnd', 'idealTree:buildDeps'))\n }\n\n async [_buildDepStep] () {\n // removes tracker of previous dependency in the queue\n if (this[_currentDep]) {\n const { location, name } = this[_currentDep]\n process.emit('timeEnd', `idealTree:${location || '#root'}`)\n this.finishTracker('idealTree', name, location)\n this[_currentDep] = null\n }\n\n if (!this[_depsQueue].length)\n return this[_resolveLinks]()\n\n // sort physically shallower deps up to the front of the queue,\n // because they'll affect things deeper in, then alphabetical\n this[_depsQueue].sort((a, b) =>\n (a.depth - b.depth) || a.path.localeCompare(b.path, 'en'))\n\n const node = this[_depsQueue].shift()\n const bd = node.package.bundleDependencies\n const hasBundle = bd && Array.isArray(bd) && bd.length\n const { hasShrinkwrap } = node\n\n // if the node was already visited, or has since been removed from the\n // tree, skip over it and process the rest of the queue. If a node has\n // a shrinkwrap, also skip it, because it's going to get its deps\n // satisfied by whatever's in that file anyway.\n if (this[_depsSeen].has(node) ||\n node.root !== this.idealTree ||\n hasShrinkwrap && !this[_complete])\n return this[_buildDepStep]()\n\n this[_depsSeen].add(node)\n this[_currentDep] = node\n process.emit('time', `idealTree:${node.location || '#root'}`)\n\n // if we're loading a _complete_ ideal tree, for a --package-lock-only\n // installation for example, we have to crack open the tarball and\n // look inside if it has bundle deps or shrinkwraps. note that this is\n // not necessary during a reification, because we just update the\n // ideal tree by reading bundles/shrinkwraps in place.\n // Don't bother if the node is from the actual tree and hasn't\n // been resolved, because we can't fetch it anyway, could be anything!\n const crackOpen = this[_complete] &&\n node !== this.idealTree &&\n node.resolved &&\n (hasBundle || hasShrinkwrap)\n if (crackOpen) {\n const Arborist = this.constructor\n const opt = { ...this.options }\n await cacache.tmp.withTmp(this.cache, opt, async path => {\n await pacote.extract(node.resolved, path, opt)\n\n if (hasShrinkwrap) {\n await new Arborist({ ...this.options, path })\n .loadVirtual({ root: node })\n }\n\n if (hasBundle) {\n await new Arborist({ ...this.options, path })\n .loadActual({ root: node, ignoreMissing: true })\n }\n })\n }\n\n // if any deps are missing or invalid, then we fetch the manifest for\n // the thing we want, and build a new dep node from that.\n // Then, find the ideal placement for that node. The ideal placement\n // searches from the node's deps (or parent deps in the case of non-root\n // peer deps), and walks up the tree until it finds the highest spot\n // where it doesn't cause any conflicts.\n //\n // A conflict can be:\n // - A node by that name already exists at that location.\n // - The parent has a peer dep on that name\n // - One of the node's peer deps conflicts at that location, unless the\n // peer dep is met by a node at that location, which is fine.\n //\n // If we create a new node, then build its ideal deps as well.\n //\n // Note: this is the same \"maximally naive\" deduping tree-building\n // algorithm that npm has used since v3. In a case like this:\n //\n // root -> (a@1, b@1||2)\n // a -> (b@1)\n //\n // You'll end up with a tree like this:\n //\n // root\n // +-- a@1\n // | +-- b@1\n // +-- b@2\n //\n // rather than this, more deduped, but just as correct tree:\n //\n // root\n // +-- a@1\n // +-- b@1\n //\n // Another way to look at it is that this algorithm favors getting higher\n // version deps at higher levels in the tree, even if that reduces\n // potential deduplication.\n //\n // Set `preferDedupe: true` in the options to replace the shallower\n // dep if allowed.\n\n const tasks = []\n const peerSource = this[_peerSetSource].get(node) || node\n for (const edge of this[_problemEdges](node)) {\n if (this[_edgesOverridden].has(edge))\n continue\n\n // peerSetSource is only relevant when we have a peerEntryEdge\n // otherwise we're setting regular non-peer deps as if they have\n // a virtual root of whatever brought in THIS node.\n // so we VR the node itself if the edge is not a peer\n const source = edge.peer ? peerSource : node\n\n const virtualRoot = this[_virtualRoot](source, true)\n // reuse virtual root if we already have one, but don't\n // try to do the override ahead of time, since we MAY be able\n // to create a more correct tree than the virtual root could.\n const vrEdge = virtualRoot && virtualRoot.edgesOut.get(edge.name)\n const vrDep = vrEdge && vrEdge.valid && vrEdge.to\n // only re-use the virtualRoot if it's a peer edge we're placing.\n // otherwise, we end up in situations where we override peer deps that\n // we could have otherwise found homes for. Eg:\n // xy -> (x, y)\n // x -> PEER(z@1)\n // y -> PEER(z@2)\n // If xy is a dependency, we can resolve this like:\n // project\n // +-- xy\n // | +-- y\n // | +-- z@2\n // +-- x\n // +-- z@1\n // But if x and y are loaded in the same virtual root, then they will\n // be forced to agree on a version of z.\n const required = new Set([edge.from])\n const parent = edge.peer ? virtualRoot : null\n const dep = vrDep && vrDep.satisfies(edge) ? vrDep\n : await this[_nodeFromEdge](edge, parent, null, required)\n\n /* istanbul ignore next */\n debug(() => {\n if (!dep)\n throw new Error('no dep??')\n })\n\n tasks.push({edge, dep})\n }\n\n const placed = tasks\n .sort((a, b) => a.edge.name.localeCompare(b.edge.name, 'en'))\n .map(({ edge, dep }) => this[_placeDep](dep, node, edge))\n\n const promises = []\n for (const set of placed) {\n for (const node of set) {\n this[_mutateTree] = true\n this.addTracker('idealTree', node.name, node.location)\n this[_depsQueue].push(node)\n\n // we're certainly going to need these soon, fetch them asap\n // if it fails at this point, though, dont' worry because it\n // may well be an optional dep that has gone missing. it'll\n // fail later anyway.\n const from = fromPath(node)\n promises.push(...this[_problemEdges](node).map(e =>\n this[_fetchManifest](npa.resolve(e.name, e.spec, from))\n .catch(er => null)))\n }\n }\n await Promise.all(promises)\n\n for (const { to } of node.edgesOut.values()) {\n if (to && to.isLink)\n this[_linkNodes].add(to)\n }\n\n return this[_buildDepStep]()\n }\n\n // loads a node from an edge, and then loads its peer deps (and their\n // peer deps, on down the line) into a virtual root parent.\n async [_nodeFromEdge] (edge, parent_, secondEdge, required) {\n // create a virtual root node with the same deps as the node that\n // is requesting this one, so that we can get all the peer deps in\n // a context where they're likely to be resolvable.\n // Note that the virtual root will also have virtual copies of the\n // targets of any child Links, so that they resolve appropriately.\n const parent = parent_ || this[_virtualRoot](edge.from)\n const realParent = edge.peer ? edge.from.resolveParent : edge.from\n\n const spec = npa.resolve(edge.name, edge.spec, edge.from.path)\n const first = await this[_nodeFromSpec](edge.name, spec, parent, edge)\n\n // we might have a case where the parent has a peer dependency on\n // `foo@*` which resolves to v2, but another dep in the set has a\n // peerDependency on `foo@1`. In that case, if we force it to be v2,\n // we're unnecessarily triggering an ERESOLVE.\n // If we have a second edge to worry about, and it's not satisfied\n // by the first node, try a second and see if that satisfies the\n // original edge here.\n const spec2 = secondEdge && npa.resolve(\n edge.name,\n secondEdge.spec,\n secondEdge.from.path\n )\n const second = secondEdge && !secondEdge.valid\n ? await this[_nodeFromSpec](edge.name, spec2, parent, secondEdge)\n : null\n\n // pick the second one if they're both happy with that, otherwise first\n const node = second && edge.valid ? second : first\n // ensure the one we want is the one that's placed\n node.parent = parent\n\n if (required.has(edge.from) && edge.type !== 'peerOptional' ||\n secondEdge && (\n required.has(secondEdge.from) && secondEdge.type !== 'peerOptional'))\n required.add(node)\n\n // handle otherwise unresolvable dependency nesting loops by\n // creating a symbolic link\n // a1 -> b1 -> a2 -> b2 -> a1 -> ...\n // instead of nesting forever, when the loop occurs, create\n // a symbolic link to the earlier instance\n for (let p = edge.from.resolveParent; p; p = p.resolveParent) {\n if (p.matches(node) && !p.isTop)\n return new Link({ parent: realParent, target: p })\n }\n\n // keep track of the thing that caused this node to be included.\n const src = parent.sourceReference\n this[_peerSetSource].set(node, src)\n return this[_loadPeerSet](node, required)\n }\n\n [_virtualRoot] (node, reuse = false) {\n if (reuse && this[_virtualRoots].has(node))\n return this[_virtualRoots].get(node)\n\n const vr = new Node({\n path: node.realpath,\n sourceReference: node,\n legacyPeerDeps: this.legacyPeerDeps,\n })\n\n // also need to set up any targets from any link deps, so that\n // they are properly reflected in the virtual environment\n for (const child of node.children.values()) {\n if (child.isLink) {\n new Node({\n path: child.realpath,\n sourceReference: child.target,\n root: vr,\n })\n }\n }\n\n this[_virtualRoots].set(node, vr)\n return vr\n }\n\n [_problemEdges] (node) {\n // skip over any bundled deps, they're not our problem.\n // Note that this WILL fetch bundled meta-deps which are also dependencies\n // but not listed as bundled deps. When reifying, we first unpack any\n // nodes that have bundleDependencies, then do a loadActual on them, move\n // the nodes into the ideal tree, and then prune. So, fetching those\n // possibly-bundled meta-deps at this point doesn't cause any worse\n // problems than a few unnecessary packument fetches.\n\n // also skip over any nodes in the tree that failed to load, since those\n // will crash the install later on anyway.\n const bd = node.isProjectRoot || node.isWorkspace ? null\n : node.package.bundleDependencies\n const bundled = new Set(bd || [])\n\n return [...node.edgesOut.values()]\n .filter(edge => {\n // If it's included in a bundle, we take whatever is specified.\n if (bundled.has(edge.name))\n return false\n\n // If it's already been logged as a load failure, skip it.\n if (edge.to && this[_loadFailures].has(edge.to))\n return false\n\n // If it's shrinkwrapped, we use what the shrinkwap wants.\n if (edge.to && edge.to.inShrinkwrap)\n return false\n\n // If the edge has no destination, that's a problem, unless\n // if it's peerOptional and not explicitly requested.\n if (!edge.to) {\n return edge.type !== 'peerOptional' ||\n this[_explicitRequests].has(edge)\n }\n\n // If the edge has an error, there's a problem.\n if (!edge.valid)\n return true\n\n // If user has explicitly asked to update this package by name, it's a problem.\n if (this[_updateNames].includes(edge.name))\n return true\n\n // If we're fixing a security vulnerability with this package, it's a problem.\n if (this[_isVulnerable](edge.to))\n return true\n\n // If the user has explicitly asked to install this package, it's a \"problem\".\n if (this[_explicitRequests].has(edge))\n return true\n\n // No problems!\n return false\n })\n }\n\n async [_fetchManifest] (spec) {\n const options = {\n ...this.options,\n avoid: this[_avoidRange](spec.name),\n }\n // get the intended spec and stored metadata from yarn.lock file,\n // if available and valid.\n spec = this.idealTree.meta.checkYarnLock(spec, options)\n\n if (this[_manifests].has(spec.raw))\n return this[_manifests].get(spec.raw)\n else {\n this.log.silly('fetch manifest', spec.raw)\n const p = pacote.manifest(spec, options)\n .then(mani => {\n this[_manifests].set(spec.raw, mani)\n return mani\n })\n this[_manifests].set(spec.raw, p)\n return p\n }\n }\n\n [_nodeFromSpec] (name, spec, parent, edge) {\n // pacote will slap integrity on its options, so we have to clone\n // the object so it doesn't get mutated.\n // Don't bother to load the manifest for link deps, because the target\n // might be within another package that doesn't exist yet.\n const { legacyPeerDeps } = this\n return spec.type === 'directory'\n ? this[_linkFromSpec](name, spec, parent, edge)\n : this[_fetchManifest](spec)\n .then(pkg => new Node({ name, pkg, parent, legacyPeerDeps }), error => {\n error.requiredBy = edge.from.location || '.'\n\n // failed to load the spec, either because of enotarget or\n // fetch failure of some other sort. save it so we can verify\n // later that it's optional, otherwise the error is fatal.\n const n = new Node({\n name,\n parent,\n error,\n legacyPeerDeps,\n })\n this[_loadFailures].add(n)\n return n\n })\n }\n\n [_linkFromSpec] (name, spec, parent, edge) {\n const realpath = spec.fetchSpec\n const { legacyPeerDeps } = this\n return rpj(realpath + '/package.json').catch(() => ({})).then(pkg => {\n const link = new Link({ name, parent, realpath, pkg, legacyPeerDeps })\n this[_linkNodes].add(link)\n return link\n })\n }\n\n // load all peer deps and meta-peer deps into the node's parent\n // At the end of this, the node's peer-type outward edges are all\n // resolved, and so are all of theirs, but other dep types are not.\n // We prefer to get peer deps that meet the requiring node's dependency,\n // if possible, since that almost certainly works (since that package was\n // developed with this set of deps) and will typically be more restrictive.\n // Note that the peers in the set can conflict either with each other,\n // or with a direct dependency from the virtual root parent! In strict\n // mode, this is always an error. In force mode, it never is, and we\n // prefer the parent's non-peer dep over a peer dep, or the version that\n // gets placed first. In non-strict mode, we behave strictly if the\n // virtual root is based on the root project, and allow non-peer parent\n // deps to override, but throw if no preference can be determined.\n async [_loadPeerSet] (node, required) {\n const peerEdges = [...node.edgesOut.values()]\n // we typically only install non-optional peers, but we have to\n // factor them into the peerSet so that we can avoid conflicts\n .filter(e => e.peer && !(e.valid && e.to))\n .sort(({name: a}, {name: b}) => a.localeCompare(b, 'en'))\n\n for (const edge of peerEdges) {\n // already placed this one, and we're happy with it.\n if (edge.valid && edge.to)\n continue\n\n const parentEdge = node.parent.edgesOut.get(edge.name)\n const {isProjectRoot, isWorkspace} = node.parent.sourceReference\n const isMine = isProjectRoot || isWorkspace\n const conflictOK = this[_force] || !isMine && !this[_strictPeerDeps]\n\n if (!edge.to) {\n if (!parentEdge) {\n // easy, just put the thing there\n await this[_nodeFromEdge](edge, node.parent, null, required)\n continue\n } else {\n // if the parent's edge is very broad like >=1, and the edge in\n // question is something like 1.x, then we want to get a 1.x, not\n // a 2.x. pass along the child edge as an advisory guideline.\n // if the parent edge doesn't satisfy the child edge, and the\n // child edge doesn't satisfy the parent edge, then we have\n // a conflict. this is always a problem in strict mode, never\n // in force mode, and a problem in non-strict mode if this isn't\n // on behalf of our project. in all such cases, we warn at least.\n const dep = await this[_nodeFromEdge](parentEdge, node.parent, edge, required)\n\n // hooray! that worked!\n if (edge.valid)\n continue\n\n // allow it. either we're overriding, or it's not something\n // that will be installed by default anyway, and we'll fail when\n // we get to the point where we need to, if we need to.\n if (conflictOK || !required.has(dep))\n continue\n\n // problem\n this[_failPeerConflict](edge, parentEdge)\n }\n }\n\n // There is something present already, and we're not happy about it\n // See if the thing we WOULD be happy with is also going to satisfy\n // the other dependents on the current node.\n const current = edge.to\n const dep = await this[_nodeFromEdge](edge, null, null, required)\n if (dep.canReplace(current)) {\n await this[_nodeFromEdge](edge, node.parent, null, required)\n continue\n }\n\n // at this point we know that there is a dep there, and\n // we don't like it. always fail strictly, always allow forcibly or\n // in non-strict mode if it's not our fault. don't warn here, because\n // we are going to warn again when we place the deps, if we end up\n // overriding for something else. If the thing that has this dep\n // isn't also required, then there's a good chance we won't need it,\n // so allow it for now and let it conflict if it turns out to actually\n // be necessary for the installation.\n if (conflictOK || !required.has(edge.from))\n continue\n\n // ok, it's the root, or we're in unforced strict mode, so this is bad\n this[_failPeerConflict](edge, parentEdge)\n }\n return node\n }\n\n [_failPeerConflict] (edge, currentEdge) {\n const expl = this[_explainPeerConflict](edge, currentEdge)\n throw Object.assign(new Error('unable to resolve dependency tree'), expl)\n }\n\n [_explainPeerConflict] (edge, currentEdge) {\n const node = edge.from\n const curNode = node.resolve(edge.name)\n const pc = this[_peerConflict] || { peer: null, current: null }\n const current = curNode ? curNode.explain() : pc.current\n const peerConflict = pc.peer\n return {\n code: 'ERESOLVE',\n current,\n // it SHOULD be impossible to get here without a current node in place,\n // but this at least gives us something report on when bugs creep into\n // the tree handling logic.\n currentEdge: currentEdge ? currentEdge.explain() : null,\n edge: edge.explain(),\n peerConflict,\n strictPeerDeps: this[_strictPeerDeps],\n force: this[_force],\n }\n }\n\n [_warnPeerConflict] (edge) {\n // track that we've overridden this edge, so that we don't keep trying\n // to re-resolve it in an infinite loop.\n this[_edgesOverridden].add(edge)\n const expl = this[_explainPeerConflict](edge)\n this.log.warn('ERESOLVE', 'overriding peer dependency', expl)\n }\n\n // starting from either node, or in the case of non-root peer deps,\n // the node's parent, walk up the tree until we find the first spot\n // where this dep cannot be placed, and use the one right before that.\n // place dep, requested by node, to satisfy edge\n // XXX split this out into a separate method or mixin? It's quite a lot\n // of functionality that ought to have its own unit tests more conveniently.\n [_placeDep] (dep, node, edge, peerEntryEdge = null, peerPath = []) {\n if (edge.to &&\n !edge.error &&\n !this[_explicitRequests].has(edge) &&\n !this[_updateNames].includes(edge.name) &&\n !this[_isVulnerable](edge.to))\n return []\n\n // top nodes should still get peer deps from their fsParent if possible,\n // and only install locally if there's no other option, eg for a link\n // outside of the project root, or for a conflicted dep.\n const start = edge.peer && !node.isProjectRoot ? node.resolveParent || node\n : node\n\n let target\n let canPlace = null\n let isSource = false\n const source = this[_peerSetSource].get(dep)\n for (let check = start; check; check = check.resolveParent) {\n // we always give the FIRST place we possibly *can* put this a little\n // extra prioritization with peer dep overrides and deduping\n if (check === source)\n isSource = true\n\n // if the current location has a peerDep on it, then we can't place here\n // this is pretty rare to hit, since we always prefer deduping peers.\n const checkEdge = check.edgesOut.get(edge.name)\n if (!check.isTop && checkEdge && checkEdge.peer)\n continue\n\n const cp = this[_canPlaceDep](dep, check, edge, peerEntryEdge, peerPath, isSource)\n isSource = false\n\n // anything other than a conflict is fine to proceed with\n if (cp !== CONFLICT) {\n canPlace = cp\n target = check\n } else\n break\n\n // nest packages like npm v1 and v2\n // very disk-inefficient\n if (this[_legacyBundling])\n break\n\n // when installing globally, or just in global style, we never place\n // deps above the first level.\n const tree = this.idealTree && this.idealTree.target || this.idealTree\n if (this[_globalStyle] && check.resolveParent === tree)\n break\n }\n\n // if we can't find a target, that means that the last placed checked\n // (and all the places before it) had a copy already. if we're in\n // --force mode, then the user has explicitly said that they're ok\n // with conflicts. This can only occur in --force mode in the case\n // when a node was added to the tree with a peerOptional dep that we\n // ignored, and then later, that edge became invalid, and we fail to\n // resolve it. We will warn about it in a moment.\n if (!target) {\n if (this[_force]) {\n // we know that there is a dep (not the root) which is the target\n // of this edge, or else it wouldn't have been a conflict.\n target = edge.to.resolveParent\n canPlace = KEEP\n } else\n this[_failPeerConflict](edge)\n } else {\n // it worked, so we clearly have no peer conflicts at this point.\n this[_peerConflict] = null\n }\n\n this.log.silly(\n 'placeDep',\n target.location || 'ROOT',\n `${dep.name}@${dep.version}`,\n canPlace.description || /* istanbul ignore next */ canPlace,\n `for: ${node.package._id || node.location}`,\n `want: ${edge.spec || '*'}`\n )\n\n // Can only get KEEP here if the original edge was valid,\n // and we're checking for an update but it's already up to date.\n if (canPlace === KEEP) {\n if (edge.peer && !target.children.get(edge.name).satisfies(edge)) {\n // this is an overridden peer dep\n this[_warnPeerConflict](edge)\n }\n\n // if we get a KEEP in a update scenario, then we MAY have something\n // already duplicating this unnecessarily! For example:\n // ```\n // root\n // +-- x (dep: y@1.x)\n // | +-- y@1.0.0\n // +-- y@1.1.0\n // ```\n // Now say we do `reify({update:['y']})`, and the latest version is\n // 1.1.0, which we already have in the root. We'll try to place y@1.1.0\n // first in x, then in the root, ending with KEEP, because we already\n // have it. In that case, we ought to REMOVE the nm/x/nm/y node, because\n // it is an unnecessary duplicate.\n this[_pruneDedupable](target)\n return []\n }\n\n // figure out which of this node's peer deps will get placed as well\n const virtualRoot = dep.parent\n\n const newDep = new dep.constructor({\n name: dep.name,\n pkg: dep.package,\n resolved: dep.resolved,\n integrity: dep.integrity,\n legacyPeerDeps: this.legacyPeerDeps,\n error: dep.errors[0],\n ...(dep.target ? { target: dep.target, realpath: dep.target.path } : {}),\n })\n if (this[_loadFailures].has(dep))\n this[_loadFailures].add(newDep)\n\n const placed = [newDep]\n const oldChild = target.children.get(edge.name)\n if (oldChild) {\n // if we're replacing, we should also remove any nodes for edges that\n // are now invalid, and where this (or its deps) is the only dependent,\n // and also recurse on that pruning. Otherwise leaving that dep node\n // around can result in spurious conflicts pushing nodes deeper into\n // the tree than needed in the case of cycles that will be removed\n // later anyway.\n const oldDeps = []\n for (const [name, edge] of oldChild.edgesOut.entries()) {\n if (!newDep.edgesOut.has(name) && edge.to)\n oldDeps.push(...gatherDepSet([edge.to], e => e.to !== edge.to))\n }\n newDep.replace(oldChild)\n this[_pruneForReplacement](newDep, oldDeps)\n // this may also create some invalid edges, for example if we're\n // intentionally causing something to get nested which was previously\n // placed in this location.\n for (const edgeIn of newDep.edgesIn) {\n if (edgeIn.invalid && edgeIn !== edge) {\n this[_depsQueue].push(edgeIn.from)\n this[_depsSeen].delete(edgeIn.from)\n }\n }\n } else\n newDep.parent = target\n\n if (edge.peer && !newDep.satisfies(edge)) {\n // this is an overridden peer dep\n this[_warnPeerConflict](edge)\n }\n\n // If the edge is not an error, then we're updating something, and\n // MAY end up putting a better/identical node further up the tree in\n // a way that causes an unnecessary duplication. If so, remove the\n // now-unnecessary node.\n if (edge.valid && edge.to && edge.to !== newDep)\n this[_pruneDedupable](edge.to, false)\n\n // visit any dependents who are upset by this change\n // if it's an angry overridden peer edge, however, make sure we\n // skip over it!\n for (const edgeIn of newDep.edgesIn) {\n if (edgeIn !== edge && !edgeIn.valid && !this[_depsSeen].has(edge.from)) {\n this.addTracker('idealTree', edgeIn.from.name, edgeIn.from.location)\n this[_depsQueue].push(edgeIn.from)\n }\n }\n\n // in case we just made some duplicates that can be removed,\n // prune anything deeper in the tree that can be replaced by this\n if (this.idealTree) {\n for (const node of this.idealTree.inventory.query('name', newDep.name)) {\n if (node.isDescendantOf(target))\n this[_pruneDedupable](node, false)\n }\n }\n\n // also place its unmet or invalid peer deps at this location\n // note that newDep has now been removed from the virtualRoot set\n // by virtue of being placed in the target's node_modules.\n // loop through any peer deps from the thing we just placed, and place\n // those ones as well. it's safe to do this with the virtual nodes,\n // because we're copying rather than moving them out of the virtual root,\n // otherwise they'd be gone and the peer set would change throughout\n // this loop.\n for (const peerEdge of newDep.edgesOut.values()) {\n const peer = virtualRoot.children.get(peerEdge.name)\n\n // Note: if the virtualRoot *doesn't* have the peer, then that means\n // it's an optional peer dep. If it's not being properly met (ie,\n // peerEdge.valid is false), that this is likely heading for an\n // ERESOLVE error, unless it can walk further up the tree.\n if (!peerEdge.peer || peerEdge.valid || !peer)\n continue\n\n const peerPlaced = this[_placeDep](\n peer, newDep, peerEdge, peerEntryEdge || edge, peerPath)\n placed.push(...peerPlaced)\n }\n\n // we're done with this now, clean it up.\n this[_virtualRoots].delete(virtualRoot.sourceReference)\n\n return placed\n }\n\n // prune all the nodes in a branch of the tree that can be safely removed\n // This is only the most basic duplication detection; it finds if there\n // is another satisfying node further up the tree, and if so, dedupes.\n // Even in legacyBundling mode, we do this amount of deduplication.\n [_pruneDedupable] (node, descend = true) {\n if (node.canDedupe(this[_preferDedupe])) {\n node.root = null\n return\n }\n if (descend) {\n // sort these so that they're deterministically ordered\n // otherwise, resulting tree shape is dependent on the order\n // in which they happened to be resolved.\n const nodeSort = (a, b) => a.location.localeCompare(b.location, 'en')\n\n const children = [...node.children.values()].sort(nodeSort)\n const fsChildren = [...node.fsChildren].sort(nodeSort)\n for (const child of children)\n this[_pruneDedupable](child)\n for (const topNode of fsChildren) {\n const children = [...topNode.children.values()].sort(nodeSort)\n for (const child of children)\n this[_pruneDedupable](child)\n }\n }\n }\n\n [_pruneForReplacement] (node, oldDeps) {\n // gather up all the invalid edgesOut, and any now-extraneous\n // deps that the new node doesn't depend on but the old one did.\n const invalidDeps = new Set([...node.edgesOut.values()]\n .filter(e => e.to && !e.valid).map(e => e.to))\n for (const dep of oldDeps) {\n const set = gatherDepSet([dep], e => e.to !== dep && e.valid)\n for (const dep of set)\n invalidDeps.add(dep)\n }\n\n // ignore dependency edges from the node being replaced, but\n // otherwise filter the set down to just the set with no\n // dependencies from outside the set, except the node in question.\n const deps = gatherDepSet(invalidDeps, edge =>\n edge.from !== node && edge.to !== node && edge.valid)\n\n // now just delete whatever's left, because it's junk\n for (const dep of deps)\n dep.parent = null\n }\n\n // check if we can place DEP in TARGET to satisfy EDGE\n // Need to verify:\n // - no child by that name there already\n // - target does not have a peer dep on name\n // - no higher-level pkg by that name and incompatible spec is depended on\n // by anything lower in the tree.\n // - node's peer deps and meta-peer deps are siblings in a virtual root at\n // this point. make sure that the whole family can come along, so apply\n // the same checks to each of them. They may land higher up in the tree,\n // but we need to know that they CAN live here.\n // Responses:\n // - OK - Yes, because there is nothing there and no conflicts caused\n // - REPLACE - Yes, and you can clobber what's there\n // - KEEP - No, but what's there is fine\n // - CONFLICT - You may not put that there\n //\n // Check peers on OK or REPLACE. KEEP and CONFLICT do not require peer\n // checking, because either we're leaving it alone, or it won't work anyway.\n // When we check peers, we pass along the peerEntryEdge to track the\n // original edge that caused us to load the family of peer dependencies.\n [_canPlaceDep] (dep, target, edge, peerEntryEdge = null, peerPath = [], isSource = false) {\n /* istanbul ignore next */\n debug(() => {\n if (!dep)\n throw new Error('no dep??')\n })\n const entryEdge = peerEntryEdge || edge\n const source = this[_peerSetSource].get(dep)\n\n isSource = isSource || target === source\n // if we're overriding the source, then we care if the *target* is\n // ours, even if it wasn't actually the original source, since we\n // are depending on something that has a dep that can't go in its own\n // folder. for example, a -> b, b -> PEER(a). Even though a is the\n // source, b has to be installed up a level, and if the root package\n // depends on a, and it has a conflict, it's our problem. So, the root\n // (or whatever is bringing in a) becomes the \"effective source\" for\n // the purposes of this calculation.\n const { isProjectRoot, isWorkspace } = isSource ? target : source || {}\n const isMine = isProjectRoot || isWorkspace\n\n // Useful testing thingie right here.\n // peerEntryEdge should *always* be a non-peer dependency, or a peer\n // dependency from the root node. When we get spurious ERESOLVE errors,\n // or *don't* get ERESOLVE errors when we should, check to see if this\n // fails, because it MAY mean we got off track somehow.\n /* istanbul ignore next - debug check, should be impossible */\n debug(() => {\n if (peerEntryEdge && peerEntryEdge.peer && !peerEntryEdge.from.isTop)\n throw new Error('lost original peerEntryEdge somehow?')\n })\n\n if (target.children.has(edge.name)) {\n const current = target.children.get(edge.name)\n\n // same thing = keep, UNLESS the current doesn't satisfy and new\n // one does satisfy. This can happen if it's a link to a matching target\n // at a different location, which satisfies a version dep, but not a\n // file: dep. If neither of them satisfy, then we can replace it,\n // because presumably it's better for a peer or something.\n if (dep.matches(current)) {\n if (current.satisfies(edge) || !dep.satisfies(edge))\n return KEEP\n }\n\n const { version: curVer } = current\n const { version: newVer } = dep\n const tryReplace = curVer && newVer && semver.gte(newVer, curVer)\n if (tryReplace && dep.canReplace(current)) {\n const res = this[_canPlacePeers](dep, target, edge, REPLACE, peerEntryEdge, peerPath, isSource)\n /* istanbul ignore else - It's extremely rare that a replaceable\n * node would be a conflict, if the current one wasn't a conflict,\n * but it is theoretically possible if peer deps are pinned. In\n * that case we treat it like any other conflict, and keep trying */\n if (res !== CONFLICT)\n return res\n }\n\n // ok, can't replace the current with new one, but maybe current is ok?\n // no need to check if it's a peer that's valid to be here, because\n // peers are always placed along with their entry source\n if (edge.satisfiedBy(current))\n return KEEP\n\n // if we prefer deduping, then try replacing newer with older\n // we always prefer to dedupe peers, because they are trying\n // a bit harder to be singletons.\n const preferDedupe = this[_preferDedupe] || edge.peer\n if (preferDedupe && !tryReplace && dep.canReplace(current)) {\n const res = this[_canPlacePeers](dep, target, edge, REPLACE, peerEntryEdge, peerPath, isSource)\n /* istanbul ignore else - It's extremely rare that a replaceable\n * node would be a conflict, if the current one wasn't a conflict,\n * but it is theoretically possible if peer deps are pinned. In\n * that case we treat it like any other conflict, and keep trying */\n if (res !== CONFLICT)\n return res\n }\n\n // check for conflict override cases.\n // first: is this the only place this thing can go? If the target is\n // the source, then one of these things are true.\n //\n // 1. the conflicted dep was deduped up to here from a lower dependency\n // w -> (x,y)\n // x -> (z)\n // y -> PEER(p@1)\n // z -> (q)\n // q -> (p@2)\n //\n // When building, let's say that x is fully placed, with all of its\n // deps, and we're _adding_ y. Since the peer on p@1 was not initially\n // present, it's been deduped up to w, and now needs to be pushed out.\n // Replace it, and potentially also replace its peer set (though that'll\n // be accomplished by making the same determination when we call\n // _canPlacePeers)\n //\n // 2. the dep we're TRYING to place here ought to be overridden by the\n // one that's here now, because current is (a) a direct dep of the\n // source, or (b) an already-placed peer in a conflicted peer set, or\n // (c) an already-placed peer in a different peer set at the same level.\n // If strict or ours, conflict. Otherwise, keep.\n if (isSource) {\n // check to see if the current module could go deeper in the tree\n let canReplace = true\n // only do this check when we're placing peers. when we're placing\n // the original in the source, we know that the edge from the source\n // is the thing we're trying to place, so its peer set will need to be\n // placed here as well. the virtualRoot already has the appropriate\n // overrides applied.\n if (peerEntryEdge) {\n const currentPeerSet = getPeerSet(current)\n\n // We are effectively replacing currentPeerSet with newPeerSet\n // If there are any non-peer deps coming into the currentPeerSet,\n // which are currently valid, and are from the target, then that\n // means that we have to ensure that they're not going to be made\n // invalid by putting the newPeerSet in place.\n // If the edge comes from somewhere deeper than the target, then\n // that's fine, because we'll create an invalid edge, detect it,\n // and duplicate the node further into the tree.\n // loop through the currentPeerSet checking for valid edges on\n // the members of the peer set which will be made invalid.\n const targetEdges = new Set()\n for (const p of currentPeerSet) {\n for (const edge of p.edgesIn) {\n // edge from within the peerSet, ignore\n if (currentPeerSet.has(edge.from))\n continue\n // only care about valid edges from target.\n // edges from elsewhere can dupe if offended, invalid edges\n // are already being fixed or will be later.\n if (edge.from !== target || !edge.valid)\n continue\n targetEdges.add(edge)\n }\n }\n\n for (const edge of targetEdges) {\n // see if we intend to replace this one anyway\n const rep = dep.parent.children.get(edge.name)\n const current = edge.to\n if (!rep) {\n // this isn't one we're replacing. but it WAS included in the\n // peerSet for some reason, so make sure that it's still\n // ok with the replacements in the new peerSet\n for (const curEdge of current.edgesOut.values()) {\n const newRepDep = dep.parent.children.get(curEdge.name)\n if (curEdge.valid && newRepDep && !newRepDep.satisfies(curEdge)) {\n canReplace = false\n break\n }\n }\n continue\n }\n\n // was this replacement already an override of some sort?\n const override = [...rep.edgesIn].some(e => !e.valid)\n // if we have a rep, and it's ok to put in this location, and\n // it's not already part of an override in the peerSet, then\n // we can continue with it.\n if (rep.satisfies(edge) && !override)\n continue\n // Otherwise, we cannot replace.\n canReplace = false\n break\n }\n // if we're going to be replacing the peerSet, we have to remove\n // and re-resolve any members of the old peerSet that are not\n // present in the new one, and which will have invalid edges.\n // We know that they're not depended upon by the target, or else\n // they would have caused a conflict, so they'll get landed deeper\n // in the tree, if possible.\n if (canReplace) {\n let needNesting = false\n OUTER: for (const node of currentPeerSet) {\n const rep = dep.parent.children.get(node.name)\n // has a replacement, already addressed above\n if (rep)\n continue\n\n // ok, it has been placed here to dedupe, see if it needs to go\n // back deeper within the tree.\n for (const edge of node.edgesOut.values()) {\n const repDep = dep.parent.children.get(edge.name)\n // not in new peerSet, maybe fine.\n if (!repDep)\n continue\n\n // new thing will be fine, no worries\n if (repDep.satisfies(edge))\n continue\n\n // uhoh, we'll have to nest them.\n needNesting = true\n break OUTER\n }\n }\n\n // to nest, just delete everything without a target dep\n // that's in the current peerSet, and add their dependants\n // to the _depsQueue for evaluation. Some of these MAY end\n // up in the same location again, and that's fine.\n if (needNesting) {\n // avoid mutating the tree while we're examining it\n const dependants = new Set()\n const reresolve = new Set()\n OUTER: for (const node of currentPeerSet) {\n const rep = dep.parent.children.get(node.name)\n if (rep)\n continue\n // create a separate set for each one, so we can skip any\n // that might somehow have an incoming target edge\n const deps = new Set()\n for (const edge of node.edgesIn) {\n // a target dep, skip this dep entirely, already addressed\n // ignoring for coverage, because it really ought to be\n // impossible, but I can't prove it yet, so this is here\n // for safety.\n /* istanbul ignore if - should be impossible */\n if (edge.from === target)\n continue OUTER\n // ignore this edge, it'll either be replaced or re-resolved\n if (currentPeerSet.has(edge.from))\n continue\n // ok, we care about this one.\n deps.add(edge.from)\n }\n reresolve.add(node)\n for (const d of deps)\n dependants.add(d)\n }\n for (const dependant of dependants) {\n this[_depsQueue].push(dependant)\n this[_depsSeen].delete(dependant)\n }\n for (const node of reresolve)\n node.root = null\n }\n }\n }\n\n if (canReplace) {\n const ret = this[_canPlacePeers](dep, target, edge, REPLACE, peerEntryEdge, peerPath, isSource)\n /* istanbul ignore else - extremely rare that the peer set would\n * conflict if we can replace the node in question, but theoretically\n * possible, if peer deps are pinned aggressively. */\n if (ret !== CONFLICT)\n return ret\n }\n\n // so it's not a deeper dep that's been deduped. That means that the\n // only way it could have ended up here is if it's a conflicted peer.\n /* istanbul ignore else - would have already crashed if not forced,\n * and either mine or strict, when creating the peerSet. Keeping this\n * check so that we're not only relying on action at a distance. */\n if (!this[_strictPeerDeps] && !isMine || this[_force]) {\n this[_warnPeerConflict](edge, dep)\n return KEEP\n }\n }\n\n // no justification for overriding, and no agreement possible.\n return CONFLICT\n }\n\n // no existing node at this location!\n // check to see if the target doesn't have a child by that name,\n // but WANTS one, and won't be happy with this one. if this is the\n // edge we're looking to resolve, then not relevant, of course.\n if (target !== entryEdge.from && target.edgesOut.has(dep.name)) {\n const targetEdge = target.edgesOut.get(dep.name)\n // It might be that the dep would not be valid here, BUT some other\n // version would. Could to try to resolve that, but that makes this no\n // longer a pure synchronous function. ugh.\n // This is a pretty unlikely scenario in a normal install, because we\n // resolve the peer dep set against the parent dependencies, and\n // presumably they all worked together SOMEWHERE to get published in the\n // first place, and since we resolve shallower deps before deeper ones,\n // this can only occur by a child having a peer dep that does not satisfy\n // the parent. It can happen if we're doing a deep update limited by\n // a specific name, however, or if a dep makes an incompatible change\n // to its peer dep in a non-semver-major version bump, or if the parent\n // is unbounded in its dependency list.\n if (!targetEdge.satisfiedBy(dep))\n return CONFLICT\n }\n\n // check to see what that name resolves to here, and who may depend on\n // being able to reach it by crawling up past this parent. we know\n // at this point that it's not the target's direct child node. if it's\n // a direct dep of the target, we just make the invalid edge and\n // resolve it later.\n const current = target !== entryEdge.from && target.resolve(dep.name)\n if (current) {\n for (const edge of current.edgesIn.values()) {\n if (edge.from.isDescendantOf(target) && edge.valid) {\n if (!edge.satisfiedBy(dep))\n return CONFLICT\n }\n }\n }\n\n // no objections! ok to place here\n return this[_canPlacePeers](dep, target, edge, OK, peerEntryEdge, peerPath, isSource)\n }\n\n // make sure the family of peer deps can live here alongside it.\n // this doesn't guarantee that THIS solution will be the one we take,\n // but it does establish that SOME solution exists at this level in\n // the tree.\n [_canPlacePeers] (dep, target, edge, ret, peerEntryEdge, peerPath, isSource) {\n // do not go in cycles when we're resolving a peer group\n if (!dep.parent || peerEntryEdge && peerPath.includes(dep))\n return ret\n\n const entryEdge = peerEntryEdge || edge\n peerPath = [...peerPath, dep]\n\n for (const peerEdge of dep.edgesOut.values()) {\n if (!peerEdge.peer || !peerEdge.to)\n continue\n const peer = peerEdge.to\n const canPlacePeer = this[_canPlaceDep](peer, target, peerEdge, entryEdge, peerPath, isSource)\n if (canPlacePeer !== CONFLICT)\n continue\n\n const current = target.resolve(peer.name)\n this[_peerConflict] = {\n peer: peer.explain(peerEdge),\n current: current && current.explain(),\n }\n return CONFLICT\n }\n return ret\n }\n\n // go through all the links in the this[_linkNodes] set\n // for each one:\n // - if outside the root, ignore it, assume it's fine, it's not our problem\n // - if a node in the tree already, assign the target to that node.\n // - if a path under an existing node, then assign that as the fsParent,\n // and add it to the _depsQueue\n //\n // call buildDepStep if anything was added to the queue, otherwise we're done\n [_resolveLinks] () {\n for (const link of this[_linkNodes]) {\n this[_linkNodes].delete(link)\n\n // link we never ended up placing, skip it\n if (link.root !== this.idealTree)\n continue\n\n const external = /^\\.\\.(\\/|$)/.test(relpath(this.path, link.realpath))\n\n // outside the root, somebody else's problem, ignore it\n if (external && !this[_follow])\n continue\n\n // didn't find a parent for it or it has not been seen yet\n // so go ahead and process it.\n const unseenLink = (link.target.parent || link.target.fsParent) &&\n !this[_depsSeen].has(link.target)\n\n if (this[_follow] &&\n !link.target.parent &&\n !link.target.fsParent ||\n unseenLink) {\n this.addTracker('idealTree', link.target.name, link.target.location)\n this[_depsQueue].push(link.target)\n }\n }\n\n if (this[_depsQueue].length)\n return this[_buildDepStep]()\n }\n\n [_fixDepFlags] () {\n process.emit('time', 'idealTree:fixDepFlags')\n const metaFromDisk = this.idealTree.meta.loadedFromDisk\n const flagsSuspect = this[_flagsSuspect]\n const mutateTree = this[_mutateTree]\n // if the options set prune:false, then we don't prune, but we still\n // mark the extraneous items in the tree if we modified it at all.\n // If we did no modifications, we just iterate over the extraneous nodes.\n // if we started with an empty tree, then the dep flags are already\n // all set to true, and there can be nothing extraneous, so there's\n // nothing to prune, because we built it from scratch. if we didn't\n // add or remove anything, then also nothing to do.\n if (metaFromDisk && mutateTree)\n resetDepFlags(this.idealTree)\n\n // update all the dev/optional/etc flags in the tree\n // either we started with a fresh tree, or we\n // reset all the flags to find the extraneous nodes.\n //\n // if we started from a blank slate, or changed something, then\n // the dep flags will be all set to true.\n if (!metaFromDisk || mutateTree)\n calcDepFlags(this.idealTree)\n else {\n // otherwise just unset all the flags on the root node\n // since they will sometimes have the default value\n this.idealTree.extraneous = false\n this.idealTree.dev = false\n this.idealTree.optional = false\n this.idealTree.devOptional = false\n this.idealTree.peer = false\n }\n\n // at this point, any node marked as extraneous should be pruned.\n // if we started from a shrinkwrap, and then added/removed something,\n // then the tree is suspect. Prune what is marked as extraneous.\n // otherwise, don't bother.\n const needPrune = metaFromDisk && (mutateTree || flagsSuspect)\n if (this[_prune] && needPrune)\n this[_idealTreePrune]()\n process.emit('timeEnd', 'idealTree:fixDepFlags')\n }\n\n [_idealTreePrune] () {\n for (const node of this.idealTree.inventory.filter(n => n.extraneous))\n node.parent = null\n }\n\n [_pruneFailedOptional] () {\n for (const node of this[_loadFailures]) {\n if (!node.optional)\n throw node.errors[0]\n\n const set = optionalSet(node)\n for (const node of set)\n node.parent = null\n }\n }\n}\n","module.exports = cls => class Deduper extends cls {\n async dedupe (options = {}) {\n // allow the user to set options on the ctor as well.\n // XXX: deprecate separate method options objects.\n options = { ...this.options, ...options }\n const tree = await this.loadVirtual().catch(() => this.loadActual())\n const names = []\n for (const name of tree.inventory.query('name')) {\n if (tree.inventory.query('name', name).size > 1)\n names.push(name)\n }\n return this.reify({\n ...options,\n preferDedupe: true,\n update: { names },\n })\n }\n}\n","// The arborist manages three trees:\n// - actual\n// - virtual\n// - ideal\n//\n// The actual tree is what's present on disk in the node_modules tree\n// and elsewhere that links may extend.\n//\n// The virtual tree is loaded from metadata (package.json and lock files).\n//\n// The ideal tree is what we WANT that actual tree to become. This starts\n// with the virtual tree, and then applies the options requesting\n// add/remove/update actions.\n//\n// To reify a tree, we calculate a diff between the ideal and actual trees,\n// and then turn the actual tree into the ideal tree by taking the actions\n// required. At the end of the reification process, the actualTree is\n// updated to reflect the changes.\n//\n// Each tree has an Inventory at the root. Shrinkwrap is tracked by Arborist\n// instance. It always refers to the actual tree, but is updated (and written\n// to disk) on reification.\n\n// Each of the mixin \"classes\" adds functionality, but are not dependent on\n// constructor call order. So, we just load them in an array, and build up\n// the base class, so that the overall voltron class is easier to test and\n// cover, and separation of concerns can be maintained.\n\nconst {resolve} = require('path')\nconst {homedir} = require('os')\nconst procLog = require('proc-log')\nconst { saveTypeMap } = require('../add-rm-pkg-deps.js')\n\nconst mixins = [\n require('../tracker.js'),\n require('./pruner.js'),\n require('./deduper.js'),\n require('./audit.js'),\n require('./build-ideal-tree.js'),\n require('./load-workspaces.js'),\n require('./load-actual.js'),\n require('./load-virtual.js'),\n require('./rebuild.js'),\n require('./reify.js'),\n]\n\nconst Base = mixins.reduce((a, b) => b(a), require('events'))\nconst getWorkspaceNodes = require('../get-workspace-nodes.js')\n\nclass Arborist extends Base {\n constructor (options = {}) {\n process.emit('time', 'arborist:ctor')\n super(options)\n this.options = {\n nodeVersion: process.version,\n ...options,\n path: options.path || '.',\n cache: options.cache || `${homedir()}/.npm/_cacache`,\n packumentCache: options.packumentCache || new Map(),\n log: options.log || procLog,\n }\n if (options.saveType && !saveTypeMap.get(options.saveType))\n throw new Error(`Invalid saveType ${options.saveType}`)\n this.cache = resolve(this.options.cache)\n this.path = resolve(this.options.path)\n process.emit('timeEnd', 'arborist:ctor')\n }\n\n // returns an array of the actual nodes for all the workspaces\n workspaceNodes (tree, workspaces) {\n return getWorkspaceNodes(tree, workspaces, this.log)\n }\n\n // returns a set of workspace nodes and all their deps\n workspaceDependencySet (tree, workspaces) {\n const wsNodes = this.workspaceNodes(tree, workspaces)\n const set = new Set(wsNodes)\n const extraneous = new Set()\n for (const node of set) {\n for (const edge of node.edgesOut.values()) {\n const dep = edge.to\n if (dep) {\n set.add(dep)\n if (dep.target)\n set.add(dep.target)\n }\n }\n for (const child of node.children.values()) {\n if (child.extraneous)\n extraneous.add(child)\n }\n }\n for (const extra of extraneous)\n set.add(extra)\n return set\n }\n}\n\nmodule.exports = Arborist\n","// mix-in implementing the loadActual method\n\nconst {relative, dirname, resolve, join, normalize} = require('path')\n\nconst rpj = require('read-package-json-fast')\nconst {promisify} = require('util')\nconst readdir = promisify(require('readdir-scoped-modules'))\nconst walkUp = require('walk-up-path')\nconst ancestorPath = require('common-ancestor-path')\nconst treeCheck = require('../tree-check.js')\n\nconst Shrinkwrap = require('../shrinkwrap.js')\nconst calcDepFlags = require('../calc-dep-flags.js')\nconst Node = require('../node.js')\nconst Link = require('../link.js')\nconst realpath = require('../realpath.js')\n\nconst _loadFSNode = Symbol('loadFSNode')\nconst _newNode = Symbol('newNode')\nconst _newLink = Symbol('newLink')\nconst _loadFSTree = Symbol('loadFSTree')\nconst _loadFSChildren = Symbol('loadFSChildren')\nconst _findMissingEdges = Symbol('findMissingEdges')\nconst _findFSParents = Symbol('findFSParents')\nconst _resetDepFlags = Symbol('resetDepFlags')\n\nconst _actualTreeLoaded = Symbol('actualTreeLoaded')\nconst _rpcache = Symbol.for('realpathCache')\nconst _stcache = Symbol.for('statCache')\nconst _topNodes = Symbol('linkTargets')\nconst _cache = Symbol('nodeLoadingCache')\nconst _loadActual = Symbol('loadActual')\nconst _loadActualVirtually = Symbol('loadActualVirtually')\nconst _loadActualActually = Symbol('loadActualActually')\nconst _loadWorkspaces = Symbol.for('loadWorkspaces')\nconst _loadWorkspaceTargets = Symbol('loadWorkspaceTargets')\nconst _actualTreePromise = Symbol('actualTreePromise')\nconst _actualTree = Symbol('actualTree')\nconst _transplant = Symbol('transplant')\nconst _transplantFilter = Symbol('transplantFilter')\n\nconst _filter = Symbol('filter')\nconst _global = Symbol.for('global')\nconst _changePath = Symbol.for('_changePath')\n\nmodule.exports = cls => class ActualLoader extends cls {\n constructor (options) {\n super(options)\n\n this[_global] = !!options.global\n\n // the tree of nodes on disk\n this.actualTree = options.actualTree\n\n // ensure when walking the tree that we don't call loadTree on the\n // same actual node more than one time.\n this[_actualTreeLoaded] = new Set()\n\n // caches for cached realpath calls\n const cwd = process.cwd()\n // assume that the cwd is real enough for our purposes\n this[_rpcache] = new Map([[cwd, cwd]])\n this[_stcache] = new Map()\n\n // cache of nodes when loading the actualTree, so that we avoid\n // loaded the same node multiple times when symlinks attack.\n this[_cache] = new Map()\n\n // cache of link targets for setting fsParent links\n // We don't do fsParent as a magic getter/setter, because\n // it'd be too costly to keep up to date along the walk.\n // And, we know that it can ONLY be relevant when the node\n // is a target of a link, otherwise it'd be in a node_modules\n // folder, so take advantage of that to limit the scans later.\n this[_topNodes] = new Set()\n }\n\n [_resetDepFlags] (tree, root) {\n // reset all deps to extraneous prior to recalc\n if (!root) {\n for (const node of tree.inventory.values())\n node.extraneous = true\n }\n\n // only reset root flags if we're not re-rooting,\n // otherwise leave as-is\n calcDepFlags(tree, !root)\n return tree\n }\n\n // public method\n async loadActual (options = {}) {\n // allow the user to set options on the ctor as well.\n // XXX: deprecate separate method options objects.\n options = { ...this.options, ...options }\n\n // stash the promise so that we don't ever have more than one\n // going at the same time. This is so that buildIdealTree can\n // default to the actualTree if no shrinkwrap present, but\n // reify() can still call buildIdealTree and loadActual in parallel\n // safely.\n return this.actualTree ? this.actualTree\n : this[_actualTreePromise] ? this[_actualTreePromise]\n : this[_actualTreePromise] = this[_loadActual](options)\n .then(tree => this[_resetDepFlags](tree, options.root))\n .then(tree => this.actualTree = treeCheck(tree))\n }\n\n async [_loadActual] (options) {\n // mostly realpath to throw if the root doesn't exist\n const {\n global = false,\n filter = () => true,\n root = null,\n transplantFilter = () => true,\n ignoreMissing = false,\n } = options\n this[_filter] = filter\n this[_transplantFilter] = transplantFilter\n\n if (global) {\n const real = await realpath(this.path, this[_rpcache], this[_stcache])\n const newNodeOrLink = this.path === real ? _newNode : _newLink\n this[_actualTree] = await this[newNodeOrLink]({\n path: this.path,\n realpath: real,\n pkg: {},\n global,\n })\n return this[_loadActualActually]({root, ignoreMissing, global})\n }\n\n // not in global mode, hidden lockfile is allowed, load root pkg too\n this[_actualTree] = await this[_loadFSNode]({\n path: this.path,\n real: await realpath(this.path, this[_rpcache], this[_stcache]),\n })\n\n // XXX only rely on this if the hidden lockfile is the newest thing?\n // need some kind of heuristic, like if the package.json or sw have\n // been touched more recently, then ignore it? This is a hazard if\n // user switches back and forth between Arborist and another way of\n // mutating the node_modules folder.\n const meta = await Shrinkwrap.load({\n path: this[_actualTree].path,\n hiddenLockfile: true,\n })\n if (meta.loadedFromDisk) {\n this[_actualTree].meta = meta\n return this[_loadActualVirtually]({ root })\n } else {\n const meta = await Shrinkwrap.load({\n path: this[_actualTree].path,\n })\n this[_actualTree].meta = meta\n return this[_loadActualActually]({ root, ignoreMissing })\n }\n }\n\n async [_loadActualVirtually] ({ root }) {\n // have to load on a new Arborist object, so we don't assign\n // the virtualTree on this one! Also, the weird reference is because\n // we can't easily get a ref to Arborist in this module, without\n // creating a circular reference, since this class is a mixin used\n // to build up the Arborist class itself.\n await new this.constructor({...this.options}).loadVirtual({\n root: this[_actualTree],\n })\n await this[_loadWorkspaces](this[_actualTree])\n\n this[_transplant](root)\n return this[_actualTree]\n }\n\n async [_loadActualActually] ({ root, ignoreMissing, global }) {\n await this[_loadFSTree](this[_actualTree])\n await this[_loadWorkspaces](this[_actualTree])\n await this[_loadWorkspaceTargets](this[_actualTree])\n if (!ignoreMissing)\n await this[_findMissingEdges]()\n this[_findFSParents]()\n this[_transplant](root)\n\n if (global) {\n // need to depend on the children, or else all of them\n // will end up being flagged as extraneous, since the\n // global root isn't a \"real\" project\n const tree = this[_actualTree]\n const actualRoot = tree.isLink ? tree.target : tree\n const { dependencies = {} } = actualRoot.package\n for (const name of actualRoot.children.keys())\n dependencies[name] = dependencies[name] || '*'\n actualRoot.package = { ...actualRoot.package, dependencies }\n }\n return this[_actualTree]\n }\n\n // if there are workspace targets without Link nodes created, load\n // the targets, so that we know what they are.\n async [_loadWorkspaceTargets] (tree) {\n if (!tree.workspaces || !tree.workspaces.size)\n return\n\n const promises = []\n for (const path of tree.workspaces.values()) {\n if (!this[_cache].has(path)) {\n const p = this[_loadFSNode]({ path, root: this[_actualTree] })\n .then(node => this[_loadFSTree](node))\n promises.push(p)\n }\n }\n await Promise.all(promises)\n }\n\n [_transplant] (root) {\n if (!root || root === this[_actualTree])\n return\n\n this[_actualTree][_changePath](root.path)\n for (const node of this[_actualTree].children.values()) {\n if (!this[_transplantFilter](node))\n node.root = null\n }\n\n root.replace(this[_actualTree])\n for (const node of this[_actualTree].fsChildren)\n node.root = this[_transplantFilter](node) ? root : null\n\n this[_actualTree] = root\n }\n\n [_loadFSNode] ({ path, parent, real, root }) {\n if (!real) {\n return realpath(path, this[_rpcache], this[_stcache])\n .then(\n real => this[_loadFSNode]({ path, parent, real, root }),\n // if realpath fails, just provide a dummy error node\n error => new Node({ error, path, realpath: path, parent, root })\n )\n }\n\n // cache temporarily holds a promise placeholder so we don't try to create\n // the same node multiple times. this is rare to encounter, given the\n // aggressive caching on realpath and lstat calls, but it's possible that\n // it's already loaded as a tree top, and then gets its parent loaded\n // later, if a symlink points deeper in the tree.\n const cached = this[_cache].get(path)\n if (cached && !cached.dummy) {\n return Promise.resolve(cached).then(node => {\n node.parent = parent\n return node\n })\n }\n\n const p = rpj(join(real, 'package.json'))\n // soldier on if read-package-json raises an error\n .then(pkg => [pkg, null], error => [null, error])\n .then(([pkg, error]) => {\n return this[normalize(path) === real ? _newNode : _newLink]({\n legacyPeerDeps: this.legacyPeerDeps,\n path,\n realpath: real,\n pkg,\n error,\n parent,\n root,\n })\n })\n .then(node => {\n this[_cache].set(path, node)\n return node\n })\n\n this[_cache].set(path, p)\n return p\n }\n\n // this is the way it is to expose a timing issue which is difficult to\n // test otherwise. The creation of a Node may take slightly longer than\n // the creation of a Link that targets it. If the Node has _begun_ its\n // creation phase (and put a Promise in the cache) then the Link will\n // get a Promise as its cachedTarget instead of an actual Node object.\n // This is not a problem, because it gets resolved prior to returning\n // the tree or attempting to load children. However, it IS remarkably\n // difficult to get to happen in a test environment to verify reliably.\n // Hence this kludge.\n [_newNode] (options) {\n // check it for an fsParent if it's a tree top. there's a decent chance\n // it'll get parented later, making the fsParent scan a no-op, but better\n // safe than sorry, since it's cheap.\n const { parent, realpath } = options\n if (!parent)\n this[_topNodes].add(realpath)\n return process.env._TEST_ARBORIST_SLOW_LINK_TARGET_ === '1'\n ? new Promise(res => setTimeout(() => res(new Node(options)), 100))\n : new Node(options)\n }\n\n [_newLink] (options) {\n const { realpath } = options\n this[_topNodes].add(realpath)\n const target = this[_cache].get(realpath)\n const link = new Link({ ...options, target })\n\n if (!target) {\n this[_cache].set(realpath, link.target)\n // if a link target points at a node outside of the root tree's\n // node_modules hierarchy, then load that node as well.\n return this[_loadFSTree](link.target).then(() => link)\n } else if (target.then)\n target.then(node => link.target = node)\n\n return link\n }\n\n [_loadFSTree] (node) {\n const did = this[_actualTreeLoaded]\n node = node.target || node\n\n // if a Link target has started, but not completed, then\n // a Promise will be in the cache to indicate this.\n if (node.then)\n return node.then(node => this[_loadFSTree](node))\n\n // impossible except in pathological ELOOP cases\n /* istanbul ignore if */\n if (did.has(node.realpath))\n return Promise.resolve(node)\n\n did.add(node.realpath)\n return this[_loadFSChildren](node)\n .then(() => Promise.all(\n [...node.children.entries()]\n .filter(([name, kid]) => !did.has(kid.realpath))\n .map(([name, kid]) => this[_loadFSTree](kid))))\n }\n\n // create child nodes for all the entries in node_modules\n // and attach them to the node as a parent\n [_loadFSChildren] (node) {\n const nm = resolve(node.realpath, 'node_modules')\n return readdir(nm).then(kids => {\n return Promise.all(\n // ignore . dirs and retired scoped package folders\n kids.filter(kid => !/^(@[^/]+\\/)?\\./.test(kid))\n .filter(kid => this[_filter](node, kid))\n .map(kid => this[_loadFSNode]({\n parent: node,\n path: resolve(nm, kid),\n })))\n },\n // error in the readdir is not fatal, just means no kids\n () => {})\n }\n\n async [_findMissingEdges] () {\n // try to resolve any missing edges by walking up the directory tree,\n // checking for the package in each node_modules folder. stop at the\n // root directory.\n // The tricky move here is that we load a \"dummy\" node for the folder\n // containing the node_modules folder, so that it can be assigned as\n // the fsParent. It's a bad idea to *actually* load that full node,\n // because people sometimes develop in ~/projects/node_modules/...\n // so we'd end up loading a massive tree with lots of unrelated junk.\n const nmContents = new Map()\n const tree = this[_actualTree]\n for (const node of tree.inventory.values()) {\n const ancestor = ancestorPath(node.realpath, this.path)\n\n const depPromises = []\n for (const [name, edge] of node.edgesOut.entries()) {\n if (!edge.missing && !(edge.to && (edge.to.dummy || edge.to.parent !== node)))\n continue\n\n // start the walk from the dirname, because we would have found\n // the dep in the loadFSTree step already if it was local.\n for (const p of walkUp(dirname(node.realpath))) {\n // only walk as far as the nearest ancestor\n // this keeps us from going into completely unrelated\n // places when a project is just missing something, but\n // allows for finding the transitive deps of link targets.\n // ie, if it has to go up and back out to get to the path\n // from the nearest common ancestor, we've gone too far.\n if (ancestor && /^\\.\\.(?:[\\\\/]|$)/.test(relative(ancestor, p)))\n break\n\n const entries = nmContents.get(p) ||\n await readdir(p + '/node_modules').catch(() => [])\n nmContents.set(p, entries)\n if (!entries.includes(name))\n continue\n\n const d = this[_cache].has(p) ? await this[_cache].get(p)\n : new Node({ path: p, root: node.root, dummy: true })\n this[_cache].set(p, d)\n if (d.dummy) {\n // it's a placeholder, so likely would not have loaded this dep,\n // unless another dep in the tree also needs it.\n const depPath = `${p}/node_modules/${name}`\n const cached = this[_cache].get(depPath)\n if (!cached || cached.dummy) {\n depPromises.push(this[_loadFSNode]({\n path: depPath,\n root: node.root,\n parent: d,\n }).then(node => this[_loadFSTree](node)))\n }\n }\n break\n }\n }\n await Promise.all(depPromises)\n }\n }\n\n // try to find a node that is the parent in a fs tree sense, but not a\n // node_modules tree sense, of any link targets. this allows us to\n // resolve deps that node will find, but a legacy npm view of the\n // world would not have noticed.\n [_findFSParents] () {\n for (const path of this[_topNodes]) {\n const node = this[_cache].get(path)\n if (node && !node.parent && !node.fsParent) {\n for (const p of walkUp(dirname(path))) {\n if (this[_cache].has(p)) {\n node.fsParent = this[_cache].get(p)\n break\n }\n }\n }\n }\n }\n}\n","// mixin providing the loadVirtual method\n\nconst {resolve} = require('path')\n\nconst nameFromFolder = require('@npmcli/name-from-folder')\nconst consistentResolve = require('../consistent-resolve.js')\nconst Shrinkwrap = require('../shrinkwrap.js')\nconst Node = require('../node.js')\nconst Link = require('../link.js')\nconst relpath = require('../relpath.js')\nconst calcDepFlags = require('../calc-dep-flags.js')\nconst rpj = require('read-package-json-fast')\nconst treeCheck = require('../tree-check.js')\n\nconst loadFromShrinkwrap = Symbol('loadFromShrinkwrap')\nconst resolveNodes = Symbol('resolveNodes')\nconst resolveLinks = Symbol('resolveLinks')\nconst assignBundles = Symbol('assignBundles')\nconst loadRoot = Symbol('loadRoot')\nconst loadNode = Symbol('loadVirtualNode')\nconst loadLink = Symbol('loadVirtualLink')\nconst loadWorkspaces = Symbol.for('loadWorkspaces')\nconst loadWorkspacesVirtual = Symbol.for('loadWorkspacesVirtual')\nconst flagsSuspect = Symbol.for('flagsSuspect')\nconst reCalcDepFlags = Symbol('reCalcDepFlags')\nconst checkRootEdges = Symbol('checkRootEdges')\nconst rootOptionProvided = Symbol('rootOptionProvided')\n\nconst depsToEdges = (type, deps) =>\n Object.entries(deps).map(d => [type, ...d])\n\nmodule.exports = cls => class VirtualLoader extends cls {\n constructor (options) {\n super(options)\n\n // the virtual tree we load from a shrinkwrap\n this.virtualTree = options.virtualTree\n this[flagsSuspect] = false\n }\n\n // public method\n async loadVirtual (options = {}) {\n if (this.virtualTree)\n return this.virtualTree\n\n // allow the user to set reify options on the ctor as well.\n // XXX: deprecate separate reify() options object.\n options = { ...this.options, ...options }\n\n if (options.root && options.root.meta) {\n await this[loadFromShrinkwrap](options.root.meta, options.root)\n return treeCheck(this.virtualTree)\n }\n\n const s = await Shrinkwrap.load({ path: this.path })\n if (!s.loadedFromDisk && !options.root) {\n const er = new Error('loadVirtual requires existing shrinkwrap file')\n throw Object.assign(er, { code: 'ENOLOCK' })\n }\n\n // when building the ideal tree, we pass in a root node to this function\n // otherwise, load it from the root package json or the lockfile\n const {\n root = await this[loadRoot](s),\n } = options\n\n this[rootOptionProvided] = options.root\n\n await this[loadFromShrinkwrap](s, root)\n return treeCheck(this.virtualTree)\n }\n\n async [loadRoot] (s) {\n const pj = this.path + '/package.json'\n const pkg = await rpj(pj).catch(() => s.data.packages['']) || {}\n return this[loadWorkspaces](this[loadNode]('', pkg))\n }\n\n async [loadFromShrinkwrap] (s, root) {\n if (!this[rootOptionProvided]) {\n // root is never any of these things, but might be a brand new\n // baby Node object that never had its dep flags calculated.\n root.extraneous = false\n root.dev = false\n root.optional = false\n root.devOptional = false\n root.peer = false\n } else\n this[flagsSuspect] = true\n\n this[checkRootEdges](s, root)\n root.meta = s\n this.virtualTree = root\n const {links, nodes} = this[resolveNodes](s, root)\n await this[resolveLinks](links, nodes)\n if (!(s.originalLockfileVersion >= 2))\n this[assignBundles](nodes)\n if (this[flagsSuspect])\n this[reCalcDepFlags](nodes.values())\n return root\n }\n\n [reCalcDepFlags] (nodes) {\n // reset all dep flags\n // can't use inventory here, because virtualTree might not be root\n for (const node of nodes) {\n if (node.isRoot || node === this[rootOptionProvided])\n continue\n node.extraneous = true\n node.dev = true\n node.optional = true\n node.devOptional = true\n node.peer = true\n }\n calcDepFlags(this.virtualTree, !this[rootOptionProvided])\n }\n\n // check the lockfile deps, and see if they match. if they do not\n // then we have to reset dep flags at the end. for example, if the\n // user manually edits their package.json file, then we need to know\n // that the idealTree is no longer entirely trustworthy.\n [checkRootEdges] (s, root) {\n // loaded virtually from tree, no chance of being out of sync\n // ancient lockfiles are critically damaged by this process,\n // so we need to just hope for the best in those cases.\n if (!s.loadedFromDisk || s.ancientLockfile)\n return\n\n const lock = s.get('')\n const prod = lock.dependencies || {}\n const dev = lock.devDependencies || {}\n const optional = lock.optionalDependencies || {}\n const peer = lock.peerDependencies || {}\n const peerOptional = {}\n if (lock.peerDependenciesMeta) {\n for (const [name, meta] of Object.entries(lock.peerDependenciesMeta)) {\n if (meta.optional && peer[name] !== undefined) {\n peerOptional[name] = peer[name]\n delete peer[name]\n }\n }\n }\n for (const name of Object.keys(optional))\n delete prod[name]\n\n const lockWS = []\n const workspaces = this[loadWorkspacesVirtual]({\n cwd: this.path,\n lockfile: s.data,\n })\n for (const [name, path] of workspaces.entries())\n lockWS.push(['workspace', name, `file:${path}`])\n\n const lockEdges = [\n ...depsToEdges('prod', prod),\n ...depsToEdges('dev', dev),\n ...depsToEdges('optional', optional),\n ...depsToEdges('peer', peer),\n ...depsToEdges('peerOptional', peerOptional),\n ...lockWS,\n ].sort(([atype, aname], [btype, bname]) =>\n atype.localeCompare(btype, 'en') || aname.localeCompare(bname, 'en'))\n\n const rootEdges = [...root.edgesOut.values()]\n .map(e => [e.type, e.name, e.spec])\n .sort(([atype, aname], [btype, bname]) =>\n atype.localeCompare(btype, 'en') || aname.localeCompare(bname, 'en'))\n\n if (rootEdges.length !== lockEdges.length) {\n // something added or removed\n return this[flagsSuspect] = true\n }\n\n for (let i = 0; i < lockEdges.length; i++) {\n if (rootEdges[i][0] !== lockEdges[i][0] ||\n rootEdges[i][1] !== lockEdges[i][1] ||\n rootEdges[i][2] !== lockEdges[i][2])\n return this[flagsSuspect] = true\n }\n }\n\n // separate out link metadatas, and create Node objects for nodes\n [resolveNodes] (s, root) {\n const links = new Map()\n const nodes = new Map([['', root]])\n for (const [location, meta] of Object.entries(s.data.packages)) {\n // skip the root because we already got it\n if (!location)\n continue\n\n if (meta.link)\n links.set(location, meta)\n else\n nodes.set(location, this[loadNode](location, meta))\n }\n return {links, nodes}\n }\n\n // links is the set of metadata, and nodes is the map of non-Link nodes\n // Set the targets to nodes in the set, if we have them (we might not)\n async [resolveLinks] (links, nodes) {\n for (const [location, meta] of links.entries()) {\n const targetPath = resolve(this.path, meta.resolved)\n const targetLoc = relpath(this.path, targetPath)\n const target = nodes.get(targetLoc)\n const link = this[loadLink](location, targetLoc, target, meta)\n nodes.set(location, link)\n nodes.set(targetLoc, link.target)\n\n // we always need to read the package.json for link targets\n // outside node_modules because they can be changed by the local user\n if (!link.target.parent) {\n const pj = link.realpath + '/package.json'\n const pkg = await rpj(pj).catch(() => null)\n if (pkg)\n link.target.package = pkg\n }\n }\n }\n\n [assignBundles] (nodes) {\n for (const [location, node] of nodes) {\n // Skip assignment of parentage for the root package\n if (!location || node.target && !node.target.location)\n continue\n const { name, parent, package: { inBundle }} = node\n\n if (!parent)\n continue\n\n // read inBundle from package because 'package' here is\n // actually a v2 lockfile metadata entry.\n // If the *parent* is also bundled, though, or if the parent has\n // no dependency on it, then we assume that it's being pulled in\n // just by virtue of its parent or a transitive dep being bundled.\n const { package: ppkg } = parent\n const { inBundle: parentBundled } = ppkg\n if (inBundle && !parentBundled && parent.edgesOut.has(node.name)) {\n if (!ppkg.bundleDependencies)\n ppkg.bundleDependencies = [name]\n else\n ppkg.bundleDependencies.push(name)\n }\n }\n }\n\n [loadNode] (location, sw) {\n const p = this.virtualTree ? this.virtualTree.realpath : this.path\n const path = resolve(p, location)\n // shrinkwrap doesn't include package name unless necessary\n if (!sw.name)\n sw.name = nameFromFolder(path)\n\n const dev = sw.dev\n const optional = sw.optional\n const devOptional = dev || optional || sw.devOptional\n const peer = sw.peer\n\n const node = new Node({\n legacyPeerDeps: this.legacyPeerDeps,\n root: this.virtualTree,\n path,\n realpath: path,\n integrity: sw.integrity,\n resolved: consistentResolve(sw.resolved, this.path, path),\n pkg: sw,\n hasShrinkwrap: sw.hasShrinkwrap,\n dev,\n optional,\n devOptional,\n peer,\n })\n // cast to boolean because they're undefined in the lock file when false\n node.extraneous = !!sw.extraneous\n node.devOptional = !!(sw.devOptional || sw.dev || sw.optional)\n node.peer = !!sw.peer\n node.optional = !!sw.optional\n node.dev = !!sw.dev\n return node\n }\n\n [loadLink] (location, targetLoc, target, meta) {\n const path = resolve(this.path, location)\n const link = new Link({\n legacyPeerDeps: this.legacyPeerDeps,\n path,\n realpath: resolve(this.path, targetLoc),\n target,\n pkg: target && target.package,\n })\n link.extraneous = target.extraneous\n link.devOptional = target.devOptional\n link.peer = target.peer\n link.optional = target.optional\n link.dev = target.dev\n return link\n }\n}\n","const mapWorkspaces = require('@npmcli/map-workspaces')\n\nconst _appendWorkspaces = Symbol('appendWorkspaces')\n// shared ref used by other mixins/Arborist\nconst _loadWorkspaces = Symbol.for('loadWorkspaces')\nconst _loadWorkspacesVirtual = Symbol.for('loadWorkspacesVirtual')\n\nmodule.exports = cls => class MapWorkspaces extends cls {\n [_appendWorkspaces] (node, workspaces) {\n if (node && workspaces.size)\n node.workspaces = workspaces\n\n return node\n }\n\n async [_loadWorkspaces] (node) {\n if (node.workspaces)\n return node\n\n const workspaces = await mapWorkspaces({\n cwd: node.path,\n pkg: node.package,\n })\n\n return this[_appendWorkspaces](node, workspaces)\n }\n\n [_loadWorkspacesVirtual] (opts) {\n return mapWorkspaces.virtual(opts)\n }\n}\n","const _idealTreePrune = Symbol.for('idealTreePrune')\n\nmodule.exports = cls => class Pruner extends cls {\n async prune (options = {}) {\n // allow the user to set options on the ctor as well.\n // XXX: deprecate separate method options objects.\n options = { ...this.options, ...options }\n\n await this.buildIdealTree(options)\n\n this[_idealTreePrune]()\n\n return this.reify(options)\n }\n}\n","// Arborist.rebuild({path = this.path}) will do all the binlinks and\n// bundle building needed. Called by reify, and by `npm rebuild`.\n\nconst {depth: dfwalk} = require('treeverse')\nconst promiseAllRejectLate = require('promise-all-reject-late')\nconst rpj = require('read-package-json-fast')\nconst binLinks = require('bin-links')\nconst runScript = require('@npmcli/run-script')\nconst promiseCallLimit = require('promise-call-limit')\nconst {resolve} = require('path')\nconst {\n isNodeGypPackage,\n defaultGypInstallScript,\n} = require('@npmcli/node-gyp')\n\nconst boolEnv = b => b ? '1' : ''\nconst sortNodes = (a, b) => (a.depth - b.depth) || a.path.localeCompare(b.path, 'en')\n\nconst _workspaces = Symbol.for('workspaces')\nconst _build = Symbol('build')\nconst _resetQueues = Symbol('resetQueues')\nconst _rebuildBundle = Symbol('rebuildBundle')\nconst _ignoreScripts = Symbol('ignoreScripts')\nconst _binLinks = Symbol('binLinks')\nconst _oldMeta = Symbol('oldMeta')\nconst _createBinLinks = Symbol('createBinLinks')\nconst _doHandleOptionalFailure = Symbol('doHandleOptionalFailure')\nconst _linkAllBins = Symbol('linkAllBins')\nconst _runScripts = Symbol('runScripts')\nconst _buildQueues = Symbol('buildQueues')\nconst _addToBuildSet = Symbol('addToBuildSet')\nconst _checkBins = Symbol.for('checkBins')\nconst _queues = Symbol('queues')\nconst _scriptShell = Symbol('scriptShell')\n\nconst _force = Symbol.for('force')\n\n// defined by reify mixin\nconst _handleOptionalFailure = Symbol.for('handleOptionalFailure')\nconst _trashList = Symbol.for('trashList')\n\nmodule.exports = cls => class Builder extends cls {\n constructor (options) {\n super(options)\n\n const {\n ignoreScripts = false,\n scriptShell,\n binLinks = true,\n rebuildBundle = true,\n } = options\n\n this.scriptsRun = new Set()\n this[_binLinks] = binLinks\n this[_ignoreScripts] = !!ignoreScripts\n this[_scriptShell] = scriptShell\n this[_rebuildBundle] = !!rebuildBundle\n this[_resetQueues]()\n this[_oldMeta] = null\n }\n\n async rebuild ({ nodes, handleOptionalFailure = false } = {}) {\n // nothing to do if we're not building anything!\n if (this[_ignoreScripts] && !this[_binLinks])\n return\n\n // when building for the first time, as part of reify, we ignore\n // failures in optional nodes, and just delete them. however, when\n // running JUST a rebuild, we treat optional failures as real fails\n this[_doHandleOptionalFailure] = handleOptionalFailure\n\n // if we don't have a set of nodes, then just rebuild\n // the actual tree on disk.\n if (!nodes) {\n const tree = await this.loadActual()\n if (this[_workspaces] && this[_workspaces].length) {\n const filterSet = this.workspaceDependencySet(tree, this[_workspaces])\n nodes = tree.inventory.filter(node => filterSet.has(node))\n } else\n nodes = tree.inventory.values()\n }\n\n // separates links nodes so that it can run\n // prepare scripts and link bins in the expected order\n process.emit('time', 'build')\n const depNodes = new Set()\n const linkNodes = new Set()\n for (const node of nodes) {\n // we skip the target nodes to that workspace in order to make sure\n // we only run lifecycle scripts / place bin links once per workspace\n if (node.isLink)\n linkNodes.add(node)\n else\n depNodes.add(node)\n }\n\n await this[_build](depNodes, {})\n\n if (linkNodes.size) {\n this[_resetQueues]()\n await this[_build](linkNodes, { type: 'links' })\n }\n\n process.emit('timeEnd', 'build')\n }\n\n [_resetQueues] () {\n this[_queues] = {\n preinstall: [],\n install: [],\n postinstall: [],\n prepare: [],\n bin: [],\n }\n }\n\n async [_build] (nodes, { type = 'deps' }) {\n process.emit('time', `build:${type}`)\n\n await this[_buildQueues](nodes)\n if (!this[_ignoreScripts])\n await this[_runScripts]('preinstall')\n if (this[_binLinks] && type !== 'links')\n await this[_linkAllBins]()\n\n // links should also run prepare scripts and only link bins after that\n if (type === 'links') {\n await this[_runScripts]('prepare')\n\n if (this[_binLinks])\n await this[_linkAllBins]()\n }\n\n if (!this[_ignoreScripts]) {\n await this[_runScripts]('install')\n await this[_runScripts]('postinstall')\n }\n\n process.emit('timeEnd', `build:${type}`)\n }\n\n async [_buildQueues] (nodes) {\n process.emit('time', 'build:queue')\n const set = new Set()\n\n const promises = []\n for (const node of nodes) {\n promises.push(this[_addToBuildSet](node, set))\n\n // if it has bundle deps, add those too, if rebuildBundle\n if (this[_rebuildBundle] !== false) {\n const bd = node.package.bundleDependencies\n if (bd && bd.length) {\n dfwalk({\n tree: node,\n leave: node => promises.push(this[_addToBuildSet](node, set)),\n getChildren: node => [...node.children.values()],\n filter: node => node.inBundle,\n })\n }\n }\n }\n await promiseAllRejectLate(promises)\n\n // now sort into the queues for the 4 things we have to do\n // run in the same predictable order that buildIdealTree uses\n // there's no particular reason for doing it in this order rather\n // than another, but sorting *somehow* makes it consistent.\n const queue = [...set].sort(sortNodes)\n\n for (const node of queue) {\n const { package: { bin, scripts = {} } } = node\n const { preinstall, install, postinstall, prepare } = scripts\n const tests = { bin, preinstall, install, postinstall, prepare }\n for (const [key, has] of Object.entries(tests)) {\n if (has)\n this[_queues][key].push(node)\n }\n }\n process.emit('timeEnd', 'build:queue')\n }\n\n async [_checkBins] (node) {\n // if the node is a global top, and we're not in force mode, then\n // any existing bins need to either be missing, or a symlink into\n // the node path. Otherwise a package can have a preinstall script\n // that unlinks something, to allow them to silently overwrite system\n // binaries, which is unsafe and insecure.\n if (!node.globalTop || this[_force])\n return\n const { path, package: pkg } = node\n await binLinks.checkBins({ pkg, path, top: true, global: true })\n }\n\n async [_addToBuildSet] (node, set, refreshed = false) {\n if (set.has(node))\n return\n\n if (this[_oldMeta] === null) {\n const {root: {meta}} = node\n this[_oldMeta] = meta && meta.loadedFromDisk &&\n !(meta.originalLockfileVersion >= 2)\n }\n\n const { package: pkg, hasInstallScript } = node\n const { gypfile, bin, scripts = {} } = pkg\n\n const { preinstall, install, postinstall, prepare } = scripts\n const anyScript = preinstall || install || postinstall || prepare\n if (!refreshed && !anyScript && (hasInstallScript || this[_oldMeta])) {\n // we either have an old metadata (and thus might have scripts)\n // or we have an indication that there's install scripts (but\n // don't yet know what they are) so we have to load the package.json\n // from disk to see what the deal is. Failure here just means\n // no scripts to add, probably borked package.json.\n // add to the set then remove while we're reading the pj, so we\n // don't accidentally hit it multiple times.\n set.add(node)\n const pkg = await rpj(node.path + '/package.json').catch(() => ({}))\n set.delete(node)\n\n const {scripts = {}} = pkg\n node.package.scripts = scripts\n return this[_addToBuildSet](node, set, true)\n }\n\n // Rebuild node-gyp dependencies lacking an install or preinstall script\n // note that 'scripts' might be missing entirely, and the package may\n // set gypfile:false to avoid this automatic detection.\n const isGyp = gypfile !== false &&\n !install &&\n !preinstall &&\n await isNodeGypPackage(node.path)\n\n if (bin || preinstall || install || postinstall || prepare || isGyp) {\n if (bin)\n await this[_checkBins](node)\n if (isGyp) {\n scripts.install = defaultGypInstallScript\n node.package.scripts = scripts\n }\n set.add(node)\n }\n }\n\n async [_runScripts] (event) {\n const queue = this[_queues][event]\n\n if (!queue.length)\n return\n\n process.emit('time', `build:run:${event}`)\n const stdio = this.options.foregroundScripts ? 'inherit' : 'pipe'\n const limit = this.options.foregroundScripts ? 1 : undefined\n await promiseCallLimit(queue.map(node => async () => {\n const {\n path,\n integrity,\n resolved,\n optional,\n peer,\n dev,\n devOptional,\n package: pkg,\n location,\n } = node.target || node\n\n // skip any that we know we'll be deleting\n if (this[_trashList].has(path))\n return\n\n const timer = `build:run:${event}:${location}`\n process.emit('time', timer)\n this.log.info('run', pkg._id, event, location, pkg.scripts[event])\n const env = {\n npm_package_resolved: resolved,\n npm_package_integrity: integrity,\n npm_package_json: resolve(path, 'package.json'),\n npm_package_optional: boolEnv(optional),\n npm_package_dev: boolEnv(dev),\n npm_package_peer: boolEnv(peer),\n npm_package_dev_optional:\n boolEnv(devOptional && !dev && !optional),\n }\n const runOpts = {\n event,\n path,\n pkg,\n stdioString: true,\n stdio,\n env,\n scriptShell: this[_scriptShell],\n }\n const p = runScript(runOpts).catch(er => {\n const { code, signal } = er\n this.log.info('run', pkg._id, event, {code, signal})\n throw er\n }).then(({args, code, signal, stdout, stderr}) => {\n this.scriptsRun.add({\n pkg,\n path,\n event,\n cmd: args && args[args.length - 1],\n env,\n code,\n signal,\n stdout,\n stderr,\n })\n this.log.info('run', pkg._id, event, {code, signal})\n })\n\n await (this[_doHandleOptionalFailure]\n ? this[_handleOptionalFailure](node, p)\n : p)\n\n process.emit('timeEnd', timer)\n }), limit)\n process.emit('timeEnd', `build:run:${event}`)\n }\n\n async [_linkAllBins] () {\n const queue = this[_queues].bin\n if (!queue.length)\n return\n\n process.emit('time', 'build:link')\n const promises = []\n // sort the queue by node path, so that the module-local collision\n // detector in bin-links will always resolve the same way.\n for (const node of queue.sort(sortNodes))\n promises.push(this[_createBinLinks](node))\n\n await promiseAllRejectLate(promises)\n process.emit('timeEnd', 'build:link')\n }\n\n async [_createBinLinks] (node) {\n if (this[_trashList].has(node.path))\n return\n\n process.emit('time', `build:link:${node.location}`)\n\n const p = binLinks({\n pkg: node.package,\n path: node.path,\n top: !!(node.isTop || node.globalTop),\n force: this[_force],\n global: !!node.globalTop,\n })\n\n await (this[_doHandleOptionalFailure]\n ? this[_handleOptionalFailure](node, p)\n : p)\n\n process.emit('timeEnd', `build:link:${node.location}`)\n }\n}\n","// mixin implementing the reify method\n\nconst onExit = require('../signal-handling.js')\nconst pacote = require('pacote')\nconst AuditReport = require('../audit-report.js')\nconst {subset, intersects} = require('semver')\nconst npa = require('npm-package-arg')\n\nconst {dirname, resolve, relative} = require('path')\nconst {depth: dfwalk} = require('treeverse')\nconst fs = require('fs')\nconst {promisify} = require('util')\nconst symlink = promisify(fs.symlink)\nconst mkdirp = require('mkdirp-infer-owner')\nconst justMkdirp = require('mkdirp')\nconst moveFile = require('@npmcli/move-file')\nconst rimraf = promisify(require('rimraf'))\nconst packageContents = require('@npmcli/installed-package-contents')\nconst { checkEngine, checkPlatform } = require('npm-install-checks')\n\nconst treeCheck = require('../tree-check.js')\nconst relpath = require('../relpath.js')\nconst Diff = require('../diff.js')\nconst retirePath = require('../retire-path.js')\nconst promiseAllRejectLate = require('promise-all-reject-late')\nconst optionalSet = require('../optional-set.js')\nconst updateRootPackageJson = require('../update-root-package-json.js')\nconst calcDepFlags = require('../calc-dep-flags.js')\nconst { saveTypeMap, hasSubKey } = require('../add-rm-pkg-deps.js')\n\nconst _retiredPaths = Symbol('retiredPaths')\nconst _retiredUnchanged = Symbol('retiredUnchanged')\nconst _sparseTreeDirs = Symbol('sparseTreeDirs')\nconst _sparseTreeRoots = Symbol('sparseTreeRoots')\nconst _savePrefix = Symbol('savePrefix')\nconst _retireShallowNodes = Symbol.for('retireShallowNodes')\nconst _getBundlesByDepth = Symbol('getBundlesByDepth')\nconst _registryResolved = Symbol('registryResolved')\nconst _addNodeToTrashList = Symbol('addNodeToTrashList')\nconst _workspaces = Symbol.for('workspaces')\n\n// shared by rebuild mixin\nconst _trashList = Symbol.for('trashList')\nconst _handleOptionalFailure = Symbol.for('handleOptionalFailure')\nconst _loadTrees = Symbol.for('loadTrees')\n\n// shared symbols for swapping out when testing\nconst _diffTrees = Symbol.for('diffTrees')\nconst _createSparseTree = Symbol.for('createSparseTree')\nconst _loadShrinkwrapsAndUpdateTrees = Symbol.for('loadShrinkwrapsAndUpdateTrees')\nconst _shrinkwrapInflated = Symbol('shrinkwrapInflated')\nconst _bundleUnpacked = Symbol('bundleUnpacked')\nconst _reifyNode = Symbol.for('reifyNode')\nconst _extractOrLink = Symbol('extractOrLink')\n// defined by rebuild mixin\nconst _checkBins = Symbol.for('checkBins')\nconst _symlink = Symbol('symlink')\nconst _warnDeprecated = Symbol('warnDeprecated')\nconst _loadBundlesAndUpdateTrees = Symbol.for('loadBundlesAndUpdateTrees')\nconst _submitQuickAudit = Symbol('submitQuickAudit')\nconst _awaitQuickAudit = Symbol('awaitQuickAudit')\nconst _unpackNewModules = Symbol.for('unpackNewModules')\nconst _moveContents = Symbol.for('moveContents')\nconst _moveBackRetiredUnchanged = Symbol.for('moveBackRetiredUnchanged')\nconst _build = Symbol.for('build')\nconst _removeTrash = Symbol.for('removeTrash')\nconst _renamePath = Symbol.for('renamePath')\nconst _rollbackRetireShallowNodes = Symbol.for('rollbackRetireShallowNodes')\nconst _rollbackCreateSparseTree = Symbol.for('rollbackCreateSparseTree')\nconst _rollbackMoveBackRetiredUnchanged = Symbol.for('rollbackMoveBackRetiredUnchanged')\nconst _saveIdealTree = Symbol.for('saveIdealTree')\nconst _saveLockFile = Symbol('saveLockFile')\nconst _copyIdealToActual = Symbol('copyIdealToActual')\nconst _addOmitsToTrashList = Symbol('addOmitsToTrashList')\nconst _packageLockOnly = Symbol('packageLockOnly')\nconst _dryRun = Symbol('dryRun')\nconst _validatePath = Symbol('validatePath')\nconst _reifyPackages = Symbol('reifyPackages')\n\nconst _omitDev = Symbol('omitDev')\nconst _omitOptional = Symbol('omitOptional')\nconst _omitPeer = Symbol('omitPeer')\n\nconst _global = Symbol.for('global')\n\n// defined by Ideal mixin\nconst _pruneBundledMetadeps = Symbol.for('pruneBundledMetadeps')\nconst _resolvedAdd = Symbol.for('resolvedAdd')\nconst _usePackageLock = Symbol.for('usePackageLock')\nconst _formatPackageLock = Symbol.for('formatPackageLock')\n\nmodule.exports = cls => class Reifier extends cls {\n constructor (options) {\n super(options)\n\n const {\n savePrefix = '^',\n packageLockOnly = false,\n dryRun = false,\n formatPackageLock = true,\n } = options\n\n this[_dryRun] = !!dryRun\n this[_packageLockOnly] = !!packageLockOnly\n this[_savePrefix] = savePrefix\n this[_formatPackageLock] = !!formatPackageLock\n\n this.diff = null\n this[_retiredPaths] = {}\n this[_shrinkwrapInflated] = new Set()\n this[_retiredUnchanged] = {}\n this[_sparseTreeDirs] = new Set()\n this[_sparseTreeRoots] = new Set()\n this[_trashList] = new Set()\n }\n\n // public method\n async reify (options = {}) {\n if (this[_packageLockOnly] && this[_global]) {\n const er = new Error('cannot generate lockfile for global packages')\n er.code = 'ESHRINKWRAPGLOBAL'\n throw er\n }\n\n const omit = new Set(options.omit || [])\n this[_omitDev] = omit.has('dev')\n this[_omitOptional] = omit.has('optional')\n this[_omitPeer] = omit.has('peer')\n\n // start tracker block\n this.addTracker('reify')\n process.emit('time', 'reify')\n await this[_validatePath]()\n await this[_loadTrees](options)\n await this[_diffTrees]()\n await this[_reifyPackages]()\n await this[_saveIdealTree](options)\n await this[_copyIdealToActual]()\n await this[_awaitQuickAudit]()\n\n this.finishTracker('reify')\n process.emit('timeEnd', 'reify')\n return treeCheck(this.actualTree)\n }\n\n async [_validatePath] () {\n // don't create missing dirs on dry runs\n if (this[_packageLockOnly] || this[_dryRun])\n return\n\n // we do NOT want to set ownership on this folder, especially\n // recursively, because it can have other side effects to do that\n // in a project directory. We just want to make it if it's missing.\n await justMkdirp(resolve(this.path))\n }\n\n async [_reifyPackages] () {\n // we don't submit the audit report or write to disk on dry runs\n if (this[_dryRun])\n return\n\n if (this[_packageLockOnly]) {\n // we already have the complete tree, so just audit it now,\n // and that's all we have to do here.\n return this[_submitQuickAudit]()\n }\n\n // ok, we're about to start touching the fs. need to roll back\n // if we get an early termination.\n let reifyTerminated = null\n const removeHandler = onExit(({signal}) => {\n // only call once. if signal hits twice, we just terminate\n removeHandler()\n reifyTerminated = Object.assign(new Error('process terminated'), {\n signal,\n })\n return false\n })\n\n // [rollbackfn, [...actions]]\n // after each step, if the process was terminated, execute the rollback\n // note that each rollback *also* calls the previous one when it's\n // finished, and then the first one throws the error, so we only need\n // a new rollback step when we have a new thing that must be done to\n // revert the install.\n const steps = [\n [_rollbackRetireShallowNodes, [\n _retireShallowNodes,\n ]],\n [_rollbackCreateSparseTree, [\n _createSparseTree,\n _addOmitsToTrashList,\n _loadShrinkwrapsAndUpdateTrees,\n _loadBundlesAndUpdateTrees,\n _submitQuickAudit,\n _unpackNewModules,\n ]],\n [_rollbackMoveBackRetiredUnchanged, [\n _moveBackRetiredUnchanged,\n _build,\n ]],\n ]\n for (const [rollback, actions] of steps) {\n for (const action of actions) {\n try {\n await this[action]()\n if (reifyTerminated)\n throw reifyTerminated\n } catch (er) {\n await this[rollback](er)\n /* istanbul ignore next - rollback throws, should never hit this */\n throw er\n }\n }\n }\n\n // no rollback for this one, just exit with the error, since the\n // install completed and can't be safely recovered at this point.\n await this[_removeTrash]()\n if (reifyTerminated)\n throw reifyTerminated\n\n // done modifying the file system, no need to keep listening for sigs\n removeHandler()\n }\n\n // when doing a local install, we load everything and figure it all out.\n // when doing a global install, we *only* care about the explicit requests.\n [_loadTrees] (options) {\n process.emit('time', 'reify:loadTrees')\n const bitOpt = {\n ...options,\n complete: this[_packageLockOnly] || this[_dryRun],\n }\n\n // if we're only writing a package lock, then it doesn't matter what's here\n if (this[_packageLockOnly]) {\n return this.buildIdealTree(bitOpt)\n .then(() => process.emit('timeEnd', 'reify:loadTrees'))\n }\n\n const actualOpt = this[_global] ? {\n ignoreMissing: true,\n global: true,\n filter: (node, kid) => {\n // if it's not the project root, and we have no explicit requests,\n // then we're already into a nested dep, so we keep it\n if (this.explicitRequests.size === 0 || !node.isProjectRoot)\n return true\n\n // if we added it as an edgeOut, then we want it\n if (this.idealTree.edgesOut.has(kid))\n return true\n\n // if it's an explicit request, then we want it\n const hasExplicit = [...this.explicitRequests]\n .some(edge => edge.name === kid)\n if (hasExplicit)\n return true\n\n // ignore the rest of the global install folder\n return false\n },\n } : { ignoreMissing: true }\n\n if (!this[_global]) {\n return Promise.all([this.loadActual(actualOpt), this.buildIdealTree(bitOpt)])\n .then(() => process.emit('timeEnd', 'reify:loadTrees'))\n }\n\n // the global install space tends to have a lot of stuff in it. don't\n // load all of it, just what we care about. we won't be saving a\n // hidden lockfile in there anyway. Note that we have to load ideal\n // BEFORE loading actual, so that the actualOpt can use the\n // explicitRequests which is set during buildIdealTree\n return this.buildIdealTree(bitOpt)\n .then(() => this.loadActual(actualOpt))\n .then(() => process.emit('timeEnd', 'reify:loadTrees'))\n }\n\n [_diffTrees] () {\n if (this[_packageLockOnly])\n return\n\n process.emit('time', 'reify:diffTrees')\n // XXX if we have an existing diff already, there should be a way\n // to just invalidate the parts that changed, but avoid walking the\n // whole tree again.\n\n const filterNodes = []\n if (this[_global] && this.explicitRequests.size) {\n const idealTree = this.idealTree.target || this.idealTree\n const actualTree = this.actualTree.target || this.actualTree\n // we ONLY are allowed to make changes in the global top-level\n // children where there's an explicit request.\n for (const { name } of this.explicitRequests) {\n const ideal = idealTree.children.get(name)\n if (ideal)\n filterNodes.push(ideal)\n const actual = actualTree.children.get(name)\n if (actual)\n filterNodes.push(actual)\n }\n } else {\n for (const ws of this[_workspaces]) {\n const ideal = this.idealTree.children.get(ws)\n if (ideal)\n filterNodes.push(ideal)\n const actual = this.actualTree.children.get(ws)\n if (actual)\n filterNodes.push(actual)\n }\n }\n\n // find all the nodes that need to change between the actual\n // and ideal trees.\n this.diff = Diff.calculate({\n shrinkwrapInflated: this[_shrinkwrapInflated],\n filterNodes,\n actual: this.actualTree,\n ideal: this.idealTree,\n })\n\n for (const node of this.diff.removed) {\n // a node in a dep bundle will only be removed if its bundling dep\n // is removed as well. in which case, we don't have to delete it!\n if (!node.inDepBundle)\n this[_addNodeToTrashList](node)\n }\n process.emit('timeEnd', 'reify:diffTrees')\n }\n\n // add the node and all its bins to the list of things to be\n // removed later on in the process. optionally, also mark them\n // as a retired paths, so that we move them out of the way and\n // replace them when rolling back on failure.\n [_addNodeToTrashList] (node, retire) {\n const paths = [node.path, ...node.binPaths]\n const moves = this[_retiredPaths]\n this.log.silly('reify', 'mark', retire ? 'retired' : 'deleted', paths)\n for (const path of paths) {\n if (retire) {\n const retired = retirePath(path)\n moves[path] = retired\n this[_trashList].add(retired)\n } else\n this[_trashList].add(path)\n }\n }\n\n // move aside the shallowest nodes in the tree that have to be\n // changed or removed, so that we can rollback if necessary.\n [_retireShallowNodes] () {\n process.emit('time', 'reify:retireShallow')\n const moves = this[_retiredPaths] = {}\n for (const diff of this.diff.children) {\n if (diff.action === 'CHANGE' || diff.action === 'REMOVE') {\n // we'll have to clean these up at the end, so add them to the list\n this[_addNodeToTrashList](diff.actual, true)\n }\n }\n this.log.silly('reify', 'moves', moves)\n const movePromises = Object.entries(moves)\n .map(([from, to]) => this[_renamePath](from, to))\n return promiseAllRejectLate(movePromises)\n .then(() => process.emit('timeEnd', 'reify:retireShallow'))\n }\n\n [_renamePath] (from, to, didMkdirp = false) {\n return moveFile(from, to)\n .catch(er => {\n // Occasionally an expected bin file might not exist in the package,\n // or a shim/symlink might have been moved aside. If we've already\n // handled the most common cause of ENOENT (dir doesn't exist yet),\n // then just ignore any ENOENT.\n if (er.code === 'ENOENT') {\n return didMkdirp ? null : mkdirp(dirname(to)).then(() =>\n this[_renamePath](from, to, true))\n } else if (er.code === 'EEXIST')\n return rimraf(to).then(() => moveFile(from, to))\n else\n throw er\n })\n }\n\n [_rollbackRetireShallowNodes] (er) {\n process.emit('time', 'reify:rollback:retireShallow')\n const moves = this[_retiredPaths]\n const movePromises = Object.entries(moves)\n .map(([from, to]) => this[_renamePath](to, from))\n return promiseAllRejectLate(movePromises)\n // ignore subsequent rollback errors\n .catch(er => {})\n .then(() => process.emit('timeEnd', 'reify:rollback:retireShallow'))\n .then(() => {\n throw er\n })\n }\n\n // adding to the trash list will skip reifying, and delete them\n // if they are currently in the tree and otherwise untouched.\n [_addOmitsToTrashList] () {\n if (!this[_omitDev] && !this[_omitOptional] && !this[_omitPeer])\n return\n\n process.emit('time', 'reify:trashOmits')\n // node.parent is checked to make sure this is a node that's in the tree, and\n // not the parent-less top level nodes\n const filter = node =>\n node.isDescendantOf(this.idealTree) &&\n (node.peer && this[_omitPeer] ||\n node.dev && this[_omitDev] ||\n node.optional && this[_omitOptional] ||\n node.devOptional && this[_omitOptional] && this[_omitDev])\n\n for (const node of this.idealTree.inventory.filter(filter))\n this[_addNodeToTrashList](node)\n\n process.emit('timeEnd', 'reify:trashOmits')\n }\n\n [_createSparseTree] () {\n process.emit('time', 'reify:createSparse')\n // if we call this fn again, we look for the previous list\n // so that we can avoid making the same directory multiple times\n const dirs = this.diff.leaves\n .filter(diff => {\n return (diff.action === 'ADD' || diff.action === 'CHANGE') &&\n !this[_sparseTreeDirs].has(diff.ideal.path) &&\n !diff.ideal.isLink\n })\n .map(diff => diff.ideal.path)\n\n return promiseAllRejectLate(dirs.map(d => mkdirp(d)))\n .then(made => {\n made.forEach(made => this[_sparseTreeRoots].add(made))\n dirs.forEach(dir => this[_sparseTreeDirs].add(dir))\n })\n .then(() => process.emit('timeEnd', 'reify:createSparse'))\n }\n\n [_rollbackCreateSparseTree] (er) {\n process.emit('time', 'reify:rollback:createSparse')\n // cut the roots of the sparse tree that were created, not the leaves\n const roots = this[_sparseTreeRoots]\n // also delete the moves that we retired, so that we can move them back\n const failures = []\n const targets = [...roots, ...Object.keys(this[_retiredPaths])]\n const unlinks = targets\n .map(path => rimraf(path).catch(er => failures.push([path, er])))\n return promiseAllRejectLate(unlinks)\n .then(() => {\n if (failures.length)\n this.log.warn('cleanup', 'Failed to remove some directories', failures)\n })\n .then(() => process.emit('timeEnd', 'reify:rollback:createSparse'))\n .then(() => this[_rollbackRetireShallowNodes](er))\n }\n\n // shrinkwrap nodes define their dependency branches with a file, so\n // we need to unpack them, read that shrinkwrap file, and then update\n // the tree by calling loadVirtual with the node as the root.\n [_loadShrinkwrapsAndUpdateTrees] () {\n const seen = this[_shrinkwrapInflated]\n const shrinkwraps = this.diff.leaves\n .filter(d => (d.action === 'CHANGE' || d.action === 'ADD' || !d.action) &&\n d.ideal.hasShrinkwrap && !seen.has(d.ideal) &&\n !this[_trashList].has(d.ideal.path))\n\n if (!shrinkwraps.length)\n return\n\n process.emit('time', 'reify:loadShrinkwraps')\n\n const Arborist = this.constructor\n return promiseAllRejectLate(shrinkwraps.map(diff => {\n const node = diff.ideal\n seen.add(node)\n return diff.action ? this[_reifyNode](node) : node\n }))\n .then(nodes => promiseAllRejectLate(nodes.map(node => new Arborist({\n ...this.options,\n path: node.path,\n }).loadVirtual({ root: node }))))\n // reload the diff and sparse tree because the ideal tree changed\n .then(() => this[_diffTrees]())\n .then(() => this[_createSparseTree]())\n .then(() => this[_addOmitsToTrashList]())\n .then(() => this[_loadShrinkwrapsAndUpdateTrees]())\n .then(() => process.emit('timeEnd', 'reify:loadShrinkwraps'))\n }\n\n // create a symlink for Links, extract for Nodes\n // return the node object, since we usually want that\n // handle optional dep failures here\n // If node is in trash list, skip it\n // If reifying fails, and the node is optional, add it and its optionalSet\n // to the trash list\n // Always return the node.\n [_reifyNode] (node) {\n if (this[_trashList].has(node.path))\n return node\n\n const timer = `reifyNode:${node.location}`\n process.emit('time', timer)\n this.addTracker('reify', node.name, node.location)\n\n const { npmVersion, nodeVersion } = this.options\n const p = Promise.resolve()\n .then(async () => {\n // when we reify an optional node, check the engine and platform\n // first. be sure to ignore the --force and --engine-strict flags,\n // since we always want to skip any optional packages we can't install.\n // these checks throwing will result in a rollback and removal\n // of the mismatches\n if (node.optional) {\n checkEngine(node.package, npmVersion, nodeVersion, false)\n checkPlatform(node.package, false)\n }\n await this[_checkBins](node)\n await this[_extractOrLink](node)\n await this[_warnDeprecated](node)\n })\n\n return this[_handleOptionalFailure](node, p)\n .then(() => {\n this.finishTracker('reify', node.name, node.location)\n process.emit('timeEnd', timer)\n return node\n })\n }\n\n [_extractOrLink] (node) {\n // in normal cases, node.resolved should *always* be set by now.\n // however, it is possible when a lockfile is damaged, or very old,\n // or in some other race condition bugs in npm v6, that a previously\n // bundled dependency will have just a version, but no resolved value,\n // and no 'bundled: true' setting.\n // Do the best with what we have, or else remove it from the tree\n // entirely, since we can't possibly reify it.\n const res = node.resolved ? `${node.name}@${this[_registryResolved](node.resolved)}`\n : node.packageName && node.version\n ? `${node.packageName}@${node.version}`\n : null\n\n // no idea what this thing is. remove it from the tree.\n if (!res) {\n const warning = 'invalid or damaged lockfile detected\\n' +\n 'please re-try this operation once it completes\\n' +\n 'so that the damage can be corrected, or perform\\n' +\n 'a fresh install with no lockfile if the problem persists.'\n this.log.warn('reify', warning)\n this.log.verbose('reify', 'unrecognized node in tree', node.path)\n node.parent = null\n node.fsParent = null\n this[_addNodeToTrashList](node)\n return\n }\n\n return node.isLink\n ? rimraf(node.path).then(() => this[_symlink](node))\n : pacote.extract(res, node.path, {\n ...this.options,\n resolved: node.resolved,\n integrity: node.integrity,\n })\n }\n\n async [_symlink] (node) {\n const dir = dirname(node.path)\n const target = node.realpath\n const rel = relative(dir, target)\n await mkdirp(dir)\n return symlink(rel, node.path, 'junction')\n }\n\n [_warnDeprecated] (node) {\n const {_id, deprecated} = node.package\n if (deprecated)\n this.log.warn('deprecated', `${_id}: ${deprecated}`)\n }\n\n // if the node is optional, then the failure of the promise is nonfatal\n // just add it and its optional set to the trash list.\n [_handleOptionalFailure] (node, p) {\n return (node.optional ? p.catch(er => {\n const set = optionalSet(node)\n for (node of set) {\n this.log.verbose('reify', 'failed optional dependency', node.path)\n this[_addNodeToTrashList](node)\n }\n }) : p).then(() => node)\n }\n\n [_registryResolved] (resolved) {\n // the default registry url is a magic value meaning \"the currently\n // configured registry\".\n //\n // XXX: use a magic string that isn't also a valid value, like\n // ${REGISTRY} or something. This has to be threaded through the\n // Shrinkwrap and Node classes carefully, so for now, just treat\n // the default reg as the magical animal that it has been.\n return resolved && resolved\n .replace(/^https?:\\/\\/registry.npmjs.org\\//, this.registry)\n }\n\n // bundles are *sort of* like shrinkwraps, in that the branch is defined\n // by the contents of the package. however, in their case, rather than\n // shipping a virtual tree that must be reified, they ship an entire\n // reified actual tree that must be unpacked and not modified.\n [_loadBundlesAndUpdateTrees] (\n depth = 0, bundlesByDepth = this[_getBundlesByDepth]()\n ) {\n if (depth === 0) {\n this[_bundleUnpacked] = new Set()\n process.emit('time', 'reify:loadBundles')\n }\n const maxBundleDepth = bundlesByDepth.get('maxBundleDepth')\n if (depth > maxBundleDepth) {\n // if we did something, then prune the tree and update the diffs\n if (maxBundleDepth !== -1) {\n this[_pruneBundledMetadeps](bundlesByDepth)\n this[_diffTrees]()\n }\n process.emit('timeEnd', 'reify:loadBundles')\n return\n }\n\n // skip any that have since been removed from the tree, eg by a\n // shallower bundle overwriting them with a bundled meta-dep.\n const set = (bundlesByDepth.get(depth) || [])\n .filter(node => node.root === this.idealTree &&\n node.target !== node.root &&\n !this[_trashList].has(node.path))\n\n if (!set.length)\n return this[_loadBundlesAndUpdateTrees](depth + 1, bundlesByDepth)\n\n // extract all the nodes with bundles\n return promiseAllRejectLate(set.map(node => {\n this[_bundleUnpacked].add(node)\n return this[_reifyNode](node)\n }))\n // then load their unpacked children and move into the ideal tree\n .then(nodes =>\n promiseAllRejectLate(nodes.map(node => new this.constructor({\n ...this.options,\n path: node.path,\n }).loadActual({\n root: node,\n // don't transplant any sparse folders we created\n transplantFilter: node => node.package._id,\n }))))\n // move onto the next level of bundled items\n .then(() => this[_loadBundlesAndUpdateTrees](depth + 1, bundlesByDepth))\n }\n\n [_getBundlesByDepth] () {\n const bundlesByDepth = new Map()\n let maxBundleDepth = -1\n dfwalk({\n tree: this.diff,\n visit: diff => {\n const node = diff.ideal\n if (!node)\n return\n if (node.isProjectRoot || (node.target && node.target.isProjectRoot))\n return\n\n const { bundleDependencies } = node.package\n if (bundleDependencies && bundleDependencies.length) {\n maxBundleDepth = Math.max(maxBundleDepth, node.depth)\n if (!bundlesByDepth.has(node.depth))\n bundlesByDepth.set(node.depth, [node])\n else\n bundlesByDepth.get(node.depth).push(node)\n }\n },\n getChildren: diff => diff.children,\n })\n\n bundlesByDepth.set('maxBundleDepth', maxBundleDepth)\n return bundlesByDepth\n }\n\n // https://github.com/npm/cli/issues/1597#issuecomment-667639545\n [_pruneBundledMetadeps] (bundlesByDepth) {\n const bundleShadowed = new Set()\n // create the list of nodes shadowed by children of bundlers\n for (const bundles of bundlesByDepth.values()) {\n // skip the 'maxBundleDepth' item\n if (!Array.isArray(bundles))\n continue\n for (const node of bundles) {\n for (const name of node.children.keys()) {\n const shadow = node.parent.resolve(name)\n if (!shadow)\n continue\n bundleShadowed.add(shadow)\n shadow.extraneous = true\n }\n }\n }\n let changed = true\n while (changed) {\n changed = false\n for (const shadow of bundleShadowed) {\n if (!shadow.extraneous) {\n bundleShadowed.delete(shadow)\n continue\n }\n\n for (const edge of shadow.edgesIn) {\n if (!edge.from.extraneous) {\n shadow.extraneous = false\n bundleShadowed.delete(shadow)\n changed = true\n } else {\n for (const shadDep of shadow.edgesOut.values()) {\n /* istanbul ignore else - pretty unusual situation, just being\n * defensive here. Would mean that a bundled dep has a dependency\n * that is unmet. which, weird, but if you bundle it, we take\n * whatever you put there and assume the publisher knows best. */\n if (shadDep.to)\n bundleShadowed.add(shadDep.to)\n }\n }\n }\n }\n }\n for (const shadow of bundleShadowed) {\n shadow.parent = null\n this[_addNodeToTrashList](shadow)\n }\n }\n\n [_submitQuickAudit] () {\n if (this.options.audit === false)\n return this.auditReport = null\n\n // we submit the quick audit at this point in the process, as soon as\n // we have all the deps resolved, so that it can overlap with the other\n // actions as much as possible. Stash the promise, which we resolve\n // before finishing the reify() and returning the tree. Thus, we do\n // NOT return the promise, as the intent is for this to run in parallel\n // with the reification, and be resolved at a later time.\n process.emit('time', 'reify:audit')\n const options = { ...this.options }\n const tree = this.idealTree\n\n // if we're operating on a workspace, only audit the workspace deps\n if (this[_workspaces] && this[_workspaces].length)\n options.filterSet = this.workspaceDependencySet(tree, this[_workspaces])\n\n this.auditReport = AuditReport.load(tree, options)\n .then(res => {\n process.emit('timeEnd', 'reify:audit')\n this.auditReport = res\n })\n }\n\n // return the promise if we're waiting for it, or the replaced result\n [_awaitQuickAudit] () {\n return this.auditReport\n }\n\n // ok! actually unpack stuff into their target locations!\n // The sparse tree has already been created, so we walk the diff\n // kicking off each unpack job. If any fail, we rimraf the sparse\n // tree entirely and try to put everything back where it was.\n [_unpackNewModules] () {\n process.emit('time', 'reify:unpack')\n const unpacks = []\n dfwalk({\n tree: this.diff,\n visit: diff => {\n // no unpacking if we don't want to change this thing\n if (diff.action !== 'CHANGE' && diff.action !== 'ADD')\n return\n\n const node = diff.ideal\n const bd = this[_bundleUnpacked].has(node)\n const sw = this[_shrinkwrapInflated].has(node)\n\n // check whether we still need to unpack this one.\n // test the inDepBundle last, since that's potentially a tree walk.\n const doUnpack = node && // can't unpack if removed!\n !node.isRoot && // root node already exists\n !bd && // already unpacked to read bundle\n !sw && // already unpacked to read sw\n !node.inDepBundle // already unpacked by another dep's bundle\n\n if (doUnpack)\n unpacks.push(this[_reifyNode](node))\n },\n getChildren: diff => diff.children,\n })\n return promiseAllRejectLate(unpacks)\n .then(() => process.emit('timeEnd', 'reify:unpack'))\n }\n\n // This is the part where we move back the unchanging nodes that were\n // the children of a node that did change. If this fails, the rollback\n // is a three-step process. First, we try to move the retired unchanged\n // nodes BACK to their retirement folders, then delete the sparse tree,\n // then move everything out of retirement.\n [_moveBackRetiredUnchanged] () {\n // get a list of all unchanging children of any shallow retired nodes\n // if they are not the ancestor of any node in the diff set, then the\n // directory won't already exist, so just rename it over.\n // This is sort of an inverse diff tree, of all the nodes where\n // the actualTree and idealTree _don't_ differ, starting from the\n // shallowest nodes that we moved aside in the first place.\n process.emit('time', 'reify:unretire')\n const moves = this[_retiredPaths]\n this[_retiredUnchanged] = {}\n return promiseAllRejectLate(this.diff.children.map(diff => {\n const realFolder = (diff.actual || diff.ideal).path\n const retireFolder = moves[realFolder]\n this[_retiredUnchanged][retireFolder] = []\n return promiseAllRejectLate(diff.unchanged.map(node => {\n // no need to roll back links, since we'll just delete them anyway\n if (node.isLink)\n return mkdirp(dirname(node.path)).then(() => this[_reifyNode](node))\n\n // will have been moved/unpacked along with bundler\n if (node.inDepBundle)\n return\n\n this[_retiredUnchanged][retireFolder].push(node)\n\n const rel = relative(realFolder, node.path)\n const fromPath = resolve(retireFolder, rel)\n // if it has bundleDependencies, then make node_modules. otherwise\n // skip it.\n const bd = node.package.bundleDependencies\n const dir = bd && bd.length ? node.path + '/node_modules' : node.path\n return mkdirp(dir).then(() => this[_moveContents](node, fromPath))\n }))\n }))\n .then(() => process.emit('timeEnd', 'reify:unretire'))\n }\n\n // move the contents from the fromPath to the node.path\n [_moveContents] (node, fromPath) {\n return packageContents({\n path: fromPath,\n depth: 1,\n packageJsonCache: new Map([[fromPath + '/package.json', node.package]]),\n }).then(res => promiseAllRejectLate(res.map(path => {\n const rel = relative(fromPath, path)\n const to = resolve(node.path, rel)\n return this[_renamePath](path, to)\n })))\n }\n\n [_rollbackMoveBackRetiredUnchanged] (er) {\n const moves = this[_retiredPaths]\n // flip the mapping around to go back\n const realFolders = new Map(Object.entries(moves).map(([k, v]) => [v, k]))\n const promises = Object.entries(this[_retiredUnchanged])\n .map(([retireFolder, nodes]) => promiseAllRejectLate(nodes.map(node => {\n const realFolder = realFolders.get(retireFolder)\n const rel = relative(realFolder, node.path)\n const fromPath = resolve(retireFolder, rel)\n return this[_moveContents]({ ...node, path: fromPath }, node.path)\n })))\n return promiseAllRejectLate(promises)\n .then(() => this[_rollbackCreateSparseTree](er))\n }\n\n [_build] () {\n process.emit('time', 'reify:build')\n\n // for all the things being installed, run their appropriate scripts\n // run in tip->root order, so as to be more likely to build a node's\n // deps before attempting to build it itself\n const nodes = []\n dfwalk({\n tree: this.diff,\n leave: diff => {\n if (!diff.ideal.isProjectRoot)\n nodes.push(diff.ideal)\n },\n // process adds before changes, ignore removals\n getChildren: diff => diff && diff.children,\n filter: diff => diff.action === 'ADD' || diff.action === 'CHANGE',\n })\n\n return this.rebuild({ nodes, handleOptionalFailure: true })\n .then(() => process.emit('timeEnd', 'reify:build'))\n }\n\n // the tree is pretty much built now, so it's cleanup time.\n // remove the retired folders, and any deleted nodes\n // If this fails, there isn't much we can do but tell the user about it.\n // Thankfully, it's pretty unlikely that it'll fail, since rimraf is a tank.\n [_removeTrash] () {\n process.emit('time', 'reify:trash')\n const promises = []\n const failures = []\n const rm = path => rimraf(path).catch(er => failures.push([path, er]))\n\n for (const path of this[_trashList])\n promises.push(rm(path))\n\n return promiseAllRejectLate(promises).then(() => {\n if (failures.length)\n this.log.warn('cleanup', 'Failed to remove some directories', failures)\n })\n .then(() => process.emit('timeEnd', 'reify:trash'))\n }\n\n // last but not least, we save the ideal tree metadata to the package-lock\n // or shrinkwrap file, and any additions or removals to package.json\n async [_saveIdealTree] (options) {\n // the ideal tree is actualized now, hooray!\n // it still contains all the references to optional nodes that were removed\n // for install failures. Those still end up in the shrinkwrap, so we\n // save it first, then prune out the optional trash, and then return it.\n\n // support save=false option\n if (options.save === false || this[_global] || this[_dryRun])\n return false\n\n process.emit('time', 'reify:save')\n\n const updatedTrees = new Set()\n\n // resolvedAdd is the list of user add requests, but with names added\n // to things like git repos and tarball file/urls. However, if the\n // user requested 'foo@', and we have a foo@file:../foo, then we should\n // end up saving the spec we actually used, not whatever they gave us.\n if (this[_resolvedAdd].length) {\n for (const { name, tree: addTree } of this[_resolvedAdd]) {\n // addTree either the root, or a workspace\n const edge = addTree.edgesOut.get(name)\n const pkg = addTree.package\n const req = npa.resolve(name, edge.spec, addTree.realpath)\n const {rawSpec, subSpec} = req\n\n const spec = subSpec ? subSpec.rawSpec : rawSpec\n const child = edge.to\n\n let newSpec\n if (req.registry) {\n const version = child.version\n const prefixRange = version ? this[_savePrefix] + version : '*'\n // if we installed a range, then we save the range specified\n // if it is not a subset of the ^x.y.z. eg, installing a range\n // of `1.x <1.2.3` will not be saved as `^1.2.0`, because that\n // would allow versions outside the requested range. Tags and\n // specific versions save with the save-prefix.\n const isRange = (subSpec || req).type === 'range'\n\n let range = spec\n if (\n !isRange ||\n spec === '*' ||\n subset(prefixRange, spec, { loose: true })\n )\n range = prefixRange\n\n const pname = child.packageName\n const alias = name !== pname\n newSpec = alias ? `npm:${pname}@${range}` : range\n } else if (req.hosted) {\n // save the git+https url if it has auth, otherwise shortcut\n const h = req.hosted\n const opt = { noCommittish: false }\n if (h.https && h.auth)\n newSpec = `git+${h.https(opt)}`\n else\n newSpec = h.shortcut(opt)\n } else if (req.type === 'directory' || req.type === 'file') {\n // save the relative path in package.json\n // Normally saveSpec is updated with the proper relative\n // path already, but it's possible to specify a full absolute\n // path initially, in which case we can end up with the wrong\n // thing, so just get the ultimate fetchSpec and relativize it.\n const p = req.fetchSpec.replace(/^file:/, '')\n const rel = relpath(addTree.realpath, p)\n newSpec = `file:${rel}`\n } else\n newSpec = req.saveSpec\n\n if (options.saveType) {\n const depType = saveTypeMap.get(options.saveType)\n pkg[depType][name] = newSpec\n // rpj will have moved it here if it was in both\n // if it is empty it will be deleted later\n if (options.saveType === 'prod' && pkg.optionalDependencies)\n delete pkg.optionalDependencies[name]\n } else {\n if (hasSubKey(pkg, 'dependencies', name))\n pkg.dependencies[name] = newSpec\n\n if (hasSubKey(pkg, 'devDependencies', name)) {\n pkg.devDependencies[name] = newSpec\n // don't update peer or optional if we don't have to\n if (hasSubKey(pkg, 'peerDependencies', name) && !intersects(newSpec, pkg.peerDependencies[name]))\n pkg.peerDependencies[name] = newSpec\n\n if (hasSubKey(pkg, 'optionalDependencies', name) && !intersects(newSpec, pkg.optionalDependencies[name]))\n pkg.optionalDependencies[name] = newSpec\n } else {\n if (hasSubKey(pkg, 'peerDependencies', name))\n pkg.peerDependencies[name] = newSpec\n\n if (hasSubKey(pkg, 'optionalDependencies', name))\n pkg.optionalDependencies[name] = newSpec\n }\n }\n\n updatedTrees.add(addTree)\n }\n }\n\n // preserve indentation, if possible\n const {\n [Symbol.for('indent')]: indent,\n } = this.idealTree.package\n const format = indent === undefined ? ' ' : indent\n\n const saveOpt = {\n format: (this[_formatPackageLock] && format) ? format\n : this[_formatPackageLock],\n }\n\n const promises = [this[_saveLockFile](saveOpt)]\n\n // grab any from explicitRequests that had deps removed\n for (const { from: tree } of this.explicitRequests)\n updatedTrees.add(tree)\n\n for (const tree of updatedTrees) {\n // refresh the edges so they have the correct specs\n tree.package = tree.package\n promises.push(updateRootPackageJson(tree))\n }\n\n await Promise.all(promises)\n process.emit('timeEnd', 'reify:save')\n return true\n }\n\n async [_saveLockFile] (saveOpt) {\n if (!this[_usePackageLock])\n return\n\n const { meta } = this.idealTree\n\n return meta.save(saveOpt)\n }\n\n async [_copyIdealToActual] () {\n // clean up any trash that is still in the tree\n for (const path of this[_trashList]) {\n const loc = relpath(this.idealTree.realpath, path)\n const node = this.idealTree.inventory.get(loc)\n if (node && node.root === this.idealTree)\n node.parent = null\n }\n\n // if we filtered to only certain nodes, then anything ELSE needs\n // to be untouched in the resulting actual tree, even if it differs\n // in the idealTree. Copy over anything that was in the actual and\n // was not changed, delete anything in the ideal and not actual.\n // Then we move the entire idealTree over to this.actualTree, and\n // save the hidden lockfile.\n if (this.diff && this.diff.filterSet.size) {\n const reroot = new Set()\n\n const { filterSet } = this.diff\n const seen = new Set()\n for (const [loc, ideal] of this.idealTree.inventory.entries()) {\n seen.add(loc)\n\n // if it's an ideal node from the filter set, then skip it\n // because we already made whatever changes were necessary\n if (filterSet.has(ideal))\n continue\n\n // otherwise, if it's not in the actualTree, then it's not a thing\n // that we actually added. And if it IS in the actualTree, then\n // it's something that we left untouched, so we need to record\n // that.\n const actual = this.actualTree.inventory.get(loc)\n if (!actual)\n ideal.root = null\n else {\n if ([...actual.linksIn].some(link => filterSet.has(link))) {\n seen.add(actual.location)\n continue\n }\n const { realpath, isLink } = actual\n if (isLink && ideal.isLink && ideal.realpath === realpath)\n continue\n else\n reroot.add(actual)\n }\n }\n\n // now find any actual nodes that may not be present in the ideal\n // tree, but were left behind by virtue of not being in the filter\n for (const [loc, actual] of this.actualTree.inventory.entries()) {\n if (seen.has(loc))\n continue\n seen.add(loc)\n\n // we know that this is something that ISN'T in the idealTree,\n // or else we will have addressed it in the previous loop.\n // If it's in the filterSet, that means we intentionally removed\n // it, so nothing to do here.\n if (filterSet.has(actual))\n continue\n\n reroot.add(actual)\n }\n\n // go through the rerooted actual nodes, and move them over.\n for (const actual of reroot)\n actual.root = this.idealTree\n\n // prune out any tops that lack a linkIn, they are no longer relevant.\n for (const top of this.idealTree.tops) {\n if (top.linksIn.size === 0)\n top.root = null\n }\n\n // need to calculate dep flags, since nodes may have been marked\n // as extraneous or otherwise incorrect during transit.\n calcDepFlags(this.idealTree)\n }\n\n // save the ideal's meta as a hidden lockfile after we actualize it\n this.idealTree.meta.filename =\n this.idealTree.realpath + '/node_modules/.package-lock.json'\n this.idealTree.meta.hiddenLockfile = true\n\n this.actualTree = this.idealTree\n this.idealTree = null\n\n if (!this[_global])\n await this.actualTree.meta.save()\n }\n}\n","// an object representing the set of vulnerabilities in a tree\n/* eslint camelcase: \"off\" */\n\nconst npa = require('npm-package-arg')\nconst pickManifest = require('npm-pick-manifest')\n\nconst Vuln = require('./vuln.js')\nconst Calculator = require('@npmcli/metavuln-calculator')\n\nconst _getReport = Symbol('getReport')\nconst _fixAvailable = Symbol('fixAvailable')\nconst _checkTopNode = Symbol('checkTopNode')\nconst _init = Symbol('init')\nconst _omit = Symbol('omit')\nconst procLog = require('proc-log')\n\nconst fetch = require('npm-registry-fetch')\n\nclass AuditReport extends Map {\n static load (tree, opts) {\n return new AuditReport(tree, opts).run()\n }\n\n get auditReportVersion () {\n return 2\n }\n\n toJSON () {\n const obj = {\n auditReportVersion: this.auditReportVersion,\n vulnerabilities: {},\n metadata: {\n vulnerabilities: {\n info: 0,\n low: 0,\n moderate: 0,\n high: 0,\n critical: 0,\n total: this.size,\n },\n dependencies: {\n prod: 0,\n dev: 0,\n optional: 0,\n peer: 0,\n peerOptional: 0,\n total: this.tree.inventory.size - 1,\n },\n },\n }\n\n for (const node of this.tree.inventory.values()) {\n const { dependencies } = obj.metadata\n let prod = true\n for (const type of [\n 'dev',\n 'optional',\n 'peer',\n 'peerOptional',\n ]) {\n if (node[type]) {\n dependencies[type]++\n prod = false\n }\n }\n if (prod)\n dependencies.prod++\n }\n\n // if it doesn't have any topVulns, then it's fixable with audit fix\n // for each topVuln, figure out if it's fixable with audit fix --force,\n // or if we have to just delete the thing, and if the fix --force will\n // require a semver major update.\n const vulnerabilities = []\n for (const [name, vuln] of this.entries()) {\n vulnerabilities.push([name, vuln.toJSON()])\n obj.metadata.vulnerabilities[vuln.severity]++\n }\n\n obj.vulnerabilities = vulnerabilities\n .sort(([a], [b]) => a.localeCompare(b, 'en'))\n .reduce((set, [name, vuln]) => {\n set[name] = vuln\n return set\n }, {})\n\n return obj\n }\n\n constructor (tree, opts = {}) {\n super()\n const { omit } = opts\n this[_omit] = new Set(omit || [])\n this.topVulns = new Map()\n\n this.calculator = new Calculator(opts)\n this.error = null\n this.options = opts\n this.log = opts.log || procLog\n this.tree = tree\n this.filterSet = opts.filterSet\n }\n\n async run () {\n this.report = await this[_getReport]()\n this.log.silly('audit report', this.report)\n if (this.report)\n await this[_init]()\n return this\n }\n\n isVulnerable (node) {\n const vuln = this.get(node.packageName)\n return !!(vuln && vuln.isVulnerable(node))\n }\n\n async [_init] () {\n process.emit('time', 'auditReport:init')\n\n const promises = []\n for (const [name, advisories] of Object.entries(this.report)) {\n for (const advisory of advisories)\n promises.push(this.calculator.calculate(name, advisory))\n }\n\n // now the advisories are calculated with a set of versions\n // and the packument. turn them into our style of vuln objects\n // which also have the affected nodes, and also create entries\n // for all the metavulns that we find from dependents.\n const advisories = new Set(await Promise.all(promises))\n const seen = new Set()\n for (const advisory of advisories) {\n const { name, range } = advisory\n\n // don't flag the exact same name/range more than once\n // adding multiple advisories with the same range is fine, but no\n // need to search for nodes we already would have added.\n const k = `${name}@${range}`\n if (seen.has(k))\n continue\n\n seen.add(k)\n\n const vuln = this.get(name) || new Vuln({ name, advisory })\n if (this.has(name))\n vuln.addAdvisory(advisory)\n super.set(name, vuln)\n\n const p = []\n for (const node of this.tree.inventory.query('packageName', name)) {\n if (!shouldAudit(node, this[_omit], this.filterSet))\n continue\n\n // if not vulnerable by this advisory, keep searching\n if (!advisory.testVersion(node.version))\n continue\n\n // we will have loaded the source already if this is a metavuln\n if (advisory.type === 'metavuln')\n vuln.addVia(this.get(advisory.dependency))\n\n // already marked this one, no need to do it again\n if (vuln.nodes.has(node))\n continue\n\n // haven't marked this one yet. get its dependents.\n vuln.nodes.add(node)\n for (const { from: dep, spec } of node.edgesIn) {\n if (dep.isTop && !vuln.topNodes.has(dep))\n this[_checkTopNode](dep, vuln, spec)\n else {\n // calculate a metavuln, if necessary\n p.push(this.calculator.calculate(dep.packageName, advisory).then(meta => {\n if (meta.testVersion(dep.version, spec))\n advisories.add(meta)\n }))\n }\n }\n }\n await Promise.all(p)\n\n // make sure we actually got something. if not, remove it\n // this can happen if you are loading from a lockfile created by\n // npm v5, since it lists the current version of all deps,\n // rather than the range that is actually depended upon,\n // or if using --omit with the older audit endpoint.\n if (this.get(name).nodes.size === 0) {\n this.delete(name)\n continue\n }\n\n // if the vuln is valid, but THIS advisory doesn't apply to any of\n // the nodes it references, then remove it from the advisory list.\n // happens when using omit with old audit endpoint.\n for (const advisory of vuln.advisories) {\n const relevant = [...vuln.nodes].some(n => advisory.testVersion(n.version))\n if (!relevant)\n vuln.deleteAdvisory(advisory)\n }\n }\n process.emit('timeEnd', 'auditReport:init')\n }\n\n [_checkTopNode] (topNode, vuln, spec) {\n vuln.fixAvailable = this[_fixAvailable](topNode, vuln, spec)\n\n if (vuln.fixAvailable !== true) {\n // now we know the top node is vulnerable, and cannot be\n // upgraded out of the bad place without --force. But, there's\n // no need to add it to the actual vulns list, because nothing\n // depends on root.\n this.topVulns.set(vuln.name, vuln)\n vuln.topNodes.add(topNode)\n }\n }\n\n // check whether the top node is vulnerable.\n // check whether we can get out of the bad place with --force, and if\n // so, whether that update is SemVer Major\n [_fixAvailable] (topNode, vuln, spec) {\n // this will always be set to at least {name, versions:{}}\n const paku = vuln.packument\n\n if (!vuln.testSpec(spec))\n return true\n\n // similarly, even if we HAVE a packument, but we're looking for it\n // somewhere other than the registry, and we got something vulnerable,\n // then we're stuck with it.\n const specObj = npa(spec)\n if (!specObj.registry)\n return false\n\n if (specObj.subSpec)\n spec = specObj.subSpec.rawSpec\n\n // We don't provide fixes for top nodes other than root, but we\n // still check to see if the node is fixable with a different version,\n // and if that is a semver major bump.\n try {\n const {\n _isSemVerMajor: isSemVerMajor,\n version,\n name,\n } = pickManifest(paku, spec, {\n ...this.options,\n before: null,\n avoid: vuln.range,\n avoidStrict: true,\n })\n return {name, version, isSemVerMajor}\n } catch (er) {\n return false\n }\n }\n\n set () {\n throw new Error('do not call AuditReport.set() directly')\n }\n\n // convert a quick-audit into a bulk advisory listing\n static auditToBulk (report) {\n if (!report.advisories) {\n // tack on the report json where the response body would go\n throw Object.assign(new Error('Invalid advisory report'), {\n body: JSON.stringify(report),\n })\n }\n\n const bulk = {}\n const {advisories} = report\n for (const advisory of Object.values(advisories)) {\n const {\n id,\n url,\n title,\n severity = 'high',\n vulnerable_versions = '*',\n module_name: name,\n } = advisory\n bulk[name] = bulk[name] || []\n bulk[name].push({id, url, title, severity, vulnerable_versions})\n }\n\n return bulk\n }\n\n async [_getReport] () {\n // if we're not auditing, just return false\n if (this.options.audit === false || this.tree.inventory.size === 1)\n return null\n\n process.emit('time', 'auditReport:getReport')\n try {\n try {\n // first try the super fast bulk advisory listing\n const body = prepareBulkData(this.tree, this[_omit], this.filterSet)\n this.log.silly('audit', 'bulk request', body)\n\n // no sense asking if we don't have anything to audit,\n // we know it'll be empty\n if (!Object.keys(body).length)\n return null\n\n const res = await fetch('/-/npm/v1/security/advisories/bulk', {\n ...this.options,\n registry: this.options.auditRegistry || this.options.registry,\n method: 'POST',\n gzip: true,\n body,\n })\n\n return await res.json()\n } catch (er) {\n this.log.silly('audit', 'bulk request failed', String(er.body))\n // that failed, try the quick audit endpoint\n const body = prepareData(this.tree, this.options)\n const res = await fetch('/-/npm/v1/security/audits/quick', {\n ...this.options,\n registry: this.options.auditRegistry || this.options.registry,\n method: 'POST',\n gzip: true,\n body,\n })\n return AuditReport.auditToBulk(await res.json())\n }\n } catch (er) {\n this.log.verbose('audit error', er)\n this.log.silly('audit error', String(er.body))\n this.error = er\n return null\n } finally {\n process.emit('timeEnd', 'auditReport:getReport')\n }\n }\n}\n\n// return true if we should audit this one\nconst shouldAudit = (node, omit, filterSet) =>\n !node.version ? false\n : node.isRoot ? false\n : filterSet && filterSet.size !== 0 && !filterSet.has(node) ? false\n : omit.size === 0 ? true\n : !( // otherwise, just ensure we're not omitting this one\n node.dev && omit.has('dev') ||\n node.optional && omit.has('optional') ||\n node.devOptional && omit.has('dev') && omit.has('optional') ||\n node.peer && omit.has('peer')\n )\n\nconst prepareBulkData = (tree, omit, filterSet) => {\n const payload = {}\n for (const name of tree.inventory.query('packageName')) {\n const set = new Set()\n for (const node of tree.inventory.query('packageName', name)) {\n if (!shouldAudit(node, omit, filterSet))\n continue\n\n set.add(node.version)\n }\n if (set.size)\n payload[name] = [...set]\n }\n return payload\n}\n\nconst prepareData = (tree, opts) => {\n const { npmVersion: npm_version } = opts\n const node_version = process.version\n const { platform, arch } = process\n const { NODE_ENV: node_env } = process.env\n const data = tree.meta.commit()\n // the legacy audit endpoint doesn't support any kind of pre-filtering\n // we just have to get the advisories and skip over them in the report\n return {\n name: data.name,\n version: data.version,\n requires: {\n ...(tree.package.devDependencies || {}),\n ...(tree.package.peerDependencies || {}),\n ...(tree.package.optionalDependencies || {}),\n ...(tree.package.dependencies || {}),\n },\n dependencies: data.dependencies,\n metadata: {\n node_version,\n npm_version,\n platform,\n arch,\n node_env,\n },\n }\n}\n\nmodule.exports = AuditReport\n","const { depth } = require('treeverse')\n\nconst calcDepFlags = (tree, resetRoot = true) => {\n if (resetRoot) {\n tree.dev = false\n tree.optional = false\n tree.devOptional = false\n tree.peer = false\n }\n const ret = depth({\n tree,\n visit: node => calcDepFlagsStep(node),\n filter: node => node,\n getChildren: (node, tree) => [...tree.edgesOut.values()].map(edge => edge.to),\n })\n return ret\n}\n\nconst calcDepFlagsStep = (node) => {\n // This rewalk is necessary to handle cases where devDep and optional\n // or normal dependency graphs overlap deep in the dep graph.\n // Since we're only walking through deps that are not already flagged\n // as non-dev/non-optional, it's typically a very shallow traversal\n node.extraneous = false\n resetParents(node, 'extraneous')\n resetParents(node, 'dev')\n resetParents(node, 'peer')\n resetParents(node, 'devOptional')\n resetParents(node, 'optional')\n\n // for links, map their hierarchy appropriately\n if (node.target) {\n node.target.dev = node.dev\n node.target.optional = node.optional\n node.target.devOptional = node.devOptional\n node.target.peer = node.peer\n return calcDepFlagsStep(node.target)\n }\n\n node.edgesOut.forEach(({peer, optional, dev, to}) => {\n // if the dep is missing, then its flags are already maximally unset\n if (!to)\n return\n\n // everything with any kind of edge into it is not extraneous\n to.extraneous = false\n\n // devOptional is the *overlap* of the dev and optional tree.\n // however, for convenience and to save an extra rewalk, we leave\n // it set when we are in *either* tree, and then omit it from the\n // package-lock if either dev or optional are set.\n const unsetDevOpt = !node.devOptional && !node.dev && !node.optional &&\n !dev && !optional\n\n // if we are not in the devOpt tree, then we're also not in\n // either the dev or opt trees\n const unsetDev = unsetDevOpt || !node.dev && !dev\n const unsetOpt = unsetDevOpt ||\n !node.optional && !optional\n const unsetPeer = !node.peer && !peer\n\n if (unsetPeer)\n unsetFlag(to, 'peer')\n\n if (unsetDevOpt)\n unsetFlag(to, 'devOptional')\n\n if (unsetDev)\n unsetFlag(to, 'dev')\n\n if (unsetOpt)\n unsetFlag(to, 'optional')\n })\n\n return node\n}\n\nconst resetParents = (node, flag) => {\n if (node[flag])\n return\n\n for (let p = node; p && (p === node || p[flag]); p = p.resolveParent)\n p[flag] = false\n}\n\n// typically a short walk, since it only traverses deps that\n// have the flag set.\nconst unsetFlag = (node, flag) => {\n if (node[flag]) {\n node[flag] = false\n depth({\n tree: node,\n visit: node => {\n node.extraneous = node[flag] = false\n if (node.target)\n node.target.extraneous = node.target[flag] = false\n },\n getChildren: node => [...(node.target || node).edgesOut.values()]\n .filter(edge => edge.to && edge.to[flag] &&\n (flag !== 'peer' && edge.type === 'peer' || edge.type === 'prod'))\n .map(edge => edge.to),\n })\n }\n}\n\nmodule.exports = calcDepFlags\n","// take a path and a resolved value, and turn it into a resolution from\n// the given new path. This is used with converting a package.json's\n// relative file: path into one suitable for a lockfile, or between\n// lockfiles, and for converting hosted git repos to a consistent url type.\nconst npa = require('npm-package-arg')\nconst relpath = require('./relpath.js')\nconst consistentResolve = (resolved, fromPath, toPath, relPaths = false) => {\n if (!resolved)\n return null\n\n try {\n const hostedOpt = { noCommittish: false }\n const {\n fetchSpec,\n saveSpec,\n type,\n hosted,\n rawSpec,\n raw,\n } = npa(resolved, fromPath)\n const isPath = type === 'file' || type === 'directory'\n return isPath && !relPaths ? `file:${fetchSpec}`\n : isPath ? 'file:' + (toPath ? relpath(toPath, fetchSpec) : fetchSpec)\n : hosted ? `git+${\n hosted.auth ? hosted.https(hostedOpt) : hosted.sshurl(hostedOpt)\n }`\n : type === 'git' ? saveSpec\n // always return something. 'foo' is interpreted as 'foo@' otherwise.\n : rawSpec === '' && raw.slice(-1) !== '@' ? raw\n // just strip off the name, but otherwise return as-is\n : rawSpec\n } catch (_) {\n // whatever we passed in was not acceptable to npa.\n // leave it 100% untouched.\n return resolved\n }\n}\nmodule.exports = consistentResolve\n","// certain assertions we should do only when testing arborist itself, because\n// they are too expensive or aggressive and would break user programs if we\n// miss a situation where they are actually valid.\n//\n// call like this:\n//\n// /* istanbul ignore next - debug check */\n// debug(() => {\n// if (someExpensiveCheck)\n// throw new Error('expensive check should have returned false')\n// })\n\n// run in debug mode if explicitly requested, running arborist tests,\n// or working in the arborist project directory.\n\nconst debug = process.env.ARBORIST_DEBUG !== '0' && (\n process.env.ARBORIST_DEBUG === '1' ||\n /\\barborist\\b/.test(process.env.NODE_DEBUG || '') ||\n process.env.npm_package_name === '@npmcli/arborist' &&\n ['test', 'snap'].includes(process.env.npm_lifecycle_event) ||\n process.cwd() === require('path').resolve(__dirname, '..')\n)\n\nmodule.exports = debug ? fn => fn() : () => {}\nconst red = process.stderr.isTTY ? msg => `\\x1B[31m${msg}\\x1B[39m` : m => m\nmodule.exports.log = (...msg) => module.exports(() => {\n const { format } = require('util')\n const prefix = `\\n${process.pid} ${red(format(msg.shift()))} `\n msg = (prefix + format(...msg).trim().split('\\n').join(prefix)).trim()\n console.error(msg)\n})\n","// Do not rely on package._fields, so that we don't throw\n// false failures if a tree is generated by other clients.\n// Only relies on child.resolved, which MAY come from\n// client-specific package.json meta _fields, but most of\n// the time will be pulled out of a lockfile\n\nconst semver = require('semver')\nconst npa = require('npm-package-arg')\nconst {relative} = require('path')\nconst fromPath = require('./from-path.js')\n\nconst depValid = (child, requested, requestor) => {\n // NB: we don't do much to verify 'tag' type requests.\n // Just verify that we got a remote resolution. Presumably, it\n // came from a registry and was tagged at some point.\n\n if (typeof requested === 'string') {\n try {\n // tarball/dir must have resolved to the same tgz on disk, but for\n // file: deps that depend on other files/dirs, we must resolve the\n // location based on the *requestor* file/dir, not where it ends up.\n // '' is equivalent to '*'\n requested = npa.resolve(child.name, requested || '*', fromPath(requestor))\n } catch (er) {\n // Not invalid because the child doesn't match, but because\n // the spec itself is not supported. Nothing would match,\n // so the edge is definitely not valid and never can be.\n er.dependency = child.name\n er.requested = requested\n requestor.errors.push(er)\n return false\n }\n }\n\n // if the lockfile is super old, or hand-modified,\n // then it's possible to hit this state.\n if (!requested) {\n const er = new Error('Invalid dependency specifier')\n er.dependency = child.name\n er.requested = requested\n requestor.errors.push(er)\n return false\n }\n\n switch (requested.type) {\n case 'range':\n if (requested.fetchSpec === '*')\n return true\n // fallthrough\n case 'version':\n // if it's a version or a range other than '*', semver it\n return semver.satisfies(child.version, requested.fetchSpec, true)\n\n case 'directory':\n // directory must be a link to the specified folder\n return !!child.isLink &&\n relative(child.realpath, requested.fetchSpec) === ''\n\n case 'file':\n return tarballValid(child, requested, requestor)\n\n case 'alias':\n // check that the alias target is valid\n return depValid(child, requested.subSpec, requestor)\n\n case 'tag':\n // if it's a tag, we just verify that it has a tarball resolution\n // presumably, it came from the registry and was tagged at some point\n return child.resolved && npa(child.resolved).type === 'remote'\n\n case 'remote':\n // verify that we got it from the desired location\n return child.resolved === requested.fetchSpec\n\n case 'git': {\n // if it's a git type, verify that they're the same repo\n //\n // if it specifies a definite commit, then it must have the\n // same commit to be considered the same repo\n //\n // if it has a #semver: specifier, verify that the\n // version in the package is in the semver range\n const resRepo = npa(child.resolved || '')\n const resHost = resRepo.hosted\n const reqHost = requested.hosted\n const reqCommit = /^[a-fA-F0-9]{40}$/.test(requested.gitCommittish || '')\n const nc = { noCommittish: !reqCommit }\n const sameRepo =\n resHost ? reqHost && reqHost.ssh(nc) === resHost.ssh(nc)\n : resRepo.fetchSpec === requested.fetchSpec\n\n return !sameRepo ? false\n : !requested.gitRange ? true\n : semver.satisfies(child.package.version, requested.gitRange, {\n loose: true,\n })\n }\n\n default: // unpossible, just being cautious\n break\n }\n\n const er = new Error('Unsupported dependency type')\n er.dependency = child.name\n er.requested = requested\n requestor.errors.push(er)\n return false\n}\n\nconst tarballValid = (child, requested, requestor) => {\n if (child.isLink)\n return false\n\n if (child.resolved)\n return child.resolved.replace(/\\\\/g, '/') === `file:${requested.fetchSpec.replace(/\\\\/g, '/')}`\n\n // if we have a legacy mutated package.json file. we can't be 100%\n // sure that it resolved to the same file, but if it was the same\n // request, that's a pretty good indicator of sameness.\n if (child.package._requested)\n return child.package._requested.saveSpec === requested.saveSpec\n\n // ok, we're probably dealing with some legacy cruft here, not much\n // we can do at this point unfortunately.\n return false\n}\n\nmodule.exports = (child, requested, accept, requestor) =>\n depValid(child, requested, requestor) ||\n (typeof accept === 'string' ? depValid(child, accept, requestor) : false)\n","// a tree representing the difference between two trees\n// A Diff node's parent is not necessarily the parent of\n// the node location it refers to, but rather the highest level\n// node that needs to be either changed or removed.\n// Thus, the root Diff node is the shallowest change required\n// for a given branch of the tree being mutated.\n\nconst {depth} = require('treeverse')\nconst {existsSync} = require('fs')\n\nconst ssri = require('ssri')\n\nclass Diff {\n constructor ({actual, ideal, filterSet, shrinkwrapInflated}) {\n this.filterSet = filterSet\n this.shrinkwrapInflated = shrinkwrapInflated\n this.children = []\n this.actual = actual\n this.ideal = ideal\n if (this.ideal) {\n this.resolved = this.ideal.resolved\n this.integrity = this.ideal.integrity\n }\n this.action = getAction(this)\n this.parent = null\n // the set of leaf nodes that we rake up to the top level\n this.leaves = []\n // the set of nodes that don't change in this branch of the tree\n this.unchanged = []\n // the set of nodes that will be removed in this branch of the tree\n this.removed = []\n }\n\n static calculate ({actual, ideal, filterNodes = [], shrinkwrapInflated = new Set()}) {\n // if there's a filterNode, then:\n // - get the path from the root to the filterNode. The root or\n // root.target should have an edge either to the filterNode or\n // a link to the filterNode. If not, abort. Add the path to the\n // filterSet.\n // - Add set of Nodes depended on by the filterNode to filterSet.\n // - Anything outside of that set should be ignored by getChildren\n const filterSet = new Set()\n const extraneous = new Set()\n for (const filterNode of filterNodes) {\n const { root } = filterNode\n if (root !== ideal && root !== actual)\n throw new Error('invalid filterNode: outside idealTree/actualTree')\n const { target } = root\n const rootTarget = target || root\n const edge = [...rootTarget.edgesOut.values()].filter(e => {\n return e.to && (e.to === filterNode || e.to.target === filterNode)\n })[0]\n filterSet.add(root)\n filterSet.add(rootTarget)\n filterSet.add(ideal)\n filterSet.add(actual)\n if (edge && edge.to) {\n filterSet.add(edge.to)\n if (edge.to.target)\n filterSet.add(edge.to.target)\n }\n filterSet.add(filterNode)\n\n depth({\n tree: filterNode,\n visit: node => filterSet.add(node),\n getChildren: node => {\n node = node.target || node\n const loc = node.location\n const idealNode = ideal.inventory.get(loc)\n const ideals = !idealNode ? []\n : [...idealNode.edgesOut.values()].filter(e => e.to).map(e => e.to)\n const actualNode = actual.inventory.get(loc)\n const actuals = !actualNode ? []\n : [...actualNode.edgesOut.values()].filter(e => e.to).map(e => e.to)\n if (actualNode) {\n for (const child of actualNode.children.values()) {\n if (child.extraneous)\n extraneous.add(child)\n }\n }\n\n return ideals.concat(actuals)\n },\n })\n }\n for (const extra of extraneous)\n filterSet.add(extra)\n\n return depth({\n tree: new Diff({actual, ideal, filterSet, shrinkwrapInflated}),\n getChildren,\n leave,\n })\n }\n}\n\nconst getAction = ({actual, ideal}) => {\n if (!ideal)\n return 'REMOVE'\n\n // bundled meta-deps are copied over to the ideal tree when we visit it,\n // so they'll appear to be missing here. There's no need to handle them\n // in the diff, though, because they'll be replaced at reify time anyway\n // Otherwise, add the missing node.\n if (!actual)\n return ideal.inDepBundle ? null : 'ADD'\n\n // always ignore the root node\n if (ideal.isRoot && actual.isRoot)\n return null\n\n // if the versions don't match, it's a change no matter what\n if (ideal.version !== actual.version)\n return 'CHANGE'\n\n const binsExist = ideal.binPaths.every((path) => existsSync(path))\n\n // top nodes, links, and git deps won't have integrity, but do have resolved\n // if neither node has integrity, the bins exist, and either (a) neither\n // node has a resolved value or (b) they both do and match, then we can\n // leave this one alone since we already know the versions match due to\n // the condition above. The \"neither has resolved\" case (a) cannot be\n // treated as a 'mark CHANGE and refetch', because shrinkwraps, bundles,\n // and link deps may lack this information, and we don't want to try to\n // go to the registry for something that isn't there.\n const noIntegrity = !ideal.integrity && !actual.integrity\n const noResolved = !ideal.resolved && !actual.resolved\n const resolvedMatch = ideal.resolved && ideal.resolved === actual.resolved\n if (noIntegrity && binsExist && (resolvedMatch || noResolved))\n return null\n\n // otherwise, verify that it's the same bits\n // note that if ideal has integrity, and resolved doesn't, we treat\n // that as a 'change', so that it gets re-fetched and locked down.\n const integrityMismatch = !ideal.integrity || !actual.integrity ||\n !ssri.parse(ideal.integrity).match(actual.integrity)\n if (integrityMismatch || !binsExist)\n return 'CHANGE'\n\n return null\n}\n\nconst allChildren = node => {\n if (!node)\n return new Map()\n\n // if the node is a global root, and also a link, then what we really\n // want is to traverse the target's children\n if (node.global && node.isRoot && node.isLink)\n return allChildren(node.target)\n\n const kids = new Map()\n for (const n of [node, ...node.fsChildren]) {\n for (const kid of n.children.values())\n kids.set(kid.path, kid)\n }\n return kids\n}\n\n// functions for the walk options when we traverse the trees\n// to create the diff tree\nconst getChildren = diff => {\n const children = []\n const {actual, ideal, unchanged, removed, filterSet, shrinkwrapInflated} = diff\n\n // Note: we DON'T diff fsChildren themselves, because they are either\n // included in the package contents, or part of some other project, and\n // will never appear in legacy shrinkwraps anyway. but we _do_ include the\n // child nodes of fsChildren, because those are nodes that we are typically\n // responsible for installing.\n const actualKids = allChildren(actual)\n const idealKids = allChildren(ideal)\n\n if (ideal && ideal.hasShrinkwrap && !shrinkwrapInflated.has(ideal)) {\n // Guaranteed to get a diff.leaves here, because we always\n // be called with a proper Diff object when ideal has a shrinkwrap\n // that has not been inflated.\n diff.leaves.push(diff)\n return children\n }\n\n const paths = new Set([...actualKids.keys(), ...idealKids.keys()])\n for (const path of paths) {\n const actual = actualKids.get(path)\n const ideal = idealKids.get(path)\n diffNode(actual, ideal, children, unchanged, removed, filterSet, shrinkwrapInflated)\n }\n\n if (diff.leaves && !children.length)\n diff.leaves.push(diff)\n\n return children\n}\n\nconst diffNode = (actual, ideal, children, unchanged, removed, filterSet, shrinkwrapInflated) => {\n if (filterSet.size && !(filterSet.has(ideal) || filterSet.has(actual)))\n return\n\n const action = getAction({actual, ideal})\n\n // if it's a match, then get its children\n // otherwise, this is the child diff node\n if (action || (!shrinkwrapInflated.has(ideal) && ideal.hasShrinkwrap)) {\n if (action === 'REMOVE')\n removed.push(actual)\n children.push(new Diff({actual, ideal, filterSet, shrinkwrapInflated}))\n } else {\n unchanged.push(ideal)\n // !*! Weird dirty hack warning !*!\n //\n // Bundled deps aren't loaded in the ideal tree, because we don't know\n // what they are going to be without unpacking. Swap them over now if\n // the bundling node isn't changing, so we don't prune them later.\n //\n // It's a little bit dirty to be doing this here, since it means that\n // diffing trees can mutate them, but otherwise we have to walk over\n // all unchanging bundlers and correct the diff later, so it's more\n // efficient to just fix it while we're passing through already.\n //\n // Note that moving over a bundled dep will break the links to other\n // deps under this parent, which may have been transitively bundled.\n // Breaking those links means that we'll no longer see the transitive\n // dependency, meaning that it won't appear as bundled any longer!\n // In order to not end up dropping transitively bundled deps, we have\n // to get the list of nodes to move, then move them all at once, rather\n // than moving them one at a time in the first loop.\n const bd = ideal.package.bundleDependencies\n if (actual && bd && bd.length) {\n const bundledChildren = []\n for (const node of actual.children.values()) {\n if (node.inBundle)\n bundledChildren.push(node)\n }\n for (const node of bundledChildren)\n node.parent = ideal\n }\n children.push(...getChildren({actual, ideal, unchanged, removed, filterSet, shrinkwrapInflated}))\n }\n}\n\n// set the parentage in the leave step so that we aren't attaching\n// child nodes only to remove them later. also bubble up the unchanged\n// nodes so that we can move them out of staging in the reification step.\nconst leave = (diff, children) => {\n children.forEach(kid => {\n kid.parent = diff\n diff.leaves.push(...kid.leaves)\n diff.unchanged.push(...kid.unchanged)\n diff.removed.push(...kid.removed)\n })\n diff.children = children\n return diff\n}\n\nmodule.exports = Diff\n","// An edge in the dependency graph\n// Represents a dependency relationship of some kind\n\nconst util = require('util')\nconst npa = require('npm-package-arg')\nconst depValid = require('./dep-valid.js')\nconst _from = Symbol('_from')\nconst _to = Symbol('_to')\nconst _type = Symbol('_type')\nconst _spec = Symbol('_spec')\nconst _accept = Symbol('_accept')\nconst _name = Symbol('_name')\nconst _error = Symbol('_error')\nconst _loadError = Symbol('_loadError')\nconst _setFrom = Symbol('_setFrom')\nconst _explain = Symbol('_explain')\nconst _explanation = Symbol('_explanation')\n\nconst types = new Set([\n 'prod',\n 'dev',\n 'optional',\n 'peer',\n 'peerOptional',\n 'workspace',\n])\n\nclass ArboristEdge {}\nconst printableEdge = (edge) => {\n const edgeFrom = edge.from && edge.from.location\n const edgeTo = edge.to && edge.to.location\n\n return Object.assign(new ArboristEdge(), {\n name: edge.name,\n spec: edge.spec,\n type: edge.type,\n ...(edgeFrom != null ? { from: edgeFrom } : {}),\n ...(edgeTo ? { to: edgeTo } : {}),\n ...(edge.error ? { error: edge.error } : {}),\n })\n}\n\nclass Edge {\n constructor (options) {\n const { type, name, spec, accept, from } = options\n\n if (typeof spec !== 'string')\n throw new TypeError('must provide string spec')\n\n if (type === 'workspace' && npa(spec).type !== 'directory')\n throw new TypeError('workspace edges must be a symlink')\n\n this[_spec] = spec\n\n if (accept !== undefined) {\n if (typeof accept !== 'string')\n throw new TypeError('accept field must be a string if provided')\n this[_accept] = accept || '*'\n }\n\n if (typeof name !== 'string')\n throw new TypeError('must provide dependency name')\n this[_name] = name\n\n if (!types.has(type)) {\n throw new TypeError(\n `invalid type: ${type}\\n` +\n `(valid types are: ${Edge.types.join(', ')})`)\n }\n this[_type] = type\n if (!from)\n throw new TypeError('must provide \"from\" node')\n this[_setFrom](from)\n this[_error] = this[_loadError]()\n }\n\n satisfiedBy (node) {\n return depValid(node, this.spec, this.accept, this.from)\n }\n\n explain (seen = []) {\n if (this[_explanation])\n return this[_explanation]\n\n return this[_explanation] = this[_explain](seen)\n }\n\n // return the edge data, and an explanation of how that edge came to be here\n [_explain] (seen) {\n const { error, from, bundled } = this\n return {\n type: this.type,\n name: this.name,\n spec: this.spec,\n ...(bundled ? { bundled } : {}),\n ...(error ? { error } : {}),\n ...(from ? { from: from.explain(null, seen) } : {}),\n }\n }\n\n get bundled () {\n if (!this.from)\n return false\n const { package: { bundleDependencies = [] } } = this.from\n return bundleDependencies.includes(this.name)\n }\n\n get workspace () {\n return this[_type] === 'workspace'\n }\n\n get prod () {\n return this[_type] === 'prod'\n }\n\n get dev () {\n return this[_type] === 'dev'\n }\n\n get optional () {\n return this[_type] === 'optional' || this[_type] === 'peerOptional'\n }\n\n get peer () {\n return this[_type] === 'peer' || this[_type] === 'peerOptional'\n }\n\n get type () {\n return this[_type]\n }\n\n get name () {\n return this[_name]\n }\n\n get spec () {\n return this[_spec]\n }\n\n get accept () {\n return this[_accept]\n }\n\n get valid () {\n return !this.error\n }\n\n get missing () {\n return this.error === 'MISSING'\n }\n\n get invalid () {\n return this.error === 'INVALID'\n }\n\n get peerLocal () {\n return this.error === 'PEER LOCAL'\n }\n\n get error () {\n this[_error] = this[_error] || this[_loadError]()\n return this[_error] === 'OK' ? null : this[_error]\n }\n\n [_loadError] () {\n return !this[_to] ? (this.optional ? null : 'MISSING')\n : this.peer && this.from === this.to.parent && !this.from.isTop ? 'PEER LOCAL'\n : !depValid(this.to, this.spec, this.accept, this.from) ? 'INVALID'\n : 'OK'\n }\n\n reload (hard = false) {\n this[_explanation] = null\n const newTo = this[_from].resolve(this.name)\n if (newTo !== this[_to]) {\n if (this[_to])\n this[_to].edgesIn.delete(this)\n this[_to] = newTo\n this[_error] = this[_loadError]()\n if (this[_to])\n this[_to].addEdgeIn(this)\n } else if (hard)\n this[_error] = this[_loadError]()\n }\n\n detach () {\n this[_explanation] = null\n if (this[_to])\n this[_to].edgesIn.delete(this)\n this[_from].edgesOut.delete(this.name)\n this[_to] = null\n this[_error] = 'DETACHED'\n this[_from] = null\n }\n\n [_setFrom] (node) {\n this[_explanation] = null\n this[_from] = node\n if (node.edgesOut.has(this.name))\n node.edgesOut.get(this.name).detach()\n node.addEdgeOut(this)\n this.reload()\n }\n\n get from () {\n return this[_from]\n }\n\n get to () {\n return this[_to]\n }\n\n toJSON () {\n return printableEdge(this)\n }\n\n [util.inspect.custom] () {\n return this.toJSON()\n }\n}\n\nEdge.types = [...types]\nEdge.errors = [\n 'DETACHED',\n 'MISSING',\n 'PEER LOCAL',\n 'INVALID',\n]\n\nmodule.exports = Edge\n","// file dependencies need their dependencies resolved based on the\n// location where the tarball was found, not the location where they\n// end up getting installed. directory (ie, symlink) deps also need\n// to be resolved based on their targets, but that's what realpath is\n\nconst {dirname} = require('path')\nconst npa = require('npm-package-arg')\n\nconst fromPath = (node, spec) =>\n spec && spec.type === 'file' ? dirname(spec.fetchSpec)\n : node.realpath\n\nmodule.exports = node => fromPath(node, node.resolved && npa(node.resolved))\n","// Given a set of nodes in a tree, and a filter function to test\n// incoming edges to the dep set that should be ignored otherwise.\n//\n// find the set of deps that are only depended upon by nodes in the set, or\n// their dependencies, or edges that are ignored.\n//\n// Used when figuring out what to prune when replacing a node with a newer\n// version, or when an optional dep fails to install.\n\nconst gatherDepSet = (set, edgeFilter) => {\n const deps = new Set(set)\n\n // add the full set of dependencies. note that this loop will continue\n // as the deps set increases in size.\n for (const node of deps) {\n for (const edge of node.edgesOut.values()) {\n if (edge.to && edgeFilter(edge))\n deps.add(edge.to)\n }\n }\n\n // now remove all nodes in the set that have a dependant outside the set\n // if any change is made, then re-check\n // continue until no changes made, or deps set evaporates fully.\n let changed = true\n while (changed === true && deps.size > 0) {\n changed = false\n for (const dep of deps) {\n for (const edge of dep.edgesIn) {\n if (!deps.has(edge.from) && edgeFilter(edge)) {\n changed = true\n deps.delete(dep)\n break\n }\n }\n }\n }\n\n return deps\n}\n\nmodule.exports = gatherDepSet\n","// Get the actual nodes corresponding to a root node's child workspaces,\n// given a list of workspace names.\nconst relpath = require('./relpath.js')\nconst getWorkspaceNodes = (tree, workspaces, log) => {\n const wsMap = tree.workspaces\n if (!wsMap) {\n log.warn('workspaces', 'filter set, but no workspaces present')\n return []\n }\n\n const nodes = []\n for (const name of workspaces) {\n const path = wsMap.get(name)\n if (!path) {\n log.warn('workspaces', `${name} in filter set, but not in workspaces`)\n continue\n }\n\n const loc = relpath(tree.realpath, path)\n const node = tree.inventory.get(loc)\n\n if (!node) {\n log.warn('workspaces', `${name} in filter set, but no workspace folder present`)\n continue\n }\n\n nodes.push(node)\n }\n\n return nodes\n}\n\nmodule.exports = getWorkspaceNodes\n","module.exports = require('./arborist/index.js')\nmodule.exports.Arborist = module.exports\nmodule.exports.Node = require('./node.js')\nmodule.exports.Link = require('./link.js')\nmodule.exports.Edge = require('./edge.js')\nmodule.exports.Shrinkwrap = require('./shrinkwrap.js')\n// XXX export the other classes, too. shrinkwrap, diff, etc.\n// they're handy!\n","// a class to manage an inventory and set of indexes of\n// a set of objects based on specific fields.\n// primary is the primary index key.\n// keys is the set of fields to be able to query.\nconst _primaryKey = Symbol('_primaryKey')\nconst _index = Symbol('_index')\nconst defaultKeys = ['name', 'license', 'funding', 'realpath', 'packageName']\nconst { hasOwnProperty } = Object.prototype\nconst debug = require('./debug.js')\n\n// handling for the outdated \"licenses\" array, just pick the first one\n// also support the alternative spelling \"licence\"\nconst getLicense = pkg => {\n if (pkg) {\n const lic = pkg.license || pkg.licence\n if (lic)\n return lic\n const lics = pkg.licenses || pkg.licences\n if (Array.isArray(lics))\n return lics[0]\n }\n}\n\nclass Inventory extends Map {\n constructor (opt = {}) {\n const { primary, keys } = opt\n super()\n this[_primaryKey] = primary || 'location'\n this[_index] = (keys || defaultKeys).reduce((index, i) => {\n index.set(i, new Map())\n return index\n }, new Map())\n }\n\n get primaryKey () {\n return this[_primaryKey]\n }\n\n get indexes () {\n return [...this[_index].keys()]\n }\n\n * filter (fn) {\n for (const node of this.values()) {\n if (fn(node))\n yield node\n }\n }\n\n add (node) {\n const root = super.get('')\n if (root && node.root !== root && node.root !== root.root) {\n debug(() => {\n throw Object.assign(new Error('adding external node to inventory'), {\n root: root.path,\n node: node.path,\n nodeRoot: node.root.path,\n })\n })\n return\n }\n\n const current = super.get(node[this.primaryKey])\n if (current) {\n if (current === node)\n return\n this.delete(current)\n }\n super.set(node[this.primaryKey], node)\n for (const [key, map] of this[_index].entries()) {\n // if the node has the value, but it's false, then use that\n const val_ = hasOwnProperty.call(node, key) ? node[key]\n : key === 'license' ? getLicense(node.package)\n : node[key] ? node[key]\n : node.package && node.package[key]\n const val = typeof val_ === 'string' ? val_\n : !val_ || typeof val_ !== 'object' ? val_\n : key === 'license' ? val_.type\n : key === 'funding' ? val_.url\n : /* istanbul ignore next - not used */ val_\n const set = map.get(val) || new Set()\n set.add(node)\n map.set(val, set)\n }\n }\n\n delete (node) {\n if (!this.has(node))\n return\n\n super.delete(node[this.primaryKey])\n for (const [key, map] of this[_index].entries()) {\n const val = node[key] !== undefined ? node[key]\n : (node[key] || (node.package && node.package[key]))\n const set = map.get(val)\n if (set) {\n set.delete(node)\n if (set.size === 0)\n map.delete(node[key])\n }\n }\n }\n\n query (key, val) {\n const map = this[_index].get(key)\n return map && (arguments.length === 2 ? map.get(val) : map.keys()) ||\n new Set()\n }\n\n has (node) {\n return super.get(node[this.primaryKey]) === node\n }\n\n set (k, v) {\n throw new Error('direct set() not supported, use inventory.add(node)')\n }\n}\n\nmodule.exports = Inventory\n","const debug = require('./debug.js')\nconst relpath = require('./relpath.js')\nconst Node = require('./node.js')\nconst _loadDeps = Symbol.for('Arborist.Node._loadDeps')\nconst _target = Symbol.for('_target')\nconst {dirname} = require('path')\n// defined by Node class\nconst _delistFromMeta = Symbol.for('_delistFromMeta')\nconst _refreshLocation = Symbol.for('_refreshLocation')\nclass Link extends Node {\n constructor (options) {\n const { root, realpath, target, parent, fsParent } = options\n\n if (!realpath && !(target && target.path))\n throw new TypeError('must provide realpath for Link node')\n\n super({\n ...options,\n realpath: realpath || target.path,\n root: root || (parent ? parent.root\n : fsParent ? fsParent.root\n : target ? target.root\n : null),\n })\n\n if (target)\n this.target = target\n else if (this.realpath === this.root.path)\n this.target = this.root\n else {\n this.target = new Node({\n ...options,\n path: realpath,\n parent: null,\n fsParent: null,\n root: this.root,\n })\n }\n }\n\n get version () {\n return this.target ? this.target.version : this.package.version || ''\n }\n\n get target () {\n return this[_target]\n }\n\n set target (target) {\n const current = this[_target]\n if (target === current)\n return\n\n if (current && current.then) {\n debug(() => {\n throw Object.assign(new Error('cannot set target while awaiting'), {\n path: this.path,\n realpath: this.realpath,\n })\n })\n }\n\n if (target && target.then) {\n // can set to a promise during an async tree build operation\n // wait until then to assign it.\n this[_target] = target\n target.then(node => {\n this[_target] = null\n this.target = node\n })\n return\n }\n\n if (!target) {\n if (current && current.linksIn)\n current.linksIn.delete(this)\n if (this.path) {\n this[_delistFromMeta]()\n this[_target] = null\n this.package = {}\n this[_refreshLocation]()\n } else\n this[_target] = null\n return\n }\n\n if (!this.path) {\n // temp node pending assignment to a tree\n // we know it's not in the inventory yet, because no path.\n if (target.path)\n this.realpath = target.path\n else\n target.path = target.realpath = this.realpath\n target.root = this.root\n this[_target] = target\n target.linksIn.add(this)\n this.package = target.package\n return\n }\n\n // have to refresh metadata, because either realpath or package\n // is very likely changing.\n this[_delistFromMeta]()\n this.package = target.package\n this.realpath = target.path\n this[_refreshLocation]()\n\n target.root = this.root\n }\n\n // a link always resolves to the relative path to its target\n get resolved () {\n // the path/realpath guard is there for the benefit of setting\n // these things in the \"wrong\" order\n return this.path && this.realpath\n ? `file:${relpath(dirname(this.path), this.realpath)}`\n : null\n }\n\n set resolved (r) {}\n\n // deps are resolved on the target, not the Link\n // so this is a no-op\n [_loadDeps] () {}\n\n // links can't have children, only their targets can\n // fix it to an empty list so that we can still call\n // things that iterate over them, just as a no-op\n get children () {\n return new Map()\n }\n\n set children (c) {}\n\n get isLink () {\n return true\n }\n}\n\nmodule.exports = Link\n","// inventory, path, realpath, root, and parent\n//\n// node.root is a reference to the root module in the tree (ie, typically the\n// cwd project folder)\n//\n// node.location is the /-delimited path from the root module to the node. In\n// the case of link targets that may be outside of the root's package tree,\n// this can include some number of /../ path segments. The location of the\n// root module is always '.'. node.location thus never contains drive letters\n// or absolute paths, and is portable within a given project, suitable for\n// inclusion in lockfiles and metadata.\n//\n// node.path is the path to the place where this node lives on disk. It is\n// system-specific and absolute.\n//\n// node.realpath is the path to where the module actually resides on disk. In\n// the case of non-link nodes, node.realpath is equivalent to node.path. In\n// the case of link nodes, it is equivalent to node.target.path.\n//\n// Setting node.parent will set the node's root to the parent's root, as well\n// as updating edgesIn and edgesOut to reload dependency resolutions as needed,\n// and setting node.path to parent.path/node_modules/name.\n//\n// node.inventory is a Map of name to a Set() of all the nodes under a given\n// root by that name. It's empty for non-root nodes, and changing the root\n// reference will remove it from the old root's inventory and add it to the new\n// one. This map is useful for cases like `npm update foo` or `npm ls foo`\n// where we need to quickly find all instances of a given package name within a\n// tree.\n\nconst semver = require('semver')\nconst nameFromFolder = require('@npmcli/name-from-folder')\nconst Edge = require('./edge.js')\nconst Inventory = require('./inventory.js')\nconst {normalize} = require('read-package-json-fast')\nconst {getPaths: getBinPaths} = require('bin-links')\nconst npa = require('npm-package-arg')\nconst debug = require('./debug.js')\nconst gatherDepSet = require('./gather-dep-set.js')\nconst treeCheck = require('./tree-check.js')\nconst walkUp = require('walk-up-path')\n\nconst {resolve, relative, dirname, basename} = require('path')\nconst util = require('util')\nconst _package = Symbol('_package')\nconst _parent = Symbol('_parent')\nconst _target = Symbol.for('_target')\nconst _fsParent = Symbol('_fsParent')\nconst _loadDepType = Symbol('_loadDepType')\nconst _loadWorkspaces = Symbol('_loadWorkspaces')\nconst _reloadNamedEdges = Symbol('_reloadNamedEdges')\n// overridden by Link class\nconst _loadDeps = Symbol.for('Arborist.Node._loadDeps')\nconst _root = Symbol('_root')\nconst _refreshLocation = Symbol.for('_refreshLocation')\nconst _changePath = Symbol.for('_changePath')\n// used by Link class as well\nconst _delistFromMeta = Symbol.for('_delistFromMeta')\nconst _global = Symbol.for('global')\nconst _workspaces = Symbol('_workspaces')\nconst _explain = Symbol('_explain')\nconst _explanation = Symbol('_explanation')\nconst _meta = Symbol('_meta')\n\nconst relpath = require('./relpath.js')\nconst consistentResolve = require('./consistent-resolve.js')\n\nconst printableTree = require('./printable.js')\n\nclass Node {\n constructor (options) {\n // NB: path can be null if it's a link target\n const {\n root,\n path,\n realpath,\n parent,\n error,\n meta,\n fsParent,\n resolved,\n integrity,\n // allow setting name explicitly when we haven't set a path yet\n name,\n children,\n fsChildren,\n legacyPeerDeps = false,\n linksIn,\n hasShrinkwrap,\n extraneous = true,\n dev = true,\n optional = true,\n devOptional = true,\n peer = true,\n global = false,\n dummy = false,\n sourceReference = null,\n } = options\n\n // true if part of a global install\n this[_global] = global\n\n this[_workspaces] = null\n\n this.errors = error ? [error] : []\n\n // this will usually be null, except when modeling a\n // package's dependencies in a virtual root.\n this.sourceReference = sourceReference\n\n const pkg = sourceReference ? sourceReference.package\n : normalize(options.pkg || {})\n\n this.name = name ||\n nameFromFolder(path || pkg.name || realpath) ||\n pkg.name ||\n null\n\n // should be equal if not a link\n this.path = path ? resolve(path) : null\n\n if (!this.name && (!this.path || this.path !== dirname(this.path)))\n throw new TypeError('could not detect node name from path or package')\n\n this.realpath = !this.isLink ? this.path : resolve(realpath)\n\n this.resolved = resolved || null\n if (!this.resolved) {\n // note: this *only* works for non-file: deps, so we avoid even\n // trying here.\n // file: deps are tracked in package.json will _resolved set to the\n // full path to the tarball or link target. However, if the package\n // is checked into git or moved to another location, that's 100% not\n // portable at all! The _where and _location don't provide much help,\n // since _location is just where the module ended up in the tree,\n // and _where can be different than the actual root if it's a\n // meta-dep deeper in the dependency graph.\n //\n // If we don't have the other oldest indicators of legacy npm, then it's\n // probably what we're getting from pacote, which IS trustworthy.\n //\n // Otherwise, hopefully a shrinkwrap will help us out.\n const resolved = consistentResolve(pkg._resolved)\n if (resolved && !(/^file:/.test(resolved) && pkg._where))\n this.resolved = resolved\n }\n this.integrity = integrity || pkg._integrity || null\n this.hasShrinkwrap = hasShrinkwrap || pkg._hasShrinkwrap || false\n this.legacyPeerDeps = legacyPeerDeps\n\n this.children = new Map()\n this.fsChildren = new Set()\n this.inventory = new Inventory({})\n this.tops = new Set()\n this.linksIn = new Set(linksIn || [])\n\n // these three are set by an Arborist taking a catalog\n // after the tree is built. We don't get this along the way,\n // because they have a tendency to change as new children are\n // added, especially when they're deduped. Eg, a dev dep may be\n // a 3-levels-deep dependency of a non-dev dep. If we calc the\n // flags along the way, then they'll tend to be invalid by the\n // time we need to look at them.\n if (!dummy) {\n this.dev = dev\n this.optional = optional\n this.devOptional = devOptional\n this.peer = peer\n this.extraneous = extraneous\n this.dummy = false\n } else {\n // true if this is a placeholder for the purpose of serving as a\n // fsParent to link targets that get their deps resolved outside\n // the root tree folder.\n this.dummy = true\n this.dev = false\n this.optional = false\n this.devOptional = false\n this.peer = false\n this.extraneous = false\n }\n\n this.edgesIn = new Set()\n this.edgesOut = new Map()\n\n // have to set the internal package ref before assigning the parent,\n // because this.package is read when adding to inventory\n this[_package] = pkg && typeof pkg === 'object' ? pkg : {}\n\n // only relevant for the root and top nodes\n this.meta = meta\n\n // Note: this is _slightly_ less efficient for the initial tree\n // building than it could be, but in exchange, it's a much simpler\n // algorithm.\n // If this node has a bunch of children, and those children satisfy\n // its various deps, then we're going to _first_ create all the\n // edges, and _then_ assign the children into place, re-resolving\n // them all in _reloadNamedEdges.\n // A more efficient, but more complicated, approach would be to\n // flag this node as being a part of a tree build, so it could\n // hold off on resolving its deps until its children are in place.\n\n // call the parent setter\n // Must be set prior to calling _loadDeps, because top-ness is relevant\n\n // will also assign root if present on the parent\n this[_parent] = null\n this.parent = parent || null\n\n this[_fsParent] = null\n this.fsParent = fsParent || null\n\n // see parent/root setters below.\n // root is set to parent's root if we have a parent, otherwise if it's\n // null, then it's set to the node itself.\n if (!parent && !fsParent)\n this.root = root || null\n\n // mostly a convenience for testing, but also a way to create\n // trees in a more declarative way than setting parent on each\n if (children) {\n for (const c of children)\n new Node({ ...c, parent: this })\n }\n if (fsChildren) {\n for (const c of fsChildren)\n new Node({ ...c, fsParent: this })\n }\n\n // now load all the dep edges\n this[_loadDeps]()\n }\n\n get meta () {\n return this[_meta]\n }\n\n set meta (meta) {\n this[_meta] = meta\n if (meta)\n meta.add(this)\n }\n\n get global () {\n return this.root[_global]\n }\n\n // true for packages installed directly in the global node_modules folder\n get globalTop () {\n return this.global && this.parent.isProjectRoot\n }\n\n get workspaces () {\n return this[_workspaces]\n }\n\n set workspaces (workspaces) {\n // deletes edges if they already exists\n if (this[_workspaces]) {\n for (const name of this[_workspaces].keys()) {\n if (!workspaces.has(name))\n this.edgesOut.get(name).detach()\n }\n }\n\n this[_workspaces] = workspaces\n this[_loadWorkspaces]()\n this[_loadDeps]()\n }\n\n get binPaths () {\n if (!this.parent)\n return []\n\n return getBinPaths({\n pkg: this[_package],\n path: this.path,\n global: this.global,\n top: this.globalTop,\n })\n }\n\n get hasInstallScript () {\n const {hasInstallScript, scripts} = this.package\n const {install, preinstall, postinstall} = scripts || {}\n return !!(hasInstallScript || install || preinstall || postinstall)\n }\n\n get version () {\n return this[_package].version || ''\n }\n\n get packageName () {\n return this[_package].name || null\n }\n\n get pkgid () {\n const { name = '', version = '' } = this.package\n // root package will prefer package name over folder name,\n // and never be called an alias.\n const { isProjectRoot } = this\n const myname = isProjectRoot ? name || this.name\n : this.name\n const alias = !isProjectRoot && name && myname !== name ? `npm:${name}@`\n : ''\n return `${myname}@${alias}${version}`\n }\n\n get package () {\n return this[_package]\n }\n\n set package (pkg) {\n // just detach them all. we could make this _slightly_ more efficient\n // by only detaching the ones that changed, but we'd still have to walk\n // them all, and the comparison logic gets a bit tricky. we generally\n // only do this more than once at the root level, so the resolve() calls\n // are only one level deep, and there's not much to be saved, anyway.\n // simpler to just toss them all out.\n for (const edge of this.edgesOut.values())\n edge.detach()\n\n this[_explanation] = null\n /* istanbul ignore next - should be impossible */\n if (!pkg || typeof pkg !== 'object') {\n debug(() => {\n throw new Error('setting Node.package to non-object')\n })\n pkg = {}\n }\n this[_package] = pkg\n this[_loadWorkspaces]()\n this[_loadDeps]()\n // do a hard reload, since the dependents may now be valid or invalid\n // as a result of the package change.\n this.edgesIn.forEach(edge => edge.reload(true))\n }\n\n // node.explain(nodes seen already, edge we're trying to satisfy\n // if edge is not specified, it lists every edge into the node.\n explain (edge = null, seen = []) {\n if (this[_explanation])\n return this[_explanation]\n\n return this[_explanation] = this[_explain](edge, seen)\n }\n\n [_explain] (edge, seen) {\n if (this.isProjectRoot && !this.sourceReference) {\n return {\n location: this.path,\n }\n }\n\n const why = {\n name: this.isProjectRoot || this.isTop ? this.packageName : this.name,\n version: this.package.version,\n }\n if (this.errors.length || !this.packageName || !this.package.version) {\n why.errors = this.errors.length ? this.errors : [\n new Error('invalid package: lacks name and/or version'),\n ]\n why.package = this.package\n }\n\n if (this.root.sourceReference) {\n const {name, version} = this.root.package\n why.whileInstalling = {\n name,\n version,\n path: this.root.sourceReference.path,\n }\n }\n\n if (this.sourceReference)\n return this.sourceReference.explain(edge, seen)\n\n if (seen.includes(this))\n return why\n\n why.location = this.location\n why.isWorkspace = this.isWorkspace\n\n // make a new list each time. we can revisit, but not loop.\n seen = seen.concat(this)\n\n why.dependents = []\n if (edge)\n why.dependents.push(edge.explain(seen))\n else {\n // ignore invalid edges, since those aren't satisfied by this thing,\n // and are not keeping it held in this spot anyway.\n const edges = []\n for (const edge of this.edgesIn) {\n if (!edge.valid && !edge.from.isProjectRoot)\n continue\n\n edges.push(edge)\n }\n for (const edge of edges)\n why.dependents.push(edge.explain(seen))\n }\n\n if (this.linksIn.size)\n why.linksIn = [...this.linksIn].map(link => link[_explain](edge, seen))\n\n return why\n }\n\n isDescendantOf (node) {\n for (let p = this; p; p = p.parent) {\n if (p === node)\n return true\n }\n return false\n }\n\n getBundler (path = []) {\n // made a cycle, definitely not bundled!\n if (path.includes(this))\n return null\n\n path.push(this)\n\n const parent = this[_parent]\n if (!parent)\n return null\n\n const pBundler = parent.getBundler(path)\n if (pBundler)\n return pBundler\n\n const ppkg = parent.package\n const bd = ppkg && ppkg.bundleDependencies\n // explicit bundling\n if (Array.isArray(bd) && bd.includes(this.name))\n return parent\n\n // deps that are deduped up to the bundling level are bundled.\n // however, if they get their dep met further up than that,\n // then they are not bundled. Ie, installing a package with\n // unmet bundled deps will not cause your deps to be bundled.\n for (const edge of this.edgesIn) {\n const eBundler = edge.from.getBundler(path)\n if (!eBundler)\n continue\n\n if (eBundler === parent)\n return eBundler\n }\n\n return null\n }\n\n get inBundle () {\n return !!this.getBundler()\n }\n\n // when reifying, if a package is technically in a bundleDependencies list,\n // but that list is the root project, we still have to install it. This\n // getter returns true if it's in a dependency's bundle list, not the root's.\n get inDepBundle () {\n const bundler = this.getBundler()\n return !!bundler && bundler !== this.root\n }\n\n get isWorkspace () {\n if (this.isProjectRoot)\n return false\n const { root } = this\n const { type, to } = root.edgesOut.get(this.packageName) || {}\n return type === 'workspace' && to && (to.target === this || to === this)\n }\n\n get isRoot () {\n return this === this.root\n }\n\n get isProjectRoot () {\n return this === this.root || this === this.root.target\n }\n\n set root (root) {\n // setting to null means this is the new root\n // should only ever be one step\n while (root && root.root !== root)\n root = root.root\n\n root = root || this\n\n // delete from current root inventory\n this[_delistFromMeta]()\n\n // can't set the root (yet) if there's no way to determine location\n // this allows us to do new Node({...}) and then set the root later.\n // just make the assignment so we don't lose it, and move on.\n if (!this.path || !root.realpath || !root.path)\n return this[_root] = root\n\n // temporarily become a root node\n this[_root] = this\n\n // break all linksIn, we're going to re-set them if needed later\n for (const link of this.linksIn) {\n link[_target] = null\n this.linksIn.delete(link)\n }\n\n // temporarily break this link as well, we'll re-set if possible later\n const { target } = this\n if (this.isLink) {\n if (target) {\n target.linksIn.delete(this)\n if (target.root === this)\n target[_delistFromMeta]()\n }\n this[_target] = null\n }\n\n // if this is part of a cascading root set, then don't do this bit\n // but if the parent/fsParent is in a different set, we have to break\n // that reference before proceeding\n if (this.parent && this.parent.root !== root) {\n this.parent.children.delete(this.name)\n this[_parent] = null\n }\n if (this.fsParent && this.fsParent.root !== root) {\n this.fsParent.fsChildren.delete(this)\n this[_fsParent] = null\n }\n\n if (root === this)\n this[_refreshLocation]()\n else {\n // setting to some different node.\n const loc = relpath(root.realpath, this.path)\n const current = root.inventory.get(loc)\n\n // clobber whatever is there now\n if (current)\n current.root = null\n\n this[_root] = root\n // set this.location and add to inventory\n this[_refreshLocation]()\n\n // try to find our parent/fsParent in the new root inventory\n for (const p of walkUp(dirname(this.path))) {\n if (p === this.path)\n continue\n const ploc = relpath(root.realpath, p)\n const parent = root.inventory.get(ploc)\n if (parent) {\n /* istanbul ignore next - impossible */\n if (parent.isLink) {\n debug(() => {\n throw Object.assign(new Error('assigning parentage to link'), {\n path: this.path,\n parent: parent.path,\n parentReal: parent.realpath,\n })\n })\n continue\n }\n const childLoc = `${ploc}${ploc ? '/' : ''}node_modules/${this.name}`\n const isParent = this.location === childLoc\n if (isParent) {\n const oldChild = parent.children.get(this.name)\n if (oldChild && oldChild !== this)\n oldChild.root = null\n if (this.parent) {\n this.parent.children.delete(this.name)\n this.parent[_reloadNamedEdges](this.name)\n }\n parent.children.set(this.name, this)\n this[_parent] = parent\n // don't do it for links, because they don't have a target yet\n // we'll hit them up a bit later on.\n if (!this.isLink)\n parent[_reloadNamedEdges](this.name)\n } else {\n /* istanbul ignore if - should be impossible, since we break\n * all fsParent/child relationships when moving? */\n if (this.fsParent)\n this.fsParent.fsChildren.delete(this)\n parent.fsChildren.add(this)\n this[_fsParent] = parent\n }\n break\n }\n }\n\n // if it doesn't have a parent, it's a top node\n if (!this.parent)\n root.tops.add(this)\n else\n root.tops.delete(this)\n\n // assign parentage for any nodes that need to have this as a parent\n // this can happen when we have a node at nm/a/nm/b added *before*\n // the node at nm/a, which might have the root node as a fsParent.\n // we can't rely on the public setter here, because it calls into\n // this function to set up these references!\n const nmloc = `${this.location}${this.location ? '/' : ''}node_modules/`\n const isChild = n => n.location === nmloc + n.name\n // check dirname so that /foo isn't treated as the fsparent of /foo-bar\n const isFsChild = n => dirname(n.path).startsWith(this.path) &&\n n !== this &&\n !n.parent &&\n (!n.fsParent || n.fsParent === this || dirname(this.path).startsWith(n.fsParent.path))\n const isKid = n => isChild(n) || isFsChild(n)\n\n // only walk top nodes, since anything else already has a parent.\n for (const child of root.tops) {\n if (!isKid(child))\n continue\n\n // set up the internal parentage links\n if (this.isLink)\n child.root = null\n else {\n // can't possibly have a parent, because it's in tops\n if (child.fsParent)\n child.fsParent.fsChildren.delete(child)\n child[_fsParent] = null\n if (isChild(child)) {\n this.children.set(child.name, child)\n child[_parent] = this\n root.tops.delete(child)\n } else {\n this.fsChildren.add(child)\n child[_fsParent] = this\n }\n }\n }\n\n // look for any nodes with the same realpath. either they're links\n // to that realpath, or a thing at that realpath if we're adding a link\n // (if we're adding a regular node, we already deleted the old one)\n for (const node of root.inventory.query('realpath', this.realpath)) {\n if (node === this)\n continue\n\n /* istanbul ignore next - should be impossible */\n debug(() => {\n if (node.root !== root)\n throw new Error('inventory contains node from other root')\n })\n\n if (this.isLink) {\n const target = node.target || node\n this[_target] = target\n this[_package] = target.package\n target.linksIn.add(this)\n // reload edges here, because now we have a target\n if (this.parent)\n this.parent[_reloadNamedEdges](this.name)\n break\n } else {\n /* istanbul ignore else - should be impossible */\n if (node.isLink) {\n node[_target] = this\n node[_package] = this.package\n this.linksIn.add(node)\n if (node.parent)\n node.parent[_reloadNamedEdges](node.name)\n } else {\n debug(() => {\n throw Object.assign(new Error('duplicate node in root setter'), {\n path: this.path,\n realpath: this.realpath,\n root: root.realpath,\n })\n })\n }\n }\n }\n }\n\n // reload all edgesIn where the root doesn't match, so we don't have\n // cross-tree dependency graphs\n for (const edge of this.edgesIn) {\n if (edge.from.root !== root)\n edge.reload()\n }\n // reload all edgesOut where root doens't match, or is missing, since\n // it might not be missing in the new tree\n for (const edge of this.edgesOut.values()) {\n if (!edge.to || edge.to.root !== root)\n edge.reload()\n }\n\n // now make sure our family comes along for the ride!\n const family = new Set([\n ...this.fsChildren,\n ...this.children.values(),\n ...this.inventory.values(),\n ].filter(n => n !== this))\n\n for (const child of family) {\n if (child.root !== root) {\n child[_delistFromMeta]()\n child[_parent] = null\n this.children.delete(child.name)\n child[_fsParent] = null\n this.fsChildren.delete(child)\n for (const l of child.linksIn) {\n l[_target] = null\n child.linksIn.delete(l)\n }\n }\n }\n for (const child of family) {\n if (child.root !== root)\n child.root = root\n }\n\n // if we had a target, and didn't find one in the new root, then bring\n // it over as well, but only if we're setting the link into a new root,\n // as we don't want to lose the target any time we remove a link.\n if (this.isLink && target && !this.target && root !== this)\n target.root = root\n\n // tree should always be valid upon root setter completion.\n treeCheck(this)\n treeCheck(root)\n }\n\n get root () {\n return this[_root] || this\n }\n\n [_loadWorkspaces] () {\n if (!this[_workspaces])\n return\n\n for (const [name, path] of this[_workspaces].entries())\n new Edge({ from: this, name, spec: `file:${path}`, type: 'workspace' })\n }\n\n [_loadDeps] () {\n // Caveat! Order is relevant!\n // Packages in optionalDependencies are optional.\n // Packages in both deps and devDeps are required.\n // Note the subtle breaking change from v6: it is no longer possible\n // to have a different spec for a devDep than production dep.\n\n // Linked targets that are disconnected from the tree are tops,\n // but don't have a 'path' field, only a 'realpath', because we\n // don't know their canonical location. We don't need their devDeps.\n const pd = this.package.peerDependencies\n if (pd && typeof pd === 'object' && !this.legacyPeerDeps) {\n const pm = this.package.peerDependenciesMeta || {}\n const peerDependencies = {}\n const peerOptional = {}\n for (const [name, dep] of Object.entries(pd)) {\n if (pm[name] && pm[name].optional)\n peerOptional[name] = dep\n else\n peerDependencies[name] = dep\n }\n this[_loadDepType](peerDependencies, 'peer')\n this[_loadDepType](peerOptional, 'peerOptional')\n }\n\n this[_loadDepType](this.package.dependencies, 'prod')\n this[_loadDepType](this.package.optionalDependencies, 'optional')\n\n const { isTop, path, sourceReference } = this\n const { isTop: srcTop, path: srcPath } = sourceReference || {}\n if (isTop && path && (!sourceReference || srcTop && srcPath))\n this[_loadDepType](this.package.devDependencies, 'dev')\n }\n\n [_loadDepType] (deps, type) {\n const ad = this.package.acceptDependencies || {}\n // Because of the order in which _loadDeps runs, we always want to\n // prioritize a new edge over an existing one\n for (const [name, spec] of Object.entries(deps || {})) {\n const current = this.edgesOut.get(name)\n if (!current || current.type !== 'workspace')\n new Edge({ from: this, name, spec, accept: ad[name], type })\n }\n }\n\n get fsParent () {\n const parent = this[_fsParent]\n /* istanbul ignore next - should be impossible */\n debug(() => {\n if (parent === this)\n throw new Error('node set to its own fsParent')\n })\n return parent\n }\n\n set fsParent (fsParent) {\n if (!fsParent) {\n if (this[_fsParent])\n this.root = null\n return\n }\n\n debug(() => {\n if (fsParent === this)\n throw new Error('setting node to its own fsParent')\n\n if (fsParent.realpath === this.realpath)\n throw new Error('setting fsParent to same path')\n\n // the initial set MUST be an actual walk-up from the realpath\n // subsequent sets will re-root on the new fsParent's path.\n if (!this[_fsParent] && this.realpath.indexOf(fsParent.realpath) !== 0) {\n throw Object.assign(new Error('setting fsParent improperly'), {\n path: this.path,\n realpath: this.realpath,\n fsParent: {\n path: fsParent.path,\n realpath: fsParent.realpath,\n },\n })\n }\n })\n\n if (fsParent.isLink)\n fsParent = fsParent.target\n\n // setting a thing to its own fsParent is not normal, but no-op for safety\n if (this === fsParent || fsParent.realpath === this.realpath)\n return\n\n // nothing to do\n if (this[_fsParent] === fsParent)\n return\n\n const oldFsParent = this[_fsParent]\n const newPath = !oldFsParent ? this.path\n : resolve(fsParent.path, relative(oldFsParent.path, this.path))\n const nmPath = resolve(fsParent.path, 'node_modules', this.name)\n\n // this is actually the parent, set that instead\n if (newPath === nmPath) {\n this.parent = fsParent\n return\n }\n\n const pathChange = newPath !== this.path\n\n // remove from old parent/fsParent\n const oldParent = this.parent\n const oldName = this.name\n if (this.parent) {\n this.parent.children.delete(this.name)\n this[_parent] = null\n }\n if (this.fsParent) {\n this.fsParent.fsChildren.delete(this)\n this[_fsParent] = null\n }\n\n // update this.path/realpath for this and all children/fsChildren\n if (pathChange)\n this[_changePath](newPath)\n\n if (oldParent)\n oldParent[_reloadNamedEdges](oldName)\n\n // clobbers anything at that path, resets all appropriate references\n this.root = fsParent.root\n }\n\n // is it safe to replace one node with another? check the edges to\n // make sure no one will get upset. Note that the node might end up\n // having its own unmet dependencies, if the new node has new deps.\n // Note that there are cases where Arborist will opt to insert a node\n // into the tree even though this function returns false! This is\n // necessary when a root dependency is added or updated, or when a\n // root dependency brings peer deps along with it. In that case, we\n // will go ahead and create the invalid state, and then try to resolve\n // it with more tree construction, because it's a user request.\n canReplaceWith (node) {\n if (node.name !== this.name)\n return false\n\n // gather up all the deps of this node and that are only depended\n // upon by deps of this node. those ones don't count, since\n // they'll be replaced if this node is replaced anyway.\n const depSet = gatherDepSet([this], e => e.to !== this && e.valid)\n\n for (const edge of this.edgesIn) {\n // only care about edges that don't originate from this node\n if (!depSet.has(edge.from) && !edge.satisfiedBy(node))\n return false\n }\n\n return true\n }\n\n canReplace (node) {\n return node.canReplaceWith(this)\n }\n\n // return true if it's safe to remove this node, because anything that\n // is depending on it would be fine with the thing that they would resolve\n // to if it was removed, or nothing is depending on it in the first place.\n canDedupe (preferDedupe = false) {\n // not allowed to mess with shrinkwraps or bundles\n if (this.inDepBundle || this.inShrinkwrap)\n return false\n\n // it's a top level pkg, or a dep of one\n if (!this.resolveParent || !this.resolveParent.resolveParent)\n return false\n\n // no one wants it, remove it\n if (this.edgesIn.size === 0)\n return true\n\n const other = this.resolveParent.resolveParent.resolve(this.name)\n\n // nothing else, need this one\n if (!other)\n return false\n\n // if it's the same thing, then always fine to remove\n if (other.matches(this))\n return true\n\n // if the other thing can't replace this, then skip it\n if (!other.canReplace(this))\n return false\n\n // if we prefer dedupe, or if the version is greater/equal, take the other\n if (preferDedupe || semver.gte(other.version, this.version))\n return true\n\n return false\n }\n\n satisfies (requested) {\n if (requested instanceof Edge)\n return this.name === requested.name && requested.satisfiedBy(this)\n\n const parsed = npa(requested)\n const { name = this.name, rawSpec: spec } = parsed\n return this.name === name && this.satisfies(new Edge({\n from: new Node({ path: this.root.realpath }),\n type: 'prod',\n name,\n spec,\n }))\n }\n\n matches (node) {\n // if the nodes are literally the same object, obviously a match.\n if (node === this)\n return true\n\n // if the names don't match, they're different things, even if\n // the package contents are identical.\n if (node.name !== this.name)\n return false\n\n // if they're links, they match if the targets match\n if (this.isLink)\n return node.isLink && this.target.matches(node.target)\n\n // if they're two project root nodes, they're different if the paths differ\n if (this.isProjectRoot && node.isProjectRoot)\n return this.path === node.path\n\n // if the integrity matches, then they're the same.\n if (this.integrity && node.integrity)\n return this.integrity === node.integrity\n\n // if no integrity, check resolved\n if (this.resolved && node.resolved)\n return this.resolved === node.resolved\n\n // if no resolved, check both package name and version\n // otherwise, conclude that they are different things\n return this.packageName && node.packageName &&\n this.packageName === node.packageName &&\n this.version && node.version &&\n this.version === node.version\n }\n\n // replace this node with the supplied argument\n // Useful when mutating an ideal tree, so we can avoid having to call\n // the parent/root setters more than necessary.\n replaceWith (node) {\n node.replace(this)\n }\n\n replace (node) {\n this[_delistFromMeta]()\n this.path = node.path\n this.name = node.name\n if (!this.isLink)\n this.realpath = this.path\n this[_refreshLocation]()\n\n // keep children when a node replaces another\n if (!this.isLink) {\n for (const kid of node.children.values())\n kid.parent = this\n }\n\n if (!node.isRoot)\n this.root = node.root\n\n treeCheck(this)\n }\n\n get inShrinkwrap () {\n return this.parent && (this.parent.hasShrinkwrap || this.parent.inShrinkwrap)\n }\n\n get parent () {\n const parent = this[_parent]\n /* istanbul ignore next - should be impossible */\n debug(() => {\n if (parent === this)\n throw new Error('node set to its own parent')\n })\n return parent\n }\n\n // This setter keeps everything in order when we move a node from\n // one point in a logical tree to another. Edges get reloaded,\n // metadata updated, etc. It's also called when we *replace* a node\n // with another by the same name (eg, to update or dedupe).\n // This does a couple of walks out on the node_modules tree, recursing\n // into child nodes. However, as setting the parent is typically done\n // with nodes that don't have have many children, and (deduped) package\n // trees tend to be broad rather than deep, it's not that bad.\n // The only walk that starts from the parent rather than this node is\n // limited by edge name.\n set parent (parent) {\n // when setting to null, just remove it from the tree entirely\n if (!parent) {\n // but only delete it if we actually had a parent in the first place\n // otherwise it's just setting to null when it's already null\n if (this[_parent])\n this.root = null\n return\n }\n\n if (parent.isLink)\n parent = parent.target\n\n // setting a thing to its own parent is not normal, but no-op for safety\n if (this === parent)\n return\n\n const oldParent = this[_parent]\n\n // nothing to do\n if (oldParent === parent)\n return\n\n // ok now we know something is actually changing, and parent is not a link\n const newPath = resolve(parent.path, 'node_modules', this.name)\n const pathChange = newPath !== this.path\n\n // remove from old parent/fsParent\n if (oldParent) {\n oldParent.children.delete(this.name)\n this[_parent] = null\n }\n if (this.fsParent) {\n this.fsParent.fsChildren.delete(this)\n this[_fsParent] = null\n }\n\n // update this.path/realpath for this and all children/fsChildren\n if (pathChange)\n this[_changePath](newPath)\n\n // clobbers anything at that path, resets all appropriate references\n this.root = parent.root\n }\n\n // Call this before changing path or updating the _root reference.\n // Removes the node from its root the metadata and inventory.\n [_delistFromMeta] () {\n const root = this.root\n if (!root.realpath || !this.path)\n return\n root.inventory.delete(this)\n root.tops.delete(this)\n if (root.meta)\n root.meta.delete(this.path)\n /* istanbul ignore next - should be impossible */\n debug(() => {\n if ([...root.inventory.values()].includes(this))\n throw new Error('failed to delist')\n })\n }\n\n // update this.path/realpath and the paths of all children/fsChildren\n [_changePath] (newPath) {\n // have to de-list before changing paths\n this[_delistFromMeta]()\n const oldPath = this.path\n this.path = newPath\n const namePattern = /(?:^|\\/|\\\\)node_modules[\\\\/](@[^/\\\\]+[\\\\/][^\\\\/]+|[^\\\\/]+)$/\n const nameChange = newPath.match(namePattern)\n if (nameChange && this.name !== nameChange[1])\n this.name = nameChange[1].replace(/\\\\/g, '/')\n\n // if we move a link target, update link realpaths\n if (!this.isLink) {\n this.realpath = newPath\n for (const link of this.linksIn) {\n link[_delistFromMeta]()\n link.realpath = newPath\n link[_refreshLocation]()\n }\n }\n // if we move /x to /y, then a module at /x/a/b becomes /y/a/b\n for (const child of this.fsChildren)\n child[_changePath](resolve(newPath, relative(oldPath, child.path)))\n for (const [name, child] of this.children.entries())\n child[_changePath](resolve(newPath, 'node_modules', name))\n\n this[_refreshLocation]()\n }\n\n // Called whenever the root/parent is changed.\n // NB: need to remove from former root's meta/inventory and then update\n // this.path BEFORE calling this method!\n [_refreshLocation] () {\n const root = this.root\n const loc = relpath(root.realpath, this.path)\n\n this.location = loc\n\n root.inventory.add(this)\n if (root.meta)\n root.meta.add(this)\n }\n\n addEdgeOut (edge) {\n this.edgesOut.set(edge.name, edge)\n }\n\n addEdgeIn (edge) {\n this.edgesIn.add(edge)\n\n // try to get metadata from the yarn.lock file\n if (this.root.meta)\n this.root.meta.addEdge(edge)\n }\n\n [_reloadNamedEdges] (name, rootLoc = this.location) {\n const edge = this.edgesOut.get(name)\n // if we don't have an edge, do nothing, but keep descending\n const rootLocResolved = edge && edge.to &&\n edge.to.location === `${rootLoc}/node_modules/${edge.name}`\n const sameResolved = edge && this.resolve(name) === edge.to\n const recheck = rootLocResolved || !sameResolved\n if (edge && recheck)\n edge.reload(true)\n for (const c of this.children.values())\n c[_reloadNamedEdges](name, rootLoc)\n\n for (const c of this.fsChildren)\n c[_reloadNamedEdges](name, rootLoc)\n }\n\n get isLink () {\n return false\n }\n\n get target () {\n return null\n }\n\n set target (n) {\n debug(() => {\n throw Object.assign(new Error('cannot set target on non-Link Nodes'), {\n path: this.path,\n })\n })\n }\n\n get depth () {\n return this.isTop ? 0 : this.parent.depth + 1\n }\n\n get isTop () {\n return !this.parent\n }\n\n get top () {\n return this.isTop ? this : this.parent.top\n }\n\n get resolveParent () {\n return this.parent || this.fsParent\n }\n\n resolve (name) {\n const mine = this.children.get(name)\n if (mine)\n return mine\n const resolveParent = this.resolveParent\n if (resolveParent)\n return resolveParent.resolve(name)\n return null\n }\n\n inNodeModules () {\n const rp = this.realpath\n const name = this.name\n const scoped = name.charAt(0) === '@'\n const d = dirname(rp)\n const nm = scoped ? dirname(d) : d\n const dir = dirname(nm)\n const base = scoped ? `${basename(d)}/${basename(rp)}` : basename(rp)\n return base === name && basename(nm) === 'node_modules' ? dir : false\n }\n\n toJSON () {\n return printableTree(this)\n }\n\n [util.inspect.custom] () {\n return this.toJSON()\n }\n}\n\nmodule.exports = Node\n","// when an optional dep fails to install, we need to remove the branch of the\n// graph up to the first optionalDependencies, as well as any nodes that are\n// only required by other nodes in the set.\n//\n// This function finds the set of nodes that will need to be removed in that\n// case.\n//\n// Note that this is *only* going to work with trees where calcDepFlags\n// has been called, because we rely on the node.optional flag.\n\nconst gatherDepSet = require('./gather-dep-set.js')\nconst optionalSet = node => {\n if (!node.optional)\n return new Set()\n\n // start with the node, then walk up the dependency graph until we\n // get to the boundaries that define the optional set. since the\n // node is optional, we know that all paths INTO this area of the\n // graph are optional, but there may be non-optional dependencies\n // WITHIN the area.\n const set = new Set([node])\n for (const node of set) {\n for (const edge of node.edgesIn) {\n if (!edge.optional)\n set.add(edge.from)\n }\n }\n\n // now that we've hit the boundary, gather the rest of the nodes in\n // the optional section. that's the set of dependencies that are only\n // depended upon by other nodes within the set, or optional dependencies\n // from outside the set.\n return gatherDepSet(set, edge => !edge.optional)\n}\n\nmodule.exports = optionalSet\n","// when we have to dupe a set of peer dependencies deeper into the tree in\n// order to make room for a dep that would otherwise conflict, we use\n// this to get the set of all deps that have to be checked to ensure\n// nothing is locking them into the current location.\n//\n// this is different in its semantics from an \"optional set\" (ie, the nodes\n// that should be removed if an optional dep fails), because in this case,\n// we specifically intend to include deps in the peer set that have\n// dependants outside the set.\nconst peerSet = node => {\n const set = new Set([node])\n for (const node of set) {\n for (const edge of node.edgesOut.values()) {\n if (edge.valid && edge.peer && edge.to)\n set.add(edge.to)\n }\n for (const edge of node.edgesIn) {\n if (edge.valid && edge.peer)\n set.add(edge.from)\n }\n }\n return set\n}\n\nmodule.exports = peerSet\n","// helper function to output a clearer visualization\n// of the current node and its descendents\n\nconst util = require('util')\nconst relpath = require('./relpath.js')\n\nclass ArboristNode {\n constructor (tree, path) {\n this.name = tree.name\n if (tree.packageName && tree.packageName !== this.name)\n this.packageName = tree.packageName\n if (tree.version)\n this.version = tree.version\n this.location = tree.location\n this.path = tree.path\n if (tree.realpath !== this.path)\n this.realpath = tree.realpath\n if (tree.resolved !== null)\n this.resolved = tree.resolved\n if (tree.extraneous)\n this.extraneous = true\n if (tree.dev)\n this.dev = true\n if (tree.optional)\n this.optional = true\n if (tree.devOptional && !tree.dev && !tree.optional)\n this.devOptional = true\n if (tree.peer)\n this.peer = true\n if (tree.inBundle)\n this.bundled = true\n if (tree.inDepBundle)\n this.bundler = tree.getBundler().location\n const bd = tree.package && tree.package.bundleDependencies\n if (bd && bd.length)\n this.bundleDependencies = bd\n if (tree.inShrinkwrap)\n this.inShrinkwrap = true\n else if (tree.hasShrinkwrap)\n this.hasShrinkwrap = true\n if (tree.error)\n this.error = treeError(tree.error)\n if (tree.errors && tree.errors.length)\n this.errors = tree.errors.map(treeError)\n\n // edgesOut sorted by name\n if (tree.edgesOut.size) {\n this.edgesOut = new Map([...tree.edgesOut.entries()]\n .sort(([a], [b]) => a.localeCompare(b, 'en'))\n .map(([name, edge]) => [name, new EdgeOut(edge)]))\n }\n\n // edgesIn sorted by location\n if (tree.edgesIn.size) {\n this.edgesIn = new Set([...tree.edgesIn]\n .sort((a, b) => a.from.location.localeCompare(b.from.location, 'en'))\n .map(edge => new EdgeIn(edge)))\n }\n\n if (tree.workspaces && tree.workspaces.size) {\n this.workspaces = new Map([...tree.workspaces.entries()]\n .map(([name, path]) => [name, relpath(tree.root.realpath, path)]))\n }\n\n // fsChildren sorted by path\n if (tree.fsChildren.size) {\n this.fsChildren = new Set([...tree.fsChildren]\n .sort(({path: a}, {path: b}) => a.localeCompare(b, 'en'))\n .map(tree => printableTree(tree, path)))\n }\n\n // children sorted by name\n if (tree.children.size) {\n this.children = new Map([...tree.children.entries()]\n .sort(([a], [b]) => a.localeCompare(b, 'en'))\n .map(([name, tree]) => [name, printableTree(tree, path)]))\n }\n }\n}\n\nclass ArboristVirtualNode extends ArboristNode {\n constructor (tree, path) {\n super(tree, path)\n this.sourceReference = printableTree(tree.sourceReference, path)\n }\n}\n\nclass ArboristLink extends ArboristNode {\n constructor (tree, path) {\n super(tree, path)\n this.target = printableTree(tree.target, path)\n }\n}\n\nconst treeError = ({code, path}) => ({\n code,\n ...(path ? { path } : {}),\n})\n\n// print out edges without dumping the full node all over again\n// this base class will toJSON as a plain old object, but the\n// util.inspect() output will be a bit cleaner\nclass Edge {\n constructor (edge) {\n this.type = edge.type\n this.name = edge.name\n this.spec = edge.spec || '*'\n if (edge.error)\n this.error = edge.error\n }\n}\n\n// don't care about 'from' for edges out\nclass EdgeOut extends Edge {\n constructor (edge) {\n super(edge)\n this.to = edge.to && edge.to.location\n }\n\n [util.inspect.custom] () {\n return `{ ${this.type} ${this.name}@${this.spec}${\n this.to ? ' -> ' + this.to : ''\n }${\n this.error ? ' ' + this.error : ''\n } }`\n }\n}\n\n// don't care about 'to' for edges in\nclass EdgeIn extends Edge {\n constructor (edge) {\n super(edge)\n this.from = edge.from && edge.from.location\n }\n\n [util.inspect.custom] () {\n return `{ ${this.from || '\"\"'} ${this.type} ${this.name}@${this.spec}${\n this.error ? ' ' + this.error : ''\n } }`\n }\n}\n\nconst printableTree = (tree, path = []) => {\n if (!tree)\n return tree\n\n const Cls = tree.isLink ? ArboristLink\n : tree.sourceReference ? ArboristVirtualNode\n : ArboristNode\n if (path.includes(tree)) {\n const obj = Object.create(Cls.prototype)\n return Object.assign(obj, { location: tree.location })\n }\n path.push(tree)\n return new Cls(tree, path)\n}\n\nmodule.exports = printableTree\n","// look up the realpath, but cache stats to minimize overhead\n// If the parent folder is in the realpath cache, then we just\n// lstat the child, since there's no need to do a full realpath\n// This is not a separate module, and is much simpler than Node's\n// built-in fs.realpath, because we only care about symbolic links,\n// so we can handle many fewer edge cases.\n\nconst fs = require('fs')\nconst promisify = require('util').promisify\nconst readlink = promisify(fs.readlink)\nconst lstat = promisify(fs.lstat)\nconst { resolve, basename, dirname } = require('path')\n\nconst realpathCached = (path, rpcache, stcache, depth) => {\n // just a safety against extremely deep eloops\n /* istanbul ignore next */\n if (depth > 2000)\n throw eloop(path)\n\n path = resolve(path)\n if (rpcache.has(path))\n return Promise.resolve(rpcache.get(path))\n\n const dir = dirname(path)\n const base = basename(path)\n\n if (base && rpcache.has(dir))\n return realpathChild(dir, base, rpcache, stcache, depth)\n\n // if it's the root, then we know it's real\n if (!base) {\n rpcache.set(dir, dir)\n return Promise.resolve(dir)\n }\n\n // the parent, what is that?\n // find out, and then come back.\n return realpathCached(dir, rpcache, stcache, depth + 1).then(() =>\n realpathCached(path, rpcache, stcache, depth + 1))\n}\n\nconst lstatCached = (path, stcache) => {\n if (stcache.has(path))\n return Promise.resolve(stcache.get(path))\n\n const p = lstat(path).then(st => {\n stcache.set(path, st)\n return st\n })\n stcache.set(path, p)\n return p\n}\n\n// This is a slight fib, as it doesn't actually occur during a stat syscall.\n// But file systems are giant piles of lies, so whatever.\nconst eloop = path =>\n Object.assign(new Error(\n `ELOOP: too many symbolic links encountered, stat '${path}'`), {\n errno: -62,\n syscall: 'stat',\n code: 'ELOOP',\n path: path,\n })\n\nconst realpathChild = (dir, base, rpcache, stcache, depth) => {\n const realdir = rpcache.get(dir)\n // that unpossible\n /* istanbul ignore next */\n if (typeof realdir === 'undefined')\n throw new Error('in realpathChild without parent being in realpath cache')\n\n const realish = resolve(realdir, base)\n return lstatCached(realish, stcache).then(st => {\n if (!st.isSymbolicLink()) {\n rpcache.set(resolve(dir, base), realish)\n return realish\n }\n\n return readlink(realish).then(target => {\n const resolved = resolve(realdir, target)\n if (realish === resolved)\n throw eloop(realish)\n\n return realpathCached(resolved, rpcache, stcache, depth + 1)\n }).then(real => {\n rpcache.set(resolve(dir, base), real)\n return real\n })\n })\n}\n\nmodule.exports = realpathCached\n","const {relative} = require('path')\nconst relpath = (from, to) => relative(from, to).replace(/\\\\/g, '/')\nmodule.exports = relpath\n","// Sometimes we need to actually do a walk from the root, because you can\n// have a cycle of deps that all depend on each other, but no path from root.\n// Also, since the ideal tree is loaded from the shrinkwrap, it had extraneous\n// flags set false that might now be actually extraneous, and dev/optional\n// flags that are also now incorrect. This method sets all flags to true, so\n// we can find the set that is actually extraneous.\nmodule.exports = tree => {\n for (const node of tree.inventory.values()) {\n node.extraneous = true\n node.dev = true\n node.devOptional = true\n node.peer = true\n node.optional = true\n }\n}\n","const crypto = require('crypto')\nconst {dirname, basename, resolve} = require('path')\n\n// use sha1 because it's faster, and collisions extremely unlikely anyway\nconst pathSafeHash = s =>\n crypto.createHash('sha1')\n .update(s)\n .digest('base64')\n .replace(/[^a-zA-Z0-9]+/g, '')\n .substr(0, 8)\n\nconst retirePath = from => {\n const d = dirname(from)\n const b = basename(from)\n const hash = pathSafeHash(from)\n return resolve(d, `.${b}-${hash}`)\n}\n\nmodule.exports = retirePath\n","// a module that manages a shrinkwrap file (npm-shrinkwrap.json or\n// package-lock.json).\n\n// Increment whenever the lockfile version updates\n// v1 - npm <=6\n// v2 - arborist v1, npm v7, backwards compatible with v1, add 'packages'\n// v3 will drop the 'dependencies' field, backwards comp with v2, not v1\n//\n// We cannot bump to v3 until npm v6 is out of common usage, and\n// definitely not before npm v8.\n\nconst lockfileVersion = 2\n\n// for comparing nodes to yarn.lock entries\nconst mismatch = (a, b) => a && b && a !== b\n\n// this.tree => the root node for the tree (ie, same path as this)\n// - Set the first time we do `this.add(node)` for a path matching this.path\n//\n// this.add(node) =>\n// - decorate the node with the metadata we have, if we have it, and it matches\n// - add to the map of nodes needing to be committed, so that subsequent\n// changes are captured when we commit that location's metadata.\n//\n// this.commit() =>\n// - commit all nodes awaiting update to their metadata entries\n// - re-generate this.data and this.yarnLock based on this.tree\n//\n// Note that between this.add() and this.commit(), `this.data` will be out of\n// date! Always call `commit()` before relying on it.\n//\n// After calling this.commit(), any nodes not present in the tree will have\n// been removed from the shrinkwrap data as well.\n\nconst procLog = require('proc-log')\nconst YarnLock = require('./yarn-lock.js')\nconst {promisify} = require('util')\nconst rimraf = promisify(require('rimraf'))\nconst fs = require('fs')\nconst readFile = promisify(fs.readFile)\nconst writeFile = promisify(fs.writeFile)\nconst stat = promisify(fs.stat)\nconst readdir_ = promisify(fs.readdir)\nconst readlink = promisify(fs.readlink)\n\n// XXX remove when drop support for node v10\nconst lstat = promisify(fs.lstat)\n/* istanbul ignore next - version specific polyfill */\nconst readdir = async (path, opt) => {\n if (!opt || !opt.withFileTypes)\n return readdir_(path, opt)\n const ents = await readdir_(path, opt)\n if (typeof ents[0] === 'string') {\n return Promise.all(ents.map(async ent => {\n return Object.assign(await lstat(path + '/' + ent), { name: ent })\n }))\n }\n return ents\n}\n\nconst { resolve, basename } = require('path')\nconst specFromLock = require('./spec-from-lock.js')\nconst versionFromTgz = require('./version-from-tgz.js')\nconst npa = require('npm-package-arg')\nconst rpj = require('read-package-json-fast')\nconst parseJSON = require('parse-conflict-json')\n\nconst stringify = require('json-stringify-nice')\nconst swKeyOrder = [\n 'name',\n 'version',\n 'lockfileVersion',\n 'resolved',\n 'integrity',\n 'requires',\n 'packages',\n 'dependencies',\n]\n\n// used to rewrite from yarn registry to npm registry\nconst yarnRegRe = /^https?:\\/\\/registry.yarnpkg.com\\//\nconst npmRegRe = /^https?:\\/\\/registry.npmjs.org\\//\n\n// sometimes resolved: is weird or broken, or something npa can't handle\nconst specFromResolved = resolved => {\n try {\n return npa(resolved)\n } catch (er) {\n return {}\n }\n}\n\nconst relpath = require('./relpath.js')\n\nconst consistentResolve = require('./consistent-resolve.js')\n\nconst maybeReadFile = file => {\n return readFile(file, 'utf8').then(d => d, er => {\n /* istanbul ignore else - can't test without breaking module itself */\n if (er.code === 'ENOENT')\n return ''\n else\n throw er\n })\n}\n\nconst maybeStatFile = file => {\n return stat(file).then(st => st.isFile(), er => {\n /* istanbul ignore else - can't test without breaking module itself */\n if (er.code === 'ENOENT')\n return null\n else\n throw er\n })\n}\n\nconst pkgMetaKeys = [\n // note: name is included if necessary, for alias packages\n 'version',\n 'dependencies',\n 'peerDependencies',\n 'peerDependenciesMeta',\n 'optionalDependencies',\n 'bundleDependencies',\n 'acceptDependencies',\n 'funding',\n 'engines',\n 'os',\n 'cpu',\n '_integrity',\n 'license',\n '_hasShrinkwrap',\n 'hasInstallScript',\n 'bin',\n 'deprecated',\n 'workspaces',\n]\n\nconst nodeMetaKeys = [\n 'integrity',\n 'inBundle',\n 'hasShrinkwrap',\n 'hasInstallScript',\n]\n\nconst metaFieldFromPkg = (pkg, key) => {\n const val = pkg[key]\n // get the license type, not an object\n return (key === 'license' && val && typeof val === 'object' && val.type)\n ? val.type\n // skip empty objects and falsey values\n : (val && !(typeof val === 'object' && !Object.keys(val).length)) ? val\n : null\n}\n\n// check to make sure that there are no packages newer than the hidden lockfile\nconst assertNoNewer = async (path, data, lockTime, dir = path, seen = null) => {\n const base = basename(dir)\n const isNM = dir !== path && base === 'node_modules'\n const isScope = dir !== path && !isNM && base.charAt(0) === '@'\n const isParent = dir === path || isNM || isScope\n\n const rel = relpath(path, dir)\n if (dir !== path) {\n const dirTime = (await stat(dir)).mtime\n if (dirTime > lockTime)\n throw 'out of date, updated: ' + rel\n if (!isScope && !isNM && !data.packages[rel])\n throw 'missing from lockfile: ' + rel\n seen.add(rel)\n } else\n seen = new Set([rel])\n\n const parent = isParent ? dir : resolve(dir, 'node_modules')\n const children = dir === path\n ? Promise.resolve([{name: 'node_modules', isDirectory: () => true }])\n : readdir(parent, { withFileTypes: true })\n\n return children.catch(() => [])\n .then(ents => Promise.all(ents.map(async ent => {\n const child = resolve(parent, ent.name)\n if (ent.isDirectory() && !/^\\./.test(ent.name))\n await assertNoNewer(path, data, lockTime, child, seen)\n else if (ent.isSymbolicLink()) {\n const target = resolve(parent, await readlink(child))\n const tstat = await stat(target).catch(() => null)\n seen.add(relpath(path, child))\n if (tstat && tstat.isDirectory() && !seen.has(relpath(path, target)))\n await assertNoNewer(path, data, lockTime, target, seen)\n }\n })))\n .then(() => {\n if (dir !== path)\n return\n\n // assert that all the entries in the lockfile were seen\n for (const loc of new Set(Object.keys(data.packages))) {\n if (!seen.has(loc))\n throw 'missing from node_modules: ' + loc\n }\n })\n}\n\nconst _awaitingUpdate = Symbol('_awaitingUpdate')\nconst _updateWaitingNode = Symbol('_updateWaitingNode')\nconst _lockFromLoc = Symbol('_lockFromLoc')\nconst _pathToLoc = Symbol('_pathToLoc')\nconst _loadAll = Symbol('_loadAll')\nconst _metaFromLock = Symbol('_metaFromLock')\nconst _resolveMetaNode = Symbol('_resolveMetaNode')\nconst _fixDependencies = Symbol('_fixDependencies')\nconst _buildLegacyLockfile = Symbol('_buildLegacyLockfile')\nconst _filenameSet = Symbol('_filenameSet')\nconst _maybeRead = Symbol('_maybeRead')\nconst _maybeStat = Symbol('_maybeStat')\nclass Shrinkwrap {\n static load (options) {\n return new Shrinkwrap(options).load()\n }\n\n static get keyOrder () {\n return swKeyOrder\n }\n\n static reset (options) {\n // still need to know if it was loaded from the disk, but don't\n // bother reading it if we're gonna just throw it away.\n const s = new Shrinkwrap(options)\n s.reset()\n\n return s[_maybeStat]().then(([sw, lock]) => {\n s.filename = resolve(s.path,\n (s.hiddenLockfile ? 'node_modules/.package-lock'\n : s.shrinkwrapOnly || sw ? 'npm-shrinkwrap'\n : 'package-lock') + '.json')\n s.loadedFromDisk = !!(sw || lock)\n s.type = basename(s.filename)\n return s\n })\n }\n\n static metaFromNode (node, path) {\n if (node.isLink) {\n return {\n resolved: relpath(path, node.realpath),\n link: true,\n }\n }\n\n const meta = {}\n pkgMetaKeys.forEach(key => {\n const val = metaFieldFromPkg(node.package, key)\n if (val)\n meta[key.replace(/^_/, '')] = val\n })\n // we only include name if different from the node path name\n const pname = node.packageName\n if (pname && pname !== node.name)\n meta.name = pname\n\n if (node.isTop && node.package.devDependencies)\n meta.devDependencies = node.package.devDependencies\n\n nodeMetaKeys.forEach(key => {\n if (node[key])\n meta[key] = node[key]\n })\n\n const resolved = consistentResolve(node.resolved, node.path, path, true)\n if (resolved)\n meta.resolved = resolved\n\n if (node.extraneous)\n meta.extraneous = true\n else {\n if (node.peer)\n meta.peer = true\n if (node.dev)\n meta.dev = true\n if (node.optional)\n meta.optional = true\n if (node.devOptional && !node.dev && !node.optional)\n meta.devOptional = true\n }\n return meta\n }\n\n constructor (options = {}) {\n const {\n path,\n indent = 2,\n newline = '\\n',\n shrinkwrapOnly = false,\n hiddenLockfile = false,\n log = procLog,\n } = options\n\n this.log = log\n this[_awaitingUpdate] = new Map()\n this.tree = null\n this.path = resolve(path || '.')\n this.filename = null\n this.data = null\n this.indent = indent\n this.newline = newline\n this.loadedFromDisk = false\n this.type = null\n this.yarnLock = null\n this.hiddenLockfile = hiddenLockfile\n this.loadingError = null\n // only load npm-shrinkwrap.json in dep trees, not package-lock\n this.shrinkwrapOnly = shrinkwrapOnly\n }\n\n // check to see if a spec is present in the yarn.lock file, and if so,\n // if we should use it, and what it should resolve to. This is only\n // done when we did not load a shrinkwrap from disk. Also, decorate\n // the options object if provided with the resolved and integrity that\n // we expect.\n checkYarnLock (spec, options = {}) {\n spec = npa(spec)\n const { yarnLock, loadedFromDisk } = this\n const useYarnLock = yarnLock && !loadedFromDisk\n const fromYarn = useYarnLock && yarnLock.entries.get(spec.raw)\n if (fromYarn && fromYarn.version) {\n // if it's the yarn or npm default registry, use the version as\n // our effective spec. if it's any other kind of thing, use that.\n const {resolved, version, integrity} = fromYarn\n const isYarnReg = spec.registry && yarnRegRe.test(resolved)\n const isnpmReg = spec.registry && !isYarnReg && npmRegRe.test(resolved)\n const isReg = isnpmReg || isYarnReg\n // don't use the simple version if the \"registry\" url is\n // something else entirely!\n const tgz = isReg && versionFromTgz(spec.name, resolved) || {}\n const yspec = tgz.name === spec.name && tgz.version === version ? version\n : isReg && tgz.name && tgz.version ? `npm:${tgz.name}@${tgz.version}`\n : resolved\n if (yspec) {\n options.resolved = resolved.replace(yarnRegRe, 'https://registry.npmjs.org/')\n options.integrity = integrity\n return npa(`${spec.name}@${yspec}`)\n }\n }\n return spec\n }\n\n // throw away the shrinkwrap data so we can start fresh\n // still worth doing a load() first so we know which files to write.\n reset () {\n this.tree = null\n this[_awaitingUpdate] = new Map()\n this.data = {\n lockfileVersion,\n requires: true,\n packages: {},\n dependencies: {},\n }\n }\n\n [_filenameSet] () {\n return this.shrinkwrapOnly ? [\n this.path + '/npm-shrinkwrap.json',\n ] : this.hiddenLockfile ? [\n null,\n this.path + '/node_modules/.package-lock.json',\n ] : [\n this.path + '/npm-shrinkwrap.json',\n this.path + '/package-lock.json',\n this.path + '/yarn.lock',\n ]\n }\n\n [_maybeRead] () {\n return Promise.all(this[_filenameSet]().map(fn => fn && maybeReadFile(fn)))\n }\n\n [_maybeStat] () {\n // throw away yarn, we only care about lock or shrinkwrap when checking\n // this way, since we're not actually loading the full lock metadata\n return Promise.all(this[_filenameSet]().slice(0, 2)\n .map(fn => fn && maybeStatFile(fn)))\n }\n\n load () {\n // we don't need to load package-lock.json except for top of tree nodes,\n // only npm-shrinkwrap.json.\n return this[_maybeRead]().then(([sw, lock, yarn]) => {\n const data = sw || lock || ''\n\n // use shrinkwrap only for deps, otherwise prefer package-lock\n // and ignore npm-shrinkwrap if both are present.\n // TODO: emit a warning here or something if both are present.\n this.filename = resolve(this.path,\n (this.hiddenLockfile ? 'node_modules/.package-lock'\n : this.shrinkwrapOnly || sw ? 'npm-shrinkwrap'\n : 'package-lock') + '.json')\n\n this.type = basename(this.filename)\n this.loadedFromDisk = !!data\n\n if (yarn) {\n this.yarnLock = new YarnLock()\n // ignore invalid yarn data. we'll likely clobber it later anyway.\n try {\n this.yarnLock.parse(yarn)\n } catch (_) {}\n }\n\n return data ? parseJSON(data) : {}\n }).then(async data => {\n // don't use detect-indent, just pick the first line.\n // if the file starts with {\" then we have an indent of '', ie, none\n // which will default to 2 at save time.\n const {\n [Symbol.for('indent')]: indent,\n [Symbol.for('newline')]: newline,\n } = data\n this.indent = indent !== undefined ? indent : this.indent\n this.newline = newline !== undefined ? newline : this.newline\n\n if (!this.hiddenLockfile || !data.packages)\n return data\n\n // add a few ms just to account for jitter\n const lockTime = +(await stat(this.filename)).mtime + 10\n await assertNoNewer(this.path, data, lockTime)\n\n // all good! hidden lockfile is the newest thing in here.\n return data\n }).catch(er => {\n const rel = relpath(this.path, this.filename)\n this.log.verbose('shrinkwrap', `failed to load ${rel}`, er)\n this.loadingError = er\n this.loadedFromDisk = false\n this.ancientLockfile = false\n return {}\n }).then(lock => {\n this.data = {\n ...lock,\n lockfileVersion,\n requires: true,\n packages: lock.packages || {},\n ...(this.hiddenLockfile ? {} : {dependencies: lock.dependencies || {}}),\n }\n this.originalLockfileVersion = lock.lockfileVersion\n this.ancientLockfile = this.loadedFromDisk &&\n !(lock.lockfileVersion >= 2) && !lock.requires\n\n // load old lockfile deps into the packages listing\n if (lock.dependencies && !lock.packages) {\n return rpj(this.path + '/package.json').then(pkg => pkg, er => ({}))\n .then(pkg => {\n this[_loadAll]('', null, this.data)\n this[_fixDependencies](pkg)\n })\n }\n })\n .then(() => this)\n }\n\n [_loadAll] (location, name, lock) {\n // migrate a v1 package lock to the new format.\n const meta = this[_metaFromLock](location, name, lock)\n // dependencies nested under a link are actually under the link target\n if (meta.link)\n location = meta.resolved\n if (lock.dependencies) {\n for (const [name, dep] of Object.entries(lock.dependencies)) {\n const loc = location + (location ? '/' : '') + 'node_modules/' + name\n this[_loadAll](loc, name, dep)\n }\n }\n }\n\n // v1 lockfiles track the optional/dev flags, but they don't tell us\n // which thing had what kind of dep on what other thing, so we need\n // to correct that now, or every link will be considered prod\n [_fixDependencies] (pkg) {\n // we need the root package.json because legacy shrinkwraps just\n // have requires:true at the root level, which is even less useful\n // than merging all dep types into one object.\n const root = this.data.packages['']\n pkgMetaKeys.forEach(key => {\n const val = metaFieldFromPkg(pkg, key)\n const k = key.replace(/^_/, '')\n if (val)\n root[k] = val\n })\n\n for (const [loc, meta] of Object.entries(this.data.packages)) {\n if (!meta.requires || !loc)\n continue\n\n // resolve each require to a meta entry\n // if this node isn't optional, but the dep is, then it's an optionalDep\n // likewise for dev deps.\n // This isn't perfect, but it's a pretty good approximation, and at\n // least gets us out of having all 'prod' edges, which throws off the\n // buildIdealTree process\n for (const [name, spec] of Object.entries(meta.requires)) {\n const dep = this[_resolveMetaNode](loc, name)\n // this overwrites the false value set above\n const depType = dep && dep.optional && !meta.optional\n ? 'optionalDependencies'\n : /* istanbul ignore next - dev deps are only for the root level */\n dep && dep.dev && !meta.dev ? 'devDependencies'\n // also land here if the dep just isn't in the tree, which maybe\n // should be an error, since it means that the shrinkwrap is\n // invalid, but we can't do much better without any info.\n : 'dependencies'\n meta[depType] = meta[depType] || {}\n meta[depType][name] = spec\n }\n delete meta.requires\n }\n }\n\n [_resolveMetaNode] (loc, name) {\n for (let path = loc; true; path = path.replace(/(^|\\/)[^/]*$/, '')) {\n const check = `${path}${path ? '/' : ''}node_modules/${name}`\n if (this.data.packages[check])\n return this.data.packages[check]\n\n if (!path)\n break\n }\n return null\n }\n\n [_lockFromLoc] (lock, path, i = 0) {\n if (!lock)\n return null\n\n if (path[i] === '')\n i++\n\n if (i >= path.length)\n return lock\n\n if (!lock.dependencies)\n return null\n\n return this[_lockFromLoc](lock.dependencies[path[i]], path, i + 1)\n }\n\n // pass in a path relative to the root path, or an absolute path,\n // get back a /-normalized location based on root path.\n [_pathToLoc] (path) {\n return relpath(this.path, resolve(this.path, path))\n }\n\n delete (nodePath) {\n if (!this.data)\n throw new Error('run load() before getting or setting data')\n const location = this[_pathToLoc](nodePath)\n this[_awaitingUpdate].delete(location)\n\n delete this.data.packages[location]\n const path = location.split(/(?:^|\\/)node_modules\\//)\n const name = path.pop()\n const pLock = this[_lockFromLoc](this.data, path)\n if (pLock && pLock.dependencies)\n delete pLock.dependencies[name]\n }\n\n get (nodePath) {\n if (!this.data)\n throw new Error('run load() before getting or setting data')\n\n const location = this[_pathToLoc](nodePath)\n if (this[_awaitingUpdate].has(location))\n this[_updateWaitingNode](location)\n\n // first try to get from the newer spot, which we know has\n // all the things we need.\n if (this.data.packages[location])\n return this.data.packages[location]\n\n // otherwise, fall back to the legacy metadata, and hope for the best\n // get the node in the shrinkwrap corresponding to this spot\n const path = location.split(/(?:^|\\/)node_modules\\//)\n const name = path[path.length - 1]\n const lock = this[_lockFromLoc](this.data, path)\n\n return this[_metaFromLock](location, name, lock)\n }\n\n [_metaFromLock] (location, name, lock) {\n // This function tries as hard as it can to figure out the metadata\n // from a lockfile which may be outdated or incomplete. Since v1\n // lockfiles used the \"version\" field to contain a variety of\n // different possible types of data, this gets a little complicated.\n if (!lock)\n return {}\n\n // try to figure out a npm-package-arg spec from the lockfile entry\n // This will return null if we could not get anything valid out of it.\n const spec = specFromLock(name, lock, this.path)\n\n if (spec.type === 'directory') {\n // the \"version\" was a file: url to a non-tarball path\n // this is a symlink dep. We don't store much metadata\n // about symlinks, just the target.\n const target = relpath(this.path, spec.fetchSpec)\n this.data.packages[location] = {\n link: true,\n resolved: target,\n }\n // also save the link target, omitting version since we don't know\n // what it is, but we know it isn't a link to itself!\n if (!this.data.packages[target])\n this[_metaFromLock](target, name, { ...lock, version: null })\n return this.data.packages[location]\n }\n\n const meta = {}\n // when calling loadAll we'll change these into proper dep objects\n if (lock.requires && typeof lock.requires === 'object')\n meta.requires = lock.requires\n\n if (lock.optional)\n meta.optional = true\n if (lock.dev)\n meta.dev = true\n\n // the root will typically have a name from the root project's\n // package.json file.\n if (location === '')\n meta.name = lock.name\n\n // if we have integrity, save it now.\n if (lock.integrity)\n meta.integrity = lock.integrity\n\n if (lock.version && !lock.integrity) {\n // this is usually going to be a git url or symlink, but it could\n // also be a registry dependency that did not have integrity at\n // the time it was saved.\n // Symlinks were already handled above, so that leaves git.\n //\n // For git, always save the full SSH url. we'll actually fetch the\n // tgz most of the time, since it's faster, but it won't work for\n // private repos, and we can't get back to the ssh from the tgz,\n // so we store the ssh instead.\n // For unknown git hosts, just resolve to the raw spec in lock.version\n if (spec.type === 'git') {\n meta.resolved = consistentResolve(spec, this.path, this.path)\n\n // return early because there is nothing else we can do with this\n return this.data.packages[location] = meta\n } else if (spec.registry) {\n // registry dep that didn't save integrity. grab the version, and\n // fall through to pick up the resolved and potentially name.\n meta.version = lock.version\n }\n // only other possible case is a tarball without integrity.\n // fall through to do what we can with the filename later.\n }\n\n // at this point, we know that the spec is either a registry dep\n // (ie, version, because locking, which means a resolved url),\n // or a remote dep, or file: url. Remote deps and file urls\n // have a fetchSpec equal to the fully resolved thing.\n // Registry deps, we take what's in the lockfile.\n if (lock.resolved || (spec.type && !spec.registry)) {\n if (spec.registry)\n meta.resolved = lock.resolved\n else if (spec.type === 'file')\n meta.resolved = consistentResolve(spec, this.path, this.path, true)\n else if (spec.fetchSpec)\n meta.resolved = spec.fetchSpec\n }\n\n // at this point, if still we don't have a version, do our best to\n // infer it from the tarball url/file. This works a surprising\n // amount of the time, even though it's not guaranteed.\n if (!meta.version) {\n if (spec.type === 'file' || spec.type === 'remote') {\n const fromTgz = versionFromTgz(spec.name, spec.fetchSpec) ||\n versionFromTgz(spec.name, meta.resolved)\n if (fromTgz) {\n meta.version = fromTgz.version\n if (fromTgz.name !== name)\n meta.name = fromTgz.name\n }\n } else if (spec.type === 'alias') {\n meta.name = spec.subSpec.name\n meta.version = spec.subSpec.fetchSpec\n } else if (spec.type === 'version')\n meta.version = spec.fetchSpec\n // ok, I did my best! good luck!\n }\n\n if (lock.bundled)\n meta.inBundle = true\n\n // save it for next time\n return this.data.packages[location] = meta\n }\n\n add (node) {\n if (!this.data)\n throw new Error('run load() before getting or setting data')\n\n // will be actually updated on read\n const loc = relpath(this.path, node.path)\n if (node.path === this.path)\n this.tree = node\n\n // if we have metadata about this node, and it's a match, then\n // try to decorate it.\n if (node.resolved === null || node.integrity === null) {\n const {\n resolved,\n integrity,\n hasShrinkwrap,\n version,\n } = this.get(node.path)\n\n const pathFixed = !resolved ? null\n : !/^file:/.test(resolved) ? resolved\n // resolve onto the metadata path\n : `file:${resolve(this.path, resolved.substr(5))}`\n\n // if we have one, only set the other if it matches\n // otherwise it could be for a completely different thing.\n const resolvedOk = !resolved || !node.resolved ||\n node.resolved === pathFixed\n const integrityOk = !integrity || !node.integrity ||\n node.integrity === integrity\n const versionOk = !version || !node.version || version === node.version\n\n const allOk = (resolved || integrity || version) &&\n resolvedOk && integrityOk && versionOk\n\n if (allOk) {\n node.resolved = node.resolved || pathFixed || null\n node.integrity = node.integrity || integrity || null\n node.hasShrinkwrap = node.hasShrinkwrap || hasShrinkwrap || false\n } else {\n // try to read off the package or node itself\n const {\n resolved,\n integrity,\n hasShrinkwrap,\n } = Shrinkwrap.metaFromNode(node, this.path)\n node.resolved = node.resolved || resolved || null\n node.integrity = node.integrity || integrity || null\n node.hasShrinkwrap = node.hasShrinkwrap || hasShrinkwrap || false\n }\n }\n this[_awaitingUpdate].set(loc, node)\n }\n\n addEdge (edge) {\n if (!this.yarnLock || !edge.valid)\n return\n\n const { to: node } = edge\n\n // if it's already set up, nothing to do\n if (node.resolved !== null && node.integrity !== null)\n return\n\n // if the yarn lock is empty, nothing to do\n if (!this.yarnLock.entries || !this.yarnLock.entries.size)\n return\n\n // we relativize the path here because that's how it shows up in the lock\n // XXX how is this different from pathFixed above??\n const pathFixed = !node.resolved ? null\n : !/file:/.test(node.resolved) ? node.resolved\n : consistentResolve(node.resolved, node.path, this.path, true)\n\n const spec = npa(`${node.name}@${edge.spec}`)\n const entry = this.yarnLock.entries.get(`${node.name}@${edge.spec}`)\n\n if (!entry ||\n mismatch(node.version, entry.version) ||\n mismatch(node.integrity, entry.integrity) ||\n mismatch(pathFixed, entry.resolved))\n return\n\n if (entry.resolved && yarnRegRe.test(entry.resolved) && spec.registry)\n entry.resolved = entry.resolved.replace(yarnRegRe, 'https://registry.npmjs.org/')\n\n node.integrity = node.integrity || entry.integrity || null\n node.resolved = node.resolved ||\n consistentResolve(entry.resolved, this.path, node.path) || null\n\n this[_awaitingUpdate].set(relpath(this.path, node.path), node)\n }\n\n [_updateWaitingNode] (loc) {\n const node = this[_awaitingUpdate].get(loc)\n this[_awaitingUpdate].delete(loc)\n this.data.packages[loc] = Shrinkwrap.metaFromNode(node, this.path)\n }\n\n commit () {\n if (this.tree) {\n if (this.yarnLock)\n this.yarnLock.fromTree(this.tree)\n const root = Shrinkwrap.metaFromNode(this.tree.target || this.tree, this.path)\n this.data.packages = {}\n if (Object.keys(root).length)\n this.data.packages[''] = root\n for (const node of this.tree.root.inventory.values()) {\n // only way this.tree is not root is if the root is a link to it\n if (node === this.tree || node.isRoot || node.location === '')\n continue\n const loc = relpath(this.path, node.path)\n this.data.packages[loc] = Shrinkwrap.metaFromNode(node, this.path)\n }\n } else if (this[_awaitingUpdate].size > 0) {\n for (const loc of this[_awaitingUpdate].keys())\n this[_updateWaitingNode](loc)\n }\n\n // hidden lockfiles don't include legacy metadata or a root entry\n if (this.hiddenLockfile) {\n delete this.data.packages['']\n delete this.data.dependencies\n } else if (this.tree)\n this[_buildLegacyLockfile](this.tree, this.data)\n\n return this.data\n }\n\n [_buildLegacyLockfile] (node, lock, path = []) {\n if (node === this.tree) {\n // the root node\n lock.name = node.packageName || node.name\n if (node.version)\n lock.version = node.version\n }\n\n // npm v6 and before tracked 'from', meaning \"the request that led\n // to this package being installed\". However, that's inherently\n // racey and non-deterministic in a world where deps are deduped\n // ahead of fetch time. In order to maintain backwards compatibility\n // with v6 in the lockfile, we do this trick where we pick a valid\n // dep link out of the edgesIn set. Choose the edge with the fewest\n // number of `node_modules` sections in the requestor path, and then\n // lexically sort afterwards.\n const edge = [...node.edgesIn].filter(e => e.valid).sort((a, b) => {\n const aloc = a.from.location.split('node_modules')\n const bloc = b.from.location.split('node_modules')\n /* istanbul ignore next - sort calling order is indeterminate */\n return aloc.length > bloc.length ? 1\n : bloc.length > aloc.length ? -1\n : aloc[aloc.length - 1].localeCompare(bloc[bloc.length - 1], 'en')\n })[0]\n\n const res = consistentResolve(node.resolved, this.path, this.path, true)\n const rSpec = specFromResolved(res)\n\n // if we don't have anything (ie, it's extraneous) then use the resolved\n // value as if that was where we got it from, since at least it's true.\n // if we don't have either, just an empty object so nothing matches below.\n // This will effectively just save the version and resolved, as if it's\n // a standard version/range dep, which is a reasonable default.\n const spec = !edge ? rSpec\n : npa.resolve(node.name, edge.spec, edge.from.realpath)\n\n if (node.target)\n lock.version = `file:${relpath(this.path, node.realpath)}`\n else if (spec && (spec.type === 'file' || spec.type === 'remote'))\n lock.version = spec.saveSpec\n else if (spec && spec.type === 'git' || rSpec.type === 'git') {\n lock.version = node.resolved\n /* istanbul ignore else - don't think there are any cases where a git\n * spec (or indeed, ANY npa spec) doesn't have a .raw member */\n if (spec.raw)\n lock.from = spec.raw\n } else if (!node.isRoot &&\n node.package &&\n node.packageName &&\n node.packageName !== node.name)\n lock.version = `npm:${node.packageName}@${node.version}`\n else if (node.package && node.version)\n lock.version = node.version\n\n if (node.inDepBundle)\n lock.bundled = true\n\n // when we didn't resolve to git, file, or dir, and didn't request\n // git, file, dir, or remote, then the resolved value is necessary.\n if (node.resolved &&\n !node.target &&\n rSpec.type !== 'git' &&\n rSpec.type !== 'file' &&\n rSpec.type !== 'directory' &&\n spec.type !== 'directory' &&\n spec.type !== 'git' &&\n spec.type !== 'file' &&\n spec.type !== 'remote')\n lock.resolved = node.resolved\n\n if (node.integrity)\n lock.integrity = node.integrity\n\n if (node.extraneous)\n lock.extraneous = true\n else if (!node.isLink) {\n if (node.peer)\n lock.peer = true\n\n if (node.devOptional && !node.dev && !node.optional)\n lock.devOptional = true\n\n if (node.dev)\n lock.dev = true\n\n if (node.optional)\n lock.optional = true\n }\n\n const depender = node.target || node\n if (depender.edgesOut.size > 0) {\n if (node !== this.tree) {\n lock.requires = [...depender.edgesOut.entries()].reduce((set, [k, v]) => {\n // omit peer deps from legacy lockfile requires field, because\n // npm v6 doesn't handle peer deps, and this triggers some bad\n // behavior if the dep can't be found in the dependencies list.\n const { spec, peer } = v\n if (peer)\n return set\n if (spec.startsWith('file:')) {\n // turn absolute file: paths into relative paths from the node\n // this especially shows up with workspace edges when the root\n // node is also a workspace in the set.\n const p = resolve(node.realpath, spec.substr('file:'.length))\n set[k] = `file:${relpath(node.realpath, p)}`\n } else\n set[k] = spec\n return set\n }, {})\n } else\n lock.requires = true\n }\n\n // now we walk the children, putting them in the 'dependencies' object\n const {children} = node.target || node\n if (!children.size)\n delete lock.dependencies\n else {\n const kidPath = [...path, node.realpath]\n const dependencies = {}\n // skip any that are already in the descent path, so cyclical link\n // dependencies don't blow up with ELOOP.\n let found = false\n for (const [name, kid] of children.entries()) {\n if (path.includes(kid.realpath))\n continue\n dependencies[name] = this[_buildLegacyLockfile](kid, {}, kidPath)\n found = true\n }\n if (found)\n lock.dependencies = dependencies\n }\n return lock\n }\n\n save (options = {}) {\n if (!this.data)\n throw new Error('run load() before saving data')\n\n const { format = true } = options\n const defaultIndent = this.indent || 2\n const indent = format === true ? defaultIndent\n : format || 0\n const eol = format ? this.newline || '\\n' : ''\n const data = this.commit()\n const json = stringify(data, swKeyOrder, indent).replace(/\\n/g, eol)\n return Promise.all([\n writeFile(this.filename, json).catch(er => {\n if (this.hiddenLockfile) {\n // well, we did our best.\n // if we reify, and there's nothing there, then it might be lacking\n // a node_modules folder, but then the lockfile is not important.\n // Remove the file, so that in case there WERE deps, but we just\n // failed to update the file for some reason, it's not out of sync.\n return rimraf(this.filename)\n }\n throw er\n }),\n this.yarnLock && this.yarnLock.entries.size &&\n writeFile(this.path + '/yarn.lock', this.yarnLock.toString()),\n ])\n }\n}\n\nmodule.exports = Shrinkwrap\n","const signals = require('./signals.js')\n\n// for testing, expose the process being used\nmodule.exports = Object.assign(fn => setup(fn), { process })\n\n// do all of this in a setup function so that we can call it\n// multiple times for multiple reifies that might be going on.\n// Otherwise, Arborist.reify() is a global action, which is a\n// new constraint we'd be adding with this behavior.\nconst setup = fn => {\n const { process } = module.exports\n\n const sigListeners = { loaded: false }\n\n const unload = () => {\n if (!sigListeners.loaded)\n return\n for (const sig of signals) {\n try {\n process.removeListener(sig, sigListeners[sig])\n } catch (er) {}\n }\n process.removeListener('beforeExit', onBeforeExit)\n sigListeners.loaded = false\n }\n\n const onBeforeExit = () => {\n // this trick ensures that we exit with the same signal we caught\n // Ie, if you press ^C and npm gets a SIGINT, we'll do the rollback\n // and then exit with a SIGINT signal once we've removed the handler.\n // The timeout is there because signals are asynchronous, so we need\n // the process to NOT exit on its own, which means we have to have\n // something keeping the event loop looping. Hence this hack.\n unload()\n process.kill(process.pid, signalReceived)\n setTimeout(() => {}, 500)\n }\n\n let signalReceived = null\n const listener = (sig, fn) => () => {\n signalReceived = sig\n\n // if we exit normally, but caught a signal which would have been fatal,\n // then re-send it once we're done with whatever cleanup we have to do.\n unload()\n if (process.listeners(sig).length < 1)\n process.once('beforeExit', onBeforeExit)\n\n fn({ signal: sig })\n }\n\n // do the actual loading here\n for (const sig of signals) {\n sigListeners[sig] = listener(sig, fn)\n const max = process.getMaxListeners()\n try {\n // if we call this a bunch of times, avoid triggering the warning\n const { length } = process.listeners(sig)\n if (length >= max)\n process.setMaxListeners(length + 1)\n process.on(sig, sigListeners[sig])\n } catch (er) {}\n }\n sigListeners.loaded = true\n\n return unload\n}\n","// copied from signal-exit\n\n// This is not the set of all possible signals.\n//\n// It IS, however, the set of all signals that trigger\n// an exit on either Linux or BSD systems. Linux is a\n// superset of the signal names supported on BSD, and\n// the unknown signals just fail to register, so we can\n// catch that easily enough.\n//\n// Don't bother with SIGKILL. It's uncatchable, which\n// means that we can't fire any callbacks anyway.\n//\n// If a user does happen to register a handler on a non-\n// fatal signal like SIGWINCH or something, and then\n// exit, it'll end up firing `process.emit('exit')`, so\n// the handler will be fired anyway.\n//\n// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n// artificially, inherently leave the process in a\n// state from which it is not safe to try and enter JS\n// listeners.\n\nconst platform = global.__ARBORIST_FAKE_PLATFORM__ || process.platform\n\nmodule.exports = [\n 'SIGABRT',\n 'SIGALRM',\n 'SIGHUP',\n 'SIGINT',\n 'SIGTERM',\n]\n\nif (platform !== 'win32') {\n module.exports.push(\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (platform === 'linux') {\n module.exports.push(\n 'SIGIO',\n 'SIGPOLL',\n 'SIGPWR',\n 'SIGSTKFLT',\n 'SIGUNUSED'\n )\n}\n","const npa = require('npm-package-arg')\n\n// extracted from npm v6 lib/install/realize-shrinkwrap-specifier.js\nconst specFromLock = (name, lock, where) => {\n try {\n if (lock.version) {\n const spec = npa.resolve(name, lock.version, where)\n if (lock.integrity || spec.type === 'git')\n return spec\n }\n if (lock.from) {\n // legacy metadata includes \"from\", but not integrity\n const spec = npa.resolve(name, lock.from, where)\n if (spec.registry && lock.version)\n return npa.resolve(name, lock.version, where)\n else if (!lock.resolved)\n return spec\n }\n if (lock.resolved)\n return npa.resolve(name, lock.resolved, where)\n } catch (_) { }\n try {\n return npa.resolve(name, lock.version, where)\n } catch (_) {\n return {}\n }\n}\n\nmodule.exports = specFromLock\n","const _progress = Symbol('_progress')\nconst _onError = Symbol('_onError')\nconst procLog = require('proc-log')\n\nmodule.exports = cls => class Tracker extends cls {\n constructor (options = {}) {\n super(options)\n this.log = options.log || procLog\n this[_progress] = new Map()\n }\n\n addTracker (section, subsection = null, key = null) {\n // TrackerGroup type object not found\n if (!this.log.newGroup)\n return\n\n if (section === null || section === undefined)\n this[_onError](`Tracker can't be null or undefined`)\n\n if (key === null)\n key = subsection\n\n const hasTracker = this[_progress].has(section)\n const hasSubtracker = this[_progress].has(`${section}:${key}`)\n\n if (hasTracker && subsection === null)\n // 0. existing tracker, no subsection\n this[_onError](`Tracker \"${section}\" already exists`)\n\n else if (!hasTracker && subsection === null) {\n // 1. no existing tracker, no subsection\n // Create a new tracker from this.log\n // starts progress bar\n if (this[_progress].size === 0)\n this.log.enableProgress()\n\n this[_progress].set(section, this.log.newGroup(section))\n } else if (!hasTracker && subsection !== null)\n // 2. no parent tracker and subsection\n this[_onError](`Parent tracker \"${section}\" does not exist`)\n\n else if (!hasTracker || !hasSubtracker) {\n // 3. existing parent tracker, no subsection tracker\n // Create a new subtracker in this[_progress] from parent tracker\n this[_progress].set(`${section}:${key}`,\n this[_progress].get(section).newGroup(`${section}:${subsection}`)\n )\n }\n // 4. existing parent tracker, existing subsection tracker\n // skip it\n }\n\n finishTracker (section, subsection = null, key = null) {\n // TrackerGroup type object not found\n if (!this.log.newGroup)\n return\n\n if (section === null || section === undefined)\n this[_onError](`Tracker can't be null or undefined`)\n\n if (key === null)\n key = subsection\n\n const hasTracker = this[_progress].has(section)\n const hasSubtracker = this[_progress].has(`${section}:${key}`)\n\n // 0. parent tracker exists, no subsection\n // Finish parent tracker and remove from this[_progress]\n if (hasTracker && subsection === null) {\n // check if parent tracker does\n // not have any remaining children\n const keys = this[_progress].keys()\n for (const key of keys) {\n if (key.match(new RegExp(section + ':')))\n this.finishTracker(section, key)\n }\n\n // remove parent tracker\n this[_progress].get(section).finish()\n this[_progress].delete(section)\n\n // remove progress bar if all\n // trackers are finished\n if (this[_progress].size === 0)\n this.log.disableProgress()\n } else if (!hasTracker && subsection === null)\n // 1. no existing parent tracker, no subsection\n this[_onError](`Tracker \"${section}\" does not exist`)\n\n else if (!hasTracker || hasSubtracker) {\n // 2. subtracker exists\n // Finish subtracker and remove from this[_progress]\n this[_progress].get(`${section}:${key}`).finish()\n this[_progress].delete(`${section}:${key}`)\n }\n // 3. existing parent tracker, no subsection\n }\n\n [_onError] (msg) {\n this.log.disableProgress()\n throw new Error(msg)\n }\n}\n","const debug = require('./debug.js')\n\nconst checkTree = (tree, checkUnreachable = true) => {\n const log = [['START TREE CHECK', tree.path]]\n\n // this can only happen in tests where we have a \"tree\" object\n // that isn't actually a tree.\n if (!tree.root || !tree.root.inventory)\n return tree\n\n const { inventory } = tree.root\n const seen = new Set()\n const check = (node, via = tree, viaType = 'self') => {\n log.push([\n 'CHECK',\n node && node.location,\n via && via.location,\n viaType,\n 'seen=' + seen.has(node),\n 'promise=' + !!(node && node.then),\n 'root=' + !!(node && node.isRoot),\n ])\n\n if (!node || seen.has(node) || node.then)\n return\n\n seen.add(node)\n\n if (node.isRoot && node !== tree.root) {\n throw Object.assign(new Error('double root'), {\n node: node.path,\n realpath: node.realpath,\n tree: tree.path,\n root: tree.root.path,\n via: via.path,\n viaType,\n log,\n })\n }\n\n if (node.root !== tree.root) {\n throw Object.assign(new Error('node from other root in tree'), {\n node: node.path,\n realpath: node.realpath,\n tree: tree.path,\n root: tree.root.path,\n via: via.path,\n viaType,\n otherRoot: node.root && node.root.path,\n log,\n })\n }\n\n if (!node.isRoot && node.inventory.size !== 0) {\n throw Object.assign(new Error('non-root has non-zero inventory'), {\n node: node.path,\n tree: tree.path,\n root: tree.root.path,\n via: via.path,\n viaType,\n inventory: [...node.inventory.values()].map(node =>\n [node.path, node.location]),\n log,\n })\n }\n\n if (!node.isRoot && !inventory.has(node) && !node.dummy) {\n throw Object.assign(new Error('not in inventory'), {\n node: node.path,\n tree: tree.path,\n root: tree.root.path,\n via: via.path,\n viaType,\n log,\n })\n }\n\n const devEdges = [...node.edgesOut.values()].filter(e => e.dev)\n if (!node.isTop && devEdges.length) {\n throw Object.assign(new Error('dev edges on non-top node'), {\n node: node.path,\n tree: tree.path,\n root: tree.root.path,\n via: via.path,\n viaType,\n devEdges: devEdges.map(e => [e.type, e.name, e.spec, e.error]),\n log,\n })\n }\n\n if (node.path === tree.root.path && node !== tree.root) {\n throw Object.assign(new Error('node with same path as root'), {\n node: node.path,\n tree: tree.path,\n root: tree.root.path,\n via: via.path,\n viaType,\n log,\n })\n }\n\n if (!node.isLink && node.path !== node.realpath) {\n throw Object.assign(new Error('non-link with mismatched path/realpath'), {\n node: node.path,\n tree: tree.path,\n realpath: node.realpath,\n root: tree.root.path,\n via: via.path,\n viaType,\n log,\n })\n }\n\n const { parent, fsParent, target } = node\n check(parent, node, 'parent')\n check(fsParent, node, 'fsParent')\n check(target, node, 'target')\n log.push(['CHILDREN', node.location, ...node.children.keys()])\n for (const kid of node.children.values())\n check(kid, node, 'children')\n for (const kid of node.fsChildren)\n check(kid, node, 'fsChildren')\n for (const link of node.linksIn)\n check(link, node, 'linksIn')\n for (const top of node.tops)\n check(top, node, 'tops')\n log.push(['DONE', node.location])\n }\n check(tree)\n if (checkUnreachable) {\n for (const node of inventory.values()) {\n if (!seen.has(node) && node !== tree.root) {\n throw Object.assign(new Error('unreachable in inventory'), {\n node: node.path,\n realpath: node.realpath,\n location: node.location,\n root: tree.root.path,\n tree: tree.path,\n log,\n })\n }\n }\n }\n return tree\n}\n\n// should only ever run this check in debug mode\nmodule.exports = tree => tree\ndebug(() => module.exports = checkTree)\n","const fs = require('fs')\nconst promisify = require('util').promisify\nconst readFile = promisify(fs.readFile)\nconst writeFile = promisify(fs.writeFile)\nconst {resolve} = require('path')\n\nconst parseJSON = require('json-parse-even-better-errors')\n\nconst depTypes = new Set([\n 'dependencies',\n 'optionalDependencies',\n 'devDependencies',\n 'peerDependencies',\n])\n\n// sort alphabetically all types of deps for a given package\nconst orderDeps = (pkg) => {\n for (const type of depTypes) {\n if (pkg && pkg[type]) {\n pkg[type] = Object.keys(pkg[type])\n .sort((a, b) => a.localeCompare(b, 'en'))\n .reduce((res, key) => {\n res[key] = pkg[type][key]\n return res\n }, {})\n }\n }\n return pkg\n}\nconst parseJsonSafe = json => {\n try {\n return parseJSON(json)\n } catch (er) {\n return null\n }\n}\n\nconst updateRootPackageJson = async tree => {\n const filename = resolve(tree.path, 'package.json')\n const originalJson = await readFile(filename, 'utf8').catch(() => null)\n const originalContent = parseJsonSafe(originalJson)\n\n const depsData = orderDeps({\n ...tree.package,\n })\n\n // optionalDependencies don't need to be repeated in two places\n if (depsData.dependencies) {\n if (depsData.optionalDependencies) {\n for (const name of Object.keys(depsData.optionalDependencies))\n delete depsData.dependencies[name]\n }\n if (Object.keys(depsData.dependencies).length === 0)\n delete depsData.dependencies\n }\n\n // if there's no package.json, just use internal pkg info as source of truth\n // clone the object though, so we can still refer to what it originally was\n const packageJsonContent = !originalContent ? depsData\n : Object.assign({}, originalContent)\n\n // loop through all types of dependencies and update package json content\n for (const type of depTypes)\n packageJsonContent[type] = depsData[type]\n\n // if original package.json had dep in peerDeps AND deps, preserve that.\n const { dependencies: origProd, peerDependencies: origPeer } =\n originalContent || {}\n const { peerDependencies: newPeer } = packageJsonContent\n if (origProd && origPeer && newPeer) {\n // we have original prod/peer deps, and new peer deps\n // copy over any that were in both in the original\n for (const name of Object.keys(origPeer)) {\n if (origProd[name] !== undefined && newPeer[name] !== undefined) {\n packageJsonContent.dependencies = packageJsonContent.dependencies || {}\n packageJsonContent.dependencies[name] = newPeer[name]\n }\n }\n }\n\n // format content\n const {\n [Symbol.for('indent')]: indent,\n [Symbol.for('newline')]: newline,\n } = tree.package\n const format = indent === undefined ? ' ' : indent\n const eol = newline === undefined ? '\\n' : newline\n const content = (JSON.stringify(packageJsonContent, null, format) + '\\n')\n .replace(/\\n/g, eol)\n\n if (content !== originalJson)\n return writeFile(filename, content)\n}\n\nmodule.exports = updateRootPackageJson\n","/* eslint node/no-deprecated-api: \"off\" */\nconst semver = require('semver')\nconst {basename} = require('path')\nconst {parse} = require('url')\nmodule.exports = (name, tgz) => {\n const base = basename(tgz)\n if (!base.endsWith('.tgz'))\n return null\n\n const u = parse(tgz)\n if (/^https?:/.test(u.protocol)) {\n // registry url? check for most likely pattern.\n // either /@foo/bar/-/bar-1.2.3.tgz or\n // /foo/-/foo-1.2.3.tgz, and fall through to\n // basename checking. Note that registries can\n // be mounted below the root url, so /a/b/-/x/y/foo/-/foo-1.2.3.tgz\n // is a potential option.\n const tfsplit = u.path.substr(1).split('/-/')\n if (tfsplit.length > 1) {\n const afterTF = tfsplit.pop()\n if (afterTF === base) {\n const pre = tfsplit.pop()\n const preSplit = pre.split(/\\/|%2f/i)\n const project = preSplit.pop()\n const scope = preSplit.pop()\n return versionFromBaseScopeName(base, scope, project)\n }\n }\n }\n\n const split = name.split(/\\/|%2f/i)\n const project = split.pop()\n const scope = split.pop()\n return versionFromBaseScopeName(base, scope, project)\n}\n\nconst versionFromBaseScopeName = (base, scope, name) => {\n if (!base.startsWith(name + '-'))\n return null\n\n const parsed = semver.parse(base.substring(name.length + 1, base.length - 4))\n return parsed ? {\n name: scope && scope.charAt(0) === '@' ? `${scope}/${name}` : name,\n version: parsed.version,\n } : null\n}\n","// An object representing a vulnerability either as the result of an\n// advisory or due to the package in question depending exclusively on\n// vulnerable versions of a dep.\n//\n// - name: package name\n// - range: Set of vulnerable versions\n// - nodes: Set of nodes affected\n// - effects: Set of vulns triggered by this one\n// - advisories: Set of advisories (including metavulns) causing this vuln.\n// All of the entries in via are vulnerability objects returned by\n// @npmcli/metavuln-calculator\n// - via: dependency vulns which cause this one\n\nconst {satisfies, simplifyRange} = require('semver')\nconst semverOpt = { loose: true, includePrerelease: true }\n\nconst npa = require('npm-package-arg')\nconst _range = Symbol('_range')\nconst _simpleRange = Symbol('_simpleRange')\nconst _fixAvailable = Symbol('_fixAvailable')\n\nconst severities = new Map([\n ['info', 0],\n ['low', 1],\n ['moderate', 2],\n ['high', 3],\n ['critical', 4],\n [null, -1],\n])\n\nfor (const [name, val] of severities.entries())\n severities.set(val, name)\n\nclass Vuln {\n constructor ({ name, advisory }) {\n this.name = name\n this.via = new Set()\n this.advisories = new Set()\n this.severity = null\n this.effects = new Set()\n this.topNodes = new Set()\n this[_range] = null\n this[_simpleRange] = null\n this.nodes = new Set()\n // assume a fix is available unless it hits a top node\n // that locks it in place, setting this to false or {isSemVerMajor, version}.\n this[_fixAvailable] = true\n this.addAdvisory(advisory)\n this.packument = advisory.packument\n this.versions = advisory.versions\n }\n\n get fixAvailable () {\n return this[_fixAvailable]\n }\n\n set fixAvailable (f) {\n this[_fixAvailable] = f\n // if there's a fix available for this at the top level, it means that\n // it will also fix the vulns that led to it being there. to get there,\n // we set the vias to the most \"strict\" of fix availables.\n // - false: no fix is available\n // - {name, version, isSemVerMajor} fix requires -f, is semver major\n // - {name, version} fix requires -f, not semver major\n // - true: fix does not require -f\n for (const v of this.via) {\n // don't blow up on loops\n if (v.fixAvailable === f)\n continue\n\n if (f === false)\n v.fixAvailable = f\n else if (v.fixAvailable === true)\n v.fixAvailable = f\n else if (typeof f === 'object' && (\n typeof v.fixAvailable !== 'object' || !v.fixAvailable.isSemVerMajor))\n v.fixAvailable = f\n }\n }\n\n testSpec (spec) {\n const specObj = npa(spec)\n if (!specObj.registry)\n return true\n\n if (specObj.subSpec)\n spec = specObj.subSpec.rawSpec\n\n for (const v of this.versions) {\n if (satisfies(v, spec) && !satisfies(v, this.range, semverOpt))\n return false\n }\n return true\n }\n\n toJSON () {\n // sort so that they're always in a consistent order\n return {\n name: this.name,\n severity: this.severity,\n // just loop over the advisories, since via is only Vuln objects,\n // and calculated advisories have all the info we need\n via: [...this.advisories].map(v => v.type === 'metavuln' ? v.dependency : {\n ...v,\n versions: undefined,\n vulnerableVersions: undefined,\n id: undefined,\n }).sort((a, b) =>\n String(a.source || a).localeCompare(String(b.source || b, 'en'))),\n effects: [...this.effects].map(v => v.name)\n .sort(/* istanbul ignore next */(a, b) => a.localeCompare(b, 'en')),\n range: this.simpleRange,\n nodes: [...this.nodes].map(n => n.location)\n .sort(/* istanbul ignore next */(a, b) => a.localeCompare(b, 'en')),\n fixAvailable: this[_fixAvailable],\n }\n }\n\n addVia (v) {\n this.via.add(v)\n v.effects.add(this)\n // call the setter since we might add vias _after_ setting fixAvailable\n this.fixAvailable = this.fixAvailable\n }\n\n deleteVia (v) {\n this.via.delete(v)\n v.effects.delete(this)\n }\n\n deleteAdvisory (advisory) {\n this.advisories.delete(advisory)\n // make sure we have the max severity of all the vulns causing this one\n this.severity = null\n this[_range] = null\n this[_simpleRange] = null\n // refresh severity\n for (const advisory of this.advisories)\n this.addAdvisory(advisory)\n\n // remove any effects that are no longer relevant\n const vias = new Set([...this.advisories].map(a => a.dependency))\n for (const via of this.via) {\n if (!vias.has(via.name))\n this.deleteVia(via)\n }\n }\n\n addAdvisory (advisory) {\n this.advisories.add(advisory)\n const sev = severities.get(advisory.severity)\n this[_range] = null\n this[_simpleRange] = null\n if (sev > severities.get(this.severity))\n this.severity = advisory.severity\n }\n\n get range () {\n return this[_range] ||\n (this[_range] = [...this.advisories].map(v => v.range).join(' || '))\n }\n\n get simpleRange () {\n if (this[_simpleRange] && this[_simpleRange] === this[_range])\n return this[_simpleRange]\n\n const versions = [...this.advisories][0].versions\n const range = this.range\n const simple = simplifyRange(versions, range, semverOpt)\n return this[_simpleRange] = this[_range] = simple\n }\n\n isVulnerable (node) {\n if (this.nodes.has(node))\n return true\n\n const { version } = node.package\n if (!version)\n return false\n\n for (const v of this.advisories) {\n if (v.testVersion(version)) {\n this.nodes.add(node)\n return true\n }\n }\n\n return false\n }\n}\n\nmodule.exports = Vuln\n","// parse a yarn lock file\n// basic format\n//\n// [, ...]:\n// \n// :\n// \n//\n// Assume that any key or value might be quoted, though that's only done\n// in practice if certain chars are in the string. Quoting unnecessarily\n// does not cause problems for yarn, so that's what we do when we write\n// it back.\n//\n// The data format would support nested objects, but at this time, it\n// appears that yarn does not use that for anything, so in the interest\n// of a simpler parser algorithm, this implementation only supports a\n// single layer of sub objects.\n//\n// This doesn't deterministically define the shape of the tree, and so\n// cannot be used (on its own) for Arborist.loadVirtual.\n// But it can give us resolved, integrity, and version, which is useful\n// for Arborist.loadActual and for building the ideal tree.\n//\n// At the very least, when a yarn.lock file is present, we update it\n// along the way, and save it back in Shrinkwrap.save()\n//\n// NIHing this rather than using @yarnpkg/lockfile because that module\n// is an impenetrable 10kloc of webpack flow output, which is overkill\n// for something relatively simple and tailored to Arborist's use case.\n\nconst consistentResolve = require('./consistent-resolve.js')\nconst {dirname} = require('path')\nconst {breadth} = require('treeverse')\n\n// sort a key/value object into a string of JSON stringified keys and vals\nconst sortKV = obj => Object.keys(obj)\n .sort((a, b) => a.localeCompare(b, 'en'))\n .map(k => ` ${JSON.stringify(k)} ${JSON.stringify(obj[k])}`)\n .join('\\n')\n\n// for checking against previous entries\nconst match = (p, n) =>\n p.integrity && n.integrity ? p.integrity === n.integrity\n : p.resolved && n.resolved ? p.resolved === n.resolved\n : p.version && n.version ? p.version === n.version\n : true\n\nconst prefix =\n`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n# yarn lockfile v1\n\n\n`\n\nconst nullSymbol = Symbol('null')\nclass YarnLock {\n static parse (data) {\n return new YarnLock().parse(data)\n }\n\n static fromTree (tree) {\n return new YarnLock().fromTree(tree)\n }\n\n constructor () {\n this.entries = null\n this.endCurrent()\n }\n\n endCurrent () {\n this.current = null\n this.subkey = nullSymbol\n }\n\n parse (data) {\n const ENTRY_START = /^[^\\s].*:$/\n const SUBKEY = /^ {2}[^\\s]+:$/\n const SUBVAL = /^ {4}[^\\s]+ .+$/\n const METADATA = /^ {2}[^\\s]+ .+$/\n this.entries = new Map()\n this.current = null\n const linere = /([^\\r\\n]*)\\r?\\n/gm\n let match\n let lineNum = 0\n if (!/\\n$/.test(data))\n data += '\\n'\n while (match = linere.exec(data)) {\n const line = match[1]\n lineNum++\n if (line.charAt(0) === '#')\n continue\n if (line === '') {\n this.endCurrent()\n continue\n }\n if (ENTRY_START.test(line)) {\n this.endCurrent()\n const specs = this.splitQuoted(line.slice(0, -1), /, */)\n this.current = new YarnLockEntry(specs)\n specs.forEach(spec => this.entries.set(spec, this.current))\n continue\n }\n if (SUBKEY.test(line)) {\n this.subkey = line.slice(2, -1)\n this.current[this.subkey] = {}\n continue\n }\n if (SUBVAL.test(line) && this.current && this.current[this.subkey]) {\n const subval = this.splitQuoted(line.trimLeft(), ' ')\n if (subval.length === 2) {\n this.current[this.subkey][subval[0]] = subval[1]\n continue\n }\n }\n // any other metadata\n if (METADATA.test(line) && this.current) {\n const metadata = this.splitQuoted(line.trimLeft(), ' ')\n if (metadata.length === 2) {\n // strip off the legacy shasum hashes\n if (metadata[0] === 'resolved')\n metadata[1] = metadata[1].replace(/#.*/, '')\n this.current[metadata[0]] = metadata[1]\n continue\n }\n }\n\n throw Object.assign(new Error('invalid or corrupted yarn.lock file'), {\n position: match.index,\n content: match[0],\n line: lineNum,\n })\n }\n this.endCurrent()\n return this\n }\n\n splitQuoted (str, delim) {\n // a,\"b,c\",d\"e,f => ['a','\"b','c\"','d\"e','f'] => ['a','b,c','d\"e','f']\n const split = str.split(delim)\n const out = []\n let o = 0\n for (let i = 0; i < split.length; i++) {\n const chunk = split[i]\n if (/^\".*\"$/.test(chunk))\n out[o++] = chunk.trim().slice(1, -1)\n else if (/^\"/.test(chunk)) {\n let collect = chunk.trimLeft().slice(1)\n while (++i < split.length) {\n const n = split[i]\n // something that is not a slash, followed by an even number\n // of slashes then a \" then end => ending on an unescaped \"\n if (/[^\\\\](\\\\\\\\)*\"$/.test(n)) {\n collect += n.trimRight().slice(0, -1)\n break\n } else\n collect += n\n }\n out[o++] = collect\n } else\n out[o++] = chunk.trim()\n }\n return out\n }\n\n toString () {\n return prefix + [...new Set([...this.entries.values()])]\n .map(e => e.toString())\n .sort((a, b) => a.localeCompare(b, 'en')).join('\\n\\n') + '\\n'\n }\n\n fromTree (tree) {\n this.entries = new Map()\n // walk the tree in a deterministic order, breadth-first, alphabetical\n breadth({\n tree,\n visit: node => this.addEntryFromNode(node),\n getChildren: node => [...node.children.values(), ...node.fsChildren]\n .sort((a, b) => a.depth - b.depth || a.name.localeCompare(b.name, 'en')),\n })\n return this\n }\n\n addEntryFromNode (node) {\n const specs = [...node.edgesIn]\n .map(e => `${node.name}@${e.spec}`)\n .sort((a, b) => a.localeCompare(b, 'en'))\n\n // Note:\n // yarn will do excessive duplication in a case like this:\n // root -> (x@1.x, y@1.x, z@1.x)\n // y@1.x -> (x@1.1, z@2.x)\n // z@1.x -> ()\n // z@2.x -> (x@1.x)\n //\n // where x@1.2 exists, because the \"x@1.x\" spec will *always* resolve\n // to x@1.2, which doesn't work for y's dep on x@1.1, so you'll get this:\n //\n // root\n // +-- x@1.2.0\n // +-- y\n // | +-- x@1.1.0\n // | +-- z@2\n // | +-- x@1.2.0\n // +-- z@1\n //\n // instead of this more deduped tree that arborist builds by default:\n //\n // root\n // +-- x@1.2.0 (dep is x@1.x, from root)\n // +-- y\n // | +-- x@1.1.0\n // | +-- z@2 (dep on x@1.x deduped to x@1.1.0 under y)\n // +-- z@1\n //\n // In order to not create an invalid yarn.lock file with conflicting\n // entries, AND not tell yarn to create an invalid tree, we need to\n // ignore the x@1.x spec coming from z, since it's already in the entries.\n //\n // So, if the integrity and resolved don't match a previous entry, skip it.\n // We call this method on shallower nodes first, so this is fine.\n const n = this.entryDataFromNode(node)\n let priorEntry = null\n const newSpecs = []\n for (const s of specs) {\n const prev = this.entries.get(s)\n // no previous entry for this spec at all, so it's new\n if (!prev) {\n // if we saw a match already, then assign this spec to it as well\n if (priorEntry)\n priorEntry.addSpec(s)\n else\n newSpecs.push(s)\n continue\n }\n\n const m = match(prev, n)\n // there was a prior entry, but a different thing. skip this one\n if (!m)\n continue\n\n // previous matches, but first time seeing it, so already has this spec.\n // go ahead and add all the previously unseen specs, though\n if (!priorEntry) {\n priorEntry = prev\n for (const s of newSpecs) {\n priorEntry.addSpec(s)\n this.entries.set(s, priorEntry)\n }\n newSpecs.length = 0\n continue\n }\n\n // have a prior entry matching n, and matching the prev we just saw\n // add the spec to it\n priorEntry.addSpec(s)\n this.entries.set(s, priorEntry)\n }\n\n // if we never found a matching prior, then this is a whole new thing\n if (!priorEntry) {\n const entry = Object.assign(new YarnLockEntry(newSpecs), n)\n for (const s of newSpecs)\n this.entries.set(s, entry)\n } else {\n // pick up any new info that we got for this node, so that we can\n // decorate with integrity/resolved/etc.\n Object.assign(priorEntry, n)\n }\n }\n\n entryDataFromNode (node) {\n const n = {}\n if (node.package.dependencies)\n n.dependencies = node.package.dependencies\n if (node.package.optionalDependencies)\n n.optionalDependencies = node.package.optionalDependencies\n if (node.version)\n n.version = node.version\n if (node.resolved) {\n n.resolved = consistentResolve(\n node.resolved,\n node.isLink ? dirname(node.path) : node.path,\n node.root.path,\n true\n )\n }\n if (node.integrity)\n n.integrity = node.integrity\n\n return n\n }\n\n static get Entry () {\n return YarnLockEntry\n }\n}\n\nconst _specs = Symbol('_specs')\nclass YarnLockEntry {\n constructor (specs) {\n this[_specs] = new Set(specs)\n this.resolved = null\n this.version = null\n this.integrity = null\n this.dependencies = null\n this.optionalDependencies = null\n }\n\n toString () {\n // sort objects to the bottom, then alphabetical\n return ([...this[_specs]]\n .sort((a, b) => a.localeCompare(b, 'en'))\n .map(JSON.stringify).join(', ') +\n ':\\n' +\n Object.getOwnPropertyNames(this)\n .filter(prop => this[prop] !== null)\n .sort(\n (a, b) =>\n /* istanbul ignore next - sort call order is unpredictable */\n (typeof this[a] === 'object') === (typeof this[b] === 'object')\n ? a.localeCompare(b, 'en')\n : typeof this[a] === 'object' ? 1 : -1)\n .map(prop =>\n typeof this[prop] !== 'object'\n ? ` ${JSON.stringify(prop)} ${JSON.stringify(this[prop])}\\n`\n : Object.keys(this[prop]).length === 0 ? ''\n : ` ${prop}:\\n` + sortKV(this[prop]) + '\\n')\n .join('')).trim()\n }\n\n addSpec (spec) {\n this[_specs].add(spec)\n }\n}\n\nmodule.exports = YarnLock\n","const ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n const sameDirectionIncreasing =\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '>=' || comp.operator === '>')\n const sameDirectionDecreasing =\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '<=' || comp.operator === '<')\n const sameSemVer = this.semver.version === comp.semver.version\n const differentDirectionsInclusive =\n (this.operator === '>=' || this.operator === '<=') &&\n (comp.operator === '>=' || comp.operator === '<=')\n const oppositeDirectionsLessThan =\n cmp(this.semver, '<', comp.semver, options) &&\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '<=' || comp.operator === '<')\n const oppositeDirectionsGreaterThan =\n cmp(this.semver, '>', comp.semver, options) &&\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '>=' || comp.operator === '>')\n\n return (\n sameDirectionIncreasing ||\n sameDirectionDecreasing ||\n (sameSemVer && differentDirectionsInclusive) ||\n oppositeDirectionsLessThan ||\n oppositeDirectionsGreaterThan\n )\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst {re, t} = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.format()\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First, split based on boolean or ||\n this.raw = range\n this.set = range\n .split(/\\s*\\|\\|\\s*/)\n // map the range to a 2d array of comparators\n .map(range => this.parseRange(range.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${range}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0)\n this.set = [first]\n else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.format()\n }\n\n format () {\n this.range = this.set\n .map((comps) => {\n return comps.join(' ').trim()\n })\n .join('||')\n .trim()\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n range = range.trim()\n\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts = Object.keys(this.options).join(',')\n const memoKey = `parseRange:${memoOpts}:${range}`\n const cached = cache.get(memoKey)\n if (cached)\n return cached\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range, re[t.COMPARATORTRIM])\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n\n // normalize spaces\n range = range.split(/\\s+/).join(' ')\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n // in loose mode, throw out any that are not valid comparators\n .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true)\n .map(comp => new Comparator(comp, this.options))\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const l = rangeList.length\n const rangeMap = new Map()\n for (const comp of rangeList) {\n if (isNullSet(comp))\n return [comp]\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has(''))\n rangeMap.delete('')\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\nmodule.exports = Range\n\nconst LRU = require('lru-cache')\nconst cache = new LRU({ max: 1000 })\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace\n} = require('../internal/re')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\nconst replaceTildes = (comp, options) =>\n comp.trim().split(/\\s+/).map((comp) => {\n return replaceTilde(comp, options)\n }).join(' ')\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\nconst replaceCarets = (comp, options) =>\n comp.trim().split(/\\s+/).map((comp) => {\n return replaceCaret(comp, options)\n }).join(' ')\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp.split(/\\s+/).map((comp) => {\n return replaceXRange(comp, options)\n }).join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<')\n pr = '-0'\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp.trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return (`${from} ${to}`).trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }\n}\n\nmodule.exports = SemVer\n","const parse = require('./parse')\nconst clean = (version, options) => {\n const s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\nmodule.exports = clean\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst {re, t} = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n let next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null)\n return null\n\n return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)\n}\nmodule.exports = coerce\n","const SemVer = require('../classes/semver')\nconst compareBuild = (a, b, loose) => {\n const versionA = new SemVer(a, loose)\n const versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\nmodule.exports = compareBuild\n","const compare = require('./compare')\nconst compareLoose = (a, b) => compare(a, b, true)\nmodule.exports = compareLoose\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const parse = require('./parse')\nconst eq = require('./eq')\n\nconst diff = (version1, version2) => {\n if (eq(version1, version2)) {\n return null\n } else {\n const v1 = parse(version1)\n const v2 = parse(version2)\n const hasPre = v1.prerelease.length || v2.prerelease.length\n const prefix = hasPre ? 'pre' : ''\n const defaultResult = hasPre ? 'prerelease' : ''\n for (const key in v1) {\n if (key === 'major' || key === 'minor' || key === 'patch') {\n if (v1[key] !== v2[key]) {\n return prefix + key\n }\n }\n }\n return defaultResult // may be undefined\n }\n}\nmodule.exports = diff\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const SemVer = require('../classes/semver')\n\nconst inc = (version, release, options, identifier) => {\n if (typeof (options) === 'string') {\n identifier = options\n options = undefined\n }\n\n try {\n return new SemVer(version, options).inc(release, identifier).version\n } catch (er) {\n return null\n }\n}\nmodule.exports = inc\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const SemVer = require('../classes/semver')\nconst major = (a, loose) => new SemVer(a, loose).major\nmodule.exports = major\n","const SemVer = require('../classes/semver')\nconst minor = (a, loose) => new SemVer(a, loose).minor\nmodule.exports = minor\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const {MAX_LENGTH} = require('../internal/constants')\nconst { re, t } = require('../internal/re')\nconst SemVer = require('../classes/semver')\n\nconst parseOptions = require('../internal/parse-options')\nconst parse = (version, options) => {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n const r = options.loose ? re[t.LOOSE] : re[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nmodule.exports = parse\n","const SemVer = require('../classes/semver')\nconst patch = (a, loose) => new SemVer(a, loose).patch\nmodule.exports = patch\n","const parse = require('./parse')\nconst prerelease = (version, options) => {\n const parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\nmodule.exports = prerelease\n","const compare = require('./compare')\nconst rcompare = (a, b, loose) => compare(b, a, loose)\nmodule.exports = rcompare\n","const compareBuild = require('./compare-build')\nconst rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))\nmodule.exports = rsort\n","const Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","const compareBuild = require('./compare-build')\nconst sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))\nmodule.exports = sort\n","const parse = require('./parse')\nconst valid = (version, options) => {\n const v = parse(version, options)\n return v ? v.version : null\n}\nmodule.exports = valid\n","// just pre-load all the stuff that index.js lazily exports\nconst internalRe = require('./internal/re')\nmodule.exports = {\n re: internalRe.re,\n src: internalRe.src,\n tokens: internalRe.t,\n SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION,\n SemVer: require('./classes/semver'),\n compareIdentifiers: require('./internal/identifiers').compareIdentifiers,\n rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers,\n parse: require('./functions/parse'),\n valid: require('./functions/valid'),\n clean: require('./functions/clean'),\n inc: require('./functions/inc'),\n diff: require('./functions/diff'),\n major: require('./functions/major'),\n minor: require('./functions/minor'),\n patch: require('./functions/patch'),\n prerelease: require('./functions/prerelease'),\n compare: require('./functions/compare'),\n rcompare: require('./functions/rcompare'),\n compareLoose: require('./functions/compare-loose'),\n compareBuild: require('./functions/compare-build'),\n sort: require('./functions/sort'),\n rsort: require('./functions/rsort'),\n gt: require('./functions/gt'),\n lt: require('./functions/lt'),\n eq: require('./functions/eq'),\n neq: require('./functions/neq'),\n gte: require('./functions/gte'),\n lte: require('./functions/lte'),\n cmp: require('./functions/cmp'),\n coerce: require('./functions/coerce'),\n Comparator: require('./classes/comparator'),\n Range: require('./classes/range'),\n satisfies: require('./functions/satisfies'),\n toComparators: require('./ranges/to-comparators'),\n maxSatisfying: require('./ranges/max-satisfying'),\n minSatisfying: require('./ranges/min-satisfying'),\n minVersion: require('./ranges/min-version'),\n validRange: require('./ranges/valid'),\n outside: require('./ranges/outside'),\n gtr: require('./ranges/gtr'),\n ltr: require('./ranges/ltr'),\n intersects: require('./ranges/intersects'),\n simplifyRange: require('./ranges/simplify'),\n subset: require('./ranges/subset'),\n}\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\nmodule.exports = {\n SEMVER_SPEC_VERSION,\n MAX_LENGTH,\n MAX_SAFE_INTEGER,\n MAX_SAFE_COMPONENT_LENGTH\n}\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers\n}\n","// parse out just the options we care about so we always get a consistent\n// obj with keys in a consistent order.\nconst opts = ['includePrerelease', 'loose', 'rtl']\nconst parseOptions = options =>\n !options ? {}\n : typeof options !== 'object' ? { loose: true }\n : opts.filter(k => options[k]).reduce((options, k) => {\n options[k] = true\n return options\n }, {})\nmodule.exports = parseOptions\n","const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst createToken = (name, value, isGlobal) => {\n const index = R++\n debug(index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '[0-9]+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*')\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCE', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\.0\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\.0\\.0-0\\\\s*$')\n","// Determine if version is greater than all the versions possible in the range.\nconst outside = require('./outside')\nconst gtr = (version, range, options) => outside(version, range, '>', options)\nmodule.exports = gtr\n","const Range = require('../classes/range')\nconst intersects = (r1, r2, options) => {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2)\n}\nmodule.exports = intersects\n","const outside = require('./outside')\n// Determine if version is less than all the versions possible in the range\nconst ltr = (version, range, options) => outside(version, range, '<', options)\nmodule.exports = ltr\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\n\nconst maxSatisfying = (versions, range, options) => {\n let max = null\n let maxSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\nmodule.exports = maxSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst minSatisfying = (versions, range, options) => {\n let min = null\n let minSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\nmodule.exports = minSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst gt = require('../functions/gt')\n\nconst minVersion = (range, loose) => {\n range = new Range(range, loose)\n\n let minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let setMin = null\n comparators.forEach((comparator) => {\n // Clone to avoid manipulating the comparator's semver object.\n const compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!setMin || gt(compver, setMin)) {\n setMin = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error(`Unexpected operation: ${comparator.operator}`)\n }\n })\n if (setMin && (!minver || gt(minver, setMin)))\n minver = setMin\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\nmodule.exports = minVersion\n","const SemVer = require('../classes/semver')\nconst Comparator = require('../classes/comparator')\nconst {ANY} = Comparator\nconst Range = require('../classes/range')\nconst satisfies = require('../functions/satisfies')\nconst gt = require('../functions/gt')\nconst lt = require('../functions/lt')\nconst lte = require('../functions/lte')\nconst gte = require('../functions/gte')\n\nconst outside = (version, range, hilo, options) => {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n let gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisfies the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let high = null\n let low = null\n\n comparators.forEach((comparator) => {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nmodule.exports = outside\n","// given a set of versions and a range, create a \"simplified\" range\n// that includes the same versions that the original range does\n// If the original range is shorter than the simplified one, return that.\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\nmodule.exports = (versions, range, options) => {\n const set = []\n let min = null\n let prev = null\n const v = versions.sort((a, b) => compare(a, b, options))\n for (const version of v) {\n const included = satisfies(version, range, options)\n if (included) {\n prev = version\n if (!min)\n min = version\n } else {\n if (prev) {\n set.push([min, prev])\n }\n prev = null\n min = null\n }\n }\n if (min)\n set.push([min, null])\n\n const ranges = []\n for (const [min, max] of set) {\n if (min === max)\n ranges.push(min)\n else if (!max && min === v[0])\n ranges.push('*')\n else if (!max)\n ranges.push(`>=${min}`)\n else if (min === v[0])\n ranges.push(`<=${max}`)\n else\n ranges.push(`${min} - ${max}`)\n }\n const simplified = ranges.join(' || ')\n const original = typeof range.raw === 'string' ? range.raw : String(range)\n return simplified.length < original.length ? simplified : range\n}\n","const Range = require('../classes/range.js')\nconst Comparator = require('../classes/comparator.js')\nconst { ANY } = Comparator\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\n\n// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:\n// - Every simple range `r1, r2, ...` is a null set, OR\n// - Every simple range `r1, r2, ...` which is not a null set is a subset of\n// some `R1, R2, ...`\n//\n// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:\n// - If c is only the ANY comparator\n// - If C is only the ANY comparator, return true\n// - Else if in prerelease mode, return false\n// - else replace c with `[>=0.0.0]`\n// - If C is only the ANY comparator\n// - if in prerelease mode, return true\n// - else replace C with `[>=0.0.0]`\n// - Let EQ be the set of = comparators in c\n// - If EQ is more than one, return true (null set)\n// - Let GT be the highest > or >= comparator in c\n// - Let LT be the lowest < or <= comparator in c\n// - If GT and LT, and GT.semver > LT.semver, return true (null set)\n// - If any C is a = range, and GT or LT are set, return false\n// - If EQ\n// - If GT, and EQ does not satisfy GT, return true (null set)\n// - If LT, and EQ does not satisfy LT, return true (null set)\n// - If EQ satisfies every C, return true\n// - Else return false\n// - If GT\n// - If GT.semver is lower than any > or >= comp in C, return false\n// - If GT is >=, and GT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the GT.semver tuple, return false\n// - If LT\n// - If LT.semver is greater than any < or <= comp in C, return false\n// - If LT is <=, and LT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the LT.semver tuple, return false\n// - Else return true\n\nconst subset = (sub, dom, options = {}) => {\n if (sub === dom)\n return true\n\n sub = new Range(sub, options)\n dom = new Range(dom, options)\n let sawNonNull = false\n\n OUTER: for (const simpleSub of sub.set) {\n for (const simpleDom of dom.set) {\n const isSub = simpleSubset(simpleSub, simpleDom, options)\n sawNonNull = sawNonNull || isSub !== null\n if (isSub)\n continue OUTER\n }\n // the null set is a subset of everything, but null simple ranges in\n // a complex range should be ignored. so if we saw a non-null range,\n // then we know this isn't a subset, but if EVERY simple range was null,\n // then it is a subset.\n if (sawNonNull)\n return false\n }\n return true\n}\n\nconst simpleSubset = (sub, dom, options) => {\n if (sub === dom)\n return true\n\n if (sub.length === 1 && sub[0].semver === ANY) {\n if (dom.length === 1 && dom[0].semver === ANY)\n return true\n else if (options.includePrerelease)\n sub = [ new Comparator('>=0.0.0-0') ]\n else\n sub = [ new Comparator('>=0.0.0') ]\n }\n\n if (dom.length === 1 && dom[0].semver === ANY) {\n if (options.includePrerelease)\n return true\n else\n dom = [ new Comparator('>=0.0.0') ]\n }\n\n const eqSet = new Set()\n let gt, lt\n for (const c of sub) {\n if (c.operator === '>' || c.operator === '>=')\n gt = higherGT(gt, c, options)\n else if (c.operator === '<' || c.operator === '<=')\n lt = lowerLT(lt, c, options)\n else\n eqSet.add(c.semver)\n }\n\n if (eqSet.size > 1)\n return null\n\n let gtltComp\n if (gt && lt) {\n gtltComp = compare(gt.semver, lt.semver, options)\n if (gtltComp > 0)\n return null\n else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<='))\n return null\n }\n\n // will iterate one or zero times\n for (const eq of eqSet) {\n if (gt && !satisfies(eq, String(gt), options))\n return null\n\n if (lt && !satisfies(eq, String(lt), options))\n return null\n\n for (const c of dom) {\n if (!satisfies(eq, String(c), options))\n return false\n }\n\n return true\n }\n\n let higher, lower\n let hasDomLT, hasDomGT\n // if the subset has a prerelease, we need a comparator in the superset\n // with the same tuple and a prerelease, or it's not a subset\n let needDomLTPre = lt &&\n !options.includePrerelease &&\n lt.semver.prerelease.length ? lt.semver : false\n let needDomGTPre = gt &&\n !options.includePrerelease &&\n gt.semver.prerelease.length ? gt.semver : false\n // exception: <1.2.3-0 is the same as <1.2.3\n if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&\n lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {\n needDomLTPre = false\n }\n\n for (const c of dom) {\n hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='\n hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='\n if (gt) {\n if (needDomGTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomGTPre.major &&\n c.semver.minor === needDomGTPre.minor &&\n c.semver.patch === needDomGTPre.patch) {\n needDomGTPre = false\n }\n }\n if (c.operator === '>' || c.operator === '>=') {\n higher = higherGT(gt, c, options)\n if (higher === c && higher !== gt)\n return false\n } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options))\n return false\n }\n if (lt) {\n if (needDomLTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomLTPre.major &&\n c.semver.minor === needDomLTPre.minor &&\n c.semver.patch === needDomLTPre.patch) {\n needDomLTPre = false\n }\n }\n if (c.operator === '<' || c.operator === '<=') {\n lower = lowerLT(lt, c, options)\n if (lower === c && lower !== lt)\n return false\n } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options))\n return false\n }\n if (!c.operator && (lt || gt) && gtltComp !== 0)\n return false\n }\n\n // if there was a < or >, and nothing in the dom, then must be false\n // UNLESS it was limited by another range in the other direction.\n // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0\n if (gt && hasDomLT && !lt && gtltComp !== 0)\n return false\n\n if (lt && hasDomGT && !gt && gtltComp !== 0)\n return false\n\n // we needed a prerelease range in a specific tuple, but didn't get one\n // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,\n // because it includes prereleases in the 1.2.3 tuple\n if (needDomGTPre || needDomLTPre)\n return false\n\n return true\n}\n\n// >=1.2.3 is lower than >1.2.3\nconst higherGT = (a, b, options) => {\n if (!a)\n return b\n const comp = compare(a.semver, b.semver, options)\n return comp > 0 ? a\n : comp < 0 ? b\n : b.operator === '>' && a.operator === '>=' ? b\n : a\n}\n\n// <=1.2.3 is higher than <1.2.3\nconst lowerLT = (a, b, options) => {\n if (!a)\n return b\n const comp = compare(a.semver, b.semver, options)\n return comp < 0 ? a\n : comp > 0 ? b\n : b.operator === '<' && a.operator === '<=' ? b\n : a\n}\n\nmodule.exports = subset\n","const Range = require('../classes/range')\n\n// Mostly just for testing and legacy API reasons\nconst toComparators = (range, options) =>\n new Range(range, options).set\n .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))\n\nmodule.exports = toComparators\n","const Range = require('../classes/range')\nconst validRange = (range, options) => {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\nmodule.exports = validRange\n","// The goal here is to minimize both git workload and\n// the number of refs we download over the network.\n//\n// Every method ends up with the checked out working dir\n// at the specified ref, and resolves with the git sha.\n\n// Only certain whitelisted hosts get shallow cloning.\n// Many hosts (including GHE) don't always support it.\n// A failed shallow fetch takes a LOT longer than a full\n// fetch in most cases, so we skip it entirely.\n// Set opts.gitShallow = true/false to force this behavior\n// one way or the other.\nconst shallowHosts = new Set([\n 'github.com',\n 'gist.github.com',\n 'gitlab.com',\n 'bitbucket.com',\n 'bitbucket.org'\n])\n// we have to use url.parse until we add the same shim that hosted-git-info has\n// to handle scp:// urls\nconst { parse } = require('url') // eslint-disable-line node/no-deprecated-api\nconst { basename, resolve } = require('path')\n\nconst revs = require('./revs.js')\nconst spawn = require('./spawn.js')\nconst { isWindows } = require('./utils.js')\n\nconst pickManifest = require('npm-pick-manifest')\nconst fs = require('fs')\nconst mkdirp = require('mkdirp')\n\nmodule.exports = (repo, ref = 'HEAD', target = null, opts = {}) =>\n revs(repo, opts).then(revs => clone(\n repo,\n revs,\n ref,\n resolveRef(revs, ref, opts),\n target || defaultTarget(repo, opts.cwd),\n opts\n ))\n\nconst maybeShallow = (repo, opts) => {\n if (opts.gitShallow === false || opts.gitShallow) {\n return opts.gitShallow\n }\n return shallowHosts.has(parse(repo).host)\n}\n\nconst defaultTarget = (repo, /* istanbul ignore next */ cwd = process.cwd()) =>\n resolve(cwd, basename(repo.replace(/[/\\\\]?\\.git$/, '')))\n\nconst clone = (repo, revs, ref, revDoc, target, opts) => {\n if (!revDoc) {\n return unresolved(repo, ref, target, opts)\n }\n if (revDoc.sha === revs.refs.HEAD.sha) {\n return plain(repo, revDoc, target, opts)\n }\n if (revDoc.type === 'tag' || revDoc.type === 'branch') {\n return branch(repo, revDoc, target, opts)\n }\n return other(repo, revDoc, target, opts)\n}\n\nconst resolveRef = (revs, ref, opts) => {\n const { spec = {} } = opts\n ref = spec.gitCommittish || ref\n /* istanbul ignore next - will fail anyway, can't pull */\n if (!revs) {\n return null\n }\n if (spec.gitRange) {\n return pickManifest(revs, spec.gitRange, opts)\n }\n if (!ref) {\n return revs.refs.HEAD\n }\n if (revs.refs[ref]) {\n return revs.refs[ref]\n }\n if (revs.shas[ref]) {\n return revs.refs[revs.shas[ref][0]]\n }\n return null\n}\n\n// pull request or some other kind of advertised ref\nconst other = (repo, revDoc, target, opts) => {\n const shallow = maybeShallow(repo, opts)\n\n const fetchOrigin = ['fetch', 'origin', revDoc.rawRef]\n .concat(shallow ? ['--depth=1'] : [])\n\n const git = (args) => spawn(args, { ...opts, cwd: target })\n return mkdirp(target)\n .then(() => git(['init']))\n .then(() => isWindows(opts)\n ? git(['config', '--local', '--add', 'core.longpaths', 'true'])\n : null)\n .then(() => git(['remote', 'add', 'origin', repo]))\n .then(() => git(fetchOrigin))\n .then(() => git(['checkout', revDoc.sha]))\n .then(() => updateSubmodules(target, opts))\n .then(() => revDoc.sha)\n}\n\n// tag or branches. use -b\nconst branch = (repo, revDoc, target, opts) => {\n const args = [\n 'clone',\n '-b',\n revDoc.ref,\n repo,\n target,\n '--recurse-submodules'\n ]\n if (maybeShallow(repo, opts)) { args.push('--depth=1') }\n if (isWindows(opts)) { args.push('--config', 'core.longpaths=true') }\n return spawn(args, opts).then(() => revDoc.sha)\n}\n\n// just the head. clone it\nconst plain = (repo, revDoc, target, opts) => {\n const args = [\n 'clone',\n repo,\n target,\n '--recurse-submodules'\n ]\n if (maybeShallow(repo, opts)) { args.push('--depth=1') }\n if (isWindows(opts)) { args.push('--config', 'core.longpaths=true') }\n return spawn(args, opts).then(() => revDoc.sha)\n}\n\nconst updateSubmodules = (target, opts) => new Promise(resolve =>\n fs.stat(target + '/.gitmodules', er => {\n if (er) {\n return resolve(null)\n }\n return resolve(spawn([\n 'submodule',\n 'update',\n '-q',\n '--init',\n '--recursive'\n ], { ...opts, cwd: target }))\n }))\n\nconst unresolved = (repo, ref, target, opts) => {\n // can't do this one shallowly, because the ref isn't advertised\n // but we can avoid checking out the working dir twice, at least\n const lp = isWindows(opts) ? ['--config', 'core.longpaths=true'] : []\n const cloneArgs = ['clone', '--mirror', '-q', repo, target + '/.git']\n const git = (args) => spawn(args, { ...opts, cwd: target })\n return mkdirp(target)\n .then(() => git(cloneArgs.concat(lp)))\n .then(() => git(['init']))\n .then(() => git(['checkout', ref]))\n .then(() => updateSubmodules(target, opts))\n .then(() => git(['rev-parse', '--revs-only', 'HEAD']))\n .then(({ stdout }) => stdout.trim())\n}\n","\nconst maxRetry = 3\n\nclass GitError extends Error {\n shouldRetry () {\n return false\n }\n}\n\nclass GitConnectionError extends GitError {\n constructor (message) {\n super('A git connection error occurred')\n }\n\n shouldRetry (number) {\n return number < maxRetry\n }\n}\n\nclass GitPathspecError extends GitError {\n constructor (message) {\n super('The git reference could not be found')\n }\n}\n\nclass GitUnknownError extends GitError {\n constructor (message) {\n super('An unknown git error occurred')\n }\n}\n\nmodule.exports = {\n GitConnectionError,\n GitPathspecError,\n GitUnknownError\n}\n","const is = require('./is.js')\nconst { dirname } = require('path')\n\nmodule.exports = async ({ cwd = process.cwd() } = {}) => {\n if (await is({ cwd })) {\n return cwd\n }\n while (cwd !== dirname(cwd)) {\n cwd = dirname(cwd)\n if (await is({ cwd })) {\n return cwd\n }\n }\n return null\n}\n","module.exports = {\n clone: require('./clone.js'),\n revs: require('./revs.js'),\n spawn: require('./spawn.js'),\n is: require('./is.js'),\n find: require('./find.js'),\n isClean: require('./is-clean.js'),\n errors: require('./errors.js')\n}\n","const spawn = require('./spawn.js')\n\nmodule.exports = (opts = {}) =>\n spawn(['status', '--porcelain=v1', '-uno'], opts)\n .then(res => !res.stdout.trim().split(/\\r?\\n+/)\n .map(l => l.trim()).filter(l => l).length)\n","// not an airtight indicator, but a good gut-check to even bother trying\nconst { promisify } = require('util')\nconst fs = require('fs')\nconst stat = promisify(fs.stat)\nmodule.exports = ({ cwd = process.cwd() } = {}) =>\n stat(cwd + '/.git').then(() => true, () => false)\n","// turn an array of lines from `git ls-remote` into a thing\n// vaguely resembling a packument, where docs are a resolved ref\n\nconst semver = require('semver')\n\nmodule.exports = lines => finish(lines.reduce(linesToRevsReducer, {\n versions: {},\n 'dist-tags': {},\n refs: {},\n shas: {}\n}))\n\nconst finish = revs => distTags(shaList(peelTags(revs)))\n\n// We can check out shallow clones on specific SHAs if we have a ref\nconst shaList = revs => {\n Object.keys(revs.refs).forEach(ref => {\n const doc = revs.refs[ref]\n if (!revs.shas[doc.sha]) {\n revs.shas[doc.sha] = [ref]\n } else {\n revs.shas[doc.sha].push(ref)\n }\n })\n return revs\n}\n\n// Replace any tags with their ^{} counterparts, if those exist\nconst peelTags = revs => {\n Object.keys(revs.refs).filter(ref => ref.endsWith('^{}')).forEach(ref => {\n const peeled = revs.refs[ref]\n const unpeeled = revs.refs[ref.replace(/\\^\\{\\}$/, '')]\n if (unpeeled) {\n unpeeled.sha = peeled.sha\n delete revs.refs[ref]\n }\n })\n return revs\n}\n\nconst distTags = revs => {\n // not entirely sure what situations would result in an\n // ichabod repo, but best to be careful in Sleepy Hollow anyway\n const HEAD = revs.refs.HEAD || /* istanbul ignore next */ {}\n const versions = Object.keys(revs.versions)\n versions.forEach(v => {\n // simulate a dist-tags with latest pointing at the\n // 'latest' branch if one exists and is a version,\n // or HEAD if not.\n const ver = revs.versions[v]\n if (revs.refs.latest && ver.sha === revs.refs.latest.sha) {\n revs['dist-tags'].latest = v\n } else if (ver.sha === HEAD.sha) {\n revs['dist-tags'].HEAD = v\n if (!revs.refs.latest) { revs['dist-tags'].latest = v }\n }\n })\n return revs\n}\n\nconst refType = ref => {\n if (ref.startsWith('refs/tags/')) {\n return 'tag'\n }\n if (ref.startsWith('refs/heads/')) {\n return 'branch'\n }\n if (ref.startsWith('refs/pull/')) {\n return 'pull'\n }\n if (ref === 'HEAD') {\n return 'head'\n }\n // Could be anything, ignore for now\n /* istanbul ignore next */\n return 'other'\n}\n\n// return the doc, or null if we should ignore it.\nconst lineToRevDoc = line => {\n const split = line.trim().split(/\\s+/, 2)\n if (split.length < 2) { return null }\n\n const sha = split[0].trim()\n const rawRef = split[1].trim()\n const type = refType(rawRef)\n\n if (type === 'tag') {\n // refs/tags/foo^{} is the 'peeled tag', ie the commit\n // that is tagged by refs/tags/foo they resolve to the same\n // content, just different objects in git's data structure.\n // But, we care about the thing the tag POINTS to, not the tag\n // object itself, so we only look at the peeled tag refs, and\n // ignore the pointer.\n // For now, though, we have to save both, because some tags\n // don't have peels, if they were not annotated.\n const ref = rawRef.substr('refs/tags/'.length)\n return { sha, ref, rawRef, type }\n }\n\n if (type === 'branch') {\n const ref = rawRef.substr('refs/heads/'.length)\n return { sha, ref, rawRef, type }\n }\n\n if (type === 'pull') {\n // NB: merged pull requests installable with #pull/123/merge\n // for the merged pr, or #pull/123 for the PR head\n const ref = rawRef.substr('refs/'.length).replace(/\\/head$/, '')\n return { sha, ref, rawRef, type }\n }\n\n if (type === 'head') {\n const ref = 'HEAD'\n return { sha, ref, rawRef, type }\n }\n\n // at this point, all we can do is leave the ref un-munged\n return { sha, ref: rawRef, rawRef, type }\n}\n\nconst linesToRevsReducer = (revs, line) => {\n const doc = lineToRevDoc(line)\n\n if (!doc) { return revs }\n\n revs.refs[doc.ref] = doc\n revs.refs[doc.rawRef] = doc\n\n if (doc.type === 'tag') {\n // try to pull a semver value out of tags like `release-v1.2.3`\n // which is a pretty common pattern.\n const match = !doc.ref.endsWith('^{}') &&\n doc.ref.match(/v?(\\d+\\.\\d+\\.\\d+(?:[-+].+)?)$/)\n if (match && semver.valid(match[1], true)) {\n revs.versions[semver.clean(match[1], true)] = doc\n }\n }\n\n return revs\n}\n","const {\n GitConnectionError,\n GitPathspecError,\n GitUnknownError\n} = require('./errors.js')\n\nconst connectionErrorRe = new RegExp([\n 'remote error: Internal Server Error',\n 'The remote end hung up unexpectedly',\n 'Connection timed out',\n 'Operation timed out',\n 'Failed to connect to .* Timed out',\n 'Connection reset by peer',\n 'SSL_ERROR_SYSCALL',\n 'The requested URL returned error: 503'\n].join('|'))\n\nconst missingPathspecRe = /pathspec .* did not match any file\\(s\\) known to git/\n\nfunction makeError (er) {\n const message = er.stderr\n let gitEr\n if (connectionErrorRe.test(message)) {\n gitEr = new GitConnectionError(message)\n } else if (missingPathspecRe.test(message)) {\n gitEr = new GitPathspecError(message)\n } else {\n gitEr = new GitUnknownError(message)\n }\n return Object.assign(gitEr, er)\n}\n\nmodule.exports = makeError\n","// Values we want to set if they're not already defined by the end user\n// This defaults to accepting new ssh host key fingerprints\nconst gitEnv = {\n GIT_ASKPASS: 'echo',\n GIT_SSH_COMMAND: 'ssh -oStrictHostKeyChecking=accept-new'\n}\nmodule.exports = (opts = {}) => ({\n stdioString: true,\n ...opts,\n shell: false,\n env: opts.env || { ...gitEnv, ...process.env }\n})\n","// default logger.\n// emits 'log' events on the process\nconst LEVELS = [\n 'notice',\n 'error',\n 'warn',\n 'info',\n 'verbose',\n 'http',\n 'silly',\n 'pause',\n 'resume'\n]\n\nconst log = level => (...args) => process.emit('log', level, ...args)\n\nconst logger = {}\nfor (const level of LEVELS) {\n logger[level] = log(level)\n}\nmodule.exports = logger\n","const pinflight = require('promise-inflight')\nconst spawn = require('./spawn.js')\nconst LRU = require('lru-cache')\n\nconst revsCache = new LRU({\n max: 100,\n maxAge: 5 * 60 * 1000\n})\n\nconst linesToRevs = require('./lines-to-revs.js')\n\nmodule.exports = async (repo, opts = {}) => {\n if (!opts.noGitRevCache) {\n const cached = revsCache.get(repo)\n if (cached) {\n return cached\n }\n }\n\n return pinflight(`ls-remote:${repo}`, () =>\n spawn(['ls-remote', repo], opts)\n .then(({ stdout }) => linesToRevs(stdout.trim().split('\\n')))\n .then(revs => {\n revsCache.set(repo, revs)\n return revs\n })\n )\n}\n","const spawn = require('@npmcli/promise-spawn')\nconst promiseRetry = require('promise-retry')\nconst makeError = require('./make-error.js')\nconst whichGit = require('./which.js')\nconst makeOpts = require('./opts.js')\nconst procLog = require('./proc-log.js')\n\nmodule.exports = (gitArgs, opts = {}) => {\n const gitPath = whichGit(opts)\n\n if (gitPath instanceof Error) { return Promise.reject(gitPath) }\n\n // undocumented option, mostly only here for tests\n const args = opts.allowReplace || gitArgs[0] === '--no-replace-objects'\n ? gitArgs\n : ['--no-replace-objects', ...gitArgs]\n\n const log = opts.log || procLog\n let retry = opts.retry\n if (retry === null || retry === undefined) {\n retry = {\n retries: opts.fetchRetries || 2,\n factor: opts.fetchRetryFactor || 10,\n maxTimeout: opts.fetchRetryMaxtimeout || 60000,\n minTimeout: opts.fetchRetryMintimeout || 1000\n }\n }\n return promiseRetry((retry, number) => {\n if (number !== 1) {\n log.silly('git', `Retrying git command: ${\n args.join(' ')} attempt # ${number}`)\n }\n\n return spawn(gitPath, args, makeOpts(opts))\n .catch(er => {\n const gitError = makeError(er)\n if (!gitError.shouldRetry(number)) {\n throw gitError\n }\n retry(gitError)\n })\n }, retry)\n}\n","const isWindows = opts => (opts.fakePlatform || process.platform) === 'win32'\n\nexports.isWindows = isWindows\n","const which = require('which')\n\nlet gitPath\ntry {\n gitPath = which.sync('git')\n} catch (e) {}\n\nmodule.exports = (opts = {}) => {\n if (opts.git) {\n return opts.git\n }\n if (!gitPath || opts.git === false) {\n return Object.assign(new Error('No git binary found in $PATH'), { code: 'ENOGIT' })\n }\n return gitPath\n}\n","const ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n const sameDirectionIncreasing =\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '>=' || comp.operator === '>')\n const sameDirectionDecreasing =\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '<=' || comp.operator === '<')\n const sameSemVer = this.semver.version === comp.semver.version\n const differentDirectionsInclusive =\n (this.operator === '>=' || this.operator === '<=') &&\n (comp.operator === '>=' || comp.operator === '<=')\n const oppositeDirectionsLessThan =\n cmp(this.semver, '<', comp.semver, options) &&\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '<=' || comp.operator === '<')\n const oppositeDirectionsGreaterThan =\n cmp(this.semver, '>', comp.semver, options) &&\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '>=' || comp.operator === '>')\n\n return (\n sameDirectionIncreasing ||\n sameDirectionDecreasing ||\n (sameSemVer && differentDirectionsInclusive) ||\n oppositeDirectionsLessThan ||\n oppositeDirectionsGreaterThan\n )\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst {re, t} = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.format()\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First, split based on boolean or ||\n this.raw = range\n this.set = range\n .split(/\\s*\\|\\|\\s*/)\n // map the range to a 2d array of comparators\n .map(range => this.parseRange(range.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${range}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0)\n this.set = [first]\n else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.format()\n }\n\n format () {\n this.range = this.set\n .map((comps) => {\n return comps.join(' ').trim()\n })\n .join('||')\n .trim()\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n range = range.trim()\n\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts = Object.keys(this.options).join(',')\n const memoKey = `parseRange:${memoOpts}:${range}`\n const cached = cache.get(memoKey)\n if (cached)\n return cached\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range, re[t.COMPARATORTRIM])\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n\n // normalize spaces\n range = range.split(/\\s+/).join(' ')\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n // in loose mode, throw out any that are not valid comparators\n .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true)\n .map(comp => new Comparator(comp, this.options))\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const l = rangeList.length\n const rangeMap = new Map()\n for (const comp of rangeList) {\n if (isNullSet(comp))\n return [comp]\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has(''))\n rangeMap.delete('')\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\nmodule.exports = Range\n\nconst LRU = require('lru-cache')\nconst cache = new LRU({ max: 1000 })\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace\n} = require('../internal/re')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\nconst replaceTildes = (comp, options) =>\n comp.trim().split(/\\s+/).map((comp) => {\n return replaceTilde(comp, options)\n }).join(' ')\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\nconst replaceCarets = (comp, options) =>\n comp.trim().split(/\\s+/).map((comp) => {\n return replaceCaret(comp, options)\n }).join(' ')\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp.split(/\\s+/).map((comp) => {\n return replaceXRange(comp, options)\n }).join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<')\n pr = '-0'\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp.trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return (`${from} ${to}`).trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }\n}\n\nmodule.exports = SemVer\n","const parse = require('./parse')\nconst clean = (version, options) => {\n const s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\nmodule.exports = clean\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst {re, t} = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n let next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null)\n return null\n\n return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)\n}\nmodule.exports = coerce\n","const SemVer = require('../classes/semver')\nconst compareBuild = (a, b, loose) => {\n const versionA = new SemVer(a, loose)\n const versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\nmodule.exports = compareBuild\n","const compare = require('./compare')\nconst compareLoose = (a, b) => compare(a, b, true)\nmodule.exports = compareLoose\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const parse = require('./parse')\nconst eq = require('./eq')\n\nconst diff = (version1, version2) => {\n if (eq(version1, version2)) {\n return null\n } else {\n const v1 = parse(version1)\n const v2 = parse(version2)\n const hasPre = v1.prerelease.length || v2.prerelease.length\n const prefix = hasPre ? 'pre' : ''\n const defaultResult = hasPre ? 'prerelease' : ''\n for (const key in v1) {\n if (key === 'major' || key === 'minor' || key === 'patch') {\n if (v1[key] !== v2[key]) {\n return prefix + key\n }\n }\n }\n return defaultResult // may be undefined\n }\n}\nmodule.exports = diff\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const SemVer = require('../classes/semver')\n\nconst inc = (version, release, options, identifier) => {\n if (typeof (options) === 'string') {\n identifier = options\n options = undefined\n }\n\n try {\n return new SemVer(version, options).inc(release, identifier).version\n } catch (er) {\n return null\n }\n}\nmodule.exports = inc\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const SemVer = require('../classes/semver')\nconst major = (a, loose) => new SemVer(a, loose).major\nmodule.exports = major\n","const SemVer = require('../classes/semver')\nconst minor = (a, loose) => new SemVer(a, loose).minor\nmodule.exports = minor\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const {MAX_LENGTH} = require('../internal/constants')\nconst { re, t } = require('../internal/re')\nconst SemVer = require('../classes/semver')\n\nconst parseOptions = require('../internal/parse-options')\nconst parse = (version, options) => {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n const r = options.loose ? re[t.LOOSE] : re[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nmodule.exports = parse\n","const SemVer = require('../classes/semver')\nconst patch = (a, loose) => new SemVer(a, loose).patch\nmodule.exports = patch\n","const parse = require('./parse')\nconst prerelease = (version, options) => {\n const parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\nmodule.exports = prerelease\n","const compare = require('./compare')\nconst rcompare = (a, b, loose) => compare(b, a, loose)\nmodule.exports = rcompare\n","const compareBuild = require('./compare-build')\nconst rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))\nmodule.exports = rsort\n","const Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","const compareBuild = require('./compare-build')\nconst sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))\nmodule.exports = sort\n","const parse = require('./parse')\nconst valid = (version, options) => {\n const v = parse(version, options)\n return v ? v.version : null\n}\nmodule.exports = valid\n","// just pre-load all the stuff that index.js lazily exports\nconst internalRe = require('./internal/re')\nmodule.exports = {\n re: internalRe.re,\n src: internalRe.src,\n tokens: internalRe.t,\n SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION,\n SemVer: require('./classes/semver'),\n compareIdentifiers: require('./internal/identifiers').compareIdentifiers,\n rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers,\n parse: require('./functions/parse'),\n valid: require('./functions/valid'),\n clean: require('./functions/clean'),\n inc: require('./functions/inc'),\n diff: require('./functions/diff'),\n major: require('./functions/major'),\n minor: require('./functions/minor'),\n patch: require('./functions/patch'),\n prerelease: require('./functions/prerelease'),\n compare: require('./functions/compare'),\n rcompare: require('./functions/rcompare'),\n compareLoose: require('./functions/compare-loose'),\n compareBuild: require('./functions/compare-build'),\n sort: require('./functions/sort'),\n rsort: require('./functions/rsort'),\n gt: require('./functions/gt'),\n lt: require('./functions/lt'),\n eq: require('./functions/eq'),\n neq: require('./functions/neq'),\n gte: require('./functions/gte'),\n lte: require('./functions/lte'),\n cmp: require('./functions/cmp'),\n coerce: require('./functions/coerce'),\n Comparator: require('./classes/comparator'),\n Range: require('./classes/range'),\n satisfies: require('./functions/satisfies'),\n toComparators: require('./ranges/to-comparators'),\n maxSatisfying: require('./ranges/max-satisfying'),\n minSatisfying: require('./ranges/min-satisfying'),\n minVersion: require('./ranges/min-version'),\n validRange: require('./ranges/valid'),\n outside: require('./ranges/outside'),\n gtr: require('./ranges/gtr'),\n ltr: require('./ranges/ltr'),\n intersects: require('./ranges/intersects'),\n simplifyRange: require('./ranges/simplify'),\n subset: require('./ranges/subset'),\n}\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\nmodule.exports = {\n SEMVER_SPEC_VERSION,\n MAX_LENGTH,\n MAX_SAFE_INTEGER,\n MAX_SAFE_COMPONENT_LENGTH\n}\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers\n}\n","// parse out just the options we care about so we always get a consistent\n// obj with keys in a consistent order.\nconst opts = ['includePrerelease', 'loose', 'rtl']\nconst parseOptions = options =>\n !options ? {}\n : typeof options !== 'object' ? { loose: true }\n : opts.filter(k => options[k]).reduce((options, k) => {\n options[k] = true\n return options\n }, {})\nmodule.exports = parseOptions\n","const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst createToken = (name, value, isGlobal) => {\n const index = R++\n debug(index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '[0-9]+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*')\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCE', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\.0\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\.0\\.0-0\\\\s*$')\n","// Determine if version is greater than all the versions possible in the range.\nconst outside = require('./outside')\nconst gtr = (version, range, options) => outside(version, range, '>', options)\nmodule.exports = gtr\n","const Range = require('../classes/range')\nconst intersects = (r1, r2, options) => {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2)\n}\nmodule.exports = intersects\n","const outside = require('./outside')\n// Determine if version is less than all the versions possible in the range\nconst ltr = (version, range, options) => outside(version, range, '<', options)\nmodule.exports = ltr\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\n\nconst maxSatisfying = (versions, range, options) => {\n let max = null\n let maxSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\nmodule.exports = maxSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst minSatisfying = (versions, range, options) => {\n let min = null\n let minSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\nmodule.exports = minSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst gt = require('../functions/gt')\n\nconst minVersion = (range, loose) => {\n range = new Range(range, loose)\n\n let minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let setMin = null\n comparators.forEach((comparator) => {\n // Clone to avoid manipulating the comparator's semver object.\n const compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!setMin || gt(compver, setMin)) {\n setMin = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error(`Unexpected operation: ${comparator.operator}`)\n }\n })\n if (setMin && (!minver || gt(minver, setMin)))\n minver = setMin\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\nmodule.exports = minVersion\n","const SemVer = require('../classes/semver')\nconst Comparator = require('../classes/comparator')\nconst {ANY} = Comparator\nconst Range = require('../classes/range')\nconst satisfies = require('../functions/satisfies')\nconst gt = require('../functions/gt')\nconst lt = require('../functions/lt')\nconst lte = require('../functions/lte')\nconst gte = require('../functions/gte')\n\nconst outside = (version, range, hilo, options) => {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n let gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisfies the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let high = null\n let low = null\n\n comparators.forEach((comparator) => {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nmodule.exports = outside\n","// given a set of versions and a range, create a \"simplified\" range\n// that includes the same versions that the original range does\n// If the original range is shorter than the simplified one, return that.\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\nmodule.exports = (versions, range, options) => {\n const set = []\n let min = null\n let prev = null\n const v = versions.sort((a, b) => compare(a, b, options))\n for (const version of v) {\n const included = satisfies(version, range, options)\n if (included) {\n prev = version\n if (!min)\n min = version\n } else {\n if (prev) {\n set.push([min, prev])\n }\n prev = null\n min = null\n }\n }\n if (min)\n set.push([min, null])\n\n const ranges = []\n for (const [min, max] of set) {\n if (min === max)\n ranges.push(min)\n else if (!max && min === v[0])\n ranges.push('*')\n else if (!max)\n ranges.push(`>=${min}`)\n else if (min === v[0])\n ranges.push(`<=${max}`)\n else\n ranges.push(`${min} - ${max}`)\n }\n const simplified = ranges.join(' || ')\n const original = typeof range.raw === 'string' ? range.raw : String(range)\n return simplified.length < original.length ? simplified : range\n}\n","const Range = require('../classes/range.js')\nconst Comparator = require('../classes/comparator.js')\nconst { ANY } = Comparator\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\n\n// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:\n// - Every simple range `r1, r2, ...` is a null set, OR\n// - Every simple range `r1, r2, ...` which is not a null set is a subset of\n// some `R1, R2, ...`\n//\n// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:\n// - If c is only the ANY comparator\n// - If C is only the ANY comparator, return true\n// - Else if in prerelease mode, return false\n// - else replace c with `[>=0.0.0]`\n// - If C is only the ANY comparator\n// - if in prerelease mode, return true\n// - else replace C with `[>=0.0.0]`\n// - Let EQ be the set of = comparators in c\n// - If EQ is more than one, return true (null set)\n// - Let GT be the highest > or >= comparator in c\n// - Let LT be the lowest < or <= comparator in c\n// - If GT and LT, and GT.semver > LT.semver, return true (null set)\n// - If any C is a = range, and GT or LT are set, return false\n// - If EQ\n// - If GT, and EQ does not satisfy GT, return true (null set)\n// - If LT, and EQ does not satisfy LT, return true (null set)\n// - If EQ satisfies every C, return true\n// - Else return false\n// - If GT\n// - If GT.semver is lower than any > or >= comp in C, return false\n// - If GT is >=, and GT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the GT.semver tuple, return false\n// - If LT\n// - If LT.semver is greater than any < or <= comp in C, return false\n// - If LT is <=, and LT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the LT.semver tuple, return false\n// - Else return true\n\nconst subset = (sub, dom, options = {}) => {\n if (sub === dom)\n return true\n\n sub = new Range(sub, options)\n dom = new Range(dom, options)\n let sawNonNull = false\n\n OUTER: for (const simpleSub of sub.set) {\n for (const simpleDom of dom.set) {\n const isSub = simpleSubset(simpleSub, simpleDom, options)\n sawNonNull = sawNonNull || isSub !== null\n if (isSub)\n continue OUTER\n }\n // the null set is a subset of everything, but null simple ranges in\n // a complex range should be ignored. so if we saw a non-null range,\n // then we know this isn't a subset, but if EVERY simple range was null,\n // then it is a subset.\n if (sawNonNull)\n return false\n }\n return true\n}\n\nconst simpleSubset = (sub, dom, options) => {\n if (sub === dom)\n return true\n\n if (sub.length === 1 && sub[0].semver === ANY) {\n if (dom.length === 1 && dom[0].semver === ANY)\n return true\n else if (options.includePrerelease)\n sub = [ new Comparator('>=0.0.0-0') ]\n else\n sub = [ new Comparator('>=0.0.0') ]\n }\n\n if (dom.length === 1 && dom[0].semver === ANY) {\n if (options.includePrerelease)\n return true\n else\n dom = [ new Comparator('>=0.0.0') ]\n }\n\n const eqSet = new Set()\n let gt, lt\n for (const c of sub) {\n if (c.operator === '>' || c.operator === '>=')\n gt = higherGT(gt, c, options)\n else if (c.operator === '<' || c.operator === '<=')\n lt = lowerLT(lt, c, options)\n else\n eqSet.add(c.semver)\n }\n\n if (eqSet.size > 1)\n return null\n\n let gtltComp\n if (gt && lt) {\n gtltComp = compare(gt.semver, lt.semver, options)\n if (gtltComp > 0)\n return null\n else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<='))\n return null\n }\n\n // will iterate one or zero times\n for (const eq of eqSet) {\n if (gt && !satisfies(eq, String(gt), options))\n return null\n\n if (lt && !satisfies(eq, String(lt), options))\n return null\n\n for (const c of dom) {\n if (!satisfies(eq, String(c), options))\n return false\n }\n\n return true\n }\n\n let higher, lower\n let hasDomLT, hasDomGT\n // if the subset has a prerelease, we need a comparator in the superset\n // with the same tuple and a prerelease, or it's not a subset\n let needDomLTPre = lt &&\n !options.includePrerelease &&\n lt.semver.prerelease.length ? lt.semver : false\n let needDomGTPre = gt &&\n !options.includePrerelease &&\n gt.semver.prerelease.length ? gt.semver : false\n // exception: <1.2.3-0 is the same as <1.2.3\n if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&\n lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {\n needDomLTPre = false\n }\n\n for (const c of dom) {\n hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='\n hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='\n if (gt) {\n if (needDomGTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomGTPre.major &&\n c.semver.minor === needDomGTPre.minor &&\n c.semver.patch === needDomGTPre.patch) {\n needDomGTPre = false\n }\n }\n if (c.operator === '>' || c.operator === '>=') {\n higher = higherGT(gt, c, options)\n if (higher === c && higher !== gt)\n return false\n } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options))\n return false\n }\n if (lt) {\n if (needDomLTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomLTPre.major &&\n c.semver.minor === needDomLTPre.minor &&\n c.semver.patch === needDomLTPre.patch) {\n needDomLTPre = false\n }\n }\n if (c.operator === '<' || c.operator === '<=') {\n lower = lowerLT(lt, c, options)\n if (lower === c && lower !== lt)\n return false\n } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options))\n return false\n }\n if (!c.operator && (lt || gt) && gtltComp !== 0)\n return false\n }\n\n // if there was a < or >, and nothing in the dom, then must be false\n // UNLESS it was limited by another range in the other direction.\n // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0\n if (gt && hasDomLT && !lt && gtltComp !== 0)\n return false\n\n if (lt && hasDomGT && !gt && gtltComp !== 0)\n return false\n\n // we needed a prerelease range in a specific tuple, but didn't get one\n // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,\n // because it includes prereleases in the 1.2.3 tuple\n if (needDomGTPre || needDomLTPre)\n return false\n\n return true\n}\n\n// >=1.2.3 is lower than >1.2.3\nconst higherGT = (a, b, options) => {\n if (!a)\n return b\n const comp = compare(a.semver, b.semver, options)\n return comp > 0 ? a\n : comp < 0 ? b\n : b.operator === '>' && a.operator === '>=' ? b\n : a\n}\n\n// <=1.2.3 is higher than <1.2.3\nconst lowerLT = (a, b, options) => {\n if (!a)\n return b\n const comp = compare(a.semver, b.semver, options)\n return comp < 0 ? a\n : comp > 0 ? b\n : b.operator === '<' && a.operator === '<=' ? b\n : a\n}\n\nmodule.exports = subset\n","const Range = require('../classes/range')\n\n// Mostly just for testing and legacy API reasons\nconst toComparators = (range, options) =>\n new Range(range, options).set\n .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))\n\nmodule.exports = toComparators\n","const Range = require('../classes/range')\nconst validRange = (range, options) => {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\nmodule.exports = validRange\n","const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n",null,"const { promisify } = require('util')\nconst path = require('path')\n\nconst getName = require('@npmcli/name-from-folder')\nconst minimatch = require('minimatch')\nconst rpj = require('read-package-json-fast')\nconst glob = require('glob')\nconst pGlob = promisify(glob)\n\nfunction appendNegatedPatterns (patterns) {\n const results = []\n for (let pattern of patterns) {\n const excl = pattern.match(/^!+/)\n if (excl) {\n pattern = pattern.substr(excl[0].length)\n }\n\n // strip off any / from the start of the pattern. /foo => foo\n pattern = pattern.replace(/^\\/+/, '')\n\n // an odd number of ! means a negated pattern. !!foo ==> foo\n const negate = excl && excl[0].length % 2 === 1\n results.push({ pattern, negate })\n }\n\n return results\n}\n\nfunction getPatterns (workspaces) {\n const workspacesDeclaration =\n Array.isArray(workspaces.packages)\n ? workspaces.packages\n : workspaces\n\n if (!Array.isArray(workspacesDeclaration)) {\n throw getError({\n message: 'workspaces config expects an Array',\n code: 'EWORKSPACESCONFIG'\n })\n }\n\n return [\n ...appendNegatedPatterns(workspacesDeclaration),\n { pattern: '**/node_modules/**', negate: true }\n ]\n}\n\nfunction isEmpty (patterns) {\n return patterns.length < 2\n}\n\nfunction getPackageName (pkg, pathname) {\n const { name } = pkg\n return name || getName(pathname)\n}\n\nfunction pkgPathmame (opts) {\n return (...args) => {\n const cwd = opts.cwd ? opts.cwd : process.cwd()\n return path.join.apply(null, [cwd, ...args])\n }\n}\n\n// make sure glob pattern only matches folders\nfunction getGlobPattern (pattern) {\n return pattern.endsWith('/')\n ? pattern\n : `${pattern}/`\n}\n\nfunction getError ({ Type = TypeError, message, code }) {\n return Object.assign(new Type(message), { code })\n}\n\nfunction reverseResultMap (map) {\n return new Map(Array.from(map, item => item.reverse()))\n}\n\nasync function mapWorkspaces (opts = {}) {\n if (!opts || !opts.pkg) {\n throw getError({\n message: 'mapWorkspaces missing pkg info',\n code: 'EMAPWORKSPACESPKG'\n })\n }\n\n const { workspaces = [] } = opts.pkg\n const patterns = getPatterns(workspaces)\n const results = new Map()\n const seen = new Map()\n\n if (isEmpty(patterns)) {\n return results\n }\n\n const getGlobOpts = () => ({\n ...opts,\n ignore: [\n ...opts.ignore || [],\n ...['**/node_modules/**']\n ]\n })\n\n const getPackagePathname = pkgPathmame(opts)\n\n for (const item of patterns) {\n const matches = await pGlob(getGlobPattern(item.pattern), getGlobOpts())\n\n for (const match of matches) {\n let pkg\n const packageJsonPathname = getPackagePathname(match, 'package.json')\n const packagePathname = path.dirname(packageJsonPathname)\n\n try {\n pkg = await rpj(packageJsonPathname)\n } catch (err) {\n if (err.code === 'ENOENT') {\n continue\n } else {\n throw err\n }\n }\n\n const name = getPackageName(pkg, packagePathname)\n\n if (item.negate) {\n results.delete(packagePathname, name)\n } else {\n if (seen.has(name) && seen.get(name) !== packagePathname) {\n throw getError({\n Type: Error,\n message: 'must not have multiple workspaces with the same name',\n code: 'EDUPLICATEWORKSPACE'\n })\n }\n\n seen.set(name, packagePathname)\n results.set(packagePathname, name)\n }\n }\n }\n\n return reverseResultMap(results)\n}\n\nmapWorkspaces.virtual = function (opts = {}) {\n if (!opts || !opts.lockfile) {\n throw getError({\n message: 'mapWorkspaces.virtual missing lockfile info',\n code: 'EMAPWORKSPACESLOCKFILE'\n })\n }\n\n const { packages = {} } = opts.lockfile\n const { workspaces = [] } = packages[''] || {}\n const patterns = getPatterns(workspaces)\n\n // uses a pathname-keyed map in order to negate the exact items\n const results = new Map()\n\n if (isEmpty(patterns)) {\n return results\n }\n\n const getPackagePathname = pkgPathmame(opts)\n\n for (const packageKey of Object.keys(packages)) {\n if (packageKey === '') {\n continue\n }\n\n for (const item of patterns) {\n if (minimatch(packageKey, item.pattern)) {\n const packagePathname = getPackagePathname(packageKey)\n const name = getPackageName(packages[packageKey], packagePathname)\n\n if (item.negate) {\n results.delete(packagePathname)\n } else {\n results.set(packagePathname, name)\n }\n }\n }\n }\n\n // Invert pathname-keyed to a proper name-to-pathnames Map\n return reverseResultMap(results)\n}\n\nmodule.exports = mapWorkspaces\n","const hash = require('./hash.js')\nconst semver = require('semver')\nconst semverOpt = { includePrerelease: true, loose: true }\nconst getDepSpec = require('./get-dep-spec.js')\n\n// any fields that we don't want in the cache need to be hidden\nconst _source = Symbol('source')\nconst _packument = Symbol('packument')\nconst _versionVulnMemo = Symbol('versionVulnMemo')\nconst _updated = Symbol('updated')\nconst _options = Symbol('options')\nconst _specVulnMemo = Symbol('specVulnMemo')\nconst _testVersion = Symbol('testVersion')\nconst _testVersions = Symbol('testVersions')\nconst _calculateRange = Symbol('calculateRange')\nconst _markVulnerable = Symbol('markVulnerable')\nconst _testSpec = Symbol('testSpec')\n\nclass Advisory {\n constructor (name, source, options = {}) {\n this.source = source.id\n this[_source] = source\n this[_options] = options\n this.name = name\n if (!source.name)\n source.name = name\n\n this.dependency = source.name\n\n if (this.type === 'advisory') {\n this.title = source.title\n this.url = source.url\n } else {\n this.title = `Depends on vulnerable versions of ${source.name}`\n this.url = null\n }\n\n this.severity = source.severity || 'high'\n this.versions = []\n this.vulnerableVersions = []\n\n // advisories have the range, metavulns do not\n // if an advisory doesn't specify range, assume all are vulnerable\n this.range = this.type === 'advisory' ? source.vulnerable_versions || '*'\n : null\n\n this.id = hash(this)\n\n this[_packument] = null\n // memoized list of which versions are vulnerable\n this[_versionVulnMemo] = new Map()\n // memoized list of which dependency specs are vulnerable\n this[_specVulnMemo] = new Map()\n this[_updated] = false\n }\n\n // true if we updated from what we had in cache\n get updated () {\n return this[_updated]\n }\n\n get type () {\n return this.dependency === this.name ? 'advisory' : 'metavuln'\n }\n\n get packument () {\n return this[_packument]\n }\n\n // load up the data from a cache entry and a fetched packument\n load (cached, packument) {\n // basic data integrity gutcheck\n if (!cached || typeof cached !== 'object')\n throw new TypeError('invalid cached data, expected object')\n\n if (!packument || typeof packument !== 'object')\n throw new TypeError('invalid packument data, expected object')\n\n if (cached.id && cached.id !== this.id) {\n throw Object.assign(new Error('loading from incorrect cache entry'), {\n expected: this.id,\n actual: cached.id,\n })\n }\n if (packument.name !== this.name) {\n throw Object.assign(new Error('loading from incorrect packument'), {\n expected: this.name,\n actual: packument.name,\n })\n }\n if (this[_packument])\n throw new Error('advisory object already loaded')\n\n // if we have a range from the initialization, and the cached\n // data has a *different* range, then we know we have to recalc.\n // just don't use the cached data, so we will definitely not match later\n if (!this.range || cached.range && cached.range === this.range)\n Object.assign(this, cached)\n\n this[_packument] = packument\n\n const pakuVersions = Object.keys(packument.versions)\n const allVersions = new Set([...pakuVersions, ...this.versions])\n const versionsAdded = []\n const versionsRemoved = []\n for (const v of allVersions) {\n if (!this.versions.includes(v)) {\n versionsAdded.push(v)\n this.versions.push(v)\n } else if (!pakuVersions.includes(v))\n versionsRemoved.push(v)\n }\n\n // strip out any removed versions from our lists, and sort by semver\n this.versions = semver.sort(this.versions.filter(v =>\n !versionsRemoved.includes(v)), semverOpt)\n\n // if no changes, then just return what we got from cache\n // versions added or removed always means we changed\n // otherwise, advisories change if the range changes, and\n // metavulns change if the source was updated\n const unchanged = this.type === 'advisory'\n ? this.range && this.range === cached.range\n : !this[_source].updated\n\n // if the underlying source changed, by an advisory updating the\n // range, or a source advisory being updated, then we have to re-check\n // otherwise, only recheck the new ones.\n this.vulnerableVersions = !unchanged ? []\n : semver.sort(this.vulnerableVersions.filter(v =>\n !versionsRemoved.includes(v)), semverOpt)\n\n if (unchanged && !versionsAdded.length && !versionsRemoved.length) {\n // nothing added or removed, nothing to do here. use the cached copy.\n return this\n }\n\n this[_updated] = true\n\n // test any versions newly added\n if (!unchanged || versionsAdded.length)\n this[_testVersions](unchanged ? versionsAdded : this.versions)\n this.vulnerableVersions = semver.sort(this.vulnerableVersions, semverOpt)\n\n // metavulns have to calculate their range, since cache is invalidated\n // advisories just get their range from the advisory above\n if (this.type === 'metavuln')\n this[_calculateRange]()\n\n return this\n }\n\n [_calculateRange] () {\n // calling semver.simplifyRange with a massive list of versions, and those\n // versions all concatenated with `||` is a geometric CPU explosion!\n // we can try to be a *little* smarter up front by doing x-y for all\n // contiguous version sets in the list\n const ranges = []\n this.versions = semver.sort(this.versions)\n this.vulnerableVersions = semver.sort(this.vulnerableVersions)\n for (let v = 0, vulnVer = 0; v < this.versions.length; v++) {\n // figure out the vulnerable subrange\n const vr = [this.versions[v]]\n while (v < this.versions.length) {\n if (this.versions[v] !== this.vulnerableVersions[vulnVer]) {\n // we don't test prerelease versions, so just skip past it\n if (/-/.test(this.versions[v])) {\n v++\n continue\n }\n break\n }\n if (vr.length > 1)\n vr[1] = this.versions[v]\n else\n vr.push(this.versions[v])\n v++\n vulnVer++\n }\n // it'll either be just the first version, which means no overlap,\n // or the start and end versions, which might be the same version\n if (vr.length > 1) {\n const tail = this.versions[this.versions.length - 1]\n ranges.push(vr[1] === tail ? `>=${vr[0]}`\n : vr[0] === vr[1] ? vr[0]\n : vr.join(' - '))\n }\n }\n const metavuln = ranges.join(' || ').trim()\n this.range = !metavuln ? '<0.0.0-0'\n : semver.simplifyRange(this.versions, metavuln, semverOpt)\n }\n\n // returns true if marked as vulnerable, false if ok\n // spec is a dependency specifier, for metavuln cases\n // where the version might not be in the packument. if\n // we have the packument and spec is not provided, then\n // we use the dependency version from the manifest.\n testVersion (version, spec = null) {\n const sv = String(version)\n if (this[_versionVulnMemo].has(sv))\n return this[_versionVulnMemo].get(sv)\n\n const result = this[_testVersion](version, spec)\n if (result)\n this[_markVulnerable](version)\n this[_versionVulnMemo].set(sv, !!result)\n return result\n }\n\n [_markVulnerable] (version) {\n const sv = String(version)\n if (!this.vulnerableVersions.includes(sv))\n this.vulnerableVersions.push(sv)\n }\n\n [_testVersion] (version, spec) {\n const sv = String(version)\n if (this.vulnerableVersions.includes(sv))\n return true\n\n if (this.type === 'advisory') {\n // advisory, just test range\n return semver.satisfies(version, this.range, semverOpt)\n }\n\n // check the dependency of this version on the vulnerable dep\n // if we got a version that's not in the packument, fall back on\n // the spec provided, if possible.\n const mani = this[_packument].versions[version] || {\n dependencies: {\n [this.dependency]: spec,\n },\n }\n\n if (!spec)\n spec = getDepSpec(mani, this.dependency)\n\n // no dep, no vuln\n if (spec === null)\n return false\n\n if (!semver.validRange(spec, semverOpt)) {\n // not a semver range, nothing we can hope to do about it\n return true\n }\n\n const bd = mani.bundleDependencies\n const bundled = bd && bd.includes(this[_source].name)\n // XXX if bundled, then semver.intersects() means vulnerable\n // else, pick a manifest and see if it can't be avoided\n // try to pick a version of the dep that isn't vulnerable\n const avoid = this[_source].range\n\n if (bundled)\n return semver.intersects(spec, avoid, semverOpt)\n\n return this[_source].testSpec(spec)\n }\n\n testSpec (spec) {\n // testing all the versions is a bit costly, and the spec tends to stay\n // consistent across multiple versions, so memoize this as well, in case\n // we're testing lots of versions.\n const memo = this[_specVulnMemo]\n if (memo.has(spec))\n return memo.get(spec)\n\n const res = this[_testSpec](spec)\n memo.set(spec, res)\n return res\n }\n\n [_testSpec] (spec) {\n for (const v of this.versions) {\n const satisfies = semver.satisfies(v, spec)\n if (!satisfies)\n continue\n if (!this.testVersion(v))\n return false\n }\n // either vulnerable, or not installable because nothing satisfied\n // either way, best avoided.\n return true\n }\n\n [_testVersions] (versions) {\n if (!versions.length)\n return\n\n // set of lists of versions\n const versionSets = new Set()\n versions = semver.sort(versions.map(v => semver.parse(v, semverOpt)))\n\n // start out with the versions grouped by major and minor\n let last = versions[0].major + '.' + versions[0].minor\n let list = []\n versionSets.add(list)\n for (const v of versions) {\n const k = v.major + '.' + v.minor\n if (k !== last) {\n last = k\n list = []\n versionSets.add(list)\n }\n list.push(v)\n }\n\n for (const list of versionSets) {\n // it's common to have version lists like:\n // 1.0.0\n // 1.0.1-alpha.0\n // 1.0.1-alpha.1\n // ...\n // 1.0.1-alpha.999\n // 1.0.1\n // 1.0.2-alpha.0\n // ...\n // 1.0.2-alpha.99\n // 1.0.2\n // with a huge number of prerelease versions that are not installable\n // anyway.\n // If mid has a prerelease tag, and list[0] does not, then walk it\n // back until we hit a non-prerelease version\n // If mid has a prerelease tag, and list[list.length-1] does not,\n // then walk it forward until we hit a version without a prerelease tag\n // Similarly, if the head/tail is a prerelease, but there is a non-pr\n // version in the list, then start there instead.\n let h = 0\n const origHeadVuln = this.testVersion(list[h])\n while (h < list.length && /-/.test(String(list[h])))\n h++\n\n // don't filter out the whole list! they might all be pr's\n if (h === list.length)\n h = 0\n else if (origHeadVuln) {\n // if the original was vulnerable, assume so are all of these\n for (let hh = 0; hh < h; hh++)\n this[_markVulnerable](list[hh])\n }\n\n let t = list.length - 1\n const origTailVuln = this.testVersion(list[t])\n while (t > h && /-/.test(String(list[t])))\n t--\n\n // don't filter out the whole list! might all be pr's\n if (t === h)\n t = list.length - 1\n else if (origTailVuln) {\n // if original tail was vulnerable, assume these are as well\n for (let tt = list.length - 1; tt > t; tt--)\n this[_markVulnerable](list[tt])\n }\n\n const headVuln = h === 0 ? origHeadVuln\n : this.testVersion(list[h])\n\n const tailVuln = t === list.length - 1 ? origTailVuln\n : this.testVersion(list[t])\n\n // if head and tail both vulnerable, whole list is thrown out\n if (headVuln && tailVuln) {\n for (let v = h; v < t; v++)\n this[_markVulnerable](list[v])\n continue\n }\n\n // if length is 2 or 1, then we marked them all already\n if (t < h + 2)\n continue\n\n const mid = Math.floor(list.length / 2)\n const pre = list.slice(0, mid)\n const post = list.slice(mid)\n\n // if the parent list wasn't prereleases, then drop pr tags\n // from end of the pre list, and beginning of the post list,\n // marking as vulnerable if the midpoint item we picked is.\n if (!/-/.test(String(pre[0]))) {\n const midVuln = this.testVersion(pre[pre.length - 1])\n while (/-/.test(String(pre[pre.length - 1]))) {\n const v = pre.pop()\n if (midVuln)\n this[_markVulnerable](v)\n }\n }\n\n if (!/-/.test(String(post[post.length - 1]))) {\n const midVuln = this.testVersion(post[0])\n while (/-/.test(String(post[0]))) {\n const v = post.shift()\n if (midVuln)\n this[_markVulnerable](v)\n }\n }\n\n versionSets.add(pre)\n versionSets.add(post)\n }\n }\n}\n\nmodule.exports = Advisory\n","module.exports = (mani, name) => {\n // skip dev because that only matters at the root,\n // where we aren't fetching a manifest from the registry\n // with multiple versions anyway.\n const {\n dependencies: deps = {},\n optionalDependencies: optDeps = {},\n peerDependencies: peerDeps = {},\n } = mani\n\n return deps && typeof deps[name] === 'string' ? deps[name]\n : optDeps && typeof optDeps[name] === 'string' ? optDeps[name]\n : peerDeps && typeof peerDeps[name] === 'string' ? peerDeps[name]\n : null\n}\n","const {createHash} = require('crypto')\n\nmodule.exports = ({name, source}) => createHash('sha512')\n .update(JSON.stringify([name, source]))\n .digest('base64')\n","// this is the public class that is used by consumers.\n// the Advisory class handles all the calculation, and this\n// class handles all the IO with the registry and cache.\nconst pacote = require('pacote')\nconst cacache = require('cacache')\nconst Advisory = require('./advisory.js')\nconst {homedir} = require('os')\nconst jsonParse = require('json-parse-even-better-errors')\n\nconst _packument = Symbol('packument')\nconst _cachePut = Symbol('cachePut')\nconst _cacheGet = Symbol('cacheGet')\nconst _cacheData = Symbol('cacheData')\nconst _packuments = Symbol('packuments')\nconst _cache = Symbol('cache')\nconst _options = Symbol('options')\nconst _advisories = Symbol('advisories')\nconst _calculate = Symbol('calculate')\n\nclass Calculator {\n constructor (options = {}) {\n this[_options] = { ...options }\n this[_cache] = this[_options].cache || (homedir() + '/.npm/_cacache')\n this[_options].cache = this[_cache]\n this[_packuments] = new Map()\n this[_cacheData] = new Map()\n this[_advisories] = new Map()\n }\n\n get cache () {\n return this[_cache]\n }\n\n get options () {\n return { ...this[_options] }\n }\n\n async calculate (name, source) {\n const k = `security-advisory:${name}:${source.id}`\n if (this[_advisories].has(k))\n return this[_advisories].get(k)\n\n const p = this[_calculate](name, source)\n this[_advisories].set(k, p)\n return p\n }\n\n async [_calculate] (name, source) {\n const k = `security-advisory:${name}:${source.id}`\n const t = `metavuln:calculate:${k}`\n process.emit('time', t)\n const advisory = new Advisory(name, source, this[_options])\n // load packument and cached advisory\n const [cached, packument] = await Promise.all([\n this[_cacheGet](advisory),\n this[_packument](name),\n ])\n process.emit('time', `metavuln:load:${k}`)\n advisory.load(cached, packument)\n process.emit('timeEnd', `metavuln:load:${k}`)\n if (advisory.updated)\n await this[_cachePut](advisory)\n this[_advisories].set(k, advisory)\n process.emit('timeEnd', t)\n return advisory\n }\n\n async [_cachePut] (advisory) {\n const { name, id } = advisory\n const key = `security-advisory:${name}:${id}`\n process.emit('time', `metavuln:cache:put:${key}`)\n const data = JSON.stringify(advisory)\n const options = { ...this[_options] }\n this[_cacheData].set(key, jsonParse(data))\n await cacache.put(this[_cache], key, data, options).catch(() => {})\n process.emit('timeEnd', `metavuln:cache:put:${key}`)\n }\n\n async [_cacheGet] (advisory) {\n const { name, id } = advisory\n const key = `security-advisory:${name}:${id}`\n /* istanbul ignore if - should be impossible, since we memoize the\n * advisory object itself using the same key, just being cautious */\n if (this[_cacheData].has(key))\n return this[_cacheData].get(key)\n\n process.emit('time', `metavuln:cache:get:${key}`)\n const p = cacache.get(this[_cache], key, { ...this[_options] })\n .catch(() => ({ data: '{}' }))\n .then(({ data }) => {\n data = jsonParse(data)\n process.emit('timeEnd', `metavuln:cache:get:${key}`)\n this[_cacheData].set(key, data)\n return data\n })\n this[_cacheData].set(key, p)\n return p\n }\n\n async [_packument] (name) {\n if (this[_packuments].has(name))\n return this[_packuments].get(name)\n\n process.emit('time', `metavuln:packument:${name}`)\n const p = pacote.packument(name, { ...this[_options] })\n .catch((er) => {\n // presumably not something from the registry.\n // an empty packument will have an effective range of *\n return {\n name,\n versions: {},\n }\n })\n .then(paku => {\n process.emit('timeEnd', `metavuln:packument:${name}`)\n this[_packuments].set(name, paku)\n return paku\n })\n this[_packuments].set(name, p)\n return p\n }\n}\n\nmodule.exports = Calculator\n","const ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n const sameDirectionIncreasing =\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '>=' || comp.operator === '>')\n const sameDirectionDecreasing =\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '<=' || comp.operator === '<')\n const sameSemVer = this.semver.version === comp.semver.version\n const differentDirectionsInclusive =\n (this.operator === '>=' || this.operator === '<=') &&\n (comp.operator === '>=' || comp.operator === '<=')\n const oppositeDirectionsLessThan =\n cmp(this.semver, '<', comp.semver, options) &&\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '<=' || comp.operator === '<')\n const oppositeDirectionsGreaterThan =\n cmp(this.semver, '>', comp.semver, options) &&\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '>=' || comp.operator === '>')\n\n return (\n sameDirectionIncreasing ||\n sameDirectionDecreasing ||\n (sameSemVer && differentDirectionsInclusive) ||\n oppositeDirectionsLessThan ||\n oppositeDirectionsGreaterThan\n )\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst {re, t} = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.format()\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First, split based on boolean or ||\n this.raw = range\n this.set = range\n .split(/\\s*\\|\\|\\s*/)\n // map the range to a 2d array of comparators\n .map(range => this.parseRange(range.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${range}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0)\n this.set = [first]\n else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.format()\n }\n\n format () {\n this.range = this.set\n .map((comps) => {\n return comps.join(' ').trim()\n })\n .join('||')\n .trim()\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n range = range.trim()\n\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts = Object.keys(this.options).join(',')\n const memoKey = `parseRange:${memoOpts}:${range}`\n const cached = cache.get(memoKey)\n if (cached)\n return cached\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range, re[t.COMPARATORTRIM])\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n\n // normalize spaces\n range = range.split(/\\s+/).join(' ')\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n // in loose mode, throw out any that are not valid comparators\n .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true)\n .map(comp => new Comparator(comp, this.options))\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const l = rangeList.length\n const rangeMap = new Map()\n for (const comp of rangeList) {\n if (isNullSet(comp))\n return [comp]\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has(''))\n rangeMap.delete('')\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\nmodule.exports = Range\n\nconst LRU = require('lru-cache')\nconst cache = new LRU({ max: 1000 })\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace\n} = require('../internal/re')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\nconst replaceTildes = (comp, options) =>\n comp.trim().split(/\\s+/).map((comp) => {\n return replaceTilde(comp, options)\n }).join(' ')\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\nconst replaceCarets = (comp, options) =>\n comp.trim().split(/\\s+/).map((comp) => {\n return replaceCaret(comp, options)\n }).join(' ')\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp.split(/\\s+/).map((comp) => {\n return replaceXRange(comp, options)\n }).join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<')\n pr = '-0'\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp.trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return (`${from} ${to}`).trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }\n}\n\nmodule.exports = SemVer\n","const parse = require('./parse')\nconst clean = (version, options) => {\n const s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\nmodule.exports = clean\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst {re, t} = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n let next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null)\n return null\n\n return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)\n}\nmodule.exports = coerce\n","const SemVer = require('../classes/semver')\nconst compareBuild = (a, b, loose) => {\n const versionA = new SemVer(a, loose)\n const versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\nmodule.exports = compareBuild\n","const compare = require('./compare')\nconst compareLoose = (a, b) => compare(a, b, true)\nmodule.exports = compareLoose\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const parse = require('./parse')\nconst eq = require('./eq')\n\nconst diff = (version1, version2) => {\n if (eq(version1, version2)) {\n return null\n } else {\n const v1 = parse(version1)\n const v2 = parse(version2)\n const hasPre = v1.prerelease.length || v2.prerelease.length\n const prefix = hasPre ? 'pre' : ''\n const defaultResult = hasPre ? 'prerelease' : ''\n for (const key in v1) {\n if (key === 'major' || key === 'minor' || key === 'patch') {\n if (v1[key] !== v2[key]) {\n return prefix + key\n }\n }\n }\n return defaultResult // may be undefined\n }\n}\nmodule.exports = diff\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const SemVer = require('../classes/semver')\n\nconst inc = (version, release, options, identifier) => {\n if (typeof (options) === 'string') {\n identifier = options\n options = undefined\n }\n\n try {\n return new SemVer(version, options).inc(release, identifier).version\n } catch (er) {\n return null\n }\n}\nmodule.exports = inc\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const SemVer = require('../classes/semver')\nconst major = (a, loose) => new SemVer(a, loose).major\nmodule.exports = major\n","const SemVer = require('../classes/semver')\nconst minor = (a, loose) => new SemVer(a, loose).minor\nmodule.exports = minor\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const {MAX_LENGTH} = require('../internal/constants')\nconst { re, t } = require('../internal/re')\nconst SemVer = require('../classes/semver')\n\nconst parseOptions = require('../internal/parse-options')\nconst parse = (version, options) => {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n const r = options.loose ? re[t.LOOSE] : re[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nmodule.exports = parse\n","const SemVer = require('../classes/semver')\nconst patch = (a, loose) => new SemVer(a, loose).patch\nmodule.exports = patch\n","const parse = require('./parse')\nconst prerelease = (version, options) => {\n const parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\nmodule.exports = prerelease\n","const compare = require('./compare')\nconst rcompare = (a, b, loose) => compare(b, a, loose)\nmodule.exports = rcompare\n","const compareBuild = require('./compare-build')\nconst rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))\nmodule.exports = rsort\n","const Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","const compareBuild = require('./compare-build')\nconst sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))\nmodule.exports = sort\n","const parse = require('./parse')\nconst valid = (version, options) => {\n const v = parse(version, options)\n return v ? v.version : null\n}\nmodule.exports = valid\n","// just pre-load all the stuff that index.js lazily exports\nconst internalRe = require('./internal/re')\nmodule.exports = {\n re: internalRe.re,\n src: internalRe.src,\n tokens: internalRe.t,\n SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION,\n SemVer: require('./classes/semver'),\n compareIdentifiers: require('./internal/identifiers').compareIdentifiers,\n rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers,\n parse: require('./functions/parse'),\n valid: require('./functions/valid'),\n clean: require('./functions/clean'),\n inc: require('./functions/inc'),\n diff: require('./functions/diff'),\n major: require('./functions/major'),\n minor: require('./functions/minor'),\n patch: require('./functions/patch'),\n prerelease: require('./functions/prerelease'),\n compare: require('./functions/compare'),\n rcompare: require('./functions/rcompare'),\n compareLoose: require('./functions/compare-loose'),\n compareBuild: require('./functions/compare-build'),\n sort: require('./functions/sort'),\n rsort: require('./functions/rsort'),\n gt: require('./functions/gt'),\n lt: require('./functions/lt'),\n eq: require('./functions/eq'),\n neq: require('./functions/neq'),\n gte: require('./functions/gte'),\n lte: require('./functions/lte'),\n cmp: require('./functions/cmp'),\n coerce: require('./functions/coerce'),\n Comparator: require('./classes/comparator'),\n Range: require('./classes/range'),\n satisfies: require('./functions/satisfies'),\n toComparators: require('./ranges/to-comparators'),\n maxSatisfying: require('./ranges/max-satisfying'),\n minSatisfying: require('./ranges/min-satisfying'),\n minVersion: require('./ranges/min-version'),\n validRange: require('./ranges/valid'),\n outside: require('./ranges/outside'),\n gtr: require('./ranges/gtr'),\n ltr: require('./ranges/ltr'),\n intersects: require('./ranges/intersects'),\n simplifyRange: require('./ranges/simplify'),\n subset: require('./ranges/subset'),\n}\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\nmodule.exports = {\n SEMVER_SPEC_VERSION,\n MAX_LENGTH,\n MAX_SAFE_INTEGER,\n MAX_SAFE_COMPONENT_LENGTH\n}\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers\n}\n","// parse out just the options we care about so we always get a consistent\n// obj with keys in a consistent order.\nconst opts = ['includePrerelease', 'loose', 'rtl']\nconst parseOptions = options =>\n !options ? {}\n : typeof options !== 'object' ? { loose: true }\n : opts.filter(k => options[k]).reduce((options, k) => {\n options[k] = true\n return options\n }, {})\nmodule.exports = parseOptions\n","const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst createToken = (name, value, isGlobal) => {\n const index = R++\n debug(index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '[0-9]+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*')\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCE', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\.0\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\.0\\.0-0\\\\s*$')\n","// Determine if version is greater than all the versions possible in the range.\nconst outside = require('./outside')\nconst gtr = (version, range, options) => outside(version, range, '>', options)\nmodule.exports = gtr\n","const Range = require('../classes/range')\nconst intersects = (r1, r2, options) => {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2)\n}\nmodule.exports = intersects\n","const outside = require('./outside')\n// Determine if version is less than all the versions possible in the range\nconst ltr = (version, range, options) => outside(version, range, '<', options)\nmodule.exports = ltr\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\n\nconst maxSatisfying = (versions, range, options) => {\n let max = null\n let maxSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\nmodule.exports = maxSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst minSatisfying = (versions, range, options) => {\n let min = null\n let minSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\nmodule.exports = minSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst gt = require('../functions/gt')\n\nconst minVersion = (range, loose) => {\n range = new Range(range, loose)\n\n let minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let setMin = null\n comparators.forEach((comparator) => {\n // Clone to avoid manipulating the comparator's semver object.\n const compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!setMin || gt(compver, setMin)) {\n setMin = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error(`Unexpected operation: ${comparator.operator}`)\n }\n })\n if (setMin && (!minver || gt(minver, setMin)))\n minver = setMin\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\nmodule.exports = minVersion\n","const SemVer = require('../classes/semver')\nconst Comparator = require('../classes/comparator')\nconst {ANY} = Comparator\nconst Range = require('../classes/range')\nconst satisfies = require('../functions/satisfies')\nconst gt = require('../functions/gt')\nconst lt = require('../functions/lt')\nconst lte = require('../functions/lte')\nconst gte = require('../functions/gte')\n\nconst outside = (version, range, hilo, options) => {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n let gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisfies the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let high = null\n let low = null\n\n comparators.forEach((comparator) => {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nmodule.exports = outside\n","// given a set of versions and a range, create a \"simplified\" range\n// that includes the same versions that the original range does\n// If the original range is shorter than the simplified one, return that.\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\nmodule.exports = (versions, range, options) => {\n const set = []\n let min = null\n let prev = null\n const v = versions.sort((a, b) => compare(a, b, options))\n for (const version of v) {\n const included = satisfies(version, range, options)\n if (included) {\n prev = version\n if (!min)\n min = version\n } else {\n if (prev) {\n set.push([min, prev])\n }\n prev = null\n min = null\n }\n }\n if (min)\n set.push([min, null])\n\n const ranges = []\n for (const [min, max] of set) {\n if (min === max)\n ranges.push(min)\n else if (!max && min === v[0])\n ranges.push('*')\n else if (!max)\n ranges.push(`>=${min}`)\n else if (min === v[0])\n ranges.push(`<=${max}`)\n else\n ranges.push(`${min} - ${max}`)\n }\n const simplified = ranges.join(' || ')\n const original = typeof range.raw === 'string' ? range.raw : String(range)\n return simplified.length < original.length ? simplified : range\n}\n","const Range = require('../classes/range.js')\nconst Comparator = require('../classes/comparator.js')\nconst { ANY } = Comparator\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\n\n// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:\n// - Every simple range `r1, r2, ...` is a null set, OR\n// - Every simple range `r1, r2, ...` which is not a null set is a subset of\n// some `R1, R2, ...`\n//\n// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:\n// - If c is only the ANY comparator\n// - If C is only the ANY comparator, return true\n// - Else if in prerelease mode, return false\n// - else replace c with `[>=0.0.0]`\n// - If C is only the ANY comparator\n// - if in prerelease mode, return true\n// - else replace C with `[>=0.0.0]`\n// - Let EQ be the set of = comparators in c\n// - If EQ is more than one, return true (null set)\n// - Let GT be the highest > or >= comparator in c\n// - Let LT be the lowest < or <= comparator in c\n// - If GT and LT, and GT.semver > LT.semver, return true (null set)\n// - If any C is a = range, and GT or LT are set, return false\n// - If EQ\n// - If GT, and EQ does not satisfy GT, return true (null set)\n// - If LT, and EQ does not satisfy LT, return true (null set)\n// - If EQ satisfies every C, return true\n// - Else return false\n// - If GT\n// - If GT.semver is lower than any > or >= comp in C, return false\n// - If GT is >=, and GT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the GT.semver tuple, return false\n// - If LT\n// - If LT.semver is greater than any < or <= comp in C, return false\n// - If LT is <=, and LT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the LT.semver tuple, return false\n// - Else return true\n\nconst subset = (sub, dom, options = {}) => {\n if (sub === dom)\n return true\n\n sub = new Range(sub, options)\n dom = new Range(dom, options)\n let sawNonNull = false\n\n OUTER: for (const simpleSub of sub.set) {\n for (const simpleDom of dom.set) {\n const isSub = simpleSubset(simpleSub, simpleDom, options)\n sawNonNull = sawNonNull || isSub !== null\n if (isSub)\n continue OUTER\n }\n // the null set is a subset of everything, but null simple ranges in\n // a complex range should be ignored. so if we saw a non-null range,\n // then we know this isn't a subset, but if EVERY simple range was null,\n // then it is a subset.\n if (sawNonNull)\n return false\n }\n return true\n}\n\nconst simpleSubset = (sub, dom, options) => {\n if (sub === dom)\n return true\n\n if (sub.length === 1 && sub[0].semver === ANY) {\n if (dom.length === 1 && dom[0].semver === ANY)\n return true\n else if (options.includePrerelease)\n sub = [ new Comparator('>=0.0.0-0') ]\n else\n sub = [ new Comparator('>=0.0.0') ]\n }\n\n if (dom.length === 1 && dom[0].semver === ANY) {\n if (options.includePrerelease)\n return true\n else\n dom = [ new Comparator('>=0.0.0') ]\n }\n\n const eqSet = new Set()\n let gt, lt\n for (const c of sub) {\n if (c.operator === '>' || c.operator === '>=')\n gt = higherGT(gt, c, options)\n else if (c.operator === '<' || c.operator === '<=')\n lt = lowerLT(lt, c, options)\n else\n eqSet.add(c.semver)\n }\n\n if (eqSet.size > 1)\n return null\n\n let gtltComp\n if (gt && lt) {\n gtltComp = compare(gt.semver, lt.semver, options)\n if (gtltComp > 0)\n return null\n else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<='))\n return null\n }\n\n // will iterate one or zero times\n for (const eq of eqSet) {\n if (gt && !satisfies(eq, String(gt), options))\n return null\n\n if (lt && !satisfies(eq, String(lt), options))\n return null\n\n for (const c of dom) {\n if (!satisfies(eq, String(c), options))\n return false\n }\n\n return true\n }\n\n let higher, lower\n let hasDomLT, hasDomGT\n // if the subset has a prerelease, we need a comparator in the superset\n // with the same tuple and a prerelease, or it's not a subset\n let needDomLTPre = lt &&\n !options.includePrerelease &&\n lt.semver.prerelease.length ? lt.semver : false\n let needDomGTPre = gt &&\n !options.includePrerelease &&\n gt.semver.prerelease.length ? gt.semver : false\n // exception: <1.2.3-0 is the same as <1.2.3\n if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&\n lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {\n needDomLTPre = false\n }\n\n for (const c of dom) {\n hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='\n hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='\n if (gt) {\n if (needDomGTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomGTPre.major &&\n c.semver.minor === needDomGTPre.minor &&\n c.semver.patch === needDomGTPre.patch) {\n needDomGTPre = false\n }\n }\n if (c.operator === '>' || c.operator === '>=') {\n higher = higherGT(gt, c, options)\n if (higher === c && higher !== gt)\n return false\n } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options))\n return false\n }\n if (lt) {\n if (needDomLTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomLTPre.major &&\n c.semver.minor === needDomLTPre.minor &&\n c.semver.patch === needDomLTPre.patch) {\n needDomLTPre = false\n }\n }\n if (c.operator === '<' || c.operator === '<=') {\n lower = lowerLT(lt, c, options)\n if (lower === c && lower !== lt)\n return false\n } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options))\n return false\n }\n if (!c.operator && (lt || gt) && gtltComp !== 0)\n return false\n }\n\n // if there was a < or >, and nothing in the dom, then must be false\n // UNLESS it was limited by another range in the other direction.\n // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0\n if (gt && hasDomLT && !lt && gtltComp !== 0)\n return false\n\n if (lt && hasDomGT && !gt && gtltComp !== 0)\n return false\n\n // we needed a prerelease range in a specific tuple, but didn't get one\n // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,\n // because it includes prereleases in the 1.2.3 tuple\n if (needDomGTPre || needDomLTPre)\n return false\n\n return true\n}\n\n// >=1.2.3 is lower than >1.2.3\nconst higherGT = (a, b, options) => {\n if (!a)\n return b\n const comp = compare(a.semver, b.semver, options)\n return comp > 0 ? a\n : comp < 0 ? b\n : b.operator === '>' && a.operator === '>=' ? b\n : a\n}\n\n// <=1.2.3 is higher than <1.2.3\nconst lowerLT = (a, b, options) => {\n if (!a)\n return b\n const comp = compare(a.semver, b.semver, options)\n return comp < 0 ? a\n : comp > 0 ? b\n : b.operator === '<' && a.operator === '<=' ? b\n : a\n}\n\nmodule.exports = subset\n","const Range = require('../classes/range')\n\n// Mostly just for testing and legacy API reasons\nconst toComparators = (range, options) =>\n new Range(range, options).set\n .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))\n\nmodule.exports = toComparators\n","const Range = require('../classes/range')\nconst validRange = (range, options) => {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\nmodule.exports = validRange\n","const { dirname, join, resolve, relative, isAbsolute } = require('path')\nconst rimraf_ = require('rimraf')\nconst { promisify } = require('util')\nconst {\n access: access_,\n accessSync,\n copyFile: copyFile_,\n copyFileSync,\n unlink: unlink_,\n unlinkSync,\n readdir: readdir_,\n readdirSync,\n rename: rename_,\n renameSync,\n stat: stat_,\n statSync,\n lstat: lstat_,\n lstatSync,\n symlink: symlink_,\n symlinkSync,\n readlink: readlink_,\n readlinkSync\n} = require('fs')\n\nconst access = promisify(access_)\nconst copyFile = promisify(copyFile_)\nconst unlink = promisify(unlink_)\nconst readdir = promisify(readdir_)\nconst rename = promisify(rename_)\nconst stat = promisify(stat_)\nconst lstat = promisify(lstat_)\nconst symlink = promisify(symlink_)\nconst readlink = promisify(readlink_)\nconst rimraf = promisify(rimraf_)\nconst rimrafSync = rimraf_.sync\n\nconst mkdirp = require('mkdirp')\n\nconst pathExists = async path => {\n try {\n await access(path)\n return true\n } catch (er) {\n return er.code !== 'ENOENT'\n }\n}\n\nconst pathExistsSync = path => {\n try {\n accessSync(path)\n return true\n } catch (er) {\n return er.code !== 'ENOENT'\n }\n}\n\nconst moveFile = async (source, destination, options = {}, root = true, symlinks = []) => {\n if (!source || !destination) {\n throw new TypeError('`source` and `destination` file required')\n }\n\n options = {\n overwrite: true,\n ...options\n }\n\n if (!options.overwrite && await pathExists(destination)) {\n throw new Error(`The destination file exists: ${destination}`)\n }\n\n await mkdirp(dirname(destination))\n\n try {\n await rename(source, destination)\n } catch (error) {\n if (error.code === 'EXDEV' || error.code === 'EPERM') {\n const sourceStat = await lstat(source)\n if (sourceStat.isDirectory()) {\n const files = await readdir(source)\n await Promise.all(files.map((file) => moveFile(join(source, file), join(destination, file), options, false, symlinks)))\n } else if (sourceStat.isSymbolicLink()) {\n symlinks.push({ source, destination })\n } else {\n await copyFile(source, destination)\n }\n } else {\n throw error\n }\n }\n\n if (root) {\n await Promise.all(symlinks.map(async ({ source, destination }) => {\n let target = await readlink(source)\n // junction symlinks in windows will be absolute paths, so we need to make sure they point to the destination\n if (isAbsolute(target))\n target = resolve(destination, relative(source, target))\n // try to determine what the actual file is so we can create the correct type of symlink in windows\n let targetStat\n try {\n targetStat = await stat(resolve(dirname(source), target))\n } catch (err) {}\n await symlink(target, destination, targetStat && targetStat.isDirectory() ? 'junction' : 'file')\n }))\n await rimraf(source)\n }\n}\n\nconst moveFileSync = (source, destination, options = {}, root = true, symlinks = []) => {\n if (!source || !destination) {\n throw new TypeError('`source` and `destination` file required')\n }\n\n options = {\n overwrite: true,\n ...options\n }\n\n if (!options.overwrite && pathExistsSync(destination)) {\n throw new Error(`The destination file exists: ${destination}`)\n }\n\n mkdirp.sync(dirname(destination))\n\n try {\n renameSync(source, destination)\n } catch (error) {\n if (error.code === 'EXDEV' || error.code === 'EPERM') {\n const sourceStat = lstatSync(source)\n if (sourceStat.isDirectory()) {\n const files = readdirSync(source)\n for (const file of files) {\n moveFileSync(join(source, file), join(destination, file), options, false, symlinks)\n }\n } else if (sourceStat.isSymbolicLink()) {\n symlinks.push({ source, destination })\n } else {\n copyFileSync(source, destination)\n }\n } else {\n throw error\n }\n }\n\n if (root) {\n for (const { source, destination } of symlinks) {\n let target = readlinkSync(source)\n // junction symlinks in windows will be absolute paths, so we need to make sure they point to the destination\n if (isAbsolute(target))\n target = resolve(destination, relative(source, target))\n // try to determine what the actual file is so we can create the correct type of symlink in windows\n let targetStat\n try {\n targetStat = statSync(resolve(dirname(source), target))\n } catch (err) {}\n symlinkSync(target, destination, targetStat && targetStat.isDirectory() ? 'junction' : 'file')\n }\n rimrafSync(source)\n }\n}\n\nmodule.exports = moveFile\nmodule.exports.sync = moveFileSync\n","const { basename, dirname } = require('path')\n\nconst getName = (parent, base) =>\n parent.charAt(0) === '@' ? `${parent}/${base}` : base\n\nmodule.exports = dir => dir ? getName(basename(dirname(dir)), basename(dir))\n : false\n","const util = require('util')\nconst fs = require('fs')\nconst {stat} = fs.promises || { stat: util.promisify(fs.stat) };\n\nasync function isNodeGypPackage(path) {\n return await stat(`${path}/binding.gyp`)\n .then(st => st.isFile())\n .catch(() => false)\n}\n\nmodule.exports = {\n isNodeGypPackage,\n defaultGypInstallScript: 'node-gyp rebuild'\n}\n","const {spawn} = require('child_process')\n\nconst inferOwner = require('infer-owner')\n\nconst isPipe = (stdio = 'pipe', fd) =>\n stdio === 'pipe' || stdio === null ? true\n : Array.isArray(stdio) ? isPipe(stdio[fd], fd)\n : false\n\n// 'extra' object is for decorating the error a bit more\nconst promiseSpawn = (cmd, args, opts, extra = {}) => {\n const cwd = opts.cwd || process.cwd()\n const isRoot = process.getuid && process.getuid() === 0\n const { uid, gid } = isRoot ? inferOwner.sync(cwd) : {}\n return promiseSpawnUid(cmd, args, {\n ...opts,\n cwd,\n uid,\n gid\n }, extra)\n}\n\nconst stdioResult = (stdout, stderr, {stdioString, stdio}) =>\n stdioString ? {\n stdout: isPipe(stdio, 1) ? Buffer.concat(stdout).toString() : null,\n stderr: isPipe(stdio, 2) ? Buffer.concat(stderr).toString() : null,\n }\n : {\n stdout: isPipe(stdio, 1) ? Buffer.concat(stdout) : null,\n stderr: isPipe(stdio, 2) ? Buffer.concat(stderr) : null,\n }\n\nconst promiseSpawnUid = (cmd, args, opts, extra) => {\n let proc\n const p = new Promise((res, rej) => {\n proc = spawn(cmd, args, opts)\n const stdout = []\n const stderr = []\n const reject = er => rej(Object.assign(er, {\n cmd,\n args,\n ...stdioResult(stdout, stderr, opts),\n ...extra,\n }))\n proc.on('error', reject)\n if (proc.stdout) {\n proc.stdout.on('data', c => stdout.push(c)).on('error', reject)\n proc.stdout.on('error', er => reject(er))\n }\n if (proc.stderr) {\n proc.stderr.on('data', c => stderr.push(c)).on('error', reject)\n proc.stderr.on('error', er => reject(er))\n }\n proc.on('close', (code, signal) => {\n const result = {\n cmd,\n args,\n code,\n signal,\n ...stdioResult(stdout, stderr, opts),\n ...extra\n }\n if (code || signal)\n rej(Object.assign(new Error('command failed'), result))\n else\n res(result)\n })\n })\n\n p.stdin = proc.stdin\n p.process = proc\n return p\n}\n\nmodule.exports = promiseSpawn\n","var deepEqual = require('fast-deep-equal');\nvar convert = require('./lib/convert');\n\nmodule.exports = openapiSchemaToJsonSchema;\nmodule.exports.fromSchema = openapiSchemaToJsonSchema;\nmodule.exports.fromParameter = openapiParameterToJsonSchema;\n\nfunction openapiSchemaToJsonSchema(schema, options) {\n\toptions = resolveOptions(options);\n\n\tvar jsonSchema = convert.fromSchema(schema, options);\n\treturn jsonSchema;\n}\n\nfunction openapiParameterToJsonSchema(parameter, options) {\n\toptions = resolveOptions(options);\n\n\tvar jsonSchema = convert.fromParameter(parameter, options);\n\treturn jsonSchema;\n}\n\nfunction resolveOptions(options) {\n\tvar notSupported = [\n\t\t'nullable', 'discriminator', 'readOnly',\n\t\t'writeOnly', 'xml', 'externalDocs',\n\t\t'example', 'deprecated'\n\t];\n\n\toptions = options || {};\n\toptions.dateToDateTime = options.dateToDateTime || false;\n\toptions.cloneSchema = options.cloneSchema == false ? false : true;\n\toptions.supportPatternProperties = options.supportPatternProperties || false;\n\toptions.keepNotSupported = options.keepNotSupported || [];\n\toptions.strictMode = options.strictMode == false ? false : true;\n\n\tif (typeof options.patternPropertiesHandler !== 'function') {\n\t\toptions.patternPropertiesHandler = patternPropertiesHandler;\n\t}\n\n\toptions._removeProps = [];\n\n\tif (options.removeReadOnly === true) {\n\t\toptions._removeProps.push('readOnly');\n\t}\n\n\tif (options.removeWriteOnly === true) {\n\t\toptions._removeProps.push('writeOnly');\n\t}\n\n\toptions._structs = ['allOf', 'anyOf', 'oneOf', 'not', 'items', 'additionalProperties'];\n\toptions._notSupported = resolveNotSupported(notSupported, options.keepNotSupported);\n\n\treturn options;\n}\n\nfunction patternPropertiesHandler(schema) {\n\tvar pattern;\n\tvar patternsObj = schema.patternProperties;\n\tvar additProps = schema.additionalProperties;\n\n\tif (typeof additProps !== 'object') {\n\t\treturn schema;\n\t}\n\n\tfor (pattern in patternsObj) {\n\t\tif (deepEqual(patternsObj[pattern], additProps)) {\n\t\t\tschema.additionalProperties = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn schema;\n}\n\nfunction resolveNotSupported(notSupported, toRetain) {\n\tvar i = 0;\n\tvar index;\n\n\tfor (i; i < toRetain.length; i++) {\n\t\tindex = notSupported.indexOf(toRetain[i]);\n\n\t\tif (index >= 0) {\n\t\t\tnotSupported.splice(index, 1);\n\t\t}\n\t}\n\n\treturn notSupported;\n}\n","var convertFromSchema = require('./converters/schema')\nvar convertFromParameter = require('./converters/parameter')\n\nmodule.exports = {\n fromSchema: convertFromSchema,\n fromParameter: convertFromParameter\n}\n","var convertFromSchema = require('./schema')\nvar InvalidInputError = require('../errors/invalid-input-error')\n\nmodule.exports = convertFromParameter\n\n// Convert from OpenAPI 3.0 `ParameterObject` to JSON schema v4\nfunction convertFromParameter (parameter, options) {\n if (parameter.schema !== undefined) {\n return convertParameterSchema(parameter, parameter.schema, options)\n } else if (parameter.content !== undefined) {\n return convertFromContents(parameter, options)\n } else {\n if (options.strictMode) {\n throw new InvalidInputError('OpenAPI parameter must have either a \\'schema\\' or a \\'content\\' property')\n }\n return convertParameterSchema(parameter, {}, options)\n }\n}\n\nfunction convertFromContents (parameter, options) {\n var schemas = {}\n\n for (var mime in parameter.content) {\n schemas[mime] = convertParameterSchema(parameter, parameter.content[mime].schema, options)\n }\n\n return schemas\n}\n\nfunction convertParameterSchema (parameter, schema, options) {\n var jsonSchema = convertFromSchema(schema || {}, options)\n\n if (parameter.description) {\n jsonSchema.description = parameter.description\n }\n\n return jsonSchema\n}\n","var isObject = require('../utils/isObject').isObject\nvar InvalidTypeError = require('../errors/invalid-type-error')\n\nmodule.exports = convertFromSchema\n\n// Convert from OpenAPI 3.0 `SchemaObject` to JSON schema v4\nfunction convertFromSchema (schema, options) {\n\tschema = convertSchema(schema, options)\n\n\tschema.$schema = 'http://json-schema.org/draft-04/schema#'\n\n\treturn schema\n}\n\nfunction convertSchema (schema, options) {\n if (options.cloneSchema) {\n schema = Object.assign({}, schema);\n }\n\n var structs = options._structs;\n\tvar notSupported = options._notSupported;\n\tvar strictMode = options.strictMode;\n\tvar i = 0;\n\tvar j = 0;\n\tvar struct = null;\n\n\tfor (i; i < structs.length; i++) {\n\t\tstruct = structs[i]\n\n\t\tif (Array.isArray(schema[struct])) {\n var cloned = false;\n\n for (j; j < schema[struct].length; j++) {\n\t\t\t\tif (!isObject(schema[struct][j])) {\n if (options.cloneSchema && !cloned) {\n cloned = true;\n schema[struct] = schema[struct].slice();\n }\n\n\t\t\t\t\tschema[struct].splice(j, 1)\n\t\t\t\t\tj--\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tschema[struct][j] = convertSchema(schema[struct][j], options)\n\t\t\t}\n\t\t} else if (schema[struct] === null) {\n\t\t\tdelete schema[struct]\n\t\t} else if (typeof schema[struct] === 'object') {\n\t\t\tschema[struct] = convertSchema(schema[struct], options)\n\t\t}\n\t}\n\n\tif ('properties' in schema) {\n\t\tschema.properties = convertProperties(schema.properties, options)\n\n\t\tif (Array.isArray(schema.required)) {\n\t\t\tschema.required = cleanRequired(schema.required, schema.properties)\n\n\t\t\tif (schema.required.length === 0) {\n\t\t\t\tdelete schema.required\n\t\t\t}\n\t\t}\n\t\tif (Object.keys(schema.properties).length === 0) {\n\t\t\tdelete schema.properties\n\t\t}\n\t}\n\n\tif (strictMode) {\n\t\tvalidateType(schema.type)\n\t}\n\n\tschema = convertTypes(schema)\n\tschema = convertFormat(schema, options)\n\n\tif ('x-patternProperties' in schema && options.supportPatternProperties) {\n\t\tschema = convertPatternProperties(schema, options.patternPropertiesHandler)\n\t}\n\n\tfor (i = 0; i < notSupported.length; i++) {\n\t\tdelete schema[notSupported[i]]\n\t}\n\n\treturn schema\n}\n\nfunction validateType (type) {\n\tvar validTypes = ['integer', 'number', 'string', 'boolean', 'object', 'array', 'null']\n\n\tif (validTypes.indexOf(type) < 0 && type !== undefined) {\n\t\tthrow new InvalidTypeError('Type ' + JSON.stringify(type) + ' is not a valid type')\n\t}\n}\n\nfunction convertProperties (properties, options) {\n\tvar key;\n\tvar property;\n\tvar props = {};\n\tvar removeProp;\n\n\tif (!isObject(properties)) {\n\t\treturn props\n\t}\n\n\tfor (key in properties) {\n\t\tproperty = properties[key]\n\n\t\tif (!isObject(property)) {\n\t\t\tcontinue\n\t\t}\n\n removeProp = options._removeProps.some(function (prop) {\n\t\t\treturn property[prop] === true\n\t\t})\n\n\t\tif (removeProp) {\n\t\t\tcontinue\n\t\t}\n\n\t\tprops[key] = convertSchema(property, options)\n\t}\n\n\treturn props\n}\n\nfunction convertTypes (schema) {\n\tif (schema.type !== undefined && schema.nullable === true) {\n\t\tschema.type = [schema.type, 'null']\n\n\t\tif (Array.isArray(schema.enum)) {\n\t\t\tschema.enum = schema.enum.concat([null])\n\t\t}\n\t}\n\n\treturn schema\n}\n\nfunction convertFormat (schema, options) {\n\tvar format = schema.format\n\tvar settings = {\n\t\tMIN_INT_32: 0 - Math.pow(2, 31),\n\t\tMAX_INT_32: Math.pow(2, 31) - 1,\n\t\tMIN_INT_64: 0 - Math.pow(2, 63),\n\t\tMAX_INT_64: Math.pow(2, 63) - 1,\n\t\tMIN_FLOAT: 0 - Math.pow(2, 128),\n\t\tMAX_FLOAT: Math.pow(2, 128) - 1,\n\t\tMIN_DOUBLE: 0 - Number.MAX_VALUE,\n\t\tMAX_DOUBLE: Number.MAX_VALUE,\n\n\t\t// Matches base64 (RFC 4648)\n\t\t// Matches `standard` base64 not `base64url`. The specification does not\n\t\t// exclude it but current ongoing OpenAPI plans will distinguish btoh.\n\t\tBYTE_PATTERN: '^[\\\\w\\\\d+\\\\/=]*$'\n\t}\n\n\t// Valid JSON schema v4 formats\n\tvar FORMATS = ['date-time', 'email', 'hostname', 'ipv4', 'ipv6', 'uri', 'uri-reference']\n\n\tif (format === undefined || FORMATS.indexOf(format) !== -1) {\n\t\treturn schema\n\t}\n\n\tif (format === 'date' && options.dateToDateTime === true) {\n\t\treturn convertFormatDate(schema)\n\t}\n\n\tvar formatConverters = {\n\t\tint32: convertFormatInt32,\n\t\tint64: convertFormatInt64,\n\t\tfloat: convertFormatFloat,\n\t\tdouble: convertFormatDouble,\n\t\tbyte: convertFormatByte\n\t}\n\n\tvar converter = formatConverters[format]\n\n\tif (converter === undefined) { return schema }\n\n\treturn converter(schema, settings)\n}\n\nfunction convertFormatInt32 (schema, settings) {\n if ((!schema.minimum && schema.minimum !== 0) || schema.minimum < settings.MIN_INT_32) {\n\t\tschema.minimum = settings.MIN_INT_32;\n\t}\n\tif ((!schema.maximum && schema.maximum !== 0) || schema.maximum > settings.MAX_INT_32) {\n\t\tschema.maximum = settings.MAX_INT_32;\n\t}\n\treturn schema\n}\n\nfunction convertFormatInt64 (schema, settings) {\n\tif ((!schema.minimum && schema.minimum !== 0) || schema.minimum < settings.MIN_INT_64) {\n\t\tschema.minimum = settings.MIN_INT_64;\n\t}\n\tif ((!schema.maximum && schema.maximum !== 0) || schema.maximum > settings.MAX_INT_64) {\n\t\tschema.maximum = settings.MAX_INT_64;\n\t}\n\treturn schema\n}\n\nfunction convertFormatFloat (schema, settings) {\n\tif ((!schema.minimum && schema.minimum !== 0) || schema.minimum < settings.MIN_FLOAT) {\n\t\tschema.minimum = settings.MIN_FLOAT;\n\t}\n\tif ((!schema.maximum && schema.maximum !== 0) || schema.maximum > settings.MAX_FLOAT) {\n\t\tschema.maximum = settings.MAX_FLOAT;\n\t}\n\treturn schema\n}\n\nfunction convertFormatDouble (schema, settings) {\n\tif ((!schema.minimum && schema.minimum !== 0) || schema.minimum < settings.MIN_DOUBLE) {\n\t\tschema.minimum = settings.MIN_DOUBLE;\n\t}\n\tif ((!schema.maximum && schema.maximum !== 0) || schema.maximum > settings.MAX_DOUBLE) {\n\t\tschema.maximum = settings.MAX_DOUBLE;\n\t}\n\treturn schema\n}\n\nfunction convertFormatDate (schema) {\n\tschema.format = 'date-time'\n\treturn schema\n}\n\nfunction convertFormatByte (schema, settings) {\n\tschema.pattern = settings.BYTE_PATTERN\n\treturn schema\n}\n\nfunction convertPatternProperties (schema, handler) {\n\tif (isObject(schema['x-patternProperties'])) {\n\t\tschema.patternProperties = schema['x-patternProperties']\n\t}\n\n\tdelete schema['x-patternProperties']\n\n\treturn handler(schema)\n}\n\nfunction cleanRequired (required, properties) {\n\trequired = required || []\n\tproperties = properties || {}\n\tlet remainedRequired = []\n\n\tfor (let i = 0; i < required.length; i++) {\n if (properties[required[i]]) {\n remainedRequired.push(required[i])\n }\n\t}\n\n\treturn remainedRequired\n}\n","module.exports = InvalidInputError\n\nfunction InvalidInputError (message) {\n this.name = 'InvalidInputError'\n this.message = message\n}\n\nInvalidInputError.prototype = new Error()\n","module.exports = InvalidTypeError\n\nfunction InvalidTypeError (message) {\n this.name = 'InvalidTypeError'\n this.message = message\n}\n\nInvalidTypeError.prototype = Error.prototype\n","exports.isObject = function (maybeObj) {\n return maybeObj !== null && typeof maybeObj === 'object'\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar babel = require('@babel/core');\nvar pluginutils = require('@rollup/pluginutils');\nvar helperModuleImports = require('@babel/helper-module-imports');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar babel__namespace = /*#__PURE__*/_interopNamespace(babel);\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nconst BUNDLED = 'bundled';\nconst INLINE = 'inline';\nconst RUNTIME = 'runtime';\nconst EXTERNAL = 'external'; // NOTE: DO NOT REMOVE the null character `\\0` as it may be used by other plugins\n// e.g. https://github.com/rollup/rollup-plugin-node-resolve/blob/313a3e32f432f9eb18cc4c231cc7aac6df317a51/src/index.js#L74\n\nconst HELPERS = '\\0rollupPluginBabelHelpers.js';\n\nfunction importHelperPlugin({\n types: t\n}) {\n return {\n pre(file) {\n const cachedHelpers = {};\n file.set('helperGenerator', name => {\n if (!file.availableHelper(name)) {\n return null;\n }\n\n if (cachedHelpers[name]) {\n return t.cloneNode(cachedHelpers[name]);\n }\n\n return cachedHelpers[name] = helperModuleImports.addNamed(file.path, name, HELPERS);\n });\n }\n\n };\n}\n\nconst addBabelPlugin = (options, plugin) => {\n return _objectSpread2(_objectSpread2({}, options), {}, {\n plugins: options.plugins.concat(plugin)\n });\n};\nconst warned = {};\nfunction warnOnce(ctx, msg) {\n if (warned[msg]) return;\n warned[msg] = true;\n ctx.warn(msg);\n}\nconst regExpCharactersRegExp = /[\\\\^$.*+?()[\\]{}|]/g;\nconst escapeRegExpCharacters = str => str.replace(regExpCharactersRegExp, '\\\\$&');\nfunction stripQuery(id) {\n // strip query params from import\n const [bareId, query] = id.split('?');\n const suffix = `${query ? `?${query}` : ''}`;\n return {\n bareId,\n query,\n suffix\n };\n}\n\nconst MODULE_ERROR = 'Rollup requires that your Babel configuration keeps ES6 module syntax intact. ' + 'Unfortunately it looks like your configuration specifies a module transformer ' + 'to replace ES6 modules with another module format. To continue you have to disable it.' + '\\n\\n' + \"Most commonly it's a CommonJS transform added by @babel/preset-env - \" + 'in such case you should disable it by adding `modules: false` option to that preset ' + '(described in more detail here - https://github.com/rollup/plugins/tree/master/packages/babel#modules ).';\nconst UNEXPECTED_ERROR = 'An unexpected situation arose. Please raise an issue at ' + 'https://github.com/rollup/plugins/issues. Thanks!';\nconst PREFLIGHT_TEST_STRING = '__ROLLUP__PREFLIGHT_CHECK_DO_NOT_TOUCH__';\nconst PREFLIGHT_INPUT = `export default \"${PREFLIGHT_TEST_STRING}\";`;\n\nfunction helpersTestTransform() {\n return {\n visitor: {\n StringLiteral(path, state) {\n if (path.node.value === PREFLIGHT_TEST_STRING) {\n path.replaceWith(state.file.addHelper('inherits'));\n }\n }\n\n }\n };\n}\n\nconst mismatchError = (actual, expected, filename) => `You have declared using \"${expected}\" babelHelpers, but transforming ${filename} resulted in \"${actual}\". Please check your configuration.`;\n\nconst inheritsHelperRe = /\\/helpers\\/(esm\\/)?inherits/;\nasync function preflightCheck(ctx, babelHelpers, transformOptions) {\n const finalOptions = addBabelPlugin(transformOptions, helpersTestTransform);\n const check = (await babel.transformAsync(PREFLIGHT_INPUT, finalOptions)).code; // Babel sometimes splits ExportDefaultDeclaration into 2 statements, so we also check for ExportNamedDeclaration\n\n if (!/export (d|{)/.test(check)) {\n ctx.error(MODULE_ERROR);\n }\n\n if (inheritsHelperRe.test(check)) {\n if (babelHelpers === RUNTIME) {\n return;\n }\n\n ctx.error(mismatchError(RUNTIME, babelHelpers, transformOptions.filename));\n }\n\n if (check.includes('babelHelpers.inherits')) {\n if (babelHelpers === EXTERNAL) {\n return;\n }\n\n ctx.error(mismatchError(EXTERNAL, babelHelpers, transformOptions.filename));\n } // test unminifiable string content\n\n\n if (check.includes('Super expression must either be null or a function')) {\n if (babelHelpers === INLINE || babelHelpers === BUNDLED) {\n return;\n }\n\n if (babelHelpers === RUNTIME && !transformOptions.plugins.length) {\n ctx.error(`You must use the \\`@babel/plugin-transform-runtime\\` plugin when \\`babelHelpers\\` is \"${RUNTIME}\".\\n`);\n }\n\n ctx.error(mismatchError(INLINE, babelHelpers, transformOptions.filename));\n }\n\n ctx.error(UNEXPECTED_ERROR);\n}\n\nasync function transformCode(inputCode, babelOptions, overrides, customOptions, ctx, finalizeOptions) {\n // loadPartialConfigAsync has become available in @babel/core@7.8.0\n const config = await (babel.loadPartialConfigAsync || babel.loadPartialConfig)(babelOptions); // file is ignored by babel\n\n if (!config) {\n return null;\n }\n\n let transformOptions = !overrides.config ? config.options : await overrides.config.call(ctx, config, {\n code: inputCode,\n customOptions\n });\n\n if (finalizeOptions) {\n transformOptions = await finalizeOptions(transformOptions);\n }\n\n if (!overrides.result) {\n const {\n code,\n map\n } = await babel.transformAsync(inputCode, transformOptions);\n return {\n code,\n map\n };\n }\n\n const result = await babel.transformAsync(inputCode, transformOptions);\n const {\n code,\n map\n } = await overrides.result.call(ctx, result, {\n code: inputCode,\n customOptions,\n config,\n transformOptions\n });\n return {\n code,\n map\n };\n}\n\nconst unpackOptions = (_ref = {}) => {\n let {\n extensions = babel.DEFAULT_EXTENSIONS,\n // rollup uses sourcemap, babel uses sourceMaps\n // just normalize them here so people don't have to worry about it\n sourcemap = true,\n sourcemaps = true,\n sourceMap = true,\n sourceMaps = true\n } = _ref,\n rest = _objectWithoutProperties(_ref, [\"extensions\", \"sourcemap\", \"sourcemaps\", \"sourceMap\", \"sourceMaps\"]);\n\n return _objectSpread2(_objectSpread2({\n extensions,\n plugins: [],\n sourceMaps: sourcemap && sourcemaps && sourceMap && sourceMaps\n }, rest), {}, {\n caller: _objectSpread2({\n name: '@rollup/plugin-babel'\n }, rest.caller)\n });\n};\n\nconst warnAboutDeprecatedHelpersOption = ({\n deprecatedOption,\n suggestion\n}) => {\n // eslint-disable-next-line no-console\n console.warn(`\\`${deprecatedOption}\\` has been removed in favor a \\`babelHelpers\\` option. Try changing your configuration to \\`${suggestion}\\`. ` + `Refer to the documentation to learn more: https://github.com/rollup/plugins/tree/master/packages/babel#babelhelpers`);\n};\n\nconst unpackInputPluginOptions = (_ref2, rollupVersion) => {\n let {\n skipPreflightCheck = false\n } = _ref2,\n rest = _objectWithoutProperties(_ref2, [\"skipPreflightCheck\"]);\n\n if ('runtimeHelpers' in rest) {\n warnAboutDeprecatedHelpersOption({\n deprecatedOption: 'runtimeHelpers',\n suggestion: `babelHelpers: 'runtime'`\n });\n } else if ('externalHelpers' in rest) {\n warnAboutDeprecatedHelpersOption({\n deprecatedOption: 'externalHelpers',\n suggestion: `babelHelpers: 'external'`\n });\n } else if (!rest.babelHelpers) {\n // eslint-disable-next-line no-console\n console.warn(\"babelHelpers: 'bundled' option was used by default. It is recommended to configure this option explicitly, read more here: \" + 'https://github.com/rollup/plugins/tree/master/packages/babel#babelhelpers');\n }\n\n return unpackOptions(_objectSpread2(_objectSpread2({}, rest), {}, {\n skipPreflightCheck,\n babelHelpers: rest.babelHelpers || BUNDLED,\n caller: _objectSpread2({\n supportsStaticESM: true,\n supportsDynamicImport: true,\n supportsTopLevelAwait: true,\n // todo: remove version checks for 1.20 - 1.25 when we bump peer deps\n supportsExportNamespaceFrom: !rollupVersion.match(/^1\\.2[0-5]\\./)\n }, rest.caller)\n }));\n};\n\nconst unpackOutputPluginOptions = (options, {\n format\n}) => unpackOptions(_objectSpread2(_objectSpread2({\n configFile: false,\n sourceType: format === 'es' ? 'module' : 'script'\n}, options), {}, {\n caller: _objectSpread2({\n supportsStaticESM: format === 'es'\n }, options.caller)\n}));\n\nfunction getOptionsWithOverrides(pluginOptions = {}, overrides = {}) {\n if (!overrides.options) return {\n customOptions: null,\n pluginOptionsWithOverrides: pluginOptions\n };\n const overridden = overrides.options(pluginOptions);\n\n if (typeof overridden.then === 'function') {\n throw new Error(\".options hook can't be asynchronous. It should return `{ customOptions, pluginsOptions }` synchronously.\");\n }\n\n return {\n customOptions: overridden.customOptions || null,\n pluginOptionsWithOverrides: overridden.pluginOptions || pluginOptions\n };\n}\n\nconst returnObject = () => {\n return {};\n};\n\nfunction createBabelInputPluginFactory(customCallback = returnObject) {\n const overrides = customCallback(babel__namespace);\n return pluginOptions => {\n const {\n customOptions,\n pluginOptionsWithOverrides\n } = getOptionsWithOverrides(pluginOptions, overrides);\n let babelHelpers;\n let babelOptions;\n let filter;\n let skipPreflightCheck;\n return {\n name: 'babel',\n\n options() {\n // todo: remove options hook and hoist declarations when version checks are removed\n let exclude;\n let include;\n let extensions;\n let customFilter;\n\n var _unpackInputPluginOpt = unpackInputPluginOptions(pluginOptionsWithOverrides, this.meta.rollupVersion);\n\n ({\n exclude,\n extensions,\n babelHelpers,\n include,\n filter: customFilter,\n skipPreflightCheck\n } = _unpackInputPluginOpt);\n babelOptions = _objectWithoutProperties(_unpackInputPluginOpt, [\"exclude\", \"extensions\", \"babelHelpers\", \"include\", \"filter\", \"skipPreflightCheck\"]);\n const extensionRegExp = new RegExp(`(${extensions.map(escapeRegExpCharacters).join('|')})$`);\n\n if (customFilter && (include || exclude)) {\n throw new Error('Could not handle include or exclude with custom filter together');\n }\n\n const userDefinedFilter = typeof customFilter === 'function' ? customFilter : pluginutils.createFilter(include, exclude);\n\n filter = id => extensionRegExp.test(stripQuery(id).bareId) && userDefinedFilter(id);\n\n return null;\n },\n\n resolveId(id) {\n if (id !== HELPERS) {\n return null;\n }\n\n return id;\n },\n\n load(id) {\n if (id !== HELPERS) {\n return null;\n }\n\n return babel.buildExternalHelpers(null, 'module');\n },\n\n transform(code, filename) {\n if (!filter(filename)) return null;\n if (filename === HELPERS) return null;\n return transformCode(code, _objectSpread2(_objectSpread2({}, babelOptions), {}, {\n filename\n }), overrides, customOptions, this, async transformOptions => {\n if (!skipPreflightCheck) {\n await preflightCheck(this, babelHelpers, transformOptions);\n }\n\n return babelHelpers === BUNDLED ? addBabelPlugin(transformOptions, importHelperPlugin) : transformOptions;\n });\n }\n\n };\n };\n}\n\nfunction getRecommendedFormat(rollupFormat) {\n switch (rollupFormat) {\n case 'amd':\n return 'amd';\n\n case 'iife':\n case 'umd':\n return 'umd';\n\n case 'system':\n return 'systemjs';\n\n default:\n return '';\n }\n}\n\nfunction createBabelOutputPluginFactory(customCallback = returnObject) {\n const overrides = customCallback(babel__namespace);\n return pluginOptions => {\n const {\n customOptions,\n pluginOptionsWithOverrides\n } = getOptionsWithOverrides(pluginOptions, overrides);\n return {\n name: 'babel',\n\n renderStart(outputOptions) {\n const {\n extensions,\n include,\n exclude,\n allowAllFormats\n } = pluginOptionsWithOverrides;\n\n if (extensions || include || exclude) {\n warnOnce(this, 'The \"include\", \"exclude\" and \"extensions\" options are ignored when transforming the output.');\n }\n\n if (!allowAllFormats && outputOptions.format !== 'es' && outputOptions.format !== 'cjs') {\n this.error(`Using Babel on the generated chunks is strongly discouraged for formats other than \"esm\" or \"cjs\" as it can easily break wrapper code and lead to accidentally created global variables. Instead, you should set \"output.format\" to \"esm\" and use Babel to transform to another format, e.g. by adding \"presets: [['@babel/env', { modules: '${getRecommendedFormat(outputOptions.format)}' }]]\" to your Babel options. If you still want to proceed, add \"allowAllFormats: true\" to your plugin options.`);\n }\n },\n\n renderChunk(code, chunk, outputOptions) {\n /* eslint-disable no-unused-vars */\n const _unpackOutputPluginOp = unpackOutputPluginOptions(pluginOptionsWithOverrides, outputOptions),\n babelOptions = _objectWithoutProperties(_unpackOutputPluginOp, [\"allowAllFormats\", \"exclude\", \"extensions\", \"externalHelpers\", \"externalHelpersWhitelist\", \"include\", \"runtimeHelpers\"]);\n /* eslint-enable no-unused-vars */\n\n\n return transformCode(code, babelOptions, overrides, customOptions, this);\n }\n\n };\n };\n} // export this for symmetry with output-related exports\n\n\nconst getBabelInputPlugin = createBabelInputPluginFactory();\nconst getBabelOutputPlugin = createBabelOutputPluginFactory();\n\nexports.babel = getBabelInputPlugin;\nexports.createBabelInputPluginFactory = createBabelInputPluginFactory;\nexports.createBabelOutputPluginFactory = createBabelOutputPluginFactory;\nexports.default = getBabelInputPlugin;\nexports.getBabelInputPlugin = getBabelInputPlugin;\nexports.getBabelOutputPlugin = getBabelOutputPlugin;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar path = require('path');\nvar pm = _interopDefault(require('picomatch'));\n\nconst addExtension = function addExtension(filename, ext = '.js') {\n let result = `${filename}`;\n if (!path.extname(filename))\n result += ext;\n return result;\n};\n\nfunction walk(ast, { enter, leave }) {\n\treturn visit(ast, null, enter, leave);\n}\n\nlet should_skip = false;\nlet should_remove = false;\nlet replacement = null;\nconst context = {\n\tskip: () => should_skip = true,\n\tremove: () => should_remove = true,\n\treplace: (node) => replacement = node\n};\n\nfunction replace(parent, prop, index, node) {\n\tif (parent) {\n\t\tif (index !== null) {\n\t\t\tparent[prop][index] = node;\n\t\t} else {\n\t\t\tparent[prop] = node;\n\t\t}\n\t}\n}\n\nfunction remove(parent, prop, index) {\n\tif (parent) {\n\t\tif (index !== null) {\n\t\t\tparent[prop].splice(index, 1);\n\t\t} else {\n\t\t\tdelete parent[prop];\n\t\t}\n\t}\n}\n\nfunction visit(\n\tnode,\n\tparent,\n\tenter,\n\tleave,\n\tprop,\n\tindex\n) {\n\tif (node) {\n\t\tif (enter) {\n\t\t\tconst _should_skip = should_skip;\n\t\t\tconst _should_remove = should_remove;\n\t\t\tconst _replacement = replacement;\n\t\t\tshould_skip = false;\n\t\t\tshould_remove = false;\n\t\t\treplacement = null;\n\n\t\t\tenter.call(context, node, parent, prop, index);\n\n\t\t\tif (replacement) {\n\t\t\t\tnode = replacement;\n\t\t\t\treplace(parent, prop, index, node);\n\t\t\t}\n\n\t\t\tif (should_remove) {\n\t\t\t\tremove(parent, prop, index);\n\t\t\t}\n\n\t\t\tconst skipped = should_skip;\n\t\t\tconst removed = should_remove;\n\n\t\t\tshould_skip = _should_skip;\n\t\t\tshould_remove = _should_remove;\n\t\t\treplacement = _replacement;\n\n\t\t\tif (skipped) return node;\n\t\t\tif (removed) return null;\n\t\t}\n\n\t\tfor (const key in node) {\n\t\t\tconst value = (node )[key];\n\n\t\t\tif (typeof value !== 'object') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\telse if (Array.isArray(value)) {\n\t\t\t\tfor (let j = 0, k = 0; j < value.length; j += 1, k += 1) {\n\t\t\t\t\tif (value[j] !== null && typeof value[j].type === 'string') {\n\t\t\t\t\t\tif (!visit(value[j], node, enter, leave, key, k)) {\n\t\t\t\t\t\t\t// removed\n\t\t\t\t\t\t\tj--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse if (value !== null && typeof value.type === 'string') {\n\t\t\t\tvisit(value, node, enter, leave, key, null);\n\t\t\t}\n\t\t}\n\n\t\tif (leave) {\n\t\t\tconst _replacement = replacement;\n\t\t\tconst _should_remove = should_remove;\n\t\t\treplacement = null;\n\t\t\tshould_remove = false;\n\n\t\t\tleave.call(context, node, parent, prop, index);\n\n\t\t\tif (replacement) {\n\t\t\t\tnode = replacement;\n\t\t\t\treplace(parent, prop, index, node);\n\t\t\t}\n\n\t\t\tif (should_remove) {\n\t\t\t\tremove(parent, prop, index);\n\t\t\t}\n\n\t\t\tconst removed = should_remove;\n\n\t\t\treplacement = _replacement;\n\t\t\tshould_remove = _should_remove;\n\n\t\t\tif (removed) return null;\n\t\t}\n\t}\n\n\treturn node;\n}\n\nconst extractors = {\n ArrayPattern(names, param) {\n for (const element of param.elements) {\n if (element)\n extractors[element.type](names, element);\n }\n },\n AssignmentPattern(names, param) {\n extractors[param.left.type](names, param.left);\n },\n Identifier(names, param) {\n names.push(param.name);\n },\n MemberExpression() { },\n ObjectPattern(names, param) {\n for (const prop of param.properties) {\n // @ts-ignore Typescript reports that this is not a valid type\n if (prop.type === 'RestElement') {\n extractors.RestElement(names, prop);\n }\n else {\n extractors[prop.value.type](names, prop.value);\n }\n }\n },\n RestElement(names, param) {\n extractors[param.argument.type](names, param.argument);\n }\n};\nconst extractAssignedNames = function extractAssignedNames(param) {\n const names = [];\n extractors[param.type](names, param);\n return names;\n};\n\nconst blockDeclarations = {\n const: true,\n let: true\n};\nclass Scope {\n constructor(options = {}) {\n this.parent = options.parent;\n this.isBlockScope = !!options.block;\n this.declarations = Object.create(null);\n if (options.params) {\n options.params.forEach((param) => {\n extractAssignedNames(param).forEach((name) => {\n this.declarations[name] = true;\n });\n });\n }\n }\n addDeclaration(node, isBlockDeclaration, isVar) {\n if (!isBlockDeclaration && this.isBlockScope) {\n // it's a `var` or function node, and this\n // is a block scope, so we need to go up\n this.parent.addDeclaration(node, isBlockDeclaration, isVar);\n }\n else if (node.id) {\n extractAssignedNames(node.id).forEach((name) => {\n this.declarations[name] = true;\n });\n }\n }\n contains(name) {\n return this.declarations[name] || (this.parent ? this.parent.contains(name) : false);\n }\n}\nconst attachScopes = function attachScopes(ast, propertyName = 'scope') {\n let scope = new Scope();\n walk(ast, {\n enter(n, parent) {\n const node = n;\n // function foo () {...}\n // class Foo {...}\n if (/(Function|Class)Declaration/.test(node.type)) {\n scope.addDeclaration(node, false, false);\n }\n // var foo = 1\n if (node.type === 'VariableDeclaration') {\n const { kind } = node;\n const isBlockDeclaration = blockDeclarations[kind];\n // don't add const/let declarations in the body of a for loop #113\n const parentType = parent ? parent.type : '';\n if (!(isBlockDeclaration && /ForOfStatement/.test(parentType))) {\n node.declarations.forEach((declaration) => {\n scope.addDeclaration(declaration, isBlockDeclaration, true);\n });\n }\n }\n let newScope;\n // create new function scope\n if (/Function/.test(node.type)) {\n const func = node;\n newScope = new Scope({\n parent: scope,\n block: false,\n params: func.params\n });\n // named function expressions - the name is considered\n // part of the function's scope\n if (func.type === 'FunctionExpression' && func.id) {\n newScope.addDeclaration(func, false, false);\n }\n }\n // create new block scope\n if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) {\n newScope = new Scope({\n parent: scope,\n block: true\n });\n }\n // catch clause has its own block scope\n if (node.type === 'CatchClause') {\n newScope = new Scope({\n parent: scope,\n params: node.param ? [node.param] : [],\n block: true\n });\n }\n if (newScope) {\n Object.defineProperty(node, propertyName, {\n value: newScope,\n configurable: true\n });\n scope = newScope;\n }\n },\n leave(n) {\n const node = n;\n if (node[propertyName])\n scope = scope.parent;\n }\n });\n return scope;\n};\n\n// Helper since Typescript can't detect readonly arrays with Array.isArray\nfunction isArray(arg) {\n return Array.isArray(arg);\n}\nfunction ensureArray(thing) {\n if (isArray(thing))\n return thing;\n if (thing == null)\n return [];\n return [thing];\n}\n\nfunction getMatcherString(id, resolutionBase) {\n if (resolutionBase === false) {\n return id;\n }\n // resolve('') is valid and will default to process.cwd()\n const basePath = path.resolve(resolutionBase || '')\n .split(path.sep)\n .join('/')\n // escape all possible (posix + win) path characters that might interfere with regex\n .replace(/[-^$*+?.()|[\\]{}]/g, '\\\\$&');\n // Note that we use posix.join because:\n // 1. the basePath has been normalized to use /\n // 2. the incoming glob (id) matcher, also uses /\n // otherwise Node will force backslash (\\) on windows\n return path.posix.join(basePath, id);\n}\nconst createFilter = function createFilter(include, exclude, options) {\n const resolutionBase = options && options.resolve;\n const getMatcher = (id) => id instanceof RegExp\n ? id\n : {\n test: (what) => {\n // this refactor is a tad overly verbose but makes for easy debugging\n const pattern = getMatcherString(id, resolutionBase);\n const fn = pm(pattern, { dot: true });\n const result = fn(what);\n return result;\n }\n };\n const includeMatchers = ensureArray(include).map(getMatcher);\n const excludeMatchers = ensureArray(exclude).map(getMatcher);\n return function result(id) {\n if (typeof id !== 'string')\n return false;\n if (/\\0/.test(id))\n return false;\n const pathId = id.split(path.sep).join('/');\n for (let i = 0; i < excludeMatchers.length; ++i) {\n const matcher = excludeMatchers[i];\n if (matcher.test(pathId))\n return false;\n }\n for (let i = 0; i < includeMatchers.length; ++i) {\n const matcher = includeMatchers[i];\n if (matcher.test(pathId))\n return true;\n }\n return !includeMatchers.length;\n };\n};\n\nconst reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';\nconst builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';\nconst forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' '));\nforbiddenIdentifiers.add('');\nconst makeLegalIdentifier = function makeLegalIdentifier(str) {\n let identifier = str\n .replace(/-(\\w)/g, (_, letter) => letter.toUpperCase())\n .replace(/[^$_a-zA-Z0-9]/g, '_');\n if (/\\d/.test(identifier[0]) || forbiddenIdentifiers.has(identifier)) {\n identifier = `_${identifier}`;\n }\n return identifier || '_';\n};\n\nfunction stringify(obj) {\n return (JSON.stringify(obj) || 'undefined').replace(/[\\u2028\\u2029]/g, (char) => `\\\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`);\n}\nfunction serializeArray(arr, indent, baseIndent) {\n let output = '[';\n const separator = indent ? `\\n${baseIndent}${indent}` : '';\n for (let i = 0; i < arr.length; i++) {\n const key = arr[i];\n output += `${i > 0 ? ',' : ''}${separator}${serialize(key, indent, baseIndent + indent)}`;\n }\n return `${output}${indent ? `\\n${baseIndent}` : ''}]`;\n}\nfunction serializeObject(obj, indent, baseIndent) {\n let output = '{';\n const separator = indent ? `\\n${baseIndent}${indent}` : '';\n const entries = Object.entries(obj);\n for (let i = 0; i < entries.length; i++) {\n const [key, value] = entries[i];\n const stringKey = makeLegalIdentifier(key) === key ? key : stringify(key);\n output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize(value, indent, baseIndent + indent)}`;\n }\n return `${output}${indent ? `\\n${baseIndent}` : ''}}`;\n}\nfunction serialize(obj, indent, baseIndent) {\n if (obj === Infinity)\n return 'Infinity';\n if (obj === -Infinity)\n return '-Infinity';\n if (obj === 0 && 1 / obj === -Infinity)\n return '-0';\n if (obj instanceof Date)\n return `new Date(${obj.getTime()})`;\n if (obj instanceof RegExp)\n return obj.toString();\n if (obj !== obj)\n return 'NaN'; // eslint-disable-line no-self-compare\n if (Array.isArray(obj))\n return serializeArray(obj, indent, baseIndent);\n if (obj === null)\n return 'null';\n if (typeof obj === 'object')\n return serializeObject(obj, indent, baseIndent);\n return stringify(obj);\n}\nconst dataToEsm = function dataToEsm(data, options = {}) {\n const t = options.compact ? '' : 'indent' in options ? options.indent : '\\t';\n const _ = options.compact ? '' : ' ';\n const n = options.compact ? '' : '\\n';\n const declarationType = options.preferConst ? 'const' : 'var';\n if (options.namedExports === false ||\n typeof data !== 'object' ||\n Array.isArray(data) ||\n data instanceof Date ||\n data instanceof RegExp ||\n data === null) {\n const code = serialize(data, options.compact ? null : t, '');\n const magic = _ || (/^[{[\\-\\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape\n return `export default${magic}${code};`;\n }\n let namedExportCode = '';\n const defaultExportRows = [];\n for (const [key, value] of Object.entries(data)) {\n if (key === makeLegalIdentifier(key)) {\n if (options.objectShorthand)\n defaultExportRows.push(key);\n else\n defaultExportRows.push(`${key}:${_}${key}`);\n namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;\n }\n else {\n defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);\n }\n }\n return `${namedExportCode}export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;\n};\n\n// TODO: remove this in next major\nvar index = {\n addExtension,\n attachScopes,\n createFilter,\n dataToEsm,\n extractAssignedNames,\n makeLegalIdentifier\n};\n\nexports.addExtension = addExtension;\nexports.attachScopes = attachScopes;\nexports.createFilter = createFilter;\nexports.dataToEsm = dataToEsm;\nexports.default = index;\nexports.extractAssignedNames = extractAssignedNames;\nexports.makeLegalIdentifier = makeLegalIdentifier;\n","\"use strict\";\nfunction once(emitter, name) {\n let c = null;\n const p = new Promise((resolve, reject) => {\n function cancel() {\n emitter.removeListener(name, onEvent);\n emitter.removeListener('error', onError);\n }\n function onEvent(arg) {\n cancel();\n resolve(arg);\n }\n function onError(err) {\n cancel();\n reject(err);\n }\n c = cancel;\n emitter.on(name, onEvent);\n emitter.on('error', onError);\n });\n if (!c) {\n throw new TypeError('Could not get `cancel()` function');\n }\n p.cancel = c;\n return p;\n}\nmodule.exports = once;\n//# sourceMappingURL=index.js.map","// MIT license (by Elan Shanker).\n(function(globals) {\n 'use strict';\n\n var executeSync = function(){\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'function'){\n args[0].apply(null, args.splice(1));\n }\n };\n\n var executeAsync = function(fn){\n if (typeof setImmediate === 'function') {\n setImmediate(fn);\n } else if (typeof process !== 'undefined' && process.nextTick) {\n process.nextTick(fn);\n } else {\n setTimeout(fn, 0);\n }\n };\n\n var makeIterator = function (tasks) {\n var makeCallback = function (index) {\n var fn = function () {\n if (tasks.length) {\n tasks[index].apply(null, arguments);\n }\n return fn.next();\n };\n fn.next = function () {\n return (index < tasks.length - 1) ? makeCallback(index + 1): null;\n };\n return fn;\n };\n return makeCallback(0);\n };\n \n var _isArray = Array.isArray || function(maybeArray){\n return Object.prototype.toString.call(maybeArray) === '[object Array]';\n };\n\n var waterfall = function (tasks, callback, forceAsync) {\n var nextTick = forceAsync ? executeAsync : executeSync;\n callback = callback || function () {};\n if (!_isArray(tasks)) {\n var err = new Error('First argument to waterfall must be an array of functions');\n return callback(err);\n }\n if (!tasks.length) {\n return callback();\n }\n var wrapIterator = function (iterator) {\n return function (err) {\n if (err) {\n callback.apply(null, arguments);\n callback = function () {};\n } else {\n var args = Array.prototype.slice.call(arguments, 1);\n var next = iterator.next();\n if (next) {\n args.push(wrapIterator(next));\n } else {\n args.push(callback);\n }\n nextTick(function () {\n iterator.apply(null, args);\n });\n }\n };\n };\n wrapIterator(makeIterator(tasks))();\n };\n\n if (typeof define !== 'undefined' && define.amd) {\n define([], function () {\n return waterfall;\n }); // RequireJS\n } else if (typeof module !== 'undefined' && module.exports) {\n module.exports = waterfall; // CommonJS\n } else {\n globals.waterfall = waterfall; //