From 17f7f06ca5daf4d7cded40bef26d645a64f0bd79 Mon Sep 17 00:00:00 2001 From: Kara Erickson Date: Fri, 13 Dec 2019 13:06:47 -0800 Subject: [PATCH] Revert "build: update to yarn@1.21.1" (#34402) This reverts commit f029af50820765019413fa319330830306b80d6a while we investigate some failures on master on Circle CI. Currently the Windows tests and the "test-ivy-aot" jobs are red because of incompatible yarn versions. PR Close #34402 --- .circleci/config.yml | 2 +- WORKSPACE | 12 +- aio/package.json | 2 +- aio/tools/examples/shared/package.json | 6 +- package.json | 2 +- .../yarnpkg/yarn/releases/BUILD.bazel | 2 +- .../download/{v1.21.1 => v1.17.3}/LICENSE | 0 .../lib/cli.js => v1.17.3/bin/yarn.js} | 162917 +++++++-------- .../yarn/releases/download/v1.21.1/README.md | 60 - .../yarn/releases/download/v1.21.1/bin/yarn | 35 - .../releases/download/v1.21.1/bin/yarn.cmd | 2 - .../releases/download/v1.21.1/bin/yarn.js | 31 - .../releases/download/v1.21.1/bin/yarnpkg | 2 - .../releases/download/v1.21.1/bin/yarnpkg.cmd | 2 - .../download/v1.21.1/lib/v8-compile-cache.js | 351 - .../releases/download/v1.21.1/package.json | 24 - 16 files changed, 78374 insertions(+), 85076 deletions(-) rename third_party/github.com/yarnpkg/yarn/releases/download/{v1.21.1 => v1.17.3}/LICENSE (100%) rename third_party/github.com/yarnpkg/yarn/releases/download/{v1.21.1/lib/cli.js => v1.17.3/bin/yarn.js} (87%) mode change 100755 => 100644 delete mode 100644 third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/README.md delete mode 100755 third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/bin/yarn delete mode 100755 third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/bin/yarn.cmd delete mode 100755 third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/bin/yarn.js delete mode 100755 third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/bin/yarnpkg delete mode 100755 third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/bin/yarnpkg.cmd delete mode 100644 third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/lib/v8-compile-cache.js delete mode 100644 third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/package.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 82fa270eca..28bb6c3890 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -129,7 +129,7 @@ commands: # Overwrite the yarn installed in the docker container with our own version. name: Overwrite yarn with our own version command: | - ourYarn=$(realpath ./third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/bin/yarn.js) + ourYarn=$(realpath ./third_party/github.com/yarnpkg/yarn/releases/download/v1.17.3/bin/yarn.js) sudo chmod a+x $ourYarn sudo ln -fs $ourYarn /usr/local/bin/yarn - run: echo "Yarn version $(yarn --version)" diff --git a/WORKSPACE b/WORKSPACE index c88ae3dad2..8f975b9027 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -41,9 +41,17 @@ node_repositories( node_version = "10.16.0", package_json = ["//:package.json"], yarn_repositories = { - "1.21.1": ("yarn-v1.21.1.tar.gz", "yarn-v1.21.1", "d1d9f4a0f16f5ed484e814afeb98f39b82d4728c6c8beaafb5abc99c02db6674"), + "1.17.3": ("yarn-v1.17.3.tar.gz", "yarn-v1.17.3", "e3835194409f1b3afa1c62ca82f561f1c29d26580c9e220c36866317e043c6f3"), }, - yarn_version = "1.21.1", + # yarn 1.13.0 under Bazel has a regression on Windows that causes build errors on rebuilds: + # ``` + # ERROR: Source forest creation failed: C:/.../fyuc5c3n/execroot/angular/external (Directory not empty) + # ``` + # See https://github.com/angular/angular/pull/29431 for more information. + # It possible that versions of yarn past 1.13.0 do not have this issue, however, before + # advancing this version we need to test manually on Windows that the above error does not + # happen as the issue is not caught by CI. + yarn_version = "1.17.3", ) yarn_install( diff --git a/aio/package.json b/aio/package.json index 6056868c40..53752720e6 100644 --- a/aio/package.json +++ b/aio/package.json @@ -83,7 +83,7 @@ "//engines-comment": "Keep this in sync with /package.json and /aio/tools/examples/shared/package.json", "engines": { "node": ">=10.9.0 <13.0.0", - "yarn": ">=1.21.1 <2" + "yarn": ">=1.17.3 <2" }, "private": true, "dependencies": { diff --git a/aio/tools/examples/shared/package.json b/aio/tools/examples/shared/package.json index 7c0b589272..186ad400c3 100644 --- a/aio/tools/examples/shared/package.json +++ b/aio/tools/examples/shared/package.json @@ -13,7 +13,7 @@ "//engines-comment": "Keep this in sync with /package.json and /aio/package.json", "engines": { "node": ">=10.9.0 <13.0.0", - "yarn": ">=1.21.1 <2" + "yarn": ">=1.17.3 <2" }, "keywords": [], "author": "", @@ -58,8 +58,8 @@ "@types/express": "^4.0.35", "@types/jasmine": "~2.8.8", "@types/jasminewd2": "^2.0.4", - "@types/jquery": "3.3.28", - "@types/node": "~12.12.14", + "@types/jquery":"3.3.28", + "@types/node":"~12.12.14", "canonical-path": "1.0.0", "concurrently": "^3.0.0", "http-server": "^0.11.1", diff --git a/package.json b/package.json index 60dc44aa23..a3b619c9f9 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "//engines-comment": "Keep this in sync with /aio/package.json and /aio/tools/examples/shared/package.json", "engines": { "node": ">=10.9.0 <13.0.0", - "yarn": ">=1.21.1 <2" + "yarn": ">=1.17.3 <2" }, "repository": { "type": "git", diff --git a/third_party/github.com/yarnpkg/yarn/releases/BUILD.bazel b/third_party/github.com/yarnpkg/yarn/releases/BUILD.bazel index e86e5ca0c4..f6d5e39d78 100644 --- a/third_party/github.com/yarnpkg/yarn/releases/BUILD.bazel +++ b/third_party/github.com/yarnpkg/yarn/releases/BUILD.bazel @@ -1,2 +1,2 @@ -# Fetched from https://github.com/yarnpkg/yarn/releases/download/v1.21.1/yarn-v1.21.1.tar.gz +# Fetched from https://github.com/yarnpkg/yarn/releases/download/v1.13.0/yarn-v1.13.0.tar.gz licenses(["notice"]) diff --git a/third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/LICENSE b/third_party/github.com/yarnpkg/yarn/releases/download/v1.17.3/LICENSE similarity index 100% rename from third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/LICENSE rename to third_party/github.com/yarnpkg/yarn/releases/download/v1.17.3/LICENSE diff --git a/third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/lib/cli.js b/third_party/github.com/yarnpkg/yarn/releases/download/v1.17.3/bin/yarn.js old mode 100755 new mode 100644 similarity index 87% rename from third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/lib/cli.js rename to third_party/github.com/yarnpkg/yarn/releases/download/v1.17.3/bin/yarn.js index 78ec11ff15..0128e82176 --- a/third_party/github.com/yarnpkg/yarn/releases/download/v1.21.1/lib/cli.js +++ b/third_party/github.com/yarnpkg/yarn/releases/download/v1.17.3/bin/yarn.js @@ -65,11 +65,17 @@ module.exports = /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 536); +/******/ return __webpack_require__(__webpack_require__.s = 548); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ +/***/ (function(module, exports) { + +module.exports = require("path"); + +/***/ }), +/* 1 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -280,12 +286,6 @@ function __importDefault(mod) { } -/***/ }), -/* 1 */ -/***/ (function(module, exports) { - -module.exports = require("path"); - /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { @@ -295,7 +295,7 @@ module.exports = require("path"); exports.__esModule = true; -var _promise = __webpack_require__(7); +var _promise = __webpack_require__(227); var _promise2 = _interopRequireDefault(_promise); @@ -332,39 +332,1256 @@ exports.default = function (fn) { /***/ }), /* 3 */ +/***/ (function(module, exports) { + +module.exports = require("util"); + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +module.exports = require("fs"); + +/***/ }), +/* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -exports.__esModule = true; - -exports.default = function (instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +class MessageError extends Error { + constructor(msg, code) { + super(msg); + this.code = code; } -}; + +} + +exports.MessageError = MessageError; +class ProcessSpawnError extends MessageError { + constructor(msg, code, process) { + super(msg, code); + this.process = process; + } + +} + +exports.ProcessSpawnError = ProcessSpawnError; +class SecurityError extends MessageError {} + +exports.SecurityError = SecurityError; +class ProcessTermError extends MessageError {} + +exports.ProcessTermError = ProcessTermError; +class ResponseError extends Error { + constructor(msg, responseCode) { + super(msg); + this.responseCode = responseCode; + } + +} + +exports.ResponseError = ResponseError; +class OneTimePasswordError extends Error {} +exports.OneTimePasswordError = OneTimePasswordError; /***/ }), -/* 4 */ +/* 6 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = { "default": __webpack_require__(623), __esModule: true }; +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getFirstSuitableFolder = exports.readFirstAvailableStream = exports.makeTempDir = exports.hardlinksWork = exports.writeFilePreservingEol = exports.getFileSizeOnDisk = exports.walk = exports.symlink = exports.find = exports.readJsonAndFile = exports.readJson = exports.readFileAny = exports.hardlinkBulk = exports.copyBulk = exports.unlink = exports.glob = exports.link = exports.chmod = exports.lstat = exports.exists = exports.mkdirp = exports.stat = exports.access = exports.rename = exports.readdir = exports.realpath = exports.readlink = exports.writeFile = exports.open = exports.readFileBuffer = exports.lockQueue = exports.constants = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +let buildActionsForCopy = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { + + // + let build = (() => { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + const src = data.src, + dest = data.dest, + type = data.type; + + const onFresh = data.onFresh || noop; + const onDone = data.onDone || noop; + + // TODO https://github.com/yarnpkg/yarn/issues/3751 + // related to bundled dependencies handling + if (files.has(dest.toLowerCase())) { + reporter.verbose(`The case-insensitive file ${dest} shouldn't be copied twice in one bulk copy`); + } else { + files.add(dest.toLowerCase()); + } + + if (type === 'symlink') { + yield mkdirp((_path || _load_path()).default.dirname(dest)); + onFresh(); + actions.symlink.push({ + dest, + linkname: src + }); + onDone(); + return; + } + + if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) { + // ignored file + return; + } + + const srcStat = yield lstat(src); + let srcFiles; + + if (srcStat.isDirectory()) { + srcFiles = yield readdir(src); + } + + let destStat; + try { + // try accessing the destination + destStat = yield lstat(dest); + } catch (e) { + // proceed if destination doesn't exist, otherwise error + if (e.code !== 'ENOENT') { + throw e; + } + } + + // if destination exists + if (destStat) { + const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); + const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); + const bothFiles = srcStat.isFile() && destStat.isFile(); + + // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving + // us modes that aren't valid. investigate this, it's generally safe to proceed. + + /* if (srcStat.mode !== destStat.mode) { + try { + await access(dest, srcStat.mode); + } catch (err) {} + } */ + + if (bothFiles && artifactFiles.has(dest)) { + // this file gets changed during build, likely by a custom install script. Don't bother checking it. + onDone(); + reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); + return; + } + + if (bothFiles && srcStat.size === destStat.size && (0, (_fsNormalized || _load_fsNormalized()).fileDatesEqual)(srcStat.mtime, destStat.mtime)) { + // we can safely assume this is the same file + onDone(); + reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.size, +srcStat.mtime)); + return; + } + + if (bothSymlinks) { + const srcReallink = yield readlink(src); + if (srcReallink === (yield readlink(dest))) { + // if both symlinks are the same then we can continue on + onDone(); + reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink)); + return; + } + } + + if (bothFolders) { + // mark files that aren't in this folder as possibly extraneous + const destFiles = yield readdir(dest); + invariant(srcFiles, 'src files not initialised'); + + for (var _iterator4 = destFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref6; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref6 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref6 = _i4.value; + } + + const file = _ref6; + + if (srcFiles.indexOf(file) < 0) { + const loc = (_path || _load_path()).default.join(dest, file); + possibleExtraneous.add(loc); + + if ((yield lstat(loc)).isDirectory()) { + for (var _iterator5 = yield readdir(loc), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref7; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref7 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref7 = _i5.value; + } + + const file = _ref7; + + possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); + } + } + } + } + } + } + + if (destStat && destStat.isSymbolicLink()) { + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); + destStat = null; + } + + if (srcStat.isSymbolicLink()) { + onFresh(); + const linkname = yield readlink(src); + actions.symlink.push({ + dest, + linkname + }); + onDone(); + } else if (srcStat.isDirectory()) { + if (!destStat) { + reporter.verbose(reporter.lang('verboseFileFolder', dest)); + yield mkdirp(dest); + } + + const destParts = dest.split((_path || _load_path()).default.sep); + while (destParts.length) { + files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); + destParts.pop(); + } + + // push all files to queue + invariant(srcFiles, 'src files not initialised'); + let remaining = srcFiles.length; + if (!remaining) { + onDone(); + } + for (var _iterator6 = srcFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref8; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref8 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref8 = _i6.value; + } + + const file = _ref8; + + queue.push({ + dest: (_path || _load_path()).default.join(dest, file), + onFresh, + onDone: function (_onDone) { + function onDone() { + return _onDone.apply(this, arguments); + } + + onDone.toString = function () { + return _onDone.toString(); + }; + + return onDone; + }(function () { + if (--remaining === 0) { + onDone(); + } + }), + src: (_path || _load_path()).default.join(src, file) + }); + } + } else if (srcStat.isFile()) { + onFresh(); + actions.file.push({ + src, + dest, + atime: srcStat.atime, + mtime: srcStat.mtime, + mode: srcStat.mode + }); + onDone(); + } else { + throw new Error(`unsure how to copy this: ${src}`); + } + }); + + return function build(_x5) { + return _ref5.apply(this, arguments); + }; + })(); + + const artifactFiles = new Set(events.artifactFiles || []); + const files = new Set(); + + // initialise events + for (var _iterator = queue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + const item = _ref2; + + const onDone = item.onDone; + item.onDone = function () { + events.onProgress(item.dest); + if (onDone) { + onDone(); + } + }; + } + events.onStart(queue.length); + + // start building actions + const actions = { + file: [], + symlink: [], + link: [] + }; + + // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items + // at a time due to the requirement to push items onto the queue + while (queue.length) { + const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); + yield Promise.all(items.map(build)); + } + + // simulate the existence of some files to prevent considering them extraneous + for (var _iterator2 = artifactFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + const file = _ref3; + + if (possibleExtraneous.has(file)) { + reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); + possibleExtraneous.delete(file); + } + } + + for (var _iterator3 = possibleExtraneous, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + const loc = _ref4; + + if (files.has(loc.toLowerCase())) { + possibleExtraneous.delete(loc); + } + } + + return actions; + }); + + return function buildActionsForCopy(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); + +let buildActionsForHardlink = (() => { + var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { + + // + let build = (() => { + var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + const src = data.src, + dest = data.dest; + + const onFresh = data.onFresh || noop; + const onDone = data.onDone || noop; + if (files.has(dest.toLowerCase())) { + // Fixes issue https://github.com/yarnpkg/yarn/issues/2734 + // When bulk hardlinking we have A -> B structure that we want to hardlink to A1 -> B1, + // package-linker passes that modules A1 and B1 need to be hardlinked, + // the recursive linking algorithm of A1 ends up scheduling files in B1 to be linked twice which will case + // an exception. + onDone(); + return; + } + files.add(dest.toLowerCase()); + + if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) { + // ignored file + return; + } + + const srcStat = yield lstat(src); + let srcFiles; + + if (srcStat.isDirectory()) { + srcFiles = yield readdir(src); + } + + const destExists = yield exists(dest); + if (destExists) { + const destStat = yield lstat(dest); + + const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); + const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); + const bothFiles = srcStat.isFile() && destStat.isFile(); + + if (srcStat.mode !== destStat.mode) { + try { + yield access(dest, srcStat.mode); + } catch (err) { + // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving + // us modes that aren't valid. investigate this, it's generally safe to proceed. + reporter.verbose(err); + } + } + + if (bothFiles && artifactFiles.has(dest)) { + // this file gets changed during build, likely by a custom install script. Don't bother checking it. + onDone(); + reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); + return; + } + + // correct hardlink + if (bothFiles && srcStat.ino !== null && srcStat.ino === destStat.ino) { + onDone(); + reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.ino)); + return; + } + + if (bothSymlinks) { + const srcReallink = yield readlink(src); + if (srcReallink === (yield readlink(dest))) { + // if both symlinks are the same then we can continue on + onDone(); + reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink)); + return; + } + } + + if (bothFolders) { + // mark files that aren't in this folder as possibly extraneous + const destFiles = yield readdir(dest); + invariant(srcFiles, 'src files not initialised'); + + for (var _iterator10 = destFiles, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { + var _ref14; + + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref14 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref14 = _i10.value; + } + + const file = _ref14; + + if (srcFiles.indexOf(file) < 0) { + const loc = (_path || _load_path()).default.join(dest, file); + possibleExtraneous.add(loc); + + if ((yield lstat(loc)).isDirectory()) { + for (var _iterator11 = yield readdir(loc), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { + var _ref15; + + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref15 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref15 = _i11.value; + } + + const file = _ref15; + + possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); + } + } + } + } + } + } + + if (srcStat.isSymbolicLink()) { + onFresh(); + const linkname = yield readlink(src); + actions.symlink.push({ + dest, + linkname + }); + onDone(); + } else if (srcStat.isDirectory()) { + reporter.verbose(reporter.lang('verboseFileFolder', dest)); + yield mkdirp(dest); + + const destParts = dest.split((_path || _load_path()).default.sep); + while (destParts.length) { + files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); + destParts.pop(); + } + + // push all files to queue + invariant(srcFiles, 'src files not initialised'); + let remaining = srcFiles.length; + if (!remaining) { + onDone(); + } + for (var _iterator12 = srcFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { + var _ref16; + + if (_isArray12) { + if (_i12 >= _iterator12.length) break; + _ref16 = _iterator12[_i12++]; + } else { + _i12 = _iterator12.next(); + if (_i12.done) break; + _ref16 = _i12.value; + } + + const file = _ref16; + + queue.push({ + onFresh, + src: (_path || _load_path()).default.join(src, file), + dest: (_path || _load_path()).default.join(dest, file), + onDone: function (_onDone2) { + function onDone() { + return _onDone2.apply(this, arguments); + } + + onDone.toString = function () { + return _onDone2.toString(); + }; + + return onDone; + }(function () { + if (--remaining === 0) { + onDone(); + } + }) + }); + } + } else if (srcStat.isFile()) { + onFresh(); + actions.link.push({ + src, + dest, + removeDest: destExists + }); + onDone(); + } else { + throw new Error(`unsure how to copy this: ${src}`); + } + }); + + return function build(_x10) { + return _ref13.apply(this, arguments); + }; + })(); + + const artifactFiles = new Set(events.artifactFiles || []); + const files = new Set(); + + // initialise events + for (var _iterator7 = queue, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref10; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref10 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref10 = _i7.value; + } + + const item = _ref10; + + const onDone = item.onDone || noop; + item.onDone = function () { + events.onProgress(item.dest); + onDone(); + }; + } + events.onStart(queue.length); + + // start building actions + const actions = { + file: [], + symlink: [], + link: [] + }; + + // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items + // at a time due to the requirement to push items onto the queue + while (queue.length) { + const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); + yield Promise.all(items.map(build)); + } + + // simulate the existence of some files to prevent considering them extraneous + for (var _iterator8 = artifactFiles, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { + var _ref11; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref11 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref11 = _i8.value; + } + + const file = _ref11; + + if (possibleExtraneous.has(file)) { + reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); + possibleExtraneous.delete(file); + } + } + + for (var _iterator9 = possibleExtraneous, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { + var _ref12; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref12 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref12 = _i9.value; + } + + const loc = _ref12; + + if (files.has(loc.toLowerCase())) { + possibleExtraneous.delete(loc); + } + } + + return actions; + }); + + return function buildActionsForHardlink(_x6, _x7, _x8, _x9) { + return _ref9.apply(this, arguments); + }; +})(); + +let copyBulk = exports.copyBulk = (() => { + var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { + const events = { + onStart: _events && _events.onStart || noop, + onProgress: _events && _events.onProgress || noop, + possibleExtraneous: _events ? _events.possibleExtraneous : new Set(), + ignoreBasenames: _events && _events.ignoreBasenames || [], + artifactFiles: _events && _events.artifactFiles || [] + }; + + const actions = yield buildActionsForCopy(queue, events, events.possibleExtraneous, reporter); + events.onStart(actions.file.length + actions.symlink.length + actions.link.length); + + const fileActions = actions.file; + + const currentlyWriting = new Map(); + + yield (_promise || _load_promise()).queue(fileActions, (() => { + var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + let writePromise; + while (writePromise = currentlyWriting.get(data.dest)) { + yield writePromise; + } + + reporter.verbose(reporter.lang('verboseFileCopy', data.src, data.dest)); + const copier = (0, (_fsNormalized || _load_fsNormalized()).copyFile)(data, function () { + return currentlyWriting.delete(data.dest); + }); + currentlyWriting.set(data.dest, copier); + events.onProgress(data.dest); + return copier; + }); + + return function (_x14) { + return _ref18.apply(this, arguments); + }; + })(), CONCURRENT_QUEUE_ITEMS); + + // we need to copy symlinks last as they could reference files we were copying + const symlinkActions = actions.symlink; + yield (_promise || _load_promise()).queue(symlinkActions, function (data) { + const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); + reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); + return symlink(linkname, data.dest); + }); + }); + + return function copyBulk(_x11, _x12, _x13) { + return _ref17.apply(this, arguments); + }; +})(); + +let hardlinkBulk = exports.hardlinkBulk = (() => { + var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { + const events = { + onStart: _events && _events.onStart || noop, + onProgress: _events && _events.onProgress || noop, + possibleExtraneous: _events ? _events.possibleExtraneous : new Set(), + artifactFiles: _events && _events.artifactFiles || [], + ignoreBasenames: [] + }; + + const actions = yield buildActionsForHardlink(queue, events, events.possibleExtraneous, reporter); + events.onStart(actions.file.length + actions.symlink.length + actions.link.length); + + const fileActions = actions.link; + + yield (_promise || _load_promise()).queue(fileActions, (() => { + var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + reporter.verbose(reporter.lang('verboseFileLink', data.src, data.dest)); + if (data.removeDest) { + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(data.dest); + } + yield link(data.src, data.dest); + }); + + return function (_x18) { + return _ref20.apply(this, arguments); + }; + })(), CONCURRENT_QUEUE_ITEMS); + + // we need to copy symlinks last as they could reference files we were copying + const symlinkActions = actions.symlink; + yield (_promise || _load_promise()).queue(symlinkActions, function (data) { + const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); + reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); + return symlink(linkname, data.dest); + }); + }); + + return function hardlinkBulk(_x15, _x16, _x17) { + return _ref19.apply(this, arguments); + }; +})(); + +let readFileAny = exports.readFileAny = (() => { + var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) { + for (var _iterator13 = files, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { + var _ref22; + + if (_isArray13) { + if (_i13 >= _iterator13.length) break; + _ref22 = _iterator13[_i13++]; + } else { + _i13 = _iterator13.next(); + if (_i13.done) break; + _ref22 = _i13.value; + } + + const file = _ref22; + + if (yield exists(file)) { + return readFile(file); + } + } + return null; + }); + + return function readFileAny(_x19) { + return _ref21.apply(this, arguments); + }; +})(); + +let readJson = exports.readJson = (() => { + var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { + return (yield readJsonAndFile(loc)).object; + }); + + return function readJson(_x20) { + return _ref23.apply(this, arguments); + }; +})(); + +let readJsonAndFile = exports.readJsonAndFile = (() => { + var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { + const file = yield readFile(loc); + try { + return { + object: (0, (_map || _load_map()).default)(JSON.parse(stripBOM(file))), + content: file + }; + } catch (err) { + err.message = `${loc}: ${err.message}`; + throw err; + } + }); + + return function readJsonAndFile(_x21) { + return _ref24.apply(this, arguments); + }; +})(); + +let find = exports.find = (() => { + var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) { + const parts = dir.split((_path || _load_path()).default.sep); + + while (parts.length) { + const loc = parts.concat(filename).join((_path || _load_path()).default.sep); + + if (yield exists(loc)) { + return loc; + } else { + parts.pop(); + } + } + + return false; + }); + + return function find(_x22, _x23) { + return _ref25.apply(this, arguments); + }; +})(); + +let symlink = exports.symlink = (() => { + var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) { + if (process.platform !== 'win32') { + // use relative paths otherwise which will be retained if the directory is moved + src = (_path || _load_path()).default.relative((_path || _load_path()).default.dirname(dest), src); + // When path.relative returns an empty string for the current directory, we should instead use + // '.', which is a valid fs.symlink target. + src = src || '.'; + } + + try { + const stats = yield lstat(dest); + if (stats.isSymbolicLink()) { + const resolved = dest; + if (resolved === src) { + return; + } + } + } catch (err) { + if (err.code !== 'ENOENT') { + throw err; + } + } + + // We use rimraf for unlink which never throws an ENOENT on missing target + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); + + if (process.platform === 'win32') { + // use directory junctions if possible on win32, this requires absolute paths + yield fsSymlink(src, dest, 'junction'); + } else { + yield fsSymlink(src, dest); + } + }); + + return function symlink(_x24, _x25) { + return _ref26.apply(this, arguments); + }; +})(); + +let walk = exports.walk = (() => { + var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir, ignoreBasenames = new Set()) { + let files = []; + + let filenames = yield readdir(dir); + if (ignoreBasenames.size) { + filenames = filenames.filter(function (name) { + return !ignoreBasenames.has(name); + }); + } + + for (var _iterator14 = filenames, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { + var _ref28; + + if (_isArray14) { + if (_i14 >= _iterator14.length) break; + _ref28 = _iterator14[_i14++]; + } else { + _i14 = _iterator14.next(); + if (_i14.done) break; + _ref28 = _i14.value; + } + + const name = _ref28; + + const relative = relativeDir ? (_path || _load_path()).default.join(relativeDir, name) : name; + const loc = (_path || _load_path()).default.join(dir, name); + const stat = yield lstat(loc); + + files.push({ + relative, + basename: name, + absolute: loc, + mtime: +stat.mtime + }); + + if (stat.isDirectory()) { + files = files.concat((yield walk(loc, relative, ignoreBasenames))); + } + } + + return files; + }); + + return function walk(_x26, _x27) { + return _ref27.apply(this, arguments); + }; +})(); + +let getFileSizeOnDisk = exports.getFileSizeOnDisk = (() => { + var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { + const stat = yield lstat(loc); + const size = stat.size, + blockSize = stat.blksize; + + + return Math.ceil(size / blockSize) * blockSize; + }); + + return function getFileSizeOnDisk(_x28) { + return _ref29.apply(this, arguments); + }; +})(); + +let getEolFromFile = (() => { + var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) { + if (!(yield exists(path))) { + return undefined; + } + + const buffer = yield readFileBuffer(path); + + for (let i = 0; i < buffer.length; ++i) { + if (buffer[i] === cr) { + return '\r\n'; + } + if (buffer[i] === lf) { + return '\n'; + } + } + return undefined; + }); + + return function getEolFromFile(_x29) { + return _ref30.apply(this, arguments); + }; +})(); + +let writeFilePreservingEol = exports.writeFilePreservingEol = (() => { + var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) { + const eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL; + if (eol !== '\n') { + data = data.replace(/\n/g, eol); + } + yield writeFile(path, data); + }); + + return function writeFilePreservingEol(_x30, _x31) { + return _ref31.apply(this, arguments); + }; +})(); + +let hardlinksWork = exports.hardlinksWork = (() => { + var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { + const filename = 'test-file' + Math.random(); + const file = (_path || _load_path()).default.join(dir, filename); + const fileLink = (_path || _load_path()).default.join(dir, filename + '-link'); + try { + yield writeFile(file, 'test'); + yield link(file, fileLink); + } catch (err) { + return false; + } finally { + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file); + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(fileLink); + } + return true; + }); + + return function hardlinksWork(_x32) { + return _ref32.apply(this, arguments); + }; +})(); + +// not a strict polyfill for Node's fs.mkdtemp + + +let makeTempDir = exports.makeTempDir = (() => { + var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) { + const dir = (_path || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ''}-${Date.now()}-${Math.random()}`); + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir); + yield mkdirp(dir); + return dir; + }); + + return function makeTempDir(_x33) { + return _ref33.apply(this, arguments); + }; +})(); + +let readFirstAvailableStream = exports.readFirstAvailableStream = (() => { + var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { + for (var _iterator15 = paths, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { + var _ref35; + + if (_isArray15) { + if (_i15 >= _iterator15.length) break; + _ref35 = _iterator15[_i15++]; + } else { + _i15 = _iterator15.next(); + if (_i15.done) break; + _ref35 = _i15.value; + } + + const path = _ref35; + + try { + const fd = yield open(path, 'r'); + return (_fs || _load_fs()).default.createReadStream(path, { fd }); + } catch (err) { + // Try the next one + } + } + return null; + }); + + return function readFirstAvailableStream(_x34) { + return _ref34.apply(this, arguments); + }; +})(); + +let getFirstSuitableFolder = exports.getFirstSuitableFolder = (() => { + var _ref36 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths, mode = constants.W_OK | constants.X_OK) { + const result = { + skipped: [], + folder: null + }; + + for (var _iterator16 = paths, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) { + var _ref37; + + if (_isArray16) { + if (_i16 >= _iterator16.length) break; + _ref37 = _iterator16[_i16++]; + } else { + _i16 = _iterator16.next(); + if (_i16.done) break; + _ref37 = _i16.value; + } + + const folder = _ref37; + + try { + yield mkdirp(folder); + yield access(folder, mode); + + result.folder = folder; + + return result; + } catch (error) { + result.skipped.push({ + error, + folder + }); + } + } + return result; + }); + + return function getFirstSuitableFolder(_x35) { + return _ref36.apply(this, arguments); + }; +})(); + +exports.copy = copy; +exports.readFile = readFile; +exports.readFileRaw = readFileRaw; +exports.normalizeOS = normalizeOS; + +var _fs; + +function _load_fs() { + return _fs = _interopRequireDefault(__webpack_require__(4)); +} + +var _glob; + +function _load_glob() { + return _glob = _interopRequireDefault(__webpack_require__(99)); +} + +var _os; + +function _load_os() { + return _os = _interopRequireDefault(__webpack_require__(49)); +} + +var _path; + +function _load_path() { + return _path = _interopRequireDefault(__webpack_require__(0)); +} + +var _blockingQueue; + +function _load_blockingQueue() { + return _blockingQueue = _interopRequireDefault(__webpack_require__(110)); +} + +var _promise; + +function _load_promise() { + return _promise = _interopRequireWildcard(__webpack_require__(50)); +} + +var _promise2; + +function _load_promise2() { + return _promise2 = __webpack_require__(50); +} + +var _map; + +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(29)); +} + +var _fsNormalized; + +function _load_fsNormalized() { + return _fsNormalized = __webpack_require__(218); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const constants = exports.constants = typeof (_fs || _load_fs()).default.constants !== 'undefined' ? (_fs || _load_fs()).default.constants : { + R_OK: (_fs || _load_fs()).default.R_OK, + W_OK: (_fs || _load_fs()).default.W_OK, + X_OK: (_fs || _load_fs()).default.X_OK +}; + +const lockQueue = exports.lockQueue = new (_blockingQueue || _load_blockingQueue()).default('fs lock'); + +const readFileBuffer = exports.readFileBuffer = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readFile); +const open = exports.open = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.open); +const writeFile = exports.writeFile = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.writeFile); +const readlink = exports.readlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readlink); +const realpath = exports.realpath = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.realpath); +const readdir = exports.readdir = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readdir); +const rename = exports.rename = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.rename); +const access = exports.access = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.access); +const stat = exports.stat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.stat); +const mkdirp = exports.mkdirp = (0, (_promise2 || _load_promise2()).promisify)(__webpack_require__(145)); +const exists = exports.exists = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.exists, true); +const lstat = exports.lstat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.lstat); +const chmod = exports.chmod = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.chmod); +const link = exports.link = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.link); +const glob = exports.glob = (0, (_promise2 || _load_promise2()).promisify)((_glob || _load_glob()).default); +exports.unlink = (_fsNormalized || _load_fsNormalized()).unlink; + +// fs.copyFile uses the native file copying instructions on the system, performing much better +// than any JS-based solution and consumes fewer resources. Repeated testing to fine tune the +// concurrency level revealed 128 as the sweet spot on a quad-core, 16 CPU Intel system with SSD. + +const CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4; + +const fsSymlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.symlink); +const invariant = __webpack_require__(9); +const stripBOM = __webpack_require__(160); + +const noop = () => {}; + +function copy(src, dest, reporter) { + return copyBulk([{ src, dest }], reporter); +} + +function _readFile(loc, encoding) { + return new Promise((resolve, reject) => { + (_fs || _load_fs()).default.readFile(loc, encoding, function (err, content) { + if (err) { + reject(err); + } else { + resolve(content); + } + }); + }); +} + +function readFile(loc) { + return _readFile(loc, 'utf8').then(normalizeOS); +} + +function readFileRaw(loc) { + return _readFile(loc, 'binary'); +} + +function normalizeOS(body) { + return body.replace(/\r\n/g, '\n'); +} + +const cr = '\r'.charCodeAt(0); +const lf = '\n'.charCodeAt(0); /***/ }), -/* 5 */ +/* 7 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscriber; }); /* unused harmony export SafeSubscriber */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isFunction__ = __webpack_require__(142); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observer__ = __webpack_require__(390); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(31); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__ = __webpack_require__(261); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__config__ = __webpack_require__(175); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_hostReportError__ = __webpack_require__(263); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isFunction__ = __webpack_require__(154); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observer__ = __webpack_require__(419); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__ = __webpack_require__(321); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__config__ = __webpack_require__(185); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_hostReportError__ = __webpack_require__(323); /** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */ @@ -604,227 +1821,6 @@ var SafeSubscriber = /*@__PURE__*/ (function (_super) { //# sourceMappingURL=Subscriber.js.map -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.OneTimePasswordError = exports.ResponseError = exports.ProcessTermError = exports.SecurityError = exports.ProcessSpawnError = exports.MessageError = undefined; - -var _create; - -function _load_create() { - return _create = _interopRequireDefault(__webpack_require__(213)); -} - -var _getPrototypeOf; - -function _load_getPrototypeOf() { - return _getPrototypeOf = _interopRequireDefault(__webpack_require__(582)); -} - -var _setPrototypeOf; - -function _load_setPrototypeOf() { - return _setPrototypeOf = _interopRequireDefault(__webpack_require__(214)); -} - -var _from; - -function _load_from() { - return _from = _interopRequireDefault(__webpack_require__(53)); -} - -var _construct; - -function _load_construct() { - return _construct = _interopRequireDefault(__webpack_require__(584)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _extendableBuiltin5(cls) { - function ExtendableBuiltin() { - var instance = (0, (_construct || _load_construct()).default)(cls, (0, (_from || _load_from()).default)(arguments)); - (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(instance, (0, (_getPrototypeOf || _load_getPrototypeOf()).default)(this)); - return instance; - } - - ExtendableBuiltin.prototype = (0, (_create || _load_create()).default)(cls.prototype, { - constructor: { - value: cls, - enumerable: false, - writable: true, - configurable: true - } - }); - - if ((_setPrototypeOf || _load_setPrototypeOf()).default) { - (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(ExtendableBuiltin, cls); - } else { - ExtendableBuiltin.__proto__ = cls; - } - - return ExtendableBuiltin; -} - -function _extendableBuiltin3(cls) { - function ExtendableBuiltin() { - var instance = (0, (_construct || _load_construct()).default)(cls, (0, (_from || _load_from()).default)(arguments)); - (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(instance, (0, (_getPrototypeOf || _load_getPrototypeOf()).default)(this)); - return instance; - } - - ExtendableBuiltin.prototype = (0, (_create || _load_create()).default)(cls.prototype, { - constructor: { - value: cls, - enumerable: false, - writable: true, - configurable: true - } - }); - - if ((_setPrototypeOf || _load_setPrototypeOf()).default) { - (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(ExtendableBuiltin, cls); - } else { - ExtendableBuiltin.__proto__ = cls; - } - - return ExtendableBuiltin; -} - -function _extendableBuiltin(cls) { - function ExtendableBuiltin() { - var instance = (0, (_construct || _load_construct()).default)(cls, (0, (_from || _load_from()).default)(arguments)); - (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(instance, (0, (_getPrototypeOf || _load_getPrototypeOf()).default)(this)); - return instance; - } - - ExtendableBuiltin.prototype = (0, (_create || _load_create()).default)(cls.prototype, { - constructor: { - value: cls, - enumerable: false, - writable: true, - configurable: true - } - }); - - if ((_setPrototypeOf || _load_setPrototypeOf()).default) { - (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(ExtendableBuiltin, cls); - } else { - ExtendableBuiltin.__proto__ = cls; - } - - return ExtendableBuiltin; -} - -var MessageError = exports.MessageError = function (_extendableBuiltin2) { - (0, (_inherits2 || _load_inherits()).default)(MessageError, _extendableBuiltin2); - - function MessageError(msg, code) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, MessageError); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _extendableBuiltin2.call(this, msg)); - - _this.code = code; - return _this; - } - - return MessageError; -}(_extendableBuiltin(Error)); - -var ProcessSpawnError = exports.ProcessSpawnError = function (_MessageError) { - (0, (_inherits2 || _load_inherits()).default)(ProcessSpawnError, _MessageError); - - function ProcessSpawnError(msg, code, process) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ProcessSpawnError); - - var _this2 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _MessageError.call(this, msg, code)); - - _this2.process = process; - return _this2; - } - - return ProcessSpawnError; -}(MessageError); - -var SecurityError = exports.SecurityError = function (_MessageError2) { - (0, (_inherits2 || _load_inherits()).default)(SecurityError, _MessageError2); - - function SecurityError() { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, SecurityError); - return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _MessageError2.apply(this, arguments)); - } - - return SecurityError; -}(MessageError); - -var ProcessTermError = exports.ProcessTermError = function (_MessageError3) { - (0, (_inherits2 || _load_inherits()).default)(ProcessTermError, _MessageError3); - - function ProcessTermError() { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ProcessTermError); - return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _MessageError3.apply(this, arguments)); - } - - return ProcessTermError; -}(MessageError); - -var ResponseError = exports.ResponseError = function (_extendableBuiltin4) { - (0, (_inherits2 || _load_inherits()).default)(ResponseError, _extendableBuiltin4); - - function ResponseError(msg, responseCode) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ResponseError); - - var _this5 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _extendableBuiltin4.call(this, msg)); - - _this5.responseCode = responseCode; - return _this5; - } - - return ResponseError; -}(_extendableBuiltin3(Error)); - -var OneTimePasswordError = exports.OneTimePasswordError = function (_extendableBuiltin6) { - (0, (_inherits2 || _load_inherits()).default)(OneTimePasswordError, _extendableBuiltin6); - - function OneTimePasswordError() { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, OneTimePasswordError); - return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _extendableBuiltin6.apply(this, arguments)); - } - - return OneTimePasswordError; -}(_extendableBuiltin5(Error)); - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(632), __esModule: true }; - /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { @@ -832,1353 +1828,58 @@ module.exports = { "default": __webpack_require__(632), __esModule: true }; "use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getFirstSuitableFolder = exports.readFirstAvailableStream = exports.makeTempDir = exports.hardlinksWork = exports.writeFilePreservingEol = exports.getFileSizeOnDisk = exports.walk = exports.symlink = exports.find = exports.readJsonAndFile = exports.readJson = exports.readFileAny = exports.hardlinkBulk = exports.copyBulk = exports.unlink = exports.glob = exports.link = exports.chmod = exports.lstat = exports.exists = exports.mkdirp = exports.stat = exports.access = exports.rename = exports.readdir = exports.realpath = exports.readlink = exports.writeFile = exports.open = exports.readFileBuffer = exports.lockQueue = exports.constants = undefined; - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(42)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var buildActionsForCopy = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { - - // - var build = function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - var src = data.src, - dest = data.dest, - type = data.type; - - var onFresh = data.onFresh || noop; - var onDone = data.onDone || noop; - - // TODO https://github.com/yarnpkg/yarn/issues/3751 - // related to bundled dependencies handling - if (files.has(dest.toLowerCase())) { - reporter.verbose(`The case-insensitive file ${dest} shouldn't be copied twice in one bulk copy`); - } else { - files.add(dest.toLowerCase()); - } - - if (type === 'symlink') { - yield mkdirp((_path2 || _load_path()).default.dirname(dest)); - onFresh(); - actions.symlink.push({ - dest, - linkname: src - }); - onDone(); - return; - } - - if (events.ignoreBasenames.indexOf((_path2 || _load_path()).default.basename(src)) >= 0) { - // ignored file - return; - } - - var srcStat = yield lstat(src); - var srcFiles = void 0; - - if (srcStat.isDirectory()) { - srcFiles = yield readdir(src); - } - - var destStat = void 0; - try { - // try accessing the destination - destStat = yield lstat(dest); - } catch (e) { - // proceed if destination doesn't exist, otherwise error - if (e.code !== 'ENOENT') { - throw e; - } - } - - // if destination exists - if (destStat) { - var bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); - var bothFolders = srcStat.isDirectory() && destStat.isDirectory(); - var bothFiles = srcStat.isFile() && destStat.isFile(); - - // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving - // us modes that aren't valid. investigate this, it's generally safe to proceed. - - /* if (srcStat.mode !== destStat.mode) { - try { - await access(dest, srcStat.mode); - } catch (err) {} - } */ - - if (bothFiles && artifactFiles.has(dest)) { - // this file gets changed during build, likely by a custom install script. Don't bother checking it. - onDone(); - reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); - return; - } - - if (bothFiles && srcStat.size === destStat.size && (0, (_fsNormalized || _load_fsNormalized()).fileDatesEqual)(srcStat.mtime, destStat.mtime)) { - // we can safely assume this is the same file - onDone(); - reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.size, +srcStat.mtime)); - return; - } - - if (bothSymlinks) { - var srcReallink = yield readlink(src); - if (srcReallink === (yield readlink(dest))) { - // if both symlinks are the same then we can continue on - onDone(); - reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink)); - return; - } - } - - if (bothFolders) { - // mark files that aren't in this folder as possibly extraneous - var destFiles = yield readdir(dest); - invariant(srcFiles, 'src files not initialised'); - - for (var _iterator4 = destFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref6; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref6 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref6 = _i4.value; - } - - var _file2 = _ref6; - - if (srcFiles.indexOf(_file2) < 0) { - var _loc = (_path2 || _load_path()).default.join(dest, _file2); - possibleExtraneous.add(_loc); - - if ((yield lstat(_loc)).isDirectory()) { - for (var _iterator5 = yield readdir(_loc), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { - var _ref7; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref7 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref7 = _i5.value; - } - - var _file3 = _ref7; - - possibleExtraneous.add((_path2 || _load_path()).default.join(_loc, _file3)); - } - } - } - } - } - } - - if (destStat && destStat.isSymbolicLink()) { - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); - destStat = null; - } - - if (srcStat.isSymbolicLink()) { - onFresh(); - var _linkname = yield readlink(src); - actions.symlink.push({ - dest, - linkname: _linkname - }); - onDone(); - } else if (srcStat.isDirectory()) { - yield* function* () { - if (!destStat) { - reporter.verbose(reporter.lang('verboseFileFolder', dest)); - yield mkdirp(dest); - } - - var destParts = dest.split((_path2 || _load_path()).default.sep); - while (destParts.length) { - files.add(destParts.join((_path2 || _load_path()).default.sep).toLowerCase()); - destParts.pop(); - } - - // push all files to queue - invariant(srcFiles, 'src files not initialised'); - var remaining = srcFiles.length; - if (!remaining) { - onDone(); - } - for (var _iterator6 = srcFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { - var _ref8; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref8 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref8 = _i6.value; - } - - var _file4 = _ref8; - - queue.push({ - dest: (_path2 || _load_path()).default.join(dest, _file4), - onFresh, - onDone: function (_onDone) { - function onDone() { - return _onDone.apply(this, arguments); - } - - onDone.toString = function () { - return _onDone.toString(); - }; - - return onDone; - }(function () { - if (--remaining === 0) { - onDone(); - } - }), - src: (_path2 || _load_path()).default.join(src, _file4) - }); - } - }(); - } else if (srcStat.isFile()) { - onFresh(); - actions.file.push({ - src, - dest, - atime: srcStat.atime, - mtime: srcStat.mtime, - mode: srcStat.mode - }); - onDone(); - } else { - throw new Error(`unsure how to copy this: ${src}`); - } - }); - - return function build(_x5) { - return _ref5.apply(this, arguments); - }; - }(); - - var artifactFiles = new (_set || _load_set()).default(events.artifactFiles || []); - var files = new (_set || _load_set()).default(); - - // initialise events - - var _loop = function _loop(item) { - var onDone = item.onDone; - item.onDone = function () { - events.onProgress(item.dest); - if (onDone) { - onDone(); - } - }; - }; - - for (var _iterator = queue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref2; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - var item = _ref2; - - _loop(item); - } - events.onStart(queue.length); - - // start building actions - var actions = { - file: [], - symlink: [], - link: [] - }; - - // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items - // at a time due to the requirement to push items onto the queue - while (queue.length) { - var items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); - yield (_promise || _load_promise()).default.all(items.map(build)); - } - - // simulate the existence of some files to prevent considering them extraneous - for (var _iterator2 = artifactFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref3; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; - } - - var _file = _ref3; - - if (possibleExtraneous.has(_file)) { - reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', _file)); - possibleExtraneous.delete(_file); - } - } - - for (var _iterator3 = possibleExtraneous, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref4; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } - - var loc = _ref4; - - if (files.has(loc.toLowerCase())) { - possibleExtraneous.delete(loc); - } - } - - return actions; - }); - - return function buildActionsForCopy(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -var buildActionsForHardlink = function () { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { - - // - var build = function () { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - var src = data.src, - dest = data.dest; - - var onFresh = data.onFresh || noop; - var onDone = data.onDone || noop; - if (files.has(dest.toLowerCase())) { - // Fixes issue https://github.com/yarnpkg/yarn/issues/2734 - // When bulk hardlinking we have A -> B structure that we want to hardlink to A1 -> B1, - // package-linker passes that modules A1 and B1 need to be hardlinked, - // the recursive linking algorithm of A1 ends up scheduling files in B1 to be linked twice which will case - // an exception. - onDone(); - return; - } - files.add(dest.toLowerCase()); - - if (events.ignoreBasenames.indexOf((_path2 || _load_path()).default.basename(src)) >= 0) { - // ignored file - return; - } - - var srcStat = yield lstat(src); - var srcFiles = void 0; - - if (srcStat.isDirectory()) { - srcFiles = yield readdir(src); - } - - var destExists = yield exists(dest); - if (destExists) { - var destStat = yield lstat(dest); - - var bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); - var bothFolders = srcStat.isDirectory() && destStat.isDirectory(); - var bothFiles = srcStat.isFile() && destStat.isFile(); - - if (srcStat.mode !== destStat.mode) { - try { - yield access(dest, srcStat.mode); - } catch (err) { - // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving - // us modes that aren't valid. investigate this, it's generally safe to proceed. - reporter.verbose(err); - } - } - - if (bothFiles && artifactFiles.has(dest)) { - // this file gets changed during build, likely by a custom install script. Don't bother checking it. - onDone(); - reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); - return; - } - - // correct hardlink - if (bothFiles && srcStat.ino !== null && srcStat.ino === destStat.ino) { - onDone(); - reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.ino)); - return; - } - - if (bothSymlinks) { - var srcReallink = yield readlink(src); - if (srcReallink === (yield readlink(dest))) { - // if both symlinks are the same then we can continue on - onDone(); - reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink)); - return; - } - } - - if (bothFolders) { - // mark files that aren't in this folder as possibly extraneous - var destFiles = yield readdir(dest); - invariant(srcFiles, 'src files not initialised'); - - for (var _iterator10 = destFiles, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) { - var _ref14; - - if (_isArray10) { - if (_i10 >= _iterator10.length) break; - _ref14 = _iterator10[_i10++]; - } else { - _i10 = _iterator10.next(); - if (_i10.done) break; - _ref14 = _i10.value; - } - - var _file6 = _ref14; - - if (srcFiles.indexOf(_file6) < 0) { - var _loc2 = (_path2 || _load_path()).default.join(dest, _file6); - possibleExtraneous.add(_loc2); - - if ((yield lstat(_loc2)).isDirectory()) { - for (var _iterator11 = yield readdir(_loc2), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) { - var _ref15; - - if (_isArray11) { - if (_i11 >= _iterator11.length) break; - _ref15 = _iterator11[_i11++]; - } else { - _i11 = _iterator11.next(); - if (_i11.done) break; - _ref15 = _i11.value; - } - - var _file7 = _ref15; - - possibleExtraneous.add((_path2 || _load_path()).default.join(_loc2, _file7)); - } - } - } - } - } - } - - if (srcStat.isSymbolicLink()) { - onFresh(); - var _linkname2 = yield readlink(src); - actions.symlink.push({ - dest, - linkname: _linkname2 - }); - onDone(); - } else if (srcStat.isDirectory()) { - yield* function* () { - reporter.verbose(reporter.lang('verboseFileFolder', dest)); - yield mkdirp(dest); - - var destParts = dest.split((_path2 || _load_path()).default.sep); - while (destParts.length) { - files.add(destParts.join((_path2 || _load_path()).default.sep).toLowerCase()); - destParts.pop(); - } - - // push all files to queue - invariant(srcFiles, 'src files not initialised'); - var remaining = srcFiles.length; - if (!remaining) { - onDone(); - } - for (var _iterator12 = srcFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) { - var _ref16; - - if (_isArray12) { - if (_i12 >= _iterator12.length) break; - _ref16 = _iterator12[_i12++]; - } else { - _i12 = _iterator12.next(); - if (_i12.done) break; - _ref16 = _i12.value; - } - - var _file8 = _ref16; - - queue.push({ - onFresh, - src: (_path2 || _load_path()).default.join(src, _file8), - dest: (_path2 || _load_path()).default.join(dest, _file8), - onDone: function (_onDone2) { - function onDone() { - return _onDone2.apply(this, arguments); - } - - onDone.toString = function () { - return _onDone2.toString(); - }; - - return onDone; - }(function () { - if (--remaining === 0) { - onDone(); - } - }) - }); - } - }(); - } else if (srcStat.isFile()) { - onFresh(); - actions.link.push({ - src, - dest, - removeDest: destExists - }); - onDone(); - } else { - throw new Error(`unsure how to copy this: ${src}`); - } - }); - - return function build(_x10) { - return _ref13.apply(this, arguments); - }; - }(); - - var artifactFiles = new (_set || _load_set()).default(events.artifactFiles || []); - var files = new (_set || _load_set()).default(); - - // initialise events - - var _loop2 = function _loop2(item) { - var onDone = item.onDone || noop; - item.onDone = function () { - events.onProgress(item.dest); - onDone(); - }; - }; - - for (var _iterator7 = queue, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { - var _ref10; - - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref10 = _iterator7[_i7++]; - } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref10 = _i7.value; - } - - var item = _ref10; - - _loop2(item); - } - events.onStart(queue.length); - - // start building actions - var actions = { - file: [], - symlink: [], - link: [] - }; - - // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items - // at a time due to the requirement to push items onto the queue - while (queue.length) { - var items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); - yield (_promise || _load_promise()).default.all(items.map(build)); - } - - // simulate the existence of some files to prevent considering them extraneous - for (var _iterator8 = artifactFiles, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) { - var _ref11; - - if (_isArray8) { - if (_i8 >= _iterator8.length) break; - _ref11 = _iterator8[_i8++]; - } else { - _i8 = _iterator8.next(); - if (_i8.done) break; - _ref11 = _i8.value; - } - - var _file5 = _ref11; - - if (possibleExtraneous.has(_file5)) { - reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', _file5)); - possibleExtraneous.delete(_file5); - } - } - - for (var _iterator9 = possibleExtraneous, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) { - var _ref12; - - if (_isArray9) { - if (_i9 >= _iterator9.length) break; - _ref12 = _iterator9[_i9++]; - } else { - _i9 = _iterator9.next(); - if (_i9.done) break; - _ref12 = _i9.value; - } - - var loc = _ref12; - - if (files.has(loc.toLowerCase())) { - possibleExtraneous.delete(loc); - } - } - - return actions; - }); - - return function buildActionsForHardlink(_x6, _x7, _x8, _x9) { - return _ref9.apply(this, arguments); - }; -}(); - -var copyBulk = exports.copyBulk = function () { - var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { - var events = { - onStart: _events && _events.onStart || noop, - onProgress: _events && _events.onProgress || noop, - possibleExtraneous: _events ? _events.possibleExtraneous : new (_set || _load_set()).default(), - ignoreBasenames: _events && _events.ignoreBasenames || [], - artifactFiles: _events && _events.artifactFiles || [] - }; - - var actions = yield buildActionsForCopy(queue, events, events.possibleExtraneous, reporter); - events.onStart(actions.file.length + actions.symlink.length + actions.link.length); - - var fileActions = actions.file; - - var currentlyWriting = new (_map || _load_map()).default(); - - yield (_promise2 || _load_promise2()).queue(fileActions, function () { - var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - var writePromise = void 0; - while (writePromise = currentlyWriting.get(data.dest)) { - yield writePromise; - } - - reporter.verbose(reporter.lang('verboseFileCopy', data.src, data.dest)); - var copier = (0, (_fsNormalized || _load_fsNormalized()).copyFile)(data, function () { - return currentlyWriting.delete(data.dest); - }); - currentlyWriting.set(data.dest, copier); - events.onProgress(data.dest); - return copier; - }); - - return function (_x14) { - return _ref18.apply(this, arguments); - }; - }(), CONCURRENT_QUEUE_ITEMS); - - // we need to copy symlinks last as they could reference files we were copying - var symlinkActions = actions.symlink; - yield (_promise2 || _load_promise2()).queue(symlinkActions, function (data) { - var linkname = (_path2 || _load_path()).default.resolve((_path2 || _load_path()).default.dirname(data.dest), data.linkname); - reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); - return symlink(linkname, data.dest); - }); - }); - - return function copyBulk(_x11, _x12, _x13) { - return _ref17.apply(this, arguments); - }; -}(); - -var hardlinkBulk = exports.hardlinkBulk = function () { - var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { - var events = { - onStart: _events && _events.onStart || noop, - onProgress: _events && _events.onProgress || noop, - possibleExtraneous: _events ? _events.possibleExtraneous : new (_set || _load_set()).default(), - artifactFiles: _events && _events.artifactFiles || [], - ignoreBasenames: [] - }; - - var actions = yield buildActionsForHardlink(queue, events, events.possibleExtraneous, reporter); - events.onStart(actions.file.length + actions.symlink.length + actions.link.length); - - var fileActions = actions.link; - - yield (_promise2 || _load_promise2()).queue(fileActions, function () { - var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - reporter.verbose(reporter.lang('verboseFileLink', data.src, data.dest)); - if (data.removeDest) { - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(data.dest); - } - yield link(data.src, data.dest); - }); - - return function (_x18) { - return _ref20.apply(this, arguments); - }; - }(), CONCURRENT_QUEUE_ITEMS); - - // we need to copy symlinks last as they could reference files we were copying - var symlinkActions = actions.symlink; - yield (_promise2 || _load_promise2()).queue(symlinkActions, function (data) { - var linkname = (_path2 || _load_path()).default.resolve((_path2 || _load_path()).default.dirname(data.dest), data.linkname); - reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); - return symlink(linkname, data.dest); - }); - }); - - return function hardlinkBulk(_x15, _x16, _x17) { - return _ref19.apply(this, arguments); - }; -}(); - -var readFileAny = exports.readFileAny = function () { - var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) { - for (var _iterator13 = files, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) { - var _ref22; - - if (_isArray13) { - if (_i13 >= _iterator13.length) break; - _ref22 = _iterator13[_i13++]; - } else { - _i13 = _iterator13.next(); - if (_i13.done) break; - _ref22 = _i13.value; - } - - var _file9 = _ref22; - - if (yield exists(_file9)) { - return readFile(_file9); - } - } - return null; - }); - - return function readFileAny(_x19) { - return _ref21.apply(this, arguments); - }; -}(); - -var readJson = exports.readJson = function () { - var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { - return (yield readJsonAndFile(loc)).object; - }); - - return function readJson(_x20) { - return _ref23.apply(this, arguments); - }; -}(); - -var readJsonAndFile = exports.readJsonAndFile = function () { - var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { - var file = yield readFile(loc); - try { - return { - object: (0, (_map2 || _load_map2()).default)(JSON.parse(stripBOM(file))), - content: file - }; - } catch (err) { - err.message = `${loc}: ${err.message}`; - throw err; - } - }); - - return function readJsonAndFile(_x21) { - return _ref24.apply(this, arguments); - }; -}(); - -var find = exports.find = function () { - var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) { - var parts = dir.split((_path2 || _load_path()).default.sep); - - while (parts.length) { - var loc = parts.concat(filename).join((_path2 || _load_path()).default.sep); - - if (yield exists(loc)) { - return loc; - } else { - parts.pop(); - } - } - - return false; - }); - - return function find(_x22, _x23) { - return _ref25.apply(this, arguments); - }; -}(); - -var symlink = exports.symlink = function () { - var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) { - if (process.platform !== 'win32') { - // use relative paths otherwise which will be retained if the directory is moved - src = (_path2 || _load_path()).default.relative((_path2 || _load_path()).default.dirname(dest), src); - // When path.relative returns an empty string for the current directory, we should instead use - // '.', which is a valid fs.symlink target. - src = src || '.'; - } - - try { - var stats = yield lstat(dest); - if (stats.isSymbolicLink()) { - var resolved = dest; - if (resolved === src) { - return; - } - } - } catch (err) { - if (err.code !== 'ENOENT') { - throw err; - } - } - - // We use rimraf for unlink which never throws an ENOENT on missing target - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); - - if (process.platform === 'win32') { - // use directory junctions if possible on win32, this requires absolute paths - yield fsSymlink(src, dest, 'junction'); - } else { - yield fsSymlink(src, dest); - } - }); - - return function symlink(_x24, _x25) { - return _ref26.apply(this, arguments); - }; -}(); - -var walk = exports.walk = function () { - var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir) { - var ignoreBasenames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_set || _load_set()).default(); - - var files = []; - - var filenames = yield readdir(dir); - if (ignoreBasenames.size) { - filenames = filenames.filter(function (name) { - return !ignoreBasenames.has(name); - }); - } - - for (var _iterator14 = filenames, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) { - var _ref28; - - if (_isArray14) { - if (_i14 >= _iterator14.length) break; - _ref28 = _iterator14[_i14++]; - } else { - _i14 = _iterator14.next(); - if (_i14.done) break; - _ref28 = _i14.value; - } - - var name = _ref28; - - var _relative = relativeDir ? (_path2 || _load_path()).default.join(relativeDir, name) : name; - var loc = (_path2 || _load_path()).default.join(dir, name); - var _stat = yield lstat(loc); - - files.push({ - relative: _relative, - basename: name, - absolute: loc, - mtime: +_stat.mtime - }); - - if (_stat.isDirectory()) { - files = files.concat((yield walk(loc, _relative, ignoreBasenames))); - } - } - - return files; - }); - - return function walk(_x26, _x27) { - return _ref27.apply(this, arguments); - }; -}(); - -var getFileSizeOnDisk = exports.getFileSizeOnDisk = function () { - var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { - var stat = yield lstat(loc); - var size = stat.size, - blockSize = stat.blksize; - - - return Math.ceil(size / blockSize) * blockSize; - }); - - return function getFileSizeOnDisk(_x29) { - return _ref29.apply(this, arguments); - }; -}(); - -var getEolFromFile = function () { - var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) { - if (!(yield exists(path))) { - return undefined; - } - - var buffer = yield readFileBuffer(path); - - for (var i = 0; i < buffer.length; ++i) { - if (buffer[i] === cr) { - return '\r\n'; - } - if (buffer[i] === lf) { - return '\n'; - } - } - return undefined; - }); - - return function getEolFromFile(_x30) { - return _ref30.apply(this, arguments); - }; -}(); - -var writeFilePreservingEol = exports.writeFilePreservingEol = function () { - var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) { - var eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL; - if (eol !== '\n') { - data = data.replace(/\n/g, eol); - } - yield writeFile(path, data); - }); - - return function writeFilePreservingEol(_x31, _x32) { - return _ref31.apply(this, arguments); - }; -}(); - -var hardlinksWork = exports.hardlinksWork = function () { - var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { - var filename = 'test-file' + Math.random(); - var file = (_path2 || _load_path()).default.join(dir, filename); - var fileLink = (_path2 || _load_path()).default.join(dir, filename + '-link'); - try { - yield writeFile(file, 'test'); - yield link(file, fileLink); - } catch (err) { - return false; - } finally { - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file); - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(fileLink); - } - return true; - }); - - return function hardlinksWork(_x33) { - return _ref32.apply(this, arguments); - }; -}(); - -// not a strict polyfill for Node's fs.mkdtemp - - -var makeTempDir = exports.makeTempDir = function () { - var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) { - var dir = (_path2 || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ''}-${Date.now()}-${Math.random()}`); - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir); - yield mkdirp(dir); - return dir; - }); - - return function makeTempDir(_x34) { - return _ref33.apply(this, arguments); - }; -}(); - -var readFirstAvailableStream = exports.readFirstAvailableStream = function () { - var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { - for (var _iterator15 = paths, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) { - var _ref35; - - if (_isArray15) { - if (_i15 >= _iterator15.length) break; - _ref35 = _iterator15[_i15++]; - } else { - _i15 = _iterator15.next(); - if (_i15.done) break; - _ref35 = _i15.value; - } - - var _path = _ref35; - - try { - var fd = yield open(_path, 'r'); - return (_fs || _load_fs()).default.createReadStream(_path, { fd }); - } catch (err) { - // Try the next one - } - } - return null; - }); - - return function readFirstAvailableStream(_x35) { - return _ref34.apply(this, arguments); - }; -}(); - -var getFirstSuitableFolder = exports.getFirstSuitableFolder = function () { - var _ref36 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { - var mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : constants.W_OK | constants.X_OK; - - var result = { - skipped: [], - folder: null - }; - - for (var _iterator16 = paths, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator16);;) { - var _ref37; - - if (_isArray16) { - if (_i16 >= _iterator16.length) break; - _ref37 = _iterator16[_i16++]; - } else { - _i16 = _iterator16.next(); - if (_i16.done) break; - _ref37 = _i16.value; - } - - var _folder = _ref37; - - try { - yield mkdirp(_folder); - yield access(_folder, mode); - - result.folder = _folder; - - return result; - } catch (error) { - result.skipped.push({ - error, - folder: _folder - }); - } - } - return result; - }); - - return function getFirstSuitableFolder(_x36) { - return _ref36.apply(this, arguments); - }; -}(); - -exports.copy = copy; -exports.readFile = readFile; -exports.readFileRaw = readFileRaw; -exports.normalizeOS = normalizeOS; - -var _fs; - -function _load_fs() { - return _fs = _interopRequireDefault(__webpack_require__(12)); -} - -var _glob; - -function _load_glob() { - return _glob = _interopRequireDefault(__webpack_require__(237)); -} - -var _os; - -function _load_os() { - return _os = _interopRequireDefault(__webpack_require__(72)); -} - -var _path2; - -function _load_path() { - return _path2 = _interopRequireDefault(__webpack_require__(1)); -} - -var _blockingQueue; - -function _load_blockingQueue() { - return _blockingQueue = _interopRequireDefault(__webpack_require__(157)); -} - -var _promise2; - -function _load_promise2() { - return _promise2 = _interopRequireWildcard(__webpack_require__(86)); -} - -var _promise3; - -function _load_promise3() { - return _promise3 = __webpack_require__(86); -} - -var _map2; - -function _load_map2() { - return _map2 = _interopRequireDefault(__webpack_require__(51)); -} - -var _fsNormalized; - -function _load_fsNormalized() { - return _fsNormalized = __webpack_require__(567); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var constants = exports.constants = typeof (_fs || _load_fs()).default.constants !== 'undefined' ? (_fs || _load_fs()).default.constants : { - R_OK: (_fs || _load_fs()).default.R_OK, - W_OK: (_fs || _load_fs()).default.W_OK, - X_OK: (_fs || _load_fs()).default.X_OK -}; - -var lockQueue = exports.lockQueue = new (_blockingQueue || _load_blockingQueue()).default('fs lock'); - -var readFileBuffer = exports.readFileBuffer = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readFile); -var open = exports.open = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.open); -var writeFile = exports.writeFile = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.writeFile); -var readlink = exports.readlink = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readlink); -var realpath = exports.realpath = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.realpath); -var readdir = exports.readdir = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readdir); -var rename = exports.rename = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.rename); -var access = exports.access = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.access); -var stat = exports.stat = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.stat); -var mkdirp = exports.mkdirp = (0, (_promise3 || _load_promise3()).promisify)(__webpack_require__(241)); -var exists = exports.exists = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.exists, true); -var lstat = exports.lstat = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.lstat); -var chmod = exports.chmod = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.chmod); -var link = exports.link = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.link); -var glob = exports.glob = (0, (_promise3 || _load_promise3()).promisify)((_glob || _load_glob()).default); -exports.unlink = (_fsNormalized || _load_fsNormalized()).unlink; - -// fs.copyFile uses the native file copying instructions on the system, performing much better -// than any JS-based solution and consumes fewer resources. Repeated testing to fine tune the -// concurrency level revealed 128 as the sweet spot on a quad-core, 16 CPU Intel system with SSD. - -var CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4; - -var fsSymlink = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.symlink); -var invariant = __webpack_require__(15); -var stripBOM = __webpack_require__(429); - -var noop = function noop() {}; - -function copy(src, dest, reporter) { - return copyBulk([{ src, dest }], reporter); -} - -function _readFile(loc, encoding) { - return new (_promise || _load_promise()).default(function (resolve, reject) { - (_fs || _load_fs()).default.readFile(loc, encoding, function (err, content) { - if (err) { - reject(err); - } else { - resolve(content); - } - }); - }); -} - -function readFile(loc) { - return _readFile(loc, 'utf8').then(normalizeOS); -} - -function readFileRaw(loc) { - return _readFile(loc, 'binary'); -} - -function normalizeOS(body) { - return body.replace(/\r\n/g, '\n'); -} - -var cr = '\r'.charCodeAt(0); -var lf = '\n'.charCodeAt(0); - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - -module.exports = require("util"); - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _setPrototypeOf = __webpack_require__(214); - -var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); - -var _create = __webpack_require__(213); - -var _create2 = _interopRequireDefault(_create); - -var _typeof2 = __webpack_require__(322); - -var _typeof3 = _interopRequireDefault(_typeof2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); - } - - subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; -}; - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _typeof2 = __webpack_require__(322); - -var _typeof3 = _interopRequireDefault(_typeof2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; -}; - -/***/ }), -/* 12 */ -/***/ (function(module, exports) { - -module.exports = require("fs"); - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - Object.defineProperty(exports, "__esModule", { value: true }); exports.getPathKey = getPathKey; -var os = __webpack_require__(72); -var path = __webpack_require__(1); -var userHome = __webpack_require__(101).default; +const os = __webpack_require__(49); +const path = __webpack_require__(0); +const userHome = __webpack_require__(66).default; -var _require = __webpack_require__(581), - getCacheDir = _require.getCacheDir, - getConfigDir = _require.getConfigDir, - getDataDir = _require.getDataDir; +var _require = __webpack_require__(225); -var isWebpackBundle = __webpack_require__(792); +const getCacheDir = _require.getCacheDir, + getConfigDir = _require.getConfigDir, + getDataDir = _require.getDataDir; -var DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies']; -var OWNED_DEPENDENCY_TYPES = exports.OWNED_DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies']; +const isWebpackBundle = __webpack_require__(278); -var RESOLUTIONS = exports.RESOLUTIONS = 'resolutions'; -var MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS].concat(DEPENDENCY_TYPES); +const DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies']; +const OWNED_DEPENDENCY_TYPES = exports.OWNED_DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies']; -var SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0'; +const RESOLUTIONS = exports.RESOLUTIONS = 'resolutions'; +const MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS, ...DEPENDENCY_TYPES]; -var YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com'; -var NPM_REGISTRY_RE = exports.NPM_REGISTRY_RE = /https?:\/\/registry\.npmjs\.org/g; +const SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0'; -var YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/'; -var YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh'; -var YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi'; +const YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com'; +const NPM_REGISTRY_RE = exports.NPM_REGISTRY_RE = /https?:\/\/registry\.npmjs\.org/g; -var SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version'; +const YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/'; +const YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh'; +const YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi'; + +const SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version'; // cache version, bump whenever we make backwards incompatible changes -var CACHE_VERSION = exports.CACHE_VERSION = 6; +const CACHE_VERSION = exports.CACHE_VERSION = 4; // lockfile version, bump whenever we make backwards incompatible changes -var LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1; +const LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1; // max amount of network requests to perform concurrently -var NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8; +const NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8; // HTTP timeout used when downloading packages -var NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds +const NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds // max amount of child processes to execute concurrently -var CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5; +const CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5; -var REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid']; +const REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid']; function getPreferredCacheDirectories() { - var preferredCacheDirectories = [getCacheDir()]; + const preferredCacheDirectories = [getCacheDir()]; if (process.getuid) { // $FlowFixMe: process.getuid exists, dammit @@ -2190,14 +1891,14 @@ function getPreferredCacheDirectories() { return preferredCacheDirectories; } -var PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories(); -var CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getConfigDir(); -var DATA_DIRECTORY = exports.DATA_DIRECTORY = getDataDir(); -var LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(DATA_DIRECTORY, 'link'); -var GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(DATA_DIRECTORY, 'global'); +const PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories(); +const CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getConfigDir(); +const DATA_DIRECTORY = exports.DATA_DIRECTORY = getDataDir(); +const LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(DATA_DIRECTORY, 'link'); +const GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(DATA_DIRECTORY, 'global'); -var NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath; -var YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath(); +const NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath; +const YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath(); // Webpack needs to be configured with node.__dirname/__filename = false function getYarnBinPath() { @@ -2208,40 +1909,40 @@ function getYarnBinPath() { } } -var NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules'; -var NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json'; +const NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules'; +const NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json'; -var PNP_FILENAME = exports.PNP_FILENAME = '.pnp.js'; +const PNP_FILENAME = exports.PNP_FILENAME = '.pnp.js'; -var POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`; -var FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn'); +const POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`; +const FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn'); -var META_FOLDER = exports.META_FOLDER = '.yarn-meta'; -var INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity'; -var LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock'; -var METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json'; -var TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz'; -var CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean'; +const META_FOLDER = exports.META_FOLDER = '.yarn-meta'; +const INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity'; +const LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock'; +const METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json'; +const TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz'; +const CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean'; -var NPM_LOCK_FILENAME = exports.NPM_LOCK_FILENAME = 'package-lock.json'; -var NPM_SHRINKWRAP_FILENAME = exports.NPM_SHRINKWRAP_FILENAME = 'npm-shrinkwrap.json'; +const NPM_LOCK_FILENAME = exports.NPM_LOCK_FILENAME = 'package-lock.json'; +const NPM_SHRINKWRAP_FILENAME = exports.NPM_SHRINKWRAP_FILENAME = 'npm-shrinkwrap.json'; -var DEFAULT_INDENT = exports.DEFAULT_INDENT = ' '; -var SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997; -var SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance'; +const DEFAULT_INDENT = exports.DEFAULT_INDENT = ' '; +const SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997; +const SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance'; -var ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env); +const ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env); function getPathKey(platform, env) { - var pathKey = 'PATH'; + let pathKey = 'PATH'; // windows calls its path "Path" usually, but this is not guaranteed. if (platform === 'win32') { pathKey = 'Path'; - for (var _key in env) { - if (_key.toLowerCase() === 'path') { - pathKey = _key; + for (const key in env) { + if (key.toLowerCase() === 'path') { + pathKey = key; } } } @@ -2249,7 +1950,7 @@ function getPathKey(platform, env) { return pathKey; } -var VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = { +const VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = { major: 'red', premajor: 'red', minor: 'yellow', @@ -2262,13 +1963,7 @@ var VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = { }; /***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(629), __esModule: true }; - -/***/ }), -/* 15 */ +/* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2326,22 +2021,84 @@ module.exports = invariant; /***/ }), -/* 16 */ +/* 10 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = { "default": __webpack_require__(634), __esModule: true }; +"use strict"; + + +var YAMLException = __webpack_require__(54); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +module.exports = Type; + /***/ }), -/* 17 */ +/* 11 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Observable; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_canReportError__ = __webpack_require__(262); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__ = __webpack_require__(1005); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__ = __webpack_require__(111); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_pipe__ = __webpack_require__(264); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config__ = __webpack_require__(175); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_canReportError__ = __webpack_require__(322); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__ = __webpack_require__(932); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__ = __webpack_require__(117); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_pipe__ = __webpack_require__(324); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config__ = __webpack_require__(185); /** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_internal_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */ @@ -2461,13 +2218,19 @@ function getPromiseCtor(promiseCtor) { /***/ }), -/* 18 */ +/* 12 */ +/***/ (function(module, exports) { + +module.exports = require("crypto"); + +/***/ }), +/* 13 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return OuterSubscriber; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -2492,13 +2255,13 @@ var OuterSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 19 */ +/* 14 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = subscribeToResult; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__ = __webpack_require__(80); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__subscribeTo__ = __webpack_require__(416); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__ = __webpack_require__(84); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__subscribeTo__ = __webpack_require__(445); /** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo PURE_IMPORTS_END */ @@ -2515,7 +2278,7 @@ function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, dest /***/ }), -/* 20 */ +/* 15 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2523,7 +2286,7 @@ function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, dest -var buffer = __webpack_require__(94) +var buffer = __webpack_require__(64) var Buffer = buffer.Buffer var safer = {} @@ -2599,21 +2362,15 @@ module.exports = safer /***/ }), -/* 21 */ -/***/ (function(module, exports) { - -module.exports = require("crypto"); - -/***/ }), -/* 22 */ +/* 16 */ /***/ (function(module, exports, __webpack_require__) { // Copyright (c) 2012, Mark Cavage. All rights reserved. // Copyright 2015 Joyent, Inc. -var assert = __webpack_require__(50); -var Stream = __webpack_require__(35).Stream; -var util = __webpack_require__(9); +var assert = __webpack_require__(28); +var Stream = __webpack_require__(23).Stream; +var util = __webpack_require__(3); ///--- Globals @@ -2822,42 +2579,126 @@ module.exports = _setExports(process.env.NODE_NDEBUG); /***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { +/* 17 */ +/***/ (function(module, exports) { + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef -module.exports = { "default": __webpack_require__(626), __esModule: true }; /***/ }), -/* 24 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sortAlpha = sortAlpha; +exports.sortOptionsByFlags = sortOptionsByFlags; +exports.entries = entries; +exports.removePrefix = removePrefix; +exports.removeSuffix = removeSuffix; +exports.addSuffix = addSuffix; +exports.hyphenate = hyphenate; +exports.camelCase = camelCase; +exports.compareSortedArrays = compareSortedArrays; +exports.sleep = sleep; +const _camelCase = __webpack_require__(230); -var _assign = __webpack_require__(23); - -var _assign2 = _interopRequireDefault(_assign); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = _assign2.default || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } +function sortAlpha(a, b) { + // sort alphabetically in a deterministic way + const shortLen = Math.min(a.length, b.length); + for (let i = 0; i < shortLen; i++) { + const aChar = a.charCodeAt(i); + const bChar = b.charCodeAt(i); + if (aChar !== bChar) { + return aChar - bChar; } } + return a.length - b.length; +} - return target; -}; +function sortOptionsByFlags(a, b) { + const aOpt = a.flags.replace(/-/g, ''); + const bOpt = b.flags.replace(/-/g, ''); + return sortAlpha(aOpt, bOpt); +} + +function entries(obj) { + const entries = []; + if (obj) { + for (const key in obj) { + entries.push([key, obj[key]]); + } + } + return entries; +} + +function removePrefix(pattern, prefix) { + if (pattern.startsWith(prefix)) { + pattern = pattern.slice(prefix.length); + } + + return pattern; +} + +function removeSuffix(pattern, suffix) { + if (pattern.endsWith(suffix)) { + return pattern.slice(0, -suffix.length); + } + + return pattern; +} + +function addSuffix(pattern, suffix) { + if (!pattern.endsWith(suffix)) { + return pattern + suffix; + } + + return pattern; +} + +function hyphenate(str) { + return str.replace(/[A-Z]/g, match => { + return '-' + match.charAt(0).toLowerCase(); + }); +} + +function camelCase(str) { + if (/[A-Z]/.test(str)) { + return null; + } else { + return _camelCase(str); + } +} + +function compareSortedArrays(array1, array2) { + if (array1.length !== array2.length) { + return false; + } + for (let i = 0, len = array1.length; i < len; i++) { + if (array1[i] !== array2[i]) { + return false; + } + } + return true; +} + +function sleep(ms) { + return new Promise(resolve => { + setTimeout(resolve, ms); + }); +} /***/ }), -/* 25 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2868,40 +2709,16 @@ Object.defineProperty(exports, "__esModule", { }); exports.stringify = exports.parse = undefined; -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(42)); -} - var _asyncToGenerator2; function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - var _parse; function _load_parse() { - return _parse = __webpack_require__(307); + return _parse = __webpack_require__(105); } Object.defineProperty(exports, 'parse', { @@ -2914,7 +2731,7 @@ Object.defineProperty(exports, 'parse', { var _stringify; function _load_stringify() { - return _stringify = __webpack_require__(542); + return _stringify = __webpack_require__(199); } Object.defineProperty(exports, 'stringify', { @@ -2929,48 +2746,48 @@ exports.explodeEntry = explodeEntry; var _misc; function _load_misc() { - return _misc = __webpack_require__(28); + return _misc = __webpack_require__(18); } var _normalizePattern; function _load_normalizePattern() { - return _normalizePattern = __webpack_require__(52); + return _normalizePattern = __webpack_require__(37); } var _parse2; function _load_parse2() { - return _parse2 = _interopRequireDefault(__webpack_require__(307)); + return _parse2 = _interopRequireDefault(__webpack_require__(105)); } var _constants; function _load_constants() { - return _constants = __webpack_require__(13); + return _constants = __webpack_require__(8); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); + return _fs = _interopRequireWildcard(__webpack_require__(6)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var invariant = __webpack_require__(15); +const invariant = __webpack_require__(9); -var path = __webpack_require__(1); -var ssri = __webpack_require__(93); +const path = __webpack_require__(0); +const ssri = __webpack_require__(77); function getName(pattern) { return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name; } function blankObjectUndefined(obj) { - return obj && (0, (_keys || _load_keys()).default)(obj).length ? obj : undefined; + return obj && Object.keys(obj).length ? obj : undefined; } function keyForRemote(remote) { @@ -2984,9 +2801,9 @@ function serializeIntegrity(integrity) { } function implodeEntry(pattern, obj) { - var inferredName = getName(pattern); - var integrity = obj.integrity ? serializeIntegrity(obj.integrity) : ''; - var imploded = { + const inferredName = getName(pattern); + const integrity = obj.integrity ? serializeIntegrity(obj.integrity) : ''; + const imploded = { name: inferredName === obj.name ? undefined : obj.name, version: obj.version, uid: obj.uid === obj.version ? undefined : obj.uid, @@ -3010,22 +2827,15 @@ function explodeEntry(pattern, obj) { obj.permissions = obj.permissions || {}; obj.registry = obj.registry || 'npm'; obj.name = obj.name || getName(pattern); - var integrity = obj.integrity; + const integrity = obj.integrity; if (integrity && integrity.isIntegrity) { obj.integrity = ssri.parse(integrity); } return obj; } -var Lockfile = function () { - function Lockfile() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - cache = _ref.cache, - source = _ref.source, - parseResultType = _ref.parseResultType; - - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Lockfile); - +class Lockfile { + constructor({ cache, source, parseResultType } = {}) { this.source = source || ''; this.cache = cache; this.parseResultType = parseResultType; @@ -3035,29 +2845,29 @@ var Lockfile = function () { // if true, we're parsing an old yarn file and need to update integrity fields - Lockfile.prototype.hasEntriesExistWithoutIntegrity = function hasEntriesExistWithoutIntegrity() { + hasEntriesExistWithoutIntegrity() { if (!this.cache) { return false; } - for (var _key in this.cache) { + for (const key in this.cache) { // $FlowFixMe - `this.cache` is clearly defined at this point - if (!/^.*@(file:|http)/.test(_key) && this.cache[_key] && !this.cache[_key].integrity) { + if (!/^.*@(file:|http)/.test(key) && this.cache[key] && !this.cache[key].integrity) { return true; } } return false; - }; + } - Lockfile.fromDirectory = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, reporter) { + static fromDirectory(dir, reporter) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { // read the manifest in this directory - var lockfileLoc = path.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME); + const lockfileLoc = path.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME); - var lockfile = void 0; - var rawLockfile = ''; - var parseResult = void 0; + let lockfile; + let rawLockfile = ''; + let parseResult; if (yield (_fs || _load_fs()).exists(lockfileLoc)) { rawLockfile = yield (_fs || _load_fs()).readFile(lockfileLoc); @@ -3076,28 +2886,17 @@ var Lockfile = function () { reporter.info(reporter.lang('noLockfileFound')); } - if (lockfile && lockfile.__metadata) { - var lockfilev2 = lockfile; - lockfile = {}; - } - return new Lockfile({ cache: lockfile, source: rawLockfile, parseResultType: parseResult && parseResult.type }); - }); + })(); + } - function fromDirectory(_x2, _x3) { - return _ref2.apply(this, arguments); - } - - return fromDirectory; - }(); - - Lockfile.prototype.getLocked = function getLocked(pattern) { - var cache = this.cache; + getLocked(pattern) { + const cache = this.cache; if (!cache) { return undefined; } - var shrunk = pattern in cache && cache[pattern]; + const shrunk = pattern in cache && cache[pattern]; if (typeof shrunk === 'string') { return this.getLocked(shrunk); @@ -3107,48 +2906,48 @@ var Lockfile = function () { } return undefined; - }; + } - Lockfile.prototype.removePattern = function removePattern(pattern) { - var cache = this.cache; + removePattern(pattern) { + const cache = this.cache; if (!cache) { return; } delete cache[pattern]; - }; + } - Lockfile.prototype.getLockfile = function getLockfile(patterns) { - var lockfile = {}; - var seen = new (_map || _load_map()).default(); + getLockfile(patterns) { + const lockfile = {}; + const seen = new Map(); // order by name so that lockfile manifest is assigned to the first dependency with this manifest // the others that have the same remoteKey will just refer to the first // ordering allows for consistency in lockfile when it is serialized - var sortedPatternsKeys = (0, (_keys || _load_keys()).default)(patterns).sort((_misc || _load_misc()).sortAlpha); + const sortedPatternsKeys = Object.keys(patterns).sort((_misc || _load_misc()).sortAlpha); - for (var _iterator = sortedPatternsKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref3; + for (var _iterator = sortedPatternsKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; if (_isArray) { if (_i >= _iterator.length) break; - _ref3 = _iterator[_i++]; + _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; - _ref3 = _i.value; + _ref = _i.value; } - var pattern = _ref3; + const pattern = _ref; - var pkg = patterns[pattern]; - var remote = pkg._remote, - ref = pkg._reference; + const pkg = patterns[pattern]; + const remote = pkg._remote, + ref = pkg._reference; invariant(ref, 'Package is missing a reference'); invariant(remote, 'Package is missing a remote'); - var remoteKey = keyForRemote(remote); - var seenPattern = remoteKey && seen.get(remoteKey); + const remoteKey = keyForRemote(remote); + const seenPattern = remoteKey && seen.get(remoteKey); if (seenPattern) { // no point in duplicating it lockfile[pattern] = seenPattern; @@ -3160,7 +2959,7 @@ var Lockfile = function () { } continue; } - var obj = implodeEntry(pattern, { + const obj = implodeEntry(pattern, { name: pkg.name, version: pkg.version, uid: pkg._uid, @@ -3182,23 +2981,29 @@ var Lockfile = function () { } return lockfile; - }; - - return Lockfile; -}(); - + } +} exports.default = Lockfile; /***/ }), -/* 26 */ -/***/ (function(module, exports) { +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { -var core = module.exports = { version: '2.5.7' }; -if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef +var store = __webpack_require__(133)('wks'); +var uid = __webpack_require__(137); +var Symbol = __webpack_require__(17).Symbol; +var USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; /***/ }), -/* 27 */ +/* 21 */ /***/ (function(module, exports) { exports = module.exports = SemVer; @@ -4523,213 +4328,63 @@ function coerce(version) { if (match == null) return null; - return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0')); + return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0')); } /***/ }), -/* 28 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); +exports.__esModule = true; -var _promise; +var _assign = __webpack_require__(591); -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -exports.sortAlpha = sortAlpha; -exports.sortOptionsByFlags = sortOptionsByFlags; -exports.entries = entries; -exports.removePrefix = removePrefix; -exports.removeSuffix = removeSuffix; -exports.addSuffix = addSuffix; -exports.hyphenate = hyphenate; -exports.camelCase = camelCase; -exports.compareSortedArrays = compareSortedArrays; -exports.sleep = sleep; +var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _camelCase = __webpack_require__(594); +exports.default = _assign2.default || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; -function sortAlpha(a, b) { - // sort alphabetically in a deterministic way - var shortLen = Math.min(a.length, b.length); - for (var i = 0; i < shortLen; i++) { - var aChar = a.charCodeAt(i); - var bChar = b.charCodeAt(i); - if (aChar !== bChar) { - return aChar - bChar; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } } } - return a.length - b.length; -} -function sortOptionsByFlags(a, b) { - var aOpt = a.flags.replace(/-/g, ''); - var bOpt = b.flags.replace(/-/g, ''); - return sortAlpha(aOpt, bOpt); -} - -function entries(obj) { - var entries = []; - if (obj) { - for (var _key in obj) { - entries.push([_key, obj[_key]]); - } - } - return entries; -} - -function removePrefix(pattern, prefix) { - if (pattern.startsWith(prefix)) { - pattern = pattern.slice(prefix.length); - } - - return pattern; -} - -function removeSuffix(pattern, suffix) { - if (pattern.endsWith(suffix)) { - return pattern.slice(0, -suffix.length); - } - - return pattern; -} - -function addSuffix(pattern, suffix) { - if (!pattern.endsWith(suffix)) { - return pattern + suffix; - } - - return pattern; -} - -function hyphenate(str) { - return str.replace(/[A-Z]/g, function (match) { - return '-' + match.charAt(0).toLowerCase(); - }); -} - -function camelCase(str) { - if (/[A-Z]/.test(str)) { - return null; - } else { - return _camelCase(str); - } -} - -function compareSortedArrays(array1, array2) { - if (array1.length !== array2.length) { - return false; - } - for (var i = 0, len = array1.length; i < len; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - return true; -} - -function sleep(ms) { - return new (_promise || _load_promise()).default(function (resolve) { - setTimeout(resolve, ms); - }); -} + return target; +}; /***/ }), -/* 29 */ +/* 23 */ +/***/ (function(module, exports) { + +module.exports = require("stream"); + +/***/ }), +/* 24 */ /***/ (function(module, exports) { module.exports = require("url"); /***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var YAMLException = __webpack_require__(131); - -var TYPE_CONSTRUCTOR_OPTIONS = [ - 'kind', - 'resolve', - 'construct', - 'instanceOf', - 'predicate', - 'represent', - 'defaultStyle', - 'styleAliases' -]; - -var YAML_NODE_KINDS = [ - 'scalar', - 'sequence', - 'mapping' -]; - -function compileStyleAliases(map) { - var result = {}; - - if (map !== null) { - Object.keys(map).forEach(function (style) { - map[style].forEach(function (alias) { - result[String(alias)] = style; - }); - }); - } - - return result; -} - -function Type(tag, options) { - options = options || {}; - - Object.keys(options).forEach(function (name) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { - throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - - // TODO: Add tag format check. - this.tag = tag; - this.kind = options['kind'] || null; - this.resolve = options['resolve'] || function () { return true; }; - this.construct = options['construct'] || function (data) { return data; }; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.represent = options['represent'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - - if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { - throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } -} - -module.exports = Type; - - -/***/ }), -/* 31 */ +/* 25 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(48); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isObject__ = __webpack_require__(414); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(142); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_tryCatch__ = __webpack_require__(58); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_errorObject__ = __webpack_require__(55); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__ = __webpack_require__(411); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isObject__ = __webpack_require__(443); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(154); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_tryCatch__ = __webpack_require__(56); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_errorObject__ = __webpack_require__(47); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__ = __webpack_require__(440); /** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_tryCatch,_util_errorObject,_util_UnsubscriptionError PURE_IMPORTS_END */ @@ -4865,7 +4520,7 @@ function flattenUnsubscriptionErrors(errors) { /***/ }), -/* 32 */ +/* 26 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. @@ -4890,13 +4545,13 @@ module.exports = { readBitString: readBitString }; -var assert = __webpack_require__(22); -var Buffer = __webpack_require__(20).Buffer; -var PrivateKey = __webpack_require__(39); -var Key = __webpack_require__(34); -var crypto = __webpack_require__(21); -var algs = __webpack_require__(38); -var asn1 = __webpack_require__(66); +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; +var PrivateKey = __webpack_require__(33); +var Key = __webpack_require__(27); +var crypto = __webpack_require__(12); +var algs = __webpack_require__(32); +var asn1 = __webpack_require__(65); var ec, jsbn; var nacl; @@ -5127,7 +4782,7 @@ function calculateDSAPublic(g, p, x) { assert.buffer(p); assert.buffer(x); try { - var bigInt = __webpack_require__(79).BigInteger; + var bigInt = __webpack_require__(81).BigInteger; } catch (e) { throw (new Error('To load a PKCS#8 format DSA private key, ' + 'the node jsbn library is required.')); @@ -5144,7 +4799,7 @@ function calculateED25519Public(k) { assert.buffer(k); if (nacl === undefined) - nacl = __webpack_require__(71); + nacl = __webpack_require__(75); var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); @@ -5154,7 +4809,7 @@ function calculateX25519Public(k) { assert.buffer(k); if (nacl === undefined) - nacl = __webpack_require__(71); + nacl = __webpack_require__(75); var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); @@ -5164,7 +4819,7 @@ function addRSAMissing(key) { assert.object(key); assertCompatible(key, PrivateKey, [1, 1]); try { - var bigInt = __webpack_require__(79).BigInteger; + var bigInt = __webpack_require__(81).BigInteger; } catch (e) { throw (new Error('To write a PEM private key from ' + 'this source, the node jsbn lib is required.')); @@ -5195,9 +4850,9 @@ function publicFromPrivateECDSA(curveName, priv) { assert.string(curveName, 'curveName'); assert.buffer(priv); if (ec === undefined) - ec = __webpack_require__(129); + ec = __webpack_require__(139); if (jsbn === undefined) - jsbn = __webpack_require__(79).BigInteger; + jsbn = __webpack_require__(81).BigInteger; var params = algs.curves[curveName]; var p = new jsbn(params.p); var a = new jsbn(params.a); @@ -5260,94 +4915,26 @@ function opensshCipherInfo(cipher) { /***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(37); -var core = __webpack_require__(26); -var ctx = __webpack_require__(67); -var hide = __webpack_require__(77); -var has = __webpack_require__(89); -var PROTOTYPE = 'prototype'; - -var $export = function (type, name, source) { - var IS_FORCED = type & $export.F; - var IS_GLOBAL = type & $export.G; - var IS_STATIC = type & $export.S; - var IS_PROTO = type & $export.P; - var IS_BIND = type & $export.B; - var IS_WRAP = type & $export.W; - var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); - var expProto = exports[PROTOTYPE]; - var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; - var key, own, out; - if (IS_GLOBAL) source = name; - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - if (own && has(exports, key)) continue; - // export native or passed - out = own ? target[key] : source[key]; - // prevent global pollution for namespaces - exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] - // bind timers to global for call from export context - : IS_BIND && own ? ctx(out, global) - // wrap global constructors for prevent change them in library - : IS_WRAP && target[key] == out ? (function (C) { - var F = function (a, b, c) { - if (this instanceof C) { - switch (arguments.length) { - case 0: return new C(); - case 1: return new C(a); - case 2: return new C(a, b); - } return new C(a, b, c); - } return C.apply(this, arguments); - }; - F[PROTOTYPE] = C[PROTOTYPE]; - return F; - // make static versions for prototype methods - })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% - if (IS_PROTO) { - (exports.virtual || (exports.virtual = {}))[key] = out; - // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% - if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); - } - } -}; -// type bitmap -$export.F = 1; // forced -$export.G = 2; // global -$export.S = 4; // static -$export.P = 8; // proto -$export.B = 16; // bind -$export.W = 32; // wrap -$export.U = 64; // safe -$export.R = 128; // real proto method for `library` -module.exports = $export; - - -/***/ }), -/* 34 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = Key; -var assert = __webpack_require__(22); -var algs = __webpack_require__(38); -var crypto = __webpack_require__(21); -var Fingerprint = __webpack_require__(144); -var Signature = __webpack_require__(70); -var DiffieHellman = __webpack_require__(265).DiffieHellman; -var errs = __webpack_require__(69); -var utils = __webpack_require__(32); -var PrivateKey = __webpack_require__(39); +var assert = __webpack_require__(16); +var algs = __webpack_require__(32); +var crypto = __webpack_require__(12); +var Fingerprint = __webpack_require__(156); +var Signature = __webpack_require__(74); +var DiffieHellman = __webpack_require__(325).DiffieHellman; +var errs = __webpack_require__(73); +var utils = __webpack_require__(26); +var PrivateKey = __webpack_require__(33); var edCompat; try { - edCompat = __webpack_require__(424); + edCompat = __webpack_require__(453); } catch (e) { /* Just continue through, and bail out if we try to use it. */ } @@ -5356,15 +4943,15 @@ var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var formats = {}; -formats['auto'] = __webpack_require__(425); -formats['pem'] = __webpack_require__(82); -formats['pkcs1'] = __webpack_require__(267); -formats['pkcs8'] = __webpack_require__(145); -formats['rfc4253'] = __webpack_require__(92); -formats['ssh'] = __webpack_require__(426); -formats['ssh-private'] = __webpack_require__(182); +formats['auto'] = __webpack_require__(454); +formats['pem'] = __webpack_require__(86); +formats['pkcs1'] = __webpack_require__(327); +formats['pkcs8'] = __webpack_require__(157); +formats['rfc4253'] = __webpack_require__(103); +formats['ssh'] = __webpack_require__(455); +formats['ssh-private'] = __webpack_require__(192); formats['openssh'] = formats['ssh-private']; -formats['dnssec'] = __webpack_require__(266); +formats['dnssec'] = __webpack_require__(326); function Key(opts) { assert.object(opts, 'options'); @@ -5609,22 +5196,65 @@ Key._oldVersionDetect = function (obj) { /***/ }), -/* 35 */ +/* 28 */ /***/ (function(module, exports) { -module.exports = require("stream"); +module.exports = require("assert"); /***/ }), -/* 36 */ +/* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const escapeStringRegexp = __webpack_require__(357); -const ansiStyles = __webpack_require__(479); -const stdoutColor = __webpack_require__(596).stdout; -const template = __webpack_require__(597); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = nullify; +function nullify(obj = {}) { + if (Array.isArray(obj)) { + for (var _iterator = obj, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const item = _ref; + + nullify(item); + } + } else if (obj !== null && typeof obj === 'object' || typeof obj === 'function') { + Object.setPrototypeOf(obj, null); + + // for..in can only be applied to 'object', not 'function' + if (typeof obj === 'object') { + for (const key in obj) { + nullify(obj[key]); + } + } + } + + return obj; +} + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +const escapeStringRegexp = __webpack_require__(387); +const ansiStyles = __webpack_require__(505); +const stdoutColor = __webpack_require__(598).stdout; + +const template = __webpack_require__(599); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); @@ -5850,24 +5480,20 @@ module.exports.default = module.exports; // For TypeScript /***/ }), -/* 37 */ +/* 31 */ /***/ (function(module, exports) { -// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 -var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self - // eslint-disable-next-line no-new-func - : Function('return this')(); -if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef +var core = module.exports = { version: '2.5.7' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef /***/ }), -/* 38 */ +/* 32 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. -var Buffer = __webpack_require__(20).Buffer; +var Buffer = __webpack_require__(15).Buffer; var algInfo = { 'dsa': { @@ -6036,50 +5662,50 @@ module.exports = { /***/ }), -/* 39 */ +/* 33 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = PrivateKey; -var assert = __webpack_require__(22); -var Buffer = __webpack_require__(20).Buffer; -var algs = __webpack_require__(38); -var crypto = __webpack_require__(21); -var Fingerprint = __webpack_require__(144); -var Signature = __webpack_require__(70); -var errs = __webpack_require__(69); -var util = __webpack_require__(9); -var utils = __webpack_require__(32); -var dhe = __webpack_require__(265); +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var crypto = __webpack_require__(12); +var Fingerprint = __webpack_require__(156); +var Signature = __webpack_require__(74); +var errs = __webpack_require__(73); +var util = __webpack_require__(3); +var utils = __webpack_require__(26); +var dhe = __webpack_require__(325); var generateECDSA = dhe.generateECDSA; var generateED25519 = dhe.generateED25519; var edCompat; var nacl; try { - edCompat = __webpack_require__(424); + edCompat = __webpack_require__(453); } catch (e) { /* Just continue through, and bail out if we try to use it. */ } -var Key = __webpack_require__(34); +var Key = __webpack_require__(27); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var KeyEncryptedError = errs.KeyEncryptedError; var formats = {}; -formats['auto'] = __webpack_require__(425); -formats['pem'] = __webpack_require__(82); -formats['pkcs1'] = __webpack_require__(267); -formats['pkcs8'] = __webpack_require__(145); -formats['rfc4253'] = __webpack_require__(92); -formats['ssh-private'] = __webpack_require__(182); +formats['auto'] = __webpack_require__(454); +formats['pem'] = __webpack_require__(86); +formats['pkcs1'] = __webpack_require__(327); +formats['pkcs8'] = __webpack_require__(157); +formats['rfc4253'] = __webpack_require__(103); +formats['ssh-private'] = __webpack_require__(192); formats['openssh'] = formats['ssh-private']; formats['ssh'] = formats['ssh-private']; -formats['dnssec'] = __webpack_require__(266); +formats['dnssec'] = __webpack_require__(326); function PrivateKey(opts) { assert.object(opts, 'options'); @@ -6132,7 +5758,7 @@ PrivateKey.prototype.derive = function (newType) { if (this.type === 'ed25519' && newType === 'curve25519') { if (nacl === undefined) - nacl = __webpack_require__(71); + nacl = __webpack_require__(75); priv = this.part.k.data; if (priv[0] === 0x00) @@ -6150,7 +5776,7 @@ PrivateKey.prototype.derive = function (newType) { })); } else if (this.type === 'curve25519' && newType === 'ed25519') { if (nacl === undefined) - nacl = __webpack_require__(71); + nacl = __webpack_require__(75); priv = this.part.k.data; if (priv[0] === 0x00) @@ -6295,13 +5921,7 @@ PrivateKey._oldVersionDetect = function (obj) { /***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(624), __esModule: true }; - -/***/ }), -/* 41 */ +/* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6312,46 +5932,10 @@ Object.defineProperty(exports, "__esModule", { }); exports.wrapLifecycle = exports.run = exports.install = exports.Install = undefined; -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _values; - -function _load_values() { - return _values = _interopRequireDefault(__webpack_require__(583)); -} - var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); + return _extends2 = _interopRequireDefault(__webpack_require__(22)); } var _asyncToGenerator2; @@ -6360,29 +5944,23 @@ function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var install = exports.install = function () { - var _ref43 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile) { +let install = exports.install = (() => { + var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile) { yield wrapLifecycle(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var install = new Install(flags, config, reporter, lockfile); + const install = new Install(flags, config, reporter, lockfile); yield install.init(); })); }); - return function install(_x16, _x17, _x18, _x19) { - return _ref43.apply(this, arguments); + return function install(_x7, _x8, _x9, _x10) { + return _ref29.apply(this, arguments); }; -}(); +})(); -var run = exports.run = function () { - var _ref45 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var lockfile = void 0; - var error = 'installCommandRenamed'; +let run = exports.run = (() => { + var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + let lockfile; + let error = 'installCommandRenamed'; if (flags.lockfile === false) { lockfile = new (_lockfile || _load_lockfile()).default(); } else { @@ -6390,7 +5968,7 @@ var run = exports.run = function () { } if (args.length) { - var exampleArgs = args.slice(); + const exampleArgs = args.slice(); if (flags.saveDev) { exampleArgs.push('--dev'); @@ -6407,7 +5985,7 @@ var run = exports.run = function () { if (flags.saveTilde) { exampleArgs.push('--tilde'); } - var command = 'add'; + let command = 'add'; if (flags.global) { error = 'globalFlagRemoved'; command = 'global add'; @@ -6418,13 +5996,13 @@ var run = exports.run = function () { yield install(config, reporter, flags, lockfile); }); - return function run(_x20, _x21, _x22, _x23) { - return _ref45.apply(this, arguments); + return function run(_x11, _x12, _x13, _x14) { + return _ref31.apply(this, arguments); }; -}(); +})(); -var wrapLifecycle = exports.wrapLifecycle = function () { - var _ref46 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags, factory) { +let wrapLifecycle = exports.wrapLifecycle = (() => { + var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags, factory) { yield config.executeLifecycleScript('preinstall'); yield factory(); @@ -6441,10 +6019,10 @@ var wrapLifecycle = exports.wrapLifecycle = function () { } }); - return function wrapLifecycle(_x24, _x25, _x26) { - return _ref46.apply(this, arguments); + return function wrapLifecycle(_x15, _x16, _x17) { + return _ref32.apply(this, arguments); }; -}(); +})(); exports.hasWrapper = hasWrapper; exports.setFlags = setFlags; @@ -6452,167 +6030,167 @@ exports.setFlags = setFlags; var _objectPath; function _load_objectPath() { - return _objectPath = _interopRequireDefault(__webpack_require__(244)); + return _objectPath = _interopRequireDefault(__webpack_require__(304)); } var _hooks; function _load_hooks() { - return _hooks = __webpack_require__(317); + return _hooks = __webpack_require__(581); } var _index; function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(208)); + return _index = _interopRequireDefault(__webpack_require__(220)); } var _errors; function _load_errors() { - return _errors = __webpack_require__(6); + return _errors = __webpack_require__(5); } var _integrityChecker; function _load_integrityChecker() { - return _integrityChecker = _interopRequireDefault(__webpack_require__(197)); + return _integrityChecker = _interopRequireDefault(__webpack_require__(208)); } var _lockfile; function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); + return _lockfile = _interopRequireDefault(__webpack_require__(19)); } var _lockfile2; function _load_lockfile2() { - return _lockfile2 = __webpack_require__(25); + return _lockfile2 = __webpack_require__(19); } var _packageFetcher; function _load_packageFetcher() { - return _packageFetcher = _interopRequireWildcard(__webpack_require__(199)); + return _packageFetcher = _interopRequireWildcard(__webpack_require__(210)); } var _packageInstallScripts; function _load_packageInstallScripts() { - return _packageInstallScripts = _interopRequireDefault(__webpack_require__(545)); + return _packageInstallScripts = _interopRequireDefault(__webpack_require__(556)); } var _packageCompatibility; function _load_packageCompatibility() { - return _packageCompatibility = _interopRequireWildcard(__webpack_require__(198)); + return _packageCompatibility = _interopRequireWildcard(__webpack_require__(209)); } var _packageResolver; function _load_packageResolver() { - return _packageResolver = _interopRequireDefault(__webpack_require__(309)); + return _packageResolver = _interopRequireDefault(__webpack_require__(366)); } var _packageLinker; function _load_packageLinker() { - return _packageLinker = _interopRequireDefault(__webpack_require__(200)); + return _packageLinker = _interopRequireDefault(__webpack_require__(211)); } var _index2; function _load_index2() { - return _index2 = __webpack_require__(60); + return _index2 = __webpack_require__(57); } var _index3; function _load_index3() { - return _index3 = __webpack_require__(75); + return _index3 = __webpack_require__(78); } var _autoclean; function _load_autoclean() { - return _autoclean = __webpack_require__(296); + return _autoclean = __webpack_require__(354); } var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } var _normalizePattern; function _load_normalizePattern() { - return _normalizePattern = __webpack_require__(52); + return _normalizePattern = __webpack_require__(37); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); + return _fs = _interopRequireWildcard(__webpack_require__(6)); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(51)); + return _map = _interopRequireDefault(__webpack_require__(29)); } var _yarnVersion; function _load_yarnVersion() { - return _yarnVersion = __webpack_require__(114); + return _yarnVersion = __webpack_require__(120); } var _generatePnpMap; function _load_generatePnpMap() { - return _generatePnpMap = __webpack_require__(568); + return _generatePnpMap = __webpack_require__(578); } var _workspaceLayout; function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(87)); + return _workspaceLayout = _interopRequireDefault(__webpack_require__(90)); } var _resolutionMap; function _load_resolutionMap() { - return _resolutionMap = _interopRequireDefault(__webpack_require__(203)); + return _resolutionMap = _interopRequireDefault(__webpack_require__(214)); } var _guessName; function _load_guessName() { - return _guessName = _interopRequireDefault(__webpack_require__(159)); + return _guessName = _interopRequireDefault(__webpack_require__(169)); } var _audit; function _load_audit() { - return _audit = _interopRequireDefault(__webpack_require__(295)); + return _audit = _interopRequireDefault(__webpack_require__(353)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var deepEqual = __webpack_require__(686); +const deepEqual = __webpack_require__(631); -var emoji = __webpack_require__(242); -var invariant = __webpack_require__(15); -var path = __webpack_require__(1); -var semver = __webpack_require__(27); -var uuid = __webpack_require__(113); -var ssri = __webpack_require__(93); +const emoji = __webpack_require__(302); +const invariant = __webpack_require__(9); +const path = __webpack_require__(0); +const semver = __webpack_require__(21); +const uuid = __webpack_require__(119); +const ssri = __webpack_require__(77); -var ONE_DAY = 1000 * 60 * 60 * 24; +const ONE_DAY = 1000 * 60 * 60 * 24; /** * Try and detect the installation method for Yarn and provide a command to update it with. @@ -6664,7 +6242,7 @@ function getUpdateInstaller(installationMethod) { } function normalizeFlags(config, rawFlags) { - var flags = { + const flags = { // install har: !!rawFlags.har, ignorePlatform: !!rawFlags.ignorePlatform, @@ -6720,10 +6298,8 @@ function normalizeFlags(config, rawFlags) { return flags; } -var Install = exports.Install = function () { - function Install(flags, config, reporter, lockfile) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Install); - +class Install { + constructor(flags, config, reporter, lockfile) { this.rootManifestRegistries = []; this.rootPatternsToOrigin = (0, (_map || _load_map()).default)(); this.lockfile = lockfile; @@ -6742,67 +6318,64 @@ var Install = exports.Install = function () { * Create a list of dependency requests from the current directories manifests. */ - Install.prototype.fetchRequestFromCwd = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _this = this; + fetchRequestFromCwd(excludePatterns = [], ignoreUnusedPatterns = false) { + var _this = this; - var excludePatterns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var ignoreUnusedPatterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const patterns = []; + const deps = []; + let resolutionDeps = []; + const manifest = {}; - var patterns = []; - var deps = []; - var resolutionDeps = []; - var manifest = {}; - - var ignorePatterns = []; - var usedPatterns = []; - var workspaceLayout = void 0; + const ignorePatterns = []; + const usedPatterns = []; + let workspaceLayout; // some commands should always run in the context of the entire workspace - var cwd = this.flags.includeWorkspaceDeps || this.flags.workspaceRootIsCwd ? this.config.lockfileFolder : this.config.cwd; + const cwd = _this.flags.includeWorkspaceDeps || _this.flags.workspaceRootIsCwd ? _this.config.lockfileFolder : _this.config.cwd; // non-workspaces are always root, otherwise check for workspace root - var cwdIsRoot = !this.config.workspaceRootFolder || this.config.lockfileFolder === cwd; + const cwdIsRoot = !_this.config.workspaceRootFolder || _this.config.lockfileFolder === cwd; // exclude package names that are in install args - var excludeNames = []; - for (var _iterator = excludePatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref2; + const excludeNames = []; + for (var _iterator = excludePatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; if (_isArray) { if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; + _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; - _ref2 = _i.value; + _ref = _i.value; } - var _pattern = _ref2; + const pattern = _ref; - if ((0, (_index3 || _load_index3()).getExoticResolver)(_pattern)) { - excludeNames.push((0, (_guessName || _load_guessName()).default)(_pattern)); + if ((0, (_index3 || _load_index3()).getExoticResolver)(pattern)) { + excludeNames.push((0, (_guessName || _load_guessName()).default)(pattern)); } else { // extract the name - var parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(_pattern); + const parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern); excludeNames.push(parts.name); } } - var stripExcluded = function stripExcluded(manifest) { - for (var _iterator2 = excludeNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref3; + const stripExcluded = function stripExcluded(manifest) { + for (var _iterator2 = excludeNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; + _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; - _ref3 = _i2.value; + _ref2 = _i2.value; } - var exclude = _ref3; + const exclude = _ref2; if (manifest.dependencies && manifest.dependencies[exclude]) { delete manifest.dependencies[exclude]; @@ -6816,61 +6389,71 @@ var Install = exports.Install = function () { } }; - var _loop = function* _loop(registry) { - var filename = (_index2 || _load_index2()).registries[registry].filename; + for (var _iterator3 = Object.keys((_index2 || _load_index2()).registries), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; - var loc = path.join(cwd, filename); + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + const registry = _ref3; + + const filename = (_index2 || _load_index2()).registries[registry].filename; + + const loc = path.join(cwd, filename); if (!(yield (_fs || _load_fs()).exists(loc))) { - return 'continue'; + continue; } _this.rootManifestRegistries.push(registry); - var projectManifestJson = yield _this.config.readJson(loc); + const projectManifestJson = yield _this.config.readJson(loc); yield (0, (_index || _load_index()).default)(projectManifestJson, cwd, _this.config, cwdIsRoot); - (0, (_assign || _load_assign()).default)(_this.resolutions, projectManifestJson.resolutions); - (0, (_assign || _load_assign()).default)(manifest, projectManifestJson); + Object.assign(_this.resolutions, projectManifestJson.resolutions); + Object.assign(manifest, projectManifestJson); _this.resolutionMap.init(_this.resolutions); - for (var _iterator4 = (0, (_keys || _load_keys()).default)(_this.resolutionMap.resolutionsByPackage), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref5; + for (var _iterator4 = Object.keys(_this.resolutionMap.resolutionsByPackage), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref4; if (_isArray4) { if (_i4 >= _iterator4.length) break; - _ref5 = _iterator4[_i4++]; + _ref4 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; - _ref5 = _i4.value; + _ref4 = _i4.value; } - var _packageName = _ref5; + const packageName = _ref4; - var _optional = (_objectPath || _load_objectPath()).default.has(manifest.optionalDependencies, _packageName) && _this.flags.ignoreOptional; - for (var _iterator8 = _this.resolutionMap.resolutionsByPackage[_packageName], _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) { - var _ref11; + const optional = (_objectPath || _load_objectPath()).default.has(manifest.optionalDependencies, packageName) && _this.flags.ignoreOptional; + for (var _iterator8 = _this.resolutionMap.resolutionsByPackage[packageName], _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { + var _ref9; if (_isArray8) { if (_i8 >= _iterator8.length) break; - _ref11 = _iterator8[_i8++]; + _ref9 = _iterator8[_i8++]; } else { _i8 = _iterator8.next(); if (_i8.done) break; - _ref11 = _i8.value; + _ref9 = _i8.value; } - var _ref10 = _ref11; - var _pattern3 = _ref10.pattern; + const _ref8 = _ref9; + const pattern = _ref8.pattern; - resolutionDeps = [].concat(resolutionDeps, [{ registry, pattern: _pattern3, optional: _optional, hint: 'resolution' }]); + resolutionDeps = [...resolutionDeps, { registry, pattern, optional, hint: 'resolution' }]; } } - var pushDeps = function pushDeps(depType, manifest, _ref6, isUsed) { - var hint = _ref6.hint, - optional = _ref6.optional; - + const pushDeps = function pushDeps(depType, manifest, { hint, optional }, isUsed) { if (ignoreUnusedPatterns && !isUsed) { return; } @@ -6880,29 +6463,29 @@ var Install = exports.Install = function () { if (_this.flags.flat && !isUsed) { return; } - var depMap = manifest[depType]; - for (var name in depMap) { + const depMap = manifest[depType]; + for (const name in depMap) { if (excludeNames.indexOf(name) >= 0) { continue; } - var _pattern2 = name; - if (!_this.lockfile.getLocked(_pattern2)) { + let pattern = name; + if (!_this.lockfile.getLocked(pattern)) { // when we use --save we save the dependency to the lockfile with just the name rather than the // version combo - _pattern2 += '@' + depMap[name]; + pattern += '@' + depMap[name]; } // normalization made sure packages are mentioned only once if (isUsed) { - usedPatterns.push(_pattern2); + usedPatterns.push(pattern); } else { - ignorePatterns.push(_pattern2); + ignorePatterns.push(pattern); } - _this.rootPatternsToOrigin[_pattern2] = depType; - patterns.push(_pattern2); - deps.push({ pattern: _pattern2, registry, hint, optional, workspaceName: manifest.name, workspaceLoc: manifest._loc }); + _this.rootPatternsToOrigin[pattern] = depType; + patterns.push(pattern); + deps.push({ pattern, registry, hint, optional, workspaceName: manifest.name, workspaceLoc: manifest._loc }); } }; @@ -6913,36 +6496,36 @@ var Install = exports.Install = function () { } if (_this.config.workspaceRootFolder) { - var workspaceLoc = cwdIsRoot ? loc : path.join(_this.config.lockfileFolder, filename); - var workspacesRoot = path.dirname(workspaceLoc); + const workspaceLoc = cwdIsRoot ? loc : path.join(_this.config.lockfileFolder, filename); + const workspacesRoot = path.dirname(workspaceLoc); - var workspaceManifestJson = projectManifestJson; + let workspaceManifestJson = projectManifestJson; if (!cwdIsRoot) { // the manifest we read before was a child workspace, so get the root workspaceManifestJson = yield _this.config.readJson(workspaceLoc); yield (0, (_index || _load_index()).default)(workspaceManifestJson, workspacesRoot, _this.config, true); } - var workspaces = yield _this.config.resolveWorkspaces(workspacesRoot, workspaceManifestJson); + const workspaces = yield _this.config.resolveWorkspaces(workspacesRoot, workspaceManifestJson); workspaceLayout = new (_workspaceLayout || _load_workspaceLayout()).default(workspaces, _this.config); // add virtual manifest that depends on all workspaces, this way package hoisters and resolvers will work fine - var workspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.dependencies); - for (var _iterator5 = (0, (_keys || _load_keys()).default)(workspaces), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { - var _ref7; + const workspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.dependencies); + for (var _iterator5 = Object.keys(workspaces), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref5; if (_isArray5) { if (_i5 >= _iterator5.length) break; - _ref7 = _iterator5[_i5++]; + _ref5 = _iterator5[_i5++]; } else { _i5 = _iterator5.next(); if (_i5.done) break; - _ref7 = _i5.value; + _ref5 = _i5.value; } - var workspaceName = _ref7; + const workspaceName = _ref5; - var workspaceManifest = workspaces[workspaceName].manifest; + const workspaceManifest = workspaces[workspaceName].manifest; workspaceDependencies[workspaceName] = workspaceManifest.version; // include dependencies from all workspaces @@ -6952,7 +6535,7 @@ var Install = exports.Install = function () { pushDeps('optionalDependencies', workspaceManifest, { hint: 'optional', optional: true }, true); } } - var virtualDependencyManifest = { + const virtualDependencyManifest = { _uid: '', name: `workspace-aggregator-${uuid.v4()}`, version: '1.0.0', @@ -6965,7 +6548,7 @@ var Install = exports.Install = function () { workspaces: workspaceManifestJson.workspaces }; workspaceLayout.virtualManifestName = virtualDependencyManifest.name; - var virtualDep = {}; + const virtualDep = {}; virtualDep[virtualDependencyManifest.name] = virtualDependencyManifest.version; workspaces[virtualDependencyManifest.name] = { loc: workspacesRoot, manifest: virtualDependencyManifest }; @@ -6974,35 +6557,35 @@ var Install = exports.Install = function () { pushDeps('workspaces', { workspaces: virtualDep }, { hint: 'workspaces', optional: false }, true); - var implicitWorkspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceDependencies); + const implicitWorkspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceDependencies); - for (var _iterator6 = (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { - var _ref8; + for (var _iterator6 = (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref6; if (_isArray6) { if (_i6 >= _iterator6.length) break; - _ref8 = _iterator6[_i6++]; + _ref6 = _iterator6[_i6++]; } else { _i6 = _iterator6.next(); if (_i6.done) break; - _ref8 = _i6.value; + _ref6 = _i6.value; } - var type = _ref8; + const type = _ref6; - for (var _iterator7 = (0, (_keys || _load_keys()).default)(projectManifestJson[type] || {}), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { - var _ref9; + for (var _iterator7 = Object.keys(projectManifestJson[type] || {}), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref7; if (_isArray7) { if (_i7 >= _iterator7.length) break; - _ref9 = _iterator7[_i7++]; + _ref7 = _iterator7[_i7++]; } else { _i7 = _iterator7.next(); if (_i7.done) break; - _ref9 = _i7.value; + _ref7 = _i7.value; } - var dependencyName = _ref9; + const dependencyName = _ref7; delete implicitWorkspaceDependencies[dependencyName]; } @@ -7011,371 +6594,318 @@ var Install = exports.Install = function () { pushDeps('dependencies', { dependencies: implicitWorkspaceDependencies }, { hint: 'workspaces', optional: false }, true); } - return 'break'; - }; - - _loop2: for (var _iterator3 = (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref4; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } - - var registry = _ref4; - - var _ret = yield* _loop(registry); - - switch (_ret) { - case 'continue': - continue; - - case 'break': - break _loop2;} + break; } // inherit root flat flag - - if (manifest.flat) { - this.flags.flat = true; + _this.flags.flat = true; } return { - requests: [].concat(resolutionDeps, deps), + requests: [...resolutionDeps, ...deps], patterns, manifest, usedPatterns, ignorePatterns, workspaceLayout }; - }); - - function fetchRequestFromCwd() { - return _ref.apply(this, arguments); - } - - return fetchRequestFromCwd; - }(); + })(); + } /** * TODO description */ - Install.prototype.prepareRequests = function prepareRequests(requests) { + prepareRequests(requests) { return requests; - }; + } - Install.prototype.preparePatterns = function preparePatterns(patterns) { + preparePatterns(patterns) { return patterns; - }; - - Install.prototype.preparePatternsForLinking = function preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) { + } + preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) { return patterns; - }; + } - Install.prototype.prepareManifests = function () { - var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var manifests = yield this.config.getRootManifests(); + prepareManifests() { + var _this2 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const manifests = yield _this2.config.getRootManifests(); return manifests; - }); + })(); + } - function prepareManifests() { - return _ref12.apply(this, arguments); - } + bailout(patterns, workspaceLayout) { + var _this3 = this; - return prepareManifests; - }(); - - Install.prototype.bailout = function () { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { // We don't want to skip the audit - it could yield important errors - if (this.flags.audit) { + if (_this3.flags.audit) { return false; } // PNP is so fast that the integrity check isn't pertinent - if (this.config.plugnplayEnabled) { + if (_this3.config.plugnplayEnabled) { return false; } - if (this.flags.skipIntegrityCheck || this.flags.force) { + if (_this3.flags.skipIntegrityCheck || _this3.flags.force) { return false; } - var lockfileCache = this.lockfile.cache; + const lockfileCache = _this3.lockfile.cache; if (!lockfileCache) { return false; } - var lockfileClean = this.lockfile.parseResultType === 'success'; - var match = yield this.integrityChecker.check(patterns, lockfileCache, this.flags, workspaceLayout); - if (this.flags.frozenLockfile && (!lockfileClean || match.missingPatterns.length > 0)) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('frozenLockfileError')); + const lockfileClean = _this3.lockfile.parseResultType === 'success'; + const match = yield _this3.integrityChecker.check(patterns, lockfileCache, _this3.flags, workspaceLayout); + if (_this3.flags.frozenLockfile && (!lockfileClean || match.missingPatterns.length > 0)) { + throw new (_errors || _load_errors()).MessageError(_this3.reporter.lang('frozenLockfileError')); } - var haveLockfile = yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); + const haveLockfile = yield (_fs || _load_fs()).exists(path.join(_this3.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); - var lockfileIntegrityPresent = !this.lockfile.hasEntriesExistWithoutIntegrity(); - var integrityBailout = lockfileIntegrityPresent || !this.config.autoAddIntegrity; + const lockfileIntegrityPresent = !_this3.lockfile.hasEntriesExistWithoutIntegrity(); + const integrityBailout = lockfileIntegrityPresent || !_this3.config.autoAddIntegrity; if (match.integrityMatches && haveLockfile && lockfileClean && integrityBailout) { - this.reporter.success(this.reporter.lang('upToDate')); + _this3.reporter.success(_this3.reporter.lang('upToDate')); return true; } if (match.integrityFileMissing && haveLockfile) { // Integrity file missing, force script installations - this.scripts.setForce(true); + _this3.scripts.setForce(true); return false; } if (match.hardRefreshRequired) { // e.g. node version doesn't match, force script installations - this.scripts.setForce(true); + _this3.scripts.setForce(true); return false; } if (!patterns.length && !match.integrityFileMissing) { - this.reporter.success(this.reporter.lang('nothingToInstall')); - yield this.createEmptyManifestFolders(); - yield this.saveLockfileAndIntegrity(patterns, workspaceLayout); + _this3.reporter.success(_this3.reporter.lang('nothingToInstall')); + yield _this3.createEmptyManifestFolders(); + yield _this3.saveLockfileAndIntegrity(patterns, workspaceLayout); return true; } return false; - }); - - function bailout(_x3, _x4) { - return _ref13.apply(this, arguments); - } - - return bailout; - }(); + })(); + } /** * Produce empty folders for all used root manifests. */ - Install.prototype.createEmptyManifestFolders = function () { - var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (this.config.modulesFolder) { + createEmptyManifestFolders() { + var _this4 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (_this4.config.modulesFolder) { // already created return; } - for (var _iterator9 = this.rootManifestRegistries, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) { - var _ref15; + for (var _iterator9 = _this4.rootManifestRegistries, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { + var _ref10; if (_isArray9) { if (_i9 >= _iterator9.length) break; - _ref15 = _iterator9[_i9++]; + _ref10 = _iterator9[_i9++]; } else { _i9 = _iterator9.next(); if (_i9.done) break; - _ref15 = _i9.value; + _ref10 = _i9.value; } - var registryName = _ref15; - var folder = this.config.registries[registryName].folder; + const registryName = _ref10; + const folder = _this4.config.registries[registryName].folder; - yield (_fs || _load_fs()).mkdirp(path.join(this.config.lockfileFolder, folder)); + yield (_fs || _load_fs()).mkdirp(path.join(_this4.config.lockfileFolder, folder)); } - }); - - function createEmptyManifestFolders() { - return _ref14.apply(this, arguments); - } - - return createEmptyManifestFolders; - }(); + })(); + } /** * TODO description */ - Install.prototype.markIgnored = function markIgnored(patterns) { - for (var _iterator10 = patterns, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) { - var _ref16; + markIgnored(patterns) { + for (var _iterator10 = patterns, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { + var _ref11; if (_isArray10) { if (_i10 >= _iterator10.length) break; - _ref16 = _iterator10[_i10++]; + _ref11 = _iterator10[_i10++]; } else { _i10 = _iterator10.next(); if (_i10.done) break; - _ref16 = _i10.value; + _ref11 = _i10.value; } - var _pattern4 = _ref16; + const pattern = _ref11; - var _manifest = this.resolver.getStrictResolvedPattern(_pattern4); - var ref = _manifest._reference; + const manifest = this.resolver.getStrictResolvedPattern(pattern); + const ref = manifest._reference; invariant(ref, 'expected package reference'); // just mark the package as ignored. if the package is used by a required package, the hoister // will take care of that. ref.ignore = true; } - }; + } /** * helper method that gets only recent manifests * used by global.ls command */ + getFlattenedDeps() { + var _this5 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _ref12 = yield _this5.fetchRequestFromCwd(); + + const depRequests = _ref12.requests, + rawPatterns = _ref12.patterns; - Install.prototype.getFlattenedDeps = function () { - var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref18 = yield this.fetchRequestFromCwd(), - depRequests = _ref18.requests, - rawPatterns = _ref18.patterns; + yield _this5.resolver.init(depRequests, {}); - yield this.resolver.init(depRequests, {}); + const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this5.resolver.getManifests(), _this5.config); + _this5.resolver.updateManifests(manifests); - var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(this.resolver.getManifests(), this.config); - this.resolver.updateManifests(manifests); - - return this.flatten(rawPatterns); - }); - - function getFlattenedDeps() { - return _ref17.apply(this, arguments); - } - - return getFlattenedDeps; - }(); + return _this5.flatten(rawPatterns); + })(); + } /** * TODO description */ - Install.prototype.init = function () { - var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _this2 = this; + init() { + var _this6 = this; - this.checkUpdate(); + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + _this6.checkUpdate(); // warn if we have a shrinkwrap - if (yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).NPM_SHRINKWRAP_FILENAME))) { - this.reporter.warn(this.reporter.lang('shrinkwrapWarning')); + if (yield (_fs || _load_fs()).exists(path.join(_this6.config.lockfileFolder, (_constants || _load_constants()).NPM_SHRINKWRAP_FILENAME))) { + _this6.reporter.warn(_this6.reporter.lang('shrinkwrapWarning')); } // warn if we have an npm lockfile - if (yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).NPM_LOCK_FILENAME))) { - this.reporter.warn(this.reporter.lang('npmLockfileWarning')); + if (yield (_fs || _load_fs()).exists(path.join(_this6.config.lockfileFolder, (_constants || _load_constants()).NPM_LOCK_FILENAME))) { + _this6.reporter.warn(_this6.reporter.lang('npmLockfileWarning')); } - if (this.config.plugnplayEnabled) { - this.reporter.info(this.reporter.lang('plugnplaySuggestV2L1')); - this.reporter.info(this.reporter.lang('plugnplaySuggestV2L2')); - } + let flattenedTopLevelPatterns = []; + const steps = []; - var flattenedTopLevelPatterns = []; - var steps = []; + var _ref13 = yield _this6.fetchRequestFromCwd(); - var _ref20 = yield this.fetchRequestFromCwd(), - depRequests = _ref20.requests, - rawPatterns = _ref20.patterns, - ignorePatterns = _ref20.ignorePatterns, - workspaceLayout = _ref20.workspaceLayout, - manifest = _ref20.manifest; + const depRequests = _ref13.requests, + rawPatterns = _ref13.patterns, + ignorePatterns = _ref13.ignorePatterns, + workspaceLayout = _ref13.workspaceLayout, + manifest = _ref13.manifest; - var topLevelPatterns = []; + let topLevelPatterns = []; - var artifacts = yield this.integrityChecker.getArtifacts(); + const artifacts = yield _this6.integrityChecker.getArtifacts(); if (artifacts) { - this.linker.setArtifacts(artifacts); - this.scripts.setArtifacts(artifacts); + _this6.linker.setArtifacts(artifacts); + _this6.scripts.setArtifacts(artifacts); } - if ((_packageCompatibility || _load_packageCompatibility()).shouldCheck(manifest, this.flags)) { - steps.push(function () { - var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this2.reporter.step(curr, total, _this2.reporter.lang('checkingManifest'), emoji.get('mag')); - yield _this2.checkCompatibility(); + if ((_packageCompatibility || _load_packageCompatibility()).shouldCheck(manifest, _this6.flags)) { + steps.push((() => { + var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { + _this6.reporter.step(curr, total, _this6.reporter.lang('checkingManifest'), emoji.get('mag')); + yield _this6.checkCompatibility(); }); - return function (_x5, _x6) { - return _ref21.apply(this, arguments); + return function (_x, _x2) { + return _ref14.apply(this, arguments); }; - }()); + })()); } - var audit = new (_audit || _load_audit()).default(this.config, this.reporter, { groups: (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES }); - var auditFoundProblems = false; + const audit = new (_audit || _load_audit()).default(_this6.config, _this6.reporter, { groups: (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES }); + let auditFoundProblems = false; steps.push(function (curr, total) { return (0, (_hooks || _load_hooks()).callThroughHook)('resolveStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this2.reporter.step(curr, total, _this2.reporter.lang('resolvingPackages'), emoji.get('mag')); - yield _this2.resolver.init(_this2.prepareRequests(depRequests), { - isFlat: _this2.flags.flat, - isFrozen: _this2.flags.frozenLockfile, + _this6.reporter.step(curr, total, _this6.reporter.lang('resolvingPackages'), emoji.get('mag')); + yield _this6.resolver.init(_this6.prepareRequests(depRequests), { + isFlat: _this6.flags.flat, + isFrozen: _this6.flags.frozenLockfile, workspaceLayout }); - topLevelPatterns = _this2.preparePatterns(rawPatterns); - flattenedTopLevelPatterns = yield _this2.flatten(topLevelPatterns); - return { bailout: !_this2.flags.audit && (yield _this2.bailout(topLevelPatterns, workspaceLayout)) }; + topLevelPatterns = _this6.preparePatterns(rawPatterns); + flattenedTopLevelPatterns = yield _this6.flatten(topLevelPatterns); + return { bailout: !_this6.flags.audit && (yield _this6.bailout(topLevelPatterns, workspaceLayout)) }; })); }); - if (this.flags.audit) { + if (_this6.flags.audit) { steps.push(function (curr, total) { return (0, (_hooks || _load_hooks()).callThroughHook)('auditStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this2.reporter.step(curr, total, _this2.reporter.lang('auditRunning'), emoji.get('mag')); - if (_this2.flags.offline) { - _this2.reporter.warn(_this2.reporter.lang('auditOffline')); + _this6.reporter.step(curr, total, _this6.reporter.lang('auditRunning'), emoji.get('mag')); + if (_this6.flags.offline) { + _this6.reporter.warn(_this6.reporter.lang('auditOffline')); return { bailout: false }; } - var preparedManifests = yield _this2.prepareManifests(); + const preparedManifests = yield _this6.prepareManifests(); // $FlowFixMe - Flow considers `m` in the map operation to be "mixed", so does not recognize `m.object` - var mergedManifest = (_assign || _load_assign()).default.apply(Object, [{}].concat((0, (_values || _load_values()).default)(preparedManifests).map(function (m) { + const mergedManifest = Object.assign({}, ...Object.values(preparedManifests).map(function (m) { return m.object; - }))); - var auditVulnerabilityCounts = yield audit.performAudit(mergedManifest, _this2.lockfile, _this2.resolver, _this2.linker, topLevelPatterns); + })); + const auditVulnerabilityCounts = yield audit.performAudit(mergedManifest, _this6.lockfile, _this6.resolver, _this6.linker, topLevelPatterns); auditFoundProblems = auditVulnerabilityCounts.info || auditVulnerabilityCounts.low || auditVulnerabilityCounts.moderate || auditVulnerabilityCounts.high || auditVulnerabilityCounts.critical; - return { bailout: yield _this2.bailout(topLevelPatterns, workspaceLayout) }; + return { bailout: yield _this6.bailout(topLevelPatterns, workspaceLayout) }; })); }); } steps.push(function (curr, total) { return (0, (_hooks || _load_hooks()).callThroughHook)('fetchStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this2.markIgnored(ignorePatterns); - _this2.reporter.step(curr, total, _this2.reporter.lang('fetchingPackages'), emoji.get('truck')); - var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this2.resolver.getManifests(), _this2.config); - _this2.resolver.updateManifests(manifests); - yield (_packageCompatibility || _load_packageCompatibility()).check(_this2.resolver.getManifests(), _this2.config, _this2.flags.ignoreEngines); + _this6.markIgnored(ignorePatterns); + _this6.reporter.step(curr, total, _this6.reporter.lang('fetchingPackages'), emoji.get('truck')); + const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this6.resolver.getManifests(), _this6.config); + _this6.resolver.updateManifests(manifests); + yield (_packageCompatibility || _load_packageCompatibility()).check(_this6.resolver.getManifests(), _this6.config, _this6.flags.ignoreEngines); })); }); steps.push(function (curr, total) { return (0, (_hooks || _load_hooks()).callThroughHook)('linkStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { // remove integrity hash to make this operation atomic - yield _this2.integrityChecker.removeIntegrityFile(); - _this2.reporter.step(curr, total, _this2.reporter.lang('linkingDependencies'), emoji.get('link')); - flattenedTopLevelPatterns = _this2.preparePatternsForLinking(flattenedTopLevelPatterns, manifest, _this2.config.lockfileFolder === _this2.config.cwd); - yield _this2.linker.init(flattenedTopLevelPatterns, workspaceLayout, { - linkDuplicates: _this2.flags.linkDuplicates, - ignoreOptional: _this2.flags.ignoreOptional + yield _this6.integrityChecker.removeIntegrityFile(); + _this6.reporter.step(curr, total, _this6.reporter.lang('linkingDependencies'), emoji.get('link')); + flattenedTopLevelPatterns = _this6.preparePatternsForLinking(flattenedTopLevelPatterns, manifest, _this6.config.lockfileFolder === _this6.config.cwd); + yield _this6.linker.init(flattenedTopLevelPatterns, workspaceLayout, { + linkDuplicates: _this6.flags.linkDuplicates, + ignoreOptional: _this6.flags.ignoreOptional }); })); }); - if (this.config.plugnplayEnabled) { + if (_this6.config.plugnplayEnabled) { steps.push(function (curr, total) { return (0, (_hooks || _load_hooks()).callThroughHook)('pnpStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var pnpPath = `${_this2.config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`; + const pnpPath = `${_this6.config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`; - var code = yield (0, (_generatePnpMap || _load_generatePnpMap()).generatePnpMap)(_this2.config, flattenedTopLevelPatterns, { - resolver: _this2.resolver, - reporter: _this2.reporter, + const code = yield (0, (_generatePnpMap || _load_generatePnpMap()).generatePnpMap)(_this6.config, flattenedTopLevelPatterns, { + resolver: _this6.resolver, + reporter: _this6.reporter, targetPath: pnpPath, workspaceLayout }); try { - var file = yield (_fs || _load_fs()).readFile(pnpPath); + const file = yield (_fs || _load_fs()).readFile(pnpPath); if (file === code) { return; } @@ -7389,130 +6919,117 @@ var Install = exports.Install = function () { steps.push(function (curr, total) { return (0, (_hooks || _load_hooks()).callThroughHook)('buildStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this2.reporter.step(curr, total, _this2.flags.force ? _this2.reporter.lang('rebuildingPackages') : _this2.reporter.lang('buildingFreshPackages'), emoji.get('hammer')); + _this6.reporter.step(curr, total, _this6.flags.force ? _this6.reporter.lang('rebuildingPackages') : _this6.reporter.lang('buildingFreshPackages'), emoji.get('hammer')); - if (_this2.config.ignoreScripts) { - _this2.reporter.warn(_this2.reporter.lang('ignoredScripts')); + if (_this6.config.ignoreScripts) { + _this6.reporter.warn(_this6.reporter.lang('ignoredScripts')); } else { - yield _this2.scripts.init(flattenedTopLevelPatterns); + yield _this6.scripts.init(flattenedTopLevelPatterns); } })); }); - if (this.flags.har) { - steps.push(function () { - var _ref28 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - var formattedDate = new Date().toISOString().replace(/:/g, '-'); - var filename = `yarn-install_${formattedDate}.har`; - _this2.reporter.step(curr, total, _this2.reporter.lang('savingHar', filename), emoji.get('black_circle_for_record')); - yield _this2.config.requestManager.saveHar(filename); + if (_this6.flags.har) { + steps.push((() => { + var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { + const formattedDate = new Date().toISOString().replace(/:/g, '-'); + const filename = `yarn-install_${formattedDate}.har`; + _this6.reporter.step(curr, total, _this6.reporter.lang('savingHar', filename), emoji.get('black_circle_for_record')); + yield _this6.config.requestManager.saveHar(filename); }); - return function (_x7, _x8) { - return _ref28.apply(this, arguments); + return function (_x3, _x4) { + return _ref21.apply(this, arguments); }; - }()); + })()); } - if (yield this.shouldClean()) { - steps.push(function () { - var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this2.reporter.step(curr, total, _this2.reporter.lang('cleaningModules'), emoji.get('recycle')); - yield (0, (_autoclean || _load_autoclean()).clean)(_this2.config, _this2.reporter); + if (yield _this6.shouldClean()) { + steps.push((() => { + var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { + _this6.reporter.step(curr, total, _this6.reporter.lang('cleaningModules'), emoji.get('recycle')); + yield (0, (_autoclean || _load_autoclean()).clean)(_this6.config, _this6.reporter); }); - return function (_x9, _x10) { - return _ref29.apply(this, arguments); + return function (_x5, _x6) { + return _ref22.apply(this, arguments); }; - }()); + })()); } - var currentStep = 0; - for (var _iterator11 = steps, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) { - var _ref30; + let currentStep = 0; + for (var _iterator11 = steps, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { + var _ref23; if (_isArray11) { if (_i11 >= _iterator11.length) break; - _ref30 = _iterator11[_i11++]; + _ref23 = _iterator11[_i11++]; } else { _i11 = _iterator11.next(); if (_i11.done) break; - _ref30 = _i11.value; + _ref23 = _i11.value; } - var step = _ref30; + const step = _ref23; - var stepResult = yield step(++currentStep, steps.length); + const stepResult = yield step(++currentStep, steps.length); if (stepResult && stepResult.bailout) { - if (this.flags.audit) { + if (_this6.flags.audit) { audit.summary(); } if (auditFoundProblems) { - this.reporter.warn(this.reporter.lang('auditRunAuditForDetails')); + _this6.reporter.warn(_this6.reporter.lang('auditRunAuditForDetails')); } - this.maybeOutputUpdate(); + _this6.maybeOutputUpdate(); return flattenedTopLevelPatterns; } } // fin! - if (this.flags.audit) { + if (_this6.flags.audit) { audit.summary(); } if (auditFoundProblems) { - this.reporter.warn(this.reporter.lang('auditRunAuditForDetails')); + _this6.reporter.warn(_this6.reporter.lang('auditRunAuditForDetails')); } - yield this.saveLockfileAndIntegrity(topLevelPatterns, workspaceLayout); - yield this.persistChanges(); - this.maybeOutputUpdate(); - this.config.requestManager.clearCache(); + yield _this6.saveLockfileAndIntegrity(topLevelPatterns, workspaceLayout); + yield _this6.persistChanges(); + _this6.maybeOutputUpdate(); + _this6.config.requestManager.clearCache(); return flattenedTopLevelPatterns; - }); + })(); + } - function init() { - return _ref19.apply(this, arguments); - } + checkCompatibility() { + var _this7 = this; - return init; - }(); + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _ref24 = yield _this7.fetchRequestFromCwd(); - Install.prototype.checkCompatibility = function () { - var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref32 = yield this.fetchRequestFromCwd(), - manifest = _ref32.manifest; + const manifest = _ref24.manifest; - yield (_packageCompatibility || _load_packageCompatibility()).checkOne(manifest, this.config, this.flags.ignoreEngines); - }); + yield (_packageCompatibility || _load_packageCompatibility()).checkOne(manifest, _this7.config, _this7.flags.ignoreEngines); + })(); + } - function checkCompatibility() { - return _ref31.apply(this, arguments); - } + persistChanges() { + var _this8 = this; - return checkCompatibility; - }(); - - Install.prototype.persistChanges = function () { - var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { // get all the different registry manifests in this folder - var manifests = yield this.config.getRootManifests(); + const manifests = yield _this8.config.getRootManifests(); - if (yield this.applyChanges(manifests)) { - yield this.config.saveRootManifests(manifests); + if (yield _this8.applyChanges(manifests)) { + yield _this8.config.saveRootManifests(manifests); } - }); + })(); + } - function persistChanges() { - return _ref33.apply(this, arguments); - } - - return persistChanges; - }(); - - Install.prototype.applyChanges = function applyChanges(manifests) { - var hasChanged = false; + applyChanges(manifests) { + let hasChanged = false; if (this.config.plugnplayPersist) { - var object = manifests.npm.object; + const object = manifests.npm.object; if (typeof object.installConfig !== 'object') { @@ -7527,52 +7044,52 @@ var Install = exports.Install = function () { hasChanged = true; } - if ((0, (_keys || _load_keys()).default)(object.installConfig).length === 0) { + if (Object.keys(object.installConfig).length === 0) { delete object.installConfig; } } - return (_promise || _load_promise()).default.resolve(hasChanged); - }; + return Promise.resolve(hasChanged); + } /** * Check if we should run the cleaning step. */ - Install.prototype.shouldClean = function shouldClean() { + shouldClean() { return (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).CLEAN_FILENAME)); - }; + } /** * TODO */ - Install.prototype.flatten = function () { - var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns) { - var _this3 = this; + flatten(patterns) { + var _this9 = this; - if (!this.flags.flat) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (!_this9.flags.flat) { return patterns; } - var flattenedPatterns = []; + const flattenedPatterns = []; - for (var _iterator12 = this.resolver.getAllDependencyNamesByLevelOrder(patterns), _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) { - var _ref35; + for (var _iterator12 = _this9.resolver.getAllDependencyNamesByLevelOrder(patterns), _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { + var _ref25; if (_isArray12) { if (_i12 >= _iterator12.length) break; - _ref35 = _iterator12[_i12++]; + _ref25 = _iterator12[_i12++]; } else { _i12 = _iterator12.next(); if (_i12.done) break; - _ref35 = _i12.value; + _ref25 = _i12.value; } - var name = _ref35; + const name = _ref25; - var infos = this.resolver.getAllInfoForPackageName(name).filter(function (manifest) { - var ref = manifest._reference; + const infos = _this9.resolver.getAllInfoForPackageName(name).filter(function (manifest) { + const ref = manifest._reference; invariant(ref, 'expected package reference'); return !ref.ignore; }); @@ -7584,108 +7101,104 @@ var Install = exports.Install = function () { if (infos.length === 1) { // single version of this package // take out a single pattern as multiple patterns may have resolved to this package - flattenedPatterns.push(this.resolver.patternsByPackage[name][0]); + flattenedPatterns.push(_this9.resolver.patternsByPackage[name][0]); continue; } - var options = infos.map(function (info) { - var ref = info._reference; + const options = infos.map(function (info) { + const ref = info._reference; invariant(ref, 'expected reference'); return { // TODO `and is required by {PARENT}`, - name: _this3.reporter.lang('manualVersionResolutionOption', ref.patterns.join(', '), info.version), + name: _this9.reporter.lang('manualVersionResolutionOption', ref.patterns.join(', '), info.version), value: info.version }; }); - var versions = infos.map(function (info) { + const versions = infos.map(function (info) { return info.version; }); - var version = void 0; + let version; - var resolutionVersion = this.resolutions[name]; + const resolutionVersion = _this9.resolutions[name]; if (resolutionVersion && versions.indexOf(resolutionVersion) >= 0) { // use json `resolution` version version = resolutionVersion; } else { - version = yield this.reporter.select(this.reporter.lang('manualVersionResolution', name), this.reporter.lang('answer'), options); - this.resolutions[name] = version; + version = yield _this9.reporter.select(_this9.reporter.lang('manualVersionResolution', name), _this9.reporter.lang('answer'), options); + _this9.resolutions[name] = version; } - flattenedPatterns.push(this.resolver.collapseAllVersionsOfPackage(name, version)); + flattenedPatterns.push(_this9.resolver.collapseAllVersionsOfPackage(name, version)); } // save resolutions to their appropriate root manifest - if ((0, (_keys || _load_keys()).default)(this.resolutions).length) { - var manifests = yield this.config.getRootManifests(); + if (Object.keys(_this9.resolutions).length) { + const manifests = yield _this9.config.getRootManifests(); - for (var _name in this.resolutions) { - var version = this.resolutions[_name]; + for (const name in _this9.resolutions) { + const version = _this9.resolutions[name]; - var _patterns = this.resolver.patternsByPackage[_name]; - if (!_patterns) { + const patterns = _this9.resolver.patternsByPackage[name]; + if (!patterns) { continue; } - var _manifest2 = void 0; - for (var _iterator13 = _patterns, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) { - var _ref36; + let manifest; + for (var _iterator13 = patterns, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { + var _ref26; if (_isArray13) { if (_i13 >= _iterator13.length) break; - _ref36 = _iterator13[_i13++]; + _ref26 = _iterator13[_i13++]; } else { _i13 = _iterator13.next(); if (_i13.done) break; - _ref36 = _i13.value; + _ref26 = _i13.value; } - var _pattern5 = _ref36; + const pattern = _ref26; - _manifest2 = this.resolver.getResolvedPattern(_pattern5); - if (_manifest2) { + manifest = _this9.resolver.getResolvedPattern(pattern); + if (manifest) { break; } } - invariant(_manifest2, 'expected manifest'); + invariant(manifest, 'expected manifest'); - var ref = _manifest2._reference; + const ref = manifest._reference; invariant(ref, 'expected reference'); - var object = manifests[ref.registry].object; + const object = manifests[ref.registry].object; object.resolutions = object.resolutions || {}; - object.resolutions[_name] = version; + object.resolutions[name] = version; } - yield this.config.saveRootManifests(manifests); + yield _this9.config.saveRootManifests(manifests); } return flattenedPatterns; - }); - - function flatten(_x11) { - return _ref34.apply(this, arguments); - } - - return flatten; - }(); + })(); + } /** * Remove offline tarballs that are no longer required */ - Install.prototype.pruneOfflineMirror = function () { - var _ref37 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (lockfile) { - var mirror = this.config.getOfflineMirrorPath(); + pruneOfflineMirror(lockfile) { + var _this10 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const mirror = _this10.config.getOfflineMirrorPath(); if (!mirror) { return; } - var requiredTarballs = new (_set || _load_set()).default(); - for (var dependency in lockfile) { - var resolved = lockfile[dependency].resolved; + const requiredTarballs = new Set(); + for (const dependency in lockfile) { + const resolved = lockfile[dependency].resolved; if (resolved) { - var basename = path.basename(resolved.split('#')[0]); + const basename = path.basename(resolved.split('#')[0]); if (dependency[0] === '@' && basename[0] !== '@') { requiredTarballs.add(`${dependency.split('/')[0]}-${basename}`); } @@ -7693,49 +7206,43 @@ var Install = exports.Install = function () { } } - var mirrorFiles = yield (_fs || _load_fs()).walk(mirror); - for (var _iterator14 = mirrorFiles, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) { - var _ref38; + const mirrorFiles = yield (_fs || _load_fs()).walk(mirror); + for (var _iterator14 = mirrorFiles, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { + var _ref27; if (_isArray14) { if (_i14 >= _iterator14.length) break; - _ref38 = _iterator14[_i14++]; + _ref27 = _iterator14[_i14++]; } else { _i14 = _iterator14.next(); if (_i14.done) break; - _ref38 = _i14.value; + _ref27 = _i14.value; } - var file = _ref38; + const file = _ref27; - var isTarball = path.extname(file.basename) === '.tgz'; + const isTarball = path.extname(file.basename) === '.tgz'; // if using experimental-pack-script-packages-in-mirror flag, don't unlink prebuilt packages - var hasPrebuiltPackage = file.relative.startsWith('prebuilt/'); + const hasPrebuiltPackage = file.relative.startsWith('prebuilt/'); if (isTarball && !hasPrebuiltPackage && !requiredTarballs.has(file.basename)) { yield (_fs || _load_fs()).unlink(file.absolute); } } - }); - - function pruneOfflineMirror(_x12) { - return _ref37.apply(this, arguments); - } - - return pruneOfflineMirror; - }(); + })(); + } /** * Save updated integrity and lockfiles. */ - Install.prototype.saveLockfileAndIntegrity = function () { - var _ref39 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) { - var _this4 = this; + saveLockfileAndIntegrity(patterns, workspaceLayout) { + var _this11 = this; - var resolvedPatterns = {}; - (0, (_keys || _load_keys()).default)(this.resolver.patterns).forEach(function (pattern) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const resolvedPatterns = {}; + Object.keys(_this11.resolver.patterns).forEach(function (pattern) { if (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern)) { - resolvedPatterns[pattern] = _this4.resolver.patterns[pattern]; + resolvedPatterns[pattern] = _this11.resolver.patterns[pattern]; } }); @@ -7744,149 +7251,137 @@ var Install = exports.Install = function () { return !workspaceLayout || !workspaceLayout.getManifestByPattern(p); }); - var lockfileBasedOnResolver = this.lockfile.getLockfile(resolvedPatterns); + const lockfileBasedOnResolver = _this11.lockfile.getLockfile(resolvedPatterns); - if (this.config.pruneOfflineMirror) { - yield this.pruneOfflineMirror(lockfileBasedOnResolver); + if (_this11.config.pruneOfflineMirror) { + yield _this11.pruneOfflineMirror(lockfileBasedOnResolver); } // write integrity hash - if (!this.config.plugnplayEnabled) { - yield this.integrityChecker.save(patterns, lockfileBasedOnResolver, this.flags, workspaceLayout, this.scripts.getArtifacts()); + if (!_this11.config.plugnplayEnabled) { + yield _this11.integrityChecker.save(patterns, lockfileBasedOnResolver, _this11.flags, workspaceLayout, _this11.scripts.getArtifacts()); } // --no-lockfile or --pure-lockfile or --frozen-lockfile - if (this.flags.lockfile === false || this.flags.pureLockfile || this.flags.frozenLockfile) { + if (_this11.flags.lockfile === false || _this11.flags.pureLockfile || _this11.flags.frozenLockfile) { return; } - var lockFileHasAllPatterns = patterns.every(function (p) { - return _this4.lockfile.getLocked(p); + const lockFileHasAllPatterns = patterns.every(function (p) { + return _this11.lockfile.getLocked(p); }); - var lockfilePatternsMatch = (0, (_keys || _load_keys()).default)(this.lockfile.cache || {}).every(function (p) { + const lockfilePatternsMatch = Object.keys(_this11.lockfile.cache || {}).every(function (p) { return lockfileBasedOnResolver[p]; }); - var resolverPatternsAreSameAsInLockfile = (0, (_keys || _load_keys()).default)(lockfileBasedOnResolver).every(function (pattern) { - var manifest = _this4.lockfile.getLocked(pattern); + const resolverPatternsAreSameAsInLockfile = Object.keys(lockfileBasedOnResolver).every(function (pattern) { + const manifest = _this11.lockfile.getLocked(pattern); return manifest && manifest.resolved === lockfileBasedOnResolver[pattern].resolved && deepEqual(manifest.prebuiltVariants, lockfileBasedOnResolver[pattern].prebuiltVariants); }); - var integrityPatternsAreSameAsInLockfile = (0, (_keys || _load_keys()).default)(lockfileBasedOnResolver).every(function (pattern) { - var existingIntegrityInfo = lockfileBasedOnResolver[pattern].integrity; + const integrityPatternsAreSameAsInLockfile = Object.keys(lockfileBasedOnResolver).every(function (pattern) { + const existingIntegrityInfo = lockfileBasedOnResolver[pattern].integrity; if (!existingIntegrityInfo) { // if this entry does not have an integrity, no need to re-write the lockfile because of it return true; } - var manifest = _this4.lockfile.getLocked(pattern); + const manifest = _this11.lockfile.getLocked(pattern); if (manifest && manifest.integrity) { - var manifestIntegrity = ssri.stringify(manifest.integrity); + const manifestIntegrity = ssri.stringify(manifest.integrity); return manifestIntegrity === existingIntegrityInfo; } return false; }); // remove command is followed by install with force, lockfile will be rewritten in any case then - if (!this.flags.force && this.lockfile.parseResultType === 'success' && lockFileHasAllPatterns && lockfilePatternsMatch && resolverPatternsAreSameAsInLockfile && integrityPatternsAreSameAsInLockfile && patterns.length) { + if (!_this11.flags.force && _this11.lockfile.parseResultType === 'success' && lockFileHasAllPatterns && lockfilePatternsMatch && resolverPatternsAreSameAsInLockfile && integrityPatternsAreSameAsInLockfile && patterns.length) { return; } // build lockfile location - var loc = path.join(this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME); + const loc = path.join(_this11.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME); // write lockfile - var lockSource = (0, (_lockfile2 || _load_lockfile2()).stringify)(lockfileBasedOnResolver, false, this.config.enableLockfileVersions); + const lockSource = (0, (_lockfile2 || _load_lockfile2()).stringify)(lockfileBasedOnResolver, false, _this11.config.enableLockfileVersions); yield (_fs || _load_fs()).writeFilePreservingEol(loc, lockSource); - this._logSuccessSaveLockfile(); - }); + _this11._logSuccessSaveLockfile(); + })(); + } - function saveLockfileAndIntegrity(_x13, _x14) { - return _ref39.apply(this, arguments); - } - - return saveLockfileAndIntegrity; - }(); - - Install.prototype._logSuccessSaveLockfile = function _logSuccessSaveLockfile() { + _logSuccessSaveLockfile() { this.reporter.success(this.reporter.lang('savedLockfile')); - }; + } /** * Load the dependency graph of the current install. Only does package resolving and wont write to the cwd. */ + hydrate(ignoreUnusedPatterns) { + var _this12 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const request = yield _this12.fetchRequestFromCwd([], ignoreUnusedPatterns); + const depRequests = request.requests, + rawPatterns = request.patterns, + ignorePatterns = request.ignorePatterns, + workspaceLayout = request.workspaceLayout; - Install.prototype.hydrate = function () { - var _ref40 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ignoreUnusedPatterns) { - var request = yield this.fetchRequestFromCwd([], ignoreUnusedPatterns); - var depRequests = request.requests, - rawPatterns = request.patterns, - ignorePatterns = request.ignorePatterns, - workspaceLayout = request.workspaceLayout; - - - yield this.resolver.init(depRequests, { - isFlat: this.flags.flat, - isFrozen: this.flags.frozenLockfile, + yield _this12.resolver.init(depRequests, { + isFlat: _this12.flags.flat, + isFrozen: _this12.flags.frozenLockfile, workspaceLayout }); - yield this.flatten(rawPatterns); - this.markIgnored(ignorePatterns); + yield _this12.flatten(rawPatterns); + _this12.markIgnored(ignorePatterns); // fetch packages, should hit cache most of the time - var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(this.resolver.getManifests(), this.config); - this.resolver.updateManifests(manifests); - yield (_packageCompatibility || _load_packageCompatibility()).check(this.resolver.getManifests(), this.config, this.flags.ignoreEngines); + const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this12.resolver.getManifests(), _this12.config); + _this12.resolver.updateManifests(manifests); + yield (_packageCompatibility || _load_packageCompatibility()).check(_this12.resolver.getManifests(), _this12.config, _this12.flags.ignoreEngines); // expand minimal manifests - for (var _iterator15 = this.resolver.getManifests(), _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) { - var _ref41; + for (var _iterator15 = _this12.resolver.getManifests(), _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { + var _ref28; if (_isArray15) { if (_i15 >= _iterator15.length) break; - _ref41 = _iterator15[_i15++]; + _ref28 = _iterator15[_i15++]; } else { _i15 = _iterator15.next(); if (_i15.done) break; - _ref41 = _i15.value; + _ref28 = _i15.value; } - var _manifest3 = _ref41; + const manifest = _ref28; - var ref = _manifest3._reference; + const ref = manifest._reference; invariant(ref, 'expected reference'); - var type = ref.remote.type; + const type = ref.remote.type; // link specifier won't ever hit cache - var _loc = ''; + let loc = ''; if (type === 'link') { continue; } else if (type === 'workspace') { if (!ref.remote.reference) { continue; } - _loc = ref.remote.reference; + loc = ref.remote.reference; } else { - _loc = this.config.generateModuleCachePath(ref); + loc = _this12.config.generateModuleCachePath(ref); } - var newPkg = yield this.config.readManifest(_loc); - yield this.resolver.updateManifest(ref, newPkg); + const newPkg = yield _this12.config.readManifest(loc); + yield _this12.resolver.updateManifest(ref, newPkg); } return request; - }); - - function hydrate(_x15) { - return _ref40.apply(this, arguments); - } - - return hydrate; - }(); + })(); + } /** * Check for updates every day and output a nag message if there's a newer version. */ - Install.prototype.checkUpdate = function checkUpdate() { + checkUpdate() { if (this.config.nonInteractive) { // don't show upgrade dialog on CI or non-TTY terminals return; @@ -7898,7 +7393,7 @@ var Install = exports.Install = function () { } // only check for updates once a day - var lastUpdateCheck = Number(this.config.getOption('lastUpdateCheck')) || 0; + const lastUpdateCheck = Number(this.config.getOption('lastUpdateCheck')) || 0; if (lastUpdateCheck && Date.now() - lastUpdateCheck < ONE_DAY) { return; } @@ -7908,16 +7403,16 @@ var Install = exports.Install = function () { return; } - this._checkUpdate().catch(function () { + this._checkUpdate().catch(() => { // swallow errors }); - }; + } - Install.prototype._checkUpdate = function () { - var _ref42 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _this5 = this; + _checkUpdate() { + var _this13 = this; - var latestVersion = yield this.config.requestManager.request({ + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + let latestVersion = yield _this13.config.requestManager.request({ url: (_constants || _load_constants()).SELF_UPDATE_VERSION_URL }); invariant(typeof latestVersion === 'string', 'expected string'); @@ -7927,45 +7422,38 @@ var Install = exports.Install = function () { } // ensure we only check for updates periodically - this.config.registries.yarn.saveHomeConfig({ + _this13.config.registries.yarn.saveHomeConfig({ lastUpdateCheck: Date.now() }); if (semver.gt(latestVersion, (_yarnVersion || _load_yarnVersion()).version)) { - var installationMethod = yield (0, (_yarnVersion || _load_yarnVersion()).getInstallationMethod)(); - this.maybeOutputUpdate = function () { - _this5.reporter.warn(_this5.reporter.lang('yarnOutdated', latestVersion, (_yarnVersion || _load_yarnVersion()).version)); + const installationMethod = yield (0, (_yarnVersion || _load_yarnVersion()).getInstallationMethod)(); + _this13.maybeOutputUpdate = function () { + _this13.reporter.warn(_this13.reporter.lang('yarnOutdated', latestVersion, (_yarnVersion || _load_yarnVersion()).version)); - var command = getUpdateCommand(installationMethod); + const command = getUpdateCommand(installationMethod); if (command) { - _this5.reporter.info(_this5.reporter.lang('yarnOutdatedCommand')); - _this5.reporter.command(command); + _this13.reporter.info(_this13.reporter.lang('yarnOutdatedCommand')); + _this13.reporter.command(command); } else { - var installer = getUpdateInstaller(installationMethod); + const installer = getUpdateInstaller(installationMethod); if (installer) { - _this5.reporter.info(_this5.reporter.lang('yarnOutdatedInstaller', installer)); + _this13.reporter.info(_this13.reporter.lang('yarnOutdatedInstaller', installer)); } } }; } - }); - - function _checkUpdate() { - return _ref42.apply(this, arguments); - } - - return _checkUpdate; - }(); + })(); + } /** * Method to override with a possible upgrade message. */ - Install.prototype.maybeOutputUpdate = function maybeOutputUpdate() {}; - - return Install; -}(); + maybeOutputUpdate() {} +} +exports.Install = Install; function hasWrapper(commander, args) { return true; } @@ -7984,26 +7472,31 @@ function setFlags(commander) { } /***/ }), -/* 42 */ +/* 35 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = { "default": __webpack_require__(625), __esModule: true }; +var isObject = __webpack_require__(52); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + /***/ }), -/* 43 */ +/* 36 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SubjectSubscriber; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subject; }); /* unused harmony export AnonymousSubject */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscriber__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(31); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__ = __webpack_require__(179); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__ = __webpack_require__(392); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__ = __webpack_require__(261); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__ = __webpack_require__(189); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__ = __webpack_require__(421); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__ = __webpack_require__(321); /** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */ @@ -8165,24 +7658,56 @@ var AnonymousSubject = /*@__PURE__*/ (function (_super) { /***/ }), -/* 44 */ +/* 37 */ /***/ (function(module, exports, __webpack_require__) { -var store = __webpack_require__(228)('wks'); -var uid = __webpack_require__(161); -var Symbol = __webpack_require__(37).Symbol; -var USE_SYMBOL = typeof Symbol == 'function'; +"use strict"; -var $exports = module.exports = function (name) { - return store[name] || (store[name] = - USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); -}; -$exports.store = store; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.normalizePattern = normalizePattern; +/** + * Explode and normalize a pattern into its name and range. + */ + +function normalizePattern(pattern) { + let hasVersion = false; + let range = 'latest'; + let name = pattern; + + // if we're a scope then remove the @ and add it back later + let isScoped = false; + if (name[0] === '@') { + isScoped = true; + name = name.slice(1); + } + + // take first part as the name + const parts = name.split('@'); + if (parts.length > 1) { + name = parts.shift(); + range = parts.join('@'); + + if (range) { + hasVersion = true; + } else { + range = '*'; + } + } + + // add back @ scope suffix + if (isScoped) { + name = `@${name}`; + } + + return { name, range, hasVersion }; +} /***/ }), -/* 45 */ +/* 38 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** @@ -25292,17 +24817,17 @@ $exports.store = store; } }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(150)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(163)(module))) /***/ }), -/* 46 */ +/* 39 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return EMPTY; }); /* harmony export (immutable) */ __webpack_exports__["a"] = empty; /* unused harmony export emptyScheduled */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(11); /** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */ var EMPTY = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return subscriber.complete(); }); @@ -25316,13 +24841,13 @@ function emptyScheduled(scheduler) { /***/ }), -/* 47 */ +/* 40 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return async; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AsyncAction__ = __webpack_require__(137); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(138); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AsyncAction__ = __webpack_require__(149); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(150); /** PURE_IMPORTS_START _AsyncAction,_AsyncScheduler PURE_IMPORTS_END */ @@ -25331,7 +24856,7 @@ var async = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__["a" /***/ }), -/* 48 */ +/* 41 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -25342,259 +24867,206 @@ var isArray = Array.isArray || (function (x) { return x && typeof x.length === ' /***/ }), -/* 49 */ -/***/ (function(module, exports) { +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { -module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; +var dP = __webpack_require__(71); +var createDesc = __webpack_require__(132); +module.exports = __webpack_require__(51) ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; }; /***/ }), -/* 50 */ -/***/ (function(module, exports) { - -module.exports = require("assert"); - -/***/ }), -/* 51 */ +/* 43 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -var _setPrototypeOf; - -function _load_setPrototypeOf() { - return _setPrototypeOf = _interopRequireDefault(__webpack_require__(214)); +function isNothing(subject) { + return (typeof subject === 'undefined') || (subject === null); } -var _getIterator2; -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); +function isObject(subject) { + return (typeof subject === 'object') && (subject !== null); } -exports.default = nullify; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; -function nullify() { - var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return [ sequence ]; +} - if (Array.isArray(obj)) { - for (var _iterator = obj, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; +function extend(target, source) { + var index, length, key, sourceKeys; + + if (source) { + sourceKeys = Object.keys(source); + + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + + return target; +} + + +function repeat(string, count) { + var result = '', cycle; + + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } + + return result; +} + + +function isNegativeZero(number) { + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); +} + + +module.exports.isNothing = isNothing; +module.exports.isObject = isObject; +module.exports.toArray = toArray; +module.exports.repeat = repeat; +module.exports.isNegativeZero = isNegativeZero; +module.exports.extend = extend; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/*eslint-disable max-len*/ + +var common = __webpack_require__(43); +var YAMLException = __webpack_require__(54); +var Type = __webpack_require__(10); + + +function compileList(schema, name, result) { + var exclude = []; + + schema.include.forEach(function (includedSchema) { + result = compileList(includedSchema, name, result); + }); + + schema[name].forEach(function (currentType) { + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { + exclude.push(previousIndex); } + }); - var item = _ref; + result.push(currentType); + }); - nullify(item); - } - } else if (obj !== null && typeof obj === 'object' || typeof obj === 'function') { - (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(obj, null); - - // for..in can only be applied to 'object', not 'function' - if (typeof obj === 'object') { - for (var key in obj) { - nullify(obj[key]); - } - } - } - - return obj; + return result.filter(function (type, index) { + return exclude.indexOf(index) === -1; + }); } -/***/ }), -/* 52 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {} + }, index, length; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.normalizePattern = normalizePattern; - -/** - * Explode and normalize a pattern into its name and range. - */ - -function normalizePattern(pattern) { - var hasVersion = false; - var range = 'latest'; - var name = pattern; - - // if we're a scope then remove the @ and add it back later - var isScoped = false; - if (name[0] === '@') { - isScoped = true; - name = name.slice(1); + function collectType(type) { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; } - // take first part as the name - var parts = name.split('@'); - if (parts.length > 1) { - name = parts.shift(); - range = parts.join('@'); + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} - if (range) { - hasVersion = true; - } else { - range = '*'; + +function Schema(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + + this.implicit.forEach(function (type) { + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); } + }); + + this.compiledImplicit = compileList(this, 'implicit', []); + this.compiledExplicit = compileList(this, 'explicit', []); + this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); +} + + +Schema.DEFAULT = null; + + +Schema.create = function createSchema() { + var schemas, types; + + switch (arguments.length) { + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; + + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; + + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); } - // add back @ scope suffix - if (isScoped) { - name = `@${name}`; + schemas = common.toArray(schemas); + types = common.toArray(types); + + if (!schemas.every(function (schema) { return schema instanceof Schema; })) { + throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); } - return { name, range, hasVersion }; -} + if (!types.every(function (type) { return type instanceof Type; })) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } -/***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(622), __esModule: true }; - -/***/ }), -/* 54 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = map; -/* unused harmony export MapOperator */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); -/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ - - -function map(project, thisArg) { - return function mapOperation(source) { - if (typeof project !== 'function') { - throw new TypeError('argument is not a function. Are you looking for `mapTo()`?'); - } - return source.lift(new MapOperator(project, thisArg)); - }; -} -var MapOperator = /*@__PURE__*/ (function () { - function MapOperator(project, thisArg) { - this.project = project; - this.thisArg = thisArg; - } - MapOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg)); - }; - return MapOperator; -}()); - -var MapSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MapSubscriber, _super); - function MapSubscriber(destination, project, thisArg) { - var _this = _super.call(this, destination) || this; - _this.project = project; - _this.count = 0; - _this.thisArg = thisArg || _this; - return _this; - } - MapSubscriber.prototype._next = function (value) { - var result; - try { - result = this.project.call(this.thisArg, value, this.count++); - } - catch (err) { - this.destination.error(err); - return; - } - this.destination.next(result); - }; - return MapSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); -//# sourceMappingURL=map.js.map - - -/***/ }), -/* 55 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return errorObject; }); -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -var errorObject = { e: {} }; -//# sourceMappingURL=errorObject.js.map - - -/***/ }), -/* 56 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = isScheduler; -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function isScheduler(value) { - return value && typeof value.schedule === 'function'; -} -//# sourceMappingURL=isScheduler.js.map - - -/***/ }), -/* 57 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(49); -module.exports = function (it) { - if (!isObject(it)) throw TypeError(it + ' is not an object!'); - return it; + return new Schema({ + include: schemas, + explicit: types + }); }; -/***/ }), -/* 58 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = tryCatch; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__errorObject__ = __webpack_require__(55); -/** PURE_IMPORTS_START _errorObject PURE_IMPORTS_END */ - -var tryCatchTarget; -function tryCatcher() { - try { - return tryCatchTarget.apply(this, arguments); - } - catch (e) { - __WEBPACK_IMPORTED_MODULE_0__errorObject__["a" /* errorObject */].e = e; - return __WEBPACK_IMPORTED_MODULE_0__errorObject__["a" /* errorObject */]; - } -} -function tryCatch(fn) { - tryCatchTarget = fn; - return tryCatcher; -} -//# sourceMappingURL=tryCatch.js.map +module.exports = Schema; /***/ }), -/* 59 */ +/* 45 */ /***/ (function(module, exports, __webpack_require__) { /* eslint-disable node/no-deprecated-api */ -var buffer = __webpack_require__(94) +var buffer = __webpack_require__(64) var Buffer = buffer.Buffer // alternative to using Object.keys for old browsers @@ -25658,7 +25130,313 @@ SafeBuffer.allocUnsafeSlow = function (size) { /***/ }), -/* 60 */ +/* 46 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = map; +/* unused harmony export MapOperator */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ + + +function map(project, thisArg) { + return function mapOperation(source) { + if (typeof project !== 'function') { + throw new TypeError('argument is not a function. Are you looking for `mapTo()`?'); + } + return source.lift(new MapOperator(project, thisArg)); + }; +} +var MapOperator = /*@__PURE__*/ (function () { + function MapOperator(project, thisArg) { + this.project = project; + this.thisArg = thisArg; + } + MapOperator.prototype.call = function (subscriber, source) { + return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg)); + }; + return MapOperator; +}()); + +var MapSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MapSubscriber, _super); + function MapSubscriber(destination, project, thisArg) { + var _this = _super.call(this, destination) || this; + _this.project = project; + _this.count = 0; + _this.thisArg = thisArg || _this; + return _this; + } + MapSubscriber.prototype._next = function (value) { + var result; + try { + result = this.project.call(this.thisArg, value, this.count++); + } + catch (err) { + this.destination.error(err); + return; + } + this.destination.next(result); + }; + return MapSubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=map.js.map + + +/***/ }), +/* 47 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return errorObject; }); +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +var errorObject = { e: {} }; +//# sourceMappingURL=errorObject.js.map + + +/***/ }), +/* 48 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = isScheduler; +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +function isScheduler(value) { + return value && typeof value.schedule === 'function'; +} +//# sourceMappingURL=isScheduler.js.map + + +/***/ }), +/* 49 */ +/***/ (function(module, exports) { + +module.exports = require("os"); + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.wait = wait; +exports.promisify = promisify; +exports.queue = queue; +function wait(delay) { + return new Promise(resolve => { + setTimeout(resolve, delay); + }); +} + +function promisify(fn, firstData) { + return function (...args) { + return new Promise(function (resolve, reject) { + args.push(function (err, ...result) { + let res = result; + + if (result.length <= 1) { + res = result[0]; + } + + if (firstData) { + res = err; + err = null; + } + + if (err) { + reject(err); + } else { + resolve(res); + } + }); + + fn.apply(null, args); + }); + }; +} + +function queue(arr, promiseProducer, concurrency = Infinity) { + concurrency = Math.min(concurrency, arr.length); + + // clone + arr = arr.slice(); + + const results = []; + let total = arr.length; + if (!total) { + return Promise.resolve(results); + } + + return new Promise((resolve, reject) => { + for (let i = 0; i < concurrency; i++) { + next(); + } + + function next() { + const item = arr.shift(); + const promise = promiseProducer(item); + + promise.then(function (result) { + results.push(result); + + total--; + if (total === 0) { + resolve(results); + } else { + if (arr.length) { + next(); + } + } + }, reject); + } + }); +} + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(112)(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports) { + +module.exports = {}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// YAML error class. http://stackoverflow.com/questions/8458984 +// + + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } +} + + +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + +YAMLException.prototype.toString = function toString(compact) { + var result = this.name + ': '; + + result += this.reason || '(unknown reason)'; + + if (!compact && this.mark) { + result += ' ' + this.mark.toString(); + } + + return result; +}; + + +module.exports = YAMLException; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + + + + +var Schema = __webpack_require__(44); + + +module.exports = new Schema({ + include: [ + __webpack_require__(143) + ], + implicit: [ + __webpack_require__(299), + __webpack_require__(292) + ], + explicit: [ + __webpack_require__(284), + __webpack_require__(294), + __webpack_require__(295), + __webpack_require__(297) + ] +}); + + +/***/ }), +/* 56 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = tryCatch; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__errorObject__ = __webpack_require__(47); +/** PURE_IMPORTS_START _errorObject PURE_IMPORTS_END */ + +var tryCatchTarget; +function tryCatcher() { + try { + return tryCatchTarget.apply(this, arguments); + } + catch (e) { + __WEBPACK_IMPORTED_MODULE_0__errorObject__["a" /* errorObject */].e = e; + return __WEBPACK_IMPORTED_MODULE_0__errorObject__["a" /* errorObject */]; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} +//# sourceMappingURL=tryCatch.js.map + + +/***/ }), +/* 57 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -25669,35 +25447,29 @@ Object.defineProperty(exports, "__esModule", { }); exports.registryNames = exports.registries = undefined; -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - var _yarnRegistry; function _load_yarnRegistry() { - return _yarnRegistry = _interopRequireDefault(__webpack_require__(547)); + return _yarnRegistry = _interopRequireDefault(__webpack_require__(558)); } var _npmRegistry; function _load_npmRegistry() { - return _npmRegistry = _interopRequireDefault(__webpack_require__(84)); + return _npmRegistry = _interopRequireDefault(__webpack_require__(88)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var registries = exports.registries = { +const registries = exports.registries = { npm: (_npmRegistry || _load_npmRegistry()).default, yarn: (_yarnRegistry || _load_yarnRegistry()).default }; -var registryNames = exports.registryNames = (0, (_keys || _load_keys()).default)(registries); +const registryNames = exports.registryNames = Object.keys(registries); /***/ }), -/* 61 */ +/* 58 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -25707,25 +25479,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.exec = exports.queue = undefined; - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - exports.forkp = forkp; exports.spawnp = spawnp; exports.forwardSignalToSpawnedProcesses = forwardSignalToSpawnedProcesses; @@ -25734,74 +25487,74 @@ exports.spawn = spawn; var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } var _blockingQueue; function _load_blockingQueue() { - return _blockingQueue = _interopRequireDefault(__webpack_require__(157)); + return _blockingQueue = _interopRequireDefault(__webpack_require__(110)); } var _errors; function _load_errors() { - return _errors = __webpack_require__(6); + return _errors = __webpack_require__(5); } -var _promise2; +var _promise; -function _load_promise2() { - return _promise2 = __webpack_require__(86); +function _load_promise() { + return _promise = __webpack_require__(50); } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + /* global child_process$spawnOpts */ -var child = __webpack_require__(270); +const child = __webpack_require__(331); -var queue = exports.queue = new (_blockingQueue || _load_blockingQueue()).default('child', (_constants || _load_constants()).CHILD_CONCURRENCY); +const queue = exports.queue = new (_blockingQueue || _load_blockingQueue()).default('child', (_constants || _load_constants()).CHILD_CONCURRENCY); // TODO: this uid check is kinda whack -var uid = 0; +let uid = 0; -var exec = exports.exec = (0, (_promise2 || _load_promise2()).promisify)(child.exec); +const exec = exports.exec = (0, (_promise || _load_promise()).promisify)(child.exec); function forkp(program, args, opts) { - return new (_promise || _load_promise()).default(function (resolve, reject) { - var proc = child.fork(program, args, opts); + return new Promise((resolve, reject) => { + const proc = child.fork(program, args, opts); - proc.on('error', function (error) { + proc.on('error', error => { reject(error); }); - proc.on('close', function (exitCode) { + proc.on('close', exitCode => { resolve(exitCode); }); }); } function spawnp(program, args, opts) { - return new (_promise || _load_promise()).default(function (resolve, reject) { - var proc = child.spawn(program, args, opts); + return new Promise((resolve, reject) => { + const proc = child.spawn(program, args, opts); - proc.on('error', function (error) { + proc.on('error', error => { reject(error); }); - proc.on('close', function (exitCode) { + proc.on('close', exitCode => { resolve(exitCode); }); }); } -var spawnedProcesses = {}; +const spawnedProcesses = {}; function forwardSignalToSpawnedProcesses(signal) { - for (var _iterator = (0, (_keys || _load_keys()).default)(spawnedProcesses), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + for (var _iterator = Object.keys(spawnedProcesses), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { @@ -25813,91 +25566,86 @@ function forwardSignalToSpawnedProcesses(signal) { _ref = _i.value; } - var key = _ref; + const key = _ref; spawnedProcesses[key].kill(signal); } } -function spawn(program, args) { - var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var onData = arguments[3]; +function spawn(program, args, opts = {}, onData) { + const key = opts.cwd || String(++uid); + return queue.push(key, () => new Promise((resolve, reject) => { + const proc = child.spawn(program, args, opts); + spawnedProcesses[key] = proc; - var key = opts.cwd || String(++uid); - return queue.push(key, function () { - return new (_promise || _load_promise()).default(function (resolve, reject) { - var proc = child.spawn(program, args, opts); - spawnedProcesses[key] = proc; + let processingDone = false; + let processClosed = false; + let err = null; - var processingDone = false; - var processClosed = false; - var err = null; + let stdout = ''; - var stdout = ''; - - proc.on('error', function (err) { - if (err.code === 'ENOENT') { - reject(new (_errors || _load_errors()).ProcessSpawnError(`Couldn't find the binary ${program}`, err.code, program)); - } else { - reject(err); - } - }); - - function updateStdout(chunk) { - stdout += chunk; - if (onData) { - onData(chunk); - } - } - - function finish() { - delete spawnedProcesses[key]; - if (err) { - reject(err); - } else { - resolve(stdout.trim()); - } - } - - if (typeof opts.process === 'function') { - opts.process(proc, updateStdout, reject, function () { - if (processClosed) { - finish(); - } else { - processingDone = true; - } - }); + proc.on('error', err => { + if (err.code === 'ENOENT') { + reject(new (_errors || _load_errors()).ProcessSpawnError(`Couldn't find the binary ${program}`, err.code, program)); } else { - if (proc.stderr) { - proc.stderr.on('data', updateStdout); - } - - if (proc.stdout) { - proc.stdout.on('data', updateStdout); - } - - processingDone = true; + reject(err); } + }); - proc.on('close', function (code, signal) { - if (signal || code >= 1) { - err = new (_errors || _load_errors()).ProcessTermError(['Command failed.', signal ? `Exit signal: ${signal}` : `Exit code: ${code}`, `Command: ${program}`, `Arguments: ${args.join(' ')}`, `Directory: ${opts.cwd || process.cwd()}`, `Output:\n${stdout.trim()}`].join('\n')); - err.EXIT_SIGNAL = signal; - err.EXIT_CODE = code; - } + function updateStdout(chunk) { + stdout += chunk; + if (onData) { + onData(chunk); + } + } - if (processingDone || err) { + function finish() { + delete spawnedProcesses[key]; + if (err) { + reject(err); + } else { + resolve(stdout.trim()); + } + } + + if (typeof opts.process === 'function') { + opts.process(proc, updateStdout, reject, function () { + if (processClosed) { finish(); } else { - processClosed = true; + processingDone = true; } }); + } else { + if (proc.stderr) { + proc.stderr.on('data', updateStdout); + } + + if (proc.stdout) { + proc.stdout.on('data', updateStdout); + } + + processingDone = true; + } + + proc.on('close', (code, signal) => { + if (signal || code >= 1) { + err = new (_errors || _load_errors()).ProcessTermError(['Command failed.', signal ? `Exit signal: ${signal}` : `Exit code: ${code}`, `Command: ${program}`, `Arguments: ${args.join(' ')}`, `Directory: ${opts.cwd || process.cwd()}`, `Output:\n${stdout.trim()}`].join('\n')); + err.EXIT_SIGNAL = signal; + err.EXIT_CODE = code; + } + + if (processingDone || err) { + finish(); + } else { + processClosed = true; + } }); - }); + })); } /***/ }), -/* 62 */ +/* 59 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -25907,45 +25655,27 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - var _asyncToGenerator2; function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -exports.default = function (rootCommandName, subCommands) { - var run = function () { +exports.default = function (rootCommandName, subCommands, usage = []) { + let run = (() => { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var subName = (0, (_misc || _load_misc()).camelCase)(args.shift() || ''); + const subName = (0, (_misc || _load_misc()).camelCase)(args.shift() || ''); if (subName && subCommands[subName]) { - var command = subCommands[subName]; - var res = yield command(config, reporter, flags, args); + const command = subCommands[subName]; + const res = yield command(config, reporter, flags, args); if (res !== false) { - return (_promise || _load_promise()).default.resolve(); + return Promise.resolve(); } } if (usage && usage.length) { reporter.error(`${reporter.lang('usage')}:`); - for (var _iterator = usage, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + for (var _iterator = usage, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref2; if (_isArray) { @@ -25957,22 +25687,20 @@ exports.default = function (rootCommandName, subCommands) { _ref2 = _i.value; } - var msg = _ref2; + const msg = _ref2; reporter.error(`yarn ${rootCommandName} ${msg}`); } } - return (_promise || _load_promise()).default.reject(new (_errors || _load_errors()).MessageError(reporter.lang('invalidCommand', subCommandNames.join(', ')))); + return Promise.reject(new (_errors || _load_errors()).MessageError(reporter.lang('invalidCommand', subCommandNames.join(', ')))); }); - return function run(_x2, _x3, _x4, _x5) { + return function run(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; - }(); + })(); - var usage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; - - var subCommandNames = (0, (_keys || _load_keys()).default)(subCommands).map((_misc || _load_misc()).hyphenate); + const subCommandNames = Object.keys(subCommands).map((_misc || _load_misc()).hyphenate); function setFlags(commander) { commander.usage(`${rootCommandName} [${subCommandNames.join('|')}] [flags]`); @@ -25982,7 +25710,7 @@ exports.default = function (rootCommandName, subCommands) { return true; } - var examples = usage.map(function (cmd) { + const examples = usage.map(cmd => { return `${rootCommandName} ${cmd}`; }); @@ -25992,55 +25720,114 @@ exports.default = function (rootCommandName, subCommands) { var _errors; function _load_errors() { - return _errors = __webpack_require__(6); + return _errors = __webpack_require__(5); } var _misc; function _load_misc() { - return _misc = __webpack_require__(28); + return _misc = __webpack_require__(18); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/* 63 */ +/* 60 */ /***/ (function(module, exports, __webpack_require__) { -var anObject = __webpack_require__(57); -var IE8_DOM_DEFINE = __webpack_require__(334); -var toPrimitive = __webpack_require__(230); -var dP = Object.defineProperty; +var global = __webpack_require__(17); +var core = __webpack_require__(31); +var ctx = __webpack_require__(69); +var hide = __webpack_require__(42); +var has = __webpack_require__(70); +var PROTOTYPE = 'prototype'; -exports.f = __webpack_require__(68) ? Object.defineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (IE8_DOM_DEFINE) try { - return dP(O, P, Attributes); - } catch (e) { /* empty */ } - if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); - if ('value' in Attributes) O[P] = Attributes.value; - return O; +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var IS_WRAP = type & $export.W; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE]; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; + var key, own, out; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if (own && has(exports, key)) continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: return new C(); + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if (IS_PROTO) { + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); + } + } }; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; /***/ }), -/* 64 */ +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +try { + var util = __webpack_require__(3); + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + module.exports = __webpack_require__(275); +} + + +/***/ }), +/* 62 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = from; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isPromise__ = __webpack_require__(415); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArrayLike__ = __webpack_require__(412); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isInteropObservable__ = __webpack_require__(1001); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isIterable__ = __webpack_require__(1002); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fromArray__ = __webpack_require__(81); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__fromPromise__ = __webpack_require__(903); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__fromIterable__ = __webpack_require__(901); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__fromObservable__ = __webpack_require__(902); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util_subscribeTo__ = __webpack_require__(416); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isPromise__ = __webpack_require__(444); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArrayLike__ = __webpack_require__(441); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isInteropObservable__ = __webpack_require__(928); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isIterable__ = __webpack_require__(929); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fromArray__ = __webpack_require__(85); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__fromPromise__ = __webpack_require__(830); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__fromIterable__ = __webpack_require__(828); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__fromObservable__ = __webpack_require__(829); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util_subscribeTo__ = __webpack_require__(445); /** PURE_IMPORTS_START _Observable,_util_isPromise,_util_isArrayLike,_util_isInteropObservable,_util_isIterable,_fromArray,_fromPromise,_fromIterable,_fromObservable,_util_subscribeTo PURE_IMPORTS_END */ @@ -26079,217 +25866,217 @@ function from(input, scheduler) { /***/ }), -/* 65 */ +/* 63 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_operators_audit__ = __webpack_require__(398); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_operators_audit__ = __webpack_require__(427); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_operators_audit__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_operators_auditTime__ = __webpack_require__(911); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_operators_auditTime__ = __webpack_require__(838); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return __WEBPACK_IMPORTED_MODULE_1__internal_operators_auditTime__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_operators_buffer__ = __webpack_require__(912); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_operators_buffer__ = __webpack_require__(839); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_operators_buffer__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internal_operators_bufferCount__ = __webpack_require__(913); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internal_operators_bufferCount__ = __webpack_require__(840); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return __WEBPACK_IMPORTED_MODULE_3__internal_operators_bufferCount__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_operators_bufferTime__ = __webpack_require__(914); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_operators_bufferTime__ = __webpack_require__(841); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_operators_bufferTime__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__internal_operators_bufferToggle__ = __webpack_require__(915); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__internal_operators_bufferToggle__ = __webpack_require__(842); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return __WEBPACK_IMPORTED_MODULE_5__internal_operators_bufferToggle__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_operators_bufferWhen__ = __webpack_require__(916); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_operators_bufferWhen__ = __webpack_require__(843); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return __WEBPACK_IMPORTED_MODULE_6__internal_operators_bufferWhen__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__internal_operators_catchError__ = __webpack_require__(917); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__internal_operators_catchError__ = __webpack_require__(844); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return __WEBPACK_IMPORTED_MODULE_7__internal_operators_catchError__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__internal_operators_combineAll__ = __webpack_require__(918); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__internal_operators_combineAll__ = __webpack_require__(845); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return __WEBPACK_IMPORTED_MODULE_8__internal_operators_combineAll__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__internal_operators_combineLatest__ = __webpack_require__(919); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__internal_operators_combineLatest__ = __webpack_require__(846); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return __WEBPACK_IMPORTED_MODULE_9__internal_operators_combineLatest__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__internal_operators_concat__ = __webpack_require__(920); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__internal_operators_concat__ = __webpack_require__(847); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return __WEBPACK_IMPORTED_MODULE_10__internal_operators_concat__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__internal_operators_concatAll__ = __webpack_require__(399); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__internal_operators_concatAll__ = __webpack_require__(428); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return __WEBPACK_IMPORTED_MODULE_11__internal_operators_concatAll__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__internal_operators_concatMap__ = __webpack_require__(400); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__internal_operators_concatMap__ = __webpack_require__(429); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return __WEBPACK_IMPORTED_MODULE_12__internal_operators_concatMap__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__internal_operators_concatMapTo__ = __webpack_require__(921); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__internal_operators_concatMapTo__ = __webpack_require__(848); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return __WEBPACK_IMPORTED_MODULE_13__internal_operators_concatMapTo__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__internal_operators_count__ = __webpack_require__(922); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__internal_operators_count__ = __webpack_require__(849); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "count", function() { return __WEBPACK_IMPORTED_MODULE_14__internal_operators_count__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__internal_operators_debounce__ = __webpack_require__(923); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__internal_operators_debounce__ = __webpack_require__(850); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_15__internal_operators_debounce__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__internal_operators_debounceTime__ = __webpack_require__(924); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__internal_operators_debounceTime__ = __webpack_require__(851); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return __WEBPACK_IMPORTED_MODULE_16__internal_operators_debounceTime__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__internal_operators_defaultIfEmpty__ = __webpack_require__(134); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__internal_operators_defaultIfEmpty__ = __webpack_require__(146); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return __WEBPACK_IMPORTED_MODULE_17__internal_operators_defaultIfEmpty__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__internal_operators_delay__ = __webpack_require__(925); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__internal_operators_delay__ = __webpack_require__(852); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_18__internal_operators_delay__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__internal_operators_delayWhen__ = __webpack_require__(926); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__internal_operators_delayWhen__ = __webpack_require__(853); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return __WEBPACK_IMPORTED_MODULE_19__internal_operators_delayWhen__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__internal_operators_dematerialize__ = __webpack_require__(927); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__internal_operators_dematerialize__ = __webpack_require__(854); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return __WEBPACK_IMPORTED_MODULE_20__internal_operators_dematerialize__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__internal_operators_distinct__ = __webpack_require__(928); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__internal_operators_distinct__ = __webpack_require__(855); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return __WEBPACK_IMPORTED_MODULE_21__internal_operators_distinct__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__internal_operators_distinctUntilChanged__ = __webpack_require__(401); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__internal_operators_distinctUntilChanged__ = __webpack_require__(430); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return __WEBPACK_IMPORTED_MODULE_22__internal_operators_distinctUntilChanged__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__internal_operators_distinctUntilKeyChanged__ = __webpack_require__(929); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__internal_operators_distinctUntilKeyChanged__ = __webpack_require__(856); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return __WEBPACK_IMPORTED_MODULE_23__internal_operators_distinctUntilKeyChanged__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__internal_operators_elementAt__ = __webpack_require__(930); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__internal_operators_elementAt__ = __webpack_require__(857); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return __WEBPACK_IMPORTED_MODULE_24__internal_operators_elementAt__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__internal_operators_endWith__ = __webpack_require__(931); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__internal_operators_endWith__ = __webpack_require__(858); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "endWith", function() { return __WEBPACK_IMPORTED_MODULE_25__internal_operators_endWith__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__internal_operators_every__ = __webpack_require__(932); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__internal_operators_every__ = __webpack_require__(859); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_26__internal_operators_every__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__internal_operators_exhaust__ = __webpack_require__(933); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__internal_operators_exhaust__ = __webpack_require__(860); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return __WEBPACK_IMPORTED_MODULE_27__internal_operators_exhaust__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__internal_operators_exhaustMap__ = __webpack_require__(934); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__internal_operators_exhaustMap__ = __webpack_require__(861); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return __WEBPACK_IMPORTED_MODULE_28__internal_operators_exhaustMap__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__internal_operators_expand__ = __webpack_require__(935); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__internal_operators_expand__ = __webpack_require__(862); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return __WEBPACK_IMPORTED_MODULE_29__internal_operators_expand__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__internal_operators_filter__ = __webpack_require__(135); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__internal_operators_filter__ = __webpack_require__(147); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_30__internal_operators_filter__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__internal_operators_finalize__ = __webpack_require__(936); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__internal_operators_finalize__ = __webpack_require__(863); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return __WEBPACK_IMPORTED_MODULE_31__internal_operators_finalize__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__internal_operators_find__ = __webpack_require__(402); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__internal_operators_find__ = __webpack_require__(431); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_32__internal_operators_find__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__internal_operators_findIndex__ = __webpack_require__(937); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__internal_operators_findIndex__ = __webpack_require__(864); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_33__internal_operators_findIndex__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__internal_operators_first__ = __webpack_require__(938); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__internal_operators_first__ = __webpack_require__(865); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_34__internal_operators_first__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__internal_operators_groupBy__ = __webpack_require__(403); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__internal_operators_groupBy__ = __webpack_require__(432); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_35__internal_operators_groupBy__["b"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__internal_operators_ignoreElements__ = __webpack_require__(939); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__internal_operators_ignoreElements__ = __webpack_require__(866); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return __WEBPACK_IMPORTED_MODULE_36__internal_operators_ignoreElements__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__internal_operators_isEmpty__ = __webpack_require__(940); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__internal_operators_isEmpty__ = __webpack_require__(867); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_37__internal_operators_isEmpty__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__internal_operators_last__ = __webpack_require__(941); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__internal_operators_last__ = __webpack_require__(868); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_38__internal_operators_last__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__internal_operators_map__ = __webpack_require__(54); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__internal_operators_map__ = __webpack_require__(46); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_39__internal_operators_map__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__internal_operators_mapTo__ = __webpack_require__(942); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__internal_operators_mapTo__ = __webpack_require__(869); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return __WEBPACK_IMPORTED_MODULE_40__internal_operators_mapTo__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__internal_operators_materialize__ = __webpack_require__(943); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__internal_operators_materialize__ = __webpack_require__(870); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return __WEBPACK_IMPORTED_MODULE_41__internal_operators_materialize__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__internal_operators_max__ = __webpack_require__(944); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__internal_operators_max__ = __webpack_require__(871); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_42__internal_operators_max__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__internal_operators_merge__ = __webpack_require__(945); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__internal_operators_merge__ = __webpack_require__(872); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return __WEBPACK_IMPORTED_MODULE_43__internal_operators_merge__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__internal_operators_mergeAll__ = __webpack_require__(255); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__internal_operators_mergeAll__ = __webpack_require__(315); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return __WEBPACK_IMPORTED_MODULE_44__internal_operators_mergeAll__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__internal_operators_mergeMap__ = __webpack_require__(136); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__internal_operators_mergeMap__ = __webpack_require__(148); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return __WEBPACK_IMPORTED_MODULE_45__internal_operators_mergeMap__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return __WEBPACK_IMPORTED_MODULE_45__internal_operators_mergeMap__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__internal_operators_mergeMapTo__ = __webpack_require__(946); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__internal_operators_mergeMapTo__ = __webpack_require__(873); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return __WEBPACK_IMPORTED_MODULE_46__internal_operators_mergeMapTo__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__internal_operators_mergeScan__ = __webpack_require__(947); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__internal_operators_mergeScan__ = __webpack_require__(874); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return __WEBPACK_IMPORTED_MODULE_47__internal_operators_mergeScan__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__internal_operators_min__ = __webpack_require__(948); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__internal_operators_min__ = __webpack_require__(875); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_48__internal_operators_min__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__internal_operators_multicast__ = __webpack_require__(110); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__internal_operators_multicast__ = __webpack_require__(116); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return __WEBPACK_IMPORTED_MODULE_49__internal_operators_multicast__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__internal_operators_observeOn__ = __webpack_require__(404); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__internal_operators_observeOn__ = __webpack_require__(433); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return __WEBPACK_IMPORTED_MODULE_50__internal_operators_observeOn__["b"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__internal_operators_onErrorResumeNext__ = __webpack_require__(949); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__internal_operators_onErrorResumeNext__ = __webpack_require__(876); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return __WEBPACK_IMPORTED_MODULE_51__internal_operators_onErrorResumeNext__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__internal_operators_pairwise__ = __webpack_require__(950); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__internal_operators_pairwise__ = __webpack_require__(877); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return __WEBPACK_IMPORTED_MODULE_52__internal_operators_pairwise__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__internal_operators_partition__ = __webpack_require__(951); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__internal_operators_partition__ = __webpack_require__(878); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_53__internal_operators_partition__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__internal_operators_pluck__ = __webpack_require__(952); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__internal_operators_pluck__ = __webpack_require__(879); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_54__internal_operators_pluck__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__internal_operators_publish__ = __webpack_require__(953); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__internal_operators_publish__ = __webpack_require__(880); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return __WEBPACK_IMPORTED_MODULE_55__internal_operators_publish__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__internal_operators_publishBehavior__ = __webpack_require__(954); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__internal_operators_publishBehavior__ = __webpack_require__(881); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return __WEBPACK_IMPORTED_MODULE_56__internal_operators_publishBehavior__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__internal_operators_publishLast__ = __webpack_require__(955); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__internal_operators_publishLast__ = __webpack_require__(882); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return __WEBPACK_IMPORTED_MODULE_57__internal_operators_publishLast__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__internal_operators_publishReplay__ = __webpack_require__(956); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__internal_operators_publishReplay__ = __webpack_require__(883); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return __WEBPACK_IMPORTED_MODULE_58__internal_operators_publishReplay__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__internal_operators_race__ = __webpack_require__(957); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__internal_operators_race__ = __webpack_require__(884); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return __WEBPACK_IMPORTED_MODULE_59__internal_operators_race__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__internal_operators_reduce__ = __webpack_require__(177); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__internal_operators_reduce__ = __webpack_require__(187); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_60__internal_operators_reduce__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__internal_operators_repeat__ = __webpack_require__(958); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__internal_operators_repeat__ = __webpack_require__(885); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return __WEBPACK_IMPORTED_MODULE_61__internal_operators_repeat__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__internal_operators_repeatWhen__ = __webpack_require__(959); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__internal_operators_repeatWhen__ = __webpack_require__(886); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return __WEBPACK_IMPORTED_MODULE_62__internal_operators_repeatWhen__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__internal_operators_retry__ = __webpack_require__(960); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__internal_operators_retry__ = __webpack_require__(887); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return __WEBPACK_IMPORTED_MODULE_63__internal_operators_retry__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__internal_operators_retryWhen__ = __webpack_require__(961); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__internal_operators_retryWhen__ = __webpack_require__(888); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return __WEBPACK_IMPORTED_MODULE_64__internal_operators_retryWhen__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__internal_operators_refCount__ = __webpack_require__(256); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__internal_operators_refCount__ = __webpack_require__(316); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return __WEBPACK_IMPORTED_MODULE_65__internal_operators_refCount__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__internal_operators_sample__ = __webpack_require__(962); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__internal_operators_sample__ = __webpack_require__(889); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_66__internal_operators_sample__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__internal_operators_sampleTime__ = __webpack_require__(963); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__internal_operators_sampleTime__ = __webpack_require__(890); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return __WEBPACK_IMPORTED_MODULE_67__internal_operators_sampleTime__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__internal_operators_scan__ = __webpack_require__(257); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__internal_operators_scan__ = __webpack_require__(317); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return __WEBPACK_IMPORTED_MODULE_68__internal_operators_scan__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__internal_operators_sequenceEqual__ = __webpack_require__(964); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__internal_operators_sequenceEqual__ = __webpack_require__(891); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return __WEBPACK_IMPORTED_MODULE_69__internal_operators_sequenceEqual__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__internal_operators_share__ = __webpack_require__(965); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__internal_operators_share__ = __webpack_require__(892); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "share", function() { return __WEBPACK_IMPORTED_MODULE_70__internal_operators_share__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__internal_operators_shareReplay__ = __webpack_require__(966); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__internal_operators_shareReplay__ = __webpack_require__(893); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return __WEBPACK_IMPORTED_MODULE_71__internal_operators_shareReplay__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__internal_operators_single__ = __webpack_require__(967); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__internal_operators_single__ = __webpack_require__(894); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "single", function() { return __WEBPACK_IMPORTED_MODULE_72__internal_operators_single__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__internal_operators_skip__ = __webpack_require__(968); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__internal_operators_skip__ = __webpack_require__(895); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return __WEBPACK_IMPORTED_MODULE_73__internal_operators_skip__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__internal_operators_skipLast__ = __webpack_require__(969); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__internal_operators_skipLast__ = __webpack_require__(896); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return __WEBPACK_IMPORTED_MODULE_74__internal_operators_skipLast__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__internal_operators_skipUntil__ = __webpack_require__(970); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__internal_operators_skipUntil__ = __webpack_require__(897); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return __WEBPACK_IMPORTED_MODULE_75__internal_operators_skipUntil__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__internal_operators_skipWhile__ = __webpack_require__(971); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__internal_operators_skipWhile__ = __webpack_require__(898); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return __WEBPACK_IMPORTED_MODULE_76__internal_operators_skipWhile__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__internal_operators_startWith__ = __webpack_require__(972); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__internal_operators_startWith__ = __webpack_require__(899); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return __WEBPACK_IMPORTED_MODULE_77__internal_operators_startWith__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__internal_operators_subscribeOn__ = __webpack_require__(973); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__internal_operators_subscribeOn__ = __webpack_require__(900); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return __WEBPACK_IMPORTED_MODULE_78__internal_operators_subscribeOn__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__internal_operators_switchAll__ = __webpack_require__(974); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__internal_operators_switchAll__ = __webpack_require__(901); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return __WEBPACK_IMPORTED_MODULE_79__internal_operators_switchAll__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__internal_operators_switchMap__ = __webpack_require__(258); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__internal_operators_switchMap__ = __webpack_require__(318); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return __WEBPACK_IMPORTED_MODULE_80__internal_operators_switchMap__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__internal_operators_switchMapTo__ = __webpack_require__(975); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__internal_operators_switchMapTo__ = __webpack_require__(902); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return __WEBPACK_IMPORTED_MODULE_81__internal_operators_switchMapTo__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__internal_operators_take__ = __webpack_require__(259); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__internal_operators_take__ = __webpack_require__(319); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_82__internal_operators_take__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__internal_operators_takeLast__ = __webpack_require__(260); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__internal_operators_takeLast__ = __webpack_require__(320); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return __WEBPACK_IMPORTED_MODULE_83__internal_operators_takeLast__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__internal_operators_takeUntil__ = __webpack_require__(976); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__internal_operators_takeUntil__ = __webpack_require__(903); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return __WEBPACK_IMPORTED_MODULE_84__internal_operators_takeUntil__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__internal_operators_takeWhile__ = __webpack_require__(977); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__internal_operators_takeWhile__ = __webpack_require__(904); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return __WEBPACK_IMPORTED_MODULE_85__internal_operators_takeWhile__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__internal_operators_tap__ = __webpack_require__(405); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__internal_operators_tap__ = __webpack_require__(434); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_86__internal_operators_tap__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__internal_operators_throttle__ = __webpack_require__(406); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__internal_operators_throttle__ = __webpack_require__(435); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_87__internal_operators_throttle__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__internal_operators_throttleTime__ = __webpack_require__(978); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__internal_operators_throttleTime__ = __webpack_require__(905); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return __WEBPACK_IMPORTED_MODULE_88__internal_operators_throttleTime__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__internal_operators_throwIfEmpty__ = __webpack_require__(178); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__internal_operators_throwIfEmpty__ = __webpack_require__(188); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return __WEBPACK_IMPORTED_MODULE_89__internal_operators_throwIfEmpty__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__internal_operators_timeInterval__ = __webpack_require__(979); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__internal_operators_timeInterval__ = __webpack_require__(906); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return __WEBPACK_IMPORTED_MODULE_90__internal_operators_timeInterval__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__internal_operators_timeout__ = __webpack_require__(980); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__internal_operators_timeout__ = __webpack_require__(907); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return __WEBPACK_IMPORTED_MODULE_91__internal_operators_timeout__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__internal_operators_timeoutWith__ = __webpack_require__(407); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__internal_operators_timeoutWith__ = __webpack_require__(436); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return __WEBPACK_IMPORTED_MODULE_92__internal_operators_timeoutWith__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__internal_operators_timestamp__ = __webpack_require__(981); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__internal_operators_timestamp__ = __webpack_require__(908); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return __WEBPACK_IMPORTED_MODULE_93__internal_operators_timestamp__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__internal_operators_toArray__ = __webpack_require__(982); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__internal_operators_toArray__ = __webpack_require__(909); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_94__internal_operators_toArray__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__internal_operators_window__ = __webpack_require__(983); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__internal_operators_window__ = __webpack_require__(910); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "window", function() { return __WEBPACK_IMPORTED_MODULE_95__internal_operators_window__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__internal_operators_windowCount__ = __webpack_require__(984); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__internal_operators_windowCount__ = __webpack_require__(911); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return __WEBPACK_IMPORTED_MODULE_96__internal_operators_windowCount__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__internal_operators_windowTime__ = __webpack_require__(985); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__internal_operators_windowTime__ = __webpack_require__(912); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return __WEBPACK_IMPORTED_MODULE_97__internal_operators_windowTime__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__internal_operators_windowToggle__ = __webpack_require__(986); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__internal_operators_windowToggle__ = __webpack_require__(913); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return __WEBPACK_IMPORTED_MODULE_98__internal_operators_windowToggle__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__internal_operators_windowWhen__ = __webpack_require__(987); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__internal_operators_windowWhen__ = __webpack_require__(914); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return __WEBPACK_IMPORTED_MODULE_99__internal_operators_windowWhen__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__internal_operators_withLatestFrom__ = __webpack_require__(988); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__internal_operators_withLatestFrom__ = __webpack_require__(915); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return __WEBPACK_IMPORTED_MODULE_100__internal_operators_withLatestFrom__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__internal_operators_zip__ = __webpack_require__(989); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__internal_operators_zip__ = __webpack_require__(916); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_101__internal_operators_zip__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__internal_operators_zipAll__ = __webpack_require__(990); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__internal_operators_zipAll__ = __webpack_require__(917); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return __WEBPACK_IMPORTED_MODULE_102__internal_operators_zipAll__["a"]; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ @@ -26400,7 +26187,13 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /***/ }), -/* 66 */ +/* 64 */ +/***/ (function(module, exports) { + +module.exports = require("buffer"); + +/***/ }), +/* 65 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2011 Mark Cavage All rights reserved. @@ -26408,7 +26201,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // If you have no idea what ASN.1 or BER is, see this: // ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc -var Ber = __webpack_require__(487); +var Ber = __webpack_require__(513); @@ -26425,12 +26218,61 @@ module.exports = { }; +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.home = undefined; + +var _rootUser; + +function _load_rootUser() { + return _rootUser = _interopRequireDefault(__webpack_require__(223)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const path = __webpack_require__(0); + +const home = exports.home = __webpack_require__(49).homedir(); + +const userHomeDir = (_rootUser || _load_rootUser()).default ? path.resolve('/usr/local/share') : home; + +exports.default = userHomeDir; + /***/ }), /* 67 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; + + +/***/ }), +/* 68 */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + + +/***/ }), +/* 69 */ /***/ (function(module, exports, __webpack_require__) { // optional / simple context binding -var aFunction = __webpack_require__(88); +var aFunction = __webpack_require__(67); module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; @@ -26452,23 +26294,77 @@ module.exports = function (fn, that, length) { /***/ }), -/* 68 */ +/* 70 */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), +/* 71 */ /***/ (function(module, exports, __webpack_require__) { -// Thank's IE8 for his funny defineProperty -module.exports = !__webpack_require__(76)(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +var anObject = __webpack_require__(35); +var IE8_DOM_DEFINE = __webpack_require__(238); +var toPrimitive = __webpack_require__(255); +var dP = Object.defineProperty; + +exports.f = __webpack_require__(51) ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// JS-YAML's default schema for `load` function. +// It is not described in the YAML specification. +// +// This schema is based on JS-YAML's default safe schema and includes +// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. +// +// Also this schema is used as default base schema at `Schema.create` function. + + + + + +var Schema = __webpack_require__(44); + + +module.exports = Schema.DEFAULT = new Schema({ + include: [ + __webpack_require__(55) + ], + explicit: [ + __webpack_require__(290), + __webpack_require__(289), + __webpack_require__(288) + ] }); /***/ }), -/* 69 */ +/* 73 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. -var assert = __webpack_require__(22); -var util = __webpack_require__(9); +var assert = __webpack_require__(16); +var util = __webpack_require__(3); function FingerprintFormatError(fp, format) { if (Error.captureStackTrace) @@ -26552,21 +26448,21 @@ module.exports = { /***/ }), -/* 70 */ +/* 74 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = Signature; -var assert = __webpack_require__(22); -var Buffer = __webpack_require__(20).Buffer; -var algs = __webpack_require__(38); -var crypto = __webpack_require__(21); -var errs = __webpack_require__(69); -var utils = __webpack_require__(32); -var asn1 = __webpack_require__(66); -var SSHBuffer = __webpack_require__(147); +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var crypto = __webpack_require__(12); +var errs = __webpack_require__(73); +var utils = __webpack_require__(26); +var asn1 = __webpack_require__(65); +var SSHBuffer = __webpack_require__(159); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var SignatureParseError = errs.SignatureParseError; @@ -26872,7 +26768,7 @@ Signature._oldVersionDetect = function (obj) { /***/ }), -/* 71 */ +/* 75 */ /***/ (function(module, exports, __webpack_require__) { (function(nacl) { @@ -29251,7 +29147,7 @@ nacl.setPRNG = function(fn) { }); } else if (true) { // Node.js. - crypto = __webpack_require__(21); + crypto = __webpack_require__(12); if (crypto && crypto.randomBytes) { nacl.setPRNG(function(x, n) { var i, v = crypto.randomBytes(n); @@ -29266,13 +29162,553 @@ nacl.setPRNG = function(fn) { /***/ }), -/* 72 */ +/* 76 */ /***/ (function(module, exports) { -module.exports = require("os"); +module.exports = require("events"); /***/ }), -/* 73 */ +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +const Buffer = __webpack_require__(45).Buffer + +const crypto = __webpack_require__(12) +const Transform = __webpack_require__(23).Transform + +const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512'] + +const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i +const SRI_REGEX = /^([^-]+)-([^?]+)([?\S*]*)$/ +const STRICT_SRI_REGEX = /^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/ +const VCHAR_REGEX = /^[\x21-\x7E]+$/ + +class Hash { + get isHash () { return true } + constructor (hash, opts) { + const strict = !!(opts && opts.strict) + this.source = hash.trim() + // 3.1. Integrity metadata (called "Hash" by ssri) + // https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description + const match = this.source.match( + strict + ? STRICT_SRI_REGEX + : SRI_REGEX + ) + if (!match) { return } + if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { return } + this.algorithm = match[1] + this.digest = match[2] + + const rawOpts = match[3] + this.options = rawOpts ? rawOpts.slice(1).split('?') : [] + } + hexDigest () { + return this.digest && Buffer.from(this.digest, 'base64').toString('hex') + } + toJSON () { + return this.toString() + } + toString (opts) { + if (opts && opts.strict) { + // Strict mode enforces the standard as close to the foot of the + // letter as it can. + if (!( + // The spec has very restricted productions for algorithms. + // https://www.w3.org/TR/CSP2/#source-list-syntax + SPEC_ALGORITHMS.some(x => x === this.algorithm) && + // Usually, if someone insists on using a "different" base64, we + // leave it as-is, since there's multiple standards, and the + // specified is not a URL-safe variant. + // https://www.w3.org/TR/CSP2/#base64_value + this.digest.match(BASE64_REGEX) && + // Option syntax is strictly visual chars. + // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-option-expression + // https://tools.ietf.org/html/rfc5234#appendix-B.1 + (this.options || []).every(opt => opt.match(VCHAR_REGEX)) + )) { + return '' + } + } + const options = this.options && this.options.length + ? `?${this.options.join('?')}` + : '' + return `${this.algorithm}-${this.digest}${options}` + } +} + +class Integrity { + get isIntegrity () { return true } + toJSON () { + return this.toString() + } + toString (opts) { + opts = opts || {} + let sep = opts.sep || ' ' + if (opts.strict) { + // Entries must be separated by whitespace, according to spec. + sep = sep.replace(/\S+/g, ' ') + } + return Object.keys(this).map(k => { + return this[k].map(hash => { + return Hash.prototype.toString.call(hash, opts) + }).filter(x => x.length).join(sep) + }).filter(x => x.length).join(sep) + } + concat (integrity, opts) { + const other = typeof integrity === 'string' + ? integrity + : stringify(integrity, opts) + return parse(`${this.toString(opts)} ${other}`, opts) + } + hexDigest () { + return parse(this, {single: true}).hexDigest() + } + match (integrity, opts) { + const other = parse(integrity, opts) + const algo = other.pickAlgorithm(opts) + return ( + this[algo] && + other[algo] && + this[algo].find(hash => + other[algo].find(otherhash => + hash.digest === otherhash.digest + ) + ) + ) || false + } + pickAlgorithm (opts) { + const pickAlgorithm = (opts && opts.pickAlgorithm) || getPrioritizedHash + const keys = Object.keys(this) + if (!keys.length) { + throw new Error(`No algorithms available for ${ + JSON.stringify(this.toString()) + }`) + } + return keys.reduce((acc, algo) => { + return pickAlgorithm(acc, algo) || acc + }) + } +} + +module.exports.parse = parse +function parse (sri, opts) { + opts = opts || {} + if (typeof sri === 'string') { + return _parse(sri, opts) + } else if (sri.algorithm && sri.digest) { + const fullSri = new Integrity() + fullSri[sri.algorithm] = [sri] + return _parse(stringify(fullSri, opts), opts) + } else { + return _parse(stringify(sri, opts), opts) + } +} + +function _parse (integrity, opts) { + // 3.4.3. Parse metadata + // https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata + if (opts.single) { + return new Hash(integrity, opts) + } + return integrity.trim().split(/\s+/).reduce((acc, string) => { + const hash = new Hash(string, opts) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) + } + return acc + }, new Integrity()) +} + +module.exports.stringify = stringify +function stringify (obj, opts) { + if (obj.algorithm && obj.digest) { + return Hash.prototype.toString.call(obj, opts) + } else if (typeof obj === 'string') { + return stringify(parse(obj, opts), opts) + } else { + return Integrity.prototype.toString.call(obj, opts) + } +} + +module.exports.fromHex = fromHex +function fromHex (hexDigest, algorithm, opts) { + const optString = (opts && opts.options && opts.options.length) + ? `?${opts.options.join('?')}` + : '' + return parse( + `${algorithm}-${ + Buffer.from(hexDigest, 'hex').toString('base64') + }${optString}`, opts + ) +} + +module.exports.fromData = fromData +function fromData (data, opts) { + opts = opts || {} + const algorithms = opts.algorithms || ['sha512'] + const optString = opts.options && opts.options.length + ? `?${opts.options.join('?')}` + : '' + return algorithms.reduce((acc, algo) => { + const digest = crypto.createHash(algo).update(data).digest('base64') + const hash = new Hash( + `${algo}-${digest}${optString}`, + opts + ) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) + } + return acc + }, new Integrity()) +} + +module.exports.fromStream = fromStream +function fromStream (stream, opts) { + opts = opts || {} + const P = opts.Promise || Promise + const istream = integrityStream(opts) + return new P((resolve, reject) => { + stream.pipe(istream) + stream.on('error', reject) + istream.on('error', reject) + let sri + istream.on('integrity', s => { sri = s }) + istream.on('end', () => resolve(sri)) + istream.on('data', () => {}) + }) +} + +module.exports.checkData = checkData +function checkData (data, sri, opts) { + opts = opts || {} + sri = parse(sri, opts) + if (!Object.keys(sri).length) { + if (opts.error) { + throw Object.assign( + new Error('No valid integrity hashes to check against'), { + code: 'EINTEGRITY' + } + ) + } else { + return false + } + } + const algorithm = sri.pickAlgorithm(opts) + const digest = crypto.createHash(algorithm).update(data).digest('base64') + const newSri = parse({algorithm, digest}) + const match = newSri.match(sri, opts) + if (match || !opts.error) { + return match + } else if (typeof opts.size === 'number' && (data.length !== opts.size)) { + const err = new Error(`data size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${data.length}`) + err.code = 'EBADSIZE' + err.found = data.length + err.expected = opts.size + err.sri = sri + throw err + } else { + const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`) + err.code = 'EINTEGRITY' + err.found = newSri + err.expected = sri + err.algorithm = algorithm + err.sri = sri + throw err + } +} + +module.exports.checkStream = checkStream +function checkStream (stream, sri, opts) { + opts = opts || {} + const P = opts.Promise || Promise + const checker = integrityStream(Object.assign({}, opts, { + integrity: sri + })) + return new P((resolve, reject) => { + stream.pipe(checker) + stream.on('error', reject) + checker.on('error', reject) + let sri + checker.on('verified', s => { sri = s }) + checker.on('end', () => resolve(sri)) + checker.on('data', () => {}) + }) +} + +module.exports.integrityStream = integrityStream +function integrityStream (opts) { + opts = opts || {} + // For verification + const sri = opts.integrity && parse(opts.integrity, opts) + const goodSri = sri && Object.keys(sri).length + const algorithm = goodSri && sri.pickAlgorithm(opts) + const digests = goodSri && sri[algorithm] + // Calculating stream + const algorithms = Array.from( + new Set( + (opts.algorithms || ['sha512']) + .concat(algorithm ? [algorithm] : []) + ) + ) + const hashes = algorithms.map(crypto.createHash) + let streamSize = 0 + const stream = new Transform({ + transform (chunk, enc, cb) { + streamSize += chunk.length + hashes.forEach(h => h.update(chunk, enc)) + cb(null, chunk, enc) + } + }).on('end', () => { + const optString = (opts.options && opts.options.length) + ? `?${opts.options.join('?')}` + : '' + const newSri = parse(hashes.map((h, i) => { + return `${algorithms[i]}-${h.digest('base64')}${optString}` + }).join(' '), opts) + // Integrity verification mode + const match = goodSri && newSri.match(sri, opts) + if (typeof opts.size === 'number' && streamSize !== opts.size) { + const err = new Error(`stream size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${streamSize}`) + err.code = 'EBADSIZE' + err.found = streamSize + err.expected = opts.size + err.sri = sri + stream.emit('error', err) + } else if (opts.integrity && !match) { + const err = new Error(`${sri} integrity checksum failed when using ${algorithm}: wanted ${digests} but got ${newSri}. (${streamSize} bytes)`) + err.code = 'EINTEGRITY' + err.found = newSri + err.expected = digests + err.algorithm = algorithm + err.sri = sri + stream.emit('error', err) + } else { + stream.emit('size', streamSize) + stream.emit('integrity', newSri) + match && stream.emit('verified', match) + } + }) + return stream +} + +module.exports.create = createIntegrity +function createIntegrity (opts) { + opts = opts || {} + const algorithms = opts.algorithms || ['sha512'] + const optString = opts.options && opts.options.length + ? `?${opts.options.join('?')}` + : '' + + const hashes = algorithms.map(crypto.createHash) + + return { + update: function (chunk, enc) { + hashes.forEach(h => h.update(chunk, enc)) + return this + }, + digest: function (enc) { + const integrity = algorithms.reduce((acc, algo) => { + const digest = hashes.shift().digest('base64') + const hash = new Hash( + `${algo}-${digest}${optString}`, + opts + ) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) + } + return acc + }, new Integrity()) + + return integrity + } + } +} + +const NODE_HASHES = new Set(crypto.getHashes()) + +// This is a Best Effort™ at a reasonable priority for hash algos +const DEFAULT_PRIORITY = [ + 'md5', 'whirlpool', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', + // TODO - it's unclear _which_ of these Node will actually use as its name + // for the algorithm, so we guesswork it based on the OpenSSL names. + 'sha3', + 'sha3-256', 'sha3-384', 'sha3-512', + 'sha3_256', 'sha3_384', 'sha3_512' +].filter(algo => NODE_HASHES.has(algo)) + +function getPrioritizedHash (algo1, algo2) { + return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase()) + ? algo1 + : algo2 +} + + +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hostedGit = exports.registries = undefined; +exports.getExoticResolver = getExoticResolver; +exports.hostedGitFragmentToGitUrl = hostedGitFragmentToGitUrl; + +var _baseResolver; + +function _load_baseResolver() { + return _baseResolver = _interopRequireDefault(__webpack_require__(123)); +} + +var _npmResolver; + +function _load_npmResolver() { + return _npmResolver = _interopRequireDefault(__webpack_require__(217)); +} + +var _yarnResolver; + +function _load_yarnResolver() { + return _yarnResolver = _interopRequireDefault(__webpack_require__(575)); +} + +var _gitResolver; + +function _load_gitResolver() { + return _gitResolver = _interopRequireDefault(__webpack_require__(124)); +} + +var _tarballResolver; + +function _load_tarballResolver() { + return _tarballResolver = _interopRequireDefault(__webpack_require__(573)); +} + +var _githubResolver; + +function _load_githubResolver() { + return _githubResolver = _interopRequireDefault(__webpack_require__(367)); +} + +var _fileResolver; + +function _load_fileResolver() { + return _fileResolver = _interopRequireDefault(__webpack_require__(215)); +} + +var _linkResolver; + +function _load_linkResolver() { + return _linkResolver = _interopRequireDefault(__webpack_require__(368)); +} + +var _gitlabResolver; + +function _load_gitlabResolver() { + return _gitlabResolver = _interopRequireDefault(__webpack_require__(571)); +} + +var _gistResolver; + +function _load_gistResolver() { + return _gistResolver = _interopRequireDefault(__webpack_require__(216)); +} + +var _bitbucketResolver; + +function _load_bitbucketResolver() { + return _bitbucketResolver = _interopRequireDefault(__webpack_require__(570)); +} + +var _hostedGitResolver; + +function _load_hostedGitResolver() { + return _hostedGitResolver = __webpack_require__(109); +} + +var _registryResolver; + +function _load_registryResolver() { + return _registryResolver = _interopRequireDefault(__webpack_require__(572)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const registries = exports.registries = { + npm: (_npmResolver || _load_npmResolver()).default, + yarn: (_yarnResolver || _load_yarnResolver()).default +}; + +// + +const exotics = new Set([(_gitResolver || _load_gitResolver()).default, (_tarballResolver || _load_tarballResolver()).default, (_githubResolver || _load_githubResolver()).default, (_fileResolver || _load_fileResolver()).default, (_linkResolver || _load_linkResolver()).default, (_gitlabResolver || _load_gitlabResolver()).default, (_gistResolver || _load_gistResolver()).default, (_bitbucketResolver || _load_bitbucketResolver()).default]); + +function getExoticResolver(pattern) { + for (var _iterator = exotics, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const Resolver = _ref; + + if (Resolver.isVersion(pattern)) { + return Resolver; + } + } + return null; +} + +// + +const hostedGit = exports.hostedGit = { + github: (_githubResolver || _load_githubResolver()).default, + gitlab: (_gitlabResolver || _load_gitlabResolver()).default, + bitbucket: (_bitbucketResolver || _load_bitbucketResolver()).default +}; + +function hostedGitFragmentToGitUrl(fragment, reporter) { + for (const key in hostedGit) { + const Resolver = hostedGit[key]; + if (Resolver.isVersion(fragment)) { + return Resolver.getGitHTTPUrl((0, (_hostedGitResolver || _load_hostedGitResolver()).explodeHostedGitFragment)(fragment, reporter)); + } + } + + return fragment; +} + +// + +for (const key in registries) { + var _class, _temp; + + const RegistryResolver = registries[key]; + + exotics.add((_temp = _class = class extends (_registryResolver || _load_registryResolver()).default {}, _class.protocol = key, _class.factory = RegistryResolver, _temp)); +} + +/***/ }), +/* 79 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29282,38 +29718,15 @@ module.exports = require("os"); * Should be extended by prompt types. */ -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _ = __webpack_require__(45); -var chalk = __webpack_require__(36); -var runAsync = __webpack_require__(171); - -var _require = __webpack_require__(65), - filter = _require.filter, - flatMap = _require.flatMap, - share = _require.share, - take = _require.take, - takeUntil = _require.takeUntil; - -var Choices = __webpack_require__(498); -var ScreenManager = __webpack_require__(509); - -var Prompt = function () { - function Prompt(question, rl, answers) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Prompt); +var _ = __webpack_require__(38); +var chalk = __webpack_require__(30); +var runAsync = __webpack_require__(181); +var { filter, flatMap, share, take, takeUntil } = __webpack_require__(63); +var Choices = __webpack_require__(686); +var ScreenManager = __webpack_require__(697); +class Prompt { + constructor(question, rl, answers) { // Setup instance defaults property _.assign(this, { answers: answers, @@ -29322,15 +29735,9 @@ var Prompt = function () { // Set defaults prompt options this.opt = _.defaults(_.clone(question), { - validate: function validate() { - return true; - }, - filter: function filter(val) { - return val; - }, - when: function when() { - return true; - }, + validate: () => true, + filter: val => val, + when: () => true, suffix: '', prefix: chalk.green('?') }); @@ -29359,22 +29766,16 @@ var Prompt = function () { * @return {Promise} */ - Prompt.prototype.run = function run() { - var _this = this; - - return new (_promise || _load_promise()).default(function (resolve) { - _this._run(function (value) { - return resolve(value); - }); + run() { + return new Promise(resolve => { + this._run(value => resolve(value)); }); - }; + } // Default noop (this one should be overwritten in prompts) - - - Prompt.prototype._run = function _run(cb) { + _run(cb) { cb(); - }; + } /** * Throw an error telling a required parameter is missing @@ -29382,62 +29783,67 @@ var Prompt = function () { * @return {Throw Error} */ - Prompt.prototype.throwParamError = function throwParamError(name) { + throwParamError(name) { throw new Error('You must provide a `' + name + '` parameter'); - }; + } /** * Called when the UI closes. Override to do any specific cleanup necessary */ - - - Prompt.prototype.close = function close() { + close() { this.screen.releaseCursor(); - }; + } /** * Run the provided validation method each time a submit event occur. * @param {Rx.Observable} submit - submit event flow * @return {Object} Object containing two observables: `success` and `error` */ - - - Prompt.prototype.handleSubmitEvents = function handleSubmitEvents(submit) { + handleSubmitEvents(submit) { var self = this; var validate = runAsync(this.opt.validate); var asyncFilter = runAsync(this.opt.filter); - var validation = submit.pipe(flatMap(function (value) { - return asyncFilter(value, self.answers).then(function (filteredValue) { - return validate(filteredValue, self.answers).then(function (isValid) { - return { isValid: isValid, value: filteredValue }; - }, function (err) { - return { isValid: err }; - }); - }, function (err) { - return { isValid: err }; - }); - }), share()); + var validation = submit.pipe( + flatMap(value => + asyncFilter(value, self.answers).then( + filteredValue => + validate(filteredValue, self.answers).then( + isValid => ({ isValid: isValid, value: filteredValue }), + err => ({ isValid: err }) + ), + err => ({ isValid: err }) + ) + ), + share() + ); - var success = validation.pipe(filter(function (state) { - return state.isValid === true; - }), take(1)); - var error = validation.pipe(filter(function (state) { - return state.isValid !== true; - }), takeUntil(success)); + var success = validation.pipe( + filter(state => state.isValid === true), + take(1) + ); + var error = validation.pipe( + filter(state => state.isValid !== true), + takeUntil(success) + ); return { success: success, error: error }; - }; + } /** * Generate the prompt question string * @return {String} prompt question string */ - Prompt.prototype.getQuestion = function getQuestion() { - var message = this.opt.prefix + ' ' + chalk.bold(this.opt.message) + this.opt.suffix + chalk.reset(' '); + getQuestion() { + var message = + this.opt.prefix + + ' ' + + chalk.bold(this.opt.message) + + this.opt.suffix + + chalk.reset(' '); // Append the default if available, and if question isn't answered if (this.opt.default != null && this.status !== 'answered') { @@ -29450,311 +29856,74 @@ var Prompt = function () { } return message; - }; - - return Prompt; -}(); + } +} module.exports = Prompt; + /***/ }), -/* 74 */ +/* 80 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -var _require = __webpack_require__(172), - fromEvent = _require.fromEvent; - -var _require2 = __webpack_require__(65), - filter = _require2.filter, - map = _require2.map, - share = _require2.share; +var { fromEvent } = __webpack_require__(182); +var { filter, map, share } = __webpack_require__(63); function normalizeKeypressEvents(value, key) { return { value: value, key: key || {} }; } -module.exports = function (rl) { +module.exports = function(rl) { var keypress = fromEvent(rl.input, 'keypress', normalizeKeypressEvents) - // Ignore `enter` key. On the readline, we only care about the `line` event. - .pipe(filter(function (_ref) { - var key = _ref.key; - return key.name !== 'enter' && key.name !== 'return'; - })); + // Ignore `enter` key. On the readline, we only care about the `line` event. + .pipe(filter(({ key }) => key.name !== 'enter' && key.name !== 'return')); return { line: fromEvent(rl, 'line'), keypress: keypress, - normalizedUpKey: keypress.pipe(filter(function (_ref2) { - var key = _ref2.key; - return key.name === 'up' || key.name === 'k' || key.name === 'p' && key.ctrl; - }), share()), + normalizedUpKey: keypress.pipe( + filter( + ({ key }) => + key.name === 'up' || key.name === 'k' || (key.name === 'p' && key.ctrl) + ), + share() + ), - normalizedDownKey: keypress.pipe(filter(function (_ref3) { - var key = _ref3.key; - return key.name === 'down' || key.name === 'j' || key.name === 'n' && key.ctrl; - }), share()), + normalizedDownKey: keypress.pipe( + filter( + ({ key }) => + key.name === 'down' || key.name === 'j' || (key.name === 'n' && key.ctrl) + ), + share() + ), - numberKey: keypress.pipe(filter(function (e) { - return e.value && '123456789'.indexOf(e.value) >= 0; - }), map(function (e) { - return Number(e.value); - }), share()), + numberKey: keypress.pipe( + filter(e => e.value && '123456789'.indexOf(e.value) >= 0), + map(e => Number(e.value)), + share() + ), - spaceKey: keypress.pipe(filter(function (_ref4) { - var key = _ref4.key; - return key && key.name === 'space'; - }), share()), - aKey: keypress.pipe(filter(function (_ref5) { - var key = _ref5.key; - return key && key.name === 'a'; - }), share()), - iKey: keypress.pipe(filter(function (_ref6) { - var key = _ref6.key; - return key && key.name === 'i'; - }), share()) + spaceKey: keypress.pipe( + filter(({ key }) => key && key.name === 'space'), + share() + ), + aKey: keypress.pipe( + filter(({ key }) => key && key.name === 'a'), + share() + ), + iKey: keypress.pipe( + filter(({ key }) => key && key.name === 'i'), + share() + ) }; }; -/***/ }), -/* 75 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.hostedGit = exports.registries = undefined; - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -exports.getExoticResolver = getExoticResolver; -exports.hostedGitFragmentToGitUrl = hostedGitFragmentToGitUrl; - -var _baseResolver; - -function _load_baseResolver() { - return _baseResolver = _interopRequireDefault(__webpack_require__(117)); -} - -var _npmResolver; - -function _load_npmResolver() { - return _npmResolver = _interopRequireDefault(__webpack_require__(206)); -} - -var _yarnResolver; - -function _load_yarnResolver() { - return _yarnResolver = _interopRequireDefault(__webpack_require__(564)); -} - -var _gitResolver; - -function _load_gitResolver() { - return _gitResolver = _interopRequireDefault(__webpack_require__(118)); -} - -var _tarballResolver; - -function _load_tarballResolver() { - return _tarballResolver = _interopRequireDefault(__webpack_require__(562)); -} - -var _githubResolver; - -function _load_githubResolver() { - return _githubResolver = _interopRequireDefault(__webpack_require__(310)); -} - -var _fileResolver; - -function _load_fileResolver() { - return _fileResolver = _interopRequireDefault(__webpack_require__(204)); -} - -var _linkResolver; - -function _load_linkResolver() { - return _linkResolver = _interopRequireDefault(__webpack_require__(311)); -} - -var _gitlabResolver; - -function _load_gitlabResolver() { - return _gitlabResolver = _interopRequireDefault(__webpack_require__(560)); -} - -var _gistResolver; - -function _load_gistResolver() { - return _gistResolver = _interopRequireDefault(__webpack_require__(205)); -} - -var _bitbucketResolver; - -function _load_bitbucketResolver() { - return _bitbucketResolver = _interopRequireDefault(__webpack_require__(559)); -} - -var _hostedGitResolver; - -function _load_hostedGitResolver() { - return _hostedGitResolver = __webpack_require__(99); -} - -var _registryResolver; - -function _load_registryResolver() { - return _registryResolver = _interopRequireDefault(__webpack_require__(561)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var registries = exports.registries = { - npm: (_npmResolver || _load_npmResolver()).default, - yarn: (_yarnResolver || _load_yarnResolver()).default -}; - -// - -var exotics = new (_set || _load_set()).default([(_gitResolver || _load_gitResolver()).default, (_tarballResolver || _load_tarballResolver()).default, (_githubResolver || _load_githubResolver()).default, (_fileResolver || _load_fileResolver()).default, (_linkResolver || _load_linkResolver()).default, (_gitlabResolver || _load_gitlabResolver()).default, (_gistResolver || _load_gistResolver()).default, (_bitbucketResolver || _load_bitbucketResolver()).default]); - -function getExoticResolver(pattern) { - for (var _iterator = exotics, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var Resolver = _ref; - - if (Resolver.isVersion(pattern)) { - return Resolver; - } - } - return null; -} - -// - -var hostedGit = exports.hostedGit = { - github: (_githubResolver || _load_githubResolver()).default, - gitlab: (_gitlabResolver || _load_gitlabResolver()).default, - bitbucket: (_bitbucketResolver || _load_bitbucketResolver()).default -}; - -function hostedGitFragmentToGitUrl(fragment, reporter) { - for (var key in hostedGit) { - var Resolver = hostedGit[key]; - if (Resolver.isVersion(fragment)) { - return Resolver.getGitHTTPUrl((0, (_hostedGitResolver || _load_hostedGitResolver()).explodeHostedGitFragment)(fragment, reporter)); - } - } - - return fragment; -} - -// - -for (var key in registries) { - var _class, _temp; - - var RegistryResolver = registries[key]; - - exotics.add((_temp = _class = function (_ExoticRegistryResolv) { - (0, (_inherits2 || _load_inherits()).default)(_class, _ExoticRegistryResolv); - - function _class() { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, _class); - return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticRegistryResolv.apply(this, arguments)); - } - - return _class; - }((_registryResolver || _load_registryResolver()).default), _class.protocol = key, _class.factory = RegistryResolver, _temp)); -} /***/ }), -/* 76 */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } -}; - - -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(63); -var createDesc = __webpack_require__(126); -module.exports = __webpack_require__(68) ? function (object, key, value) { - return dP.f(object, key, createDesc(1, value)); -} : function (object, key, value) { - object[key] = value; - return object; -}; - - -/***/ }), -/* 78 */ -/***/ (function(module, exports, __webpack_require__) { - -try { - var util = __webpack_require__(9); - if (typeof util.inherits !== 'function') throw ''; - module.exports = util.inherits; -} catch (e) { - module.exports = __webpack_require__(746); -} - - -/***/ }), -/* 79 */ +/* 81 */ /***/ (function(module, exports, __webpack_require__) { (function(){ @@ -31116,12660 +31285,20 @@ try { }).call(this); -/***/ }), -/* 80 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return InnerSubscriber; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); -/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ - - -var InnerSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](InnerSubscriber, _super); - function InnerSubscriber(parent, outerValue, outerIndex) { - var _this = _super.call(this) || this; - _this.parent = parent; - _this.outerValue = outerValue; - _this.outerIndex = outerIndex; - _this.index = 0; - return _this; - } - InnerSubscriber.prototype._next = function (value) { - this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this); - }; - InnerSubscriber.prototype._error = function (error) { - this.parent.notifyError(error, this); - this.unsubscribe(); - }; - InnerSubscriber.prototype._complete = function () { - this.parent.notifyComplete(this); - this.unsubscribe(); - }; - return InnerSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); - -//# sourceMappingURL=InnerSubscriber.js.map - - -/***/ }), -/* 81 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = fromArray; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToArray__ = __webpack_require__(417); -/** PURE_IMPORTS_START _Observable,_Subscription,_util_subscribeToArray PURE_IMPORTS_END */ - - - -function fromArray(input, scheduler) { - if (!scheduler) { - return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToArray__["a" /* subscribeToArray */])(input)); - } - else { - return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { - var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */](); - var i = 0; - sub.add(scheduler.schedule(function () { - if (i === input.length) { - subscriber.complete(); - return; - } - subscriber.next(input[i++]); - if (!subscriber.closed) { - sub.add(this.schedule()); - } - })); - return sub; - }); - } -} -//# sourceMappingURL=fromArray.js.map - - /***/ }), /* 82 */ /***/ (function(module, exports, __webpack_require__) { -// Copyright 2015 Joyent, Inc. - -module.exports = { - read: read, - write: write -}; - -var assert = __webpack_require__(22); -var asn1 = __webpack_require__(66); -var crypto = __webpack_require__(21); -var Buffer = __webpack_require__(20).Buffer; -var algs = __webpack_require__(38); -var utils = __webpack_require__(32); -var Key = __webpack_require__(34); -var PrivateKey = __webpack_require__(39); - -var pkcs1 = __webpack_require__(267); -var pkcs8 = __webpack_require__(145); -var sshpriv = __webpack_require__(182); -var rfc4253 = __webpack_require__(92); - -var errors = __webpack_require__(69); - -/* - * For reading we support both PKCS#1 and PKCS#8. If we find a private key, - * we just take the public component of it and use that. - */ -function read(buf, options, forceType) { - var input = buf; - if (typeof (buf) !== 'string') { - assert.buffer(buf, 'buf'); - buf = buf.toString('ascii'); - } - - var lines = buf.trim().split('\n'); - - var m = lines[0].match(/*JSSTYLED*/ - /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); - assert.ok(m, 'invalid PEM header'); - - var m2 = lines[lines.length - 1].match(/*JSSTYLED*/ - /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); - assert.ok(m2, 'invalid PEM footer'); - - /* Begin and end banners must match key type */ - assert.equal(m[2], m2[2]); - var type = m[2].toLowerCase(); - - var alg; - if (m[1]) { - /* They also must match algorithms, if given */ - assert.equal(m[1], m2[1], 'PEM header and footer mismatch'); - alg = m[1].trim(); - } - - var headers = {}; - while (true) { - lines = lines.slice(1); - m = lines[0].match(/*JSSTYLED*/ - /^([A-Za-z0-9-]+): (.+)$/); - if (!m) - break; - headers[m[1].toLowerCase()] = m[2]; - } - - var cipher, key, iv; - if (headers['proc-type']) { - var parts = headers['proc-type'].split(','); - if (parts[0] === '4' && parts[1] === 'ENCRYPTED') { - if (typeof (options.passphrase) === 'string') { - options.passphrase = Buffer.from( - options.passphrase, 'utf-8'); - } - if (!Buffer.isBuffer(options.passphrase)) { - throw (new errors.KeyEncryptedError( - options.filename, 'PEM')); - } else { - parts = headers['dek-info'].split(','); - assert.ok(parts.length === 2); - cipher = parts[0].toLowerCase(); - iv = Buffer.from(parts[1], 'hex'); - key = utils.opensslKeyDeriv(cipher, iv, - options.passphrase, 1).key; - } - } - } - - /* Chop off the first and last lines */ - lines = lines.slice(0, -1).join(''); - buf = Buffer.from(lines, 'base64'); - - if (cipher && key && iv) { - var cipherStream = crypto.createDecipheriv(cipher, key, iv); - var chunk, chunks = []; - cipherStream.once('error', function (e) { - if (e.toString().indexOf('bad decrypt') !== -1) { - throw (new Error('Incorrect passphrase ' + - 'supplied, could not decrypt key')); - } - throw (e); - }); - cipherStream.write(buf); - cipherStream.end(); - while ((chunk = cipherStream.read()) !== null) - chunks.push(chunk); - buf = Buffer.concat(chunks); - } - - /* The new OpenSSH internal format abuses PEM headers */ - if (alg && alg.toLowerCase() === 'openssh') - return (sshpriv.readSSHPrivate(type, buf, options)); - if (alg && alg.toLowerCase() === 'ssh2') - return (rfc4253.readType(type, buf, options)); - - var der = new asn1.BerReader(buf); - der.originalInput = input; - - /* - * All of the PEM file types start with a sequence tag, so chop it - * off here - */ - der.readSequence(); - - /* PKCS#1 type keys name an algorithm in the banner explicitly */ - if (alg) { - if (forceType) - assert.strictEqual(forceType, 'pkcs1'); - return (pkcs1.readPkcs1(alg, type, der)); - } else { - if (forceType) - assert.strictEqual(forceType, 'pkcs8'); - return (pkcs8.readPkcs8(alg, type, der)); - } -} - -function write(key, options, type) { - assert.object(key); - - var alg = { - 'ecdsa': 'EC', - 'rsa': 'RSA', - 'dsa': 'DSA', - 'ed25519': 'EdDSA' - }[key.type]; - var header; - - var der = new asn1.BerWriter(); - - if (PrivateKey.isPrivateKey(key)) { - if (type && type === 'pkcs8') { - header = 'PRIVATE KEY'; - pkcs8.writePkcs8(der, key); - } else { - if (type) - assert.strictEqual(type, 'pkcs1'); - header = alg + ' PRIVATE KEY'; - pkcs1.writePkcs1(der, key); - } - - } else if (Key.isKey(key)) { - if (type && type === 'pkcs1') { - header = alg + ' PUBLIC KEY'; - pkcs1.writePkcs1(der, key); - } else { - if (type) - assert.strictEqual(type, 'pkcs8'); - header = 'PUBLIC KEY'; - pkcs8.writePkcs8(der, key); - } - - } else { - throw (new Error('key is not a Key or PrivateKey')); - } - - var tmp = der.buffer.toString('base64'); - var len = tmp.length + (tmp.length / 64) + - 18 + 16 + header.length*2 + 10; - var buf = Buffer.alloc(len); - var o = 0; - o += buf.write('-----BEGIN ' + header + '-----\n', o); - for (var i = 0; i < tmp.length; ) { - var limit = i + 64; - if (limit > tmp.length) - limit = tmp.length; - o += buf.write(tmp.slice(i, limit), o); - buf[o++] = 10; - i = limit; - } - o += buf.write('-----END ' + header + '-----\n', o); - - return (buf.slice(0, o)); -} - - -/***/ }), -/* 83 */ -/***/ (function(module, exports) { - -module.exports = require("http"); - -/***/ }), -/* 84 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SCOPE_SEPARATOR = undefined; - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(13); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _npmResolver; - -function _load_npmResolver() { - return _npmResolver = _interopRequireDefault(__webpack_require__(206)); -} - -var _envReplace; - -function _load_envReplace() { - return _envReplace = _interopRequireDefault(__webpack_require__(565)); -} - -var _baseRegistry; - -function _load_baseRegistry() { - return _baseRegistry = _interopRequireDefault(__webpack_require__(546)); -} - -var _misc; - -function _load_misc() { - return _misc = __webpack_require__(28); -} - -var _path; - -function _load_path() { - return _path = __webpack_require__(320); -} - -var _normalizeUrl; - -function _load_normalizeUrl() { - return _normalizeUrl = _interopRequireDefault(__webpack_require__(372)); -} - -var _userHomeDir; - -function _load_userHomeDir() { - return _userHomeDir = _interopRequireDefault(__webpack_require__(101)); -} - -var _userHomeDir2; - -function _load_userHomeDir2() { - return _userHomeDir2 = __webpack_require__(101); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _login; - -function _load_login() { - return _login = __webpack_require__(97); -} - -var _path2; - -function _load_path2() { - return _path2 = _interopRequireDefault(__webpack_require__(1)); -} - -var _url; - -function _load_url() { - return _url = _interopRequireDefault(__webpack_require__(29)); -} - -var _ini; - -function _load_ini() { - return _ini = _interopRequireDefault(__webpack_require__(747)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var DEFAULT_REGISTRY = 'https://registry.npmjs.org/'; -var REGEX_REGISTRY_ENFORCED_HTTPS = /^https?:\/\/([^\/]+\.)?(yarnpkg\.com|npmjs\.(org|com))(\/|$)/; -var REGEX_REGISTRY_HTTP_PROTOCOL = /^https?:/i; -var REGEX_REGISTRY_PREFIX = /^(https?:)?\/\//i; -var REGEX_REGISTRY_SUFFIX = /registry\/?$/; - -var SCOPE_SEPARATOR = exports.SCOPE_SEPARATOR = '%2f'; -// All scoped package names are of the format `@scope%2fpkg` from the use of NpmRegistry.escapeName -// `(?:^|\/)` Match either the start of the string or a `/` but don't capture -// `[^\/?]+?` Match any character that is not '/' or '?' and capture, up until the first occurrence of: -// `(?=%2f|\/)` Match SCOPE_SEPARATOR, the escaped '/', or a raw `/` and don't capture -// The reason for matching a plain `/` is NPM registry being inconsistent about escaping `/` in -// scoped package names: when you're fetching a tarball, it is not escaped, when you want info -// about the package, it is escaped. -var SCOPED_PKG_REGEXP = /(?:^|\/)(@[^\/?]+?)(?=%2f|\/)/; - -// TODO: Use the method from src/cli/commands/global.js for this instead -function getGlobalPrefix() { - if (process.env.PREFIX) { - return process.env.PREFIX; - } else if (process.platform === 'win32') { - // c:\node\node.exe --> prefix=c:\node\ - return (_path2 || _load_path2()).default.dirname(process.execPath); - } else { - // /usr/local/bin/node --> prefix=/usr/local - var prefix = (_path2 || _load_path2()).default.dirname((_path2 || _load_path2()).default.dirname(process.execPath)); - - // destdir only is respected on Unix - if (process.env.DESTDIR) { - prefix = (_path2 || _load_path2()).default.join(process.env.DESTDIR, prefix); - } - - return prefix; - } -} - -var PATH_CONFIG_OPTIONS = new (_set || _load_set()).default(['cache', 'cafile', 'prefix', 'userconfig']); - -function isPathConfigOption(key) { - return PATH_CONFIG_OPTIONS.has(key); -} - -function normalizePath(val) { - if (val === undefined) { - return undefined; - } - - if (typeof val !== 'string') { - val = String(val); - } - - return (0, (_path || _load_path()).resolveWithHome)(val); -} - -function urlParts(requestUrl) { - var normalizedUrl = (0, (_normalizeUrl || _load_normalizeUrl()).default)(requestUrl); - var parsed = (_url || _load_url()).default.parse(normalizedUrl); - var host = parsed.host || ''; - var path = parsed.path || ''; - return { host, path }; -} - -var NpmRegistry = function (_Registry) { - (0, (_inherits2 || _load_inherits()).default)(NpmRegistry, _Registry); - - function NpmRegistry(cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NpmRegistry); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Registry.call(this, cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles)); - - _this.folder = 'node_modules'; - return _this; - } - - NpmRegistry.escapeName = function escapeName(name) { - // scoped packages contain slashes and the npm registry expects them to be escaped - return name.replace('/', SCOPE_SEPARATOR); - }; - - NpmRegistry.prototype.isScopedPackage = function isScopedPackage(packageIdent) { - return SCOPED_PKG_REGEXP.test(packageIdent); - }; - - NpmRegistry.prototype.getRequestUrl = function getRequestUrl(registry, pathname) { - var resolved = pathname; - - if (!REGEX_REGISTRY_PREFIX.test(pathname)) { - resolved = (_url || _load_url()).default.resolve((0, (_misc || _load_misc()).addSuffix)(registry, '/'), pathname); - } - - if (REGEX_REGISTRY_ENFORCED_HTTPS.test(resolved)) { - resolved = resolved.replace(/^http:\/\//, 'https://'); - } - - return resolved; - }; - - NpmRegistry.prototype.isRequestToRegistry = function isRequestToRegistry(requestUrl, registryUrl) { - var request = urlParts(requestUrl); - var registry = urlParts(registryUrl); - var customHostSuffix = this.getRegistryOrGlobalOption(registryUrl, 'custom-host-suffix'); - - var requestToRegistryHost = request.host === registry.host; - var requestToYarn = (_constants || _load_constants()).YARN_REGISTRY.indexOf(request.host) !== -1 && DEFAULT_REGISTRY.indexOf(registry.host) !== -1; - var requestToRegistryPath = request.path.startsWith(registry.path); - // For some registries, the package path does not prefix with the registry path - var customHostSuffixInUse = typeof customHostSuffix === 'string' && request.host.endsWith(customHostSuffix); - - return (requestToRegistryHost || requestToYarn) && (requestToRegistryPath || customHostSuffixInUse); - }; - - NpmRegistry.prototype.request = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pathname) { - var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var packageName = arguments[2]; - - // packageName needs to be escaped when if it is passed - var packageIdent = packageName && NpmRegistry.escapeName(packageName) || pathname; - var registry = opts.registry || this.getRegistry(packageIdent); - var requestUrl = this.getRequestUrl(registry, pathname); - - var alwaysAuth = this.getRegistryOrGlobalOption(registry, 'always-auth'); - - var headers = (0, (_extends2 || _load_extends()).default)({ - Accept: - // This is to use less bandwidth unless we really need to get the full response. - // See https://github.com/npm/npm-registry-client#requests - opts.unfiltered ? 'application/json' : 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' - }, opts.headers); - - var isToRegistry = this.isRequestToRegistry(requestUrl, registry) || this.requestNeedsAuth(requestUrl); - - // this.token must be checked to account for publish requests on non-scoped packages - if (this.token || isToRegistry && (alwaysAuth || this.isScopedPackage(packageIdent))) { - var authorization = this.getAuth(packageIdent); - if (authorization) { - headers.authorization = authorization; - } - } - - if (this.otp) { - headers['npm-otp'] = this.otp; - } - - try { - return yield this.requestManager.request({ - url: requestUrl, - method: opts.method, - body: opts.body, - auth: opts.auth, - headers, - json: !opts.buffer, - buffer: opts.buffer, - process: opts.process, - gzip: true - }); - } catch (error) { - if (error instanceof (_errors || _load_errors()).OneTimePasswordError) { - if (this.otp) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('incorrectOneTimePassword')); - } - - this.reporter.info(this.reporter.lang('twoFactorAuthenticationEnabled')); - this.otp = yield (0, (_login || _load_login()).getOneTimePassword)(this.reporter); - - this.requestManager.clearCache(); - - return this.request(pathname, opts, packageName); - } else { - throw error; - } - } - }); - - function request(_x) { - return _ref.apply(this, arguments); - } - - return request; - }(); - - NpmRegistry.prototype.requestNeedsAuth = function requestNeedsAuth(requestUrl) { - var config = this.config; - var requestParts = urlParts(requestUrl); - return !!(0, (_keys || _load_keys()).default)(config).find(function (option) { - var parts = option.split(':'); - if (parts.length === 2 && parts[1] === '_authToken' || parts[1] === '_password') { - var registryParts = urlParts(parts[0]); - if (requestParts.host === registryParts.host && requestParts.path.startsWith(registryParts.path)) { - return true; - } - } - return false; - }); - }; - - NpmRegistry.prototype.checkOutdated = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, name, range) { - var escapedName = NpmRegistry.escapeName(name); - var req = yield this.request(escapedName, { unfiltered: true }); - if (!req) { - throw new Error(`couldn't find ${name}`); - } - - // By default use top level 'repository' and 'homepage' values - var repository = req.repository, - homepage = req.homepage; - - var wantedPkg = yield (_npmResolver || _load_npmResolver()).default.findVersionInRegistryResponse(config, escapedName, range, req); - - // But some local repositories like Verdaccio do not return 'repository' nor 'homepage' - // in top level data structure, so we fallback to wanted package manifest - if (!repository && !homepage) { - repository = wantedPkg.repository; - homepage = wantedPkg.homepage; - } - - var latest = req['dist-tags'].latest; - // In certain cases, registries do not return a 'latest' tag. - if (!latest) { - latest = wantedPkg.version; - } - - var url = homepage || repository && repository.url || ''; - - return { - latest, - wanted: wantedPkg.version, - url - }; - }); - - function checkOutdated(_x3, _x4, _x5) { - return _ref2.apply(this, arguments); - } - - return checkOutdated; - }(); - - NpmRegistry.prototype.getPossibleConfigLocations = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, reporter) { - var possibles = []; - - for (var _iterator = this.extraneousRcFiles.slice().reverse(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref4; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref4 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref4 = _i.value; - } - - var rcFile = _ref4; - - possibles.push([false, (_path2 || _load_path2()).default.resolve(process.cwd(), rcFile)]); - } - - if (this.enableDefaultRc) { - // npmrc --> ./.npmrc, ~/.npmrc, ${prefix}/etc/npmrc - var localfile = '.' + filename; - possibles = possibles.concat([[false, (_path2 || _load_path2()).default.join(this.cwd, localfile)], [true, this.config.userconfig || (_path2 || _load_path2()).default.join((_userHomeDir || _load_userHomeDir()).default, localfile)], [false, (_path2 || _load_path2()).default.join(getGlobalPrefix(), 'etc', filename)]]); - - // When home directory for global install is different from where $HOME/npmrc is stored, - // E.g. /usr/local/share vs /root on linux machines, check the additional location - if ((_userHomeDir2 || _load_userHomeDir2()).home !== (_userHomeDir || _load_userHomeDir()).default) { - possibles.push([true, (_path2 || _load_path2()).default.join((_userHomeDir2 || _load_userHomeDir2()).home, localfile)]); - } - - // npmrc --> ../.npmrc, ../../.npmrc, etc. - var foldersFromRootToCwd = (0, (_path || _load_path()).getPosixPath)(this.cwd).split('/'); - while (foldersFromRootToCwd.length > 1) { - possibles.push([false, (_path2 || _load_path2()).default.join(foldersFromRootToCwd.join((_path2 || _load_path2()).default.sep), localfile)]); - foldersFromRootToCwd.pop(); - } - } - - var actuals = []; - for (var _iterator2 = possibles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref6; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref6 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref6 = _i2.value; - } - - var _ref5 = _ref6; - var isHome = _ref5[0]; - var loc = _ref5[1]; - - reporter.verbose(reporter.lang('configPossibleFile', loc)); - if (yield (_fs || _load_fs()).exists(loc)) { - reporter.verbose(reporter.lang('configFileFound', loc)); - actuals.push([isHome, loc, yield (_fs || _load_fs()).readFile(loc)]); - } - } - - return actuals; - }); - - function getPossibleConfigLocations(_x6, _x7) { - return _ref3.apply(this, arguments); - } - - return getPossibleConfigLocations; - }(); - - NpmRegistry.getConfigEnv = function getConfigEnv() { - var env = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : process.env; - - // To match NPM's behavior, HOME is always the user's home directory. - var overrideEnv = { - HOME: (_userHomeDir2 || _load_userHomeDir2()).home - }; - return (0, (_assign || _load_assign()).default)({}, env, overrideEnv); - }; - - NpmRegistry.normalizeConfig = function normalizeConfig(config) { - var env = NpmRegistry.getConfigEnv(); - config = (_baseRegistry || _load_baseRegistry()).default.normalizeConfig(config); - - for (var key in config) { - config[key] = (0, (_envReplace || _load_envReplace()).default)(config[key], env); - if (isPathConfigOption(key)) { - config[key] = normalizePath(config[key]); - } - } - - return config; - }; - - NpmRegistry.prototype.loadConfig = function () { - var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // docs: https://docs.npmjs.com/misc/config - this.mergeEnv('npm_config_'); - - for (var _iterator3 = yield this.getPossibleConfigLocations('npmrc', this.reporter), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref9; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref9 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref9 = _i3.value; - } - - var _ref8 = _ref9; - var loc = _ref8[1]; - var file = _ref8[2]; - - var config = NpmRegistry.normalizeConfig((_ini || _load_ini()).default.parse(file)); - - // normalize offline mirror path relative to the current npmrc - var offlineLoc = config['yarn-offline-mirror']; - // don't normalize if we already have a mirror path - if (!this.config['yarn-offline-mirror'] && offlineLoc) { - var mirrorLoc = config['yarn-offline-mirror'] = (_path2 || _load_path2()).default.resolve((_path2 || _load_path2()).default.dirname(loc), offlineLoc); - yield (_fs || _load_fs()).mkdirp(mirrorLoc); - } - - this.config = (0, (_assign || _load_assign()).default)({}, config, this.config); - } - }); - - function loadConfig() { - return _ref7.apply(this, arguments); - } - - return loadConfig; - }(); - - NpmRegistry.prototype.getScope = function getScope(packageIdent) { - var match = packageIdent.match(SCOPED_PKG_REGEXP); - return match && match[1] || ''; - }; - - NpmRegistry.prototype.getRegistry = function getRegistry(packageIdent) { - // Try extracting registry from the url, then scoped registry, and default registry - if (packageIdent.match(REGEX_REGISTRY_PREFIX)) { - var availableRegistries = this.getAvailableRegistries(); - var registry = availableRegistries.find(function (registry) { - return packageIdent.startsWith(registry); - }); - if (registry) { - return String(registry); - } - } - - var _arr = [this.getScope(packageIdent), '']; - for (var _i4 = 0; _i4 < _arr.length; _i4++) { - var scope = _arr[_i4]; - var _registry = this.getScopedOption(scope, 'registry') || this.registries.yarn.getScopedOption(scope, 'registry'); - if (_registry) { - return String(_registry); - } - } - - return DEFAULT_REGISTRY; - }; - - NpmRegistry.prototype.getAuthByRegistry = function getAuthByRegistry(registry) { - // Check for bearer token. - var authToken = this.getRegistryOrGlobalOption(registry, '_authToken'); - if (authToken) { - return `Bearer ${String(authToken)}`; - } - - // Check for basic auth token. - var auth = this.getRegistryOrGlobalOption(registry, '_auth'); - if (auth) { - return `Basic ${String(auth)}`; - } - - // Check for basic username/password auth. - var username = this.getRegistryOrGlobalOption(registry, 'username'); - var password = this.getRegistryOrGlobalOption(registry, '_password'); - if (username && password) { - var pw = Buffer.from(String(password), 'base64').toString(); - return 'Basic ' + Buffer.from(String(username) + ':' + pw).toString('base64'); - } - - return ''; - }; - - NpmRegistry.prototype.getAuth = function getAuth(packageIdent) { - if (this.token) { - return this.token; - } - - var baseRegistry = this.getRegistry(packageIdent); - var registries = [baseRegistry]; - - // If sending a request to the Yarn registry, we must also send it the auth token for the npm registry - if (baseRegistry === (_constants || _load_constants()).YARN_REGISTRY) { - registries.push(DEFAULT_REGISTRY); - } - - for (var _iterator4 = registries, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref10; - - if (_isArray4) { - if (_i5 >= _iterator4.length) break; - _ref10 = _iterator4[_i5++]; - } else { - _i5 = _iterator4.next(); - if (_i5.done) break; - _ref10 = _i5.value; - } - - var registry = _ref10; - - var auth = this.getAuthByRegistry(registry); - - if (auth) { - return auth; - } - } - - return ''; - }; - - NpmRegistry.prototype.getScopedOption = function getScopedOption(scope, option) { - return this.getOption(scope + (scope ? ':' : '') + option); - }; - - NpmRegistry.prototype.getRegistryOption = function getRegistryOption(registry, option) { - var pre = REGEX_REGISTRY_HTTP_PROTOCOL; - var suf = REGEX_REGISTRY_SUFFIX; - - // When registry is used config scope, the trailing '/' is required - var reg = (0, (_misc || _load_misc()).addSuffix)(registry, '/'); - - // 1st attempt, try to get option for the given registry URL - // 2nd attempt, remove the 'https?:' prefix of the registry URL - // 3nd attempt, remove the 'registry/?' suffix of the registry URL - return this.getScopedOption(reg, option) || pre.test(reg) && this.getRegistryOption(reg.replace(pre, ''), option) || suf.test(reg) && this.getRegistryOption(reg.replace(suf, ''), option); - }; - - NpmRegistry.prototype.getRegistryOrGlobalOption = function getRegistryOrGlobalOption(registry, option) { - return this.getRegistryOption(registry, option) || this.getOption(option); - }; - - return NpmRegistry; -}((_baseRegistry || _load_baseRegistry()).default); - -NpmRegistry.filename = 'package.json'; -exports.default = NpmRegistry; - -/***/ }), -/* 85 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -var _baseResolver; - -function _load_baseResolver() { - return _baseResolver = _interopRequireDefault(__webpack_require__(117)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ExoticResolver = function (_BaseResolver) { - (0, (_inherits2 || _load_inherits()).default)(ExoticResolver, _BaseResolver); - - function ExoticResolver() { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ExoticResolver); - return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseResolver.apply(this, arguments)); - } - - ExoticResolver.isVersion = function isVersion(pattern) { - var proto = this.protocol; - if (proto) { - return pattern.startsWith(`${proto}:`); - } else { - throw new Error('No protocol specified'); - } - }; - - return ExoticResolver; -}((_baseResolver || _load_baseResolver()).default); - -exports.default = ExoticResolver; - -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -exports.wait = wait; -exports.promisify = promisify; -exports.queue = queue; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function wait(delay) { - return new (_promise || _load_promise()).default(function (resolve) { - setTimeout(resolve, delay); - }); -} - -function promisify(fn, firstData) { - return function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return new (_promise || _load_promise()).default(function (resolve, reject) { - args.push(function (err) { - for (var _len2 = arguments.length, result = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - result[_key2 - 1] = arguments[_key2]; - } - - var res = result; - - if (result.length <= 1) { - res = result[0]; - } - - if (firstData) { - res = err; - err = null; - } - - if (err) { - reject(err); - } else { - resolve(res); - } - }); - - fn.apply(null, args); - }); - }; -} - -function queue(arr, promiseProducer) { - var concurrency = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity; - - concurrency = Math.min(concurrency, arr.length); - - // clone - arr = arr.slice(); - - var results = []; - var total = arr.length; - if (!total) { - return (_promise || _load_promise()).default.resolve(results); - } - - return new (_promise || _load_promise()).default(function (resolve, reject) { - for (var i = 0; i < concurrency; i++) { - next(); - } - - function next() { - var item = arr.shift(); - var promise = promiseProducer(item); - - promise.then(function (result) { - results.push(result); - - total--; - if (total === 0) { - resolve(results); - } else { - if (arr.length) { - next(); - } - } - }, reject); - } - }); -} - -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _normalizePattern2; - -function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(52); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var semver = __webpack_require__(27); - -var WorkspaceLayout = function () { - function WorkspaceLayout(workspaces, config) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, WorkspaceLayout); - - this.workspaces = workspaces; - this.config = config; - } - - WorkspaceLayout.prototype.getWorkspaceManifest = function getWorkspaceManifest(key) { - return this.workspaces[key]; - }; - - WorkspaceLayout.prototype.getManifestByPattern = function getManifestByPattern(pattern) { - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern), - name = _normalizePattern.name, - range = _normalizePattern.range; - - var workspace = this.getWorkspaceManifest(name); - if (!workspace || !semver.satisfies(workspace.manifest.version, range, this.config.looseSemver)) { - return null; - } - return workspace; - }; - - return WorkspaceLayout; -}(); - -exports.default = WorkspaceLayout; - -/***/ }), -/* 88 */ -/***/ (function(module, exports) { - -module.exports = function (it) { - if (typeof it != 'function') throw TypeError(it + ' is not a function!'); - return it; -}; - - -/***/ }), -/* 89 */ -/***/ (function(module, exports) { - -var hasOwnProperty = {}.hasOwnProperty; -module.exports = function (it, key) { - return hasOwnProperty.call(it, key); -}; - - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = __webpack_require__(221); -var defined = __webpack_require__(218); -module.exports = function (it) { - return IObject(defined(it)); -}; - - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -var Stream = __webpack_require__(35); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; - exports = module.exports = Stream.Readable; - exports.Readable = Stream.Readable; - exports.Writable = Stream.Writable; - exports.Duplex = Stream.Duplex; - exports.Transform = Stream.Transform; - exports.PassThrough = Stream.PassThrough; - exports.Stream = Stream; -} else { - exports = module.exports = __webpack_require__(376); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = __webpack_require__(378); - exports.Duplex = __webpack_require__(109); - exports.Transform = __webpack_require__(377); - exports.PassThrough = __webpack_require__(864); -} - - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = { - read: read.bind(undefined, false, undefined), - readType: read.bind(undefined, false), - write: write, - /* semi-private api, used by sshpk-agent */ - readPartial: read.bind(undefined, true), - - /* shared with ssh format */ - readInternal: read, - keyTypeToAlg: keyTypeToAlg, - algToKeyType: algToKeyType -}; - -var assert = __webpack_require__(22); -var Buffer = __webpack_require__(20).Buffer; -var algs = __webpack_require__(38); -var utils = __webpack_require__(32); -var Key = __webpack_require__(34); -var PrivateKey = __webpack_require__(39); -var SSHBuffer = __webpack_require__(147); - -function algToKeyType(alg) { - assert.string(alg); - if (alg === 'ssh-dss') - return ('dsa'); - else if (alg === 'ssh-rsa') - return ('rsa'); - else if (alg === 'ssh-ed25519') - return ('ed25519'); - else if (alg === 'ssh-curve25519') - return ('curve25519'); - else if (alg.match(/^ecdsa-sha2-/)) - return ('ecdsa'); - else - throw (new Error('Unknown algorithm ' + alg)); -} - -function keyTypeToAlg(key) { - assert.object(key); - if (key.type === 'dsa') - return ('ssh-dss'); - else if (key.type === 'rsa') - return ('ssh-rsa'); - else if (key.type === 'ed25519') - return ('ssh-ed25519'); - else if (key.type === 'curve25519') - return ('ssh-curve25519'); - else if (key.type === 'ecdsa') - return ('ecdsa-sha2-' + key.part.curve.data.toString()); - else - throw (new Error('Unknown key type ' + key.type)); -} - -function read(partial, type, buf, options) { - if (typeof (buf) === 'string') - buf = Buffer.from(buf); - assert.buffer(buf, 'buf'); - - var key = {}; - - var parts = key.parts = []; - var sshbuf = new SSHBuffer({buffer: buf}); - - var alg = sshbuf.readString(); - assert.ok(!sshbuf.atEnd(), 'key must have at least one part'); - - key.type = algToKeyType(alg); - - var partCount = algs.info[key.type].parts.length; - if (type && type === 'private') - partCount = algs.privInfo[key.type].parts.length; - - while (!sshbuf.atEnd() && parts.length < partCount) - parts.push(sshbuf.readPart()); - while (!partial && !sshbuf.atEnd()) - parts.push(sshbuf.readPart()); - - assert.ok(parts.length >= 1, - 'key must have at least one part'); - assert.ok(partial || sshbuf.atEnd(), - 'leftover bytes at end of key'); - - var Constructor = Key; - var algInfo = algs.info[key.type]; - if (type === 'private' || algInfo.parts.length !== parts.length) { - algInfo = algs.privInfo[key.type]; - Constructor = PrivateKey; - } - assert.strictEqual(algInfo.parts.length, parts.length); - - if (key.type === 'ecdsa') { - var res = /^ecdsa-sha2-(.+)$/.exec(alg); - assert.ok(res !== null); - assert.strictEqual(res[1], parts[0].data.toString()); - } - - var normalized = true; - for (var i = 0; i < algInfo.parts.length; ++i) { - var p = parts[i]; - p.name = algInfo.parts[i]; - /* - * OpenSSH stores ed25519 "private" keys as seed + public key - * concat'd together (k followed by A). We want to keep them - * separate for other formats that don't do this. - */ - if (key.type === 'ed25519' && p.name === 'k') - p.data = p.data.slice(0, 32); - - if (p.name !== 'curve' && algInfo.normalize !== false) { - var nd; - if (key.type === 'ed25519') { - nd = utils.zeroPadToLength(p.data, 32); - } else { - nd = utils.mpNormalize(p.data); - } - if (nd.toString('binary') !== - p.data.toString('binary')) { - p.data = nd; - normalized = false; - } - } - } - - if (normalized) - key._rfc4253Cache = sshbuf.toBuffer(); - - if (partial && typeof (partial) === 'object') { - partial.remainder = sshbuf.remainder(); - partial.consumed = sshbuf._offset; - } - - return (new Constructor(key)); -} - -function write(key, options) { - assert.object(key); - - var alg = keyTypeToAlg(key); - var i; - - var algInfo = algs.info[key.type]; - if (PrivateKey.isPrivateKey(key)) - algInfo = algs.privInfo[key.type]; - var parts = algInfo.parts; - - var buf = new SSHBuffer({}); - - buf.writeString(alg); - - for (i = 0; i < parts.length; ++i) { - var data = key.part[parts[i]].data; - if (algInfo.normalize !== false) { - if (key.type === 'ed25519') - data = utils.zeroPadToLength(data, 32); - else - data = utils.mpNormalize(data); - } - if (key.type === 'ed25519' && parts[i] === 'k') - data = Buffer.concat([data, key.part.A.data]); - buf.writeBuffer(data); - } - - return (buf.toBuffer()); -} - - -/***/ }), -/* 93 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -const Buffer = __webpack_require__(59).Buffer - -const crypto = __webpack_require__(21) -const Transform = __webpack_require__(35).Transform - -const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512'] - -const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i -const SRI_REGEX = /^([^-]+)-([^?]+)([?\S*]*)$/ -const STRICT_SRI_REGEX = /^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/ -const VCHAR_REGEX = /^[\x21-\x7E]+$/ - -class Hash { - get isHash () { return true } - constructor (hash, opts) { - const strict = !!(opts && opts.strict) - this.source = hash.trim() - // 3.1. Integrity metadata (called "Hash" by ssri) - // https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description - const match = this.source.match( - strict - ? STRICT_SRI_REGEX - : SRI_REGEX - ) - if (!match) { return } - if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { return } - this.algorithm = match[1] - this.digest = match[2] - - const rawOpts = match[3] - this.options = rawOpts ? rawOpts.slice(1).split('?') : [] - } - hexDigest () { - return this.digest && Buffer.from(this.digest, 'base64').toString('hex') - } - toJSON () { - return this.toString() - } - toString (opts) { - if (opts && opts.strict) { - // Strict mode enforces the standard as close to the foot of the - // letter as it can. - if (!( - // The spec has very restricted productions for algorithms. - // https://www.w3.org/TR/CSP2/#source-list-syntax - SPEC_ALGORITHMS.some(x => x === this.algorithm) && - // Usually, if someone insists on using a "different" base64, we - // leave it as-is, since there's multiple standards, and the - // specified is not a URL-safe variant. - // https://www.w3.org/TR/CSP2/#base64_value - this.digest.match(BASE64_REGEX) && - // Option syntax is strictly visual chars. - // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-option-expression - // https://tools.ietf.org/html/rfc5234#appendix-B.1 - (this.options || []).every(opt => opt.match(VCHAR_REGEX)) - )) { - return '' - } - } - const options = this.options && this.options.length - ? `?${this.options.join('?')}` - : '' - return `${this.algorithm}-${this.digest}${options}` - } -} - -class Integrity { - get isIntegrity () { return true } - toJSON () { - return this.toString() - } - toString (opts) { - opts = opts || {} - let sep = opts.sep || ' ' - if (opts.strict) { - // Entries must be separated by whitespace, according to spec. - sep = sep.replace(/\S+/g, ' ') - } - return Object.keys(this).map(k => { - return this[k].map(hash => { - return Hash.prototype.toString.call(hash, opts) - }).filter(x => x.length).join(sep) - }).filter(x => x.length).join(sep) - } - concat (integrity, opts) { - const other = typeof integrity === 'string' - ? integrity - : stringify(integrity, opts) - return parse(`${this.toString(opts)} ${other}`, opts) - } - hexDigest () { - return parse(this, {single: true}).hexDigest() - } - match (integrity, opts) { - const other = parse(integrity, opts) - const algo = other.pickAlgorithm(opts) - return ( - this[algo] && - other[algo] && - this[algo].find(hash => - other[algo].find(otherhash => - hash.digest === otherhash.digest - ) - ) - ) || false - } - pickAlgorithm (opts) { - const pickAlgorithm = (opts && opts.pickAlgorithm) || getPrioritizedHash - const keys = Object.keys(this) - if (!keys.length) { - throw new Error(`No algorithms available for ${ - JSON.stringify(this.toString()) - }`) - } - return keys.reduce((acc, algo) => { - return pickAlgorithm(acc, algo) || acc - }) - } -} - -module.exports.parse = parse -function parse (sri, opts) { - opts = opts || {} - if (typeof sri === 'string') { - return _parse(sri, opts) - } else if (sri.algorithm && sri.digest) { - const fullSri = new Integrity() - fullSri[sri.algorithm] = [sri] - return _parse(stringify(fullSri, opts), opts) - } else { - return _parse(stringify(sri, opts), opts) - } -} - -function _parse (integrity, opts) { - // 3.4.3. Parse metadata - // https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata - if (opts.single) { - return new Hash(integrity, opts) - } - return integrity.trim().split(/\s+/).reduce((acc, string) => { - const hash = new Hash(string, opts) - if (hash.algorithm && hash.digest) { - const algo = hash.algorithm - if (!acc[algo]) { acc[algo] = [] } - acc[algo].push(hash) - } - return acc - }, new Integrity()) -} - -module.exports.stringify = stringify -function stringify (obj, opts) { - if (obj.algorithm && obj.digest) { - return Hash.prototype.toString.call(obj, opts) - } else if (typeof obj === 'string') { - return stringify(parse(obj, opts), opts) - } else { - return Integrity.prototype.toString.call(obj, opts) - } -} - -module.exports.fromHex = fromHex -function fromHex (hexDigest, algorithm, opts) { - const optString = (opts && opts.options && opts.options.length) - ? `?${opts.options.join('?')}` - : '' - return parse( - `${algorithm}-${ - Buffer.from(hexDigest, 'hex').toString('base64') - }${optString}`, opts - ) -} - -module.exports.fromData = fromData -function fromData (data, opts) { - opts = opts || {} - const algorithms = opts.algorithms || ['sha512'] - const optString = opts.options && opts.options.length - ? `?${opts.options.join('?')}` - : '' - return algorithms.reduce((acc, algo) => { - const digest = crypto.createHash(algo).update(data).digest('base64') - const hash = new Hash( - `${algo}-${digest}${optString}`, - opts - ) - if (hash.algorithm && hash.digest) { - const algo = hash.algorithm - if (!acc[algo]) { acc[algo] = [] } - acc[algo].push(hash) - } - return acc - }, new Integrity()) -} - -module.exports.fromStream = fromStream -function fromStream (stream, opts) { - opts = opts || {} - const P = opts.Promise || Promise - const istream = integrityStream(opts) - return new P((resolve, reject) => { - stream.pipe(istream) - stream.on('error', reject) - istream.on('error', reject) - let sri - istream.on('integrity', s => { sri = s }) - istream.on('end', () => resolve(sri)) - istream.on('data', () => {}) - }) -} - -module.exports.checkData = checkData -function checkData (data, sri, opts) { - opts = opts || {} - sri = parse(sri, opts) - if (!Object.keys(sri).length) { - if (opts.error) { - throw Object.assign( - new Error('No valid integrity hashes to check against'), { - code: 'EINTEGRITY' - } - ) - } else { - return false - } - } - const algorithm = sri.pickAlgorithm(opts) - const digest = crypto.createHash(algorithm).update(data).digest('base64') - const newSri = parse({algorithm, digest}) - const match = newSri.match(sri, opts) - if (match || !opts.error) { - return match - } else if (typeof opts.size === 'number' && (data.length !== opts.size)) { - const err = new Error(`data size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${data.length}`) - err.code = 'EBADSIZE' - err.found = data.length - err.expected = opts.size - err.sri = sri - throw err - } else { - const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`) - err.code = 'EINTEGRITY' - err.found = newSri - err.expected = sri - err.algorithm = algorithm - err.sri = sri - throw err - } -} - -module.exports.checkStream = checkStream -function checkStream (stream, sri, opts) { - opts = opts || {} - const P = opts.Promise || Promise - const checker = integrityStream(Object.assign({}, opts, { - integrity: sri - })) - return new P((resolve, reject) => { - stream.pipe(checker) - stream.on('error', reject) - checker.on('error', reject) - let sri - checker.on('verified', s => { sri = s }) - checker.on('end', () => resolve(sri)) - checker.on('data', () => {}) - }) -} - -module.exports.integrityStream = integrityStream -function integrityStream (opts) { - opts = opts || {} - // For verification - const sri = opts.integrity && parse(opts.integrity, opts) - const goodSri = sri && Object.keys(sri).length - const algorithm = goodSri && sri.pickAlgorithm(opts) - const digests = goodSri && sri[algorithm] - // Calculating stream - const algorithms = Array.from( - new Set( - (opts.algorithms || ['sha512']) - .concat(algorithm ? [algorithm] : []) - ) - ) - const hashes = algorithms.map(crypto.createHash) - let streamSize = 0 - const stream = new Transform({ - transform (chunk, enc, cb) { - streamSize += chunk.length - hashes.forEach(h => h.update(chunk, enc)) - cb(null, chunk, enc) - } - }).on('end', () => { - const optString = (opts.options && opts.options.length) - ? `?${opts.options.join('?')}` - : '' - const newSri = parse(hashes.map((h, i) => { - return `${algorithms[i]}-${h.digest('base64')}${optString}` - }).join(' '), opts) - // Integrity verification mode - const match = goodSri && newSri.match(sri, opts) - if (typeof opts.size === 'number' && streamSize !== opts.size) { - const err = new Error(`stream size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${streamSize}`) - err.code = 'EBADSIZE' - err.found = streamSize - err.expected = opts.size - err.sri = sri - stream.emit('error', err) - } else if (opts.integrity && !match) { - const err = new Error(`${sri} integrity checksum failed when using ${algorithm}: wanted ${digests} but got ${newSri}. (${streamSize} bytes)`) - err.code = 'EINTEGRITY' - err.found = newSri - err.expected = digests - err.algorithm = algorithm - err.sri = sri - stream.emit('error', err) - } else { - stream.emit('size', streamSize) - stream.emit('integrity', newSri) - match && stream.emit('verified', match) - } - }) - return stream -} - -module.exports.create = createIntegrity -function createIntegrity (opts) { - opts = opts || {} - const algorithms = opts.algorithms || ['sha512'] - const optString = opts.options && opts.options.length - ? `?${opts.options.join('?')}` - : '' - - const hashes = algorithms.map(crypto.createHash) - - return { - update: function (chunk, enc) { - hashes.forEach(h => h.update(chunk, enc)) - return this - }, - digest: function (enc) { - const integrity = algorithms.reduce((acc, algo) => { - const digest = hashes.shift().digest('base64') - const hash = new Hash( - `${algo}-${digest}${optString}`, - opts - ) - if (hash.algorithm && hash.digest) { - const algo = hash.algorithm - if (!acc[algo]) { acc[algo] = [] } - acc[algo].push(hash) - } - return acc - }, new Integrity()) - - return integrity - } - } -} - -const NODE_HASHES = new Set(crypto.getHashes()) - -// This is a Best Effort™ at a reasonable priority for hash algos -const DEFAULT_PRIORITY = [ - 'md5', 'whirlpool', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', - // TODO - it's unclear _which_ of these Node will actually use as its name - // for the algorithm, so we guesswork it based on the OpenSSL names. - 'sha3', - 'sha3-256', 'sha3-384', 'sha3-512', - 'sha3_256', 'sha3_384', 'sha3_512' -].filter(algo => NODE_HASHES.has(algo)) - -function getPrioritizedHash (algo1, algo2) { - return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase()) - ? algo1 - : algo2 -} - - -/***/ }), -/* 94 */ -/***/ (function(module, exports) { - -module.exports = require("buffer"); - -/***/ }), -/* 95 */ -/***/ (function(module, exports) { - -module.exports = require("events"); - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - - -module.exports = { - copy: copy, - checkDataType: checkDataType, - checkDataTypes: checkDataTypes, - coerceToTypes: coerceToTypes, - toHash: toHash, - getProperty: getProperty, - escapeQuotes: escapeQuotes, - equal: __webpack_require__(192), - ucs2length: __webpack_require__(453), - varOccurences: varOccurences, - varReplace: varReplace, - cleanUpCode: cleanUpCode, - finalCleanUpCode: finalCleanUpCode, - schemaHasRules: schemaHasRules, - schemaHasRulesExcept: schemaHasRulesExcept, - toQuotedString: toQuotedString, - getPathExpr: getPathExpr, - getPath: getPath, - getData: getData, - unescapeFragment: unescapeFragment, - unescapeJsonPointer: unescapeJsonPointer, - escapeFragment: escapeFragment, - escapeJsonPointer: escapeJsonPointer -}; - - -function copy(o, to) { - to = to || {}; - for (var key in o) to[key] = o[key]; - return to; -} - - -function checkDataType(dataType, data, negate) { - var EQUAL = negate ? ' !== ' : ' === ' - , AND = negate ? ' || ' : ' && ' - , OK = negate ? '!' : '' - , NOT = negate ? '' : '!'; - switch (dataType) { - case 'null': return data + EQUAL + 'null'; - case 'array': return OK + 'Array.isArray(' + data + ')'; - case 'object': return '(' + OK + data + AND + - 'typeof ' + data + EQUAL + '"object"' + AND + - NOT + 'Array.isArray(' + data + '))'; - case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + - NOT + '(' + data + ' % 1)' + - AND + data + EQUAL + data + ')'; - default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; - } -} - - -function checkDataTypes(dataTypes, data) { - switch (dataTypes.length) { - case 1: return checkDataType(dataTypes[0], data, true); - default: - var code = ''; - var types = toHash(dataTypes); - if (types.array && types.object) { - code = types.null ? '(': '(!' + data + ' || '; - code += 'typeof ' + data + ' !== "object")'; - delete types.null; - delete types.array; - delete types.object; - } - if (types.number) delete types.integer; - for (var t in types) - code += (code ? ' && ' : '' ) + checkDataType(t, data, true); - - return code; - } -} - - -var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); -function coerceToTypes(optionCoerceTypes, dataTypes) { - if (Array.isArray(dataTypes)) { - var types = []; - for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); - return paths[lvl - up]; - } - - if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); - data = 'data' + ((lvl - up) || ''); - if (!jsonPointer) return data; - } - - var expr = data; - var segments = jsonPointer.split('/'); - for (var i=0; i 2 && arguments[2] !== undefined ? arguments[2] : ''; - var flags = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - var registry = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ''; - - var auth = registry ? config.registries.npm.getAuthByRegistry(registry) : config.registries.npm.getAuth(name); - - if (config.otp) { - config.registries.npm.setOtp(config.otp); - } - - if (auth) { - config.registries.npm.setToken(auth); - return function revoke() { - reporter.info(reporter.lang('notRevokingConfigToken')); - return (_promise || _load_promise()).default.resolve(); - }; - } - - var env = process.env.YARN_AUTH_TOKEN || process.env.NPM_AUTH_TOKEN; - if (env) { - config.registries.npm.setToken(`Bearer ${env}`); - return function revoke() { - reporter.info(reporter.lang('notRevokingEnvToken')); - return (_promise || _load_promise()).default.resolve(); - }; - } - - // make sure we're not running in non-interactive mode before asking for login - if (flags.nonInteractive || config.nonInteractive) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('nonInteractiveNoToken')); - } - - // - var creds = yield getCredentials(config, reporter); - if (!creds) { - reporter.warn(reporter.lang('loginAsPublic')); - return function revoke() { - reporter.info(reporter.lang('noTokenToRevoke')); - return (_promise || _load_promise()).default.resolve(); - }; - } - - var username = creds.username, - email = creds.email; - - var password = yield reporter.question(reporter.lang('npmPassword'), { - password: true, - required: true - }); - - // - var userobj = { - _id: `org.couchdb.user:${username}`, - name: username, - password, - email, - type: 'user', - roles: [], - date: new Date().toISOString() - }; - - // - var res = yield config.registries.npm.request(`-/user/org.couchdb.user:${encodeURIComponent(username)}`, { - method: 'PUT', - registry, - body: userobj, - auth: { username, password, email } - }); - - if (res && res.ok) { - reporter.success(reporter.lang('loggedIn')); - - var token = res.token; - config.registries.npm.setToken(`Bearer ${token}`); - - return function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - reporter.success(reporter.lang('revokedToken')); - yield config.registries.npm.request(`-/user/token/${token}`, { - method: 'DELETE', - registry - }); - }); - - function revoke() { - return _ref3.apply(this, arguments); - } - - return revoke; - }(); - } else { - throw new (_errors || _load_errors()).MessageError(reporter.lang('incorrectCredentials')); - } - }); - - return function getToken(_x3, _x4) { - return _ref2.apply(this, arguments); - }; -}(); - -var run = exports.run = function () { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - yield getCredentials(config, reporter); - }); - - return function run(_x8, _x9, _x10, _x11) { - return _ref4.apply(this, arguments); - }; -}(); - -exports.getOneTimePassword = getOneTimePassword; -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function getOneTimePassword(reporter) { - return reporter.question(reporter.lang('npmOneTimePassword')); -} - -function hasWrapper(commander, args) { - return true; -} - -function setFlags(commander) { - commander.description('Stores registry username and email.'); -} - -/***/ }), -/* 98 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _stringify; - -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(40)); -} - -exports.stringifyLangArgs = stringifyLangArgs; - -var _format; - -function _load_format() { - return _format = __webpack_require__(554); -} - -var _index; - -function _load_index() { - return _index = _interopRequireWildcard(__webpack_require__(556)); -} - -var _isCi; - -function _load_isCi() { - return _isCi = _interopRequireDefault(__webpack_require__(365)); -} - -var _os; - -function _load_os() { - return _os = _interopRequireDefault(__webpack_require__(72)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* eslint no-unused-vars: 0 */ - -var util = __webpack_require__(9); -var EventEmitter = __webpack_require__(95).EventEmitter; - -function stringifyLangArgs(args) { - return args.map(function (val) { - if (val != null && val.inspect) { - return val.inspect(); - } else { - try { - var str = (0, (_stringify || _load_stringify()).default)(val) || val + ''; - // should match all literal line breaks and - // "u001b" that follow an odd number of backslashes and convert them to ESC - // we do this because the JSON.stringify process has escaped these characters - return str.replace(/((?:^|[^\\])(?:\\{2})*)\\u001[bB]/g, '$1\u001b').replace(/[\\]r[\\]n|([\\])?[\\]n/g, function (match, precededBacklash) { - // precededBacklash not null when "\n" is preceded by a backlash ("\\n") - // match will be "\\n" and we don't replace it with os.EOL - return precededBacklash ? match : (_os || _load_os()).default.EOL; - }); - } catch (e) { - return util.inspect(val); - } - } - }); -} - -var BaseReporter = function () { - function BaseReporter() { - var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseReporter); - - var lang = 'en'; - this.language = lang; - - this.stdout = opts.stdout || process.stdout; - this.stderr = opts.stderr || process.stderr; - this.stdin = opts.stdin || this._getStandardInput(); - this.emoji = !!opts.emoji; - this.nonInteractive = !!opts.nonInteractive; - this.noProgress = !!opts.noProgress || (_isCi || _load_isCi()).default; - this.isVerbose = !!opts.verbose; - - // $FlowFixMe: this is valid! - this.isTTY = this.stdout.isTTY; - - this.peakMemory = 0; - this.startTime = Date.now(); - this.format = (_format || _load_format()).defaultFormatter; - } - - BaseReporter.prototype.lang = function lang(key) { - var msg = (_index || _load_index())[this.language][key] || (_index || _load_index()).en[key]; - if (!msg) { - throw new ReferenceError(`No message defined for language key ${key}`); - } - - // stringify args - - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var stringifiedArgs = stringifyLangArgs(args); - - // replace $0 placeholders with args - return msg.replace(/\$(\d+)/g, function (str, i) { - return stringifiedArgs[i]; - }); - }; - - /** - * `stringifyLangArgs` run `JSON.stringify` on strings too causing - * them to appear quoted. This marks them as "raw" and prevents - * the quoting and escaping - */ - - - BaseReporter.prototype.rawText = function rawText(str) { - return { - inspect() { - return str; - } - }; - }; - - BaseReporter.prototype.verbose = function verbose(msg) { - if (this.isVerbose) { - this._verbose(msg); - } - }; - - BaseReporter.prototype.verboseInspect = function verboseInspect(val) { - if (this.isVerbose) { - this._verboseInspect(val); - } - }; - - BaseReporter.prototype._verbose = function _verbose(msg) {}; - - BaseReporter.prototype._verboseInspect = function _verboseInspect(val) {}; - - BaseReporter.prototype._getStandardInput = function _getStandardInput() { - var standardInput = void 0; - - // Accessing stdin in a win32 headless process (e.g., Visual Studio) may throw an exception. - try { - standardInput = process.stdin; - } catch (e) { - console.warn(e.message); - delete process.stdin; - // $FlowFixMe: this is valid! - process.stdin = new EventEmitter(); - standardInput = process.stdin; - } - - return standardInput; - }; - - BaseReporter.prototype.initPeakMemoryCounter = function initPeakMemoryCounter() { - var _this = this; - - this.checkPeakMemory(); - this.peakMemoryInterval = setInterval(function () { - _this.checkPeakMemory(); - }, 1000); - // $FlowFixMe: Node's setInterval returns a Timeout, not a Number - this.peakMemoryInterval.unref(); - }; - - BaseReporter.prototype.checkPeakMemory = function checkPeakMemory() { - var _process$memoryUsage = process.memoryUsage(), - heapTotal = _process$memoryUsage.heapTotal; - - if (heapTotal > this.peakMemory) { - this.peakMemory = heapTotal; - } - }; - - BaseReporter.prototype.close = function close() { - if (this.peakMemoryInterval) { - clearInterval(this.peakMemoryInterval); - this.peakMemoryInterval = null; - } - }; - - BaseReporter.prototype.getTotalTime = function getTotalTime() { - return Date.now() - this.startTime; - }; - - // TODO - - - BaseReporter.prototype.list = function list(key, items, hints) {}; - - // Outputs basic tree structure to console - - - BaseReporter.prototype.tree = function tree(key, obj) { - var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, - _ref$force = _ref.force, - force = _ref$force === undefined ? false : _ref$force; - }; - - // called whenever we begin a step in the CLI. - - - BaseReporter.prototype.step = function step(current, total, message, emoji) {}; - - // a error message has been triggered. this however does not always meant an abrupt - // program end. - - - BaseReporter.prototype.error = function error(message) {}; - - // an info message has been triggered. this provides things like stats and diagnostics. - - - BaseReporter.prototype.info = function info(message) {}; - - // a warning message has been triggered. - - - BaseReporter.prototype.warn = function warn(message) {}; - - // a success message has been triggered. - - - BaseReporter.prototype.success = function success(message) {}; - - // a simple log message - // TODO: rethink the {force} parameter. In the meantime, please don't use it (cf comments in #4143). - - - BaseReporter.prototype.log = function log(message) { - var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref2$force = _ref2.force, - force = _ref2$force === undefined ? false : _ref2$force; - }; - - // a shell command has been executed - - - BaseReporter.prototype.command = function command(_command) {}; - - // inspect and pretty-print any value - - - BaseReporter.prototype.inspect = function inspect(value) {}; - - // the screen shown at the very start of the CLI - - - BaseReporter.prototype.header = function header(command, pkg) {}; - - // the screen shown at the very end of the CLI - - - BaseReporter.prototype.footer = function footer(showPeakMemory) {}; - - // a table structure - - - BaseReporter.prototype.table = function table(head, body) {}; - - // security audit action to resolve advisories - - - BaseReporter.prototype.auditAction = function auditAction(recommendation) {}; - - // security audit requires manual review - - - BaseReporter.prototype.auditManualReview = function auditManualReview() {}; - - // security audit advisory - - - BaseReporter.prototype.auditAdvisory = function auditAdvisory(resolution, _auditAdvisory) {}; - - // summary for security audit report - - - BaseReporter.prototype.auditSummary = function auditSummary(auditMetadata) {}; - - // render an activity spinner and return a function that will trigger an update - - - BaseReporter.prototype.activity = function activity() { - return { - tick(name) {}, - end() {} - }; - }; - - // - - - BaseReporter.prototype.activitySet = function activitySet(total, workers) { - return { - spinners: Array(workers).fill({ - clear() {}, - setPrefix() {}, - tick() {}, - end() {} - }), - end() {} - }; - }; - - // - - - BaseReporter.prototype.question = function question(_question) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - return (_promise || _load_promise()).default.reject(new Error('Not implemented')); - }; - - // - - - BaseReporter.prototype.questionAffirm = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (question) { - var condition = true; // trick eslint - if (this.nonInteractive) { - return true; - } - - while (condition) { - var answer = yield this.question(question); - answer = answer.toLowerCase(); - - if (answer === 'y' || answer === 'yes') { - return true; - } - if (answer === 'n' || answer === 'no') { - return false; - } - - this.error('Invalid answer for question'); - } - - return false; - }); - - function questionAffirm(_x5) { - return _ref3.apply(this, arguments); - } - - return questionAffirm; - }(); - - // prompt the user to select an option from an array - - - BaseReporter.prototype.select = function select(header, question, options) { - return (_promise || _load_promise()).default.reject(new Error('Not implemented')); - }; - - // render a progress bar and return a function which when called will trigger an update - - - BaseReporter.prototype.progress = function progress(total) { - return function () {}; - }; - - // utility function to disable progress bar - - - BaseReporter.prototype.disableProgress = function disableProgress() { - this.noProgress = true; - }; - - // - - - BaseReporter.prototype.prompt = function prompt(message, choices) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - return (_promise || _load_promise()).default.reject(new Error('Not implemented')); - }; - - return BaseReporter; -}(); - -exports.default = BaseReporter; - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -exports.explodeHostedGitFragment = explodeHostedGitFragment; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(60); -} - -var _gitResolver; - -function _load_gitResolver() { - return _gitResolver = _interopRequireDefault(__webpack_require__(118)); -} - -var _exoticResolver; - -function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(85)); -} - -var _git; - -function _load_git() { - return _git = _interopRequireDefault(__webpack_require__(207)); -} - -var _guessName; - -function _load_guessName() { - return _guessName = _interopRequireDefault(__webpack_require__(159)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function parseHash(fragment) { - var hashPosition = fragment.indexOf('#'); - return hashPosition === -1 ? '' : fragment.substr(hashPosition + 1); -} - -function explodeHostedGitFragment(fragment, reporter) { - var hash = parseHash(fragment); - - var preParts = fragment.split('@'); - if (preParts.length > 2) { - fragment = preParts[1] + '@' + preParts[2]; - } - - var parts = fragment.replace(/(.*?)#.*/, '$1') // Strip hash - .replace(/.*:(.*)/, '$1') // Strip prefixed protocols - .replace(/.git$/, '') // Strip the .git suffix - .split('/'); - - var user = parts[parts.length - 2]; - var repo = parts[parts.length - 1]; - - if (user === undefined || repo === undefined) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidHostedGitFragment', fragment)); - } - - return { - user, - repo, - hash - }; -} - -var HostedGitResolver = function (_ExoticResolver) { - (0, (_inherits2 || _load_inherits()).default)(HostedGitResolver, _ExoticResolver); - - function HostedGitResolver(request, fragment) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, HostedGitResolver); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment)); - - var exploded = _this.exploded = explodeHostedGitFragment(fragment, _this.reporter); - var user = exploded.user, - repo = exploded.repo, - hash = exploded.hash; - - _this.user = user; - _this.repo = repo; - _this.hash = hash; - return _this; - } - - HostedGitResolver.getTarballUrl = function getTarballUrl(exploded, commit) { - exploded; - commit; - throw new Error('Not implemented'); - }; - - HostedGitResolver.getGitHTTPUrl = function getGitHTTPUrl(exploded) { - exploded; - throw new Error('Not implemented'); - }; - - HostedGitResolver.getGitHTTPBaseUrl = function getGitHTTPBaseUrl(exploded) { - exploded; - throw new Error('Not implemented'); - }; - - HostedGitResolver.getGitSSHUrl = function getGitSSHUrl(exploded) { - exploded; - throw new Error('Not implemented'); - }; - - HostedGitResolver.getHTTPFileUrl = function getHTTPFileUrl(exploded, filename, commit) { - exploded; - filename; - commit; - throw new Error('Not implemented'); - }; - - HostedGitResolver.prototype.getRefOverHTTP = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) { - var gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url); - var client = new (_git || _load_git()).default(this.config, gitUrl, this.hash); - - var out = yield this.config.requestManager.request({ - url: `${url}/info/refs?service=git-upload-pack`, - queue: this.resolver.fetchingQueue - }); - - if (out) { - // clean up output - var lines = out.trim().split('\n'); - - // remove first two lines which contains compatibility info etc - lines = lines.slice(2); - - // remove last line which contains the terminator "0000" - lines.pop(); - - // remove line lengths from start of each line - lines = lines.map(function (line) { - return line.slice(4); - }); - - out = lines.join('\n'); - } else { - throw new Error(this.reporter.lang('hostedGitResolveError')); - } - - return client.setRefHosted(out); - }); - - function getRefOverHTTP(_x) { - return _ref.apply(this, arguments); - } - - return getRefOverHTTP; - }(); - - HostedGitResolver.prototype.resolveOverHTTP = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) { - var _this2 = this; - - var commit = yield this.getRefOverHTTP(url); - var config = this.config; - - - var tarballUrl = this.constructor.getTarballUrl(this.exploded, commit); - - var tryRegistry = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) { - var filename = (_index || _load_index()).registries[registry].filename; - - var href = _this2.constructor.getHTTPFileUrl(_this2.exploded, filename, commit); - var file = yield config.requestManager.request({ - url: href, - queue: _this2.resolver.fetchingQueue - }); - if (!file) { - return null; - } - - var json = yield config.readJson(href, function () { - return JSON.parse(file); - }); - json._uid = commit; - json._remote = { - resolved: tarballUrl, - type: 'tarball', - reference: tarballUrl, - registry - }; - return json; - }); - - return function tryRegistry(_x3) { - return _ref3.apply(this, arguments); - }; - }(); - - var file = yield tryRegistry(this.registry); - if (file) { - return file; - } - - for (var registry in (_index || _load_index()).registries) { - if (registry === this.registry) { - continue; - } - - var _file = yield tryRegistry(registry); - if (_file) { - return _file; - } - } - - return { - name: (0, (_guessName || _load_guessName()).default)(url), - version: '0.0.0', - _uid: commit, - _remote: { - resolved: tarballUrl, - type: 'tarball', - reference: tarballUrl, - registry: 'npm', - hash: undefined - } - }; - }); - - function resolveOverHTTP(_x2) { - return _ref2.apply(this, arguments); - } - - return resolveOverHTTP; - }(); - - HostedGitResolver.prototype.hasHTTPCapability = function () { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) { - return (yield this.config.requestManager.request({ - url, - method: 'HEAD', - queue: this.resolver.fetchingQueue, - followRedirect: false - })) !== false; - }); - - function hasHTTPCapability(_x4) { - return _ref4.apply(this, arguments); - } - - return hasHTTPCapability; - }(); - - HostedGitResolver.prototype.resolve = function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // If we already have the tarball, just return it without having to make any HTTP requests. - var shrunk = this.request.getLocked('tarball'); - if (shrunk) { - return shrunk; - } - - var httpUrl = this.constructor.getGitHTTPUrl(this.exploded); - var httpBaseUrl = this.constructor.getGitHTTPBaseUrl(this.exploded); - var sshUrl = this.constructor.getGitSSHUrl(this.exploded); - - // If we can access the files over HTTP then we should as it's MUCH faster than git - // archive and tarball unarchiving. The HTTP API is only available for public repos - // though. - if (yield this.hasHTTPCapability(httpBaseUrl)) { - return this.resolveOverHTTP(httpUrl); - } - - // If the url is accessible over git archive then we should immediately delegate to - // the git resolver. - // - // NOTE: Here we use a different url than when we delegate to the git resolver later on. - // This is because `git archive` requires access over ssh and github only allows that - // if you have write permissions - var sshGitUrl = (_git || _load_git()).default.npmUrlToGitUrl(sshUrl); - if (yield (_git || _load_git()).default.hasArchiveCapability(sshGitUrl)) { - var archiveClient = new (_git || _load_git()).default(this.config, sshGitUrl, this.hash); - var commit = yield archiveClient.init(); - return this.fork((_gitResolver || _load_gitResolver()).default, true, `${sshUrl}#${commit}`); - } - - // fallback to the plain git resolver - return this.fork((_gitResolver || _load_gitResolver()).default, true, sshUrl); - }); - - function resolve() { - return _ref5.apply(this, arguments); - } - - return resolve; - }(); - - return HostedGitResolver; -}((_exoticResolver || _load_exoticResolver()).default); - -exports.default = HostedGitResolver; - -/***/ }), -/* 100 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.execCommand = exports.execFromManifest = exports.executeLifecycleScript = exports.makeEnv = exports.getWrappersFolder = exports.IGNORE_MANIFEST_KEYS = undefined; - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _from; - -function _load_from() { - return _from = _interopRequireDefault(__webpack_require__(53)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _stringify; - -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(40)); -} - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var getWrappersFolder = exports.getWrappersFolder = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { - if (wrappersFolder) { - return wrappersFolder; - } - - wrappersFolder = yield (_fs || _load_fs()).makeTempDir(); - - yield (0, (_portableScript || _load_portableScript()).makePortableProxyScript)(process.execPath, wrappersFolder, { - proxyBasename: 'node' - }); - - yield (0, (_portableScript || _load_portableScript()).makePortableProxyScript)(process.execPath, wrappersFolder, { - proxyBasename: 'yarn', - prependArguments: [process.argv[1]] - }); - - return wrappersFolder; - }); - - return function getWrappersFolder(_x) { - return _ref.apply(this, arguments); - }; -}(); - -var makeEnv = exports.makeEnv = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (stage, cwd, config) { - var env = (0, (_extends2 || _load_extends()).default)({ - NODE: process.execPath, - INIT_CWD: process.cwd() - }, process.env); - - // Merge in the `env` object specified in .yarnrc - var customEnv = config.getOption('env'); - if (customEnv && typeof customEnv === 'object') { - (0, (_assign || _load_assign()).default)(env, customEnv); - } - - env.npm_lifecycle_event = stage; - env.npm_node_execpath = env.NODE; - env.npm_execpath = env.npm_execpath || process.mainModule && process.mainModule.filename; - - // Set the env to production for npm compat if production mode. - // https://github.com/npm/npm/blob/30d75e738b9cb7a6a3f9b50e971adcbe63458ed3/lib/utils/lifecycle.js#L336 - if (config.production) { - env.NODE_ENV = 'production'; - } - - // Note: npm_config_argv environment variable contains output of nopt - command-line - // parser used by npm. Since we use other parser, we just roughly emulate it's output. (See: #684) - env.npm_config_argv = (0, (_stringify || _load_stringify()).default)({ - remain: [], - cooked: config.commandName === 'run' ? [config.commandName, stage] : [config.commandName], - original: process.argv.slice(2) - }); - - var manifest = yield config.maybeReadManifest(cwd); - if (manifest) { - if (manifest.scripts && Object.prototype.hasOwnProperty.call(manifest.scripts, stage)) { - env.npm_lifecycle_script = manifest.scripts[stage]; - } - - // add npm_package_* - var queue = [['', manifest]]; - while (queue.length) { - var _queue$pop = queue.pop(), - _key = _queue$pop[0], - val = _queue$pop[1]; - - if (typeof val === 'object') { - for (var subKey in val) { - var fullKey = [_key, subKey].filter(Boolean).join('_'); - if (fullKey && fullKey[0] !== '_' && !IGNORE_MANIFEST_KEYS.has(fullKey)) { - queue.push([fullKey, val[subKey]]); - } - } - } else { - var cleanVal = String(val); - if (cleanVal.indexOf('\n') >= 0) { - cleanVal = (0, (_stringify || _load_stringify()).default)(cleanVal); - } - - //replacing invalid chars with underscore - var cleanKey = _key.replace(INVALID_CHAR_REGEX, '_'); - - env[`npm_package_${cleanKey}`] = cleanVal; - } - } - } - - // add npm_config_* and npm_package_config_* from yarn config - var keys = new (_set || _load_set()).default([].concat((0, (_keys || _load_keys()).default)(config.registries.yarn.config), (0, (_keys || _load_keys()).default)(config.registries.npm.config))); - var cleaned = (0, (_from || _load_from()).default)(keys).filter(function (key) { - return !key.match(/:_/) && IGNORE_CONFIG_KEYS.indexOf(key) === -1; - }).map(function (key) { - var val = config.getOption(key); - if (!val) { - val = ''; - } else if (typeof val === 'number') { - val = '' + val; - } else if (typeof val !== 'string') { - val = (0, (_stringify || _load_stringify()).default)(val); - } - - if (val.indexOf('\n') >= 0) { - val = (0, (_stringify || _load_stringify()).default)(val); - } - return [key, val]; - }); - // add npm_config_* - for (var _iterator = cleaned, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref4; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref4 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref4 = _i.value; - } - - var _ref3 = _ref4; - var _key2 = _ref3[0]; - var _val = _ref3[1]; - - var _cleanKey = _key2.replace(/^_+/, ''); - var envKey = `npm_config_${_cleanKey}`.replace(INVALID_CHAR_REGEX, '_'); - env[envKey] = _val; - } - // add npm_package_config_* - if (manifest && manifest.name) { - var packageConfigPrefix = `${manifest.name}:`; - for (var _iterator2 = cleaned, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref6; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref6 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref6 = _i2.value; - } - - var _ref5 = _ref6; - var _key3 = _ref5[0]; - var _val2 = _ref5[1]; - - if (_key3.indexOf(packageConfigPrefix) !== 0) { - continue; - } - var _cleanKey2 = _key3.replace(/^_+/, '').replace(packageConfigPrefix, ''); - var envKey = `npm_package_config_${_cleanKey2}`.replace(INVALID_CHAR_REGEX, '_'); - env[envKey] = _val2; - } - } - - // split up the path - var envPath = env[(_constants || _load_constants()).ENV_PATH_KEY]; - var pathParts = envPath ? envPath.split(path.delimiter) : []; - - // Include node-gyp version that was bundled with the current Node.js version, - // if available. - pathParts.unshift(path.join(path.dirname(process.execPath), 'node_modules', 'npm', 'bin', 'node-gyp-bin')); - pathParts.unshift(path.join(path.dirname(process.execPath), '..', 'lib', 'node_modules', 'npm', 'bin', 'node-gyp-bin')); - // Include node-gyp version from homebrew managed npm, if available. - pathParts.unshift(path.join(path.dirname(process.execPath), '..', 'libexec', 'lib', 'node_modules', 'npm', 'bin', 'node-gyp-bin')); - - // Add global bin folder if it is not present already, as some packages depend - // on a globally-installed version of node-gyp. - var globalBin = yield (0, (_global || _load_global()).getBinFolder)(config, {}); - if (pathParts.indexOf(globalBin) === -1) { - pathParts.unshift(globalBin); - } - - // Add node_modules .bin folders to the PATH - for (var _iterator3 = config.registryFolders, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref7; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref7 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref7 = _i3.value; - } - - var registryFolder = _ref7; - - var binFolder = path.join(registryFolder, '.bin'); - if (config.workspacesEnabled && config.workspaceRootFolder) { - pathParts.unshift(path.join(config.workspaceRootFolder, binFolder)); - } - pathParts.unshift(path.join(config.linkFolder, binFolder)); - pathParts.unshift(path.join(cwd, binFolder)); - } - - var pnpFile = void 0; - - if (process.versions.pnp) { - pnpFile = (_dynamicRequire || _load_dynamicRequire()).dynamicRequire.resolve('pnpapi'); - } else { - var candidate = `${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`; - if (yield (_fs || _load_fs()).exists(candidate)) { - pnpFile = candidate; - } - } - - if (pnpFile) { - var pnpApi = (0, (_dynamicRequire || _load_dynamicRequire()).dynamicRequire)(pnpFile); - - var packageLocator = pnpApi.findPackageLocator(`${cwd}/`); - var packageInformation = pnpApi.getPackageInformation(packageLocator); - - for (var _iterator4 = packageInformation.packageDependencies.entries(), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref9; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref9 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref9 = _i4.value; - } - - var _ref8 = _ref9; - var name = _ref8[0]; - var reference = _ref8[1]; - - var dependencyInformation = pnpApi.getPackageInformation({ name, reference }); - - if (!dependencyInformation || !dependencyInformation.packageLocation) { - continue; - } - - var binFolder = `${dependencyInformation.packageLocation}/.bin`; - if (yield (_fs || _load_fs()).exists(binFolder)) { - pathParts.unshift(binFolder); - } - } - - // Note that NODE_OPTIONS doesn't support any style of quoting its arguments at the moment - // For this reason, it won't work if the user has a space inside its $PATH - env.NODE_OPTIONS = env.NODE_OPTIONS || ''; - env.NODE_OPTIONS = `--require ${pnpFile} ${env.NODE_OPTIONS}`; - } - - pathParts.unshift((yield getWrappersFolder(config))); - - // join path back together - env[(_constants || _load_constants()).ENV_PATH_KEY] = pathParts.join(path.delimiter); - - return env; - }); - - return function makeEnv(_x2, _x3, _x4) { - return _ref2.apply(this, arguments); - }; -}(); - -var executeLifecycleScript = exports.executeLifecycleScript = function () { - var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref11) { - var stage = _ref11.stage, - config = _ref11.config, - cwd = _ref11.cwd, - cmd = _ref11.cmd, - isInteractive = _ref11.isInteractive, - onProgress = _ref11.onProgress, - customShell = _ref11.customShell; - - var env = yield makeEnv(stage, cwd, config); - - yield checkForGypIfNeeded(config, cmd, env[(_constants || _load_constants()).ENV_PATH_KEY].split(path.delimiter)); - - if (process.platform === 'win32' && (!customShell || customShell === 'cmd')) { - // handle windows run scripts starting with a relative path - cmd = (0, (_fixCmdWinSlashes || _load_fixCmdWinSlashes()).fixCmdWinSlashes)(cmd); - } - - // By default (non-interactive), pipe everything to the terminal and run child process detached - // as long as it's not Windows (since windows does not have /dev/tty) - var stdio = ['ignore', 'pipe', 'pipe']; - var detached = process.platform !== 'win32'; - - if (isInteractive) { - stdio = 'inherit'; - detached = false; - } - - var shell = customShell || true; - var stdout = yield (_child || _load_child()).spawn(cmd, [], { cwd, env, stdio, detached, shell }, onProgress); - - return { cwd, command: cmd, stdout }; - }); - - return function executeLifecycleScript(_x5) { - return _ref10.apply(this, arguments); - }; -}(); - -var _checkForGyp = function () { - var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, paths) { - var reporter = config.reporter; - - // Check every directory in the PATH - - var allChecks = yield (_promise || _load_promise()).default.all(paths.map(function (dir) { - return (_fs || _load_fs()).exists(path.join(dir, 'node-gyp')); - })); - if (allChecks.some(Boolean)) { - // node-gyp is available somewhere - return; - } - - reporter.info(reporter.lang('packageRequiresNodeGyp')); - - try { - yield (0, (_global || _load_global()).run)(config, reporter, {}, ['add', 'node-gyp']); - } catch (e) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('nodeGypAutoInstallFailed', e.message)); - } - }); - - return function _checkForGyp(_x6, _x7) { - return _ref12.apply(this, arguments); - }; -}(); - -var execFromManifest = exports.execFromManifest = function () { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, commandName, cwd) { - var pkg = yield config.maybeReadManifest(cwd); - if (!pkg || !pkg.scripts) { - return; - } - - var cmd = pkg.scripts[commandName]; - if (cmd) { - yield execCommand({ stage: commandName, config, cmd, cwd, isInteractive: true }); - } - }); - - return function execFromManifest(_x8, _x9, _x10) { - return _ref13.apply(this, arguments); - }; -}(); - -var execCommand = exports.execCommand = function () { - var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref15) { - var stage = _ref15.stage, - config = _ref15.config, - cmd = _ref15.cmd, - cwd = _ref15.cwd, - isInteractive = _ref15.isInteractive, - customShell = _ref15.customShell; - var reporter = config.reporter; - - try { - reporter.command(cmd); - yield executeLifecycleScript({ stage, config, cwd, cmd, isInteractive, customShell }); - return (_promise || _load_promise()).default.resolve(); - } catch (err) { - if (err instanceof (_errors || _load_errors()).ProcessTermError) { - var formattedError = new (_errors || _load_errors()).ProcessTermError(err.EXIT_SIGNAL ? reporter.lang('commandFailedWithSignal', err.EXIT_SIGNAL) : reporter.lang('commandFailedWithCode', err.EXIT_CODE)); - formattedError.EXIT_CODE = err.EXIT_CODE; - formattedError.EXIT_SIGNAL = err.EXIT_SIGNAL; - throw formattedError; - } else { - throw err; - } - } - }); - - return function execCommand(_x11) { - return _ref14.apply(this, arguments); - }; -}(); - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); -} - -var _child; - -function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(61)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _dynamicRequire; - -function _load_dynamicRequire() { - return _dynamicRequire = __webpack_require__(314); -} - -var _portableScript; - -function _load_portableScript() { - return _portableScript = __webpack_require__(578); -} - -var _fixCmdWinSlashes; - -function _load_fixCmdWinSlashes() { - return _fixCmdWinSlashes = __webpack_require__(566); -} - -var _global; - -function _load_global() { - return _global = __webpack_require__(115); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var path = __webpack_require__(1); - -var IGNORE_MANIFEST_KEYS = exports.IGNORE_MANIFEST_KEYS = new (_set || _load_set()).default(['readme', 'notice', 'licenseText', 'activationEvents', 'contributes']); - -// We treat these configs as internal, thus not expose them to process.env. -// This helps us avoid some gyp issues when building native modules. -// See https://github.com/yarnpkg/yarn/issues/2286. -var IGNORE_CONFIG_KEYS = ['lastUpdateCheck']; - -var wrappersFolder = null; - -var INVALID_CHAR_REGEX = /\W/g; - -exports.default = executeLifecycleScript; - - -var checkGypPromise = null; -/** - * Special case: Some packages depend on node-gyp, but don't specify this in - * their package.json dependencies. They assume that node-gyp is available - * globally. We need to detect this case and show an error message. - */ -function checkForGypIfNeeded(config, cmd, paths) { - if (cmd.substr(0, cmd.indexOf(' ')) !== 'node-gyp') { - return (_promise || _load_promise()).default.resolve(); - } - - // Ensure this only runs once, rather than multiple times in parallel. - if (!checkGypPromise) { - checkGypPromise = _checkForGyp(config, paths); - } - return checkGypPromise; -} - -/***/ }), -/* 101 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.home = undefined; - -var _rootUser; - -function _load_rootUser() { - return _rootUser = _interopRequireDefault(__webpack_require__(580)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var path = __webpack_require__(1); - -var home = exports.home = __webpack_require__(72).homedir(); - -var userHomeDir = (_rootUser || _load_rootUser()).default ? path.resolve('/usr/local/share') : home; - -exports.default = userHomeDir; - -/***/ }), -/* 102 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = __webpack_require__(344); -var enumBugKeys = __webpack_require__(220); - -module.exports = Object.keys || function keys(O) { - return $keys(O, enumBugKeys); -}; - - -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.13 ToObject(argument) -var defined = __webpack_require__(218); -module.exports = function (it) { - return Object(defined(it)); -}; - - -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $at = __webpack_require__(653)(true); - -// 21.1.3.27 String.prototype[@@iterator]() -__webpack_require__(222)(String, 'String', function (iterated) { - this._t = String(iterated); // target - this._i = 0; // next index -// 21.1.5.2.1 %StringIteratorPrototype%.next() -}, function () { - var O = this._t; - var index = this._i; - var point; - if (index >= O.length) return { value: undefined, done: true }; - point = $at(O, index); - this._i += point.length; - return { value: point, done: false }; -}); - - -/***/ }), -/* 105 */ -/***/ (function(module, exports) { - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. - -function isArray(arg) { - if (Array.isArray) { - return Array.isArray(arg); - } - return objectToString(arg) === '[object Array]'; -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = Buffer.isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} - - -/***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - - -function isNothing(subject) { - return (typeof subject === 'undefined') || (subject === null); -} - - -function isObject(subject) { - return (typeof subject === 'object') && (subject !== null); -} - - -function toArray(sequence) { - if (Array.isArray(sequence)) return sequence; - else if (isNothing(sequence)) return []; - - return [ sequence ]; -} - - -function extend(target, source) { - var index, length, key, sourceKeys; - - if (source) { - sourceKeys = Object.keys(source); - - for (index = 0, length = sourceKeys.length; index < length; index += 1) { - key = sourceKeys[index]; - target[key] = source[key]; - } - } - - return target; -} - - -function repeat(string, count) { - var result = '', cycle; - - for (cycle = 0; cycle < count; cycle += 1) { - result += string; - } - - return result; -} - - -function isNegativeZero(number) { - return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); -} - - -module.exports.isNothing = isNothing; -module.exports.isObject = isObject; -module.exports.toArray = toArray; -module.exports.repeat = repeat; -module.exports.isNegativeZero = isNegativeZero; -module.exports.extend = extend; - - -/***/ }), -/* 107 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/*eslint-disable max-len*/ - -var common = __webpack_require__(106); -var YAMLException = __webpack_require__(131); -var Type = __webpack_require__(30); - - -function compileList(schema, name, result) { - var exclude = []; - - schema.include.forEach(function (includedSchema) { - result = compileList(includedSchema, name, result); - }); - - schema[name].forEach(function (currentType) { - result.forEach(function (previousType, previousIndex) { - if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { - exclude.push(previousIndex); - } - }); - - result.push(currentType); - }); - - return result.filter(function (type, index) { - return exclude.indexOf(index) === -1; - }); -} - - -function compileMap(/* lists... */) { - var result = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {} - }, index, length; - - function collectType(type) { - result[type.kind][type.tag] = result['fallback'][type.tag] = type; - } - - for (index = 0, length = arguments.length; index < length; index += 1) { - arguments[index].forEach(collectType); - } - return result; -} - - -function Schema(definition) { - this.include = definition.include || []; - this.implicit = definition.implicit || []; - this.explicit = definition.explicit || []; - - this.implicit.forEach(function (type) { - if (type.loadKind && type.loadKind !== 'scalar') { - throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); - } - }); - - this.compiledImplicit = compileList(this, 'implicit', []); - this.compiledExplicit = compileList(this, 'explicit', []); - this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); -} - - -Schema.DEFAULT = null; - - -Schema.create = function createSchema() { - var schemas, types; - - switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; - - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; - - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); - } - - schemas = common.toArray(schemas); - types = common.toArray(types); - - if (!schemas.every(function (schema) { return schema instanceof Schema; })) { - throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); - } - - if (!types.every(function (type) { return type instanceof Type; })) { - throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } - - return new Schema({ - include: schemas, - explicit: types - }); -}; - - -module.exports = Schema; - - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * micromatch - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - - - -var expand = __webpack_require__(824); -var utils = __webpack_require__(240); - -/** - * The main function. Pass an array of filepaths, - * and a string or array of glob patterns - * - * @param {Array|String} `files` - * @param {Array|String} `patterns` - * @param {Object} `opts` - * @return {Array} Array of matches - */ - -function micromatch(files, patterns, opts) { - if (!files || !patterns) return []; - opts = opts || {}; - - if (typeof opts.cache === 'undefined') { - opts.cache = true; - } - - if (!Array.isArray(patterns)) { - return match(files, patterns, opts); - } - - var len = patterns.length, i = 0; - var omit = [], keep = []; - - while (len--) { - var glob = patterns[i++]; - if (typeof glob === 'string' && glob.charCodeAt(0) === 33 /* ! */) { - omit.push.apply(omit, match(files, glob.slice(1), opts)); - } else { - keep.push.apply(keep, match(files, glob, opts)); - } - } - return utils.diff(keep, omit); -} - -/** - * Return an array of files that match the given glob pattern. - * - * This function is called by the main `micromatch` function If you only - * need to pass a single pattern you might get very minor speed improvements - * using this function. - * - * @param {Array} `files` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Array} - */ - -function match(files, pattern, opts) { - if (utils.typeOf(files) !== 'string' && !Array.isArray(files)) { - throw new Error(msg('match', 'files', 'a string or array')); - } - - files = utils.arrayify(files); - opts = opts || {}; - - var negate = opts.negate || false; - var orig = pattern; - - if (typeof pattern === 'string') { - negate = pattern.charAt(0) === '!'; - if (negate) { - pattern = pattern.slice(1); - } - - // we need to remove the character regardless, - // so the above logic is still needed - if (opts.nonegate === true) { - negate = false; - } - } - - var _isMatch = matcher(pattern, opts); - var len = files.length, i = 0; - var res = []; - - while (i < len) { - var file = files[i++]; - var fp = utils.unixify(file, opts); - - if (!_isMatch(fp)) { continue; } - res.push(fp); - } - - if (res.length === 0) { - if (opts.failglob === true) { - throw new Error('micromatch.match() found no matches for: "' + orig + '".'); - } - - if (opts.nonull || opts.nullglob) { - res.push(utils.unescapeGlob(orig)); - } - } - - // if `negate` was defined, diff negated files - if (negate) { res = utils.diff(files, res); } - - // if `ignore` was defined, diff ignored filed - if (opts.ignore && opts.ignore.length) { - pattern = opts.ignore; - opts = utils.omit(opts, ['ignore']); - res = utils.diff(res, micromatch(res, pattern, opts)); - } - - if (opts.nodupes) { - return utils.unique(res); - } - return res; -} - -/** - * Returns a function that takes a glob pattern or array of glob patterns - * to be used with `Array#filter()`. (Internally this function generates - * the matching function using the [matcher] method). - * - * ```js - * var fn = mm.filter('[a-c]'); - * ['a', 'b', 'c', 'd', 'e'].filter(fn); - * //=> ['a', 'b', 'c'] - * ``` - * @param {String|Array} `patterns` Can be a glob or array of globs. - * @param {Options} `opts` Options to pass to the [matcher] method. - * @return {Function} Filter function to be passed to `Array#filter()`. - */ - -function filter(patterns, opts) { - if (!Array.isArray(patterns) && typeof patterns !== 'string') { - throw new TypeError(msg('filter', 'patterns', 'a string or array')); - } - - patterns = utils.arrayify(patterns); - var len = patterns.length, i = 0; - var patternMatchers = Array(len); - while (i < len) { - patternMatchers[i] = matcher(patterns[i++], opts); - } - - return function(fp) { - if (fp == null) return []; - var len = patternMatchers.length, i = 0; - var res = true; - - fp = utils.unixify(fp, opts); - while (i < len) { - var fn = patternMatchers[i++]; - if (!fn(fp)) { - res = false; - break; - } - } - return res; - }; -} - -/** - * Returns true if the filepath contains the given - * pattern. Can also return a function for matching. - * - * ```js - * isMatch('foo.md', '*.md', {}); - * //=> true - * - * isMatch('*.md', {})('foo.md') - * //=> true - * ``` - * @param {String} `fp` - * @param {String} `pattern` - * @param {Object} `opts` - * @return {Boolean} - */ - -function isMatch(fp, pattern, opts) { - if (typeof fp !== 'string') { - throw new TypeError(msg('isMatch', 'filepath', 'a string')); - } - - fp = utils.unixify(fp, opts); - if (utils.typeOf(pattern) === 'object') { - return matcher(fp, pattern); - } - return matcher(pattern, opts)(fp); -} - -/** - * Returns true if the filepath matches the - * given pattern. - */ - -function contains(fp, pattern, opts) { - if (typeof fp !== 'string') { - throw new TypeError(msg('contains', 'pattern', 'a string')); - } - - opts = opts || {}; - opts.contains = (pattern !== ''); - fp = utils.unixify(fp, opts); - - if (opts.contains && !utils.isGlob(pattern)) { - return fp.indexOf(pattern) !== -1; - } - return matcher(pattern, opts)(fp); -} - -/** - * Returns true if a file path matches any of the - * given patterns. - * - * @param {String} `fp` The filepath to test. - * @param {String|Array} `patterns` Glob patterns to use. - * @param {Object} `opts` Options to pass to the `matcher()` function. - * @return {String} - */ - -function any(fp, patterns, opts) { - if (!Array.isArray(patterns) && typeof patterns !== 'string') { - throw new TypeError(msg('any', 'patterns', 'a string or array')); - } - - patterns = utils.arrayify(patterns); - var len = patterns.length; - - fp = utils.unixify(fp, opts); - while (len--) { - var isMatch = matcher(patterns[len], opts); - if (isMatch(fp)) { - return true; - } - } - return false; -} - -/** - * Filter the keys of an object with the given `glob` pattern - * and `options` - * - * @param {Object} `object` - * @param {Pattern} `object` - * @return {Array} - */ - -function matchKeys(obj, glob, options) { - if (utils.typeOf(obj) !== 'object') { - throw new TypeError(msg('matchKeys', 'first argument', 'an object')); - } - - var fn = matcher(glob, options); - var res = {}; - - for (var key in obj) { - if (obj.hasOwnProperty(key) && fn(key)) { - res[key] = obj[key]; - } - } - return res; -} - -/** - * Return a function for matching based on the - * given `pattern` and `options`. - * - * @param {String} `pattern` - * @param {Object} `options` - * @return {Function} - */ - -function matcher(pattern, opts) { - // pattern is a function - if (typeof pattern === 'function') { - return pattern; - } - // pattern is a regex - if (pattern instanceof RegExp) { - return function(fp) { - return pattern.test(fp); - }; - } - - if (typeof pattern !== 'string') { - throw new TypeError(msg('matcher', 'pattern', 'a string, regex, or function')); - } - - // strings, all the way down... - pattern = utils.unixify(pattern, opts); - - // pattern is a non-glob string - if (!utils.isGlob(pattern)) { - return utils.matchPath(pattern, opts); - } - // pattern is a glob string - var re = makeRe(pattern, opts); - - // `matchBase` is defined - if (opts && opts.matchBase) { - return utils.hasFilename(re, opts); - } - // `matchBase` is not defined - return function(fp) { - fp = utils.unixify(fp, opts); - return re.test(fp); - }; -} - -/** - * Create and cache a regular expression for matching - * file paths. - * - * If the leading character in the `glob` is `!`, a negation - * regex is returned. - * - * @param {String} `glob` - * @param {Object} `options` - * @return {RegExp} - */ - -function toRegex(glob, options) { - // clone options to prevent mutating the original object - var opts = Object.create(options || {}); - var flags = opts.flags || ''; - if (opts.nocase && flags.indexOf('i') === -1) { - flags += 'i'; - } - - var parsed = expand(glob, opts); - - // pass in tokens to avoid parsing more than once - opts.negated = opts.negated || parsed.negated; - opts.negate = opts.negated; - glob = wrapGlob(parsed.pattern, opts); - var re; - - try { - re = new RegExp(glob, flags); - return re; - } catch (err) { - err.reason = 'micromatch invalid regex: (' + re + ')'; - if (opts.strict) throw new SyntaxError(err); - } - - // we're only here if a bad pattern was used and the user - // passed `options.silent`, so match nothing - return /$^/; -} - -/** - * Create the regex to do the matching. If the leading - * character in the `glob` is `!` a negation regex is returned. - * - * @param {String} `glob` - * @param {Boolean} `negate` - */ - -function wrapGlob(glob, opts) { - var prefix = (opts && !opts.contains) ? '^' : ''; - var after = (opts && !opts.contains) ? '$' : ''; - glob = ('(?:' + glob + ')' + after); - if (opts && opts.negate) { - return prefix + ('(?!^' + glob + ').*$'); - } - return prefix + glob; -} - -/** - * Create and cache a regular expression for matching file paths. - * If the leading character in the `glob` is `!`, a negation - * regex is returned. - * - * @param {String} `glob` - * @param {Object} `options` - * @return {RegExp} - */ - -function makeRe(glob, opts) { - if (utils.typeOf(glob) !== 'string') { - throw new Error(msg('makeRe', 'glob', 'a string')); - } - return utils.cache(toRegex, glob, opts); -} - -/** - * Make error messages consistent. Follows this format: - * - * ```js - * msg(methodName, argNumber, nativeType); - * // example: - * msg('matchKeys', 'first', 'an object'); - * ``` - * - * @param {String} `method` - * @param {String} `num` - * @param {String} `type` - * @return {String} - */ - -function msg(method, what, type) { - return 'micromatch.' + method + '(): ' + what + ' should be ' + type + '.'; -} - -/** - * Public methods - */ - -/* eslint no-multi-spaces: 0 */ -micromatch.any = any; -micromatch.braces = micromatch.braceExpand = utils.braces; -micromatch.contains = contains; -micromatch.expand = expand; -micromatch.filter = filter; -micromatch.isMatch = isMatch; -micromatch.makeRe = makeRe; -micromatch.match = match; -micromatch.matcher = matcher; -micromatch.matchKeys = matchKeys; - -/** - * Expose `micromatch` - */ - -module.exports = micromatch; - - -/***/ }), -/* 109 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - - - -/**/ - -var pna = __webpack_require__(170); -/**/ - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var util = __webpack_require__(105); -util.inherits = __webpack_require__(78); -/**/ - -var Readable = __webpack_require__(376); -var Writable = __webpack_require__(378); - -util.inherits(Duplex, Readable); - -{ - // avoid scope creep, the keys array can then be collected - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - pna.nextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -Object.defineProperty(Duplex.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); - -Duplex.prototype._destroy = function (err, cb) { - this.push(null); - this.end(); - - pna.nextTick(cb, err); -}; - -/***/ }), -/* 110 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = multicast; -/* unused harmony export MulticastOperator */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_ConnectableObservable__ = __webpack_require__(393); -/** PURE_IMPORTS_START _observable_ConnectableObservable PURE_IMPORTS_END */ - -function multicast(subjectOrSubjectFactory, selector) { - return function multicastOperatorFunction(source) { - var subjectFactory; - if (typeof subjectOrSubjectFactory === 'function') { - subjectFactory = subjectOrSubjectFactory; - } - else { - subjectFactory = function subjectFactory() { - return subjectOrSubjectFactory; - }; - } - if (typeof selector === 'function') { - return source.lift(new MulticastOperator(subjectFactory, selector)); - } - var connectable = Object.create(source, __WEBPACK_IMPORTED_MODULE_0__observable_ConnectableObservable__["b" /* connectableObservableDescriptor */]); - connectable.source = source; - connectable.subjectFactory = subjectFactory; - return connectable; - }; -} -var MulticastOperator = /*@__PURE__*/ (function () { - function MulticastOperator(subjectFactory, selector) { - this.subjectFactory = subjectFactory; - this.selector = selector; - } - MulticastOperator.prototype.call = function (subscriber, source) { - var selector = this.selector; - var subject = this.subjectFactory(); - var subscription = selector(subject).subscribe(subscriber); - subscription.add(source.subscribe(subject)); - return subscription; - }; - return MulticastOperator; -}()); - -//# sourceMappingURL=multicast.js.map - - -/***/ }), -/* 111 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return observable; }); -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -var observable = typeof Symbol === 'function' && Symbol.observable || '@@observable'; -//# sourceMappingURL=observable.js.map - - -/***/ }), -/* 112 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = identity; -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function identity(x) { - return x; -} -//# sourceMappingURL=identity.js.map - - -/***/ }), -/* 113 */ -/***/ (function(module, exports, __webpack_require__) { - -var v1 = __webpack_require__(1030); -var v4 = __webpack_require__(1031); - -var uuid = v4; -uuid.v1 = v1; -uuid.v4 = v4; - -module.exports = uuid; - - -/***/ }), -/* 114 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getInstallationMethod = exports.version = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var getInstallationMethod = exports.getInstallationMethod = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var installationMethod = originalInstallationMethod; - - // If there's a package.json in the parent directory, it could have an - // override for the installation method, so we should prefer that over - // whatever was originally in Yarn's package.json. This is the case with - // systems such as Homebrew, which take the tarball and modify the - // installation method so we're aware of the fact that Yarn was installed via - // Homebrew (so things like update notifications can point out the correct - // command to upgrade). - try { - var manifestPath = (_path || _load_path()).default.join(__dirname, '..', 'package.json'); - if ((_fs2 || _load_fs2()).default.existsSync(manifestPath)) { - // non-async version is deprecated - var manifest = yield (0, (_fs || _load_fs()).readJson)(manifestPath); - if (manifest.installationMethod) { - installationMethod = manifest.installationMethod; - } - } - } catch (e) { - // Ignore any errors; this is not critical functionality. - } - return installationMethod; - }); - - return function getInstallationMethod() { - return _ref.apply(this, arguments); - }; -}(); - -var _fs; - -function _load_fs() { - return _fs = __webpack_require__(8); -} - -var _fs2; - -function _load_fs2() { - return _fs2 = _interopRequireDefault(__webpack_require__(12)); -} - -var _path; - -function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(1)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// This will be bundled directly in the .js file for production builds -var _require = __webpack_require__(438), - version = _require.version, - originalInstallationMethod = _require.installationMethod; /** - * Determines the current version of Yarn itself. - * - */ - -exports.version = version; - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.getBinFolder = undefined; - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -var updateCwd = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { - yield (_fs || _load_fs()).mkdirp(config.globalFolder); - - yield config.init({ - cwd: config.globalFolder, - offline: config.offline, - binLinks: true, - globalFolder: config.globalFolder, - cacheFolder: config._cacheRootFolder, - linkFolder: config.linkFolder, - enableDefaultRc: config.enableDefaultRc, - extraneousYarnrcFiles: config.extraneousYarnrcFiles - }); - }); - - return function updateCwd(_x) { - return _ref2.apply(this, arguments); - }; -}(); - -var getBins = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { - // build up list of registry folders to search for binaries - var dirs = []; - for (var _iterator2 = (0, (_keys || _load_keys()).default)((_index || _load_index()).registries), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref4; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref4 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref4 = _i2.value; - } - - var registryName = _ref4; - - var registry = config.registries[registryName]; - dirs.push(registry.loc); - } - - // build up list of binary files - var paths = new (_set || _load_set()).default(); - for (var _iterator3 = dirs, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref5; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref5 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref5 = _i3.value; - } - - var dir = _ref5; - - var binDir = path.join(dir, '.bin'); - if (!(yield (_fs || _load_fs()).exists(binDir))) { - continue; - } - - for (var _iterator4 = yield (_fs || _load_fs()).readdir(binDir), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref6; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref6 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref6 = _i4.value; - } - - var name = _ref6; - - paths.add(path.join(binDir, name)); - } - } - return paths; - }); - - return function getBins(_x2) { - return _ref3.apply(this, arguments); - }; -}(); - -var getGlobalPrefix = function () { - var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { - if (flags.prefix) { - return flags.prefix; - } else if (config.getOption('prefix', true)) { - return String(config.getOption('prefix', true)); - } else if (process.env.PREFIX) { - return process.env.PREFIX; - } - - var potentialPrefixFolders = [(_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX]; - if (process.platform === 'win32') { - // %LOCALAPPDATA%\Yarn --> C:\Users\Alice\AppData\Local\Yarn - if (process.env.LOCALAPPDATA) { - potentialPrefixFolders.unshift(path.join(process.env.LOCALAPPDATA, 'Yarn')); - } - } else { - potentialPrefixFolders.unshift((_constants || _load_constants()).POSIX_GLOBAL_PREFIX); - } - - var binFolders = potentialPrefixFolders.map(function (prefix) { - return path.join(prefix, 'bin'); - }); - var prefixFolderQueryResult = yield (_fs || _load_fs()).getFirstSuitableFolder(binFolders); - var prefix = prefixFolderQueryResult.folder && path.dirname(prefixFolderQueryResult.folder); - - if (!prefix) { - config.reporter.warn(config.reporter.lang('noGlobalFolder', prefixFolderQueryResult.skipped.map(function (item) { - return path.dirname(item.folder); - }).join(', '))); - - return (_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX; - } - - return prefix; - }); - - return function getGlobalPrefix(_x3, _x4) { - return _ref7.apply(this, arguments); - }; -}(); - -var getBinFolder = exports.getBinFolder = function () { - var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { - var prefix = yield getGlobalPrefix(config, flags); - return path.resolve(prefix, 'bin'); - }); - - return function getBinFolder(_x5, _x6) { - return _ref8.apply(this, arguments); - }; -}(); - -var initUpdateBins = function () { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags) { - var beforeBins = yield getBins(config); - var binFolder = yield getBinFolder(config, flags); - - function throwPermError(err, dest) { - if (err.code === 'EACCES') { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noPermission', dest)); - } else { - throw err; - } - } - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - try { - yield (_fs || _load_fs()).mkdirp(binFolder); - } catch (err) { - throwPermError(err, binFolder); - } - - var afterBins = yield getBins(config); - - // remove old bins - for (var _iterator5 = beforeBins, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { - var _ref11; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref11 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref11 = _i5.value; - } - - var src = _ref11; - - if (afterBins.has(src)) { - // not old - continue; - } - - // remove old bin - var dest = path.join(binFolder, path.basename(src)); - try { - yield (_fs || _load_fs()).unlink(dest); - } catch (err) { - throwPermError(err, dest); - } - } - - // add new bins - for (var _iterator6 = afterBins, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { - var _ref12; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref12 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref12 = _i6.value; - } - - var _src = _ref12; - - // insert new bin - var dest = path.join(binFolder, path.basename(_src)); - try { - yield (_fs || _load_fs()).unlink(dest); - yield (0, (_packageLinker || _load_packageLinker()).linkBin)(_src, dest); - if (process.platform === 'win32' && dest.indexOf('.cmd') !== -1) { - yield (_fs || _load_fs()).rename(dest + '.cmd', dest); - } - } catch (err) { - throwPermError(err, dest); - } - } - }); - }); - - return function initUpdateBins(_x7, _x8, _x9) { - return _ref9.apply(this, arguments); - }; -}(); - -var list = function () { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - yield updateCwd(config); - - // install so we get hard file paths - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); - var install = new (_install || _load_install()).Install({}, config, new (_baseReporter || _load_baseReporter()).default(), lockfile); - var patterns = yield install.getFlattenedDeps(); - - // dump global modules - for (var _iterator7 = patterns, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { - var _ref14; - - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref14 = _iterator7[_i7++]; - } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref14 = _i7.value; - } - - var pattern = _ref14; - - var manifest = install.resolver.getStrictResolvedPattern(pattern); - ls(manifest, reporter, false); - } - }); - - return function list(_x10, _x11, _x12, _x13) { - return _ref13.apply(this, arguments); - }; -}(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(60); -} - -var _baseReporter; - -function _load_baseReporter() { - return _baseReporter = _interopRequireDefault(__webpack_require__(98)); -} - -var _buildSubCommands2; - -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62)); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -var _install; - -function _load_install() { - return _install = __webpack_require__(41); -} - -var _add; - -function _load_add() { - return _add = __webpack_require__(154); -} - -var _remove; - -function _load_remove() { - return _remove = __webpack_require__(301); -} - -var _upgrade; - -function _load_upgrade() { - return _upgrade = __webpack_require__(196); -} - -var _upgradeInteractive; - -function _load_upgradeInteractive() { - return _upgradeInteractive = __webpack_require__(304); -} - -var _packageLinker; - -function _load_packageLinker() { - return _packageLinker = __webpack_require__(200); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(13); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var GlobalAdd = function (_Add) { - (0, (_inherits2 || _load_inherits()).default)(GlobalAdd, _Add); - - function GlobalAdd(args, flags, config, reporter, lockfile) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GlobalAdd); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Add.call(this, args, flags, config, reporter, lockfile)); - - _this.linker.setTopLevelBinLinking(false); - return _this; - } - - GlobalAdd.prototype.maybeOutputSaveTree = function maybeOutputSaveTree() { - for (var _iterator = this.addedPatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var pattern = _ref; - - var manifest = this.resolver.getStrictResolvedPattern(pattern); - ls(manifest, this.reporter, true); - } - return (_promise || _load_promise()).default.resolve(); - }; - - GlobalAdd.prototype._logSuccessSaveLockfile = function _logSuccessSaveLockfile() { - // noop - }; - - return GlobalAdd; -}((_add || _load_add()).Add); - -var path = __webpack_require__(1); - -function hasWrapper(flags, args) { - return args[0] !== 'bin' && args[0] !== 'dir'; -} - -function ls(manifest, reporter, saved) { - var bins = manifest.bin ? (0, (_keys || _load_keys()).default)(manifest.bin) : []; - var human = `${manifest.name}@${manifest.version}`; - if (bins.length) { - if (saved) { - reporter.success(reporter.lang('packageInstalledWithBinaries', human)); - } else { - reporter.info(reporter.lang('packageHasBinaries', human)); - } - reporter.list(`bins-${manifest.name}`, bins); - } else if (saved) { - reporter.warn(reporter.lang('packageHasNoBinaries', human)); - } -} - -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('global', { - add(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield updateCwd(config); - - var updateBins = yield initUpdateBins(config, reporter, flags); - if (args.indexOf('yarn') !== -1) { - reporter.warn(reporter.lang('packageContainsYarnAsGlobal')); - } - - // install module - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); - var install = new GlobalAdd(args, flags, config, reporter, lockfile); - yield install.init(); - - // link binaries - yield updateBins(); - })(); - }, - - bin(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - reporter.log((yield getBinFolder(config, flags)), { force: true }); - })(); - }, - - dir(config, reporter, flags, args) { - reporter.log(config.globalFolder, { force: true }); - return (_promise || _load_promise()).default.resolve(); - }, - - ls(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - reporter.warn(`\`yarn global ls\` is deprecated. Please use \`yarn global list\`.`); - yield list(config, reporter, flags, args); - })(); - }, - - list(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield list(config, reporter, flags, args); - })(); - }, - - remove(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield updateCwd(config); - - var updateBins = yield initUpdateBins(config, reporter, flags); - - // remove module - yield (0, (_remove || _load_remove()).run)(config, reporter, flags, args); - - // remove binaries - yield updateBins(); - })(); - }, - - upgrade(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield updateCwd(config); - - var updateBins = yield initUpdateBins(config, reporter, flags); - - // upgrade module - yield (0, (_upgrade || _load_upgrade()).run)(config, reporter, flags, args); - - // update binaries - yield updateBins(); - })(); - }, - - upgradeInteractive(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield updateCwd(config); - - var updateBins = yield initUpdateBins(config, reporter, flags); - - // upgrade module - yield (0, (_upgradeInteractive || _load_upgradeInteractive()).run)(config, reporter, flags, args); - - // update binaries - yield updateBins(); - })(); - } -}), - run = _buildSubCommands.run, - _setFlags = _buildSubCommands.setFlags; - -exports.run = run; -function setFlags(commander) { - _setFlags(commander); - commander.description('Installs packages globally on your operating system.'); - commander.option('--prefix ', 'bin prefix to use to install binaries'); - commander.option('--latest', 'upgrade to the latest version of packages'); -} - -/***/ }), -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _path; - -function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(1)); -} - -var _invariant; - -function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(15)); -} - -var _semver; - -function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(27)); -} - -var _validate; - -function _load_validate() { - return _validate = __webpack_require__(119); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -var _packageReference; - -function _load_packageReference() { - return _packageReference = _interopRequireDefault(__webpack_require__(308)); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(75); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); -} - -var _version; - -function _load_version() { - return _version = _interopRequireWildcard(__webpack_require__(212)); -} - -var _workspaceResolver; - -function _load_workspaceResolver() { - return _workspaceResolver = _interopRequireDefault(__webpack_require__(558)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _normalizePattern4; - -function _load_normalizePattern() { - return _normalizePattern4 = __webpack_require__(52); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var micromatch = __webpack_require__(108); - -var PackageRequest = function () { - function PackageRequest(req, resolver) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageRequest); - - this.parentRequest = req.parentRequest; - this.parentNames = req.parentNames || []; - this.lockfile = resolver.lockfile; - this.registry = req.registry; - this.reporter = resolver.reporter; - this.resolver = resolver; - this.optional = req.optional; - this.hint = req.hint; - this.pattern = req.pattern; - this.config = resolver.config; - this.foundInfo = null; - } - - PackageRequest.prototype.init = function init() { - this.resolver.usedRegistries.add(this.registry); - }; - - PackageRequest.prototype.getLocked = function getLocked(remoteType) { - // always prioritise root lockfile - var shrunk = this.lockfile.getLocked(this.pattern); - - if (shrunk && shrunk.resolved) { - var resolvedParts = (_version || _load_version()).explodeHashedUrl(shrunk.resolved); - - // Detect Git protocols (git://HOST/PATH or git+PROTOCOL://HOST/PATH) - var preferredRemoteType = /^git(\+[a-z0-9]+)?:\/\//.test(resolvedParts.url) ? 'git' : remoteType; - - return { - name: shrunk.name, - version: shrunk.version, - _uid: shrunk.uid, - _remote: { - resolved: shrunk.resolved, - type: preferredRemoteType, - reference: resolvedParts.url, - hash: resolvedParts.hash, - integrity: shrunk.integrity, - registry: shrunk.registry, - packageName: shrunk.name - }, - optionalDependencies: shrunk.optionalDependencies || {}, - dependencies: shrunk.dependencies || {}, - prebuiltVariants: shrunk.prebuiltVariants || {} - }; - } else { - return null; - } - }; - - /** - * If the input pattern matches a registry one then attempt to find it on the registry. - * Otherwise fork off to an exotic resolver if one matches. - */ - - PackageRequest.prototype.findVersionOnRegistry = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pattern) { - var _ref2 = yield this.normalize(pattern), - range = _ref2.range, - name = _ref2.name; - - var exoticResolver = (0, (_index || _load_index()).getExoticResolver)(range); - if (exoticResolver) { - var data = yield this.findExoticVersionInfo(exoticResolver, range); - - // clone data as we're manipulating it in place and this could be resolved multiple - // times - data = (0, (_assign || _load_assign()).default)({}, data); - - // this is so the returned package response uses the overridden name. ie. if the - // package's actual name is `bar`, but it's been specified in the manifest like: - // "foo": "http://foo.com/bar.tar.gz" - // then we use the foo name - data.name = name; - return data; - } - - var Resolver = this.getRegistryResolver(); - var resolver = new Resolver(this, name, range); - try { - return yield resolver.resolve(); - } catch (err) { - // if it is not an error thrown by yarn and it has a parent request, - // thow a more readable error - if (!(err instanceof (_errors || _load_errors()).MessageError) && this.parentRequest && this.parentRequest.pattern) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('requiredPackageNotFoundRegistry', pattern, this.parentRequest.pattern, this.registry)); - } - throw err; - } - }); - - function findVersionOnRegistry(_x) { - return _ref.apply(this, arguments); - } - - return findVersionOnRegistry; - }(); - - /** - * Get the registry resolver associated with this package request. - */ - - PackageRequest.prototype.getRegistryResolver = function getRegistryResolver() { - var Resolver = (_index || _load_index()).registries[this.registry]; - if (Resolver) { - return Resolver; - } else { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('unknownRegistryResolver', this.registry)); - } - }; - - PackageRequest.prototype.normalizeRange = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pattern) { - if (pattern.indexOf(':') > -1 || pattern.indexOf('@') > -1 || (0, (_index || _load_index()).getExoticResolver)(pattern)) { - return pattern; - } - - if (!(_semver || _load_semver()).default.validRange(pattern)) { - try { - if (yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(this.config.cwd, pattern, (_constants || _load_constants()).NODE_PACKAGE_JSON))) { - this.reporter.warn(this.reporter.lang('implicitFileDeprecated', pattern)); - return `file:${pattern}`; - } - } catch (err) { - // pass - } - } - - return pattern; - }); - - function normalizeRange(_x2) { - return _ref3.apply(this, arguments); - } - - return normalizeRange; - }(); - - PackageRequest.prototype.normalize = function () { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pattern) { - var _normalizePattern = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern), - name = _normalizePattern.name, - range = _normalizePattern.range, - hasVersion = _normalizePattern.hasVersion; - - var newRange = yield this.normalizeRange(range); - return { name, range: newRange, hasVersion }; - }); - - function normalize(_x3) { - return _ref4.apply(this, arguments); - } - - return normalize; - }(); - - /** - * Construct an exotic resolver instance with the input `ExoticResolver` and `range`. - */ - - PackageRequest.prototype.findExoticVersionInfo = function findExoticVersionInfo(ExoticResolver, range) { - var resolver = new ExoticResolver(this, range); - return resolver.resolve(); - }; - - /** - * If the current pattern matches an exotic resolver then delegate to it or else try - * the registry. - */ - - PackageRequest.prototype.findVersionInfo = function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var exoticResolver = (0, (_index || _load_index()).getExoticResolver)(this.pattern); - if (exoticResolver) { - return this.findExoticVersionInfo(exoticResolver, this.pattern); - } else if ((_workspaceResolver || _load_workspaceResolver()).default.isWorkspace(this.pattern, this.resolver.workspaceLayout)) { - (0, (_invariant || _load_invariant()).default)(this.resolver.workspaceLayout, 'expected workspaceLayout'); - var resolver = new (_workspaceResolver || _load_workspaceResolver()).default(this, this.pattern, this.resolver.workspaceLayout); - var manifest = void 0; - if (this.config.focus && !(this.pattern.indexOf(this.resolver.workspaceLayout.virtualManifestName) !== -1) && !this.pattern.startsWith(this.config.focusedWorkspaceName + '@')) { - var localInfo = this.resolver.workspaceLayout.getManifestByPattern(this.pattern); - (0, (_invariant || _load_invariant()).default)(localInfo, 'expected local info for ' + this.pattern); - var localManifest = localInfo.manifest; - var requestPattern = localManifest.name + '@' + localManifest.version; - manifest = yield this.findVersionOnRegistry(requestPattern); - } - return resolver.resolve(manifest); - } else { - return this.findVersionOnRegistry(this.pattern); - } - }); - - function findVersionInfo() { - return _ref5.apply(this, arguments); - } - - return findVersionInfo; - }(); - - PackageRequest.prototype.reportResolvedRangeMatch = function reportResolvedRangeMatch(info, resolved) {}; - - /** - * Do the final resolve of a package that had a match with an existing version. - * After all unique versions have been discovered, so the best available version - * is found. - */ - - - PackageRequest.prototype.resolveToExistingVersion = function resolveToExistingVersion(info) { - // get final resolved version - var _normalizePattern2 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(this.pattern), - range = _normalizePattern2.range, - name = _normalizePattern2.name; - - var solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; - var resolved = this.resolver.getHighestRangeVersionMatch(name, solvedRange, info); - (0, (_invariant || _load_invariant()).default)(resolved, 'should have a resolved reference'); - - this.reportResolvedRangeMatch(info, resolved); - var ref = resolved._reference; - (0, (_invariant || _load_invariant()).default)(ref, 'Resolved package info has no package reference'); - ref.addRequest(this); - ref.addPattern(this.pattern, resolved); - ref.addOptional(this.optional); - }; - - /** - * TODO description - */ - - - PackageRequest.prototype.find = function () { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref7) { - var fresh = _ref7.fresh, - frozen = _ref7.frozen; - - // find version info for this package pattern - var info = yield this.findVersionInfo(); - - if (!(_semver || _load_semver()).default.valid(info.version)) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('invalidPackageVersion', info.name, info.version)); - } - - info.fresh = fresh; - (0, (_validate || _load_validate()).cleanDependencies)(info, false, this.reporter, function () { - // swallow warnings - }); - - // check if while we were resolving this dep we've already resolved one that satisfies - // the same range - - var _normalizePattern3 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(this.pattern), - range = _normalizePattern3.range, - name = _normalizePattern3.name; - - var solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; - var resolved = !info.fresh || frozen ? this.resolver.getExactVersionMatch(name, solvedRange, info) : this.resolver.getHighestRangeVersionMatch(name, solvedRange, info); - - if (resolved) { - this.resolver.reportPackageWithExistingVersion(this, info); - return; - } - - if (info.flat && !this.resolver.flat) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('flatGlobalError', `${info.name}@${info.version}`)); - } - - // validate version info - PackageRequest.validateVersionInfo(info, this.reporter); - - // - var remote = info._remote; - (0, (_invariant || _load_invariant()).default)(remote, 'Missing remote'); - - // set package reference - var ref = new (_packageReference || _load_packageReference()).default(this, info, remote); - ref.addPattern(this.pattern, info); - ref.addOptional(this.optional); - ref.setFresh(fresh); - info._reference = ref; - info._remote = remote; - // start installation of dependencies - var promises = []; - var deps = []; - var parentNames = [].concat(this.parentNames, [name]); - // normal deps - for (var depName in info.dependencies) { - var depPattern = depName + '@' + info.dependencies[depName]; - deps.push(depPattern); - promises.push(this.resolver.find({ - pattern: depPattern, - registry: remote.registry, - // dependencies of optional dependencies should themselves be optional - optional: this.optional, - parentRequest: this, - parentNames - })); - } - - // optional deps - for (var _depName in info.optionalDependencies) { - var _depPattern = _depName + '@' + info.optionalDependencies[_depName]; - deps.push(_depPattern); - promises.push(this.resolver.find({ - hint: 'optional', - pattern: _depPattern, - registry: remote.registry, - optional: true, - parentRequest: this, - parentNames - })); - } - if (remote.type === 'workspace' && !this.config.production) { - // workspaces support dev dependencies - for (var _depName2 in info.devDependencies) { - var _depPattern2 = _depName2 + '@' + info.devDependencies[_depName2]; - deps.push(_depPattern2); - promises.push(this.resolver.find({ - hint: 'dev', - pattern: _depPattern2, - registry: remote.registry, - optional: false, - parentRequest: this, - parentNames - })); - } - } - - for (var _iterator = promises, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref8; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref8 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref8 = _i.value; - } - - var promise = _ref8; - - yield promise; - } - - ref.addDependencies(deps); - - // Now that we have all dependencies, it's safe to propagate optional - for (var _iterator2 = ref.requests.slice(1), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref9; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref9 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref9 = _i2.value; - } - - var otherRequest = _ref9; - - ref.addOptional(otherRequest.optional); - } - }); - - function find(_x4) { - return _ref6.apply(this, arguments); - } - - return find; - }(); - - /** - * TODO description - */ - - PackageRequest.validateVersionInfo = function validateVersionInfo(info, reporter) { - // human readable name to use in errors - var human = `${info.name}@${info.version}`; - - info.version = PackageRequest.getPackageVersion(info); - - for (var _iterator3 = (_constants || _load_constants()).REQUIRED_PACKAGE_KEYS, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref10; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref10 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref10 = _i3.value; - } - - var key = _ref10; - - if (!info[key]) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('missingRequiredPackageKey', human, key)); - } - } - }; - - /** - * Returns the package version if present, else defaults to the uid - */ - - PackageRequest.getPackageVersion = function getPackageVersion(info) { - // TODO possibly reconsider this behaviour - return info.version === undefined ? info._uid : info.version; - }; - - /** - * Gets all of the outdated packages and sorts them appropriately - */ - - PackageRequest.getOutdatedPackages = function () { - var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (lockfile, install, config, reporter, filterByPatterns, flags) { - var _ref12 = yield install.fetchRequestFromCwd(), - reqPatterns = _ref12.requests, - workspaceLayout = _ref12.workspaceLayout; - - // Filter out workspace patterns if necessary - - - var depReqPatterns = workspaceLayout ? reqPatterns.filter(function (p) { - return !workspaceLayout.getManifestByPattern(p.pattern); - }) : reqPatterns; - - // filter the list down to just the packages requested. - // prevents us from having to query the metadata for all packages. - if (filterByPatterns && filterByPatterns.length || flags && flags.pattern) { - var filterByNames = filterByPatterns && filterByPatterns.length ? filterByPatterns.map(function (pattern) { - return (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern).name; - }) : []; - depReqPatterns = depReqPatterns.filter(function (dep) { - return filterByNames.indexOf((0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(dep.pattern).name) >= 0 || flags && flags.pattern && micromatch.contains((0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(dep.pattern).name, flags.pattern); - }); - } - - var deps = yield (_promise || _load_promise()).default.all(depReqPatterns.map(function () { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref14) { - var pattern = _ref14.pattern, - hint = _ref14.hint, - workspaceName = _ref14.workspaceName, - workspaceLoc = _ref14.workspaceLoc; - - var locked = lockfile.getLocked(pattern); - if (!locked) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('lockfileOutdated')); - } - - var name = locked.name, - current = locked.version; - - var latest = ''; - var wanted = ''; - var url = ''; - - var normalized = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern); - - if ((0, (_index || _load_index()).getExoticResolver)(pattern) || (0, (_index || _load_index()).getExoticResolver)(normalized.range)) { - latest = wanted = 'exotic'; - url = normalized.range; - } else { - var registry = config.registries[locked.registry]; - - var _ref15 = yield registry.checkOutdated(config, name, normalized.range); - - latest = _ref15.latest; - wanted = _ref15.wanted; - url = _ref15.url; - } - - return { - name, - current, - wanted, - latest, - url, - hint, - range: normalized.range, - upgradeTo: '', - workspaceName: workspaceName || '', - workspaceLoc: workspaceLoc || '' - }; - }); - - return function (_x11) { - return _ref13.apply(this, arguments); - }; - }())); - - // Make sure to always output `exotic` versions to be compatible with npm - var isDepOld = function isDepOld(_ref16) { - var current = _ref16.current, - latest = _ref16.latest, - wanted = _ref16.wanted; - return latest === 'exotic' || (_semver || _load_semver()).default.lt(current, wanted) || (_semver || _load_semver()).default.lt(current, latest); - }; - var orderByName = function orderByName(depA, depB) { - return depA.name.localeCompare(depB.name); - }; - return deps.filter(isDepOld).sort(orderByName); - }); - - function getOutdatedPackages(_x5, _x6, _x7, _x8, _x9, _x10) { - return _ref11.apply(this, arguments); - } - - return getOutdatedPackages; - }(); - - return PackageRequest; -}(); - -exports.default = PackageRequest; - -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var BaseResolver = function () { - function BaseResolver(request, fragment) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseResolver); - - this.resolver = request.resolver; - this.reporter = request.reporter; - this.fragment = fragment; - this.registry = request.registry; - this.request = request; - this.pattern = request.pattern; - this.config = request.config; - } - - BaseResolver.prototype.fork = function fork(Resolver, resolveArg) { - for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } - - var resolver = new (Function.prototype.bind.apply(Resolver, [null].concat([this.request], args)))(); - resolver.registry = this.registry; - return resolver.resolve(resolveArg); - }; - - BaseResolver.prototype.resolve = function resolve(resolveArg) { - throw new Error('Not implemented'); - }; - - return BaseResolver; -}(); - -exports.default = BaseResolver; - -/***/ }), -/* 118 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(75); -} - -var _misc; - -function _load_misc() { - return _misc = _interopRequireWildcard(__webpack_require__(28)); -} - -var _version; - -function _load_version() { - return _version = _interopRequireWildcard(__webpack_require__(212)); -} - -var _guessName; - -function _load_guessName() { - return _guessName = _interopRequireDefault(__webpack_require__(159)); -} - -var _index2; - -function _load_index2() { - return _index2 = __webpack_require__(60); -} - -var _exoticResolver; - -function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(85)); -} - -var _git; - -function _load_git() { - return _git = _interopRequireDefault(__webpack_require__(207)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var urlParse = __webpack_require__(29).parse; - -var GIT_HOSTS = ['github.com', 'gitlab.com', 'bitbucket.com', 'bitbucket.org']; - -var GIT_PATTERN_MATCHERS = [/^git:/, /^git\+.+:/, /^ssh:/, /^https?:.+\.git$/, /^https?:.+\.git#.+/]; - -var GitResolver = function (_ExoticResolver) { - (0, (_inherits2 || _load_inherits()).default)(GitResolver, _ExoticResolver); - - function GitResolver(request, fragment) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GitResolver); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment)); - - var _versionUtil$explodeH = (_version || _load_version()).explodeHashedUrl(fragment), - url = _versionUtil$explodeH.url, - hash = _versionUtil$explodeH.hash; - - _this.url = url; - _this.hash = hash; - return _this; - } - - GitResolver.isVersion = function isVersion(pattern) { - for (var _iterator = GIT_PATTERN_MATCHERS, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var matcher = _ref; - - if (matcher.test(pattern)) { - return true; - } - } - - var _urlParse = urlParse(pattern), - hostname = _urlParse.hostname, - path = _urlParse.path; - - if (hostname && path && GIT_HOSTS.indexOf(hostname) >= 0) { - // only if dependency is pointing to a git repo, - // e.g. facebook/flow and not file in a git repo facebook/flow/archive/v1.0.0.tar.gz - return path.split('/').filter(function (p) { - return !!p; - }).length === 2; - } - - return false; - }; - - GitResolver.prototype.resolve = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (forked) { - var tryRegistry = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) { - var filename = (_index2 || _load_index2()).registries[registry].filename; - - var file = yield client.getFile(filename); - if (!file) { - return null; - } - - var json = yield config.readJson(`${url}/${filename}`, function () { - return JSON.parse(file); - }); - json._uid = commit; - json._remote = { - resolved: `${url}#${commit}`, - type: 'git', - reference: url, - hash: commit, - registry - }; - return json; - }); - - return function tryRegistry(_x2) { - return _ref3.apply(this, arguments); - }; - }(); - - var url = this.url; - - // shortcut for hosted git. we will fallback to a GitResolver if the hosted git - // optimisations fail which the `forked` flag indicates so we don't get into an - // infinite loop - - var parts = urlParse(url); - if (false) { - // check if this git url uses any of the hostnames defined in our hosted git resolvers - for (var name in (_index || _load_index()).hostedGit) { - var Resolver = (_index || _load_index()).hostedGit[name]; - if (Resolver.hostname !== parts.hostname) { - continue; - } - - // we have a match! clean up the pathname of url artifacts - var pathname = parts.pathname; - pathname = (_misc || _load_misc()).removePrefix(pathname, '/'); // remove prefixed slash - pathname = (_misc || _load_misc()).removeSuffix(pathname, '.git'); // remove .git suffix if present - - var _url = `${pathname}${this.hash ? '#' + decodeURIComponent(this.hash) : ''}`; - return this.fork(Resolver, false, _url); - } - } - - // get from lockfile - var shrunk = this.request.getLocked('git'); - if (shrunk) { - return shrunk; - } - - var config = this.config; - - - var gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url); - var client = new (_git || _load_git()).default(config, gitUrl, this.hash); - var commit = yield client.init(); - - var file = yield tryRegistry(this.registry); - if (file) { - return file; - } - - for (var registry in (_index2 || _load_index2()).registries) { - if (registry === this.registry) { - continue; - } - - var _file = yield tryRegistry(registry); - if (_file) { - return _file; - } - } - - return { - // This is just the default, it can be overridden with key of dependencies - name: (0, (_guessName || _load_guessName()).default)(url), - version: '0.0.0', - _uid: commit, - _remote: { - resolved: `${url}#${commit}`, - type: 'git', - reference: url, - hash: commit, - registry: 'npm' - } - }; - }); - - function resolve(_x) { - return _ref2.apply(this, arguments); - } - - return resolve; - }(); - - return GitResolver; -}((_exoticResolver || _load_exoticResolver()).default); - -exports.default = GitResolver; - -/***/ }), -/* 119 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(42)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -exports.isValidPackageName = isValidPackageName; - -exports.default = function (info, isRoot, reporter, warn) { - if (isRoot) { - for (var key in (_typos || _load_typos()).default) { - if (key in info) { - warn(reporter.lang('manifestPotentialTypo', key, (_typos || _load_typos()).default[key])); - } - } - } - - // validate name - var name = info.name; - - if (typeof name === 'string') { - if (isRoot && isBuiltinModule(name)) { - warn(reporter.lang('manifestBuiltinModule', name)); - } - - // cannot start with a dot - if (name[0] === '.') { - throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameDot')); - } - - // cannot contain the following characters - if (!isValidPackageName(name)) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameIllegalChars')); - } - - // cannot equal node_modules or favicon.ico - var lower = name.toLowerCase(); - if (lower === 'node_modules' || lower === 'favicon.ico') { - throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameBlacklisted')); - } - } - - // validate license - if (isRoot && !info.private) { - if (typeof info.license === 'string') { - var license = info.license.replace(/\*$/g, ''); - if (!(0, (_util || _load_util()).isValidLicense)(license)) { - warn(reporter.lang('manifestLicenseInvalid')); - } - } else { - warn(reporter.lang('manifestLicenseNone')); - } - } - - // validate strings - for (var _iterator = strings, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var _key = _ref; - - var val = info[_key]; - if (val && typeof val !== 'string') { - throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestStringExpected', _key)); - } - } - - cleanDependencies(info, isRoot, reporter, warn); -}; - -exports.cleanDependencies = cleanDependencies; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _util; - -function _load_util() { - return _util = __webpack_require__(209); -} - -var _typos; - -function _load_typos() { - return _typos = _interopRequireDefault(__webpack_require__(576)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var isBuiltinModule = __webpack_require__(779); - -var strings = ['name', 'version']; - -var dependencyKeys = [ -// npm registry will include optionalDependencies in dependencies and we'll want to dedupe them from the -// other fields first -'optionalDependencies', - -// it's seemingly common to include a dependency in dependencies and devDependencies of the same name but -// different ranges, this can cause a lot of issues with our determinism and the behaviour of npm is -// currently unspecified. -'dependencies', 'devDependencies']; - -function isValidName(name) { - return !name.match(/[\/@\s\+%:]/) && encodeURIComponent(name) === name; -} - -function isValidScopedName(name) { - if (name[0] !== '@') { - return false; - } - - var parts = name.slice(1).split('/'); - return parts.length === 2 && isValidName(parts[0]) && isValidName(parts[1]); -} - -function isValidPackageName(name) { - return isValidName(name) || isValidScopedName(name); -} - -function cleanDependencies(info, isRoot, reporter, warn) { - // get dependency objects - var depTypes = []; - for (var _iterator2 = dependencyKeys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref2; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } - - var _type = _ref2; - - var deps = info[_type]; - if (!deps || typeof deps !== 'object') { - continue; - } - depTypes.push([_type, deps]); - } - - // aggregate all non-trivial deps (not '' or '*') - var nonTrivialDeps = new (_map || _load_map()).default(); - for (var _iterator3 = depTypes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref4; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } - - var _ref3 = _ref4; - var _type2 = _ref3[0]; - var deps = _ref3[1]; - - for (var _iterator5 = (0, (_keys || _load_keys()).default)(deps), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { - var _ref7; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref7 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref7 = _i5.value; - } - - var name = _ref7; - - var _version = deps[name]; - if (!nonTrivialDeps.has(name) && _version && _version !== '*') { - nonTrivialDeps.set(name, { type: _type2, version: _version }); - } - } - } - - // overwrite first dep of package with non-trivial version, remove the rest - var setDeps = new (_set || _load_set()).default(); - for (var _iterator4 = depTypes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref6; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref6 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref6 = _i4.value; - } - - var _ref5 = _ref6; - var _type3 = _ref5[0]; - var _deps = _ref5[1]; - - for (var _iterator6 = (0, (_keys || _load_keys()).default)(_deps), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { - var _ref8; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref8 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref8 = _i6.value; - } - - var _name = _ref8; - - var _version2 = _deps[_name]; - - var dep = nonTrivialDeps.get(_name); - if (dep) { - if (_version2 && _version2 !== '*' && _version2 !== dep.version && isRoot) { - // only throw a warning when at the root - warn(reporter.lang('manifestDependencyCollision', dep.type, _name, dep.version, _type3, _version2)); - } - _version2 = dep.version; - } - - if (setDeps.has(_name)) { - delete _deps[_name]; - } else { - _deps[_name] = _version2; - setDeps.add(_name); - } - } - } -} - -/***/ }), -/* 120 */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; - - -/***/ }), -/* 121 */ -/***/ (function(module, exports, __webpack_require__) { - -var ctx = __webpack_require__(67); -var call = __webpack_require__(338); -var isArrayIter = __webpack_require__(336); -var anObject = __webpack_require__(57); -var toLength = __webpack_require__(160); -var getIterFn = __webpack_require__(234); -var BREAK = {}; -var RETURN = {}; -var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { - var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); - var f = ctx(fn, that, entries ? 2 : 1); - var index = 0; - var length, step, iterator, result; - if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); - // fast case for arrays with default iterator - if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { - result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); - if (result === BREAK || result === RETURN) return result; - } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { - result = call(iterator, f, step.value, entries); - if (result === BREAK || result === RETURN) return result; - } -}; -exports.BREAK = BREAK; -exports.RETURN = RETURN; - - -/***/ }), -/* 122 */ -/***/ (function(module, exports) { - -module.exports = {}; - - -/***/ }), -/* 123 */ -/***/ (function(module, exports) { - -module.exports = true; - - -/***/ }), -/* 124 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = __webpack_require__(57); -var dPs = __webpack_require__(649); -var enumBugKeys = __webpack_require__(220); -var IE_PROTO = __webpack_require__(227)('IE_PROTO'); -var Empty = function () { /* empty */ }; -var PROTOTYPE = 'prototype'; - -// Create object with fake `null` prototype: use iframe Object with cleared prototype -var createDict = function () { - // Thrash, waste and sodomy: IE GC bug - var iframe = __webpack_require__(219)('iframe'); - var i = enumBugKeys.length; - var lt = '<'; - var gt = '>'; - var iframeDocument; - iframe.style.display = 'none'; - __webpack_require__(333).appendChild(iframe); - iframe.src = 'javascript:'; // eslint-disable-line no-script-url - // createDict = iframe.contentWindow.Object; - // html.removeChild(iframe); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); - iframeDocument.close(); - createDict = iframeDocument.F; - while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; - return createDict(); -}; - -module.exports = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - Empty[PROTOTYPE] = anObject(O); - result = new Empty(); - Empty[PROTOTYPE] = null; - // add "__proto__" for Object.getPrototypeOf polyfill - result[IE_PROTO] = O; - } else result = createDict(); - return Properties === undefined ? result : dPs(result, Properties); -}; - - -/***/ }), -/* 125 */ -/***/ (function(module, exports) { - -exports.f = {}.propertyIsEnumerable; - - -/***/ }), -/* 126 */ -/***/ (function(module, exports) { - -module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; -}; - - -/***/ }), -/* 127 */ -/***/ (function(module, exports, __webpack_require__) { - -var def = __webpack_require__(63).f; -var has = __webpack_require__(89); -var TAG = __webpack_require__(44)('toStringTag'); - -module.exports = function (it, tag, stat) { - if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); -}; - - -/***/ }), -/* 128 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(658); -var global = __webpack_require__(37); -var hide = __webpack_require__(77); -var Iterators = __webpack_require__(122); -var TO_STRING_TAG = __webpack_require__(44)('toStringTag'); - -var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + - 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + - 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + - 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + - 'TextTrackList,TouchList').split(','); - -for (var i = 0; i < DOMIterables.length; i++) { - var NAME = DOMIterables[i]; - var Collection = global[NAME]; - var proto = Collection && Collection.prototype; - if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); - Iterators[NAME] = Iterators.Array; -} - - -/***/ }), -/* 129 */ -/***/ (function(module, exports, __webpack_require__) { - -// Basic Javascript Elliptic Curve implementation -// Ported loosely from BouncyCastle's Java EC code -// Only Fp curves implemented for now - -// Requires jsbn.js and jsbn2.js -var BigInteger = __webpack_require__(79).BigInteger -var Barrett = BigInteger.prototype.Barrett - -// ---------------- -// ECFieldElementFp - -// constructor -function ECFieldElementFp(q,x) { - this.x = x; - // TODO if(x.compareTo(q) >= 0) error - this.q = q; -} - -function feFpEquals(other) { - if(other == this) return true; - return (this.q.equals(other.q) && this.x.equals(other.x)); -} - -function feFpToBigInteger() { - return this.x; -} - -function feFpNegate() { - return new ECFieldElementFp(this.q, this.x.negate().mod(this.q)); -} - -function feFpAdd(b) { - return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q)); -} - -function feFpSubtract(b) { - return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q)); -} - -function feFpMultiply(b) { - return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q)); -} - -function feFpSquare() { - return new ECFieldElementFp(this.q, this.x.square().mod(this.q)); -} - -function feFpDivide(b) { - return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q)); -} - -ECFieldElementFp.prototype.equals = feFpEquals; -ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger; -ECFieldElementFp.prototype.negate = feFpNegate; -ECFieldElementFp.prototype.add = feFpAdd; -ECFieldElementFp.prototype.subtract = feFpSubtract; -ECFieldElementFp.prototype.multiply = feFpMultiply; -ECFieldElementFp.prototype.square = feFpSquare; -ECFieldElementFp.prototype.divide = feFpDivide; - -// ---------------- -// ECPointFp - -// constructor -function ECPointFp(curve,x,y,z) { - this.curve = curve; - this.x = x; - this.y = y; - // Projective coordinates: either zinv == null or z * zinv == 1 - // z and zinv are just BigIntegers, not fieldElements - if(z == null) { - this.z = BigInteger.ONE; - } - else { - this.z = z; - } - this.zinv = null; - //TODO: compression flag -} - -function pointFpGetX() { - if(this.zinv == null) { - this.zinv = this.z.modInverse(this.curve.q); - } - var r = this.x.toBigInteger().multiply(this.zinv); - this.curve.reduce(r); - return this.curve.fromBigInteger(r); -} - -function pointFpGetY() { - if(this.zinv == null) { - this.zinv = this.z.modInverse(this.curve.q); - } - var r = this.y.toBigInteger().multiply(this.zinv); - this.curve.reduce(r); - return this.curve.fromBigInteger(r); -} - -function pointFpEquals(other) { - if(other == this) return true; - if(this.isInfinity()) return other.isInfinity(); - if(other.isInfinity()) return this.isInfinity(); - var u, v; - // u = Y2 * Z1 - Y1 * Z2 - u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q); - if(!u.equals(BigInteger.ZERO)) return false; - // v = X2 * Z1 - X1 * Z2 - v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q); - return v.equals(BigInteger.ZERO); -} - -function pointFpIsInfinity() { - if((this.x == null) && (this.y == null)) return true; - return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO); -} - -function pointFpNegate() { - return new ECPointFp(this.curve, this.x, this.y.negate(), this.z); -} - -function pointFpAdd(b) { - if(this.isInfinity()) return b; - if(b.isInfinity()) return this; - - // u = Y2 * Z1 - Y1 * Z2 - var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q); - // v = X2 * Z1 - X1 * Z2 - var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q); - - if(BigInteger.ZERO.equals(v)) { - if(BigInteger.ZERO.equals(u)) { - return this.twice(); // this == b, so double - } - return this.curve.getInfinity(); // this = -b, so infinity - } - - var THREE = new BigInteger("3"); - var x1 = this.x.toBigInteger(); - var y1 = this.y.toBigInteger(); - var x2 = b.x.toBigInteger(); - var y2 = b.y.toBigInteger(); - - var v2 = v.square(); - var v3 = v2.multiply(v); - var x1v2 = x1.multiply(v2); - var zu2 = u.square().multiply(this.z); - - // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3) - var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q); - // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3 - var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q); - // z3 = v^3 * z1 * z2 - var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q); - - return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); -} - -function pointFpTwice() { - if(this.isInfinity()) return this; - if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity(); - - // TODO: optimized handling of constants - var THREE = new BigInteger("3"); - var x1 = this.x.toBigInteger(); - var y1 = this.y.toBigInteger(); - - var y1z1 = y1.multiply(this.z); - var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q); - var a = this.curve.a.toBigInteger(); - - // w = 3 * x1^2 + a * z1^2 - var w = x1.square().multiply(THREE); - if(!BigInteger.ZERO.equals(a)) { - w = w.add(this.z.square().multiply(a)); - } - w = w.mod(this.curve.q); - //this.curve.reduce(w); - // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1) - var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q); - // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3 - var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q); - // z3 = 8 * (y1 * z1)^3 - var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q); - - return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); -} - -// Simple NAF (Non-Adjacent Form) multiplication algorithm -// TODO: modularize the multiplication algorithm -function pointFpMultiply(k) { - if(this.isInfinity()) return this; - if(k.signum() == 0) return this.curve.getInfinity(); - - var e = k; - var h = e.multiply(new BigInteger("3")); - - var neg = this.negate(); - var R = this; - - var i; - for(i = h.bitLength() - 2; i > 0; --i) { - R = R.twice(); - - var hBit = h.testBit(i); - var eBit = e.testBit(i); - - if (hBit != eBit) { - R = R.add(hBit ? this : neg); - } - } - - return R; -} - -// Compute this*j + x*k (simultaneous multiplication) -function pointFpMultiplyTwo(j,x,k) { - var i; - if(j.bitLength() > k.bitLength()) - i = j.bitLength() - 1; - else - i = k.bitLength() - 1; - - var R = this.curve.getInfinity(); - var both = this.add(x); - while(i >= 0) { - R = R.twice(); - if(j.testBit(i)) { - if(k.testBit(i)) { - R = R.add(both); - } - else { - R = R.add(this); - } - } - else { - if(k.testBit(i)) { - R = R.add(x); - } - } - --i; - } - - return R; -} - -ECPointFp.prototype.getX = pointFpGetX; -ECPointFp.prototype.getY = pointFpGetY; -ECPointFp.prototype.equals = pointFpEquals; -ECPointFp.prototype.isInfinity = pointFpIsInfinity; -ECPointFp.prototype.negate = pointFpNegate; -ECPointFp.prototype.add = pointFpAdd; -ECPointFp.prototype.twice = pointFpTwice; -ECPointFp.prototype.multiply = pointFpMultiply; -ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo; - -// ---------------- -// ECCurveFp - -// constructor -function ECCurveFp(q,a,b) { - this.q = q; - this.a = this.fromBigInteger(a); - this.b = this.fromBigInteger(b); - this.infinity = new ECPointFp(this, null, null); - this.reducer = new Barrett(this.q); -} - -function curveFpGetQ() { - return this.q; -} - -function curveFpGetA() { - return this.a; -} - -function curveFpGetB() { - return this.b; -} - -function curveFpEquals(other) { - if(other == this) return true; - return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b)); -} - -function curveFpGetInfinity() { - return this.infinity; -} - -function curveFpFromBigInteger(x) { - return new ECFieldElementFp(this.q, x); -} - -function curveReduce(x) { - this.reducer.reduce(x); -} - -// for now, work with hex strings because they're easier in JS -function curveFpDecodePointHex(s) { - switch(parseInt(s.substr(0,2), 16)) { // first byte - case 0: - return this.infinity; - case 2: - case 3: - // point compression not supported yet - return null; - case 4: - case 6: - case 7: - var len = (s.length - 2) / 2; - var xHex = s.substr(2, len); - var yHex = s.substr(len+2, len); - - return new ECPointFp(this, - this.fromBigInteger(new BigInteger(xHex, 16)), - this.fromBigInteger(new BigInteger(yHex, 16))); - - default: // unsupported - return null; - } -} - -function curveFpEncodePointHex(p) { - if (p.isInfinity()) return "00"; - var xHex = p.getX().toBigInteger().toString(16); - var yHex = p.getY().toBigInteger().toString(16); - var oLen = this.getQ().toString(16).length; - if ((oLen % 2) != 0) oLen++; - while (xHex.length < oLen) { - xHex = "0" + xHex; - } - while (yHex.length < oLen) { - yHex = "0" + yHex; - } - return "04" + xHex + yHex; -} - -ECCurveFp.prototype.getQ = curveFpGetQ; -ECCurveFp.prototype.getA = curveFpGetA; -ECCurveFp.prototype.getB = curveFpGetB; -ECCurveFp.prototype.equals = curveFpEquals; -ECCurveFp.prototype.getInfinity = curveFpGetInfinity; -ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger; -ECCurveFp.prototype.reduce = curveReduce; -//ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex; -ECCurveFp.prototype.encodePointHex = curveFpEncodePointHex; - -// from: https://github.com/kaielvin/jsbn-ec-point-compression -ECCurveFp.prototype.decodePointHex = function(s) -{ - var yIsEven; - switch(parseInt(s.substr(0,2), 16)) { // first byte - case 0: - return this.infinity; - case 2: - yIsEven = false; - case 3: - if(yIsEven == undefined) yIsEven = true; - var len = s.length - 2; - var xHex = s.substr(2, len); - var x = this.fromBigInteger(new BigInteger(xHex,16)); - var alpha = x.multiply(x.square().add(this.getA())).add(this.getB()); - var beta = alpha.sqrt(); - - if (beta == null) throw "Invalid point compression"; - - var betaValue = beta.toBigInteger(); - if (betaValue.testBit(0) != yIsEven) - { - // Use the other root - beta = this.fromBigInteger(this.getQ().subtract(betaValue)); - } - return new ECPointFp(this,x,beta); - case 4: - case 6: - case 7: - var len = (s.length - 2) / 2; - var xHex = s.substr(2, len); - var yHex = s.substr(len+2, len); - - return new ECPointFp(this, - this.fromBigInteger(new BigInteger(xHex, 16)), - this.fromBigInteger(new BigInteger(yHex, 16))); - - default: // unsupported - return null; - } -} -ECCurveFp.prototype.encodeCompressedPointHex = function(p) -{ - if (p.isInfinity()) return "00"; - var xHex = p.getX().toBigInteger().toString(16); - var oLen = this.getQ().toString(16).length; - if ((oLen % 2) != 0) oLen++; - while (xHex.length < oLen) - xHex = "0" + xHex; - var yPrefix; - if(p.getY().toBigInteger().isEven()) yPrefix = "02"; - else yPrefix = "03"; - - return yPrefix + xHex; -} - - -ECFieldElementFp.prototype.getR = function() -{ - if(this.r != undefined) return this.r; - - this.r = null; - var bitLength = this.q.bitLength(); - if (bitLength > 128) - { - var firstWord = this.q.shiftRight(bitLength - 64); - if (firstWord.intValue() == -1) - { - this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q); - } - } - return this.r; -} -ECFieldElementFp.prototype.modMult = function(x1,x2) -{ - return this.modReduce(x1.multiply(x2)); -} -ECFieldElementFp.prototype.modReduce = function(x) -{ - if (this.getR() != null) - { - var qLen = q.bitLength(); - while (x.bitLength() > (qLen + 1)) - { - var u = x.shiftRight(qLen); - var v = x.subtract(u.shiftLeft(qLen)); - if (!this.getR().equals(BigInteger.ONE)) - { - u = u.multiply(this.getR()); - } - x = u.add(v); - } - while (x.compareTo(q) >= 0) - { - x = x.subtract(q); - } - } - else - { - x = x.mod(q); - } - return x; -} -ECFieldElementFp.prototype.sqrt = function() -{ - if (!this.q.testBit(0)) throw "unsupported"; - - // p mod 4 == 3 - if (this.q.testBit(1)) - { - var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q)); - return z.square().equals(this) ? z : null; - } - - // p mod 4 == 1 - var qMinusOne = this.q.subtract(BigInteger.ONE); - - var legendreExponent = qMinusOne.shiftRight(1); - if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE))) - { - return null; - } - - var u = qMinusOne.shiftRight(2); - var k = u.shiftLeft(1).add(BigInteger.ONE); - - var Q = this.x; - var fourQ = modDouble(modDouble(Q)); - - var U, V; - do - { - var P; - do - { - P = new BigInteger(this.q.bitLength(), new SecureRandom()); - } - while (P.compareTo(this.q) >= 0 - || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne))); - - var result = this.lucasSequence(P, Q, k); - U = result[0]; - V = result[1]; - - if (this.modMult(V, V).equals(fourQ)) - { - // Integer division by 2, mod q - if (V.testBit(0)) - { - V = V.add(q); - } - - V = V.shiftRight(1); - - return new ECFieldElementFp(q,V); - } - } - while (U.equals(BigInteger.ONE) || U.equals(qMinusOne)); - - return null; -} -ECFieldElementFp.prototype.lucasSequence = function(P,Q,k) -{ - var n = k.bitLength(); - var s = k.getLowestSetBit(); - - var Uh = BigInteger.ONE; - var Vl = BigInteger.TWO; - var Vh = P; - var Ql = BigInteger.ONE; - var Qh = BigInteger.ONE; - - for (var j = n - 1; j >= s + 1; --j) - { - Ql = this.modMult(Ql, Qh); - - if (k.testBit(j)) - { - Qh = this.modMult(Ql, Q); - Uh = this.modMult(Uh, Vh); - Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); - Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1))); - } - else - { - Qh = Ql; - Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); - Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); - Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); - } - } - - Ql = this.modMult(Ql, Qh); - Qh = this.modMult(Ql, Q); - Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); - Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); - Ql = this.modMult(Ql, Qh); - - for (var j = 1; j <= s; ++j) - { - Uh = this.modMult(Uh, Vl); - Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); - Ql = this.modMult(Ql, Ql); - } - - return [ Uh, Vl ]; -} - -var exports = { - ECCurveFp: ECCurveFp, - ECPointFp: ECPointFp, - ECFieldElementFp: ECFieldElementFp -} - -module.exports = exports - - -/***/ }), -/* 130 */ -/***/ (function(module, exports) { - - -module.exports = function(det, rec, confidence, name, lang) { - this.confidence = confidence; - this.name = name || rec.name(det); - this.lang = lang; -}; - - -/***/ }), -/* 131 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// YAML error class. http://stackoverflow.com/questions/8458984 -// - - -function YAMLException(reason, mark) { - // Super constructor - Error.call(this); - - this.name = 'YAMLException'; - this.reason = reason; - this.mark = mark; - this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); - - // Include stack trace in error object - if (Error.captureStackTrace) { - // Chrome and NodeJS - Error.captureStackTrace(this, this.constructor); - } else { - // FF, IE 10+ and Safari 6+. Fallback for others - this.stack = (new Error()).stack || ''; - } -} - - -// Inherit from Error -YAMLException.prototype = Object.create(Error.prototype); -YAMLException.prototype.constructor = YAMLException; - - -YAMLException.prototype.toString = function toString(compact) { - var result = this.name + ': '; - - result += this.reason || '(unknown reason)'; - - if (!compact && this.mark) { - result += ' ' + this.mark.toString(); - } - - return result; -}; - - -module.exports = YAMLException; - - -/***/ }), -/* 132 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// JS-YAML's default schema for `safeLoad` function. -// It is not described in the YAML specification. -// -// This schema is based on standard YAML's Core schema and includes most of -// extra types described at YAML tag repository. (http://yaml.org/type/) - - - - - -var Schema = __webpack_require__(107); - - -module.exports = new Schema({ - include: [ - __webpack_require__(368) - ], - implicit: [ - __webpack_require__(814), - __webpack_require__(807) - ], - explicit: [ - __webpack_require__(799), - __webpack_require__(809), - __webpack_require__(810), - __webpack_require__(812) - ] -}); - - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -var wrappy = __webpack_require__(436) -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) - - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} - -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f -} - - -/***/ }), -/* 134 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = defaultIfEmpty; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); -/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ - - -function defaultIfEmpty(defaultValue) { - if (defaultValue === void 0) { - defaultValue = null; - } - return function (source) { return source.lift(new DefaultIfEmptyOperator(defaultValue)); }; -} -var DefaultIfEmptyOperator = /*@__PURE__*/ (function () { - function DefaultIfEmptyOperator(defaultValue) { - this.defaultValue = defaultValue; - } - DefaultIfEmptyOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue)); - }; - return DefaultIfEmptyOperator; -}()); -var DefaultIfEmptySubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DefaultIfEmptySubscriber, _super); - function DefaultIfEmptySubscriber(destination, defaultValue) { - var _this = _super.call(this, destination) || this; - _this.defaultValue = defaultValue; - _this.isEmpty = true; - return _this; - } - DefaultIfEmptySubscriber.prototype._next = function (value) { - this.isEmpty = false; - this.destination.next(value); - }; - DefaultIfEmptySubscriber.prototype._complete = function () { - if (this.isEmpty) { - this.destination.next(this.defaultValue); - } - this.destination.complete(); - }; - return DefaultIfEmptySubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); -//# sourceMappingURL=defaultIfEmpty.js.map - - -/***/ }), -/* 135 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = filter; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); -/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ - - -function filter(predicate, thisArg) { - return function filterOperatorFunction(source) { - return source.lift(new FilterOperator(predicate, thisArg)); - }; -} -var FilterOperator = /*@__PURE__*/ (function () { - function FilterOperator(predicate, thisArg) { - this.predicate = predicate; - this.thisArg = thisArg; - } - FilterOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg)); - }; - return FilterOperator; -}()); -var FilterSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](FilterSubscriber, _super); - function FilterSubscriber(destination, predicate, thisArg) { - var _this = _super.call(this, destination) || this; - _this.predicate = predicate; - _this.thisArg = thisArg; - _this.count = 0; - return _this; - } - FilterSubscriber.prototype._next = function (value) { - var result; - try { - result = this.predicate.call(this.thisArg, value, this.count++); - } - catch (err) { - this.destination.error(err); - return; - } - if (result) { - this.destination.next(value); - } - }; - return FilterSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); -//# sourceMappingURL=filter.js.map - - -/***/ }), -/* 136 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = mergeMap; -/* unused harmony export MergeMapOperator */ -/* unused harmony export MergeMapSubscriber */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_subscribeToResult__ = __webpack_require__(19); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__ = __webpack_require__(18); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__InnerSubscriber__ = __webpack_require__(80); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map__ = __webpack_require__(54); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__observable_from__ = __webpack_require__(64); -/** PURE_IMPORTS_START tslib,_util_subscribeToResult,_OuterSubscriber,_InnerSubscriber,_map,_observable_from PURE_IMPORTS_END */ - - - - - - -function mergeMap(project, resultSelector, concurrent) { - if (concurrent === void 0) { - concurrent = Number.POSITIVE_INFINITY; - } - if (typeof resultSelector === 'function') { - return function (source) { return source.pipe(mergeMap(function (a, i) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__observable_from__["a" /* from */])(project(a, i)).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__map__["a" /* map */])(function (b, ii) { return resultSelector(a, b, i, ii); })); }, concurrent)); }; - } - else if (typeof resultSelector === 'number') { - concurrent = resultSelector; - } - return function (source) { return source.lift(new MergeMapOperator(project, concurrent)); }; -} -var MergeMapOperator = /*@__PURE__*/ (function () { - function MergeMapOperator(project, concurrent) { - if (concurrent === void 0) { - concurrent = Number.POSITIVE_INFINITY; - } - this.project = project; - this.concurrent = concurrent; - } - MergeMapOperator.prototype.call = function (observer, source) { - return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent)); - }; - return MergeMapOperator; -}()); - -var MergeMapSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MergeMapSubscriber, _super); - function MergeMapSubscriber(destination, project, concurrent) { - if (concurrent === void 0) { - concurrent = Number.POSITIVE_INFINITY; - } - var _this = _super.call(this, destination) || this; - _this.project = project; - _this.concurrent = concurrent; - _this.hasCompleted = false; - _this.buffer = []; - _this.active = 0; - _this.index = 0; - return _this; - } - MergeMapSubscriber.prototype._next = function (value) { - if (this.active < this.concurrent) { - this._tryNext(value); - } - else { - this.buffer.push(value); - } - }; - MergeMapSubscriber.prototype._tryNext = function (value) { - var result; - var index = this.index++; - try { - result = this.project(value, index); - } - catch (err) { - this.destination.error(err); - return; - } - this.active++; - this._innerSub(result, value, index); - }; - MergeMapSubscriber.prototype._innerSub = function (ish, value, index) { - var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_3__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined); - var destination = this.destination; - destination.add(innerSubscriber); - __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_subscribeToResult__["a" /* subscribeToResult */])(this, ish, value, index, innerSubscriber); - }; - MergeMapSubscriber.prototype._complete = function () { - this.hasCompleted = true; - if (this.active === 0 && this.buffer.length === 0) { - this.destination.complete(); - } - this.unsubscribe(); - }; - MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.destination.next(innerValue); - }; - MergeMapSubscriber.prototype.notifyComplete = function (innerSub) { - var buffer = this.buffer; - this.remove(innerSub); - this.active--; - if (buffer.length > 0) { - this._next(buffer.shift()); - } - else if (this.active === 0 && this.hasCompleted) { - this.destination.complete(); - } - }; - return MergeMapSubscriber; -}(__WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__["a" /* OuterSubscriber */])); - -//# sourceMappingURL=mergeMap.js.map - - -/***/ }), -/* 137 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncAction; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Action__ = __webpack_require__(991); -/** PURE_IMPORTS_START tslib,_Action PURE_IMPORTS_END */ - - -var AsyncAction = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsyncAction, _super); - function AsyncAction(scheduler, work) { - var _this = _super.call(this, scheduler, work) || this; - _this.scheduler = scheduler; - _this.work = work; - _this.pending = false; - return _this; - } - AsyncAction.prototype.schedule = function (state, delay) { - if (delay === void 0) { - delay = 0; - } - if (this.closed) { - return this; - } - this.state = state; - var id = this.id; - var scheduler = this.scheduler; - if (id != null) { - this.id = this.recycleAsyncId(scheduler, id, delay); - } - this.pending = true; - this.delay = delay; - this.id = this.id || this.requestAsyncId(scheduler, this.id, delay); - return this; - }; - AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) { - if (delay === void 0) { - delay = 0; - } - return setInterval(scheduler.flush.bind(scheduler, this), delay); - }; - AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) { - if (delay === void 0) { - delay = 0; - } - if (delay !== null && this.delay === delay && this.pending === false) { - return id; - } - clearInterval(id); - }; - AsyncAction.prototype.execute = function (state, delay) { - if (this.closed) { - return new Error('executing a cancelled action'); - } - this.pending = false; - var error = this._execute(state, delay); - if (error) { - return error; - } - else if (this.pending === false && this.id != null) { - this.id = this.recycleAsyncId(this.scheduler, this.id, null); - } - }; - AsyncAction.prototype._execute = function (state, delay) { - var errored = false; - var errorValue = undefined; - try { - this.work(state); - } - catch (e) { - errored = true; - errorValue = !!e && e || new Error(e); - } - if (errored) { - this.unsubscribe(); - return errorValue; - } - }; - AsyncAction.prototype._unsubscribe = function () { - var id = this.id; - var scheduler = this.scheduler; - var actions = scheduler.actions; - var index = actions.indexOf(this); - this.work = null; - this.state = null; - this.pending = false; - this.scheduler = null; - if (index !== -1) { - actions.splice(index, 1); - } - if (id != null) { - this.id = this.recycleAsyncId(scheduler, id, null); - } - this.delay = null; - }; - return AsyncAction; -}(__WEBPACK_IMPORTED_MODULE_1__Action__["a" /* Action */])); - -//# sourceMappingURL=AsyncAction.js.map - - -/***/ }), -/* 138 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncScheduler; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Scheduler__ = __webpack_require__(391); -/** PURE_IMPORTS_START tslib,_Scheduler PURE_IMPORTS_END */ - - -var AsyncScheduler = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsyncScheduler, _super); - function AsyncScheduler(SchedulerAction, now) { - if (now === void 0) { - now = __WEBPACK_IMPORTED_MODULE_1__Scheduler__["a" /* Scheduler */].now; - } - var _this = _super.call(this, SchedulerAction, function () { - if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) { - return AsyncScheduler.delegate.now(); - } - else { - return now(); - } - }) || this; - _this.actions = []; - _this.active = false; - _this.scheduled = undefined; - return _this; - } - AsyncScheduler.prototype.schedule = function (work, delay, state) { - if (delay === void 0) { - delay = 0; - } - if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) { - return AsyncScheduler.delegate.schedule(work, delay, state); - } - else { - return _super.prototype.schedule.call(this, work, delay, state); - } - }; - AsyncScheduler.prototype.flush = function (action) { - var actions = this.actions; - if (this.active) { - actions.push(action); - return; - } - var error; - this.active = true; - do { - if (error = action.execute(action.state, action.delay)) { - break; - } - } while (action = actions.shift()); - this.active = false; - if (error) { - while (action = actions.shift()) { - action.unsubscribe(); - } - throw error; - } - }; - return AsyncScheduler; -}(__WEBPACK_IMPORTED_MODULE_1__Scheduler__["a" /* Scheduler */])); - -//# sourceMappingURL=AsyncScheduler.js.map - - -/***/ }), -/* 139 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export getSymbolIterator */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return iterator; }); -/* unused harmony export $$iterator */ -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function getSymbolIterator() { - if (typeof Symbol !== 'function' || !Symbol.iterator) { - return '@@iterator'; - } - return Symbol.iterator; -} -var iterator = /*@__PURE__*/ getSymbolIterator(); -var $$iterator = iterator; -//# sourceMappingURL=iterator.js.map - - -/***/ }), -/* 140 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArgumentOutOfRangeError; }); -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function ArgumentOutOfRangeErrorImpl() { - Error.call(this); - this.message = 'argument out of range'; - this.name = 'ArgumentOutOfRangeError'; - return this; -} -ArgumentOutOfRangeErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype); -var ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl; -//# sourceMappingURL=ArgumentOutOfRangeError.js.map - - -/***/ }), -/* 141 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EmptyError; }); -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function EmptyErrorImpl() { - Error.call(this); - this.message = 'no elements in sequence'; - this.name = 'EmptyError'; - return this; -} -EmptyErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype); -var EmptyError = EmptyErrorImpl; -//# sourceMappingURL=EmptyError.js.map - - -/***/ }), -/* 142 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = isFunction; -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function isFunction(x) { - return typeof x === 'function'; -} -//# sourceMappingURL=isFunction.js.map - - -/***/ }), -/* 143 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2016 Joyent, Inc. - -module.exports = Certificate; - -var assert = __webpack_require__(22); -var Buffer = __webpack_require__(20).Buffer; -var algs = __webpack_require__(38); -var crypto = __webpack_require__(21); -var Fingerprint = __webpack_require__(144); -var Signature = __webpack_require__(70); -var errs = __webpack_require__(69); -var util = __webpack_require__(9); -var utils = __webpack_require__(32); -var Key = __webpack_require__(34); -var PrivateKey = __webpack_require__(39); -var Identity = __webpack_require__(146); - -var formats = {}; -formats['openssh'] = __webpack_require__(1013); -formats['x509'] = __webpack_require__(427); -formats['pem'] = __webpack_require__(1014); - -var CertificateParseError = errs.CertificateParseError; -var InvalidAlgorithmError = errs.InvalidAlgorithmError; - -function Certificate(opts) { - assert.object(opts, 'options'); - assert.arrayOfObject(opts.subjects, 'options.subjects'); - utils.assertCompatible(opts.subjects[0], Identity, [1, 0], - 'options.subjects'); - utils.assertCompatible(opts.subjectKey, Key, [1, 0], - 'options.subjectKey'); - utils.assertCompatible(opts.issuer, Identity, [1, 0], 'options.issuer'); - if (opts.issuerKey !== undefined) { - utils.assertCompatible(opts.issuerKey, Key, [1, 0], - 'options.issuerKey'); - } - assert.object(opts.signatures, 'options.signatures'); - assert.buffer(opts.serial, 'options.serial'); - assert.date(opts.validFrom, 'options.validFrom'); - assert.date(opts.validUntil, 'optons.validUntil'); - - assert.optionalArrayOfString(opts.purposes, 'options.purposes'); - - this._hashCache = {}; - - this.subjects = opts.subjects; - this.issuer = opts.issuer; - this.subjectKey = opts.subjectKey; - this.issuerKey = opts.issuerKey; - this.signatures = opts.signatures; - this.serial = opts.serial; - this.validFrom = opts.validFrom; - this.validUntil = opts.validUntil; - this.purposes = opts.purposes; -} - -Certificate.formats = formats; - -Certificate.prototype.toBuffer = function (format, options) { - if (format === undefined) - format = 'x509'; - assert.string(format, 'format'); - assert.object(formats[format], 'formats[format]'); - assert.optionalObject(options, 'options'); - - return (formats[format].write(this, options)); -}; - -Certificate.prototype.toString = function (format, options) { - if (format === undefined) - format = 'pem'; - return (this.toBuffer(format, options).toString()); -}; - -Certificate.prototype.fingerprint = function (algo) { - if (algo === undefined) - algo = 'sha256'; - assert.string(algo, 'algorithm'); - var opts = { - type: 'certificate', - hash: this.hash(algo), - algorithm: algo - }; - return (new Fingerprint(opts)); -}; - -Certificate.prototype.hash = function (algo) { - assert.string(algo, 'algorithm'); - algo = algo.toLowerCase(); - if (algs.hashAlgs[algo] === undefined) - throw (new InvalidAlgorithmError(algo)); - - if (this._hashCache[algo]) - return (this._hashCache[algo]); - - var hash = crypto.createHash(algo). - update(this.toBuffer('x509')).digest(); - this._hashCache[algo] = hash; - return (hash); -}; - -Certificate.prototype.isExpired = function (when) { - if (when === undefined) - when = new Date(); - return (!((when.getTime() >= this.validFrom.getTime()) && - (when.getTime() < this.validUntil.getTime()))); -}; - -Certificate.prototype.isSignedBy = function (issuerCert) { - utils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer'); - - if (!this.issuer.equals(issuerCert.subjects[0])) - return (false); - if (this.issuer.purposes && this.issuer.purposes.length > 0 && - this.issuer.purposes.indexOf('ca') === -1) { - return (false); - } - - return (this.isSignedByKey(issuerCert.subjectKey)); -}; - -Certificate.prototype.isSignedByKey = function (issuerKey) { - utils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey'); - - if (this.issuerKey !== undefined) { - return (this.issuerKey. - fingerprint('sha512').matches(issuerKey)); - } - - var fmt = Object.keys(this.signatures)[0]; - var valid = formats[fmt].verify(this, issuerKey); - if (valid) - this.issuerKey = issuerKey; - return (valid); -}; - -Certificate.prototype.signWith = function (key) { - utils.assertCompatible(key, PrivateKey, [1, 2], 'key'); - var fmts = Object.keys(formats); - var didOne = false; - for (var i = 0; i < fmts.length; ++i) { - if (fmts[i] !== 'pem') { - var ret = formats[fmts[i]].sign(this, key); - if (ret === true) - didOne = true; - } - } - if (!didOne) { - throw (new Error('Failed to sign the certificate for any ' + - 'available certificate formats')); - } -}; - -Certificate.createSelfSigned = function (subjectOrSubjects, key, options) { - var subjects; - if (Array.isArray(subjectOrSubjects)) - subjects = subjectOrSubjects; - else - subjects = [subjectOrSubjects]; - - assert.arrayOfObject(subjects); - subjects.forEach(function (subject) { - utils.assertCompatible(subject, Identity, [1, 0], 'subject'); - }); - - utils.assertCompatible(key, PrivateKey, [1, 2], 'private key'); - - assert.optionalObject(options, 'options'); - if (options === undefined) - options = {}; - assert.optionalObject(options.validFrom, 'options.validFrom'); - assert.optionalObject(options.validUntil, 'options.validUntil'); - var validFrom = options.validFrom; - var validUntil = options.validUntil; - if (validFrom === undefined) - validFrom = new Date(); - if (validUntil === undefined) { - assert.optionalNumber(options.lifetime, 'options.lifetime'); - var lifetime = options.lifetime; - if (lifetime === undefined) - lifetime = 10*365*24*3600; - validUntil = new Date(); - validUntil.setTime(validUntil.getTime() + lifetime*1000); - } - assert.optionalBuffer(options.serial, 'options.serial'); - var serial = options.serial; - if (serial === undefined) - serial = Buffer.from('0000000000000001', 'hex'); - - var purposes = options.purposes; - if (purposes === undefined) - purposes = []; - - if (purposes.indexOf('signature') === -1) - purposes.push('signature'); - - /* Self-signed certs are always CAs. */ - if (purposes.indexOf('ca') === -1) - purposes.push('ca'); - if (purposes.indexOf('crl') === -1) - purposes.push('crl'); - - /* - * If we weren't explicitly given any other purposes, do the sensible - * thing and add some basic ones depending on the subject type. - */ - if (purposes.length <= 3) { - var hostSubjects = subjects.filter(function (subject) { - return (subject.type === 'host'); - }); - var userSubjects = subjects.filter(function (subject) { - return (subject.type === 'user'); - }); - if (hostSubjects.length > 0) { - if (purposes.indexOf('serverAuth') === -1) - purposes.push('serverAuth'); - } - if (userSubjects.length > 0) { - if (purposes.indexOf('clientAuth') === -1) - purposes.push('clientAuth'); - } - if (userSubjects.length > 0 || hostSubjects.length > 0) { - if (purposes.indexOf('keyAgreement') === -1) - purposes.push('keyAgreement'); - if (key.type === 'rsa' && - purposes.indexOf('encryption') === -1) - purposes.push('encryption'); - } - } - - var cert = new Certificate({ - subjects: subjects, - issuer: subjects[0], - subjectKey: key.toPublic(), - issuerKey: key.toPublic(), - signatures: {}, - serial: serial, - validFrom: validFrom, - validUntil: validUntil, - purposes: purposes - }); - cert.signWith(key); - - return (cert); -}; - -Certificate.create = - function (subjectOrSubjects, key, issuer, issuerKey, options) { - var subjects; - if (Array.isArray(subjectOrSubjects)) - subjects = subjectOrSubjects; - else - subjects = [subjectOrSubjects]; - - assert.arrayOfObject(subjects); - subjects.forEach(function (subject) { - utils.assertCompatible(subject, Identity, [1, 0], 'subject'); - }); - - utils.assertCompatible(key, Key, [1, 0], 'key'); - if (PrivateKey.isPrivateKey(key)) - key = key.toPublic(); - utils.assertCompatible(issuer, Identity, [1, 0], 'issuer'); - utils.assertCompatible(issuerKey, PrivateKey, [1, 2], 'issuer key'); - - assert.optionalObject(options, 'options'); - if (options === undefined) - options = {}; - assert.optionalObject(options.validFrom, 'options.validFrom'); - assert.optionalObject(options.validUntil, 'options.validUntil'); - var validFrom = options.validFrom; - var validUntil = options.validUntil; - if (validFrom === undefined) - validFrom = new Date(); - if (validUntil === undefined) { - assert.optionalNumber(options.lifetime, 'options.lifetime'); - var lifetime = options.lifetime; - if (lifetime === undefined) - lifetime = 10*365*24*3600; - validUntil = new Date(); - validUntil.setTime(validUntil.getTime() + lifetime*1000); - } - assert.optionalBuffer(options.serial, 'options.serial'); - var serial = options.serial; - if (serial === undefined) - serial = Buffer.from('0000000000000001', 'hex'); - - var purposes = options.purposes; - if (purposes === undefined) - purposes = []; - - if (purposes.indexOf('signature') === -1) - purposes.push('signature'); - - if (options.ca === true) { - if (purposes.indexOf('ca') === -1) - purposes.push('ca'); - if (purposes.indexOf('crl') === -1) - purposes.push('crl'); - } - - var hostSubjects = subjects.filter(function (subject) { - return (subject.type === 'host'); - }); - var userSubjects = subjects.filter(function (subject) { - return (subject.type === 'user'); - }); - if (hostSubjects.length > 0) { - if (purposes.indexOf('serverAuth') === -1) - purposes.push('serverAuth'); - } - if (userSubjects.length > 0) { - if (purposes.indexOf('clientAuth') === -1) - purposes.push('clientAuth'); - } - if (userSubjects.length > 0 || hostSubjects.length > 0) { - if (purposes.indexOf('keyAgreement') === -1) - purposes.push('keyAgreement'); - if (key.type === 'rsa' && - purposes.indexOf('encryption') === -1) - purposes.push('encryption'); - } - - var cert = new Certificate({ - subjects: subjects, - issuer: issuer, - subjectKey: key, - issuerKey: issuerKey.toPublic(), - signatures: {}, - serial: serial, - validFrom: validFrom, - validUntil: validUntil, - purposes: purposes - }); - cert.signWith(issuerKey); - - return (cert); -}; - -Certificate.parse = function (data, format, options) { - if (typeof (data) !== 'string') - assert.buffer(data, 'data'); - if (format === undefined) - format = 'auto'; - assert.string(format, 'format'); - if (typeof (options) === 'string') - options = { filename: options }; - assert.optionalObject(options, 'options'); - if (options === undefined) - options = {}; - assert.optionalString(options.filename, 'options.filename'); - if (options.filename === undefined) - options.filename = '(unnamed)'; - - assert.object(formats[format], 'formats[format]'); - - try { - var k = formats[format].read(data, options); - return (k); - } catch (e) { - throw (new CertificateParseError(options.filename, format, e)); - } -}; - -Certificate.isCertificate = function (obj, ver) { - return (utils.isCompatible(obj, Certificate, ver)); -}; - -/* - * API versions for Certificate: - * [1,0] -- initial ver - */ -Certificate.prototype._sshpkApiVersion = [1, 0]; - -Certificate._oldVersionDetect = function (obj) { - return ([1, 0]); -}; - - -/***/ }), -/* 144 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = Fingerprint; - -var assert = __webpack_require__(22); -var Buffer = __webpack_require__(20).Buffer; -var algs = __webpack_require__(38); -var crypto = __webpack_require__(21); -var errs = __webpack_require__(69); -var Key = __webpack_require__(34); -var Certificate = __webpack_require__(143); -var utils = __webpack_require__(32); - -var FingerprintFormatError = errs.FingerprintFormatError; -var InvalidAlgorithmError = errs.InvalidAlgorithmError; - -function Fingerprint(opts) { - assert.object(opts, 'options'); - assert.string(opts.type, 'options.type'); - assert.buffer(opts.hash, 'options.hash'); - assert.string(opts.algorithm, 'options.algorithm'); - - this.algorithm = opts.algorithm.toLowerCase(); - if (algs.hashAlgs[this.algorithm] !== true) - throw (new InvalidAlgorithmError(this.algorithm)); - - this.hash = opts.hash; - this.type = opts.type; -} - -Fingerprint.prototype.toString = function (format) { - if (format === undefined) { - if (this.algorithm === 'md5') - format = 'hex'; - else - format = 'base64'; - } - assert.string(format); - - switch (format) { - case 'hex': - return (addColons(this.hash.toString('hex'))); - case 'base64': - return (sshBase64Format(this.algorithm, - this.hash.toString('base64'))); - default: - throw (new FingerprintFormatError(undefined, format)); - } -}; - -Fingerprint.prototype.matches = function (other) { - assert.object(other, 'key or certificate'); - if (this.type === 'key') { - utils.assertCompatible(other, Key, [1, 0], 'key'); - } else { - utils.assertCompatible(other, Certificate, [1, 0], - 'certificate'); - } - - var theirHash = other.hash(this.algorithm); - var theirHash2 = crypto.createHash(this.algorithm). - update(theirHash).digest('base64'); - - if (this.hash2 === undefined) - this.hash2 = crypto.createHash(this.algorithm). - update(this.hash).digest('base64'); - - return (this.hash2 === theirHash2); -}; - -Fingerprint.parse = function (fp, options) { - assert.string(fp, 'fingerprint'); - - var alg, hash, enAlgs; - if (Array.isArray(options)) { - enAlgs = options; - options = {}; - } - assert.optionalObject(options, 'options'); - if (options === undefined) - options = {}; - if (options.enAlgs !== undefined) - enAlgs = options.enAlgs; - assert.optionalArrayOfString(enAlgs, 'algorithms'); - - var parts = fp.split(':'); - if (parts.length == 2) { - alg = parts[0].toLowerCase(); - /*JSSTYLED*/ - var base64RE = /^[A-Za-z0-9+\/=]+$/; - if (!base64RE.test(parts[1])) - throw (new FingerprintFormatError(fp)); - try { - hash = Buffer.from(parts[1], 'base64'); - } catch (e) { - throw (new FingerprintFormatError(fp)); - } - } else if (parts.length > 2) { - alg = 'md5'; - if (parts[0].toLowerCase() === 'md5') - parts = parts.slice(1); - parts = parts.join(''); - /*JSSTYLED*/ - var md5RE = /^[a-fA-F0-9]+$/; - if (!md5RE.test(parts)) - throw (new FingerprintFormatError(fp)); - try { - hash = Buffer.from(parts, 'hex'); - } catch (e) { - throw (new FingerprintFormatError(fp)); - } - } - - if (alg === undefined) - throw (new FingerprintFormatError(fp)); - - if (algs.hashAlgs[alg] === undefined) - throw (new InvalidAlgorithmError(alg)); - - if (enAlgs !== undefined) { - enAlgs = enAlgs.map(function (a) { return a.toLowerCase(); }); - if (enAlgs.indexOf(alg) === -1) - throw (new InvalidAlgorithmError(alg)); - } - - return (new Fingerprint({ - algorithm: alg, - hash: hash, - type: options.type || 'key' - })); -}; - -function addColons(s) { - /*JSSTYLED*/ - return (s.replace(/(.{2})(?=.)/g, '$1:')); -} - -function base64Strip(s) { - /*JSSTYLED*/ - return (s.replace(/=*$/, '')); -} - -function sshBase64Format(alg, h) { - return (alg.toUpperCase() + ':' + base64Strip(h)); -} - -Fingerprint.isFingerprint = function (obj, ver) { - return (utils.isCompatible(obj, Fingerprint, ver)); -}; - -/* - * API versions for Fingerprint: - * [1,0] -- initial ver - * [1,1] -- first tagged ver - */ -Fingerprint.prototype._sshpkApiVersion = [1, 1]; - -Fingerprint._oldVersionDetect = function (obj) { - assert.func(obj.toString); - assert.func(obj.matches); - return ([1, 0]); -}; - - -/***/ }), -/* 145 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = { - read: read, - readPkcs8: readPkcs8, - write: write, - writePkcs8: writePkcs8, - - readECDSACurve: readECDSACurve, - writeECDSACurve: writeECDSACurve -}; - -var assert = __webpack_require__(22); -var asn1 = __webpack_require__(66); -var Buffer = __webpack_require__(20).Buffer; -var algs = __webpack_require__(38); -var utils = __webpack_require__(32); -var Key = __webpack_require__(34); -var PrivateKey = __webpack_require__(39); -var pem = __webpack_require__(82); - -function read(buf, options) { - return (pem.read(buf, options, 'pkcs8')); -} - -function write(key, options) { - return (pem.write(key, options, 'pkcs8')); -} - -/* Helper to read in a single mpint */ -function readMPInt(der, nm) { - assert.strictEqual(der.peek(), asn1.Ber.Integer, - nm + ' is not an Integer'); - return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); -} - -function readPkcs8(alg, type, der) { - /* Private keys in pkcs#8 format have a weird extra int */ - if (der.peek() === asn1.Ber.Integer) { - assert.strictEqual(type, 'private', - 'unexpected Integer at start of public key'); - der.readString(asn1.Ber.Integer, true); - } - - der.readSequence(); - var next = der.offset + der.length; - - var oid = der.readOID(); - switch (oid) { - case '1.2.840.113549.1.1.1': - der._offset = next; - if (type === 'public') - return (readPkcs8RSAPublic(der)); - else - return (readPkcs8RSAPrivate(der)); - case '1.2.840.10040.4.1': - if (type === 'public') - return (readPkcs8DSAPublic(der)); - else - return (readPkcs8DSAPrivate(der)); - case '1.2.840.10045.2.1': - if (type === 'public') - return (readPkcs8ECDSAPublic(der)); - else - return (readPkcs8ECDSAPrivate(der)); - case '1.3.101.112': - if (type === 'public') { - return (readPkcs8EdDSAPublic(der)); - } else { - return (readPkcs8EdDSAPrivate(der)); - } - case '1.3.101.110': - if (type === 'public') { - return (readPkcs8X25519Public(der)); - } else { - return (readPkcs8X25519Private(der)); - } - default: - throw (new Error('Unknown key type OID ' + oid)); - } -} - -function readPkcs8RSAPublic(der) { - // bit string sequence - der.readSequence(asn1.Ber.BitString); - der.readByte(); - der.readSequence(); - - // modulus - var n = readMPInt(der, 'modulus'); - var e = readMPInt(der, 'exponent'); - - // now, make the key - var key = { - type: 'rsa', - source: der.originalInput, - parts: [ - { name: 'e', data: e }, - { name: 'n', data: n } - ] - }; - - return (new Key(key)); -} - -function readPkcs8RSAPrivate(der) { - der.readSequence(asn1.Ber.OctetString); - der.readSequence(); - - var ver = readMPInt(der, 'version'); - assert.equal(ver[0], 0x0, 'unknown RSA private key version'); - - // modulus then public exponent - var n = readMPInt(der, 'modulus'); - var e = readMPInt(der, 'public exponent'); - var d = readMPInt(der, 'private exponent'); - var p = readMPInt(der, 'prime1'); - var q = readMPInt(der, 'prime2'); - var dmodp = readMPInt(der, 'exponent1'); - var dmodq = readMPInt(der, 'exponent2'); - var iqmp = readMPInt(der, 'iqmp'); - - // now, make the key - var key = { - type: 'rsa', - parts: [ - { name: 'n', data: n }, - { name: 'e', data: e }, - { name: 'd', data: d }, - { name: 'iqmp', data: iqmp }, - { name: 'p', data: p }, - { name: 'q', data: q }, - { name: 'dmodp', data: dmodp }, - { name: 'dmodq', data: dmodq } - ] - }; - - return (new PrivateKey(key)); -} - -function readPkcs8DSAPublic(der) { - der.readSequence(); - - var p = readMPInt(der, 'p'); - var q = readMPInt(der, 'q'); - var g = readMPInt(der, 'g'); - - // bit string sequence - der.readSequence(asn1.Ber.BitString); - der.readByte(); - - var y = readMPInt(der, 'y'); - - // now, make the key - var key = { - type: 'dsa', - parts: [ - { name: 'p', data: p }, - { name: 'q', data: q }, - { name: 'g', data: g }, - { name: 'y', data: y } - ] - }; - - return (new Key(key)); -} - -function readPkcs8DSAPrivate(der) { - der.readSequence(); - - var p = readMPInt(der, 'p'); - var q = readMPInt(der, 'q'); - var g = readMPInt(der, 'g'); - - der.readSequence(asn1.Ber.OctetString); - var x = readMPInt(der, 'x'); - - /* The pkcs#8 format does not include the public key */ - var y = utils.calculateDSAPublic(g, p, x); - - var key = { - type: 'dsa', - parts: [ - { name: 'p', data: p }, - { name: 'q', data: q }, - { name: 'g', data: g }, - { name: 'y', data: y }, - { name: 'x', data: x } - ] - }; - - return (new PrivateKey(key)); -} - -function readECDSACurve(der) { - var curveName, curveNames; - var j, c, cd; - - if (der.peek() === asn1.Ber.OID) { - var oid = der.readOID(); - - curveNames = Object.keys(algs.curves); - for (j = 0; j < curveNames.length; ++j) { - c = curveNames[j]; - cd = algs.curves[c]; - if (cd.pkcs8oid === oid) { - curveName = c; - break; - } - } - - } else { - // ECParameters sequence - der.readSequence(); - var version = der.readString(asn1.Ber.Integer, true); - assert.strictEqual(version[0], 1, 'ECDSA key not version 1'); - - var curve = {}; - - // FieldID sequence - der.readSequence(); - var fieldTypeOid = der.readOID(); - assert.strictEqual(fieldTypeOid, '1.2.840.10045.1.1', - 'ECDSA key is not from a prime-field'); - var p = curve.p = utils.mpNormalize( - der.readString(asn1.Ber.Integer, true)); - /* - * p always starts with a 1 bit, so count the zeros to get its - * real size. - */ - curve.size = p.length * 8 - utils.countZeros(p); - - // Curve sequence - der.readSequence(); - curve.a = utils.mpNormalize( - der.readString(asn1.Ber.OctetString, true)); - curve.b = utils.mpNormalize( - der.readString(asn1.Ber.OctetString, true)); - if (der.peek() === asn1.Ber.BitString) - curve.s = der.readString(asn1.Ber.BitString, true); - - // Combined Gx and Gy - curve.G = der.readString(asn1.Ber.OctetString, true); - assert.strictEqual(curve.G[0], 0x4, - 'uncompressed G is required'); - - curve.n = utils.mpNormalize( - der.readString(asn1.Ber.Integer, true)); - curve.h = utils.mpNormalize( - der.readString(asn1.Ber.Integer, true)); - assert.strictEqual(curve.h[0], 0x1, 'a cofactor=1 curve is ' + - 'required'); - - curveNames = Object.keys(algs.curves); - var ks = Object.keys(curve); - for (j = 0; j < curveNames.length; ++j) { - c = curveNames[j]; - cd = algs.curves[c]; - var equal = true; - for (var i = 0; i < ks.length; ++i) { - var k = ks[i]; - if (cd[k] === undefined) - continue; - if (typeof (cd[k]) === 'object' && - cd[k].equals !== undefined) { - if (!cd[k].equals(curve[k])) { - equal = false; - break; - } - } else if (Buffer.isBuffer(cd[k])) { - if (cd[k].toString('binary') - !== curve[k].toString('binary')) { - equal = false; - break; - } - } else { - if (cd[k] !== curve[k]) { - equal = false; - break; - } - } - } - if (equal) { - curveName = c; - break; - } - } - } - return (curveName); -} - -function readPkcs8ECDSAPrivate(der) { - var curveName = readECDSACurve(der); - assert.string(curveName, 'a known elliptic curve'); - - der.readSequence(asn1.Ber.OctetString); - der.readSequence(); - - var version = readMPInt(der, 'version'); - assert.equal(version[0], 1, 'unknown version of ECDSA key'); - - var d = der.readString(asn1.Ber.OctetString, true); - der.readSequence(0xa1); - - var Q = der.readString(asn1.Ber.BitString, true); - Q = utils.ecNormalize(Q); - - var key = { - type: 'ecdsa', - parts: [ - { name: 'curve', data: Buffer.from(curveName) }, - { name: 'Q', data: Q }, - { name: 'd', data: d } - ] - }; - - return (new PrivateKey(key)); -} - -function readPkcs8ECDSAPublic(der) { - var curveName = readECDSACurve(der); - assert.string(curveName, 'a known elliptic curve'); - - var Q = der.readString(asn1.Ber.BitString, true); - Q = utils.ecNormalize(Q); - - var key = { - type: 'ecdsa', - parts: [ - { name: 'curve', data: Buffer.from(curveName) }, - { name: 'Q', data: Q } - ] - }; - - return (new Key(key)); -} - -function readPkcs8EdDSAPublic(der) { - if (der.peek() === 0x00) - der.readByte(); - - var A = utils.readBitString(der); - - var key = { - type: 'ed25519', - parts: [ - { name: 'A', data: utils.zeroPadToLength(A, 32) } - ] - }; - - return (new Key(key)); -} - -function readPkcs8X25519Public(der) { - var A = utils.readBitString(der); - - var key = { - type: 'curve25519', - parts: [ - { name: 'A', data: utils.zeroPadToLength(A, 32) } - ] - }; - - return (new Key(key)); -} - -function readPkcs8EdDSAPrivate(der) { - if (der.peek() === 0x00) - der.readByte(); - - der.readSequence(asn1.Ber.OctetString); - var k = der.readString(asn1.Ber.OctetString, true); - k = utils.zeroPadToLength(k, 32); - - var A; - if (der.peek() === asn1.Ber.BitString) { - A = utils.readBitString(der); - A = utils.zeroPadToLength(A, 32); - } else { - A = utils.calculateED25519Public(k); - } - - var key = { - type: 'ed25519', - parts: [ - { name: 'A', data: utils.zeroPadToLength(A, 32) }, - { name: 'k', data: utils.zeroPadToLength(k, 32) } - ] - }; - - return (new PrivateKey(key)); -} - -function readPkcs8X25519Private(der) { - if (der.peek() === 0x00) - der.readByte(); - - der.readSequence(asn1.Ber.OctetString); - var k = der.readString(asn1.Ber.OctetString, true); - k = utils.zeroPadToLength(k, 32); - - var A = utils.calculateX25519Public(k); - - var key = { - type: 'curve25519', - parts: [ - { name: 'A', data: utils.zeroPadToLength(A, 32) }, - { name: 'k', data: utils.zeroPadToLength(k, 32) } - ] - }; - - return (new PrivateKey(key)); -} - -function writePkcs8(der, key) { - der.startSequence(); - - if (PrivateKey.isPrivateKey(key)) { - var sillyInt = Buffer.from([0]); - der.writeBuffer(sillyInt, asn1.Ber.Integer); - } - - der.startSequence(); - switch (key.type) { - case 'rsa': - der.writeOID('1.2.840.113549.1.1.1'); - if (PrivateKey.isPrivateKey(key)) - writePkcs8RSAPrivate(key, der); - else - writePkcs8RSAPublic(key, der); - break; - case 'dsa': - der.writeOID('1.2.840.10040.4.1'); - if (PrivateKey.isPrivateKey(key)) - writePkcs8DSAPrivate(key, der); - else - writePkcs8DSAPublic(key, der); - break; - case 'ecdsa': - der.writeOID('1.2.840.10045.2.1'); - if (PrivateKey.isPrivateKey(key)) - writePkcs8ECDSAPrivate(key, der); - else - writePkcs8ECDSAPublic(key, der); - break; - case 'ed25519': - der.writeOID('1.3.101.112'); - if (PrivateKey.isPrivateKey(key)) - throw (new Error('Ed25519 private keys in pkcs8 ' + - 'format are not supported')); - writePkcs8EdDSAPublic(key, der); - break; - default: - throw (new Error('Unsupported key type: ' + key.type)); - } - - der.endSequence(); -} - -function writePkcs8RSAPrivate(key, der) { - der.writeNull(); - der.endSequence(); - - der.startSequence(asn1.Ber.OctetString); - der.startSequence(); - - var version = Buffer.from([0]); - der.writeBuffer(version, asn1.Ber.Integer); - - der.writeBuffer(key.part.n.data, asn1.Ber.Integer); - der.writeBuffer(key.part.e.data, asn1.Ber.Integer); - der.writeBuffer(key.part.d.data, asn1.Ber.Integer); - der.writeBuffer(key.part.p.data, asn1.Ber.Integer); - der.writeBuffer(key.part.q.data, asn1.Ber.Integer); - if (!key.part.dmodp || !key.part.dmodq) - utils.addRSAMissing(key); - der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer); - der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer); - der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer); - - der.endSequence(); - der.endSequence(); -} - -function writePkcs8RSAPublic(key, der) { - der.writeNull(); - der.endSequence(); - - der.startSequence(asn1.Ber.BitString); - der.writeByte(0x00); - - der.startSequence(); - der.writeBuffer(key.part.n.data, asn1.Ber.Integer); - der.writeBuffer(key.part.e.data, asn1.Ber.Integer); - der.endSequence(); - - der.endSequence(); -} - -function writePkcs8DSAPrivate(key, der) { - der.startSequence(); - der.writeBuffer(key.part.p.data, asn1.Ber.Integer); - der.writeBuffer(key.part.q.data, asn1.Ber.Integer); - der.writeBuffer(key.part.g.data, asn1.Ber.Integer); - der.endSequence(); - - der.endSequence(); - - der.startSequence(asn1.Ber.OctetString); - der.writeBuffer(key.part.x.data, asn1.Ber.Integer); - der.endSequence(); -} - -function writePkcs8DSAPublic(key, der) { - der.startSequence(); - der.writeBuffer(key.part.p.data, asn1.Ber.Integer); - der.writeBuffer(key.part.q.data, asn1.Ber.Integer); - der.writeBuffer(key.part.g.data, asn1.Ber.Integer); - der.endSequence(); - der.endSequence(); - - der.startSequence(asn1.Ber.BitString); - der.writeByte(0x00); - der.writeBuffer(key.part.y.data, asn1.Ber.Integer); - der.endSequence(); -} - -function writeECDSACurve(key, der) { - var curve = algs.curves[key.curve]; - if (curve.pkcs8oid) { - /* This one has a name in pkcs#8, so just write the oid */ - der.writeOID(curve.pkcs8oid); - - } else { - // ECParameters sequence - der.startSequence(); - - var version = Buffer.from([1]); - der.writeBuffer(version, asn1.Ber.Integer); - - // FieldID sequence - der.startSequence(); - der.writeOID('1.2.840.10045.1.1'); // prime-field - der.writeBuffer(curve.p, asn1.Ber.Integer); - der.endSequence(); - - // Curve sequence - der.startSequence(); - var a = curve.p; - if (a[0] === 0x0) - a = a.slice(1); - der.writeBuffer(a, asn1.Ber.OctetString); - der.writeBuffer(curve.b, asn1.Ber.OctetString); - der.writeBuffer(curve.s, asn1.Ber.BitString); - der.endSequence(); - - der.writeBuffer(curve.G, asn1.Ber.OctetString); - der.writeBuffer(curve.n, asn1.Ber.Integer); - var h = curve.h; - if (!h) { - h = Buffer.from([1]); - } - der.writeBuffer(h, asn1.Ber.Integer); - - // ECParameters - der.endSequence(); - } -} - -function writePkcs8ECDSAPublic(key, der) { - writeECDSACurve(key, der); - der.endSequence(); - - var Q = utils.ecNormalize(key.part.Q.data, true); - der.writeBuffer(Q, asn1.Ber.BitString); -} - -function writePkcs8ECDSAPrivate(key, der) { - writeECDSACurve(key, der); - der.endSequence(); - - der.startSequence(asn1.Ber.OctetString); - der.startSequence(); - - var version = Buffer.from([1]); - der.writeBuffer(version, asn1.Ber.Integer); - - der.writeBuffer(key.part.d.data, asn1.Ber.OctetString); - - der.startSequence(0xa1); - var Q = utils.ecNormalize(key.part.Q.data, true); - der.writeBuffer(Q, asn1.Ber.BitString); - der.endSequence(); - - der.endSequence(); - der.endSequence(); -} - -function writePkcs8EdDSAPublic(key, der) { - der.endSequence(); - - utils.writeBitString(der, key.part.A.data); -} - -function writePkcs8EdDSAPrivate(key, der) { - der.endSequence(); - - var k = utils.mpNormalize(key.part.k.data, true); - der.startSequence(asn1.Ber.OctetString); - der.writeBuffer(k, asn1.Ber.OctetString); - der.endSequence(); -} - - -/***/ }), -/* 146 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2017 Joyent, Inc. - -module.exports = Identity; - -var assert = __webpack_require__(22); -var algs = __webpack_require__(38); -var crypto = __webpack_require__(21); -var Fingerprint = __webpack_require__(144); -var Signature = __webpack_require__(70); -var errs = __webpack_require__(69); -var util = __webpack_require__(9); -var utils = __webpack_require__(32); -var asn1 = __webpack_require__(66); -var Buffer = __webpack_require__(20).Buffer; - -/*JSSTYLED*/ -var DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i; - -var oids = {}; -oids.cn = '2.5.4.3'; -oids.o = '2.5.4.10'; -oids.ou = '2.5.4.11'; -oids.l = '2.5.4.7'; -oids.s = '2.5.4.8'; -oids.c = '2.5.4.6'; -oids.sn = '2.5.4.4'; -oids.dc = '0.9.2342.19200300.100.1.25'; -oids.uid = '0.9.2342.19200300.100.1.1'; -oids.mail = '0.9.2342.19200300.100.1.3'; - -var unoids = {}; -Object.keys(oids).forEach(function (k) { - unoids[oids[k]] = k; -}); - -function Identity(opts) { - var self = this; - assert.object(opts, 'options'); - assert.arrayOfObject(opts.components, 'options.components'); - this.components = opts.components; - this.componentLookup = {}; - this.components.forEach(function (c) { - if (c.name && !c.oid) - c.oid = oids[c.name]; - if (c.oid && !c.name) - c.name = unoids[c.oid]; - if (self.componentLookup[c.name] === undefined) - self.componentLookup[c.name] = []; - self.componentLookup[c.name].push(c); - }); - if (this.componentLookup.cn && this.componentLookup.cn.length > 0) { - this.cn = this.componentLookup.cn[0].value; - } - assert.optionalString(opts.type, 'options.type'); - if (opts.type === undefined) { - if (this.components.length === 1 && - this.componentLookup.cn && - this.componentLookup.cn.length === 1 && - this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { - this.type = 'host'; - this.hostname = this.componentLookup.cn[0].value; - - } else if (this.componentLookup.dc && - this.components.length === this.componentLookup.dc.length) { - this.type = 'host'; - this.hostname = this.componentLookup.dc.map( - function (c) { - return (c.value); - }).join('.'); - - } else if (this.componentLookup.uid && - this.components.length === - this.componentLookup.uid.length) { - this.type = 'user'; - this.uid = this.componentLookup.uid[0].value; - - } else if (this.componentLookup.cn && - this.componentLookup.cn.length === 1 && - this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { - this.type = 'host'; - this.hostname = this.componentLookup.cn[0].value; - - } else if (this.componentLookup.uid && - this.componentLookup.uid.length === 1) { - this.type = 'user'; - this.uid = this.componentLookup.uid[0].value; - - } else if (this.componentLookup.mail && - this.componentLookup.mail.length === 1) { - this.type = 'email'; - this.email = this.componentLookup.mail[0].value; - - } else if (this.componentLookup.cn && - this.componentLookup.cn.length === 1) { - this.type = 'user'; - this.uid = this.componentLookup.cn[0].value; - - } else { - this.type = 'unknown'; - } - } else { - this.type = opts.type; - if (this.type === 'host') - this.hostname = opts.hostname; - else if (this.type === 'user') - this.uid = opts.uid; - else if (this.type === 'email') - this.email = opts.email; - else - throw (new Error('Unknown type ' + this.type)); - } -} - -Identity.prototype.toString = function () { - return (this.components.map(function (c) { - return (c.name.toUpperCase() + '=' + c.value); - }).join(', ')); -}; - -/* - * These are from X.680 -- PrintableString allowed chars are in section 37.4 - * table 8. Spec for IA5Strings is "1,6 + SPACE + DEL" where 1 refers to - * ISO IR #001 (standard ASCII control characters) and 6 refers to ISO IR #006 - * (the basic ASCII character set). - */ -/* JSSTYLED */ -var NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\/:=?-]/; -/* JSSTYLED */ -var NOT_IA5 = /[^\x00-\x7f]/; - -Identity.prototype.toAsn1 = function (der, tag) { - der.startSequence(tag); - this.components.forEach(function (c) { - der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set); - der.startSequence(); - der.writeOID(c.oid); - /* - * If we fit in a PrintableString, use that. Otherwise use an - * IA5String or UTF8String. - * - * If this identity was parsed from a DN, use the ASN.1 types - * from the original representation (otherwise this might not - * be a full match for the original in some validators). - */ - if (c.asn1type === asn1.Ber.Utf8String || - c.value.match(NOT_IA5)) { - var v = Buffer.from(c.value, 'utf8'); - der.writeBuffer(v, asn1.Ber.Utf8String); - - } else if (c.asn1type === asn1.Ber.IA5String || - c.value.match(NOT_PRINTABLE)) { - der.writeString(c.value, asn1.Ber.IA5String); - - } else { - var type = asn1.Ber.PrintableString; - if (c.asn1type !== undefined) - type = c.asn1type; - der.writeString(c.value, type); - } - der.endSequence(); - der.endSequence(); - }); - der.endSequence(); -}; - -function globMatch(a, b) { - if (a === '**' || b === '**') - return (true); - var aParts = a.split('.'); - var bParts = b.split('.'); - if (aParts.length !== bParts.length) - return (false); - for (var i = 0; i < aParts.length; ++i) { - if (aParts[i] === '*' || bParts[i] === '*') - continue; - if (aParts[i] !== bParts[i]) - return (false); - } - return (true); -} - -Identity.prototype.equals = function (other) { - if (!Identity.isIdentity(other, [1, 0])) - return (false); - if (other.components.length !== this.components.length) - return (false); - for (var i = 0; i < this.components.length; ++i) { - if (this.components[i].oid !== other.components[i].oid) - return (false); - if (!globMatch(this.components[i].value, - other.components[i].value)) { - return (false); - } - } - return (true); -}; - -Identity.forHost = function (hostname) { - assert.string(hostname, 'hostname'); - return (new Identity({ - type: 'host', - hostname: hostname, - components: [ { name: 'cn', value: hostname } ] - })); -}; - -Identity.forUser = function (uid) { - assert.string(uid, 'uid'); - return (new Identity({ - type: 'user', - uid: uid, - components: [ { name: 'uid', value: uid } ] - })); -}; - -Identity.forEmail = function (email) { - assert.string(email, 'email'); - return (new Identity({ - type: 'email', - email: email, - components: [ { name: 'mail', value: email } ] - })); -}; - -Identity.parseDN = function (dn) { - assert.string(dn, 'dn'); - var parts = dn.split(','); - var cmps = parts.map(function (c) { - c = c.trim(); - var eqPos = c.indexOf('='); - var name = c.slice(0, eqPos).toLowerCase(); - var value = c.slice(eqPos + 1); - return ({ name: name, value: value }); - }); - return (new Identity({ components: cmps })); -}; - -Identity.parseAsn1 = function (der, top) { - var components = []; - der.readSequence(top); - var end = der.offset + der.length; - while (der.offset < end) { - der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set); - var after = der.offset + der.length; - der.readSequence(); - var oid = der.readOID(); - var type = der.peek(); - var value; - switch (type) { - case asn1.Ber.PrintableString: - case asn1.Ber.IA5String: - case asn1.Ber.OctetString: - case asn1.Ber.T61String: - value = der.readString(type); - break; - case asn1.Ber.Utf8String: - value = der.readString(type, true); - value = value.toString('utf8'); - break; - case asn1.Ber.CharacterString: - case asn1.Ber.BMPString: - value = der.readString(type, true); - value = value.toString('utf16le'); - break; - default: - throw (new Error('Unknown asn1 type ' + type)); - } - components.push({ oid: oid, asn1type: type, value: value }); - der._offset = after; - } - der._offset = end; - return (new Identity({ - components: components - })); -}; - -Identity.isIdentity = function (obj, ver) { - return (utils.isCompatible(obj, Identity, ver)); -}; - -/* - * API versions for Identity: - * [1,0] -- initial ver - */ -Identity.prototype._sshpkApiVersion = [1, 0]; - -Identity._oldVersionDetect = function (obj) { - return ([1, 0]); -}; - - -/***/ }), -/* 147 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = SSHBuffer; - -var assert = __webpack_require__(22); -var Buffer = __webpack_require__(20).Buffer; - -function SSHBuffer(opts) { - assert.object(opts, 'options'); - if (opts.buffer !== undefined) - assert.buffer(opts.buffer, 'options.buffer'); - - this._size = opts.buffer ? opts.buffer.length : 1024; - this._buffer = opts.buffer || Buffer.alloc(this._size); - this._offset = 0; -} - -SSHBuffer.prototype.toBuffer = function () { - return (this._buffer.slice(0, this._offset)); -}; - -SSHBuffer.prototype.atEnd = function () { - return (this._offset >= this._buffer.length); -}; - -SSHBuffer.prototype.remainder = function () { - return (this._buffer.slice(this._offset)); -}; - -SSHBuffer.prototype.skip = function (n) { - this._offset += n; -}; - -SSHBuffer.prototype.expand = function () { - this._size *= 2; - var buf = Buffer.alloc(this._size); - this._buffer.copy(buf, 0); - this._buffer = buf; -}; - -SSHBuffer.prototype.readPart = function () { - return ({data: this.readBuffer()}); -}; - -SSHBuffer.prototype.readBuffer = function () { - var len = this._buffer.readUInt32BE(this._offset); - this._offset += 4; - assert.ok(this._offset + len <= this._buffer.length, - 'length out of bounds at +0x' + this._offset.toString(16) + - ' (data truncated?)'); - var buf = this._buffer.slice(this._offset, this._offset + len); - this._offset += len; - return (buf); -}; - -SSHBuffer.prototype.readString = function () { - return (this.readBuffer().toString()); -}; - -SSHBuffer.prototype.readCString = function () { - var offset = this._offset; - while (offset < this._buffer.length && - this._buffer[offset] !== 0x00) - offset++; - assert.ok(offset < this._buffer.length, 'c string does not terminate'); - var str = this._buffer.slice(this._offset, offset).toString(); - this._offset = offset + 1; - return (str); -}; - -SSHBuffer.prototype.readInt = function () { - var v = this._buffer.readUInt32BE(this._offset); - this._offset += 4; - return (v); -}; - -SSHBuffer.prototype.readInt64 = function () { - assert.ok(this._offset + 8 < this._buffer.length, - 'buffer not long enough to read Int64'); - var v = this._buffer.slice(this._offset, this._offset + 8); - this._offset += 8; - return (v); -}; - -SSHBuffer.prototype.readChar = function () { - var v = this._buffer[this._offset++]; - return (v); -}; - -SSHBuffer.prototype.writeBuffer = function (buf) { - while (this._offset + 4 + buf.length > this._size) - this.expand(); - this._buffer.writeUInt32BE(buf.length, this._offset); - this._offset += 4; - buf.copy(this._buffer, this._offset); - this._offset += buf.length; -}; - -SSHBuffer.prototype.writeString = function (str) { - this.writeBuffer(Buffer.from(str, 'utf8')); -}; - -SSHBuffer.prototype.writeCString = function (str) { - while (this._offset + 1 + str.length > this._size) - this.expand(); - this._buffer.write(str, this._offset); - this._offset += str.length; - this._buffer[this._offset++] = 0; -}; - -SSHBuffer.prototype.writeInt = function (v) { - while (this._offset + 4 > this._size) - this.expand(); - this._buffer.writeUInt32BE(v, this._offset); - this._offset += 4; -}; - -SSHBuffer.prototype.writeInt64 = function (v) { - assert.buffer(v, 'value'); - if (v.length > 8) { - var lead = v.slice(0, v.length - 8); - for (var i = 0; i < lead.length; ++i) { - assert.strictEqual(lead[i], 0, - 'must fit in 64 bits of precision'); - } - v = v.slice(v.length - 8, v.length); - } - while (this._offset + 8 > this._size) - this.expand(); - v.copy(this._buffer, this._offset); - this._offset += 8; -}; - -SSHBuffer.prototype.writeChar = function (v) { - while (this._offset + 1 > this._size) - this.expand(); - this._buffer[this._offset++] = v; -}; - -SSHBuffer.prototype.writePart = function (p) { - this.writeBuffer(p.data); -}; - -SSHBuffer.prototype.write = function (buf) { - while (this._offset + buf.length > this._size) - this.expand(); - buf.copy(this._buffer, this._offset); - this._offset += buf.length; -}; - - -/***/ }), -/* 148 */ -/***/ (function(module, exports) { - -module.exports = require("tty"); - -/***/ }), -/* 149 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _stringify; - -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(40)); -} - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(42)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -exports.extractWorkspaces = extractWorkspaces; - -var _executeLifecycleScript; - -function _load_executeLifecycleScript() { - return _executeLifecycleScript = __webpack_require__(100); -} - -var _path; - -function _load_path() { - return _path = __webpack_require__(320); -} - -var _conversion; - -function _load_conversion() { - return _conversion = __webpack_require__(275); -} - -var _index; - -function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(208)); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); -} - -var _packageConstraintResolver; - -function _load_packageConstraintResolver() { - return _packageConstraintResolver = _interopRequireDefault(__webpack_require__(543)); -} - -var _requestManager; - -function _load_requestManager() { - return _requestManager = _interopRequireDefault(__webpack_require__(321)); -} - -var _index2; - -function _load_index2() { - return _index2 = __webpack_require__(60); -} - -var _index3; - -function _load_index3() { - return _index3 = __webpack_require__(188); -} - -var _map2; - -function _load_map2() { - return _map2 = _interopRequireDefault(__webpack_require__(51)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var crypto = __webpack_require__(21); -var detectIndent = __webpack_require__(690); -var invariant = __webpack_require__(15); -var path = __webpack_require__(1); -var micromatch = __webpack_require__(108); -var isCi = __webpack_require__(365); - -function sortObject(object) { - var sortedObject = {}; - (0, (_keys || _load_keys()).default)(object).sort().forEach(function (item) { - sortedObject[item] = object[item]; - }); - return sortedObject; -} - -var Config = function () { - function Config(reporter) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Config); - - this.constraintResolver = new (_packageConstraintResolver || _load_packageConstraintResolver()).default(this, reporter); - this.requestManager = new (_requestManager || _load_requestManager()).default(reporter); - this.reporter = reporter; - this._init({}); - } - - // - - - // - - - // cache packages in offline mirror folder as new .tgz files - - - // - - - // - - - // - - - // - - - // - - - // - - - // - - - // - - - // - - - // - - - // - - - // Whether we should ignore executing lifecycle scripts - - - // - - - // - - - // - - - // - - - /** - * Execute a promise produced by factory if it doesn't exist in our cache with - * the associated key. - */ - - Config.prototype.getCache = function getCache(key, factory) { - var _this = this; - - var cached = this.cache[key]; - if (cached) { - return cached; - } - - return this.cache[key] = factory().catch(function (err) { - _this.cache[key] = null; - throw err; - }); - }; - - /** - * Get a config option from our yarn config. - */ - - Config.prototype.getOption = function getOption(key) { - var resolve = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - var value = this.registries.yarn.getOption(key); - - if (resolve && typeof value === 'string' && value.length) { - return (0, (_path || _load_path()).resolveWithHome)(value); - } - - return value; - }; - - /** - * Reduce a list of versions to a single one based on an input range. - */ - - Config.prototype.resolveConstraints = function resolveConstraints(versions, range) { - return this.constraintResolver.reduce(versions, range); - }; - - /** - * Initialise config. Fetch registry options, find package roots. - */ - - Config.prototype.init = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _this2 = this; - - var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - this._init(opts); - - this.workspaceRootFolder = yield this.findWorkspaceRoot(this.cwd); - this.lockfileFolder = this.workspaceRootFolder || this.cwd; - - // using focus in a workspace root is not allowed - if (this.focus && (!this.workspaceRootFolder || this.cwd === this.workspaceRootFolder)) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesFocusRootCheck')); - } - - if (this.focus) { - var focusedWorkspaceManifest = yield this.readRootManifest(); - this.focusedWorkspaceName = focusedWorkspaceManifest.name; - } - - this.linkedModules = []; - - var linkedModules = void 0; - try { - linkedModules = yield (_fs || _load_fs()).readdir(this.linkFolder); - } catch (err) { - if (err.code === 'ENOENT') { - linkedModules = []; - } else { - throw err; - } - } - - var _loop = function* _loop(dir) { - var linkedPath = path.join(_this2.linkFolder, dir); - - if (dir[0] === '@') { - var _linkedModules; - - // it's a scope, not a package - var scopedLinked = yield (_fs || _load_fs()).readdir(linkedPath); - (_linkedModules = _this2.linkedModules).push.apply(_linkedModules, scopedLinked.map(function (scopedDir) { - return path.join(dir, scopedDir); - })); - } else { - _this2.linkedModules.push(dir); - } - }; - - for (var _iterator = linkedModules, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref2; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - var dir = _ref2; - yield* _loop(dir); - } - - for (var _iterator2 = (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref3; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; - } - - var _key = _ref3; - - var Registry = (_index2 || _load_index2()).registries[_key]; - - var extraneousRcFiles = Registry === (_index2 || _load_index2()).registries.yarn ? this.extraneousYarnrcFiles : []; - - // instantiate registry - var _registry = new Registry(this.cwd, this.registries, this.requestManager, this.reporter, this.enableDefaultRc, extraneousRcFiles); - yield _registry.init({ - registry: opts.registry - }); - - this.registries[_key] = _registry; - if (this.registryFolders.indexOf(_registry.folder) === -1) { - this.registryFolders.push(_registry.folder); - } - } - - if (this.modulesFolder) { - this.registryFolders = [this.modulesFolder]; - } - - this.networkConcurrency = opts.networkConcurrency || Number(this.getOption('network-concurrency')) || (_constants || _load_constants()).NETWORK_CONCURRENCY; - - this.childConcurrency = opts.childConcurrency || Number(this.getOption('child-concurrency')) || Number(process.env.CHILD_CONCURRENCY) || (_constants || _load_constants()).CHILD_CONCURRENCY; - - this.networkTimeout = opts.networkTimeout || Number(this.getOption('network-timeout')) || (_constants || _load_constants()).NETWORK_TIMEOUT; - - var httpProxy = opts.httpProxy || this.getOption('proxy'); - var httpsProxy = opts.httpsProxy || this.getOption('https-proxy'); - this.requestManager.setOptions({ - userAgent: String(this.getOption('user-agent')), - httpProxy: httpProxy === false ? false : String(httpProxy || ''), - httpsProxy: httpsProxy === false ? false : String(httpsProxy || ''), - strictSSL: Boolean(this.getOption('strict-ssl')), - ca: Array.prototype.concat(opts.ca || this.getOption('ca') || []).map(String), - cafile: String(opts.cafile || this.getOption('cafile', true) || ''), - cert: String(opts.cert || this.getOption('cert') || ''), - key: String(opts.key || this.getOption('key') || ''), - networkConcurrency: this.networkConcurrency, - networkTimeout: this.networkTimeout - }); - - this.globalFolder = opts.globalFolder || String(this.getOption('global-folder', true)); - if (this.globalFolder === 'undefined') { - this.globalFolder = (_constants || _load_constants()).GLOBAL_MODULE_DIRECTORY; - } - - var cacheRootFolder = opts.cacheFolder || this.getOption('cache-folder', true); - - if (!cacheRootFolder) { - var preferredCacheFolders = (_constants || _load_constants()).PREFERRED_MODULE_CACHE_DIRECTORIES; - var preferredCacheFolder = opts.preferredCacheFolder || this.getOption('preferred-cache-folder', true); - - if (preferredCacheFolder) { - preferredCacheFolders = [String(preferredCacheFolder)].concat(preferredCacheFolders); - } - - var cacheFolderQuery = yield (_fs || _load_fs()).getFirstSuitableFolder(preferredCacheFolders, (_fs || _load_fs()).constants.W_OK | (_fs || _load_fs()).constants.X_OK | (_fs || _load_fs()).constants.R_OK // eslint-disable-line no-bitwise - ); - for (var _iterator3 = cacheFolderQuery.skipped, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref4; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } - - var skippedEntry = _ref4; - - this.reporter.warn(this.reporter.lang('cacheFolderSkipped', skippedEntry.folder)); - } - - cacheRootFolder = cacheFolderQuery.folder; - if (cacheRootFolder && cacheFolderQuery.skipped.length > 0) { - this.reporter.warn(this.reporter.lang('cacheFolderSelected', cacheRootFolder)); - } - } - - if (!cacheRootFolder) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('cacheFolderMissing')); - } else { - this._cacheRootFolder = String(cacheRootFolder); - } - - var manifest = yield this.maybeReadManifest(this.lockfileFolder); - - var plugnplayByEnv = this.getOption('plugnplay-override'); - if (plugnplayByEnv != null) { - this.plugnplayEnabled = plugnplayByEnv !== 'false' && plugnplayByEnv !== '0'; - this.plugnplayPersist = false; - } else if (opts.enablePnp || opts.disablePnp) { - this.plugnplayEnabled = !!opts.enablePnp; - this.plugnplayPersist = true; - } else if (manifest && manifest.installConfig && manifest.installConfig.pnp) { - this.plugnplayEnabled = !!manifest.installConfig.pnp; - this.plugnplayPersist = false; - } else { - this.plugnplayEnabled = false; - this.plugnplayPersist = false; - } - - if (process.platform === 'win32') { - var cacheRootFolderDrive = path.parse(this._cacheRootFolder).root.toLowerCase(); - var lockfileFolderDrive = path.parse(this.lockfileFolder).root.toLowerCase(); - - if (cacheRootFolderDrive !== lockfileFolderDrive) { - if (this.plugnplayEnabled) { - this.reporter.warn(this.reporter.lang('plugnplayWindowsSupport')); - } - this.plugnplayEnabled = false; - this.plugnplayPersist = false; - } - } - - this.plugnplayShebang = String(this.getOption('plugnplay-shebang') || '') || '/usr/bin/env node'; - this.plugnplayBlacklist = String(this.getOption('plugnplay-blacklist') || '') || null; - - this.ignoreScripts = opts.ignoreScripts || Boolean(this.getOption('ignore-scripts', false)); - - this.workspacesEnabled = this.getOption('workspaces-experimental') !== false; - this.workspacesNohoistEnabled = this.getOption('workspaces-nohoist-experimental') !== false; - - this.offlineCacheFolder = String(this.getOption('offline-cache-folder') || '') || null; - - this.pruneOfflineMirror = Boolean(this.getOption('yarn-offline-mirror-pruning')); - this.enableMetaFolder = Boolean(this.getOption('enable-meta-folder')); - this.enableLockfileVersions = Boolean(this.getOption('yarn-enable-lockfile-versions')); - this.linkFileDependencies = Boolean(this.getOption('yarn-link-file-dependencies')); - this.packBuiltPackages = Boolean(this.getOption('experimental-pack-script-packages-in-mirror')); - - this.autoAddIntegrity = !(0, (_conversion || _load_conversion()).boolifyWithDefault)(String(this.getOption('unsafe-disable-integrity-migration')), true); - - //init & create cacheFolder, tempFolder - this.cacheFolder = path.join(this._cacheRootFolder, 'v' + String((_constants || _load_constants()).CACHE_VERSION)); - this.tempFolder = opts.tempFolder || path.join(this.cacheFolder, '.tmp'); - yield (_fs || _load_fs()).mkdirp(this.cacheFolder); - yield (_fs || _load_fs()).mkdirp(this.tempFolder); - - if (opts.production !== undefined) { - this.production = Boolean(opts.production); - } else { - this.production = Boolean(this.getOption('production')) || process.env.NODE_ENV === 'production' && process.env.NPM_CONFIG_PRODUCTION !== 'false' && process.env.YARN_PRODUCTION !== 'false'; - } - - if (this.workspaceRootFolder && !this.workspacesEnabled) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesDisabled')); - } - }); - - function init() { - return _ref.apply(this, arguments); - } - - return init; - }(); - - Config.prototype._init = function _init(opts) { - this.registryFolders = []; - this.linkedModules = []; - - this.registries = (0, (_map2 || _load_map2()).default)(); - this.cache = (0, (_map2 || _load_map2()).default)(); - - // Ensure the cwd is always an absolute path. - this.cwd = path.resolve(opts.cwd || this.cwd || process.cwd()); - - this.looseSemver = opts.looseSemver == undefined ? true : opts.looseSemver; - - this.commandName = opts.commandName || ''; - - this.enableDefaultRc = opts.enableDefaultRc !== false; - this.extraneousYarnrcFiles = opts.extraneousYarnrcFiles || []; - - this.preferOffline = !!opts.preferOffline; - this.modulesFolder = opts.modulesFolder; - this.linkFolder = opts.linkFolder || (_constants || _load_constants()).LINK_REGISTRY_DIRECTORY; - this.offline = !!opts.offline; - this.binLinks = !!opts.binLinks; - this.updateChecksums = !!opts.updateChecksums; - this.plugnplayUnplugged = []; - this.plugnplayPurgeUnpluggedPackages = false; - - this.ignorePlatform = !!opts.ignorePlatform; - this.ignoreScripts = !!opts.ignoreScripts; - - this.disablePrepublish = !!opts.disablePrepublish; - - // $FlowFixMe$ - this.nonInteractive = !!opts.nonInteractive || isCi || !process.stdout.isTTY; - - this.requestManager.setOptions({ - offline: !!opts.offline && !opts.preferOffline, - captureHar: !!opts.captureHar - }); - - this.focus = !!opts.focus; - this.focusedWorkspaceName = ''; - - this.otp = opts.otp || ''; - }; - - /** - * Generate a name suitable as unique filesystem identifier for the specified package. - */ - - Config.prototype.generateUniquePackageSlug = function generateUniquePackageSlug(pkg) { - var slug = pkg.name; - - slug = slug.replace(/[^@a-z0-9]+/g, '-'); - slug = slug.replace(/^-+|-+$/g, ''); - - if (pkg.registry) { - slug = `${pkg.registry}-${slug}`; - } else { - slug = `unknown-${slug}`; - } - - var hash = pkg.remote.hash; - - - if (pkg.version) { - slug += `-${pkg.version}`; - } - - if (pkg.uid && pkg.version !== pkg.uid) { - slug += `-${pkg.uid}`; - } else if (hash) { - slug += `-${hash}`; - } - - if (pkg.remote.integrity) { - slug += `-integrity`; - } - - return slug; - }; - - /** - * Generate an absolute module path. - */ - - Config.prototype.generateModuleCachePath = function generateModuleCachePath(pkg) { - invariant(this.cacheFolder, 'No package root'); - invariant(pkg, 'Undefined package'); - - var slug = this.generateUniquePackageSlug(pkg); - return path.join(this.cacheFolder, slug, 'node_modules', pkg.name); - }; - - /** - */ - - Config.prototype.getUnpluggedPath = function getUnpluggedPath() { - return path.join(this.lockfileFolder, '.pnp', 'unplugged'); - }; - - /** - */ - - Config.prototype.generatePackageUnpluggedPath = function generatePackageUnpluggedPath(pkg) { - var slug = this.generateUniquePackageSlug(pkg); - return path.join(this.getUnpluggedPath(), slug, 'node_modules', pkg.name); - }; - - /** - */ - - Config.prototype.listUnpluggedPackageFolders = function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var unpluggedPackages = new (_map || _load_map()).default(); - var unpluggedPath = this.getUnpluggedPath(); - - if (!(yield (_fs || _load_fs()).exists(unpluggedPath))) { - return unpluggedPackages; - } - - for (var _iterator4 = yield (_fs || _load_fs()).readdir(unpluggedPath), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref6; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref6 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref6 = _i4.value; - } - - var unpluggedName = _ref6; - - var nmListing = yield (_fs || _load_fs()).readdir(path.join(unpluggedPath, unpluggedName, 'node_modules')); - invariant(nmListing.length === 1, 'A single folder should be in the unplugged directory'); - - var target = path.join(unpluggedPath, unpluggedName, `node_modules`, nmListing[0]); - unpluggedPackages.set(unpluggedName, target); - } - - return unpluggedPackages; - }); - - function listUnpluggedPackageFolders() { - return _ref5.apply(this, arguments); - } - - return listUnpluggedPackageFolders; - }(); - - /** - * Execute lifecycle scripts in the specified directory. Ignoring when the --ignore-scripts flag has been - * passed. - */ - - Config.prototype.executeLifecycleScript = function executeLifecycleScript(commandName, cwd) { - if (this.ignoreScripts) { - return (_promise || _load_promise()).default.resolve(); - } else { - return (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execFromManifest)(this, commandName, cwd || this.cwd); - } - }; - - /** - * Generate an absolute temporary filename location based on the input filename. - */ - - Config.prototype.getTemp = function getTemp(filename) { - invariant(this.tempFolder, 'No temp folder'); - return path.join(this.tempFolder, filename); - }; - - /** - * Remote packages may be cached in a file system to be available for offline installation. - * Second time the same package needs to be installed it will be loaded from there. - * Given a package's filename, return a path in the offline mirror location. - */ - - Config.prototype.getOfflineMirrorPath = function getOfflineMirrorPath(packageFilename) { - var mirrorPath = void 0; - - var _arr = ['npm', 'yarn']; - for (var _i5 = 0; _i5 < _arr.length; _i5++) { - var _key2 = _arr[_i5]; - var _registry2 = this.registries[_key2]; - - if (_registry2 == null) { - continue; - } - - var registryMirrorPath = _registry2.config['yarn-offline-mirror']; - - if (registryMirrorPath === false) { - return null; - } - - if (registryMirrorPath == null) { - continue; - } - - mirrorPath = registryMirrorPath; - } - - if (mirrorPath == null) { - return null; - } - - if (packageFilename == null) { - return mirrorPath; - } - - return path.join(mirrorPath, path.basename(packageFilename)); - }; - - /** - * Checker whether the folder input is a valid module folder. We output a yarn metadata - * file when we've successfully setup a folder so use this as a marker. - */ - - Config.prototype.isValidModuleDest = function () { - var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) { - if (!(yield (_fs || _load_fs()).exists(dest))) { - return false; - } - - if (!(yield (_fs || _load_fs()).exists(path.join(dest, (_constants || _load_constants()).METADATA_FILENAME)))) { - return false; - } - - return true; - }); - - function isValidModuleDest(_x3) { - return _ref7.apply(this, arguments); - } - - return isValidModuleDest; - }(); - - /** - * Read package metadata and normalized package info. - */ - - Config.prototype.readPackageMetadata = function readPackageMetadata(dir) { - var _this3 = this; - - return this.getCache(`metadata-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var metadata = yield _this3.readJson(path.join(dir, (_constants || _load_constants()).METADATA_FILENAME)); - var pkg = yield _this3.readManifest(dir, metadata.registry); - - return { - package: pkg, - artifacts: metadata.artifacts || [], - hash: metadata.hash, - remote: metadata.remote, - registry: metadata.registry - }; - })); - }; - - /** - * Read normalized package info according yarn-metadata.json - * throw an error if package.json was not found - */ - - Config.prototype.readManifest = function readManifest(dir, priorityRegistry) { - var _this4 = this; - - var isRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - return this.getCache(`manifest-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var manifest = yield _this4.maybeReadManifest(dir, priorityRegistry, isRoot); - - if (manifest) { - return manifest; - } else { - throw new (_errors || _load_errors()).MessageError(_this4.reporter.lang('couldntFindPackagejson', dir), 'ENOENT'); - } - })); - }; - - /** - * try get the manifest file by looking - * 1. manifest file in cache - * 2. manifest file in registry - */ - - - Config.prototype.maybeReadManifest = function () { - var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, priorityRegistry) { - var isRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - var metadataLoc = path.join(dir, (_constants || _load_constants()).METADATA_FILENAME); - - if (yield (_fs || _load_fs()).exists(metadataLoc)) { - var metadata = yield this.readJson(metadataLoc); - - if (!priorityRegistry) { - priorityRegistry = metadata.priorityRegistry; - } - - if (typeof metadata.manifest !== 'undefined') { - return metadata.manifest; - } - } - - if (priorityRegistry) { - var file = yield this.tryManifest(dir, priorityRegistry, isRoot); - if (file) { - return file; - } - } - - for (var _iterator5 = (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries), _isArray5 = Array.isArray(_iterator5), _i6 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { - var _ref11; - - if (_isArray5) { - if (_i6 >= _iterator5.length) break; - _ref11 = _iterator5[_i6++]; - } else { - _i6 = _iterator5.next(); - if (_i6.done) break; - _ref11 = _i6.value; - } - - var _registry3 = _ref11; - - if (priorityRegistry === _registry3) { - continue; - } - - var _file = yield this.tryManifest(dir, _registry3, isRoot); - if (_file) { - return _file; - } - } - - return null; - }); - - function maybeReadManifest(_x5, _x6) { - return _ref10.apply(this, arguments); - } - - return maybeReadManifest; - }(); - - /** - * Read the root manifest. - */ - - Config.prototype.readRootManifest = function readRootManifest() { - return this.readManifest(this.cwd, 'npm', true); - }; - - /** - * Try and find package info with the input directory and registry. - */ - - Config.prototype.tryManifest = function () { - var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, registry, isRoot) { - var filename = (_index2 || _load_index2()).registries[registry].filename; - - var loc = path.join(dir, filename); - if (yield (_fs || _load_fs()).exists(loc)) { - var data = yield this.readJson(loc); - data._registry = registry; - data._loc = loc; - return (0, (_index || _load_index()).default)(data, dir, this, isRoot); - } else { - return null; - } - }); - - function tryManifest(_x8, _x9, _x10) { - return _ref12.apply(this, arguments); - } - - return tryManifest; - }(); - - Config.prototype.findManifest = function () { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, isRoot) { - for (var _iterator6 = (_index2 || _load_index2()).registryNames, _isArray6 = Array.isArray(_iterator6), _i7 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { - var _ref14; - - if (_isArray6) { - if (_i7 >= _iterator6.length) break; - _ref14 = _iterator6[_i7++]; - } else { - _i7 = _iterator6.next(); - if (_i7.done) break; - _ref14 = _i7.value; - } - - var _registry4 = _ref14; - - var manifest = yield this.tryManifest(dir, _registry4, isRoot); - - if (manifest) { - return manifest; - } - } - - return null; - }); - - function findManifest(_x11, _x12) { - return _ref13.apply(this, arguments); - } - - return findManifest; - }(); - - Config.prototype.findWorkspaceRoot = function () { - var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (initial) { - var previous = null; - var current = path.normalize(initial); - if (!(yield (_fs || _load_fs()).exists(current))) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('folderMissing', current)); - } - - do { - var manifest = yield this.findManifest(current, true); - var ws = extractWorkspaces(manifest); - if (ws && ws.packages) { - var relativePath = path.relative(current, initial); - if (relativePath === '' || micromatch([relativePath], ws.packages).length > 0) { - return current; - } else { - return null; - } - } - - previous = current; - current = path.dirname(current); - } while (current !== previous); - - return null; - }); - - function findWorkspaceRoot(_x13) { - return _ref15.apply(this, arguments); - } - - return findWorkspaceRoot; - }(); - - Config.prototype.resolveWorkspaces = function () { - var _ref16 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (root, rootManifest) { - var _this5 = this; - - var workspaces = {}; - if (!this.workspacesEnabled) { - return workspaces; - } - - var ws = this.getWorkspaces(rootManifest, true); - var patterns = ws && ws.packages ? ws.packages : []; - - if (!Array.isArray(patterns)) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesSettingMustBeArray')); - } - - var registryFilenames = (_index2 || _load_index2()).registryNames.map(function (registryName) { - return _this5.registries[registryName].constructor.filename; - }).join('|'); - var trailingPattern = `/+(${registryFilenames})`; - // anything under folder (node_modules) should be ignored, thus use the '**' instead of shallow match "*" - var ignorePatterns = this.registryFolders.map(function (folder) { - return `/${folder}/**/+(${registryFilenames})`; - }); - - var files = yield (_promise || _load_promise()).default.all(patterns.map(function (pattern) { - return (_fs || _load_fs()).glob(pattern.replace(/\/?$/, trailingPattern), { - cwd: root, - ignore: ignorePatterns.map(function (ignorePattern) { - return pattern.replace(/\/?$/, ignorePattern); - }) - }); - })); - - for (var _iterator7 = new (_set || _load_set()).default((_ref18 = []).concat.apply(_ref18, files)), _isArray7 = Array.isArray(_iterator7), _i8 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { - var _ref18; - - var _ref17; - - if (_isArray7) { - if (_i8 >= _iterator7.length) break; - _ref17 = _iterator7[_i8++]; - } else { - _i8 = _iterator7.next(); - if (_i8.done) break; - _ref17 = _i8.value; - } - - var file = _ref17; - - var _loc = path.join(root, path.dirname(file)); - var manifest = yield this.findManifest(_loc, false); - - if (!manifest) { - continue; - } - - if (!manifest.name) { - this.reporter.warn(this.reporter.lang('workspaceNameMandatory', _loc)); - continue; - } - if (!manifest.version) { - this.reporter.warn(this.reporter.lang('workspaceVersionMandatory', _loc)); - continue; - } - - if (Object.prototype.hasOwnProperty.call(workspaces, manifest.name)) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspaceNameDuplicate', manifest.name)); - } - - workspaces[manifest.name] = { loc: _loc, manifest }; - } - - return workspaces; - }); - - function resolveWorkspaces(_x14, _x15) { - return _ref16.apply(this, arguments); - } - - return resolveWorkspaces; - }(); - - // workspaces functions - - - Config.prototype.getWorkspaces = function getWorkspaces(manifest) { - var shouldThrow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (!manifest || !this.workspacesEnabled) { - return undefined; - } - - var ws = extractWorkspaces(manifest); - - if (!ws) { - return ws; - } - - // validate eligibility - var wsCopy = (0, (_extends2 || _load_extends()).default)({}, ws); - var warnings = []; - var errors = []; - - // packages - if (wsCopy.packages && wsCopy.packages.length > 0 && !manifest.private) { - errors.push(this.reporter.lang('workspacesRequirePrivateProjects')); - wsCopy = undefined; - } - // nohoist - if (wsCopy && wsCopy.nohoist && wsCopy.nohoist.length > 0) { - if (!this.workspacesNohoistEnabled) { - warnings.push(this.reporter.lang('workspacesNohoistDisabled', manifest.name)); - wsCopy.nohoist = undefined; - } else if (!manifest.private) { - errors.push(this.reporter.lang('workspacesNohoistRequirePrivatePackages', manifest.name)); - wsCopy.nohoist = undefined; - } - } - - if (errors.length > 0 && shouldThrow) { - throw new (_errors || _load_errors()).MessageError(errors.join('\n')); - } - - var msg = errors.concat(warnings).join('\n'); - if (msg.length > 0) { - this.reporter.warn(msg); - } - - return wsCopy; - }; - - /** - * Description - */ - - Config.prototype.getFolder = function getFolder(pkg) { - var registryName = pkg._registry; - if (!registryName) { - var ref = pkg._reference; - invariant(ref, 'expected reference'); - registryName = ref.registry; - } - return this.registries[registryName].folder; - }; - - /** - * Get root manifests. - */ - - Config.prototype.getRootManifests = function () { - var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var manifests = {}; - for (var _iterator8 = (_index2 || _load_index2()).registryNames, _isArray8 = Array.isArray(_iterator8), _i9 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) { - var _ref20; - - if (_isArray8) { - if (_i9 >= _iterator8.length) break; - _ref20 = _iterator8[_i9++]; - } else { - _i9 = _iterator8.next(); - if (_i9.done) break; - _ref20 = _i9.value; - } - - var _registryName = _ref20; - - var _registry5 = (_index2 || _load_index2()).registries[_registryName]; - var jsonLoc = path.join(this.cwd, _registry5.filename); - - var _object = {}; - var _exists = false; - var _indent = void 0; - if (yield (_fs || _load_fs()).exists(jsonLoc)) { - _exists = true; - - var info = yield this.readJson(jsonLoc, (_fs || _load_fs()).readJsonAndFile); - _object = info.object; - _indent = detectIndent(info.content).indent || undefined; - } - manifests[_registryName] = { loc: jsonLoc, object: _object, exists: _exists, indent: _indent }; - } - return manifests; - }); - - function getRootManifests() { - return _ref19.apply(this, arguments); - } - - return getRootManifests; - }(); - - /** - * Save root manifests. - */ - - Config.prototype.saveRootManifests = function () { - var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (manifests) { - for (var _iterator9 = (_index2 || _load_index2()).registryNames, _isArray9 = Array.isArray(_iterator9), _i10 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) { - var _ref22; - - if (_isArray9) { - if (_i10 >= _iterator9.length) break; - _ref22 = _iterator9[_i10++]; - } else { - _i10 = _iterator9.next(); - if (_i10.done) break; - _ref22 = _i10.value; - } - - var _registryName2 = _ref22; - var _manifests$_registryN = manifests[_registryName2], - _loc2 = _manifests$_registryN.loc, - _object2 = _manifests$_registryN.object, - _exists2 = _manifests$_registryN.exists, - _indent2 = _manifests$_registryN.indent; - - if (!_exists2 && !(0, (_keys || _load_keys()).default)(_object2).length) { - continue; - } - - for (var _iterator10 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray10 = Array.isArray(_iterator10), _i11 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) { - var _ref23; - - if (_isArray10) { - if (_i11 >= _iterator10.length) break; - _ref23 = _iterator10[_i11++]; - } else { - _i11 = _iterator10.next(); - if (_i11.done) break; - _ref23 = _i11.value; - } - - var field = _ref23; - - if (_object2[field]) { - _object2[field] = sortObject(_object2[field]); - } - } - - yield (_fs || _load_fs()).writeFilePreservingEol(_loc2, (0, (_stringify || _load_stringify()).default)(_object2, null, _indent2 || (_constants || _load_constants()).DEFAULT_INDENT) + '\n'); - } - }); - - function saveRootManifests(_x17) { - return _ref21.apply(this, arguments); - } - - return saveRootManifests; - }(); - - /** - * Call the passed factory (defaults to fs.readJson) and rethrow a pretty error message if it was the result - * of a syntax error. - */ - - Config.prototype.readJson = function readJson(loc) { - var factory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_fs || _load_fs()).readJson; - - try { - return factory(loc); - } catch (err) { - if (err instanceof SyntaxError) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('jsonError', loc, err.message)); - } else { - throw err; - } - } - }; - - Config.create = function () { - var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var reporter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new (_index3 || _load_index3()).NoopReporter(); - - var config = new Config(reporter); - yield config.init(opts); - return config; - }); - - function create() { - return _ref24.apply(this, arguments); - } - - return create; - }(); - - return Config; -}(); - -exports.default = Config; -function extractWorkspaces(manifest) { - if (!manifest || !manifest.workspaces) { - return undefined; - } - - if (Array.isArray(manifest.workspaces)) { - return { packages: manifest.workspaces }; - } - - if (manifest.workspaces.packages && Array.isArray(manifest.workspaces.packages) || manifest.workspaces.nohoist && Array.isArray(manifest.workspaces.nohoist)) { - return manifest.workspaces; - } - - return undefined; -} - -/***/ }), -/* 150 */ -/***/ (function(module, exports) { - -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; - - -/***/ }), -/* 151 */ -/***/ (function(module, exports) { - -module.exports = require("net"); - -/***/ }), -/* 152 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var chalk = __webpack_require__(36); -var figures = __webpack_require__(236); - -/** - * Separator object - * Used to space/separate choices group - * @constructor - * @param {String} line Separation line content (facultative) - */ - -var Separator = function () { - function Separator(line) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Separator); - - this.type = 'separator'; - this.line = chalk.dim(line || new Array(15).join(figures.line)); - } - - /** - * Stringify separator - * @return {String} the separator display string - */ - - - Separator.prototype.toString = function toString() { - return this.line; - }; - - return Separator; -}(); - -/** - * Helper function returning false if object is a separator - * @param {Object} obj object to test against - * @return {Boolean} `false` if object is a separator - */ - -Separator.exclude = function (obj) { - return obj.type !== 'separator'; -}; - -module.exports = Separator; - -/***/ }), -/* 153 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _ = __webpack_require__(45); -var chalk = __webpack_require__(36); - -/** - * The paginator keeps track of a pointer index in a list and returns - * a subset of the choices if the list is too long. - */ - -var Paginator = function () { - function Paginator(screen) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Paginator); - - this.pointer = 0; - this.lastIndex = 0; - this.screen = screen; - } - - Paginator.prototype.paginate = function paginate(output, active, pageSize) { - pageSize = pageSize || 7; - var middleOfList = Math.floor(pageSize / 2); - var lines = output.split('\n'); - - if (this.screen) { - lines = this.screen.breakLines(lines); - active = _.sum(lines.map(function (lineParts) { - return lineParts.length; - }).splice(0, active)); - lines = _.flatten(lines); - } - - // Make sure there's enough lines to paginate - if (lines.length <= pageSize) { - return output; - } - - // Move the pointer only when the user go down and limit it to the middle of the list - if (this.pointer < middleOfList && this.lastIndex < active && active - this.lastIndex < pageSize) { - this.pointer = Math.min(middleOfList, this.pointer + active - this.lastIndex); - } - this.lastIndex = active; - - // Duplicate the lines so it give an infinite list look - var infinite = _.flatten([lines, lines, lines]); - var topIndex = Math.max(0, active + lines.length - this.pointer); - - var section = infinite.splice(topIndex, pageSize).join('\n'); - return section + '\n' + chalk.dim('(Move up and down to reveal more choices)'); - }; - - return Paginator; -}(); - -module.exports = Paginator; - -/***/ }), -/* 154 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.Add = undefined; - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -var run = exports.run = function () { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (!args.length) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('missingAddDependencies')); - } - - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); - - yield (0, (_install || _load_install()).wrapLifecycle)(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var install = new Add(args, flags, config, reporter, lockfile); - yield install.init(); - })); - }); - - return function run(_x5, _x6, _x7, _x8) { - return _ref13.apply(this, arguments); - }; -}(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -var _normalizePattern2; - -function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(52); -} - -var _workspaceLayout; - -function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(87)); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(75); -} - -var _list; - -function _load_list() { - return _list = __webpack_require__(300); -} - -var _install; - -function _load_install() { - return _install = __webpack_require__(41); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _invariant; - -function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(15)); -} - -var _path; - -function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(1)); -} - -var _semver; - -function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(27)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var SILENCE_DEPENDENCY_TYPE_WARNINGS = ['upgrade', 'upgrade-interactive']; - -var Add = exports.Add = function (_Install) { - (0, (_inherits2 || _load_inherits()).default)(Add, _Install); - - function Add(args, flags, config, reporter, lockfile) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Add); - - var workspaceRootIsCwd = config.cwd === config.lockfileFolder; - var _flags = flags ? (0, (_extends2 || _load_extends()).default)({}, flags, { workspaceRootIsCwd }) : { workspaceRootIsCwd }; - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Install.call(this, _flags, config, reporter, lockfile)); - - _this.args = args; - // only one flag is supported, so we can figure out which one was passed to `yarn add` - _this.flagToOrigin = [flags.dev && 'devDependencies', flags.optional && 'optionalDependencies', flags.peer && 'peerDependencies', 'dependencies'].filter(Boolean).shift(); - return _this; - } - - /** - * TODO - */ - - Add.prototype.prepareRequests = function prepareRequests(requests) { - var requestsWithArgs = requests.slice(); - - for (var _iterator = this.args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var _pattern = _ref; - - requestsWithArgs.push({ - pattern: _pattern, - registry: 'npm', - optional: false - }); - } - return requestsWithArgs; - }; - - /** - * returns version for a pattern based on Manifest - */ - - - Add.prototype.getPatternVersion = function getPatternVersion(pattern, pkg) { - var tilde = this.flags.tilde; - var configPrefix = String(this.config.getOption('save-prefix')); - var exact = this.flags.exact || Boolean(this.config.getOption('save-exact')) || configPrefix === ''; - - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern), - hasVersion = _normalizePattern.hasVersion, - range = _normalizePattern.range; - - var version = void 0; - - if ((0, (_index || _load_index()).getExoticResolver)(pattern)) { - // wasn't a name/range tuple so this is just a raw exotic pattern - version = pattern; - } else if (hasVersion && range && ((_semver || _load_semver()).default.satisfies(pkg.version, range) || (0, (_index || _load_index()).getExoticResolver)(range))) { - // if the user specified a range then use it verbatim - version = range; - } - - if (!version || (_semver || _load_semver()).default.valid(version)) { - var prefix = configPrefix || '^'; - - if (tilde) { - prefix = '~'; - } else if (version || exact) { - prefix = ''; - } - version = `${prefix}${pkg.version}`; - } - - return version; - }; - - Add.prototype.preparePatterns = function preparePatterns(patterns) { - var preparedPatterns = patterns.slice(); - for (var _iterator2 = this.resolver.dedupePatterns(this.args), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref2; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } - - var _pattern2 = _ref2; - - var pkg = this.resolver.getResolvedPattern(_pattern2); - (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${_pattern2}`); - var _version = this.getPatternVersion(_pattern2, pkg); - var newPattern = `${pkg.name}@${_version}`; - preparedPatterns.push(newPattern); - this.addedPatterns.push(newPattern); - if (newPattern === _pattern2) { - continue; - } - this.resolver.replacePattern(_pattern2, newPattern); - } - return preparedPatterns; - }; - - Add.prototype.preparePatternsForLinking = function preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) { - // remove the newly added patterns if cwd != root and update the in-memory package dependency instead - if (cwdIsRoot) { - return patterns; - } - - var manifest = void 0; - var cwdPackage = `${cwdManifest.name}@${cwdManifest.version}`; - try { - manifest = this.resolver.getStrictResolvedPattern(cwdPackage); - } catch (e) { - this.reporter.warn(this.reporter.lang('unknownPackage', cwdPackage)); - return patterns; - } - - var newPatterns = patterns; - this._iterateAddedPackages(function (pattern, registry, dependencyType, pkgName, version) { - // remove added package from patterns list - var filtered = newPatterns.filter(function (p) { - return p !== pattern; - }); - (0, (_invariant || _load_invariant()).default)(newPatterns.length - filtered.length > 0, `expect added pattern '${pattern}' in the list: ${patterns.toString()}`); - newPatterns = filtered; - - // add new package into in-memory manifest so they can be linked properly - manifest[dependencyType] = manifest[dependencyType] || {}; - if (manifest[dependencyType][pkgName] === version) { - // package already existed - return; - } - - // update dependencies in the manifest - (0, (_invariant || _load_invariant()).default)(manifest._reference, 'manifest._reference should not be null'); - var ref = manifest._reference; - - ref['dependencies'] = ref['dependencies'] || []; - ref['dependencies'].push(pattern); - }); - - return newPatterns; - }; - - Add.prototype.bailout = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) { - var lockfileCache = this.lockfile.cache; - if (!lockfileCache) { - return false; - } - var match = yield this.integrityChecker.check(patterns, lockfileCache, this.flags, workspaceLayout); - var haveLockfile = yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); - if (match.integrityFileMissing && haveLockfile) { - // Integrity file missing, force script installations - this.scripts.setForce(true); - } - return false; - }); - - function bailout(_x, _x2) { - return _ref3.apply(this, arguments); - } - - return bailout; - }(); - - /** - * Description - */ - - Add.prototype.init = function () { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var isWorkspaceRoot = this.config.workspaceRootFolder && this.config.cwd === this.config.workspaceRootFolder; - - // running "yarn add something" in a workspace root is often a mistake - if (isWorkspaceRoot && !this.flags.ignoreWorkspaceRootCheck) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesAddRootCheck')); - } - - this.addedPatterns = []; - var patterns = yield (_install || _load_install()).Install.prototype.init.call(this); - yield this.maybeOutputSaveTree(patterns); - return patterns; - }); - - function init() { - return _ref4.apply(this, arguments); - } - - return init; - }(); - - Add.prototype.applyChanges = function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (manifests) { - var _this2 = this; - - yield (_install || _load_install()).Install.prototype.applyChanges.call(this, manifests); - - // fill rootPatternsToOrigin without `excludePatterns` - yield (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(this); - - this._iterateAddedPackages(function (pattern, registry, dependencyType, pkgName, version) { - // add it to manifest - var object = manifests[registry].object; - - - object[dependencyType] = object[dependencyType] || {}; - object[dependencyType][pkgName] = version; - if (SILENCE_DEPENDENCY_TYPE_WARNINGS.indexOf(_this2.config.commandName) === -1 && dependencyType !== _this2.flagToOrigin) { - _this2.reporter.warn(_this2.reporter.lang('moduleAlreadyInManifest', pkgName, dependencyType, _this2.flagToOrigin)); - } - }); - - return true; - }); - - function applyChanges(_x3) { - return _ref5.apply(this, arguments); - } - - return applyChanges; - }(); - - /** - * Description - */ - - Add.prototype.fetchRequestFromCwd = function fetchRequestFromCwd() { - return (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(this, this.args); - }; - - /** - * Output a tree of any newly added dependencies. - */ - - Add.prototype.maybeOutputSaveTree = function () { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns) { - // don't limit the shown tree depth - var opts = { - reqDepth: 0 - }; - - // restore the original patterns - var merged = [].concat(patterns, this.addedPatterns); - - var _ref7 = yield (0, (_list || _load_list()).buildTree)(this.resolver, this.linker, merged, opts, true, true), - trees = _ref7.trees, - count = _ref7.count; - - if (count === 1) { - this.reporter.success(this.reporter.lang('savedNewDependency')); - } else { - this.reporter.success(this.reporter.lang('savedNewDependencies', count)); - } - - if (!count) { - return; - } - - var resolverPatterns = new (_set || _load_set()).default(); - for (var _iterator3 = patterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref8; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref8 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref8 = _i3.value; - } - - var _pattern3 = _ref8; - - var _ref10 = this.resolver.getResolvedPattern(_pattern3) || {}, - _version2 = _ref10.version, - name = _ref10.name; - - resolverPatterns.add(`${name}@${_version2}`); - } - var directRequireDependencies = trees.filter(function (_ref9) { - var name = _ref9.name; - return resolverPatterns.has(name); - }); - - this.reporter.info(this.reporter.lang('directDependencies')); - this.reporter.tree('newDirectDependencies', directRequireDependencies); - this.reporter.info(this.reporter.lang('allDependencies')); - this.reporter.tree('newAllDependencies', trees); - }); - - function maybeOutputSaveTree(_x4) { - return _ref6.apply(this, arguments); - } - - return maybeOutputSaveTree; - }(); - - /** - * Save added packages to manifest if any of the --save flags were used. - */ - - Add.prototype.savePackages = function () { - var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {}); - - function savePackages() { - return _ref11.apply(this, arguments); - } - - return savePackages; - }(); - - Add.prototype._iterateAddedPackages = function _iterateAddedPackages(f) { - var _this3 = this; - - var patternOrigins = (0, (_keys || _load_keys()).default)(this.rootPatternsToOrigin); - - // add new patterns to their appropriate registry manifest - - var _loop = function _loop(_pattern4) { - var pkg = _this3.resolver.getResolvedPattern(_pattern4); - (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${_pattern4}`); - var version = _this3.getPatternVersion(_pattern4, pkg); - var ref = pkg._reference; - (0, (_invariant || _load_invariant()).default)(ref, 'expected package reference'); - // lookup the package to determine dependency type; used during `yarn upgrade` - var depType = patternOrigins.reduce(function (acc, prev) { - if (prev.indexOf(`${pkg.name}@`) === 0) { - return _this3.rootPatternsToOrigin[prev]; - } - return acc; - }, null); - - // depType is calculated when `yarn upgrade` command is used - var target = depType || _this3.flagToOrigin; - - f(_pattern4, ref.registry, target, pkg.name, version); - }; - - for (var _iterator4 = this.addedPatterns, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref12; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref12 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref12 = _i4.value; - } - - var _pattern4 = _ref12; - - _loop(_pattern4); - } - }; - - return Add; -}((_install || _load_install()).Install); - -function hasWrapper(commander) { - return true; -} - -function setFlags(commander) { - commander.description('Installs a package and any packages that it depends on.'); - commander.usage('add [packages ...] [flags]'); - commander.option('-W, --ignore-workspace-root-check', 'required to run yarn add inside a workspace root'); - commander.option('-D, --dev', 'save package to your `devDependencies`'); - commander.option('-P, --peer', 'save package to your `peerDependencies`'); - commander.option('-O, --optional', 'save package to your `optionalDependencies`'); - commander.option('-E, --exact', 'install exact version'); - commander.option('-T, --tilde', 'install most recent release with the same minor version'); - commander.option('-A, --audit', 'Run vulnerability audit on installed packages'); -} - -/***/ }), -/* 155 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.pack = exports.packTarball = undefined; - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _from; - -function _load_from() { - return _from = _interopRequireDefault(__webpack_require__(53)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var packTarball = exports.packTarball = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { - var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - mapHeader = _ref2.mapHeader; - - var pkg = yield config.readRootManifest(); - var bundleDependencies = pkg.bundleDependencies, - main = pkg.main, - onlyFiles = pkg.files; - - // include required files - - var filters = NEVER_IGNORE.slice(); - // include default filters unless `files` is used - if (!onlyFiles) { - filters = filters.concat(DEFAULT_IGNORE); - } - if (main) { - filters = filters.concat((0, (_filter || _load_filter()).ignoreLinesToRegex)(['!/' + main])); - } - - // include bundleDependencies - var bundleDependenciesFiles = []; - if (bundleDependencies) { - for (var _iterator = bundleDependencies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref3; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref3 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref3 = _i.value; - } - - var dependency = _ref3; - - var dependencyList = depsFor(dependency, config.cwd); - - for (var _iterator2 = dependencyList, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref4; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref4 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref4 = _i2.value; - } - - var dep = _ref4; - - var filesForBundledDep = yield (_fs || _load_fs()).walk(dep.baseDir, null, new (_set || _load_set()).default(FOLDERS_IGNORE)); - bundleDependenciesFiles = bundleDependenciesFiles.concat(filesForBundledDep); - } - } - } - - // `files` field - if (onlyFiles) { - var lines = ['*']; - lines = lines.concat(onlyFiles.map(function (filename) { - return `!${filename}`; - }), onlyFiles.map(function (filename) { - return `!${path.join(filename, '**')}`; - })); - var regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines, './'); - filters = filters.concat(regexes); - } - - var files = yield (_fs || _load_fs()).walk(config.cwd, null, new (_set || _load_set()).default(FOLDERS_IGNORE)); - var dotIgnoreFiles = (0, (_filter || _load_filter()).filterOverridenGitignores)(files); - - // create ignores - for (var _iterator3 = dotIgnoreFiles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref5; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref5 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref5 = _i3.value; - } - - var file = _ref5; - - var raw = yield (_fs || _load_fs()).readFile(file.absolute); - var _lines = raw.split('\n'); - - var _regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(_lines, path.dirname(file.relative)); - filters = filters.concat(_regexes); - } - - // files to definitely keep, takes precedence over ignore filter - var keepFiles = new (_set || _load_set()).default(); - - // files to definitely ignore - var ignoredFiles = new (_set || _load_set()).default(); - - // list of files that didn't match any of our patterns, if a directory in the chain above was matched - // then we should inherit it - var possibleKeepFiles = new (_set || _load_set()).default(); - - // apply filters - (0, (_filter || _load_filter()).sortFilter)(files, filters, keepFiles, possibleKeepFiles, ignoredFiles); - - // add the files for the bundled dependencies to the set of files to keep - for (var _iterator4 = bundleDependenciesFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref6; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref6 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref6 = _i4.value; - } - - var _file = _ref6; - - var realPath = yield (_fs || _load_fs()).realpath(config.cwd); - keepFiles.add(path.relative(realPath, _file.absolute)); - } - - return packWithIgnoreAndHeaders(config.cwd, function (name) { - var relative = path.relative(config.cwd, name); - // Don't ignore directories, since we need to recurse inside them to check for unignored files. - if (fs2.lstatSync(name).isDirectory()) { - var isParentOfKeptFile = (0, (_from || _load_from()).default)(keepFiles).some(function (name) { - return !path.relative(relative, name).startsWith('..'); - }); - return !isParentOfKeptFile; - } - // Otherwise, ignore a file if we're not supposed to keep it. - return !keepFiles.has(relative); - }, { mapHeader }); - }); - - return function packTarball(_x) { - return _ref.apply(this, arguments); - }; -}(); - -var pack = exports.pack = function () { - var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { - var packer = yield packTarball(config); - var compressor = packer.pipe(new zlib.Gzip()); - - return compressor; - }); - - return function pack(_x4) { - return _ref8.apply(this, arguments); - }; -}(); - -var run = exports.run = function () { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var pkg = yield config.readRootManifest(); - if (!pkg.name) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noName')); - } - if (!pkg.version) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noVersion')); - } - - var normaliseScope = function normaliseScope(name) { - return name[0] === '@' ? name.substr(1).replace('/', '-') : name; - }; - var filename = flags.filename || path.join(config.cwd, `${normaliseScope(pkg.name)}-v${pkg.version}.tgz`); - - yield config.executeLifecycleScript('prepack'); - - var stream = yield pack(config); - - yield new (_promise || _load_promise()).default(function (resolve, reject) { - stream.pipe(fs2.createWriteStream(filename)); - stream.on('error', reject); - stream.on('close', resolve); - }); - - yield config.executeLifecycleScript('postpack'); - - reporter.success(reporter.lang('packWroteTarball', filename)); - }); - - return function run(_x5, _x6, _x7, _x8) { - return _ref9.apply(this, arguments); - }; -}(); - -exports.packWithIgnoreAndHeaders = packWithIgnoreAndHeaders; -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _filter; - -function _load_filter() { - return _filter = __webpack_require__(315); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var zlib = __webpack_require__(187); -var path = __webpack_require__(1); -var tar = __webpack_require__(183); -var fs2 = __webpack_require__(12); -var depsFor = __webpack_require__(738); - -var FOLDERS_IGNORE = [ -// never allow version control folders -'.git', 'CVS', '.svn', '.hg', 'node_modules']; - -var DEFAULT_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([].concat(FOLDERS_IGNORE, [ - -// ignore cruft -'yarn.lock', '.lock-wscript', '.wafpickle-{0..9}', '*.swp', '._*', 'npm-debug.log', 'yarn-error.log', '.npmrc', '.yarnrc', '.npmignore', '.gitignore', '.DS_Store'])); - -var NEVER_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([ -// never ignore these files -'!/package.json', '!/readme*', '!/+(license|licence)*', '!/+(changes|changelog|history)*']); - -function packWithIgnoreAndHeaders(cwd, ignoreFunction) { - var _ref7 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, - mapHeader = _ref7.mapHeader; - - return tar.pack(cwd, { - ignore: ignoreFunction, - map: function map(header) { - var suffix = header.name === '.' ? '' : `/${header.name}`; - header.name = `package${suffix}`; - delete header.uid; - delete header.gid; - return mapHeader ? mapHeader(header) : header; - } - }); -} - -function setFlags(commander) { - commander.description('Creates a compressed gzip archive of package dependencies.'); - commander.option('-f, --filename ', 'filename'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 156 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _stringify; - -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(40)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _index; - -function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(208)); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _mutex; - -function _load_mutex() { - return _mutex = _interopRequireDefault(__webpack_require__(318)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* eslint no-unused-vars: 0 */ - -var cmdShim = __webpack_require__(189); -var path = __webpack_require__(1); - -var BaseFetcher = function () { - function BaseFetcher(dest, remote, config) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseFetcher); - - this.reporter = config.reporter; - this.packageName = remote.packageName; - this.reference = remote.reference; - this.registry = remote.registry; - this.hash = remote.hash; - this.remote = remote; - this.config = config; - this.dest = dest; - } - - BaseFetcher.prototype.setupMirrorFromCache = function setupMirrorFromCache() { - // fetcher subclasses may use this to perform actions such as copying over a cached tarball to the offline - // mirror etc - return (_promise || _load_promise()).default.resolve(); - }; - - BaseFetcher.prototype._fetch = function _fetch() { - return (_promise || _load_promise()).default.reject(new Error('Not implemented')); - }; - - BaseFetcher.prototype.fetch = function fetch(defaultManifest) { - var _this = this; - - return (_fs || _load_fs()).lockQueue.push(this.dest, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield (_fs || _load_fs()).mkdirp(_this.dest); - - // fetch package and get the hash - - var _ref2 = yield _this._fetch(), - hash = _ref2.hash; - - var pkg = yield (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // load the new normalized manifest - try { - return yield _this.config.readManifest(_this.dest, _this.registry); - } catch (e) { - if (e.code === 'ENOENT' && defaultManifest) { - return (0, (_index || _load_index()).default)(defaultManifest, _this.dest, _this.config, false); - } else { - throw e; - } - } - })(); - - if (pkg.bin) { - for (var _iterator = (0, (_keys || _load_keys()).default)(pkg.bin), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref4; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref4 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref4 = _i.value; - } - - var binName = _ref4; - - var binDest = `${_this.dest}/.bin`; - - // Using any sort of absolute path here would prevent makePortableProxyScript from preserving symlinks when - // calling the binary - var src = path.resolve(_this.dest, pkg.bin[binName]); - - if (yield (_fs || _load_fs()).exists(src)) { - // We ensure that the target is executable - yield (_fs || _load_fs()).chmod(src, 0o755); - } - - yield (_fs || _load_fs()).mkdirp(binDest); - if (process.platform === 'win32') { - var unlockMutex = yield (0, (_mutex || _load_mutex()).default)(src); - try { - yield cmdShim.ifExists(src, `${binDest}/${binName}`, { createPwshFile: false }); - } finally { - unlockMutex(); - } - } else { - yield (_fs || _load_fs()).symlink(src, `${binDest}/${binName}`); - } - } - } - - yield (_fs || _load_fs()).writeFile(path.join(_this.dest, (_constants || _load_constants()).METADATA_FILENAME), (0, (_stringify || _load_stringify()).default)({ - manifest: pkg, - artifacts: [], - remote: _this.remote, - registry: _this.registry, - hash - }, null, ' ')); - - return { - hash, - dest: _this.dest, - package: pkg, - cached: false - }; - })); - }; - - return BaseFetcher; -}(); - -exports.default = BaseFetcher; - -/***/ }), -/* 157 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _stringify; - -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(40)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(51)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var debug = __webpack_require__(683)('yarn'); - -var BlockingQueue = function () { - function BlockingQueue(alias) { - var maxConcurrency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity; - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BlockingQueue); - - this.concurrencyQueue = []; - this.maxConcurrency = maxConcurrency; - this.runningCount = 0; - this.warnedStuck = false; - this.alias = alias; - this.first = true; - - this.running = (0, (_map || _load_map()).default)(); - this.queue = (0, (_map || _load_map()).default)(); - - this.stuckTick = this.stuckTick.bind(this); - } - - BlockingQueue.prototype.stillActive = function stillActive() { - if (this.stuckTimer) { - clearTimeout(this.stuckTimer); - } - - this.stuckTimer = setTimeout(this.stuckTick, 5000); - - // We need to check the existence of unref because of https://github.com/facebook/jest/issues/4559 - // $FlowFixMe: Node's setInterval returns a Timeout, not a Number - this.stuckTimer.unref && this.stuckTimer.unref(); - }; - - BlockingQueue.prototype.stuckTick = function stuckTick() { - if (this.runningCount === 1) { - this.warnedStuck = true; - debug(`The ${(0, (_stringify || _load_stringify()).default)(this.alias)} blocking queue may be stuck. 5 seconds ` + `without any activity with 1 worker: ${(0, (_keys || _load_keys()).default)(this.running)[0]}`); - } - }; - - BlockingQueue.prototype.push = function push(key, factory) { - var _this = this; - - if (this.first) { - this.first = false; - } else { - this.stillActive(); - } - - return new (_promise || _load_promise()).default(function (resolve, reject) { - // we're already running so push ourselves to the queue - var queue = _this.queue[key] = _this.queue[key] || []; - queue.push({ factory, resolve, reject }); - - if (!_this.running[key]) { - _this.shift(key); - } - }); - }; - - BlockingQueue.prototype.shift = function shift(key) { - var _this2 = this; - - if (this.running[key]) { - delete this.running[key]; - this.runningCount--; - - if (this.stuckTimer) { - clearTimeout(this.stuckTimer); - this.stuckTimer = null; - } - - if (this.warnedStuck) { - this.warnedStuck = false; - debug(`${(0, (_stringify || _load_stringify()).default)(this.alias)} blocking queue finally resolved. Nothing to worry about.`); - } - } - - var queue = this.queue[key]; - if (!queue) { - return; - } - - var _queue$shift = queue.shift(), - resolve = _queue$shift.resolve, - reject = _queue$shift.reject, - factory = _queue$shift.factory; - - if (!queue.length) { - delete this.queue[key]; - } - - var next = function next() { - _this2.shift(key); - _this2.shiftConcurrencyQueue(); - }; - - var run = function run() { - _this2.running[key] = true; - _this2.runningCount++; - - factory().then(function (val) { - resolve(val); - next(); - return null; - }).catch(function (err) { - reject(err); - next(); - }); - }; - - this.maybePushConcurrencyQueue(run); - }; - - BlockingQueue.prototype.maybePushConcurrencyQueue = function maybePushConcurrencyQueue(run) { - if (this.runningCount < this.maxConcurrency) { - run(); - } else { - this.concurrencyQueue.push(run); - } - }; - - BlockingQueue.prototype.shiftConcurrencyQueue = function shiftConcurrencyQueue() { - if (this.runningCount < this.maxConcurrency) { - var fn = this.concurrencyQueue.shift(); - if (fn) { - fn(); - } - } - }; - - return BlockingQueue; -}(); - -exports.default = BlockingQueue; - -/***/ }), -/* 158 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.HashStream = undefined; - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -exports.hash = hash; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var crypto = __webpack_require__(21); -var stream = __webpack_require__(35); - -function hash(content) { - var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md5'; - - return crypto.createHash(type).update(content).digest('hex'); -} - -var HashStream = exports.HashStream = function (_stream$Transform) { - (0, (_inherits2 || _load_inherits()).default)(HashStream, _stream$Transform); - - function HashStream(options) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, HashStream); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _stream$Transform.call(this, options)); - - _this._hash = crypto.createHash('sha1'); - _this._updated = false; - return _this; - } - - HashStream.prototype._transform = function _transform(chunk, encoding, callback) { - this._updated = true; - this._hash.update(chunk); - callback(null, chunk); - }; - - HashStream.prototype.getHash = function getHash() { - return this._hash.digest('hex'); - }; - - HashStream.prototype.test = function test(sum) { - return this._updated && sum === this.getHash(); - }; - - return HashStream; -}(stream.Transform); - -/***/ }), -/* 159 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -exports.default = guessName; - -var _url; - -function _load_url() { - return _url = _interopRequireDefault(__webpack_require__(29)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function cleanup(name) { - name = name.replace(/-\d+\.\d+\.\d+/, ''); - return name.replace(/\.git$|\.zip$|\.tar\.gz$|\.tar\.bz2$/, ''); -} - -function guessNameFallback(source) { - // If cannot parse as url, just return cleaned up last part - var parts = source.split('/'); - return cleanup(parts[parts.length - 1]); -} - -function guessName(source) { - try { - var parsed = (_url || _load_url()).default.parse(source); - - if (!parsed.pathname) { - return guessNameFallback(source); - } - - var parts = parsed.pathname.split('/'); - - // Priority goes to part that ends with .git - for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var part = _ref; - - if (part.match(/\.git$/)) { - return cleanup(part); - } - } - - // Most likely a directory - if (parsed.host == null) { - return cleanup(parts[parts.length - 1]); - } - - // A site like github or gitlab - if (parts.length > 2) { - return cleanup(parts[2]); - } - - // Privately hosted package? - if (parts.length > 1) { - return cleanup(parts[1]); - } - - return guessNameFallback(source); - } catch (e) { - return guessNameFallback(source); - } -} - -/***/ }), -/* 160 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.15 ToLength -var toInteger = __webpack_require__(229); -var min = Math.min; -module.exports = function (it) { - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; - - -/***/ }), -/* 161 */ -/***/ (function(module, exports) { - -var id = 0; -var px = Math.random(); -module.exports = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; - - -/***/ }), -/* 162 */ -/***/ (function(module, exports) { - - - -/***/ }), -/* 163 */ -/***/ (function(module, exports, __webpack_require__) { - -var once = __webpack_require__(133); - -var noop = function() {}; - -var isRequest = function(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -}; - -var isChildProcess = function(stream) { - return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 -}; - -var eos = function(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - - callback = once(callback || noop); - - var ws = stream._writableState; - var rs = stream._readableState; - var readable = opts.readable || (opts.readable !== false && stream.readable); - var writable = opts.writable || (opts.writable !== false && stream.writable); - - var onlegacyfinish = function() { - if (!stream.writable) onfinish(); - }; - - var onfinish = function() { - writable = false; - if (!readable) callback.call(stream); - }; - - var onend = function() { - readable = false; - if (!writable) callback.call(stream); - }; - - var onexit = function(exitCode) { - callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); - }; - - var onerror = function(err) { - callback.call(stream, err); - }; - - var onclose = function() { - if (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close')); - if (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close')); - }; - - var onrequest = function() { - stream.req.on('finish', onfinish); - }; - - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest(); - else stream.on('request', onrequest); - } else if (writable && !ws) { // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - if (isChildProcess(stream)) stream.on('exit', onexit); - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - - return function() { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('exit', onexit); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -}; - -module.exports = eos; - - -/***/ }), -/* 164 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2012 Joyent, Inc. All rights reserved. - -var assert = __webpack_require__(22); -var sshpk = __webpack_require__(268); -var util = __webpack_require__(9); - -var HASH_ALGOS = { - 'sha1': true, - 'sha256': true, - 'sha512': true -}; - -var PK_ALGOS = { - 'rsa': true, - 'dsa': true, - 'ecdsa': true -}; - -function HttpSignatureError(message, caller) { - if (Error.captureStackTrace) - Error.captureStackTrace(this, caller || HttpSignatureError); - - this.message = message; - this.name = caller.name; -} -util.inherits(HttpSignatureError, Error); - -function InvalidAlgorithmError(message) { - HttpSignatureError.call(this, message, InvalidAlgorithmError); -} -util.inherits(InvalidAlgorithmError, HttpSignatureError); - -function validateAlgorithm(algorithm) { - var alg = algorithm.toLowerCase().split('-'); - - if (alg.length !== 2) { - throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' + - 'valid algorithm')); - } - - if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) { - throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' + - 'are not supported')); - } - - if (!HASH_ALGOS[alg[1]]) { - throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' + - 'supported hash algorithm')); - } - - return (alg); -} - -///--- API - -module.exports = { - - HASH_ALGOS: HASH_ALGOS, - PK_ALGOS: PK_ALGOS, - - HttpSignatureError: HttpSignatureError, - InvalidAlgorithmError: InvalidAlgorithmError, - - validateAlgorithm: validateAlgorithm, - - /** - * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file. - * - * The intent of this module is to interoperate with OpenSSL only, - * specifically the node crypto module's `verify` method. - * - * @param {String} key an OpenSSH public key. - * @return {String} PEM encoded form of the RSA public key. - * @throws {TypeError} on bad input. - * @throws {Error} on invalid ssh key formatted data. - */ - sshKeyToPEM: function sshKeyToPEM(key) { - assert.string(key, 'ssh_key'); - - var k = sshpk.parseKey(key, 'ssh'); - return (k.toString('pem')); - }, - - - /** - * Generates an OpenSSH fingerprint from an ssh public key. - * - * @param {String} key an OpenSSH public key. - * @return {String} key fingerprint. - * @throws {TypeError} on bad input. - * @throws {Error} if what you passed doesn't look like an ssh public key. - */ - fingerprint: function fingerprint(key) { - assert.string(key, 'ssh_key'); - - var k = sshpk.parseKey(key, 'ssh'); - return (k.fingerprint('md5').toString('hex')); - }, - - /** - * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa) - * - * The reverse of the above function. - */ - pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) { - assert.equal('string', typeof (pem), 'typeof pem'); - - var k = sshpk.parseKey(pem, 'pem'); - k.comment = comment; - return (k.toString('ssh')); - } -}; - - -/***/ }), -/* 165 */ -/***/ (function(module, exports) { - -/*! - * is-extglob - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -module.exports = function isExtglob(str) { - return typeof str === 'string' - && /[@?!+*]\(/.test(str); -}; - - -/***/ }), -/* 166 */ -/***/ (function(module, exports, __webpack_require__) { - -/*! - * is-glob - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -var isExtglob = __webpack_require__(165); - -module.exports = function isGlob(str) { - return typeof str === 'string' - && (/[*!?{}(|)[\]]/.test(str) - || isExtglob(str)); -}; - -/***/ }), -/* 167 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// JS-YAML's default schema for `load` function. -// It is not described in the YAML specification. -// -// This schema is based on JS-YAML's default safe schema and includes -// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. -// -// Also this schema is used as default base schema at `Schema.create` function. - - - - - -var Schema = __webpack_require__(107); - - -module.exports = Schema.DEFAULT = new Schema({ - include: [ - __webpack_require__(132) - ], - explicit: [ - __webpack_require__(805), - __webpack_require__(804), - __webpack_require__(803) - ] -}); - - -/***/ }), -/* 168 */ -/***/ (function(module, exports, __webpack_require__) { - -var isBuffer = __webpack_require__(778); -var toString = Object.prototype.toString; - -/** - * Get the native `typeof` a value. - * - * @param {*} `val` - * @return {*} Native javascript type - */ - -module.exports = function kindOf(val) { - // primitivies - if (typeof val === 'undefined') { - return 'undefined'; - } - if (val === null) { - return 'null'; - } - if (val === true || val === false || val instanceof Boolean) { - return 'boolean'; - } - if (typeof val === 'string' || val instanceof String) { - return 'string'; - } - if (typeof val === 'number' || val instanceof Number) { - return 'number'; - } - - // functions - if (typeof val === 'function' || val instanceof Function) { - return 'function'; - } - - // array - if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { - return 'array'; - } - - // check for instances of RegExp and Date before calling `toString` - if (val instanceof RegExp) { - return 'regexp'; - } - if (val instanceof Date) { - return 'date'; - } - - // other objects - var type = toString.call(val); - - if (type === '[object RegExp]') { - return 'regexp'; - } - if (type === '[object Date]') { - return 'date'; - } - if (type === '[object Arguments]') { - return 'arguments'; - } - if (type === '[object Error]') { - return 'error'; - } - - // buffer - if (isBuffer(val)) { - return 'buffer'; - } - - // es6: Map, WeakMap, Set, WeakSet - if (type === '[object Set]') { - return 'set'; - } - if (type === '[object WeakSet]') { - return 'weakset'; - } - if (type === '[object Map]') { - return 'map'; - } - if (type === '[object WeakMap]') { - return 'weakmap'; - } - if (type === '[object Symbol]') { - return 'symbol'; - } - - // typed arrays - if (type === '[object Int8Array]') { - return 'int8array'; - } - if (type === '[object Uint8Array]') { - return 'uint8array'; - } - if (type === '[object Uint8ClampedArray]') { - return 'uint8clampedarray'; - } - if (type === '[object Int16Array]') { - return 'int16array'; - } - if (type === '[object Uint16Array]') { - return 'uint16array'; - } - if (type === '[object Int32Array]') { - return 'int32array'; - } - if (type === '[object Uint32Array]') { - return 'uint32array'; - } - if (type === '[object Float32Array]') { - return 'float32array'; - } - if (type === '[object Float64Array]') { - return 'float64array'; - } - - // must be a plain object - return 'object'; -}; - - -/***/ }), -/* 169 */ -/***/ (function(module, exports, __webpack_require__) { - module.exports = minimatch minimatch.Minimatch = Minimatch var path = { sep: '/' } try { - path = __webpack_require__(1) + path = __webpack_require__(0) } catch (er) {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __webpack_require__(589) +var expand = __webpack_require__(229) var plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, @@ -44686,690 +32215,226 @@ function regExpEscape (s) { /***/ }), -/* 170 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var wrappy = __webpack_require__(161) +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) -if (!process.version || - process.version.indexOf('v0.') === 0 || - process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { - module.exports = { nextTick: nextTick }; -} else { - module.exports = process + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f } -function nextTick(fn, arg1, arg2, arg3) { - if (typeof fn !== 'function') { - throw new TypeError('"callback" argument must be a function'); - } - var len = arguments.length; - var args, i; - switch (len) { - case 0: - case 1: - return process.nextTick(fn); - case 2: - return process.nextTick(function afterTickOne() { - fn.call(null, arg1); - }); - case 3: - return process.nextTick(function afterTickTwo() { - fn.call(null, arg1, arg2); - }); - case 4: - return process.nextTick(function afterTickThree() { - fn.call(null, arg1, arg2, arg3); - }); - default: - args = new Array(len - 1); - i = 0; - while (i < args.length) { - args[i++] = arguments[i]; - } - return process.nextTick(function afterTick() { - fn.apply(null, args); - }); +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f } - /***/ }), -/* 171 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var isPromise = __webpack_require__(790); - -/** - * Return a function that will run a function asynchronously or synchronously - * - * example: - * runAsync(wrappedFunction, callback)(...args); - * - * @param {Function} func Function to run - * @param {Function} cb Callback function passed the `func` returned value - * @return {Function(arguments)} Arguments to pass to `func`. This function will in turn - * return a Promise (Node >= 0.12) or call the callbacks. - */ - -var runAsync = module.exports = function (func, cb) { - cb = cb || function () {}; - - return function () { - var async = false; - var args = arguments; - - var promise = new Promise(function (resolve, reject) { - var answer = func.apply({ - async: function () { - async = true; - return function (err, value) { - if (err) { - reject(err); - } else { - resolve(value); - } - }; - } - }, Array.prototype.slice.call(args)); - - if (!async) { - if (isPromise(answer)) { - answer.then(resolve, reject); - } else { - resolve(answer); - } - } - }); - - promise.then(cb.bind(null, null), cb); - - return promise; - } -}; - -runAsync.cb = function (func, cb) { - return runAsync(function () { - var args = Array.prototype.slice.call(arguments); - if (args.length === func.length - 1) { - args.push(this.async()); - } - return func.apply(this, args); - }, cb); -}; - - -/***/ }), -/* 172 */ +/* 84 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_Observable__ = __webpack_require__(17); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_Observable__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_observable_ConnectableObservable__ = __webpack_require__(393); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return __WEBPACK_IMPORTED_MODULE_1__internal_observable_ConnectableObservable__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_operators_groupBy__ = __webpack_require__(403); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_operators_groupBy__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internal_symbol_observable__ = __webpack_require__(111); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return __WEBPACK_IMPORTED_MODULE_3__internal_symbol_observable__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_Subject__ = __webpack_require__(43); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_Subject__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__internal_BehaviorSubject__ = __webpack_require__(389); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return __WEBPACK_IMPORTED_MODULE_5__internal_BehaviorSubject__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_ReplaySubject__ = __webpack_require__(248); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return __WEBPACK_IMPORTED_MODULE_6__internal_ReplaySubject__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__internal_AsyncSubject__ = __webpack_require__(173); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return __WEBPACK_IMPORTED_MODULE_7__internal_AsyncSubject__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__internal_scheduler_asap__ = __webpack_require__(408); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "asapScheduler", function() { return __WEBPACK_IMPORTED_MODULE_8__internal_scheduler_asap__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__internal_scheduler_async__ = __webpack_require__(47); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "asyncScheduler", function() { return __WEBPACK_IMPORTED_MODULE_9__internal_scheduler_async__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__internal_scheduler_queue__ = __webpack_require__(409); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "queueScheduler", function() { return __WEBPACK_IMPORTED_MODULE_10__internal_scheduler_queue__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__internal_scheduler_animationFrame__ = __webpack_require__(999); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "animationFrameScheduler", function() { return __WEBPACK_IMPORTED_MODULE_11__internal_scheduler_animationFrame__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__internal_scheduler_VirtualTimeScheduler__ = __webpack_require__(998); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return __WEBPACK_IMPORTED_MODULE_12__internal_scheduler_VirtualTimeScheduler__["a"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return __WEBPACK_IMPORTED_MODULE_12__internal_scheduler_VirtualTimeScheduler__["b"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__internal_Scheduler__ = __webpack_require__(391); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return __WEBPACK_IMPORTED_MODULE_13__internal_Scheduler__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__internal_Subscription__ = __webpack_require__(31); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return __WEBPACK_IMPORTED_MODULE_14__internal_Subscription__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__internal_Subscriber__ = __webpack_require__(5); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return __WEBPACK_IMPORTED_MODULE_15__internal_Subscriber__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__internal_Notification__ = __webpack_require__(174); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return __WEBPACK_IMPORTED_MODULE_16__internal_Notification__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__internal_util_pipe__ = __webpack_require__(264); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return __WEBPACK_IMPORTED_MODULE_17__internal_util_pipe__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__internal_util_noop__ = __webpack_require__(181); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_18__internal_util_noop__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__internal_util_identity__ = __webpack_require__(112); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_19__internal_util_identity__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__internal_util_isObservable__ = __webpack_require__(1003); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return __WEBPACK_IMPORTED_MODULE_20__internal_util_isObservable__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__internal_util_ArgumentOutOfRangeError__ = __webpack_require__(140); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return __WEBPACK_IMPORTED_MODULE_21__internal_util_ArgumentOutOfRangeError__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__internal_util_EmptyError__ = __webpack_require__(141); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return __WEBPACK_IMPORTED_MODULE_22__internal_util_EmptyError__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__internal_util_ObjectUnsubscribedError__ = __webpack_require__(179); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return __WEBPACK_IMPORTED_MODULE_23__internal_util_ObjectUnsubscribedError__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__internal_util_UnsubscriptionError__ = __webpack_require__(411); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return __WEBPACK_IMPORTED_MODULE_24__internal_util_UnsubscriptionError__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__internal_util_TimeoutError__ = __webpack_require__(410); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return __WEBPACK_IMPORTED_MODULE_25__internal_util_TimeoutError__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__internal_observable_bindCallback__ = __webpack_require__(896); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return __WEBPACK_IMPORTED_MODULE_26__internal_observable_bindCallback__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__internal_observable_bindNodeCallback__ = __webpack_require__(897); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return __WEBPACK_IMPORTED_MODULE_27__internal_observable_bindNodeCallback__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__internal_observable_combineLatest__ = __webpack_require__(249); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return __WEBPACK_IMPORTED_MODULE_28__internal_observable_combineLatest__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__internal_observable_concat__ = __webpack_require__(176); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return __WEBPACK_IMPORTED_MODULE_29__internal_observable_concat__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__internal_observable_defer__ = __webpack_require__(250); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_30__internal_observable_defer__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__internal_observable_empty__ = __webpack_require__(46); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return __WEBPACK_IMPORTED_MODULE_31__internal_observable_empty__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__internal_observable_forkJoin__ = __webpack_require__(898); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return __WEBPACK_IMPORTED_MODULE_32__internal_observable_forkJoin__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__internal_observable_from__ = __webpack_require__(64); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "from", function() { return __WEBPACK_IMPORTED_MODULE_33__internal_observable_from__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__internal_observable_fromEvent__ = __webpack_require__(899); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return __WEBPACK_IMPORTED_MODULE_34__internal_observable_fromEvent__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__internal_observable_fromEventPattern__ = __webpack_require__(900); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return __WEBPACK_IMPORTED_MODULE_35__internal_observable_fromEventPattern__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__internal_observable_generate__ = __webpack_require__(904); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return __WEBPACK_IMPORTED_MODULE_36__internal_observable_generate__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__internal_observable_iif__ = __webpack_require__(905); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return __WEBPACK_IMPORTED_MODULE_37__internal_observable_iif__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__internal_observable_interval__ = __webpack_require__(906); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return __WEBPACK_IMPORTED_MODULE_38__internal_observable_interval__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__internal_observable_merge__ = __webpack_require__(394); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return __WEBPACK_IMPORTED_MODULE_39__internal_observable_merge__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__internal_observable_never__ = __webpack_require__(395); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "never", function() { return __WEBPACK_IMPORTED_MODULE_40__internal_observable_never__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__internal_observable_of__ = __webpack_require__(251); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "of", function() { return __WEBPACK_IMPORTED_MODULE_41__internal_observable_of__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__internal_observable_onErrorResumeNext__ = __webpack_require__(907); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return __WEBPACK_IMPORTED_MODULE_42__internal_observable_onErrorResumeNext__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__internal_observable_pairs__ = __webpack_require__(908); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_43__internal_observable_pairs__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__internal_observable_race__ = __webpack_require__(396); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return __WEBPACK_IMPORTED_MODULE_44__internal_observable_race__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__internal_observable_range__ = __webpack_require__(909); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_45__internal_observable_range__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__internal_observable_throwError__ = __webpack_require__(253); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return __WEBPACK_IMPORTED_MODULE_46__internal_observable_throwError__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__internal_observable_timer__ = __webpack_require__(397); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return __WEBPACK_IMPORTED_MODULE_47__internal_observable_timer__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__internal_observable_using__ = __webpack_require__(910); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "using", function() { return __WEBPACK_IMPORTED_MODULE_48__internal_observable_using__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__internal_observable_zip__ = __webpack_require__(254); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_49__internal_observable_zip__["a"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return __WEBPACK_IMPORTED_MODULE_31__internal_observable_empty__["b"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return __WEBPACK_IMPORTED_MODULE_40__internal_observable_never__["b"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__internal_config__ = __webpack_require__(175); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return __WEBPACK_IMPORTED_MODULE_50__internal_config__["a"]; }); -/** PURE_IMPORTS_START PURE_IMPORTS_END */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return InnerSubscriber; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//# sourceMappingURL=index.js.map - - -/***/ }), -/* 173 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncSubject; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(31); -/** PURE_IMPORTS_START tslib,_Subject,_Subscription PURE_IMPORTS_END */ - - - -var AsyncSubject = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsyncSubject, _super); - function AsyncSubject() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.value = null; - _this.hasNext = false; - _this.hasCompleted = false; +var InnerSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](InnerSubscriber, _super); + function InnerSubscriber(parent, outerValue, outerIndex) { + var _this = _super.call(this) || this; + _this.parent = parent; + _this.outerValue = outerValue; + _this.outerIndex = outerIndex; + _this.index = 0; return _this; } - AsyncSubject.prototype._subscribe = function (subscriber) { - if (this.hasError) { - subscriber.error(this.thrownError); - return __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */].EMPTY; - } - else if (this.hasCompleted && this.hasNext) { - subscriber.next(this.value); - subscriber.complete(); - return __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */].EMPTY; - } - return _super.prototype._subscribe.call(this, subscriber); + InnerSubscriber.prototype._next = function (value) { + this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this); }; - AsyncSubject.prototype.next = function (value) { - if (!this.hasCompleted) { - this.value = value; - this.hasNext = true; - } + InnerSubscriber.prototype._error = function (error) { + this.parent.notifyError(error, this); + this.unsubscribe(); }; - AsyncSubject.prototype.error = function (error) { - if (!this.hasCompleted) { - _super.prototype.error.call(this, error); - } + InnerSubscriber.prototype._complete = function () { + this.parent.notifyComplete(this); + this.unsubscribe(); }; - AsyncSubject.prototype.complete = function () { - this.hasCompleted = true; - if (this.hasNext) { - _super.prototype.next.call(this, this.value); - } - _super.prototype.complete.call(this); - }; - return AsyncSubject; -}(__WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */])); + return InnerSubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); -//# sourceMappingURL=AsyncSubject.js.map +//# sourceMappingURL=InnerSubscriber.js.map /***/ }), -/* 174 */ +/* 85 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Notification; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_empty__ = __webpack_require__(46); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_of__ = __webpack_require__(251); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_throwError__ = __webpack_require__(253); -/** PURE_IMPORTS_START _observable_empty,_observable_of,_observable_throwError PURE_IMPORTS_END */ +/* harmony export (immutable) */ __webpack_exports__["a"] = fromArray; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToArray__ = __webpack_require__(446); +/** PURE_IMPORTS_START _Observable,_Subscription,_util_subscribeToArray PURE_IMPORTS_END */ -var Notification = /*@__PURE__*/ (function () { - function Notification(kind, value, error) { - this.kind = kind; - this.value = value; - this.error = error; - this.hasValue = kind === 'N'; +function fromArray(input, scheduler) { + if (!scheduler) { + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToArray__["a" /* subscribeToArray */])(input)); } - Notification.prototype.observe = function (observer) { - switch (this.kind) { - case 'N': - return observer.next && observer.next(this.value); - case 'E': - return observer.error && observer.error(this.error); - case 'C': - return observer.complete && observer.complete(); - } - }; - Notification.prototype.do = function (next, error, complete) { - var kind = this.kind; - switch (kind) { - case 'N': - return next && next(this.value); - case 'E': - return error && error(this.error); - case 'C': - return complete && complete(); - } - }; - Notification.prototype.accept = function (nextOrObserver, error, complete) { - if (nextOrObserver && typeof nextOrObserver.next === 'function') { - return this.observe(nextOrObserver); - } - else { - return this.do(nextOrObserver, error, complete); - } - }; - Notification.prototype.toObservable = function () { - var kind = this.kind; - switch (kind) { - case 'N': - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__observable_of__["a" /* of */])(this.value); - case 'E': - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_throwError__["a" /* throwError */])(this.error); - case 'C': - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__observable_empty__["a" /* empty */])(); - } - throw new Error('unexpected notification kind value'); - }; - Notification.createNext = function (value) { - if (typeof value !== 'undefined') { - return new Notification('N', value); - } - return Notification.undefinedValueNotification; - }; - Notification.createError = function (err) { - return new Notification('E', undefined, err); - }; - Notification.createComplete = function () { - return Notification.completeNotification; - }; - Notification.completeNotification = new Notification('C'); - Notification.undefinedValueNotification = new Notification('N', undefined); - return Notification; -}()); - -//# sourceMappingURL=Notification.js.map - - -/***/ }), -/* 175 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return config; }); -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -var _enable_super_gross_mode_that_will_cause_bad_things = false; -var config = { - Promise: undefined, - set useDeprecatedSynchronousErrorHandling(value) { - if (value) { - var error = /*@__PURE__*/ new Error(); - /*@__PURE__*/ console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack); - } - else if (_enable_super_gross_mode_that_will_cause_bad_things) { - /*@__PURE__*/ console.log('RxJS: Back to a better error behavior. Thank you. <3'); - } - _enable_super_gross_mode_that_will_cause_bad_things = value; - }, - get useDeprecatedSynchronousErrorHandling() { - return _enable_super_gross_mode_that_will_cause_bad_things; - }, -}; -//# sourceMappingURL=config.js.map - - -/***/ }), -/* 176 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = concat; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isScheduler__ = __webpack_require__(56); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__of__ = __webpack_require__(251); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__from__ = __webpack_require__(64); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__operators_concatAll__ = __webpack_require__(399); -/** PURE_IMPORTS_START _util_isScheduler,_of,_from,_operators_concatAll PURE_IMPORTS_END */ - - - - -function concat() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i] = arguments[_i]; + else { + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { + var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */](); + var i = 0; + sub.add(scheduler.schedule(function () { + if (i === input.length) { + subscriber.complete(); + return; + } + subscriber.next(input[i++]); + if (!subscriber.closed) { + sub.add(this.schedule()); + } + })); + return sub; + }); } - if (observables.length === 1 || (observables.length === 2 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isScheduler__["a" /* isScheduler */])(observables[1]))) { - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__from__["a" /* from */])(observables[0]); - } - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__operators_concatAll__["a" /* concatAll */])()(__WEBPACK_IMPORTED_MODULE_1__of__["a" /* of */].apply(void 0, observables)); } -//# sourceMappingURL=concat.js.map +//# sourceMappingURL=fromArray.js.map /***/ }), -/* 177 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = reduce; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scan__ = __webpack_require__(257); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__takeLast__ = __webpack_require__(260); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__defaultIfEmpty__ = __webpack_require__(134); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_pipe__ = __webpack_require__(264); -/** PURE_IMPORTS_START _scan,_takeLast,_defaultIfEmpty,_util_pipe PURE_IMPORTS_END */ - - - - -function reduce(accumulator, seed) { - if (arguments.length >= 2) { - return function reduceOperatorFunctionWithSeed(source) { - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["a" /* pipe */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__scan__["a" /* scan */])(accumulator, seed), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__takeLast__["a" /* takeLast */])(1), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__defaultIfEmpty__["a" /* defaultIfEmpty */])(seed))(source); - }; - } - return function reduceOperatorFunction(source) { - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["a" /* pipe */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__scan__["a" /* scan */])(function (acc, value, index) { return accumulator(acc, value, index + 1); }), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__takeLast__["a" /* takeLast */])(1))(source); - }; -} -//# sourceMappingURL=reduce.js.map - - -/***/ }), -/* 178 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return throwIfEmpty; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tap__ = __webpack_require__(405); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_EmptyError__ = __webpack_require__(141); -/** PURE_IMPORTS_START _tap,_util_EmptyError PURE_IMPORTS_END */ - - -var throwIfEmpty = function (errorFactory) { - if (errorFactory === void 0) { - errorFactory = defaultErrorFactory; - } - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__tap__["a" /* tap */])({ - hasValue: false, - next: function () { this.hasValue = true; }, - complete: function () { - if (!this.hasValue) { - throw errorFactory(); - } - } - }); -}; -function defaultErrorFactory() { - return new __WEBPACK_IMPORTED_MODULE_1__util_EmptyError__["a" /* EmptyError */](); -} -//# sourceMappingURL=throwIfEmpty.js.map - - -/***/ }), -/* 179 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ObjectUnsubscribedError; }); -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function ObjectUnsubscribedErrorImpl() { - Error.call(this); - this.message = 'object unsubscribed'; - this.name = 'ObjectUnsubscribedError'; - return this; -} -ObjectUnsubscribedErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype); -var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl; -//# sourceMappingURL=ObjectUnsubscribedError.js.map - - -/***/ }), -/* 180 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = isNumeric; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArray__ = __webpack_require__(48); -/** PURE_IMPORTS_START _isArray PURE_IMPORTS_END */ - -function isNumeric(val) { - return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isArray__["a" /* isArray */])(val) && (val - parseFloat(val) + 1) >= 0; -} -//# sourceMappingURL=isNumeric.js.map - - -/***/ }), -/* 181 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = noop; -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function noop() { } -//# sourceMappingURL=noop.js.map - - -/***/ }), -/* 182 */ +/* 86 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = { read: read, - readSSHPrivate: readSSHPrivate, write: write }; -var assert = __webpack_require__(22); -var asn1 = __webpack_require__(66); -var Buffer = __webpack_require__(20).Buffer; -var algs = __webpack_require__(38); -var utils = __webpack_require__(32); -var crypto = __webpack_require__(21); +var assert = __webpack_require__(16); +var asn1 = __webpack_require__(65); +var crypto = __webpack_require__(12); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var utils = __webpack_require__(26); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(33); -var Key = __webpack_require__(34); -var PrivateKey = __webpack_require__(39); -var pem = __webpack_require__(82); -var rfc4253 = __webpack_require__(92); -var SSHBuffer = __webpack_require__(147); -var errors = __webpack_require__(69); +var pkcs1 = __webpack_require__(327); +var pkcs8 = __webpack_require__(157); +var sshpriv = __webpack_require__(192); +var rfc4253 = __webpack_require__(103); -var bcrypt; +var errors = __webpack_require__(73); -function read(buf, options) { - return (pem.read(buf, options)); -} - -var MAGIC = 'openssh-key-v1'; - -function readSSHPrivate(type, buf, options) { - buf = new SSHBuffer({buffer: buf}); - - var magic = buf.readCString(); - assert.strictEqual(magic, MAGIC, 'bad magic string'); - - var cipher = buf.readString(); - var kdf = buf.readString(); - var kdfOpts = buf.readBuffer(); - - var nkeys = buf.readInt(); - if (nkeys !== 1) { - throw (new Error('OpenSSH-format key file contains ' + - 'multiple keys: this is unsupported.')); +/* + * For reading we support both PKCS#1 and PKCS#8. If we find a private key, + * we just take the public component of it and use that. + */ +function read(buf, options, forceType) { + var input = buf; + if (typeof (buf) !== 'string') { + assert.buffer(buf, 'buf'); + buf = buf.toString('ascii'); } - var pubKey = buf.readBuffer(); + var lines = buf.trim().split('\n'); - if (type === 'public') { - assert.ok(buf.atEnd(), 'excess bytes left after key'); - return (rfc4253.read(pubKey)); + var m = lines[0].match(/*JSSTYLED*/ + /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); + assert.ok(m, 'invalid PEM header'); + + var m2 = lines[lines.length - 1].match(/*JSSTYLED*/ + /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); + assert.ok(m2, 'invalid PEM footer'); + + /* Begin and end banners must match key type */ + assert.equal(m[2], m2[2]); + var type = m[2].toLowerCase(); + + var alg; + if (m[1]) { + /* They also must match algorithms, if given */ + assert.equal(m[1], m2[1], 'PEM header and footer mismatch'); + alg = m[1].trim(); } - var privKeyBlob = buf.readBuffer(); - assert.ok(buf.atEnd(), 'excess bytes left after key'); + var headers = {}; + while (true) { + lines = lines.slice(1); + m = lines[0].match(/*JSSTYLED*/ + /^([A-Za-z0-9-]+): (.+)$/); + if (!m) + break; + headers[m[1].toLowerCase()] = m[2]; + } - var kdfOptsBuf = new SSHBuffer({ buffer: kdfOpts }); - switch (kdf) { - case 'none': - if (cipher !== 'none') { - throw (new Error('OpenSSH-format key uses KDF "none" ' + - 'but specifies a cipher other than "none"')); - } - break; - case 'bcrypt': - var salt = kdfOptsBuf.readBuffer(); - var rounds = kdfOptsBuf.readInt(); - var cinf = utils.opensshCipherInfo(cipher); - if (bcrypt === undefined) { - bcrypt = __webpack_require__(323); + var cipher, key, iv; + if (headers['proc-type']) { + var parts = headers['proc-type'].split(','); + if (parts[0] === '4' && parts[1] === 'ENCRYPTED') { + if (typeof (options.passphrase) === 'string') { + options.passphrase = Buffer.from( + options.passphrase, 'utf-8'); + } + if (!Buffer.isBuffer(options.passphrase)) { + throw (new errors.KeyEncryptedError( + options.filename, 'PEM')); + } else { + parts = headers['dek-info'].split(','); + assert.ok(parts.length === 2); + cipher = parts[0].toLowerCase(); + iv = Buffer.from(parts[1], 'hex'); + key = utils.opensslKeyDeriv(cipher, iv, + options.passphrase, 1).key; + } } + } - if (typeof (options.passphrase) === 'string') { - options.passphrase = Buffer.from(options.passphrase, - 'utf-8'); - } - if (!Buffer.isBuffer(options.passphrase)) { - throw (new errors.KeyEncryptedError( - options.filename, 'OpenSSH')); - } + /* Chop off the first and last lines */ + lines = lines.slice(0, -1).join(''); + buf = Buffer.from(lines, 'base64'); - var pass = new Uint8Array(options.passphrase); - var salti = new Uint8Array(salt); - /* Use the pbkdf to derive both the key and the IV. */ - var out = new Uint8Array(cinf.keySize + cinf.blockSize); - var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length, - out, out.length, rounds); - if (res !== 0) { - throw (new Error('bcrypt_pbkdf function returned ' + - 'failure, parameters invalid')); - } - out = Buffer.from(out); - var ckey = out.slice(0, cinf.keySize); - var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize); - var cipherStream = crypto.createDecipheriv(cinf.opensslName, - ckey, iv); - cipherStream.setAutoPadding(false); + if (cipher && key && iv) { + var cipherStream = crypto.createDecipheriv(cipher, key, iv); var chunk, chunks = []; cipherStream.once('error', function (e) { if (e.toString().indexOf('bad decrypt') !== -1) { @@ -45378,153 +32443,87 @@ function readSSHPrivate(type, buf, options) { } throw (e); }); - cipherStream.write(privKeyBlob); + cipherStream.write(buf); cipherStream.end(); while ((chunk = cipherStream.read()) !== null) chunks.push(chunk); - privKeyBlob = Buffer.concat(chunks); - break; - default: - throw (new Error( - 'OpenSSH-format key uses unknown KDF "' + kdf + '"')); + buf = Buffer.concat(chunks); } - buf = new SSHBuffer({buffer: privKeyBlob}); + /* The new OpenSSH internal format abuses PEM headers */ + if (alg && alg.toLowerCase() === 'openssh') + return (sshpriv.readSSHPrivate(type, buf, options)); + if (alg && alg.toLowerCase() === 'ssh2') + return (rfc4253.readType(type, buf, options)); - var checkInt1 = buf.readInt(); - var checkInt2 = buf.readInt(); - if (checkInt1 !== checkInt2) { - throw (new Error('Incorrect passphrase supplied, could not ' + - 'decrypt key')); + var der = new asn1.BerReader(buf); + der.originalInput = input; + + /* + * All of the PEM file types start with a sequence tag, so chop it + * off here + */ + der.readSequence(); + + /* PKCS#1 type keys name an algorithm in the banner explicitly */ + if (alg) { + if (forceType) + assert.strictEqual(forceType, 'pkcs1'); + return (pkcs1.readPkcs1(alg, type, der)); + } else { + if (forceType) + assert.strictEqual(forceType, 'pkcs8'); + return (pkcs8.readPkcs8(alg, type, der)); } - - var ret = {}; - var key = rfc4253.readInternal(ret, 'private', buf.remainder()); - - buf.skip(ret.consumed); - - var comment = buf.readString(); - key.comment = comment; - - return (key); } -function write(key, options) { - var pubKey; - if (PrivateKey.isPrivateKey(key)) - pubKey = key.toPublic(); - else - pubKey = key; - - var cipher = 'none'; - var kdf = 'none'; - var kdfopts = Buffer.alloc(0); - var cinf = { blockSize: 8 }; - var passphrase; - if (options !== undefined) { - passphrase = options.passphrase; - if (typeof (passphrase) === 'string') - passphrase = Buffer.from(passphrase, 'utf-8'); - if (passphrase !== undefined) { - assert.buffer(passphrase, 'options.passphrase'); - assert.optionalString(options.cipher, 'options.cipher'); - cipher = options.cipher; - if (cipher === undefined) - cipher = 'aes128-ctr'; - cinf = utils.opensshCipherInfo(cipher); - kdf = 'bcrypt'; - } - } - - var privBuf; - if (PrivateKey.isPrivateKey(key)) { - privBuf = new SSHBuffer({}); - var checkInt = crypto.randomBytes(4).readUInt32BE(0); - privBuf.writeInt(checkInt); - privBuf.writeInt(checkInt); - privBuf.write(key.toBuffer('rfc4253')); - privBuf.writeString(key.comment || ''); - - var n = 1; - while (privBuf._offset % cinf.blockSize !== 0) - privBuf.writeChar(n++); - privBuf = privBuf.toBuffer(); - } - - switch (kdf) { - case 'none': - break; - case 'bcrypt': - var salt = crypto.randomBytes(16); - var rounds = 16; - var kdfssh = new SSHBuffer({}); - kdfssh.writeBuffer(salt); - kdfssh.writeInt(rounds); - kdfopts = kdfssh.toBuffer(); - - if (bcrypt === undefined) { - bcrypt = __webpack_require__(323); - } - var pass = new Uint8Array(passphrase); - var salti = new Uint8Array(salt); - /* Use the pbkdf to derive both the key and the IV. */ - var out = new Uint8Array(cinf.keySize + cinf.blockSize); - var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length, - out, out.length, rounds); - if (res !== 0) { - throw (new Error('bcrypt_pbkdf function returned ' + - 'failure, parameters invalid')); - } - out = Buffer.from(out); - var ckey = out.slice(0, cinf.keySize); - var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize); - - var cipherStream = crypto.createCipheriv(cinf.opensslName, - ckey, iv); - cipherStream.setAutoPadding(false); - var chunk, chunks = []; - cipherStream.once('error', function (e) { - throw (e); - }); - cipherStream.write(privBuf); - cipherStream.end(); - while ((chunk = cipherStream.read()) !== null) - chunks.push(chunk); - privBuf = Buffer.concat(chunks); - break; - default: - throw (new Error('Unsupported kdf ' + kdf)); - } - - var buf = new SSHBuffer({}); - - buf.writeCString(MAGIC); - buf.writeString(cipher); /* cipher */ - buf.writeString(kdf); /* kdf */ - buf.writeBuffer(kdfopts); /* kdfoptions */ - - buf.writeInt(1); /* nkeys */ - buf.writeBuffer(pubKey.toBuffer('rfc4253')); - - if (privBuf) - buf.writeBuffer(privBuf); - - buf = buf.toBuffer(); +function write(key, options, type) { + assert.object(key); + var alg = { + 'ecdsa': 'EC', + 'rsa': 'RSA', + 'dsa': 'DSA', + 'ed25519': 'EdDSA' + }[key.type]; var header; - if (PrivateKey.isPrivateKey(key)) - header = 'OPENSSH PRIVATE KEY'; - else - header = 'OPENSSH PUBLIC KEY'; - var tmp = buf.toString('base64'); - var len = tmp.length + (tmp.length / 70) + + var der = new asn1.BerWriter(); + + if (PrivateKey.isPrivateKey(key)) { + if (type && type === 'pkcs8') { + header = 'PRIVATE KEY'; + pkcs8.writePkcs8(der, key); + } else { + if (type) + assert.strictEqual(type, 'pkcs1'); + header = alg + ' PRIVATE KEY'; + pkcs1.writePkcs1(der, key); + } + + } else if (Key.isKey(key)) { + if (type && type === 'pkcs1') { + header = alg + ' PUBLIC KEY'; + pkcs1.writePkcs1(der, key); + } else { + if (type) + assert.strictEqual(type, 'pkcs8'); + header = 'PUBLIC KEY'; + pkcs8.writePkcs8(der, key); + } + + } else { + throw (new Error('key is not a Key or PrivateKey')); + } + + var tmp = der.buffer.toString('base64'); + var len = tmp.length + (tmp.length / 64) + 18 + 16 + header.length*2 + 10; - buf = Buffer.alloc(len); + var buf = Buffer.alloc(len); var o = 0; o += buf.write('-----BEGIN ' + header + '-----\n', o); for (var i = 0; i < tmp.length; ) { - var limit = i + 70; + var limit = i + 64; if (limit > tmp.length) limit = tmp.length; o += buf.write(tmp.slice(i, limit), o); @@ -45538,382 +32537,13 @@ function write(key, options) { /***/ }), -/* 183 */ -/***/ (function(module, exports, __webpack_require__) { - -var chownr = __webpack_require__(598) -var tar = __webpack_require__(431) -var pump = __webpack_require__(853) -var mkdirp = __webpack_require__(241) -var fs = __webpack_require__(12) -var path = __webpack_require__(1) -var os = __webpack_require__(72) - -var win32 = os.platform() === 'win32' - -var noop = function () {} - -var echo = function (name) { - return name -} - -var normalize = !win32 ? echo : function (name) { - return name.replace(/\\/g, '/').replace(/[:?<>|]/g, '_') -} - -var statAll = function (fs, stat, cwd, ignore, entries, sort) { - var queue = entries || ['.'] - - return function loop (callback) { - if (!queue.length) return callback() - var next = queue.shift() - var nextAbs = path.join(cwd, next) - - stat(nextAbs, function (err, stat) { - if (err) return callback(err) - - if (!stat.isDirectory()) return callback(null, next, stat) - - fs.readdir(nextAbs, function (err, files) { - if (err) return callback(err) - - if (sort) files.sort() - for (var i = 0; i < files.length; i++) { - if (!ignore(path.join(cwd, next, files[i]))) queue.push(path.join(next, files[i])) - } - - callback(null, next, stat) - }) - }) - } -} - -var strip = function (map, level) { - return function (header) { - header.name = header.name.split('/').slice(level).join('/') - - var linkname = header.linkname - if (linkname && (header.type === 'link' || path.isAbsolute(linkname))) { - header.linkname = linkname.split('/').slice(level).join('/') - } - - return map(header) - } -} - -exports.pack = function (cwd, opts) { - if (!cwd) cwd = '.' - if (!opts) opts = {} - - var xfs = opts.fs || fs - var ignore = opts.ignore || opts.filter || noop - var map = opts.map || noop - var mapStream = opts.mapStream || echo - var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd, ignore, opts.entries, opts.sort) - var strict = opts.strict !== false - var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask() - var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0 - var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0 - var pack = opts.pack || tar.pack() - var finish = opts.finish || noop - - if (opts.strip) map = strip(map, opts.strip) - - if (opts.readable) { - dmode |= parseInt(555, 8) - fmode |= parseInt(444, 8) - } - if (opts.writable) { - dmode |= parseInt(333, 8) - fmode |= parseInt(222, 8) - } - - var onsymlink = function (filename, header) { - xfs.readlink(path.join(cwd, filename), function (err, linkname) { - if (err) return pack.destroy(err) - header.linkname = normalize(linkname) - pack.entry(header, onnextentry) - }) - } - - var onstat = function (err, filename, stat) { - if (err) return pack.destroy(err) - if (!filename) { - if (opts.finalize !== false) pack.finalize() - return finish(pack) - } - - if (stat.isSocket()) return onnextentry() // tar does not support sockets... - - var header = { - name: normalize(filename), - mode: (stat.mode | (stat.isDirectory() ? dmode : fmode)) & umask, - mtime: stat.mtime, - size: stat.size, - type: 'file', - uid: stat.uid, - gid: stat.gid - } - - if (stat.isDirectory()) { - header.size = 0 - header.type = 'directory' - header = map(header) || header - return pack.entry(header, onnextentry) - } - - if (stat.isSymbolicLink()) { - header.size = 0 - header.type = 'symlink' - header = map(header) || header - return onsymlink(filename, header) - } - - // TODO: add fifo etc... - - header = map(header) || header - - if (!stat.isFile()) { - if (strict) return pack.destroy(new Error('unsupported type for ' + filename)) - return onnextentry() - } - - var entry = pack.entry(header, onnextentry) - if (!entry) return - - var rs = mapStream(xfs.createReadStream(path.join(cwd, filename)), header) - - rs.on('error', function (err) { // always forward errors on destroy - entry.destroy(err) - }) - - pump(rs, entry) - } - - var onnextentry = function (err) { - if (err) return pack.destroy(err) - statNext(onstat) - } - - onnextentry() - - return pack -} - -var head = function (list) { - return list.length ? list[list.length - 1] : null -} - -var processGetuid = function () { - return process.getuid ? process.getuid() : -1 -} - -var processUmask = function () { - return process.umask ? process.umask() : 0 -} - -exports.extract = function (cwd, opts) { - if (!cwd) cwd = '.' - if (!opts) opts = {} - - var xfs = opts.fs || fs - var ignore = opts.ignore || opts.filter || noop - var map = opts.map || noop - var mapStream = opts.mapStream || echo - var own = opts.chown !== false && !win32 && processGetuid() === 0 - var extract = opts.extract || tar.extract() - var stack = [] - var now = new Date() - var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask() - var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0 - var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0 - var strict = opts.strict !== false - - if (opts.strip) map = strip(map, opts.strip) - - if (opts.readable) { - dmode |= parseInt(555, 8) - fmode |= parseInt(444, 8) - } - if (opts.writable) { - dmode |= parseInt(333, 8) - fmode |= parseInt(222, 8) - } - - var utimesParent = function (name, cb) { // we just set the mtime on the parent dir again everytime we write an entry - var top - while ((top = head(stack)) && name.slice(0, top[0].length) !== top[0]) stack.pop() - if (!top) return cb() - xfs.utimes(top[0], now, top[1], cb) - } - - var utimes = function (name, header, cb) { - if (opts.utimes === false) return cb() - - if (header.type === 'directory') return xfs.utimes(name, now, header.mtime, cb) - if (header.type === 'symlink') return utimesParent(name, cb) // TODO: how to set mtime on link? - - xfs.utimes(name, now, header.mtime, function (err) { - if (err) return cb(err) - utimesParent(name, cb) - }) - } - - var chperm = function (name, header, cb) { - var link = header.type === 'symlink' - var chmod = link ? xfs.lchmod : xfs.chmod - var chown = link ? xfs.lchown : xfs.chown - - if (!chmod) return cb() - - var mode = (header.mode | (header.type === 'directory' ? dmode : fmode)) & umask - chmod(name, mode, function (err) { - if (err) return cb(err) - if (!own) return cb() - if (!chown) return cb() - chown(name, header.uid, header.gid, cb) - }) - } - - extract.on('entry', function (header, stream, next) { - header = map(header) || header - header.name = normalize(header.name) - var name = path.join(cwd, path.join('/', header.name)) - - if (ignore(name, header)) { - stream.resume() - return next() - } - - var stat = function (err) { - if (err) return next(err) - utimes(name, header, function (err) { - if (err) return next(err) - if (win32) return next() - chperm(name, header, next) - }) - } - - var onsymlink = function () { - if (win32) return next() // skip symlinks on win for now before it can be tested - xfs.unlink(name, function () { - xfs.symlink(header.linkname, name, stat) - }) - } - - var onlink = function () { - if (win32) return next() // skip links on win for now before it can be tested - xfs.unlink(name, function () { - var srcpath = path.join(cwd, path.join('/', header.linkname)) - - xfs.link(srcpath, name, function (err) { - if (err && err.code === 'EPERM' && opts.hardlinkAsFilesFallback) { - stream = xfs.createReadStream(srcpath) - return onfile() - } - - stat(err) - }) - }) - } - - var onfile = function () { - var ws = xfs.createWriteStream(name) - var rs = mapStream(stream, header) - - ws.on('error', function (err) { // always forward errors on destroy - rs.destroy(err) - }) - - pump(rs, ws, function (err) { - if (err) return next(err) - ws.on('close', stat) - }) - } - - if (header.type === 'directory') { - stack.push([name, header.mtime]) - return mkdirfix(name, { - fs: xfs, own: own, uid: header.uid, gid: header.gid - }, stat) - } - - var dir = path.dirname(name) - - validate(xfs, dir, path.join(cwd, '.'), function (err, valid) { - if (err) return next(err) - if (!valid) return next(new Error(dir + ' is not a valid path')) - - mkdirfix(dir, { - fs: xfs, own: own, uid: header.uid, gid: header.gid - }, function (err) { - if (err) return next(err) - - switch (header.type) { - case 'file': return onfile() - case 'link': return onlink() - case 'symlink': return onsymlink() - } - - if (strict) return next(new Error('unsupported type for ' + name + ' (' + header.type + ')')) - - stream.resume() - next() - }) - }) - }) - - if (opts.finish) extract.on('finish', opts.finish) - - return extract -} - -function validate (fs, name, root, cb) { - if (name === root) return cb(null, true) - fs.lstat(name, function (err, st) { - if (err && err.code !== 'ENOENT') return cb(err) - if (err || st.isDirectory()) return validate(fs, path.join(name, '..'), root, cb) - cb(null, false) - }) -} - -function mkdirfix (name, opts, cb) { - mkdirp(name, {fs: opts.fs}, function (err, made) { - if (!err && made && opts.own) { - chownr(made, opts.uid, opts.gid, cb) - } else { - cb(err) - } - }) -} - - -/***/ }), -/* 184 */ +/* 87 */ /***/ (function(module, exports) { -module.exports = require("https"); +module.exports = require("http"); /***/ }), -/* 185 */ -/***/ (function(module, exports) { - -module.exports = require("querystring"); - -/***/ }), -/* 186 */ -/***/ (function(module, exports) { - -module.exports = require("readline"); - -/***/ }), -/* 187 */ -/***/ (function(module, exports) { - -module.exports = require("zlib"); - -/***/ }), -/* 188 */ +/* 88 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45922,1228 +32552,12 @@ module.exports = require("zlib"); Object.defineProperty(exports, "__esModule", { value: true }); - -var _consoleReporter; - -function _load_consoleReporter() { - return _consoleReporter = __webpack_require__(549); -} - -Object.defineProperty(exports, 'ConsoleReporter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_consoleReporter || _load_consoleReporter()).default; - } -}); - -var _bufferReporter; - -function _load_bufferReporter() { - return _bufferReporter = __webpack_require__(548); -} - -Object.defineProperty(exports, 'BufferReporter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_bufferReporter || _load_bufferReporter()).default; - } -}); - -var _eventReporter; - -function _load_eventReporter() { - return _eventReporter = __webpack_require__(553); -} - -Object.defineProperty(exports, 'EventReporter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_eventReporter || _load_eventReporter()).default; - } -}); - -var _jsonReporter; - -function _load_jsonReporter() { - return _jsonReporter = __webpack_require__(202); -} - -Object.defineProperty(exports, 'JSONReporter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_jsonReporter || _load_jsonReporter()).default; - } -}); - -var _noopReporter; - -function _load_noopReporter() { - return _noopReporter = __webpack_require__(557); -} - -Object.defineProperty(exports, 'NoopReporter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_noopReporter || _load_noopReporter()).default; - } -}); - -var _baseReporter; - -function _load_baseReporter() { - return _baseReporter = __webpack_require__(98); -} - -Object.defineProperty(exports, 'Reporter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_baseReporter || _load_baseReporter()).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), -/* 189 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// On windows, create a .cmd file. -// Read the #! in the file to see what it uses. The vast majority -// of the time, this will be either: -// "#!/usr/bin/env " -// or: -// "#! " -// -// Write a binroot/pkg.bin + ".cmd" file that has this line in it: -// @ %~dp0 %* - -module.exports = cmdShim -cmdShim.ifExists = cmdShimIfExists - -const fs = __webpack_require__(834) - -const mkdir = __webpack_require__(832) -const path = __webpack_require__(1) -const isWindows = __webpack_require__(793) -const shebangExpr = /^#!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/ -const DEFAULT_OPTIONS = { - // Create PowerShell file by default if the option hasn't been specified - createPwshFile: true, - createCmdFile: isWindows() -} - -function cmdShimIfExists (src, to, opts) { - opts = Object.assign({}, DEFAULT_OPTIONS, opts) - return fs.stat(src) - .then(() => cmdShim(src, to, opts)) - .catch(() => {}) -} - -// Try to unlink, but ignore errors. -// Any problems will surface later. -function rm (path) { - return fs.unlink(path).catch(() => {}) -} - -function cmdShim (src, to, opts) { - opts = Object.assign({}, DEFAULT_OPTIONS, opts) - return fs.stat(src) - .then(() => cmdShim_(src, to, opts)) -} - -function cmdShim_ (src, to, opts) { - return Promise.all([ - rm(to), - rm(`${to}.ps1`), - opts.createCmdFile && rm(`${to}.cmd`) - ]) - .then(() => writeShim(src, to, opts)) -} - -function writeShim (src, to, opts) { - opts = Object.assign({}, DEFAULT_OPTIONS, opts) - const defaultArgs = opts.preserveSymlinks ? '--preserve-symlinks' : '' - // make a cmd file and a sh script - // First, check if the bin is a #! of some sort. - // If not, then assume it's something that'll be compiled, or some other - // sort of script, and just call it directly. - return mkdir(path.dirname(to)) - .then(() => { - return fs.readFile(src, 'utf8') - .then(data => { - const firstLine = data.trim().split(/\r*\n/)[0] - const shebang = firstLine.match(shebangExpr) - if (!shebang) return writeShim_(src, to, Object.assign({}, opts, {args: defaultArgs})) - const prog = shebang[1] - const args = (shebang[2] && ((defaultArgs && (shebang[2] + ' ' + defaultArgs)) || shebang[2])) || defaultArgs - return writeShim_(src, to, Object.assign({}, opts, {prog, args})) - }) - .catch(() => writeShim_(src, to, Object.assign({}, opts, {args: defaultArgs}))) - }) -} - -function writeShim_ (src, to, opts) { - opts = Object.assign({}, DEFAULT_OPTIONS, opts) - let shTarget = path.relative(path.dirname(to), src) - let target = shTarget.split('/').join('\\') - let longProg - let prog = opts.prog - let shProg = prog && prog.split('\\').join('/') - let shLongProg - let pwshProg = shProg && `"${shProg}$exe"` - let pwshLongProg - shTarget = shTarget.split('\\').join('/') - let args = opts.args || '' - let { - win32: nodePath, - posix: shNodePath - } = normalizePathEnvVar(opts.nodePath) - if (!prog) { - prog = `"%~dp0\\${target}"` - shProg = `"$basedir/${shTarget}"` - pwshProg = shProg - args = '' - target = '' - shTarget = '' - } else { - longProg = `"%~dp0\\${prog}.exe"` - shLongProg = '"$basedir/' + prog + '"' - pwshLongProg = `"$basedir/${prog}$exe"` - target = `"%~dp0\\${target}"` - shTarget = `"$basedir/${shTarget}"` - } - - let cmd - if (opts.createCmdFile) { - // @IF EXIST "%~dp0\node.exe" ( - // "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* - // ) ELSE ( - // SETLOCAL - // SET PATHEXT=%PATHEXT:;.JS;=;% - // node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* - // ) - cmd = nodePath ? `@SET NODE_PATH=${nodePath}\r\n` : '' - if (longProg) { - cmd += '@IF EXIST ' + longProg + ' (\r\n' + - ' ' + longProg + ' ' + args + ' ' + target + ' %*\r\n' + - ') ELSE (\r\n' + - ' @SETLOCAL\r\n' + - ' @SET PATHEXT=%PATHEXT:;.JS;=;%\r\n' + - ' ' + prog + ' ' + args + ' ' + target + ' %*\r\n' + - ')' - } else { - cmd += `@${prog} ${args} ${target} %*\r\n` - } - } - - // #!/bin/sh - // basedir=`dirname "$0"` - // - // case `uname` in - // *CYGWIN*) basedir=`cygpath -w "$basedir"`;; - // esac - // - // if [ -x "$basedir/node.exe" ]; then - // "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@" - // ret=$? - // else - // node "$basedir/node_modules/npm/bin/npm-cli.js" "$@" - // ret=$? - // fi - // exit $ret - - let sh = '#!/bin/sh\n' - sh = sh + - "basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n" + - '\n' + - 'case `uname` in\n' + - ' *CYGWIN*) basedir=`cygpath -w "$basedir"`;;\n' + - 'esac\n' + - '\n' - const env = opts.nodePath ? `NODE_PATH="${shNodePath}" ` : '' - - if (shLongProg) { - sh = sh + - 'if [ -x ' + shLongProg + ' ]; then\n' + - ' ' + env + shLongProg + ' ' + args + ' ' + shTarget + ' "$@"\n' + - ' ret=$?\n' + - 'else \n' + - ' ' + env + shProg + ' ' + args + ' ' + shTarget + ' "$@"\n' + - ' ret=$?\n' + - 'fi\n' + - 'exit $ret\n' - } else { - sh = sh + env + shProg + ' ' + args + ' ' + shTarget + ' "$@"\n' + - 'exit $?\n' - } - - // #!/usr/bin/env pwsh - // $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - // - // $ret=0 - // $exe = "" - // if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - // # Fix case when both the Windows and Linux builds of Node - // # are installed in the same directory - // $exe = ".exe" - // } - // if (Test-Path "$basedir/node") { - // & "$basedir/node$exe" "$basedir/node_modules/npm/bin/npm-cli.js" $args - // $ret=$LASTEXITCODE - // } else { - // & "node$exe" "$basedir/node_modules/npm/bin/npm-cli.js" $args - // $ret=$LASTEXITCODE - // } - // exit $ret - let pwsh = '#!/usr/bin/env pwsh\n' + - '$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n' + - '\n' + - '$exe=""\n' + - (opts.nodePath ? '$env_node_path=$env:NODE_PATH\n' + - `$env:NODE_PATH="${nodePath}"\n` : '') + - 'if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {\n' + - ' # Fix case when both the Windows and Linux builds of Node\n' + - ' # are installed in the same directory\n' + - ' $exe=".exe"\n' + - '}' - if (opts.nodePath) { - pwsh = pwsh + - ' else {\n' + - ` $env:NODE_PATH="${shNodePath}"\n` + - '}' - } - pwsh += '\n' - if (shLongProg) { - pwsh = pwsh + - '$ret=0\n' + - `if (Test-Path ${pwshLongProg}) {\n` + - ` & ${pwshLongProg} ${args} ${shTarget} $args\n` + - ' $ret=$LASTEXITCODE\n' + - '} else {\n' + - ` & ${pwshProg} ${args} ${shTarget} $args\n` + - ' $ret=$LASTEXITCODE\n' + - '}\n' + - (opts.nodePath ? '$env:NODE_PATH=$env_node_path\n' : '') + - 'exit $ret\n' - } else { - pwsh = pwsh + - `& ${pwshProg} ${args} ${shTarget} $args\n` + - (opts.nodePath ? '$env:NODE_PATH=$env_node_path\n' : '') + - 'exit $LASTEXITCODE\n' - } - - return Promise.all([ - opts.createCmdFile && fs.writeFile(to + '.cmd', cmd, 'utf8'), - opts.createPwshFile && fs.writeFile(`${to}.ps1`, pwsh, 'utf8'), - fs.writeFile(to, sh, 'utf8') - ]) - .then(() => chmodShim(to, opts)) -} - -function chmodShim (to, {createCmdFile, createPwshFile}) { - return Promise.all([ - fs.chmod(to, 0o755), - createPwshFile && fs.chmod(`${to}.ps1`, 0o755), - createCmdFile && fs.chmod(`${to}.cmd`, 0o755) - ]) -} - -/** - * @param {string|string[]} nodePath - * @returns {{win32:string,posix:string}} - */ -function normalizePathEnvVar (nodePath) { - if (!nodePath) { - return { - win32: nodePath, - posix: nodePath - } - } - let split = (typeof nodePath === 'string' ? nodePath.split(path.delimiter) : Array.from(nodePath)) - let result = {} - for (let i = 0; i < split.length; i++) { - const win32 = split[i].split('/').join('\\') - const posix = isWindows() ? split[i].split('\\').join('/').replace(/^([^:\\/]*):/, (_, $1) => `/mnt/${$1.toLowerCase()}`) : split[i] - - result.win32 = result.win32 ? `${result.win32};${win32}` : win32 - result.posix = result.posix ? `${result.posix}:${posix}` : posix - - result[i] = {win32, posix} - } - return result -} - - -/***/ }), -/* 190 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var resolve = __webpack_require__(191); - -module.exports = { - Validation: errorSubclass(ValidationError), - MissingRef: errorSubclass(MissingRefError) -}; - - -function ValidationError(errors) { - this.message = 'validation failed'; - this.errors = errors; - this.ajv = this.validation = true; -} - - -MissingRefError.message = function (baseId, ref) { - return 'can\'t resolve reference ' + ref + ' from id ' + baseId; -}; - - -function MissingRefError(baseId, ref, message) { - this.message = message || MissingRefError.message(baseId, ref); - this.missingRef = resolve.url(baseId, ref); - this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef)); -} - - -function errorSubclass(Subclass) { - Subclass.prototype = Object.create(Error.prototype); - Subclass.prototype.constructor = Subclass; - return Subclass; -} - - -/***/ }), -/* 191 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var url = __webpack_require__(29) - , equal = __webpack_require__(192) - , util = __webpack_require__(96) - , SchemaObject = __webpack_require__(278) - , traverse = __webpack_require__(476); - -module.exports = resolve; - -resolve.normalizeId = normalizeId; -resolve.fullPath = getFullPath; -resolve.url = resolveUrl; -resolve.ids = resolveIds; -resolve.inlineRef = inlineRef; -resolve.schema = resolveSchema; - -/** - * [resolve and compile the references ($ref)] - * @this Ajv - * @param {Function} compile reference to schema compilation funciton (localCompile) - * @param {Object} root object with information about the root schema for the current schema - * @param {String} ref reference to resolve - * @return {Object|Function} schema object (if the schema can be inlined) or validation function - */ -function resolve(compile, root, ref) { - /* jshint validthis: true */ - var refVal = this._refs[ref]; - if (typeof refVal == 'string') { - if (this._refs[refVal]) refVal = this._refs[refVal]; - else return resolve.call(this, compile, root, refVal); - } - - refVal = refVal || this._schemas[ref]; - if (refVal instanceof SchemaObject) { - return inlineRef(refVal.schema, this._opts.inlineRefs) - ? refVal.schema - : refVal.validate || this._compile(refVal); - } - - var res = resolveSchema.call(this, root, ref); - var schema, v, baseId; - if (res) { - schema = res.schema; - root = res.root; - baseId = res.baseId; - } - - if (schema instanceof SchemaObject) { - v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId); - } else if (schema !== undefined) { - v = inlineRef(schema, this._opts.inlineRefs) - ? schema - : compile.call(this, schema, root, undefined, baseId); - } - - return v; -} - - -/** - * Resolve schema, its root and baseId - * @this Ajv - * @param {Object} root root object with properties schema, refVal, refs - * @param {String} ref reference to resolve - * @return {Object} object with properties schema, root, baseId - */ -function resolveSchema(root, ref) { - /* jshint validthis: true */ - var p = url.parse(ref, false, true) - , refPath = _getFullPath(p) - , baseId = getFullPath(this._getId(root.schema)); - if (refPath !== baseId) { - var id = normalizeId(refPath); - var refVal = this._refs[id]; - if (typeof refVal == 'string') { - return resolveRecursive.call(this, root, refVal, p); - } else if (refVal instanceof SchemaObject) { - if (!refVal.validate) this._compile(refVal); - root = refVal; - } else { - refVal = this._schemas[id]; - if (refVal instanceof SchemaObject) { - if (!refVal.validate) this._compile(refVal); - if (id == normalizeId(ref)) - return { schema: refVal, root: root, baseId: baseId }; - root = refVal; - } else { - return; - } - } - if (!root.schema) return; - baseId = getFullPath(this._getId(root.schema)); - } - return getJsonPointer.call(this, p, baseId, root.schema, root); -} - - -/* @this Ajv */ -function resolveRecursive(root, ref, parsedRef) { - /* jshint validthis: true */ - var res = resolveSchema.call(this, root, ref); - if (res) { - var schema = res.schema; - var baseId = res.baseId; - root = res.root; - var id = this._getId(schema); - if (id) baseId = resolveUrl(baseId, id); - return getJsonPointer.call(this, parsedRef, baseId, schema, root); - } -} - - -var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']); -/* @this Ajv */ -function getJsonPointer(parsedRef, baseId, schema, root) { - /* jshint validthis: true */ - parsedRef.hash = parsedRef.hash || ''; - if (parsedRef.hash.slice(0,2) != '#/') return; - var parts = parsedRef.hash.split('/'); - - for (var i = 1; i < parts.length; i++) { - var part = parts[i]; - if (part) { - part = util.unescapeFragment(part); - schema = schema[part]; - if (schema === undefined) break; - var id; - if (!PREVENT_SCOPE_CHANGE[part]) { - id = this._getId(schema); - if (id) baseId = resolveUrl(baseId, id); - if (schema.$ref) { - var $ref = resolveUrl(baseId, schema.$ref); - var res = resolveSchema.call(this, root, $ref); - if (res) { - schema = res.schema; - root = res.root; - baseId = res.baseId; - } - } - } - } - } - if (schema !== undefined && schema !== root.schema) - return { schema: schema, root: root, baseId: baseId }; -} - - -var SIMPLE_INLINED = util.toHash([ - 'type', 'format', 'pattern', - 'maxLength', 'minLength', - 'maxProperties', 'minProperties', - 'maxItems', 'minItems', - 'maximum', 'minimum', - 'uniqueItems', 'multipleOf', - 'required', 'enum' -]); -function inlineRef(schema, limit) { - if (limit === false) return false; - if (limit === undefined || limit === true) return checkNoRef(schema); - else if (limit) return countKeys(schema) <= limit; -} - - -function checkNoRef(schema) { - var item; - if (Array.isArray(schema)) { - for (var i=0; i All rights reserved. - - -module.exports = { - - newInvalidAsn1Error: function (msg) { - var e = new Error(); - e.name = 'InvalidAsn1Error'; - e.message = msg || ''; - return e; - } - -}; - - -/***/ }), -/* 194 */ -/***/ (function(module, exports) { - -// Copyright 2011 Mark Cavage All rights reserved. - - -module.exports = { - EOC: 0, - Boolean: 1, - Integer: 2, - BitString: 3, - OctetString: 4, - Null: 5, - OID: 6, - ObjectDescriptor: 7, - External: 8, - Real: 9, // float - Enumeration: 10, - PDV: 11, - Utf8String: 12, - RelativeOID: 13, - Sequence: 16, - Set: 17, - NumericString: 18, - PrintableString: 19, - T61String: 20, - VideotexString: 21, - IA5String: 22, - UTCTime: 23, - GeneralizedTime: 24, - GraphicString: 25, - VisibleString: 26, - GeneralString: 28, - UniversalString: 29, - CharacterString: 30, - BMPString: 31, - Constructor: 32, - Context: 128 -}; - - -/***/ }), -/* 195 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * Inquirer.js - * A collection of common interactive command line user interfaces. - */ - -var inquirer = module.exports; - -/** - * Client interfaces - */ - -inquirer.prompts = {}; - -inquirer.Separator = __webpack_require__(152); - -inquirer.ui = { - BottomBar: __webpack_require__(507), - Prompt: __webpack_require__(508) -}; - -/** - * Create a new self-contained prompt module. - */ -inquirer.createPromptModule = function (opt) { - var promptModule = function promptModule(questions) { - var ui = new inquirer.ui.Prompt(promptModule.prompts, opt); - var promise = ui.run(questions); - - // Monkey patch the UI on the promise object so - // that it remains publicly accessible. - promise.ui = ui; - - return promise; - }; - promptModule.prompts = {}; - - /** - * Register a prompt type - * @param {String} name Prompt type name - * @param {Function} prompt Prompt constructor - * @return {inquirer} - */ - - promptModule.registerPrompt = function (name, prompt) { - promptModule.prompts[name] = prompt; - return this; - }; - - /** - * Register the defaults provider prompts - */ - - promptModule.restoreDefaultPrompts = function () { - this.registerPrompt('list', __webpack_require__(503)); - this.registerPrompt('input', __webpack_require__(291)); - this.registerPrompt('number', __webpack_require__(504)); - this.registerPrompt('confirm', __webpack_require__(500)); - this.registerPrompt('rawlist', __webpack_require__(506)); - this.registerPrompt('expand', __webpack_require__(502)); - this.registerPrompt('checkbox', __webpack_require__(499)); - this.registerPrompt('password', __webpack_require__(505)); - this.registerPrompt('editor', __webpack_require__(501)); - }; - - promptModule.restoreDefaultPrompts(); - - return promptModule; -}; - -/** - * Public CLI helper interface - * @param {Array|Object|Rx.Observable} questions - Questions settings array - * @param {Function} cb - Callback being passed the user answers - * @return {inquirer.ui.Prompt} - */ - -inquirer.prompt = inquirer.createPromptModule(); - -// Expose helper functions on the top level for easiest usage by common users -inquirer.registerPrompt = function (name, prompt) { - inquirer.prompt.registerPrompt(name, prompt); -}; -inquirer.restoreDefaultPrompts = function () { - inquirer.prompt.restoreDefaultPrompts(); -}; - -/***/ }), -/* 196 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getOutdated = exports.run = exports.requireLockfile = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var addArgs = []; - var upgradeAll = args.length === 0 && typeof flags.scope === 'undefined' && typeof flags.pattern === 'undefined'; - var addFlags = (0, (_assign || _load_assign()).default)({}, flags, { - force: true, - ignoreWorkspaceRootCheck: true, - workspaceRootIsCwd: config.cwd === config.lockfileFolder - }); - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); - var deps = yield getOutdated(config, reporter, flags, lockfile, args); - var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); - - var _ref2 = yield install.fetchRequestFromCwd(), - packagePatterns = _ref2.requests; - - setUserRequestedPackageVersions(deps, args, flags.latest, packagePatterns, reporter); - cleanLockfile(lockfile, deps, packagePatterns, reporter); - addArgs = deps.map(function (dep) { - return dep.upgradeTo; - }); - - if (flags.scope && validScopeRegex.test(flags.scope)) { - addArgs = addArgs.filter(function (depName) { - return depName.startsWith(flags.scope); - }); - } - - var add = new (_add || _load_add()).Add(addArgs, addFlags, config, reporter, upgradeAll ? new (_lockfile || _load_lockfile()).default() : lockfile); - yield add.init(); - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -var getOutdated = exports.getOutdated = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile, patterns) { - var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); - var outdatedFieldName = flags.latest ? 'latest' : 'wanted'; - - // ensure scope is of the form `@scope/` - var normalizeScope = function normalizeScope() { - if (flags.scope) { - if (!flags.scope.startsWith('@')) { - flags.scope = '@' + flags.scope; - } - - if (!flags.scope.endsWith('/')) { - flags.scope += '/'; - } - } - }; - - var versionFilter = function versionFilter(dep) { - return dep.current !== dep[outdatedFieldName]; - }; - - if (!flags.latest) { - // these flags only have an affect when --latest is used - flags.tilde = false; - flags.exact = false; - flags.caret = false; - } - - normalizeScope(); - - var deps = (yield (_packageRequest || _load_packageRequest()).default.getOutdatedPackages(lockfile, install, config, reporter, patterns, flags)).filter(versionFilter).filter(scopeFilter.bind(this, flags)); - deps.forEach(function (dep) { - dep.upgradeTo = buildPatternToUpgradeTo(dep, flags); - reporter.verbose(reporter.lang('verboseUpgradeBecauseOutdated', dep.name, dep.upgradeTo)); - }); - - return deps; - }); - - return function getOutdated(_x5, _x6, _x7, _x8, _x9) { - return _ref3.apply(this, arguments); - }; -}(); - -exports.cleanLockfile = cleanLockfile; -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _add; - -function _load_add() { - return _add = __webpack_require__(154); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -var _packageRequest; - -function _load_packageRequest() { - return _packageRequest = _interopRequireDefault(__webpack_require__(116)); -} - -var _normalizePattern; - -function _load_normalizePattern() { - return _normalizePattern = __webpack_require__(52); -} - -var _install; - -function _load_install() { - return _install = __webpack_require__(41); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// used to detect whether a semver range is simple enough to preserve when doing a --latest upgrade. -// when not matched, the upgraded version range will default to `^` the same as the `add` command would. -var basicSemverOperatorRegex = new RegExp('^(\\^|~|>=|<=)?[^ |&,]+$'); - -// used to detect if a passed parameter is a scope or a package name. - - -var validScopeRegex = /^@[a-zA-Z0-9-][a-zA-Z0-9_.-]*\/$/; - -// If specific versions were requested for packages, override what getOutdated reported as the latest to install -// Also add ones that are missing, since the requested packages may not have been outdated at all. -function setUserRequestedPackageVersions(deps, args, latest, packagePatterns, reporter) { - args.forEach(function (requestedPattern) { - var found = false; - var normalized = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(requestedPattern); - - // if the user specified a package name without a version range, then that implies "latest" - // but if the latest flag is not passed then we need to use the version range from package.json - if (!normalized.hasVersion && !latest) { - packagePatterns.forEach(function (packagePattern) { - var packageNormalized = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(packagePattern.pattern); - if (packageNormalized.name === normalized.name) { - normalized = packageNormalized; - } - }); - } - - var newPattern = `${normalized.name}@${normalized.range}`; - - // if this dependency is already in the outdated list, - // just update the upgradeTo to whatever version the user requested. - deps.forEach(function (dep) { - if (normalized.hasVersion && dep.name === normalized.name) { - found = true; - dep.upgradeTo = newPattern; - reporter.verbose(reporter.lang('verboseUpgradeBecauseRequested', requestedPattern, newPattern)); - } - }); - - // if this dependency was not in the outdated list, - // then add a new entry - if (normalized.hasVersion && !found) { - deps.push({ - name: normalized.name, - wanted: '', - latest: '', - url: '', - hint: '', - range: '', - current: '', - upgradeTo: newPattern, - workspaceName: '', - workspaceLoc: '' - }); - reporter.verbose(reporter.lang('verboseUpgradeBecauseRequested', requestedPattern, newPattern)); - } - }); -} - -// this function attempts to determine the range operator on the semver range. -// this will only handle the simple cases of a semver starting with '^', '~', '>=', '<=', or an exact version. -// "exotic" semver ranges will not be handled. -function getRangeOperator(version) { - var result = basicSemverOperatorRegex.exec(version); - return result ? result[1] || '' : '^'; -} - -// Attempt to preserve the range operator from the package.json specified semver range. -// If an explicit operator was specified using --exact, --tilde, --caret, then that will take precedence. -function buildPatternToUpgradeTo(dep, flags) { - if (dep.latest === 'exotic') { - return `${dep.name}@${dep.url}`; - } - - var toLatest = flags.latest; - var toVersion = toLatest ? dep.latest : dep.range; - var rangeOperator = ''; - - if (toLatest) { - if (flags.caret) { - rangeOperator = '^'; - } else if (flags.tilde) { - rangeOperator = '~'; - } else if (flags.exact) { - rangeOperator = ''; - } else { - rangeOperator = getRangeOperator(dep.range); - } - } - - return `${dep.name}@${rangeOperator}${toVersion}`; -} - -function scopeFilter(flags, dep) { - if (validScopeRegex.test(flags.scope)) { - return dep.name.startsWith(flags.scope); - } - return true; -} - -// Remove deps being upgraded from the lockfile, or else Add will use the already-installed version -// instead of the latest for the range. -// We do this recursively so that when Yarn installs the potentially updated transitive deps, -// it may upgrade them too instead of just using the "locked" version from the lockfile. -// Transitive dependencies that are also a direct dependency are skipped. -function cleanLockfile(lockfile, deps, packagePatterns, reporter) { - function cleanDepFromLockfile(pattern, depth) { - var lockManifest = lockfile.getLocked(pattern); - if (!lockManifest || depth > 1 && packagePatterns.some(function (packagePattern) { - return packagePattern.pattern === pattern; - })) { - reporter.verbose(reporter.lang('verboseUpgradeNotUnlocking', pattern)); - return; - } - - var dependencies = (0, (_assign || _load_assign()).default)({}, lockManifest.dependencies || {}, lockManifest.optionalDependencies || {}); - var depPatterns = (0, (_keys || _load_keys()).default)(dependencies).map(function (key) { - return `${key}@${dependencies[key]}`; - }); - reporter.verbose(reporter.lang('verboseUpgradeUnlocking', pattern)); - lockfile.removePattern(pattern); - depPatterns.forEach(function (pattern) { - return cleanDepFromLockfile(pattern, depth + 1); - }); - } - - var patterns = deps.map(function (dep) { - return dep.upgradeTo; - }); - patterns.forEach(function (pattern) { - return cleanDepFromLockfile(pattern, 1); - }); -} - -function setFlags(commander) { - commander.description('Upgrades packages to their latest version based on the specified range.'); - commander.usage('upgrade [flags]'); - commander.option('-S, --scope ', 'upgrade packages under the specified scope'); - commander.option('-L, --latest', 'list the latest version of packages, ignoring version ranges in package.json'); - commander.option('-E, --exact', 'install exact version. Only used when --latest is specified.'); - commander.option('-P, --pattern [pattern]', 'upgrade packages that match pattern'); - commander.option('-T, --tilde', 'install most recent release with the same minor version. Only used when --latest is specified.'); - commander.option('-C, --caret', 'install most recent release with the same major version. Only used when --latest is specified.'); - commander.option('-A, --audit', 'Run vulnerability audit on installed packages'); -} - -function hasWrapper(commander, args) { - return true; -} - -var requireLockfile = exports.requireLockfile = true; - -/***/ }), -/* 197 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.integrityErrors = undefined; - -var _stringify; - -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(40)); -} +exports.SCOPE_SEPARATOR = undefined; var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); + return _extends2 = _interopRequireDefault(__webpack_require__(22)); } var _asyncToGenerator2; @@ -47152,4531 +32566,566 @@ function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); + return _constants = __webpack_require__(8); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); + return _fs = _interopRequireWildcard(__webpack_require__(6)); +} + +var _npmResolver; + +function _load_npmResolver() { + return _npmResolver = _interopRequireDefault(__webpack_require__(217)); +} + +var _envReplace; + +function _load_envReplace() { + return _envReplace = _interopRequireDefault(__webpack_require__(576)); +} + +var _baseRegistry; + +function _load_baseRegistry() { + return _baseRegistry = _interopRequireDefault(__webpack_require__(557)); } var _misc; function _load_misc() { - return _misc = __webpack_require__(28); -} - -var _packageNameUtils; - -function _load_packageNameUtils() { - return _packageNameUtils = __webpack_require__(210); -} - -var _workspaceLayout; - -function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(87)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var invariant = __webpack_require__(15); - -var path = __webpack_require__(1); - -var integrityErrors = exports.integrityErrors = { - EXPECTED_IS_NOT_A_JSON: 'integrityFailedExpectedIsNotAJSON', - FILES_MISSING: 'integrityFailedFilesMissing', - LOCKFILE_DONT_MATCH: 'integrityLockfilesDontMatch', - FLAGS_DONT_MATCH: 'integrityFlagsDontMatch', - LINKED_MODULES_DONT_MATCH: 'integrityCheckLinkedModulesDontMatch', - PATTERNS_DONT_MATCH: 'integrityPatternsDontMatch', - MODULES_FOLDERS_MISSING: 'integrityModulesFoldersMissing', - SYSTEM_PARAMS_DONT_MATCH: 'integritySystemParamsDontMatch' -}; - -var INTEGRITY_FILE_DEFAULTS = function INTEGRITY_FILE_DEFAULTS() { - return { - systemParams: (0, (_packageNameUtils || _load_packageNameUtils()).getSystemParams)(), - modulesFolders: [], - flags: [], - linkedModules: [], - topLevelPatterns: [], - lockfileEntries: {}, - files: [] - }; -}; - -/** - * - */ - -var InstallationIntegrityChecker = function () { - function InstallationIntegrityChecker(config) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, InstallationIntegrityChecker); - - this.config = config; - } - - /** - * Get the common ancestor of every node_modules - it may be a node_modules directory itself, but isn't required to. - */ - - InstallationIntegrityChecker.prototype._getModulesRootFolder = function _getModulesRootFolder() { - if (this.config.modulesFolder) { - return this.config.modulesFolder; - } else if (this.config.workspaceRootFolder) { - return this.config.workspaceRootFolder; - } else { - return path.join(this.config.lockfileFolder, (_constants || _load_constants()).NODE_MODULES_FOLDER); - } - }; - - /** - * Get the directory in which the yarn-integrity file should be written. - */ - - InstallationIntegrityChecker.prototype._getIntegrityFileFolder = function _getIntegrityFileFolder() { - if (this.config.modulesFolder) { - return this.config.modulesFolder; - } else if (this.config.enableMetaFolder) { - return path.join(this.config.lockfileFolder, (_constants || _load_constants()).META_FOLDER); - } else { - return path.join(this.config.lockfileFolder, (_constants || _load_constants()).NODE_MODULES_FOLDER); - } - }; - - /** - * Get the full path of the yarn-integrity file. - */ - - InstallationIntegrityChecker.prototype._getIntegrityFileLocation = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var locationFolder = this._getIntegrityFileFolder(); - var locationPath = path.join(locationFolder, (_constants || _load_constants()).INTEGRITY_FILENAME); - - var exists = yield (_fs || _load_fs()).exists(locationPath); - - return { - locationFolder, - locationPath, - exists - }; - }); - - function _getIntegrityFileLocation() { - return _ref.apply(this, arguments); - } - - return _getIntegrityFileLocation; - }(); - - /** - * Get the list of the directories that contain our modules (there might be multiple such folders b/c of workspaces). - */ - - InstallationIntegrityChecker.prototype._getModulesFolders = function _getModulesFolders() { - var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - workspaceLayout = _ref2.workspaceLayout; - - var locations = []; - - if (this.config.modulesFolder) { - locations.push(this.config.modulesFolder); - } else { - locations.push(path.join(this.config.lockfileFolder, (_constants || _load_constants()).NODE_MODULES_FOLDER)); - } - - if (workspaceLayout) { - for (var _iterator = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref3; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref3 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref3 = _i.value; - } - - var workspaceName = _ref3; - - var loc = workspaceLayout.workspaces[workspaceName].loc; - - if (loc) { - locations.push(path.join(loc, (_constants || _load_constants()).NODE_MODULES_FOLDER)); - } - } - } - - return locations.sort((_misc || _load_misc()).sortAlpha); - }; - - /** - * Get a list of the files that are located inside our module folders. - */ - - - InstallationIntegrityChecker.prototype._getIntegrityListing = function () { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - workspaceLayout = _ref5.workspaceLayout; - - var files = []; - - var recurse = function () { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { - for (var _iterator2 = yield (_fs || _load_fs()).readdir(dir), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref7; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref7 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref7 = _i2.value; - } - - var file = _ref7; - - var entry = path.join(dir, file); - var stat = yield (_fs || _load_fs()).lstat(entry); - - if (stat.isDirectory()) { - yield recurse(entry); - } else { - files.push(entry); - } - } - }); - - return function recurse(_x3) { - return _ref6.apply(this, arguments); - }; - }(); - - for (var _iterator3 = this._getModulesFolders({ workspaceLayout }), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref8; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref8 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref8 = _i3.value; - } - - var modulesFolder = _ref8; - - if (yield (_fs || _load_fs()).exists(modulesFolder)) { - yield recurse(modulesFolder); - } - } - - return files; - }); - - function _getIntegrityListing() { - return _ref4.apply(this, arguments); - } - - return _getIntegrityListing; - }(); - - /** - * Generate integrity hash of input lockfile. - */ - - InstallationIntegrityChecker.prototype._generateIntegrityFile = function () { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (lockfile, patterns, flags, workspaceLayout, artifacts) { - var result = (0, (_extends2 || _load_extends()).default)({}, INTEGRITY_FILE_DEFAULTS(), { - artifacts - }); - - result.topLevelPatterns = patterns; - - // If using workspaces, we also need to add the workspaces patterns to the top-level, so that we'll know if a - // dependency is added or removed into one of them. We must take care not to read the aggregator (if !loc). - // - // Also note that we can't use of workspaceLayout.workspaces[].manifest._reference.patterns, because when - // doing a "yarn check", the _reference property hasn't yet been properly initialized. - - if (workspaceLayout) { - result.topLevelPatterns = result.topLevelPatterns.filter(function (p) { - // $FlowFixMe - return !workspaceLayout.getManifestByPattern(p); - }); - - for (var _iterator4 = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref10; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref10 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref10 = _i4.value; - } - - var name = _ref10; - - if (!workspaceLayout.workspaces[name].loc) { - continue; - } - - var manifest = workspaceLayout.workspaces[name].manifest; - - if (manifest) { - for (var _iterator5 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { - var _ref11; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref11 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref11 = _i5.value; - } - - var dependencyType = _ref11; - - var dependencies = manifest[dependencyType]; - - if (!dependencies) { - continue; - } - - for (var _iterator6 = (0, (_keys || _load_keys()).default)(dependencies), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { - var _ref12; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref12 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref12 = _i6.value; - } - - var dep = _ref12; - - result.topLevelPatterns.push(`${dep}@${dependencies[dep]}`); - } - } - } - } - } - - result.topLevelPatterns.sort((_misc || _load_misc()).sortAlpha); - - if (flags.checkFiles) { - result.flags.push('checkFiles'); - } - - if (flags.flat) { - result.flags.push('flat'); - } - - if (this.config.ignoreScripts) { - result.flags.push('ignoreScripts'); - } - if (this.config.focus) { - result.flags.push('focus: ' + this.config.focusedWorkspaceName); - } - - if (this.config.production) { - result.flags.push('production'); - } - - if (this.config.plugnplayEnabled) { - result.flags.push('plugnplay'); - } - - var linkedModules = this.config.linkedModules; - - if (linkedModules.length) { - result.linkedModules = linkedModules.sort((_misc || _load_misc()).sortAlpha); - } - - for (var _iterator7 = (0, (_keys || _load_keys()).default)(lockfile), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { - var _ref13; - - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref13 = _iterator7[_i7++]; - } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref13 = _i7.value; - } - - var _key = _ref13; - - result.lockfileEntries[_key] = lockfile[_key].resolved || ''; - } - - for (var _iterator8 = this._getModulesFolders({ workspaceLayout }), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) { - var _ref14; - - if (_isArray8) { - if (_i8 >= _iterator8.length) break; - _ref14 = _iterator8[_i8++]; - } else { - _i8 = _iterator8.next(); - if (_i8.done) break; - _ref14 = _i8.value; - } - - var modulesFolder = _ref14; - - if (yield (_fs || _load_fs()).exists(modulesFolder)) { - result.modulesFolders.push(path.relative(this.config.lockfileFolder, modulesFolder)); - } - } - - if (flags.checkFiles) { - var modulesRoot = this._getModulesRootFolder(); - - result.files = (yield this._getIntegrityListing({ workspaceLayout })).map(function (entry) { - return path.relative(modulesRoot, entry); - }).sort((_misc || _load_misc()).sortAlpha); - } - - return result; - }); - - function _generateIntegrityFile(_x4, _x5, _x6, _x7, _x8) { - return _ref9.apply(this, arguments); - } - - return _generateIntegrityFile; - }(); - - InstallationIntegrityChecker.prototype._getIntegrityFile = function () { - var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (locationPath) { - var expectedRaw = yield (_fs || _load_fs()).readFile(locationPath); - try { - return (0, (_extends2 || _load_extends()).default)({}, INTEGRITY_FILE_DEFAULTS(), JSON.parse(expectedRaw)); - } catch (e) { - // ignore JSON parsing for legacy text integrity files compatibility - } - return null; - }); - - function _getIntegrityFile(_x9) { - return _ref15.apply(this, arguments); - } - - return _getIntegrityFile; - }(); - - InstallationIntegrityChecker.prototype._compareIntegrityFiles = function _compareIntegrityFiles(actual, expected, checkFiles, workspaceLayout) { - if (!expected) { - return 'EXPECTED_IS_NOT_A_JSON'; - } - - if (!(0, (_misc || _load_misc()).compareSortedArrays)(actual.linkedModules, expected.linkedModules)) { - return 'LINKED_MODULES_DONT_MATCH'; - } - - if (actual.systemParams !== expected.systemParams) { - return 'SYSTEM_PARAMS_DONT_MATCH'; - } - - var relevantExpectedFlags = expected.flags.slice(); - - // If we run "yarn" after "yarn --check-files", we shouldn't fail the less strict validation - if (actual.flags.indexOf('checkFiles') === -1) { - relevantExpectedFlags = relevantExpectedFlags.filter(function (flag) { - return flag !== 'checkFiles'; - }); - } - - if (!(0, (_misc || _load_misc()).compareSortedArrays)(actual.flags, relevantExpectedFlags)) { - return 'FLAGS_DONT_MATCH'; - } - - if (!(0, (_misc || _load_misc()).compareSortedArrays)(actual.topLevelPatterns, expected.topLevelPatterns || [])) { - return 'PATTERNS_DONT_MATCH'; - } - - for (var _iterator9 = (0, (_keys || _load_keys()).default)(actual.lockfileEntries), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) { - var _ref16; - - if (_isArray9) { - if (_i9 >= _iterator9.length) break; - _ref16 = _iterator9[_i9++]; - } else { - _i9 = _iterator9.next(); - if (_i9.done) break; - _ref16 = _i9.value; - } - - var _key2 = _ref16; - - if (actual.lockfileEntries[_key2] !== expected.lockfileEntries[_key2]) { - return 'LOCKFILE_DONT_MATCH'; - } - } - - for (var _iterator10 = (0, (_keys || _load_keys()).default)(expected.lockfileEntries), _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) { - var _ref17; - - if (_isArray10) { - if (_i10 >= _iterator10.length) break; - _ref17 = _iterator10[_i10++]; - } else { - _i10 = _iterator10.next(); - if (_i10.done) break; - _ref17 = _i10.value; - } - - var _key3 = _ref17; - - if (actual.lockfileEntries[_key3] !== expected.lockfileEntries[_key3]) { - return 'LOCKFILE_DONT_MATCH'; - } - } - - if (checkFiles) { - // Early bailout if we expect more files than what we have - if (expected.files.length > actual.files.length) { - return 'FILES_MISSING'; - } - - // Since we know the "files" array is sorted (alphabetically), we can optimize the thing - // Instead of storing the files in a Set, we can just iterate both arrays at once. O(n)! - for (var u = 0, v = 0; u < expected.files.length; ++u) { - // Index that, if reached, means that we won't have enough food to match the remaining expected entries anyway - var max = v + (actual.files.length - v) - (expected.files.length - u) + 1; - - // Skip over files that have been added (ie not present in 'expected') - while (v < max && actual.files[v] !== expected.files[u]) { - v += 1; - } - - // If we've reached the index defined above, the file is either missing or we can early exit - if (v === max) { - return 'FILES_MISSING'; - } - } - } - return 'OK'; - }; - - InstallationIntegrityChecker.prototype.check = function () { - var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, lockfile, flags, workspaceLayout) { - // check if patterns exist in lockfile - var missingPatterns = patterns.filter(function (p) { - return !lockfile[p] && (!workspaceLayout || !workspaceLayout.getManifestByPattern(p)); - }); - - var loc = yield this._getIntegrityFileLocation(); - if (missingPatterns.length || !loc.exists) { - return { - integrityFileMissing: !loc.exists, - missingPatterns - }; - } - - var actual = yield this._generateIntegrityFile(lockfile, patterns, flags, workspaceLayout); - - var expected = yield this._getIntegrityFile(loc.locationPath); - var integrityMatches = this._compareIntegrityFiles(actual, expected, flags.checkFiles, workspaceLayout); - - if (integrityMatches === 'OK') { - invariant(expected, "The integrity shouldn't pass without integrity file"); - for (var _iterator11 = expected.modulesFolders, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) { - var _ref19; - - if (_isArray11) { - if (_i11 >= _iterator11.length) break; - _ref19 = _iterator11[_i11++]; - } else { - _i11 = _iterator11.next(); - if (_i11.done) break; - _ref19 = _i11.value; - } - - var modulesFolder = _ref19; - - if (!(yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, modulesFolder)))) { - integrityMatches = 'MODULES_FOLDERS_MISSING'; - } - } - } - - return { - integrityFileMissing: false, - integrityMatches: integrityMatches === 'OK', - integrityError: integrityMatches === 'OK' ? undefined : integrityMatches, - missingPatterns, - hardRefreshRequired: integrityMatches === 'SYSTEM_PARAMS_DONT_MATCH' - }; - }); - - function check(_x10, _x11, _x12, _x13) { - return _ref18.apply(this, arguments); - } - - return check; - }(); - - /** - * Get artifacts from integrity file if it exists. - */ - - - InstallationIntegrityChecker.prototype.getArtifacts = function () { - var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var loc = yield this._getIntegrityFileLocation(); - if (!loc.exists) { - return null; - } - - var expectedRaw = yield (_fs || _load_fs()).readFile(loc.locationPath); - var expected = void 0; - try { - expected = JSON.parse(expectedRaw); - } catch (e) { - // ignore JSON parsing for legacy text integrity files compatibility - } - - return expected ? expected.artifacts : null; - }); - - function getArtifacts() { - return _ref20.apply(this, arguments); - } - - return getArtifacts; - }(); - - /** - * Write the integrity hash of the current install to disk. - */ - - - InstallationIntegrityChecker.prototype.save = function () { - var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, lockfile, flags, workspaceLayout, artifacts) { - var integrityFile = yield this._generateIntegrityFile(lockfile, patterns, flags, workspaceLayout, artifacts); - - var loc = yield this._getIntegrityFileLocation(); - invariant(loc.locationPath, 'expected integrity hash location'); - - yield (_fs || _load_fs()).mkdirp(path.dirname(loc.locationPath)); - yield (_fs || _load_fs()).writeFile(loc.locationPath, (0, (_stringify || _load_stringify()).default)(integrityFile, null, 2)); - }); - - function save(_x14, _x15, _x16, _x17, _x18) { - return _ref21.apply(this, arguments); - } - - return save; - }(); - - InstallationIntegrityChecker.prototype.removeIntegrityFile = function () { - var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var loc = yield this._getIntegrityFileLocation(); - if (loc.exists) { - yield (_fs || _load_fs()).unlink(loc.locationPath); - } - }); - - function removeIntegrityFile() { - return _ref22.apply(this, arguments); - } - - return removeIntegrityFile; - }(); - - return InstallationIntegrityChecker; -}(); - -exports.default = InstallationIntegrityChecker; - -/***/ }), -/* 198 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -exports.testEngine = testEngine; -exports.checkOne = checkOne; -exports.check = check; -exports.shouldCheck = shouldCheck; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(51)); -} - -var _misc; - -function _load_misc() { - return _misc = __webpack_require__(28); -} - -var _yarnVersion; - -function _load_yarnVersion() { - return _yarnVersion = __webpack_require__(114); -} - -var _semver; - -function _load_semver() { - return _semver = __webpack_require__(211); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var semver = __webpack_require__(27); - -var VERSIONS = (0, (_assign || _load_assign()).default)({}, process.versions, { - yarn: (_yarnVersion || _load_yarnVersion()).version -}); - -function isValid(items, actual) { - var isNotWhitelist = true; - var isBlacklist = false; - - for (var _iterator = items, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var item = _ref; - - // blacklist - if (item[0] === '!') { - isBlacklist = true; - - if (actual === item.slice(1)) { - return false; - } - // whitelist - } else { - isNotWhitelist = false; - - if (item === actual) { - return true; - } - } - } - - // npm allows blacklists and whitelists to be mixed. Blacklists with - // whitelisted items should be treated as whitelists. - return isBlacklist && isNotWhitelist; -} - -var aliases = (0, (_map || _load_map()).default)({ - iojs: 'node' // we should probably prompt these libraries to fix this -}); - -var ignore = ['npm', // we'll never satisfy this for obvious reasons -'teleport', // a module bundler used by some modules -'rhino', // once a target for older modules -'cordovaDependencies', // http://bit.ly/2tkUePg -'parcel']; - -function testEngine(name, range, versions, looseSemver) { - var actual = versions[name]; - if (!actual) { - return false; - } - - if (!semver.valid(actual, looseSemver)) { - return false; - } - - if (semver.satisfies(actual, range, looseSemver)) { - return true; - } - - if (name === 'yarn' && (0, (_semver || _load_semver()).satisfiesWithPrereleases)(actual, range, looseSemver)) { - return true; - } - - if (name === 'node' && semver.gt(actual, '1.0.0', looseSemver)) { - // WARNING: this is a massive hack and is super gross but necessary for compatibility - // some modules have the `engines.node` field set to a caret version below semver major v1 - // eg. ^0.12.0. this is problematic as we enforce engines checks and node is now on version >=1 - // to allow this pattern we transform the node version to fake ones in the minor range 10-13 - var major = semver.major(actual, looseSemver); - var fakes = [`0.10.${major}`, `0.11.${major}`, `0.12.${major}`, `0.13.${major}`]; - for (var _iterator2 = fakes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref2; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } - - var actualFake = _ref2; - - if (semver.satisfies(actualFake, range, looseSemver)) { - return true; - } - } - } - - // incompatible version - return false; -} - -function isValidArch(archs) { - return isValid(archs, process.arch); -} - -function isValidPlatform(platforms) { - return isValid(platforms, process.platform); -} - -function checkOne(info, config, ignoreEngines) { - var didIgnore = false; - var didError = false; - var reporter = config.reporter; - var human = `${info.name}@${info.version}`; - - var pushError = function pushError(msg) { - var ref = info._reference; - - if (ref && ref.optional) { - ref.ignore = true; - ref.incompatible = true; - - reporter.info(`${human}: ${msg}`); - if (!didIgnore) { - reporter.info(reporter.lang('optionalCompatibilityExcluded', human)); - didIgnore = true; - } - } else { - reporter.error(`${human}: ${msg}`); - didError = true; - } - }; - - var os = info.os, - cpu = info.cpu, - engines = info.engines; - - - if (shouldCheckPlatform(os, config.ignorePlatform) && !isValidPlatform(os)) { - pushError(reporter.lang('incompatibleOS', process.platform)); - } - - if (shouldCheckCpu(cpu, config.ignorePlatform) && !isValidArch(cpu)) { - pushError(reporter.lang('incompatibleCPU', process.arch)); - } - - if (shouldCheckEngines(engines, ignoreEngines)) { - for (var _iterator3 = (0, (_misc || _load_misc()).entries)(info.engines), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref3; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref3 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref3 = _i3.value; - } - - var entry = _ref3; - - var name = entry[0]; - var range = entry[1]; - - if (aliases[name]) { - name = aliases[name]; - } - - if (VERSIONS[name]) { - if (!testEngine(name, range, VERSIONS, config.looseSemver)) { - pushError(reporter.lang('incompatibleEngine', name, range, VERSIONS[name])); - } - } else if (ignore.indexOf(name) < 0) { - reporter.warn(`${human}: ${reporter.lang('invalidEngine', name)}`); - } - } - } - - if (didError) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('foundIncompatible')); - } -} - -function check(infos, config, ignoreEngines) { - for (var _iterator4 = infos, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref4; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref4 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref4 = _i4.value; - } - - var info = _ref4; - - checkOne(info, config, ignoreEngines); - } -} - -function shouldCheckCpu(cpu, ignorePlatform) { - return !ignorePlatform && Array.isArray(cpu) && cpu.length > 0; -} - -function shouldCheckPlatform(os, ignorePlatform) { - return !ignorePlatform && Array.isArray(os) && os.length > 0; -} - -function shouldCheckEngines(engines, ignoreEngines) { - return !ignoreEngines && typeof engines === 'object'; -} - -function shouldCheck(manifest, options) { - return shouldCheckCpu(manifest.cpu, options.ignorePlatform) || shouldCheckPlatform(manifest.os, options.ignorePlatform) || shouldCheckEngines(manifest.engines, options.ignoreEngines); -} - -/***/ }), -/* 199 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.fetchOneRemote = undefined; - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(42)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var fetchCache = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest, fetcher, config, remote) { - // $FlowFixMe: This error doesn't make sense - var _ref2 = yield config.readPackageMetadata(dest), - hash = _ref2.hash, - pkg = _ref2.package, - cacheRemote = _ref2.remote; - - var cacheIntegrity = cacheRemote.cacheIntegrity || cacheRemote.integrity; - var cacheHash = cacheRemote.hash; - - if (remote.integrity) { - if (!cacheIntegrity || !ssri.parse(cacheIntegrity).match(remote.integrity)) { - throw new (_errors || _load_errors()).SecurityError(config.reporter.lang('fetchBadIntegrityCache', pkg.name, cacheIntegrity, remote.integrity)); - } - } - - if (remote.hash) { - if (!cacheHash || cacheHash !== remote.hash) { - throw new (_errors || _load_errors()).SecurityError(config.reporter.lang('fetchBadHashCache', pkg.name, cacheHash, remote.hash)); - } - } - - yield fetcher.setupMirrorFromCache(); - return { - package: pkg, - hash, - dest, - cached: true - }; - }); - - return function fetchCache(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -var fetchOneRemote = exports.fetchOneRemote = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (remote, name, version, dest, config) { - // Mock metadata for symlinked dependencies - if (remote.type === 'link') { - var mockPkg = { _uid: '', name: '', version: '0.0.0' }; - return (_promise || _load_promise()).default.resolve({ resolved: null, hash: '', dest, package: mockPkg, cached: false }); - } - - var Fetcher = (_index || _load_index())[remote.type]; - if (!Fetcher) { - throw new (_errors || _load_errors()).MessageError(config.reporter.lang('unknownFetcherFor', remote.type)); - } - - var fetcher = new Fetcher(dest, remote, config); - if (yield config.isValidModuleDest(dest)) { - return fetchCache(dest, fetcher, config, remote); - } - - // remove as the module may be invalid - yield (_fs || _load_fs()).unlink(dest); - - try { - return yield fetcher.fetch({ - name, - version - }); - } catch (err) { - try { - yield (_fs || _load_fs()).unlink(dest); - } catch (err2) { - // what do? - } - throw err; - } - }); - - return function fetchOneRemote(_x5, _x6, _x7, _x8, _x9) { - return _ref3.apply(this, arguments); - }; -}(); - -var maybeFetchOne = function () { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref, config) { - try { - return yield fetchOne(ref, config); - } catch (err) { - if (ref.optional) { - config.reporter.error(err.message); - return null; - } else { - throw err; - } - } - }); - - return function maybeFetchOne(_x10, _x11) { - return _ref4.apply(this, arguments); - }; -}(); - -exports.fetch = fetch; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _index; - -function _load_index() { - return _index = _interopRequireWildcard(__webpack_require__(539)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _promise2; - -function _load_promise2() { - return _promise2 = _interopRequireWildcard(__webpack_require__(86)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ssri = __webpack_require__(93); - -function fetchOne(ref, config) { - var dest = config.generateModuleCachePath(ref); - - return fetchOneRemote(ref.remote, ref.name, ref.version, dest, config); -} - -function fetch(pkgs, config) { - var pkgsPerDest = new (_map || _load_map()).default(); - pkgs = pkgs.filter(function (pkg) { - var ref = pkg._reference; - if (!ref) { - return false; - } - var dest = config.generateModuleCachePath(ref); - var otherPkg = pkgsPerDest.get(dest); - if (otherPkg) { - config.reporter.warn(config.reporter.lang('multiplePackagesCantUnpackInSameDestination', ref.patterns, dest, otherPkg.patterns)); - return false; - } - pkgsPerDest.set(dest, ref); - return true; - }); - var tick = config.reporter.progress(pkgs.length); - - return (_promise2 || _load_promise2()).queue(pkgs, function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg) { - var ref = pkg._reference; - if (!ref) { - return pkg; - } - - var res = yield maybeFetchOne(ref, config); - var newPkg = void 0; - - if (res) { - newPkg = res.package; - - // update with new remote - // but only if there was a hash previously as the tarball fetcher does not provide a hash. - if (ref.remote.hash) { - // if the checksum was updated, also update resolved and cache - if (ref.remote.hash !== res.hash && config.updateChecksums) { - var oldHash = ref.remote.hash; - if (ref.remote.resolved) { - ref.remote.resolved = ref.remote.resolved.replace(oldHash, res.hash); - } - ref.config.cache = (0, (_keys || _load_keys()).default)(ref.config.cache).reduce(function (cache, entry) { - var entryWithNewHash = entry.replace(oldHash, res.hash); - cache[entryWithNewHash] = ref.config.cache[entry]; - return cache; - }, {}); - } - ref.remote.hash = res.hash || ref.remote.hash; - } - } - - if (tick) { - tick(); - } - - if (newPkg) { - newPkg._reference = ref; - newPkg._remote = ref.remote; - newPkg.name = pkg.name; - newPkg.fresh = pkg.fresh; - return newPkg; - } - - return pkg; - }); - - return function (_x12) { - return _ref5.apply(this, arguments); - }; - }(), config.networkConcurrency); -} - -/***/ }), -/* 200 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.linkBin = undefined; - -var _from; - -function _load_from() { - return _from = _interopRequireDefault(__webpack_require__(53)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(42)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var linkBin = exports.linkBin = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) { - if (process.platform === 'win32') { - var unlockMutex = yield (0, (_mutex || _load_mutex()).default)(src); - try { - yield cmdShim(src, dest, { createPwshFile: false }); - } finally { - unlockMutex(); - } - } else { - yield (_fs || _load_fs()).mkdirp(path.dirname(dest)); - yield (_fs || _load_fs()).symlink(src, dest); - yield (_fs || _load_fs()).chmod(dest, '755'); - } - }); - - return function linkBin(_x, _x2) { - return _ref.apply(this, arguments); - }; -}(); - -var _packageHoister; - -function _load_packageHoister() { - return _packageHoister = _interopRequireDefault(__webpack_require__(544)); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); -} - -var _promise2; - -function _load_promise2() { - return _promise2 = _interopRequireWildcard(__webpack_require__(86)); -} - -var _normalizePattern2; - -function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(52); -} - -var _misc; - -function _load_misc() { - return _misc = __webpack_require__(28); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _mutex; - -function _load_mutex() { - return _mutex = _interopRequireDefault(__webpack_require__(318)); -} - -var _semver; - -function _load_semver() { - return _semver = __webpack_require__(211); -} - -var _workspaceLayout; - -function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(87)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var invariant = __webpack_require__(15); - -var cmdShim = __webpack_require__(189); -var path = __webpack_require__(1); -var semver = __webpack_require__(27); -// Concurrency for creating bin links disabled because of the issue #1961 -var linkBinConcurrency = 1; - -var PackageLinker = function () { - function PackageLinker(config, resolver) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageLinker); - - this.resolver = resolver; - this.reporter = config.reporter; - this.config = config; - this.artifacts = {}; - this.topLevelBinLinking = true; - this.unplugged = []; - } - - PackageLinker.prototype.setArtifacts = function setArtifacts(artifacts) { - this.artifacts = artifacts; - }; - - PackageLinker.prototype.setTopLevelBinLinking = function setTopLevelBinLinking(topLevelBinLinking) { - this.topLevelBinLinking = topLevelBinLinking; - }; - - PackageLinker.prototype.linkSelfDependencies = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, pkgLoc, targetBinLoc) { - var override = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - - targetBinLoc = path.join(targetBinLoc, '.bin'); - yield (_fs || _load_fs()).mkdirp(targetBinLoc); - targetBinLoc = yield (_fs || _load_fs()).realpath(targetBinLoc); - pkgLoc = yield (_fs || _load_fs()).realpath(pkgLoc); - for (var _iterator = (0, (_misc || _load_misc()).entries)(pkg.bin), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref4; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref4 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref4 = _i.value; - } - - var _ref3 = _ref4; - var scriptName = _ref3[0]; - var scriptCmd = _ref3[1]; - - var dest = path.join(targetBinLoc, scriptName); - var src = path.join(pkgLoc, scriptCmd); - if (!(yield (_fs || _load_fs()).exists(src))) { - if (!override) { - // TODO maybe throw an error - continue; - } - } - yield linkBin(src, dest); - } - }); - - function linkSelfDependencies(_x3, _x4, _x5) { - return _ref2.apply(this, arguments); - } - - return linkSelfDependencies; - }(); - - PackageLinker.prototype.linkBinDependencies = function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, dir) { - var _this = this; - - var deps = []; - - var ref = pkg._reference; - invariant(ref, 'Package reference is missing'); - - var remote = pkg._remote; - invariant(remote, 'Package remote is missing'); - - // link up `bin scripts` in `dependencies` - for (var _iterator2 = ref.dependencies, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref6; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref6 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref6 = _i2.value; - } - - var pattern = _ref6; - - var _dep = this.resolver.getStrictResolvedPattern(pattern); - if ( - // Missing locations means not installed inside node_modules - _dep._reference && _dep._reference.locations.length && _dep.bin && (0, (_keys || _load_keys()).default)(_dep.bin).length) { - var _loc2 = yield this.findNearestInstalledVersionOfPackage(_dep, dir); - deps.push({ dep: _dep, loc: _loc2 }); - } - } - - // link up the `bin` scripts in bundled dependencies - if (pkg.bundleDependencies) { - var _loop = function* _loop(depName) { - var locs = ref.locations.map(function (loc) { - return path.join(loc, _this.config.getFolder(pkg), depName); - }); - try { - var _dep2 = yield _this.config.readManifest(locs[0], remote.registry); //all of them should be the same - - if (_dep2.bin && (0, (_keys || _load_keys()).default)(_dep2.bin).length) { - deps.push.apply(deps, locs.map(function (loc) { - return { dep: _dep2, loc }; - })); - } - } catch (ex) { - if (ex.code !== 'ENOENT') { - throw ex; - } - // intentionally ignoring ENOENT error. - // bundledDependency either does not exist or does not contain a package.json - } - }; - - for (var _iterator3 = pkg.bundleDependencies, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref7; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref7 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref7 = _i3.value; - } - - var depName = _ref7; - yield* _loop(depName); - } - } - - // no deps to link - if (!deps.length) { - return; - } - - // write the executables - for (var _iterator4 = deps, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref9; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref9 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref9 = _i4.value; - } - - var _ref8 = _ref9; - var _dep3 = _ref8.dep, - _loc = _ref8.loc; - - if (_dep3._reference && _dep3._reference.locations.length) { - invariant(!_dep3._reference.isPlugnplay, "Plug'n'play packages should not be referenced here"); - yield this.linkSelfDependencies(_dep3, _loc, dir); - } - } - }); - - function linkBinDependencies(_x7, _x8) { - return _ref5.apply(this, arguments); - } - - return linkBinDependencies; - }(); - - //find the installation location of ref that would be used in binLoc based on node module resolution - - - PackageLinker.prototype.findNearestInstalledVersionOfPackage = function () { - var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, binLoc) { - var ref = pkg._reference; - invariant(ref, 'expected pkg reference for ' + pkg.name); - var moduleFolder = this.config.getFolder(pkg); - yield (_fs || _load_fs()).mkdirp(binLoc); - var realBinLoc = yield (_fs || _load_fs()).realpath(binLoc); - - var allLocations = [].concat(ref.locations); - var realLocations = yield (_promise || _load_promise()).default.all(ref.locations.map(function (loc) { - return (_fs || _load_fs()).realpath(loc); - })); - realLocations.forEach(function (loc) { - return allLocations.indexOf(loc) !== -1 || allLocations.push(loc); - }); - - var locationBinLocPairs = allLocations.map(function (loc) { - return [loc, binLoc]; - }); - if (binLoc !== realBinLoc) { - locationBinLocPairs.push.apply(locationBinLocPairs, allLocations.map(function (loc) { - return [loc, realBinLoc]; - })); - } - - var distancePairs = locationBinLocPairs.map(function (_ref11) { - var loc = _ref11[0], - curBinLoc = _ref11[1]; - - var distance = 0; - var curLoc = curBinLoc; - var notFound = false; - - while (path.join(curLoc, ref.name) !== loc && path.join(curLoc, moduleFolder, ref.name) !== loc) { - var next = path.dirname(curLoc); - if (curLoc === next) { - notFound = true; - break; - } - - distance++; - curLoc = next; - } - return notFound ? null : [loc, distance]; - }); - - //remove items where path was not found - var filteredDistancePairs = distancePairs.filter(function (d) { - return d; - }); - filteredDistancePairs; - - invariant(filteredDistancePairs.length > 0, `could not find a copy of ${pkg.name} to link in ${binLoc}`); - - //get smallest distance from package location - var minItem = filteredDistancePairs.reduce(function (min, cur) { - return cur[1] < min[1] ? cur : min; - }); - - invariant(minItem[1] >= 0, 'could not find a target for bin dir of ' + minItem.toString()); - return minItem[0]; - }); - - function findNearestInstalledVersionOfPackage(_x9, _x10) { - return _ref10.apply(this, arguments); - } - - return findNearestInstalledVersionOfPackage; - }(); - - PackageLinker.prototype.getFlatHoistedTree = function getFlatHoistedTree(patterns, workspaceLayout) { - var _ref12 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, - ignoreOptional = _ref12.ignoreOptional; - - var hoister = new (_packageHoister || _load_packageHoister()).default(this.config, this.resolver, { ignoreOptional, workspaceLayout }); - hoister.seed(patterns); - if (this.config.focus) { - hoister.markShallowWorkspaceEntries(); - } - return hoister.init(); - }; - - PackageLinker.prototype.copyModules = function () { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) { - var _this2 = this; - - var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, - linkDuplicates = _ref14.linkDuplicates, - ignoreOptional = _ref14.ignoreOptional; - - var flatTree = this.getFlatHoistedTree(patterns, workspaceLayout, { ignoreOptional }); - // sorted tree makes file creation and copying not to interfere with each other - flatTree = flatTree.sort(function (dep1, dep2) { - return dep1[0].localeCompare(dep2[0]); - }); - - // list of artifacts in modules to remove from extraneous removal - var artifactFiles = []; - - var copyQueue = new (_map || _load_map()).default(); - var hardlinkQueue = new (_map || _load_map()).default(); - var hardlinksEnabled = linkDuplicates && (yield (_fs || _load_fs()).hardlinksWork(this.config.cwd)); - - var copiedSrcs = new (_map || _load_map()).default(); - var symlinkPaths = new (_map || _load_map()).default(); - - var _loop2 = function* _loop2(folder, pkg, isShallow, _loc3) { - var remote = pkg._remote || { type: '' }; - var ref = pkg._reference; - var dest = folder; - invariant(ref, 'expected package reference'); - - var src = _loc3; - var type = ''; - if (remote.type === 'link') { - // replace package source from incorrect cache location (workspaces and link: are not cached) - // with a symlink source - src = remote.reference; - type = 'symlink'; - } else if (workspaceLayout && remote.type === 'workspace' && !isShallow) { - src = remote.reference; - type = 'symlink'; - // to get real path for non hoisted dependencies - symlinkPaths.set(dest, src); - } else { - // backwards compatibility: get build artifacts from metadata - // does not apply to symlinked dependencies - var metadata = yield _this2.config.readPackageMetadata(src); - for (var _iterator15 = metadata.artifacts, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) { - var _ref32; - - if (_isArray15) { - if (_i15 >= _iterator15.length) break; - _ref32 = _iterator15[_i15++]; - } else { - _i15 = _iterator15.next(); - if (_i15.done) break; - _ref32 = _i15.value; - } - - var file = _ref32; - - artifactFiles.push(path.join(dest, file)); - } - } - - for (var _iterator16 = symlinkPaths.entries(), _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator16);;) { - var _ref34; - - if (_isArray16) { - if (_i16 >= _iterator16.length) break; - _ref34 = _iterator16[_i16++]; - } else { - _i16 = _iterator16.next(); - if (_i16.done) break; - _ref34 = _i16.value; - } - - var _ref33 = _ref34; - var symlink = _ref33[0]; - var realpath = _ref33[1]; - - if (dest.indexOf(symlink + path.sep) === 0) { - // after hoisting we end up with this structure - // root/node_modules/workspace-package(symlink)/node_modules/package-a - // fs.copy operations can't copy files through a symlink, so all the paths under workspace-package - // need to be replaced with a real path, except for the symlink root/node_modules/workspace-package - dest = dest.replace(symlink, realpath); - } - } - - if (_this2.config.plugnplayEnabled) { - ref.isPlugnplay = true; - if (yield _this2._isUnplugged(pkg, ref)) { - dest = _this2.config.generatePackageUnpluggedPath(ref); - - // We don't skip the copy if the unplugged package isn't materialized yet - if (yield (_fs || _load_fs()).exists(dest)) { - ref.addLocation(dest); - return 'continue'; - } - } else { - ref.addLocation(src); - return 'continue'; - } - } - - ref.addLocation(dest); - - var integrityArtifacts = _this2.artifacts[`${pkg.name}@${pkg.version}`]; - if (integrityArtifacts) { - for (var _iterator17 = integrityArtifacts, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator17);;) { - var _ref35; - - if (_isArray17) { - if (_i17 >= _iterator17.length) break; - _ref35 = _iterator17[_i17++]; - } else { - _i17 = _iterator17.next(); - if (_i17.done) break; - _ref35 = _i17.value; - } - - var _file = _ref35; - - artifactFiles.push(path.join(dest, _file)); - } - } - - var copiedDest = copiedSrcs.get(src); - if (!copiedDest) { - // no point to hardlink to a symlink - if (hardlinksEnabled && type !== 'symlink') { - copiedSrcs.set(src, dest); - } - copyQueue.set(dest, { - src, - dest, - type, - onFresh() { - if (ref) { - ref.setFresh(true); - } - } - }); - } else { - hardlinkQueue.set(dest, { - src: copiedDest, - dest, - onFresh() { - if (ref) { - ref.setFresh(true); - } - } - }); - } - }; - - for (var _iterator5 = flatTree, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { - var _ref16; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref16 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref16 = _i5.value; - } - - var _ref15 = _ref16; - var folder = _ref15[0]; - var _ref15$ = _ref15[1]; - var pkg = _ref15$.pkg; - var _loc3 = _ref15$.loc; - var isShallow = _ref15$.isShallow; - - var _ret2 = yield* _loop2(folder, pkg, isShallow, _loc3); - - if (_ret2 === 'continue') continue; - } - - var possibleExtraneous = new (_set || _load_set()).default(); - var scopedPaths = new (_set || _load_set()).default(); - - var findExtraneousFiles = function () { - var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (basePath) { - for (var _iterator6 = _this2.config.registryFolders, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { - var _ref18; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref18 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref18 = _i6.value; - } - - var folder = _ref18; - - var _loc4 = path.resolve(basePath, folder); - - if (yield (_fs || _load_fs()).exists(_loc4)) { - var files = yield (_fs || _load_fs()).readdir(_loc4); - - for (var _iterator7 = files, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { - var _ref19; - - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref19 = _iterator7[_i7++]; - } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref19 = _i7.value; - } - - var file = _ref19; - - var filepath = path.join(_loc4, file); - - // it's a scope, not a package - if (file[0] === '@') { - scopedPaths.add(filepath); - - for (var _iterator8 = yield (_fs || _load_fs()).readdir(filepath), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) { - var _ref20; - - if (_isArray8) { - if (_i8 >= _iterator8.length) break; - _ref20 = _iterator8[_i8++]; - } else { - _i8 = _iterator8.next(); - if (_i8.done) break; - _ref20 = _i8.value; - } - - var subfile = _ref20; - - possibleExtraneous.add(path.join(filepath, subfile)); - } - } else if (file[0] === '.' && file !== '.bin') { - if (!(yield (_fs || _load_fs()).lstat(filepath)).isDirectory()) { - possibleExtraneous.add(filepath); - } - } else { - possibleExtraneous.add(filepath); - } - } - } - } - }); - - return function findExtraneousFiles(_x15) { - return _ref17.apply(this, arguments); - }; - }(); - - yield findExtraneousFiles(this.config.lockfileFolder); - if (workspaceLayout) { - for (var _iterator9 = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) { - var _ref21; - - if (_isArray9) { - if (_i9 >= _iterator9.length) break; - _ref21 = _iterator9[_i9++]; - } else { - _i9 = _iterator9.next(); - if (_i9.done) break; - _ref21 = _i9.value; - } - - var workspaceName = _ref21; - - yield findExtraneousFiles(workspaceLayout.workspaces[workspaceName].loc); - } - } - - // If an Extraneous is an entry created via "yarn link", we prevent it from being overwritten. - // Unfortunately, the only way we can know if they have been created this way is to check if they - // are symlinks - problem is that it then conflicts with the newly introduced "link:" protocol, - // which also creates symlinks :( a somewhat weak fix is to check if the symlink target is registered - // inside the linkFolder, in which case we assume it has been created via "yarn link". Otherwise, we - // assume it's a link:-managed dependency, and overwrite it as usual. - var linkTargets = new (_map || _load_map()).default(); - - var linkedModules = void 0; - try { - linkedModules = yield (_fs || _load_fs()).readdir(this.config.linkFolder); - } catch (err) { - if (err.code === 'ENOENT') { - linkedModules = []; - } else { - throw err; - } - } - - // TODO: Consolidate this logic with `this.config.linkedModules` logic - for (var _iterator10 = linkedModules, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) { - var _ref22; - - if (_isArray10) { - if (_i10 >= _iterator10.length) break; - _ref22 = _iterator10[_i10++]; - } else { - _i10 = _iterator10.next(); - if (_i10.done) break; - _ref22 = _i10.value; - } - - var entry = _ref22; - - var entryPath = path.join(this.config.linkFolder, entry); - var stat = yield (_fs || _load_fs()).lstat(entryPath); - - if (stat.isSymbolicLink()) { - try { - var entryTarget = yield (_fs || _load_fs()).realpath(entryPath); - linkTargets.set(entry, entryTarget); - } catch (err) { - this.reporter.warn(this.reporter.lang('linkTargetMissing', entry)); - yield (_fs || _load_fs()).unlink(entryPath); - } - } else if (stat.isDirectory() && entry[0] === '@') { - // if the entry is directory beginning with '@', then we're dealing with a package scope, which - // means we must iterate inside to retrieve the package names it contains - var scopeName = entry; - - for (var _iterator18 = yield (_fs || _load_fs()).readdir(entryPath), _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator18);;) { - var _ref36; - - if (_isArray18) { - if (_i18 >= _iterator18.length) break; - _ref36 = _iterator18[_i18++]; - } else { - _i18 = _iterator18.next(); - if (_i18.done) break; - _ref36 = _i18.value; - } - - var entry2 = _ref36; - - var entryPath2 = path.join(entryPath, entry2); - var stat2 = yield (_fs || _load_fs()).lstat(entryPath2); - - if (stat2.isSymbolicLink()) { - var packageName = `${scopeName}/${entry2}`; - try { - var _entryTarget = yield (_fs || _load_fs()).realpath(entryPath2); - linkTargets.set(packageName, _entryTarget); - } catch (err) { - this.reporter.warn(this.reporter.lang('linkTargetMissing', packageName)); - yield (_fs || _load_fs()).unlink(entryPath2); - } - } - } - } - } - - for (var _iterator11 = possibleExtraneous, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) { - var _ref23; - - if (_isArray11) { - if (_i11 >= _iterator11.length) break; - _ref23 = _iterator11[_i11++]; - } else { - _i11 = _iterator11.next(); - if (_i11.done) break; - _ref23 = _i11.value; - } - - var _loc5 = _ref23; - - var packageName = path.basename(_loc5); - var scopeName = path.basename(path.dirname(_loc5)); - - if (scopeName[0] === `@`) { - packageName = `${scopeName}/${packageName}`; - } - - if ((yield (_fs || _load_fs()).lstat(_loc5)).isSymbolicLink() && linkTargets.has(packageName) && linkTargets.get(packageName) === (yield (_fs || _load_fs()).realpath(_loc5))) { - possibleExtraneous.delete(_loc5); - copyQueue.delete(_loc5); - } - } - - // - var tick = void 0; - yield (_fs || _load_fs()).copyBulk((0, (_from || _load_from()).default)(copyQueue.values()), this.reporter, { - possibleExtraneous, - artifactFiles, - - ignoreBasenames: [(_constants || _load_constants()).METADATA_FILENAME, (_constants || _load_constants()).TARBALL_FILENAME, '.bin'], - - onStart: function onStart(num) { - tick = _this2.reporter.progress(num); - }, - - onProgress(src) { - if (tick) { - tick(); - } - } - }); - - yield (_fs || _load_fs()).hardlinkBulk((0, (_from || _load_from()).default)(hardlinkQueue.values()), this.reporter, { - possibleExtraneous, - artifactFiles, - - onStart: function onStart(num) { - tick = _this2.reporter.progress(num); - }, - - onProgress(src) { - if (tick) { - tick(); - } - } - }); - - // remove all extraneous files that weren't in the tree - for (var _iterator12 = possibleExtraneous, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) { - var _ref24; - - if (_isArray12) { - if (_i12 >= _iterator12.length) break; - _ref24 = _iterator12[_i12++]; - } else { - _i12 = _iterator12.next(); - if (_i12.done) break; - _ref24 = _i12.value; - } - - var _loc6 = _ref24; - - this.reporter.verbose(this.reporter.lang('verboseFileRemoveExtraneous', _loc6)); - yield (_fs || _load_fs()).unlink(_loc6); - } - - // remove any empty scoped directories - for (var _iterator13 = scopedPaths, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) { - var _ref25; - - if (_isArray13) { - if (_i13 >= _iterator13.length) break; - _ref25 = _iterator13[_i13++]; - } else { - _i13 = _iterator13.next(); - if (_i13.done) break; - _ref25 = _i13.value; - } - - var scopedPath = _ref25; - - var files = yield (_fs || _load_fs()).readdir(scopedPath); - if (files.length === 0) { - yield (_fs || _load_fs()).unlink(scopedPath); - } - } - - // create binary links - if (this.config.getOption('bin-links') && this.config.binLinks !== false) { - var topLevelDependencies = this.determineTopLevelBinLinkOrder(flatTree); - var tickBin = this.reporter.progress(flatTree.length + topLevelDependencies.length); - - // create links in transient dependencies - yield (_promise2 || _load_promise2()).queue(flatTree, function () { - var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref27) { - var dest = _ref27[0], - _ref27$ = _ref27[1], - pkg = _ref27$.pkg, - isNohoist = _ref27$.isNohoist, - parts = _ref27$.parts; - - if (pkg._reference && pkg._reference.locations.length && !pkg._reference.isPlugnplay) { - var binLoc = path.join(dest, _this2.config.getFolder(pkg)); - yield _this2.linkBinDependencies(pkg, binLoc); - if (isNohoist) { - // if nohoist, we need to override the binLink to point to the local destination - var parentBinLoc = _this2.getParentBinLoc(parts, flatTree); - yield _this2.linkSelfDependencies(pkg, dest, parentBinLoc, true); - } - tickBin(); - } - tickBin(); - }); - - return function (_x16) { - return _ref26.apply(this, arguments); - }; - }(), linkBinConcurrency); - - // create links at top level for all dependencies. - yield (_promise2 || _load_promise2()).queue(topLevelDependencies, function () { - var _ref28 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref29) { - var dest = _ref29[0], - pkg = _ref29[1].pkg; - - if (pkg._reference && pkg._reference.locations.length && !pkg._reference.isPlugnplay && pkg.bin && (0, (_keys || _load_keys()).default)(pkg.bin).length) { - var binLoc = void 0; - if (_this2.config.modulesFolder) { - binLoc = path.join(_this2.config.modulesFolder); - } else { - binLoc = path.join(_this2.config.lockfileFolder, _this2.config.getFolder(pkg)); - } - yield _this2.linkSelfDependencies(pkg, dest, binLoc); - } - tickBin(); - }); - - return function (_x17) { - return _ref28.apply(this, arguments); - }; - }(), linkBinConcurrency); - } - - for (var _iterator14 = flatTree, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) { - var _ref31; - - if (_isArray14) { - if (_i14 >= _iterator14.length) break; - _ref31 = _iterator14[_i14++]; - } else { - _i14 = _iterator14.next(); - if (_i14.done) break; - _ref31 = _i14.value; - } - - var _ref30 = _ref31; - var pkg = _ref30[1].pkg; - - yield this._warnForMissingBundledDependencies(pkg); - } - }); - - function copyModules(_x12, _x13) { - return _ref13.apply(this, arguments); - } - - return copyModules; - }(); - - PackageLinker.prototype._buildTreeHash = function _buildTreeHash(flatTree) { - var hash = new (_map || _load_map()).default(); - for (var _iterator19 = flatTree, _isArray19 = Array.isArray(_iterator19), _i19 = 0, _iterator19 = _isArray19 ? _iterator19 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator19);;) { - var _ref38; - - if (_isArray19) { - if (_i19 >= _iterator19.length) break; - _ref38 = _iterator19[_i19++]; - } else { - _i19 = _iterator19.next(); - if (_i19.done) break; - _ref38 = _i19.value; - } - - var _ref37 = _ref38; - var _dest = _ref37[0]; - var hoistManifest = _ref37[1]; - - var key = hoistManifest.parts.join('#'); - hash.set(key, [_dest, hoistManifest]); - } - this._treeHash = hash; - return hash; - }; - - PackageLinker.prototype.getParentBinLoc = function getParentBinLoc(parts, flatTree) { - var hash = this._treeHash || this._buildTreeHash(flatTree); - var parent = parts.slice(0, -1).join('#'); - var tuple = hash.get(parent); - if (!tuple) { - throw new Error(`failed to get parent '${parent}' binLoc`); - } - var dest = tuple[0], - hoistManifest = tuple[1]; - - var parentBinLoc = path.join(dest, this.config.getFolder(hoistManifest.pkg)); - - return parentBinLoc; - }; - - PackageLinker.prototype.determineTopLevelBinLinkOrder = function determineTopLevelBinLinkOrder(flatTree) { - var linksToCreate = new (_map || _load_map()).default(); - for (var _iterator20 = flatTree, _isArray20 = Array.isArray(_iterator20), _i20 = 0, _iterator20 = _isArray20 ? _iterator20 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator20);;) { - var _ref40; - - if (_isArray20) { - if (_i20 >= _iterator20.length) break; - _ref40 = _iterator20[_i20++]; - } else { - _i20 = _iterator20.next(); - if (_i20.done) break; - _ref40 = _i20.value; - } - - var _ref39 = _ref40; - var _dest2 = _ref39[0]; - var hoistManifest = _ref39[1]; - var pkg = hoistManifest.pkg, - isDirectRequire = hoistManifest.isDirectRequire, - isNohoist = hoistManifest.isNohoist, - isShallow = hoistManifest.isShallow; - var name = pkg.name; - - // nohoist and shallow packages should not be linked at topLevel bin - - if (!isNohoist && !isShallow && (isDirectRequire || this.topLevelBinLinking && !linksToCreate.has(name))) { - linksToCreate.set(name, [_dest2, hoistManifest]); - } - } - - // Sort the array so that direct dependencies will be linked last. - // Bin links are overwritten if they already exist, so this will cause direct deps to take precedence. - // If someone finds this to be incorrect later, you could also consider sorting descending by - // `linkToCreate.level` which is the dependency tree depth. Direct deps will have level 0 and transitive - // deps will have level > 0. - var transientBins = []; - var topLevelBins = []; - for (var _iterator21 = (0, (_from || _load_from()).default)(linksToCreate.values()), _isArray21 = Array.isArray(_iterator21), _i21 = 0, _iterator21 = _isArray21 ? _iterator21 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator21);;) { - var _ref41; - - if (_isArray21) { - if (_i21 >= _iterator21.length) break; - _ref41 = _iterator21[_i21++]; - } else { - _i21 = _iterator21.next(); - if (_i21.done) break; - _ref41 = _i21.value; - } - - var linkToCreate = _ref41; - - if (linkToCreate[1].isDirectRequire) { - topLevelBins.push(linkToCreate); - } else { - transientBins.push(linkToCreate); - } - } - return [].concat(transientBins, topLevelBins); - }; - - PackageLinker.prototype.resolvePeerModules = function resolvePeerModules() { - var _this3 = this; - - var _loop3 = function _loop3(pkg) { - var peerDeps = pkg.peerDependencies; - var peerDepsMeta = pkg.peerDependenciesMeta; - - if (!peerDeps) { - return 'continue'; - } - - var ref = pkg._reference; - invariant(ref, 'Package reference is missing'); - - // TODO: We are taking the "shortest" ref tree but there may be multiple ref trees with the same length - var refTree = ref.requests.map(function (req) { - return req.parentNames; - }).sort(function (arr1, arr2) { - return arr1.length - arr2.length; - })[0]; - - var getLevelDistance = function getLevelDistance(pkgRef) { - var minDistance = Infinity; - for (var _iterator23 = pkgRef.requests, _isArray23 = Array.isArray(_iterator23), _i23 = 0, _iterator23 = _isArray23 ? _iterator23 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator23);;) { - var _ref43; - - if (_isArray23) { - if (_i23 >= _iterator23.length) break; - _ref43 = _iterator23[_i23++]; - } else { - _i23 = _iterator23.next(); - if (_i23.done) break; - _ref43 = _i23.value; - } - - var req = _ref43; - - var distance = refTree.length - req.parentNames.length; - - if (distance >= 0 && distance < minDistance && req.parentNames.every(function (name, idx) { - return name === refTree[idx]; - })) { - minDistance = distance; - } - } - - return minDistance; - }; - - for (var peerDepName in peerDeps) { - var range = peerDeps[peerDepName]; - var meta = peerDepsMeta && peerDepsMeta[peerDepName]; - - var isOptional = !!(meta && meta.optional); - - var peerPkgs = _this3.resolver.getAllInfoForPackageName(peerDepName); - - var peerError = 'unmetPeer'; - var resolvedLevelDistance = Infinity; - var resolvedPeerPkg = void 0; - for (var _iterator24 = peerPkgs, _isArray24 = Array.isArray(_iterator24), _i24 = 0, _iterator24 = _isArray24 ? _iterator24 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator24);;) { - var _ref44; - - if (_isArray24) { - if (_i24 >= _iterator24.length) break; - _ref44 = _iterator24[_i24++]; - } else { - _i24 = _iterator24.next(); - if (_i24.done) break; - _ref44 = _i24.value; - } - - var peerPkg = _ref44; - - var peerPkgRef = peerPkg._reference; - if (!(peerPkgRef && peerPkgRef.patterns)) { - continue; - } - var levelDistance = getLevelDistance(peerPkgRef); - if (isFinite(levelDistance) && levelDistance < resolvedLevelDistance) { - if (_this3._satisfiesPeerDependency(range, peerPkgRef.version)) { - resolvedLevelDistance = levelDistance; - resolvedPeerPkg = peerPkgRef; - } else { - peerError = 'incorrectPeer'; - } - } - } - - if (resolvedPeerPkg) { - ref.addDependencies(resolvedPeerPkg.patterns); - _this3.reporter.verbose(_this3.reporter.lang('selectedPeer', `${pkg.name}@${pkg.version}`, `${peerDepName}@${resolvedPeerPkg.version}`, resolvedPeerPkg.level)); - } else if (!isOptional) { - _this3.reporter.warn(_this3.reporter.lang(peerError, `${refTree.join(' > ')} > ${pkg.name}@${pkg.version}`, `${peerDepName}@${range}`)); - } - } - }; - - for (var _iterator22 = this.resolver.getManifests(), _isArray22 = Array.isArray(_iterator22), _i22 = 0, _iterator22 = _isArray22 ? _iterator22 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator22);;) { - var _ref42; - - if (_isArray22) { - if (_i22 >= _iterator22.length) break; - _ref42 = _iterator22[_i22++]; - } else { - _i22 = _iterator22.next(); - if (_i22.done) break; - _ref42 = _i22.value; - } - - var pkg = _ref42; - - var _ret3 = _loop3(pkg); - - if (_ret3 === 'continue') continue; - } - }; - - PackageLinker.prototype._satisfiesPeerDependency = function _satisfiesPeerDependency(range, version) { - return range === '*' || (0, (_semver || _load_semver()).satisfiesWithPrereleases)(version, range, this.config.looseSemver); - }; - - PackageLinker.prototype._warnForMissingBundledDependencies = function () { - var _ref45 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg) { - var _this4 = this; - - var ref = pkg._reference; - invariant(ref, 'missing package ref ' + pkg.name); - - if (pkg.bundleDependencies) { - var _loop4 = function* _loop4(depName) { - var locs = ref.locations.map(function (loc) { - return path.join(loc, _this4.config.getFolder(pkg), depName); - }); - var locsExist = yield (_promise || _load_promise()).default.all(locs.map(function (loc) { - return (_fs || _load_fs()).exists(loc); - })); - if (locsExist.some(function (e) { - return !e; - })) { - //if any of the locs do not exist - var pkgHuman = `${pkg.name}@${pkg.version}`; - _this4.reporter.warn(_this4.reporter.lang('missingBundledDependency', pkgHuman, depName)); - } - }; - - for (var _iterator25 = pkg.bundleDependencies, _isArray25 = Array.isArray(_iterator25), _i25 = 0, _iterator25 = _isArray25 ? _iterator25 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator25);;) { - var _ref46; - - if (_isArray25) { - if (_i25 >= _iterator25.length) break; - _ref46 = _iterator25[_i25++]; - } else { - _i25 = _iterator25.next(); - if (_i25.done) break; - _ref46 = _i25.value; - } - - var depName = _ref46; - yield* _loop4(depName); - } - } - }); - - function _warnForMissingBundledDependencies(_x18) { - return _ref45.apply(this, arguments); - } - - return _warnForMissingBundledDependencies; - }(); - - PackageLinker.prototype._isUnplugged = function () { - var _ref47 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, ref) { - // If an unplugged folder exists for the specified package, we simply use it - if (yield (_fs || _load_fs()).exists(this.config.generatePackageUnpluggedPath(ref))) { - return true; - } - - // If the package has a postinstall script, we also unplug it (otherwise they would run into the cache) - if (!this.config.ignoreScripts && pkg.scripts && (pkg.scripts.preinstall || pkg.scripts.install || pkg.scripts.postinstall)) { - return true; - } - - // Check whether the user explicitly requested for the package to be unplugged - return this.unplugged.some(function (patternToUnplug) { - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(patternToUnplug), - name = _normalizePattern.name, - range = _normalizePattern.range, - hasVersion = _normalizePattern.hasVersion; - - var satisfiesSemver = hasVersion ? semver.satisfies(ref.version, range) : true; - return name === ref.name && satisfiesSemver; - }); - }); - - function _isUnplugged(_x19, _x20) { - return _ref47.apply(this, arguments); - } - - return _isUnplugged; - }(); - - PackageLinker.prototype.init = function () { - var _ref48 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) { - var _ref49 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, - linkDuplicates = _ref49.linkDuplicates, - ignoreOptional = _ref49.ignoreOptional; - - this.resolvePeerModules(); - yield this.copyModules(patterns, workspaceLayout, { linkDuplicates, ignoreOptional }); - - if (!this.config.plugnplayEnabled) { - yield (_fs || _load_fs()).unlink(`${this.config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`); - } - }); - - function init(_x21, _x22) { - return _ref48.apply(this, arguments); - } - - return init; - }(); - - return PackageLinker; -}(); - -exports.default = PackageLinker; - -/***/ }), -/* 201 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.clearLine = clearLine; -exports.toStartOfLine = toStartOfLine; -exports.writeOnNthLine = writeOnNthLine; -exports.clearNthLine = clearNthLine; - -var _tty; - -function _load_tty() { - return _tty = _interopRequireDefault(__webpack_require__(148)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var readline = __webpack_require__(186); - -var _require = __webpack_require__(36), - supportsColor = _require.supportsColor; - -var CLEAR_WHOLE_LINE = 0; -var CLEAR_RIGHT_OF_CURSOR = 1; - -function clearLine(stdout) { - if (!supportsColor) { - if (stdout instanceof (_tty || _load_tty()).default.WriteStream) { - if (stdout.columns > 0) { - stdout.write(`\r${' '.repeat(stdout.columns - 1)}`); - } - stdout.write(`\r`); - } - return; - } - - readline.clearLine(stdout, CLEAR_WHOLE_LINE); - readline.cursorTo(stdout, 0); -} - -function toStartOfLine(stdout) { - if (!supportsColor) { - stdout.write('\r'); - return; - } - - readline.cursorTo(stdout, 0); -} - -function writeOnNthLine(stdout, n, msg) { - if (!supportsColor) { - return; - } - - if (n == 0) { - readline.cursorTo(stdout, 0); - stdout.write(msg); - readline.clearLine(stdout, CLEAR_RIGHT_OF_CURSOR); - return; - } - readline.cursorTo(stdout, 0); - readline.moveCursor(stdout, 0, -n); - stdout.write(msg); - readline.clearLine(stdout, CLEAR_RIGHT_OF_CURSOR); - readline.cursorTo(stdout, 0); - readline.moveCursor(stdout, 0, n); -} - -function clearNthLine(stdout, n) { - if (!supportsColor) { - return; - } - - if (n == 0) { - clearLine(stdout); - return; - } - readline.cursorTo(stdout, 0); - readline.moveCursor(stdout, 0, -n); - readline.clearLine(stdout, CLEAR_WHOLE_LINE); - readline.moveCursor(stdout, 0, n); -} - -/***/ }), -/* 202 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _stringify; - -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(40)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -var _baseReporter; - -function _load_baseReporter() { - return _baseReporter = _interopRequireDefault(__webpack_require__(98)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var JSONReporter = function (_BaseReporter) { - (0, (_inherits2 || _load_inherits()).default)(JSONReporter, _BaseReporter); - - function JSONReporter(opts) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, JSONReporter); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseReporter.call(this, opts)); - - _this._activityId = 0; - _this._progressId = 0; - return _this; - } - - JSONReporter.prototype._dump = function _dump(type, data, error) { - var stdout = this.stdout; - if (error) { - stdout = this.stderr; - } - stdout.write(`${(0, (_stringify || _load_stringify()).default)({ type, data })}\n`); - }; - - JSONReporter.prototype._verbose = function _verbose(msg) { - this._dump('verbose', msg); - }; - - JSONReporter.prototype.list = function list(type, items, hints) { - this._dump('list', { type, items, hints }); - }; - - JSONReporter.prototype.tree = function tree(type, trees) { - this._dump('tree', { type, trees }); - }; - - JSONReporter.prototype.step = function step(current, total, message) { - this._dump('step', { message, current, total }); - }; - - JSONReporter.prototype.inspect = function inspect(value) { - this._dump('inspect', value); - }; - - JSONReporter.prototype.footer = function footer(showPeakMemory) { - this._dump('finished', this.getTotalTime()); - }; - - JSONReporter.prototype.log = function log(msg) { - this._dump('log', msg); - }; - - JSONReporter.prototype.command = function command(msg) { - this._dump('command', msg); - }; - - JSONReporter.prototype.table = function table(head, body) { - this._dump('table', { head, body }); - }; - - JSONReporter.prototype.success = function success(msg) { - this._dump('success', msg); - }; - - JSONReporter.prototype.error = function error(msg) { - this._dump('error', msg, true); - }; - - JSONReporter.prototype.warn = function warn(msg) { - this._dump('warning', msg, true); - }; - - JSONReporter.prototype.info = function info(msg) { - this._dump('info', msg); - }; - - JSONReporter.prototype.activitySet = function activitySet(total, workers) { - var _this2 = this; - - if (!this.isTTY || this.noProgress) { - return _BaseReporter.prototype.activitySet.call(this, total, workers); - } - - var id = this._activityId++; - this._dump('activitySetStart', { id, total, workers }); - - var spinners = []; - - var _loop = function _loop(i) { - var current = 0; - var header = ''; - - spinners.push({ - clear() {}, - setPrefix(_current, _header) { - current = _current; - header = _header; - }, - tick: function tick(msg) { - _this2._dump('activitySetTick', { - id, - header, - current, - worker: i, - message: msg - }); - }, - end() {} - }); - }; - - for (var i = 0; i < workers; i++) { - _loop(i); - } - - return { - spinners, - end: function end() { - _this2._dump('activitySetEnd', { id }); - } - }; - }; - - JSONReporter.prototype.activity = function activity() { - return this._activity({}); - }; - - JSONReporter.prototype._activity = function _activity(data) { - var _this3 = this; - - if (!this.isTTY || this.noProgress) { - return { - tick() {}, - end() {} - }; - } - - var id = this._activityId++; - this._dump('activityStart', (0, (_extends2 || _load_extends()).default)({ id }, data)); - - return { - tick: function tick(name) { - _this3._dump('activityTick', { id, name }); - }, - - end: function end() { - _this3._dump('activityEnd', { id }); - } - }; - }; - - JSONReporter.prototype.progress = function progress(total) { - var _this4 = this; - - if (this.noProgress) { - return function () { - // noop - }; - } - - var id = this._progressId++; - var current = 0; - this._dump('progressStart', { id, total }); - - return function () { - current++; - _this4._dump('progressTick', { id, current }); - - if (current === total) { - _this4._dump('progressFinish', { id }); - } - }; - }; - - JSONReporter.prototype.auditAction = function auditAction(recommendation) { - this._dump('auditAction', recommendation); - }; - - JSONReporter.prototype.auditAdvisory = function auditAdvisory(resolution, _auditAdvisory) { - this._dump('auditAdvisory', { resolution, advisory: _auditAdvisory }); - }; - - JSONReporter.prototype.auditSummary = function auditSummary(auditMetadata) { - this._dump('auditSummary', auditMetadata); - }; - - return JSONReporter; -}((_baseReporter || _load_baseReporter()).default); - -exports.default = JSONReporter; - -/***/ }), -/* 203 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.shouldUpdateLockfile = undefined; - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _semver; - -function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(27)); -} - -var _minimatch; - -function _load_minimatch() { - return _minimatch = _interopRequireDefault(__webpack_require__(169)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(51)); -} - -var _normalizePattern2; - -function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(52); -} - -var _parsePackagePath; - -function _load_parsePackagePath() { - return _parsePackagePath = _interopRequireDefault(__webpack_require__(319)); -} - -var _parsePackagePath2; - -function _load_parsePackagePath2() { - return _parsePackagePath2 = __webpack_require__(319); -} - -var _resolvers; - -function _load_resolvers() { - return _resolvers = __webpack_require__(75); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var DIRECTORY_SEPARATOR = '/'; -var GLOBAL_NESTED_DEP_PATTERN = '**/'; - -var ResolutionMap = function () { - function ResolutionMap(config) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ResolutionMap); - - this.resolutionsByPackage = (0, (_map || _load_map()).default)(); - this.config = config; - this.reporter = config.reporter; - this.delayQueue = new (_set || _load_set()).default(); - } - - ResolutionMap.prototype.init = function init() { - var resolutions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - for (var _globPattern in resolutions) { - var info = this.parsePatternInfo(_globPattern, resolutions[_globPattern]); - - if (info) { - var resolution = this.resolutionsByPackage[info.name] || []; - this.resolutionsByPackage[info.name] = [].concat(resolution, [info]); - } - } - }; - - ResolutionMap.prototype.addToDelayQueue = function addToDelayQueue(req) { - this.delayQueue.add(req); - }; - - ResolutionMap.prototype.parsePatternInfo = function parsePatternInfo(globPattern, range) { - if (!(0, (_parsePackagePath2 || _load_parsePackagePath2()).isValidPackagePath)(globPattern)) { - this.reporter.warn(this.reporter.lang('invalidResolutionName', globPattern)); - return null; - } - - var directories = (0, (_parsePackagePath || _load_parsePackagePath()).default)(globPattern); - var name = directories.pop(); - - if (!(_semver || _load_semver()).default.validRange(range) && !(0, (_resolvers || _load_resolvers()).getExoticResolver)(range)) { - this.reporter.warn(this.reporter.lang('invalidResolutionVersion', range)); - return null; - } - - // For legacy support of resolutions, replace `name` with `**/name` - if (name === globPattern) { - globPattern = `${GLOBAL_NESTED_DEP_PATTERN}${name}`; - } - - return { - name, - range, - globPattern, - pattern: `${name}@${range}` - }; - }; - - ResolutionMap.prototype.find = function find(reqPattern, parentNames) { - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(reqPattern), - name = _normalizePattern.name, - reqRange = _normalizePattern.range; - - var resolutions = this.resolutionsByPackage[name]; - - if (!resolutions) { - return ''; - } - - var modulePath = [].concat(parentNames, [name]).join(DIRECTORY_SEPARATOR); - - var _ref = resolutions.find(function (_ref2) { - var globPattern = _ref2.globPattern; - return (0, (_minimatch || _load_minimatch()).default)(modulePath, globPattern); - }) || {}, - pattern = _ref.pattern, - range = _ref.range; - - if (pattern) { - if ((_semver || _load_semver()).default.validRange(reqRange) && (_semver || _load_semver()).default.valid(range) && !(_semver || _load_semver()).default.satisfies(range, reqRange)) { - this.reporter.warn(this.reporter.lang('incompatibleResolutionVersion', pattern, reqPattern)); - } - } - - return pattern; - }; - - return ResolutionMap; -}(); - -exports.default = ResolutionMap; -var shouldUpdateLockfile = exports.shouldUpdateLockfile = function shouldUpdateLockfile(lockfileEntry, resolutionEntry) { - if (!lockfileEntry || !resolutionEntry) { - return false; - } - - return lockfileEntry.resolved !== resolutionEntry.remote.resolved; -}; - -/***/ }), -/* 204 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.FILE_PROTOCOL_PREFIX = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); + return _misc = __webpack_require__(18); } var _path; function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(1)); + return _path = __webpack_require__(376); } -var _invariant; +var _normalizeUrl; -function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(15)); +function _load_normalizeUrl() { + return _normalizeUrl = _interopRequireDefault(__webpack_require__(401)); } -var _uuid; +var _userHomeDir; -function _load_uuid() { - return _uuid = _interopRequireDefault(__webpack_require__(113)); +function _load_userHomeDir() { + return _userHomeDir = _interopRequireDefault(__webpack_require__(66)); +} + +var _userHomeDir2; + +function _load_userHomeDir2() { + return _userHomeDir2 = __webpack_require__(66); } var _errors; function _load_errors() { - return _errors = __webpack_require__(6); + return _errors = __webpack_require__(5); } -var _exoticResolver; +var _login; -function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(85)); +function _load_login() { + return _login = __webpack_require__(107); } -var _misc; +var _path2; -function _load_misc() { - return _misc = _interopRequireWildcard(__webpack_require__(28)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var FILE_PROTOCOL_PREFIX = exports.FILE_PROTOCOL_PREFIX = 'file:'; - -var FileResolver = function (_ExoticResolver) { - (0, (_inherits2 || _load_inherits()).default)(FileResolver, _ExoticResolver); - - function FileResolver(request, fragment) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, FileResolver); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment)); - - _this.loc = (_misc || _load_misc()).removePrefix(fragment, FILE_PROTOCOL_PREFIX); - return _this; - } - - FileResolver.isVersion = function isVersion(pattern) { - return _ExoticResolver.isVersion.call(this, pattern) || this.prefixMatcher.test(pattern) || (_path || _load_path()).default.isAbsolute(pattern); - }; - - FileResolver.prototype.resolve = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _this2 = this; - - var loc = this.loc; - if (!(_path || _load_path()).default.isAbsolute(loc)) { - loc = (_path || _load_path()).default.resolve(this.config.lockfileFolder, loc); - } - - if (this.config.linkFileDependencies) { - var _registry = 'npm'; - var _manifest = { _uid: '', name: '', version: '0.0.0', _registry: _registry }; - _manifest._remote = { - type: 'link', - registry: _registry, - hash: null, - reference: loc - }; - _manifest._uid = _manifest.version; - return _manifest; - } - if (!(yield (_fs || _load_fs()).exists(loc))) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('doesntExist', loc, this.pattern.split('@')[0])); - } - - var manifest = yield (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - try { - return yield _this2.config.readManifest(loc, _this2.registry); - } catch (e) { - if (e.code === 'ENOENT') { - return { - // This is just the default, it can be overridden with key of dependencies - name: (_path || _load_path()).default.dirname(loc), - version: '0.0.0', - _uid: '0.0.0', - _registry: 'npm' - }; - } - - throw e; - } - })(); - var registry = manifest._registry; - (0, (_invariant || _load_invariant()).default)(registry, 'expected registry'); - - manifest._remote = { - type: 'copy', - registry, - hash: `${(_uuid || _load_uuid()).default.v4()}-${new Date().getTime()}`, - reference: loc - }; - - manifest._uid = manifest.version; - - return manifest; - }); - - function resolve() { - return _ref.apply(this, arguments); - } - - return resolve; - }(); - - return FileResolver; -}((_exoticResolver || _load_exoticResolver()).default); - -FileResolver.protocol = 'file'; -FileResolver.prefixMatcher = /^\.{1,2}\//; -exports.default = FileResolver; - -/***/ }), -/* 205 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -exports.explodeGistFragment = explodeGistFragment; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _gitResolver; - -function _load_gitResolver() { - return _gitResolver = _interopRequireDefault(__webpack_require__(118)); -} - -var _exoticResolver; - -function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(85)); -} - -var _misc; - -function _load_misc() { - return _misc = _interopRequireWildcard(__webpack_require__(28)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function explodeGistFragment(fragment, reporter) { - fragment = (_misc || _load_misc()).removePrefix(fragment, 'gist:'); - - var parts = fragment.split('#'); - - if (parts.length <= 2) { - return { - id: parts[0], - hash: parts[1] || '' - }; - } else { - throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidGistFragment', fragment)); - } -} - -var GistResolver = function (_ExoticResolver) { - (0, (_inherits2 || _load_inherits()).default)(GistResolver, _ExoticResolver); - - function GistResolver(request, fragment) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GistResolver); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment)); - - var _explodeGistFragment = explodeGistFragment(fragment, _this.reporter), - id = _explodeGistFragment.id, - hash = _explodeGistFragment.hash; - - _this.id = id; - _this.hash = hash; - return _this; - } - - GistResolver.prototype.resolve = function resolve() { - return this.fork((_gitResolver || _load_gitResolver()).default, false, `https://gist.github.com/${this.id}.git#${this.hash}`); - }; - - return GistResolver; -}((_exoticResolver || _load_exoticResolver()).default); - -GistResolver.protocol = 'gist'; -exports.default = GistResolver; - -/***/ }), -/* 206 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -var _cache; - -function _load_cache() { - return _cache = __webpack_require__(297); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _registryResolver; - -function _load_registryResolver() { - return _registryResolver = _interopRequireDefault(__webpack_require__(563)); -} - -var _npmRegistry; - -function _load_npmRegistry() { - return _npmRegistry = _interopRequireDefault(__webpack_require__(84)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(51)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(13); -} - -var _packageNameUtils; - -function _load_packageNameUtils() { - return _packageNameUtils = __webpack_require__(210); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var inquirer = __webpack_require__(195); -var tty = __webpack_require__(148); -var path = __webpack_require__(1); -var semver = __webpack_require__(27); -var ssri = __webpack_require__(93); - -var NPM_REGISTRY_ID = 'npm'; - -var NpmResolver = function (_RegistryResolver) { - (0, (_inherits2 || _load_inherits()).default)(NpmResolver, _RegistryResolver); - - function NpmResolver() { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NpmResolver); - return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _RegistryResolver.apply(this, arguments)); - } - - NpmResolver.findVersionInRegistryResponse = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, name, range, body, request) { - if (body.versions && (0, (_keys || _load_keys()).default)(body.versions).length === 0) { - throw new (_errors || _load_errors()).MessageError(config.reporter.lang('registryNoVersions', body.name)); - } - - if (!body['dist-tags'] || !body.versions) { - throw new (_errors || _load_errors()).MessageError(config.reporter.lang('malformedRegistryResponse', name)); - } - - if (range in body['dist-tags']) { - range = body['dist-tags'][range]; - } - - // If the latest tag in the registry satisfies the requested range, then use that. - // Otherwise we will fall back to semver maxSatisfying. - // This mimics logic in NPM. See issue #3560 - var latestVersion = body['dist-tags'] ? body['dist-tags'].latest : undefined; - if (latestVersion && semver.satisfies(latestVersion, range)) { - return body.versions[latestVersion]; - } - - var satisfied = yield config.resolveConstraints((0, (_keys || _load_keys()).default)(body.versions), range); - if (satisfied) { - return body.versions[satisfied]; - } else if (request && !config.nonInteractive) { - if (request.resolver && request.resolver.activity) { - request.resolver.activity.end(); - } - config.reporter.log(config.reporter.lang('couldntFindVersionThatMatchesRange', body.name, range)); - var pageSize = void 0; - if (process.stdout instanceof tty.WriteStream) { - pageSize = process.stdout.rows - 2; - } - var response = yield inquirer.prompt([{ - name: 'package', - type: 'list', - message: config.reporter.lang('chooseVersionFromList', body.name), - choices: semver.rsort((0, (_keys || _load_keys()).default)(body.versions)), - pageSize - }]); - if (response && response.package) { - return body.versions[response.package]; - } - } - throw new (_errors || _load_errors()).MessageError(config.reporter.lang('couldntFindVersionThatMatchesRange', body.name, range)); - }); - - function findVersionInRegistryResponse(_x, _x2, _x3, _x4, _x5) { - return _ref.apply(this, arguments); - } - - return findVersionInRegistryResponse; - }(); - - NpmResolver.prototype.resolveRequest = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (desiredVersion) { - if (this.config.offline) { - var res = yield this.resolveRequestOffline(); - if (res != null) { - return res; - } - } - - var escapedName = (_npmRegistry || _load_npmRegistry()).default.escapeName(this.name); - var desiredRange = desiredVersion || this.range; - var body = yield this.config.registries.npm.request(escapedName); - - if (body) { - return NpmResolver.findVersionInRegistryResponse(this.config, escapedName, desiredRange, body, this.request); - } else { - return null; - } - }); - - function resolveRequest(_x6) { - return _ref2.apply(this, arguments); - } - - return resolveRequest; - }(); - - NpmResolver.prototype.resolveRequestOffline = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _this2 = this; - - var packageDirs = yield this.config.getCache('cachedPackages', function () { - return (0, (_cache || _load_cache()).getCachedPackagesDirs)(_this2.config, _this2.config.cacheFolder); - }); - - var versions = (0, (_map || _load_map()).default)(); - - for (var _iterator = packageDirs, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref4; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref4 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref4 = _i.value; - } - - var dir = _ref4; - - // check if folder contains the registry prefix - if (dir.indexOf(`${NPM_REGISTRY_ID}-`) === -1) { - continue; - } - - // read manifest and validate correct name - var pkg = yield this.config.readManifest(dir, NPM_REGISTRY_ID); - if (pkg.name !== this.name) { - continue; - } - - // read package metadata - var metadata = yield this.config.readPackageMetadata(dir); - if (!metadata.remote) { - continue; // old yarn metadata - } - - versions[pkg.version] = (0, (_assign || _load_assign()).default)({}, pkg, { - _remote: metadata.remote - }); - } - - var satisfied = yield this.config.resolveConstraints((0, (_keys || _load_keys()).default)(versions), this.range); - if (satisfied) { - return versions[satisfied]; - } else if (!this.config.preferOffline) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('couldntFindPackageInCache', this.name, this.range, (0, (_keys || _load_keys()).default)(versions).join(', '))); - } else { - return null; - } - }); - - function resolveRequestOffline() { - return _ref3.apply(this, arguments); - } - - return resolveRequestOffline; - }(); - - NpmResolver.prototype.cleanRegistry = function cleanRegistry(url) { - if (this.config.getOption('registry') === (_constants || _load_constants()).YARN_REGISTRY) { - return url.replace((_constants || _load_constants()).NPM_REGISTRY_RE, (_constants || _load_constants()).YARN_REGISTRY); - } else { - return url; - } - }; - - NpmResolver.prototype.resolve = function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // lockfile - var shrunk = this.request.getLocked('tarball'); - if (shrunk) { - if (this.config.packBuiltPackages && shrunk.prebuiltVariants && shrunk._remote) { - var prebuiltVariants = shrunk.prebuiltVariants; - var prebuiltName = (0, (_packageNameUtils || _load_packageNameUtils()).getPlatformSpecificPackageFilename)(shrunk); - var offlineMirrorPath = this.config.getOfflineMirrorPath(); - if (prebuiltVariants[prebuiltName] && offlineMirrorPath) { - var filename = path.join(offlineMirrorPath, 'prebuilt', prebuiltName + '.tgz'); - var _remote = shrunk._remote; - - if (_remote && (yield (_fs || _load_fs()).exists(filename))) { - _remote.reference = `file:${filename}`; - _remote.hash = prebuiltVariants[prebuiltName]; - _remote.integrity = ssri.fromHex(_remote.hash, 'sha1').toString(); - } - } - } - } - if (shrunk && shrunk._remote && (shrunk._remote.integrity || this.config.offline || !this.config.autoAddIntegrity)) { - // if the integrity field does not exist, we're not network-restricted, and the - // migration hasn't been disabled, it needs to be created - return shrunk; - } - - var desiredVersion = shrunk && shrunk.version ? shrunk.version : null; - var info = yield this.resolveRequest(desiredVersion); - if (info == null) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('packageNotFoundRegistry', this.name, NPM_REGISTRY_ID)); - } - - var deprecated = info.deprecated, - dist = info.dist; - - if (shrunk && shrunk._remote) { - shrunk._remote.integrity = dist && dist.integrity ? ssri.parse(dist.integrity) : ssri.fromHex(dist && dist.shasum ? dist.shasum : '', 'sha1'); - return shrunk; - } - - if (typeof deprecated === 'string') { - var human = `${info.name}@${info.version}`; - var parentNames = this.request.parentNames; - if (parentNames.length) { - human = parentNames.concat(human).join(' > '); - } - this.reporter.warn(`${human}: ${deprecated}`); - } - - if (dist != null && dist.tarball) { - info._remote = { - resolved: `${this.cleanRegistry(dist.tarball)}#${dist.shasum}`, - type: 'tarball', - reference: this.cleanRegistry(dist.tarball), - hash: dist.shasum, - integrity: dist.integrity ? ssri.parse(dist.integrity) : ssri.fromHex(dist.shasum, 'sha1'), - registry: NPM_REGISTRY_ID, - packageName: info.name - }; - } - - info._uid = info.version; - - return info; - }); - - function resolve() { - return _ref5.apply(this, arguments); - } - - return resolve; - }(); - - return NpmResolver; -}((_registryResolver || _load_registryResolver()).default); - -NpmResolver.registry = NPM_REGISTRY_ID; -exports.default = NpmResolver; - -/***/ }), -/* 207 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _from; - -function _load_from() { - return _from = _interopRequireDefault(__webpack_require__(53)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _invariant; - -function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(15)); -} - -var _string_decoder; - -function _load_string_decoder() { - return _string_decoder = __webpack_require__(272); -} - -var _tarFs; - -function _load_tarFs() { - return _tarFs = _interopRequireDefault(__webpack_require__(183)); -} - -var _tarStream; - -function _load_tarStream() { - return _tarStream = _interopRequireDefault(__webpack_require__(431)); +function _load_path2() { + return _path2 = _interopRequireDefault(__webpack_require__(0)); } var _url; function _load_url() { - return _url = _interopRequireDefault(__webpack_require__(29)); + return _url = _interopRequireDefault(__webpack_require__(24)); } -var _fs; +var _ini; -function _load_fs() { - return _fs = __webpack_require__(12); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _gitSpawn; - -function _load_gitSpawn() { - return _gitSpawn = __webpack_require__(316); -} - -var _gitRefResolver; - -function _load_gitRefResolver() { - return _gitRefResolver = __webpack_require__(570); -} - -var _crypto; - -function _load_crypto() { - return _crypto = _interopRequireWildcard(__webpack_require__(158)); -} - -var _fs2; - -function _load_fs2() { - return _fs2 = _interopRequireWildcard(__webpack_require__(8)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(51)); -} - -var _misc; - -function _load_misc() { - return _misc = __webpack_require__(28); +function _load_ini() { + return _ini = _interopRequireDefault(__webpack_require__(684)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var GIT_PROTOCOL_PREFIX = 'git+'; +const DEFAULT_REGISTRY = 'https://registry.npmjs.org/'; +const REGEX_REGISTRY_ENFORCED_HTTPS = /^https?:\/\/([^\/]+\.)?(yarnpkg\.com|npmjs\.(org|com))(\/|$)/; +const REGEX_REGISTRY_HTTP_PROTOCOL = /^https?:/i; +const REGEX_REGISTRY_PREFIX = /^(https?:)?\/\//i; +const REGEX_REGISTRY_SUFFIX = /registry\/?$/; -var SSH_PROTOCOL = 'ssh:'; -var SCP_PATH_PREFIX = '/:'; -var FILE_PROTOCOL = 'file:'; -var GIT_VALID_REF_LINE_REGEXP = /^([a-fA-F0-9]+|ref)/; +const SCOPE_SEPARATOR = exports.SCOPE_SEPARATOR = '%2f'; +// All scoped package names are of the format `@scope%2fpkg` from the use of NpmRegistry.escapeName +// `(?:^|\/)` Match either the start of the string or a `/` but don't capture +// `[^\/?]+?` Match any character that is not '/' or '?' and capture, up until the first occurrence of: +// `(?=%2f|\/)` Match SCOPE_SEPARATOR, the escaped '/', or a raw `/` and don't capture +// The reason for matching a plain `/` is NPM registry being inconsistent about escaping `/` in +// scoped package names: when you're fetching a tarball, it is not escaped, when you want info +// about the package, it is escaped. +const SCOPED_PKG_REGEXP = /(?:^|\/)(@[^\/?]+?)(?=%2f|\/)/; -var validRef = function validRef(line) { - return GIT_VALID_REF_LINE_REGEXP.exec(line); -}; +// TODO: Use the method from src/cli/commands/global.js for this instead +function getGlobalPrefix() { + if (process.env.PREFIX) { + return process.env.PREFIX; + } else if (process.platform === 'win32') { + // c:\node\node.exe --> prefix=c:\node\ + return (_path2 || _load_path2()).default.dirname(process.execPath); + } else { + // /usr/local/bin/node --> prefix=/usr/local + let prefix = (_path2 || _load_path2()).default.dirname((_path2 || _load_path2()).default.dirname(process.execPath)); -var supportsArchiveCache = (0, (_map || _load_map()).default)({ - 'github.com': false // not support, doubt they will ever support it -}); + // destdir only is respected on Unix + if (process.env.DESTDIR) { + prefix = (_path2 || _load_path2()).default.join(process.env.DESTDIR, prefix); + } -var handleSpawnError = function handleSpawnError(err) { - if (err instanceof (_errors || _load_errors()).ProcessSpawnError) { - throw err; + return prefix; } -}; - -var SHORTHAND_SERVICES = (0, (_map || _load_map()).default)({ - 'github:': function github(parsedUrl) { - return (0, (_extends2 || _load_extends()).default)({}, parsedUrl, { - slashes: true, - auth: 'git', - protocol: SSH_PROTOCOL, - host: 'github.com', - hostname: 'github.com', - pathname: `/${parsedUrl.hostname}${parsedUrl.pathname}` - }); - }, - 'bitbucket:': function bitbucket(parsedUrl) { - return (0, (_extends2 || _load_extends()).default)({}, parsedUrl, { - slashes: true, - auth: 'git', - protocol: SSH_PROTOCOL, - host: 'bitbucket.com', - hostname: 'bitbucket.com', - pathname: `/${parsedUrl.hostname}${parsedUrl.pathname}` - }); - } -}); - -var Git = function () { - function Git(config, gitUrl, hash) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Git); - - this.supportsArchive = false; - this.fetched = false; - this.config = config; - this.reporter = config.reporter; - this.hash = hash; - this.ref = hash; - this.gitUrl = gitUrl; - this.cwd = this.config.getTemp((_crypto || _load_crypto()).hash(this.gitUrl.repository)); - } - - /** - * npm URLs contain a 'git+' scheme prefix, which is not understood by git. - * git "URLs" also allow an alternative scp-like syntax, so they're not standard URLs. - */ - Git.npmUrlToGitUrl = function npmUrlToGitUrl(npmUrl) { - npmUrl = (0, (_misc || _load_misc()).removePrefix)(npmUrl, GIT_PROTOCOL_PREFIX); - - var parsed = (_url || _load_url()).default.parse(npmUrl); - var expander = parsed.protocol && SHORTHAND_SERVICES[parsed.protocol]; - - if (expander) { - parsed = expander(parsed); - } - - // Special case in npm, where ssh:// prefix is stripped to pass scp-like syntax - // which in git works as remote path only if there are no slashes before ':'. - // See #3146. - if (parsed.protocol === SSH_PROTOCOL && parsed.hostname && parsed.path && parsed.path.startsWith(SCP_PATH_PREFIX) && parsed.port === null) { - var auth = parsed.auth ? parsed.auth + '@' : ''; - var pathname = parsed.path.slice(SCP_PATH_PREFIX.length); - return { - hostname: parsed.hostname, - protocol: parsed.protocol, - repository: `${auth}${parsed.hostname}:${pathname}` - }; - } - - // git local repos are specified as `git+file:` and a filesystem path, not a url. - var repository = void 0; - if (parsed.protocol === FILE_PROTOCOL) { - repository = parsed.path; - } else { - repository = (_url || _load_url()).default.format((0, (_extends2 || _load_extends()).default)({}, parsed, { hash: '' })); - } - - return { - hostname: parsed.hostname || null, - protocol: parsed.protocol || FILE_PROTOCOL, - repository: repository || '' - }; - }; - - /** - * Check if the host specified in the input `gitUrl` has archive capability. - */ - - Git.hasArchiveCapability = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref) { - var hostname = ref.hostname; - if (ref.protocol !== 'ssh:' || hostname == null) { - return false; - } - - if (hostname in supportsArchiveCache) { - return supportsArchiveCache[hostname]; - } - - try { - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${ref.repository}`, 'HEAD', Date.now() + '']); - throw new Error(); - } catch (err) { - handleSpawnError(err); - var supports = err.message.indexOf('did not match any files') >= 0; - return supportsArchiveCache[hostname] = supports; - } - }); - - function hasArchiveCapability(_x) { - return _ref.apply(this, arguments); - } - - return hasArchiveCapability; - }(); - - /** - * Check if the input `target` is a 5-40 character hex commit hash. - */ - - Git.repoExists = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref) { - var isLocal = ref.protocol === FILE_PROTOCOL; - - try { - if (isLocal) { - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show-ref', '-t'], { cwd: ref.repository }); - } else { - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '-t', ref.repository]); - } - return true; - } catch (err) { - handleSpawnError(err); - return false; - } - }); - - function repoExists(_x2) { - return _ref2.apply(this, arguments); - } - - return repoExists; - }(); - - Git.replaceProtocol = function replaceProtocol(ref, protocol) { - return { - hostname: ref.hostname, - protocol, - repository: ref.repository.replace(/^(?:git|http):/, protocol) - }; - }; - - /** - * Attempt to upgrade insecure protocols to secure protocol - */ - - - Git.secureGitUrl = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref, hash, reporter) { - if ((0, (_gitRefResolver || _load_gitRefResolver()).isCommitSha)(hash)) { - // this is cryptographically secure - return ref; - } - - if (ref.protocol === 'git:') { - var secureUrl = Git.replaceProtocol(ref, 'https:'); - if (yield Git.repoExists(secureUrl)) { - return secureUrl; - } else { - reporter.warn(reporter.lang('downloadGitWithoutCommit', ref.repository)); - return ref; - } - } - - if (ref.protocol === 'http:') { - var secureRef = Git.replaceProtocol(ref, 'https:'); - if (yield Git.repoExists(secureRef)) { - return secureRef; - } else { - reporter.warn(reporter.lang('downloadHTTPWithoutCommit', ref.repository)); - return ref; - } - } - - return ref; - }); - - function secureGitUrl(_x3, _x4, _x5) { - return _ref3.apply(this, arguments); - } - - return secureGitUrl; - }(); - - /** - * Archive a repo to destination - */ - - Git.prototype.archive = function archive(dest) { - if (this.supportsArchive) { - return this._archiveViaRemoteArchive(dest); - } else { - return this._archiveViaLocalFetched(dest); - } - }; - - Git.prototype._archiveViaRemoteArchive = function () { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) { - var hashStream = new (_crypto || _load_crypto()).HashStream(); - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${this.gitUrl.repository}`, this.ref], { - process(proc, resolve, reject, done) { - var writeStream = (0, (_fs || _load_fs()).createWriteStream)(dest); - proc.on('error', reject); - writeStream.on('error', reject); - writeStream.on('end', done); - writeStream.on('open', function () { - proc.stdout.pipe(hashStream).pipe(writeStream); - }); - writeStream.once('finish', done); - } - }); - return hashStream.getHash(); - }); - - function _archiveViaRemoteArchive(_x6) { - return _ref4.apply(this, arguments); - } - - return _archiveViaRemoteArchive; - }(); - - Git.prototype._archiveViaLocalFetched = function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) { - var hashStream = new (_crypto || _load_crypto()).HashStream(); - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', this.hash], { - cwd: this.cwd, - process(proc, resolve, reject, done) { - var writeStream = (0, (_fs || _load_fs()).createWriteStream)(dest); - proc.on('error', reject); - writeStream.on('error', reject); - writeStream.on('open', function () { - proc.stdout.pipe(hashStream).pipe(writeStream); - }); - writeStream.once('finish', done); - } - }); - return hashStream.getHash(); - }); - - function _archiveViaLocalFetched(_x7) { - return _ref5.apply(this, arguments); - } - - return _archiveViaLocalFetched; - }(); - - /** - * Clone a repo to the input `dest`. Use `git archive` if it's available, otherwise fall - * back to `git clone`. - */ - - Git.prototype.clone = function clone(dest) { - if (this.supportsArchive) { - return this._cloneViaRemoteArchive(dest); - } else { - return this._cloneViaLocalFetched(dest); - } - }; - - Git.prototype._cloneViaRemoteArchive = function () { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) { - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${this.gitUrl.repository}`, this.ref], { - process(proc, update, reject, done) { - var extractor = (_tarFs || _load_tarFs()).default.extract(dest, { - dmode: 0o555, // all dirs should be readable - fmode: 0o444 // all files should be readable - }); - extractor.on('error', reject); - extractor.on('finish', done); - - proc.stdout.pipe(extractor); - proc.on('error', reject); - } - }); - }); - - function _cloneViaRemoteArchive(_x8) { - return _ref6.apply(this, arguments); - } - - return _cloneViaRemoteArchive; - }(); - - Git.prototype._cloneViaLocalFetched = function () { - var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) { - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', this.hash], { - cwd: this.cwd, - process(proc, resolve, reject, done) { - var extractor = (_tarFs || _load_tarFs()).default.extract(dest, { - dmode: 0o555, // all dirs should be readable - fmode: 0o444 // all files should be readable - }); - - extractor.on('error', reject); - extractor.on('finish', done); - - proc.stdout.pipe(extractor); - } - }); - }); - - function _cloneViaLocalFetched(_x9) { - return _ref7.apply(this, arguments); - } - - return _cloneViaLocalFetched; - }(); - - /** - * Clone this repo. - */ - - Git.prototype.fetch = function fetch() { - var _this = this; - - var gitUrl = this.gitUrl, - cwd = this.cwd; - - - return (_fs2 || _load_fs2()).lockQueue.push(gitUrl.repository, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (yield (_fs2 || _load_fs2()).exists(cwd)) { - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['fetch', '--tags'], { cwd }); - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['pull'], { cwd }); - } else { - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['clone', gitUrl.repository, cwd]); - } - - _this.fetched = true; - })); - }; - - /** - * Fetch the file by cloning the repo and reading it. - */ - - Git.prototype.getFile = function getFile(filename) { - if (this.supportsArchive) { - return this._getFileFromArchive(filename); - } else { - return this._getFileFromClone(filename); - } - }; - - Git.prototype._getFileFromArchive = function () { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename) { - try { - return yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${this.gitUrl.repository}`, this.ref, filename], { - process(proc, update, reject, done) { - var parser = (_tarStream || _load_tarStream()).default.extract(); - - parser.on('error', reject); - parser.on('finish', done); - - parser.on('entry', function (header, stream, next) { - var decoder = new (_string_decoder || _load_string_decoder()).StringDecoder('utf8'); - var fileContent = ''; - - stream.on('data', function (buffer) { - fileContent += decoder.write(buffer); - }); - stream.on('end', function () { - var remaining = decoder.end(); - update(fileContent + remaining); - next(); - }); - stream.resume(); - }); - - proc.stdout.pipe(parser); - } - }); - } catch (err) { - if (err.message.indexOf('did not match any files') >= 0) { - return false; - } else { - throw err; - } - } - }); - - function _getFileFromArchive(_x10) { - return _ref9.apply(this, arguments); - } - - return _getFileFromArchive; - }(); - - Git.prototype._getFileFromClone = function () { - var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename) { - (0, (_invariant || _load_invariant()).default)(this.fetched, 'Repo not fetched'); - - try { - return yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show', `${this.hash}:${filename}`], { - cwd: this.cwd - }); - } catch (err) { - handleSpawnError(err); - // file doesn't exist - return false; - } - }); - - function _getFileFromClone(_x11) { - return _ref10.apply(this, arguments); - } - - return _getFileFromClone; - }(); - - /** - * Initialize the repo, find a secure url to use and - * set the ref to match an input `target`. - */ - - - Git.prototype.init = function () { - var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - this.gitUrl = yield Git.secureGitUrl(this.gitUrl, this.hash, this.reporter); - - yield this.setRefRemote(); - - // check capabilities - if (this.ref !== '' && (yield Git.hasArchiveCapability(this.gitUrl))) { - this.supportsArchive = true; - } else { - yield this.fetch(); - } - - return this.hash; - }); - - function init() { - return _ref11.apply(this, arguments); - } - - return init; - }(); - - Git.prototype.setRefRemote = function () { - var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var isLocal = this.gitUrl.protocol === FILE_PROTOCOL; - var stdout = void 0; - - if (isLocal) { - stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show-ref', '--tags', '--heads'], { cwd: this.gitUrl.repository }); - } else { - stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--tags', '--heads', this.gitUrl.repository]); - } - - var refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(stdout); - return this.setRef(refs); - }); - - function setRefRemote() { - return _ref12.apply(this, arguments); - } - - return setRefRemote; - }(); - - Git.prototype.setRefHosted = function setRefHosted(hostedRefsList) { - var refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(hostedRefsList); - return this.setRef(refs); - }; - - /** - * Resolves the default branch of a remote repository (not always "master") - */ - - Git.prototype.resolveDefaultBranch = function () { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var isLocal = this.gitUrl.protocol === FILE_PROTOCOL; - - try { - var stdout = void 0; - if (isLocal) { - stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show-ref', 'HEAD'], { cwd: this.gitUrl.repository }); - var refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(stdout); - var sha = refs.values().next().value; - if (sha) { - return { sha, ref: undefined }; - } else { - throw new Error('Unable to find SHA for git HEAD'); - } - } else { - stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--symref', this.gitUrl.repository, 'HEAD']); - var lines = stdout.split('\n').filter(validRef); - - var _lines$0$split = lines[0].split(/\s+/), - ref = _lines$0$split[1]; - - var _lines$1$split = lines[1].split(/\s+/), - _sha = _lines$1$split[0]; - - return { sha: _sha, ref }; - } - } catch (err) { - handleSpawnError(err); - // older versions of git don't support "--symref" - var _stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', this.gitUrl.repository, 'HEAD']); - var _lines = _stdout.split('\n').filter(validRef); - - var _lines$0$split2 = _lines[0].split(/\s+/), - _sha2 = _lines$0$split2[0]; - - return { sha: _sha2, ref: undefined }; - } - }); - - function resolveDefaultBranch() { - return _ref13.apply(this, arguments); - } - - return resolveDefaultBranch; - }(); - - /** - * Resolve a git commit to it's 40-chars format and ensure it exists in the repository - * We need to use the 40-chars format to avoid multiple folders in the cache - */ - - Git.prototype.resolveCommit = function () { - var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (shaToResolve) { - try { - yield this.fetch(); - var revListArgs = ['rev-list', '-n', '1', '--no-abbrev-commit', '--format=oneline', shaToResolve]; - var stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(revListArgs, { cwd: this.cwd }); - - var _stdout$split = stdout.split(/\s+/), - sha = _stdout$split[0]; - - return { sha, ref: undefined }; - } catch (err) { - handleSpawnError(err); - // assuming commit not found, let's try something else - return null; - } - }); - - function resolveCommit(_x12) { - return _ref14.apply(this, arguments); - } - - return resolveCommit; - }(); - - /** - * Resolves the input hash / ref / semver range to a valid commit sha - * If possible also resolves the sha to a valid ref in order to use "git archive" - */ - - Git.prototype.setRef = function () { - var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (refs) { - // get commit ref - var version = this.hash; - - - var resolvedResult = yield (0, (_gitRefResolver || _load_gitRefResolver()).resolveVersion)({ - config: this.config, - git: this, - version, - refs - }); - if (!resolvedResult) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('couldntFindMatch', version, (0, (_from || _load_from()).default)(refs.keys()).join(','), this.gitUrl.repository)); - } - - this.hash = resolvedResult.sha; - this.ref = resolvedResult.ref || ''; - return this.hash; - }); - - function setRef(_x13) { - return _ref15.apply(this, arguments); - } - - return setRef; - }(); - - return Git; -}(); - -exports.default = Git; - -/***/ }), -/* 208 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -var _resolveRelative; +const PATH_CONFIG_OPTIONS = new Set(['cache', 'cafile', 'prefix', 'userconfig']); -function _load_resolveRelative() { - return _resolveRelative = _interopRequireDefault(__webpack_require__(575)); +function isPathConfigOption(key) { + return PATH_CONFIG_OPTIONS.has(key); } -var _validate; - -function _load_validate() { - return _validate = _interopRequireDefault(__webpack_require__(119)); -} - -var _fix; - -function _load_fix() { - return _fix = _interopRequireDefault(__webpack_require__(572)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var path = __webpack_require__(1); - -exports.default = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (info, moduleLoc, config, isRoot) { - // create human readable name - var name = info.name, - version = info.version; - - var human = void 0; - if (typeof name === 'string') { - human = name; - } - if (human && typeof version === 'string' && version) { - human += `@${version}`; - } - if (isRoot && info._loc) { - human = path.relative(config.cwd, info._loc); - } - - function warn(msg) { - if (human) { - msg = `${human}: ${msg}`; - } - config.reporter.warn(msg); - } - - yield (0, (_fix || _load_fix()).default)(info, moduleLoc, config.reporter, warn, config.looseSemver); - (0, (_resolveRelative || _load_resolveRelative()).default)(info, moduleLoc, config.lockfileFolder); - - if (config.cwd === config.globalFolder) { - return info; - } - - try { - (0, (_validate || _load_validate()).default)(info, isRoot, config.reporter, warn); - } catch (err) { - if (human) { - err.message = `${human}: ${err.message}`; - } - throw err; - } - - return info; - }); - - return function (_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -/***/ }), -/* 209 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isValidLicense = isValidLicense; -exports.isValidBin = isValidBin; -exports.stringifyPerson = stringifyPerson; -exports.parsePerson = parsePerson; -exports.normalizePerson = normalizePerson; -exports.extractDescription = extractDescription; -exports.extractRepositoryUrl = extractRepositoryUrl; - - -var path = __webpack_require__(1); - -var validateLicense = __webpack_require__(1032); - -var PARENT_PATH = /^\.\.([\\\/]|$)/; - -function isValidLicense(license) { - return !!license && validateLicense(license).validForNewPackages; -} - -function isValidBin(bin) { - return !path.isAbsolute(bin) && !PARENT_PATH.test(path.normalize(bin)); -} - -function stringifyPerson(person) { - if (!person || typeof person !== 'object') { - return person; - } - - var parts = []; - if (person.name) { - parts.push(person.name); - } - - var email = person.email || person.mail; - if (typeof email === 'string') { - parts.push(`<${email}>`); - } - - var url = person.url || person.web; - if (typeof url === 'string') { - parts.push(`(${url})`); - } - - return parts.join(' '); -} - -function parsePerson(person) { - if (typeof person !== 'string') { - return person; - } - - // format: name (url) - var obj = {}; - - var name = person.match(/^([^\(<]+)/); - if (name) { - name = name[0].trim(); - if (name) { - obj.name = name; - } - } - - var email = person.match(/<([^>]+)>/); - if (email) { - obj.email = email[1]; - } - - var url = person.match(/\(([^\)]+)\)/); - if (url) { - obj.url = url[1]; - } - - return obj; -} - -function normalizePerson(person) { - return parsePerson(stringifyPerson(person)); -} - -function extractDescription(readme) { - if (typeof readme !== 'string' || readme === '') { +function normalizePath(val) { + if (val === undefined) { return undefined; } - // split into lines - var lines = readme.trim().split('\n').map(function (line) { - return line.trim(); - }); + if (typeof val !== 'string') { + val = String(val); + } - // find the start of the first paragraph, ignore headings - var start = 0; - for (; start < lines.length; start++) { - var line = lines[start]; - if (line && line.match(/^(#|$)/)) { - // line isn't empty and isn't a heading so this is the start of a paragraph - start++; - break; + return (0, (_path || _load_path()).resolveWithHome)(val); +} + +function urlParts(requestUrl) { + const normalizedUrl = (0, (_normalizeUrl || _load_normalizeUrl()).default)(requestUrl); + const parsed = (_url || _load_url()).default.parse(normalizedUrl); + const host = parsed.host || ''; + const path = parsed.path || ''; + return { host, path }; +} + +class NpmRegistry extends (_baseRegistry || _load_baseRegistry()).default { + constructor(cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles) { + super(cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles); + this.folder = 'node_modules'; + } + + static escapeName(name) { + // scoped packages contain slashes and the npm registry expects them to be escaped + return name.replace('/', SCOPE_SEPARATOR); + } + + isScopedPackage(packageIdent) { + return SCOPED_PKG_REGEXP.test(packageIdent); + } + + getRequestUrl(registry, pathname) { + let resolved = pathname; + + if (!REGEX_REGISTRY_PREFIX.test(pathname)) { + resolved = (_url || _load_url()).default.resolve((0, (_misc || _load_misc()).addSuffix)(registry, '/'), pathname); } + + if (REGEX_REGISTRY_ENFORCED_HTTPS.test(resolved)) { + resolved = resolved.replace(/^http:\/\//, 'https://'); + } + + return resolved; } - // skip newlines from the header to the first line - while (start < lines.length && !lines[start]) { - start++; + isRequestToRegistry(requestUrl, registryUrl) { + const request = urlParts(requestUrl); + const registry = urlParts(registryUrl); + const customHostSuffix = this.getRegistryOrGlobalOption(registryUrl, 'custom-host-suffix'); + + const requestToRegistryHost = request.host === registry.host; + const requestToYarn = (_constants || _load_constants()).YARN_REGISTRY.includes(request.host) && DEFAULT_REGISTRY.includes(registry.host); + const requestToRegistryPath = request.path.startsWith(registry.path); + // For some registries, the package path does not prefix with the registry path + const customHostSuffixInUse = typeof customHostSuffix === 'string' && request.host.endsWith(customHostSuffix); + + return (requestToRegistryHost || requestToYarn) && (requestToRegistryPath || customHostSuffixInUse); } - // continue to the first non empty line - var end = start; - while (end < lines.length && lines[end]) { - end++; + request(pathname, opts = {}, packageName) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // packageName needs to be escaped when if it is passed + const packageIdent = packageName && NpmRegistry.escapeName(packageName) || pathname; + const registry = opts.registry || _this.getRegistry(packageIdent); + const requestUrl = _this.getRequestUrl(registry, pathname); + + const alwaysAuth = _this.getRegistryOrGlobalOption(registry, 'always-auth'); + + const headers = (0, (_extends2 || _load_extends()).default)({ + Accept: + // This is to use less bandwidth unless we really need to get the full response. + // See https://github.com/npm/npm-registry-client#requests + opts.unfiltered ? 'application/json' : 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' + }, opts.headers); + + const isToRegistry = _this.isRequestToRegistry(requestUrl, registry) || _this.requestNeedsAuth(requestUrl); + + // this.token must be checked to account for publish requests on non-scoped packages + if (_this.token || isToRegistry && (alwaysAuth || _this.isScopedPackage(packageIdent))) { + const authorization = _this.getAuth(packageIdent); + if (authorization) { + headers.authorization = authorization; + } + } + + if (_this.otp) { + headers['npm-otp'] = _this.otp; + } + + try { + return yield _this.requestManager.request({ + url: requestUrl, + method: opts.method, + body: opts.body, + auth: opts.auth, + headers, + json: !opts.buffer, + buffer: opts.buffer, + process: opts.process, + gzip: true + }); + } catch (error) { + if (error instanceof (_errors || _load_errors()).OneTimePasswordError) { + if (_this.otp) { + throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('incorrectOneTimePassword')); + } + + _this.reporter.info(_this.reporter.lang('twoFactorAuthenticationEnabled')); + _this.otp = yield (0, (_login || _load_login()).getOneTimePassword)(_this.reporter); + + _this.requestManager.clearCache(); + + return _this.request(pathname, opts, packageName); + } else { + throw error; + } + } + })(); } - return lines.slice(start, end).join(' '); -} - -function extractRepositoryUrl(repository) { - if (!repository || typeof repository !== 'object') { - return repository; - } - return repository.url; + requestNeedsAuth(requestUrl) { + const config = this.config; + const requestParts = urlParts(requestUrl); + return !!Object.keys(config).find(option => { + const parts = option.split(':'); + if (parts.length === 2 && parts[1] === '_authToken' || parts[1] === '_password') { + const registryParts = urlParts(parts[0]); + if (requestParts.host === registryParts.host && requestParts.path.startsWith(registryParts.path)) { + return true; + } + } + return false; + }); + } + + checkOutdated(config, name, range) { + var _this2 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const escapedName = NpmRegistry.escapeName(name); + const req = yield _this2.request(escapedName, { unfiltered: true }); + if (!req) { + throw new Error(`couldn't find ${name}`); + } + + // By default use top level 'repository' and 'homepage' values + let repository = req.repository, + homepage = req.homepage; + + const wantedPkg = yield (_npmResolver || _load_npmResolver()).default.findVersionInRegistryResponse(config, escapedName, range, req); + + // But some local repositories like Verdaccio do not return 'repository' nor 'homepage' + // in top level data structure, so we fallback to wanted package manifest + if (!repository && !homepage) { + repository = wantedPkg.repository; + homepage = wantedPkg.homepage; + } + + let latest = req['dist-tags'].latest; + // In certain cases, registries do not return a 'latest' tag. + if (!latest) { + latest = wantedPkg.version; + } + + const url = homepage || repository && repository.url || ''; + + return { + latest, + wanted: wantedPkg.version, + url + }; + })(); + } + + getPossibleConfigLocations(filename, reporter) { + var _this3 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + let possibles = []; + + for (var _iterator = _this3.extraneousRcFiles.slice().reverse(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const rcFile = _ref; + + possibles.push([false, (_path2 || _load_path2()).default.resolve(process.cwd(), rcFile)]); + } + + if (_this3.enableDefaultRc) { + // npmrc --> ./.npmrc, ~/.npmrc, ${prefix}/etc/npmrc + const localfile = '.' + filename; + possibles = possibles.concat([[false, (_path2 || _load_path2()).default.join(_this3.cwd, localfile)], [true, _this3.config.userconfig || (_path2 || _load_path2()).default.join((_userHomeDir || _load_userHomeDir()).default, localfile)], [false, (_path2 || _load_path2()).default.join(getGlobalPrefix(), 'etc', filename)]]); + + // When home directory for global install is different from where $HOME/npmrc is stored, + // E.g. /usr/local/share vs /root on linux machines, check the additional location + if ((_userHomeDir2 || _load_userHomeDir2()).home !== (_userHomeDir || _load_userHomeDir()).default) { + possibles.push([true, (_path2 || _load_path2()).default.join((_userHomeDir2 || _load_userHomeDir2()).home, localfile)]); + } + + // npmrc --> ../.npmrc, ../../.npmrc, etc. + const foldersFromRootToCwd = (0, (_path || _load_path()).getPosixPath)(_this3.cwd).split('/'); + while (foldersFromRootToCwd.length > 1) { + possibles.push([false, (_path2 || _load_path2()).default.join(foldersFromRootToCwd.join((_path2 || _load_path2()).default.sep), localfile)]); + foldersFromRootToCwd.pop(); + } + } + + const actuals = []; + for (var _iterator2 = possibles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + const _ref2 = _ref3; + const isHome = _ref2[0]; + const loc = _ref2[1]; + + reporter.verbose(reporter.lang('configPossibleFile', loc)); + if (yield (_fs || _load_fs()).exists(loc)) { + reporter.verbose(reporter.lang('configFileFound', loc)); + actuals.push([isHome, loc, yield (_fs || _load_fs()).readFile(loc)]); + } + } + + return actuals; + })(); + } + + static getConfigEnv(env = process.env) { + // To match NPM's behavior, HOME is always the user's home directory. + const overrideEnv = { + HOME: (_userHomeDir2 || _load_userHomeDir2()).home + }; + return Object.assign({}, env, overrideEnv); + } + + static normalizeConfig(config) { + const env = NpmRegistry.getConfigEnv(); + config = (_baseRegistry || _load_baseRegistry()).default.normalizeConfig(config); + + for (const key in config) { + config[key] = (0, (_envReplace || _load_envReplace()).default)(config[key], env); + if (isPathConfigOption(key)) { + config[key] = normalizePath(config[key]); + } + } + + return config; + } + + loadConfig() { + var _this4 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // docs: https://docs.npmjs.com/misc/config + _this4.mergeEnv('npm_config_'); + + for (var _iterator3 = yield _this4.getPossibleConfigLocations('npmrc', _this4.reporter), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref5; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref5 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref5 = _i3.value; + } + + const _ref4 = _ref5; + const loc = _ref4[1]; + const file = _ref4[2]; + + const config = NpmRegistry.normalizeConfig((_ini || _load_ini()).default.parse(file)); + + // normalize offline mirror path relative to the current npmrc + const offlineLoc = config['yarn-offline-mirror']; + // don't normalize if we already have a mirror path + if (!_this4.config['yarn-offline-mirror'] && offlineLoc) { + const mirrorLoc = config['yarn-offline-mirror'] = (_path2 || _load_path2()).default.resolve((_path2 || _load_path2()).default.dirname(loc), offlineLoc); + yield (_fs || _load_fs()).mkdirp(mirrorLoc); + } + + _this4.config = Object.assign({}, config, _this4.config); + } + })(); + } + + getScope(packageIdent) { + const match = packageIdent.match(SCOPED_PKG_REGEXP); + return match && match[1] || ''; + } + + getRegistry(packageIdent) { + // Try extracting registry from the url, then scoped registry, and default registry + if (packageIdent.match(REGEX_REGISTRY_PREFIX)) { + const availableRegistries = this.getAvailableRegistries(); + const registry = availableRegistries.find(registry => packageIdent.startsWith(registry)); + if (registry) { + return String(registry); + } + } + + var _arr = [this.getScope(packageIdent), '']; + for (var _i4 = 0; _i4 < _arr.length; _i4++) { + const scope = _arr[_i4]; + const registry = this.getScopedOption(scope, 'registry') || this.registries.yarn.getScopedOption(scope, 'registry'); + if (registry) { + return String(registry); + } + } + + return DEFAULT_REGISTRY; + } + + getAuthByRegistry(registry) { + // Check for bearer token. + const authToken = this.getRegistryOrGlobalOption(registry, '_authToken'); + if (authToken) { + return `Bearer ${String(authToken)}`; + } + + // Check for basic auth token. + const auth = this.getRegistryOrGlobalOption(registry, '_auth'); + if (auth) { + return `Basic ${String(auth)}`; + } + + // Check for basic username/password auth. + const username = this.getRegistryOrGlobalOption(registry, 'username'); + const password = this.getRegistryOrGlobalOption(registry, '_password'); + if (username && password) { + const pw = Buffer.from(String(password), 'base64').toString(); + return 'Basic ' + Buffer.from(String(username) + ':' + pw).toString('base64'); + } + + return ''; + } + + getAuth(packageIdent) { + if (this.token) { + return this.token; + } + + const baseRegistry = this.getRegistry(packageIdent); + const registries = [baseRegistry]; + + // If sending a request to the Yarn registry, we must also send it the auth token for the npm registry + if (baseRegistry === (_constants || _load_constants()).YARN_REGISTRY) { + registries.push(DEFAULT_REGISTRY); + } + + for (var _iterator4 = registries, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref6; + + if (_isArray4) { + if (_i5 >= _iterator4.length) break; + _ref6 = _iterator4[_i5++]; + } else { + _i5 = _iterator4.next(); + if (_i5.done) break; + _ref6 = _i5.value; + } + + const registry = _ref6; + + const auth = this.getAuthByRegistry(registry); + + if (auth) { + return auth; + } + } + + return ''; + } + + getScopedOption(scope, option) { + return this.getOption(scope + (scope ? ':' : '') + option); + } + + getRegistryOption(registry, option) { + const pre = REGEX_REGISTRY_HTTP_PROTOCOL; + const suf = REGEX_REGISTRY_SUFFIX; + + // When registry is used config scope, the trailing '/' is required + const reg = (0, (_misc || _load_misc()).addSuffix)(registry, '/'); + + // 1st attempt, try to get option for the given registry URL + // 2nd attempt, remove the 'https?:' prefix of the registry URL + // 3nd attempt, remove the 'registry/?' suffix of the registry URL + return this.getScopedOption(reg, option) || pre.test(reg) && this.getRegistryOption(reg.replace(pre, ''), option) || suf.test(reg) && this.getRegistryOption(reg.replace(suf, ''), option); + } + + getRegistryOrGlobalOption(registry, option) { + return this.getRegistryOption(registry, option) || this.getOption(option); + } } +exports.default = NpmRegistry; +NpmRegistry.filename = 'package.json'; /***/ }), -/* 210 */ +/* 89 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51685,161 +33134,30 @@ function extractRepositoryUrl(repository) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.getPlatformSpecificPackageFilename = getPlatformSpecificPackageFilename; -exports.getSystemParams = getSystemParams; -function getPlatformSpecificPackageFilename(pkg) { - // TODO support hash for all subdependencies that have installs scripts - var normalizeScope = function normalizeScope(name) { - return name[0] === '@' ? name.substr(1).replace('/', '-') : name; - }; - var suffix = getSystemParams(); - return `${normalizeScope(pkg.name)}-v${pkg.version}-${suffix}`; -} -function getSystemParams() { - // TODO support platform variant for linux - return `${process.platform}-${process.arch}-${process.versions.modules || ''}`; -} +var _baseResolver; -/***/ }), -/* 211 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.satisfiesWithPrereleases = satisfiesWithPrereleases; -exports.diffWithUnstable = diffWithUnstable; - -var _semver; - -function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(27)); +function _load_baseResolver() { + return _baseResolver = _interopRequireDefault(__webpack_require__(123)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/** - * Returns whether the given semver version satisfies the given range. Notably this supports - * prerelease versions so that "2.0.0-rc.0" satisfies the range ">=1.0.0", for example. - */ +class ExoticResolver extends (_baseResolver || _load_baseResolver()).default { -function satisfiesWithPrereleases(version, range) { - var loose = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - var semverRange = void 0; - try { - // $FlowFixMe: Add a definition for the Range class - semverRange = new (_semver || _load_semver()).default.Range(range, loose); - } catch (err) { - return false; - } - - if (!version) { - return false; - } - var semverVersion = void 0; - try { - semverVersion = new (_semver || _load_semver()).default.SemVer(version, semverRange.loose); - } catch (err) { - return false; - } - - // A range has multiple sets of comparators. A version must satisfy all comparators in a set - // and at least one set to satisfy the range. - return semverRange.set.some(function (comparatorSet) { - // node-semver converts ~ and ^ ranges into pairs of >= and < ranges but the upper bounds don't - // properly exclude prerelease versions. For example, "^1.0.0" is converted to ">=1.0.0 <2.0.0", - // which includes "2.0.0-pre" since prerelease versions are lower than their non-prerelease - // counterparts. As a practical workaround we make upper-bound ranges exclude prereleases and - // convert "<2.0.0" to "<2.0.0-0", for example. - comparatorSet = comparatorSet.map(function (comparator) { - if (comparator.operator !== '<' || !comparator.value || comparator.semver.prerelease.length) { - return comparator; - } - - // "0" is the lowest prerelease version - comparator.semver.inc('pre', 0); - - var comparatorString = comparator.operator + comparator.semver.version; - // $FlowFixMe: Add a definition for the Comparator class - return new (_semver || _load_semver()).default.Comparator(comparatorString, comparator.loose); - }); - - return !comparatorSet.some(function (comparator) { - return !comparator.test(semverVersion); - }); - }); -} - -var PRE_RELEASES = { - major: 'premajor', - minor: 'preminor', - patch: 'prepatch' -}; - -/** - * Returns the difference between two versions as a semantic string representation. - * Similar to the `diff` method in node-semver, but it also accounts for unstable versions, - * like 0.x.x or 0.0.x. - */ - -function diffWithUnstable(version1, version2) { - if ((_semver || _load_semver()).default.eq(version1, version2) === false) { - var v1 = (_semver || _load_semver()).default.parse(version1); - var v2 = (_semver || _load_semver()).default.parse(version2); - - if (v1 != null && v2 != null) { - var isPreRelease = v1.prerelease.length > 0 || v2.prerelease.length > 0; - var preMajor = v1.major === 0 || v2.major === 0; - var preMinor = preMajor && (v1.minor === 0 || v2.minor === 0); - - var diff = null; - - if (v1.major !== v2.major) { - diff = 'major'; - } else if (v1.minor !== v2.minor) { - if (preMajor) { - // If the major version number is zero (0.x.x), treat a change - // of the minor version number as a major change. - diff = 'major'; - } else { - diff = 'minor'; - } - } else if (v1.patch !== v2.patch) { - if (preMinor) { - // If the major & minor version numbers are zero (0.0.x), treat a change - // of the patch version number as a major change. - diff = 'major'; - } else if (preMajor) { - // If the major version number is zero (0.x.x), treat a change - // of the patch version number as a minor change. - diff = 'minor'; - } else { - diff = 'patch'; - } - } - - if (isPreRelease) { - if (diff != null) { - diff = PRE_RELEASES[diff]; - } else { - diff = 'prerelease'; - } - } - - return diff; + static isVersion(pattern) { + const proto = this.protocol; + if (proto) { + return pattern.startsWith(`${proto}:`); + } else { + throw new Error('No protocol specified'); } } - - return null; } +exports.default = ExoticResolver; /***/ }), -/* 212 */ +/* 90 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51848,143 +33166,42 @@ function diffWithUnstable(version1, version2) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.explodeHashedUrl = explodeHashedUrl; -function explodeHashedUrl(url) { - var parts = url.split('#'); - return { - hash: parts[1] || '', - url: parts[0] - }; +var _normalizePattern2; + +function _load_normalizePattern() { + return _normalizePattern2 = __webpack_require__(37); } -/***/ }), -/* 213 */ -/***/ (function(module, exports, __webpack_require__) { +const semver = __webpack_require__(21); -module.exports = { "default": __webpack_require__(627), __esModule: true }; +class WorkspaceLayout { + constructor(workspaces, config) { + this.workspaces = workspaces; + this.config = config; + } -/***/ }), -/* 214 */ -/***/ (function(module, exports, __webpack_require__) { + getWorkspaceManifest(key) { + return this.workspaces[key]; + } -module.exports = { "default": __webpack_require__(630), __esModule: true }; + getManifestByPattern(pattern) { + var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern); -/***/ }), -/* 215 */ -/***/ (function(module, exports) { + const name = _normalizePattern.name, + range = _normalizePattern.range; -function Caseless (dict) { - this.dict = dict || {} -} -Caseless.prototype.set = function (name, value, clobber) { - if (typeof name === 'object') { - for (var i in name) { - this.set(i, name[i], value) + const workspace = this.getWorkspaceManifest(name); + if (!workspace || !semver.satisfies(workspace.manifest.version, range, this.config.looseSemver)) { + return null; } - } else { - if (typeof clobber === 'undefined') clobber = true - var has = this.has(name) - - if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value - else this.dict[has || name] = value - return has + return workspace; } } -Caseless.prototype.has = function (name) { - var keys = Object.keys(this.dict) - , name = name.toLowerCase() - ; - for (var i=0;i', - pointerSmall: '»', - info: 'i', - warning: '‼', - hamburger: '≡', - smiley: '☺', - mustache: '┌─┐', - heart: main.heart, - arrowUp: main.arrowUp, - arrowDown: main.arrowDown, - arrowLeft: main.arrowLeft, - arrowRight: main.arrowRight, - radioOn: '(*)', - radioOff: '( )', - checkboxOn: '[×]', - checkboxOff: '[ ]', - checkboxCircleOn: '(×)', - checkboxCircleOff: '( )', - questionMarkPrefix: '?', - oneHalf: '1/2', - oneThird: '1/3', - oneQuarter: '1/4', - oneFifth: '1/5', - oneSixth: '1/6', - oneSeventh: '1/7', - oneEighth: '1/8', - oneNinth: '1/9', - oneTenth: '1/10', - twoThirds: '2/3', - twoFifths: '2/5', - threeQuarters: '3/4', - threeFifths: '3/5', - threeEighths: '3/8', - fourFifths: '4/5', - fiveSixths: '5/6', - fiveEighths: '5/8', - sevenEighths: '7/8' -}; - -if (platform === 'linux') { - // the main one doesn't look that good on Ubuntu - main.questionMarkPrefix = '?'; -} - -const figures = platform === 'win32' ? win : main; - -const fn = str => { - if (figures === main) { - return str; - } - - Object.keys(main).forEach(key => { - if (main[key] === figures[key]) { - return; - } - - str = str.replace(new RegExp(escapeStringRegexp(main[key]), 'g'), figures[key]); - }); - - return str; -}; - -module.exports = Object.assign(fn, figures); - - -/***/ }), -/* 237 */ +/* 99 */ /***/ (function(module, exports, __webpack_require__) { // Approach: @@ -52639,27 +33350,27 @@ module.exports = Object.assign(fn, figures); module.exports = glob -var fs = __webpack_require__(12) -var rp = __webpack_require__(359) -var minimatch = __webpack_require__(169) +var fs = __webpack_require__(4) +var rp = __webpack_require__(140) +var minimatch = __webpack_require__(82) var Minimatch = minimatch.Minimatch -var inherits = __webpack_require__(78) -var EE = __webpack_require__(95).EventEmitter -var path = __webpack_require__(1) -var assert = __webpack_require__(50) -var isAbsolute = __webpack_require__(245) -var globSync = __webpack_require__(711) -var common = __webpack_require__(360) +var inherits = __webpack_require__(61) +var EE = __webpack_require__(76).EventEmitter +var path = __webpack_require__(0) +var assert = __webpack_require__(28) +var isAbsolute = __webpack_require__(101) +var globSync = __webpack_require__(272) +var common = __webpack_require__(141) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp -var inflight = __webpack_require__(745) -var util = __webpack_require__(9) +var inflight = __webpack_require__(274) +var util = __webpack_require__(3) var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored -var once = __webpack_require__(133) +var once = __webpack_require__(83) function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} @@ -53390,13 +34101,7 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) { /***/ }), -/* 238 */ -/***/ (function(module, exports) { - -module.exports = [["0","\u0000",127,"€"],["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"],["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"],["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11],["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"],["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"],["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5],["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"],["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"],["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"],["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"],["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"],["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"],["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4],["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6],["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"],["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7],["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"],["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"],["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"],["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5],["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"],["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6],["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"],["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4],["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4],["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"],["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"],["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6],["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"],["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"],["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"],["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6],["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"],["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"],["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"],["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"],["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"],["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"],["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8],["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"],["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"],["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"],["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"],["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5],["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"],["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"],["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"],["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"],["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5],["9980","檧檨檪檭",114,"欥欦欨",6],["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"],["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"],["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"],["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"],["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"],["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5],["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"],["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"],["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6],["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"],["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"],["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4],["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19],["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"],["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"],["a2a1","ⅰ",9],["a2b1","⒈",19,"⑴",19,"①",9],["a2e5","㈠",9],["a2f1","Ⅰ",11],["a3a1","!"#¥%",88," ̄"],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"],["a6ee","︻︼︷︸︱"],["a6f4","︳︴"],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6],["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"],["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"],["a8bd","ńň"],["a8c0","ɡ"],["a8c5","ㄅ",36],["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"],["a959","℡㈱"],["a95c","‐"],["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8],["a980","﹢",4,"﹨﹩﹪﹫"],["a996","〇"],["a9a4","─",75],["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8],["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"],["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4],["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4],["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11],["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"],["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12],["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"],["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"],["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"],["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"],["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"],["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"],["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"],["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"],["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"],["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4],["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"],["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"],["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"],["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9],["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"],["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"],["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"],["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"],["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"],["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16],["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"],["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"],["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"],["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"],["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"],["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"],["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"],["bb40","籃",9,"籎",36,"籵",5,"籾",9],["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"],["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5],["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"],["bd40","紷",54,"絯",7],["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"],["be40","継",12,"綧",6,"綯",42],["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"],["bf40","緻",62],["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"],["c040","繞",35,"纃",23,"纜纝纞"],["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"],["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"],["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"],["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"],["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"],["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"],["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"],["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"],["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"],["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"],["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"],["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"],["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"],["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"],["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"],["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"],["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"],["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"],["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"],["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10],["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"],["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"],["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"],["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"],["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"],["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"],["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"],["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"],["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"],["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9],["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"],["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"],["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"],["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5],["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"],["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"],["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"],["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6],["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"],["d440","訞",31,"訿",8,"詉",21],["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"],["d540","誁",7,"誋",7,"誔",46],["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"],["d640","諤",34,"謈",27],["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"],["d740","譆",31,"譧",4,"譭",25],["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"],["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"],["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"],["d940","貮",62],["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"],["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"],["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"],["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"],["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"],["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7],["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"],["dd40","軥",62],["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"],["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"],["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"],["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"],["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"],["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"],["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"],["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"],["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"],["e240","釦",62],["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"],["e340","鉆",45,"鉵",16],["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"],["e440","銨",5,"銯",24,"鋉",31],["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"],["e540","錊",51,"錿",10],["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"],["e640","鍬",34,"鎐",27],["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"],["e740","鏎",7,"鏗",54],["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"],["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"],["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"],["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42],["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"],["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"],["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"],["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"],["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"],["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7],["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"],["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46],["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"],["ee40","頏",62],["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"],["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4],["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"],["f040","餈",4,"餎餏餑",28,"餯",26],["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"],["f140","馌馎馚",10,"馦馧馩",47],["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"],["f240","駺",62],["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"],["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"],["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"],["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5],["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"],["f540","魼",62],["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"],["f640","鯜",62],["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"],["f740","鰼",62],["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"],["f840","鳣",62],["f880","鴢",32],["f940","鵃",62],["f980","鶂",32],["fa40","鶣",62],["fa80","鷢",32],["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"],["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"],["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6],["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"],["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38],["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"],["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"]] - -/***/ }), -/* 239 */ +/* 100 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -53407,684 +34112,20 @@ module.exports = [["0","\u0000",127,"€"],["8140","丂丄丅丆丏丒丗丟丠 -var Schema = __webpack_require__(107); +var Schema = __webpack_require__(44); module.exports = new Schema({ explicit: [ - __webpack_require__(813), - __webpack_require__(811), - __webpack_require__(806) + __webpack_require__(298), + __webpack_require__(296), + __webpack_require__(291) ] }); /***/ }), -/* 240 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var win32 = process && process.platform === 'win32'; -var path = __webpack_require__(1); -var fileRe = __webpack_require__(702); -var utils = module.exports; - -/** - * Module dependencies - */ - -utils.diff = __webpack_require__(826); -utils.unique = __webpack_require__(827); -utils.braces = __webpack_require__(828); -utils.brackets = __webpack_require__(695); -utils.extglob = __webpack_require__(700); -utils.isExtglob = __webpack_require__(165); -utils.isGlob = __webpack_require__(166); -utils.typeOf = __webpack_require__(168); -utils.normalize = __webpack_require__(837); -utils.omit = __webpack_require__(841); -utils.parseGlob = __webpack_require__(845); -utils.cache = __webpack_require__(867); - -/** - * Get the filename of a filepath - * - * @param {String} `string` - * @return {String} - */ - -utils.filename = function filename(fp) { - var seg = fp.match(fileRe()); - return seg && seg[0]; -}; - -/** - * Returns a function that returns true if the given - * pattern is the same as a given `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ - -utils.isPath = function isPath(pattern, opts) { - opts = opts || {}; - return function(fp) { - var unixified = utils.unixify(fp, opts); - if(opts.nocase){ - return pattern.toLowerCase() === unixified.toLowerCase(); - } - return pattern === unixified; - }; -}; - -/** - * Returns a function that returns true if the given - * pattern contains a `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ - -utils.hasPath = function hasPath(pattern, opts) { - return function(fp) { - return utils.unixify(pattern, opts).indexOf(fp) !== -1; - }; -}; - -/** - * Returns a function that returns true if the given - * pattern matches or contains a `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ - -utils.matchPath = function matchPath(pattern, opts) { - var fn = (opts && opts.contains) - ? utils.hasPath(pattern, opts) - : utils.isPath(pattern, opts); - return fn; -}; - -/** - * Returns a function that returns true if the given - * regex matches the `filename` of a file path. - * - * @param {RegExp} `re` - * @return {Boolean} - */ - -utils.hasFilename = function hasFilename(re) { - return function(fp) { - var name = utils.filename(fp); - return name && re.test(name); - }; -}; - -/** - * Coerce `val` to an array - * - * @param {*} val - * @return {Array} - */ - -utils.arrayify = function arrayify(val) { - return !Array.isArray(val) - ? [val] - : val; -}; - -/** - * Normalize all slashes in a file path or glob pattern to - * forward slashes. - */ - -utils.unixify = function unixify(fp, opts) { - if (opts && opts.unixify === false) return fp; - if (opts && opts.unixify === true || win32 || path.sep === '\\') { - return utils.normalize(fp, false); - } - if (opts && opts.unescape === true) { - return fp ? fp.toString().replace(/\\(\w)/g, '$1') : ''; - } - return fp; -}; - -/** - * Escape/unescape utils - */ - -utils.escapePath = function escapePath(fp) { - return fp.replace(/[\\.]/g, '\\$&'); -}; - -utils.unescapeGlob = function unescapeGlob(fp) { - return fp.replace(/[\\"']/g, ''); -}; - -utils.escapeRe = function escapeRe(str) { - return str.replace(/[-[\\$*+?.#^\s{}(|)\]]/g, '\\$&'); -}; - -/** - * Expose `utils` - */ - -module.exports = utils; - - -/***/ }), -/* 241 */ -/***/ (function(module, exports, __webpack_require__) { - -var path = __webpack_require__(1); -var fs = __webpack_require__(12); -var _0777 = parseInt('0777', 8); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, opts, f, made) { - if (typeof opts === 'function') { - f = opts; - opts = {}; - } - else if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = _0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - p = path.resolve(p); - - xfs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), opts, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, opts, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - xfs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, opts, made) { - if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = _0777 & (~process.umask()); - } - if (!made) made = null; - - p = path.resolve(p); - - try { - xfs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), opts, made); - sync(p, opts, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = xfs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; - - -/***/ }), -/* 242 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(835); - -/***/ }), -/* 243 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - - -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; - - -/***/ }), -/* 244 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory){ - 'use strict'; - - /*istanbul ignore next:cant test*/ - if (typeof module === 'object' && typeof module.exports === 'object') { - module.exports = factory(); - } else if (true) { - // AMD. Register as an anonymous module. - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - // Browser globals - root.objectPath = factory(); - } -})(this, function(){ - 'use strict'; - - var toStr = Object.prototype.toString; - function hasOwnProperty(obj, prop) { - if(obj == null) { - return false - } - //to handle objects with null prototypes (too edge case?) - return Object.prototype.hasOwnProperty.call(obj, prop) - } - - function isEmpty(value){ - if (!value) { - return true; - } - if (isArray(value) && value.length === 0) { - return true; - } else if (typeof value !== 'string') { - for (var i in value) { - if (hasOwnProperty(value, i)) { - return false; - } - } - return true; - } - return false; - } - - function toString(type){ - return toStr.call(type); - } - - function isObject(obj){ - return typeof obj === 'object' && toString(obj) === "[object Object]"; - } - - var isArray = Array.isArray || function(obj){ - /*istanbul ignore next:cant test*/ - return toStr.call(obj) === '[object Array]'; - } - - function isBoolean(obj){ - return typeof obj === 'boolean' || toString(obj) === '[object Boolean]'; - } - - function getKey(key){ - var intKey = parseInt(key); - if (intKey.toString() === key) { - return intKey; - } - return key; - } - - function factory(options) { - options = options || {} - - var objectPath = function(obj) { - return Object.keys(objectPath).reduce(function(proxy, prop) { - if(prop === 'create') { - return proxy; - } - - /*istanbul ignore else*/ - if (typeof objectPath[prop] === 'function') { - proxy[prop] = objectPath[prop].bind(objectPath, obj); - } - - return proxy; - }, {}); - }; - - function hasShallowProperty(obj, prop) { - return (options.includeInheritedProps || (typeof prop === 'number' && Array.isArray(obj)) || hasOwnProperty(obj, prop)) - } - - function getShallowProperty(obj, prop) { - if (hasShallowProperty(obj, prop)) { - return obj[prop]; - } - } - - function set(obj, path, value, doNotReplace){ - if (typeof path === 'number') { - path = [path]; - } - if (!path || path.length === 0) { - return obj; - } - if (typeof path === 'string') { - return set(obj, path.split('.').map(getKey), value, doNotReplace); - } - var currentPath = path[0]; - var currentValue = getShallowProperty(obj, currentPath); - if (path.length === 1) { - if (currentValue === void 0 || !doNotReplace) { - obj[currentPath] = value; - } - return currentValue; - } - - if (currentValue === void 0) { - //check if we assume an array - if(typeof path[1] === 'number') { - obj[currentPath] = []; - } else { - obj[currentPath] = {}; - } - } - - return set(obj[currentPath], path.slice(1), value, doNotReplace); - } - - objectPath.has = function (obj, path) { - if (typeof path === 'number') { - path = [path]; - } else if (typeof path === 'string') { - path = path.split('.'); - } - - if (!path || path.length === 0) { - return !!obj; - } - - for (var i = 0; i < path.length; i++) { - var j = getKey(path[i]); - - if((typeof j === 'number' && isArray(obj) && j < obj.length) || - (options.includeInheritedProps ? (j in Object(obj)) : hasOwnProperty(obj, j))) { - obj = obj[j]; - } else { - return false; - } - } - - return true; - }; - - objectPath.ensureExists = function (obj, path, value){ - return set(obj, path, value, true); - }; - - objectPath.set = function (obj, path, value, doNotReplace){ - return set(obj, path, value, doNotReplace); - }; - - objectPath.insert = function (obj, path, value, at){ - var arr = objectPath.get(obj, path); - at = ~~at; - if (!isArray(arr)) { - arr = []; - objectPath.set(obj, path, arr); - } - arr.splice(at, 0, value); - }; - - objectPath.empty = function(obj, path) { - if (isEmpty(path)) { - return void 0; - } - if (obj == null) { - return void 0; - } - - var value, i; - if (!(value = objectPath.get(obj, path))) { - return void 0; - } - - if (typeof value === 'string') { - return objectPath.set(obj, path, ''); - } else if (isBoolean(value)) { - return objectPath.set(obj, path, false); - } else if (typeof value === 'number') { - return objectPath.set(obj, path, 0); - } else if (isArray(value)) { - value.length = 0; - } else if (isObject(value)) { - for (i in value) { - if (hasShallowProperty(value, i)) { - delete value[i]; - } - } - } else { - return objectPath.set(obj, path, null); - } - }; - - objectPath.push = function (obj, path /*, values */){ - var arr = objectPath.get(obj, path); - if (!isArray(arr)) { - arr = []; - objectPath.set(obj, path, arr); - } - - arr.push.apply(arr, Array.prototype.slice.call(arguments, 2)); - }; - - objectPath.coalesce = function (obj, paths, defaultValue) { - var value; - - for (var i = 0, len = paths.length; i < len; i++) { - if ((value = objectPath.get(obj, paths[i])) !== void 0) { - return value; - } - } - - return defaultValue; - }; - - objectPath.get = function (obj, path, defaultValue){ - if (typeof path === 'number') { - path = [path]; - } - if (!path || path.length === 0) { - return obj; - } - if (obj == null) { - return defaultValue; - } - if (typeof path === 'string') { - return objectPath.get(obj, path.split('.'), defaultValue); - } - - var currentPath = getKey(path[0]); - var nextObj = getShallowProperty(obj, currentPath) - if (nextObj === void 0) { - return defaultValue; - } - - if (path.length === 1) { - return nextObj; - } - - return objectPath.get(obj[currentPath], path.slice(1), defaultValue); - }; - - objectPath.del = function del(obj, path) { - if (typeof path === 'number') { - path = [path]; - } - - if (obj == null) { - return obj; - } - - if (isEmpty(path)) { - return obj; - } - if(typeof path === 'string') { - return objectPath.del(obj, path.split('.')); - } - - var currentPath = getKey(path[0]); - if (!hasShallowProperty(obj, currentPath)) { - return obj; - } - - if(path.length === 1) { - if (isArray(obj)) { - obj.splice(currentPath, 1); - } else { - delete obj[currentPath]; - } - } else { - return objectPath.del(obj[currentPath], path.slice(1)); - } - - return obj; - } - - return objectPath; - } - - var mod = factory(); - mod.create = factory; - mod.withInheritedProps = factory({includeInheritedProps: true}) - return mod; -}); - - -/***/ }), -/* 245 */ +/* 101 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -54111,2385 +34152,210 @@ module.exports.win32 = win32; /***/ }), -/* 246 */ +/* 102 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -var jsonSafeStringify = __webpack_require__(816) -var crypto = __webpack_require__(21) -var Buffer = __webpack_require__(59).Buffer - -var defer = typeof setImmediate === 'undefined' - ? process.nextTick - : setImmediate - -function paramsHaveRequestBody (params) { - return ( - params.body || - params.requestBodyStream || - (params.json && typeof params.json !== 'boolean') || - params.multipart - ) -} - -function safeStringify (obj, replacer) { - var ret - try { - ret = JSON.stringify(obj, replacer) - } catch (e) { - ret = jsonSafeStringify(obj, replacer) - } - return ret -} - -function md5 (str) { - return crypto.createHash('md5').update(str).digest('hex') -} - -function isReadStream (rs) { - return rs.readable && rs.path && rs.mode -} - -function toBase64 (str) { - return Buffer.from(str || '', 'utf8').toString('base64') -} - -function copy (obj) { - var o = {} - Object.keys(obj).forEach(function (i) { - o[i] = obj[i] - }) - return o -} - -function version () { - var numbers = process.version.replace('v', '').split('.') - return { - major: parseInt(numbers[0], 10), - minor: parseInt(numbers[1], 10), - patch: parseInt(numbers[2], 10) - } -} - -exports.paramsHaveRequestBody = paramsHaveRequestBody -exports.safeStringify = safeStringify -exports.md5 = md5 -exports.isReadStream = isReadStream -exports.toBase64 = toBase64 -exports.copy = copy -exports.version = version -exports.defer = defer - - -/***/ }), -/* 247 */ -/***/ (function(module, exports, __webpack_require__) { - -var current = (process.versions && process.versions.node && process.versions.node.split('.')) || []; - -function specifierIncluded(specifier) { - var parts = specifier.split(' '); - var op = parts.length > 1 ? parts[0] : '='; - var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); - - for (var i = 0; i < 3; ++i) { - var cur = Number(current[i] || 0); - var ver = Number(versionParts[i] || 0); - if (cur === ver) { - continue; // eslint-disable-line no-restricted-syntax, no-continue - } - if (op === '<') { - return cur < ver; - } else if (op === '>=') { - return cur >= ver; - } else { - return false; - } - } - return op === '>='; -} - -function matchesRange(range) { - var specifiers = range.split(/ ?&& ?/); - if (specifiers.length === 0) { return false; } - for (var i = 0; i < specifiers.length; ++i) { - if (!specifierIncluded(specifiers[i])) { return false; } - } - return true; -} - -function versionIncluded(specifierValue) { - if (typeof specifierValue === 'boolean') { return specifierValue; } - if (specifierValue && typeof specifierValue === 'object') { - for (var i = 0; i < specifierValue.length; ++i) { - if (matchesRange(specifierValue[i])) { return true; } - } - return false; - } - return matchesRange(specifierValue); -} - -var data = __webpack_require__(888); - -var core = {}; -for (var mod in data) { // eslint-disable-line no-restricted-syntax - if (Object.prototype.hasOwnProperty.call(data, mod)) { - core[mod] = versionIncluded(data[mod]); - } -} -module.exports = core; - - -/***/ }), -/* 248 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ReplaySubject; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_queue__ = __webpack_require__(409); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(31); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__operators_observeOn__ = __webpack_require__(404); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_ObjectUnsubscribedError__ = __webpack_require__(179); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__SubjectSubscription__ = __webpack_require__(392); -/** PURE_IMPORTS_START tslib,_Subject,_scheduler_queue,_Subscription,_operators_observeOn,_util_ObjectUnsubscribedError,_SubjectSubscription PURE_IMPORTS_END */ - - - - - - - -var ReplaySubject = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ReplaySubject, _super); - function ReplaySubject(bufferSize, windowTime, scheduler) { - if (bufferSize === void 0) { - bufferSize = Number.POSITIVE_INFINITY; - } - if (windowTime === void 0) { - windowTime = Number.POSITIVE_INFINITY; - } - var _this = _super.call(this) || this; - _this.scheduler = scheduler; - _this._events = []; - _this._infiniteTimeWindow = false; - _this._bufferSize = bufferSize < 1 ? 1 : bufferSize; - _this._windowTime = windowTime < 1 ? 1 : windowTime; - if (windowTime === Number.POSITIVE_INFINITY) { - _this._infiniteTimeWindow = true; - _this.next = _this.nextInfiniteTimeWindow; - } - else { - _this.next = _this.nextTimeWindow; - } - return _this; - } - ReplaySubject.prototype.nextInfiniteTimeWindow = function (value) { - var _events = this._events; - _events.push(value); - if (_events.length > this._bufferSize) { - _events.shift(); - } - _super.prototype.next.call(this, value); - }; - ReplaySubject.prototype.nextTimeWindow = function (value) { - this._events.push(new ReplayEvent(this._getNow(), value)); - this._trimBufferThenGetEvents(); - _super.prototype.next.call(this, value); - }; - ReplaySubject.prototype._subscribe = function (subscriber) { - var _infiniteTimeWindow = this._infiniteTimeWindow; - var _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents(); - var scheduler = this.scheduler; - var len = _events.length; - var subscription; - if (this.closed) { - throw new __WEBPACK_IMPORTED_MODULE_5__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); - } - else if (this.isStopped || this.hasError) { - subscription = __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY; - } - else { - this.observers.push(subscriber); - subscription = new __WEBPACK_IMPORTED_MODULE_6__SubjectSubscription__["a" /* SubjectSubscription */](this, subscriber); - } - if (scheduler) { - subscriber.add(subscriber = new __WEBPACK_IMPORTED_MODULE_4__operators_observeOn__["a" /* ObserveOnSubscriber */](subscriber, scheduler)); - } - if (_infiniteTimeWindow) { - for (var i = 0; i < len && !subscriber.closed; i++) { - subscriber.next(_events[i]); - } - } - else { - for (var i = 0; i < len && !subscriber.closed; i++) { - subscriber.next(_events[i].value); - } - } - if (this.hasError) { - subscriber.error(this.thrownError); - } - else if (this.isStopped) { - subscriber.complete(); - } - return subscription; - }; - ReplaySubject.prototype._getNow = function () { - return (this.scheduler || __WEBPACK_IMPORTED_MODULE_2__scheduler_queue__["a" /* queue */]).now(); - }; - ReplaySubject.prototype._trimBufferThenGetEvents = function () { - var now = this._getNow(); - var _bufferSize = this._bufferSize; - var _windowTime = this._windowTime; - var _events = this._events; - var eventsCount = _events.length; - var spliceCount = 0; - while (spliceCount < eventsCount) { - if ((now - _events[spliceCount].time) < _windowTime) { - break; - } - spliceCount++; - } - if (eventsCount > _bufferSize) { - spliceCount = Math.max(spliceCount, eventsCount - _bufferSize); - } - if (spliceCount > 0) { - _events.splice(0, spliceCount); - } - return _events; - }; - return ReplaySubject; -}(__WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */])); - -var ReplayEvent = /*@__PURE__*/ (function () { - function ReplayEvent(time, value) { - this.time = time; - this.value = value; - } - return ReplayEvent; -}()); -//# sourceMappingURL=ReplaySubject.js.map - - -/***/ }), -/* 249 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = combineLatest; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CombineLatestOperator; }); -/* unused harmony export CombineLatestSubscriber */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isScheduler__ = __webpack_require__(56); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(48); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fromArray__ = __webpack_require__(81); -/** PURE_IMPORTS_START tslib,_util_isScheduler,_util_isArray,_OuterSubscriber,_util_subscribeToResult,_fromArray PURE_IMPORTS_END */ - - - - - - -var NONE = {}; -function combineLatest() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i] = arguments[_i]; - } - var resultSelector = null; - var scheduler = null; - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isScheduler__["a" /* isScheduler */])(observables[observables.length - 1])) { - scheduler = observables.pop(); - } - if (typeof observables[observables.length - 1] === 'function') { - resultSelector = observables.pop(); - } - if (observables.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(observables[0])) { - observables = observables[0]; - } - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__fromArray__["a" /* fromArray */])(observables, scheduler).lift(new CombineLatestOperator(resultSelector)); -} -var CombineLatestOperator = /*@__PURE__*/ (function () { - function CombineLatestOperator(resultSelector) { - this.resultSelector = resultSelector; - } - CombineLatestOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector)); - }; - return CombineLatestOperator; -}()); - -var CombineLatestSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](CombineLatestSubscriber, _super); - function CombineLatestSubscriber(destination, resultSelector) { - var _this = _super.call(this, destination) || this; - _this.resultSelector = resultSelector; - _this.active = 0; - _this.values = []; - _this.observables = []; - return _this; - } - CombineLatestSubscriber.prototype._next = function (observable) { - this.values.push(NONE); - this.observables.push(observable); - }; - CombineLatestSubscriber.prototype._complete = function () { - var observables = this.observables; - var len = observables.length; - if (len === 0) { - this.destination.complete(); - } - else { - this.active = len; - this.toRespond = len; - for (var i = 0; i < len; i++) { - var observable = observables[i]; - this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, observable, observable, i)); - } - } - }; - CombineLatestSubscriber.prototype.notifyComplete = function (unused) { - if ((this.active -= 1) === 0) { - this.destination.complete(); - } - }; - CombineLatestSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { - var values = this.values; - var oldVal = values[outerIndex]; - var toRespond = !this.toRespond - ? 0 - : oldVal === NONE ? --this.toRespond : this.toRespond; - values[outerIndex] = innerValue; - if (toRespond === 0) { - if (this.resultSelector) { - this._tryResultSelector(values); - } - else { - this.destination.next(values.slice()); - } - } - }; - CombineLatestSubscriber.prototype._tryResultSelector = function (values) { - var result; - try { - result = this.resultSelector.apply(this, values); - } - catch (err) { - this.destination.error(err); - return; - } - this.destination.next(result); - }; - return CombineLatestSubscriber; -}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */])); - -//# sourceMappingURL=combineLatest.js.map - - -/***/ }), -/* 250 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = defer; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__from__ = __webpack_require__(64); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__empty__ = __webpack_require__(46); -/** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */ - - - -function defer(observableFactory) { - return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { - var input; - try { - input = observableFactory(); - } - catch (err) { - subscriber.error(err); - return undefined; - } - var source = input ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__from__["a" /* from */])(input) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__empty__["a" /* empty */])(); - return source.subscribe(subscriber); - }); -} -//# sourceMappingURL=defer.js.map - - -/***/ }), -/* 251 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = of; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isScheduler__ = __webpack_require__(56); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__fromArray__ = __webpack_require__(81); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__empty__ = __webpack_require__(46); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__scalar__ = __webpack_require__(252); -/** PURE_IMPORTS_START _util_isScheduler,_fromArray,_empty,_scalar PURE_IMPORTS_END */ - - - - -function of() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var scheduler = args[args.length - 1]; - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isScheduler__["a" /* isScheduler */])(scheduler)) { - args.pop(); - } - else { - scheduler = undefined; - } - switch (args.length) { - case 0: - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__empty__["a" /* empty */])(scheduler); - case 1: - return scheduler ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__fromArray__["a" /* fromArray */])(args, scheduler) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__scalar__["a" /* scalar */])(args[0]); - default: - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__fromArray__["a" /* fromArray */])(args, scheduler); - } -} -//# sourceMappingURL=of.js.map - - -/***/ }), -/* 252 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = scalar; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17); -/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */ - -function scalar(value) { - var result = new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { - subscriber.next(value); - subscriber.complete(); - }); - result._isScalar = true; - result.value = value; - return result; -} -//# sourceMappingURL=scalar.js.map - - -/***/ }), -/* 253 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = throwError; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17); -/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */ - -function throwError(error, scheduler) { - if (!scheduler) { - return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return subscriber.error(error); }); - } - else { - return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return scheduler.schedule(dispatch, 0, { error: error, subscriber: subscriber }); }); - } -} -function dispatch(_a) { - var error = _a.error, subscriber = _a.subscriber; - subscriber.error(error); -} -//# sourceMappingURL=throwError.js.map - - -/***/ }), -/* 254 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = zip; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ZipOperator; }); -/* unused harmony export ZipSubscriber */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__fromArray__ = __webpack_require__(81); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(48); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscriber__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(18); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(19); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__ = __webpack_require__(139); -/** PURE_IMPORTS_START tslib,_fromArray,_util_isArray,_Subscriber,_OuterSubscriber,_util_subscribeToResult,_.._internal_symbol_iterator PURE_IMPORTS_END */ - - - - - - - -function zip() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i] = arguments[_i]; - } - var resultSelector = observables[observables.length - 1]; - if (typeof resultSelector === 'function') { - observables.pop(); - } - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__fromArray__["a" /* fromArray */])(observables, undefined).lift(new ZipOperator(resultSelector)); -} -var ZipOperator = /*@__PURE__*/ (function () { - function ZipOperator(resultSelector) { - this.resultSelector = resultSelector; - } - ZipOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector)); - }; - return ZipOperator; -}()); - -var ZipSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ZipSubscriber, _super); - function ZipSubscriber(destination, resultSelector, values) { - if (values === void 0) { - values = Object.create(null); - } - var _this = _super.call(this, destination) || this; - _this.iterators = []; - _this.active = 0; - _this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : null; - _this.values = values; - return _this; - } - ZipSubscriber.prototype._next = function (value) { - var iterators = this.iterators; - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(value)) { - iterators.push(new StaticArrayIterator(value)); - } - else if (typeof value[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__["a" /* iterator */]] === 'function') { - iterators.push(new StaticIterator(value[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__["a" /* iterator */]]())); - } - else { - iterators.push(new ZipBufferIterator(this.destination, this, value)); - } - }; - ZipSubscriber.prototype._complete = function () { - var iterators = this.iterators; - var len = iterators.length; - this.unsubscribe(); - if (len === 0) { - this.destination.complete(); - return; - } - this.active = len; - for (var i = 0; i < len; i++) { - var iterator = iterators[i]; - if (iterator.stillUnsubscribed) { - var destination = this.destination; - destination.add(iterator.subscribe(iterator, i)); - } - else { - this.active--; - } - } - }; - ZipSubscriber.prototype.notifyInactive = function () { - this.active--; - if (this.active === 0) { - this.destination.complete(); - } - }; - ZipSubscriber.prototype.checkIterators = function () { - var iterators = this.iterators; - var len = iterators.length; - var destination = this.destination; - for (var i = 0; i < len; i++) { - var iterator = iterators[i]; - if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) { - return; - } - } - var shouldComplete = false; - var args = []; - for (var i = 0; i < len; i++) { - var iterator = iterators[i]; - var result = iterator.next(); - if (iterator.hasCompleted()) { - shouldComplete = true; - } - if (result.done) { - destination.complete(); - return; - } - args.push(result.value); - } - if (this.resultSelector) { - this._tryresultSelector(args); - } - else { - destination.next(args); - } - if (shouldComplete) { - destination.complete(); - } - }; - ZipSubscriber.prototype._tryresultSelector = function (args) { - var result; - try { - result = this.resultSelector.apply(this, args); - } - catch (err) { - this.destination.error(err); - return; - } - this.destination.next(result); - }; - return ZipSubscriber; -}(__WEBPACK_IMPORTED_MODULE_3__Subscriber__["a" /* Subscriber */])); - -var StaticIterator = /*@__PURE__*/ (function () { - function StaticIterator(iterator) { - this.iterator = iterator; - this.nextResult = iterator.next(); - } - StaticIterator.prototype.hasValue = function () { - return true; - }; - StaticIterator.prototype.next = function () { - var result = this.nextResult; - this.nextResult = this.iterator.next(); - return result; - }; - StaticIterator.prototype.hasCompleted = function () { - var nextResult = this.nextResult; - return nextResult && nextResult.done; - }; - return StaticIterator; -}()); -var StaticArrayIterator = /*@__PURE__*/ (function () { - function StaticArrayIterator(array) { - this.array = array; - this.index = 0; - this.length = 0; - this.length = array.length; - } - StaticArrayIterator.prototype[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__["a" /* iterator */]] = function () { - return this; - }; - StaticArrayIterator.prototype.next = function (value) { - var i = this.index++; - var array = this.array; - return i < this.length ? { value: array[i], done: false } : { value: null, done: true }; - }; - StaticArrayIterator.prototype.hasValue = function () { - return this.array.length > this.index; - }; - StaticArrayIterator.prototype.hasCompleted = function () { - return this.array.length === this.index; - }; - return StaticArrayIterator; -}()); -var ZipBufferIterator = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ZipBufferIterator, _super); - function ZipBufferIterator(destination, parent, observable) { - var _this = _super.call(this, destination) || this; - _this.parent = parent; - _this.observable = observable; - _this.stillUnsubscribed = true; - _this.buffer = []; - _this.isComplete = false; - return _this; - } - ZipBufferIterator.prototype[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__["a" /* iterator */]] = function () { - return this; - }; - ZipBufferIterator.prototype.next = function () { - var buffer = this.buffer; - if (buffer.length === 0 && this.isComplete) { - return { value: null, done: true }; - } - else { - return { value: buffer.shift(), done: false }; - } - }; - ZipBufferIterator.prototype.hasValue = function () { - return this.buffer.length > 0; - }; - ZipBufferIterator.prototype.hasCompleted = function () { - return this.buffer.length === 0 && this.isComplete; - }; - ZipBufferIterator.prototype.notifyComplete = function () { - if (this.buffer.length > 0) { - this.isComplete = true; - this.parent.notifyInactive(); - } - else { - this.destination.complete(); - } - }; - ZipBufferIterator.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.buffer.push(innerValue); - this.parent.checkIterators(); - }; - ZipBufferIterator.prototype.subscribe = function (value, index) { - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, this.observable, this, index); - }; - return ZipBufferIterator; -}(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */])); -//# sourceMappingURL=zip.js.map - - -/***/ }), -/* 255 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = mergeAll; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mergeMap__ = __webpack_require__(136); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_identity__ = __webpack_require__(112); -/** PURE_IMPORTS_START _mergeMap,_util_identity PURE_IMPORTS_END */ - - -function mergeAll(concurrent) { - if (concurrent === void 0) { - concurrent = Number.POSITIVE_INFINITY; - } - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeMap__["a" /* mergeMap */])(__WEBPACK_IMPORTED_MODULE_1__util_identity__["a" /* identity */], concurrent); -} -//# sourceMappingURL=mergeAll.js.map - - -/***/ }), -/* 256 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = refCount; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); -/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ - - -function refCount() { - return function refCountOperatorFunction(source) { - return source.lift(new RefCountOperator(source)); - }; -} -var RefCountOperator = /*@__PURE__*/ (function () { - function RefCountOperator(connectable) { - this.connectable = connectable; - } - RefCountOperator.prototype.call = function (subscriber, source) { - var connectable = this.connectable; - connectable._refCount++; - var refCounter = new RefCountSubscriber(subscriber, connectable); - var subscription = source.subscribe(refCounter); - if (!refCounter.closed) { - refCounter.connection = connectable.connect(); - } - return subscription; - }; - return RefCountOperator; -}()); -var RefCountSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RefCountSubscriber, _super); - function RefCountSubscriber(destination, connectable) { - var _this = _super.call(this, destination) || this; - _this.connectable = connectable; - return _this; - } - RefCountSubscriber.prototype._unsubscribe = function () { - var connectable = this.connectable; - if (!connectable) { - this.connection = null; - return; - } - this.connectable = null; - var refCount = connectable._refCount; - if (refCount <= 0) { - this.connection = null; - return; - } - connectable._refCount = refCount - 1; - if (refCount > 1) { - this.connection = null; - return; - } - var connection = this.connection; - var sharedConnection = connectable._connection; - this.connection = null; - if (sharedConnection && (!connection || sharedConnection === connection)) { - sharedConnection.unsubscribe(); - } - }; - return RefCountSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); -//# sourceMappingURL=refCount.js.map - - -/***/ }), -/* 257 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = scan; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); -/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ - - -function scan(accumulator, seed) { - var hasSeed = false; - if (arguments.length >= 2) { - hasSeed = true; - } - return function scanOperatorFunction(source) { - return source.lift(new ScanOperator(accumulator, seed, hasSeed)); - }; -} -var ScanOperator = /*@__PURE__*/ (function () { - function ScanOperator(accumulator, seed, hasSeed) { - if (hasSeed === void 0) { - hasSeed = false; - } - this.accumulator = accumulator; - this.seed = seed; - this.hasSeed = hasSeed; - } - ScanOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed)); - }; - return ScanOperator; -}()); -var ScanSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ScanSubscriber, _super); - function ScanSubscriber(destination, accumulator, _seed, hasSeed) { - var _this = _super.call(this, destination) || this; - _this.accumulator = accumulator; - _this._seed = _seed; - _this.hasSeed = hasSeed; - _this.index = 0; - return _this; - } - Object.defineProperty(ScanSubscriber.prototype, "seed", { - get: function () { - return this._seed; - }, - set: function (value) { - this.hasSeed = true; - this._seed = value; - }, - enumerable: true, - configurable: true - }); - ScanSubscriber.prototype._next = function (value) { - if (!this.hasSeed) { - this.seed = value; - this.destination.next(value); - } - else { - return this._tryNext(value); - } - }; - ScanSubscriber.prototype._tryNext = function (value) { - var index = this.index++; - var result; - try { - result = this.accumulator(this.seed, value, index); - } - catch (err) { - this.destination.error(err); - } - this.seed = result; - this.destination.next(result); - }; - return ScanSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); -//# sourceMappingURL=scan.js.map - - -/***/ }), -/* 258 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = switchMap; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__ = __webpack_require__(80); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(19); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map__ = __webpack_require__(54); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__observable_from__ = __webpack_require__(64); -/** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */ - - - - - - -function switchMap(project, resultSelector) { - if (typeof resultSelector === 'function') { - return function (source) { return source.pipe(switchMap(function (a, i) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__observable_from__["a" /* from */])(project(a, i)).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__map__["a" /* map */])(function (b, ii) { return resultSelector(a, b, i, ii); })); })); }; - } - return function (source) { return source.lift(new SwitchMapOperator(project)); }; -} -var SwitchMapOperator = /*@__PURE__*/ (function () { - function SwitchMapOperator(project) { - this.project = project; - } - SwitchMapOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new SwitchMapSubscriber(subscriber, this.project)); - }; - return SwitchMapOperator; -}()); -var SwitchMapSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SwitchMapSubscriber, _super); - function SwitchMapSubscriber(destination, project) { - var _this = _super.call(this, destination) || this; - _this.project = project; - _this.index = 0; - return _this; - } - SwitchMapSubscriber.prototype._next = function (value) { - var result; - var index = this.index++; - try { - result = this.project(value, index); - } - catch (error) { - this.destination.error(error); - return; - } - this._innerSub(result, value, index); - }; - SwitchMapSubscriber.prototype._innerSub = function (result, value, index) { - var innerSubscription = this.innerSubscription; - if (innerSubscription) { - innerSubscription.unsubscribe(); - } - var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined); - var destination = this.destination; - destination.add(innerSubscriber); - this.innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(this, result, value, index, innerSubscriber); - }; - SwitchMapSubscriber.prototype._complete = function () { - var innerSubscription = this.innerSubscription; - if (!innerSubscription || innerSubscription.closed) { - _super.prototype._complete.call(this); - } - this.unsubscribe(); - }; - SwitchMapSubscriber.prototype._unsubscribe = function () { - this.innerSubscription = null; - }; - SwitchMapSubscriber.prototype.notifyComplete = function (innerSub) { - var destination = this.destination; - destination.remove(innerSub); - this.innerSubscription = null; - if (this.isStopped) { - _super.prototype._complete.call(this); - } - }; - SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.destination.next(innerValue); - }; - return SwitchMapSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */])); -//# sourceMappingURL=switchMap.js.map - - -/***/ }), -/* 259 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = take; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__ = __webpack_require__(140); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_empty__ = __webpack_require__(46); -/** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */ - - - - -function take(count) { - return function (source) { - if (count === 0) { - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_empty__["a" /* empty */])(); - } - else { - return source.lift(new TakeOperator(count)); - } - }; -} -var TakeOperator = /*@__PURE__*/ (function () { - function TakeOperator(total) { - this.total = total; - if (this.total < 0) { - throw new __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */]; - } - } - TakeOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new TakeSubscriber(subscriber, this.total)); - }; - return TakeOperator; -}()); -var TakeSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TakeSubscriber, _super); - function TakeSubscriber(destination, total) { - var _this = _super.call(this, destination) || this; - _this.total = total; - _this.count = 0; - return _this; - } - TakeSubscriber.prototype._next = function (value) { - var total = this.total; - var count = ++this.count; - if (count <= total) { - this.destination.next(value); - if (count === total) { - this.destination.complete(); - this.unsubscribe(); - } - } - }; - return TakeSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); -//# sourceMappingURL=take.js.map - - -/***/ }), -/* 260 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = takeLast; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__ = __webpack_require__(140); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_empty__ = __webpack_require__(46); -/** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */ - - - - -function takeLast(count) { - return function takeLastOperatorFunction(source) { - if (count === 0) { - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_empty__["a" /* empty */])(); - } - else { - return source.lift(new TakeLastOperator(count)); - } - }; -} -var TakeLastOperator = /*@__PURE__*/ (function () { - function TakeLastOperator(total) { - this.total = total; - if (this.total < 0) { - throw new __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */]; - } - } - TakeLastOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new TakeLastSubscriber(subscriber, this.total)); - }; - return TakeLastOperator; -}()); -var TakeLastSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TakeLastSubscriber, _super); - function TakeLastSubscriber(destination, total) { - var _this = _super.call(this, destination) || this; - _this.total = total; - _this.ring = new Array(); - _this.count = 0; - return _this; - } - TakeLastSubscriber.prototype._next = function (value) { - var ring = this.ring; - var total = this.total; - var count = this.count++; - if (ring.length < total) { - ring.push(value); - } - else { - var index = count % total; - ring[index] = value; - } - }; - TakeLastSubscriber.prototype._complete = function () { - var destination = this.destination; - var count = this.count; - if (count > 0) { - var total = this.count >= this.total ? this.total : this.count; - var ring = this.ring; - for (var i = 0; i < total; i++) { - var idx = (count++) % total; - destination.next(ring[idx]); - } - } - destination.complete(); - }; - return TakeLastSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); -//# sourceMappingURL=takeLast.js.map - - -/***/ }), -/* 261 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return rxSubscriber; }); -/* unused harmony export $$rxSubscriber */ -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -var rxSubscriber = typeof Symbol === 'function' - ? /*@__PURE__*/ Symbol('rxSubscriber') - : '@@rxSubscriber_' + /*@__PURE__*/ Math.random(); -var $$rxSubscriber = rxSubscriber; -//# sourceMappingURL=rxSubscriber.js.map - - -/***/ }), -/* 262 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = canReportError; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Subscriber__ = __webpack_require__(5); -/** PURE_IMPORTS_START _Subscriber PURE_IMPORTS_END */ - -function canReportError(observer) { - while (observer) { - var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped; - if (closed_1 || isStopped) { - return false; - } - else if (destination && destination instanceof __WEBPACK_IMPORTED_MODULE_0__Subscriber__["a" /* Subscriber */]) { - observer = destination; - } - else { - observer = null; - } - } - return true; -} -//# sourceMappingURL=canReportError.js.map - - -/***/ }), -/* 263 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = hostReportError; -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function hostReportError(err) { - setTimeout(function () { throw err; }); -} -//# sourceMappingURL=hostReportError.js.map - - -/***/ }), -/* 264 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = pipe; -/* harmony export (immutable) */ __webpack_exports__["b"] = pipeFromArray; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__noop__ = __webpack_require__(181); -/** PURE_IMPORTS_START _noop PURE_IMPORTS_END */ - -function pipe() { - var fns = []; - for (var _i = 0; _i < arguments.length; _i++) { - fns[_i] = arguments[_i]; - } - return pipeFromArray(fns); -} -function pipeFromArray(fns) { - if (!fns) { - return __WEBPACK_IMPORTED_MODULE_0__noop__["a" /* noop */]; - } - if (fns.length === 1) { - return fns[0]; - } - return function piped(input) { - return fns.reduce(function (prev, fn) { return fn(prev); }, input); - }; -} -//# sourceMappingURL=pipe.js.map - - -/***/ }), -/* 265 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2017 Joyent, Inc. - -module.exports = { - DiffieHellman: DiffieHellman, - generateECDSA: generateECDSA, - generateED25519: generateED25519 -}; - -var assert = __webpack_require__(22); -var crypto = __webpack_require__(21); -var Buffer = __webpack_require__(20).Buffer; -var algs = __webpack_require__(38); -var utils = __webpack_require__(32); -var nacl; - -var Key = __webpack_require__(34); -var PrivateKey = __webpack_require__(39); - -var CRYPTO_HAVE_ECDH = (crypto.createECDH !== undefined); - -var ecdh, ec, jsbn; - -function DiffieHellman(key) { - utils.assertCompatible(key, Key, [1, 4], 'key'); - this._isPriv = PrivateKey.isPrivateKey(key, [1, 3]); - this._algo = key.type; - this._curve = key.curve; - this._key = key; - if (key.type === 'dsa') { - if (!CRYPTO_HAVE_ECDH) { - throw (new Error('Due to bugs in the node 0.10 ' + - 'crypto API, node 0.12.x or later is required ' + - 'to use DH')); - } - this._dh = crypto.createDiffieHellman( - key.part.p.data, undefined, - key.part.g.data, undefined); - this._p = key.part.p; - this._g = key.part.g; - if (this._isPriv) - this._dh.setPrivateKey(key.part.x.data); - this._dh.setPublicKey(key.part.y.data); - - } else if (key.type === 'ecdsa') { - if (!CRYPTO_HAVE_ECDH) { - if (ecdh === undefined) - ecdh = __webpack_require__(356); - if (ec === undefined) - ec = __webpack_require__(129); - if (jsbn === undefined) - jsbn = __webpack_require__(79).BigInteger; - - this._ecParams = new X9ECParameters(this._curve); - - if (this._isPriv) { - this._priv = new ECPrivate( - this._ecParams, key.part.d.data); - } - return; - } - - var curve = { - 'nistp256': 'prime256v1', - 'nistp384': 'secp384r1', - 'nistp521': 'secp521r1' - }[key.curve]; - this._dh = crypto.createECDH(curve); - if (typeof (this._dh) !== 'object' || - typeof (this._dh.setPrivateKey) !== 'function') { - CRYPTO_HAVE_ECDH = false; - DiffieHellman.call(this, key); - return; - } - if (this._isPriv) - this._dh.setPrivateKey(key.part.d.data); - this._dh.setPublicKey(key.part.Q.data); - - } else if (key.type === 'curve25519') { - if (nacl === undefined) - nacl = __webpack_require__(71); - - if (this._isPriv) { - utils.assertCompatible(key, PrivateKey, [1, 5], 'key'); - this._priv = key.part.k.data; - } - - } else { - throw (new Error('DH not supported for ' + key.type + ' keys')); - } -} - -DiffieHellman.prototype.getPublicKey = function () { - if (this._isPriv) - return (this._key.toPublic()); - return (this._key); -}; - -DiffieHellman.prototype.getPrivateKey = function () { - if (this._isPriv) - return (this._key); - else - return (undefined); -}; -DiffieHellman.prototype.getKey = DiffieHellman.prototype.getPrivateKey; - -DiffieHellman.prototype._keyCheck = function (pk, isPub) { - assert.object(pk, 'key'); - if (!isPub) - utils.assertCompatible(pk, PrivateKey, [1, 3], 'key'); - utils.assertCompatible(pk, Key, [1, 4], 'key'); - - if (pk.type !== this._algo) { - throw (new Error('A ' + pk.type + ' key cannot be used in ' + - this._algo + ' Diffie-Hellman')); - } - - if (pk.curve !== this._curve) { - throw (new Error('A key from the ' + pk.curve + ' curve ' + - 'cannot be used with a ' + this._curve + - ' Diffie-Hellman')); - } - - if (pk.type === 'dsa') { - assert.deepEqual(pk.part.p, this._p, - 'DSA key prime does not match'); - assert.deepEqual(pk.part.g, this._g, - 'DSA key generator does not match'); - } -}; - -DiffieHellman.prototype.setKey = function (pk) { - this._keyCheck(pk); - - if (pk.type === 'dsa') { - this._dh.setPrivateKey(pk.part.x.data); - this._dh.setPublicKey(pk.part.y.data); - - } else if (pk.type === 'ecdsa') { - if (CRYPTO_HAVE_ECDH) { - this._dh.setPrivateKey(pk.part.d.data); - this._dh.setPublicKey(pk.part.Q.data); - } else { - this._priv = new ECPrivate( - this._ecParams, pk.part.d.data); - } - - } else if (pk.type === 'curve25519') { - var k = pk.part.k; - if (!pk.part.k) - k = pk.part.r; - this._priv = k.data; - if (this._priv[0] === 0x00) - this._priv = this._priv.slice(1); - this._priv = this._priv.slice(0, 32); - } - this._key = pk; - this._isPriv = true; -}; -DiffieHellman.prototype.setPrivateKey = DiffieHellman.prototype.setKey; - -DiffieHellman.prototype.computeSecret = function (otherpk) { - this._keyCheck(otherpk, true); - if (!this._isPriv) - throw (new Error('DH exchange has not been initialized with ' + - 'a private key yet')); - - var pub; - if (this._algo === 'dsa') { - return (this._dh.computeSecret( - otherpk.part.y.data)); - - } else if (this._algo === 'ecdsa') { - if (CRYPTO_HAVE_ECDH) { - return (this._dh.computeSecret( - otherpk.part.Q.data)); - } else { - pub = new ECPublic( - this._ecParams, otherpk.part.Q.data); - return (this._priv.deriveSharedSecret(pub)); - } - - } else if (this._algo === 'curve25519') { - pub = otherpk.part.A.data; - while (pub[0] === 0x00 && pub.length > 32) - pub = pub.slice(1); - var priv = this._priv; - assert.strictEqual(pub.length, 32); - assert.strictEqual(priv.length, 32); - - var secret = nacl.box.before(new Uint8Array(pub), - new Uint8Array(priv)); - - return (Buffer.from(secret)); - } - - throw (new Error('Invalid algorithm: ' + this._algo)); -}; - -DiffieHellman.prototype.generateKey = function () { - var parts = []; - var priv, pub; - if (this._algo === 'dsa') { - this._dh.generateKeys(); - - parts.push({name: 'p', data: this._p.data}); - parts.push({name: 'q', data: this._key.part.q.data}); - parts.push({name: 'g', data: this._g.data}); - parts.push({name: 'y', data: this._dh.getPublicKey()}); - parts.push({name: 'x', data: this._dh.getPrivateKey()}); - this._key = new PrivateKey({ - type: 'dsa', - parts: parts - }); - this._isPriv = true; - return (this._key); - - } else if (this._algo === 'ecdsa') { - if (CRYPTO_HAVE_ECDH) { - this._dh.generateKeys(); - - parts.push({name: 'curve', - data: Buffer.from(this._curve)}); - parts.push({name: 'Q', data: this._dh.getPublicKey()}); - parts.push({name: 'd', data: this._dh.getPrivateKey()}); - this._key = new PrivateKey({ - type: 'ecdsa', - curve: this._curve, - parts: parts - }); - this._isPriv = true; - return (this._key); - - } else { - var n = this._ecParams.getN(); - var r = new jsbn(crypto.randomBytes(n.bitLength())); - var n1 = n.subtract(jsbn.ONE); - priv = r.mod(n1).add(jsbn.ONE); - pub = this._ecParams.getG().multiply(priv); - - priv = Buffer.from(priv.toByteArray()); - pub = Buffer.from(this._ecParams.getCurve(). - encodePointHex(pub), 'hex'); - - this._priv = new ECPrivate(this._ecParams, priv); - - parts.push({name: 'curve', - data: Buffer.from(this._curve)}); - parts.push({name: 'Q', data: pub}); - parts.push({name: 'd', data: priv}); - - this._key = new PrivateKey({ - type: 'ecdsa', - curve: this._curve, - parts: parts - }); - this._isPriv = true; - return (this._key); - } - - } else if (this._algo === 'curve25519') { - var pair = nacl.box.keyPair(); - priv = Buffer.from(pair.secretKey); - pub = Buffer.from(pair.publicKey); - priv = Buffer.concat([priv, pub]); - assert.strictEqual(priv.length, 64); - assert.strictEqual(pub.length, 32); - - parts.push({name: 'A', data: pub}); - parts.push({name: 'k', data: priv}); - this._key = new PrivateKey({ - type: 'curve25519', - parts: parts - }); - this._isPriv = true; - return (this._key); - } - - throw (new Error('Invalid algorithm: ' + this._algo)); -}; -DiffieHellman.prototype.generateKeys = DiffieHellman.prototype.generateKey; - -/* These are helpers for using ecc-jsbn (for node 0.10 compatibility). */ - -function X9ECParameters(name) { - var params = algs.curves[name]; - assert.object(params); - - var p = new jsbn(params.p); - var a = new jsbn(params.a); - var b = new jsbn(params.b); - var n = new jsbn(params.n); - var h = jsbn.ONE; - var curve = new ec.ECCurveFp(p, a, b); - var G = curve.decodePointHex(params.G.toString('hex')); - - this.curve = curve; - this.g = G; - this.n = n; - this.h = h; -} -X9ECParameters.prototype.getCurve = function () { return (this.curve); }; -X9ECParameters.prototype.getG = function () { return (this.g); }; -X9ECParameters.prototype.getN = function () { return (this.n); }; -X9ECParameters.prototype.getH = function () { return (this.h); }; - -function ECPublic(params, buffer) { - this._params = params; - if (buffer[0] === 0x00) - buffer = buffer.slice(1); - this._pub = params.getCurve().decodePointHex(buffer.toString('hex')); -} - -function ECPrivate(params, buffer) { - this._params = params; - this._priv = new jsbn(utils.mpNormalize(buffer)); -} -ECPrivate.prototype.deriveSharedSecret = function (pubKey) { - assert.ok(pubKey instanceof ECPublic); - var S = pubKey._pub.multiply(this._priv); - return (Buffer.from(S.getX().toBigInteger().toByteArray())); -}; - -function generateED25519() { - if (nacl === undefined) - nacl = __webpack_require__(71); - - var pair = nacl.sign.keyPair(); - var priv = Buffer.from(pair.secretKey); - var pub = Buffer.from(pair.publicKey); - assert.strictEqual(priv.length, 64); - assert.strictEqual(pub.length, 32); - - var parts = []; - parts.push({name: 'A', data: pub}); - parts.push({name: 'k', data: priv.slice(0, 32)}); - var key = new PrivateKey({ - type: 'ed25519', - parts: parts - }); - return (key); -} - -/* Generates a new ECDSA private key on a given curve. */ -function generateECDSA(curve) { - var parts = []; - var key; - - if (CRYPTO_HAVE_ECDH) { - /* - * Node crypto doesn't expose key generation directly, but the - * ECDH instances can generate keys. It turns out this just - * calls into the OpenSSL generic key generator, and we can - * read its output happily without doing an actual DH. So we - * use that here. - */ - var osCurve = { - 'nistp256': 'prime256v1', - 'nistp384': 'secp384r1', - 'nistp521': 'secp521r1' - }[curve]; - - var dh = crypto.createECDH(osCurve); - dh.generateKeys(); - - parts.push({name: 'curve', - data: Buffer.from(curve)}); - parts.push({name: 'Q', data: dh.getPublicKey()}); - parts.push({name: 'd', data: dh.getPrivateKey()}); - - key = new PrivateKey({ - type: 'ecdsa', - curve: curve, - parts: parts - }); - return (key); - } else { - if (ecdh === undefined) - ecdh = __webpack_require__(356); - if (ec === undefined) - ec = __webpack_require__(129); - if (jsbn === undefined) - jsbn = __webpack_require__(79).BigInteger; - - var ecParams = new X9ECParameters(curve); - - /* This algorithm taken from FIPS PUB 186-4 (section B.4.1) */ - var n = ecParams.getN(); - /* - * The crypto.randomBytes() function can only give us whole - * bytes, so taking a nod from X9.62, we round up. - */ - var cByteLen = Math.ceil((n.bitLength() + 64) / 8); - var c = new jsbn(crypto.randomBytes(cByteLen)); - - var n1 = n.subtract(jsbn.ONE); - var priv = c.mod(n1).add(jsbn.ONE); - var pub = ecParams.getG().multiply(priv); - - priv = Buffer.from(priv.toByteArray()); - pub = Buffer.from(ecParams.getCurve(). - encodePointHex(pub), 'hex'); - - parts.push({name: 'curve', data: Buffer.from(curve)}); - parts.push({name: 'Q', data: pub}); - parts.push({name: 'd', data: priv}); - - key = new PrivateKey({ - type: 'ecdsa', - curve: curve, - parts: parts - }); - return (key); - } +var Stream = __webpack_require__(23); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = __webpack_require__(405); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = __webpack_require__(407); + exports.Duplex = __webpack_require__(115); + exports.Transform = __webpack_require__(406); + exports.PassThrough = __webpack_require__(792); } /***/ }), -/* 266 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2017 Joyent, Inc. - -module.exports = { - read: read, - write: write -}; - -var assert = __webpack_require__(22); -var Buffer = __webpack_require__(20).Buffer; -var Key = __webpack_require__(34); -var PrivateKey = __webpack_require__(39); -var utils = __webpack_require__(32); -var SSHBuffer = __webpack_require__(147); -var Dhe = __webpack_require__(265); - -var supportedAlgos = { - 'rsa-sha1' : 5, - 'rsa-sha256' : 8, - 'rsa-sha512' : 10, - 'ecdsa-p256-sha256' : 13, - 'ecdsa-p384-sha384' : 14 - /* - * ed25519 is hypothetically supported with id 15 - * but the common tools available don't appear to be - * capable of generating/using ed25519 keys - */ -}; - -var supportedAlgosById = {}; -Object.keys(supportedAlgos).forEach(function (k) { - supportedAlgosById[supportedAlgos[k]] = k.toUpperCase(); -}); - -function read(buf, options) { - if (typeof (buf) !== 'string') { - assert.buffer(buf, 'buf'); - buf = buf.toString('ascii'); - } - var lines = buf.split('\n'); - if (lines[0].match(/^Private-key-format\: v1/)) { - var algElems = lines[1].split(' '); - var algoNum = parseInt(algElems[1], 10); - var algoName = algElems[2]; - if (!supportedAlgosById[algoNum]) - throw (new Error('Unsupported algorithm: ' + algoName)); - return (readDNSSECPrivateKey(algoNum, lines.slice(2))); - } - - // skip any comment-lines - var line = 0; - /* JSSTYLED */ - while (lines[line].match(/^\;/)) - line++; - // we should now have *one single* line left with our KEY on it. - if ((lines[line].match(/\. IN KEY /) || - lines[line].match(/\. IN DNSKEY /)) && lines[line+1].length === 0) { - return (readRFC3110(lines[line])); - } - throw (new Error('Cannot parse dnssec key')); -} - -function readRFC3110(keyString) { - var elems = keyString.split(' '); - //unused var flags = parseInt(elems[3], 10); - //unused var protocol = parseInt(elems[4], 10); - var algorithm = parseInt(elems[5], 10); - if (!supportedAlgosById[algorithm]) - throw (new Error('Unsupported algorithm: ' + algorithm)); - var base64key = elems.slice(6, elems.length).join(); - var keyBuffer = Buffer.from(base64key, 'base64'); - if (supportedAlgosById[algorithm].match(/^RSA-/)) { - // join the rest of the body into a single base64-blob - var publicExponentLen = keyBuffer.readUInt8(0); - if (publicExponentLen != 3 && publicExponentLen != 1) - throw (new Error('Cannot parse dnssec key: ' + - 'unsupported exponent length')); - - var publicExponent = keyBuffer.slice(1, publicExponentLen+1); - publicExponent = utils.mpNormalize(publicExponent); - var modulus = keyBuffer.slice(1+publicExponentLen); - modulus = utils.mpNormalize(modulus); - // now, make the key - var rsaKey = { - type: 'rsa', - parts: [] - }; - rsaKey.parts.push({ name: 'e', data: publicExponent}); - rsaKey.parts.push({ name: 'n', data: modulus}); - return (new Key(rsaKey)); - } - if (supportedAlgosById[algorithm] === 'ECDSA-P384-SHA384' || - supportedAlgosById[algorithm] === 'ECDSA-P256-SHA256') { - var curve = 'nistp384'; - var size = 384; - if (supportedAlgosById[algorithm].match(/^ECDSA-P256-SHA256/)) { - curve = 'nistp256'; - size = 256; - } - - var ecdsaKey = { - type: 'ecdsa', - curve: curve, - size: size, - parts: [ - {name: 'curve', data: Buffer.from(curve) }, - {name: 'Q', data: utils.ecNormalize(keyBuffer) } - ] - }; - return (new Key(ecdsaKey)); - } - throw (new Error('Unsupported algorithm: ' + - supportedAlgosById[algorithm])); -} - -function elementToBuf(e) { - return (Buffer.from(e.split(' ')[1], 'base64')); -} - -function readDNSSECRSAPrivateKey(elements) { - var rsaParams = {}; - elements.forEach(function (element) { - if (element.split(' ')[0] === 'Modulus:') - rsaParams['n'] = elementToBuf(element); - else if (element.split(' ')[0] === 'PublicExponent:') - rsaParams['e'] = elementToBuf(element); - else if (element.split(' ')[0] === 'PrivateExponent:') - rsaParams['d'] = elementToBuf(element); - else if (element.split(' ')[0] === 'Prime1:') - rsaParams['p'] = elementToBuf(element); - else if (element.split(' ')[0] === 'Prime2:') - rsaParams['q'] = elementToBuf(element); - else if (element.split(' ')[0] === 'Exponent1:') - rsaParams['dmodp'] = elementToBuf(element); - else if (element.split(' ')[0] === 'Exponent2:') - rsaParams['dmodq'] = elementToBuf(element); - else if (element.split(' ')[0] === 'Coefficient:') - rsaParams['iqmp'] = elementToBuf(element); - }); - // now, make the key - var key = { - type: 'rsa', - parts: [ - { name: 'e', data: utils.mpNormalize(rsaParams['e'])}, - { name: 'n', data: utils.mpNormalize(rsaParams['n'])}, - { name: 'd', data: utils.mpNormalize(rsaParams['d'])}, - { name: 'p', data: utils.mpNormalize(rsaParams['p'])}, - { name: 'q', data: utils.mpNormalize(rsaParams['q'])}, - { name: 'dmodp', - data: utils.mpNormalize(rsaParams['dmodp'])}, - { name: 'dmodq', - data: utils.mpNormalize(rsaParams['dmodq'])}, - { name: 'iqmp', - data: utils.mpNormalize(rsaParams['iqmp'])} - ] - }; - return (new PrivateKey(key)); -} - -function readDNSSECPrivateKey(alg, elements) { - if (supportedAlgosById[alg].match(/^RSA-/)) { - return (readDNSSECRSAPrivateKey(elements)); - } - if (supportedAlgosById[alg] === 'ECDSA-P384-SHA384' || - supportedAlgosById[alg] === 'ECDSA-P256-SHA256') { - var d = Buffer.from(elements[0].split(' ')[1], 'base64'); - var curve = 'nistp384'; - var size = 384; - if (supportedAlgosById[alg] === 'ECDSA-P256-SHA256') { - curve = 'nistp256'; - size = 256; - } - // DNSSEC generates the public-key on the fly (go calculate it) - var publicKey = utils.publicFromPrivateECDSA(curve, d); - var Q = publicKey.part['Q'].data; - var ecdsaKey = { - type: 'ecdsa', - curve: curve, - size: size, - parts: [ - {name: 'curve', data: Buffer.from(curve) }, - {name: 'd', data: d }, - {name: 'Q', data: Q } - ] - }; - return (new PrivateKey(ecdsaKey)); - } - throw (new Error('Unsupported algorithm: ' + supportedAlgosById[alg])); -} - -function dnssecTimestamp(date) { - var year = date.getFullYear() + ''; //stringify - var month = (date.getMonth() + 1); - var timestampStr = year + month + date.getUTCDate(); - timestampStr += '' + date.getUTCHours() + date.getUTCMinutes(); - timestampStr += date.getUTCSeconds(); - return (timestampStr); -} - -function rsaAlgFromOptions(opts) { - if (!opts || !opts.hashAlgo || opts.hashAlgo === 'sha1') - return ('5 (RSASHA1)'); - else if (opts.hashAlgo === 'sha256') - return ('8 (RSASHA256)'); - else if (opts.hashAlgo === 'sha512') - return ('10 (RSASHA512)'); - else - throw (new Error('Unknown or unsupported hash: ' + - opts.hashAlgo)); -} - -function writeRSA(key, options) { - // if we're missing parts, add them. - if (!key.part.dmodp || !key.part.dmodq) { - utils.addRSAMissing(key); - } - - var out = ''; - out += 'Private-key-format: v1.3\n'; - out += 'Algorithm: ' + rsaAlgFromOptions(options) + '\n'; - var n = utils.mpDenormalize(key.part['n'].data); - out += 'Modulus: ' + n.toString('base64') + '\n'; - var e = utils.mpDenormalize(key.part['e'].data); - out += 'PublicExponent: ' + e.toString('base64') + '\n'; - var d = utils.mpDenormalize(key.part['d'].data); - out += 'PrivateExponent: ' + d.toString('base64') + '\n'; - var p = utils.mpDenormalize(key.part['p'].data); - out += 'Prime1: ' + p.toString('base64') + '\n'; - var q = utils.mpDenormalize(key.part['q'].data); - out += 'Prime2: ' + q.toString('base64') + '\n'; - var dmodp = utils.mpDenormalize(key.part['dmodp'].data); - out += 'Exponent1: ' + dmodp.toString('base64') + '\n'; - var dmodq = utils.mpDenormalize(key.part['dmodq'].data); - out += 'Exponent2: ' + dmodq.toString('base64') + '\n'; - var iqmp = utils.mpDenormalize(key.part['iqmp'].data); - out += 'Coefficient: ' + iqmp.toString('base64') + '\n'; - // Assume that we're valid as-of now - var timestamp = new Date(); - out += 'Created: ' + dnssecTimestamp(timestamp) + '\n'; - out += 'Publish: ' + dnssecTimestamp(timestamp) + '\n'; - out += 'Activate: ' + dnssecTimestamp(timestamp) + '\n'; - return (Buffer.from(out, 'ascii')); -} - -function writeECDSA(key, options) { - var out = ''; - out += 'Private-key-format: v1.3\n'; - - if (key.curve === 'nistp256') { - out += 'Algorithm: 13 (ECDSAP256SHA256)\n'; - } else if (key.curve === 'nistp384') { - out += 'Algorithm: 14 (ECDSAP384SHA384)\n'; - } else { - throw (new Error('Unsupported curve')); - } - var base64Key = key.part['d'].data.toString('base64'); - out += 'PrivateKey: ' + base64Key + '\n'; - - // Assume that we're valid as-of now - var timestamp = new Date(); - out += 'Created: ' + dnssecTimestamp(timestamp) + '\n'; - out += 'Publish: ' + dnssecTimestamp(timestamp) + '\n'; - out += 'Activate: ' + dnssecTimestamp(timestamp) + '\n'; - - return (Buffer.from(out, 'ascii')); -} - -function write(key, options) { - if (PrivateKey.isPrivateKey(key)) { - if (key.type === 'rsa') { - return (writeRSA(key, options)); - } else if (key.type === 'ecdsa') { - return (writeECDSA(key, options)); - } else { - throw (new Error('Unsupported algorithm: ' + key.type)); - } - } else if (Key.isKey(key)) { - /* - * RFC3110 requires a keyname, and a keytype, which we - * don't really have a mechanism for specifying such - * additional metadata. - */ - throw (new Error('Format "dnssec" only supports ' + - 'writing private keys')); - } else { - throw (new Error('key is not a Key or PrivateKey')); - } -} - - -/***/ }), -/* 267 */ +/* 103 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = { - read: read, - readPkcs1: readPkcs1, + read: read.bind(undefined, false, undefined), + readType: read.bind(undefined, false), write: write, - writePkcs1: writePkcs1 + /* semi-private api, used by sshpk-agent */ + readPartial: read.bind(undefined, true), + + /* shared with ssh format */ + readInternal: read, + keyTypeToAlg: keyTypeToAlg, + algToKeyType: algToKeyType }; -var assert = __webpack_require__(22); -var asn1 = __webpack_require__(66); -var Buffer = __webpack_require__(20).Buffer; -var algs = __webpack_require__(38); -var utils = __webpack_require__(32); +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var utils = __webpack_require__(26); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(33); +var SSHBuffer = __webpack_require__(159); -var Key = __webpack_require__(34); -var PrivateKey = __webpack_require__(39); -var pem = __webpack_require__(82); +function algToKeyType(alg) { + assert.string(alg); + if (alg === 'ssh-dss') + return ('dsa'); + else if (alg === 'ssh-rsa') + return ('rsa'); + else if (alg === 'ssh-ed25519') + return ('ed25519'); + else if (alg === 'ssh-curve25519') + return ('curve25519'); + else if (alg.match(/^ecdsa-sha2-/)) + return ('ecdsa'); + else + throw (new Error('Unknown algorithm ' + alg)); +} -var pkcs8 = __webpack_require__(145); -var readECDSACurve = pkcs8.readECDSACurve; +function keyTypeToAlg(key) { + assert.object(key); + if (key.type === 'dsa') + return ('ssh-dss'); + else if (key.type === 'rsa') + return ('ssh-rsa'); + else if (key.type === 'ed25519') + return ('ssh-ed25519'); + else if (key.type === 'curve25519') + return ('ssh-curve25519'); + else if (key.type === 'ecdsa') + return ('ecdsa-sha2-' + key.part.curve.data.toString()); + else + throw (new Error('Unknown key type ' + key.type)); +} -function read(buf, options) { - return (pem.read(buf, options, 'pkcs1')); +function read(partial, type, buf, options) { + if (typeof (buf) === 'string') + buf = Buffer.from(buf); + assert.buffer(buf, 'buf'); + + var key = {}; + + var parts = key.parts = []; + var sshbuf = new SSHBuffer({buffer: buf}); + + var alg = sshbuf.readString(); + assert.ok(!sshbuf.atEnd(), 'key must have at least one part'); + + key.type = algToKeyType(alg); + + var partCount = algs.info[key.type].parts.length; + if (type && type === 'private') + partCount = algs.privInfo[key.type].parts.length; + + while (!sshbuf.atEnd() && parts.length < partCount) + parts.push(sshbuf.readPart()); + while (!partial && !sshbuf.atEnd()) + parts.push(sshbuf.readPart()); + + assert.ok(parts.length >= 1, + 'key must have at least one part'); + assert.ok(partial || sshbuf.atEnd(), + 'leftover bytes at end of key'); + + var Constructor = Key; + var algInfo = algs.info[key.type]; + if (type === 'private' || algInfo.parts.length !== parts.length) { + algInfo = algs.privInfo[key.type]; + Constructor = PrivateKey; + } + assert.strictEqual(algInfo.parts.length, parts.length); + + if (key.type === 'ecdsa') { + var res = /^ecdsa-sha2-(.+)$/.exec(alg); + assert.ok(res !== null); + assert.strictEqual(res[1], parts[0].data.toString()); + } + + var normalized = true; + for (var i = 0; i < algInfo.parts.length; ++i) { + var p = parts[i]; + p.name = algInfo.parts[i]; + /* + * OpenSSH stores ed25519 "private" keys as seed + public key + * concat'd together (k followed by A). We want to keep them + * separate for other formats that don't do this. + */ + if (key.type === 'ed25519' && p.name === 'k') + p.data = p.data.slice(0, 32); + + if (p.name !== 'curve' && algInfo.normalize !== false) { + var nd; + if (key.type === 'ed25519') { + nd = utils.zeroPadToLength(p.data, 32); + } else { + nd = utils.mpNormalize(p.data); + } + if (nd.toString('binary') !== + p.data.toString('binary')) { + p.data = nd; + normalized = false; + } + } + } + + if (normalized) + key._rfc4253Cache = sshbuf.toBuffer(); + + if (partial && typeof (partial) === 'object') { + partial.remainder = sshbuf.remainder(); + partial.consumed = sshbuf._offset; + } + + return (new Constructor(key)); } function write(key, options) { - return (pem.write(key, options, 'pkcs1')); -} + assert.object(key); -/* Helper to read in a single mpint */ -function readMPInt(der, nm) { - assert.strictEqual(der.peek(), asn1.Ber.Integer, - nm + ' is not an Integer'); - return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); -} + var alg = keyTypeToAlg(key); + var i; -function readPkcs1(alg, type, der) { - switch (alg) { - case 'RSA': - if (type === 'public') - return (readPkcs1RSAPublic(der)); - else if (type === 'private') - return (readPkcs1RSAPrivate(der)); - throw (new Error('Unknown key type: ' + type)); - case 'DSA': - if (type === 'public') - return (readPkcs1DSAPublic(der)); - else if (type === 'private') - return (readPkcs1DSAPrivate(der)); - throw (new Error('Unknown key type: ' + type)); - case 'EC': - case 'ECDSA': - if (type === 'private') - return (readPkcs1ECDSAPrivate(der)); - else if (type === 'public') - return (readPkcs1ECDSAPublic(der)); - throw (new Error('Unknown key type: ' + type)); - case 'EDDSA': - case 'EdDSA': - if (type === 'private') - return (readPkcs1EdDSAPrivate(der)); - throw (new Error(type + ' keys not supported with EdDSA')); - default: - throw (new Error('Unknown key algo: ' + alg)); - } -} + var algInfo = algs.info[key.type]; + if (PrivateKey.isPrivateKey(key)) + algInfo = algs.privInfo[key.type]; + var parts = algInfo.parts; -function readPkcs1RSAPublic(der) { - // modulus and exponent - var n = readMPInt(der, 'modulus'); - var e = readMPInt(der, 'exponent'); + var buf = new SSHBuffer({}); - // now, make the key - var key = { - type: 'rsa', - parts: [ - { name: 'e', data: e }, - { name: 'n', data: n } - ] - }; + buf.writeString(alg); - return (new Key(key)); -} - -function readPkcs1RSAPrivate(der) { - var version = readMPInt(der, 'version'); - assert.strictEqual(version[0], 0); - - // modulus then public exponent - var n = readMPInt(der, 'modulus'); - var e = readMPInt(der, 'public exponent'); - var d = readMPInt(der, 'private exponent'); - var p = readMPInt(der, 'prime1'); - var q = readMPInt(der, 'prime2'); - var dmodp = readMPInt(der, 'exponent1'); - var dmodq = readMPInt(der, 'exponent2'); - var iqmp = readMPInt(der, 'iqmp'); - - // now, make the key - var key = { - type: 'rsa', - parts: [ - { name: 'n', data: n }, - { name: 'e', data: e }, - { name: 'd', data: d }, - { name: 'iqmp', data: iqmp }, - { name: 'p', data: p }, - { name: 'q', data: q }, - { name: 'dmodp', data: dmodp }, - { name: 'dmodq', data: dmodq } - ] - }; - - return (new PrivateKey(key)); -} - -function readPkcs1DSAPrivate(der) { - var version = readMPInt(der, 'version'); - assert.strictEqual(version.readUInt8(0), 0); - - var p = readMPInt(der, 'p'); - var q = readMPInt(der, 'q'); - var g = readMPInt(der, 'g'); - var y = readMPInt(der, 'y'); - var x = readMPInt(der, 'x'); - - // now, make the key - var key = { - type: 'dsa', - parts: [ - { name: 'p', data: p }, - { name: 'q', data: q }, - { name: 'g', data: g }, - { name: 'y', data: y }, - { name: 'x', data: x } - ] - }; - - return (new PrivateKey(key)); -} - -function readPkcs1EdDSAPrivate(der) { - var version = readMPInt(der, 'version'); - assert.strictEqual(version.readUInt8(0), 1); - - // private key - var k = der.readString(asn1.Ber.OctetString, true); - - der.readSequence(0xa0); - var oid = der.readOID(); - assert.strictEqual(oid, '1.3.101.112', 'the ed25519 curve identifier'); - - der.readSequence(0xa1); - var A = utils.readBitString(der); - - var key = { - type: 'ed25519', - parts: [ - { name: 'A', data: utils.zeroPadToLength(A, 32) }, - { name: 'k', data: k } - ] - }; - - return (new PrivateKey(key)); -} - -function readPkcs1DSAPublic(der) { - var y = readMPInt(der, 'y'); - var p = readMPInt(der, 'p'); - var q = readMPInt(der, 'q'); - var g = readMPInt(der, 'g'); - - var key = { - type: 'dsa', - parts: [ - { name: 'y', data: y }, - { name: 'p', data: p }, - { name: 'q', data: q }, - { name: 'g', data: g } - ] - }; - - return (new Key(key)); -} - -function readPkcs1ECDSAPublic(der) { - der.readSequence(); - - var oid = der.readOID(); - assert.strictEqual(oid, '1.2.840.10045.2.1', 'must be ecPublicKey'); - - var curveOid = der.readOID(); - - var curve; - var curves = Object.keys(algs.curves); - for (var j = 0; j < curves.length; ++j) { - var c = curves[j]; - var cd = algs.curves[c]; - if (cd.pkcs8oid === curveOid) { - curve = c; - break; + for (i = 0; i < parts.length; ++i) { + var data = key.part[parts[i]].data; + if (algInfo.normalize !== false) { + if (key.type === 'ed25519') + data = utils.zeroPadToLength(data, 32); + else + data = utils.mpNormalize(data); } - } - assert.string(curve, 'a known ECDSA named curve'); - - var Q = der.readString(asn1.Ber.BitString, true); - Q = utils.ecNormalize(Q); - - var key = { - type: 'ecdsa', - parts: [ - { name: 'curve', data: Buffer.from(curve) }, - { name: 'Q', data: Q } - ] - }; - - return (new Key(key)); -} - -function readPkcs1ECDSAPrivate(der) { - var version = readMPInt(der, 'version'); - assert.strictEqual(version.readUInt8(0), 1); - - // private key - var d = der.readString(asn1.Ber.OctetString, true); - - der.readSequence(0xa0); - var curve = readECDSACurve(der); - assert.string(curve, 'a known elliptic curve'); - - der.readSequence(0xa1); - var Q = der.readString(asn1.Ber.BitString, true); - Q = utils.ecNormalize(Q); - - var key = { - type: 'ecdsa', - parts: [ - { name: 'curve', data: Buffer.from(curve) }, - { name: 'Q', data: Q }, - { name: 'd', data: d } - ] - }; - - return (new PrivateKey(key)); -} - -function writePkcs1(der, key) { - der.startSequence(); - - switch (key.type) { - case 'rsa': - if (PrivateKey.isPrivateKey(key)) - writePkcs1RSAPrivate(der, key); - else - writePkcs1RSAPublic(der, key); - break; - case 'dsa': - if (PrivateKey.isPrivateKey(key)) - writePkcs1DSAPrivate(der, key); - else - writePkcs1DSAPublic(der, key); - break; - case 'ecdsa': - if (PrivateKey.isPrivateKey(key)) - writePkcs1ECDSAPrivate(der, key); - else - writePkcs1ECDSAPublic(der, key); - break; - case 'ed25519': - if (PrivateKey.isPrivateKey(key)) - writePkcs1EdDSAPrivate(der, key); - else - writePkcs1EdDSAPublic(der, key); - break; - default: - throw (new Error('Unknown key algo: ' + key.type)); + if (key.type === 'ed25519' && parts[i] === 'k') + data = Buffer.concat([data, key.part.A.data]); + buf.writeBuffer(data); } - der.endSequence(); -} - -function writePkcs1RSAPublic(der, key) { - der.writeBuffer(key.part.n.data, asn1.Ber.Integer); - der.writeBuffer(key.part.e.data, asn1.Ber.Integer); -} - -function writePkcs1RSAPrivate(der, key) { - var ver = Buffer.from([0]); - der.writeBuffer(ver, asn1.Ber.Integer); - - der.writeBuffer(key.part.n.data, asn1.Ber.Integer); - der.writeBuffer(key.part.e.data, asn1.Ber.Integer); - der.writeBuffer(key.part.d.data, asn1.Ber.Integer); - der.writeBuffer(key.part.p.data, asn1.Ber.Integer); - der.writeBuffer(key.part.q.data, asn1.Ber.Integer); - if (!key.part.dmodp || !key.part.dmodq) - utils.addRSAMissing(key); - der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer); - der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer); - der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer); -} - -function writePkcs1DSAPrivate(der, key) { - var ver = Buffer.from([0]); - der.writeBuffer(ver, asn1.Ber.Integer); - - der.writeBuffer(key.part.p.data, asn1.Ber.Integer); - der.writeBuffer(key.part.q.data, asn1.Ber.Integer); - der.writeBuffer(key.part.g.data, asn1.Ber.Integer); - der.writeBuffer(key.part.y.data, asn1.Ber.Integer); - der.writeBuffer(key.part.x.data, asn1.Ber.Integer); -} - -function writePkcs1DSAPublic(der, key) { - der.writeBuffer(key.part.y.data, asn1.Ber.Integer); - der.writeBuffer(key.part.p.data, asn1.Ber.Integer); - der.writeBuffer(key.part.q.data, asn1.Ber.Integer); - der.writeBuffer(key.part.g.data, asn1.Ber.Integer); -} - -function writePkcs1ECDSAPublic(der, key) { - der.startSequence(); - - der.writeOID('1.2.840.10045.2.1'); /* ecPublicKey */ - var curve = key.part.curve.data.toString(); - var curveOid = algs.curves[curve].pkcs8oid; - assert.string(curveOid, 'a known ECDSA named curve'); - der.writeOID(curveOid); - - der.endSequence(); - - var Q = utils.ecNormalize(key.part.Q.data, true); - der.writeBuffer(Q, asn1.Ber.BitString); -} - -function writePkcs1ECDSAPrivate(der, key) { - var ver = Buffer.from([1]); - der.writeBuffer(ver, asn1.Ber.Integer); - - der.writeBuffer(key.part.d.data, asn1.Ber.OctetString); - - der.startSequence(0xa0); - var curve = key.part.curve.data.toString(); - var curveOid = algs.curves[curve].pkcs8oid; - assert.string(curveOid, 'a known ECDSA named curve'); - der.writeOID(curveOid); - der.endSequence(); - - der.startSequence(0xa1); - var Q = utils.ecNormalize(key.part.Q.data, true); - der.writeBuffer(Q, asn1.Ber.BitString); - der.endSequence(); -} - -function writePkcs1EdDSAPrivate(der, key) { - var ver = Buffer.from([1]); - der.writeBuffer(ver, asn1.Ber.Integer); - - der.writeBuffer(key.part.k.data, asn1.Ber.OctetString); - - der.startSequence(0xa0); - der.writeOID('1.3.101.112'); - der.endSequence(); - - der.startSequence(0xa1); - utils.writeBitString(der, key.part.A.data); - der.endSequence(); -} - -function writePkcs1EdDSAPublic(der, key) { - throw (new Error('Public keys are not supported for EdDSA PKCS#1')); + return (buf.toBuffer()); } /***/ }), -/* 268 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -var Key = __webpack_require__(34); -var Fingerprint = __webpack_require__(144); -var Signature = __webpack_require__(70); -var PrivateKey = __webpack_require__(39); -var Certificate = __webpack_require__(143); -var Identity = __webpack_require__(146); -var errs = __webpack_require__(69); - -module.exports = { - /* top-level classes */ - Key: Key, - parseKey: Key.parse, - Fingerprint: Fingerprint, - parseFingerprint: Fingerprint.parse, - Signature: Signature, - parseSignature: Signature.parse, - PrivateKey: PrivateKey, - parsePrivateKey: PrivateKey.parse, - generatePrivateKey: PrivateKey.generate, - Certificate: Certificate, - parseCertificate: Certificate.parse, - createSelfSignedCertificate: Certificate.createSelfSigned, - createCertificate: Certificate.create, - Identity: Identity, - identityFromDN: Identity.parseDN, - identityForHost: Identity.forHost, - identityForUser: Identity.forUser, - identityForEmail: Identity.forEmail, - - /* errors */ - FingerprintFormatError: errs.FingerprintFormatError, - InvalidAlgorithmError: errs.InvalidAlgorithmError, - KeyParseError: errs.KeyParseError, - SignatureParseError: errs.SignatureParseError, - KeyEncryptedError: errs.KeyEncryptedError, - CertificateParseError: errs.CertificateParseError -}; - - -/***/ }), -/* 269 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const ansiRegex = __webpack_require__(1020); - -module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; - - -/***/ }), -/* 270 */ +/* 104 */ /***/ (function(module, exports) { -module.exports = require("child_process"); +module.exports = require("tty"); /***/ }), -/* 271 */ -/***/ (function(module, exports) { - -module.exports = require("punycode"); - -/***/ }), -/* 272 */ -/***/ (function(module, exports) { - -module.exports = require("string_decoder"); - -/***/ }), -/* 273 */ +/* 105 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56499,7584 +34365,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); -} - -var _access; - -function _load_access() { - return _access = _interopRequireWildcard(__webpack_require__(512)); -} - -var _add; - -function _load_add() { - return _add = _interopRequireWildcard(__webpack_require__(154)); -} - -var _audit; - -function _load_audit() { - return _audit = _interopRequireWildcard(__webpack_require__(295)); -} - -var _autoclean; - -function _load_autoclean() { - return _autoclean = _interopRequireWildcard(__webpack_require__(296)); -} - -var _bin; - -function _load_bin() { - return _bin = _interopRequireWildcard(__webpack_require__(513)); -} - -var _cache; - -function _load_cache() { - return _cache = _interopRequireWildcard(__webpack_require__(297)); -} - -var _check; - -function _load_check() { - return _check = _interopRequireWildcard(__webpack_require__(298)); -} - -var _config; - -function _load_config() { - return _config = _interopRequireWildcard(__webpack_require__(514)); -} - -var _create; - -function _load_create() { - return _create = _interopRequireWildcard(__webpack_require__(515)); -} - -var _exec; - -function _load_exec() { - return _exec = _interopRequireWildcard(__webpack_require__(516)); -} - -var _generateLockEntry; - -function _load_generateLockEntry() { - return _generateLockEntry = _interopRequireWildcard(__webpack_require__(517)); -} - -var _global; - -function _load_global() { - return _global = _interopRequireWildcard(__webpack_require__(115)); -} - -var _help; - -function _load_help() { - return _help = _interopRequireWildcard(__webpack_require__(518)); -} - -var _import; - -function _load_import() { - return _import = _interopRequireWildcard(__webpack_require__(519)); -} - -var _info; - -function _load_info() { - return _info = _interopRequireWildcard(__webpack_require__(520)); -} - -var _init; - -function _load_init() { - return _init = _interopRequireWildcard(__webpack_require__(521)); -} - -var _install; - -function _load_install() { - return _install = _interopRequireWildcard(__webpack_require__(41)); -} - -var _licenses; - -function _load_licenses() { - return _licenses = _interopRequireWildcard(__webpack_require__(522)); -} - -var _link; - -function _load_link() { - return _link = _interopRequireWildcard(__webpack_require__(299)); -} - -var _login; - -function _load_login() { - return _login = _interopRequireWildcard(__webpack_require__(97)); -} - -var _logout; - -function _load_logout() { - return _logout = _interopRequireWildcard(__webpack_require__(523)); -} - -var _list; - -function _load_list() { - return _list = _interopRequireWildcard(__webpack_require__(300)); -} - -var _node; - -function _load_node() { - return _node = _interopRequireWildcard(__webpack_require__(524)); -} - -var _outdated; - -function _load_outdated() { - return _outdated = _interopRequireWildcard(__webpack_require__(525)); -} - -var _owner; - -function _load_owner() { - return _owner = _interopRequireWildcard(__webpack_require__(526)); -} - -var _pack; - -function _load_pack() { - return _pack = _interopRequireWildcard(__webpack_require__(155)); -} - -var _policies; - -function _load_policies() { - return _policies = _interopRequireWildcard(__webpack_require__(527)); -} - -var _publish; - -function _load_publish() { - return _publish = _interopRequireWildcard(__webpack_require__(528)); -} - -var _remove; - -function _load_remove() { - return _remove = _interopRequireWildcard(__webpack_require__(301)); -} - -var _run; - -function _load_run() { - return _run = _interopRequireWildcard(__webpack_require__(302)); -} - -var _tag; - -function _load_tag() { - return _tag = _interopRequireWildcard(__webpack_require__(303)); -} - -var _team; - -function _load_team() { - return _team = _interopRequireWildcard(__webpack_require__(529)); -} - -var _unplug; - -function _load_unplug() { - return _unplug = _interopRequireWildcard(__webpack_require__(531)); -} - -var _unlink; - -function _load_unlink() { - return _unlink = _interopRequireWildcard(__webpack_require__(530)); -} - -var _upgrade; - -function _load_upgrade() { - return _upgrade = _interopRequireWildcard(__webpack_require__(196)); -} - -var _version; - -function _load_version() { - return _version = _interopRequireWildcard(__webpack_require__(305)); -} - -var _versions; - -function _load_versions() { - return _versions = _interopRequireWildcard(__webpack_require__(532)); -} - -var _why; - -function _load_why() { - return _why = _interopRequireWildcard(__webpack_require__(533)); -} - -var _workspaces; - -function _load_workspaces() { - return _workspaces = _interopRequireWildcard(__webpack_require__(535)); -} - -var _workspace; - -function _load_workspace() { - return _workspace = _interopRequireWildcard(__webpack_require__(534)); -} - -var _upgradeInteractive; - -function _load_upgradeInteractive() { - return _upgradeInteractive = _interopRequireWildcard(__webpack_require__(304)); -} - -var _useless; - -function _load_useless() { - return _useless = _interopRequireDefault(__webpack_require__(511)); -} - -var _aliases; - -function _load_aliases() { - return _aliases = _interopRequireDefault(__webpack_require__(294)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -var chalk = __webpack_require__(36); - - -var getDocsLink = function getDocsLink(name) { - return `${(_constants || _load_constants()).YARN_DOCS}${name || ''}`; -}; -var getDocsInfo = function getDocsInfo(name) { - return 'Visit ' + chalk.bold(getDocsLink(name)) + ' for documentation about this command.'; -}; - -var commands = { - access: _access || _load_access(), - add: _add || _load_add(), - audit: _audit || _load_audit(), - autoclean: _autoclean || _load_autoclean(), - bin: _bin || _load_bin(), - cache: _cache || _load_cache(), - check: _check || _load_check(), - config: _config || _load_config(), - create: _create || _load_create(), - dedupe: (0, (_useless || _load_useless()).default)("The dedupe command isn't necessary. `yarn install` will already dedupe."), - exec: _exec || _load_exec(), - generateLockEntry: _generateLockEntry || _load_generateLockEntry(), - global: _global || _load_global(), - help: _help || _load_help(), - import: _import || _load_import(), - info: _info || _load_info(), - init: _init || _load_init(), - install: _install || _load_install(), - licenses: _licenses || _load_licenses(), - link: _link || _load_link(), - lockfile: (0, (_useless || _load_useless()).default)("The lockfile command isn't necessary. `yarn install` will produce a lockfile."), - login: _login || _load_login(), - logout: _logout || _load_logout(), - list: _list || _load_list(), - node: _node || _load_node(), - outdated: _outdated || _load_outdated(), - owner: _owner || _load_owner(), - pack: _pack || _load_pack(), - policies: _policies || _load_policies(), - prune: (0, (_useless || _load_useless()).default)("The prune command isn't necessary. `yarn install` will prune extraneous packages."), - publish: _publish || _load_publish(), - remove: _remove || _load_remove(), - run: _run || _load_run(), - tag: _tag || _load_tag(), - team: _team || _load_team(), - unplug: _unplug || _load_unplug(), - unlink: _unlink || _load_unlink(), - upgrade: _upgrade || _load_upgrade(), - version: _version || _load_version(), - versions: _versions || _load_versions(), - why: _why || _load_why(), - workspaces: _workspaces || _load_workspaces(), - workspace: _workspace || _load_workspace(), - upgradeInteractive: _upgradeInteractive || _load_upgradeInteractive() -}; - -for (var key in commands) { - commands[key].getDocsInfo = getDocsInfo(key); -} - -for (var _key in (_aliases || _load_aliases()).default) { - commands[_key] = commands[(_aliases || _load_aliases()).default[_key]]; - commands[_key].getDocsInfo = getDocsInfo(_key); -} - -exports.default = commands; - -/***/ }), -/* 274 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(42)); -} - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -exports.getRcConfigForCwd = getRcConfigForCwd; -exports.getRcConfigForFolder = getRcConfigForFolder; -exports.getRcArgs = getRcArgs; - -var _fs; - -function _load_fs() { - return _fs = __webpack_require__(12); -} - -var _path; - -function _load_path() { - return _path = __webpack_require__(1); -} - -var _commander; - -function _load_commander() { - return _commander = _interopRequireDefault(__webpack_require__(277)); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = __webpack_require__(25); -} - -var _rc; - -function _load_rc() { - return _rc = _interopRequireWildcard(__webpack_require__(579)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// Keys that will get resolved relative to the path of the rc file they belong to -var PATH_KEYS = new (_set || _load_set()).default(['yarn-path', 'cache-folder', 'global-folder', 'modules-folder', 'cwd', 'offline-cache-folder']); - -// given a cwd, load all .yarnrc files relative to it - - -function getRcConfigForCwd(cwd, args) { - var config = {}; - - if (args.indexOf('--no-default-rc') === -1) { - (0, (_assign || _load_assign()).default)(config, (_rc || _load_rc()).findRc('yarn', cwd, function (fileText, filePath) { - return loadRcFile(fileText, filePath); - })); - } - - for (var index = args.indexOf('--use-yarnrc'); index !== -1; index = args.indexOf('--use-yarnrc', index + 1)) { - var value = args[index + 1]; - - if (value && value.charAt(0) !== '-') { - (0, (_assign || _load_assign()).default)(config, loadRcFile((0, (_fs || _load_fs()).readFileSync)(value, 'utf8'), value)); - } - } - - return config; -} - -function getRcConfigForFolder(cwd) { - var filePath = (0, (_path || _load_path()).resolve)(cwd, '.yarnrc'); - if (!(0, (_fs || _load_fs()).existsSync)(filePath)) { - return {}; - } - - var fileText = (0, (_fs || _load_fs()).readFileSync)(filePath, 'utf8'); - return loadRcFile(fileText, filePath); -} - -function loadRcFile(fileText, filePath) { - var _parse = (0, (_lockfile || _load_lockfile()).parse)(fileText, 'yarnrc'), - values = _parse.object; - - if (filePath.match(/\.yml$/)) { - values = { 'yarn-path': values.yarnPath }; - } - - // some keys reference directories so keep their relativity - for (var _key in values) { - if (PATH_KEYS.has(_key.replace(/^(--)?([^.]+\.)*/, ''))) { - values[_key] = (0, (_path || _load_path()).resolve)((0, (_path || _load_path()).dirname)(filePath), values[_key]); - } - } - - return values; -} - -// get the built of arguments of a .yarnrc chain of the passed cwd -function buildRcArgs(cwd, args) { - var config = getRcConfigForCwd(cwd, args); - - var argsForCommands = new (_map || _load_map()).default(); - - for (var _key2 in config) { - // args can be prefixed with the command name they're meant for, eg. - // `--install.check-files true` - var keyMatch = _key2.match(/^--(?:([^.]+)\.)?(.*)$/); - if (!keyMatch) { - continue; - } - - var commandName = keyMatch[1] || '*'; - var arg = keyMatch[2]; - var value = config[_key2]; - - // create args for this command name if we didn't previously have them - var _args = argsForCommands.get(commandName) || []; - argsForCommands.set(commandName, _args); - - // turn config value into appropriate cli flag - var option = (_commander || _load_commander()).default.optionFor(`--${arg}`); - - // If commander doesn't recognize the option or it takes a value after it - if (!option || option.optional || option.required) { - _args.push(`--${arg}`, value); - } else if (value === true) { - // we can't force remove an arg from cli - _args.push(`--${arg}`); - } - } - - return argsForCommands; -} - -// extract the value of a --cwd arg if present -function extractCwdArg(args) { - for (var i = 0, I = args.length; i < I; ++i) { - var arg = args[i]; - if (arg === '--') { - return null; - } else if (arg === '--cwd') { - return args[i + 1]; - } - } - return null; -} - -// get a list of arguments from .yarnrc that apply to this commandName -function getRcArgs(commandName, args) { - var previousCwds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; - - // for the cwd, use the --cwd arg if it was passed or else use process.cwd() - var origCwd = extractCwdArg(args) || process.cwd(); - - // get a map of command names and their arguments - var argMap = buildRcArgs(origCwd, args); - - // concat wildcard arguments and arguments meant for this specific command - var newArgs = [].concat(argMap.get('*') || [], argMap.get(commandName) || []); - - // check if the .yarnrc args specified a cwd - var newCwd = extractCwdArg(newArgs); - if (newCwd && newCwd !== origCwd) { - // ensure that we don't enter into a loop - if (previousCwds.indexOf(newCwd) !== -1) { - throw new Error(`Recursive .yarnrc files specifying --cwd flags. Bailing out.`); - } - - // if we have a new cwd then let's refetch the .yarnrc args relative to it - return getRcArgs(commandName, newArgs, previousCwds.concat(origCwd)); - } - - return newArgs; -} - -/***/ }), -/* 275 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -exports.boolify = boolify; -exports.boolifyWithDefault = boolifyWithDefault; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var FALSY_STRINGS = new (_set || _load_set()).default(['0', 'false']); - -function boolify(val) { - return !FALSY_STRINGS.has(val.toString().toLowerCase()); -} - -function boolifyWithDefault(val, defaultResult) { - return val === '' || val === null || val === undefined ? defaultResult : boolify(val); -} - -/***/ }), -/* 276 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -exports.isOffline = isOffline; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var os = __webpack_require__(72); - -var IGNORE_INTERFACES = ['lo0', 'awdl0', 'bridge0']; -var LOCAL_IPS = ['127.0.0.1', '::1']; - -function isOffline() { - var interfaces = void 0; - - try { - interfaces = os.networkInterfaces(); - } catch (e) { - // As of October 2016, Windows Subsystem for Linux (WSL) does not support - // the os.networkInterfaces() call and throws instead. For this platform, - // assume we are online. - if (e.syscall === 'uv_interface_addresses') { - return false; - } else { - throw e; - } - } - - for (var name in interfaces) { - if (IGNORE_INTERFACES.indexOf(name) >= 0) { - continue; - } - - var addrs = interfaces[name]; - for (var _iterator = addrs, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var addr = _ref; - - if (LOCAL_IPS.indexOf(addr.address) < 0) { - // found a possible remote ip - return false; - } - } - } - - return true; -} - -/***/ }), -/* 277 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * Module dependencies. - */ - -var EventEmitter = __webpack_require__(95).EventEmitter; -var spawn = __webpack_require__(270).spawn; -var path = __webpack_require__(1); -var dirname = path.dirname; -var basename = path.basename; -var fs = __webpack_require__(12); - -/** - * Inherit `Command` from `EventEmitter.prototype`. - */ - -__webpack_require__(9).inherits(Command, EventEmitter); - -/** - * Expose the root command. - */ - -exports = module.exports = new Command(); - -/** - * Expose `Command`. - */ - -exports.Command = Command; - -/** - * Expose `Option`. - */ - -exports.Option = Option; - -/** - * Initialize a new `Option` with the given `flags` and `description`. - * - * @param {String} flags - * @param {String} description - * @api public - */ - -function Option(flags, description) { - this.flags = flags; - this.required = flags.indexOf('<') >= 0; - this.optional = flags.indexOf('[') >= 0; - this.bool = flags.indexOf('-no-') === -1; - flags = flags.split(/[ ,|]+/); - if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); - this.long = flags.shift(); - this.description = description || ''; -} - -/** - * Return option name. - * - * @return {String} - * @api private - */ - -Option.prototype.name = function() { - return this.long - .replace('--', '') - .replace('no-', ''); -}; - -/** - * Return option name, in a camelcase format that can be used - * as a object attribute key. - * - * @return {String} - * @api private - */ - -Option.prototype.attributeName = function() { - return camelcase(this.name()); -}; - -/** - * Check if `arg` matches the short or long flag. - * - * @param {String} arg - * @return {Boolean} - * @api private - */ - -Option.prototype.is = function(arg) { - return this.short === arg || this.long === arg; -}; - -/** - * Initialize a new `Command`. - * - * @param {String} name - * @api public - */ - -function Command(name) { - this.commands = []; - this.options = []; - this._execs = {}; - this._allowUnknownOption = false; - this._args = []; - this._name = name || ''; -} - -/** - * Add command `name`. - * - * The `.action()` callback is invoked when the - * command `name` is specified via __ARGV__, - * and the remaining arguments are applied to the - * function for access. - * - * When the `name` is "*" an un-matched command - * will be passed as the first arg, followed by - * the rest of __ARGV__ remaining. - * - * Examples: - * - * program - * .version('0.0.1') - * .option('-C, --chdir ', 'change the working directory') - * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') - * .option('-T, --no-tests', 'ignore test hook') - * - * program - * .command('setup') - * .description('run remote setup commands') - * .action(function() { - * console.log('setup'); - * }); - * - * program - * .command('exec ') - * .description('run the given remote command') - * .action(function(cmd) { - * console.log('exec "%s"', cmd); - * }); - * - * program - * .command('teardown [otherDirs...]') - * .description('run teardown commands') - * .action(function(dir, otherDirs) { - * console.log('dir "%s"', dir); - * if (otherDirs) { - * otherDirs.forEach(function (oDir) { - * console.log('dir "%s"', oDir); - * }); - * } - * }); - * - * program - * .command('*') - * .description('deploy the given env') - * .action(function(env) { - * console.log('deploying "%s"', env); - * }); - * - * program.parse(process.argv); - * - * @param {String} name - * @param {String} [desc] for git-style sub-commands - * @return {Command} the new command - * @api public - */ - -Command.prototype.command = function(name, desc, opts) { - if (typeof desc === 'object' && desc !== null) { - opts = desc; - desc = null; - } - opts = opts || {}; - var args = name.split(/ +/); - var cmd = new Command(args.shift()); - - if (desc) { - cmd.description(desc); - this.executables = true; - this._execs[cmd._name] = true; - if (opts.isDefault) this.defaultExecutable = cmd._name; - } - cmd._noHelp = !!opts.noHelp; - this.commands.push(cmd); - cmd.parseExpectedArgs(args); - cmd.parent = this; - - if (desc) return this; - return cmd; -}; - -/** - * Define argument syntax for the top-level command. - * - * @api public - */ - -Command.prototype.arguments = function(desc) { - return this.parseExpectedArgs(desc.split(/ +/)); -}; - -/** - * Add an implicit `help [cmd]` subcommand - * which invokes `--help` for the given command. - * - * @api private - */ - -Command.prototype.addImplicitHelpCommand = function() { - this.command('help [cmd]', 'display help for [cmd]'); -}; - -/** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @param {Array} args - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parseExpectedArgs = function(args) { - if (!args.length) return; - var self = this; - args.forEach(function(arg) { - var argDetails = { - required: false, - name: '', - variadic: false - }; - - switch (arg[0]) { - case '<': - argDetails.required = true; - argDetails.name = arg.slice(1, -1); - break; - case '[': - argDetails.name = arg.slice(1, -1); - break; - } - - if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { - argDetails.variadic = true; - argDetails.name = argDetails.name.slice(0, -3); - } - if (argDetails.name) { - self._args.push(argDetails); - } - }); - return this; -}; - -/** - * Register callback `fn` for the command. - * - * Examples: - * - * program - * .command('help') - * .description('display verbose help') - * .action(function() { - * // output help here - * }); - * - * @param {Function} fn - * @return {Command} for chaining - * @api public - */ - -Command.prototype.action = function(fn) { - var self = this; - var listener = function(args, unknown) { - // Parse any so-far unknown options - args = args || []; - unknown = unknown || []; - - var parsed = self.parseOptions(unknown); - - // Output help if necessary - outputHelpIfNecessary(self, parsed.unknown); - - // If there are still any unknown options, then we simply - // die, unless someone asked for help, in which case we give it - // to them, and then we die. - if (parsed.unknown.length > 0) { - self.unknownOption(parsed.unknown[0]); - } - - // Leftover arguments need to be pushed back. Fixes issue #56 - if (parsed.args.length) args = parsed.args.concat(args); - - self._args.forEach(function(arg, i) { - if (arg.required && args[i] == null) { - self.missingArgument(arg.name); - } else if (arg.variadic) { - if (i !== self._args.length - 1) { - self.variadicArgNotLast(arg.name); - } - - args[i] = args.splice(i); - } - }); - - // Always append ourselves to the end of the arguments, - // to make sure we match the number of arguments the user - // expects - if (self._args.length) { - args[self._args.length] = self; - } else { - args.push(self); - } - - fn.apply(self, args); - }; - var parent = this.parent || this; - var name = parent === this ? '*' : this._name; - parent.on('command:' + name, listener); - if (this._alias) parent.on('command:' + this._alias, listener); - return this; -}; - -/** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * Examples: - * - * // simple boolean defaulting to false - * program.option('-p, --pepper', 'add pepper'); - * - * --pepper - * program.pepper - * // => Boolean - * - * // simple boolean defaulting to true - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => false - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @param {String} flags - * @param {String} description - * @param {Function|*} [fn] or default - * @param {*} [defaultValue] - * @return {Command} for chaining - * @api public - */ - -Command.prototype.option = function(flags, description, fn, defaultValue) { - var self = this, - option = new Option(flags, description), - oname = option.name(), - name = option.attributeName(); - - // default as 3rd arg - if (typeof fn !== 'function') { - if (fn instanceof RegExp) { - var regex = fn; - fn = function(val, def) { - var m = regex.exec(val); - return m ? m[0] : def; - }; - } else { - defaultValue = fn; - fn = null; - } - } - - // preassign default value only for --no-*, [optional], or - if (!option.bool || option.optional || option.required) { - // when --no-* we make sure default is true - if (!option.bool) defaultValue = true; - // preassign only if we have a default - if (defaultValue !== undefined) { - self[name] = defaultValue; - option.defaultValue = defaultValue; - } - } - - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on('option:' + oname, function(val) { - // coercion - if (val !== null && fn) { - val = fn(val, self[name] === undefined ? defaultValue : self[name]); - } - - // unassigned or bool - if (typeof self[name] === 'boolean' || typeof self[name] === 'undefined') { - // if no value, bool true, and we have a default, then use it! - if (val == null) { - self[name] = option.bool - ? defaultValue || true - : false; - } else { - self[name] = val; - } - } else if (val !== null) { - // reassign - self[name] = val; - } - }); - - return this; -}; - -/** - * Allow unknown options on the command line. - * - * @param {Boolean} arg if `true` or omitted, no error will be thrown - * for unknown options. - * @api public - */ -Command.prototype.allowUnknownOption = function(arg) { - this._allowUnknownOption = arguments.length === 0 || arg; - return this; -}; - -/** - * Parse `argv`, settings options and invoking commands when defined. - * - * @param {Array} argv - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parse = function(argv) { - // implicit help - if (this.executables) this.addImplicitHelpCommand(); - - // store raw args - this.rawArgs = argv; - - // guess name - this._name = this._name || basename(argv[1], '.js'); - - // github-style sub-commands with no sub-command - if (this.executables && argv.length < 3 && !this.defaultExecutable) { - // this user needs help - argv.push('--help'); - } - - // process argv - var parsed = this.parseOptions(this.normalize(argv.slice(2))); - var args = this.args = parsed.args; - - var result = this.parseArgs(this.args, parsed.unknown); - - // executable sub-commands - var name = result.args[0]; - - var aliasCommand = null; - // check alias of sub commands - if (name) { - aliasCommand = this.commands.filter(function(command) { - return command.alias() === name; - })[0]; - } - - if (this._execs[name] && typeof this._execs[name] !== 'function') { - return this.executeSubCommand(argv, args, parsed.unknown); - } else if (aliasCommand) { - // is alias of a subCommand - args[0] = aliasCommand._name; - return this.executeSubCommand(argv, args, parsed.unknown); - } else if (this.defaultExecutable) { - // use the default subcommand - args.unshift(this.defaultExecutable); - return this.executeSubCommand(argv, args, parsed.unknown); - } - - return result; -}; - -/** - * Execute a sub-command executable. - * - * @param {Array} argv - * @param {Array} args - * @param {Array} unknown - * @api private - */ - -Command.prototype.executeSubCommand = function(argv, args, unknown) { - args = args.concat(unknown); - - if (!args.length) this.help(); - if (args[0] === 'help' && args.length === 1) this.help(); - - // --help - if (args[0] === 'help') { - args[0] = args[1]; - args[1] = '--help'; - } - - // executable - var f = argv[1]; - // name of the subcommand, link `pm-install` - var bin = basename(f, '.js') + '-' + args[0]; - - // In case of globally installed, get the base dir where executable - // subcommand file should be located at - var baseDir, - link = fs.lstatSync(f).isSymbolicLink() ? fs.readlinkSync(f) : f; - - // when symbolink is relative path - if (link !== f && link.charAt(0) !== '/') { - link = path.join(dirname(f), link); - } - baseDir = dirname(link); - - // prefer local `./` to bin in the $PATH - var localBin = path.join(baseDir, bin); - - // whether bin file is a js script with explicit `.js` extension - var isExplicitJS = false; - if (exists(localBin + '.js')) { - bin = localBin + '.js'; - isExplicitJS = true; - } else if (exists(localBin)) { - bin = localBin; - } - - args = args.slice(1); - - var proc; - if (process.platform !== 'win32') { - if (isExplicitJS) { - args.unshift(bin); - // add executable arguments to spawn - args = (process.execArgv || []).concat(args); - - proc = spawn(process.argv[0], args, { stdio: 'inherit', customFds: [0, 1, 2] }); - } else { - proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] }); - } - } else { - args.unshift(bin); - proc = spawn(process.execPath, args, { stdio: 'inherit' }); - } - - var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP']; - signals.forEach(function(signal) { - process.on(signal, function() { - if (proc.killed === false && proc.exitCode === null) { - proc.kill(signal); - } - }); - }); - proc.on('close', process.exit.bind(process)); - proc.on('error', function(err) { - if (err.code === 'ENOENT') { - console.error('\n %s(1) does not exist, try --help\n', bin); - } else if (err.code === 'EACCES') { - console.error('\n %s(1) not executable. try chmod or run with root\n', bin); - } - process.exit(1); - }); - - // Store the reference to the child process - this.runningCommand = proc; -}; - -/** - * Normalize `args`, splitting joined short flags. For example - * the arg "-abc" is equivalent to "-a -b -c". - * This also normalizes equal sign and splits "--abc=def" into "--abc def". - * - * @param {Array} args - * @return {Array} - * @api private - */ - -Command.prototype.normalize = function(args) { - var ret = [], - arg, - lastOpt, - index; - - for (var i = 0, len = args.length; i < len; ++i) { - arg = args[i]; - if (i > 0) { - lastOpt = this.optionFor(args[i - 1]); - } - - if (arg === '--') { - // Honor option terminator - ret = ret.concat(args.slice(i)); - break; - } else if (lastOpt && lastOpt.required) { - ret.push(arg); - } else if (arg.length > 1 && arg[0] === '-' && arg[1] !== '-') { - arg.slice(1).split('').forEach(function(c) { - ret.push('-' + c); - }); - } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) { - ret.push(arg.slice(0, index), arg.slice(index + 1)); - } else { - ret.push(arg); - } - } - - return ret; -}; - -/** - * Parse command `args`. - * - * When listener(s) are available those - * callbacks are invoked, otherwise the "*" - * event is emitted and those actions are invoked. - * - * @param {Array} args - * @return {Command} for chaining - * @api private - */ - -Command.prototype.parseArgs = function(args, unknown) { - var name; - - if (args.length) { - name = args[0]; - if (this.listeners('command:' + name).length) { - this.emit('command:' + args.shift(), args, unknown); - } else { - this.emit('command:*', args); - } - } else { - outputHelpIfNecessary(this, unknown); - - // If there were no args and we have unknown options, - // then they are extraneous and we need to error. - if (unknown.length > 0) { - this.unknownOption(unknown[0]); - } - } - - return this; -}; - -/** - * Return an option matching `arg` if any. - * - * @param {String} arg - * @return {Option} - * @api private - */ - -Command.prototype.optionFor = function(arg) { - for (var i = 0, len = this.options.length; i < len; ++i) { - if (this.options[i].is(arg)) { - return this.options[i]; - } - } -}; - -/** - * Parse options from `argv` returning `argv` - * void of these options. - * - * @param {Array} argv - * @return {Array} - * @api public - */ - -Command.prototype.parseOptions = function(argv) { - var args = [], - len = argv.length, - literal, - option, - arg; - - var unknownOptions = []; - - // parse options - for (var i = 0; i < len; ++i) { - arg = argv[i]; - - // literal args after -- - if (literal) { - args.push(arg); - continue; - } - - if (arg === '--') { - literal = true; - continue; - } - - // find matching Option - option = this.optionFor(arg); - - // option is defined - if (option) { - // requires arg - if (option.required) { - arg = argv[++i]; - if (arg == null) return this.optionMissingArgument(option); - this.emit('option:' + option.name(), arg); - // optional arg - } else if (option.optional) { - arg = argv[i + 1]; - if (arg == null || (arg[0] === '-' && arg !== '-')) { - arg = null; - } else { - ++i; - } - this.emit('option:' + option.name(), arg); - // bool - } else { - this.emit('option:' + option.name()); - } - continue; - } - - // looks like an option - if (arg.length > 1 && arg[0] === '-') { - unknownOptions.push(arg); - - // If the next argument looks like it might be - // an argument for this option, we pass it on. - // If it isn't, then it'll simply be ignored - if ((i + 1) < argv.length && argv[i + 1][0] !== '-') { - unknownOptions.push(argv[++i]); - } - continue; - } - - // arg - args.push(arg); - } - - return { args: args, unknown: unknownOptions }; -}; - -/** - * Return an object containing options as key-value pairs - * - * @return {Object} - * @api public - */ -Command.prototype.opts = function() { - var result = {}, - len = this.options.length; - - for (var i = 0; i < len; i++) { - var key = this.options[i].attributeName(); - result[key] = key === this._versionOptionName ? this._version : this[key]; - } - return result; -}; - -/** - * Argument `name` is missing. - * - * @param {String} name - * @api private - */ - -Command.prototype.missingArgument = function(name) { - console.error(); - console.error(" error: missing required argument `%s'", name); - console.error(); - process.exit(1); -}; - -/** - * `Option` is missing an argument, but received `flag` or nothing. - * - * @param {String} option - * @param {String} flag - * @api private - */ - -Command.prototype.optionMissingArgument = function(option, flag) { - console.error(); - if (flag) { - console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); - } else { - console.error(" error: option `%s' argument missing", option.flags); - } - console.error(); - process.exit(1); -}; - -/** - * Unknown option `flag`. - * - * @param {String} flag - * @api private - */ - -Command.prototype.unknownOption = function(flag) { - if (this._allowUnknownOption) return; - console.error(); - console.error(" error: unknown option `%s'", flag); - console.error(); - process.exit(1); -}; - -/** - * Variadic argument with `name` is not the last argument as required. - * - * @param {String} name - * @api private - */ - -Command.prototype.variadicArgNotLast = function(name) { - console.error(); - console.error(" error: variadic arguments must be last `%s'", name); - console.error(); - process.exit(1); -}; - -/** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * @param {String} str - * @param {String} [flags] - * @return {Command} for chaining - * @api public - */ - -Command.prototype.version = function(str, flags) { - if (arguments.length === 0) return this._version; - this._version = str; - flags = flags || '-V, --version'; - var versionOption = new Option(flags, 'output the version number'); - this._versionOptionName = versionOption.long.substr(2) || 'version'; - this.options.push(versionOption); - this.on('option:' + this._versionOptionName, function() { - process.stdout.write(str + '\n'); - process.exit(0); - }); - return this; -}; - -/** - * Set the description to `str`. - * - * @param {String} str - * @param {Object} argsDescription - * @return {String|Command} - * @api public - */ - -Command.prototype.description = function(str, argsDescription) { - if (arguments.length === 0) return this._description; - this._description = str; - this._argsDescription = argsDescription; - return this; -}; - -/** - * Set an alias for the command - * - * @param {String} alias - * @return {String|Command} - * @api public - */ - -Command.prototype.alias = function(alias) { - var command = this; - if (this.commands.length !== 0) { - command = this.commands[this.commands.length - 1]; - } - - if (arguments.length === 0) return command._alias; - - if (alias === command._name) throw new Error('Command alias can\'t be the same as its name'); - - command._alias = alias; - return this; -}; - -/** - * Set / get the command usage `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.usage = function(str) { - var args = this._args.map(function(arg) { - return humanReadableArgName(arg); - }); - - var usage = '[options]' + - (this.commands.length ? ' [command]' : '') + - (this._args.length ? ' ' + args.join(' ') : ''); - - if (arguments.length === 0) return this._usage || usage; - this._usage = str; - - return this; -}; - -/** - * Get or set the name of the command - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.name = function(str) { - if (arguments.length === 0) return this._name; - this._name = str; - return this; -}; - -/** - * Return prepared commands. - * - * @return {Array} - * @api private - */ - -Command.prototype.prepareCommands = function() { - return this.commands.filter(function(cmd) { - return !cmd._noHelp; - }).map(function(cmd) { - var args = cmd._args.map(function(arg) { - return humanReadableArgName(arg); - }).join(' '); - - return [ - cmd._name + - (cmd._alias ? '|' + cmd._alias : '') + - (cmd.options.length ? ' [options]' : '') + - (args ? ' ' + args : ''), - cmd._description - ]; - }); -}; - -/** - * Return the largest command length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestCommandLength = function() { - var commands = this.prepareCommands(); - return commands.reduce(function(max, command) { - return Math.max(max, command[0].length); - }, 0); -}; - -/** - * Return the largest option length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestOptionLength = function() { - var options = [].slice.call(this.options); - options.push({ - flags: '-h, --help' - }); - return options.reduce(function(max, option) { - return Math.max(max, option.flags.length); - }, 0); -}; - -/** - * Return the largest arg length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestArgLength = function() { - return this._args.reduce(function(max, arg) { - return Math.max(max, arg.name.length); - }, 0); -}; - -/** - * Return the pad width. - * - * @return {Number} - * @api private - */ - -Command.prototype.padWidth = function() { - var width = this.largestOptionLength(); - if (this._argsDescription && this._args.length) { - if (this.largestArgLength() > width) { - width = this.largestArgLength(); - } - } - - if (this.commands && this.commands.length) { - if (this.largestCommandLength() > width) { - width = this.largestCommandLength(); - } - } - - return width; -}; - -/** - * Return help for options. - * - * @return {String} - * @api private - */ - -Command.prototype.optionHelp = function() { - var width = this.padWidth(); - - // Append the help information - return this.options.map(function(option) { - return pad(option.flags, width) + ' ' + option.description + - ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + option.defaultValue + ')' : ''); - }).concat([pad('-h, --help', width) + ' ' + 'output usage information']) - .join('\n'); -}; - -/** - * Return command help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.commandHelp = function() { - if (!this.commands.length) return ''; - - var commands = this.prepareCommands(); - var width = this.padWidth(); - - return [ - ' Commands:', - '', - commands.map(function(cmd) { - var desc = cmd[1] ? ' ' + cmd[1] : ''; - return (desc ? pad(cmd[0], width) : cmd[0]) + desc; - }).join('\n').replace(/^/gm, ' '), - '' - ].join('\n'); -}; - -/** - * Return program help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.helpInformation = function() { - var desc = []; - if (this._description) { - desc = [ - ' ' + this._description, - '' - ]; - - var argsDescription = this._argsDescription; - if (argsDescription && this._args.length) { - var width = this.padWidth(); - desc.push(' Arguments:'); - desc.push(''); - this._args.forEach(function(arg) { - desc.push(' ' + pad(arg.name, width) + ' ' + argsDescription[arg.name]); - }); - desc.push(''); - } - } - - var cmdName = this._name; - if (this._alias) { - cmdName = cmdName + '|' + this._alias; - } - var usage = [ - '', - ' Usage: ' + cmdName + ' ' + this.usage(), - '' - ]; - - var cmds = []; - var commandHelp = this.commandHelp(); - if (commandHelp) cmds = [commandHelp]; - - var options = [ - ' Options:', - '', - '' + this.optionHelp().replace(/^/gm, ' '), - '' - ]; - - return usage - .concat(desc) - .concat(options) - .concat(cmds) - .join('\n'); -}; - -/** - * Output help information for this command - * - * @api public - */ - -Command.prototype.outputHelp = function(cb) { - if (!cb) { - cb = function(passthru) { - return passthru; - }; - } - process.stdout.write(cb(this.helpInformation())); - this.emit('--help'); -}; - -/** - * Output help information and exit. - * - * @api public - */ - -Command.prototype.help = function(cb) { - this.outputHelp(cb); - process.exit(); -}; - -/** - * Camel-case the given `flag` - * - * @param {String} flag - * @return {String} - * @api private - */ - -function camelcase(flag) { - return flag.split('-').reduce(function(str, word) { - return str + word[0].toUpperCase() + word.slice(1); - }); -} - -/** - * Pad `str` to `width`. - * - * @param {String} str - * @param {Number} width - * @return {String} - * @api private - */ - -function pad(str, width) { - var len = Math.max(0, width - str.length); - return str + Array(len + 1).join(' '); -} - -/** - * Output help information if necessary - * - * @param {Command} command to output help for - * @param {Array} array of options to search for -h or --help - * @api private - */ - -function outputHelpIfNecessary(cmd, options) { - options = options || []; - for (var i = 0; i < options.length; i++) { - if (options[i] === '--help' || options[i] === '-h') { - cmd.outputHelp(); - process.exit(0); - } - } -} - -/** - * Takes an argument an returns its human readable equivalent for help usage. - * - * @param {Object} arg - * @return {String} - * @api private - */ - -function humanReadableArgName(arg) { - var nameOutput = arg.name + (arg.variadic === true ? '...' : ''); - - return arg.required - ? '<' + nameOutput + '>' - : '[' + nameOutput + ']'; -} - -// for versions before node v0.8 when there weren't `fs.existsSync` -function exists(file) { - try { - if (fs.statSync(file).isFile()) { - return true; - } - } catch (e) { - return false; - } -} - - -/***/ }), -/* 278 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(96); - -module.exports = SchemaObject; - -function SchemaObject(obj) { - util.copy(obj, this); -} - - -/***/ }), -/* 279 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate__limit(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - var $isMax = $keyword == 'maximum', - $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', - $schemaExcl = it.schema[$exclusiveKeyword], - $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, - $op = $isMax ? '<' : '>', - $notOp = $isMax ? '>' : '<', - $errorKeyword = undefined; - if ($isDataExcl) { - var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), - $exclusive = 'exclusive' + $lvl, - $exclType = 'exclType' + $lvl, - $exclIsNumber = 'exclIsNumber' + $lvl, - $opExpr = 'op' + $lvl, - $opStr = '\' + ' + $opExpr + ' + \''; - out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; - $schemaValueExcl = 'schemaExcl' + $lvl; - out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; - var $errorKeyword = $exclusiveKeyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } else if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; - } - out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; - } else { - var $exclIsNumber = typeof $schemaExcl == 'number', - $opStr = $op; - if ($exclIsNumber && $isData) { - var $opExpr = '\'' + $opStr + '\''; - out += ' if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; - } - out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; - } else { - if ($exclIsNumber && $schema === undefined) { - $exclusive = true; - $errorKeyword = $exclusiveKeyword; - $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; - $schemaValue = $schemaExcl; - $notOp += '='; - } else { - if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); - if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { - $exclusive = true; - $errorKeyword = $exclusiveKeyword; - $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; - $notOp += '='; - } else { - $exclusive = false; - $opStr += '='; - } - } - var $opExpr = '\'' + $opStr + '\''; - out += ' if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; - } - out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; - } - } - $errorKeyword = $errorKeyword || $keyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be ' + ($opStr) + ' '; - if ($isData) { - out += '\' + ' + ($schemaValue); - } else { - out += '' + ($schemaValue) + '\''; - } - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + ($schema); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - if ($breakOnError) { - out += ' else { '; - } - return out; -} - - -/***/ }), -/* 280 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate__limitItems(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - var $op = $keyword == 'maxItems' ? '>' : '<'; - out += 'if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; - } - out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; - var $errorKeyword = $keyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have '; - if ($keyword == 'maxItems') { - out += 'more'; - } else { - out += 'less'; - } - out += ' than '; - if ($isData) { - out += '\' + ' + ($schemaValue) + ' + \''; - } else { - out += '' + ($schema); - } - out += ' items\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + ($schema); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += '} '; - if ($breakOnError) { - out += ' else { '; - } - return out; -} - - -/***/ }), -/* 281 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate__limitLength(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - var $op = $keyword == 'maxLength' ? '>' : '<'; - out += 'if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; - } - if (it.opts.unicode === false) { - out += ' ' + ($data) + '.length '; - } else { - out += ' ucs2length(' + ($data) + ') '; - } - out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; - var $errorKeyword = $keyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT be '; - if ($keyword == 'maxLength') { - out += 'longer'; - } else { - out += 'shorter'; - } - out += ' than '; - if ($isData) { - out += '\' + ' + ($schemaValue) + ' + \''; - } else { - out += '' + ($schema); - } - out += ' characters\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + ($schema); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += '} '; - if ($breakOnError) { - out += ' else { '; - } - return out; -} - - -/***/ }), -/* 282 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate__limitProperties(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - var $op = $keyword == 'maxProperties' ? '>' : '<'; - out += 'if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; - } - out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; - var $errorKeyword = $keyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have '; - if ($keyword == 'maxProperties') { - out += 'more'; - } else { - out += 'less'; - } - out += ' than '; - if ($isData) { - out += '\' + ' + ($schemaValue) + ' + \''; - } else { - out += '' + ($schema); - } - out += ' properties\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + ($schema); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += '} '; - if ($breakOnError) { - out += ' else { '; - } - return out; -} - - -/***/ }), -/* 283 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_validate(it, $keyword, $ruleType) { - var out = ''; - var $async = it.schema.$async === true, - $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), - $id = it.self._getId(it.schema); - if (it.isTop) { - if ($async) { - it.async = true; - var $es7 = it.opts.async == 'es7'; - it.yieldAwait = $es7 ? 'await' : 'yield'; - } - out += ' var validate = '; - if ($async) { - if ($es7) { - out += ' (async function '; - } else { - if (it.opts.async != '*') { - out += 'co.wrap'; - } - out += '(function* '; - } - } else { - out += ' (function '; - } - out += ' (data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; - if ($id && (it.opts.sourceCode || it.opts.processCode)) { - out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; - } - } - if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) { - var $keyword = 'false schema'; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - if (it.schema === false) { - if (it.isTop) { - $breakOnError = true; - } else { - out += ' var ' + ($valid) + ' = false; '; - } - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'boolean schema is false\' '; - } - if (it.opts.verbose) { - out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - } else { - if (it.isTop) { - if ($async) { - out += ' return data; '; - } else { - out += ' validate.errors = null; return true; '; - } - } else { - out += ' var ' + ($valid) + ' = true; '; - } - } - if (it.isTop) { - out += ' }); return validate; '; - } - return out; - } - if (it.isTop) { - var $top = it.isTop, - $lvl = it.level = 0, - $dataLvl = it.dataLevel = 0, - $data = 'data'; - it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); - it.baseId = it.baseId || it.rootId; - delete it.isTop; - it.dataPathArr = [undefined]; - out += ' var vErrors = null; '; - out += ' var errors = 0; '; - out += ' if (rootData === undefined) rootData = data; '; - } else { - var $lvl = it.level, - $dataLvl = it.dataLevel, - $data = 'data' + ($dataLvl || ''); - if ($id) it.baseId = it.resolve.url(it.baseId, $id); - if ($async && !it.async) throw new Error('async schema in sync schema'); - out += ' var errs_' + ($lvl) + ' = errors;'; - } - var $valid = 'valid' + $lvl, - $breakOnError = !it.opts.allErrors, - $closingBraces1 = '', - $closingBraces2 = ''; - var $errorKeyword; - var $typeSchema = it.schema.type, - $typeIsArray = Array.isArray($typeSchema); - if ($typeIsArray && $typeSchema.length == 1) { - $typeSchema = $typeSchema[0]; - $typeIsArray = false; - } - if (it.schema.$ref && $refKeywords) { - if (it.opts.extendRefs == 'fail') { - throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); - } else if (it.opts.extendRefs !== true) { - $refKeywords = false; - it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); - } - } - if ($typeSchema) { - if (it.opts.coerceTypes) { - var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); - } - var $rulesGroup = it.RULES.types[$typeSchema]; - if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) { - var $schemaPath = it.schemaPath + '.type', - $errSchemaPath = it.errSchemaPath + '/type'; - var $schemaPath = it.schemaPath + '.type', - $errSchemaPath = it.errSchemaPath + '/type', - $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; - out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; - if ($coerceToTypes) { - var $dataType = 'dataType' + $lvl, - $coerced = 'coerced' + $lvl; - out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; - if (it.opts.coerceTypes == 'array') { - out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; - } - out += ' var ' + ($coerced) + ' = undefined; '; - var $bracesCoercion = ''; - var arr1 = $coerceToTypes; - if (arr1) { - var $type, $i = -1, - l1 = arr1.length - 1; - while ($i < l1) { - $type = arr1[$i += 1]; - if ($i) { - out += ' if (' + ($coerced) + ' === undefined) { '; - $bracesCoercion += '}'; - } - if (it.opts.coerceTypes == 'array' && $type != 'array') { - out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; - } - if ($type == 'string') { - out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; - } else if ($type == 'number' || $type == 'integer') { - out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; - if ($type == 'integer') { - out += ' && !(' + ($data) + ' % 1)'; - } - out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; - } else if ($type == 'boolean') { - out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; - } else if ($type == 'null') { - out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; - } else if (it.opts.coerceTypes == 'array' && $type == 'array') { - out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; - } - } - } - out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; - if ($typeIsArray) { - out += '' + ($typeSchema.join(",")); - } else { - out += '' + ($typeSchema); - } - out += '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be '; - if ($typeIsArray) { - out += '' + ($typeSchema.join(",")); - } else { - out += '' + ($typeSchema); - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } else { '; - var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', - $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; - out += ' ' + ($data) + ' = ' + ($coerced) + '; '; - if (!$dataLvl) { - out += 'if (' + ($parentData) + ' !== undefined)'; - } - out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } '; - } else { - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; - if ($typeIsArray) { - out += '' + ($typeSchema.join(",")); - } else { - out += '' + ($typeSchema); - } - out += '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be '; - if ($typeIsArray) { - out += '' + ($typeSchema.join(",")); - } else { - out += '' + ($typeSchema); - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - } - out += ' } '; - } - } - if (it.schema.$ref && !$refKeywords) { - out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; - if ($breakOnError) { - out += ' } if (errors === '; - if ($top) { - out += '0'; - } else { - out += 'errs_' + ($lvl); - } - out += ') { '; - $closingBraces2 += '}'; - } - } else { - if (it.opts.v5 && it.schema.patternGroups) { - it.logger.warn('keyword "patternGroups" is deprecated and disabled. Use option patternGroups: true to enable.'); - } - var arr2 = it.RULES; - if (arr2) { - var $rulesGroup, i2 = -1, - l2 = arr2.length - 1; - while (i2 < l2) { - $rulesGroup = arr2[i2 += 1]; - if ($shouldUseGroup($rulesGroup)) { - if ($rulesGroup.type) { - out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { '; - } - if (it.opts.useDefaults && !it.compositeRule) { - if ($rulesGroup.type == 'object' && it.schema.properties) { - var $schema = it.schema.properties, - $schemaKeys = Object.keys($schema); - var arr3 = $schemaKeys; - if (arr3) { - var $propertyKey, i3 = -1, - l3 = arr3.length - 1; - while (i3 < l3) { - $propertyKey = arr3[i3 += 1]; - var $sch = $schema[$propertyKey]; - if ($sch.default !== undefined) { - var $passData = $data + it.util.getProperty($propertyKey); - out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; - if (it.opts.useDefaults == 'shared') { - out += ' ' + (it.useDefault($sch.default)) + ' '; - } else { - out += ' ' + (JSON.stringify($sch.default)) + ' '; - } - out += '; '; - } - } - } - } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { - var arr4 = it.schema.items; - if (arr4) { - var $sch, $i = -1, - l4 = arr4.length - 1; - while ($i < l4) { - $sch = arr4[$i += 1]; - if ($sch.default !== undefined) { - var $passData = $data + '[' + $i + ']'; - out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; - if (it.opts.useDefaults == 'shared') { - out += ' ' + (it.useDefault($sch.default)) + ' '; - } else { - out += ' ' + (JSON.stringify($sch.default)) + ' '; - } - out += '; '; - } - } - } - } - } - var arr5 = $rulesGroup.rules; - if (arr5) { - var $rule, i5 = -1, - l5 = arr5.length - 1; - while (i5 < l5) { - $rule = arr5[i5 += 1]; - if ($shouldUseRule($rule)) { - var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); - if ($code) { - out += ' ' + ($code) + ' '; - if ($breakOnError) { - $closingBraces1 += '}'; - } - } - } - } - } - if ($breakOnError) { - out += ' ' + ($closingBraces1) + ' '; - $closingBraces1 = ''; - } - if ($rulesGroup.type) { - out += ' } '; - if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { - out += ' else { '; - var $schemaPath = it.schemaPath + '.type', - $errSchemaPath = it.errSchemaPath + '/type'; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; - if ($typeIsArray) { - out += '' + ($typeSchema.join(",")); - } else { - out += '' + ($typeSchema); - } - out += '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be '; - if ($typeIsArray) { - out += '' + ($typeSchema.join(",")); - } else { - out += '' + ($typeSchema); - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - } - } - if ($breakOnError) { - out += ' if (errors === '; - if ($top) { - out += '0'; - } else { - out += 'errs_' + ($lvl); - } - out += ') { '; - $closingBraces2 += '}'; - } - } - } - } - } - if ($breakOnError) { - out += ' ' + ($closingBraces2) + ' '; - } - if ($top) { - if ($async) { - out += ' if (errors === 0) return data; '; - out += ' else throw new ValidationError(vErrors); '; - } else { - out += ' validate.errors = vErrors; '; - out += ' return errors === 0; '; - } - out += ' }); return validate;'; - } else { - out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; - } - out = it.util.cleanUpCode(out); - if ($top) { - out = it.util.finalCleanUpCode(out, $async); - } - - function $shouldUseGroup($rulesGroup) { - var rules = $rulesGroup.rules; - for (var i = 0; i < rules.length; i++) - if ($shouldUseRule(rules[i])) return true; - } - - function $shouldUseRule($rule) { - return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule)); - } - - function $ruleImplementsSomeKeyword($rule) { - var impl = $rule.implements; - for (var i = 0; i < impl.length; i++) - if (it.schema[impl[i]] !== undefined) return true; - } - return out; -} - - -/***/ }), -/* 284 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(482)().Promise - - -/***/ }), -/* 285 */ -/***/ (function(module, exports) { - -// API -module.exports = abort; - -/** - * Aborts leftover active jobs - * - * @param {object} state - current state object - */ -function abort(state) -{ - Object.keys(state.jobs).forEach(clean.bind(state)); - - // reset leftover jobs - state.jobs = {}; -} - -/** - * Cleans up leftover job by invoking abort function for the provided job id - * - * @this state - * @param {string|number} key - job id to abort - */ -function clean(key) -{ - if (typeof this.jobs[key] == 'function') - { - this.jobs[key](); - } -} - - -/***/ }), -/* 286 */ -/***/ (function(module, exports, __webpack_require__) { - -var defer = __webpack_require__(491); - -// API -module.exports = async; - -/** - * Runs provided callback asynchronously - * even if callback itself is not - * - * @param {function} callback - callback to invoke - * @returns {function} - augmented callback - */ -function async(callback) -{ - var isAsync = false; - - // check if async happened - defer(function() { isAsync = true; }); - - return function async_callback(err, result) - { - if (isAsync) - { - callback(err, result); - } - else - { - defer(function nextTick_callback() - { - callback(err, result); - }); - } - }; -} - - -/***/ }), -/* 287 */ -/***/ (function(module, exports, __webpack_require__) { - -var async = __webpack_require__(286) - , abort = __webpack_require__(285) - ; - -// API -module.exports = iterate; - -/** - * Iterates over each job object - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {object} state - current job status - * @param {function} callback - invoked when all elements processed - */ -function iterate(list, iterator, state, callback) -{ - // store current index - var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; - - state.jobs[key] = runJob(iterator, key, list[key], function(error, output) - { - // don't repeat yourself - // skip secondary callbacks - if (!(key in state.jobs)) - { - return; - } - - // clean up jobs - delete state.jobs[key]; - - if (error) - { - // don't process rest of the results - // stop still active jobs - // and reset the list - abort(state); - } - else - { - state.results[key] = output; - } - - // return salvaged results - callback(error, state.results); - }); -} - -/** - * Runs iterator over provided job element - * - * @param {function} iterator - iterator to invoke - * @param {string|number} key - key/index of the element in the list of jobs - * @param {mixed} item - job description - * @param {function} callback - invoked after iterator is done with the job - * @returns {function|mixed} - job abort function or something else - */ -function runJob(iterator, key, item, callback) -{ - var aborter; - - // allow shortcut if iterator expects only two arguments - if (iterator.length == 2) - { - aborter = iterator(item, async(callback)); - } - // otherwise go with full three arguments - else - { - aborter = iterator(item, key, async(callback)); - } - - return aborter; -} - - -/***/ }), -/* 288 */ -/***/ (function(module, exports) { - -// API -module.exports = state; - -/** - * Creates initial state object - * for iteration over list - * - * @param {array|object} list - list to iterate over - * @param {function|null} sortMethod - function to use for keys sort, - * or `null` to keep them as is - * @returns {object} - initial state object - */ -function state(list, sortMethod) -{ - var isNamedList = !Array.isArray(list) - , initState = - { - index : 0, - keyedList: isNamedList || sortMethod ? Object.keys(list) : null, - jobs : {}, - results : isNamedList ? {} : [], - size : isNamedList ? Object.keys(list).length : list.length - } - ; - - if (sortMethod) - { - // sort array keys based on it's values - // sort object's keys just on own merit - initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) - { - return sortMethod(list[a], list[b]); - }); - } - - return initState; -} - - -/***/ }), -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { - -var abort = __webpack_require__(285) - , async = __webpack_require__(286) - ; - -// API -module.exports = terminator; - -/** - * Terminates jobs in the attached state context - * - * @this AsyncKitState# - * @param {function} callback - final callback to invoke after termination - */ -function terminator(callback) -{ - if (!Object.keys(this.jobs).length) - { - return; - } - - // fast forward iteration index - this.index = this.size; - - // abort jobs - abort(this); - - // send back results we have so far - async(callback)(null, this.results); -} - - -/***/ }), -/* 290 */ -/***/ (function(module, exports, __webpack_require__) { - -var iterate = __webpack_require__(287) - , initState = __webpack_require__(288) - , terminator = __webpack_require__(289) - ; - -// Public API -module.exports = serialOrdered; -// sorting helpers -module.exports.ascending = ascending; -module.exports.descending = descending; - -/** - * Runs iterator over provided sorted array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} sortMethod - custom sort function - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serialOrdered(list, iterator, sortMethod, callback) -{ - var state = initState(list, sortMethod); - - iterate(list, iterator, state, function iteratorHandler(error, result) - { - if (error) - { - callback(error, result); - return; - } - - state.index++; - - // are we there yet? - if (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, iteratorHandler); - return; - } - - // done here - callback(null, state.results); - }); - - return terminator.bind(state, callback); -} - -/* - * -- Sort methods - */ - -/** - * sort helper to sort array elements in ascending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function ascending(a, b) -{ - return a < b ? -1 : a > b ? 1 : 0; -} - -/** - * sort helper to sort array elements in descending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function descending(a, b) -{ - return -1 * ascending(a, b); -} - - -/***/ }), -/* 291 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * `input` type prompt - */ - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var chalk = __webpack_require__(36); - -var _require = __webpack_require__(65), - map = _require.map, - takeUntil = _require.takeUntil; - -var Base = __webpack_require__(73); -var observe = __webpack_require__(74); - -var InputPrompt = function (_Base) { - (0, (_inherits2 || _load_inherits()).default)(InputPrompt, _Base); - - function InputPrompt() { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, InputPrompt); - return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.apply(this, arguments)); - } - - /** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - - InputPrompt.prototype._run = function _run(cb) { - this.done = cb; - - // Once user confirm (enter key) - var events = observe(this.rl); - var submit = events.line.pipe(map(this.filterInput.bind(this))); - - var validation = this.handleSubmitEvents(submit); - validation.success.forEach(this.onEnd.bind(this)); - validation.error.forEach(this.onError.bind(this)); - - events.keypress.pipe(takeUntil(validation.success)).forEach(this.onKeypress.bind(this)); - - // Init - this.render(); - - return this; - }; - - /** - * Render the prompt to screen - * @return {InputPrompt} self - */ - - InputPrompt.prototype.render = function render(error) { - var bottomContent = ''; - var appendContent = ''; - var message = this.getQuestion(); - var transformer = this.opt.transformer; - var isFinal = this.status === 'answered'; - - if (isFinal) { - appendContent = this.answer; - } else { - appendContent = this.rl.line; - } - - if (transformer) { - message += transformer(appendContent, this.answers, { isFinal }); - } else { - message += isFinal ? chalk.cyan(appendContent) : appendContent; - } - - if (error) { - bottomContent = chalk.red('>> ') + error; - } - - this.screen.render(message, bottomContent); - }; - - /** - * When user press `enter` key - */ - - InputPrompt.prototype.filterInput = function filterInput(input) { - if (!input) { - return this.opt.default == null ? '' : this.opt.default; - } - return input; - }; - - InputPrompt.prototype.onEnd = function onEnd(state) { - this.answer = state.value; - this.status = 'answered'; - - // Re-render prompt - this.render(); - - this.screen.done(); - this.done(state.value); - }; - - InputPrompt.prototype.onError = function onError(state) { - this.render(state.isValid); - }; - - /** - * When user press a key - */ - - InputPrompt.prototype.onKeypress = function onKeypress() { - // If user press a key, just clear the default value - if (this.opt.default) { - this.opt.default = undefined; - } - - this.render(); - }; - - return InputPrompt; -}(Base); - -module.exports = InputPrompt; - -/***/ }), -/* 292 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _ = __webpack_require__(45); -var MuteStream = __webpack_require__(371); -var readline = __webpack_require__(186); - -/** - * Base interface class other can inherits from - */ - -var UI = function () { - function UI(opt) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, UI); - - // Instantiate the Readline interface - // @Note: Don't reassign if already present (allow test to override the Stream) - if (!this.rl) { - this.rl = readline.createInterface(setupReadlineOptions(opt)); - } - this.rl.resume(); - - this.onForceClose = this.onForceClose.bind(this); - - // Make sure new prompt start on a newline when closing - process.on('exit', this.onForceClose); - - // Terminate process on SIGINT (which will call process.on('exit') in return) - this.rl.on('SIGINT', this.onForceClose); - } - - /** - * Handle the ^C exit - * @return {null} - */ - - UI.prototype.onForceClose = function onForceClose() { - this.close(); - process.kill(process.pid, 'SIGINT'); - console.log(''); - }; - - /** - * Close the interface and cleanup listeners - */ - - UI.prototype.close = function close() { - // Remove events listeners - this.rl.removeListener('SIGINT', this.onForceClose); - process.removeListener('exit', this.onForceClose); - - this.rl.output.unmute(); - - if (this.activePrompt && typeof this.activePrompt.close === 'function') { - this.activePrompt.close(); - } - - // Close the readline - this.rl.output.end(); - this.rl.pause(); - this.rl.close(); - }; - - return UI; -}(); - -function setupReadlineOptions(opt) { - opt = opt || {}; - - // Default `input` to stdin - var input = opt.input || process.stdin; - - // Add mute capabilities to the output - var ms = new MuteStream(); - ms.pipe(opt.output || process.stdout); - var output = ms; - - return _.extend({ - terminal: true, - input: input, - output: output - }, _.omit(opt, ['input', 'output'])); -} - -module.exports = UI; - -/***/ }), -/* 293 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var ansiEscapes = __webpack_require__(477); - -/** - * Move cursor left by `x` - * @param {Readline} rl - Readline instance - * @param {Number} x - How far to go left (default to 1) - */ - -exports.left = function (rl, x) { - rl.output.write(ansiEscapes.cursorBackward(x)); -}; - -/** - * Move cursor right by `x` - * @param {Readline} rl - Readline instance - * @param {Number} x - How far to go left (default to 1) - */ - -exports.right = function (rl, x) { - rl.output.write(ansiEscapes.cursorForward(x)); -}; - -/** - * Move cursor up by `x` - * @param {Readline} rl - Readline instance - * @param {Number} x - How far to go up (default to 1) - */ - -exports.up = function (rl, x) { - rl.output.write(ansiEscapes.cursorUp(x)); -}; - -/** - * Move cursor down by `x` - * @param {Readline} rl - Readline instance - * @param {Number} x - How far to go down (default to 1) - */ - -exports.down = function (rl, x) { - rl.output.write(ansiEscapes.cursorDown(x)); -}; - -/** - * Clear current line - * @param {Readline} rl - Readline instance - * @param {Number} len - number of line to delete - */ -exports.clearLine = function (rl, len) { - rl.output.write(ansiEscapes.eraseLines(len)); -}; - -/***/ }), -/* 294 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = { - 'upgrade-interactive': 'upgradeInteractive', - 'generate-lock-entry': 'generateLockEntry' -}; - -/***/ }), -/* 295 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = undefined; - -var _stringify; - -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(40)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var DEFAULT_LOG_LEVEL = 'info'; - var audit = new Audit(config, reporter, { - groups: flags.groups || (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES, - level: flags.level || DEFAULT_LOG_LEVEL - }); - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); - var install = new (_install || _load_install()).Install({}, config, reporter, lockfile); - - var _ref2 = yield install.fetchRequestFromCwd(), - manifest = _ref2.manifest, - requests = _ref2.requests, - patterns = _ref2.patterns, - workspaceLayout = _ref2.workspaceLayout; - - yield install.resolver.init(requests, { - workspaceLayout - }); - - var vulnerabilities = yield audit.performAudit(manifest, lockfile, install.resolver, install.linker, patterns); - - var EXIT_INFO = 1; - var EXIT_LOW = 2; - var EXIT_MODERATE = 4; - var EXIT_HIGH = 8; - var EXIT_CRITICAL = 16; - - var exitCode = (vulnerabilities.info ? EXIT_INFO : 0) + (vulnerabilities.low ? EXIT_LOW : 0) + (vulnerabilities.moderate ? EXIT_MODERATE : 0) + (vulnerabilities.high ? EXIT_HIGH : 0) + (vulnerabilities.critical ? EXIT_CRITICAL : 0); - - if (flags.summary) { - audit.summary(); - } else { - audit.report(); - } - - return exitCode; - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _promise; - -function _load_promise() { - return _promise = __webpack_require__(86); -} - -var _hoistedTreeBuilder; - -function _load_hoistedTreeBuilder() { - return _hoistedTreeBuilder = __webpack_require__(541); -} - -var _getTransitiveDevDependencies; - -function _load_getTransitiveDevDependencies() { - return _getTransitiveDevDependencies = __webpack_require__(569); -} - -var _install; - -function _load_install() { - return _install = __webpack_require__(41); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(13); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var zlib = __webpack_require__(187); - -var gzip = (0, (_promise || _load_promise()).promisify)(zlib.gzip); - -function setFlags(commander) { - commander.description('Checks for known security issues with the installed packages.'); - commander.option('--summary', 'Only print the summary.'); - commander.option('--groups [ ...]', `Only audit dependencies from listed groups. Default: ${(_constants || _load_constants()).OWNED_DEPENDENCY_TYPES.join(', ')}`, function (groups) { - return groups.split(' '); - }, (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES); - commander.option('--level ', `Only print advisories with severity greater than or equal to one of the following: \ - info|low|moderate|high|critical. Default: info`, 'info'); -} - -function hasWrapper(commander, args) { - return true; -} - -var Audit = function () { - function Audit(config, reporter, options) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Audit); - this.severityLevels = ['info', 'low', 'moderate', 'high', 'critical']; - - this.config = config; - this.reporter = reporter; - this.options = options; - } - - Audit.prototype._mapHoistedNodes = function _mapHoistedNodes(auditNode, hoistedNodes, transitiveDevDeps) { - for (var _iterator = hoistedNodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref3; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref3 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref3 = _i.value; - } - - var node = _ref3; - - var pkg = node.manifest.pkg; - var _requires = (0, (_assign || _load_assign()).default)({}, pkg.dependencies || {}, pkg.optionalDependencies || {}); - for (var _iterator2 = (0, (_keys || _load_keys()).default)(_requires), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref4; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref4 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref4 = _i2.value; - } - - var _name = _ref4; - - if (!_requires[_name]) { - _requires[_name] = '*'; - } - } - auditNode.dependencies[node.name] = { - version: node.version, - integrity: pkg._remote ? pkg._remote.integrity || '' : '', - requires: _requires, - dependencies: {}, - dev: transitiveDevDeps.has(`${node.name}@${node.version}`) - }; - if (node.children) { - this._mapHoistedNodes(auditNode.dependencies[node.name], node.children, transitiveDevDeps); - } - } - }; - - Audit.prototype._mapHoistedTreesToAuditTree = function _mapHoistedTreesToAuditTree(manifest, hoistedTrees, transitiveDevDeps) { - var requiresGroups = this.options.groups.map(function (group) { - return manifest[group] || {}; - }); - - var auditTree = { - name: manifest.name || undefined, - version: manifest.version || undefined, - install: [], - remove: [], - metadata: { - //TODO: What do we send here? npm sends npm version, node version, etc. - }, - requires: (_assign || _load_assign()).default.apply(Object, [{}].concat(requiresGroups)), - integrity: undefined, - dependencies: {}, - dev: false - }; - - this._mapHoistedNodes(auditTree, hoistedTrees, transitiveDevDeps); - return auditTree; - }; - - Audit.prototype._fetchAudit = function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (auditTree) { - var responseJson = void 0; - var registry = (_constants || _load_constants()).YARN_REGISTRY; - this.reporter.verbose(`Audit Request: ${(0, (_stringify || _load_stringify()).default)(auditTree, null, 2)}`); - var requestBody = yield gzip((0, (_stringify || _load_stringify()).default)(auditTree)); - var response = yield this.config.requestManager.request({ - url: `${registry}/-/npm/v1/security/audits`, - method: 'POST', - body: requestBody, - headers: { - 'Content-Encoding': 'gzip', - 'Content-Type': 'application/json', - Accept: 'application/json' - } - }); - - try { - responseJson = JSON.parse(response); - } catch (ex) { - throw new Error(`Unexpected audit response (Invalid JSON): ${response}`); - } - if (!responseJson.metadata) { - throw new Error(`Unexpected audit response (Missing Metadata): ${(0, (_stringify || _load_stringify()).default)(responseJson, null, 2)}`); - } - this.reporter.verbose(`Audit Response: ${(0, (_stringify || _load_stringify()).default)(responseJson, null, 2)}`); - return responseJson; - }); - - function _fetchAudit(_x5) { - return _ref5.apply(this, arguments); - } - - return _fetchAudit; - }(); - - Audit.prototype._insertWorkspacePackagesIntoManifest = function _insertWorkspacePackagesIntoManifest(manifest, resolver) { - if (resolver.workspaceLayout) { - var workspaceAggregatorName = resolver.workspaceLayout.virtualManifestName; - var workspaceManifest = resolver.workspaceLayout.workspaces[workspaceAggregatorName].manifest; - - manifest.dependencies = (0, (_assign || _load_assign()).default)(manifest.dependencies || {}, workspaceManifest.dependencies); - manifest.devDependencies = (0, (_assign || _load_assign()).default)(manifest.devDependencies || {}, workspaceManifest.devDependencies); - manifest.optionalDependencies = (0, (_assign || _load_assign()).default)(manifest.optionalDependencies || {}, workspaceManifest.optionalDependencies); - } - }; - - Audit.prototype.performAudit = function () { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (manifest, lockfile, resolver, linker, patterns) { - this._insertWorkspacePackagesIntoManifest(manifest, resolver); - var transitiveDevDeps = (0, (_getTransitiveDevDependencies || _load_getTransitiveDevDependencies()).getTransitiveDevDependencies)(manifest, resolver.workspaceLayout, lockfile); - var hoistedTrees = yield (0, (_hoistedTreeBuilder || _load_hoistedTreeBuilder()).buildTree)(resolver, linker, patterns); - var auditTree = this._mapHoistedTreesToAuditTree(manifest, hoistedTrees, transitiveDevDeps); - this.auditData = yield this._fetchAudit(auditTree); - return this.auditData.metadata.vulnerabilities; - }); - - function performAudit(_x6, _x7, _x8, _x9, _x10) { - return _ref6.apply(this, arguments); - } - - return performAudit; - }(); - - Audit.prototype.summary = function summary() { - if (!this.auditData) { - return; - } - this.reporter.auditSummary(this.auditData.metadata); - }; - - Audit.prototype.report = function report() { - var _this = this; - - if (!this.auditData) { - return; - } - - var startLoggingAt = Math.max(0, this.severityLevels.indexOf(this.options.level)); - - var reportAdvisory = function reportAdvisory(resolution) { - var advisory = _this.auditData.advisories[resolution.id.toString()]; - - if (_this.severityLevels.indexOf(advisory.severity) >= startLoggingAt) { - _this.reporter.auditAdvisory(resolution, advisory); - } - }; - - if ((0, (_keys || _load_keys()).default)(this.auditData.advisories).length !== 0) { - // let printedManualReviewHeader = false; - - this.auditData.actions.forEach(function (action) { - action.resolves.forEach(reportAdvisory); - - /* The following block has been temporarily removed - * because the actions returned by npm are not valid for yarn. - * Removing this action reporting until we can come up with a way - * to correctly resolve issues. - */ - // if (action.action === 'update' || action.action === 'install') { - // // these advisories can be resolved automatically by running a yarn command - // const recommendation: AuditActionRecommendation = { - // cmd: `yarn upgrade ${action.module}@${action.target}`, - // isBreaking: action.isMajor, - // action, - // }; - // this.reporter.auditAction(recommendation); - // action.resolves.forEach(reportAdvisory); - // } - - // if (action.action === 'review') { - // // these advisories cannot be resolved automatically and require manual review - // if (!printedManualReviewHeader) { - // this.reporter.auditManualReview(); - // } - // printedManualReviewHeader = true; - // action.resolves.forEach(reportAdvisory); - // } - }); - } - - this.summary(); - }; - - return Audit; -}(); - -exports.default = Audit; - -/***/ }), -/* 296 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.clean = exports.noArguments = exports.requireLockfile = undefined; - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var clean = exports.clean = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) { - var loc = path.join(config.lockfileFolder, (_constants || _load_constants()).CLEAN_FILENAME); - var file = yield (_fs || _load_fs()).readFile(loc); - var lines = file.split('\n'); - var filters = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines); - - var removedFiles = 0; - var removedSize = 0; - - // build list of possible module folders - var locs = new (_set || _load_set()).default(); - for (var _iterator = config.registryFolders, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref2; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - var registryFolder = _ref2; - - locs.add(path.resolve(config.lockfileFolder, registryFolder)); - } - - var workspaceRootFolder = config.workspaceRootFolder; - if (workspaceRootFolder) { - var manifest = yield config.findManifest(workspaceRootFolder, false); - invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property'); - - var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest); - - for (var _iterator2 = (0, (_keys || _load_keys()).default)(workspaces), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref3; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; - } - - var workspaceName = _ref3; - - for (var _iterator3 = (_index || _load_index()).registryNames, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref4; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } - - var name = _ref4; - - var registry = config.registries[name]; - locs.add(path.join(workspaces[workspaceName].loc, registry.folder)); - } - } - } - - for (var _iterator4 = locs, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref5; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref5 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref5 = _i4.value; - } - - var folder = _ref5; - - if (!(yield (_fs || _load_fs()).exists(folder))) { - continue; - } - - var spinner = reporter.activity(); - var files = yield (_fs || _load_fs()).walk(folder); - - var _sortFilter = (0, (_filter || _load_filter()).sortFilter)(files, filters), - ignoreFiles = _sortFilter.ignoreFiles; - - spinner.end(); - - var tick = reporter.progress(ignoreFiles.size); - // TODO make sure `main` field of all modules isn't ignored - - for (var _iterator5 = ignoreFiles, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { - var _ref6; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref6 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref6 = _i5.value; - } - - var _file = _ref6; - - var _loc = path.join(folder, _file); - var stat = yield (_fs || _load_fs()).lstat(_loc); - removedSize += stat.size; - removedFiles++; - } - - for (var _iterator6 = ignoreFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { - var _ref7; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref7 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref7 = _i6.value; - } - - var _file2 = _ref7; - - var _loc2 = path.join(folder, _file2); - yield (_fs || _load_fs()).unlink(_loc2); - tick(); - } - } - - return { removedFiles, removedSize }; - }); - - return function clean(_x, _x2) { - return _ref.apply(this, arguments); - }; -}(); - -var runInit = function () { - var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (cwd, reporter) { - reporter.step(1, 1, reporter.lang('cleanCreatingFile', (_constants || _load_constants()).CLEAN_FILENAME)); - var cleanLoc = path.join(cwd, (_constants || _load_constants()).CLEAN_FILENAME); - yield (_fs || _load_fs()).writeFile(cleanLoc, `${DEFAULT_FILTER}\n`, { flag: 'wx' }); - reporter.info(reporter.lang('cleanCreatedFile', (_constants || _load_constants()).CLEAN_FILENAME)); - }); - - return function runInit(_x3, _x4) { - return _ref8.apply(this, arguments); - }; -}(); - -var runAutoClean = function () { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) { - reporter.step(1, 1, reporter.lang('cleaning')); - - var _ref10 = yield clean(config, reporter), - removedFiles = _ref10.removedFiles, - removedSize = _ref10.removedSize; - - reporter.info(reporter.lang('cleanRemovedFiles', removedFiles)); - reporter.info(reporter.lang('cleanSavedSize', Number((removedSize / 1024 / 1024).toFixed(2)))); - }); - - return function runAutoClean(_x5, _x6) { - return _ref9.apply(this, arguments); - }; -}(); - -var checkForCleanFile = function () { - var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (cwd) { - var cleanLoc = path.join(cwd, (_constants || _load_constants()).CLEAN_FILENAME); - var exists = yield (_fs || _load_fs()).exists(cleanLoc); - return exists; - }); - - return function checkForCleanFile(_x7) { - return _ref11.apply(this, arguments); - }; -}(); - -var run = exports.run = function () { - var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var cleanFileExists = yield checkForCleanFile(config.cwd); - - if (flags.init && cleanFileExists) { - reporter.info(reporter.lang('cleanAlreadyExists', (_constants || _load_constants()).CLEAN_FILENAME)); - } else if (flags.init) { - yield runInit(config.cwd, reporter); - } else if (flags.force && cleanFileExists) { - yield runAutoClean(config, reporter); - } else if (cleanFileExists) { - reporter.info(reporter.lang('cleanRequiresForce', (_constants || _load_constants()).CLEAN_FILENAME)); - } else { - reporter.info(reporter.lang('cleanDoesNotExist', (_constants || _load_constants()).CLEAN_FILENAME)); - } - }); - - return function run(_x8, _x9, _x10, _x11) { - return _ref12.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _index; - -function _load_index() { - return _index = __webpack_require__(60); -} - -var _filter; - -function _load_filter() { - return _filter = __webpack_require__(315); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(13); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var invariant = __webpack_require__(15); -var path = __webpack_require__(1); - -var requireLockfile = exports.requireLockfile = true; -var noArguments = exports.noArguments = true; - -var DEFAULT_FILTER = ` -# test directories -__tests__ -test -tests -powered-test - -# asset directories -docs -doc -website -images -assets - -# examples -example -examples - -# code coverage directories -coverage -.nyc_output - -# build scripts -Makefile -Gulpfile.js -Gruntfile.js - -# configs -appveyor.yml -circle.yml -codeship-services.yml -codeship-steps.yml -wercker.yml -.tern-project -.gitattributes -.editorconfig -.*ignore -.eslintrc -.jshintrc -.flowconfig -.documentup.json -.yarn-metadata.json -.travis.yml - -# misc -*.md -`.trim(); - -function setFlags(commander) { - commander.description('Cleans and removes unnecessary files from package dependencies.'); - commander.usage('autoclean [flags]'); - commander.option('-I, --init', `Create "${(_constants || _load_constants()).CLEAN_FILENAME}" file with the default entries.`); - commander.option('-F, --force', `Run autoclean using the existing "${(_constants || _load_constants()).CLEAN_FILENAME}" file.`); -} - -function hasWrapper(commander) { - return true; -} - -/***/ }), -/* 297 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.examples = exports.run = exports.getCachedPackagesDirs = undefined; - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var getCachedPackagesDirs = exports.getCachedPackagesDirs = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, currentPath) { - var results = []; - var stat = yield (_fs || _load_fs()).lstat(currentPath); - - if (!stat.isDirectory()) { - return results; - } - - var folders = yield (_fs || _load_fs()).readdir(currentPath); - for (var _iterator = folders, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref2; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - var folder = _ref2; - - if (folder[0] === '.') { - continue; - } - var packageParentPath = path.join(currentPath, folder, 'node_modules'); - - var candidates = yield (_fs || _load_fs()).readdir(packageParentPath); - invariant(candidates.length === 1, `There should only be one folder in a package cache (got ${candidates.join(',')} in ${packageParentPath})`); - - for (var _iterator2 = candidates, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref3; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; - } - - var candidate = _ref3; - - var candidatePath = path.join(packageParentPath, candidate); - if (candidate.charAt(0) === '@') { - var subCandidates = yield (_fs || _load_fs()).readdir(candidatePath); - invariant(subCandidates.length === 1, `There should only be one folder in a package cache (got ${subCandidates.join(',')} in ${candidatePath})`); - - for (var _iterator3 = subCandidates, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref4; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } - - var subCandidate = _ref4; - - var subCandidatePath = path.join(candidatePath, subCandidate); - results.push(subCandidatePath); - } - } else { - results.push(candidatePath); - } - } - } - - return results; - }); - - return function getCachedPackagesDirs(_x, _x2) { - return _ref.apply(this, arguments); - }; -}(); - -var getCachedPackages = function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { - var paths = yield getCachedPackagesDirs(config, config.cacheFolder); - return _getMetadataWithPath(config.readPackageMetadata.bind(config), paths).then(function (packages) { - return packages.filter(function (p) { - return !!p; - }); - }); - }); - - return function getCachedPackages(_x3) { - return _ref5.apply(this, arguments); - }; -}(); - -var list = function () { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var filterOut = function filterOut() { - var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - registry = _ref7.registry, - manifest = _ref7.package, - remote = _ref7.remote; - - if (flags.pattern && !micromatch.contains(manifest.name, flags.pattern)) { - return false; - } - return true; - }; - - var forReport = function forReport() { - var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - registry = _ref8.registry, - manifest = _ref8.package, - remote = _ref8.remote; - - return [manifest.name, manifest.version, registry, remote && remote.resolved || '']; - }; - - var packages = yield getCachedPackages(config); - var body = packages.filter(filterOut).map(forReport); - reporter.table(['Name', 'Version', 'Registry', 'Resolved'], body); - }); - - return function list(_x4, _x5, _x6, _x7) { - return _ref6.apply(this, arguments); - }; -}(); - -var clean = function () { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (config.cacheFolder) { - var activity = reporter.activity(); - - if (args.length > 0) { - // Clear named packages from cache - var packages = yield getCachedPackages(config); - var shouldDelete = function shouldDelete() { - var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - registry = _ref10.registry, - manifest = _ref10.package, - remote = _ref10.remote; - - return args.indexOf(manifest.name) !== -1; - }; - var packagesToDelete = packages.filter(shouldDelete); - - for (var _iterator4 = packagesToDelete, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref11; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref11 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref11 = _i4.value; - } - - var manifest = _ref11; - - var relativePath = path.relative(config.cacheFolder, manifest._path); - while (relativePath && relativePath !== '.') { - yield (_fs || _load_fs()).unlink(path.resolve(config.cacheFolder, relativePath)); - relativePath = path.dirname(relativePath); - } - } - - activity.end(); - reporter.success(reporter.lang('clearedPackageFromCache', args[0])); - } else { - // Clear all cache - yield (_fs || _load_fs()).unlink(config._cacheRootFolder); - yield (_fs || _load_fs()).mkdirp(config.cacheFolder); - activity.end(); - reporter.success(reporter.lang('clearedCache')); - } - } - }); - - return function clean(_x10, _x11, _x12, _x13) { - return _ref9.apply(this, arguments); - }; -}(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _buildSubCommands2; - -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var invariant = __webpack_require__(15); -var path = __webpack_require__(1); -var micromatch = __webpack_require__(108); - -function hasWrapper(flags, args) { - return args[0] !== 'dir'; -} - -function _getMetadataWithPath(getMetadataFn, paths) { - return (_promise || _load_promise()).default.all(paths.map(function (path) { - return getMetadataFn(path).then(function (r) { - r._path = path; - return r; - }).catch(function (error) { - return undefined; - }); - })); -} - -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('cache', { - ls(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - reporter.warn(`\`yarn cache ls\` is deprecated. Please use \`yarn cache list\`.`); - yield list(config, reporter, flags, args); - })(); - }, - list, - clean, - dir(config, reporter) { - reporter.log(config.cacheFolder, { force: true }); - } -}), - run = _buildSubCommands.run, - _setFlags = _buildSubCommands.setFlags, - examples = _buildSubCommands.examples; - -exports.run = run; -exports.examples = examples; -function setFlags(commander) { - _setFlags(commander); - commander.description('Yarn cache list will print out every cached package.'); - commander.option('--pattern [pattern]', 'filter cached packages by pattern'); -} - -/***/ }), -/* 298 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.verifyTreeCheck = exports.noArguments = exports.requireLockfile = undefined; - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var verifyTreeCheck = exports.verifyTreeCheck = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var errCount = 0; - function reportError(msg) { - for (var _len = arguments.length, vars = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - vars[_key - 1] = arguments[_key]; - } - - reporter.error(reporter.lang.apply(reporter, [msg].concat(vars))); - errCount++; - } - // check all dependencies recursively without relying on internal resolver - var registryName = 'yarn'; - var registryFolder = config.registryFolders[0]; - var cwd = config.workspaceRootFolder ? config.lockfileFolder : config.cwd; - var rootManifest = yield config.readManifest(cwd, registryName); - - var dependenciesToCheckVersion = []; - if (rootManifest.dependencies) { - for (var _name in rootManifest.dependencies) { - var _version = rootManifest.dependencies[_name]; - // skip linked dependencies - var isLinkedDependency = /^link:/i.test(_version) || /^file:/i.test(_version) && config.linkFileDependencies; - if (isLinkedDependency) { - continue; - } - dependenciesToCheckVersion.push({ - name: _name, - originalKey: _name, - parentCwd: cwd, - version: _version - }); - } - } - if (rootManifest.devDependencies && !config.production) { - for (var _name2 in rootManifest.devDependencies) { - var _version2 = rootManifest.devDependencies[_name2]; - // skip linked dependencies - var _isLinkedDependency = /^link:/i.test(_version2) || /^file:/i.test(_version2) && config.linkFileDependencies; - if (_isLinkedDependency) { - continue; - } - dependenciesToCheckVersion.push({ - name: _name2, - originalKey: _name2, - parentCwd: cwd, - version: _version2 - }); - } - } - - var locationsVisited = new (_set || _load_set()).default(); - while (dependenciesToCheckVersion.length) { - var dep = dependenciesToCheckVersion.shift(); - var manifestLoc = path.resolve(dep.parentCwd, registryFolder, dep.name); - if (locationsVisited.has(manifestLoc + `@${dep.version}`)) { - continue; - } - locationsVisited.add(manifestLoc + `@${dep.version}`); - // When plugnplay is enabled, packages aren't copied to the node_modules folder, so this check doesn't make sense - // TODO: We ideally should check that the packages are located inside the cache instead - if (config.plugnplayEnabled) { - continue; - } - if (!(yield (_fs || _load_fs()).exists(manifestLoc))) { - reportError('packageNotInstalled', `${dep.originalKey}`); - continue; - } - if (!(yield (_fs || _load_fs()).exists(path.join(manifestLoc, 'package.json')))) { - continue; - } - var pkg = yield config.readManifest(manifestLoc, registryName); - if (semver.validRange(dep.version, config.looseSemver) && !semver.satisfies(pkg.version, dep.version, config.looseSemver)) { - reportError('packageWrongVersion', dep.originalKey, dep.version, pkg.version); - continue; - } - var dependencies = pkg.dependencies; - if (dependencies) { - for (var subdep in dependencies) { - var subDepPath = path.resolve(manifestLoc, registryFolder, subdep); - var found = false; - var relative = path.relative(cwd, subDepPath); - var locations = path.normalize(relative).split(registryFolder + path.sep).filter(function (dir) { - return !!dir; - }); - locations.pop(); - while (locations.length >= 0) { - var possiblePath = void 0; - if (locations.length > 0) { - possiblePath = path.join(cwd, registryFolder, locations.join(path.sep + registryFolder + path.sep)); - } else { - possiblePath = cwd; - } - if (yield (_fs || _load_fs()).exists(path.resolve(possiblePath, registryFolder, subdep))) { - dependenciesToCheckVersion.push({ - name: subdep, - originalKey: `${dep.originalKey}#${subdep}`, - parentCwd: possiblePath, - version: dependencies[subdep] - }); - found = true; - break; - } - if (!locations.length) { - break; - } - locations.pop(); - } - if (!found) { - reportError('packageNotInstalled', `${dep.originalKey}#${subdep}`); - } - } - } - } - - if (errCount > 0) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('foundErrors', errCount)); - } else { - reporter.success(reporter.lang('folderInSync')); - } - }); - - return function verifyTreeCheck(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -var integrityHashCheck = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var errCount = 0; - function reportError(msg) { - for (var _len2 = arguments.length, vars = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - vars[_key2 - 1] = arguments[_key2]; - } - - reporter.error(reporter.lang.apply(reporter, [msg].concat(vars))); - errCount++; - } - var integrityChecker = new (_integrityChecker || _load_integrityChecker()).default(config); - - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); - var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); - - // get patterns that are installed when running `yarn install` - - var _ref3 = yield install.fetchRequestFromCwd(), - patterns = _ref3.patterns, - workspaceLayout = _ref3.workspaceLayout; - - var match = yield integrityChecker.check(patterns, lockfile.cache, flags, workspaceLayout); - for (var _iterator = match.missingPatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref4; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref4 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref4 = _i.value; - } - - var pattern = _ref4; - - reportError('lockfileNotContainPattern', pattern); - } - if (match.integrityFileMissing) { - reportError('noIntegrityFile'); - } - if (match.integrityMatches === false) { - reporter.warn(reporter.lang((_integrityChecker2 || _load_integrityChecker2()).integrityErrors[match.integrityError])); - reportError('integrityCheckFailed'); - } - - if (errCount > 0) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('foundErrors', errCount)); - } else { - reporter.success(reporter.lang('folderInSync')); - } - }); - - return function integrityHashCheck(_x5, _x6, _x7, _x8) { - return _ref2.apply(this, arguments); - }; -}(); - -var run = exports.run = function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (flags.verifyTree) { - yield verifyTreeCheck(config, reporter, flags, args); - return; - } else if (flags.integrity) { - yield integrityHashCheck(config, reporter, flags, args); - return; - } - - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); - var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); - - function humaniseLocation(loc) { - var relative = path.relative(path.join(config.cwd, 'node_modules'), loc); - var normalized = path.normalize(relative).split(path.sep); - return normalized.filter(function (p) { - return p !== 'node_modules'; - }).reduce(function (result, part) { - var length = result.length; - if (length && result[length - 1].startsWith('@') && result[length - 1].indexOf(path.sep) === -1) { - result[length - 1] += path.sep + part; - } else { - result.push(part); - } - return result; - }, []); - } - - var warningCount = 0; - var errCount = 0; - function reportError(msg) { - for (var _len3 = arguments.length, vars = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { - vars[_key3 - 1] = arguments[_key3]; - } - - reporter.error(reporter.lang.apply(reporter, [msg].concat(vars))); - errCount++; - } - - // get patterns that are installed when running `yarn install` - - var _ref6 = yield install.hydrate(), - rawPatterns = _ref6.patterns, - workspaceLayout = _ref6.workspaceLayout; - - var patterns = yield install.flatten(rawPatterns); - - // check if patterns exist in lockfile - for (var _iterator2 = patterns, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref7; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref7 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref7 = _i2.value; - } - - var pattern = _ref7; - - if (!lockfile.getLocked(pattern) && (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern))) { - reportError('lockfileNotContainPattern', pattern); - } - } - - var bundledDeps = {}; - // check if any of the node_modules are out of sync - var res = yield install.linker.getFlatHoistedTree(patterns, workspaceLayout); - for (var _iterator3 = res, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref9; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref9 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref9 = _i3.value; - } - - var _ref8 = _ref9; - var loc = _ref8[0]; - var _ref8$ = _ref8[1]; - var _originalKey = _ref8$.originalKey; - var pkg = _ref8$.pkg; - var ignore = _ref8$.ignore; - - if (ignore) { - continue; - } - - var parts = humaniseLocation(loc); - - // grey out hoisted portions of key - var human = _originalKey; - var hoistedParts = parts.slice(); - var hoistedKey = parts.join('#'); - if (human !== hoistedKey) { - var humanParts = human.split('#'); - - for (var i = 0; i < humanParts.length; i++) { - var humanPart = humanParts[i]; - - if (hoistedParts[0] === humanPart) { - hoistedParts.shift(); - - if (i < humanParts.length - 1) { - humanParts[i] += '#'; - } - } else { - humanParts[i] = reporter.format.dim(`${humanPart}#`); - } - } - - human = humanParts.join(''); - } - - // skip unnecessary checks for linked dependencies - var remoteType = pkg._reference.remote.type; - var isLinkedDependency = remoteType === 'link' || remoteType === 'workspace' || remoteType === 'file' && config.linkFileDependencies; - var isResolution = pkg._reference.hint === 'resolution'; - if (isLinkedDependency || isResolution) { - continue; - } - - if (!(yield (_fs || _load_fs()).exists(loc))) { - if (pkg._reference.optional) { - reporter.warn(reporter.lang('optionalDepNotInstalled', human)); - } else { - reportError('packageNotInstalled', human); - } - continue; - } - - var pkgLoc = path.join(loc, 'package.json'); - - if (yield (_fs || _load_fs()).exists(pkgLoc)) { - var packageJson = yield config.readJson(pkgLoc); - packageJson.version = semver.clean(packageJson.version); - - if (pkg.version !== packageJson.version) { - // node_modules contains wrong version - reportError('packageWrongVersion', human, pkg.version, packageJson.version); - } - - var deps = (0, (_assign || _load_assign()).default)({}, packageJson.dependencies, packageJson.peerDependencies); - bundledDeps[packageJson.name] = packageJson.bundledDependencies || []; - - for (var _name3 in deps) { - var range = deps[_name3]; - if (!semver.validRange(range, config.looseSemver)) { - continue; // exotic - } - - var subHuman = `${human}#${_name3}@${range}`; - - // find the package that this will resolve to, factoring in hoisting - var possibles = []; - var depLoc = void 0; - for (var _i4 = parts.length; _i4 >= 0; _i4--) { - var myParts = parts.slice(0, _i4).concat(_name3); - - // build package.json location for this position - var myDepPkgLoc = path.join(config.cwd, 'node_modules', myParts.join(`${path.sep}node_modules${path.sep}`)); - - possibles.push(myDepPkgLoc); - } - while (possibles.length) { - var _myDepPkgLoc = possibles.shift(); - if (yield (_fs || _load_fs()).exists(_myDepPkgLoc)) { - depLoc = _myDepPkgLoc; - break; - } - } - if (!depLoc) { - // we'll hit the module not install error above when this module is hit - continue; - } - - var depPkgLoc = path.join(depLoc, 'package.json'); - - if (yield (_fs || _load_fs()).exists(depPkgLoc)) { - var depPkg = yield config.readJson(depPkgLoc); - var foundHuman = `${humaniseLocation(path.dirname(depPkgLoc)).join('#')}@${depPkg.version}`; - if (!semver.satisfies(depPkg.version, range, config.looseSemver)) { - // module isn't correct semver - var resPattern = install.resolutionMap.find(_name3, _originalKey.split('#')); - if (resPattern) { - var resHuman = `${human}#${resPattern}`; - - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(resPattern), - resRange = _normalizePattern.range; - - if (semver.satisfies(depPkg.version, resRange, config.looseSemver)) { - reporter.warn(reporter.lang('incompatibleResolutionVersion', foundHuman, subHuman)); - warningCount++; - } else { - reportError('packageDontSatisfy', resHuman, foundHuman); - } - } else { - reportError('packageDontSatisfy', subHuman, foundHuman); - } - - continue; - } - - // check for modules above us that this could be deduped to - for (var _iterator4 = possibles, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref10; - - if (_isArray4) { - if (_i5 >= _iterator4.length) break; - _ref10 = _iterator4[_i5++]; - } else { - _i5 = _iterator4.next(); - if (_i5.done) break; - _ref10 = _i5.value; - } - - var _loc = _ref10; - - var locPkg = path.join(_loc, 'package.json'); - - if (!(yield (_fs || _load_fs()).exists(locPkg))) { - continue; - } - - var _packageJson = yield config.readJson(locPkg); - var packagePath = _originalKey.split('#'); - var rootDep = packagePath[0]; - var packageName = packagePath[1] || _packageJson.name; - - var bundledDep = bundledDeps[rootDep] && bundledDeps[rootDep].indexOf(packageName) !== -1; - if (!bundledDep && (_packageJson.version === depPkg.version || semver.satisfies(_packageJson.version, range, config.looseSemver) && semver.gt(_packageJson.version, depPkg.version, config.looseSemver))) { - reporter.warn(reporter.lang('couldBeDeduped', subHuman, _packageJson.version, `${humaniseLocation(path.dirname(locPkg)).join('#')}@${_packageJson.version}`)); - warningCount++; - } - break; - } - } - } - } - } - - if (warningCount > 1) { - reporter.info(reporter.lang('foundWarnings', warningCount)); - } - - if (errCount > 0) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('foundErrors', errCount)); - } else { - reporter.success(reporter.lang('folderInSync')); - } - }); - - return function run(_x9, _x10, _x11, _x12) { - return _ref5.apply(this, arguments); - }; -}(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _integrityChecker; - -function _load_integrityChecker() { - return _integrityChecker = _interopRequireDefault(__webpack_require__(197)); -} - -var _integrityChecker2; - -function _load_integrityChecker2() { - return _integrityChecker2 = __webpack_require__(197); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _install; - -function _load_install() { - return _install = __webpack_require__(41); -} - -var _normalizePattern2; - -function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(52); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var semver = __webpack_require__(27); -var path = __webpack_require__(1); - -var requireLockfile = exports.requireLockfile = false; -var noArguments = exports.noArguments = true; - -function hasWrapper(commander) { - return true; -} - -function setFlags(commander) { - commander.description('Verifies if versions in the current project’s package.json match that of yarn’s lock file.'); - commander.option('--integrity'); - commander.option('--verify-tree'); -} - -/***/ }), -/* 299 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.getRegistryFolder = undefined; - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var getRegistryFolder = exports.getRegistryFolder = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, name) { - if (config.modulesFolder) { - return config.modulesFolder; - } - - var src = path.join(config.linkFolder, name); - - var _ref2 = yield config.readManifest(src), - _registry = _ref2._registry; - - invariant(_registry, 'expected registry'); - - var registryFolder = config.registries[_registry].folder; - return path.join(config.cwd, registryFolder); - }); - - return function getRegistryFolder(_x, _x2) { - return _ref.apply(this, arguments); - }; -}(); - -var run = exports.run = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (args.length) { - for (var _iterator = args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref4; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref4 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref4 = _i.value; - } - - var name = _ref4; - - var src = path.join(config.linkFolder, name); - - if (yield (_fs || _load_fs()).exists(src)) { - var folder = yield getRegistryFolder(config, name); - var dest = path.join(folder, name); - - yield (_fs || _load_fs()).unlink(dest); - yield (_fs || _load_fs()).mkdirp(path.dirname(dest)); - yield (_fs || _load_fs()).symlink(src, dest); - reporter.success(reporter.lang('linkUsing', name)); - } else { - throw new (_errors || _load_errors()).MessageError(reporter.lang('linkMissing', name)); - } - } - } else { - // add cwd module to the global registry - var manifest = yield config.readRootManifest(); - var _name = manifest.name; - if (!_name) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownPackageName')); - } - - var linkLoc = path.join(config.linkFolder, _name); - if (yield (_fs || _load_fs()).exists(linkLoc)) { - reporter.warn(reporter.lang('linkCollision', _name)); - } else { - yield (_fs || _load_fs()).mkdirp(path.dirname(linkLoc)); - yield (_fs || _load_fs()).symlink(config.cwd, linkLoc); - - // If there is a `bin` defined in the package.json, - // link each bin to the global bin - if (manifest.bin) { - var globalBinFolder = yield (0, (_global || _load_global()).getBinFolder)(config, flags); - for (var binName in manifest.bin) { - var binSrc = manifest.bin[binName]; - var binSrcLoc = path.join(linkLoc, binSrc); - var binDestLoc = path.join(globalBinFolder, binName); - if (yield (_fs || _load_fs()).exists(binDestLoc)) { - reporter.warn(reporter.lang('binLinkCollision', binName)); - } else { - if (process.platform === 'win32') { - yield cmdShim(binSrcLoc, binDestLoc, { createPwshFile: false }); - } else { - yield (_fs || _load_fs()).symlink(binSrcLoc, binDestLoc); - } - } - } - } - - reporter.success(reporter.lang('linkRegistered', _name)); - reporter.info(reporter.lang('linkRegisteredMessage', _name)); - } - } - }); - - return function run(_x3, _x4, _x5, _x6) { - return _ref3.apply(this, arguments); - }; -}(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _global; - -function _load_global() { - return _global = __webpack_require__(115); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var invariant = __webpack_require__(15); - -var cmdShim = __webpack_require__(189); -var path = __webpack_require__(1); - -function hasWrapper(commander, args) { - return true; -} - -function setFlags(commander) { - commander.description('Symlink a package folder during development.'); -} - -/***/ }), -/* 300 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.buildTree = exports.requireLockfile = undefined; - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var buildTree = exports.buildTree = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (resolver, linker, patterns, opts, onlyFresh, ignoreHoisted) { - var treesByKey = {}; - var trees = []; - var flatTree = yield linker.getFlatHoistedTree(patterns); - - // If using workspaces, filter out the virtual manifest - var workspaceLayout = resolver.workspaceLayout; - - var hoisted = workspaceLayout && workspaceLayout.virtualManifestName ? flatTree.filter(function (_ref3) { - var key = _ref3[0]; - return key.indexOf(workspaceLayout.virtualManifestName) === -1; - }) : flatTree; - - var hoistedByKey = {}; - for (var _iterator2 = hoisted, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref5; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref5 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref5 = _i2.value; - } - - var _ref4 = _ref5; - var key = _ref4[0]; - var info = _ref4[1]; - - hoistedByKey[key] = info; - } - - // build initial trees - for (var _iterator3 = hoisted, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref7; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref7 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref7 = _i3.value; - } - - var _ref6 = _ref7; - var _info = _ref6[1]; - - var ref = _info.pkg._reference; - var hint = null; - var parent = getParent(_info.key, treesByKey); - var children = []; - var depth = 0; - var color = 'bold'; - invariant(ref, 'expected reference'); - - if (onlyFresh) { - var isFresh = false; - for (var _iterator5 = ref.patterns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { - var _ref10; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref10 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref10 = _i5.value; - } - - var pattern = _ref10; - - if (resolver.isNewPattern(pattern)) { - isFresh = true; - break; - } - } - if (!isFresh) { - continue; - } - } - - if (_info.originalKey !== _info.key || opts.reqDepth === 0) { - // was hoisted - color = null; - } - // check parent to obtain next depth - if (parent && parent.depth > 0) { - depth = parent.depth + 1; - } else { - depth = 0; - } - - var topLevel = opts.reqDepth === 0 && !parent; - var showAll = opts.reqDepth === -1; - var nextDepthIsValid = depth + 1 <= Number(opts.reqDepth); - - if (topLevel || nextDepthIsValid || showAll) { - treesByKey[_info.key] = { - name: `${_info.pkg.name}@${_info.pkg.version}`, - children, - hint, - color, - depth - }; - } - - // add in dummy children for hoisted dependencies - var nextChildDepthIsValid = depth + 1 < Number(opts.reqDepth); - invariant(ref, 'expected reference'); - if (!ignoreHoisted && nextDepthIsValid || showAll) { - for (var _iterator6 = resolver.dedupePatterns(ref.dependencies), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { - var _ref11; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref11 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref11 = _i6.value; - } - - var _pattern = _ref11; - - var pkg = resolver.getStrictResolvedPattern(_pattern); - - if (!hoistedByKey[`${_info.key}#${pkg.name}`] && (nextChildDepthIsValid || showAll)) { - children.push({ - name: _pattern, - color: 'dim', - shadow: true - }); - } - } - } - } - - // add children - for (var _iterator4 = hoisted, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref9; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref9 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref9 = _i4.value; - } - - var _ref8 = _ref9; - var _info2 = _ref8[1]; - - var tree = treesByKey[_info2.key]; - var parent = getParent(_info2.key, treesByKey); - if (!tree) { - continue; - } - - if (_info2.key.split('#').length === 1) { - trees.push(tree); - continue; - } - - if (parent) { - parent.children.push(tree); - } - } - - return { trees, count: buildCount(trees) }; - }); - - return function buildTree(_x, _x2, _x3, _x4, _x5, _x6) { - return _ref2.apply(this, arguments); - }; -}(); - -var run = exports.run = function () { - var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); - var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); - - var _ref13 = yield install.fetchRequestFromCwd(), - depRequests = _ref13.requests, - patterns = _ref13.patterns, - manifest = _ref13.manifest, - workspaceLayout = _ref13.workspaceLayout; - - yield install.resolver.init(depRequests, { - isFlat: install.flags.flat, - isFrozen: install.flags.frozenLockfile, - workspaceLayout - }); - - var activePatterns = []; - if (config.production) { - var devDeps = getDevDeps(manifest); - activePatterns = patterns.filter(function (pattern) { - return !devDeps.has(pattern); - }); - } else { - activePatterns = patterns; - } - - var opts = { - reqDepth: getReqDepth(flags.depth) - }; - - var _ref14 = yield buildTree(install.resolver, install.linker, activePatterns, opts), - trees = _ref14.trees; - - if (args.length) { - reporter.warn(reporter.lang('deprecatedListArgs')); - } - if (args.length || flags.pattern) { - trees = trees.filter(function (tree) { - return filterTree(tree, args, flags.pattern); - }); - } - - reporter.tree('list', trees, { force: true }); - }); - - return function run(_x8, _x9, _x10, _x11) { - return _ref12.apply(this, arguments); - }; -}(); - -exports.getParent = getParent; -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; -exports.getReqDepth = getReqDepth; -exports.filterTree = filterTree; -exports.getDevDeps = getDevDeps; - -var _install; - -function _load_install() { - return _install = __webpack_require__(41); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var invariant = __webpack_require__(15); - -var micromatch = __webpack_require__(108); - -var requireLockfile = exports.requireLockfile = true; - -function buildCount(trees) { - if (!trees || !trees.length) { - return 0; - } - - var count = 0; - - for (var _iterator = trees, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var tree = _ref; - - if (tree.shadow) { - continue; - } - - count++; - count += buildCount(tree.children); - } - - return count; -} - -function getParent(key, treesByKey) { - var parentKey = key.slice(0, key.lastIndexOf('#')); - return treesByKey[parentKey]; -} - -function hasWrapper(commander, args) { - return true; -} - -function setFlags(commander) { - commander.description('Lists installed packages.'); - commander.option('--depth [depth]', 'Limit the depth of the shown dependencies'); - commander.option('--pattern [pattern]', 'Filter dependencies by pattern'); -} - -function getReqDepth(inputDepth) { - return inputDepth && /^\d+$/.test(inputDepth) ? Number(inputDepth) : -1; -} - -function filterTree(tree, filters) { - var pattern = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; - - if (tree.children) { - tree.children = tree.children.filter(function (child) { - return filterTree(child, filters, pattern); - }); - } - - var notDim = tree.color !== 'dim'; - var hasChildren = tree.children == null ? false : tree.children.length > 0; - var name = tree.name.slice(0, tree.name.lastIndexOf('@')); - var found = micromatch.any(name, filters) || micromatch.contains(name, pattern); - - return notDim && (found || hasChildren); -} - -function getDevDeps(manifest) { - if (manifest.devDependencies) { - return new (_set || _load_set()).default((0, (_keys || _load_keys()).default)(manifest.devDependencies).map(function (key) { - return `${key}@${manifest.devDependencies[key]}`; - })); - } else { - return new (_set || _load_set()).default(); - } -} - -/***/ }), -/* 301 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.requireLockfile = undefined; - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var isWorkspaceRoot = config.workspaceRootFolder && config.cwd === config.workspaceRootFolder; - - if (!args.length) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('tooFewArguments', 1)); - } - - // running "yarn remove something" in a workspace root is often a mistake - if (isWorkspaceRoot && !flags.ignoreWorkspaceRootCheck) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('workspacesRemoveRootCheck')); - } - - var totalSteps = args.length + 1; - var step = 0; - - // load manifests - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder); - var rootManifests = yield config.getRootManifests(); - var manifests = []; - - for (var _iterator = args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref2; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - var name = _ref2; - - reporter.step(++step, totalSteps, `Removing module ${name}`, emoji.get('wastebasket')); - - var found = false; - - for (var _iterator2 = (0, (_keys || _load_keys()).default)((_index || _load_index()).registries), _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref3; - - if (_isArray2) { - if (_i3 >= _iterator2.length) break; - _ref3 = _iterator2[_i3++]; - } else { - _i3 = _iterator2.next(); - if (_i3.done) break; - _ref3 = _i3.value; - } - - var registryName = _ref3; - - var registry = config.registries[registryName]; - var object = rootManifests[registryName].object; - - for (var _iterator3 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref4; - - if (_isArray3) { - if (_i4 >= _iterator3.length) break; - _ref4 = _iterator3[_i4++]; - } else { - _i4 = _iterator3.next(); - if (_i4.done) break; - _ref4 = _i4.value; - } - - var type = _ref4; - - var deps = object[type]; - if (deps && deps[name]) { - found = true; - delete deps[name]; - } - } - - var possibleManifestLoc = path.join(config.cwd, registry.folder, name); - if (yield (_fs || _load_fs()).exists(possibleManifestLoc)) { - var manifest = yield config.maybeReadManifest(possibleManifestLoc, registryName); - if (manifest) { - manifests.push([possibleManifestLoc, manifest]); - } - } - } - - if (!found) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('moduleNotInManifest')); - } - } - - // save manifests - yield config.saveRootManifests(rootManifests); - - // run hooks - npm runs these one after another - var _arr = ['preuninstall', 'uninstall', 'postuninstall']; - for (var _i2 = 0; _i2 < _arr.length; _i2++) { - var action = _arr[_i2]; - for (var _iterator4 = manifests, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref6; - - if (_isArray4) { - if (_i5 >= _iterator4.length) break; - _ref6 = _iterator4[_i5++]; - } else { - _i5 = _iterator4.next(); - if (_i5.done) break; - _ref6 = _i5.value; - } - - var _ref5 = _ref6; - var loc = _ref5[0]; - - yield config.executeLifecycleScript(action, loc); - } - } - - // reinstall so we can get the updated lockfile - reporter.step(++step, totalSteps, reporter.lang('uninstallRegenerate'), emoji.get('hammer')); - var installFlags = (0, (_extends2 || _load_extends()).default)({ force: true, workspaceRootIsCwd: true }, flags); - var reinstall = new (_install || _load_install()).Install(installFlags, config, new (_index2 || _load_index2()).NoopReporter(), lockfile); - yield reinstall.init(); - - // - reporter.success(reporter.lang('uninstalledPackages')); - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(60); -} - -var _install; - -function _load_install() { - return _install = __webpack_require__(41); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _index2; - -function _load_index2() { - return _index2 = __webpack_require__(188); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var path = __webpack_require__(1); - -var emoji = __webpack_require__(242); - -var requireLockfile = exports.requireLockfile = true; - -function setFlags(commander) { - commander.description('Removes a package from your direct dependencies updating your package.json and yarn.lock.'); - commander.usage('remove [packages ...] [flags]'); - commander.option('-W, --ignore-workspace-root-check', 'required to run yarn remove inside a workspace root'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 302 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.getBinEntries = undefined; - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _from; - -function _load_from() { - return _from = _interopRequireDefault(__webpack_require__(53)); -} - -var _stringify; - -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(40)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(42)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _create; - -function _load_create() { - return _create = _interopRequireDefault(__webpack_require__(213)); -} - -var getBinEntries = exports.getBinEntries = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { - var binFolders = new (_set || _load_set()).default(); - var binEntries = new (_map || _load_map()).default(); - - // Setup the node_modules/.bin folders for analysis - for (var _iterator2 = config.registryFolders, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref4; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref4 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref4 = _i2.value; - } - - var registryFolder = _ref4; - - binFolders.add(path.resolve(config.cwd, registryFolder, '.bin')); - binFolders.add(path.resolve(config.lockfileFolder, registryFolder, '.bin')); - } - - // Same thing, but for the pnp dependencies, located inside the cache - if (yield (_fs || _load_fs()).exists(`${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`)) { - var pnpApi = (0, (_dynamicRequire || _load_dynamicRequire()).dynamicRequire)(`${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`); - - var packageLocator = pnpApi.findPackageLocator(`${config.cwd}/`); - var packageInformation = pnpApi.getPackageInformation(packageLocator); - - for (var _iterator3 = packageInformation.packageDependencies.entries(), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref6; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref6 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref6 = _i3.value; - } - - var _ref5 = _ref6; - var name = _ref5[0]; - var reference = _ref5[1]; - - var dependencyInformation = pnpApi.getPackageInformation({ name, reference }); - - if (dependencyInformation.packageLocation) { - binFolders.add(`${dependencyInformation.packageLocation}/.bin`); - } - } - } - - // Build up a list of possible scripts by exploring the folders marked for analysis - for (var _iterator4 = binFolders, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref7; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref7 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref7 = _i4.value; - } - - var binFolder = _ref7; - - if (yield (_fs || _load_fs()).exists(binFolder)) { - for (var _iterator5 = yield (_fs || _load_fs()).readdir(binFolder), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { - var _ref8; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref8 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref8 = _i5.value; - } - - var _name = _ref8; - - binEntries.set(_name, path.join(binFolder, _name)); - } - } - } - - return binEntries; - }); - - return function getBinEntries(_x) { - return _ref3.apply(this, arguments); - }; -}(); - -var run = exports.run = function () { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var realRunCommand = function () { - var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (action, args) { - // build up list of commands - var cmds = []; - - if (pkgScripts && action in pkgScripts) { - var preAction = `pre${action}`; - if (preAction in pkgScripts) { - cmds.push([preAction, pkgScripts[preAction]]); - } - - var script = scripts.get(action); - invariant(script, 'Script must exist'); - cmds.push([action, script]); - - var postAction = `post${action}`; - if (postAction in pkgScripts) { - cmds.push([postAction, pkgScripts[postAction]]); - } - } else if (scripts.has(action)) { - var _script = scripts.get(action); - invariant(_script, 'Script must exist'); - cmds.push([action, _script]); - } - - if (cmds.length) { - var ignoreEngines = !!(flags.ignoreEngines || config.getOption('ignore-engines')); - try { - yield (0, (_packageCompatibility || _load_packageCompatibility()).checkOne)(pkg, config, ignoreEngines); - } catch (err) { - throw err instanceof (_errors || _load_errors()).MessageError ? new (_errors || _load_errors()).MessageError(reporter.lang('cannotRunWithIncompatibleEnv')) : err; - } - - // Disable wrapper in executed commands - process.env.YARN_WRAP_OUTPUT = 'false'; - for (var _iterator8 = cmds, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) { - var _ref16; - - if (_isArray8) { - if (_i8 >= _iterator8.length) break; - _ref16 = _iterator8[_i8++]; - } else { - _i8 = _iterator8.next(); - if (_i8.done) break; - _ref16 = _i8.value; - } - - var _ref15 = _ref16; - var stage = _ref15[0]; - var cmd = _ref15[1]; - - // only tack on trailing arguments for default script, ignore for pre and post - #1595 - var cmdWithArgs = stage === action ? sh`${unquoted(cmd)} ${args}` : cmd; - var customShell = config.getOption('script-shell'); - yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execCommand)({ - stage, - config, - cmd: cmdWithArgs, - cwd: flags.into || config.cwd, - isInteractive: true, - customShell: customShell ? String(customShell) : undefined - }); - } - } else if (action === 'env') { - reporter.log((0, (_stringify || _load_stringify()).default)((yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)('env', config.cwd, config)), null, 2), { force: true }); - } else { - var suggestion = void 0; - - for (var commandName in scripts) { - var steps = leven(commandName, action); - if (steps < 2) { - suggestion = commandName; - } - } - - var msg = `Command ${(0, (_stringify || _load_stringify()).default)(action)} not found.`; - if (suggestion) { - msg += ` Did you mean ${(0, (_stringify || _load_stringify()).default)(suggestion)}?`; - } - throw new (_errors || _load_errors()).MessageError(msg); - } - }); - - return function realRunCommand(_x6, _x7) { - return _ref14.apply(this, arguments); - }; - }(); - - // list possible scripts if none specified - - - var pkg = yield config.readManifest(config.cwd); - - var binCommands = new (_set || _load_set()).default(); - var pkgCommands = new (_set || _load_set()).default(); - - var scripts = new (_map || _load_map()).default(); - - for (var _iterator6 = yield getBinEntries(config), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { - var _ref11; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref11 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref11 = _i6.value; - } - - var _ref10 = _ref11; - var name = _ref10[0]; - var loc = _ref10[1]; - - scripts.set(name, quoteForShell(loc)); - binCommands.add(name); - } - - var pkgScripts = pkg.scripts; - - if (pkgScripts) { - for (var _iterator7 = (0, (_keys || _load_keys()).default)(pkgScripts).sort(), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { - var _ref12; - - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref12 = _iterator7[_i7++]; - } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref12 = _i7.value; - } - - var _name2 = _ref12; - - scripts.set(_name2, pkgScripts[_name2] || ''); - pkgCommands.add(_name2); - } - } - - function runCommand(_ref13) { - var action = _ref13[0], - args = _ref13.slice(1); - - return (0, (_hooks || _load_hooks()).callThroughHook)('runScript', function () { - return realRunCommand(action, args); - }, { action, args }); - } - - if (args.length === 0) { - if (binCommands.size > 0) { - reporter.info(`${reporter.lang('binCommands') + (0, (_from || _load_from()).default)(binCommands).join(', ')}`); - } else { - reporter.error(reporter.lang('noBinAvailable')); - } - - var printedCommands = new (_map || _load_map()).default(); - - for (var _iterator9 = pkgCommands, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) { - var _ref17; - - if (_isArray9) { - if (_i9 >= _iterator9.length) break; - _ref17 = _iterator9[_i9++]; - } else { - _i9 = _iterator9.next(); - if (_i9.done) break; - _ref17 = _i9.value; - } - - var pkgCommand = _ref17; - - var action = scripts.get(pkgCommand); - invariant(action, 'Action must exists'); - printedCommands.set(pkgCommand, action); - } - - if (pkgCommands.size > 0) { - reporter.info(`${reporter.lang('possibleCommands')}`); - reporter.list('possibleCommands', (0, (_from || _load_from()).default)(pkgCommands), toObject(printedCommands)); - if (!flags.nonInteractive) { - yield reporter.question(reporter.lang('commandQuestion')).then(function (answer) { - return runCommand(answer.trim().split(' ')); - }, function () { - return reporter.error(reporter.lang('commandNotSpecified')); - }); - } - } else { - reporter.error(reporter.lang('noScriptsAvailable')); - } - return (_promise || _load_promise()).default.resolve(); - } else { - return runCommand(args); - } - }); - - return function run(_x2, _x3, _x4, _x5) { - return _ref9.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _executeLifecycleScript; - -function _load_executeLifecycleScript() { - return _executeLifecycleScript = __webpack_require__(100); -} - -var _dynamicRequire; - -function _load_dynamicRequire() { - return _dynamicRequire = __webpack_require__(314); -} - -var _hooks; - -function _load_hooks() { - return _hooks = __webpack_require__(317); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _packageCompatibility; - -function _load_packageCompatibility() { - return _packageCompatibility = __webpack_require__(198); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var invariant = __webpack_require__(15); - -var leven = __webpack_require__(818); -var path = __webpack_require__(1); - -var _require = __webpack_require__(852), - quoteForShell = _require.quoteForShell, - sh = _require.sh, - unquoted = _require.unquoted; - -function toObject(input) { - var output = (0, (_create || _load_create()).default)(null); - - for (var _iterator = input.entries(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref2; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - var _ref = _ref2; - var key = _ref[0]; - var val = _ref[1]; - - output[key] = val; - } - - return output; -} - -function setFlags(commander) { - commander.description('Runs a defined package script.'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 303 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.examples = exports.hasWrapper = exports.run = exports.getName = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var getName = exports.getName = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (args, config) { - var name = args.shift(); - - if (!name) { - var pkg = yield config.readRootManifest(); - name = pkg.name; - } - - if (name) { - if (!(0, (_validate || _load_validate()).isValidPackageName)(name)) { - throw new (_errors || _load_errors()).MessageError(config.reporter.lang('invalidPackageName')); - } - - return (_npmRegistry || _load_npmRegistry()).default.escapeName(name); - } else { - throw new (_errors || _load_errors()).MessageError(config.reporter.lang('unknownPackageName')); - } - }); - - return function getName(_x, _x2) { - return _ref.apply(this, arguments); - }; -}(); - -var list = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var name = yield getName(args, config); - - reporter.step(1, 1, reporter.lang('gettingTags')); - var tags = yield config.registries.npm.request(`-/package/${name}/dist-tags`); - - if (tags) { - reporter.info(`Package ${name}`); - for (var _name in tags) { - reporter.info(`${_name}: ${tags[_name]}`); - } - } - - if (!tags) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('packageNotFoundRegistry', name, 'npm')); - } - }); - - return function list(_x3, _x4, _x5, _x6) { - return _ref2.apply(this, arguments); - }; -}(); - -var remove = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (args.length !== 2) { - return false; - } - - var name = yield getName(args, config); - var tag = args.shift(); - - reporter.step(1, 3, reporter.lang('loggingIn')); - var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name); - - reporter.step(2, 3, reporter.lang('deletingTags')); - var result = yield config.registries.npm.request(`-/package/${name}/dist-tags/${encodeURI(tag)}`, { - method: 'DELETE' - }); - - if (result === false) { - reporter.error(reporter.lang('deletedTagFail')); - } else { - reporter.success(reporter.lang('deletedTag')); - } - - reporter.step(3, 3, reporter.lang('revokingToken')); - yield revoke(); - - if (result === false) { - throw new Error(); - } else { - return true; - } - }); - - return function remove(_x7, _x8, _x9, _x10) { - return _ref3.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; - -var _buildSubCommands2; - -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62)); -} - -var _login; - -function _load_login() { - return _login = __webpack_require__(97); -} - -var _npmRegistry; - -function _load_npmRegistry() { - return _npmRegistry = _interopRequireDefault(__webpack_require__(84)); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _normalizePattern2; - -function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(52); -} - -var _validate; - -function _load_validate() { - return _validate = __webpack_require__(119); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function setFlags(commander) { - commander.description('Add, remove, or list tags on a package.'); -} - -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('tag', { - add(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (args.length !== 2) { - return false; - } - - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(args.shift()), - name = _normalizePattern.name, - range = _normalizePattern.range, - hasVersion = _normalizePattern.hasVersion; - - if (!hasVersion) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('requiredVersionInRange')); - } - if (!(0, (_validate || _load_validate()).isValidPackageName)(name)) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName')); - } - - var tag = args.shift(); - - reporter.step(1, 3, reporter.lang('loggingIn')); - var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name); - - reporter.step(2, 3, reporter.lang('creatingTag', tag, range)); - var result = yield config.registries.npm.request(`-/package/${(_npmRegistry || _load_npmRegistry()).default.escapeName(name)}/dist-tags/${encodeURI(tag)}`, { - method: 'PUT', - body: range - }); - - if (result != null && result.ok) { - reporter.success(reporter.lang('createdTag')); - } else { - reporter.error(reporter.lang('createdTagFail')); - } - - reporter.step(3, 3, reporter.lang('revokingToken')); - yield revoke(); - - if (result != null && result.ok) { - return true; - } else { - throw new Error(); - } - })(); - }, - - rm(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - reporter.warn(`\`yarn tag rm\` is deprecated. Please use \`yarn tag remove\`.`); - yield remove(config, reporter, flags, args); - })(); - }, - - remove(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield remove(config, reporter, flags, args); - })(); - }, - - ls(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - reporter.warn(`\`yarn tag ls\` is deprecated. Please use \`yarn tag list\`.`); - yield list(config, reporter, flags, args); - })(); - }, - - list(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield list(config, reporter, flags, args); - })(); - } -}, ['add @ []', 'remove ', 'list []']), - run = _buildSubCommands.run, - hasWrapper = _buildSubCommands.hasWrapper, - examples = _buildSubCommands.examples; - -exports.run = run; -exports.hasWrapper = hasWrapper; -exports.examples = examples; - -/***/ }), -/* 304 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.requireLockfile = undefined; - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var outdatedFieldName = flags.latest ? 'latest' : 'wanted'; - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder); - - var deps = yield (0, (_upgrade || _load_upgrade()).getOutdated)(config, reporter, (0, (_extends2 || _load_extends()).default)({}, flags, { includeWorkspaceDeps: true }), lockfile, args); - - if (deps.length === 0) { - reporter.success(reporter.lang('allDependenciesUpToDate')); - return; - } - - // Fail early with runtime compatibility checks so that it doesn't fail after you've made your selections - var install = new (_install2 || _load_install()).Install(flags, config, reporter, lockfile); - yield install.checkCompatibility(); - - var usesWorkspaces = !!config.workspaceRootFolder; - - var maxLengthArr = { - name: 'name'.length, - current: 'from'.length, - range: 'latest'.length, - [outdatedFieldName]: 'to'.length, - workspaceName: 'workspace'.length - }; - - var keysWithDynamicLength = ['name', 'current', outdatedFieldName]; - - if (!flags.latest) { - maxLengthArr.range = 'range'.length; - keysWithDynamicLength.push('range'); - } - - if (usesWorkspaces) { - keysWithDynamicLength.push('workspaceName'); - } - - deps.forEach(function (dep) { - return keysWithDynamicLength.forEach(function (key) { - maxLengthArr[key] = Math.max(maxLengthArr[key], dep[key].length); - }); - }); - - // Depends on maxLengthArr - var addPadding = function addPadding(dep) { - return function (key) { - return `${dep[key]}${' '.repeat(maxLengthArr[key] - dep[key].length)}`; - }; - }; - var headerPadding = function headerPadding(header, key) { - return `${reporter.format.bold.underline(header)}${' '.repeat(maxLengthArr[key] - header.length)}`; - }; - - var colorizeName = function colorizeName(from, to) { - return reporter.format[(0, (_colorForVersions || _load_colorForVersions()).default)(from, to)]; - }; - - var getNameFromHint = function getNameFromHint(hint) { - return hint ? `${hint}Dependencies` : 'dependencies'; - }; - - var makeRow = function makeRow(dep) { - var padding = addPadding(dep); - var name = colorizeName(dep.current, dep[outdatedFieldName])(padding('name')); - var current = reporter.format.blue(padding('current')); - var latest = (0, (_colorizeDiff || _load_colorizeDiff()).default)(dep.current, padding(outdatedFieldName), reporter); - var url = reporter.format.cyan(dep.url); - var range = reporter.format.blue(flags.latest ? 'latest' : padding('range')); - if (usesWorkspaces) { - var workspace = padding('workspaceName'); - return `${name} ${range} ${current} ❯ ${latest} ${workspace} ${url}`; - } else { - return `${name} ${range} ${current} ❯ ${latest} ${url}`; - } - }; - - var makeHeaderRow = function makeHeaderRow() { - var name = headerPadding('name', 'name'); - var range = headerPadding('range', 'range'); - var from = headerPadding('from', 'current'); - var to = headerPadding('to', outdatedFieldName); - var url = reporter.format.bold.underline('url'); - if (usesWorkspaces) { - var workspace = headerPadding('workspace', 'workspaceName'); - return ` ${name} ${range} ${from} ${to} ${workspace} ${url}`; - } else { - return ` ${name} ${range} ${from} ${to} ${url}`; - } - }; - - var groupedDeps = deps.reduce(function (acc, dep) { - var hint = dep.hint, - name = dep.name, - upgradeTo = dep.upgradeTo; - - var version = dep[outdatedFieldName]; - var key = getNameFromHint(hint); - var xs = acc[key] || []; - acc[key] = xs.concat({ - name: makeRow(dep), - value: dep, - short: `${name}@${version}`, - upgradeTo - }); - return acc; - }, {}); - - var flatten = function flatten(xs) { - return xs.reduce(function (ys, y) { - return ys.concat(Array.isArray(y) ? flatten(y) : y); - }, []); - }; - - var choices = flatten((0, (_keys || _load_keys()).default)(groupedDeps).map(function (key) { - return [new (_inquirer || _load_inquirer()).default.Separator(reporter.format.bold.underline.green(key)), new (_inquirer || _load_inquirer()).default.Separator(makeHeaderRow()), groupedDeps[key], new (_inquirer || _load_inquirer()).default.Separator(' ')]; - })); - - try { - var red = reporter.format.red(''); - var yellow = reporter.format.yellow(''); - var green = reporter.format.green(''); - reporter.info(reporter.lang('legendColorsForVersionUpdates', red, yellow, green)); - - var answers = yield reporter.prompt('Choose which packages to update.', choices, { - name: 'packages', - type: 'checkbox', - validate: function validate(answer) { - return !!answer.length || 'You must choose at least one package.'; - } - }); - - var getPattern = function getPattern(_ref2) { - var upgradeTo = _ref2.upgradeTo; - return upgradeTo; - }; - var isHint = function isHint(x) { - return function (_ref3) { - var hint = _ref3.hint; - return hint === x; - }; - }; - - var _arr = [null, 'dev', 'optional', 'peer']; - for (var _i = 0; _i < _arr.length; _i++) { - var hint = _arr[_i]; - // Reset dependency flags - flags.dev = hint === 'dev'; - flags.peer = hint === 'peer'; - flags.optional = hint === 'optional'; - flags.ignoreWorkspaceRootCheck = true; - flags.includeWorkspaceDeps = false; - flags.workspaceRootIsCwd = false; - var _deps = answers.filter(isHint(hint)); - if (_deps.length) { - var _install = new (_install2 || _load_install()).Install(flags, config, reporter, lockfile); - - var _ref4 = yield _install.fetchRequestFromCwd(), - packagePatterns = _ref4.requests; - - var depsByWorkspace = _deps.reduce(function (acc, dep) { - var workspaceLoc = dep.workspaceLoc; - - var xs = acc[workspaceLoc] || []; - acc[workspaceLoc] = xs.concat(dep); - return acc; - }, {}); - var cwd = config.cwd; - for (var _iterator = (0, (_keys || _load_keys()).default)(depsByWorkspace), _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref5; - - if (_isArray) { - if (_i2 >= _iterator.length) break; - _ref5 = _iterator[_i2++]; - } else { - _i2 = _iterator.next(); - if (_i2.done) break; - _ref5 = _i2.value; - } - - var loc = _ref5; - - var patterns = depsByWorkspace[loc].map(getPattern); - (0, (_upgrade || _load_upgrade()).cleanLockfile)(lockfile, _deps, packagePatterns, reporter); - reporter.info(reporter.lang('updateInstalling', getNameFromHint(hint))); - if (loc !== '') { - config.cwd = path.resolve(path.dirname(loc)); - } - var add = new (_add || _load_add()).Add(patterns, flags, config, reporter, lockfile); - yield add.init(); - config.cwd = cwd; - } - } - } - } catch (e) { - (_promise || _load_promise()).default.reject(e); - } - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _inquirer; - -function _load_inquirer() { - return _inquirer = _interopRequireDefault(__webpack_require__(195)); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -var _add; - -function _load_add() { - return _add = __webpack_require__(154); -} - -var _upgrade; - -function _load_upgrade() { - return _upgrade = __webpack_require__(196); -} - -var _colorForVersions; - -function _load_colorForVersions() { - return _colorForVersions = _interopRequireDefault(__webpack_require__(312)); -} - -var _colorizeDiff; - -function _load_colorizeDiff() { - return _colorizeDiff = _interopRequireDefault(__webpack_require__(313)); -} - -var _install2; - -function _load_install() { - return _install2 = __webpack_require__(41); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var path = __webpack_require__(1); - -var requireLockfile = exports.requireLockfile = true; - -function setFlags(commander) { - commander.description('Provides an easy way to update outdated packages.'); - commander.usage('upgrade-interactive [flags]'); - commander.option('-S, --scope ', 'upgrade packages under the specified scope'); - commander.option('--latest', 'list the latest version of packages, ignoring version ranges in package.json'); - commander.option('-E, --exact', 'install exact version. Only used when --latest is specified.'); - commander.option('-T, --tilde', 'install most recent release with the same minor version. Only used when --latest is specified.'); - commander.option('-C, --caret', 'install most recent release with the same major version. Only used when --latest is specified.'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 305 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.setVersion = undefined; - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var setVersion = exports.setVersion = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args, required) { - var pkg = yield config.readRootManifest(); - var pkgLoc = pkg._loc; - var scripts = (0, (_map || _load_map()).default)(); - var newVersion = flags.newVersion; - var identifier = undefined; - if (flags.preid) { - identifier = flags.preid; - } - invariant(pkgLoc, 'expected package location'); - - if (args.length && !newVersion) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidVersionArgument', NEW_VERSION_FLAG)); - } - - function runLifecycle(lifecycle) { - if (scripts[lifecycle]) { - return (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execCommand)({ stage: lifecycle, config, cmd: scripts[lifecycle], cwd: config.cwd, isInteractive: true }); - } - - return (_promise || _load_promise()).default.resolve(); - } - - function isCommitHooksDisabled() { - return flags.commitHooks === false || config.getOption('version-commit-hooks') === false; - } - - if (pkg.scripts) { - // inherit `scripts` from manifest - (0, (_assign || _load_assign()).default)(scripts, pkg.scripts); - } - - // get old version - var oldVersion = pkg.version; - if (oldVersion) { - reporter.info(`${reporter.lang('currentVersion')}: ${oldVersion}`); - } else { - oldVersion = '0.0.0'; - } - - // get new version - if (newVersion && !isValidNewVersion(oldVersion, newVersion, config.looseSemver, identifier)) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidVersion')); - } - - // get new version by bumping old version, if requested - if (!newVersion) { - if (flags.major) { - newVersion = semver.inc(oldVersion, 'major'); - } else if (flags.minor) { - newVersion = semver.inc(oldVersion, 'minor'); - } else if (flags.patch) { - newVersion = semver.inc(oldVersion, 'patch'); - } else if (flags.premajor) { - newVersion = semver.inc(oldVersion, 'premajor', identifier); - } else if (flags.preminor) { - newVersion = semver.inc(oldVersion, 'preminor', identifier); - } else if (flags.prepatch) { - newVersion = semver.inc(oldVersion, 'prepatch', identifier); - } else if (flags.prerelease) { - newVersion = semver.inc(oldVersion, 'prerelease', identifier); - } - } - - // wasn't passed a version arg so ask interactively - while (!newVersion) { - // make sure we're not running in non-interactive mode before asking for new version - if (flags.nonInteractive || config.nonInteractive) { - // if no version is specified, use current version in package.json - newVersion = oldVersion; - break; - } - - // Make sure we dont exit with an error message when pressing Ctrl-C or enter to abort - try { - newVersion = yield reporter.question(reporter.lang('newVersion')); - if (!newVersion) { - newVersion = oldVersion; - } - } catch (err) { - newVersion = oldVersion; - } - - if (!required && !newVersion) { - reporter.info(`${reporter.lang('noVersionOnPublish')}: ${oldVersion}`); - return function () { - return (_promise || _load_promise()).default.resolve(); - }; - } - - if (isValidNewVersion(oldVersion, newVersion, config.looseSemver, identifier)) { - break; - } else { - newVersion = null; - reporter.error(reporter.lang('invalidSemver')); - } - } - if (newVersion) { - newVersion = semver.inc(oldVersion, newVersion, config.looseSemver, identifier) || newVersion; - } - invariant(newVersion, 'expected new version'); - - if (newVersion === pkg.version) { - return function () { - return (_promise || _load_promise()).default.resolve(); - }; - } - - yield runLifecycle('preversion'); - - // update version - reporter.info(`${reporter.lang('newVersion')}: ${newVersion}`); - pkg.version = newVersion; - - // update versions in manifests - var manifests = yield config.getRootManifests(); - for (var _iterator = (_index || _load_index()).registryNames, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref2; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - var registryName = _ref2; - - var manifest = manifests[registryName]; - if (manifest.exists) { - manifest.object.version = newVersion; - } - } - yield config.saveRootManifests(manifests); - - yield runLifecycle('version'); - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - invariant(newVersion, 'expected version'); - - // check if a new git tag should be created - if (flags.gitTagVersion && config.getOption('version-git-tag')) { - // add git commit and tag - var isGit = false; - var parts = config.cwd.split(path.sep); - while (parts.length) { - isGit = yield (_fs || _load_fs()).exists(path.join(parts.join(path.sep), '.git')); - if (isGit) { - break; - } else { - parts.pop(); - } - } - - if (isGit) { - var message = (flags.message || String(config.getOption('version-git-message'))).replace(/%s/g, newVersion); - var sign = Boolean(config.getOption('version-sign-git-tag')); - var flag = sign ? '-sm' : '-am'; - var prefix = String(config.getOption('version-tag-prefix')); - var _args = ['commit', '-m', message].concat(isCommitHooksDisabled() ? ['-n'] : []); - - var gitRoot = (yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['rev-parse', '--show-toplevel'], { cwd: config.cwd })).trim(); - - // add manifest - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['add', path.relative(gitRoot, pkgLoc)], { cwd: gitRoot }); - - // create git commit - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(_args, { cwd: gitRoot }); - - // create git tag - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['tag', `${prefix}${newVersion}`, flag, message], { cwd: gitRoot }); - } - } - - yield runLifecycle('postversion'); - }); - }); - - return function setVersion(_x, _x2, _x3, _x4, _x5) { - return _ref.apply(this, arguments); - }; -}(); - -var run = exports.run = function () { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var commit = yield setVersion(config, reporter, flags, args, true); - yield commit(); - }); - - return function run(_x6, _x7, _x8, _x9) { - return _ref4.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _index; - -function _load_index() { - return _index = __webpack_require__(60); -} - -var _executeLifecycleScript; - -function _load_executeLifecycleScript() { - return _executeLifecycleScript = __webpack_require__(100); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _gitSpawn; - -function _load_gitSpawn() { - return _gitSpawn = __webpack_require__(316); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(51)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var invariant = __webpack_require__(15); -var semver = __webpack_require__(27); -var path = __webpack_require__(1); - -var NEW_VERSION_FLAG = '--new-version [version]'; -function isValidNewVersion(oldVersion, newVersion, looseSemver, identifier) { - return !!(semver.valid(newVersion, looseSemver) || semver.inc(oldVersion, newVersion, looseSemver, identifier)); -} - -function setFlags(commander) { - commander.description('Update the version of your package via the command line.'); - commander.option(NEW_VERSION_FLAG, 'new version'); - commander.option('--major', 'auto-increment major version number'); - commander.option('--minor', 'auto-increment minor version number'); - commander.option('--patch', 'auto-increment patch version number'); - commander.option('--premajor', 'auto-increment premajor version number'); - commander.option('--preminor', 'auto-increment preminor version number'); - commander.option('--prepatch', 'auto-increment prepatch version number'); - commander.option('--prerelease', 'auto-increment prerelease version number'); - commander.option('--preid [preid]', 'add a custom identifier to the prerelease'); - commander.option('--message [message]', 'message'); - commander.option('--no-git-tag-version', 'no git tag version'); - commander.option('--no-commit-hooks', 'bypass git hooks when committing new version'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 306 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.LocalTarballFetcher = undefined; - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _from; - -function _load_from() { - return _from = _interopRequireDefault(__webpack_require__(53)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); -} - -var _baseFetcher; - -function _load_baseFetcher() { - return _baseFetcher = _interopRequireDefault(__webpack_require__(156)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _misc; - -function _load_misc() { - return _misc = __webpack_require__(28); -} - -var _normalizeUrl; - -function _load_normalizeUrl() { - return _normalizeUrl = _interopRequireDefault(__webpack_require__(372)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var crypto = __webpack_require__(21); -var path = __webpack_require__(1); -var tarFs = __webpack_require__(183); -var url = __webpack_require__(29); -var fs = __webpack_require__(12); -var stream = __webpack_require__(35); -var gunzip = __webpack_require__(714); -var invariant = __webpack_require__(15); -var ssri = __webpack_require__(93); - -var RE_URL_NAME_MATCH = /\/(?:(@[^/]+)(?:\/|%2f))?[^/]+\/(?:-|_attachments)\/(?:@[^/]+\/)?([^/]+)$/; - -var isHashAlgorithmSupported = function isHashAlgorithmSupported(name) { - var cachedResult = isHashAlgorithmSupported.__cache[name]; - if (cachedResult != null) { - return cachedResult; - } - var supported = true; - try { - crypto.createHash(name); - } catch (error) { - if (error.message !== 'Digest method not supported') { - throw error; - } - supported = false; - } - - isHashAlgorithmSupported.__cache[name] = supported; - return supported; -}; -isHashAlgorithmSupported.__cache = {}; - -var TarballFetcher = function (_BaseFetcher) { - (0, (_inherits2 || _load_inherits()).default)(TarballFetcher, _BaseFetcher); - - function TarballFetcher() { - var _temp, _this, _ret; - - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, TarballFetcher); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseFetcher.call.apply(_BaseFetcher, [this].concat(args))), _this), _this.validateError = null, _this.validateIntegrity = null, _temp), (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(_this, _ret); - } - - TarballFetcher.prototype.setupMirrorFromCache = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var tarballMirrorPath = this.getTarballMirrorPath(); - var tarballCachePath = this.getTarballCachePath(); - - if (tarballMirrorPath == null) { - return; - } - - if (!(yield (_fs || _load_fs()).exists(tarballMirrorPath)) && (yield (_fs || _load_fs()).exists(tarballCachePath))) { - // The tarball doesn't exists in the offline cache but does in the cache; we import it to the mirror - yield (_fs || _load_fs()).mkdirp(path.dirname(tarballMirrorPath)); - yield (_fs || _load_fs()).copy(tarballCachePath, tarballMirrorPath, this.reporter); - } - }); - - function setupMirrorFromCache() { - return _ref.apply(this, arguments); - } - - return setupMirrorFromCache; - }(); - - TarballFetcher.prototype.getTarballCachePath = function getTarballCachePath() { - return path.join(this.dest, (_constants || _load_constants()).TARBALL_FILENAME); - }; - - TarballFetcher.prototype.getTarballMirrorPath = function getTarballMirrorPath() { - var _url$parse = url.parse(this.reference), - pathname = _url$parse.pathname; - - if (pathname == null) { - return null; - } - - var match = pathname.match(RE_URL_NAME_MATCH); - - var packageFilename = void 0; - if (match) { - var scope = match[1], - tarballBasename = match[2]; - - packageFilename = scope ? `${scope}-${tarballBasename}` : tarballBasename; - } else { - // fallback to base name - packageFilename = path.basename(pathname); - } - - return this.config.getOfflineMirrorPath(packageFilename); - }; - - TarballFetcher.prototype.createExtractor = function createExtractor(resolve, reject, tarballPath) { - var _this2 = this; - - var hashInfo = this._supportedIntegrity({ hashOnly: true }); - var integrityInfo = this._supportedIntegrity({ hashOnly: false }); - - var now = new Date(); - - var fs = __webpack_require__(12); - var patchedFs = (0, (_assign || _load_assign()).default)({}, fs, { - utimes: function utimes(path, atime, mtime, cb) { - fs.stat(path, function (err, stat) { - if (err) { - cb(err); - return; - } - if (stat.isDirectory()) { - fs.utimes(path, atime, mtime, cb); - return; - } - fs.open(path, 'a', function (err, fd) { - if (err) { - cb(err); - return; - } - fs.futimes(fd, atime, mtime, function (err) { - if (err) { - fs.close(fd, function () { - return cb(err); - }); - } else { - fs.close(fd, function (err) { - return cb(err); - }); - } - }); - }); - }); - } - }); - - var hashValidateStream = new ssri.integrityStream(hashInfo); - var integrityValidateStream = new ssri.integrityStream(integrityInfo); - - var untarStream = tarFs.extract(this.dest, { - strip: 1, - dmode: 0o755, // all dirs should be readable - fmode: 0o644, // all files should be readable - chown: false, // don't chown. just leave as it is - map: function map(header) { - header.mtime = now; - return header; - }, - fs: patchedFs - }); - var extractorStream = gunzip(); - - hashValidateStream.once('error', function (err) { - _this2.validateError = err; - }); - integrityValidateStream.once('error', function (err) { - _this2.validateError = err; - }); - integrityValidateStream.once('integrity', function (sri) { - _this2.validateIntegrity = sri; - }); - - untarStream.on('error', function (err) { - reject(new (_errors || _load_errors()).MessageError(_this2.config.reporter.lang('errorExtractingTarball', err.message, tarballPath))); - }); - - extractorStream.pipe(untarStream).on('finish', function () { - var error = _this2.validateError; - var hexDigest = _this2.validateIntegrity ? _this2.validateIntegrity.hexDigest() : ''; - if (_this2.config.updateChecksums && _this2.remote.integrity && _this2.validateIntegrity && _this2.remote.integrity !== _this2.validateIntegrity.toString()) { - _this2.remote.integrity = _this2.validateIntegrity.toString(); - } else if (_this2.validateIntegrity) { - _this2.remote.cacheIntegrity = _this2.validateIntegrity.toString(); - } - - if (integrityInfo.integrity && (0, (_keys || _load_keys()).default)(integrityInfo.integrity).length === 0) { - return reject(new (_errors || _load_errors()).SecurityError(_this2.config.reporter.lang('fetchBadIntegrityAlgorithm', _this2.packageName, _this2.remote.reference))); - } - - if (error) { - if (_this2.config.updateChecksums) { - _this2.remote.integrity = error.found.toString(); - } else { - return reject(new (_errors || _load_errors()).SecurityError(_this2.config.reporter.lang('fetchBadHashWithPath', _this2.packageName, _this2.remote.reference, error.found.toString(), error.expected.toString()))); - } - } - - return resolve({ - hash: _this2.hash || hexDigest - }); - }); - - return { hashValidateStream, integrityValidateStream, extractorStream }; - }; - - TarballFetcher.prototype.getLocalPaths = function getLocalPaths(override) { - var paths = [override ? path.resolve(this.config.cwd, override) : null, this.getTarballMirrorPath(), this.getTarballCachePath()]; - // $FlowFixMe: https://github.com/facebook/flow/issues/1414 - return paths.filter(function (path) { - return path != null; - }); - }; - - TarballFetcher.prototype.fetchFromLocal = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (override) { - var _this3 = this; - - var tarPaths = this.getLocalPaths(override); - var stream = yield (_fs || _load_fs()).readFirstAvailableStream(tarPaths); - - return new (_promise || _load_promise()).default(function (resolve, reject) { - if (!stream) { - reject(new (_errors || _load_errors()).MessageError(_this3.reporter.lang('tarballNotInNetworkOrCache', _this3.reference, tarPaths))); - return; - } - invariant(stream, 'stream should be available at this point'); - // $FlowFixMe - This is available https://nodejs.org/api/fs.html#fs_readstream_path - var tarballPath = stream.path; - - var _createExtractor = _this3.createExtractor(resolve, reject, tarballPath), - hashValidateStream = _createExtractor.hashValidateStream, - integrityValidateStream = _createExtractor.integrityValidateStream, - extractorStream = _createExtractor.extractorStream; - - stream.pipe(hashValidateStream); - hashValidateStream.pipe(integrityValidateStream); - - integrityValidateStream.pipe(extractorStream).on('error', function (err) { - reject(new (_errors || _load_errors()).MessageError(_this3.config.reporter.lang('fetchErrorCorrupt', err.message, tarballPath))); - }); - }); - }); - - function fetchFromLocal(_x) { - return _ref2.apply(this, arguments); - } - - return fetchFromLocal; - }(); - - TarballFetcher.prototype.fetchFromExternal = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _this4 = this; - - var registry = this.config.registries[this.registry]; - - try { - var headers = this.requestHeaders(); - return yield registry.request(this.reference, { - headers: (0, (_extends2 || _load_extends()).default)({ - 'Accept-Encoding': 'gzip' - }, headers), - buffer: true, - process: function process(req, resolve, reject) { - // should we save this to the offline cache? - var tarballMirrorPath = _this4.getTarballMirrorPath(); - var tarballCachePath = _this4.getTarballCachePath(); - - var _createExtractor2 = _this4.createExtractor(resolve, reject), - hashValidateStream = _createExtractor2.hashValidateStream, - integrityValidateStream = _createExtractor2.integrityValidateStream, - extractorStream = _createExtractor2.extractorStream; - - req.pipe(hashValidateStream); - hashValidateStream.pipe(integrityValidateStream); - - if (tarballMirrorPath) { - integrityValidateStream.pipe(fs.createWriteStream(tarballMirrorPath)).on('error', reject); - } - - if (tarballCachePath) { - integrityValidateStream.pipe(fs.createWriteStream(tarballCachePath)).on('error', reject); - } - - integrityValidateStream.pipe(extractorStream).on('error', reject); - } - }, this.packageName); - } catch (err) { - var tarballMirrorPath = this.getTarballMirrorPath(); - var tarballCachePath = this.getTarballCachePath(); - - if (tarballMirrorPath && (yield (_fs || _load_fs()).exists(tarballMirrorPath))) { - yield (_fs || _load_fs()).unlink(tarballMirrorPath); - } - - if (tarballCachePath && (yield (_fs || _load_fs()).exists(tarballCachePath))) { - yield (_fs || _load_fs()).unlink(tarballCachePath); - } - - throw err; - } - }); - - function fetchFromExternal() { - return _ref3.apply(this, arguments); - } - - return fetchFromExternal; - }(); - - TarballFetcher.prototype.requestHeaders = function requestHeaders() { - var registry = this.config.registries.yarn; - var config = registry.config; - var requestParts = urlParts(this.reference); - return (0, (_keys || _load_keys()).default)(config).reduce(function (headers, option) { - var parts = option.split(':'); - if (parts.length === 3 && parts[1] === '_header') { - var registryParts = urlParts(parts[0]); - if (requestParts.host === registryParts.host && requestParts.path.startsWith(registryParts.path)) { - var headerName = parts[2]; - var headerValue = config[option]; - headers[headerName] = headerValue; - } - } - return headers; - }, {}); - }; - - TarballFetcher.prototype._fetch = function _fetch() { - var _this5 = this; - - var isFilePath = this.reference.startsWith('file:'); - this.reference = (0, (_misc || _load_misc()).removePrefix)(this.reference, 'file:'); - var urlParse = url.parse(this.reference); - - // legacy support for local paths in yarn.lock entries - var isRelativePath = urlParse.protocol ? urlParse.protocol.match(/^[a-z]:$/i) : urlParse.pathname ? urlParse.pathname.match(/^(?:\.{1,2})?[\\\/]/) : false; - - if (isFilePath || isRelativePath) { - return this.fetchFromLocal(this.reference); - } - - return this.fetchFromLocal().catch(function (err) { - return _this5.fetchFromExternal(); - }); - }; - - TarballFetcher.prototype._findIntegrity = function _findIntegrity(_ref4) { - var hashOnly = _ref4.hashOnly; - - if (this.remote.integrity && !hashOnly) { - return ssri.parse(this.remote.integrity); - } - if (this.hash) { - return ssri.fromHex(this.hash, 'sha1'); - } - return null; - }; - - TarballFetcher.prototype._supportedIntegrity = function _supportedIntegrity(_ref5) { - var hashOnly = _ref5.hashOnly; - - var expectedIntegrity = this._findIntegrity({ hashOnly }) || {}; - var expectedIntegrityAlgorithms = (0, (_keys || _load_keys()).default)(expectedIntegrity); - var shouldValidateIntegrity = (this.hash || this.remote.integrity) && !this.config.updateChecksums; - - if (expectedIntegrityAlgorithms.length === 0 && (!shouldValidateIntegrity || hashOnly)) { - var _algorithms = this.config.updateChecksums ? ['sha512'] : ['sha1']; - // for consistency, return sha1 for packages without a remote integrity (eg. github) - return { integrity: null, algorithms: _algorithms }; - } - - var algorithms = new (_set || _load_set()).default(['sha512', 'sha1']); - var integrity = {}; - for (var _iterator = expectedIntegrityAlgorithms, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref6; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref6 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref6 = _i.value; - } - - var algorithm = _ref6; - - if (isHashAlgorithmSupported(algorithm)) { - algorithms.add(algorithm); - integrity[algorithm] = expectedIntegrity[algorithm]; - } - } - - return { integrity, algorithms: (0, (_from || _load_from()).default)(algorithms) }; - }; - - return TarballFetcher; -}((_baseFetcher || _load_baseFetcher()).default); - -exports.default = TarballFetcher; - -var LocalTarballFetcher = exports.LocalTarballFetcher = function (_TarballFetcher) { - (0, (_inherits2 || _load_inherits()).default)(LocalTarballFetcher, _TarballFetcher); - - function LocalTarballFetcher() { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, LocalTarballFetcher); - return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _TarballFetcher.apply(this, arguments)); - } - - LocalTarballFetcher.prototype._fetch = function _fetch() { - return this.fetchFromLocal(this.reference); - }; - - return LocalTarballFetcher; -}(TarballFetcher); - -function urlParts(requestUrl) { - var normalizedUrl = (0, (_normalizeUrl || _load_normalizeUrl()).default)(requestUrl); - var parsed = url.parse(normalizedUrl); - var host = parsed.host || ''; - var path = parsed.path || ''; - return { host, path }; -} - -/***/ }), -/* 307 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -exports.default = function (str) { - var fileLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'lockfile'; - +exports.default = function (str, fileLoc = 'lockfile') { str = (0, (_stripBom || _load_stripBom()).default)(str); return hasMergeConflicts(str) ? parseWithConflict(str, fileLoc) : { type: 'success', object: parse(str, fileLoc) }; }; @@ -64084,50 +34373,52 @@ exports.default = function (str) { var _util; function _load_util() { - return _util = _interopRequireDefault(__webpack_require__(9)); + return _util = _interopRequireDefault(__webpack_require__(3)); } var _invariant; function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(15)); + return _invariant = _interopRequireDefault(__webpack_require__(9)); } var _stripBom; function _load_stripBom() { - return _stripBom = _interopRequireDefault(__webpack_require__(429)); + return _stripBom = _interopRequireDefault(__webpack_require__(160)); } var _constants; function _load_constants() { - return _constants = __webpack_require__(13); + return _constants = __webpack_require__(8); } var _errors; function _load_errors() { - return _errors = __webpack_require__(6); + return _errors = __webpack_require__(5); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(51)); + return _map = _interopRequireDefault(__webpack_require__(29)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* eslint quotes: 0 */ -var _require = __webpack_require__(794), - safeLoad = _require.safeLoad, - FAILSAFE_SCHEMA = _require.FAILSAFE_SCHEMA; +var _require = __webpack_require__(279); -var VERSION_REGEX = /^yarn lockfile v(\d+)$/; +const safeLoad = _require.safeLoad, + FAILSAFE_SCHEMA = _require.FAILSAFE_SCHEMA; -var TOKEN_TYPES = { + +const VERSION_REGEX = /^yarn lockfile v(\d+)$/; + +const TOKEN_TYPES = { boolean: 'BOOLEAN', string: 'STRING', identifier: 'IDENTIFIER', @@ -64141,23 +34432,23 @@ var TOKEN_TYPES = { comma: 'COMMA' }; -var VALID_PROP_VALUE_TOKENS = [TOKEN_TYPES.boolean, TOKEN_TYPES.string, TOKEN_TYPES.number]; +const VALID_PROP_VALUE_TOKENS = [TOKEN_TYPES.boolean, TOKEN_TYPES.string, TOKEN_TYPES.number]; function isValidPropValueToken(token) { return VALID_PROP_VALUE_TOKENS.indexOf(token.type) >= 0; } function* tokenise(input) { - var lastNewline = false; - var line = 1; - var col = 0; + let lastNewline = false; + let line = 1; + let col = 0; function buildToken(type, value) { return { line, col, type, value }; } while (input.length) { - var chop = 0; + let chop = 0; if (input[0] === '\n' || input[0] === '\r') { chop++; @@ -64171,17 +34462,17 @@ function* tokenise(input) { } else if (input[0] === '#') { chop++; - var nextNewline = input.indexOf('\n', chop); + let nextNewline = input.indexOf('\n', chop); if (nextNewline === -1) { nextNewline = input.length; } - var val = input.substring(chop, nextNewline); + const val = input.substring(chop, nextNewline); chop = nextNewline; yield buildToken(TOKEN_TYPES.comment, val); } else if (input[0] === ' ') { if (lastNewline) { - var indentSize = 1; - for (var i = 1; input[i] === ' '; i++) { + let indentSize = 1; + for (let i = 1; input[i] === ' '; i++) { indentSize++; } @@ -64195,22 +34486,22 @@ function* tokenise(input) { chop++; } } else if (input[0] === '"') { - var _i = 1; - for (; _i < input.length; _i++) { - if (input[_i] === '"') { - var isEscaped = input[_i - 1] === '\\' && input[_i - 2] !== '\\'; + let i = 1; + for (; i < input.length; i++) { + if (input[i] === '"') { + const isEscaped = input[i - 1] === '\\' && input[i - 2] !== '\\'; if (!isEscaped) { - _i++; + i++; break; } } } - var _val = input.substring(0, _i); + const val = input.substring(0, i); - chop = _i; + chop = i; try { - yield buildToken(TOKEN_TYPES.string, JSON.parse(_val)); + yield buildToken(TOKEN_TYPES.string, JSON.parse(val)); } catch (err) { if (err instanceof SyntaxError) { yield buildToken(TOKEN_TYPES.invalid); @@ -64219,10 +34510,10 @@ function* tokenise(input) { } } } else if (/^[0-9]/.test(input)) { - var _val2 = /^[0-9]+/.exec(input)[0]; - chop = _val2.length; + const val = /^[0-9]+/.exec(input)[0]; + chop = val.length; - yield buildToken(TOKEN_TYPES.number, +_val2); + yield buildToken(TOKEN_TYPES.number, +val); } else if (/^true/.test(input)) { yield buildToken(TOKEN_TYPES.boolean, true); chop = 4; @@ -64236,15 +34527,15 @@ function* tokenise(input) { yield buildToken(TOKEN_TYPES.comma); chop++; } else if (/^[a-zA-Z\/.-]/g.test(input)) { - var _i2 = 0; - for (; _i2 < input.length; _i2++) { - var char = input[_i2]; + let i = 0; + for (; i < input.length; i++) { + const char = input[i]; if (char === ':' || char === ' ' || char === '\n' || char === '\r' || char === ',') { break; } } - var name = input.substring(0, _i2); - chop = _i2; + const name = input.substring(0, i); + chop = i; yield buildToken(TOKEN_TYPES.string, name); } else { @@ -64264,39 +34555,36 @@ function* tokenise(input) { yield buildToken(TOKEN_TYPES.eof); } -var Parser = function () { - function Parser(input) { - var fileLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'lockfile'; - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Parser); - +class Parser { + constructor(input, fileLoc = 'lockfile') { this.comments = []; this.tokens = tokenise(input); this.fileLoc = fileLoc; } - Parser.prototype.onComment = function onComment(token) { - var value = token.value; + onComment(token) { + const value = token.value; (0, (_invariant || _load_invariant()).default)(typeof value === 'string', 'expected token value to be a string'); - var comment = value.trim(); + const comment = value.trim(); - var versionMatch = comment.match(VERSION_REGEX); + const versionMatch = comment.match(VERSION_REGEX); if (versionMatch) { - var version = +versionMatch[1]; + const version = +versionMatch[1]; if (version > (_constants || _load_constants()).LOCKFILE_VERSION) { throw new (_errors || _load_errors()).MessageError(`Can't install from a lockfile of version ${version} as you're on an old yarn version that only supports ` + `versions up to ${(_constants || _load_constants()).LOCKFILE_VERSION}. Run \`$ yarn self-update\` to upgrade to the latest version.`); } } this.comments.push(comment); - }; + } - Parser.prototype.next = function next() { - var item = this.tokens.next(); + next() { + const item = this.tokens.next(); (0, (_invariant || _load_invariant()).default)(item, 'expected a token'); - var done = item.done, - value = item.value; + const done = item.done, + value = item.value; if (done || !value) { throw new Error('No more tokens'); @@ -64306,41 +34594,37 @@ var Parser = function () { } else { return this.token = value; } - }; - - Parser.prototype.unexpected = function unexpected() { - var msg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Unexpected token'; + } + unexpected(msg = 'Unexpected token') { throw new SyntaxError(`${msg} ${this.token.line}:${this.token.col} in ${this.fileLoc}`); - }; + } - Parser.prototype.expect = function expect(tokType) { + expect(tokType) { if (this.token.type === tokType) { this.next(); } else { this.unexpected(); } - }; + } - Parser.prototype.eat = function eat(tokType) { + eat(tokType) { if (this.token.type === tokType) { this.next(); return true; } else { return false; } - }; + } - Parser.prototype.parse = function parse() { - var indent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - - var obj = (0, (_map || _load_map()).default)(); + parse(indent = 0) { + const obj = (0, (_map || _load_map()).default)(); while (true) { - var propToken = this.token; + const propToken = this.token; if (propToken.type === TOKEN_TYPES.newline) { - var nextToken = this.next(); + const nextToken = this.next(); if (!indent) { // if we have 0 indentation then the next token doesn't matter continue; @@ -64368,71 +34652,71 @@ var Parser = function () { break; } else if (propToken.type === TOKEN_TYPES.string) { // property key - var key = propToken.value; + const key = propToken.value; (0, (_invariant || _load_invariant()).default)(key, 'Expected a key'); - var keys = [key]; + const keys = [key]; this.next(); // support multiple keys while (this.token.type === TOKEN_TYPES.comma) { this.next(); // skip comma - var keyToken = this.token; + const keyToken = this.token; if (keyToken.type !== TOKEN_TYPES.string) { this.unexpected('Expected string'); } - var _key = keyToken.value; - (0, (_invariant || _load_invariant()).default)(_key, 'Expected a key'); - keys.push(_key); + const key = keyToken.value; + (0, (_invariant || _load_invariant()).default)(key, 'Expected a key'); + keys.push(key); this.next(); } - var wasColon = this.token.type === TOKEN_TYPES.colon; + const wasColon = this.token.type === TOKEN_TYPES.colon; if (wasColon) { this.next(); } if (isValidPropValueToken(this.token)) { // plain value - for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i3 = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { - if (_i3 >= _iterator.length) break; - _ref = _iterator[_i3++]; + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; } else { - _i3 = _iterator.next(); - if (_i3.done) break; - _ref = _i3.value; + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; } - var _key2 = _ref; + const key = _ref; - obj[_key2] = this.token.value; + obj[key] = this.token.value; } this.next(); } else if (wasColon) { // parse object - var val = this.parse(indent + 1); + const val = this.parse(indent + 1); - for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i4 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref2; if (_isArray2) { - if (_i4 >= _iterator2.length) break; - _ref2 = _iterator2[_i4++]; + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; } else { - _i4 = _iterator2.next(); - if (_i4.done) break; - _ref2 = _i4.value; + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; } - var _key3 = _ref2; + const key = _ref2; - obj[_key3] = val; + obj[key] = val; } if (indent && this.token.type !== TOKEN_TYPES.indent) { @@ -64447,30 +34731,28 @@ var Parser = function () { } return obj; - }; + } +} - return Parser; -}(); - -var MERGE_CONFLICT_ANCESTOR = '|||||||'; -var MERGE_CONFLICT_END = '>>>>>>>'; -var MERGE_CONFLICT_SEP = '======='; -var MERGE_CONFLICT_START = '<<<<<<<'; +const MERGE_CONFLICT_ANCESTOR = '|||||||'; +const MERGE_CONFLICT_END = '>>>>>>>'; +const MERGE_CONFLICT_SEP = '======='; +const MERGE_CONFLICT_START = '<<<<<<<'; /** * Extract the two versions of the lockfile from a merge conflict. */ function extractConflictVariants(str) { - var variants = [[], []]; - var lines = str.split(/\r?\n/g); - var skip = false; + const variants = [[], []]; + const lines = str.split(/\r?\n/g); + let skip = false; while (lines.length) { - var _line = lines.shift(); - if (_line.startsWith(MERGE_CONFLICT_START)) { + const line = lines.shift(); + if (line.startsWith(MERGE_CONFLICT_START)) { // get the first variant while (lines.length) { - var conflictLine = lines.shift(); + const conflictLine = lines.shift(); if (conflictLine === MERGE_CONFLICT_SEP) { skip = false; break; @@ -64484,16 +34766,16 @@ function extractConflictVariants(str) { // get the second variant while (lines.length) { - var _conflictLine = lines.shift(); - if (_conflictLine.startsWith(MERGE_CONFLICT_END)) { + const conflictLine = lines.shift(); + if (conflictLine.startsWith(MERGE_CONFLICT_END)) { break; } else { - variants[1].push(_conflictLine); + variants[1].push(conflictLine); } } } else { - variants[0].push(_line); - variants[1].push(_line); + variants[0].push(line); + variants[1].push(line); } } @@ -64504,14 +34786,14 @@ function extractConflictVariants(str) { * Check if a lockfile has merge conflicts. */ function hasMergeConflicts(str) { - return str.indexOf(MERGE_CONFLICT_START) !== -1 && str.indexOf(MERGE_CONFLICT_SEP) !== -1 && str.indexOf(MERGE_CONFLICT_END) !== -1; + return str.includes(MERGE_CONFLICT_START) && str.includes(MERGE_CONFLICT_SEP) && str.includes(MERGE_CONFLICT_END); } /** * Parse the lockfile. */ function parse(str, fileLoc) { - var parser = new Parser(str, fileLoc); + const parser = new Parser(str, fileLoc); parser.next(); try { return parser.parse(); @@ -64530,9 +34812,9 @@ function parse(str, fileLoc) { * Parse and merge the two variants in a conflicted lockfile. */ function parseWithConflict(str, fileLoc) { - var variants = extractConflictVariants(str); + const variants = extractConflictVariants(str); try { - return { type: 'merge', object: (0, (_assign || _load_assign()).default)({}, parse(variants[0], fileLoc), parse(variants[1], fileLoc)) }; + return { type: 'merge', object: Object.assign({}, parse(variants[0], fileLoc), parse(variants[1], fileLoc)) }; } catch (err) { if (err instanceof SyntaxError) { return { type: 'conflict', object: {} }; @@ -64543,7 +34825,465 @@ function parseWithConflict(str, fileLoc) { } /***/ }), -/* 308 */ +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + + +module.exports = { + copy: copy, + checkDataType: checkDataType, + checkDataTypes: checkDataTypes, + coerceToTypes: coerceToTypes, + toHash: toHash, + getProperty: getProperty, + escapeQuotes: escapeQuotes, + equal: __webpack_require__(204), + ucs2length: __webpack_require__(479), + varOccurences: varOccurences, + varReplace: varReplace, + cleanUpCode: cleanUpCode, + finalCleanUpCode: finalCleanUpCode, + schemaHasRules: schemaHasRules, + schemaHasRulesExcept: schemaHasRulesExcept, + toQuotedString: toQuotedString, + getPathExpr: getPathExpr, + getPath: getPath, + getData: getData, + unescapeFragment: unescapeFragment, + unescapeJsonPointer: unescapeJsonPointer, + escapeFragment: escapeFragment, + escapeJsonPointer: escapeJsonPointer +}; + + +function copy(o, to) { + to = to || {}; + for (var key in o) to[key] = o[key]; + return to; +} + + +function checkDataType(dataType, data, negate) { + var EQUAL = negate ? ' !== ' : ' === ' + , AND = negate ? ' || ' : ' && ' + , OK = negate ? '!' : '' + , NOT = negate ? '' : '!'; + switch (dataType) { + case 'null': return data + EQUAL + 'null'; + case 'array': return OK + 'Array.isArray(' + data + ')'; + case 'object': return '(' + OK + data + AND + + 'typeof ' + data + EQUAL + '"object"' + AND + + NOT + 'Array.isArray(' + data + '))'; + case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + + NOT + '(' + data + ' % 1)' + + AND + data + EQUAL + data + ')'; + default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; + } +} + + +function checkDataTypes(dataTypes, data) { + switch (dataTypes.length) { + case 1: return checkDataType(dataTypes[0], data, true); + default: + var code = ''; + var types = toHash(dataTypes); + if (types.array && types.object) { + code = types.null ? '(': '(!' + data + ' || '; + code += 'typeof ' + data + ' !== "object")'; + delete types.null; + delete types.array; + delete types.object; + } + if (types.number) delete types.integer; + for (var t in types) + code += (code ? ' && ' : '' ) + checkDataType(t, data, true); + + return code; + } +} + + +var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); +function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types = []; + for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); + return paths[lvl - up]; + } + + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); + data = 'data' + ((lvl - up) || ''); + if (!jsonPointer) return data; + } + + var expr = data; + var segments = jsonPointer.split('/'); + for (var i=0; i { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) { + var _config$registries$ya = config.registries.yarn.config; + let username = _config$registries$ya.username, + email = _config$registries$ya.email; + + + if (username) { + reporter.info(`${reporter.lang('npmUsername')}: ${username}`); + } else { + username = yield reporter.question(reporter.lang('npmUsername')); + if (!username) { + return null; + } + } + + if (email) { + reporter.info(`${reporter.lang('npmEmail')}: ${email}`); + } else { + email = yield reporter.question(reporter.lang('npmEmail')); + if (!email) { + return null; + } + } + + yield config.registries.yarn.saveHomeConfig({ username, email }); + + return { username, email }; + }); + + return function getCredentials(_x, _x2) { + return _ref.apply(this, arguments); + }; +})(); + +let getToken = exports.getToken = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, name = '', flags = {}, registry = '') { + const auth = registry ? config.registries.npm.getAuthByRegistry(registry) : config.registries.npm.getAuth(name); + + if (config.otp) { + config.registries.npm.setOtp(config.otp); + } + + if (auth) { + config.registries.npm.setToken(auth); + return function revoke() { + reporter.info(reporter.lang('notRevokingConfigToken')); + return Promise.resolve(); + }; + } + + const env = process.env.YARN_AUTH_TOKEN || process.env.NPM_AUTH_TOKEN; + if (env) { + config.registries.npm.setToken(`Bearer ${env}`); + return function revoke() { + reporter.info(reporter.lang('notRevokingEnvToken')); + return Promise.resolve(); + }; + } + + // make sure we're not running in non-interactive mode before asking for login + if (flags.nonInteractive || config.nonInteractive) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('nonInteractiveNoToken')); + } + + // + const creds = yield getCredentials(config, reporter); + if (!creds) { + reporter.warn(reporter.lang('loginAsPublic')); + return function revoke() { + reporter.info(reporter.lang('noTokenToRevoke')); + return Promise.resolve(); + }; + } + + const username = creds.username, + email = creds.email; + + const password = yield reporter.question(reporter.lang('npmPassword'), { + password: true, + required: true + }); + + // + const userobj = { + _id: `org.couchdb.user:${username}`, + name: username, + password, + email, + type: 'user', + roles: [], + date: new Date().toISOString() + }; + + // + const res = yield config.registries.npm.request(`-/user/org.couchdb.user:${encodeURIComponent(username)}`, { + method: 'PUT', + registry, + body: userobj, + auth: { username, password, email } + }); + + if (res && res.ok) { + reporter.success(reporter.lang('loggedIn')); + + const token = res.token; + config.registries.npm.setToken(`Bearer ${token}`); + + return (() => { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + reporter.success(reporter.lang('revokedToken')); + yield config.registries.npm.request(`-/user/token/${token}`, { + method: 'DELETE' + }); + }); + + function revoke() { + return _ref3.apply(this, arguments); + } + + return revoke; + })(); + } else { + throw new (_errors || _load_errors()).MessageError(reporter.lang('incorrectCredentials')); + } + }); + + return function getToken(_x3, _x4) { + return _ref2.apply(this, arguments); + }; +})(); + +let run = exports.run = (() => { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + yield getCredentials(config, reporter); + }); + + return function run(_x5, _x6, _x7, _x8) { + return _ref4.apply(this, arguments); + }; +})(); + +exports.getOneTimePassword = getOneTimePassword; +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function getOneTimePassword(reporter) { + return reporter.question(reporter.lang('npmOneTimePassword')); +} + +function hasWrapper(commander, args) { + return true; +} + +function setFlags(commander) { + commander.description('Stores registry username and email.'); +} + +/***/ }), +/* 108 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -64553,76 +35293,2479 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _getIterator2; +var _asyncToGenerator2; -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -var _classCallCheck2; +exports.stringifyLangArgs = stringifyLangArgs; -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); +var _format; + +function _load_format() { + return _format = __webpack_require__(565); } -var _misc; +var _index; -function _load_misc() { - return _misc = __webpack_require__(28); +function _load_index() { + return _index = _interopRequireWildcard(__webpack_require__(567)); +} + +var _isCi; + +function _load_isCi() { + return _isCi = _interopRequireDefault(__webpack_require__(396)); +} + +var _os; + +function _load_os() { + return _os = _interopRequireDefault(__webpack_require__(49)); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* eslint no-unused-vars: 0 */ + +const util = __webpack_require__(3); +const EventEmitter = __webpack_require__(76).EventEmitter; + +function stringifyLangArgs(args) { + return args.map(function (val) { + if (val != null && val.inspect) { + return val.inspect(); + } else { + try { + const str = JSON.stringify(val) || val + ''; + // should match all literal line breaks and + // "u001b" that follow an odd number of backslashes and convert them to ESC + // we do this because the JSON.stringify process has escaped these characters + return str.replace(/((?:^|[^\\])(?:\\{2})*)\\u001[bB]/g, '$1\u001b').replace(/[\\]r[\\]n|([\\])?[\\]n/g, (match, precededBacklash) => { + // precededBacklash not null when "\n" is preceded by a backlash ("\\n") + // match will be "\\n" and we don't replace it with os.EOL + return precededBacklash ? match : (_os || _load_os()).default.EOL; + }); + } catch (e) { + return util.inspect(val); + } + } + }); +} + +class BaseReporter { + constructor(opts = {}) { + const lang = 'en'; + this.language = lang; + + this.stdout = opts.stdout || process.stdout; + this.stderr = opts.stderr || process.stderr; + this.stdin = opts.stdin || this._getStandardInput(); + this.emoji = !!opts.emoji; + this.nonInteractive = !!opts.nonInteractive; + this.noProgress = !!opts.noProgress || (_isCi || _load_isCi()).default; + this.isVerbose = !!opts.verbose; + + // $FlowFixMe: this is valid! + this.isTTY = this.stdout.isTTY; + + this.peakMemory = 0; + this.startTime = Date.now(); + this.format = (_format || _load_format()).defaultFormatter; + } + + lang(key, ...args) { + const msg = (_index || _load_index())[this.language][key] || (_index || _load_index()).en[key]; + if (!msg) { + throw new ReferenceError(`No message defined for language key ${key}`); + } + + // stringify args + const stringifiedArgs = stringifyLangArgs(args); + + // replace $0 placeholders with args + return msg.replace(/\$(\d+)/g, (str, i) => { + return stringifiedArgs[i]; + }); + } + + /** + * `stringifyLangArgs` run `JSON.stringify` on strings too causing + * them to appear quoted. This marks them as "raw" and prevents + * the quoting and escaping + */ + rawText(str) { + return { + inspect() { + return str; + } + }; + } + + verbose(msg) { + if (this.isVerbose) { + this._verbose(msg); + } + } + + verboseInspect(val) { + if (this.isVerbose) { + this._verboseInspect(val); + } + } + + _verbose(msg) {} + _verboseInspect(val) {} + + _getStandardInput() { + let standardInput; + + // Accessing stdin in a win32 headless process (e.g., Visual Studio) may throw an exception. + try { + standardInput = process.stdin; + } catch (e) { + console.warn(e.message); + delete process.stdin; + // $FlowFixMe: this is valid! + process.stdin = new EventEmitter(); + standardInput = process.stdin; + } + + return standardInput; + } + + initPeakMemoryCounter() { + this.checkPeakMemory(); + this.peakMemoryInterval = setInterval(() => { + this.checkPeakMemory(); + }, 1000); + // $FlowFixMe: Node's setInterval returns a Timeout, not a Number + this.peakMemoryInterval.unref(); + } + + checkPeakMemory() { + var _process$memoryUsage = process.memoryUsage(); + + const heapTotal = _process$memoryUsage.heapTotal; + + if (heapTotal > this.peakMemory) { + this.peakMemory = heapTotal; + } + } + + close() { + if (this.peakMemoryInterval) { + clearInterval(this.peakMemoryInterval); + this.peakMemoryInterval = null; + } + } + + getTotalTime() { + return Date.now() - this.startTime; + } + + // TODO + list(key, items, hints) {} + + // Outputs basic tree structure to console + tree(key, obj, { force = false } = {}) {} + + // called whenever we begin a step in the CLI. + step(current, total, message, emoji) {} + + // a error message has been triggered. this however does not always meant an abrupt + // program end. + error(message) {} + + // an info message has been triggered. this provides things like stats and diagnostics. + info(message) {} + + // a warning message has been triggered. + warn(message) {} + + // a success message has been triggered. + success(message) {} + + // a simple log message + // TODO: rethink the {force} parameter. In the meantime, please don't use it (cf comments in #4143). + log(message, { force = false } = {}) {} + + // a shell command has been executed + command(command) {} + + // inspect and pretty-print any value + inspect(value) {} + + // the screen shown at the very start of the CLI + header(command, pkg) {} + + // the screen shown at the very end of the CLI + footer(showPeakMemory) {} + + // a table structure + table(head, body) {} + + // security audit action to resolve advisories + auditAction(recommendation) {} + + // security audit requires manual review + auditManualReview() {} + + // security audit advisory + auditAdvisory(resolution, auditAdvisory) {} + + // summary for security audit report + auditSummary(auditMetadata) {} + + // render an activity spinner and return a function that will trigger an update + activity() { + return { + tick(name) {}, + end() {} + }; + } + + // + activitySet(total, workers) { + return { + spinners: Array(workers).fill({ + clear() {}, + setPrefix() {}, + tick() {}, + end() {} + }), + end() {} + }; + } + + // + question(question, options = {}) { + return Promise.reject(new Error('Not implemented')); + } + + // + questionAffirm(question) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const condition = true; // trick eslint + if (_this.nonInteractive) { + return true; + } + + while (condition) { + let answer = yield _this.question(question); + answer = answer.toLowerCase(); + + if (answer === 'y' || answer === 'yes') { + return true; + } + if (answer === 'n' || answer === 'no') { + return false; + } + + _this.error('Invalid answer for question'); + } + + return false; + })(); + } + + // prompt the user to select an option from an array + select(header, question, options) { + return Promise.reject(new Error('Not implemented')); + } + + // render a progress bar and return a function which when called will trigger an update + progress(total) { + return function () {}; + } + + // utility function to disable progress bar + disableProgress() { + this.noProgress = true; + } + + // + prompt(message, choices, options = {}) { + return Promise.reject(new Error('Not implemented')); + } +} +exports.default = BaseReporter; + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +exports.explodeHostedGitFragment = explodeHostedGitFragment; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); +} + +var _index; + +function _load_index() { + return _index = __webpack_require__(57); +} + +var _gitResolver; + +function _load_gitResolver() { + return _gitResolver = _interopRequireDefault(__webpack_require__(124)); +} + +var _exoticResolver; + +function _load_exoticResolver() { + return _exoticResolver = _interopRequireDefault(__webpack_require__(89)); +} + +var _git; + +function _load_git() { + return _git = _interopRequireDefault(__webpack_require__(219)); +} + +var _guessName; + +function _load_guessName() { + return _guessName = _interopRequireDefault(__webpack_require__(169)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var PackageReference = function () { - function PackageReference(request, info, remote) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageReference); +function parseHash(fragment) { + const hashPosition = fragment.indexOf('#'); + return hashPosition === -1 ? '' : fragment.substr(hashPosition + 1); +} - this.resolver = request.resolver; - this.lockfile = request.lockfile; - this.requests = []; - this.config = request.config; - this.hint = request.hint; +function explodeHostedGitFragment(fragment, reporter) { + const hash = parseHash(fragment); - this.isPlugnplay = false; - - this.registry = remote.registry; - this.version = info.version; - this.name = info.name; - this.uid = info._uid; - - this.remote = remote; - - this.dependencies = []; - - this.permissions = {}; - this.patterns = []; - this.optional = null; - this.level = Infinity; - this.ignore = false; - this.incompatible = false; - this.fresh = false; - this.locations = []; - this.addRequest(request); + const preParts = fragment.split('@'); + if (preParts.length > 2) { + fragment = preParts[1] + '@' + preParts[2]; } - PackageReference.prototype.setFresh = function setFresh(fresh) { - this.fresh = fresh; - }; + const parts = fragment.replace(/(.*?)#.*/, '$1') // Strip hash + .replace(/.*:(.*)/, '$1') // Strip prefixed protocols + .replace(/.git$/, '') // Strip the .git suffix + .split('/'); - PackageReference.prototype.addLocation = function addLocation(loc) { - if (this.locations.indexOf(loc) === -1) { - this.locations.push(loc); + const user = parts[parts.length - 2]; + const repo = parts[parts.length - 1]; + + if (user === undefined || repo === undefined) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidHostedGitFragment', fragment)); + } + + return { + user, + repo, + hash + }; +} + +class HostedGitResolver extends (_exoticResolver || _load_exoticResolver()).default { + constructor(request, fragment) { + super(request, fragment); + + const exploded = this.exploded = explodeHostedGitFragment(fragment, this.reporter); + const user = exploded.user, + repo = exploded.repo, + hash = exploded.hash; + + this.user = user; + this.repo = repo; + this.hash = hash; + } + + static getTarballUrl(exploded, commit) { + exploded; + commit; + throw new Error('Not implemented'); + } + + static getGitHTTPUrl(exploded) { + exploded; + throw new Error('Not implemented'); + } + + static getGitHTTPBaseUrl(exploded) { + exploded; + throw new Error('Not implemented'); + } + + static getGitSSHUrl(exploded) { + exploded; + throw new Error('Not implemented'); + } + + static getHTTPFileUrl(exploded, filename, commit) { + exploded; + filename; + commit; + throw new Error('Not implemented'); + } + + getRefOverHTTP(url) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url); + const client = new (_git || _load_git()).default(_this.config, gitUrl, _this.hash); + + let out = yield _this.config.requestManager.request({ + url: `${url}/info/refs?service=git-upload-pack`, + queue: _this.resolver.fetchingQueue + }); + + if (out) { + // clean up output + let lines = out.trim().split('\n'); + + // remove first two lines which contains compatibility info etc + lines = lines.slice(2); + + // remove last line which contains the terminator "0000" + lines.pop(); + + // remove line lengths from start of each line + lines = lines.map(function (line) { + return line.slice(4); + }); + + out = lines.join('\n'); + } else { + throw new Error(_this.reporter.lang('hostedGitResolveError')); + } + + return client.setRefHosted(out); + })(); + } + + resolveOverHTTP(url) { + var _this2 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const commit = yield _this2.getRefOverHTTP(url); + const config = _this2.config; + + + const tarballUrl = _this2.constructor.getTarballUrl(_this2.exploded, commit); + + const tryRegistry = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) { + const filename = (_index || _load_index()).registries[registry].filename; + + const href = _this2.constructor.getHTTPFileUrl(_this2.exploded, filename, commit); + const file = yield config.requestManager.request({ + url: href, + queue: _this2.resolver.fetchingQueue + }); + if (!file) { + return null; + } + + const json = yield config.readJson(href, function () { + return JSON.parse(file); + }); + json._uid = commit; + json._remote = { + resolved: tarballUrl, + type: 'tarball', + reference: tarballUrl, + registry + }; + return json; + }); + + return function tryRegistry(_x) { + return _ref.apply(this, arguments); + }; + })(); + + const file = yield tryRegistry(_this2.registry); + if (file) { + return file; + } + + for (const registry in (_index || _load_index()).registries) { + if (registry === _this2.registry) { + continue; + } + + const file = yield tryRegistry(registry); + if (file) { + return file; + } + } + + return { + name: (0, (_guessName || _load_guessName()).default)(url), + version: '0.0.0', + _uid: commit, + _remote: { + resolved: tarballUrl, + type: 'tarball', + reference: tarballUrl, + registry: 'npm', + hash: undefined + } + }; + })(); + } + + hasHTTPCapability(url) { + var _this3 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + return (yield _this3.config.requestManager.request({ + url, + method: 'HEAD', + queue: _this3.resolver.fetchingQueue, + followRedirect: false + })) !== false; + })(); + } + + resolve() { + var _this4 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // If we already have the tarball, just return it without having to make any HTTP requests. + const shrunk = _this4.request.getLocked('tarball'); + if (shrunk) { + return shrunk; + } + + const httpUrl = _this4.constructor.getGitHTTPUrl(_this4.exploded); + const httpBaseUrl = _this4.constructor.getGitHTTPBaseUrl(_this4.exploded); + const sshUrl = _this4.constructor.getGitSSHUrl(_this4.exploded); + + // If we can access the files over HTTP then we should as it's MUCH faster than git + // archive and tarball unarchiving. The HTTP API is only available for public repos + // though. + if (yield _this4.hasHTTPCapability(httpBaseUrl)) { + return _this4.resolveOverHTTP(httpUrl); + } + + // If the url is accessible over git archive then we should immediately delegate to + // the git resolver. + // + // NOTE: Here we use a different url than when we delegate to the git resolver later on. + // This is because `git archive` requires access over ssh and github only allows that + // if you have write permissions + const sshGitUrl = (_git || _load_git()).default.npmUrlToGitUrl(sshUrl); + if (yield (_git || _load_git()).default.hasArchiveCapability(sshGitUrl)) { + const archiveClient = new (_git || _load_git()).default(_this4.config, sshGitUrl, _this4.hash); + const commit = yield archiveClient.init(); + return _this4.fork((_gitResolver || _load_gitResolver()).default, true, `${sshUrl}#${commit}`); + } + + // fallback to the plain git resolver + return _this4.fork((_gitResolver || _load_gitResolver()).default, true, sshUrl); + })(); + } +} +exports.default = HostedGitResolver; + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _map; + +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(29)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const debug = __webpack_require__(266)('yarn'); + +class BlockingQueue { + constructor(alias, maxConcurrency = Infinity) { + this.concurrencyQueue = []; + this.maxConcurrency = maxConcurrency; + this.runningCount = 0; + this.warnedStuck = false; + this.alias = alias; + this.first = true; + + this.running = (0, (_map || _load_map()).default)(); + this.queue = (0, (_map || _load_map()).default)(); + + this.stuckTick = this.stuckTick.bind(this); + } + + stillActive() { + if (this.stuckTimer) { + clearTimeout(this.stuckTimer); } + + this.stuckTimer = setTimeout(this.stuckTick, 5000); + + // We need to check the existence of unref because of https://github.com/facebook/jest/issues/4559 + // $FlowFixMe: Node's setInterval returns a Timeout, not a Number + this.stuckTimer.unref && this.stuckTimer.unref(); + } + + stuckTick() { + if (this.runningCount === 1) { + this.warnedStuck = true; + debug(`The ${JSON.stringify(this.alias)} blocking queue may be stuck. 5 seconds ` + `without any activity with 1 worker: ${Object.keys(this.running)[0]}`); + } + } + + push(key, factory) { + if (this.first) { + this.first = false; + } else { + this.stillActive(); + } + + return new Promise((resolve, reject) => { + // we're already running so push ourselves to the queue + const queue = this.queue[key] = this.queue[key] || []; + queue.push({ factory, resolve, reject }); + + if (!this.running[key]) { + this.shift(key); + } + }); + } + + shift(key) { + if (this.running[key]) { + delete this.running[key]; + this.runningCount--; + + if (this.stuckTimer) { + clearTimeout(this.stuckTimer); + this.stuckTimer = null; + } + + if (this.warnedStuck) { + this.warnedStuck = false; + debug(`${JSON.stringify(this.alias)} blocking queue finally resolved. Nothing to worry about.`); + } + } + + const queue = this.queue[key]; + if (!queue) { + return; + } + + var _queue$shift = queue.shift(); + + const resolve = _queue$shift.resolve, + reject = _queue$shift.reject, + factory = _queue$shift.factory; + + if (!queue.length) { + delete this.queue[key]; + } + + const next = () => { + this.shift(key); + this.shiftConcurrencyQueue(); + }; + + const run = () => { + this.running[key] = true; + this.runningCount++; + + factory().then(function (val) { + resolve(val); + next(); + return null; + }).catch(function (err) { + reject(err); + next(); + }); + }; + + this.maybePushConcurrencyQueue(run); + } + + maybePushConcurrencyQueue(run) { + if (this.runningCount < this.maxConcurrency) { + run(); + } else { + this.concurrencyQueue.push(run); + } + } + + shiftConcurrencyQueue() { + if (this.runningCount < this.maxConcurrency) { + const fn = this.concurrencyQueue.shift(); + if (fn) { + fn(); + } + } + } +} +exports.default = BlockingQueue; + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.execCommand = exports.execFromManifest = exports.executeLifecycleScript = exports.makeEnv = exports.getWrappersFolder = exports.IGNORE_MANIFEST_KEYS = undefined; + +var _extends2; + +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(22)); +} + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +let getWrappersFolder = exports.getWrappersFolder = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { + if (wrappersFolder) { + return wrappersFolder; + } + + wrappersFolder = yield (_fs || _load_fs()).makeTempDir(); + + yield (0, (_portableScript || _load_portableScript()).makePortableProxyScript)(process.execPath, wrappersFolder, { + proxyBasename: 'node' + }); + + yield (0, (_portableScript || _load_portableScript()).makePortableProxyScript)(process.execPath, wrappersFolder, { + proxyBasename: 'yarn', + prependArguments: [process.argv[1]] + }); + + return wrappersFolder; + }); + + return function getWrappersFolder(_x) { + return _ref.apply(this, arguments); }; +})(); - PackageReference.prototype.addRequest = function addRequest(request) { - this.requests.push(request); +let makeEnv = exports.makeEnv = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (stage, cwd, config) { + const env = (0, (_extends2 || _load_extends()).default)({ + NODE: process.execPath, + INIT_CWD: process.cwd() + }, process.env); - this.level = Math.min(this.level, request.parentNames.length); + // Merge in the `env` object specified in .yarnrc + const customEnv = config.getOption('env'); + if (customEnv && typeof customEnv === 'object') { + Object.assign(env, customEnv); + } + + env.npm_lifecycle_event = stage; + env.npm_node_execpath = env.NODE; + env.npm_execpath = env.npm_execpath || process.mainModule && process.mainModule.filename; + + // Set the env to production for npm compat if production mode. + // https://github.com/npm/npm/blob/30d75e738b9cb7a6a3f9b50e971adcbe63458ed3/lib/utils/lifecycle.js#L336 + if (config.production) { + env.NODE_ENV = 'production'; + } + + // Note: npm_config_argv environment variable contains output of nopt - command-line + // parser used by npm. Since we use other parser, we just roughly emulate it's output. (See: #684) + env.npm_config_argv = JSON.stringify({ + remain: [], + cooked: config.commandName === 'run' ? [config.commandName, stage] : [config.commandName], + original: process.argv.slice(2) + }); + + const manifest = yield config.maybeReadManifest(cwd); + if (manifest) { + if (manifest.scripts && Object.prototype.hasOwnProperty.call(manifest.scripts, stage)) { + env.npm_lifecycle_script = manifest.scripts[stage]; + } + + // add npm_package_* + const queue = [['', manifest]]; + while (queue.length) { + var _queue$pop = queue.pop(); + + const key = _queue$pop[0], + val = _queue$pop[1]; + + if (typeof val === 'object') { + for (const subKey in val) { + const fullKey = [key, subKey].filter(Boolean).join('_'); + if (fullKey && fullKey[0] !== '_' && !IGNORE_MANIFEST_KEYS.has(fullKey)) { + queue.push([fullKey, val[subKey]]); + } + } + } else { + let cleanVal = String(val); + if (cleanVal.indexOf('\n') >= 0) { + cleanVal = JSON.stringify(cleanVal); + } + + //replacing invalid chars with underscore + const cleanKey = key.replace(INVALID_CHAR_REGEX, '_'); + + env[`npm_package_${cleanKey}`] = cleanVal; + } + } + } + + // add npm_config_* and npm_package_config_* from yarn config + const keys = new Set([...Object.keys(config.registries.yarn.config), ...Object.keys(config.registries.npm.config)]); + const cleaned = Array.from(keys).filter(function (key) { + return !key.match(/:_/) && IGNORE_CONFIG_KEYS.indexOf(key) === -1; + }).map(function (key) { + let val = config.getOption(key); + if (!val) { + val = ''; + } else if (typeof val === 'number') { + val = '' + val; + } else if (typeof val !== 'string') { + val = JSON.stringify(val); + } + + if (val.indexOf('\n') >= 0) { + val = JSON.stringify(val); + } + return [key, val]; + }); + // add npm_config_* + for (var _iterator = cleaned, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref4; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; + } + + const _ref3 = _ref4; + const key = _ref3[0]; + const val = _ref3[1]; + + const cleanKey = key.replace(/^_+/, ''); + const envKey = `npm_config_${cleanKey}`.replace(INVALID_CHAR_REGEX, '_'); + env[envKey] = val; + } + // add npm_package_config_* + if (manifest && manifest.name) { + const packageConfigPrefix = `${manifest.name}:`; + for (var _iterator2 = cleaned, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref6; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref6 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref6 = _i2.value; + } + + const _ref5 = _ref6; + const key = _ref5[0]; + const val = _ref5[1]; + + if (key.indexOf(packageConfigPrefix) !== 0) { + continue; + } + const cleanKey = key.replace(/^_+/, '').replace(packageConfigPrefix, ''); + const envKey = `npm_package_config_${cleanKey}`.replace(INVALID_CHAR_REGEX, '_'); + env[envKey] = val; + } + } + + // split up the path + const envPath = env[(_constants || _load_constants()).ENV_PATH_KEY]; + const pathParts = envPath ? envPath.split(path.delimiter) : []; + + // Include node-gyp version that was bundled with the current Node.js version, + // if available. + pathParts.unshift(path.join(path.dirname(process.execPath), 'node_modules', 'npm', 'bin', 'node-gyp-bin')); + pathParts.unshift(path.join(path.dirname(process.execPath), '..', 'lib', 'node_modules', 'npm', 'bin', 'node-gyp-bin')); + // Include node-gyp version from homebrew managed npm, if available. + pathParts.unshift(path.join(path.dirname(process.execPath), '..', 'libexec', 'lib', 'node_modules', 'npm', 'bin', 'node-gyp-bin')); + + // Add global bin folder if it is not present already, as some packages depend + // on a globally-installed version of node-gyp. + const globalBin = yield (0, (_global || _load_global()).getBinFolder)(config, {}); + if (pathParts.indexOf(globalBin) === -1) { + pathParts.unshift(globalBin); + } + + // Add node_modules .bin folders to the PATH + for (var _iterator3 = config.registryFolders, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref7; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref7 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref7 = _i3.value; + } + + const registryFolder = _ref7; + + const binFolder = path.join(registryFolder, '.bin'); + if (config.workspacesEnabled && config.workspaceRootFolder) { + pathParts.unshift(path.join(config.workspaceRootFolder, binFolder)); + } + pathParts.unshift(path.join(config.linkFolder, binFolder)); + pathParts.unshift(path.join(cwd, binFolder)); + } + + let pnpFile; + + if (process.versions.pnp) { + pnpFile = (_dynamicRequire || _load_dynamicRequire()).dynamicRequire.resolve('pnpapi'); + } else { + const candidate = `${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`; + if (yield (_fs || _load_fs()).exists(candidate)) { + pnpFile = candidate; + } + } + + if (pnpFile) { + const pnpApi = (0, (_dynamicRequire || _load_dynamicRequire()).dynamicRequire)(pnpFile); + + const packageLocator = pnpApi.findPackageLocator(`${cwd}/`); + const packageInformation = pnpApi.getPackageInformation(packageLocator); + + for (var _iterator4 = packageInformation.packageDependencies.entries(), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref9; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref9 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref9 = _i4.value; + } + + const _ref8 = _ref9; + const name = _ref8[0]; + const reference = _ref8[1]; + + const dependencyInformation = pnpApi.getPackageInformation({ name, reference }); + + if (!dependencyInformation || !dependencyInformation.packageLocation) { + continue; + } + + const binFolder = `${dependencyInformation.packageLocation}/.bin`; + if (yield (_fs || _load_fs()).exists(binFolder)) { + pathParts.unshift(binFolder); + } + } + + // Note that NODE_OPTIONS doesn't support any style of quoting its arguments at the moment + // For this reason, it won't work if the user has a space inside its $PATH + env.NODE_OPTIONS = env.NODE_OPTIONS || ''; + env.NODE_OPTIONS = `--require ${pnpFile} ${env.NODE_OPTIONS}`; + } + + pathParts.unshift((yield getWrappersFolder(config))); + + // join path back together + env[(_constants || _load_constants()).ENV_PATH_KEY] = pathParts.join(path.delimiter); + + return env; + }); + + return function makeEnv(_x2, _x3, _x4) { + return _ref2.apply(this, arguments); }; +})(); - PackageReference.prototype.prune = function prune() { - for (var _iterator = this.patterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { +let executeLifecycleScript = exports.executeLifecycleScript = (() => { + var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ({ + stage, + config, + cwd, + cmd, + isInteractive, + onProgress, + customShell + }) { + const env = yield makeEnv(stage, cwd, config); + + yield checkForGypIfNeeded(config, cmd, env[(_constants || _load_constants()).ENV_PATH_KEY].split(path.delimiter)); + + if (process.platform === 'win32' && (!customShell || customShell === 'cmd')) { + // handle windows run scripts starting with a relative path + cmd = (0, (_fixCmdWinSlashes || _load_fixCmdWinSlashes()).fixCmdWinSlashes)(cmd); + } + + // By default (non-interactive), pipe everything to the terminal and run child process detached + // as long as it's not Windows (since windows does not have /dev/tty) + let stdio = ['ignore', 'pipe', 'pipe']; + let detached = process.platform !== 'win32'; + + if (isInteractive) { + stdio = 'inherit'; + detached = false; + } + + const shell = customShell || true; + const stdout = yield (_child || _load_child()).spawn(cmd, [], { cwd, env, stdio, detached, shell }, onProgress); + + return { cwd, command: cmd, stdout }; + }); + + return function executeLifecycleScript(_x5) { + return _ref10.apply(this, arguments); + }; +})(); + +let _checkForGyp = (() => { + var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, paths) { + const reporter = config.reporter; + + // Check every directory in the PATH + + const allChecks = yield Promise.all(paths.map(function (dir) { + return (_fs || _load_fs()).exists(path.join(dir, 'node-gyp')); + })); + if (allChecks.some(Boolean)) { + // node-gyp is available somewhere + return; + } + + reporter.info(reporter.lang('packageRequiresNodeGyp')); + + try { + yield (0, (_global || _load_global()).run)(config, reporter, {}, ['add', 'node-gyp']); + } catch (e) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('nodeGypAutoInstallFailed', e.message)); + } + }); + + return function _checkForGyp(_x6, _x7) { + return _ref11.apply(this, arguments); + }; +})(); + +let execFromManifest = exports.execFromManifest = (() => { + var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, commandName, cwd) { + const pkg = yield config.maybeReadManifest(cwd); + if (!pkg || !pkg.scripts) { + return; + } + + const cmd = pkg.scripts[commandName]; + if (cmd) { + yield execCommand({ stage: commandName, config, cmd, cwd, isInteractive: true }); + } + }); + + return function execFromManifest(_x8, _x9, _x10) { + return _ref12.apply(this, arguments); + }; +})(); + +let execCommand = exports.execCommand = (() => { + var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ({ + stage, + config, + cmd, + cwd, + isInteractive, + customShell + }) { + const reporter = config.reporter; + + try { + reporter.command(cmd); + yield executeLifecycleScript({ stage, config, cwd, cmd, isInteractive, customShell }); + return Promise.resolve(); + } catch (err) { + if (err instanceof (_errors || _load_errors()).ProcessTermError) { + const formattedError = new (_errors || _load_errors()).ProcessTermError(err.EXIT_SIGNAL ? reporter.lang('commandFailedWithSignal', err.EXIT_SIGNAL) : reporter.lang('commandFailedWithCode', err.EXIT_CODE)); + formattedError.EXIT_CODE = err.EXIT_CODE; + formattedError.EXIT_SIGNAL = err.EXIT_SIGNAL; + throw formattedError; + } else { + throw err; + } + } + }); + + return function execCommand(_x11) { + return _ref13.apply(this, arguments); + }; +})(); + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); +} + +var _constants; + +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} + +var _child; + +function _load_child() { + return _child = _interopRequireWildcard(__webpack_require__(58)); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(6)); +} + +var _dynamicRequire; + +function _load_dynamicRequire() { + return _dynamicRequire = __webpack_require__(371); +} + +var _portableScript; + +function _load_portableScript() { + return _portableScript = __webpack_require__(589); +} + +var _fixCmdWinSlashes; + +function _load_fixCmdWinSlashes() { + return _fixCmdWinSlashes = __webpack_require__(577); +} + +var _global; + +function _load_global() { + return _global = __webpack_require__(121); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const path = __webpack_require__(0); + +const IGNORE_MANIFEST_KEYS = exports.IGNORE_MANIFEST_KEYS = new Set(['readme', 'notice', 'licenseText']); + +// We treat these configs as internal, thus not expose them to process.env. +// This helps us avoid some gyp issues when building native modules. +// See https://github.com/yarnpkg/yarn/issues/2286. +const IGNORE_CONFIG_KEYS = ['lastUpdateCheck']; + +let wrappersFolder = null; + +const INVALID_CHAR_REGEX = /\W/g; + +exports.default = executeLifecycleScript; + + +let checkGypPromise = null; +/** + * Special case: Some packages depend on node-gyp, but don't specify this in + * their package.json dependencies. They assume that node-gyp is available + * globally. We need to detect this case and show an error message. + */ +function checkForGypIfNeeded(config, cmd, paths) { + if (cmd.substr(0, cmd.indexOf(' ')) !== 'node-gyp') { + return Promise.resolve(); + } + + // Ensure this only runs once, rather than multiple times in parallel. + if (!checkGypPromise) { + checkGypPromise = _checkForGyp(config, paths); + } + return checkGypPromise; +} + +/***/ }), +/* 112 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports) { + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * micromatch + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + + + +var expand = __webpack_require__(753); +var utils = __webpack_require__(300); + +/** + * The main function. Pass an array of filepaths, + * and a string or array of glob patterns + * + * @param {Array|String} `files` + * @param {Array|String} `patterns` + * @param {Object} `opts` + * @return {Array} Array of matches + */ + +function micromatch(files, patterns, opts) { + if (!files || !patterns) return []; + opts = opts || {}; + + if (typeof opts.cache === 'undefined') { + opts.cache = true; + } + + if (!Array.isArray(patterns)) { + return match(files, patterns, opts); + } + + var len = patterns.length, i = 0; + var omit = [], keep = []; + + while (len--) { + var glob = patterns[i++]; + if (typeof glob === 'string' && glob.charCodeAt(0) === 33 /* ! */) { + omit.push.apply(omit, match(files, glob.slice(1), opts)); + } else { + keep.push.apply(keep, match(files, glob, opts)); + } + } + return utils.diff(keep, omit); +} + +/** + * Return an array of files that match the given glob pattern. + * + * This function is called by the main `micromatch` function If you only + * need to pass a single pattern you might get very minor speed improvements + * using this function. + * + * @param {Array} `files` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Array} + */ + +function match(files, pattern, opts) { + if (utils.typeOf(files) !== 'string' && !Array.isArray(files)) { + throw new Error(msg('match', 'files', 'a string or array')); + } + + files = utils.arrayify(files); + opts = opts || {}; + + var negate = opts.negate || false; + var orig = pattern; + + if (typeof pattern === 'string') { + negate = pattern.charAt(0) === '!'; + if (negate) { + pattern = pattern.slice(1); + } + + // we need to remove the character regardless, + // so the above logic is still needed + if (opts.nonegate === true) { + negate = false; + } + } + + var _isMatch = matcher(pattern, opts); + var len = files.length, i = 0; + var res = []; + + while (i < len) { + var file = files[i++]; + var fp = utils.unixify(file, opts); + + if (!_isMatch(fp)) { continue; } + res.push(fp); + } + + if (res.length === 0) { + if (opts.failglob === true) { + throw new Error('micromatch.match() found no matches for: "' + orig + '".'); + } + + if (opts.nonull || opts.nullglob) { + res.push(utils.unescapeGlob(orig)); + } + } + + // if `negate` was defined, diff negated files + if (negate) { res = utils.diff(files, res); } + + // if `ignore` was defined, diff ignored filed + if (opts.ignore && opts.ignore.length) { + pattern = opts.ignore; + opts = utils.omit(opts, ['ignore']); + res = utils.diff(res, micromatch(res, pattern, opts)); + } + + if (opts.nodupes) { + return utils.unique(res); + } + return res; +} + +/** + * Returns a function that takes a glob pattern or array of glob patterns + * to be used with `Array#filter()`. (Internally this function generates + * the matching function using the [matcher] method). + * + * ```js + * var fn = mm.filter('[a-c]'); + * ['a', 'b', 'c', 'd', 'e'].filter(fn); + * //=> ['a', 'b', 'c'] + * ``` + * @param {String|Array} `patterns` Can be a glob or array of globs. + * @param {Options} `opts` Options to pass to the [matcher] method. + * @return {Function} Filter function to be passed to `Array#filter()`. + */ + +function filter(patterns, opts) { + if (!Array.isArray(patterns) && typeof patterns !== 'string') { + throw new TypeError(msg('filter', 'patterns', 'a string or array')); + } + + patterns = utils.arrayify(patterns); + var len = patterns.length, i = 0; + var patternMatchers = Array(len); + while (i < len) { + patternMatchers[i] = matcher(patterns[i++], opts); + } + + return function(fp) { + if (fp == null) return []; + var len = patternMatchers.length, i = 0; + var res = true; + + fp = utils.unixify(fp, opts); + while (i < len) { + var fn = patternMatchers[i++]; + if (!fn(fp)) { + res = false; + break; + } + } + return res; + }; +} + +/** + * Returns true if the filepath contains the given + * pattern. Can also return a function for matching. + * + * ```js + * isMatch('foo.md', '*.md', {}); + * //=> true + * + * isMatch('*.md', {})('foo.md') + * //=> true + * ``` + * @param {String} `fp` + * @param {String} `pattern` + * @param {Object} `opts` + * @return {Boolean} + */ + +function isMatch(fp, pattern, opts) { + if (typeof fp !== 'string') { + throw new TypeError(msg('isMatch', 'filepath', 'a string')); + } + + fp = utils.unixify(fp, opts); + if (utils.typeOf(pattern) === 'object') { + return matcher(fp, pattern); + } + return matcher(pattern, opts)(fp); +} + +/** + * Returns true if the filepath matches the + * given pattern. + */ + +function contains(fp, pattern, opts) { + if (typeof fp !== 'string') { + throw new TypeError(msg('contains', 'pattern', 'a string')); + } + + opts = opts || {}; + opts.contains = (pattern !== ''); + fp = utils.unixify(fp, opts); + + if (opts.contains && !utils.isGlob(pattern)) { + return fp.indexOf(pattern) !== -1; + } + return matcher(pattern, opts)(fp); +} + +/** + * Returns true if a file path matches any of the + * given patterns. + * + * @param {String} `fp` The filepath to test. + * @param {String|Array} `patterns` Glob patterns to use. + * @param {Object} `opts` Options to pass to the `matcher()` function. + * @return {String} + */ + +function any(fp, patterns, opts) { + if (!Array.isArray(patterns) && typeof patterns !== 'string') { + throw new TypeError(msg('any', 'patterns', 'a string or array')); + } + + patterns = utils.arrayify(patterns); + var len = patterns.length; + + fp = utils.unixify(fp, opts); + while (len--) { + var isMatch = matcher(patterns[len], opts); + if (isMatch(fp)) { + return true; + } + } + return false; +} + +/** + * Filter the keys of an object with the given `glob` pattern + * and `options` + * + * @param {Object} `object` + * @param {Pattern} `object` + * @return {Array} + */ + +function matchKeys(obj, glob, options) { + if (utils.typeOf(obj) !== 'object') { + throw new TypeError(msg('matchKeys', 'first argument', 'an object')); + } + + var fn = matcher(glob, options); + var res = {}; + + for (var key in obj) { + if (obj.hasOwnProperty(key) && fn(key)) { + res[key] = obj[key]; + } + } + return res; +} + +/** + * Return a function for matching based on the + * given `pattern` and `options`. + * + * @param {String} `pattern` + * @param {Object} `options` + * @return {Function} + */ + +function matcher(pattern, opts) { + // pattern is a function + if (typeof pattern === 'function') { + return pattern; + } + // pattern is a regex + if (pattern instanceof RegExp) { + return function(fp) { + return pattern.test(fp); + }; + } + + if (typeof pattern !== 'string') { + throw new TypeError(msg('matcher', 'pattern', 'a string, regex, or function')); + } + + // strings, all the way down... + pattern = utils.unixify(pattern, opts); + + // pattern is a non-glob string + if (!utils.isGlob(pattern)) { + return utils.matchPath(pattern, opts); + } + // pattern is a glob string + var re = makeRe(pattern, opts); + + // `matchBase` is defined + if (opts && opts.matchBase) { + return utils.hasFilename(re, opts); + } + // `matchBase` is not defined + return function(fp) { + fp = utils.unixify(fp, opts); + return re.test(fp); + }; +} + +/** + * Create and cache a regular expression for matching + * file paths. + * + * If the leading character in the `glob` is `!`, a negation + * regex is returned. + * + * @param {String} `glob` + * @param {Object} `options` + * @return {RegExp} + */ + +function toRegex(glob, options) { + // clone options to prevent mutating the original object + var opts = Object.create(options || {}); + var flags = opts.flags || ''; + if (opts.nocase && flags.indexOf('i') === -1) { + flags += 'i'; + } + + var parsed = expand(glob, opts); + + // pass in tokens to avoid parsing more than once + opts.negated = opts.negated || parsed.negated; + opts.negate = opts.negated; + glob = wrapGlob(parsed.pattern, opts); + var re; + + try { + re = new RegExp(glob, flags); + return re; + } catch (err) { + err.reason = 'micromatch invalid regex: (' + re + ')'; + if (opts.strict) throw new SyntaxError(err); + } + + // we're only here if a bad pattern was used and the user + // passed `options.silent`, so match nothing + return /$^/; +} + +/** + * Create the regex to do the matching. If the leading + * character in the `glob` is `!` a negation regex is returned. + * + * @param {String} `glob` + * @param {Boolean} `negate` + */ + +function wrapGlob(glob, opts) { + var prefix = (opts && !opts.contains) ? '^' : ''; + var after = (opts && !opts.contains) ? '$' : ''; + glob = ('(?:' + glob + ')' + after); + if (opts && opts.negate) { + return prefix + ('(?!^' + glob + ').*$'); + } + return prefix + glob; +} + +/** + * Create and cache a regular expression for matching file paths. + * If the leading character in the `glob` is `!`, a negation + * regex is returned. + * + * @param {String} `glob` + * @param {Object} `options` + * @return {RegExp} + */ + +function makeRe(glob, opts) { + if (utils.typeOf(glob) !== 'string') { + throw new Error(msg('makeRe', 'glob', 'a string')); + } + return utils.cache(toRegex, glob, opts); +} + +/** + * Make error messages consistent. Follows this format: + * + * ```js + * msg(methodName, argNumber, nativeType); + * // example: + * msg('matchKeys', 'first', 'an object'); + * ``` + * + * @param {String} `method` + * @param {String} `num` + * @param {String} `type` + * @return {String} + */ + +function msg(method, what, type) { + return 'micromatch.' + method + '(): ' + what + ' should be ' + type + '.'; +} + +/** + * Public methods + */ + +/* eslint no-multi-spaces: 0 */ +micromatch.any = any; +micromatch.braces = micromatch.braceExpand = utils.braces; +micromatch.contains = contains; +micromatch.expand = expand; +micromatch.filter = filter; +micromatch.isMatch = isMatch; +micromatch.makeRe = makeRe; +micromatch.match = match; +micromatch.matcher = matcher; +micromatch.matchKeys = matchKeys; + +/** + * Expose `micromatch` + */ + +module.exports = micromatch; + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + + + +/**/ + +var pna = __webpack_require__(180); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = __webpack_require__(113); +util.inherits = __webpack_require__(61); +/**/ + +var Readable = __webpack_require__(405); +var Writable = __webpack_require__(407); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; + +/***/ }), +/* 116 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = multicast; +/* unused harmony export MulticastOperator */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_ConnectableObservable__ = __webpack_require__(422); +/** PURE_IMPORTS_START _observable_ConnectableObservable PURE_IMPORTS_END */ + +function multicast(subjectOrSubjectFactory, selector) { + return function multicastOperatorFunction(source) { + var subjectFactory; + if (typeof subjectOrSubjectFactory === 'function') { + subjectFactory = subjectOrSubjectFactory; + } + else { + subjectFactory = function subjectFactory() { + return subjectOrSubjectFactory; + }; + } + if (typeof selector === 'function') { + return source.lift(new MulticastOperator(subjectFactory, selector)); + } + var connectable = Object.create(source, __WEBPACK_IMPORTED_MODULE_0__observable_ConnectableObservable__["b" /* connectableObservableDescriptor */]); + connectable.source = source; + connectable.subjectFactory = subjectFactory; + return connectable; + }; +} +var MulticastOperator = /*@__PURE__*/ (function () { + function MulticastOperator(subjectFactory, selector) { + this.subjectFactory = subjectFactory; + this.selector = selector; + } + MulticastOperator.prototype.call = function (subscriber, source) { + var selector = this.selector; + var subject = this.subjectFactory(); + var subscription = selector(subject).subscribe(subscriber); + subscription.add(source.subscribe(subject)); + return subscription; + }; + return MulticastOperator; +}()); + +//# sourceMappingURL=multicast.js.map + + +/***/ }), +/* 117 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return observable; }); +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +var observable = typeof Symbol === 'function' && Symbol.observable || '@@observable'; +//# sourceMappingURL=observable.js.map + + +/***/ }), +/* 118 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = identity; +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +function identity(x) { + return x; +} +//# sourceMappingURL=identity.js.map + + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +var v1 = __webpack_require__(957); +var v4 = __webpack_require__(958); + +var uuid = v4; +uuid.v1 = v1; +uuid.v4 = v4; + +module.exports = uuid; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getInstallationMethod = exports.version = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +let getInstallationMethod = exports.getInstallationMethod = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + let installationMethod = originalInstallationMethod; + + // If there's a package.json in the parent directory, it could have an + // override for the installation method, so we should prefer that over + // whatever was originally in Yarn's package.json. This is the case with + // systems such as Homebrew, which take the tarball and modify the + // installation method so we're aware of the fact that Yarn was installed via + // Homebrew (so things like update notifications can point out the correct + // command to upgrade). + try { + const manifestPath = (_path || _load_path()).default.join(__dirname, '..', 'package.json'); + if ((_fs2 || _load_fs2()).default.existsSync(manifestPath)) { + // non-async version is deprecated + const manifest = yield (0, (_fs || _load_fs()).readJson)(manifestPath); + if (manifest.installationMethod) { + installationMethod = manifest.installationMethod; + } + } + } catch (e) { + // Ignore any errors; this is not critical functionality. + } + return installationMethod; + }); + + return function getInstallationMethod() { + return _ref.apply(this, arguments); + }; +})(); + +var _fs; + +function _load_fs() { + return _fs = __webpack_require__(6); +} + +var _fs2; + +function _load_fs2() { + return _fs2 = _interopRequireDefault(__webpack_require__(4)); +} + +var _path; + +function _load_path() { + return _path = _interopRequireDefault(__webpack_require__(0)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// This will be bundled directly in the .js file for production builds +var _require = __webpack_require__(194); /** + * Determines the current version of Yarn itself. + * + */ + +const version = _require.version, + originalInstallationMethod = _require.installationMethod; +exports.version = version; + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = exports.getBinFolder = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +let updateCwd = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { + yield (_fs || _load_fs()).mkdirp(config.globalFolder); + + yield config.init({ + cwd: config.globalFolder, + offline: config.offline, + binLinks: true, + globalFolder: config.globalFolder, + cacheFolder: config._cacheRootFolder, + linkFolder: config.linkFolder, + enableDefaultRc: config.enableDefaultRc, + extraneousYarnrcFiles: config.extraneousYarnrcFiles + }); + }); + + return function updateCwd(_x) { + return _ref2.apply(this, arguments); + }; +})(); + +let getBins = (() => { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { + // build up list of registry folders to search for binaries + const dirs = []; + for (var _iterator2 = Object.keys((_index || _load_index()).registries), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref4; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref4 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref4 = _i2.value; + } + + const registryName = _ref4; + + const registry = config.registries[registryName]; + dirs.push(registry.loc); + } + + // build up list of binary files + const paths = new Set(); + for (var _iterator3 = dirs, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref5; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref5 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref5 = _i3.value; + } + + const dir = _ref5; + + const binDir = path.join(dir, '.bin'); + if (!(yield (_fs || _load_fs()).exists(binDir))) { + continue; + } + + for (var _iterator4 = yield (_fs || _load_fs()).readdir(binDir), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref6; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref6 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref6 = _i4.value; + } + + const name = _ref6; + + paths.add(path.join(binDir, name)); + } + } + return paths; + }); + + return function getBins(_x2) { + return _ref3.apply(this, arguments); + }; +})(); + +let getGlobalPrefix = (() => { + var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { + if (flags.prefix) { + return flags.prefix; + } else if (config.getOption('prefix', true)) { + return String(config.getOption('prefix', true)); + } else if (process.env.PREFIX) { + return process.env.PREFIX; + } + + const potentialPrefixFolders = [(_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX]; + if (process.platform === 'win32') { + // %LOCALAPPDATA%\Yarn --> C:\Users\Alice\AppData\Local\Yarn + if (process.env.LOCALAPPDATA) { + potentialPrefixFolders.unshift(path.join(process.env.LOCALAPPDATA, 'Yarn')); + } + } else { + potentialPrefixFolders.unshift((_constants || _load_constants()).POSIX_GLOBAL_PREFIX); + } + + const binFolders = potentialPrefixFolders.map(function (prefix) { + return path.join(prefix, 'bin'); + }); + const prefixFolderQueryResult = yield (_fs || _load_fs()).getFirstSuitableFolder(binFolders); + const prefix = prefixFolderQueryResult.folder && path.dirname(prefixFolderQueryResult.folder); + + if (!prefix) { + config.reporter.warn(config.reporter.lang('noGlobalFolder', prefixFolderQueryResult.skipped.map(function (item) { + return path.dirname(item.folder); + }).join(', '))); + + return (_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX; + } + + return prefix; + }); + + return function getGlobalPrefix(_x3, _x4) { + return _ref7.apply(this, arguments); + }; +})(); + +let getBinFolder = exports.getBinFolder = (() => { + var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { + const prefix = yield getGlobalPrefix(config, flags); + return path.resolve(prefix, 'bin'); + }); + + return function getBinFolder(_x5, _x6) { + return _ref8.apply(this, arguments); + }; +})(); + +let initUpdateBins = (() => { + var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags) { + const beforeBins = yield getBins(config); + const binFolder = yield getBinFolder(config, flags); + + function throwPermError(err, dest) { + if (err.code === 'EACCES') { + throw new (_errors || _load_errors()).MessageError(reporter.lang('noPermission', dest)); + } else { + throw err; + } + } + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + try { + yield (_fs || _load_fs()).mkdirp(binFolder); + } catch (err) { + throwPermError(err, binFolder); + } + + const afterBins = yield getBins(config); + + // remove old bins + for (var _iterator5 = beforeBins, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref11; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref11 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref11 = _i5.value; + } + + const src = _ref11; + + if (afterBins.has(src)) { + // not old + continue; + } + + // remove old bin + const dest = path.join(binFolder, path.basename(src)); + try { + yield (_fs || _load_fs()).unlink(dest); + } catch (err) { + throwPermError(err, dest); + } + } + + // add new bins + for (var _iterator6 = afterBins, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref12; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref12 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref12 = _i6.value; + } + + const src = _ref12; + + // insert new bin + const dest = path.join(binFolder, path.basename(src)); + try { + yield (_fs || _load_fs()).unlink(dest); + yield (0, (_packageLinker || _load_packageLinker()).linkBin)(src, dest); + if (process.platform === 'win32' && dest.indexOf('.cmd') !== -1) { + yield (_fs || _load_fs()).rename(dest + '.cmd', dest); + } + } catch (err) { + throwPermError(err, dest); + } + } + }); + }); + + return function initUpdateBins(_x7, _x8, _x9) { + return _ref9.apply(this, arguments); + }; +})(); + +let list = (() => { + var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + yield updateCwd(config); + + // install so we get hard file paths + const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); + const install = new (_install || _load_install()).Install({}, config, new (_baseReporter || _load_baseReporter()).default(), lockfile); + const patterns = yield install.getFlattenedDeps(); + + // dump global modules + for (var _iterator7 = patterns, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref14; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref14 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref14 = _i7.value; + } + + const pattern = _ref14; + + const manifest = install.resolver.getStrictResolvedPattern(pattern); + ls(manifest, reporter, false); + } + }); + + return function list(_x10, _x11, _x12, _x13) { + return _ref13.apply(this, arguments); + }; +})(); + +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); +} + +var _index; + +function _load_index() { + return _index = __webpack_require__(57); +} + +var _baseReporter; + +function _load_baseReporter() { + return _baseReporter = _interopRequireDefault(__webpack_require__(108)); +} + +var _buildSubCommands2; + +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(59)); +} + +var _lockfile; + +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(19)); +} + +var _install; + +function _load_install() { + return _install = __webpack_require__(34); +} + +var _add; + +function _load_add() { + return _add = __webpack_require__(165); +} + +var _remove; + +function _load_remove() { + return _remove = __webpack_require__(359); +} + +var _upgrade; + +function _load_upgrade() { + return _upgrade = __webpack_require__(207); +} + +var _upgradeInteractive; + +function _load_upgradeInteractive() { + return _upgradeInteractive = __webpack_require__(362); +} + +var _packageLinker; + +function _load_packageLinker() { + return _packageLinker = __webpack_require__(211); +} + +var _constants; + +function _load_constants() { + return _constants = __webpack_require__(8); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(6)); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class GlobalAdd extends (_add || _load_add()).Add { + constructor(args, flags, config, reporter, lockfile) { + super(args, flags, config, reporter, lockfile); + + this.linker.setTopLevelBinLinking(false); + } + + maybeOutputSaveTree() { + for (var _iterator = this.addedPatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { @@ -64634,37 +37777,572 @@ var PackageReference = function () { _ref = _i.value; } - var selfPattern = _ref; + const pattern = _ref; - // remove ourselves from the resolver - this.resolver.removePattern(selfPattern); + const manifest = this.resolver.getStrictResolvedPattern(pattern); + ls(manifest, this.reporter, true); } - }; + return Promise.resolve(); + } - PackageReference.prototype.addDependencies = function addDependencies(deps) { - this.dependencies = this.dependencies.concat(deps); - }; + _logSuccessSaveLockfile() { + // noop + } +} - PackageReference.prototype.setPermission = function setPermission(key, val) { - this.permissions[key] = val; - }; +const path = __webpack_require__(0); - PackageReference.prototype.hasPermission = function hasPermission(key) { - if (key in this.permissions) { - return this.permissions[key]; +function hasWrapper(flags, args) { + return args[0] !== 'bin' && args[0] !== 'dir'; +} + +function ls(manifest, reporter, saved) { + const bins = manifest.bin ? Object.keys(manifest.bin) : []; + const human = `${manifest.name}@${manifest.version}`; + if (bins.length) { + if (saved) { + reporter.success(reporter.lang('packageInstalledWithBinaries', human)); } else { - return false; + reporter.info(reporter.lang('packageHasBinaries', human)); } - }; + reporter.list(`bins-${manifest.name}`, bins); + } else if (saved) { + reporter.warn(reporter.lang('packageHasNoBinaries', human)); + } +} - PackageReference.prototype.addPattern = function addPattern(pattern, manifest) { - this.resolver.addPattern(pattern, manifest); +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('global', { + add(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield updateCwd(config); - this.patterns.push(pattern); + const updateBins = yield initUpdateBins(config, reporter, flags); + if (args.indexOf('yarn') !== -1) { + reporter.warn(reporter.lang('packageContainsYarnAsGlobal')); + } - var shrunk = this.lockfile.getLocked(pattern); - if (shrunk && shrunk.permissions) { - for (var _iterator2 = (0, (_misc || _load_misc()).entries)(shrunk.permissions), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + // install module + const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); + const install = new GlobalAdd(args, flags, config, reporter, lockfile); + yield install.init(); + + // link binaries + yield updateBins(); + })(); + }, + + bin(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + reporter.log((yield getBinFolder(config, flags)), { force: true }); + })(); + }, + + dir(config, reporter, flags, args) { + reporter.log(config.globalFolder, { force: true }); + return Promise.resolve(); + }, + + ls(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + reporter.warn(`\`yarn global ls\` is deprecated. Please use \`yarn global list\`.`); + yield list(config, reporter, flags, args); + })(); + }, + + list(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield list(config, reporter, flags, args); + })(); + }, + + remove(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield updateCwd(config); + + const updateBins = yield initUpdateBins(config, reporter, flags); + + // remove module + yield (0, (_remove || _load_remove()).run)(config, reporter, flags, args); + + // remove binaries + yield updateBins(); + })(); + }, + + upgrade(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield updateCwd(config); + + const updateBins = yield initUpdateBins(config, reporter, flags); + + // upgrade module + yield (0, (_upgrade || _load_upgrade()).run)(config, reporter, flags, args); + + // update binaries + yield updateBins(); + })(); + }, + + upgradeInteractive(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield updateCwd(config); + + const updateBins = yield initUpdateBins(config, reporter, flags); + + // upgrade module + yield (0, (_upgradeInteractive || _load_upgradeInteractive()).run)(config, reporter, flags, args); + + // update binaries + yield updateBins(); + })(); + } +}); + +const run = _buildSubCommands.run, + _setFlags = _buildSubCommands.setFlags; +exports.run = run; +function setFlags(commander) { + _setFlags(commander); + commander.description('Installs packages globally on your operating system.'); + commander.option('--prefix ', 'bin prefix to use to install binaries'); + commander.option('--latest', 'upgrade to the latest version of packages'); +} + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _path; + +function _load_path() { + return _path = _interopRequireDefault(__webpack_require__(0)); +} + +var _invariant; + +function _load_invariant() { + return _invariant = _interopRequireDefault(__webpack_require__(9)); +} + +var _semver; + +function _load_semver() { + return _semver = _interopRequireDefault(__webpack_require__(21)); +} + +var _validate; + +function _load_validate() { + return _validate = __webpack_require__(125); +} + +var _lockfile; + +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(19)); +} + +var _packageReference; + +function _load_packageReference() { + return _packageReference = _interopRequireDefault(__webpack_require__(365)); +} + +var _index; + +function _load_index() { + return _index = __webpack_require__(78); +} + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); +} + +var _constants; + +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} + +var _version; + +function _load_version() { + return _version = _interopRequireWildcard(__webpack_require__(226)); +} + +var _workspaceResolver; + +function _load_workspaceResolver() { + return _workspaceResolver = _interopRequireDefault(__webpack_require__(569)); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(6)); +} + +var _normalizePattern4; + +function _load_normalizePattern() { + return _normalizePattern4 = __webpack_require__(37); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const micromatch = __webpack_require__(114); + +class PackageRequest { + constructor(req, resolver) { + this.parentRequest = req.parentRequest; + this.parentNames = req.parentNames || []; + this.lockfile = resolver.lockfile; + this.registry = req.registry; + this.reporter = resolver.reporter; + this.resolver = resolver; + this.optional = req.optional; + this.hint = req.hint; + this.pattern = req.pattern; + this.config = resolver.config; + this.foundInfo = null; + } + + init() { + this.resolver.usedRegistries.add(this.registry); + } + + getLocked(remoteType) { + // always prioritise root lockfile + const shrunk = this.lockfile.getLocked(this.pattern); + + if (shrunk && shrunk.resolved) { + const resolvedParts = (_version || _load_version()).explodeHashedUrl(shrunk.resolved); + + // Detect Git protocols (git://HOST/PATH or git+PROTOCOL://HOST/PATH) + const preferredRemoteType = /^git(\+[a-z0-9]+)?:\/\//.test(resolvedParts.url) ? 'git' : remoteType; + + return { + name: shrunk.name, + version: shrunk.version, + _uid: shrunk.uid, + _remote: { + resolved: shrunk.resolved, + type: preferredRemoteType, + reference: resolvedParts.url, + hash: resolvedParts.hash, + integrity: shrunk.integrity, + registry: shrunk.registry, + packageName: shrunk.name + }, + optionalDependencies: shrunk.optionalDependencies || {}, + dependencies: shrunk.dependencies || {}, + prebuiltVariants: shrunk.prebuiltVariants || {} + }; + } else { + return null; + } + } + + /** + * If the input pattern matches a registry one then attempt to find it on the registry. + * Otherwise fork off to an exotic resolver if one matches. + */ + + findVersionOnRegistry(pattern) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _ref = yield _this.normalize(pattern); + + const range = _ref.range, + name = _ref.name; + + + const exoticResolver = (0, (_index || _load_index()).getExoticResolver)(range); + if (exoticResolver) { + let data = yield _this.findExoticVersionInfo(exoticResolver, range); + + // clone data as we're manipulating it in place and this could be resolved multiple + // times + data = Object.assign({}, data); + + // this is so the returned package response uses the overridden name. ie. if the + // package's actual name is `bar`, but it's been specified in the manifest like: + // "foo": "http://foo.com/bar.tar.gz" + // then we use the foo name + data.name = name; + return data; + } + + const Resolver = _this.getRegistryResolver(); + const resolver = new Resolver(_this, name, range); + try { + return yield resolver.resolve(); + } catch (err) { + // if it is not an error thrown by yarn and it has a parent request, + // thow a more readable error + if (!(err instanceof (_errors || _load_errors()).MessageError) && _this.parentRequest && _this.parentRequest.pattern) { + throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('requiredPackageNotFoundRegistry', pattern, _this.parentRequest.pattern, _this.registry)); + } + throw err; + } + })(); + } + + /** + * Get the registry resolver associated with this package request. + */ + + getRegistryResolver() { + const Resolver = (_index || _load_index()).registries[this.registry]; + if (Resolver) { + return Resolver; + } else { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('unknownRegistryResolver', this.registry)); + } + } + + normalizeRange(pattern) { + var _this2 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (pattern.indexOf(':') > -1 || pattern.indexOf('@') > -1 || (0, (_index || _load_index()).getExoticResolver)(pattern)) { + return pattern; + } + + if (!(_semver || _load_semver()).default.validRange(pattern)) { + try { + if (yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(_this2.config.cwd, pattern, (_constants || _load_constants()).NODE_PACKAGE_JSON))) { + _this2.reporter.warn(_this2.reporter.lang('implicitFileDeprecated', pattern)); + return `file:${pattern}`; + } + } catch (err) { + // pass + } + } + + return pattern; + })(); + } + + normalize(pattern) { + var _this3 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _normalizePattern = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern); + + const name = _normalizePattern.name, + range = _normalizePattern.range, + hasVersion = _normalizePattern.hasVersion; + + const newRange = yield _this3.normalizeRange(range); + return { name, range: newRange, hasVersion }; + })(); + } + + /** + * Construct an exotic resolver instance with the input `ExoticResolver` and `range`. + */ + + findExoticVersionInfo(ExoticResolver, range) { + const resolver = new ExoticResolver(this, range); + return resolver.resolve(); + } + + /** + * If the current pattern matches an exotic resolver then delegate to it or else try + * the registry. + */ + + findVersionInfo() { + var _this4 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const exoticResolver = (0, (_index || _load_index()).getExoticResolver)(_this4.pattern); + if (exoticResolver) { + return _this4.findExoticVersionInfo(exoticResolver, _this4.pattern); + } else if ((_workspaceResolver || _load_workspaceResolver()).default.isWorkspace(_this4.pattern, _this4.resolver.workspaceLayout)) { + (0, (_invariant || _load_invariant()).default)(_this4.resolver.workspaceLayout, 'expected workspaceLayout'); + const resolver = new (_workspaceResolver || _load_workspaceResolver()).default(_this4, _this4.pattern, _this4.resolver.workspaceLayout); + let manifest; + if (_this4.config.focus && !_this4.pattern.includes(_this4.resolver.workspaceLayout.virtualManifestName) && !_this4.pattern.startsWith(_this4.config.focusedWorkspaceName + '@')) { + const localInfo = _this4.resolver.workspaceLayout.getManifestByPattern(_this4.pattern); + (0, (_invariant || _load_invariant()).default)(localInfo, 'expected local info for ' + _this4.pattern); + const localManifest = localInfo.manifest; + const requestPattern = localManifest.name + '@' + localManifest.version; + manifest = yield _this4.findVersionOnRegistry(requestPattern); + } + return resolver.resolve(manifest); + } else { + return _this4.findVersionOnRegistry(_this4.pattern); + } + })(); + } + + reportResolvedRangeMatch(info, resolved) {} + + /** + * Do the final resolve of a package that had a match with an existing version. + * After all unique versions have been discovered, so the best available version + * is found. + */ + resolveToExistingVersion(info) { + // get final resolved version + var _normalizePattern2 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(this.pattern); + + const range = _normalizePattern2.range, + name = _normalizePattern2.name; + + const solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; + const resolved = this.resolver.getHighestRangeVersionMatch(name, solvedRange, info); + (0, (_invariant || _load_invariant()).default)(resolved, 'should have a resolved reference'); + + this.reportResolvedRangeMatch(info, resolved); + const ref = resolved._reference; + (0, (_invariant || _load_invariant()).default)(ref, 'Resolved package info has no package reference'); + ref.addRequest(this); + ref.addPattern(this.pattern, resolved); + ref.addOptional(this.optional); + } + + /** + * TODO description + */ + find({ fresh, frozen }) { + var _this5 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // find version info for this package pattern + const info = yield _this5.findVersionInfo(); + + if (!(_semver || _load_semver()).default.valid(info.version)) { + throw new (_errors || _load_errors()).MessageError(_this5.reporter.lang('invalidPackageVersion', info.name, info.version)); + } + + info.fresh = fresh; + (0, (_validate || _load_validate()).cleanDependencies)(info, false, _this5.reporter, function () { + // swallow warnings + }); + + // check if while we were resolving this dep we've already resolved one that satisfies + // the same range + + var _normalizePattern3 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(_this5.pattern); + + const range = _normalizePattern3.range, + name = _normalizePattern3.name; + + const solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; + const resolved = !info.fresh || frozen ? _this5.resolver.getExactVersionMatch(name, solvedRange, info) : _this5.resolver.getHighestRangeVersionMatch(name, solvedRange, info); + + if (resolved) { + _this5.resolver.reportPackageWithExistingVersion(_this5, info); + return; + } + + if (info.flat && !_this5.resolver.flat) { + throw new (_errors || _load_errors()).MessageError(_this5.reporter.lang('flatGlobalError', `${info.name}@${info.version}`)); + } + + // validate version info + PackageRequest.validateVersionInfo(info, _this5.reporter); + + // + const remote = info._remote; + (0, (_invariant || _load_invariant()).default)(remote, 'Missing remote'); + + // set package reference + const ref = new (_packageReference || _load_packageReference()).default(_this5, info, remote); + ref.addPattern(_this5.pattern, info); + ref.addOptional(_this5.optional); + ref.setFresh(fresh); + info._reference = ref; + info._remote = remote; + // start installation of dependencies + const promises = []; + const deps = []; + const parentNames = [..._this5.parentNames, name]; + // normal deps + for (const depName in info.dependencies) { + const depPattern = depName + '@' + info.dependencies[depName]; + deps.push(depPattern); + promises.push(_this5.resolver.find({ + pattern: depPattern, + registry: remote.registry, + // dependencies of optional dependencies should themselves be optional + optional: _this5.optional, + parentRequest: _this5, + parentNames + })); + } + + // optional deps + for (const depName in info.optionalDependencies) { + const depPattern = depName + '@' + info.optionalDependencies[depName]; + deps.push(depPattern); + promises.push(_this5.resolver.find({ + hint: 'optional', + pattern: depPattern, + registry: remote.registry, + optional: true, + parentRequest: _this5, + parentNames + })); + } + if (remote.type === 'workspace' && !_this5.config.production) { + // workspaces support dev dependencies + for (const depName in info.devDependencies) { + const depPattern = depName + '@' + info.devDependencies[depName]; + deps.push(depPattern); + promises.push(_this5.resolver.find({ + hint: 'dev', + pattern: depPattern, + registry: remote.registry, + optional: false, + parentRequest: _this5, + parentNames + })); + } + } + + for (var _iterator = promises, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + const promise = _ref2; + + yield promise; + } + + ref.addDependencies(deps); + + // Now that we have all dependencies, it's safe to propagate optional + for (var _iterator2 = ref.requests.slice(1), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref3; if (_isArray2) { @@ -64676,33 +38354,176 @@ var PackageReference = function () { _ref3 = _i2.value; } - var _ref2 = _ref3; - var _key = _ref2[0]; - var perm = _ref2[1]; + const otherRequest = _ref3; - this.setPermission(_key, perm); + ref.addOptional(otherRequest.optional); + } + })(); + } + + /** + * TODO description + */ + + static validateVersionInfo(info, reporter) { + // human readable name to use in errors + const human = `${info.name}@${info.version}`; + + info.version = PackageRequest.getPackageVersion(info); + + for (var _iterator3 = (_constants || _load_constants()).REQUIRED_PACKAGE_KEYS, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + const key = _ref4; + + if (!info[key]) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('missingRequiredPackageKey', human, key)); } } - }; + } - PackageReference.prototype.addOptional = function addOptional(optional) { - if (this.optional == null) { - // optional is uninitialised - this.optional = optional; - } else if (!optional) { - // otherwise, ignore all subsequent optional assignments and only accept ones making - // this not optional - this.optional = false; - } - }; + /** + * Returns the package version if present, else defaults to the uid + */ - return PackageReference; -}(); + static getPackageVersion(info) { + // TODO possibly reconsider this behaviour + return info.version === undefined ? info._uid : info.version; + } -exports.default = PackageReference; + /** + * Gets all of the outdated packages and sorts them appropriately + */ + + static getOutdatedPackages(lockfile, install, config, reporter, filterByPatterns, flags) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _ref5 = yield install.fetchRequestFromCwd(); + + const reqPatterns = _ref5.requests, + workspaceLayout = _ref5.workspaceLayout; + + // Filter out workspace patterns if necessary + + let depReqPatterns = workspaceLayout ? reqPatterns.filter(function (p) { + return !workspaceLayout.getManifestByPattern(p.pattern); + }) : reqPatterns; + + // filter the list down to just the packages requested. + // prevents us from having to query the metadata for all packages. + if (filterByPatterns && filterByPatterns.length || flags && flags.pattern) { + const filterByNames = filterByPatterns && filterByPatterns.length ? filterByPatterns.map(function (pattern) { + return (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern).name; + }) : []; + depReqPatterns = depReqPatterns.filter(function (dep) { + return filterByNames.indexOf((0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(dep.pattern).name) >= 0 || flags && flags.pattern && micromatch.contains((0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(dep.pattern).name, flags.pattern); + }); + } + + const deps = yield Promise.all(depReqPatterns.map((() => { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ({ pattern, hint, workspaceName, workspaceLoc }) { + const locked = lockfile.getLocked(pattern); + if (!locked) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('lockfileOutdated')); + } + + const name = locked.name, + current = locked.version; + + let latest = ''; + let wanted = ''; + let url = ''; + + const normalized = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern); + + if ((0, (_index || _load_index()).getExoticResolver)(pattern) || (0, (_index || _load_index()).getExoticResolver)(normalized.range)) { + latest = wanted = 'exotic'; + url = normalized.range; + } else { + const registry = config.registries[locked.registry]; + + var _ref7 = yield registry.checkOutdated(config, name, normalized.range); + + latest = _ref7.latest; + wanted = _ref7.wanted; + url = _ref7.url; + } + + return { + name, + current, + wanted, + latest, + url, + hint, + range: normalized.range, + upgradeTo: '', + workspaceName: workspaceName || '', + workspaceLoc: workspaceLoc || '' + }; + }); + + return function (_x) { + return _ref6.apply(this, arguments); + }; + })())); + + // Make sure to always output `exotic` versions to be compatible with npm + const isDepOld = function isDepOld({ current, latest, wanted }) { + return latest === 'exotic' || (_semver || _load_semver()).default.lt(current, wanted) || (_semver || _load_semver()).default.lt(current, latest); + }; + const orderByName = function orderByName(depA, depB) { + return depA.name.localeCompare(depB.name); + }; + return deps.filter(isDepOld).sort(orderByName); + })(); + } +} +exports.default = PackageRequest; /***/ }), -/* 309 */ +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +class BaseResolver { + constructor(request, fragment) { + this.resolver = request.resolver; + this.reporter = request.reporter; + this.fragment = fragment; + this.registry = request.registry; + this.request = request; + this.pattern = request.pattern; + this.config = request.config; + } + + fork(Resolver, resolveArg, ...args) { + const resolver = new Resolver(this.request, ...args); + resolver.registry = this.registry; + return resolver.resolve(resolveArg); + } + + resolve(resolveArg) { + throw new Error('Not implemented'); + } +} +exports.default = BaseResolver; + +/***/ }), +/* 124 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -64718,171 +38539,73 @@ function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - var _index; function _load_index() { - return _index = __webpack_require__(75); + return _index = __webpack_require__(78); } -var _packageRequest; +var _misc; -function _load_packageRequest() { - return _packageRequest = _interopRequireDefault(__webpack_require__(116)); +function _load_misc() { + return _misc = _interopRequireWildcard(__webpack_require__(18)); } -var _normalizePattern2; +var _version; -function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(52); +function _load_version() { + return _version = _interopRequireWildcard(__webpack_require__(226)); } -var _requestManager; +var _guessName; -function _load_requestManager() { - return _requestManager = _interopRequireDefault(__webpack_require__(321)); +function _load_guessName() { + return _guessName = _interopRequireDefault(__webpack_require__(169)); } -var _blockingQueue; +var _index2; -function _load_blockingQueue() { - return _blockingQueue = _interopRequireDefault(__webpack_require__(157)); +function _load_index2() { + return _index2 = __webpack_require__(57); } -var _lockfile; +var _exoticResolver; -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); +function _load_exoticResolver() { + return _exoticResolver = _interopRequireDefault(__webpack_require__(89)); } -var _map; +var _git; -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(51)); +function _load_git() { + return _git = _interopRequireDefault(__webpack_require__(219)); } -var _workspaceLayout; - -function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(87)); -} - -var _resolutionMap; - -function _load_resolutionMap() { - return _resolutionMap = _interopRequireDefault(__webpack_require__(203)); -} - -var _resolutionMap2; - -function _load_resolutionMap2() { - return _resolutionMap2 = __webpack_require__(203); -} +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var invariant = __webpack_require__(15); +const urlParse = __webpack_require__(24).parse; -var semver = __webpack_require__(27); +const GIT_HOSTS = ['github.com', 'gitlab.com', 'bitbucket.com', 'bitbucket.org']; -var PackageResolver = function () { - function PackageResolver(config, lockfile) { - var resolutionMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_resolutionMap || _load_resolutionMap()).default(config); - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageResolver); +const GIT_PATTERN_MATCHERS = [/^git:/, /^git\+.+:/, /^ssh:/, /^https?:.+\.git$/, /^https?:.+\.git#.+/]; - this.patternsByPackage = (0, (_map || _load_map()).default)(); - this.fetchingPatterns = new (_set || _load_set()).default(); - this.fetchingQueue = new (_blockingQueue || _load_blockingQueue()).default('resolver fetching'); - this.patterns = (0, (_map || _load_map()).default)(); - this.resolutionMap = resolutionMap; - this.usedRegistries = new (_set || _load_set()).default(); - this.flat = false; +class GitResolver extends (_exoticResolver || _load_exoticResolver()).default { + constructor(request, fragment) { + super(request, fragment); - this.reporter = config.reporter; - this.lockfile = lockfile; - this.config = config; - this.delayedResolveQueue = []; + var _versionUtil$explodeH = (_version || _load_version()).explodeHashedUrl(fragment); + + const url = _versionUtil$explodeH.url, + hash = _versionUtil$explodeH.hash; + + this.url = url; + this.hash = hash; } - // whether the dependency graph will be flattened - - - // list of registries that have been used in this resolution - - - // activity monitor - - - // patterns we've already resolved or are in the process of resolving - - - // TODO - - - // manages and throttles json api http requests - - - // list of patterns associated with a package - - - // lockfile instance which we can use to retrieve version info - - - // a map of dependency patterns to packages - - - // reporter instance, abstracts out display logic - - - // environment specific config methods and options - - - // list of packages need to be resolved later (they found a matching version in the - // resolver, but better matches can still arrive later in the resolve process) - - - /** - * TODO description - */ - - PackageResolver.prototype.isNewPattern = function isNewPattern(pattern) { - return !!this.patterns[pattern].fresh; - }; - - PackageResolver.prototype.updateManifest = function updateManifest(ref, newPkg) { - // inherit fields - var oldPkg = this.patterns[ref.patterns[0]]; - newPkg._reference = ref; - newPkg._remote = ref.remote; - newPkg.name = oldPkg.name; - newPkg.fresh = oldPkg.fresh; - newPkg.prebuiltVariants = oldPkg.prebuiltVariants; - - // update patterns - for (var _iterator = ref.patterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + static isVersion(pattern) { + for (var _iterator = GIT_PATTERN_MATCHERS, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { @@ -64894,1143 +38617,191 @@ var PackageResolver = function () { _ref = _i.value; } - var pattern = _ref; + const matcher = _ref; - this.patterns[pattern] = newPkg; - } - - return (_promise || _load_promise()).default.resolve(); - }; - - PackageResolver.prototype.updateManifests = function updateManifests(newPkgs) { - for (var _iterator2 = newPkgs, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref2; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } - - var newPkg = _ref2; - - if (newPkg._reference) { - for (var _iterator3 = newPkg._reference.patterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref3; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref3 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref3 = _i3.value; - } - - var pattern = _ref3; - - var oldPkg = this.patterns[pattern]; - newPkg.prebuiltVariants = oldPkg.prebuiltVariants; - - this.patterns[pattern] = newPkg; - } + if (matcher.test(pattern)) { + return true; } } - return (_promise || _load_promise()).default.resolve(); - }; + var _urlParse = urlParse(pattern); - /** - * Given a list of patterns, dedupe them to a list of unique patterns. - */ + const hostname = _urlParse.hostname, + path = _urlParse.path; - PackageResolver.prototype.dedupePatterns = function dedupePatterns(patterns) { - var deduped = []; - var seen = new (_set || _load_set()).default(); - - for (var _iterator4 = patterns, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref4; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref4 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref4 = _i4.value; - } - - var pattern = _ref4; - - var _info = this.getResolvedPattern(pattern); - if (seen.has(_info)) { - continue; - } - - seen.add(_info); - deduped.push(pattern); - } - - return deduped; - }; - - /** - * Get a list of all manifests by topological order. - */ - - PackageResolver.prototype.getTopologicalManifests = function getTopologicalManifests(seedPatterns) { - var _this = this; - - var pkgs = new (_set || _load_set()).default(); - var skip = new (_set || _load_set()).default(); - - var add = function add(seedPatterns) { - for (var _iterator5 = seedPatterns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { - var _ref5; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref5 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref5 = _i5.value; - } - - var pattern = _ref5; - - var pkg = _this.getStrictResolvedPattern(pattern); - if (skip.has(pkg)) { - continue; - } - - var ref = pkg._reference; - invariant(ref, 'expected reference'); - skip.add(pkg); - add(ref.dependencies); - pkgs.add(pkg); - } - }; - - add(seedPatterns); - - return pkgs; - }; - - /** - * Get a list of all manifests by level sort order. - */ - - PackageResolver.prototype.getLevelOrderManifests = function getLevelOrderManifests(seedPatterns) { - var _this2 = this; - - var pkgs = new (_set || _load_set()).default(); - var skip = new (_set || _load_set()).default(); - - var add = function add(seedPatterns) { - var refs = []; - - for (var _iterator6 = seedPatterns, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { - var _ref6; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref6 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref6 = _i6.value; - } - - var pattern = _ref6; - - var pkg = _this2.getStrictResolvedPattern(pattern); - if (skip.has(pkg)) { - continue; - } - - var ref = pkg._reference; - invariant(ref, 'expected reference'); - - refs.push(ref); - skip.add(pkg); - pkgs.add(pkg); - } - - for (var _iterator7 = refs, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) { - var _ref7; - - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref7 = _iterator7[_i7++]; - } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref7 = _i7.value; - } - - var ref = _ref7; - - add(ref.dependencies); - } - }; - - add(seedPatterns); - - return pkgs; - }; - - /** - * Get a list of all package names in the dependency graph. - */ - - PackageResolver.prototype.getAllDependencyNamesByLevelOrder = function getAllDependencyNamesByLevelOrder(seedPatterns) { - var names = new (_set || _load_set()).default(); - for (var _iterator8 = this.getLevelOrderManifests(seedPatterns), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) { - var _ref9; - - if (_isArray8) { - if (_i8 >= _iterator8.length) break; - _ref9 = _iterator8[_i8++]; - } else { - _i8 = _iterator8.next(); - if (_i8.done) break; - _ref9 = _i8.value; - } - - var _ref8 = _ref9; - var _name = _ref8.name; - - names.add(_name); - } - return names; - }; - - /** - * Retrieve all the package info stored for this package name. - */ - - PackageResolver.prototype.getAllInfoForPackageName = function getAllInfoForPackageName(name) { - var patterns = this.patternsByPackage[name] || []; - return this.getAllInfoForPatterns(patterns); - }; - - /** - * Retrieve all the package info stored for a list of patterns. - */ - - PackageResolver.prototype.getAllInfoForPatterns = function getAllInfoForPatterns(patterns) { - var infos = []; - var seen = new (_set || _load_set()).default(); - - for (var _iterator9 = patterns, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) { - var _ref10; - - if (_isArray9) { - if (_i9 >= _iterator9.length) break; - _ref10 = _iterator9[_i9++]; - } else { - _i9 = _iterator9.next(); - if (_i9.done) break; - _ref10 = _i9.value; - } - - var pattern = _ref10; - - var _info2 = this.patterns[pattern]; - if (seen.has(_info2)) { - continue; - } - - seen.add(_info2); - infos.push(_info2); - } - - return infos; - }; - - /** - * Get a flat list of all package info. - */ - - PackageResolver.prototype.getManifests = function getManifests() { - var infos = []; - var seen = new (_set || _load_set()).default(); - - for (var pattern in this.patterns) { - var _info3 = this.patterns[pattern]; - if (seen.has(_info3)) { - continue; - } - - infos.push(_info3); - seen.add(_info3); - } - - return infos; - }; - - /** - * replace pattern in resolver, e.g. `name` is replaced with `name@^1.0.1` - */ - - - PackageResolver.prototype.replacePattern = function replacePattern(pattern, newPattern) { - var pkg = this.getResolvedPattern(pattern); - invariant(pkg, `missing package ${pattern}`); - var ref = pkg._reference; - invariant(ref, 'expected package reference'); - ref.patterns = [newPattern]; - this.addPattern(newPattern, pkg); - this.removePattern(pattern); - }; - - /** - * Make all versions of this package resolve to it. - */ - - PackageResolver.prototype.collapseAllVersionsOfPackage = function collapseAllVersionsOfPackage(name, version) { - var patterns = this.dedupePatterns(this.patternsByPackage[name]); - return this.collapsePackageVersions(name, version, patterns); - }; - - /** - * Make all given patterns resolve to version. - */ - - - PackageResolver.prototype.collapsePackageVersions = function collapsePackageVersions(name, version, patterns) { - var human = `${name}@${version}`; - - // get manifest that matches the version we're collapsing too - var collapseToReference = void 0; - var collapseToManifest = void 0; - var collapseToPattern = void 0; - for (var _iterator10 = patterns, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) { - var _ref11; - - if (_isArray10) { - if (_i10 >= _iterator10.length) break; - _ref11 = _iterator10[_i10++]; - } else { - _i10 = _iterator10.next(); - if (_i10.done) break; - _ref11 = _i10.value; - } - - var pattern = _ref11; - - var _manifest = this.patterns[pattern]; - if (_manifest.version === version) { - collapseToReference = _manifest._reference; - collapseToManifest = _manifest; - collapseToPattern = pattern; - break; - } - } - - invariant(collapseToReference && collapseToManifest && collapseToPattern, `Couldn't find package manifest for ${human}`); - - for (var _iterator11 = patterns, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) { - var _ref12; - - if (_isArray11) { - if (_i11 >= _iterator11.length) break; - _ref12 = _iterator11[_i11++]; - } else { - _i11 = _iterator11.next(); - if (_i11.done) break; - _ref12 = _i11.value; - } - - var _pattern = _ref12; - - // don't touch the pattern we're collapsing to - if (_pattern === collapseToPattern) { - continue; - } - - // remove this pattern - var ref = this.getStrictResolvedPattern(_pattern)._reference; - invariant(ref, 'expected package reference'); - var refPatterns = ref.patterns.slice(); - ref.prune(); - - // add pattern to the manifest we're collapsing to - for (var _iterator12 = refPatterns, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) { - var _ref13; - - if (_isArray12) { - if (_i12 >= _iterator12.length) break; - _ref13 = _iterator12[_i12++]; - } else { - _i12 = _iterator12.next(); - if (_i12.done) break; - _ref13 = _i12.value; - } - - var _pattern2 = _ref13; - - collapseToReference.addPattern(_pattern2, collapseToManifest); - } - } - - return collapseToPattern; - }; - - /** - * TODO description - */ - - PackageResolver.prototype.addPattern = function addPattern(pattern, info) { - this.patterns[pattern] = info; - - var byName = this.patternsByPackage[info.name] = this.patternsByPackage[info.name] || []; - if (byName.indexOf(pattern) === -1) { - byName.push(pattern); - } - }; - - /** - * TODO description - */ - - PackageResolver.prototype.removePattern = function removePattern(pattern) { - var pkg = this.patterns[pattern]; - if (!pkg) { - return; - } - - var byName = this.patternsByPackage[pkg.name]; - if (!byName) { - return; - } - - byName.splice(byName.indexOf(pattern), 1); - delete this.patterns[pattern]; - }; - - /** - * TODO description - */ - - PackageResolver.prototype.getResolvedPattern = function getResolvedPattern(pattern) { - return this.patterns[pattern]; - }; - - /** - * TODO description - */ - - PackageResolver.prototype.getStrictResolvedPattern = function getStrictResolvedPattern(pattern) { - var manifest = this.getResolvedPattern(pattern); - invariant(manifest, 'expected manifest'); - return manifest; - }; - - /** - * TODO description - */ - - PackageResolver.prototype.getExactVersionMatch = function getExactVersionMatch(name, version, manifest) { - var patterns = this.patternsByPackage[name]; - if (!patterns) { - return null; - } - - for (var _iterator13 = patterns, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) { - var _ref14; - - if (_isArray13) { - if (_i13 >= _iterator13.length) break; - _ref14 = _iterator13[_i13++]; - } else { - _i13 = _iterator13.next(); - if (_i13.done) break; - _ref14 = _i13.value; - } - - var pattern = _ref14; - - var _info4 = this.getStrictResolvedPattern(pattern); - if (_info4.version === version) { - return _info4; - } - } - - if (manifest && (0, (_index || _load_index()).getExoticResolver)(version)) { - return this.exoticRangeMatch(patterns.map(this.getStrictResolvedPattern.bind(this)), manifest); - } - - return null; - }; - - /** - * Get the manifest of the highest known version that satisfies a package range - */ - - PackageResolver.prototype.getHighestRangeVersionMatch = function getHighestRangeVersionMatch(name, range, manifest) { - var _this3 = this; - - var patterns = this.patternsByPackage[name]; - - if (!patterns) { - return null; - } - - var versionNumbers = []; - var resolvedPatterns = patterns.map(function (pattern) { - var info = _this3.getStrictResolvedPattern(pattern); - versionNumbers.push(info.version); - - return info; - }); - - var maxValidRange = semver.maxSatisfying(versionNumbers, range); - - if (!maxValidRange) { - return manifest && (0, (_index || _load_index()).getExoticResolver)(range) ? this.exoticRangeMatch(resolvedPatterns, manifest) : null; - } - - var indexOfmaxValidRange = versionNumbers.indexOf(maxValidRange); - var maxValidRangeManifest = resolvedPatterns[indexOfmaxValidRange]; - - return maxValidRangeManifest; - }; - - /** - * Get the manifest of the package that matches an exotic range - */ - - PackageResolver.prototype.exoticRangeMatch = function exoticRangeMatch(resolvedPkgs, manifest) { - var remote = manifest._remote; - if (!(remote && remote.reference && remote.type === 'copy')) { - return null; - } - - var matchedPkg = resolvedPkgs.find(function (_ref15) { - var pkgRemote = _ref15._remote; - return pkgRemote && pkgRemote.reference === remote.reference && pkgRemote.type === 'copy'; - }); - - if (matchedPkg) { - manifest._remote = matchedPkg._remote; - } - - return matchedPkg; - }; - - /** - * Determine if LockfileEntry is incorrect, remove it from lockfile cache and consider the pattern as new - */ - - - PackageResolver.prototype.isLockfileEntryOutdated = function isLockfileEntryOutdated(version, range, hasVersion) { - return !!(semver.validRange(range) && semver.valid(version) && !(0, (_index || _load_index()).getExoticResolver)(range) && hasVersion && !semver.satisfies(version, range)); - }; - - /** - * TODO description - */ - - PackageResolver.prototype.find = function () { - var _ref16 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (initialReq) { - var req = this.resolveToResolution(initialReq); - - // we've already resolved it with a resolution - if (!req) { - return; - } - - var request = new (_packageRequest || _load_packageRequest()).default(req, this); - var fetchKey = `${req.registry}:${req.pattern}:${String(req.optional)}`; - var initialFetch = !this.fetchingPatterns.has(fetchKey); - var fresh = false; - - if (this.activity) { - this.activity.tick(req.pattern); - } - - if (initialFetch) { - this.fetchingPatterns.add(fetchKey); - - var lockfileEntry = this.lockfile.getLocked(req.pattern); - - if (lockfileEntry) { - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(req.pattern), - range = _normalizePattern.range, - hasVersion = _normalizePattern.hasVersion; - - if (this.isLockfileEntryOutdated(lockfileEntry.version, range, hasVersion)) { - this.reporter.warn(this.reporter.lang('incorrectLockfileEntry', req.pattern)); - this.removePattern(req.pattern); - this.lockfile.removePattern(req.pattern); - fresh = true; - } - } else { - fresh = true; - } - - request.init(); - } - - yield request.find({ fresh, frozen: this.frozen }); - }); - - function find(_x2) { - return _ref16.apply(this, arguments); - } - - return find; - }(); - - /** - * TODO description - */ - - PackageResolver.prototype.init = function () { - var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (deps) { - var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - isFlat: false, - isFrozen: false, - workspaceLayout: undefined - }, - isFlat = _ref18.isFlat, - isFrozen = _ref18.isFrozen, - workspaceLayout = _ref18.workspaceLayout; - - this.flat = Boolean(isFlat); - this.frozen = Boolean(isFrozen); - this.workspaceLayout = workspaceLayout; - var activity = this.activity = this.reporter.activity(); - - for (var _iterator14 = deps, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) { - var _ref19; - - if (_isArray14) { - if (_i14 >= _iterator14.length) break; - _ref19 = _iterator14[_i14++]; - } else { - _i14 = _iterator14.next(); - if (_i14.done) break; - _ref19 = _i14.value; - } - - var _req = _ref19; - - yield this.find(_req); - } - - // all required package versions have been discovered, so now packages that - // resolved to existing versions can be resolved to their best available version - this.resolvePackagesWithExistingVersions(); - - for (var _iterator15 = this.resolutionMap.delayQueue, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) { - var _ref20; - - if (_isArray15) { - if (_i15 >= _iterator15.length) break; - _ref20 = _iterator15[_i15++]; - } else { - _i15 = _iterator15.next(); - if (_i15.done) break; - _ref20 = _i15.value; - } - - var _req2 = _ref20; - - this.resolveToResolution(_req2); - } - - if (isFlat) { - for (var _iterator16 = deps, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator16);;) { - var _ref21; - - if (_isArray16) { - if (_i16 >= _iterator16.length) break; - _ref21 = _iterator16[_i16++]; - } else { - _i16 = _iterator16.next(); - if (_i16.done) break; - _ref21 = _i16.value; - } - - var dep = _ref21; - - var _name2 = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(dep.pattern).name; - this.optimizeResolutions(_name2); - } - } - - activity.end(); - this.activity = null; - }); - - function init(_x3) { - return _ref17.apply(this, arguments); - } - - return init; - }(); - - // for a given package, see if a single manifest can satisfy all ranges - - - PackageResolver.prototype.optimizeResolutions = function optimizeResolutions(name) { - var _this4 = this; - - var patterns = this.dedupePatterns(this.patternsByPackage[name] || []); - - // don't optimize things that already have a lockfile entry: - // https://github.com/yarnpkg/yarn/issues/79 - var collapsablePatterns = patterns.filter(function (pattern) { - var remote = _this4.patterns[pattern]._remote; - return !_this4.lockfile.getLocked(pattern) && (!remote || remote.type !== 'workspace'); - }); - if (collapsablePatterns.length < 2) { - return; - } - - // reverse sort, so we'll find the maximum satisfying version first - var availableVersions = this.getAllInfoForPatterns(collapsablePatterns).map(function (manifest) { - return manifest.version; - }); - availableVersions.sort(semver.rcompare); - - var ranges = collapsablePatterns.map(function (pattern) { - return (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern).range; - }); - - // find the most recent version that satisfies all patterns (if one exists), and - // collapse to that version. - - var _loop = function _loop(version) { - if (ranges.every(function (range) { - return semver.satisfies(version, range); - })) { - _this4.collapsePackageVersions(name, version, collapsablePatterns); - return { - v: void 0 - }; - } - }; - - for (var _iterator17 = availableVersions, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator17);;) { - var _ref22; - - if (_isArray17) { - if (_i17 >= _iterator17.length) break; - _ref22 = _iterator17[_i17++]; - } else { - _i17 = _iterator17.next(); - if (_i17.done) break; - _ref22 = _i17.value; - } - - var version = _ref22; - - var _ret = _loop(version); - - if (typeof _ret === "object") return _ret.v; - } - }; - - /** - * Called by the package requester for packages that this resolver already had - * a matching version for. Delay the resolve, because better matches can still be - * discovered. - */ - - PackageResolver.prototype.reportPackageWithExistingVersion = function reportPackageWithExistingVersion(req, info) { - this.delayedResolveQueue.push({ req, info }); - }; - - /** - * Executes the resolve to existing versions for packages after the find process, - * when all versions that are going to be used have been discovered. - */ - - PackageResolver.prototype.resolvePackagesWithExistingVersions = function resolvePackagesWithExistingVersions() { - for (var _iterator18 = this.delayedResolveQueue, _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator18);;) { - var _ref24; - - if (_isArray18) { - if (_i18 >= _iterator18.length) break; - _ref24 = _iterator18[_i18++]; - } else { - _i18 = _iterator18.next(); - if (_i18.done) break; - _ref24 = _i18.value; - } - - var _ref23 = _ref24; - var _req3 = _ref23.req, - _info5 = _ref23.info; - - _req3.resolveToExistingVersion(_info5); - } - }; - - PackageResolver.prototype.resolveToResolution = function resolveToResolution(req) { - var parentNames = req.parentNames, - pattern = req.pattern; - - - if (!parentNames || this.flat) { - return req; - } - - var resolution = this.resolutionMap.find(pattern, parentNames); - - if (resolution) { - var resolutionManifest = this.getResolvedPattern(resolution); - - if (resolutionManifest) { - invariant(resolutionManifest._reference, 'resolutions should have a resolved reference'); - resolutionManifest._reference.patterns.push(pattern); - this.addPattern(pattern, resolutionManifest); - var lockManifest = this.lockfile.getLocked(pattern); - if ((0, (_resolutionMap2 || _load_resolutionMap2()).shouldUpdateLockfile)(lockManifest, resolutionManifest._reference)) { - this.lockfile.removePattern(pattern); - } - } else { - this.resolutionMap.addToDelayQueue(req); - } - return null; - } - - return req; - }; - - return PackageResolver; -}(); - -exports.default = PackageResolver; - -/***/ }), -/* 310 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -var _hostedGitResolver; - -function _load_hostedGitResolver() { - return _hostedGitResolver = _interopRequireDefault(__webpack_require__(99)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var GitHubResolver = function (_HostedGitResolver) { - (0, (_inherits2 || _load_inherits()).default)(GitHubResolver, _HostedGitResolver); - - function GitHubResolver() { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GitHubResolver); - return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _HostedGitResolver.apply(this, arguments)); - } - - GitHubResolver.isVersion = function isVersion(pattern) { - // github proto - if (pattern.startsWith('github:')) { - return true; - } - - // github shorthand - if (/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(pattern)) { - return true; + if (hostname && path && GIT_HOSTS.indexOf(hostname) >= 0) { + // only if dependency is pointing to a git repo, + // e.g. facebook/flow and not file in a git repo facebook/flow/archive/v1.0.0.tar.gz + return path.split('/').filter(p => !!p).length === 2; } return false; - }; - - GitHubResolver.getTarballUrl = function getTarballUrl(parts, hash) { - return `https://codeload.${this.hostname}/${parts.user}/${parts.repo}/tar.gz/${hash}`; - }; - - GitHubResolver.getGitSSHUrl = function getGitSSHUrl(parts) { - return `git+ssh://git@${this.hostname}/${parts.user}/${parts.repo}.git` + `${parts.hash ? '#' + decodeURIComponent(parts.hash) : ''}`; - }; - - GitHubResolver.getGitHTTPBaseUrl = function getGitHTTPBaseUrl(parts) { - return `https://${this.hostname}/${parts.user}/${parts.repo}`; - }; - - GitHubResolver.getGitHTTPUrl = function getGitHTTPUrl(parts) { - return `${GitHubResolver.getGitHTTPBaseUrl(parts)}.git`; - }; - - GitHubResolver.getHTTPFileUrl = function getHTTPFileUrl(parts, filename, commit) { - return `https://raw.githubusercontent.com/${parts.user}/${parts.repo}/${commit}/${filename}`; - }; - - return GitHubResolver; -}((_hostedGitResolver || _load_hostedGitResolver()).default); - -GitHubResolver.protocol = 'github'; -GitHubResolver.hostname = 'github.com'; -exports.default = GitHubResolver; - -/***/ }), -/* 311 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.LINK_PROTOCOL_PREFIX = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -var _exoticResolver; - -function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(85)); -} - -var _misc; - -function _load_misc() { - return _misc = _interopRequireWildcard(__webpack_require__(28)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var path = __webpack_require__(1); - -var LINK_PROTOCOL_PREFIX = exports.LINK_PROTOCOL_PREFIX = 'link:'; - -var LinkResolver = function (_ExoticResolver) { - (0, (_inherits2 || _load_inherits()).default)(LinkResolver, _ExoticResolver); - - function LinkResolver(request, fragment) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, LinkResolver); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment)); - - _this.loc = (_misc || _load_misc()).removePrefix(fragment, LINK_PROTOCOL_PREFIX); - return _this; } - LinkResolver.prototype.resolve = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var loc = this.loc; - if (!path.isAbsolute(loc)) { - loc = path.resolve(this.config.lockfileFolder, loc); + resolve(forked) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + let tryRegistry = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) { + const filename = (_index2 || _load_index2()).registries[registry].filename; + + const file = yield client.getFile(filename); + if (!file) { + return null; + } + + const json = yield config.readJson(`${url}/${filename}`, function () { + return JSON.parse(file); + }); + json._uid = commit; + json._remote = { + resolved: `${url}#${commit}`, + type: 'git', + reference: url, + hash: commit, + registry + }; + return json; + }); + + return function tryRegistry(_x) { + return _ref2.apply(this, arguments); + }; + })(); + + const url = _this.url; + + // shortcut for hosted git. we will fallback to a GitResolver if the hosted git + // optimisations fail which the `forked` flag indicates so we don't get into an + // infinite loop + + const parts = urlParse(url); + if (false) { + // check if this git url uses any of the hostnames defined in our hosted git resolvers + for (const name in (_index || _load_index()).hostedGit) { + const Resolver = (_index || _load_index()).hostedGit[name]; + if (Resolver.hostname !== parts.hostname) { + continue; + } + + // we have a match! clean up the pathname of url artifacts + let pathname = parts.pathname; + pathname = (_misc || _load_misc()).removePrefix(pathname, '/'); // remove prefixed slash + pathname = (_misc || _load_misc()).removeSuffix(pathname, '.git'); // remove .git suffix if present + + const url = `${pathname}${_this.hash ? '#' + decodeURIComponent(_this.hash) : ''}`; + return _this.fork(Resolver, false, url); + } } - var name = path.basename(loc); - var registry = 'npm'; + // get from lockfile + const shrunk = _this.request.getLocked('git'); + if (shrunk) { + return shrunk; + } - var manifest = !(yield (_fs || _load_fs()).exists(`${loc}/package.json`)) || loc === this.config.lockfileFolder ? { _uid: '', name, version: '0.0.0', _registry: registry } : yield this.config.readManifest(loc, this.registry); + const config = _this.config; - manifest._remote = { - type: 'link', - registry, - hash: null, - reference: loc + + const gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url); + const client = new (_git || _load_git()).default(config, gitUrl, _this.hash); + const commit = yield client.init(); + + const file = yield tryRegistry(_this.registry); + if (file) { + return file; + } + + for (const registry in (_index2 || _load_index2()).registries) { + if (registry === _this.registry) { + continue; + } + + const file = yield tryRegistry(registry); + if (file) { + return file; + } + } + + return { + // This is just the default, it can be overridden with key of dependencies + name: (0, (_guessName || _load_guessName()).default)(url), + version: '0.0.0', + _uid: commit, + _remote: { + resolved: `${url}#${commit}`, + type: 'git', + reference: url, + hash: commit, + registry: 'npm' + } }; + })(); + } +} +exports.default = GitResolver; - manifest._uid = manifest.version; +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { - return manifest; - }); +"use strict"; - function resolve() { - return _ref.apply(this, arguments); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isValidPackageName = isValidPackageName; + +exports.default = function (info, isRoot, reporter, warn) { + if (isRoot) { + for (const key in (_typos || _load_typos()).default) { + if (key in info) { + warn(reporter.lang('manifestPotentialTypo', key, (_typos || _load_typos()).default[key])); + } + } + } + + // validate name + const name = info.name; + + if (typeof name === 'string') { + if (isRoot && isBuiltinModule(name)) { + warn(reporter.lang('manifestBuiltinModule', name)); } - return resolve; - }(); + // cannot start with a dot + if (name[0] === '.') { + throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameDot')); + } - return LinkResolver; -}((_exoticResolver || _load_exoticResolver()).default); + // cannot contain the following characters + if (!isValidPackageName(name)) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameIllegalChars')); + } -LinkResolver.protocol = 'link'; -exports.default = LinkResolver; - -/***/ }), -/* 312 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (from, to) { - var validFrom = (_semver || _load_semver()).default.valid(from); - var validTo = (_semver || _load_semver()).default.valid(to); - var versionBump = 'unknown'; - if (validFrom && validTo) { - versionBump = (0, (_semver2 || _load_semver2()).diffWithUnstable)(validFrom, validTo) || 'unchanged'; - } - return (_constants || _load_constants()).VERSION_COLOR_SCHEME[versionBump]; -}; - -var _semver; - -function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(27)); -} - -var _semver2; - -function _load_semver2() { - return _semver2 = __webpack_require__(211); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(13); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), -/* 313 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (from, to, reporter) { - var parts = to.split('.'); - var fromParts = from.split('.'); - - var splitIndex = parts.findIndex(function (part, i) { - return part !== fromParts[i]; - }); - if (splitIndex === -1) { - return from; + // cannot equal node_modules or favicon.ico + const lower = name.toLowerCase(); + if (lower === 'node_modules' || lower === 'favicon.ico') { + throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameBlacklisted')); + } } - var colorized = reporter.format.green(parts.slice(splitIndex).join('.')); - return parts.slice(0, splitIndex).concat(colorized).join('.'); -}; + // validate license + if (isRoot && !info.private) { + if (typeof info.license === 'string') { + const license = info.license.replace(/\*$/g, ''); + if (!(0, (_util || _load_util()).isValidLicense)(license)) { + warn(reporter.lang('manifestLicenseInvalid')); + } + } else { + warn(reporter.lang('manifestLicenseNone')); + } + } -/***/ }), -/* 314 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// $FlowFixMe We want this require to be dynamic -exports.dynamicRequire = true ? require : require; // eslint-disable-line - -/***/ }), -/* 315 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -exports.sortFilter = sortFilter; -exports.matchesFilter = matchesFilter; -exports.ignoreLinesToRegex = ignoreLinesToRegex; -exports.filterOverridenGitignores = filterOverridenGitignores; - -var _misc; - -function _load_misc() { - return _misc = __webpack_require__(28); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var mm = __webpack_require__(108); -var path = __webpack_require__(1); - -var WHITESPACE_RE = /^\s+$/; - -function sortFilter(files, filters) { - var keepFiles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_set || _load_set()).default(); - var possibleKeepFiles = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new (_set || _load_set()).default(); - var ignoreFiles = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : new (_set || _load_set()).default(); - - for (var _iterator = files, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + // validate strings + for (var _iterator = strings, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { @@ -66042,68 +38813,74 @@ function sortFilter(files, filters) { _ref = _i.value; } - var file = _ref; + const key = _ref; - var keep = false; - - // always keep a file if a ! pattern matches it - for (var _iterator5 = filters, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { - var _ref5; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref5 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref5 = _i5.value; - } - - var filter = _ref5; - - if (filter.isNegation && matchesFilter(filter, file.basename, file.relative)) { - keep = true; - break; - } - } - - // - if (keep) { - keepFiles.add(file.relative); - continue; - } - - // otherwise don't keep it if a pattern matches it - keep = true; - for (var _iterator6 = filters, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { - var _ref6; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref6 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref6 = _i6.value; - } - - var _filter = _ref6; - - if (!_filter.isNegation && matchesFilter(_filter, file.basename, file.relative)) { - keep = false; - break; - } - } - - if (keep) { - possibleKeepFiles.add(file.relative); - } else { - ignoreFiles.add(file.relative); + const val = info[key]; + if (val && typeof val !== 'string') { + throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestStringExpected', key)); } } - // exclude file - for (var _iterator2 = possibleKeepFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { + cleanDependencies(info, isRoot, reporter, warn); +}; + +exports.cleanDependencies = cleanDependencies; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); +} + +var _util; + +function _load_util() { + return _util = __webpack_require__(221); +} + +var _typos; + +function _load_typos() { + return _typos = _interopRequireDefault(__webpack_require__(587)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const isBuiltinModule = __webpack_require__(730); + +const strings = ['name', 'version']; + +const dependencyKeys = [ +// npm registry will include optionalDependencies in dependencies and we'll want to dedupe them from the +// other fields first +'optionalDependencies', + +// it's seemingly common to include a dependency in dependencies and devDependencies of the same name but +// different ranges, this can cause a lot of issues with our determinism and the behaviour of npm is +// currently unspecified. +'dependencies', 'devDependencies']; + +function isValidName(name) { + return !name.match(/[\/@\s\+%:]/) && encodeURIComponent(name) === name; +} + +function isValidScopedName(name) { + if (name[0] !== '@') { + return false; + } + + const parts = name.slice(1).split('/'); + return parts.length === 2 && isValidName(parts[0]) && isValidName(parts[1]); +} + +function isValidPackageName(name) { + return isValidName(name) || isValidScopedName(name); +} + +function cleanDependencies(info, isRoot, reporter, warn) { + // get dependency objects + const depTypes = []; + for (var _iterator2 = dependencyKeys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref2; if (_isArray2) { @@ -66115,3685 +38892,232 @@ function sortFilter(files, filters) { _ref2 = _i2.value; } - var _file = _ref2; + const type = _ref2; - var parts = path.dirname(_file).split(path.sep); - - while (parts.length) { - var folder = parts.join(path.sep); - if (ignoreFiles.has(folder)) { - ignoreFiles.add(_file); - break; - } - parts.pop(); + const deps = info[type]; + if (!deps || typeof deps !== 'object') { + continue; } + depTypes.push([type, deps]); } - // - for (var _iterator3 = possibleKeepFiles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref3; + // aggregate all non-trivial deps (not '' or '*') + const nonTrivialDeps = new Map(); + for (var _iterator3 = depTypes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; if (_isArray3) { if (_i3 >= _iterator3.length) break; - _ref3 = _iterator3[_i3++]; + _ref4 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; - _ref3 = _i3.value; + _ref4 = _i3.value; } - var _file2 = _ref3; + const _ref3 = _ref4; + const type = _ref3[0]; + const deps = _ref3[1]; - if (!ignoreFiles.has(_file2)) { - keepFiles.add(_file2); + for (var _iterator5 = Object.keys(deps), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref7; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref7 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref7 = _i5.value; + } + + const name = _ref7; + + const version = deps[name]; + if (!nonTrivialDeps.has(name) && version && version !== '*') { + nonTrivialDeps.set(name, { type, version }); + } } } - // - for (var _iterator4 = keepFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref4; + // overwrite first dep of package with non-trivial version, remove the rest + const setDeps = new Set(); + for (var _iterator4 = depTypes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref6; if (_isArray4) { if (_i4 >= _iterator4.length) break; - _ref4 = _iterator4[_i4++]; + _ref6 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; - _ref4 = _i4.value; + _ref6 = _i4.value; } - var _file3 = _ref4; + const _ref5 = _ref6; + const type = _ref5[0]; + const deps = _ref5[1]; - var parts = path.dirname(_file3).split(path.sep); + for (var _iterator6 = Object.keys(deps), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref8; - while (parts.length) { - // deregister this folder from being ignored, any files inside - // will still be marked as ignored - ignoreFiles.delete(parts.join(path.sep)); - parts.pop(); - } - } - - return { ignoreFiles, keepFiles }; -} - -function matchesFilter(filter, basename, loc) { - var filterByBasename = true; - if (filter.base && filter.base !== '.') { - loc = path.relative(filter.base, loc); - filterByBasename = false; - } - // the micromatch regex expects unix path separators - loc = loc.replace(/\\/g, '/'); - - return filter.regex.test(loc) || filter.regex.test(`/${loc}`) || filterByBasename && filter.regex.test(basename) || mm.isMatch(loc, filter.pattern); -} - -function ignoreLinesToRegex(lines) { - var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.'; - - return lines - // create regex - .map(function (line) { - // remove empty lines, comments, etc - if (line === '' || line === '!' || line[0] === '#' || WHITESPACE_RE.test(line)) { - return null; - } - - var pattern = line; - var isNegation = false; - - // hide the fact that it's a negation from minimatch since we'll handle this specifically - // ourselves - if (pattern[0] === '!') { - isNegation = true; - pattern = pattern.slice(1); - } - - // remove trailing slash - pattern = (0, (_misc || _load_misc()).removeSuffix)(pattern, '/'); - - var regex = mm.makeRe(pattern.trim(), { dot: true, nocase: true }); - - if (regex) { - return { - base, - isNegation, - pattern, - regex - }; - } else { - return null; - } - }).filter(Boolean); -} - -function filterOverridenGitignores(files) { - var IGNORE_FILENAMES = ['.yarnignore', '.npmignore', '.gitignore']; - var GITIGNORE_NAME = IGNORE_FILENAMES[2]; - return files.filter(function (file) { - return IGNORE_FILENAMES.indexOf(file.basename) > -1; - }).reduce(function (acc, file) { - if (file.basename !== GITIGNORE_NAME) { - return [].concat(acc, [file]); - } else { - //don't include .gitignore if .npmignore or .yarnignore are present - var dir = path.dirname(file.absolute); - var higherPriorityIgnoreFilePaths = [path.join(dir, IGNORE_FILENAMES[0]), path.join(dir, IGNORE_FILENAMES[1])]; - var hasHigherPriorityFiles = files.find(function (file) { - return higherPriorityIgnoreFilePaths.indexOf(path.normalize(file.absolute)) > -1; - }); - if (!hasHigherPriorityFiles) { - return [].concat(acc, [file]); - } - } - return acc; - }, []); -} - -/***/ }), -/* 316 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.spawn = undefined; - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(42)); -} - -var _path; - -function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(1)); -} - -var _child; - -function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(61)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var BATCH_MODE_ARGS = new (_map || _load_map()).default([['ssh', '-oBatchMode=yes'], ['plink', '-batch']]); - -// Suppress any password prompts since we run these in the background -var env = (0, (_extends2 || _load_extends()).default)({ - GIT_ASKPASS: '', - GIT_TERMINAL_PROMPT: 0 -}, process.env); - -var sshCommand = env.GIT_SSH || 'ssh'; -var sshExecutable = (_path || _load_path()).default.basename(sshCommand.toLowerCase(), '.exe'); -var sshBatchArgs = BATCH_MODE_ARGS.get(sshExecutable); - -if (!env.GIT_SSH_COMMAND && sshBatchArgs) { - // We have to manually specify `GIT_SSH_VARIANT`, - // because it's not automatically set when using `GIT_SSH_COMMAND` instead of `GIT_SSH` - // See: https://github.com/yarnpkg/yarn/issues/4729 - env.GIT_SSH_VARIANT = sshExecutable; - env.GIT_SSH_COMMAND = `"${sshCommand}" ${sshBatchArgs}`; -} - -var spawn = exports.spawn = function spawn(args) { - var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - return (_child || _load_child()).spawn('git', args, (0, (_extends2 || _load_extends()).default)({}, opts, { env })); -}; - -/***/ }), -/* 317 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.callThroughHook = callThroughHook; - - -var YARN_HOOKS_KEY = 'experimentalYarnHooks'; - -function callThroughHook(type, fn, context) { - if (typeof global === 'undefined') { - return fn(); - } - - if (typeof global[YARN_HOOKS_KEY] !== 'object' || !global[YARN_HOOKS_KEY]) { - return fn(); - } - - var hook = global[YARN_HOOKS_KEY][type]; - - if (!hook) { - return fn(); - } - - return hook(fn, context); -} - -/***/ }), -/* 318 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(42)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var lockPromises = new (_map || _load_map()).default(); - -/** - * Acquires a mutex lock over the given key. If the lock can't be acquired, it waits until it's available. - * @param key Key to get the lock for. - * @return {Promise.} A Promise that resolves when the lock is acquired, with the function that - * must be called to release the lock. - */ - -exports.default = function (key) { - var unlockNext = void 0; - var willLock = new (_promise || _load_promise()).default(function (resolve) { - return unlockNext = resolve; - }); - var lockPromise = lockPromises.get(key) || (_promise || _load_promise()).default.resolve(); - var willUnlock = lockPromise.then(function () { - return unlockNext; - }); - lockPromises.set(key, lockPromise.then(function () { - return willLock; - })); - return willUnlock; -}; - -/***/ }), -/* 319 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = parsePackagePath; -exports.isValidPackagePath = isValidPackagePath; - - -/** - * Parse input strings like `package-1/package-2` to an array of packages - */ -function parsePackagePath(input) { - return input.match(/(@[^\/]+\/)?([^/]+)/g) || []; -} - -var WRONG_PATTERNS = /\/$|\/{2,}|\*+$/; - -function isValidPackagePath(input) { - return !WRONG_PATTERNS.test(input); -} - -/***/ }), -/* 320 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getPosixPath = getPosixPath; -exports.resolveWithHome = resolveWithHome; - -var _path; - -function _load_path() { - return _path = __webpack_require__(1); -} - -var userHome = __webpack_require__(101).default; - -function getPosixPath(path) { - return path.replace(/\\/g, '/'); -} - -function resolveWithHome(path) { - var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//; - if (homePattern.test(path)) { - return (0, (_path || _load_path()).resolve)(userHome, path.substr(2)); - } - - return (0, (_path || _load_path()).resolve)(path); -} - -/***/ }), -/* 321 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireDefault(__webpack_require__(12)); -} - -var _http; - -function _load_http() { - return _http = _interopRequireDefault(__webpack_require__(83)); -} - -var _url; - -function _load_url() { - return _url = _interopRequireDefault(__webpack_require__(29)); -} - -var _dnscache; - -function _load_dnscache() { - return _dnscache = _interopRequireDefault(__webpack_require__(692)); -} - -var _invariant; - -function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(15)); -} - -var _requestCaptureHar; - -function _load_requestCaptureHar() { - return _requestCaptureHar = _interopRequireDefault(__webpack_require__(871)); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _blockingQueue; - -function _load_blockingQueue() { - return _blockingQueue = _interopRequireDefault(__webpack_require__(157)); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); -} - -var _network; - -function _load_network() { - return _network = _interopRequireWildcard(__webpack_require__(276)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(51)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// Initialize DNS cache so we don't look up the same -// domains like registry.yarnpkg.com over and over again -// for each request. -(0, (_dnscache || _load_dnscache()).default)({ - enable: true, - ttl: 300, - cachesize: 10 -}); - -var successHosts = (0, (_map || _load_map()).default)(); -var controlOffline = (_network || _load_network()).isOffline(); - -var RequestManager = function () { - function RequestManager(reporter) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, RequestManager); - - this.offlineNoRequests = false; - this._requestCaptureHar = null; - this._requestModule = null; - this.offlineQueue = []; - this.captureHar = false; - this.httpsProxy = ''; - this.ca = null; - this.httpProxy = ''; - this.strictSSL = true; - this.userAgent = ''; - this.reporter = reporter; - this.running = 0; - this.queue = []; - this.cache = {}; - this.max = (_constants || _load_constants()).NETWORK_CONCURRENCY; - this.maxRetryAttempts = 5; - } - - RequestManager.prototype.setOptions = function setOptions(opts) { - if (opts.userAgent != null) { - this.userAgent = opts.userAgent; - } - - if (opts.offline != null) { - this.offlineNoRequests = opts.offline; - } - - if (opts.captureHar != null) { - this.captureHar = opts.captureHar; - } - - if (opts.httpProxy != null) { - this.httpProxy = opts.httpProxy || ''; - } - - if (opts.httpsProxy === '') { - this.httpsProxy = opts.httpProxy || ''; - } else if (opts.httpsProxy === false) { - this.httpsProxy = false; - } else { - this.httpsProxy = opts.httpsProxy || ''; - } - - if (opts.strictSSL !== null && typeof opts.strictSSL !== 'undefined') { - this.strictSSL = opts.strictSSL; - } - - if (opts.ca != null && opts.ca.length > 0) { - this.ca = opts.ca; - } - - if (opts.networkConcurrency != null) { - this.max = opts.networkConcurrency; - } - - if (opts.networkTimeout != null) { - this.timeout = opts.networkTimeout; - } - - if (opts.maxRetryAttempts != null) { - this.maxRetryAttempts = opts.maxRetryAttempts; - } - - if (opts.cafile != null && opts.cafile != '') { - // The CA bundle file can contain one or more certificates with comments/text between each PEM block. - // tls.connect wants an array of certificates without any comments/text, so we need to split the string - // and strip out any text in between the certificates - try { - var bundle = (_fs || _load_fs()).default.readFileSync(opts.cafile).toString(); - var hasPemPrefix = function hasPemPrefix(block) { - return block.startsWith('-----BEGIN '); - }; - // opts.cafile overrides opts.ca, this matches with npm behavior - this.ca = bundle.split(/(-----BEGIN .*\r?\n[^-]+\r?\n--.*)/).filter(hasPemPrefix); - } catch (err) { - this.reporter.error(`Could not open cafile: ${err.message}`); - } - } - - if (opts.cert != null) { - this.cert = opts.cert; - } - - if (opts.key != null) { - this.key = opts.key; - } - }; - - /** - * Lazy load `request` since it is exceptionally expensive to load and is - * often not needed at all. - */ - - RequestManager.prototype._getRequestModule = function _getRequestModule() { - if (!this._requestModule) { - var request = __webpack_require__(872); - if (this.captureHar) { - this._requestCaptureHar = new (_requestCaptureHar || _load_requestCaptureHar()).default(request); - this._requestModule = this._requestCaptureHar.request.bind(this._requestCaptureHar); + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref8 = _iterator6[_i6++]; } else { - this._requestModule = request; + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref8 = _i6.value; } - } - return this._requestModule; - }; - /** - * Queue up a request. - */ + const name = _ref8; - RequestManager.prototype.request = function request(params) { - var _this = this; + let version = deps[name]; - if (this.offlineNoRequests) { - return (_promise || _load_promise()).default.reject(new (_errors || _load_errors()).MessageError(this.reporter.lang('cantRequestOffline', params.url))); - } - - var cached = this.cache[params.url]; - if (cached) { - return cached; - } - - params.method = params.method || 'GET'; - params.forever = true; - params.retryAttempts = 0; - params.strictSSL = this.strictSSL; - params.headers = (0, (_assign || _load_assign()).default)({ - 'User-Agent': this.userAgent - }, params.headers); - - var promise = new (_promise || _load_promise()).default(function (resolve, reject) { - _this.queue.push({ params, reject, resolve }); - _this.shiftQueue(); - }); - - // we can't cache a request with a processor - if (!params.process) { - this.cache[params.url] = promise; - } - - return promise; - }; - - /** - * Clear the request cache. This is important as we cache all HTTP requests so you'll - * want to do this as soon as you can. - */ - - RequestManager.prototype.clearCache = function clearCache() { - this.cache = {}; - if (this._requestCaptureHar != null) { - this._requestCaptureHar.clear(); - } - }; - - /** - * Check if an error is possibly due to lost or poor network connectivity. - */ - - RequestManager.prototype.isPossibleOfflineError = function isPossibleOfflineError(err) { - var code = err.code, - hostname = err.hostname; - - if (!code) { - return false; - } - - // network was previously online but now we're offline - var possibleOfflineChange = !controlOffline && !(_network || _load_network()).isOffline(); - if (code === 'ENOTFOUND' && possibleOfflineChange) { - // can't resolve a domain - return true; - } - - // used to be able to resolve this domain! something is wrong - if (code === 'ENOTFOUND' && hostname && successHosts[hostname]) { - // can't resolve this domain but we've successfully resolved it before - return true; - } - - // network was previously offline and we can't resolve the domain - if (code === 'ENOTFOUND' && controlOffline) { - return true; - } - - // connection was reset or dropped - if (code === 'ECONNRESET') { - return true; - } - - // TCP timeout - if (code === 'ESOCKETTIMEDOUT' || code === 'ETIMEDOUT') { - return true; - } - - return false; - }; - - /** - * Queue up request arguments to be retried. Start a network connectivity timer if there - * isn't already one. - */ - - RequestManager.prototype.queueForRetry = function queueForRetry(opts) { - if (opts.retryReason) { - var containsReason = false; - - for (var _iterator = this.offlineQueue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var queuedOpts = _ref; - - if (queuedOpts.retryReason === opts.retryReason) { - containsReason = true; - break; + const dep = nonTrivialDeps.get(name); + if (dep) { + if (version && version !== '*' && version !== dep.version && isRoot) { + // only throw a warning when at the root + warn(reporter.lang('manifestDependencyCollision', dep.type, name, dep.version, type, version)); } + version = dep.version; } - if (!containsReason) { - this.reporter.info(opts.retryReason); - } - } - - if (!this.offlineQueue.length) { - this.initOfflineRetry(); - } - - this.offlineQueue.push(opts); - }; - - /** - * Begin timers to retry failed requests when we possibly establish network connectivity - * again. - */ - - RequestManager.prototype.initOfflineRetry = function initOfflineRetry() { - var _this2 = this; - - setTimeout(function () { - var queue = _this2.offlineQueue; - _this2.offlineQueue = []; - for (var _iterator2 = queue, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref2; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } - - var opts = _ref2; - - _this2.execute(opts); - } - }, 3000); - }; - - /** - * Execute a request. - */ - - RequestManager.prototype.execute = function execute(opts) { - var _this3 = this; - - var params = opts.params; - var reporter = this.reporter; - - - var buildNext = function buildNext(fn) { - return function (data) { - fn(data); - _this3.running--; - _this3.shiftQueue(); - }; - }; - - var resolve = buildNext(opts.resolve); - - var rejectNext = buildNext(opts.reject); - var reject = function reject(err) { - err.message = `${params.url}: ${err.message}`; - rejectNext(err); - }; - - var queueForRetry = function queueForRetry(reason) { - var attempts = params.retryAttempts || 0; - if (attempts >= _this3.maxRetryAttempts - 1) { - return false; - } - if (opts.params.method && opts.params.method.toUpperCase() !== 'GET') { - return false; - } - params.retryAttempts = attempts + 1; - if (typeof params.cleanup === 'function') { - params.cleanup(); - } - opts.retryReason = reason; - _this3.queueForRetry(opts); - return true; - }; - - var calledOnError = false; - var onError = function onError(err) { - if (calledOnError) { - return; - } - calledOnError = true; - - if (_this3.isPossibleOfflineError(err)) { - if (!queueForRetry(_this3.reporter.lang('offlineRetrying'))) { - reject(err); - } + if (setDeps.has(name)) { + delete deps[name]; } else { - reject(err); - } - }; - - if (!params.process) { - var parts = (_url || _load_url()).default.parse(params.url); - - params.callback = function (err, res, body) { - if (err) { - onError(err); - return; - } - - successHosts[parts.hostname] = true; - - _this3.reporter.verbose(_this3.reporter.lang('verboseRequestFinish', params.url, res.statusCode)); - - if (res.statusCode === 408 || res.statusCode >= 500) { - var description = `${res.statusCode} ${(_http || _load_http()).default.STATUS_CODES[res.statusCode]}`; - if (!queueForRetry(_this3.reporter.lang('internalServerErrorRetrying', description))) { - throw new (_errors || _load_errors()).ResponseError(_this3.reporter.lang('requestFailed', description), res.statusCode); - } else { - return; - } - } - - if (res.statusCode === 401 && res.headers['www-authenticate']) { - var authMethods = res.headers['www-authenticate'].split(/,\s*/).map(function (s) { - return s.toLowerCase(); - }); - - if (authMethods.indexOf('otp') !== -1) { - reject(new (_errors || _load_errors()).OneTimePasswordError()); - return; - } - } - - if (body && typeof body.error === 'string') { - reject(new Error(body.error)); - return; - } - - if ([400, 401, 404].concat(params.rejectStatusCode || []).indexOf(res.statusCode) !== -1) { - // So this is actually a rejection ... the hosted git resolver uses this to know whether http is supported - resolve(false); - } else if (res.statusCode >= 400) { - var errMsg = body && body.message || reporter.lang('requestError', params.url, res.statusCode); - reject(new Error(errMsg)); - } else { - resolve(body); - } - }; - } - - if (params.buffer) { - params.encoding = null; - } - - var proxy = this.httpProxy; - if (params.url.startsWith('https:')) { - proxy = this.httpsProxy; - } - - if (proxy) { - // if no proxy is set, do not pass a proxy down to request. - // the request library will internally check the HTTP_PROXY and HTTPS_PROXY env vars. - params.proxy = String(proxy); - } else if (proxy === false) { - // passing empty string prevents the underlying library from falling back to the env vars. - // an explicit false in the yarn config should override the env var. See #4546. - params.proxy = ''; - } - - if (this.ca != null) { - params.ca = this.ca; - } - - if (this.cert != null) { - params.cert = this.cert; - } - - if (this.key != null) { - params.key = this.key; - } - - if (this.timeout != null) { - params.timeout = this.timeout; - } - - var request = this._getRequestModule(); - var req = request(params); - this.reporter.verbose(this.reporter.lang('verboseRequestStart', params.method, params.url)); - - req.on('error', onError); - - var queue = params.queue; - if (queue) { - req.on('data', queue.stillActive.bind(queue)); - } - - var process = params.process; - if (process) { - req.on('response', function (res) { - if (res.statusCode >= 200 && res.statusCode < 300) { - return; - } - - var description = `${res.statusCode} ${(_http || _load_http()).default.STATUS_CODES[res.statusCode]}`; - reject(new (_errors || _load_errors()).ResponseError(_this3.reporter.lang('requestFailed', description), res.statusCode)); - - req.abort(); - }); - process(req, resolve, reject); - } - }; - - /** - * Remove an item from the queue. Create it's request options and execute it. - */ - - RequestManager.prototype.shiftQueue = function shiftQueue() { - if (this.running >= this.max || !this.queue.length) { - return; - } - - var opts = this.queue.shift(); - - this.running++; - this.execute(opts); - }; - - RequestManager.prototype.saveHar = function saveHar(filename) { - if (!this.captureHar) { - throw new Error(this.reporter.lang('requestManagerNotSetupHAR')); - } - // No request may have occurred at all. - this._getRequestModule(); - (0, (_invariant || _load_invariant()).default)(this._requestCaptureHar != null, 'request-capture-har not setup'); - this._requestCaptureHar.saveHar(filename); - }; - - return RequestManager; -}(); - -exports.default = RequestManager; - -/***/ }), -/* 322 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _iterator = __webpack_require__(586); - -var _iterator2 = _interopRequireDefault(_iterator); - -var _symbol = __webpack_require__(585); - -var _symbol2 = _interopRequireDefault(_symbol); - -var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { - return typeof obj === "undefined" ? "undefined" : _typeof(obj); -} : function (obj) { - return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); -}; - -/***/ }), -/* 323 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var crypto_hash_sha512 = __webpack_require__(71).lowlevel.crypto_hash; - -/* - * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a - * result, it retains the original copyright and license. The two files are - * under slightly different (but compatible) licenses, and are here combined in - * one file. - * - * Credit for the actual porting work goes to: - * Devi Mandiri - */ - -/* - * The Blowfish portions are under the following license: - * - * Blowfish block cipher for OpenBSD - * Copyright 1997 Niels Provos - * All rights reserved. - * - * Implementation advice by David Mazieres . - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * The bcrypt_pbkdf portions are under the following license: - * - * Copyright (c) 2013 Ted Unangst - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * Performance improvements (Javascript-specific): - * - * Copyright 2016, Joyent Inc - * Author: Alex Wilson - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -// Ported from OpenBSD bcrypt_pbkdf.c v1.9 - -var BLF_J = 0; - -var Blowfish = function() { - this.S = [ - new Uint32Array([ - 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, - 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, - 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, - 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, - 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, - 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, - 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, - 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, - 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, - 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, - 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, - 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, - 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, - 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, - 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, - 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, - 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, - 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, - 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, - 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, - 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, - 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, - 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, - 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, - 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, - 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, - 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, - 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, - 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, - 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, - 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, - 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, - 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, - 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, - 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, - 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, - 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, - 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, - 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, - 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, - 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, - 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, - 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, - 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, - 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, - 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, - 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, - 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, - 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, - 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, - 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, - 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, - 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, - 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, - 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, - 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, - 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, - 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, - 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, - 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, - 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, - 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, - 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, - 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]), - new Uint32Array([ - 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, - 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, - 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, - 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, - 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, - 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, - 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, - 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, - 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, - 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, - 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, - 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, - 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, - 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, - 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, - 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, - 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, - 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, - 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, - 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, - 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, - 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, - 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, - 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, - 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, - 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, - 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, - 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, - 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, - 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, - 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, - 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, - 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, - 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, - 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, - 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, - 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, - 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, - 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, - 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, - 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, - 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, - 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, - 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, - 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, - 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, - 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, - 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, - 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, - 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, - 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, - 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, - 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, - 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, - 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, - 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, - 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, - 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, - 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, - 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, - 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, - 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, - 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, - 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]), - new Uint32Array([ - 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, - 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, - 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, - 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, - 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, - 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, - 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, - 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, - 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, - 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, - 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, - 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, - 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, - 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, - 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, - 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, - 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, - 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, - 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, - 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, - 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, - 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, - 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, - 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, - 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, - 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, - 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, - 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, - 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, - 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, - 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, - 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, - 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, - 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, - 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, - 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, - 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, - 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, - 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, - 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, - 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, - 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, - 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, - 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, - 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, - 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, - 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, - 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, - 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, - 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, - 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, - 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, - 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, - 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, - 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, - 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, - 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, - 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, - 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, - 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, - 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, - 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, - 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, - 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]), - new Uint32Array([ - 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, - 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, - 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, - 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, - 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, - 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, - 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, - 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, - 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, - 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, - 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, - 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, - 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, - 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, - 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, - 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, - 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, - 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, - 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, - 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, - 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, - 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, - 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, - 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, - 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, - 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, - 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, - 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, - 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, - 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, - 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, - 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, - 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, - 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, - 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, - 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, - 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, - 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, - 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, - 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, - 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, - 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, - 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, - 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, - 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, - 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, - 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, - 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, - 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, - 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, - 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, - 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, - 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, - 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, - 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, - 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, - 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, - 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, - 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, - 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, - 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, - 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, - 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, - 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6]) - ]; - this.P = new Uint32Array([ - 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, - 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, - 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, - 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, - 0x9216d5d9, 0x8979fb1b]); -}; - -function F(S, x8, i) { - return (((S[0][x8[i+3]] + - S[1][x8[i+2]]) ^ - S[2][x8[i+1]]) + - S[3][x8[i]]); -}; - -Blowfish.prototype.encipher = function(x, x8) { - if (x8 === undefined) { - x8 = new Uint8Array(x.buffer); - if (x.byteOffset !== 0) - x8 = x8.subarray(x.byteOffset); - } - x[0] ^= this.P[0]; - for (var i = 1; i < 16; i += 2) { - x[1] ^= F(this.S, x8, 0) ^ this.P[i]; - x[0] ^= F(this.S, x8, 4) ^ this.P[i+1]; - } - var t = x[0]; - x[0] = x[1] ^ this.P[17]; - x[1] = t; -}; - -Blowfish.prototype.decipher = function(x) { - var x8 = new Uint8Array(x.buffer); - if (x.byteOffset !== 0) - x8 = x8.subarray(x.byteOffset); - x[0] ^= this.P[17]; - for (var i = 16; i > 0; i -= 2) { - x[1] ^= F(this.S, x8, 0) ^ this.P[i]; - x[0] ^= F(this.S, x8, 4) ^ this.P[i-1]; - } - var t = x[0]; - x[0] = x[1] ^ this.P[0]; - x[1] = t; -}; - -function stream2word(data, databytes){ - var i, temp = 0; - for (i = 0; i < 4; i++, BLF_J++) { - if (BLF_J >= databytes) BLF_J = 0; - temp = (temp << 8) | data[BLF_J]; - } - return temp; -}; - -Blowfish.prototype.expand0state = function(key, keybytes) { - var d = new Uint32Array(2), i, k; - var d8 = new Uint8Array(d.buffer); - - for (i = 0, BLF_J = 0; i < 18; i++) { - this.P[i] ^= stream2word(key, keybytes); - } - BLF_J = 0; - - for (i = 0; i < 18; i += 2) { - this.encipher(d, d8); - this.P[i] = d[0]; - this.P[i+1] = d[1]; - } - - for (i = 0; i < 4; i++) { - for (k = 0; k < 256; k += 2) { - this.encipher(d, d8); - this.S[i][k] = d[0]; - this.S[i][k+1] = d[1]; - } - } -}; - -Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) { - var d = new Uint32Array(2), i, k; - - for (i = 0, BLF_J = 0; i < 18; i++) { - this.P[i] ^= stream2word(key, keybytes); - } - - for (i = 0, BLF_J = 0; i < 18; i += 2) { - d[0] ^= stream2word(data, databytes); - d[1] ^= stream2word(data, databytes); - this.encipher(d); - this.P[i] = d[0]; - this.P[i+1] = d[1]; - } - - for (i = 0; i < 4; i++) { - for (k = 0; k < 256; k += 2) { - d[0] ^= stream2word(data, databytes); - d[1] ^= stream2word(data, databytes); - this.encipher(d); - this.S[i][k] = d[0]; - this.S[i][k+1] = d[1]; - } - } - BLF_J = 0; -}; - -Blowfish.prototype.enc = function(data, blocks) { - for (var i = 0; i < blocks; i++) { - this.encipher(data.subarray(i*2)); - } -}; - -Blowfish.prototype.dec = function(data, blocks) { - for (var i = 0; i < blocks; i++) { - this.decipher(data.subarray(i*2)); - } -}; - -var BCRYPT_BLOCKS = 8, - BCRYPT_HASHSIZE = 32; - -function bcrypt_hash(sha2pass, sha2salt, out) { - var state = new Blowfish(), - cdata = new Uint32Array(BCRYPT_BLOCKS), i, - ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105, - 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109, - 105,116,101]); //"OxychromaticBlowfishSwatDynamite" - - state.expandstate(sha2salt, 64, sha2pass, 64); - for (i = 0; i < 64; i++) { - state.expand0state(sha2salt, 64); - state.expand0state(sha2pass, 64); - } - - for (i = 0; i < BCRYPT_BLOCKS; i++) - cdata[i] = stream2word(ciphertext, ciphertext.byteLength); - for (i = 0; i < 64; i++) - state.enc(cdata, cdata.byteLength / 8); - - for (i = 0; i < BCRYPT_BLOCKS; i++) { - out[4*i+3] = cdata[i] >>> 24; - out[4*i+2] = cdata[i] >>> 16; - out[4*i+1] = cdata[i] >>> 8; - out[4*i+0] = cdata[i]; - } -}; - -function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) { - var sha2pass = new Uint8Array(64), - sha2salt = new Uint8Array(64), - out = new Uint8Array(BCRYPT_HASHSIZE), - tmpout = new Uint8Array(BCRYPT_HASHSIZE), - countsalt = new Uint8Array(saltlen+4), - i, j, amt, stride, dest, count, - origkeylen = keylen; - - if (rounds < 1) - return -1; - if (passlen === 0 || saltlen === 0 || keylen === 0 || - keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20)) - return -1; - - stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength); - amt = Math.floor((keylen + stride - 1) / stride); - - for (i = 0; i < saltlen; i++) - countsalt[i] = salt[i]; - - crypto_hash_sha512(sha2pass, pass, passlen); - - for (count = 1; keylen > 0; count++) { - countsalt[saltlen+0] = count >>> 24; - countsalt[saltlen+1] = count >>> 16; - countsalt[saltlen+2] = count >>> 8; - countsalt[saltlen+3] = count; - - crypto_hash_sha512(sha2salt, countsalt, saltlen + 4); - bcrypt_hash(sha2pass, sha2salt, tmpout); - for (i = out.byteLength; i--;) - out[i] = tmpout[i]; - - for (i = 1; i < rounds; i++) { - crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength); - bcrypt_hash(sha2pass, sha2salt, tmpout); - for (j = 0; j < out.byteLength; j++) - out[j] ^= tmpout[j]; - } - - amt = Math.min(amt, keylen); - for (i = 0; i < amt; i++) { - dest = i * stride + (count - 1); - if (dest >= origkeylen) - break; - key[dest] = out[i]; - } - keylen -= i; - } - - return 0; -}; - -module.exports = { - BLOCKS: BCRYPT_BLOCKS, - HASHSIZE: BCRYPT_HASHSIZE, - hash: bcrypt_hash, - pbkdf: bcrypt_pbkdf -}; - - -/***/ }), -/* 324 */ -/***/ (function(module, exports, __webpack_require__) { - -var bufferFill = __webpack_require__(591) -var allocUnsafe = __webpack_require__(590) - -module.exports = function alloc (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be a number') - } - - if (size < 0) { - throw new RangeError('"size" argument must not be negative') - } - - if (Buffer.alloc) { - return Buffer.alloc(size, fill, encoding) - } - - var buffer = allocUnsafe(size) - - if (size === 0) { - return buffer - } - - if (fill === undefined) { - return bufferFill(buffer, 0) - } - - if (typeof encoding !== 'string') { - encoding = undefined - } - - return bufferFill(buffer, fill, encoding) -} - - -/***/ }), -/* 325 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const restoreCursor = __webpack_require__(890); - -let hidden = false; - -exports.show = stream => { - const s = stream || process.stderr; - - if (!s.isTTY) { - return; - } - - hidden = false; - s.write('\u001b[?25h'); -}; - -exports.hide = stream => { - const s = stream || process.stderr; - - if (!s.isTTY) { - return; - } - - restoreCursor(); - hidden = true; - s.write('\u001b[?25l'); -}; - -exports.toggle = (force, stream) => { - if (force !== undefined) { - hidden = force; - } - - if (hidden) { - exports.show(stream); - } else { - exports.hide(stream); - } -}; - - -/***/ }), -/* 326 */ -/***/ (function(module, exports, __webpack_require__) { - -var objectAssign = __webpack_require__(243); -var stringWidth = __webpack_require__(1017); - -function codeRegex(capture){ - return capture ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g -} - -function strlen(str){ - var code = codeRegex(); - var stripped = ("" + str).replace(code,''); - var split = stripped.split("\n"); - return split.reduce(function (memo, s) { return (stringWidth(s) > memo) ? stringWidth(s) : memo }, 0); -} - -function repeat(str,times){ - return Array(times + 1).join(str); -} - -function pad(str, len, pad, dir) { - var length = strlen(str); - if (len + 1 >= length) { - var padlen = len - length; - switch (dir) { - case 'right': - str = repeat(pad, padlen) + str; - break; - - case 'center': - var right = Math.ceil((padlen) / 2); - var left = padlen - right; - str = repeat(pad, left) + str + repeat(pad, right); - break; - - default : - str = str + repeat(pad,padlen); - break; - } - } - return str; -} - -var codeCache = {}; - -function addToCodeCache(name,on,off){ - on = '\u001b[' + on + 'm'; - off = '\u001b[' + off + 'm'; - codeCache[on] = {set:name,to:true}; - codeCache[off] = {set:name,to:false}; - codeCache[name] = {on:on,off:off}; -} - -//https://github.com/Marak/colors.js/blob/master/lib/styles.js -addToCodeCache('bold', 1, 22); -addToCodeCache('italics', 3, 23); -addToCodeCache('underline', 4, 24); -addToCodeCache('inverse', 7, 27); -addToCodeCache('strikethrough', 9, 29); - - -function updateState(state, controlChars){ - var controlCode = controlChars[1] ? parseInt(controlChars[1].split(';')[0]) : 0; - if ( (controlCode >= 30 && controlCode <= 39) - || (controlCode >= 90 && controlCode <= 97) - ) { - state.lastForegroundAdded = controlChars[0]; - return; - } - if ( (controlCode >= 40 && controlCode <= 49) - || (controlCode >= 100 && controlCode <= 107) - ) { - state.lastBackgroundAdded = controlChars[0]; - return; - } - if (controlCode === 0) { - for (var i in state) { - /* istanbul ignore else */ - if (state.hasOwnProperty(i)) { - delete state[i]; + deps[name] = version; + setDeps.add(name); } } - return; - } - var info = codeCache[controlChars[0]]; - if (info) { - state[info.set] = info.to; } } -function readState(line){ - var code = codeRegex(true); - var controlChars = code.exec(line); - var state = {}; - while(controlChars !== null){ - updateState(state, controlChars); - controlChars = code.exec(line); - } - return state; -} +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { -function unwindState(state,ret){ - var lastBackgroundAdded = state.lastBackgroundAdded; - var lastForegroundAdded = state.lastForegroundAdded; +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = __webpack_require__(68); +var TAG = __webpack_require__(20)('toStringTag'); +// ES3 wrong here +var ARG = cof(function () { return arguments; }()) == 'Arguments'; - delete state.lastBackgroundAdded; - delete state.lastForegroundAdded; +// fallback for IE11 Script Access Denied error +var tryGet = function (it, key) { + try { + return it[key]; + } catch (e) { /* empty */ } +}; - Object.keys(state).forEach(function(key){ - if(state[key]){ - ret += codeCache[key].off; - } - }); - - if(lastBackgroundAdded && (lastBackgroundAdded != '\u001b[49m')){ - ret += '\u001b[49m'; - } - if(lastForegroundAdded && (lastForegroundAdded != '\u001b[39m')){ - ret += '\u001b[39m'; - } - - return ret; -} - -function rewindState(state,ret){ - var lastBackgroundAdded = state.lastBackgroundAdded; - var lastForegroundAdded = state.lastForegroundAdded; - - delete state.lastBackgroundAdded; - delete state.lastForegroundAdded; - - Object.keys(state).forEach(function(key){ - if(state[key]){ - ret = codeCache[key].on + ret; - } - }); - - if(lastBackgroundAdded && (lastBackgroundAdded != '\u001b[49m')){ - ret = lastBackgroundAdded + ret; - } - if(lastForegroundAdded && (lastForegroundAdded != '\u001b[39m')){ - ret = lastForegroundAdded + ret; - } - - return ret; -} - -function truncateWidth(str, desiredLength){ - if (str.length === strlen(str)) { - return str.substr(0, desiredLength); - } - - while (strlen(str) > desiredLength){ - str = str.slice(0, -1); - } - - return str; -} - -function truncateWidthWithAnsi(str, desiredLength){ - var code = codeRegex(true); - var split = str.split(codeRegex()); - var splitIndex = 0; - var retLen = 0; - var ret = ''; - var myArray; - var state = {}; - - while(retLen < desiredLength){ - myArray = code.exec(str); - var toAdd = split[splitIndex]; - splitIndex++; - if (retLen + strlen(toAdd) > desiredLength){ - toAdd = truncateWidth(toAdd, desiredLength - retLen); - } - ret += toAdd; - retLen += strlen(toAdd); - - if(retLen < desiredLength){ - if (!myArray) { break; } // full-width chars may cause a whitespace which cannot be filled - ret += myArray[0]; - updateState(state,myArray); - } - } - - return unwindState(state,ret); -} - -function truncate(str, desiredLength, truncateChar){ - truncateChar = truncateChar || '…'; - var lengthOfStr = strlen(str); - if(lengthOfStr <= desiredLength){ - return str; - } - desiredLength -= strlen(truncateChar); - - var ret = truncateWidthWithAnsi(str, desiredLength); - - return ret + truncateChar; -} - - -function defaultOptions(){ - return{ - chars: { - 'top': '─' - , 'top-mid': '┬' - , 'top-left': '┌' - , 'top-right': '┐' - , 'bottom': '─' - , 'bottom-mid': '┴' - , 'bottom-left': '└' - , 'bottom-right': '┘' - , 'left': '│' - , 'left-mid': '├' - , 'mid': '─' - , 'mid-mid': '┼' - , 'right': '│' - , 'right-mid': '┤' - , 'middle': '│' - } - , truncate: '…' - , colWidths: [] - , rowHeights: [] - , colAligns: [] - , rowAligns: [] - , style: { - 'padding-left': 1 - , 'padding-right': 1 - , head: ['red'] - , border: ['grey'] - , compact : false - } - , head: [] - }; -} - -function mergeOptions(options,defaults){ - options = options || {}; - defaults = defaults || defaultOptions(); - var ret = objectAssign({}, defaults, options); - ret.chars = objectAssign({}, defaults.chars, options.chars); - ret.style = objectAssign({}, defaults.style, options.style); - return ret; -} - -function wordWrap(maxLength,input){ - var lines = []; - var split = input.split(/(\s+)/g); - var line = []; - var lineLength = 0; - var whitespace; - for (var i = 0; i < split.length; i += 2) { - var word = split[i]; - var newLength = lineLength + strlen(word); - if (lineLength > 0 && whitespace) { - newLength += whitespace.length; - } - if(newLength > maxLength){ - if(lineLength !== 0){ - lines.push(line.join('')); - } - line = [word]; - lineLength = strlen(word); - } else { - line.push(whitespace || '', word); - lineLength = newLength; - } - whitespace = split[i+1]; - } - if(lineLength){ - lines.push(line.join('')); - } - return lines; -} - -function multiLineWordWrap(maxLength, input){ - var output = []; - input = input.split('\n'); - for(var i = 0; i < input.length; i++){ - output.push.apply(output,wordWrap(maxLength,input[i])); - } - return output; -} - -function colorizeLines(input){ - var state = {}; - var output = []; - for(var i = 0; i < input.length; i++){ - var line = rewindState(state,input[i]) ; - state = readState(line); - var temp = objectAssign({},state); - output.push(unwindState(temp,line)); - } - return output; -} - -module.exports = { - strlen:strlen, - repeat:repeat, - pad:pad, - truncate:truncate, - mergeOptions:mergeOptions, - wordWrap:multiLineWordWrap, - colorizeLines:colorizeLines +module.exports = function (it) { + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; /***/ }), -/* 327 */ +/* 127 */ /***/ (function(module, exports) { - -/** - * slice() reference. - */ - -var slice = Array.prototype.slice; - -/** - * Expose `co`. - */ - -module.exports = co['default'] = co.co = co; - -/** - * Wrap the given generator `fn` into a - * function that returns a promise. - * This is a separate function so that - * every `co()` call doesn't create a new, - * unnecessary closure. - * - * @param {GeneratorFunction} fn - * @return {Function} - * @api public - */ - -co.wrap = function (fn) { - createPromise.__generatorFunction__ = fn; - return createPromise; - function createPromise() { - return co.call(this, fn.apply(this, arguments)); - } -}; - -/** - * Execute the generator function or a generator - * and return a promise. - * - * @param {Function} fn - * @return {Promise} - * @api public - */ - -function co(gen) { - var ctx = this; - var args = slice.call(arguments, 1) - - // we wrap everything in a promise to avoid promise chaining, - // which leads to memory leak errors. - // see https://github.com/tj/co/issues/180 - return new Promise(function(resolve, reject) { - if (typeof gen === 'function') gen = gen.apply(ctx, args); - if (!gen || typeof gen.next !== 'function') return resolve(gen); - - onFulfilled(); - - /** - * @param {Mixed} res - * @return {Promise} - * @api private - */ - - function onFulfilled(res) { - var ret; - try { - ret = gen.next(res); - } catch (e) { - return reject(e); - } - next(ret); - } - - /** - * @param {Error} err - * @return {Promise} - * @api private - */ - - function onRejected(err) { - var ret; - try { - ret = gen.throw(err); - } catch (e) { - return reject(e); - } - next(ret); - } - - /** - * Get the next value in the generator, - * return a promise. - * - * @param {Object} ret - * @return {Promise} - * @api private - */ - - function next(ret) { - if (ret.done) return resolve(ret.value); - var value = toPromise.call(ctx, ret.value); - if (value && isPromise(value)) return value.then(onFulfilled, onRejected); - return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, ' - + 'but the following object was passed: "' + String(ret.value) + '"')); - } - }); -} - -/** - * Convert a `yield`ed value into a promise. - * - * @param {Mixed} obj - * @return {Promise} - * @api private - */ - -function toPromise(obj) { - if (!obj) return obj; - if (isPromise(obj)) return obj; - if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj); - if ('function' == typeof obj) return thunkToPromise.call(this, obj); - if (Array.isArray(obj)) return arrayToPromise.call(this, obj); - if (isObject(obj)) return objectToPromise.call(this, obj); - return obj; -} - -/** - * Convert a thunk to a promise. - * - * @param {Function} - * @return {Promise} - * @api private - */ - -function thunkToPromise(fn) { - var ctx = this; - return new Promise(function (resolve, reject) { - fn.call(ctx, function (err, res) { - if (err) return reject(err); - if (arguments.length > 2) res = slice.call(arguments, 1); - resolve(res); - }); - }); -} - -/** - * Convert an array of "yieldables" to a promise. - * Uses `Promise.all()` internally. - * - * @param {Array} obj - * @return {Promise} - * @api private - */ - -function arrayToPromise(obj) { - return Promise.all(obj.map(toPromise, this)); -} - -/** - * Convert an object of "yieldables" to a promise. - * Uses `Promise.all()` internally. - * - * @param {Object} obj - * @return {Promise} - * @api private - */ - -function objectToPromise(obj){ - var results = new obj.constructor(); - var keys = Object.keys(obj); - var promises = []; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var promise = toPromise.call(this, obj[key]); - if (promise && isPromise(promise)) defer(promise, key); - else results[key] = obj[key]; - } - return Promise.all(promises).then(function () { - return results; - }); - - function defer(promise, key) { - // predefine the key in the result - results[key] = undefined; - promises.push(promise.then(function (res) { - results[key] = res; - })); - } -} - -/** - * Check if `obj` is a promise. - * - * @param {Object} obj - * @return {Boolean} - * @api private - */ - -function isPromise(obj) { - return 'function' == typeof obj.then; -} - -/** - * Check if `obj` is a generator. - * - * @param {Mixed} obj - * @return {Boolean} - * @api private - */ - -function isGenerator(obj) { - return 'function' == typeof obj.next && 'function' == typeof obj.throw; -} - -/** - * Check if `obj` is a generator function. - * - * @param {Mixed} obj - * @return {Boolean} - * @api private - */ -function isGeneratorFunction(obj) { - var constructor = obj.constructor; - if (!constructor) return false; - if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true; - return isGenerator(constructor.prototype); -} - -/** - * Check for plain object. - * - * @param {Mixed} val - * @return {Boolean} - * @api private - */ - -function isObject(val) { - return Object == val.constructor; -} +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); /***/ }), -/* 328 */ +/* 128 */ /***/ (function(module, exports, __webpack_require__) { -/* MIT license */ -var cssKeywords = __webpack_require__(608); - -// NOTE: conversions should only return primitive values (i.e. arrays, or -// values that give correct `typeof` results). -// do not use box values types (i.e. Number(), String(), etc.) - -var reverseKeywords = {}; -for (var key in cssKeywords) { - if (cssKeywords.hasOwnProperty(key)) { - reverseKeywords[cssKeywords[key]] = key; - } -} - -var convert = module.exports = { - rgb: {channels: 3, labels: 'rgb'}, - hsl: {channels: 3, labels: 'hsl'}, - hsv: {channels: 3, labels: 'hsv'}, - hwb: {channels: 3, labels: 'hwb'}, - cmyk: {channels: 4, labels: 'cmyk'}, - xyz: {channels: 3, labels: 'xyz'}, - lab: {channels: 3, labels: 'lab'}, - lch: {channels: 3, labels: 'lch'}, - hex: {channels: 1, labels: ['hex']}, - keyword: {channels: 1, labels: ['keyword']}, - ansi16: {channels: 1, labels: ['ansi16']}, - ansi256: {channels: 1, labels: ['ansi256']}, - hcg: {channels: 3, labels: ['h', 'c', 'g']}, - apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, - gray: {channels: 1, labels: ['gray']} -}; - -// hide .channels and .labels properties -for (var model in convert) { - if (convert.hasOwnProperty(model)) { - if (!('channels' in convert[model])) { - throw new Error('missing channels property: ' + model); - } - - if (!('labels' in convert[model])) { - throw new Error('missing channel labels property: ' + model); - } - - if (convert[model].labels.length !== convert[model].channels) { - throw new Error('channel and label counts mismatch: ' + model); - } - - var channels = convert[model].channels; - var labels = convert[model].labels; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], 'channels', {value: channels}); - Object.defineProperty(convert[model], 'labels', {value: labels}); - } -} - -convert.rgb.hsl = function (rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var min = Math.min(r, g, b); - var max = Math.max(r, g, b); - var delta = max - min; - var h; - var s; - var l; - - if (max === min) { - h = 0; - } else if (r === max) { - h = (g - b) / delta; - } else if (g === max) { - h = 2 + (b - r) / delta; - } else if (b === max) { - h = 4 + (r - g) / delta; - } - - h = Math.min(h * 60, 360); - - if (h < 0) { - h += 360; - } - - l = (min + max) / 2; - - if (max === min) { - s = 0; - } else if (l <= 0.5) { - s = delta / (max + min); - } else { - s = delta / (2 - max - min); - } - - return [h, s * 100, l * 100]; -}; - -convert.rgb.hsv = function (rgb) { - var rdif; - var gdif; - var bdif; - var h; - var s; - - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var v = Math.max(r, g, b); - var diff = v - Math.min(r, g, b); - var diffc = function (c) { - return (v - c) / 6 / diff + 1 / 2; - }; - - if (diff === 0) { - h = s = 0; - } else { - s = diff / v; - rdif = diffc(r); - gdif = diffc(g); - bdif = diffc(b); - - if (r === v) { - h = bdif - gdif; - } else if (g === v) { - h = (1 / 3) + rdif - bdif; - } else if (b === v) { - h = (2 / 3) + gdif - rdif; - } - if (h < 0) { - h += 1; - } else if (h > 1) { - h -= 1; - } - } - - return [ - h * 360, - s * 100, - v * 100 - ]; -}; - -convert.rgb.hwb = function (rgb) { - var r = rgb[0]; - var g = rgb[1]; - var b = rgb[2]; - var h = convert.rgb.hsl(rgb)[0]; - var w = 1 / 255 * Math.min(r, Math.min(g, b)); - - b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - - return [h, w * 100, b * 100]; -}; - -convert.rgb.cmyk = function (rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var c; - var m; - var y; - var k; - - k = Math.min(1 - r, 1 - g, 1 - b); - c = (1 - r - k) / (1 - k) || 0; - m = (1 - g - k) / (1 - k) || 0; - y = (1 - b - k) / (1 - k) || 0; - - return [c * 100, m * 100, y * 100, k * 100]; -}; - -/** - * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance - * */ -function comparativeDistance(x, y) { - return ( - Math.pow(x[0] - y[0], 2) + - Math.pow(x[1] - y[1], 2) + - Math.pow(x[2] - y[2], 2) - ); -} - -convert.rgb.keyword = function (rgb) { - var reversed = reverseKeywords[rgb]; - if (reversed) { - return reversed; - } - - var currentClosestDistance = Infinity; - var currentClosestKeyword; - - for (var keyword in cssKeywords) { - if (cssKeywords.hasOwnProperty(keyword)) { - var value = cssKeywords[keyword]; - - // Compute comparative distance - var distance = comparativeDistance(rgb, value); - - // Check if its less, if so set as closest - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; - } - } - } - - return currentClosestKeyword; -}; - -convert.keyword.rgb = function (keyword) { - return cssKeywords[keyword]; -}; - -convert.rgb.xyz = function (rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - - // assume sRGB - r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92); - g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92); - b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92); - - var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); - var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); - var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); - - return [x * 100, y * 100, z * 100]; -}; - -convert.rgb.lab = function (rgb) { - var xyz = convert.rgb.xyz(rgb); - var x = xyz[0]; - var y = xyz[1]; - var z = xyz[2]; - var l; - var a; - var b; - - x /= 95.047; - y /= 100; - z /= 108.883; - - x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); - - l = (116 * y) - 16; - a = 500 * (x - y); - b = 200 * (y - z); - - return [l, a, b]; -}; - -convert.hsl.rgb = function (hsl) { - var h = hsl[0] / 360; - var s = hsl[1] / 100; - var l = hsl[2] / 100; - var t1; - var t2; - var t3; - var rgb; - var val; - - if (s === 0) { - val = l * 255; - return [val, val, val]; - } - - if (l < 0.5) { - t2 = l * (1 + s); - } else { - t2 = l + s - l * s; - } - - t1 = 2 * l - t2; - - rgb = [0, 0, 0]; - for (var i = 0; i < 3; i++) { - t3 = h + 1 / 3 * -(i - 1); - if (t3 < 0) { - t3++; - } - if (t3 > 1) { - t3--; - } - - if (6 * t3 < 1) { - val = t1 + (t2 - t1) * 6 * t3; - } else if (2 * t3 < 1) { - val = t2; - } else if (3 * t3 < 2) { - val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; - } else { - val = t1; - } - - rgb[i] = val * 255; - } - - return rgb; -}; - -convert.hsl.hsv = function (hsl) { - var h = hsl[0]; - var s = hsl[1] / 100; - var l = hsl[2] / 100; - var smin = s; - var lmin = Math.max(l, 0.01); - var sv; - var v; - - l *= 2; - s *= (l <= 1) ? l : 2 - l; - smin *= lmin <= 1 ? lmin : 2 - lmin; - v = (l + s) / 2; - sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); - - return [h, sv * 100, v * 100]; -}; - -convert.hsv.rgb = function (hsv) { - var h = hsv[0] / 60; - var s = hsv[1] / 100; - var v = hsv[2] / 100; - var hi = Math.floor(h) % 6; - - var f = h - Math.floor(h); - var p = 255 * v * (1 - s); - var q = 255 * v * (1 - (s * f)); - var t = 255 * v * (1 - (s * (1 - f))); - v *= 255; - - switch (hi) { - case 0: - return [v, t, p]; - case 1: - return [q, v, p]; - case 2: - return [p, v, t]; - case 3: - return [p, q, v]; - case 4: - return [t, p, v]; - case 5: - return [v, p, q]; - } -}; - -convert.hsv.hsl = function (hsv) { - var h = hsv[0]; - var s = hsv[1] / 100; - var v = hsv[2] / 100; - var vmin = Math.max(v, 0.01); - var lmin; - var sl; - var l; - - l = (2 - s) * v; - lmin = (2 - s) * vmin; - sl = s * vmin; - sl /= (lmin <= 1) ? lmin : 2 - lmin; - sl = sl || 0; - l /= 2; - - return [h, sl * 100, l * 100]; -}; - -// http://dev.w3.org/csswg/css-color/#hwb-to-rgb -convert.hwb.rgb = function (hwb) { - var h = hwb[0] / 360; - var wh = hwb[1] / 100; - var bl = hwb[2] / 100; - var ratio = wh + bl; - var i; - var v; - var f; - var n; - - // wh + bl cant be > 1 - if (ratio > 1) { - wh /= ratio; - bl /= ratio; - } - - i = Math.floor(6 * h); - v = 1 - bl; - f = 6 * h - i; - - if ((i & 0x01) !== 0) { - f = 1 - f; - } - - n = wh + f * (v - wh); // linear interpolation - - var r; - var g; - var b; - switch (i) { - default: - case 6: - case 0: r = v; g = n; b = wh; break; - case 1: r = n; g = v; b = wh; break; - case 2: r = wh; g = v; b = n; break; - case 3: r = wh; g = n; b = v; break; - case 4: r = n; g = wh; b = v; break; - case 5: r = v; g = wh; b = n; break; - } - - return [r * 255, g * 255, b * 255]; -}; - -convert.cmyk.rgb = function (cmyk) { - var c = cmyk[0] / 100; - var m = cmyk[1] / 100; - var y = cmyk[2] / 100; - var k = cmyk[3] / 100; - var r; - var g; - var b; - - r = 1 - Math.min(1, c * (1 - k) + k); - g = 1 - Math.min(1, m * (1 - k) + k); - b = 1 - Math.min(1, y * (1 - k) + k); - - return [r * 255, g * 255, b * 255]; -}; - -convert.xyz.rgb = function (xyz) { - var x = xyz[0] / 100; - var y = xyz[1] / 100; - var z = xyz[2] / 100; - var r; - var g; - var b; - - r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); - g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); - b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); - - // assume sRGB - r = r > 0.0031308 - ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055) - : r * 12.92; - - g = g > 0.0031308 - ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055) - : g * 12.92; - - b = b > 0.0031308 - ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055) - : b * 12.92; - - r = Math.min(Math.max(0, r), 1); - g = Math.min(Math.max(0, g), 1); - b = Math.min(Math.max(0, b), 1); - - return [r * 255, g * 255, b * 255]; -}; - -convert.xyz.lab = function (xyz) { - var x = xyz[0]; - var y = xyz[1]; - var z = xyz[2]; - var l; - var a; - var b; - - x /= 95.047; - y /= 100; - z /= 108.883; - - x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); - - l = (116 * y) - 16; - a = 500 * (x - y); - b = 200 * (y - z); - - return [l, a, b]; -}; - -convert.lab.xyz = function (lab) { - var l = lab[0]; - var a = lab[1]; - var b = lab[2]; - var x; - var y; - var z; - - y = (l + 16) / 116; - x = a / 500 + y; - z = y - b / 200; - - var y2 = Math.pow(y, 3); - var x2 = Math.pow(x, 3); - var z2 = Math.pow(z, 3); - y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; - x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; - z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; - - x *= 95.047; - y *= 100; - z *= 108.883; - - return [x, y, z]; -}; - -convert.lab.lch = function (lab) { - var l = lab[0]; - var a = lab[1]; - var b = lab[2]; - var hr; - var h; - var c; - - hr = Math.atan2(b, a); - h = hr * 360 / 2 / Math.PI; - - if (h < 0) { - h += 360; - } - - c = Math.sqrt(a * a + b * b); - - return [l, c, h]; -}; - -convert.lch.lab = function (lch) { - var l = lch[0]; - var c = lch[1]; - var h = lch[2]; - var a; - var b; - var hr; - - hr = h / 360 * 2 * Math.PI; - a = c * Math.cos(hr); - b = c * Math.sin(hr); - - return [l, a, b]; -}; - -convert.rgb.ansi16 = function (args) { - var r = args[0]; - var g = args[1]; - var b = args[2]; - var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization - - value = Math.round(value / 50); - - if (value === 0) { - return 30; - } - - var ansi = 30 - + ((Math.round(b / 255) << 2) - | (Math.round(g / 255) << 1) - | Math.round(r / 255)); - - if (value === 2) { - ansi += 60; - } - - return ansi; -}; - -convert.hsv.ansi16 = function (args) { - // optimization here; we already know the value and don't need to get - // it converted for us. - return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); -}; - -convert.rgb.ansi256 = function (args) { - var r = args[0]; - var g = args[1]; - var b = args[2]; - - // we use the extended greyscale palette here, with the exception of - // black and white. normal palette only has 4 greyscale shades. - if (r === g && g === b) { - if (r < 8) { - return 16; - } - - if (r > 248) { - return 231; - } - - return Math.round(((r - 8) / 247) * 24) + 232; - } - - var ansi = 16 - + (36 * Math.round(r / 255 * 5)) - + (6 * Math.round(g / 255 * 5)) - + Math.round(b / 255 * 5); - - return ansi; -}; - -convert.ansi16.rgb = function (args) { - var color = args % 10; - - // handle greyscale - if (color === 0 || color === 7) { - if (args > 50) { - color += 3.5; - } - - color = color / 10.5 * 255; - - return [color, color, color]; - } - - var mult = (~~(args > 50) + 1) * 0.5; - var r = ((color & 1) * mult) * 255; - var g = (((color >> 1) & 1) * mult) * 255; - var b = (((color >> 2) & 1) * mult) * 255; - - return [r, g, b]; -}; - -convert.ansi256.rgb = function (args) { - // handle greyscale - if (args >= 232) { - var c = (args - 232) * 10 + 8; - return [c, c, c]; - } - - args -= 16; - - var rem; - var r = Math.floor(args / 36) / 5 * 255; - var g = Math.floor((rem = args % 36) / 6) / 5 * 255; - var b = (rem % 6) / 5 * 255; - - return [r, g, b]; -}; - -convert.rgb.hex = function (args) { - var integer = ((Math.round(args[0]) & 0xFF) << 16) - + ((Math.round(args[1]) & 0xFF) << 8) - + (Math.round(args[2]) & 0xFF); - - var string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; - -convert.hex.rgb = function (args) { - var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { - return [0, 0, 0]; - } - - var colorString = match[0]; - - if (match[0].length === 3) { - colorString = colorString.split('').map(function (char) { - return char + char; - }).join(''); - } - - var integer = parseInt(colorString, 16); - var r = (integer >> 16) & 0xFF; - var g = (integer >> 8) & 0xFF; - var b = integer & 0xFF; - - return [r, g, b]; -}; - -convert.rgb.hcg = function (rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var max = Math.max(Math.max(r, g), b); - var min = Math.min(Math.min(r, g), b); - var chroma = (max - min); - var grayscale; - var hue; - - if (chroma < 1) { - grayscale = min / (1 - chroma); - } else { - grayscale = 0; - } - - if (chroma <= 0) { - hue = 0; - } else - if (max === r) { - hue = ((g - b) / chroma) % 6; - } else - if (max === g) { - hue = 2 + (b - r) / chroma; - } else { - hue = 4 + (r - g) / chroma + 4; - } - - hue /= 6; - hue %= 1; - - return [hue * 360, chroma * 100, grayscale * 100]; -}; - -convert.hsl.hcg = function (hsl) { - var s = hsl[1] / 100; - var l = hsl[2] / 100; - var c = 1; - var f = 0; - - if (l < 0.5) { - c = 2.0 * s * l; - } else { - c = 2.0 * s * (1.0 - l); - } - - if (c < 1.0) { - f = (l - 0.5 * c) / (1.0 - c); - } - - return [hsl[0], c * 100, f * 100]; -}; - -convert.hsv.hcg = function (hsv) { - var s = hsv[1] / 100; - var v = hsv[2] / 100; - - var c = s * v; - var f = 0; - - if (c < 1.0) { - f = (v - c) / (1 - c); - } - - return [hsv[0], c * 100, f * 100]; -}; - -convert.hcg.rgb = function (hcg) { - var h = hcg[0] / 360; - var c = hcg[1] / 100; - var g = hcg[2] / 100; - - if (c === 0.0) { - return [g * 255, g * 255, g * 255]; - } - - var pure = [0, 0, 0]; - var hi = (h % 1) * 6; - var v = hi % 1; - var w = 1 - v; - var mg = 0; - - switch (Math.floor(hi)) { - case 0: - pure[0] = 1; pure[1] = v; pure[2] = 0; break; - case 1: - pure[0] = w; pure[1] = 1; pure[2] = 0; break; - case 2: - pure[0] = 0; pure[1] = 1; pure[2] = v; break; - case 3: - pure[0] = 0; pure[1] = w; pure[2] = 1; break; - case 4: - pure[0] = v; pure[1] = 0; pure[2] = 1; break; - default: - pure[0] = 1; pure[1] = 0; pure[2] = w; - } - - mg = (1.0 - c) * g; - - return [ - (c * pure[0] + mg) * 255, - (c * pure[1] + mg) * 255, - (c * pure[2] + mg) * 255 - ]; -}; - -convert.hcg.hsv = function (hcg) { - var c = hcg[1] / 100; - var g = hcg[2] / 100; - - var v = c + g * (1.0 - c); - var f = 0; - - if (v > 0.0) { - f = c / v; - } - - return [hcg[0], f * 100, v * 100]; -}; - -convert.hcg.hsl = function (hcg) { - var c = hcg[1] / 100; - var g = hcg[2] / 100; - - var l = g * (1.0 - c) + 0.5 * c; - var s = 0; - - if (l > 0.0 && l < 0.5) { - s = c / (2 * l); - } else - if (l >= 0.5 && l < 1.0) { - s = c / (2 * (1 - l)); - } - - return [hcg[0], s * 100, l * 100]; -}; - -convert.hcg.hwb = function (hcg) { - var c = hcg[1] / 100; - var g = hcg[2] / 100; - var v = c + g * (1.0 - c); - return [hcg[0], (v - c) * 100, (1 - v) * 100]; -}; - -convert.hwb.hcg = function (hwb) { - var w = hwb[1] / 100; - var b = hwb[2] / 100; - var v = 1 - b; - var c = v - w; - var g = 0; - - if (c < 1) { - g = (v - c) / (1 - c); - } - - return [hwb[0], c * 100, g * 100]; -}; - -convert.apple.rgb = function (apple) { - return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; -}; - -convert.rgb.apple = function (rgb) { - return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; -}; - -convert.gray.rgb = function (args) { - return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; -}; - -convert.gray.hsl = convert.gray.hsv = function (args) { - return [0, 0, args[0]]; -}; - -convert.gray.hwb = function (gray) { - return [0, 100, gray[0]]; -}; - -convert.gray.cmyk = function (gray) { - return [0, 0, 0, gray[0]]; -}; - -convert.gray.lab = function (gray) { - return [gray[0], 0, 0]; -}; - -convert.gray.hex = function (gray) { - var val = Math.round(gray[0] / 100 * 255) & 0xFF; - var integer = (val << 16) + (val << 8) + val; - - var string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; - -convert.rgb.gray = function (rgb) { - var val = (rgb[0] + rgb[1] + rgb[2]) / 3; - return [val / 255 * 100]; -}; - - -/***/ }), -/* 329 */ -/***/ (function(module, exports, __webpack_require__) { - -var util = __webpack_require__(9); -var Stream = __webpack_require__(35).Stream; -var DelayedStream = __webpack_require__(689); -var defer = __webpack_require__(620); - -module.exports = CombinedStream; -function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - - this._released = false; - this._streams = []; - this._currentStream = null; -} -util.inherits(CombinedStream, Stream); - -CombinedStream.create = function(options) { - var combinedStream = new this(); - - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - - return combinedStream; -}; - -CombinedStream.isStreamLike = function(stream) { - return (typeof stream !== 'function') - && (typeof stream !== 'string') - && (typeof stream !== 'boolean') - && (typeof stream !== 'number') - && (!Buffer.isBuffer(stream)); -}; - -CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams, - }); - stream.on('data', this._checkDataSize.bind(this)); - stream = newStream; - } - - this._handleErrors(stream); - - if (this.pauseStreams) { - stream.pause(); - } - } - - this._streams.push(stream); - return this; -}; - -CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); - return dest; -}; - -CombinedStream.prototype._getNext = function() { - this._currentStream = null; - var stream = this._streams.shift(); - - - if (typeof stream == 'undefined') { - this.end(); - return; - } - - if (typeof stream !== 'function') { - this._pipeNext(stream); - return; - } - - var getStream = stream; - getStream(function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('data', this._checkDataSize.bind(this)); - this._handleErrors(stream); - } - - defer(this._pipeNext.bind(this, stream)); - }.bind(this)); -}; - -CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('end', this._getNext.bind(this)); - stream.pipe(this, {end: false}); - return; - } - - var value = stream; - this.write(value); - this._getNext(); -}; - -CombinedStream.prototype._handleErrors = function(stream) { - var self = this; - stream.on('error', function(err) { - self._emitError(err); - }); -}; - -CombinedStream.prototype.write = function(data) { - this.emit('data', data); -}; - -CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); - this.emit('pause'); -}; - -CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); - this.emit('resume'); -}; - -CombinedStream.prototype.end = function() { - this._reset(); - this.emit('end'); -}; - -CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit('close'); -}; - -CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; -}; - -CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; - this._emitError(new Error(message)); -}; - -CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - - var self = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - - self.dataSize += stream.dataSize; - }); - - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } -}; - -CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit('error', err); -}; - - -/***/ }), -/* 330 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var dP = __webpack_require__(63).f; -var create = __webpack_require__(124); -var redefineAll = __webpack_require__(226); -var ctx = __webpack_require__(67); -var anInstance = __webpack_require__(216); -var forOf = __webpack_require__(121); -var $iterDefine = __webpack_require__(222); -var step = __webpack_require__(340); -var setSpecies = __webpack_require__(351); -var DESCRIPTORS = __webpack_require__(68); -var fastKey = __webpack_require__(223).fastKey; -var validate = __webpack_require__(231); -var SIZE = DESCRIPTORS ? '_s' : 'size'; - -var getEntry = function (that, key) { - // fast case - var index = fastKey(key); - var entry; - if (index !== 'F') return that._i[index]; - // frozen object case - for (entry = that._f; entry; entry = entry.n) { - if (entry.k == key) return entry; - } -}; - -module.exports = { - getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { - var C = wrapper(function (that, iterable) { - anInstance(that, C, NAME, '_i'); - that._t = NAME; // collection type - that._i = create(null); // index - that._f = undefined; // first entry - that._l = undefined; // last entry - that[SIZE] = 0; // size - if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); - }); - redefineAll(C.prototype, { - // 23.1.3.1 Map.prototype.clear() - // 23.2.3.2 Set.prototype.clear() - clear: function clear() { - for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { - entry.r = true; - if (entry.p) entry.p = entry.p.n = undefined; - delete data[entry.i]; - } - that._f = that._l = undefined; - that[SIZE] = 0; - }, - // 23.1.3.3 Map.prototype.delete(key) - // 23.2.3.4 Set.prototype.delete(value) - 'delete': function (key) { - var that = validate(this, NAME); - var entry = getEntry(that, key); - if (entry) { - var next = entry.n; - var prev = entry.p; - delete that._i[entry.i]; - entry.r = true; - if (prev) prev.n = next; - if (next) next.p = prev; - if (that._f == entry) that._f = next; - if (that._l == entry) that._l = prev; - that[SIZE]--; - } return !!entry; - }, - // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) - // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) - forEach: function forEach(callbackfn /* , that = undefined */) { - validate(this, NAME); - var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); - var entry; - while (entry = entry ? entry.n : this._f) { - f(entry.v, entry.k, this); - // revert to the last existing entry - while (entry && entry.r) entry = entry.p; - } - }, - // 23.1.3.7 Map.prototype.has(key) - // 23.2.3.7 Set.prototype.has(value) - has: function has(key) { - return !!getEntry(validate(this, NAME), key); - } - }); - if (DESCRIPTORS) dP(C.prototype, 'size', { - get: function () { - return validate(this, NAME)[SIZE]; - } - }); - return C; - }, - def: function (that, key, value) { - var entry = getEntry(that, key); - var prev, index; - // change existing entry - if (entry) { - entry.v = value; - // create new entry - } else { - that._l = entry = { - i: index = fastKey(key, true), // <- index - k: key, // <- key - v: value, // <- value - p: prev = that._l, // <- previous entry - n: undefined, // <- next entry - r: false // <- removed - }; - if (!that._f) that._f = entry; - if (prev) prev.n = entry; - that[SIZE]++; - // add to index - if (index !== 'F') that._i[index] = entry; - } return that; - }, - getEntry: getEntry, - setStrong: function (C, NAME, IS_MAP) { - // add .keys, .values, .entries, [@@iterator] - // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 - $iterDefine(C, NAME, function (iterated, kind) { - this._t = validate(iterated, NAME); // target - this._k = kind; // kind - this._l = undefined; // previous - }, function () { - var that = this; - var kind = that._k; - var entry = that._l; - // revert to the last existing entry - while (entry && entry.r) entry = entry.p; - // get next entry - if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { - // or finish the iteration - that._t = undefined; - return step(1); - } - // return step by kind - if (kind == 'keys') return step(0, entry.k); - if (kind == 'values') return step(0, entry.v); - return step(0, [entry.k, entry.v]); - }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); - - // add [@@species], 23.1.2.2, 23.2.2.2 - setSpecies(NAME); - } -}; - - -/***/ }), -/* 331 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var classof = __webpack_require__(217); -var from = __webpack_require__(638); -module.exports = function (NAME) { - return function toJSON() { - if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); - return from(this); - }; -}; - - -/***/ }), -/* 332 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(37); -var $export = __webpack_require__(33); -var meta = __webpack_require__(223); -var fails = __webpack_require__(76); -var hide = __webpack_require__(77); -var redefineAll = __webpack_require__(226); -var forOf = __webpack_require__(121); -var anInstance = __webpack_require__(216); -var isObject = __webpack_require__(49); -var setToStringTag = __webpack_require__(127); -var dP = __webpack_require__(63).f; -var each = __webpack_require__(640)(0); -var DESCRIPTORS = __webpack_require__(68); - -module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { - var Base = global[NAME]; - var C = Base; - var ADDER = IS_MAP ? 'set' : 'add'; - var proto = C && C.prototype; - var O = {}; - if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { - new C().entries().next(); - }))) { - // create collection constructor - C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); - redefineAll(C.prototype, methods); - meta.NEED = true; - } else { - C = wrapper(function (target, iterable) { - anInstance(target, C, NAME, '_c'); - target._c = new Base(); - if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target); - }); - each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) { - var IS_ADDER = KEY == 'add' || KEY == 'set'; - if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) { - anInstance(this, C, KEY); - if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false; - var result = this._c[KEY](a === 0 ? 0 : a, b); - return IS_ADDER ? this : result; - }); - }); - IS_WEAK || dP(C.prototype, 'size', { - get: function () { - return this._c.size; - } - }); - } - - setToStringTag(C, NAME); - - O[NAME] = C; - $export($export.G + $export.W + $export.F, O); - - if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); - - return C; -}; - - -/***/ }), -/* 333 */ -/***/ (function(module, exports, __webpack_require__) { - -var document = __webpack_require__(37).document; +var document = __webpack_require__(17).document; module.exports = document && document.documentElement; /***/ }), -/* 334 */ +/* 129 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = !__webpack_require__(68) && !__webpack_require__(76)(function () { - return Object.defineProperty(__webpack_require__(219)('div'), 'a', { get: function () { return 7; } }).a != 7; -}); +"use strict"; +var LIBRARY = __webpack_require__(93); +var $export = __webpack_require__(60); +var redefine = __webpack_require__(251); +var hide = __webpack_require__(42); +var Iterators = __webpack_require__(53); +var $iterCreate = __webpack_require__(242); +var setToStringTag = __webpack_require__(95); +var getPrototypeOf = __webpack_require__(248); +var ITERATOR = __webpack_require__(20)('iterator'); +var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` +var FF_ITERATOR = '@@iterator'; +var KEYS = 'keys'; +var VALUES = 'values'; -/***/ }), -/* 335 */ -/***/ (function(module, exports) { +var returnThis = function () { return this; }; -// fast apply, http://jsperf.lnkit.com/fast-apply/5 -module.exports = function (fn, args, that) { - var un = that === undefined; - switch (args.length) { - case 0: return un ? fn() - : fn.call(that); - case 1: return un ? fn(args[0]) - : fn.call(that, args[0]); - case 2: return un ? fn(args[0], args[1]) - : fn.call(that, args[0], args[1]); - case 3: return un ? fn(args[0], args[1], args[2]) - : fn.call(that, args[0], args[1], args[2]); - case 4: return un ? fn(args[0], args[1], args[2], args[3]) - : fn.call(that, args[0], args[1], args[2], args[3]); - } return fn.apply(that, args); -}; - - -/***/ }), -/* 336 */ -/***/ (function(module, exports, __webpack_require__) { - -// check on default Array iterator -var Iterators = __webpack_require__(122); -var ITERATOR = __webpack_require__(44)('iterator'); -var ArrayProto = Array.prototype; - -module.exports = function (it) { - return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); -}; - - -/***/ }), -/* 337 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.2.2 IsArray(argument) -var cof = __webpack_require__(120); -module.exports = Array.isArray || function isArray(arg) { - return cof(arg) == 'Array'; -}; - - -/***/ }), -/* 338 */ -/***/ (function(module, exports, __webpack_require__) { - -// call something on iterator step with safe closing on error -var anObject = __webpack_require__(57); -module.exports = function (iterator, fn, value, entries) { - try { - return entries ? fn(anObject(value)[0], value[1]) : fn(value); - // 7.4.6 IteratorClose(iterator, completion) - } catch (e) { - var ret = iterator['return']; - if (ret !== undefined) anObject(ret.call(iterator)); - throw e; +module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + $iterCreate(Constructor, NAME, next); + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + switch (kind) { + case KEYS: return function keys() { return new Constructor(this, kind); }; + case VALUES: return function values() { return new Constructor(this, kind); }; + } return function entries() { return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = $native || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; + // Fix native + if ($anyNative) { + IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); + } } -}; - - -/***/ }), -/* 339 */ -/***/ (function(module, exports, __webpack_require__) { - -var ITERATOR = __webpack_require__(44)('iterator'); -var SAFE_CLOSING = false; - -try { - var riter = [7][ITERATOR](); - riter['return'] = function () { SAFE_CLOSING = true; }; - // eslint-disable-next-line no-throw-literal - Array.from(riter, function () { throw 2; }); -} catch (e) { /* empty */ } - -module.exports = function (exec, skipClosing) { - if (!skipClosing && !SAFE_CLOSING) return false; - var safe = false; - try { - var arr = [7]; - var iter = arr[ITERATOR](); - iter.next = function () { return { done: safe = true }; }; - arr[ITERATOR] = function () { return iter; }; - exec(arr); - } catch (e) { /* empty */ } - return safe; -}; - - -/***/ }), -/* 340 */ -/***/ (function(module, exports) { - -module.exports = function (done, value) { - return { value: value, done: !!done }; -}; - - -/***/ }), -/* 341 */ -/***/ (function(module, exports, __webpack_require__) { - -var pIE = __webpack_require__(125); -var createDesc = __webpack_require__(126); -var toIObject = __webpack_require__(90); -var toPrimitive = __webpack_require__(230); -var has = __webpack_require__(89); -var IE8_DOM_DEFINE = __webpack_require__(334); -var gOPD = Object.getOwnPropertyDescriptor; - -exports.f = __webpack_require__(68) ? gOPD : function getOwnPropertyDescriptor(O, P) { - O = toIObject(O); - P = toPrimitive(P, true); - if (IE8_DOM_DEFINE) try { - return gOPD(O, P); - } catch (e) { /* empty */ } - if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); -}; - - -/***/ }), -/* 342 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) -var $keys = __webpack_require__(344); -var hiddenKeys = __webpack_require__(220).concat('length', 'prototype'); - -exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return $keys(O, hiddenKeys); -}; - - -/***/ }), -/* 343 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) -var has = __webpack_require__(89); -var toObject = __webpack_require__(103); -var IE_PROTO = __webpack_require__(227)('IE_PROTO'); -var ObjectProto = Object.prototype; - -module.exports = Object.getPrototypeOf || function (O) { - O = toObject(O); - if (has(O, IE_PROTO)) return O[IE_PROTO]; - if (typeof O.constructor == 'function' && O instanceof O.constructor) { - return O.constructor.prototype; - } return O instanceof Object ? ObjectProto : null; -}; - - -/***/ }), -/* 344 */ -/***/ (function(module, exports, __webpack_require__) { - -var has = __webpack_require__(89); -var toIObject = __webpack_require__(90); -var arrayIndexOf = __webpack_require__(639)(false); -var IE_PROTO = __webpack_require__(227)('IE_PROTO'); - -module.exports = function (object, names) { - var O = toIObject(object); - var i = 0; - var result = []; - var key; - for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); - // Don't enum bug & hidden keys - while (names.length > i) if (has(O, key = names[i++])) { - ~arrayIndexOf(result, key) || result.push(key); + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + $default = function values() { return $native.call(this); }; } - return result; + // Define iterator + if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if (FORCED) for (key in methods) { + if (!(key in proto)) redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; }; /***/ }), -/* 345 */ -/***/ (function(module, exports, __webpack_require__) { - -// most Object methods by ES6 should accept primitives -var $export = __webpack_require__(33); -var core = __webpack_require__(26); -var fails = __webpack_require__(76); -module.exports = function (KEY, exec) { - var fn = (core.Object || {})[KEY] || Object[KEY]; - var exp = {}; - exp[KEY] = exec(fn); - $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); -}; - - -/***/ }), -/* 346 */ +/* 130 */ /***/ (function(module, exports) { module.exports = function (exec) { @@ -69806,12 +39130,12 @@ module.exports = function (exec) { /***/ }), -/* 347 */ +/* 131 */ /***/ (function(module, exports, __webpack_require__) { -var anObject = __webpack_require__(57); -var isObject = __webpack_require__(49); -var newPromiseCapability = __webpack_require__(224); +var anObject = __webpack_require__(35); +var isObject = __webpack_require__(52); +var newPromiseCapability = __webpack_require__(94); module.exports = function (C, x) { anObject(C); @@ -69824,95 +39148,45 @@ module.exports = function (C, x) { /***/ }), -/* 348 */ -/***/ (function(module, exports, __webpack_require__) { +/* 132 */ +/***/ (function(module, exports) { -module.exports = __webpack_require__(77); - - -/***/ }), -/* 349 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = __webpack_require__(33); -var aFunction = __webpack_require__(88); -var ctx = __webpack_require__(67); -var forOf = __webpack_require__(121); - -module.exports = function (COLLECTION) { - $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { - var mapFn = arguments[1]; - var mapping, A, n, cb; - aFunction(this); - mapping = mapFn !== undefined; - if (mapping) aFunction(mapFn); - if (source == undefined) return new this(); - A = []; - if (mapping) { - n = 0; - cb = ctx(mapFn, arguments[2], 2); - forOf(source, false, function (nextItem) { - A.push(cb(nextItem, n++)); - }); - } else { - forOf(source, false, A.push, A); - } - return new this(A); - } }); +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; }; /***/ }), -/* 350 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var core = __webpack_require__(31); +var global = __webpack_require__(17); +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || (global[SHARED] = {}); -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = __webpack_require__(33); - -module.exports = function (COLLECTION) { - $export($export.S, COLLECTION, { of: function of() { - var length = arguments.length; - var A = new Array(length); - while (length--) A[length] = arguments[length]; - return new this(A); - } }); -}; +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: core.version, + mode: __webpack_require__(93) ? 'pure' : 'global', + copyright: '© 2018 Denis Pushkarev (zloirock.ru)' +}); /***/ }), -/* 351 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(37); -var core = __webpack_require__(26); -var dP = __webpack_require__(63); -var DESCRIPTORS = __webpack_require__(68); -var SPECIES = __webpack_require__(44)('species'); - -module.exports = function (KEY) { - var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; - if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { - configurable: true, - get: function () { return this; } - }); -}; - - -/***/ }), -/* 352 */ +/* 134 */ /***/ (function(module, exports, __webpack_require__) { // 7.3.20 SpeciesConstructor(O, defaultConstructor) -var anObject = __webpack_require__(57); -var aFunction = __webpack_require__(88); -var SPECIES = __webpack_require__(44)('species'); +var anObject = __webpack_require__(35); +var aFunction = __webpack_require__(67); +var SPECIES = __webpack_require__(20)('species'); module.exports = function (O, D) { var C = anObject(O).constructor; var S; @@ -69921,14 +39195,14 @@ module.exports = function (O, D) { /***/ }), -/* 353 */ +/* 135 */ /***/ (function(module, exports, __webpack_require__) { -var ctx = __webpack_require__(67); -var invoke = __webpack_require__(335); -var html = __webpack_require__(333); -var cel = __webpack_require__(219); -var global = __webpack_require__(37); +var ctx = __webpack_require__(69); +var invoke = __webpack_require__(239); +var html = __webpack_require__(128); +var cel = __webpack_require__(92); +var global = __webpack_require__(17); var process = global.process; var setTask = global.setImmediate; var clearTask = global.clearImmediate; @@ -69967,7 +39241,7 @@ if (!setTask || !clearTask) { delete queue[id]; }; // Node.js 0.8- - if (__webpack_require__(120)(process) == 'process') { + if (__webpack_require__(68)(process) == 'process') { defer = function (id) { process.nextTick(ctx(run, id, 1)); }; @@ -70011,7 +39285,30 @@ module.exports = { /***/ }), -/* 354 */ +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.15 ToLength +var toInteger = __webpack_require__(97); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + + +/***/ }), +/* 137 */ +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + + +/***/ }), +/* 138 */ /***/ (function(module, exports, __webpack_require__) { @@ -70027,7 +39324,7 @@ exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; -exports.humanize = __webpack_require__(833); +exports.humanize = __webpack_require__(301); /** * Active `debug` instances. @@ -70242,396 +39539,574 @@ function coerce(val) { /***/ }), -/* 355 */ +/* 139 */ /***/ (function(module, exports, __webpack_require__) { -var stream = __webpack_require__(91) -var eos = __webpack_require__(163) -var inherits = __webpack_require__(78) -var shift = __webpack_require__(1015) +// Basic Javascript Elliptic Curve implementation +// Ported loosely from BouncyCastle's Java EC code +// Only Fp curves implemented for now -var SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from) - ? Buffer.from([0]) - : new Buffer([0]) +// Requires jsbn.js and jsbn2.js +var BigInteger = __webpack_require__(81).BigInteger +var Barrett = BigInteger.prototype.Barrett -var onuncork = function(self, fn) { - if (self._corked) self.once('uncork', fn) - else fn() +// ---------------- +// ECFieldElementFp + +// constructor +function ECFieldElementFp(q,x) { + this.x = x; + // TODO if(x.compareTo(q) >= 0) error + this.q = q; } -var autoDestroy = function (self, err) { - if (self._autoDestroy) self.destroy(err) +function feFpEquals(other) { + if(other == this) return true; + return (this.q.equals(other.q) && this.x.equals(other.x)); } -var destroyer = function(self, end) { - return function(err) { - if (err) autoDestroy(self, err.message === 'premature close' ? null : err) - else if (end && !self._ended) self.end() - } +function feFpToBigInteger() { + return this.x; } -var end = function(ws, fn) { - if (!ws) return fn() - if (ws._writableState && ws._writableState.finished) return fn() - if (ws._writableState) return ws.end(fn) - ws.end() - fn() +function feFpNegate() { + return new ECFieldElementFp(this.q, this.x.negate().mod(this.q)); } -var toStreams2 = function(rs) { - return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs) +function feFpAdd(b) { + return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q)); } -var Duplexify = function(writable, readable, opts) { - if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts) - stream.Duplex.call(this, opts) - - this._writable = null - this._readable = null - this._readable2 = null - - this._autoDestroy = !opts || opts.autoDestroy !== false - this._forwardDestroy = !opts || opts.destroy !== false - this._forwardEnd = !opts || opts.end !== false - this._corked = 1 // start corked - this._ondrain = null - this._drained = false - this._forwarding = false - this._unwrite = null - this._unread = null - this._ended = false - - this.destroyed = false - - if (writable) this.setWritable(writable) - if (readable) this.setReadable(readable) +function feFpSubtract(b) { + return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q)); } -inherits(Duplexify, stream.Duplex) - -Duplexify.obj = function(writable, readable, opts) { - if (!opts) opts = {} - opts.objectMode = true - opts.highWaterMark = 16 - return new Duplexify(writable, readable, opts) +function feFpMultiply(b) { + return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q)); } -Duplexify.prototype.cork = function() { - if (++this._corked === 1) this.emit('cork') +function feFpSquare() { + return new ECFieldElementFp(this.q, this.x.square().mod(this.q)); } -Duplexify.prototype.uncork = function() { - if (this._corked && --this._corked === 0) this.emit('uncork') +function feFpDivide(b) { + return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q)); } -Duplexify.prototype.setWritable = function(writable) { - if (this._unwrite) this._unwrite() +ECFieldElementFp.prototype.equals = feFpEquals; +ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger; +ECFieldElementFp.prototype.negate = feFpNegate; +ECFieldElementFp.prototype.add = feFpAdd; +ECFieldElementFp.prototype.subtract = feFpSubtract; +ECFieldElementFp.prototype.multiply = feFpMultiply; +ECFieldElementFp.prototype.square = feFpSquare; +ECFieldElementFp.prototype.divide = feFpDivide; - if (this.destroyed) { - if (writable && writable.destroy) writable.destroy() - return - } +// ---------------- +// ECPointFp - if (writable === null || writable === false) { - this.end() - return - } - - var self = this - var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd)) - - var ondrain = function() { - var ondrain = self._ondrain - self._ondrain = null - if (ondrain) ondrain() - } - - var clear = function() { - self._writable.removeListener('drain', ondrain) - unend() - } - - if (this._unwrite) process.nextTick(ondrain) // force a drain on stream reset to avoid livelocks - - this._writable = writable - this._writable.on('drain', ondrain) - this._unwrite = clear - - this.uncork() // always uncork setWritable -} - -Duplexify.prototype.setReadable = function(readable) { - if (this._unread) this._unread() - - if (this.destroyed) { - if (readable && readable.destroy) readable.destroy() - return - } - - if (readable === null || readable === false) { - this.push(null) - this.resume() - return - } - - var self = this - var unend = eos(readable, {writable:false, readable:true}, destroyer(this)) - - var onreadable = function() { - self._forward() - } - - var onend = function() { - self.push(null) - } - - var clear = function() { - self._readable2.removeListener('readable', onreadable) - self._readable2.removeListener('end', onend) - unend() - } - - this._drained = true - this._readable = readable - this._readable2 = readable._readableState ? readable : toStreams2(readable) - this._readable2.on('readable', onreadable) - this._readable2.on('end', onend) - this._unread = clear - - this._forward() -} - -Duplexify.prototype._read = function() { - this._drained = true - this._forward() -} - -Duplexify.prototype._forward = function() { - if (this._forwarding || !this._readable2 || !this._drained) return - this._forwarding = true - - var data - - while (this._drained && (data = shift(this._readable2)) !== null) { - if (this.destroyed) continue - this._drained = this.push(data) - } - - this._forwarding = false -} - -Duplexify.prototype.destroy = function(err) { - if (this.destroyed) return - this.destroyed = true - - var self = this - process.nextTick(function() { - self._destroy(err) - }) -} - -Duplexify.prototype._destroy = function(err) { - if (err) { - var ondrain = this._ondrain - this._ondrain = null - if (ondrain) ondrain(err) - else this.emit('error', err) - } - - if (this._forwardDestroy) { - if (this._readable && this._readable.destroy) this._readable.destroy() - if (this._writable && this._writable.destroy) this._writable.destroy() - } - - this.emit('close') -} - -Duplexify.prototype._write = function(data, enc, cb) { - if (this.destroyed) return cb() - if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb)) - if (data === SIGNAL_FLUSH) return this._finish(cb) - if (!this._writable) return cb() - - if (this._writable.write(data) === false) this._ondrain = cb - else cb() -} - - -Duplexify.prototype._finish = function(cb) { - var self = this - this.emit('preend') - onuncork(this, function() { - end(self._forwardEnd && self._writable, function() { - // haxx to not emit prefinish twice - if (self._writableState.prefinished === false) self._writableState.prefinished = true - self.emit('prefinish') - onuncork(self, cb) - }) - }) -} - -Duplexify.prototype.end = function(data, enc, cb) { - if (typeof data === 'function') return this.end(null, null, data) - if (typeof enc === 'function') return this.end(data, null, enc) - this._ended = true - if (data) this.write(data) - if (!this._writableState.ending) this.write(SIGNAL_FLUSH) - return stream.Writable.prototype.end.call(this, cb) -} - -module.exports = Duplexify - - -/***/ }), -/* 356 */ -/***/ (function(module, exports, __webpack_require__) { - -var crypto = __webpack_require__(21); -var BigInteger = __webpack_require__(79).BigInteger; -var ECPointFp = __webpack_require__(129).ECPointFp; -var Buffer = __webpack_require__(20).Buffer; -exports.ECCurves = __webpack_require__(693); - -// zero prepad -function unstupid(hex,len) -{ - return (hex.length >= len) ? hex : unstupid("0"+hex,len); -} - -exports.ECKey = function(curve, key, isPublic) -{ - var priv; - var c = curve(); - var n = c.getN(); - var bytes = Math.floor(n.bitLength()/8); - - if(key) - { - if(isPublic) - { - var curve = c.getCurve(); -// var x = key.slice(1,bytes+1); // skip the 04 for uncompressed format -// var y = key.slice(bytes+1); -// this.P = new ECPointFp(curve, -// curve.fromBigInteger(new BigInteger(x.toString("hex"), 16)), -// curve.fromBigInteger(new BigInteger(y.toString("hex"), 16))); - this.P = curve.decodePointHex(key.toString("hex")); - }else{ - if(key.length != bytes) return false; - priv = new BigInteger(key.toString("hex"), 16); +// constructor +function ECPointFp(curve,x,y,z) { + this.curve = curve; + this.x = x; + this.y = y; + // Projective coordinates: either zinv == null or z * zinv == 1 + // z and zinv are just BigIntegers, not fieldElements + if(z == null) { + this.z = BigInteger.ONE; } - }else{ - var n1 = n.subtract(BigInteger.ONE); - var r = new BigInteger(crypto.randomBytes(n.bitLength())); - priv = r.mod(n1).add(BigInteger.ONE); - this.P = c.getG().multiply(priv); + else { + this.z = z; + } + this.zinv = null; + //TODO: compression flag +} + +function pointFpGetX() { + if(this.zinv == null) { + this.zinv = this.z.modInverse(this.curve.q); + } + var r = this.x.toBigInteger().multiply(this.zinv); + this.curve.reduce(r); + return this.curve.fromBigInteger(r); +} + +function pointFpGetY() { + if(this.zinv == null) { + this.zinv = this.z.modInverse(this.curve.q); + } + var r = this.y.toBigInteger().multiply(this.zinv); + this.curve.reduce(r); + return this.curve.fromBigInteger(r); +} + +function pointFpEquals(other) { + if(other == this) return true; + if(this.isInfinity()) return other.isInfinity(); + if(other.isInfinity()) return this.isInfinity(); + var u, v; + // u = Y2 * Z1 - Y1 * Z2 + u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q); + if(!u.equals(BigInteger.ZERO)) return false; + // v = X2 * Z1 - X1 * Z2 + v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q); + return v.equals(BigInteger.ZERO); +} + +function pointFpIsInfinity() { + if((this.x == null) && (this.y == null)) return true; + return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO); +} + +function pointFpNegate() { + return new ECPointFp(this.curve, this.x, this.y.negate(), this.z); +} + +function pointFpAdd(b) { + if(this.isInfinity()) return b; + if(b.isInfinity()) return this; + + // u = Y2 * Z1 - Y1 * Z2 + var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q); + // v = X2 * Z1 - X1 * Z2 + var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q); + + if(BigInteger.ZERO.equals(v)) { + if(BigInteger.ZERO.equals(u)) { + return this.twice(); // this == b, so double + } + return this.curve.getInfinity(); // this = -b, so infinity + } + + var THREE = new BigInteger("3"); + var x1 = this.x.toBigInteger(); + var y1 = this.y.toBigInteger(); + var x2 = b.x.toBigInteger(); + var y2 = b.y.toBigInteger(); + + var v2 = v.square(); + var v3 = v2.multiply(v); + var x1v2 = x1.multiply(v2); + var zu2 = u.square().multiply(this.z); + + // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3) + var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q); + // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3 + var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q); + // z3 = v^3 * z1 * z2 + var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q); + + return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); +} + +function pointFpTwice() { + if(this.isInfinity()) return this; + if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity(); + + // TODO: optimized handling of constants + var THREE = new BigInteger("3"); + var x1 = this.x.toBigInteger(); + var y1 = this.y.toBigInteger(); + + var y1z1 = y1.multiply(this.z); + var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q); + var a = this.curve.a.toBigInteger(); + + // w = 3 * x1^2 + a * z1^2 + var w = x1.square().multiply(THREE); + if(!BigInteger.ZERO.equals(a)) { + w = w.add(this.z.square().multiply(a)); + } + w = w.mod(this.curve.q); + //this.curve.reduce(w); + // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1) + var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q); + // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3 + var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q); + // z3 = 8 * (y1 * z1)^3 + var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q); + + return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); +} + +// Simple NAF (Non-Adjacent Form) multiplication algorithm +// TODO: modularize the multiplication algorithm +function pointFpMultiply(k) { + if(this.isInfinity()) return this; + if(k.signum() == 0) return this.curve.getInfinity(); + + var e = k; + var h = e.multiply(new BigInteger("3")); + + var neg = this.negate(); + var R = this; + + var i; + for(i = h.bitLength() - 2; i > 0; --i) { + R = R.twice(); + + var hBit = h.testBit(i); + var eBit = e.testBit(i); + + if (hBit != eBit) { + R = R.add(hBit ? this : neg); + } + } + + return R; +} + +// Compute this*j + x*k (simultaneous multiplication) +function pointFpMultiplyTwo(j,x,k) { + var i; + if(j.bitLength() > k.bitLength()) + i = j.bitLength() - 1; + else + i = k.bitLength() - 1; + + var R = this.curve.getInfinity(); + var both = this.add(x); + while(i >= 0) { + R = R.twice(); + if(j.testBit(i)) { + if(k.testBit(i)) { + R = R.add(both); + } + else { + R = R.add(this); + } + } + else { + if(k.testBit(i)) { + R = R.add(x); + } + } + --i; } - if(this.P) - { -// var pubhex = unstupid(this.P.getX().toBigInteger().toString(16),bytes*2)+unstupid(this.P.getY().toBigInteger().toString(16),bytes*2); -// this.PublicKey = Buffer.from("04"+pubhex,"hex"); - this.PublicKey = Buffer.from(c.getCurve().encodeCompressedPointHex(this.P),"hex"); - } - if(priv) - { - this.PrivateKey = Buffer.from(unstupid(priv.toString(16),bytes*2),"hex"); - this.deriveSharedSecret = function(key) + + return R; +} + +ECPointFp.prototype.getX = pointFpGetX; +ECPointFp.prototype.getY = pointFpGetY; +ECPointFp.prototype.equals = pointFpEquals; +ECPointFp.prototype.isInfinity = pointFpIsInfinity; +ECPointFp.prototype.negate = pointFpNegate; +ECPointFp.prototype.add = pointFpAdd; +ECPointFp.prototype.twice = pointFpTwice; +ECPointFp.prototype.multiply = pointFpMultiply; +ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo; + +// ---------------- +// ECCurveFp + +// constructor +function ECCurveFp(q,a,b) { + this.q = q; + this.a = this.fromBigInteger(a); + this.b = this.fromBigInteger(b); + this.infinity = new ECPointFp(this, null, null); + this.reducer = new Barrett(this.q); +} + +function curveFpGetQ() { + return this.q; +} + +function curveFpGetA() { + return this.a; +} + +function curveFpGetB() { + return this.b; +} + +function curveFpEquals(other) { + if(other == this) return true; + return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b)); +} + +function curveFpGetInfinity() { + return this.infinity; +} + +function curveFpFromBigInteger(x) { + return new ECFieldElementFp(this.q, x); +} + +function curveReduce(x) { + this.reducer.reduce(x); +} + +// for now, work with hex strings because they're easier in JS +function curveFpDecodePointHex(s) { + switch(parseInt(s.substr(0,2), 16)) { // first byte + case 0: + return this.infinity; + case 2: + case 3: + // point compression not supported yet + return null; + case 4: + case 6: + case 7: + var len = (s.length - 2) / 2; + var xHex = s.substr(2, len); + var yHex = s.substr(len+2, len); + + return new ECPointFp(this, + this.fromBigInteger(new BigInteger(xHex, 16)), + this.fromBigInteger(new BigInteger(yHex, 16))); + + default: // unsupported + return null; + } +} + +function curveFpEncodePointHex(p) { + if (p.isInfinity()) return "00"; + var xHex = p.getX().toBigInteger().toString(16); + var yHex = p.getY().toBigInteger().toString(16); + var oLen = this.getQ().toString(16).length; + if ((oLen % 2) != 0) oLen++; + while (xHex.length < oLen) { + xHex = "0" + xHex; + } + while (yHex.length < oLen) { + yHex = "0" + yHex; + } + return "04" + xHex + yHex; +} + +ECCurveFp.prototype.getQ = curveFpGetQ; +ECCurveFp.prototype.getA = curveFpGetA; +ECCurveFp.prototype.getB = curveFpGetB; +ECCurveFp.prototype.equals = curveFpEquals; +ECCurveFp.prototype.getInfinity = curveFpGetInfinity; +ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger; +ECCurveFp.prototype.reduce = curveReduce; +//ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex; +ECCurveFp.prototype.encodePointHex = curveFpEncodePointHex; + +// from: https://github.com/kaielvin/jsbn-ec-point-compression +ECCurveFp.prototype.decodePointHex = function(s) +{ + var yIsEven; + switch(parseInt(s.substr(0,2), 16)) { // first byte + case 0: + return this.infinity; + case 2: + yIsEven = false; + case 3: + if(yIsEven == undefined) yIsEven = true; + var len = s.length - 2; + var xHex = s.substr(2, len); + var x = this.fromBigInteger(new BigInteger(xHex,16)); + var alpha = x.multiply(x.square().add(this.getA())).add(this.getB()); + var beta = alpha.sqrt(); + + if (beta == null) throw "Invalid point compression"; + + var betaValue = beta.toBigInteger(); + if (betaValue.testBit(0) != yIsEven) { - if(!key || !key.P) return false; - var S = key.P.multiply(priv); - return Buffer.from(unstupid(S.getX().toBigInteger().toString(16),bytes*2),"hex"); - } - } + // Use the other root + beta = this.fromBigInteger(this.getQ().subtract(betaValue)); + } + return new ECPointFp(this,x,beta); + case 4: + case 6: + case 7: + var len = (s.length - 2) / 2; + var xHex = s.substr(2, len); + var yHex = s.substr(len+2, len); + + return new ECPointFp(this, + this.fromBigInteger(new BigInteger(xHex, 16)), + this.fromBigInteger(new BigInteger(yHex, 16))); + + default: // unsupported + return null; + } +} +ECCurveFp.prototype.encodeCompressedPointHex = function(p) +{ + if (p.isInfinity()) return "00"; + var xHex = p.getX().toBigInteger().toString(16); + var oLen = this.getQ().toString(16).length; + if ((oLen % 2) != 0) oLen++; + while (xHex.length < oLen) + xHex = "0" + xHex; + var yPrefix; + if(p.getY().toBigInteger().isEven()) yPrefix = "02"; + else yPrefix = "03"; + + return yPrefix + xHex; } +ECFieldElementFp.prototype.getR = function() +{ + if(this.r != undefined) return this.r; -/***/ }), -/* 357 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; - -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return str.replace(matchOperatorsRe, '\\$&'); -}; - - -/***/ }), -/* 358 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = function (data, opts) { - if (!opts) opts = {}; - if (typeof opts === 'function') opts = { cmp: opts }; - var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; - - var cmp = opts.cmp && (function (f) { - return function (node) { - return function (a, b) { - var aobj = { key: a, value: node[a] }; - var bobj = { key: b, value: node[b] }; - return f(aobj, bobj); - }; - }; - })(opts.cmp); - - var seen = []; - return (function stringify (node) { - if (node && node.toJSON && typeof node.toJSON === 'function') { - node = node.toJSON(); + this.r = null; + var bitLength = this.q.bitLength(); + if (bitLength > 128) + { + var firstWord = this.q.shiftRight(bitLength - 64); + if (firstWord.intValue() == -1) + { + this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q); } - - if (node === undefined) return; - if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; - if (typeof node !== 'object') return JSON.stringify(node); - - var i, out; - if (Array.isArray(node)) { - out = '['; - for (i = 0; i < node.length; i++) { - if (i) out += ','; - out += stringify(node[i]) || 'null'; + } + return this.r; +} +ECFieldElementFp.prototype.modMult = function(x1,x2) +{ + return this.modReduce(x1.multiply(x2)); +} +ECFieldElementFp.prototype.modReduce = function(x) +{ + if (this.getR() != null) + { + var qLen = q.bitLength(); + while (x.bitLength() > (qLen + 1)) + { + var u = x.shiftRight(qLen); + var v = x.subtract(u.shiftLeft(qLen)); + if (!this.getR().equals(BigInteger.ONE)) + { + u = u.multiply(this.getR()); } - return out + ']'; + x = u.add(v); } - - if (node === null) return 'null'; - - if (seen.indexOf(node) !== -1) { - if (cycles) return JSON.stringify('__cycle__'); - throw new TypeError('Converting circular structure to JSON'); + while (x.compareTo(q) >= 0) + { + x = x.subtract(q); } + } + else + { + x = x.mod(q); + } + return x; +} +ECFieldElementFp.prototype.sqrt = function() +{ + if (!this.q.testBit(0)) throw "unsupported"; - var seenIndex = seen.push(node) - 1; - var keys = Object.keys(node).sort(cmp && cmp(node)); - out = ''; - for (i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = stringify(node[key]); + // p mod 4 == 3 + if (this.q.testBit(1)) + { + var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q)); + return z.square().equals(this) ? z : null; + } - if (!value) continue; - if (out) out += ','; - out += JSON.stringify(key) + ':' + value; + // p mod 4 == 1 + var qMinusOne = this.q.subtract(BigInteger.ONE); + + var legendreExponent = qMinusOne.shiftRight(1); + if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE))) + { + return null; + } + + var u = qMinusOne.shiftRight(2); + var k = u.shiftLeft(1).add(BigInteger.ONE); + + var Q = this.x; + var fourQ = modDouble(modDouble(Q)); + + var U, V; + do + { + var P; + do + { + P = new BigInteger(this.q.bitLength(), new SecureRandom()); } - seen.splice(seenIndex, 1); - return '{' + out + '}'; - })(data); -}; + while (P.compareTo(this.q) >= 0 + || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne))); + + var result = this.lucasSequence(P, Q, k); + U = result[0]; + V = result[1]; + + if (this.modMult(V, V).equals(fourQ)) + { + // Integer division by 2, mod q + if (V.testBit(0)) + { + V = V.add(q); + } + + V = V.shiftRight(1); + + return new ECFieldElementFp(q,V); + } + } + while (U.equals(BigInteger.ONE) || U.equals(qMinusOne)); + + return null; +} +ECFieldElementFp.prototype.lucasSequence = function(P,Q,k) +{ + var n = k.bitLength(); + var s = k.getLowestSetBit(); + + var Uh = BigInteger.ONE; + var Vl = BigInteger.TWO; + var Vh = P; + var Ql = BigInteger.ONE; + var Qh = BigInteger.ONE; + + for (var j = n - 1; j >= s + 1; --j) + { + Ql = this.modMult(Ql, Qh); + + if (k.testBit(j)) + { + Qh = this.modMult(Ql, Q); + Uh = this.modMult(Uh, Vh); + Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); + Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1))); + } + else + { + Qh = Ql; + Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); + Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); + Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); + } + } + + Ql = this.modMult(Ql, Qh); + Qh = this.modMult(Ql, Q); + Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); + Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); + Ql = this.modMult(Ql, Qh); + + for (var j = 1; j <= s; ++j) + { + Uh = this.modMult(Uh, Vl); + Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); + Ql = this.modMult(Ql, Ql); + } + + return [ Uh, Vl ]; +} + +var exports = { + ECCurveFp: ECCurveFp, + ECPointFp: ECPointFp, + ECFieldElementFp: ECFieldElementFp +} + +module.exports = exports /***/ }), -/* 359 */ +/* 140 */ /***/ (function(module, exports, __webpack_require__) { module.exports = realpath @@ -70641,13 +40116,13 @@ realpath.realpathSync = realpathSync realpath.monkeypatch = monkeypatch realpath.unmonkeypatch = unmonkeypatch -var fs = __webpack_require__(12) +var fs = __webpack_require__(4) var origRealpath = fs.realpath var origRealpathSync = fs.realpathSync var version = process.version var ok = /^v[0-5]\./.test(version) -var old = __webpack_require__(708) +var old = __webpack_require__(271) function newError (er) { return er && er.syscall === 'realpath' && ( @@ -70703,7 +40178,7 @@ function unmonkeypatch () { /***/ }), -/* 360 */ +/* 141 */ /***/ (function(module, exports, __webpack_require__) { exports.alphasort = alphasort @@ -70720,9 +40195,9 @@ function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } -var path = __webpack_require__(1) -var minimatch = __webpack_require__(169) -var isAbsolute = __webpack_require__(245) +var path = __webpack_require__(0) +var minimatch = __webpack_require__(82) +var isAbsolute = __webpack_require__(101) var Minimatch = minimatch.Minimatch function alphasorti (a, b) { @@ -70949,369 +40424,19 @@ function childrenIgnored (self, path) { /***/ }), -/* 361 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var fs = __webpack_require__(12) - -module.exports = clone(fs) - -function clone (obj) { - if (obj === null || typeof obj !== 'object') - return obj - - if (obj instanceof Object) - var copy = { __proto__: obj.__proto__ } - else - var copy = Object.create(null) - - Object.getOwnPropertyNames(obj).forEach(function (key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) - }) - - return copy -} - - -/***/ }), -/* 362 */ -/***/ (function(module, exports, __webpack_require__) { - -var fs = __webpack_require__(12) -var polyfills = __webpack_require__(713) -var legacy = __webpack_require__(712) -var queue = [] - -var util = __webpack_require__(9) - -function noop () {} - -var debug = noop -if (util.debuglog) - debug = util.debuglog('gfs4') -else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') - console.error(m) - } - -if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug(queue) - __webpack_require__(50).equal(queue.length, 0) - }) -} - -module.exports = patch(__webpack_require__(361)) -if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { - module.exports = patch(fs) -} - -// Always patch fs.close/closeSync, because we want to -// retry() whenever a close happens *anywhere* in the program. -// This is essential when multiple graceful-fs instances are -// in play at the same time. -module.exports.close = -fs.close = (function (fs$close) { return function (fd, cb) { - return fs$close.call(fs, fd, function (err) { - if (!err) - retry() - - if (typeof cb === 'function') - cb.apply(this, arguments) - }) -}})(fs.close) - -module.exports.closeSync = -fs.closeSync = (function (fs$closeSync) { return function (fd) { - // Note that graceful-fs also retries when fs.closeSync() fails. - // Looks like a bug to me, although it's probably a harmless one. - var rval = fs$closeSync.apply(fs, arguments) - retry() - return rval -}})(fs.closeSync) - -function patch (fs) { - // Everything that references the open() function needs to be in here - polyfills(fs) - fs.gracefulify = patch - fs.FileReadStream = ReadStream; // Legacy name. - fs.FileWriteStream = WriteStream; // Legacy name. - fs.createReadStream = createReadStream - fs.createWriteStream = createWriteStream - var fs$readFile = fs.readFile - fs.readFile = readFile - function readFile (path, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$readFile(path, options, cb) - - function go$readFile (path, options, cb) { - return fs$readFile(path, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readFile, [path, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$writeFile = fs.writeFile - fs.writeFile = writeFile - function writeFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$writeFile(path, data, options, cb) - - function go$writeFile (path, data, options, cb) { - return fs$writeFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$writeFile, [path, data, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$appendFile = fs.appendFile - if (fs$appendFile) - fs.appendFile = appendFile - function appendFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$appendFile(path, data, options, cb) - - function go$appendFile (path, data, options, cb) { - return fs$appendFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$appendFile, [path, data, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$readdir = fs.readdir - fs.readdir = readdir - function readdir (path, options, cb) { - var args = [path] - if (typeof options !== 'function') { - args.push(options) - } else { - cb = options - } - args.push(go$readdir$cb) - - return go$readdir(args) - - function go$readdir$cb (err, files) { - if (files && files.sort) - files.sort() - - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readdir, [args]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - } - } - - function go$readdir (args) { - return fs$readdir.apply(fs, args) - } - - if (process.version.substr(0, 4) === 'v0.8') { - var legStreams = legacy(fs) - ReadStream = legStreams.ReadStream - WriteStream = legStreams.WriteStream - } - - var fs$ReadStream = fs.ReadStream - ReadStream.prototype = Object.create(fs$ReadStream.prototype) - ReadStream.prototype.open = ReadStream$open - - var fs$WriteStream = fs.WriteStream - WriteStream.prototype = Object.create(fs$WriteStream.prototype) - WriteStream.prototype.open = WriteStream$open - - fs.ReadStream = ReadStream - fs.WriteStream = WriteStream - - function ReadStream (path, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments) - } - - function ReadStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - if (that.autoClose) - that.destroy() - - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - that.read() - } - }) - } - - function WriteStream (path, options) { - if (this instanceof WriteStream) - return fs$WriteStream.apply(this, arguments), this - else - return WriteStream.apply(Object.create(WriteStream.prototype), arguments) - } - - function WriteStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - that.destroy() - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - } - }) - } - - function createReadStream (path, options) { - return new ReadStream(path, options) - } - - function createWriteStream (path, options) { - return new WriteStream(path, options) - } - - var fs$open = fs.open - fs.open = open - function open (path, flags, mode, cb) { - if (typeof mode === 'function') - cb = mode, mode = null - - return go$open(path, flags, mode, cb) - - function go$open (path, flags, mode, cb) { - return fs$open(path, flags, mode, function (err, fd) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$open, [path, flags, mode, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - return fs -} - -function enqueue (elem) { - debug('ENQUEUE', elem[0].name, elem[1]) - queue.push(elem) -} - -function retry () { - var elem = queue.shift() - if (elem) { - debug('RETRY', elem[0].name, elem[1]) - elem[0].apply(null, elem[1]) - } -} - - -/***/ }), -/* 363 */ +/* 142 */ /***/ (function(module, exports) { -module.exports = [["0","\u0000",127],["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"],["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"],["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"],["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21],["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10],["a3a1","ㄐ",25,"˙ˉˊˇˋ"],["a3e1","€"],["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"],["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"],["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"],["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"],["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"],["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"],["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"],["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"],["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"],["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"],["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"],["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"],["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"],["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"],["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"],["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"],["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"],["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"],["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"],["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"],["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"],["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"],["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"],["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"],["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"],["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"],["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"],["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"],["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"],["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"],["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"],["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"],["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"],["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"],["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"],["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"],["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"],["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"],["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"],["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"],["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"],["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"],["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"],["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"],["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"],["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"],["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"],["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"],["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"],["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"],["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"],["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"],["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"],["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"],["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"],["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"],["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"],["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"],["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"],["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"],["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"],["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"],["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"],["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"],["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"],["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"],["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"],["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"],["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"],["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"],["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"],["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"],["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"],["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"],["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"],["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"],["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"],["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"],["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"],["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"],["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"],["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"],["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"],["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"],["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"],["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"],["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"],["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"],["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"],["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"],["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"],["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"],["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"],["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"],["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"],["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"],["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"],["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"],["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"],["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"],["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"],["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"],["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"],["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"],["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"],["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"],["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"],["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"],["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"],["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"],["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"],["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"],["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"],["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"],["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"],["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"],["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"],["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"],["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"],["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"],["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"],["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"],["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"],["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"],["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"],["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"],["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"],["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"],["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"],["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"],["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"],["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"],["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"],["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"],["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"],["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"],["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"],["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"],["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"],["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"],["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"],["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"],["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"],["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"],["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"],["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"],["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"],["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"],["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"],["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"],["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"],["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"],["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"],["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"],["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"],["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"],["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"],["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"],["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"],["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"],["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"],["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"],["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"],["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"],["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"],["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"],["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"]] -/***/ }), -/* 364 */ -/***/ (function(module, exports) { - -module.exports = [["a140","",62],["a180","",32],["a240","",62],["a280","",32],["a2ab","",5],["a2e3","€"],["a2ef",""],["a2fd",""],["a340","",62],["a380","",31," "],["a440","",62],["a480","",32],["a4f4","",10],["a540","",62],["a580","",32],["a5f7","",7],["a640","",62],["a680","",32],["a6b9","",7],["a6d9","",6],["a6ec",""],["a6f3",""],["a6f6","",8],["a740","",62],["a780","",32],["a7c2","",14],["a7f2","",12],["a896","",10],["a8bc",""],["a8bf","ǹ"],["a8c1",""],["a8ea","",20],["a958",""],["a95b",""],["a95d",""],["a989","〾⿰",11],["a997","",12],["a9f0","",14],["aaa1","",93],["aba1","",93],["aca1","",93],["ada1","",93],["aea1","",93],["afa1","",93],["d7fa","",4],["f8a1","",93],["f9a1","",93],["faa1","",93],["fba1","",93],["fca1","",93],["fda1","",93],["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"],["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93]] - -/***/ }), -/* 365 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = __webpack_require__(599).isCI - - -/***/ }), -/* 366 */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; +module.exports = function(det, rec, confidence, name, lang) { + this.confidence = confidence; + this.name = name || rec.name(det); + this.lang = lang; }; /***/ }), -/* 367 */ -/***/ (function(module, exports, __webpack_require__) { - -var stream = __webpack_require__(35) - - -function isStream (obj) { - return obj instanceof stream.Stream -} - - -function isReadable (obj) { - return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object' -} - - -function isWritable (obj) { - return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object' -} - - -function isDuplex (obj) { - return isReadable(obj) && isWritable(obj) -} - - -module.exports = isStream -module.exports.isReadable = isReadable -module.exports.isWritable = isWritable -module.exports.isDuplex = isDuplex - - -/***/ }), -/* 368 */ +/* 143 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -71325,18 +40450,18 @@ module.exports.isDuplex = isDuplex -var Schema = __webpack_require__(107); +var Schema = __webpack_require__(44); module.exports = new Schema({ include: [ - __webpack_require__(369) + __webpack_require__(144) ] }); /***/ }), -/* 369 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -71351,5427 +40476,1169 @@ module.exports = new Schema({ -var Schema = __webpack_require__(107); +var Schema = __webpack_require__(44); module.exports = new Schema({ include: [ - __webpack_require__(239) + __webpack_require__(100) ], implicit: [ - __webpack_require__(808), - __webpack_require__(800), - __webpack_require__(802), - __webpack_require__(801) + __webpack_require__(293), + __webpack_require__(285), + __webpack_require__(287), + __webpack_require__(286) ] }); /***/ }), -/* 370 */ +/* 145 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/*! - * mime-types - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ +var path = __webpack_require__(0); +var fs = __webpack_require__(4); +var _0777 = parseInt('0777', 8); +module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -/** - * Module dependencies. - * @private - */ - -var db = __webpack_require__(830) -var extname = __webpack_require__(1).extname - -/** - * Module variables. - * @private - */ - -var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ -var TEXT_TYPE_REGEXP = /^text\//i - -/** - * Module exports. - * @public - */ - -exports.charset = charset -exports.charsets = { lookup: charset } -exports.contentType = contentType -exports.extension = extension -exports.extensions = Object.create(null) -exports.lookup = lookup -exports.types = Object.create(null) - -// Populate the extensions/types maps -populateMaps(exports.extensions, exports.types) - -/** - * Get the default charset for a MIME type. - * - * @param {string} type - * @return {boolean|string} - */ - -function charset (type) { - if (!type || typeof type !== 'string') { - return false - } - - // TODO: use media-typer - var match = EXTRACT_TYPE_REGEXP.exec(type) - var mime = match && db[match[1].toLowerCase()] - - if (mime && mime.charset) { - return mime.charset - } - - // default text/* to utf-8 - if (match && TEXT_TYPE_REGEXP.test(match[1])) { - return 'UTF-8' - } - - return false -} - -/** - * Create a full Content-Type header given a MIME type or extension. - * - * @param {string} str - * @return {boolean|string} - */ - -function contentType (str) { - // TODO: should this even be in this module? - if (!str || typeof str !== 'string') { - return false - } - - var mime = str.indexOf('/') === -1 - ? exports.lookup(str) - : str - - if (!mime) { - return false - } - - // TODO: use content-type or other module - if (mime.indexOf('charset') === -1) { - var charset = exports.charset(mime) - if (charset) mime += '; charset=' + charset.toLowerCase() - } - - return mime -} - -/** - * Get the default extension for a MIME type. - * - * @param {string} type - * @return {boolean|string} - */ - -function extension (type) { - if (!type || typeof type !== 'string') { - return false - } - - // TODO: use media-typer - var match = EXTRACT_TYPE_REGEXP.exec(type) - - // get extensions - var exts = match && exports.extensions[match[1].toLowerCase()] - - if (!exts || !exts.length) { - return false - } - - return exts[0] -} - -/** - * Lookup the MIME type for a file path/extension. - * - * @param {string} path - * @return {boolean|string} - */ - -function lookup (path) { - if (!path || typeof path !== 'string') { - return false - } - - // get the extension ("ext" or ".ext" or full path) - var extension = extname('x.' + path) - .toLowerCase() - .substr(1) - - if (!extension) { - return false - } - - return exports.types[extension] || false -} - -/** - * Populate the extensions and types maps. - * @private - */ - -function populateMaps (extensions, types) { - // source preference (least -> most) - var preference = ['nginx', 'apache', undefined, 'iana'] - - Object.keys(db).forEach(function forEachMimeType (type) { - var mime = db[type] - var exts = mime.extensions - - if (!exts || !exts.length) { - return +function mkdirP (p, opts, f, made) { + if (typeof opts === 'function') { + f = opts; + opts = {}; + } + else if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; } - // mime -> extensions - extensions[type] = exts + var mode = opts.mode; + var xfs = opts.fs || fs; - // extension -> mime - for (var i = 0; i < exts.length; i++) { - var extension = exts[i] + if (mode === undefined) { + mode = _0777 & (~process.umask()); + } + if (!made) made = null; - if (types[extension]) { - var from = preference.indexOf(db[types[extension]].source) - var to = preference.indexOf(mime.source) + var cb = f || function () {}; + p = path.resolve(p); - if (types[extension] !== 'application/octet-stream' && - (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { - // skip the remapping - continue + xfs.mkdir(p, mode, function (er) { + if (!er) { + made = made || p; + return cb(null, made); } - } - - // set the extension -> mime - types[extension] = type - } - }) -} - - -/***/ }), -/* 371 */ -/***/ (function(module, exports, __webpack_require__) { - -var Stream = __webpack_require__(35) - -module.exports = MuteStream - -// var out = new MuteStream(process.stdout) -// argument auto-pipes -function MuteStream (opts) { - Stream.apply(this) - opts = opts || {} - this.writable = this.readable = true - this.muted = false - this.on('pipe', this._onpipe) - this.replace = opts.replace - - // For readline-type situations - // This much at the start of a line being redrawn after a ctrl char - // is seen (such as backspace) won't be redrawn as the replacement - this._prompt = opts.prompt || null - this._hadControl = false -} - -MuteStream.prototype = Object.create(Stream.prototype) - -Object.defineProperty(MuteStream.prototype, 'constructor', { - value: MuteStream, - enumerable: false -}) - -MuteStream.prototype.mute = function () { - this.muted = true -} - -MuteStream.prototype.unmute = function () { - this.muted = false -} - -Object.defineProperty(MuteStream.prototype, '_onpipe', { - value: onPipe, - enumerable: false, - writable: true, - configurable: true -}) - -function onPipe (src) { - this._src = src -} - -Object.defineProperty(MuteStream.prototype, 'isTTY', { - get: getIsTTY, - set: setIsTTY, - enumerable: true, - configurable: true -}) - -function getIsTTY () { - return( (this._dest) ? this._dest.isTTY - : (this._src) ? this._src.isTTY - : false - ) -} - -// basically just get replace the getter/setter with a regular value -function setIsTTY (isTTY) { - Object.defineProperty(this, 'isTTY', { - value: isTTY, - enumerable: true, - writable: true, - configurable: true - }) -} - -Object.defineProperty(MuteStream.prototype, 'rows', { - get: function () { - return( this._dest ? this._dest.rows - : this._src ? this._src.rows - : undefined ) - }, enumerable: true, configurable: true }) - -Object.defineProperty(MuteStream.prototype, 'columns', { - get: function () { - return( this._dest ? this._dest.columns - : this._src ? this._src.columns - : undefined ) - }, enumerable: true, configurable: true }) - - -MuteStream.prototype.pipe = function (dest, options) { - this._dest = dest - return Stream.prototype.pipe.call(this, dest, options) -} - -MuteStream.prototype.pause = function () { - if (this._src) return this._src.pause() -} - -MuteStream.prototype.resume = function () { - if (this._src) return this._src.resume() -} - -MuteStream.prototype.write = function (c) { - if (this.muted) { - if (!this.replace) return true - if (c.match(/^\u001b/)) { - if(c.indexOf(this._prompt) === 0) { - c = c.substr(this._prompt.length); - c = c.replace(/./g, this.replace); - c = this._prompt + c; - } - this._hadControl = true - return this.emit('data', c) - } else { - if (this._prompt && this._hadControl && - c.indexOf(this._prompt) === 0) { - this._hadControl = false - this.emit('data', this._prompt) - c = c.substr(this._prompt.length) - } - c = c.toString().replace(/./g, this.replace) - } - } - this.emit('data', c) -} - -MuteStream.prototype.end = function (c) { - if (this.muted) { - if (c && this.replace) { - c = c.toString().replace(/./g, this.replace) - } else { - c = null - } - } - if (c) this.emit('data', c) - this.emit('end') -} - -function proxy (fn) { return function () { - var d = this._dest - var s = this._src - if (d && d[fn]) d[fn].apply(d, arguments) - if (s && s[fn]) s[fn].apply(s, arguments) -}} - -MuteStream.prototype.destroy = proxy('destroy') -MuteStream.prototype.destroySoon = proxy('destroySoon') -MuteStream.prototype.close = proxy('close') - - -/***/ }), -/* 372 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const url = __webpack_require__(29); -const punycode = __webpack_require__(271); -const queryString = __webpack_require__(858); -const prependHttp = __webpack_require__(849); -const sortKeys = __webpack_require__(1007); - -const DEFAULT_PORTS = { - 'http:': 80, - 'https:': 443, - 'ftp:': 21 -}; - -// Protocols that always contain a `//`` bit -const slashedProtocol = { - http: true, - https: true, - ftp: true, - gopher: true, - file: true, - 'http:': true, - 'https:': true, - 'ftp:': true, - 'gopher:': true, - 'file:': true -}; - -function testParameter(name, filters) { - return filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name); -} - -module.exports = (str, opts) => { - opts = Object.assign({ - normalizeProtocol: true, - normalizeHttps: false, - stripFragment: true, - stripWWW: true, - removeQueryParameters: [/^utm_\w+/i], - removeTrailingSlash: true, - removeDirectoryIndex: false, - sortQueryParameters: true - }, opts); - - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - const hasRelativeProtocol = str.startsWith('//'); - - // Prepend protocol - str = prependHttp(str.trim()).replace(/^\/\//, 'http://'); - - const urlObj = url.parse(str); - - if (opts.normalizeHttps && urlObj.protocol === 'https:') { - urlObj.protocol = 'http:'; - } - - if (!urlObj.hostname && !urlObj.pathname) { - throw new Error('Invalid URL'); - } - - // Prevent these from being used by `url.format` - delete urlObj.host; - delete urlObj.query; - - // Remove fragment - if (opts.stripFragment) { - delete urlObj.hash; - } - - // Remove default port - const port = DEFAULT_PORTS[urlObj.protocol]; - if (Number(urlObj.port) === port) { - delete urlObj.port; - } - - // Remove duplicate slashes - if (urlObj.pathname) { - urlObj.pathname = urlObj.pathname.replace(/\/{2,}/g, '/'); - } - - // Decode URI octets - if (urlObj.pathname) { - urlObj.pathname = decodeURI(urlObj.pathname); - } - - // Remove directory index - if (opts.removeDirectoryIndex === true) { - opts.removeDirectoryIndex = [/^index\.[a-z]+$/]; - } - - if (Array.isArray(opts.removeDirectoryIndex) && opts.removeDirectoryIndex.length > 0) { - let pathComponents = urlObj.pathname.split('/'); - const lastComponent = pathComponents[pathComponents.length - 1]; - - if (testParameter(lastComponent, opts.removeDirectoryIndex)) { - pathComponents = pathComponents.slice(0, pathComponents.length - 1); - urlObj.pathname = pathComponents.slice(1).join('/') + '/'; - } - } - - // Resolve relative paths, but only for slashed protocols - if (slashedProtocol[urlObj.protocol]) { - const domain = urlObj.protocol + '//' + urlObj.hostname; - const relative = url.resolve(domain, urlObj.pathname); - urlObj.pathname = relative.replace(domain, ''); - } - - if (urlObj.hostname) { - // IDN to Unicode - urlObj.hostname = punycode.toUnicode(urlObj.hostname).toLowerCase(); - - // Remove trailing dot - urlObj.hostname = urlObj.hostname.replace(/\.$/, ''); - - // Remove `www.` - if (opts.stripWWW) { - urlObj.hostname = urlObj.hostname.replace(/^www\./, ''); - } - } - - // Remove URL with empty query string - if (urlObj.search === '?') { - delete urlObj.search; - } - - const queryParameters = queryString.parse(urlObj.search); - - // Remove query unwanted parameters - if (Array.isArray(opts.removeQueryParameters)) { - for (const key in queryParameters) { - if (testParameter(key, opts.removeQueryParameters)) { - delete queryParameters[key]; - } - } - } - - // Sort query parameters - if (opts.sortQueryParameters) { - urlObj.search = queryString.stringify(sortKeys(queryParameters)); - } - - // Decode query parameters - if (urlObj.search !== null) { - urlObj.search = decodeURIComponent(urlObj.search); - } - - // Take advantage of many of the Node `url` normalizations - str = url.format(urlObj); - - // Remove ending `/` - if (opts.removeTrailingSlash || urlObj.pathname === '/') { - str = str.replace(/\/$/, ''); - } - - // Restore relative protocol, if applicable - if (hasRelativeProtocol && !opts.normalizeProtocol) { - str = str.replace(/^http:\/\//, '//'); - } - - return str; -}; - - -/***/ }), -/* 373 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var replace = String.prototype.replace; -var percentTwenties = /%20/g; - -module.exports = { - 'default': 'RFC3986', - formatters: { - RFC1738: function (value) { - return replace.call(value, percentTwenties, '+'); - }, - RFC3986: function (value) { - return value; + switch (er.code) { + case 'ENOENT': + mkdirP(path.dirname(p), opts, function (er, made) { + if (er) cb(er, made); + else mkdirP(p, opts, cb, made); + }); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, function (er2, stat) { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) cb(er, made) + else cb(null, made); + }); + break; } - }, - RFC1738: 'RFC1738', - RFC3986: 'RFC3986' -}; + }); +} - -/***/ }), -/* 374 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var stringify = __webpack_require__(857); -var parse = __webpack_require__(856); -var formats = __webpack_require__(373); - -module.exports = { - formats: formats, - parse: parse, - stringify: stringify -}; - - -/***/ }), -/* 375 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var has = Object.prototype.hasOwnProperty; - -var hexTable = (function () { - var array = []; - for (var i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); +mkdirP.sync = function sync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; } - return array; -}()); + var mode = opts.mode; + var xfs = opts.fs || fs; -var compactQueue = function compactQueue(queue) { - var obj; - - while (queue.length) { - var item = queue.pop(); - obj = item.obj[item.prop]; - - if (Array.isArray(obj)) { - var compacted = []; - - for (var j = 0; j < obj.length; ++j) { - if (typeof obj[j] !== 'undefined') { - compacted.push(obj[j]); - } - } - - item.obj[item.prop] = compacted; - } + if (mode === undefined) { + mode = _0777 & (~process.umask()); } + if (!made) made = null; - return obj; -}; + p = path.resolve(p); -var arrayToObject = function arrayToObject(source, options) { - var obj = options && options.plainObjects ? Object.create(null) : {}; - for (var i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; - } - } - - return obj; -}; - -var merge = function merge(target, source, options) { - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (Array.isArray(target)) { - target.push(source); - } else if (typeof target === 'object') { - if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { - target[source] = true; - } - } else { - return [target, source]; - } - - return target; - } - - if (typeof target !== 'object') { - return [target].concat(source); - } - - var mergeTarget = target; - if (Array.isArray(target) && !Array.isArray(source)) { - mergeTarget = arrayToObject(target, options); - } - - if (Array.isArray(target) && Array.isArray(source)) { - source.forEach(function (item, i) { - if (has.call(target, i)) { - if (target[i] && typeof target[i] === 'object') { - target[i] = merge(target[i], item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - - return Object.keys(source).reduce(function (acc, key) { - var value = source[key]; - - if (has.call(acc, key)) { - acc[key] = merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -}; - -var assign = function assignSingleSource(target, source) { - return Object.keys(source).reduce(function (acc, key) { - acc[key] = source[key]; - return acc; - }, target); -}; - -var decode = function (str) { try { - return decodeURIComponent(str.replace(/\+/g, ' ')); - } catch (e) { - return str; + xfs.mkdirSync(p, mode); + made = made || p; } -}; - -var encode = function encode(str) { - // This code was originally written by Brian White (mscdex) for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; - } - - var string = typeof str === 'string' ? str : String(str); - - var out = ''; - for (var i = 0; i < string.length; ++i) { - var c = string.charCodeAt(i); - - if ( - c === 0x2D // - - || c === 0x2E // . - || c === 0x5F // _ - || c === 0x7E // ~ - || (c >= 0x30 && c <= 0x39) // 0-9 - || (c >= 0x41 && c <= 0x5A) // a-z - || (c >= 0x61 && c <= 0x7A) // A-Z - ) { - out += string.charAt(i); - continue; - } - - if (c < 0x80) { - out = out + hexTable[c]; - continue; - } - - if (c < 0x800) { - out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } - - if (c < 0xD800 || c >= 0xE000) { - out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } - - i += 1; - c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); - out += hexTable[0xF0 | (c >> 18)] - + hexTable[0x80 | ((c >> 12) & 0x3F)] - + hexTable[0x80 | ((c >> 6) & 0x3F)] - + hexTable[0x80 | (c & 0x3F)]; - } - - return out; -}; - -var compact = function compact(value) { - var queue = [{ obj: { o: value }, prop: 'o' }]; - var refs = []; - - for (var i = 0; i < queue.length; ++i) { - var item = queue[i]; - var obj = item.obj[item.prop]; - - var keys = Object.keys(obj); - for (var j = 0; j < keys.length; ++j) { - var key = keys[j]; - var val = obj[key]; - if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { - queue.push({ obj: obj, prop: key }); - refs.push(val); - } - } - } - - return compactQueue(queue); -}; - -var isRegExp = function isRegExp(obj) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -}; - -var isBuffer = function isBuffer(obj) { - if (obj === null || typeof obj === 'undefined') { - return false; - } - - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); -}; - -module.exports = { - arrayToObject: arrayToObject, - assign: assign, - compact: compact, - decode: decode, - encode: encode, - isBuffer: isBuffer, - isRegExp: isRegExp, - merge: merge -}; - - -/***/ }), -/* 376 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - -/**/ - -var pna = __webpack_require__(170); -/**/ - -module.exports = Readable; - -/**/ -var isArray = __webpack_require__(366); -/**/ - -/**/ -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = __webpack_require__(95).EventEmitter; - -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream = __webpack_require__(380); -/**/ - -/**/ - -var Buffer = __webpack_require__(59).Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -/**/ -var util = __webpack_require__(105); -util.inherits = __webpack_require__(78); -/**/ - -/**/ -var debugUtil = __webpack_require__(9); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var BufferList = __webpack_require__(865); -var destroyImpl = __webpack_require__(379); -var StringDecoder; - -util.inherits(Readable, Stream); - -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); - - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -function ReadableState(options, stream) { - Duplex = Duplex || __webpack_require__(109); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // has it been destroyed - this.destroyed = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = __webpack_require__(428).StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - Duplex = Duplex || __webpack_require__(109); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream.call(this); -} - -Object.defineProperty(Readable.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); - -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - this.push(null); - cb(err); -}; - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; - -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit('error', new Error('stream.push() after EOF')); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - } - } - - return needMoreData(state); -} - -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} - -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = __webpack_require__(428).StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - - if (n !== 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - - return ret; -}; - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('_read() is not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } - - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, unpipeInfo); - }return this; - } - - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - - dest.emit('unpipe', this, unpipeInfo); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._readableState.highWaterMark; - } -}); - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } - - return ret; -} - -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; -} - -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} - -/***/ }), -/* 377 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - - - -module.exports = Transform; - -var Duplex = __webpack_require__(109); - -/**/ -var util = __webpack_require__(105); -util.inherits = __webpack_require__(78); -/**/ - -util.inherits(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) { - return this.emit('error', new Error('write callback called multiple times')); - } - - ts.writechunk = null; - ts.writecb = null; - - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - - cb(er); - - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function') { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('_transform() is not implemented'); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform.prototype._destroy = function (err, cb) { - var _this2 = this; - - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - _this2.emit('close'); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); - - if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); - - return stream.push(null); -} - -/***/ }), -/* 378 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - - - -/**/ - -var pna = __webpack_require__(170); -/**/ - -module.exports = Writable; - -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; -/**/ - -/**/ -var Duplex; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var util = __webpack_require__(105); -util.inherits = __webpack_require__(78); -/**/ - -/**/ -var internalUtil = { - deprecate: __webpack_require__(1029) -}; -/**/ - -/**/ -var Stream = __webpack_require__(380); -/**/ - -/**/ - -var Buffer = __webpack_require__(59).Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -var destroyImpl = __webpack_require__(379); - -util.inherits(Writable, Stream); - -function nop() {} - -function WritableState(options, stream) { - Duplex = Duplex || __webpack_require__(109); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // if _final has been called - this.finalCalled = false; - - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // has it been destroyed - this.destroyed = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function (object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || __webpack_require__(109); - - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - - if (typeof options.final === 'function') this._final = options.final; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - pna.nextTick(cb, er); -} - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - pna.nextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} - -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - pna.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - stream.emit('error', err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function') { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = corkReq; - } else { - state.corkedRequestsFree = corkReq; - } -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - get: function () { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); - -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - this.end(); - cb(err); -}; - -/***/ }), -/* 379 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/**/ - -var pna = __webpack_require__(170); -/**/ - -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - pna.nextTick(emitErrorNT, this, err); - } - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - pna.nextTick(emitErrorNT, _this, err); - if (_this._writableState) { - _this._writableState.errorEmitted = true; - } - } else if (cb) { - cb(err); - } - }); - - return this; -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy -}; - -/***/ }), -/* 380 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(35); - - -/***/ }), -/* 381 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * repeat-element - * - * Copyright (c) 2015 Jon Schlinkert. - * Licensed under the MIT license. - */ - - - -module.exports = function repeat(ele, num) { - var arr = new Array(num); - - for (var i = 0; i < num; i++) { - arr[i] = ele; - } - - return arr; -}; - - -/***/ }), -/* 382 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var tough = __webpack_require__(882) - -var Cookie = tough.Cookie -var CookieJar = tough.CookieJar - -exports.parse = function (str) { - if (str && str.uri) { - str = str.uri - } - if (typeof str !== 'string') { - throw new Error('The cookie function only accepts STRING as param') - } - return Cookie.parse(str, {loose: true}) -} - -// Adapt the sometimes-Async api of tough.CookieJar to our requirements -function RequestJar (store) { - var self = this - self._jar = new CookieJar(store, {looseMode: true}) -} -RequestJar.prototype.setCookie = function (cookieOrStr, uri, options) { - var self = this - return self._jar.setCookieSync(cookieOrStr, uri, options || {}) -} -RequestJar.prototype.getCookieString = function (uri) { - var self = this - return self._jar.getCookieStringSync(uri) -} -RequestJar.prototype.getCookies = function (uri) { - var self = this - return self._jar.getCookiesSync(uri) -} - -exports.jar = function (store) { - return new RequestJar(store) -} - - -/***/ }), -/* 383 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * "A request-path path-matches a given cookie-path if at least one of the - * following conditions holds:" - */ -function pathMatch (reqPath, cookiePath) { - // "o The cookie-path and the request-path are identical." - if (cookiePath === reqPath) { - return true; - } - - var idx = reqPath.indexOf(cookiePath); - if (idx === 0) { - // "o The cookie-path is a prefix of the request-path, and the last - // character of the cookie-path is %x2F ("/")." - if (cookiePath.substr(-1) === "/") { - return true; - } - - // " o The cookie-path is a prefix of the request-path, and the first - // character of the request-path that is not included in the cookie- path - // is a %x2F ("/") character." - if (reqPath.substr(cookiePath.length, 1) === "/") { - return true; - } - } - - return false; -} - -exports.pathMatch = pathMatch; - - -/***/ }), -/* 384 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -var pubsuffix = __webpack_require__(385); - -// Gives the permutation of all possible domainMatch()es of a given domain. The -// array is in shortest-to-longest order. Handy for indexing. -function permuteDomain (domain) { - var pubSuf = pubsuffix.getPublicSuffix(domain); - if (!pubSuf) { - return null; - } - if (pubSuf == domain) { - return [domain]; - } - - var prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com" - var parts = prefix.split('.').reverse(); - var cur = pubSuf; - var permutations = [cur]; - while (parts.length) { - cur = parts.shift() + '.' + cur; - permutations.push(cur); - } - return permutations; -} - -exports.permuteDomain = permuteDomain; - - -/***/ }), -/* 385 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/**************************************************** - * AUTOMATICALLY GENERATED by generate-pubsuffix.js * - * DO NOT EDIT! * - ****************************************************/ - - - -var punycode = __webpack_require__(271); - -module.exports.getPublicSuffix = function getPublicSuffix(domain) { - /*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - if (!domain) { - return null; - } - if (domain.match(/^\./)) { - return null; - } - var asciiDomain = punycode.toASCII(domain); - var converted = false; - if (asciiDomain !== domain) { - domain = asciiDomain; - converted = true; - } - if (index[domain]) { - return null; - } - - domain = domain.toLowerCase(); - var parts = domain.split('.').reverse(); - - var suffix = ''; - var suffixLen = 0; - for (var i=0; i suffixLen) { - var publicSuffix = parts.slice(0,suffixLen+1).reverse().join('.'); - return converted ? punycode.toUnicode(publicSuffix) : publicSuffix; - } - - return null; -}; - -// The following generated structure is used under the MPL version 2.0 -// See public-suffix.txt for more information - -var index = module.exports.index = Object.freeze( -{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"educator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software.aero":true,"student.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"ar":true,"com.ar":true,"edu.ar":true,"gob.ar":true,"gov.ar":true,"int.ar":true,"mil.ar":true,"musica.ar":true,"net.ar":true,"org.ar":true,"tur.ar":true,"arpa":true,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,"or.at":true,"au":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"com.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"net.ba":true,"org.ba":true,"bb":true,"biz.bb":true,"co.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":true,"tv.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"web.bo":true,"academia.bo":true,"agro.bo":true,"arte.bo":true,"blog.bo":true,"bolivia.bo":true,"ciencia.bo":true,"cooperativa.bo":true,"democracia.bo":true,"deporte.bo":true,"ecologia.bo":true,"economia.bo":true,"empresa.bo":true,"indigena.bo":true,"industria.bo":true,"info.bo":true,"medicina.bo":true,"movimiento.bo":true,"musica.bo":true,"natural.bo":true,"nombre.bo":true,"noticias.bo":true,"patria.bo":true,"politica.bo":true,"profesional.bo":true,"plurinacional.bo":true,"pueblo.bo":true,"revista.bo":true,"salud.bo":true,"tecnologia.bo":true,"tksat.bo":true,"transporte.bo":true,"wiki.bo":true,"br":true,"9guacu.br":true,"abc.br":true,"adm.br":true,"adv.br":true,"agr.br":true,"aju.br":true,"am.br":true,"anani.br":true,"aparecida.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"belem.br":true,"bhz.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"boavista.br":true,"bsb.br":true,"campinagrande.br":true,"campinas.br":true,"caxias.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"contagem.br":true,"coop.br":true,"cri.br":true,"cuiaba.br":true,"curitiba.br":true,"def.br":true,"ecn.br":true,"eco.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"feira.br":true,"flog.br":true,"floripa.br":true,"fm.br":true,"fnd.br":true,"fortal.br":true,"fot.br":true,"foz.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"goiania.br":true,"gov.br":true,"ac.gov.br":true,"al.gov.br":true,"am.gov.br":true,"ap.gov.br":true,"ba.gov.br":true,"ce.gov.br":true,"df.gov.br":true,"es.gov.br":true,"go.gov.br":true,"ma.gov.br":true,"mg.gov.br":true,"ms.gov.br":true,"mt.gov.br":true,"pa.gov.br":true,"pb.gov.br":true,"pe.gov.br":true,"pi.gov.br":true,"pr.gov.br":true,"rj.gov.br":true,"rn.gov.br":true,"ro.gov.br":true,"rr.gov.br":true,"rs.gov.br":true,"sc.gov.br":true,"se.gov.br":true,"sp.gov.br":true,"to.gov.br":true,"gru.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jab.br":true,"jampa.br":true,"jdf.br":true,"joinville.br":true,"jor.br":true,"jus.br":true,"leg.br":true,"lel.br":true,"londrina.br":true,"macapa.br":true,"maceio.br":true,"manaus.br":true,"maringa.br":true,"mat.br":true,"med.br":true,"mil.br":true,"morena.br":true,"mp.br":true,"mus.br":true,"natal.br":true,"net.br":true,"niteroi.br":true,"*.nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"osasco.br":true,"palmas.br":true,"poa.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"pvh.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"recife.br":true,"ribeirao.br":true,"rio.br":true,"riobranco.br":true,"riopreto.br":true,"salvador.br":true,"sampa.br":true,"santamaria.br":true,"santoandre.br":true,"saobernardo.br":true,"saogonca.br":true,"sjc.br":true,"slg.br":true,"slz.br":true,"sorocaba.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"the.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"udi.br":true,"vet.br":true,"vix.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"net.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bv":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"co.cm":true,"com.cm":true,"gov.cm":true,"net.cm":true,"cn":true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov.cu":true,"inf.cu":true,"cv":true,"cw":true,"com.cw":true,"edu.cw":true,"net.cw":true,"org.cw":true,"cx":true,"gov.cx":true,"cy":true,"ac.cy":true,"biz.cy":true,"com.cy":true,"ekloges.cy":true,"gov.cy":true,"ltd.cy":true,"name.cy":true,"net.cy":true,"org.cy":true,"parliament.cy":true,"press.cy":true,"pro.cy":true,"tm.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"et":true,"com.et":true,"gov.et":true,"org.et":true,"edu.et":true,"biz.et":true,"name.et":true,"info.et":true,"net.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gb":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"net.gg":true,"org.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":true,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"co.gl":true,"com.gl":true,"edu.gl":true,"net.gl":true,"org.gl":true,"gm":true,"gn":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"gt":true,"com.gt":true,"edu.gt":true,"gob.gt":true,"ind.gt":true,"mil.gt":true,"net.gt":true,"org.gt":true,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"edu.gy":true,"gov.gy":true,"net.gy":true,"org.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":true,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"biz.id":true,"co.id":true,"desa.id":true,"go.id":true,"mil.id":true,"my.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"il":true,"ac.il":true,"co.il":true,"gov.il":true,"idf.il":true,"k12.il":true,"muni.il":true,"net.il":true,"org.il":true,"im":true,"ac.im":true,"co.im":true,"com.im":true,"ltd.co.im":true,"net.im":true,"org.im":true,"plc.co.im":true,"tt.im":true,"tv.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"abr.it":true,"abruzzo.it":true,"aosta-valley.it":true,"aostavalley.it":true,"bas.it":true,"basilicata.it":true,"cal.it":true,"calabria.it":true,"cam.it":true,"campania.it":true,"emilia-romagna.it":true,"emiliaromagna.it":true,"emr.it":true,"friuli-v-giulia.it":true,"friuli-ve-giulia.it":true,"friuli-vegiulia.it":true,"friuli-venezia-giulia.it":true,"friuli-veneziagiulia.it":true,"friuli-vgiulia.it":true,"friuliv-giulia.it":true,"friulive-giulia.it":true,"friulivegiulia.it":true,"friulivenezia-giulia.it":true,"friuliveneziagiulia.it":true,"friulivgiulia.it":true,"fvg.it":true,"laz.it":true,"lazio.it":true,"lig.it":true,"liguria.it":true,"lom.it":true,"lombardia.it":true,"lombardy.it":true,"lucania.it":true,"mar.it":true,"marche.it":true,"mol.it":true,"molise.it":true,"piedmont.it":true,"piemonte.it":true,"pmn.it":true,"pug.it":true,"puglia.it":true,"sar.it":true,"sardegna.it":true,"sardinia.it":true,"sic.it":true,"sicilia.it":true,"sicily.it":true,"taa.it":true,"tos.it":true,"toscana.it":true,"trentino-a-adige.it":true,"trentino-aadige.it":true,"trentino-alto-adige.it":true,"trentino-altoadige.it":true,"trentino-s-tirol.it":true,"trentino-stirol.it":true,"trentino-sud-tirol.it":true,"trentino-sudtirol.it":true,"trentino-sued-tirol.it":true,"trentino-suedtirol.it":true,"trentinoa-adige.it":true,"trentinoaadige.it":true,"trentinoalto-adige.it":true,"trentinoaltoadige.it":true,"trentinos-tirol.it":true,"trentinostirol.it":true,"trentinosud-tirol.it":true,"trentinosudtirol.it":true,"trentinosued-tirol.it":true,"trentinosuedtirol.it":true,"tuscany.it":true,"umb.it":true,"umbria.it":true,"val-d-aosta.it":true,"val-daosta.it":true,"vald-aosta.it":true,"valdaosta.it":true,"valle-aosta.it":true,"valle-d-aosta.it":true,"valle-daosta.it":true,"valleaosta.it":true,"valled-aosta.it":true,"valledaosta.it":true,"vallee-aoste.it":true,"valleeaoste.it":true,"vao.it":true,"vda.it":true,"ven.it":true,"veneto.it":true,"ag.it":true,"agrigento.it":true,"al.it":true,"alessandria.it":true,"alto-adige.it":true,"altoadige.it":true,"an.it":true,"ancona.it":true,"andria-barletta-trani.it":true,"andria-trani-barletta.it":true,"andriabarlettatrani.it":true,"andriatranibarletta.it":true,"ao.it":true,"aosta.it":true,"aoste.it":true,"ap.it":true,"aq.it":true,"aquila.it":true,"ar.it":true,"arezzo.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"asti.it":true,"at.it":true,"av.it":true,"avellino.it":true,"ba.it":true,"balsan.it":true,"bari.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"belluno.it":true,"benevento.it":true,"bergamo.it":true,"bg.it":true,"bi.it":true,"biella.it":true,"bl.it":true,"bn.it":true,"bo.it":true,"bologna.it":true,"bolzano.it":true,"bozen.it":true,"br.it":true,"brescia.it":true,"brindisi.it":true,"bs.it":true,"bt.it":true,"bz.it":true,"ca.it":true,"cagliari.it":true,"caltanissetta.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"campobasso.it":true,"carbonia-iglesias.it":true,"carboniaiglesias.it":true,"carrara-massa.it":true,"carraramassa.it":true,"caserta.it":true,"catania.it":true,"catanzaro.it":true,"cb.it":true,"ce.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"ch.it":true,"chieti.it":true,"ci.it":true,"cl.it":true,"cn.it":true,"co.it":true,"como.it":true,"cosenza.it":true,"cr.it":true,"cremona.it":true,"crotone.it":true,"cs.it":true,"ct.it":true,"cuneo.it":true,"cz.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"en.it":true,"enna.it":true,"fc.it":true,"fe.it":true,"fermo.it":true,"ferrara.it":true,"fg.it":true,"fi.it":true,"firenze.it":true,"florence.it":true,"fm.it":true,"foggia.it":true,"forli-cesena.it":true,"forlicesena.it":true,"fr.it":true,"frosinone.it":true,"ge.it":true,"genoa.it":true,"genova.it":true,"go.it":true,"gorizia.it":true,"gr.it":true,"grosseto.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"im.it":true,"imperia.it":true,"is.it":true,"isernia.it":true,"kr.it":true,"la-spezia.it":true,"laquila.it":true,"laspezia.it":true,"latina.it":true,"lc.it":true,"le.it":true,"lecce.it":true,"lecco.it":true,"li.it":true,"livorno.it":true,"lo.it":true,"lodi.it":true,"lt.it":true,"lu.it":true,"lucca.it":true,"macerata.it":true,"mantova.it":true,"massa-carrara.it":true,"massacarrara.it":true,"matera.it":true,"mb.it":true,"mc.it":true,"me.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"messina.it":true,"mi.it":true,"milan.it":true,"milano.it":true,"mn.it":true,"mo.it":true,"modena.it":true,"monza-brianza.it":true,"monza-e-della-brianza.it":true,"monza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"ms.it":true,"mt.it":true,"na.it":true,"naples.it":true,"napoli.it":true,"no.it":true,"novara.it":true,"nu.it":true,"nuoro.it":true,"og.it":true,"ogliastra.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"or.it":true,"oristano.it":true,"ot.it":true,"pa.it":true,"padova.it":true,"padua.it":true,"palermo.it":true,"parma.it":true,"pavia.it":true,"pc.it":true,"pd.it":true,"pe.it":true,"perugia.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"pescara.it":true,"pg.it":true,"pi.it":true,"piacenza.it":true,"pisa.it":true,"pistoia.it":true,"pn.it":true,"po.it":true,"pordenone.it":true,"potenza.it":true,"pr.it":true,"prato.it":true,"pt.it":true,"pu.it":true,"pv.it":true,"pz.it":true,"ra.it":true,"ragusa.it":true,"ravenna.it":true,"rc.it":true,"re.it":true,"reggio-calabria.it":true,"reggio-emilia.it":true,"reggiocalabria.it":true,"reggioemilia.it":true,"rg.it":true,"ri.it":true,"rieti.it":true,"rimini.it":true,"rm.it":true,"rn.it":true,"ro.it":true,"roma.it":true,"rome.it":true,"rovigo.it":true,"sa.it":true,"salerno.it":true,"sassari.it":true,"savona.it":true,"si.it":true,"siena.it":true,"siracusa.it":true,"so.it":true,"sondrio.it":true,"sp.it":true,"sr.it":true,"ss.it":true,"suedtirol.it":true,"sv.it":true,"ta.it":true,"taranto.it":true,"te.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"teramo.it":true,"terni.it":true,"tn.it":true,"to.it":true,"torino.it":true,"tp.it":true,"tr.it":true,"trani-andria-barletta.it":true,"trani-barletta-andria.it":true,"traniandriabarletta.it":true,"tranibarlettaandria.it":true,"trapani.it":true,"trentino.it":true,"trento.it":true,"treviso.it":true,"trieste.it":true,"ts.it":true,"turin.it":true,"tv.it":true,"ud.it":true,"udine.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"va.it":true,"varese.it":true,"vb.it":true,"vc.it":true,"ve.it":true,"venezia.it":true,"venice.it":true,"verbania.it":true,"vercelli.it":true,"verona.it":true,"vi.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vicenza.it":true,"viterbo.it":true,"vr.it":true,"vs.it":true,"vt.it":true,"vv.it":true,"je":true,"co.je":true,"net.je":true,"org.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"aichi.jp":true,"akita.jp":true,"aomori.jp":true,"chiba.jp":true,"ehime.jp":true,"fukui.jp":true,"fukuoka.jp":true,"fukushima.jp":true,"gifu.jp":true,"gunma.jp":true,"hiroshima.jp":true,"hokkaido.jp":true,"hyogo.jp":true,"ibaraki.jp":true,"ishikawa.jp":true,"iwate.jp":true,"kagawa.jp":true,"kagoshima.jp":true,"kanagawa.jp":true,"kochi.jp":true,"kumamoto.jp":true,"kyoto.jp":true,"mie.jp":true,"miyagi.jp":true,"miyazaki.jp":true,"nagano.jp":true,"nagasaki.jp":true,"nara.jp":true,"niigata.jp":true,"oita.jp":true,"okayama.jp":true,"okinawa.jp":true,"osaka.jp":true,"saga.jp":true,"saitama.jp":true,"shiga.jp":true,"shimane.jp":true,"shizuoka.jp":true,"tochigi.jp":true,"tokushima.jp":true,"tokyo.jp":true,"tottori.jp":true,"toyama.jp":true,"wakayama.jp":true,"yamagata.jp":true,"yamaguchi.jp":true,"yamanashi.jp":true,"xn--4pvxs.jp":true,"xn--vgu402c.jp":true,"xn--c3s14m.jp":true,"xn--f6qx53a.jp":true,"xn--8pvr4u.jp":true,"xn--uist22h.jp":true,"xn--djrs72d6uy.jp":true,"xn--mkru45i.jp":true,"xn--0trq7p7nn.jp":true,"xn--8ltr62k.jp":true,"xn--2m4a15e.jp":true,"xn--efvn9s.jp":true,"xn--32vp30h.jp":true,"xn--4it797k.jp":true,"xn--1lqs71d.jp":true,"xn--5rtp49c.jp":true,"xn--5js045d.jp":true,"xn--ehqz56n.jp":true,"xn--1lqs03n.jp":true,"xn--qqqt11m.jp":true,"xn--kbrq7o.jp":true,"xn--pssu33l.jp":true,"xn--ntsq17g.jp":true,"xn--uisz3g.jp":true,"xn--6btw5a.jp":true,"xn--1ctwo.jp":true,"xn--6orx2r.jp":true,"xn--rht61e.jp":true,"xn--rht27z.jp":true,"xn--djty4k.jp":true,"xn--nit225k.jp":true,"xn--rht3d.jp":true,"xn--klty5x.jp":true,"xn--kltx9a.jp":true,"xn--kltp7d.jp":true,"xn--uuwu58a.jp":true,"xn--zbx025d.jp":true,"xn--ntso0iqx3a.jp":true,"xn--elqq16h.jp":true,"xn--4it168d.jp":true,"xn--klt787d.jp":true,"xn--rny31h.jp":true,"xn--7t0a264c.jp":true,"xn--5rtq34k.jp":true,"xn--k7yn95e.jp":true,"xn--tor131o.jp":true,"xn--d5qv7z876c.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.nagoya.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.yokohama.jp":true,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city.nagoya.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.yokohama.jp":false,"aisai.aichi.jp":true,"ama.aichi.jp":true,"anjo.aichi.jp":true,"asuke.aichi.jp":true,"chiryu.aichi.jp":true,"chita.aichi.jp":true,"fuso.aichi.jp":true,"gamagori.aichi.jp":true,"handa.aichi.jp":true,"hazu.aichi.jp":true,"hekinan.aichi.jp":true,"higashiura.aichi.jp":true,"ichinomiya.aichi.jp":true,"inazawa.aichi.jp":true,"inuyama.aichi.jp":true,"isshiki.aichi.jp":true,"iwakura.aichi.jp":true,"kanie.aichi.jp":true,"kariya.aichi.jp":true,"kasugai.aichi.jp":true,"kira.aichi.jp":true,"kiyosu.aichi.jp":true,"komaki.aichi.jp":true,"konan.aichi.jp":true,"kota.aichi.jp":true,"mihama.aichi.jp":true,"miyoshi.aichi.jp":true,"nishio.aichi.jp":true,"nisshin.aichi.jp":true,"obu.aichi.jp":true,"oguchi.aichi.jp":true,"oharu.aichi.jp":true,"okazaki.aichi.jp":true,"owariasahi.aichi.jp":true,"seto.aichi.jp":true,"shikatsu.aichi.jp":true,"shinshiro.aichi.jp":true,"shitara.aichi.jp":true,"tahara.aichi.jp":true,"takahama.aichi.jp":true,"tobishima.aichi.jp":true,"toei.aichi.jp":true,"togo.aichi.jp":true,"tokai.aichi.jp":true,"tokoname.aichi.jp":true,"toyoake.aichi.jp":true,"toyohashi.aichi.jp":true,"toyokawa.aichi.jp":true,"toyone.aichi.jp":true,"toyota.aichi.jp":true,"tsushima.aichi.jp":true,"yatomi.aichi.jp":true,"akita.akita.jp":true,"daisen.akita.jp":true,"fujisato.akita.jp":true,"gojome.akita.jp":true,"hachirogata.akita.jp":true,"happou.akita.jp":true,"higashinaruse.akita.jp":true,"honjo.akita.jp":true,"honjyo.akita.jp":true,"ikawa.akita.jp":true,"kamikoani.akita.jp":true,"kamioka.akita.jp":true,"katagami.akita.jp":true,"kazuno.akita.jp":true,"kitaakita.akita.jp":true,"kosaka.akita.jp":true,"kyowa.akita.jp":true,"misato.akita.jp":true,"mitane.akita.jp":true,"moriyoshi.akita.jp":true,"nikaho.akita.jp":true,"noshiro.akita.jp":true,"odate.akita.jp":true,"oga.akita.jp":true,"ogata.akita.jp":true,"semboku.akita.jp":true,"yokote.akita.jp":true,"yurihonjo.akita.jp":true,"aomori.aomori.jp":true,"gonohe.aomori.jp":true,"hachinohe.aomori.jp":true,"hashikami.aomori.jp":true,"hiranai.aomori.jp":true,"hirosaki.aomori.jp":true,"itayanagi.aomori.jp":true,"kuroishi.aomori.jp":true,"misawa.aomori.jp":true,"mutsu.aomori.jp":true,"nakadomari.aomori.jp":true,"noheji.aomori.jp":true,"oirase.aomori.jp":true,"owani.aomori.jp":true,"rokunohe.aomori.jp":true,"sannohe.aomori.jp":true,"shichinohe.aomori.jp":true,"shingo.aomori.jp":true,"takko.aomori.jp":true,"towada.aomori.jp":true,"tsugaru.aomori.jp":true,"tsuruta.aomori.jp":true,"abiko.chiba.jp":true,"asahi.chiba.jp":true,"chonan.chiba.jp":true,"chosei.chiba.jp":true,"choshi.chiba.jp":true,"chuo.chiba.jp":true,"funabashi.chiba.jp":true,"futtsu.chiba.jp":true,"hanamigawa.chiba.jp":true,"ichihara.chiba.jp":true,"ichikawa.chiba.jp":true,"ichinomiya.chiba.jp":true,"inzai.chiba.jp":true,"isumi.chiba.jp":true,"kamagaya.chiba.jp":true,"kamogawa.chiba.jp":true,"kashiwa.chiba.jp":true,"katori.chiba.jp":true,"katsuura.chiba.jp":true,"kimitsu.chiba.jp":true,"kisarazu.chiba.jp":true,"kozaki.chiba.jp":true,"kujukuri.chiba.jp":true,"kyonan.chiba.jp":true,"matsudo.chiba.jp":true,"midori.chiba.jp":true,"mihama.chiba.jp":true,"minamiboso.chiba.jp":true,"mobara.chiba.jp":true,"mutsuzawa.chiba.jp":true,"nagara.chiba.jp":true,"nagareyama.chiba.jp":true,"narashino.chiba.jp":true,"narita.chiba.jp":true,"noda.chiba.jp":true,"oamishirasato.chiba.jp":true,"omigawa.chiba.jp":true,"onjuku.chiba.jp":true,"otaki.chiba.jp":true,"sakae.chiba.jp":true,"sakura.chiba.jp":true,"shimofusa.chiba.jp":true,"shirako.chiba.jp":true,"shiroi.chiba.jp":true,"shisui.chiba.jp":true,"sodegaura.chiba.jp":true,"sosa.chiba.jp":true,"tako.chiba.jp":true,"tateyama.chiba.jp":true,"togane.chiba.jp":true,"tohnosho.chiba.jp":true,"tomisato.chiba.jp":true,"urayasu.chiba.jp":true,"yachimata.chiba.jp":true,"yachiyo.chiba.jp":true,"yokaichiba.chiba.jp":true,"yokoshibahikari.chiba.jp":true,"yotsukaido.chiba.jp":true,"ainan.ehime.jp":true,"honai.ehime.jp":true,"ikata.ehime.jp":true,"imabari.ehime.jp":true,"iyo.ehime.jp":true,"kamijima.ehime.jp":true,"kihoku.ehime.jp":true,"kumakogen.ehime.jp":true,"masaki.ehime.jp":true,"matsuno.ehime.jp":true,"matsuyama.ehime.jp":true,"namikata.ehime.jp":true,"niihama.ehime.jp":true,"ozu.ehime.jp":true,"saijo.ehime.jp":true,"seiyo.ehime.jp":true,"shikokuchuo.ehime.jp":true,"tobe.ehime.jp":true,"toon.ehime.jp":true,"uchiko.ehime.jp":true,"uwajima.ehime.jp":true,"yawatahama.ehime.jp":true,"echizen.fukui.jp":true,"eiheiji.fukui.jp":true,"fukui.fukui.jp":true,"ikeda.fukui.jp":true,"katsuyama.fukui.jp":true,"mihama.fukui.jp":true,"minamiechizen.fukui.jp":true,"obama.fukui.jp":true,"ohi.fukui.jp":true,"ono.fukui.jp":true,"sabae.fukui.jp":true,"sakai.fukui.jp":true,"takahama.fukui.jp":true,"tsuruga.fukui.jp":true,"wakasa.fukui.jp":true,"ashiya.fukuoka.jp":true,"buzen.fukuoka.jp":true,"chikugo.fukuoka.jp":true,"chikuho.fukuoka.jp":true,"chikujo.fukuoka.jp":true,"chikushino.fukuoka.jp":true,"chikuzen.fukuoka.jp":true,"chuo.fukuoka.jp":true,"dazaifu.fukuoka.jp":true,"fukuchi.fukuoka.jp":true,"hakata.fukuoka.jp":true,"higashi.fukuoka.jp":true,"hirokawa.fukuoka.jp":true,"hisayama.fukuoka.jp":true,"iizuka.fukuoka.jp":true,"inatsuki.fukuoka.jp":true,"kaho.fukuoka.jp":true,"kasuga.fukuoka.jp":true,"kasuya.fukuoka.jp":true,"kawara.fukuoka.jp":true,"keisen.fukuoka.jp":true,"koga.fukuoka.jp":true,"kurate.fukuoka.jp":true,"kurogi.fukuoka.jp":true,"kurume.fukuoka.jp":true,"minami.fukuoka.jp":true,"miyako.fukuoka.jp":true,"miyama.fukuoka.jp":true,"miyawaka.fukuoka.jp":true,"mizumaki.fukuoka.jp":true,"munakata.fukuoka.jp":true,"nakagawa.fukuoka.jp":true,"nakama.fukuoka.jp":true,"nishi.fukuoka.jp":true,"nogata.fukuoka.jp":true,"ogori.fukuoka.jp":true,"okagaki.fukuoka.jp":true,"okawa.fukuoka.jp":true,"oki.fukuoka.jp":true,"omuta.fukuoka.jp":true,"onga.fukuoka.jp":true,"onojo.fukuoka.jp":true,"oto.fukuoka.jp":true,"saigawa.fukuoka.jp":true,"sasaguri.fukuoka.jp":true,"shingu.fukuoka.jp":true,"shinyoshitomi.fukuoka.jp":true,"shonai.fukuoka.jp":true,"soeda.fukuoka.jp":true,"sue.fukuoka.jp":true,"tachiarai.fukuoka.jp":true,"tagawa.fukuoka.jp":true,"takata.fukuoka.jp":true,"toho.fukuoka.jp":true,"toyotsu.fukuoka.jp":true,"tsuiki.fukuoka.jp":true,"ukiha.fukuoka.jp":true,"umi.fukuoka.jp":true,"usui.fukuoka.jp":true,"yamada.fukuoka.jp":true,"yame.fukuoka.jp":true,"yanagawa.fukuoka.jp":true,"yukuhashi.fukuoka.jp":true,"aizubange.fukushima.jp":true,"aizumisato.fukushima.jp":true,"aizuwakamatsu.fukushima.jp":true,"asakawa.fukushima.jp":true,"bandai.fukushima.jp":true,"date.fukushima.jp":true,"fukushima.fukushima.jp":true,"furudono.fukushima.jp":true,"futaba.fukushima.jp":true,"hanawa.fukushima.jp":true,"higashi.fukushima.jp":true,"hirata.fukushima.jp":true,"hirono.fukushima.jp":true,"iitate.fukushima.jp":true,"inawashiro.fukushima.jp":true,"ishikawa.fukushima.jp":true,"iwaki.fukushima.jp":true,"izumizaki.fukushima.jp":true,"kagamiishi.fukushima.jp":true,"kaneyama.fukushima.jp":true,"kawamata.fukushima.jp":true,"kitakata.fukushima.jp":true,"kitashiobara.fukushima.jp":true,"koori.fukushima.jp":true,"koriyama.fukushima.jp":true,"kunimi.fukushima.jp":true,"miharu.fukushima.jp":true,"mishima.fukushima.jp":true,"namie.fukushima.jp":true,"nango.fukushima.jp":true,"nishiaizu.fukushima.jp":true,"nishigo.fukushima.jp":true,"okuma.fukushima.jp":true,"omotego.fukushima.jp":true,"ono.fukushima.jp":true,"otama.fukushima.jp":true,"samegawa.fukushima.jp":true,"shimogo.fukushima.jp":true,"shirakawa.fukushima.jp":true,"showa.fukushima.jp":true,"soma.fukushima.jp":true,"sukagawa.fukushima.jp":true,"taishin.fukushima.jp":true,"tamakawa.fukushima.jp":true,"tanagura.fukushima.jp":true,"tenei.fukushima.jp":true,"yabuki.fukushima.jp":true,"yamato.fukushima.jp":true,"yamatsuri.fukushima.jp":true,"yanaizu.fukushima.jp":true,"yugawa.fukushima.jp":true,"anpachi.gifu.jp":true,"ena.gifu.jp":true,"gifu.gifu.jp":true,"ginan.gifu.jp":true,"godo.gifu.jp":true,"gujo.gifu.jp":true,"hashima.gifu.jp":true,"hichiso.gifu.jp":true,"hida.gifu.jp":true,"higashishirakawa.gifu.jp":true,"ibigawa.gifu.jp":true,"ikeda.gifu.jp":true,"kakamigahara.gifu.jp":true,"kani.gifu.jp":true,"kasahara.gifu.jp":true,"kasamatsu.gifu.jp":true,"kawaue.gifu.jp":true,"kitagata.gifu.jp":true,"mino.gifu.jp":true,"minokamo.gifu.jp":true,"mitake.gifu.jp":true,"mizunami.gifu.jp":true,"motosu.gifu.jp":true,"nakatsugawa.gifu.jp":true,"ogaki.gifu.jp":true,"sakahogi.gifu.jp":true,"seki.gifu.jp":true,"sekigahara.gifu.jp":true,"shirakawa.gifu.jp":true,"tajimi.gifu.jp":true,"takayama.gifu.jp":true,"tarui.gifu.jp":true,"toki.gifu.jp":true,"tomika.gifu.jp":true,"wanouchi.gifu.jp":true,"yamagata.gifu.jp":true,"yaotsu.gifu.jp":true,"yoro.gifu.jp":true,"annaka.gunma.jp":true,"chiyoda.gunma.jp":true,"fujioka.gunma.jp":true,"higashiagatsuma.gunma.jp":true,"isesaki.gunma.jp":true,"itakura.gunma.jp":true,"kanna.gunma.jp":true,"kanra.gunma.jp":true,"katashina.gunma.jp":true,"kawaba.gunma.jp":true,"kiryu.gunma.jp":true,"kusatsu.gunma.jp":true,"maebashi.gunma.jp":true,"meiwa.gunma.jp":true,"midori.gunma.jp":true,"minakami.gunma.jp":true,"naganohara.gunma.jp":true,"nakanojo.gunma.jp":true,"nanmoku.gunma.jp":true,"numata.gunma.jp":true,"oizumi.gunma.jp":true,"ora.gunma.jp":true,"ota.gunma.jp":true,"shibukawa.gunma.jp":true,"shimonita.gunma.jp":true,"shinto.gunma.jp":true,"showa.gunma.jp":true,"takasaki.gunma.jp":true,"takayama.gunma.jp":true,"tamamura.gunma.jp":true,"tatebayashi.gunma.jp":true,"tomioka.gunma.jp":true,"tsukiyono.gunma.jp":true,"tsumagoi.gunma.jp":true,"ueno.gunma.jp":true,"yoshioka.gunma.jp":true,"asaminami.hiroshima.jp":true,"daiwa.hiroshima.jp":true,"etajima.hiroshima.jp":true,"fuchu.hiroshima.jp":true,"fukuyama.hiroshima.jp":true,"hatsukaichi.hiroshima.jp":true,"higashihiroshima.hiroshima.jp":true,"hongo.hiroshima.jp":true,"jinsekikogen.hiroshima.jp":true,"kaita.hiroshima.jp":true,"kui.hiroshima.jp":true,"kumano.hiroshima.jp":true,"kure.hiroshima.jp":true,"mihara.hiroshima.jp":true,"miyoshi.hiroshima.jp":true,"naka.hiroshima.jp":true,"onomichi.hiroshima.jp":true,"osakikamijima.hiroshima.jp":true,"otake.hiroshima.jp":true,"saka.hiroshima.jp":true,"sera.hiroshima.jp":true,"seranishi.hiroshima.jp":true,"shinichi.hiroshima.jp":true,"shobara.hiroshima.jp":true,"takehara.hiroshima.jp":true,"abashiri.hokkaido.jp":true,"abira.hokkaido.jp":true,"aibetsu.hokkaido.jp":true,"akabira.hokkaido.jp":true,"akkeshi.hokkaido.jp":true,"asahikawa.hokkaido.jp":true,"ashibetsu.hokkaido.jp":true,"ashoro.hokkaido.jp":true,"assabu.hokkaido.jp":true,"atsuma.hokkaido.jp":true,"bibai.hokkaido.jp":true,"biei.hokkaido.jp":true,"bifuka.hokkaido.jp":true,"bihoro.hokkaido.jp":true,"biratori.hokkaido.jp":true,"chippubetsu.hokkaido.jp":true,"chitose.hokkaido.jp":true,"date.hokkaido.jp":true,"ebetsu.hokkaido.jp":true,"embetsu.hokkaido.jp":true,"eniwa.hokkaido.jp":true,"erimo.hokkaido.jp":true,"esan.hokkaido.jp":true,"esashi.hokkaido.jp":true,"fukagawa.hokkaido.jp":true,"fukushima.hokkaido.jp":true,"furano.hokkaido.jp":true,"furubira.hokkaido.jp":true,"haboro.hokkaido.jp":true,"hakodate.hokkaido.jp":true,"hamatonbetsu.hokkaido.jp":true,"hidaka.hokkaido.jp":true,"higashikagura.hokkaido.jp":true,"higashikawa.hokkaido.jp":true,"hiroo.hokkaido.jp":true,"hokuryu.hokkaido.jp":true,"hokuto.hokkaido.jp":true,"honbetsu.hokkaido.jp":true,"horokanai.hokkaido.jp":true,"horonobe.hokkaido.jp":true,"ikeda.hokkaido.jp":true,"imakane.hokkaido.jp":true,"ishikari.hokkaido.jp":true,"iwamizawa.hokkaido.jp":true,"iwanai.hokkaido.jp":true,"kamifurano.hokkaido.jp":true,"kamikawa.hokkaido.jp":true,"kamishihoro.hokkaido.jp":true,"kamisunagawa.hokkaido.jp":true,"kamoenai.hokkaido.jp":true,"kayabe.hokkaido.jp":true,"kembuchi.hokkaido.jp":true,"kikonai.hokkaido.jp":true,"kimobetsu.hokkaido.jp":true,"kitahiroshima.hokkaido.jp":true,"kitami.hokkaido.jp":true,"kiyosato.hokkaido.jp":true,"koshimizu.hokkaido.jp":true,"kunneppu.hokkaido.jp":true,"kuriyama.hokkaido.jp":true,"kuromatsunai.hokkaido.jp":true,"kushiro.hokkaido.jp":true,"kutchan.hokkaido.jp":true,"kyowa.hokkaido.jp":true,"mashike.hokkaido.jp":true,"matsumae.hokkaido.jp":true,"mikasa.hokkaido.jp":true,"minamifurano.hokkaido.jp":true,"mombetsu.hokkaido.jp":true,"moseushi.hokkaido.jp":true,"mukawa.hokkaido.jp":true,"muroran.hokkaido.jp":true,"naie.hokkaido.jp":true,"nakagawa.hokkaido.jp":true,"nakasatsunai.hokkaido.jp":true,"nakatombetsu.hokkaido.jp":true,"nanae.hokkaido.jp":true,"nanporo.hokkaido.jp":true,"nayoro.hokkaido.jp":true,"nemuro.hokkaido.jp":true,"niikappu.hokkaido.jp":true,"niki.hokkaido.jp":true,"nishiokoppe.hokkaido.jp":true,"noboribetsu.hokkaido.jp":true,"numata.hokkaido.jp":true,"obihiro.hokkaido.jp":true,"obira.hokkaido.jp":true,"oketo.hokkaido.jp":true,"okoppe.hokkaido.jp":true,"otaru.hokkaido.jp":true,"otobe.hokkaido.jp":true,"otofuke.hokkaido.jp":true,"otoineppu.hokkaido.jp":true,"oumu.hokkaido.jp":true,"ozora.hokkaido.jp":true,"pippu.hokkaido.jp":true,"rankoshi.hokkaido.jp":true,"rebun.hokkaido.jp":true,"rikubetsu.hokkaido.jp":true,"rishiri.hokkaido.jp":true,"rishirifuji.hokkaido.jp":true,"saroma.hokkaido.jp":true,"sarufutsu.hokkaido.jp":true,"shakotan.hokkaido.jp":true,"shari.hokkaido.jp":true,"shibecha.hokkaido.jp":true,"shibetsu.hokkaido.jp":true,"shikabe.hokkaido.jp":true,"shikaoi.hokkaido.jp":true,"shimamaki.hokkaido.jp":true,"shimizu.hokkaido.jp":true,"shimokawa.hokkaido.jp":true,"shinshinotsu.hokkaido.jp":true,"shintoku.hokkaido.jp":true,"shiranuka.hokkaido.jp":true,"shiraoi.hokkaido.jp":true,"shiriuchi.hokkaido.jp":true,"sobetsu.hokkaido.jp":true,"sunagawa.hokkaido.jp":true,"taiki.hokkaido.jp":true,"takasu.hokkaido.jp":true,"takikawa.hokkaido.jp":true,"takinoue.hokkaido.jp":true,"teshikaga.hokkaido.jp":true,"tobetsu.hokkaido.jp":true,"tohma.hokkaido.jp":true,"tomakomai.hokkaido.jp":true,"tomari.hokkaido.jp":true,"toya.hokkaido.jp":true,"toyako.hokkaido.jp":true,"toyotomi.hokkaido.jp":true,"toyoura.hokkaido.jp":true,"tsubetsu.hokkaido.jp":true,"tsukigata.hokkaido.jp":true,"urakawa.hokkaido.jp":true,"urausu.hokkaido.jp":true,"uryu.hokkaido.jp":true,"utashinai.hokkaido.jp":true,"wakkanai.hokkaido.jp":true,"wassamu.hokkaido.jp":true,"yakumo.hokkaido.jp":true,"yoichi.hokkaido.jp":true,"aioi.hyogo.jp":true,"akashi.hyogo.jp":true,"ako.hyogo.jp":true,"amagasaki.hyogo.jp":true,"aogaki.hyogo.jp":true,"asago.hyogo.jp":true,"ashiya.hyogo.jp":true,"awaji.hyogo.jp":true,"fukusaki.hyogo.jp":true,"goshiki.hyogo.jp":true,"harima.hyogo.jp":true,"himeji.hyogo.jp":true,"ichikawa.hyogo.jp":true,"inagawa.hyogo.jp":true,"itami.hyogo.jp":true,"kakogawa.hyogo.jp":true,"kamigori.hyogo.jp":true,"kamikawa.hyogo.jp":true,"kasai.hyogo.jp":true,"kasuga.hyogo.jp":true,"kawanishi.hyogo.jp":true,"miki.hyogo.jp":true,"minamiawaji.hyogo.jp":true,"nishinomiya.hyogo.jp":true,"nishiwaki.hyogo.jp":true,"ono.hyogo.jp":true,"sanda.hyogo.jp":true,"sannan.hyogo.jp":true,"sasayama.hyogo.jp":true,"sayo.hyogo.jp":true,"shingu.hyogo.jp":true,"shinonsen.hyogo.jp":true,"shiso.hyogo.jp":true,"sumoto.hyogo.jp":true,"taishi.hyogo.jp":true,"taka.hyogo.jp":true,"takarazuka.hyogo.jp":true,"takasago.hyogo.jp":true,"takino.hyogo.jp":true,"tamba.hyogo.jp":true,"tatsuno.hyogo.jp":true,"toyooka.hyogo.jp":true,"yabu.hyogo.jp":true,"yashiro.hyogo.jp":true,"yoka.hyogo.jp":true,"yokawa.hyogo.jp":true,"ami.ibaraki.jp":true,"asahi.ibaraki.jp":true,"bando.ibaraki.jp":true,"chikusei.ibaraki.jp":true,"daigo.ibaraki.jp":true,"fujishiro.ibaraki.jp":true,"hitachi.ibaraki.jp":true,"hitachinaka.ibaraki.jp":true,"hitachiomiya.ibaraki.jp":true,"hitachiota.ibaraki.jp":true,"ibaraki.ibaraki.jp":true,"ina.ibaraki.jp":true,"inashiki.ibaraki.jp":true,"itako.ibaraki.jp":true,"iwama.ibaraki.jp":true,"joso.ibaraki.jp":true,"kamisu.ibaraki.jp":true,"kasama.ibaraki.jp":true,"kashima.ibaraki.jp":true,"kasumigaura.ibaraki.jp":true,"koga.ibaraki.jp":true,"miho.ibaraki.jp":true,"mito.ibaraki.jp":true,"moriya.ibaraki.jp":true,"naka.ibaraki.jp":true,"namegata.ibaraki.jp":true,"oarai.ibaraki.jp":true,"ogawa.ibaraki.jp":true,"omitama.ibaraki.jp":true,"ryugasaki.ibaraki.jp":true,"sakai.ibaraki.jp":true,"sakuragawa.ibaraki.jp":true,"shimodate.ibaraki.jp":true,"shimotsuma.ibaraki.jp":true,"shirosato.ibaraki.jp":true,"sowa.ibaraki.jp":true,"suifu.ibaraki.jp":true,"takahagi.ibaraki.jp":true,"tamatsukuri.ibaraki.jp":true,"tokai.ibaraki.jp":true,"tomobe.ibaraki.jp":true,"tone.ibaraki.jp":true,"toride.ibaraki.jp":true,"tsuchiura.ibaraki.jp":true,"tsukuba.ibaraki.jp":true,"uchihara.ibaraki.jp":true,"ushiku.ibaraki.jp":true,"yachiyo.ibaraki.jp":true,"yamagata.ibaraki.jp":true,"yawara.ibaraki.jp":true,"yuki.ibaraki.jp":true,"anamizu.ishikawa.jp":true,"hakui.ishikawa.jp":true,"hakusan.ishikawa.jp":true,"kaga.ishikawa.jp":true,"kahoku.ishikawa.jp":true,"kanazawa.ishikawa.jp":true,"kawakita.ishikawa.jp":true,"komatsu.ishikawa.jp":true,"nakanoto.ishikawa.jp":true,"nanao.ishikawa.jp":true,"nomi.ishikawa.jp":true,"nonoichi.ishikawa.jp":true,"noto.ishikawa.jp":true,"shika.ishikawa.jp":true,"suzu.ishikawa.jp":true,"tsubata.ishikawa.jp":true,"tsurugi.ishikawa.jp":true,"uchinada.ishikawa.jp":true,"wajima.ishikawa.jp":true,"fudai.iwate.jp":true,"fujisawa.iwate.jp":true,"hanamaki.iwate.jp":true,"hiraizumi.iwate.jp":true,"hirono.iwate.jp":true,"ichinohe.iwate.jp":true,"ichinoseki.iwate.jp":true,"iwaizumi.iwate.jp":true,"iwate.iwate.jp":true,"joboji.iwate.jp":true,"kamaishi.iwate.jp":true,"kanegasaki.iwate.jp":true,"karumai.iwate.jp":true,"kawai.iwate.jp":true,"kitakami.iwate.jp":true,"kuji.iwate.jp":true,"kunohe.iwate.jp":true,"kuzumaki.iwate.jp":true,"miyako.iwate.jp":true,"mizusawa.iwate.jp":true,"morioka.iwate.jp":true,"ninohe.iwate.jp":true,"noda.iwate.jp":true,"ofunato.iwate.jp":true,"oshu.iwate.jp":true,"otsuchi.iwate.jp":true,"rikuzentakata.iwate.jp":true,"shiwa.iwate.jp":true,"shizukuishi.iwate.jp":true,"sumita.iwate.jp":true,"tanohata.iwate.jp":true,"tono.iwate.jp":true,"yahaba.iwate.jp":true,"yamada.iwate.jp":true,"ayagawa.kagawa.jp":true,"higashikagawa.kagawa.jp":true,"kanonji.kagawa.jp":true,"kotohira.kagawa.jp":true,"manno.kagawa.jp":true,"marugame.kagawa.jp":true,"mitoyo.kagawa.jp":true,"naoshima.kagawa.jp":true,"sanuki.kagawa.jp":true,"tadotsu.kagawa.jp":true,"takamatsu.kagawa.jp":true,"tonosho.kagawa.jp":true,"uchinomi.kagawa.jp":true,"utazu.kagawa.jp":true,"zentsuji.kagawa.jp":true,"akune.kagoshima.jp":true,"amami.kagoshima.jp":true,"hioki.kagoshima.jp":true,"isa.kagoshima.jp":true,"isen.kagoshima.jp":true,"izumi.kagoshima.jp":true,"kagoshima.kagoshima.jp":true,"kanoya.kagoshima.jp":true,"kawanabe.kagoshima.jp":true,"kinko.kagoshima.jp":true,"kouyama.kagoshima.jp":true,"makurazaki.kagoshima.jp":true,"matsumoto.kagoshima.jp":true,"minamitane.kagoshima.jp":true,"nakatane.kagoshima.jp":true,"nishinoomote.kagoshima.jp":true,"satsumasendai.kagoshima.jp":true,"soo.kagoshima.jp":true,"tarumizu.kagoshima.jp":true,"yusui.kagoshima.jp":true,"aikawa.kanagawa.jp":true,"atsugi.kanagawa.jp":true,"ayase.kanagawa.jp":true,"chigasaki.kanagawa.jp":true,"ebina.kanagawa.jp":true,"fujisawa.kanagawa.jp":true,"hadano.kanagawa.jp":true,"hakone.kanagawa.jp":true,"hiratsuka.kanagawa.jp":true,"isehara.kanagawa.jp":true,"kaisei.kanagawa.jp":true,"kamakura.kanagawa.jp":true,"kiyokawa.kanagawa.jp":true,"matsuda.kanagawa.jp":true,"minamiashigara.kanagawa.jp":true,"miura.kanagawa.jp":true,"nakai.kanagawa.jp":true,"ninomiya.kanagawa.jp":true,"odawara.kanagawa.jp":true,"oi.kanagawa.jp":true,"oiso.kanagawa.jp":true,"sagamihara.kanagawa.jp":true,"samukawa.kanagawa.jp":true,"tsukui.kanagawa.jp":true,"yamakita.kanagawa.jp":true,"yamato.kanagawa.jp":true,"yokosuka.kanagawa.jp":true,"yugawara.kanagawa.jp":true,"zama.kanagawa.jp":true,"zushi.kanagawa.jp":true,"aki.kochi.jp":true,"geisei.kochi.jp":true,"hidaka.kochi.jp":true,"higashitsuno.kochi.jp":true,"ino.kochi.jp":true,"kagami.kochi.jp":true,"kami.kochi.jp":true,"kitagawa.kochi.jp":true,"kochi.kochi.jp":true,"mihara.kochi.jp":true,"motoyama.kochi.jp":true,"muroto.kochi.jp":true,"nahari.kochi.jp":true,"nakamura.kochi.jp":true,"nankoku.kochi.jp":true,"nishitosa.kochi.jp":true,"niyodogawa.kochi.jp":true,"ochi.kochi.jp":true,"okawa.kochi.jp":true,"otoyo.kochi.jp":true,"otsuki.kochi.jp":true,"sakawa.kochi.jp":true,"sukumo.kochi.jp":true,"susaki.kochi.jp":true,"tosa.kochi.jp":true,"tosashimizu.kochi.jp":true,"toyo.kochi.jp":true,"tsuno.kochi.jp":true,"umaji.kochi.jp":true,"yasuda.kochi.jp":true,"yusuhara.kochi.jp":true,"amakusa.kumamoto.jp":true,"arao.kumamoto.jp":true,"aso.kumamoto.jp":true,"choyo.kumamoto.jp":true,"gyokuto.kumamoto.jp":true,"kamiamakusa.kumamoto.jp":true,"kikuchi.kumamoto.jp":true,"kumamoto.kumamoto.jp":true,"mashiki.kumamoto.jp":true,"mifune.kumamoto.jp":true,"minamata.kumamoto.jp":true,"minamioguni.kumamoto.jp":true,"nagasu.kumamoto.jp":true,"nishihara.kumamoto.jp":true,"oguni.kumamoto.jp":true,"ozu.kumamoto.jp":true,"sumoto.kumamoto.jp":true,"takamori.kumamoto.jp":true,"uki.kumamoto.jp":true,"uto.kumamoto.jp":true,"yamaga.kumamoto.jp":true,"yamato.kumamoto.jp":true,"yatsushiro.kumamoto.jp":true,"ayabe.kyoto.jp":true,"fukuchiyama.kyoto.jp":true,"higashiyama.kyoto.jp":true,"ide.kyoto.jp":true,"ine.kyoto.jp":true,"joyo.kyoto.jp":true,"kameoka.kyoto.jp":true,"kamo.kyoto.jp":true,"kita.kyoto.jp":true,"kizu.kyoto.jp":true,"kumiyama.kyoto.jp":true,"kyotamba.kyoto.jp":true,"kyotanabe.kyoto.jp":true,"kyotango.kyoto.jp":true,"maizuru.kyoto.jp":true,"minami.kyoto.jp":true,"minamiyamashiro.kyoto.jp":true,"miyazu.kyoto.jp":true,"muko.kyoto.jp":true,"nagaokakyo.kyoto.jp":true,"nakagyo.kyoto.jp":true,"nantan.kyoto.jp":true,"oyamazaki.kyoto.jp":true,"sakyo.kyoto.jp":true,"seika.kyoto.jp":true,"tanabe.kyoto.jp":true,"uji.kyoto.jp":true,"ujitawara.kyoto.jp":true,"wazuka.kyoto.jp":true,"yamashina.kyoto.jp":true,"yawata.kyoto.jp":true,"asahi.mie.jp":true,"inabe.mie.jp":true,"ise.mie.jp":true,"kameyama.mie.jp":true,"kawagoe.mie.jp":true,"kiho.mie.jp":true,"kisosaki.mie.jp":true,"kiwa.mie.jp":true,"komono.mie.jp":true,"kumano.mie.jp":true,"kuwana.mie.jp":true,"matsusaka.mie.jp":true,"meiwa.mie.jp":true,"mihama.mie.jp":true,"minamiise.mie.jp":true,"misugi.mie.jp":true,"miyama.mie.jp":true,"nabari.mie.jp":true,"shima.mie.jp":true,"suzuka.mie.jp":true,"tado.mie.jp":true,"taiki.mie.jp":true,"taki.mie.jp":true,"tamaki.mie.jp":true,"toba.mie.jp":true,"tsu.mie.jp":true,"udono.mie.jp":true,"ureshino.mie.jp":true,"watarai.mie.jp":true,"yokkaichi.mie.jp":true,"furukawa.miyagi.jp":true,"higashimatsushima.miyagi.jp":true,"ishinomaki.miyagi.jp":true,"iwanuma.miyagi.jp":true,"kakuda.miyagi.jp":true,"kami.miyagi.jp":true,"kawasaki.miyagi.jp":true,"marumori.miyagi.jp":true,"matsushima.miyagi.jp":true,"minamisanriku.miyagi.jp":true,"misato.miyagi.jp":true,"murata.miyagi.jp":true,"natori.miyagi.jp":true,"ogawara.miyagi.jp":true,"ohira.miyagi.jp":true,"onagawa.miyagi.jp":true,"osaki.miyagi.jp":true,"rifu.miyagi.jp":true,"semine.miyagi.jp":true,"shibata.miyagi.jp":true,"shichikashuku.miyagi.jp":true,"shikama.miyagi.jp":true,"shiogama.miyagi.jp":true,"shiroishi.miyagi.jp":true,"tagajo.miyagi.jp":true,"taiwa.miyagi.jp":true,"tome.miyagi.jp":true,"tomiya.miyagi.jp":true,"wakuya.miyagi.jp":true,"watari.miyagi.jp":true,"yamamoto.miyagi.jp":true,"zao.miyagi.jp":true,"aya.miyazaki.jp":true,"ebino.miyazaki.jp":true,"gokase.miyazaki.jp":true,"hyuga.miyazaki.jp":true,"kadogawa.miyazaki.jp":true,"kawaminami.miyazaki.jp":true,"kijo.miyazaki.jp":true,"kitagawa.miyazaki.jp":true,"kitakata.miyazaki.jp":true,"kitaura.miyazaki.jp":true,"kobayashi.miyazaki.jp":true,"kunitomi.miyazaki.jp":true,"kushima.miyazaki.jp":true,"mimata.miyazaki.jp":true,"miyakonojo.miyazaki.jp":true,"miyazaki.miyazaki.jp":true,"morotsuka.miyazaki.jp":true,"nichinan.miyazaki.jp":true,"nishimera.miyazaki.jp":true,"nobeoka.miyazaki.jp":true,"saito.miyazaki.jp":true,"shiiba.miyazaki.jp":true,"shintomi.miyazaki.jp":true,"takaharu.miyazaki.jp":true,"takanabe.miyazaki.jp":true,"takazaki.miyazaki.jp":true,"tsuno.miyazaki.jp":true,"achi.nagano.jp":true,"agematsu.nagano.jp":true,"anan.nagano.jp":true,"aoki.nagano.jp":true,"asahi.nagano.jp":true,"azumino.nagano.jp":true,"chikuhoku.nagano.jp":true,"chikuma.nagano.jp":true,"chino.nagano.jp":true,"fujimi.nagano.jp":true,"hakuba.nagano.jp":true,"hara.nagano.jp":true,"hiraya.nagano.jp":true,"iida.nagano.jp":true,"iijima.nagano.jp":true,"iiyama.nagano.jp":true,"iizuna.nagano.jp":true,"ikeda.nagano.jp":true,"ikusaka.nagano.jp":true,"ina.nagano.jp":true,"karuizawa.nagano.jp":true,"kawakami.nagano.jp":true,"kiso.nagano.jp":true,"kisofukushima.nagano.jp":true,"kitaaiki.nagano.jp":true,"komagane.nagano.jp":true,"komoro.nagano.jp":true,"matsukawa.nagano.jp":true,"matsumoto.nagano.jp":true,"miasa.nagano.jp":true,"minamiaiki.nagano.jp":true,"minamimaki.nagano.jp":true,"minamiminowa.nagano.jp":true,"minowa.nagano.jp":true,"miyada.nagano.jp":true,"miyota.nagano.jp":true,"mochizuki.nagano.jp":true,"nagano.nagano.jp":true,"nagawa.nagano.jp":true,"nagiso.nagano.jp":true,"nakagawa.nagano.jp":true,"nakano.nagano.jp":true,"nozawaonsen.nagano.jp":true,"obuse.nagano.jp":true,"ogawa.nagano.jp":true,"okaya.nagano.jp":true,"omachi.nagano.jp":true,"omi.nagano.jp":true,"ookuwa.nagano.jp":true,"ooshika.nagano.jp":true,"otaki.nagano.jp":true,"otari.nagano.jp":true,"sakae.nagano.jp":true,"sakaki.nagano.jp":true,"saku.nagano.jp":true,"sakuho.nagano.jp":true,"shimosuwa.nagano.jp":true,"shinanomachi.nagano.jp":true,"shiojiri.nagano.jp":true,"suwa.nagano.jp":true,"suzaka.nagano.jp":true,"takagi.nagano.jp":true,"takamori.nagano.jp":true,"takayama.nagano.jp":true,"tateshina.nagano.jp":true,"tatsuno.nagano.jp":true,"togakushi.nagano.jp":true,"togura.nagano.jp":true,"tomi.nagano.jp":true,"ueda.nagano.jp":true,"wada.nagano.jp":true,"yamagata.nagano.jp":true,"yamanouchi.nagano.jp":true,"yasaka.nagano.jp":true,"yasuoka.nagano.jp":true,"chijiwa.nagasaki.jp":true,"futsu.nagasaki.jp":true,"goto.nagasaki.jp":true,"hasami.nagasaki.jp":true,"hirado.nagasaki.jp":true,"iki.nagasaki.jp":true,"isahaya.nagasaki.jp":true,"kawatana.nagasaki.jp":true,"kuchinotsu.nagasaki.jp":true,"matsuura.nagasaki.jp":true,"nagasaki.nagasaki.jp":true,"obama.nagasaki.jp":true,"omura.nagasaki.jp":true,"oseto.nagasaki.jp":true,"saikai.nagasaki.jp":true,"sasebo.nagasaki.jp":true,"seihi.nagasaki.jp":true,"shimabara.nagasaki.jp":true,"shinkamigoto.nagasaki.jp":true,"togitsu.nagasaki.jp":true,"tsushima.nagasaki.jp":true,"unzen.nagasaki.jp":true,"ando.nara.jp":true,"gose.nara.jp":true,"heguri.nara.jp":true,"higashiyoshino.nara.jp":true,"ikaruga.nara.jp":true,"ikoma.nara.jp":true,"kamikitayama.nara.jp":true,"kanmaki.nara.jp":true,"kashiba.nara.jp":true,"kashihara.nara.jp":true,"katsuragi.nara.jp":true,"kawai.nara.jp":true,"kawakami.nara.jp":true,"kawanishi.nara.jp":true,"koryo.nara.jp":true,"kurotaki.nara.jp":true,"mitsue.nara.jp":true,"miyake.nara.jp":true,"nara.nara.jp":true,"nosegawa.nara.jp":true,"oji.nara.jp":true,"ouda.nara.jp":true,"oyodo.nara.jp":true,"sakurai.nara.jp":true,"sango.nara.jp":true,"shimoichi.nara.jp":true,"shimokitayama.nara.jp":true,"shinjo.nara.jp":true,"soni.nara.jp":true,"takatori.nara.jp":true,"tawaramoto.nara.jp":true,"tenkawa.nara.jp":true,"tenri.nara.jp":true,"uda.nara.jp":true,"yamatokoriyama.nara.jp":true,"yamatotakada.nara.jp":true,"yamazoe.nara.jp":true,"yoshino.nara.jp":true,"aga.niigata.jp":true,"agano.niigata.jp":true,"gosen.niigata.jp":true,"itoigawa.niigata.jp":true,"izumozaki.niigata.jp":true,"joetsu.niigata.jp":true,"kamo.niigata.jp":true,"kariwa.niigata.jp":true,"kashiwazaki.niigata.jp":true,"minamiuonuma.niigata.jp":true,"mitsuke.niigata.jp":true,"muika.niigata.jp":true,"murakami.niigata.jp":true,"myoko.niigata.jp":true,"nagaoka.niigata.jp":true,"niigata.niigata.jp":true,"ojiya.niigata.jp":true,"omi.niigata.jp":true,"sado.niigata.jp":true,"sanjo.niigata.jp":true,"seiro.niigata.jp":true,"seirou.niigata.jp":true,"sekikawa.niigata.jp":true,"shibata.niigata.jp":true,"tagami.niigata.jp":true,"tainai.niigata.jp":true,"tochio.niigata.jp":true,"tokamachi.niigata.jp":true,"tsubame.niigata.jp":true,"tsunan.niigata.jp":true,"uonuma.niigata.jp":true,"yahiko.niigata.jp":true,"yoita.niigata.jp":true,"yuzawa.niigata.jp":true,"beppu.oita.jp":true,"bungoono.oita.jp":true,"bungotakada.oita.jp":true,"hasama.oita.jp":true,"hiji.oita.jp":true,"himeshima.oita.jp":true,"hita.oita.jp":true,"kamitsue.oita.jp":true,"kokonoe.oita.jp":true,"kuju.oita.jp":true,"kunisaki.oita.jp":true,"kusu.oita.jp":true,"oita.oita.jp":true,"saiki.oita.jp":true,"taketa.oita.jp":true,"tsukumi.oita.jp":true,"usa.oita.jp":true,"usuki.oita.jp":true,"yufu.oita.jp":true,"akaiwa.okayama.jp":true,"asakuchi.okayama.jp":true,"bizen.okayama.jp":true,"hayashima.okayama.jp":true,"ibara.okayama.jp":true,"kagamino.okayama.jp":true,"kasaoka.okayama.jp":true,"kibichuo.okayama.jp":true,"kumenan.okayama.jp":true,"kurashiki.okayama.jp":true,"maniwa.okayama.jp":true,"misaki.okayama.jp":true,"nagi.okayama.jp":true,"niimi.okayama.jp":true,"nishiawakura.okayama.jp":true,"okayama.okayama.jp":true,"satosho.okayama.jp":true,"setouchi.okayama.jp":true,"shinjo.okayama.jp":true,"shoo.okayama.jp":true,"soja.okayama.jp":true,"takahashi.okayama.jp":true,"tamano.okayama.jp":true,"tsuyama.okayama.jp":true,"wake.okayama.jp":true,"yakage.okayama.jp":true,"aguni.okinawa.jp":true,"ginowan.okinawa.jp":true,"ginoza.okinawa.jp":true,"gushikami.okinawa.jp":true,"haebaru.okinawa.jp":true,"higashi.okinawa.jp":true,"hirara.okinawa.jp":true,"iheya.okinawa.jp":true,"ishigaki.okinawa.jp":true,"ishikawa.okinawa.jp":true,"itoman.okinawa.jp":true,"izena.okinawa.jp":true,"kadena.okinawa.jp":true,"kin.okinawa.jp":true,"kitadaito.okinawa.jp":true,"kitanakagusuku.okinawa.jp":true,"kumejima.okinawa.jp":true,"kunigami.okinawa.jp":true,"minamidaito.okinawa.jp":true,"motobu.okinawa.jp":true,"nago.okinawa.jp":true,"naha.okinawa.jp":true,"nakagusuku.okinawa.jp":true,"nakijin.okinawa.jp":true,"nanjo.okinawa.jp":true,"nishihara.okinawa.jp":true,"ogimi.okinawa.jp":true,"okinawa.okinawa.jp":true,"onna.okinawa.jp":true,"shimoji.okinawa.jp":true,"taketomi.okinawa.jp":true,"tarama.okinawa.jp":true,"tokashiki.okinawa.jp":true,"tomigusuku.okinawa.jp":true,"tonaki.okinawa.jp":true,"urasoe.okinawa.jp":true,"uruma.okinawa.jp":true,"yaese.okinawa.jp":true,"yomitan.okinawa.jp":true,"yonabaru.okinawa.jp":true,"yonaguni.okinawa.jp":true,"zamami.okinawa.jp":true,"abeno.osaka.jp":true,"chihayaakasaka.osaka.jp":true,"chuo.osaka.jp":true,"daito.osaka.jp":true,"fujiidera.osaka.jp":true,"habikino.osaka.jp":true,"hannan.osaka.jp":true,"higashiosaka.osaka.jp":true,"higashisumiyoshi.osaka.jp":true,"higashiyodogawa.osaka.jp":true,"hirakata.osaka.jp":true,"ibaraki.osaka.jp":true,"ikeda.osaka.jp":true,"izumi.osaka.jp":true,"izumiotsu.osaka.jp":true,"izumisano.osaka.jp":true,"kadoma.osaka.jp":true,"kaizuka.osaka.jp":true,"kanan.osaka.jp":true,"kashiwara.osaka.jp":true,"katano.osaka.jp":true,"kawachinagano.osaka.jp":true,"kishiwada.osaka.jp":true,"kita.osaka.jp":true,"kumatori.osaka.jp":true,"matsubara.osaka.jp":true,"minato.osaka.jp":true,"minoh.osaka.jp":true,"misaki.osaka.jp":true,"moriguchi.osaka.jp":true,"neyagawa.osaka.jp":true,"nishi.osaka.jp":true,"nose.osaka.jp":true,"osakasayama.osaka.jp":true,"sakai.osaka.jp":true,"sayama.osaka.jp":true,"sennan.osaka.jp":true,"settsu.osaka.jp":true,"shijonawate.osaka.jp":true,"shimamoto.osaka.jp":true,"suita.osaka.jp":true,"tadaoka.osaka.jp":true,"taishi.osaka.jp":true,"tajiri.osaka.jp":true,"takaishi.osaka.jp":true,"takatsuki.osaka.jp":true,"tondabayashi.osaka.jp":true,"toyonaka.osaka.jp":true,"toyono.osaka.jp":true,"yao.osaka.jp":true,"ariake.saga.jp":true,"arita.saga.jp":true,"fukudomi.saga.jp":true,"genkai.saga.jp":true,"hamatama.saga.jp":true,"hizen.saga.jp":true,"imari.saga.jp":true,"kamimine.saga.jp":true,"kanzaki.saga.jp":true,"karatsu.saga.jp":true,"kashima.saga.jp":true,"kitagata.saga.jp":true,"kitahata.saga.jp":true,"kiyama.saga.jp":true,"kouhoku.saga.jp":true,"kyuragi.saga.jp":true,"nishiarita.saga.jp":true,"ogi.saga.jp":true,"omachi.saga.jp":true,"ouchi.saga.jp":true,"saga.saga.jp":true,"shiroishi.saga.jp":true,"taku.saga.jp":true,"tara.saga.jp":true,"tosu.saga.jp":true,"yoshinogari.saga.jp":true,"arakawa.saitama.jp":true,"asaka.saitama.jp":true,"chichibu.saitama.jp":true,"fujimi.saitama.jp":true,"fujimino.saitama.jp":true,"fukaya.saitama.jp":true,"hanno.saitama.jp":true,"hanyu.saitama.jp":true,"hasuda.saitama.jp":true,"hatogaya.saitama.jp":true,"hatoyama.saitama.jp":true,"hidaka.saitama.jp":true,"higashichichibu.saitama.jp":true,"higashimatsuyama.saitama.jp":true,"honjo.saitama.jp":true,"ina.saitama.jp":true,"iruma.saitama.jp":true,"iwatsuki.saitama.jp":true,"kamiizumi.saitama.jp":true,"kamikawa.saitama.jp":true,"kamisato.saitama.jp":true,"kasukabe.saitama.jp":true,"kawagoe.saitama.jp":true,"kawaguchi.saitama.jp":true,"kawajima.saitama.jp":true,"kazo.saitama.jp":true,"kitamoto.saitama.jp":true,"koshigaya.saitama.jp":true,"kounosu.saitama.jp":true,"kuki.saitama.jp":true,"kumagaya.saitama.jp":true,"matsubushi.saitama.jp":true,"minano.saitama.jp":true,"misato.saitama.jp":true,"miyashiro.saitama.jp":true,"miyoshi.saitama.jp":true,"moroyama.saitama.jp":true,"nagatoro.saitama.jp":true,"namegawa.saitama.jp":true,"niiza.saitama.jp":true,"ogano.saitama.jp":true,"ogawa.saitama.jp":true,"ogose.saitama.jp":true,"okegawa.saitama.jp":true,"omiya.saitama.jp":true,"otaki.saitama.jp":true,"ranzan.saitama.jp":true,"ryokami.saitama.jp":true,"saitama.saitama.jp":true,"sakado.saitama.jp":true,"satte.saitama.jp":true,"sayama.saitama.jp":true,"shiki.saitama.jp":true,"shiraoka.saitama.jp":true,"soka.saitama.jp":true,"sugito.saitama.jp":true,"toda.saitama.jp":true,"tokigawa.saitama.jp":true,"tokorozawa.saitama.jp":true,"tsurugashima.saitama.jp":true,"urawa.saitama.jp":true,"warabi.saitama.jp":true,"yashio.saitama.jp":true,"yokoze.saitama.jp":true,"yono.saitama.jp":true,"yorii.saitama.jp":true,"yoshida.saitama.jp":true,"yoshikawa.saitama.jp":true,"yoshimi.saitama.jp":true,"aisho.shiga.jp":true,"gamo.shiga.jp":true,"higashiomi.shiga.jp":true,"hikone.shiga.jp":true,"koka.shiga.jp":true,"konan.shiga.jp":true,"kosei.shiga.jp":true,"koto.shiga.jp":true,"kusatsu.shiga.jp":true,"maibara.shiga.jp":true,"moriyama.shiga.jp":true,"nagahama.shiga.jp":true,"nishiazai.shiga.jp":true,"notogawa.shiga.jp":true,"omihachiman.shiga.jp":true,"otsu.shiga.jp":true,"ritto.shiga.jp":true,"ryuoh.shiga.jp":true,"takashima.shiga.jp":true,"takatsuki.shiga.jp":true,"torahime.shiga.jp":true,"toyosato.shiga.jp":true,"yasu.shiga.jp":true,"akagi.shimane.jp":true,"ama.shimane.jp":true,"gotsu.shimane.jp":true,"hamada.shimane.jp":true,"higashiizumo.shimane.jp":true,"hikawa.shimane.jp":true,"hikimi.shimane.jp":true,"izumo.shimane.jp":true,"kakinoki.shimane.jp":true,"masuda.shimane.jp":true,"matsue.shimane.jp":true,"misato.shimane.jp":true,"nishinoshima.shimane.jp":true,"ohda.shimane.jp":true,"okinoshima.shimane.jp":true,"okuizumo.shimane.jp":true,"shimane.shimane.jp":true,"tamayu.shimane.jp":true,"tsuwano.shimane.jp":true,"unnan.shimane.jp":true,"yakumo.shimane.jp":true,"yasugi.shimane.jp":true,"yatsuka.shimane.jp":true,"arai.shizuoka.jp":true,"atami.shizuoka.jp":true,"fuji.shizuoka.jp":true,"fujieda.shizuoka.jp":true,"fujikawa.shizuoka.jp":true,"fujinomiya.shizuoka.jp":true,"fukuroi.shizuoka.jp":true,"gotemba.shizuoka.jp":true,"haibara.shizuoka.jp":true,"hamamatsu.shizuoka.jp":true,"higashiizu.shizuoka.jp":true,"ito.shizuoka.jp":true,"iwata.shizuoka.jp":true,"izu.shizuoka.jp":true,"izunokuni.shizuoka.jp":true,"kakegawa.shizuoka.jp":true,"kannami.shizuoka.jp":true,"kawanehon.shizuoka.jp":true,"kawazu.shizuoka.jp":true,"kikugawa.shizuoka.jp":true,"kosai.shizuoka.jp":true,"makinohara.shizuoka.jp":true,"matsuzaki.shizuoka.jp":true,"minamiizu.shizuoka.jp":true,"mishima.shizuoka.jp":true,"morimachi.shizuoka.jp":true,"nishiizu.shizuoka.jp":true,"numazu.shizuoka.jp":true,"omaezaki.shizuoka.jp":true,"shimada.shizuoka.jp":true,"shimizu.shizuoka.jp":true,"shimoda.shizuoka.jp":true,"shizuoka.shizuoka.jp":true,"susono.shizuoka.jp":true,"yaizu.shizuoka.jp":true,"yoshida.shizuoka.jp":true,"ashikaga.tochigi.jp":true,"bato.tochigi.jp":true,"haga.tochigi.jp":true,"ichikai.tochigi.jp":true,"iwafune.tochigi.jp":true,"kaminokawa.tochigi.jp":true,"kanuma.tochigi.jp":true,"karasuyama.tochigi.jp":true,"kuroiso.tochigi.jp":true,"mashiko.tochigi.jp":true,"mibu.tochigi.jp":true,"moka.tochigi.jp":true,"motegi.tochigi.jp":true,"nasu.tochigi.jp":true,"nasushiobara.tochigi.jp":true,"nikko.tochigi.jp":true,"nishikata.tochigi.jp":true,"nogi.tochigi.jp":true,"ohira.tochigi.jp":true,"ohtawara.tochigi.jp":true,"oyama.tochigi.jp":true,"sakura.tochigi.jp":true,"sano.tochigi.jp":true,"shimotsuke.tochigi.jp":true,"shioya.tochigi.jp":true,"takanezawa.tochigi.jp":true,"tochigi.tochigi.jp":true,"tsuga.tochigi.jp":true,"ujiie.tochigi.jp":true,"utsunomiya.tochigi.jp":true,"yaita.tochigi.jp":true,"aizumi.tokushima.jp":true,"anan.tokushima.jp":true,"ichiba.tokushima.jp":true,"itano.tokushima.jp":true,"kainan.tokushima.jp":true,"komatsushima.tokushima.jp":true,"matsushige.tokushima.jp":true,"mima.tokushima.jp":true,"minami.tokushima.jp":true,"miyoshi.tokushima.jp":true,"mugi.tokushima.jp":true,"nakagawa.tokushima.jp":true,"naruto.tokushima.jp":true,"sanagochi.tokushima.jp":true,"shishikui.tokushima.jp":true,"tokushima.tokushima.jp":true,"wajiki.tokushima.jp":true,"adachi.tokyo.jp":true,"akiruno.tokyo.jp":true,"akishima.tokyo.jp":true,"aogashima.tokyo.jp":true,"arakawa.tokyo.jp":true,"bunkyo.tokyo.jp":true,"chiyoda.tokyo.jp":true,"chofu.tokyo.jp":true,"chuo.tokyo.jp":true,"edogawa.tokyo.jp":true,"fuchu.tokyo.jp":true,"fussa.tokyo.jp":true,"hachijo.tokyo.jp":true,"hachioji.tokyo.jp":true,"hamura.tokyo.jp":true,"higashikurume.tokyo.jp":true,"higashimurayama.tokyo.jp":true,"higashiyamato.tokyo.jp":true,"hino.tokyo.jp":true,"hinode.tokyo.jp":true,"hinohara.tokyo.jp":true,"inagi.tokyo.jp":true,"itabashi.tokyo.jp":true,"katsushika.tokyo.jp":true,"kita.tokyo.jp":true,"kiyose.tokyo.jp":true,"kodaira.tokyo.jp":true,"koganei.tokyo.jp":true,"kokubunji.tokyo.jp":true,"komae.tokyo.jp":true,"koto.tokyo.jp":true,"kouzushima.tokyo.jp":true,"kunitachi.tokyo.jp":true,"machida.tokyo.jp":true,"meguro.tokyo.jp":true,"minato.tokyo.jp":true,"mitaka.tokyo.jp":true,"mizuho.tokyo.jp":true,"musashimurayama.tokyo.jp":true,"musashino.tokyo.jp":true,"nakano.tokyo.jp":true,"nerima.tokyo.jp":true,"ogasawara.tokyo.jp":true,"okutama.tokyo.jp":true,"ome.tokyo.jp":true,"oshima.tokyo.jp":true,"ota.tokyo.jp":true,"setagaya.tokyo.jp":true,"shibuya.tokyo.jp":true,"shinagawa.tokyo.jp":true,"shinjuku.tokyo.jp":true,"suginami.tokyo.jp":true,"sumida.tokyo.jp":true,"tachikawa.tokyo.jp":true,"taito.tokyo.jp":true,"tama.tokyo.jp":true,"toshima.tokyo.jp":true,"chizu.tottori.jp":true,"hino.tottori.jp":true,"kawahara.tottori.jp":true,"koge.tottori.jp":true,"kotoura.tottori.jp":true,"misasa.tottori.jp":true,"nanbu.tottori.jp":true,"nichinan.tottori.jp":true,"sakaiminato.tottori.jp":true,"tottori.tottori.jp":true,"wakasa.tottori.jp":true,"yazu.tottori.jp":true,"yonago.tottori.jp":true,"asahi.toyama.jp":true,"fuchu.toyama.jp":true,"fukumitsu.toyama.jp":true,"funahashi.toyama.jp":true,"himi.toyama.jp":true,"imizu.toyama.jp":true,"inami.toyama.jp":true,"johana.toyama.jp":true,"kamiichi.toyama.jp":true,"kurobe.toyama.jp":true,"nakaniikawa.toyama.jp":true,"namerikawa.toyama.jp":true,"nanto.toyama.jp":true,"nyuzen.toyama.jp":true,"oyabe.toyama.jp":true,"taira.toyama.jp":true,"takaoka.toyama.jp":true,"tateyama.toyama.jp":true,"toga.toyama.jp":true,"tonami.toyama.jp":true,"toyama.toyama.jp":true,"unazuki.toyama.jp":true,"uozu.toyama.jp":true,"yamada.toyama.jp":true,"arida.wakayama.jp":true,"aridagawa.wakayama.jp":true,"gobo.wakayama.jp":true,"hashimoto.wakayama.jp":true,"hidaka.wakayama.jp":true,"hirogawa.wakayama.jp":true,"inami.wakayama.jp":true,"iwade.wakayama.jp":true,"kainan.wakayama.jp":true,"kamitonda.wakayama.jp":true,"katsuragi.wakayama.jp":true,"kimino.wakayama.jp":true,"kinokawa.wakayama.jp":true,"kitayama.wakayama.jp":true,"koya.wakayama.jp":true,"koza.wakayama.jp":true,"kozagawa.wakayama.jp":true,"kudoyama.wakayama.jp":true,"kushimoto.wakayama.jp":true,"mihama.wakayama.jp":true,"misato.wakayama.jp":true,"nachikatsuura.wakayama.jp":true,"shingu.wakayama.jp":true,"shirahama.wakayama.jp":true,"taiji.wakayama.jp":true,"tanabe.wakayama.jp":true,"wakayama.wakayama.jp":true,"yuasa.wakayama.jp":true,"yura.wakayama.jp":true,"asahi.yamagata.jp":true,"funagata.yamagata.jp":true,"higashine.yamagata.jp":true,"iide.yamagata.jp":true,"kahoku.yamagata.jp":true,"kaminoyama.yamagata.jp":true,"kaneyama.yamagata.jp":true,"kawanishi.yamagata.jp":true,"mamurogawa.yamagata.jp":true,"mikawa.yamagata.jp":true,"murayama.yamagata.jp":true,"nagai.yamagata.jp":true,"nakayama.yamagata.jp":true,"nanyo.yamagata.jp":true,"nishikawa.yamagata.jp":true,"obanazawa.yamagata.jp":true,"oe.yamagata.jp":true,"oguni.yamagata.jp":true,"ohkura.yamagata.jp":true,"oishida.yamagata.jp":true,"sagae.yamagata.jp":true,"sakata.yamagata.jp":true,"sakegawa.yamagata.jp":true,"shinjo.yamagata.jp":true,"shirataka.yamagata.jp":true,"shonai.yamagata.jp":true,"takahata.yamagata.jp":true,"tendo.yamagata.jp":true,"tozawa.yamagata.jp":true,"tsuruoka.yamagata.jp":true,"yamagata.yamagata.jp":true,"yamanobe.yamagata.jp":true,"yonezawa.yamagata.jp":true,"yuza.yamagata.jp":true,"abu.yamaguchi.jp":true,"hagi.yamaguchi.jp":true,"hikari.yamaguchi.jp":true,"hofu.yamaguchi.jp":true,"iwakuni.yamaguchi.jp":true,"kudamatsu.yamaguchi.jp":true,"mitou.yamaguchi.jp":true,"nagato.yamaguchi.jp":true,"oshima.yamaguchi.jp":true,"shimonoseki.yamaguchi.jp":true,"shunan.yamaguchi.jp":true,"tabuse.yamaguchi.jp":true,"tokuyama.yamaguchi.jp":true,"toyota.yamaguchi.jp":true,"ube.yamaguchi.jp":true,"yuu.yamaguchi.jp":true,"chuo.yamanashi.jp":true,"doshi.yamanashi.jp":true,"fuefuki.yamanashi.jp":true,"fujikawa.yamanashi.jp":true,"fujikawaguchiko.yamanashi.jp":true,"fujiyoshida.yamanashi.jp":true,"hayakawa.yamanashi.jp":true,"hokuto.yamanashi.jp":true,"ichikawamisato.yamanashi.jp":true,"kai.yamanashi.jp":true,"kofu.yamanashi.jp":true,"koshu.yamanashi.jp":true,"kosuge.yamanashi.jp":true,"minami-alps.yamanashi.jp":true,"minobu.yamanashi.jp":true,"nakamichi.yamanashi.jp":true,"nanbu.yamanashi.jp":true,"narusawa.yamanashi.jp":true,"nirasaki.yamanashi.jp":true,"nishikatsura.yamanashi.jp":true,"oshino.yamanashi.jp":true,"otsuki.yamanashi.jp":true,"showa.yamanashi.jp":true,"tabayama.yamanashi.jp":true,"tsuru.yamanashi.jp":true,"uenohara.yamanashi.jp":true,"yamanakako.yamanashi.jp":true,"yamanashi.yamanashi.jp":true,"ke":true,"ac.ke":true,"co.ke":true,"go.ke":true,"info.ke":true,"me.ke":true,"mobi.ke":true,"ne.ke":true,"or.ke":true,"sc.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"kp":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":true,"lb":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"ac.lk":true,"lr":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"co.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"com.ms":true,"edu.ms":true,"gov.ms":true,"net.ms":true,"org.ms":true,"mt":true,"com.mt":true,"edu.mt":true,"net.mt":true,"org.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":true,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimore.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"carrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum":true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelvinck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"iraq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"mad.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":true,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprings.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabarbara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museum.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"mz":true,"ac.mz":true,"adv.mz":true,"co.mz":true,"edu.mz":true,"gov.mz":true,"mil.mz":true,"net.mz":true,"org.mz":true,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"nom.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ng":true,"com.ng":true,"edu.ng":true,"gov.ng":true,"i.ng":true,"mil.ng":true,"mobi.ng":true,"name.ng":true,"net.ng":true,"org.ng":true,"sch.ng":true,"ni":true,"ac.ni":true,"biz.ni":true,"co.ni":true,"com.ni":true,"edu.ni":true,"gob.ni":true,"in.ni":true,"info.ni":true,"int.ni":true,"mil.ni":true,"net.ni":true,"nom.ni":true,"org.ni":true,"web.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bievt-0qa.no":true,"bomlo.no":true,"xn--bmlo-gra.no":true,"batsfjord.no":true,"xn--btsfjord-9za.no":true,"bahcavuotna.no":true,"xn--bhcavuotna-s4a.no":true,"dovre.no":true,"drammen.no":true,"drangedal.no":true,"dyroy.no":true,"xn--dyry-ira.no":true,"donna.no":true,"xn--dnna-gra.no":true,"eid.no":true,"eidfjord.no":true,"eidsberg.no":true,"eidskog.no":true,"eidsvoll.no":true,"eigersund.no":true,"elverum.no":true,"enebakk.no":true,"engerdal.no":true,"etne.no":true,"etnedal.no":true,"evenes.no":true,"evenassi.no":true,"xn--eveni-0qa01ga.no":true,"evje-og-hornnes.no":true,"farsund.no":true,"fauske.no":true,"fuossko.no":true,"fuoisku.no":true,"fedje.no":true,"fet.no":true,"finnoy.no":true,"xn--finny-yua.no":true,"fitjar.no":true,"fjaler.no":true,"fjell.no":true,"flakstad.no":true,"flatanger.no":true,"flekkefjord.no":true,"flesberg.no":true,"flora.no":true,"fla.no":true,"xn--fl-zia.no":true,"folldal.no":true,"forsand.no":true,"fosnes.no":true,"frei.no":true,"frogn.no":true,"froland.no":true,"frosta.no":true,"frana.no":true,"xn--frna-woa.no":true,"froya.no":true,"xn--frya-hra.no":true,"fusa.no":true,"fyresdal.no":true,"forde.no":true,"xn--frde-gra.no":true,"gamvik.no":true,"gangaviika.no":true,"xn--ggaviika-8ya47h.no":true,"gaular.no":true,"gausdal.no":true,"gildeskal.no":true,"xn--gildeskl-g0a.no":true,"giske.no":true,"gjemnes.no":true,"gjerdrum.no":true,"gjerstad.no":true,"gjesdal.no":true,"gjovik.no":true,"xn--gjvik-wua.no":true,"gloppen.no":true,"gol.no":true,"gran.no":true,"grane.no":true,"granvin.no":true,"gratangen.no":true,"grimstad.no":true,"grong.no":true,"kraanghke.no":true,"xn--kranghke-b0a.no":true,"grue.no":true,"gulen.no":true,"hadsel.no":true,"halden.no":true,"halsa.no":true,"hamar.no":true,"hamaroy.no":true,"habmer.no":true,"xn--hbmer-xqa.no":true,"hapmir.no":true,"xn--hpmir-xqa.no":true,"hammerfest.no":true,"hammarfeasta.no":true,"xn--hmmrfeasta-s4ac.no":true,"haram.no":true,"hareid.no":true,"harstad.no":true,"hasvik.no":true,"aknoluokta.no":true,"xn--koluokta-7ya57h.no":true,"hattfjelldal.no":true,"aarborte.no":true,"haugesund.no":true,"hemne.no":true,"hemnes.no":true,"hemsedal.no":true,"heroy.more-og-romsdal.no":true,"xn--hery-ira.xn--mre-og-romsdal-qqb.no":true,"heroy.nordland.no":true,"xn--hery-ira.nordland.no":true,"hitra.no":true,"hjartdal.no":true,"hjelmeland.no":true,"hobol.no":true,"xn--hobl-ira.no":true,"hof.no":true,"hol.no":true,"hole.no":true,"holmestrand.no":true,"holtalen.no":true,"xn--holtlen-hxa.no":true,"hornindal.no":true,"horten.no":true,"hurdal.no":true,"hurum.no":true,"hvaler.no":true,"hyllestad.no":true,"hagebostad.no":true,"xn--hgebostad-g3a.no":true,"hoyanger.no":true,"xn--hyanger-q1a.no":true,"hoylandet.no":true,"xn--hylandet-54a.no":true,"ha.no":true,"xn--h-2fa.no":true,"ibestad.no":true,"inderoy.no":true,"xn--indery-fya.no":true,"iveland.no":true,"jevnaker.no":true,"jondal.no":true,"jolster.no":true,"xn--jlster-bya.no":true,"karasjok.no":true,"karasjohka.no":true,"xn--krjohka-hwab49j.no":true,"karlsoy.no":true,"galsa.no":true,"xn--gls-elac.no":true,"karmoy.no":true,"xn--karmy-yua.no":true,"kautokeino.no":true,"guovdageaidnu.no":true,"klepp.no":true,"klabu.no":true,"xn--klbu-woa.no":true,"kongsberg.no":true,"kongsvinger.no":true,"kragero.no":true,"xn--krager-gya.no":true,"kristiansand.no":true,"kristiansund.no":true,"krodsherad.no":true,"xn--krdsherad-m8a.no":true,"kvalsund.no":true,"rahkkeravju.no":true,"xn--rhkkervju-01af.no":true,"kvam.no":true,"kvinesdal.no":true,"kvinnherad.no":true,"kviteseid.no":true,"kvitsoy.no":true,"xn--kvitsy-fya.no":true,"kvafjord.no":true,"xn--kvfjord-nxa.no":true,"giehtavuoatna.no":true,"kvanangen.no":true,"xn--kvnangen-k0a.no":true,"navuotna.no":true,"xn--nvuotna-hwa.no":true,"kafjord.no":true,"xn--kfjord-iua.no":true,"gaivuotna.no":true,"xn--givuotna-8ya.no":true,"larvik.no":true,"lavangen.no":true,"lavagis.no":true,"loabat.no":true,"xn--loabt-0qa.no":true,"lebesby.no":true,"davvesiida.no":true,"leikanger.no":true,"leirfjord.no":true,"leka.no":true,"leksvik.no":true,"lenvik.no":true,"leangaviika.no":true,"xn--leagaviika-52b.no":true,"lesja.no":true,"levanger.no":true,"lier.no":true,"lierne.no":true,"lillehammer.no":true,"lillesand.no":true,"lindesnes.no":true,"lindas.no":true,"xn--linds-pra.no":true,"lom.no":true,"loppa.no":true,"lahppi.no":true,"xn--lhppi-xqa.no":true,"lund.no":true,"lunner.no":true,"luroy.no":true,"xn--lury-ira.no":true,"luster.no":true,"lyngdal.no":true,"lyngen.no":true,"ivgu.no":true,"lardal.no":true,"lerdal.no":true,"xn--lrdal-sra.no":true,"lodingen.no":true,"xn--ldingen-q1a.no":true,"lorenskog.no":true,"xn--lrenskog-54a.no":true,"loten.no":true,"xn--lten-gra.no":true,"malvik.no":true,"masoy.no":true,"xn--msy-ula0h.no":true,"muosat.no":true,"xn--muost-0qa.no":true,"mandal.no":true,"marker.no":true,"marnardal.no":true,"masfjorden.no":true,"meland.no":true,"meldal.no":true,"melhus.no":true,"meloy.no":true,"xn--mely-ira.no":true,"meraker.no":true,"xn--merker-kua.no":true,"moareke.no":true,"xn--moreke-jua.no":true,"midsund.no":true,"midtre-gauldal.no":true,"modalen.no":true,"modum.no":true,"molde.no":true,"moskenes.no":true,"moss.no":true,"mosvik.no":true,"malselv.no":true,"xn--mlselv-iua.no":true,"malatvuopmi.no":true,"xn--mlatvuopmi-s4a.no":true,"namdalseid.no":true,"aejrie.no":true,"namsos.no":true,"namsskogan.no":true,"naamesjevuemie.no":true,"xn--nmesjevuemie-tcba.no":true,"laakesvuemie.no":true,"nannestad.no":true,"narvik.no":true,"narviika.no":true,"naustdal.no":true,"nedre-eiker.no":true,"nes.akershus.no":true,"nes.buskerud.no":true,"nesna.no":true,"nesodden.no":true,"nesseby.no":true,"unjarga.no":true,"xn--unjrga-rta.no":true,"nesset.no":true,"nissedal.no":true,"nittedal.no":true,"nord-aurdal.no":true,"nord-fron.no":true,"nord-odal.no":true,"norddal.no":true,"nordkapp.no":true,"davvenjarga.no":true,"xn--davvenjrga-y4a.no":true,"nordre-land.no":true,"nordreisa.no":true,"raisa.no":true,"xn--risa-5na.no":true,"nore-og-uvdal.no":true,"notodden.no":true,"naroy.no":true,"xn--nry-yla5g.no":true,"notteroy.no":true,"xn--nttery-byae.no":true,"odda.no":true,"oksnes.no":true,"xn--ksnes-uua.no":true,"oppdal.no":true,"oppegard.no":true,"xn--oppegrd-ixa.no":true,"orkdal.no":true,"orland.no":true,"xn--rland-uua.no":true,"orskog.no":true,"xn--rskog-uua.no":true,"orsta.no":true,"xn--rsta-fra.no":true,"os.hedmark.no":true,"os.hordaland.no":true,"osen.no":true,"osteroy.no":true,"xn--ostery-fya.no":true,"ostre-toten.no":true,"xn--stre-toten-zcb.no":true,"overhalla.no":true,"ovre-eiker.no":true,"xn--vre-eiker-k8a.no":true,"oyer.no":true,"xn--yer-zna.no":true,"oygarden.no":true,"xn--ygarden-p1a.no":true,"oystre-slidre.no":true,"xn--ystre-slidre-ujb.no":true,"porsanger.no":true,"porsangu.no":true,"xn--porsgu-sta26f.no":true,"porsgrunn.no":true,"radoy.no":true,"xn--rady-ira.no":true,"rakkestad.no":true,"rana.no":true,"ruovat.no":true,"randaberg.no":true,"rauma.no":true,"rendalen.no":true,"rennebu.no":true,"rennesoy.no":true,"xn--rennesy-v1a.no":true,"rindal.no":true,"ringebu.no":true,"ringerike.no":true,"ringsaker.no":true,"rissa.no":true,"risor.no":true,"xn--risr-ira.no":true,"roan.no":true,"rollag.no":true,"rygge.no":true,"ralingen.no":true,"xn--rlingen-mxa.no":true,"rodoy.no":true,"xn--rdy-0nab.no":true,"romskog.no":true,"xn--rmskog-bya.no":true,"roros.no":true,"xn--rros-gra.no":true,"rost.no":true,"xn--rst-0na.no":true,"royken.no":true,"xn--ryken-vua.no":true,"royrvik.no":true,"xn--ryrvik-bya.no":true,"rade.no":true,"xn--rde-ula.no":true,"salangen.no":true,"siellak.no":true,"saltdal.no":true,"salat.no":true,"xn--slt-elab.no":true,"xn--slat-5na.no":true,"samnanger.no":true,"sande.more-og-romsdal.no":true,"sande.xn--mre-og-romsdal-qqb.no":true,"sande.vestfold.no":true,"sandefjord.no":true,"sandnes.no":true,"sandoy.no":true,"xn--sandy-yua.no":true,"sarpsborg.no":true,"sauda.no":true,"sauherad.no":true,"sel.no":true,"selbu.no":true,"selje.no":true,"seljord.no":true,"sigdal.no":true,"siljan.no":true,"sirdal.no":true,"skaun.no":true,"skedsmo.no":true,"ski.no":true,"skien.no":true,"skiptvet.no":true,"skjervoy.no":true,"xn--skjervy-v1a.no":true,"skierva.no":true,"xn--skierv-uta.no":true,"skjak.no":true,"xn--skjk-soa.no":true,"skodje.no":true,"skanland.no":true,"xn--sknland-fxa.no":true,"skanit.no":true,"xn--sknit-yqa.no":true,"smola.no":true,"xn--smla-hra.no":true,"snillfjord.no":true,"snasa.no":true,"xn--snsa-roa.no":true,"snoasa.no":true,"snaase.no":true,"xn--snase-nra.no":true,"sogndal.no":true,"sokndal.no":true,"sola.no":true,"solund.no":true,"songdalen.no":true,"sortland.no":true,"spydeberg.no":true,"stange.no":true,"stavanger.no":true,"steigen.no":true,"steinkjer.no":true,"stjordal.no":true,"xn--stjrdal-s1a.no":true,"stokke.no":true,"stor-elvdal.no":true,"stord.no":true,"stordal.no":true,"storfjord.no":true,"omasvuotna.no":true,"strand.no":true,"stranda.no":true,"stryn.no":true,"sula.no":true,"suldal.no":true,"sund.no":true,"sunndal.no":true,"surnadal.no":true,"sveio.no":true,"svelvik.no":true,"sykkylven.no":true,"sogne.no":true,"xn--sgne-gra.no":true,"somna.no":true,"xn--smna-gra.no":true,"sondre-land.no":true,"xn--sndre-land-0cb.no":true,"sor-aurdal.no":true,"xn--sr-aurdal-l8a.no":true,"sor-fron.no":true,"xn--sr-fron-q1a.no":true,"sor-odal.no":true,"xn--sr-odal-q1a.no":true,"sor-varanger.no":true,"xn--sr-varanger-ggb.no":true,"matta-varjjat.no":true,"xn--mtta-vrjjat-k7af.no":true,"sorfold.no":true,"xn--srfold-bya.no":true,"sorreisa.no":true,"xn--srreisa-q1a.no":true,"sorum.no":true,"xn--srum-gra.no":true,"tana.no":true,"deatnu.no":true,"time.no":true,"tingvoll.no":true,"tinn.no":true,"tjeldsund.no":true,"dielddanuorri.no":true,"tjome.no":true,"xn--tjme-hra.no":true,"tokke.no":true,"tolga.no":true,"torsken.no":true,"tranoy.no":true,"xn--trany-yua.no":true,"tromso.no":true,"xn--troms-zua.no":true,"tromsa.no":true,"romsa.no":true,"trondheim.no":true,"troandin.no":true,"trysil.no":true,"trana.no":true,"xn--trna-woa.no":true,"trogstad.no":true,"xn--trgstad-r1a.no":true,"tvedestrand.no":true,"tydal.no":true,"tynset.no":true,"tysfjord.no":true,"divtasvuodna.no":true,"divttasvuotna.no":true,"tysnes.no":true,"tysvar.no":true,"xn--tysvr-vra.no":true,"tonsberg.no":true,"xn--tnsberg-q1a.no":true,"ullensaker.no":true,"ullensvang.no":true,"ulvik.no":true,"utsira.no":true,"vadso.no":true,"xn--vads-jra.no":true,"cahcesuolo.no":true,"xn--hcesuolo-7ya35b.no":true,"vaksdal.no":true,"valle.no":true,"vang.no":true,"vanylven.no":true,"vardo.no":true,"xn--vard-jra.no":true,"varggat.no":true,"xn--vrggt-xqad.no":true,"vefsn.no":true,"vaapste.no":true,"vega.no":true,"vegarshei.no":true,"xn--vegrshei-c0a.no":true,"vennesla.no":true,"verdal.no":true,"verran.no":true,"vestby.no":true,"vestnes.no":true,"vestre-slidre.no":true,"vestre-toten.no":true,"vestvagoy.no":true,"xn--vestvgy-ixa6o.no":true,"vevelstad.no":true,"vik.no":true,"vikna.no":true,"vindafjord.no":true,"volda.no":true,"voss.no":true,"varoy.no":true,"xn--vry-yla5g.no":true,"vagan.no":true,"xn--vgan-qoa.no":true,"voagat.no":true,"vagsoy.no":true,"xn--vgsy-qoa0j.no":true,"vaga.no":true,"xn--vg-yiab.no":true,"valer.ostfold.no":true,"xn--vler-qoa.xn--stfold-9xa.no":true,"valer.hedmark.no":true,"xn--vler-qoa.hedmark.no":true,"*.np":true,"nr":true,"biz.nr":true,"info.nr":true,"gov.nr":true,"edu.nr":true,"org.nr":true,"net.nr":true,"com.nr":true,"nu":true,"nz":true,"ac.nz":true,"co.nz":true,"cri.nz":true,"geek.nz":true,"gen.nz":true,"govt.nz":true,"health.nz":true,"iwi.nz":true,"kiwi.nz":true,"maori.nz":true,"mil.nz":true,"xn--mori-qsa.nz":true,"net.nz":true,"org.nz":true,"parliament.nz":true,"school.nz":true,"om":true,"co.om":true,"com.om":true,"edu.om":true,"gov.om":true,"med.om":true,"museum.om":true,"net.om":true,"org.om":true,"pro.om":true,"onion":true,"org":true,"pa":true,"ac.pa":true,"gob.pa":true,"com.pa":true,"org.pa":true,"sld.pa":true,"edu.pa":true,"net.pa":true,"ing.pa":true,"abo.pa":true,"med.pa":true,"nom.pa":true,"pe":true,"edu.pe":true,"gob.pe":true,"nom.pe":true,"mil.pe":true,"org.pe":true,"com.pe":true,"net.pe":true,"pf":true,"com.pf":true,"org.pf":true,"edu.pf":true,"*.pg":true,"ph":true,"com.ph":true,"net.ph":true,"org.ph":true,"gov.ph":true,"edu.ph":true,"ngo.ph":true,"mil.ph":true,"i.ph":true,"pk":true,"com.pk":true,"net.pk":true,"edu.pk":true,"org.pk":true,"fam.pk":true,"biz.pk":true,"web.pk":true,"gov.pk":true,"gob.pk":true,"gok.pk":true,"gon.pk":true,"gop.pk":true,"gos.pk":true,"info.pk":true,"pl":true,"com.pl":true,"net.pl":true,"org.pl":true,"aid.pl":true,"agro.pl":true,"atm.pl":true,"auto.pl":true,"biz.pl":true,"edu.pl":true,"gmina.pl":true,"gsm.pl":true,"info.pl":true,"mail.pl":true,"miasta.pl":true,"media.pl":true,"mil.pl":true,"nieruchomosci.pl":true,"nom.pl":true,"pc.pl":true,"powiat.pl":true,"priv.pl":true,"realestate.pl":true,"rel.pl":true,"sex.pl":true,"shop.pl":true,"sklep.pl":true,"sos.pl":true,"szkola.pl":true,"targi.pl":true,"tm.pl":true,"tourism.pl":true,"travel.pl":true,"turystyka.pl":true,"gov.pl":true,"ap.gov.pl":true,"ic.gov.pl":true,"is.gov.pl":true,"us.gov.pl":true,"kmpsp.gov.pl":true,"kppsp.gov.pl":true,"kwpsp.gov.pl":true,"psp.gov.pl":true,"wskr.gov.pl":true,"kwp.gov.pl":true,"mw.gov.pl":true,"ug.gov.pl":true,"um.gov.pl":true,"umig.gov.pl":true,"ugim.gov.pl":true,"upow.gov.pl":true,"uw.gov.pl":true,"starostwo.gov.pl":true,"pa.gov.pl":true,"po.gov.pl":true,"psse.gov.pl":true,"pup.gov.pl":true,"rzgw.gov.pl":true,"sa.gov.pl":true,"so.gov.pl":true,"sr.gov.pl":true,"wsa.gov.pl":true,"sko.gov.pl":true,"uzs.gov.pl":true,"wiih.gov.pl":true,"winb.gov.pl":true,"pinb.gov.pl":true,"wios.gov.pl":true,"witd.gov.pl":true,"wzmiuw.gov.pl":true,"piw.gov.pl":true,"wiw.gov.pl":true,"griw.gov.pl":true,"wif.gov.pl":true,"oum.gov.pl":true,"sdn.gov.pl":true,"zp.gov.pl":true,"uppo.gov.pl":true,"mup.gov.pl":true,"wuoz.gov.pl":true,"konsulat.gov.pl":true,"oirm.gov.pl":true,"augustow.pl":true,"babia-gora.pl":true,"bedzin.pl":true,"beskidy.pl":true,"bialowieza.pl":true,"bialystok.pl":true,"bielawa.pl":true,"bieszczady.pl":true,"boleslawiec.pl":true,"bydgoszcz.pl":true,"bytom.pl":true,"cieszyn.pl":true,"czeladz.pl":true,"czest.pl":true,"dlugoleka.pl":true,"elblag.pl":true,"elk.pl":true,"glogow.pl":true,"gniezno.pl":true,"gorlice.pl":true,"grajewo.pl":true,"ilawa.pl":true,"jaworzno.pl":true,"jelenia-gora.pl":true,"jgora.pl":true,"kalisz.pl":true,"kazimierz-dolny.pl":true,"karpacz.pl":true,"kartuzy.pl":true,"kaszuby.pl":true,"katowice.pl":true,"kepno.pl":true,"ketrzyn.pl":true,"klodzko.pl":true,"kobierzyce.pl":true,"kolobrzeg.pl":true,"konin.pl":true,"konskowola.pl":true,"kutno.pl":true,"lapy.pl":true,"lebork.pl":true,"legnica.pl":true,"lezajsk.pl":true,"limanowa.pl":true,"lomza.pl":true,"lowicz.pl":true,"lubin.pl":true,"lukow.pl":true,"malbork.pl":true,"malopolska.pl":true,"mazowsze.pl":true,"mazury.pl":true,"mielec.pl":true,"mielno.pl":true,"mragowo.pl":true,"naklo.pl":true,"nowaruda.pl":true,"nysa.pl":true,"olawa.pl":true,"olecko.pl":true,"olkusz.pl":true,"olsztyn.pl":true,"opoczno.pl":true,"opole.pl":true,"ostroda.pl":true,"ostroleka.pl":true,"ostrowiec.pl":true,"ostrowwlkp.pl":true,"pila.pl":true,"pisz.pl":true,"podhale.pl":true,"podlasie.pl":true,"polkowice.pl":true,"pomorze.pl":true,"pomorskie.pl":true,"prochowice.pl":true,"pruszkow.pl":true,"przeworsk.pl":true,"pulawy.pl":true,"radom.pl":true,"rawa-maz.pl":true,"rybnik.pl":true,"rzeszow.pl":true,"sanok.pl":true,"sejny.pl":true,"slask.pl":true,"slupsk.pl":true,"sosnowiec.pl":true,"stalowa-wola.pl":true,"skoczow.pl":true,"starachowice.pl":true,"stargard.pl":true,"suwalki.pl":true,"swidnica.pl":true,"swiebodzin.pl":true,"swinoujscie.pl":true,"szczecin.pl":true,"szczytno.pl":true,"tarnobrzeg.pl":true,"tgory.pl":true,"turek.pl":true,"tychy.pl":true,"ustka.pl":true,"walbrzych.pl":true,"warmia.pl":true,"warszawa.pl":true,"waw.pl":true,"wegrow.pl":true,"wielun.pl":true,"wlocl.pl":true,"wloclawek.pl":true,"wodzislaw.pl":true,"wolomin.pl":true,"wroclaw.pl":true,"zachpomor.pl":true,"zagan.pl":true,"zarow.pl":true,"zgora.pl":true,"zgorzelec.pl":true,"pm":true,"pn":true,"gov.pn":true,"co.pn":true,"org.pn":true,"edu.pn":true,"net.pn":true,"post":true,"pr":true,"com.pr":true,"net.pr":true,"org.pr":true,"gov.pr":true,"edu.pr":true,"isla.pr":true,"pro.pr":true,"biz.pr":true,"info.pr":true,"name.pr":true,"est.pr":true,"prof.pr":true,"ac.pr":true,"pro":true,"aaa.pro":true,"aca.pro":true,"acct.pro":true,"avocat.pro":true,"bar.pro":true,"cpa.pro":true,"eng.pro":true,"jur.pro":true,"law.pro":true,"med.pro":true,"recht.pro":true,"ps":true,"edu.ps":true,"gov.ps":true,"sec.ps":true,"plo.ps":true,"com.ps":true,"org.ps":true,"net.ps":true,"pt":true,"net.pt":true,"gov.pt":true,"org.pt":true,"edu.pt":true,"int.pt":true,"publ.pt":true,"com.pt":true,"nome.pt":true,"pw":true,"co.pw":true,"ne.pw":true,"or.pw":true,"ed.pw":true,"go.pw":true,"belau.pw":true,"py":true,"com.py":true,"coop.py":true,"edu.py":true,"gov.py":true,"mil.py":true,"net.py":true,"org.py":true,"qa":true,"com.qa":true,"edu.qa":true,"gov.qa":true,"mil.qa":true,"name.qa":true,"net.qa":true,"org.qa":true,"sch.qa":true,"re":true,"asso.re":true,"com.re":true,"nom.re":true,"ro":true,"arts.ro":true,"com.ro":true,"firm.ro":true,"info.ro":true,"nom.ro":true,"nt.ro":true,"org.ro":true,"rec.ro":true,"store.ro":true,"tm.ro":true,"www.ro":true,"rs":true,"ac.rs":true,"co.rs":true,"edu.rs":true,"gov.rs":true,"in.rs":true,"org.rs":true,"ru":true,"ac.ru":true,"edu.ru":true,"gov.ru":true,"int.ru":true,"mil.ru":true,"test.ru":true,"rw":true,"gov.rw":true,"net.rw":true,"edu.rw":true,"ac.rw":true,"com.rw":true,"co.rw":true,"int.rw":true,"mil.rw":true,"gouv.rw":true,"sa":true,"com.sa":true,"net.sa":true,"org.sa":true,"gov.sa":true,"med.sa":true,"pub.sa":true,"edu.sa":true,"sch.sa":true,"sb":true,"com.sb":true,"edu.sb":true,"gov.sb":true,"net.sb":true,"org.sb":true,"sc":true,"com.sc":true,"gov.sc":true,"net.sc":true,"org.sc":true,"edu.sc":true,"sd":true,"com.sd":true,"net.sd":true,"org.sd":true,"edu.sd":true,"med.sd":true,"tv.sd":true,"gov.sd":true,"info.sd":true,"se":true,"a.se":true,"ac.se":true,"b.se":true,"bd.se":true,"brand.se":true,"c.se":true,"d.se":true,"e.se":true,"f.se":true,"fh.se":true,"fhsk.se":true,"fhv.se":true,"g.se":true,"h.se":true,"i.se":true,"k.se":true,"komforb.se":true,"kommunalforbund.se":true,"komvux.se":true,"l.se":true,"lanbib.se":true,"m.se":true,"n.se":true,"naturbruksgymn.se":true,"o.se":true,"org.se":true,"p.se":true,"parti.se":true,"pp.se":true,"press.se":true,"r.se":true,"s.se":true,"t.se":true,"tm.se":true,"u.se":true,"w.se":true,"x.se":true,"y.se":true,"z.se":true,"sg":true,"com.sg":true,"net.sg":true,"org.sg":true,"gov.sg":true,"edu.sg":true,"per.sg":true,"sh":true,"com.sh":true,"net.sh":true,"gov.sh":true,"org.sh":true,"mil.sh":true,"si":true,"sj":true,"sk":true,"sl":true,"com.sl":true,"net.sl":true,"edu.sl":true,"gov.sl":true,"org.sl":true,"sm":true,"sn":true,"art.sn":true,"com.sn":true,"edu.sn":true,"gouv.sn":true,"org.sn":true,"perso.sn":true,"univ.sn":true,"so":true,"com.so":true,"net.so":true,"org.so":true,"sr":true,"st":true,"co.st":true,"com.st":true,"consulado.st":true,"edu.st":true,"embaixada.st":true,"gov.st":true,"mil.st":true,"net.st":true,"org.st":true,"principe.st":true,"saotome.st":true,"store.st":true,"su":true,"sv":true,"com.sv":true,"edu.sv":true,"gob.sv":true,"org.sv":true,"red.sv":true,"sx":true,"gov.sx":true,"sy":true,"edu.sy":true,"gov.sy":true,"net.sy":true,"mil.sy":true,"com.sy":true,"org.sy":true,"sz":true,"co.sz":true,"ac.sz":true,"org.sz":true,"tc":true,"td":true,"tel":true,"tf":true,"tg":true,"th":true,"ac.th":true,"co.th":true,"go.th":true,"in.th":true,"mi.th":true,"net.th":true,"or.th":true,"tj":true,"ac.tj":true,"biz.tj":true,"co.tj":true,"com.tj":true,"edu.tj":true,"go.tj":true,"gov.tj":true,"int.tj":true,"mil.tj":true,"name.tj":true,"net.tj":true,"nic.tj":true,"org.tj":true,"test.tj":true,"web.tj":true,"tk":true,"tl":true,"gov.tl":true,"tm":true,"com.tm":true,"co.tm":true,"org.tm":true,"net.tm":true,"nom.tm":true,"gov.tm":true,"mil.tm":true,"edu.tm":true,"tn":true,"com.tn":true,"ens.tn":true,"fin.tn":true,"gov.tn":true,"ind.tn":true,"intl.tn":true,"nat.tn":true,"net.tn":true,"org.tn":true,"info.tn":true,"perso.tn":true,"tourism.tn":true,"edunet.tn":true,"rnrt.tn":true,"rns.tn":true,"rnu.tn":true,"mincom.tn":true,"agrinet.tn":true,"defense.tn":true,"turen.tn":true,"to":true,"com.to":true,"gov.to":true,"net.to":true,"org.to":true,"edu.to":true,"mil.to":true,"tr":true,"com.tr":true,"info.tr":true,"biz.tr":true,"net.tr":true,"org.tr":true,"web.tr":true,"gen.tr":true,"tv.tr":true,"av.tr":true,"dr.tr":true,"bbs.tr":true,"name.tr":true,"tel.tr":true,"gov.tr":true,"bel.tr":true,"pol.tr":true,"mil.tr":true,"k12.tr":true,"edu.tr":true,"kep.tr":true,"nc.tr":true,"gov.nc.tr":true,"travel":true,"tt":true,"co.tt":true,"com.tt":true,"org.tt":true,"net.tt":true,"biz.tt":true,"info.tt":true,"pro.tt":true,"int.tt":true,"coop.tt":true,"jobs.tt":true,"mobi.tt":true,"travel.tt":true,"museum.tt":true,"aero.tt":true,"name.tt":true,"gov.tt":true,"edu.tt":true,"tv":true,"tw":true,"edu.tw":true,"gov.tw":true,"mil.tw":true,"com.tw":true,"net.tw":true,"org.tw":true,"idv.tw":true,"game.tw":true,"ebiz.tw":true,"club.tw":true,"xn--zf0ao64a.tw":true,"xn--uc0atv.tw":true,"xn--czrw28b.tw":true,"tz":true,"ac.tz":true,"co.tz":true,"go.tz":true,"hotel.tz":true,"info.tz":true,"me.tz":true,"mil.tz":true,"mobi.tz":true,"ne.tz":true,"or.tz":true,"sc.tz":true,"tv.tz":true,"ua":true,"com.ua":true,"edu.ua":true,"gov.ua":true,"in.ua":true,"net.ua":true,"org.ua":true,"cherkassy.ua":true,"cherkasy.ua":true,"chernigov.ua":true,"chernihiv.ua":true,"chernivtsi.ua":true,"chernovtsy.ua":true,"ck.ua":true,"cn.ua":true,"cr.ua":true,"crimea.ua":true,"cv.ua":true,"dn.ua":true,"dnepropetrovsk.ua":true,"dnipropetrovsk.ua":true,"dominic.ua":true,"donetsk.ua":true,"dp.ua":true,"if.ua":true,"ivano-frankivsk.ua":true,"kh.ua":true,"kharkiv.ua":true,"kharkov.ua":true,"kherson.ua":true,"khmelnitskiy.ua":true,"khmelnytskyi.ua":true,"kiev.ua":true,"kirovograd.ua":true,"km.ua":true,"kr.ua":true,"krym.ua":true,"ks.ua":true,"kv.ua":true,"kyiv.ua":true,"lg.ua":true,"lt.ua":true,"lugansk.ua":true,"lutsk.ua":true,"lv.ua":true,"lviv.ua":true,"mk.ua":true,"mykolaiv.ua":true,"nikolaev.ua":true,"od.ua":true,"odesa.ua":true,"odessa.ua":true,"pl.ua":true,"poltava.ua":true,"rivne.ua":true,"rovno.ua":true,"rv.ua":true,"sb.ua":true,"sebastopol.ua":true,"sevastopol.ua":true,"sm.ua":true,"sumy.ua":true,"te.ua":true,"ternopil.ua":true,"uz.ua":true,"uzhgorod.ua":true,"vinnica.ua":true,"vinnytsia.ua":true,"vn.ua":true,"volyn.ua":true,"yalta.ua":true,"zaporizhzhe.ua":true,"zaporizhzhia.ua":true,"zhitomir.ua":true,"zhytomyr.ua":true,"zp.ua":true,"zt.ua":true,"ug":true,"co.ug":true,"or.ug":true,"ac.ug":true,"sc.ug":true,"go.ug":true,"ne.ug":true,"com.ug":true,"org.ug":true,"uk":true,"ac.uk":true,"co.uk":true,"gov.uk":true,"ltd.uk":true,"me.uk":true,"net.uk":true,"nhs.uk":true,"org.uk":true,"plc.uk":true,"police.uk":true,"*.sch.uk":true,"us":true,"dni.us":true,"fed.us":true,"isa.us":true,"kids.us":true,"nsn.us":true,"ak.us":true,"al.us":true,"ar.us":true,"as.us":true,"az.us":true,"ca.us":true,"co.us":true,"ct.us":true,"dc.us":true,"de.us":true,"fl.us":true,"ga.us":true,"gu.us":true,"hi.us":true,"ia.us":true,"id.us":true,"il.us":true,"in.us":true,"ks.us":true,"ky.us":true,"la.us":true,"ma.us":true,"md.us":true,"me.us":true,"mi.us":true,"mn.us":true,"mo.us":true,"ms.us":true,"mt.us":true,"nc.us":true,"nd.us":true,"ne.us":true,"nh.us":true,"nj.us":true,"nm.us":true,"nv.us":true,"ny.us":true,"oh.us":true,"ok.us":true,"or.us":true,"pa.us":true,"pr.us":true,"ri.us":true,"sc.us":true,"sd.us":true,"tn.us":true,"tx.us":true,"ut.us":true,"vi.us":true,"vt.us":true,"va.us":true,"wa.us":true,"wi.us":true,"wv.us":true,"wy.us":true,"k12.ak.us":true,"k12.al.us":true,"k12.ar.us":true,"k12.as.us":true,"k12.az.us":true,"k12.ca.us":true,"k12.co.us":true,"k12.ct.us":true,"k12.dc.us":true,"k12.de.us":true,"k12.fl.us":true,"k12.ga.us":true,"k12.gu.us":true,"k12.ia.us":true,"k12.id.us":true,"k12.il.us":true,"k12.in.us":true,"k12.ks.us":true,"k12.ky.us":true,"k12.la.us":true,"k12.ma.us":true,"k12.md.us":true,"k12.me.us":true,"k12.mi.us":true,"k12.mn.us":true,"k12.mo.us":true,"k12.ms.us":true,"k12.mt.us":true,"k12.nc.us":true,"k12.ne.us":true,"k12.nh.us":true,"k12.nj.us":true,"k12.nm.us":true,"k12.nv.us":true,"k12.ny.us":true,"k12.oh.us":true,"k12.ok.us":true,"k12.or.us":true,"k12.pa.us":true,"k12.pr.us":true,"k12.ri.us":true,"k12.sc.us":true,"k12.tn.us":true,"k12.tx.us":true,"k12.ut.us":true,"k12.vi.us":true,"k12.vt.us":true,"k12.va.us":true,"k12.wa.us":true,"k12.wi.us":true,"k12.wy.us":true,"cc.ak.us":true,"cc.al.us":true,"cc.ar.us":true,"cc.as.us":true,"cc.az.us":true,"cc.ca.us":true,"cc.co.us":true,"cc.ct.us":true,"cc.dc.us":true,"cc.de.us":true,"cc.fl.us":true,"cc.ga.us":true,"cc.gu.us":true,"cc.hi.us":true,"cc.ia.us":true,"cc.id.us":true,"cc.il.us":true,"cc.in.us":true,"cc.ks.us":true,"cc.ky.us":true,"cc.la.us":true,"cc.ma.us":true,"cc.md.us":true,"cc.me.us":true,"cc.mi.us":true,"cc.mn.us":true,"cc.mo.us":true,"cc.ms.us":true,"cc.mt.us":true,"cc.nc.us":true,"cc.nd.us":true,"cc.ne.us":true,"cc.nh.us":true,"cc.nj.us":true,"cc.nm.us":true,"cc.nv.us":true,"cc.ny.us":true,"cc.oh.us":true,"cc.ok.us":true,"cc.or.us":true,"cc.pa.us":true,"cc.pr.us":true,"cc.ri.us":true,"cc.sc.us":true,"cc.sd.us":true,"cc.tn.us":true,"cc.tx.us":true,"cc.ut.us":true,"cc.vi.us":true,"cc.vt.us":true,"cc.va.us":true,"cc.wa.us":true,"cc.wi.us":true,"cc.wv.us":true,"cc.wy.us":true,"lib.ak.us":true,"lib.al.us":true,"lib.ar.us":true,"lib.as.us":true,"lib.az.us":true,"lib.ca.us":true,"lib.co.us":true,"lib.ct.us":true,"lib.dc.us":true,"lib.fl.us":true,"lib.ga.us":true,"lib.gu.us":true,"lib.hi.us":true,"lib.ia.us":true,"lib.id.us":true,"lib.il.us":true,"lib.in.us":true,"lib.ks.us":true,"lib.ky.us":true,"lib.la.us":true,"lib.ma.us":true,"lib.md.us":true,"lib.me.us":true,"lib.mi.us":true,"lib.mn.us":true,"lib.mo.us":true,"lib.ms.us":true,"lib.mt.us":true,"lib.nc.us":true,"lib.nd.us":true,"lib.ne.us":true,"lib.nh.us":true,"lib.nj.us":true,"lib.nm.us":true,"lib.nv.us":true,"lib.ny.us":true,"lib.oh.us":true,"lib.ok.us":true,"lib.or.us":true,"lib.pa.us":true,"lib.pr.us":true,"lib.ri.us":true,"lib.sc.us":true,"lib.sd.us":true,"lib.tn.us":true,"lib.tx.us":true,"lib.ut.us":true,"lib.vi.us":true,"lib.vt.us":true,"lib.va.us":true,"lib.wa.us":true,"lib.wi.us":true,"lib.wy.us":true,"pvt.k12.ma.us":true,"chtr.k12.ma.us":true,"paroch.k12.ma.us":true,"ann-arbor.mi.us":true,"cog.mi.us":true,"dst.mi.us":true,"eaton.mi.us":true,"gen.mi.us":true,"mus.mi.us":true,"tec.mi.us":true,"washtenaw.mi.us":true,"uy":true,"com.uy":true,"edu.uy":true,"gub.uy":true,"mil.uy":true,"net.uy":true,"org.uy":true,"uz":true,"co.uz":true,"com.uz":true,"net.uz":true,"org.uz":true,"va":true,"vc":true,"com.vc":true,"net.vc":true,"org.vc":true,"gov.vc":true,"mil.vc":true,"edu.vc":true,"ve":true,"arts.ve":true,"co.ve":true,"com.ve":true,"e12.ve":true,"edu.ve":true,"firm.ve":true,"gob.ve":true,"gov.ve":true,"info.ve":true,"int.ve":true,"mil.ve":true,"net.ve":true,"org.ve":true,"rec.ve":true,"store.ve":true,"tec.ve":true,"web.ve":true,"vg":true,"vi":true,"co.vi":true,"com.vi":true,"k12.vi":true,"net.vi":true,"org.vi":true,"vn":true,"com.vn":true,"net.vn":true,"org.vn":true,"edu.vn":true,"gov.vn":true,"int.vn":true,"ac.vn":true,"biz.vn":true,"info.vn":true,"name.vn":true,"pro.vn":true,"health.vn":true,"vu":true,"com.vu":true,"edu.vu":true,"net.vu":true,"org.vu":true,"wf":true,"ws":true,"com.ws":true,"net.ws":true,"org.ws":true,"gov.ws":true,"edu.ws":true,"yt":true,"xn--mgbaam7a8h":true,"xn--y9a3aq":true,"xn--54b7fta0cc":true,"xn--90ae":true,"xn--90ais":true,"xn--fiqs8s":true,"xn--fiqz9s":true,"xn--lgbbat1ad8j":true,"xn--wgbh1c":true,"xn--e1a4c":true,"xn--node":true,"xn--qxam":true,"xn--j6w193g":true,"xn--2scrj9c":true,"xn--3hcrj9c":true,"xn--45br5cyl":true,"xn--h2breg3eve":true,"xn--h2brj9c8c":true,"xn--mgbgu82a":true,"xn--rvc1e0am3e":true,"xn--h2brj9c":true,"xn--mgbbh1a71e":true,"xn--fpcrj9c3d":true,"xn--gecrj9c":true,"xn--s9brj9c":true,"xn--45brj9c":true,"xn--xkc2dl3a5ee0h":true,"xn--mgba3a4f16a":true,"xn--mgba3a4fra":true,"xn--mgbtx2b":true,"xn--mgbayh7gpa":true,"xn--3e0b707e":true,"xn--80ao21a":true,"xn--fzc2c9e2c":true,"xn--xkc2al3hye2a":true,"xn--mgbc0a9azcg":true,"xn--d1alf":true,"xn--l1acc":true,"xn--mix891f":true,"xn--mix082f":true,"xn--mgbx4cd0ab":true,"xn--mgb9awbf":true,"xn--mgbai9azgqp6j":true,"xn--mgbai9a5eva00b":true,"xn--ygbi2ammx":true,"xn--90a3ac":true,"xn--o1ac.xn--90a3ac":true,"xn--c1avg.xn--90a3ac":true,"xn--90azh.xn--90a3ac":true,"xn--d1at.xn--90a3ac":true,"xn--o1ach.xn--90a3ac":true,"xn--80au.xn--90a3ac":true,"xn--p1ai":true,"xn--wgbl6a":true,"xn--mgberp4a5d4ar":true,"xn--mgberp4a5d4a87g":true,"xn--mgbqly7c0a67fbc":true,"xn--mgbqly7cvafr":true,"xn--mgbpl2fh":true,"xn--yfro4i67o":true,"xn--clchc0ea0b2g2a9gcd":true,"xn--ogbpf8fl":true,"xn--mgbtf8fl":true,"xn--o3cw4h":true,"xn--12c1fe0br.xn--o3cw4h":true,"xn--12co0c3b4eva.xn--o3cw4h":true,"xn--h3cuzk1di.xn--o3cw4h":true,"xn--o3cyx2a.xn--o3cw4h":true,"xn--m3ch0j3a.xn--o3cw4h":true,"xn--12cfi8ixb8l.xn--o3cw4h":true,"xn--pgbs0dh":true,"xn--kpry57d":true,"xn--kprw13d":true,"xn--nnx388a":true,"xn--j1amh":true,"xn--mgb2ddes":true,"xxx":true,"*.ye":true,"ac.za":true,"agric.za":true,"alt.za":true,"co.za":true,"edu.za":true,"gov.za":true,"grondar.za":true,"law.za":true,"mil.za":true,"net.za":true,"ngo.za":true,"nis.za":true,"nom.za":true,"org.za":true,"school.za":true,"tm.za":true,"web.za":true,"zm":true,"ac.zm":true,"biz.zm":true,"co.zm":true,"com.zm":true,"edu.zm":true,"gov.zm":true,"info.zm":true,"mil.zm":true,"net.zm":true,"org.zm":true,"sch.zm":true,"zw":true,"ac.zw":true,"co.zw":true,"gov.zw":true,"mil.zw":true,"org.zw":true,"aaa":true,"aarp":true,"abarth":true,"abb":true,"abbott":true,"abbvie":true,"abc":true,"able":true,"abogado":true,"abudhabi":true,"academy":true,"accenture":true,"accountant":true,"accountants":true,"aco":true,"active":true,"actor":true,"adac":true,"ads":true,"adult":true,"aeg":true,"aetna":true,"afamilycompany":true,"afl":true,"africa":true,"agakhan":true,"agency":true,"aig":true,"aigo":true,"airbus":true,"airforce":true,"airtel":true,"akdn":true,"alfaromeo":true,"alibaba":true,"alipay":true,"allfinanz":true,"allstate":true,"ally":true,"alsace":true,"alstom":true,"americanexpress":true,"americanfamily":true,"amex":true,"amfam":true,"amica":true,"amsterdam":true,"analytics":true,"android":true,"anquan":true,"anz":true,"aol":true,"apartments":true,"app":true,"apple":true,"aquarelle":true,"arab":true,"aramco":true,"archi":true,"army":true,"art":true,"arte":true,"asda":true,"associates":true,"athleta":true,"attorney":true,"auction":true,"audi":true,"audible":true,"audio":true,"auspost":true,"author":true,"auto":true,"autos":true,"avianca":true,"aws":true,"axa":true,"azure":true,"baby":true,"baidu":true,"banamex":true,"bananarepublic":true,"band":true,"bank":true,"bar":true,"barcelona":true,"barclaycard":true,"barclays":true,"barefoot":true,"bargains":true,"baseball":true,"basketball":true,"bauhaus":true,"bayern":true,"bbc":true,"bbt":true,"bbva":true,"bcg":true,"bcn":true,"beats":true,"beauty":true,"beer":true,"bentley":true,"berlin":true,"best":true,"bestbuy":true,"bet":true,"bharti":true,"bible":true,"bid":true,"bike":true,"bing":true,"bingo":true,"bio":true,"black":true,"blackfriday":true,"blanco":true,"blockbuster":true,"blog":true,"bloomberg":true,"blue":true,"bms":true,"bmw":true,"bnl":true,"bnpparibas":true,"boats":true,"boehringer":true,"bofa":true,"bom":true,"bond":true,"boo":true,"book":true,"booking":true,"boots":true,"bosch":true,"bostik":true,"boston":true,"bot":true,"boutique":true,"box":true,"bradesco":true,"bridgestone":true,"broadway":true,"broker":true,"brother":true,"brussels":true,"budapest":true,"bugatti":true,"build":true,"builders":true,"business":true,"buy":true,"buzz":true,"bzh":true,"cab":true,"cafe":true,"cal":true,"call":true,"calvinklein":true,"cam":true,"camera":true,"camp":true,"cancerresearch":true,"canon":true,"capetown":true,"capital":true,"capitalone":true,"car":true,"caravan":true,"cards":true,"care":true,"career":true,"careers":true,"cars":true,"cartier":true,"casa":true,"case":true,"caseih":true,"cash":true,"casino":true,"catering":true,"catholic":true,"cba":true,"cbn":true,"cbre":true,"cbs":true,"ceb":true,"center":true,"ceo":true,"cern":true,"cfa":true,"cfd":true,"chanel":true,"channel":true,"chase":true,"chat":true,"cheap":true,"chintai":true,"christmas":true,"chrome":true,"chrysler":true,"church":true,"cipriani":true,"circle":true,"cisco":true,"citadel":true,"citi":true,"citic":true,"city":true,"cityeats":true,"claims":true,"cleaning":true,"click":true,"clinic":true,"clinique":true,"clothing":true,"cloud":true,"club":true,"clubmed":true,"coach":true,"codes":true,"coffee":true,"college":true,"cologne":true,"comcast":true,"commbank":true,"community":true,"company":true,"compare":true,"computer":true,"comsec":true,"condos":true,"construction":true,"consulting":true,"contact":true,"contractors":true,"cooking":true,"cookingchannel":true,"cool":true,"corsica":true,"country":true,"coupon":true,"coupons":true,"courses":true,"credit":true,"creditcard":true,"creditunion":true,"cricket":true,"crown":true,"crs":true,"cruise":true,"cruises":true,"csc":true,"cuisinella":true,"cymru":true,"cyou":true,"dabur":true,"dad":true,"dance":true,"data":true,"date":true,"dating":true,"datsun":true,"day":true,"dclk":true,"dds":true,"deal":true,"dealer":true,"deals":true,"degree":true,"delivery":true,"dell":true,"deloitte":true,"delta":true,"democrat":true,"dental":true,"dentist":true,"desi":true,"design":true,"dev":true,"dhl":true,"diamonds":true,"diet":true,"digital":true,"direct":true,"directory":true,"discount":true,"discover":true,"dish":true,"diy":true,"dnp":true,"docs":true,"doctor":true,"dodge":true,"dog":true,"doha":true,"domains":true,"dot":true,"download":true,"drive":true,"dtv":true,"dubai":true,"duck":true,"dunlop":true,"duns":true,"dupont":true,"durban":true,"dvag":true,"dvr":true,"earth":true,"eat":true,"eco":true,"edeka":true,"education":true,"email":true,"emerck":true,"energy":true,"engineer":true,"engineering":true,"enterprises":true,"epost":true,"epson":true,"equipment":true,"ericsson":true,"erni":true,"esq":true,"estate":true,"esurance":true,"etisalat":true,"eurovision":true,"eus":true,"events":true,"everbank":true,"exchange":true,"expert":true,"exposed":true,"express":true,"extraspace":true,"fage":true,"fail":true,"fairwinds":true,"faith":true,"family":true,"fan":true,"fans":true,"farm":true,"farmers":true,"fashion":true,"fast":true,"fedex":true,"feedback":true,"ferrari":true,"ferrero":true,"fiat":true,"fidelity":true,"fido":true,"film":true,"final":true,"finance":true,"financial":true,"fire":true,"firestone":true,"firmdale":true,"fish":true,"fishing":true,"fit":true,"fitness":true,"flickr":true,"flights":true,"flir":true,"florist":true,"flowers":true,"fly":true,"foo":true,"food":true,"foodnetwork":true,"football":true,"ford":true,"forex":true,"forsale":true,"forum":true,"foundation":true,"fox":true,"free":true,"fresenius":true,"frl":true,"frogans":true,"frontdoor":true,"frontier":true,"ftr":true,"fujitsu":true,"fujixerox":true,"fun":true,"fund":true,"furniture":true,"futbol":true,"fyi":true,"gal":true,"gallery":true,"gallo":true,"gallup":true,"game":true,"games":true,"gap":true,"garden":true,"gbiz":true,"gdn":true,"gea":true,"gent":true,"genting":true,"george":true,"ggee":true,"gift":true,"gifts":true,"gives":true,"giving":true,"glade":true,"glass":true,"gle":true,"global":true,"globo":true,"gmail":true,"gmbh":true,"gmo":true,"gmx":true,"godaddy":true,"gold":true,"goldpoint":true,"golf":true,"goo":true,"goodhands":true,"goodyear":true,"goog":true,"google":true,"gop":true,"got":true,"grainger":true,"graphics":true,"gratis":true,"green":true,"gripe":true,"grocery":true,"group":true,"guardian":true,"gucci":true,"guge":true,"guide":true,"guitars":true,"guru":true,"hair":true,"hamburg":true,"hangout":true,"haus":true,"hbo":true,"hdfc":true,"hdfcbank":true,"health":true,"healthcare":true,"help":true,"helsinki":true,"here":true,"hermes":true,"hgtv":true,"hiphop":true,"hisamitsu":true,"hitachi":true,"hiv":true,"hkt":true,"hockey":true,"holdings":true,"holiday":true,"homedepot":true,"homegoods":true,"homes":true,"homesense":true,"honda":true,"honeywell":true,"horse":true,"hospital":true,"host":true,"hosting":true,"hot":true,"hoteles":true,"hotels":true,"hotmail":true,"house":true,"how":true,"hsbc":true,"hughes":true,"hyatt":true,"hyundai":true,"ibm":true,"icbc":true,"ice":true,"icu":true,"ieee":true,"ifm":true,"ikano":true,"imamat":true,"imdb":true,"immo":true,"immobilien":true,"industries":true,"infiniti":true,"ing":true,"ink":true,"institute":true,"insurance":true,"insure":true,"intel":true,"international":true,"intuit":true,"investments":true,"ipiranga":true,"irish":true,"iselect":true,"ismaili":true,"ist":true,"istanbul":true,"itau":true,"itv":true,"iveco":true,"iwc":true,"jaguar":true,"java":true,"jcb":true,"jcp":true,"jeep":true,"jetzt":true,"jewelry":true,"jio":true,"jlc":true,"jll":true,"jmp":true,"jnj":true,"joburg":true,"jot":true,"joy":true,"jpmorgan":true,"jprs":true,"juegos":true,"juniper":true,"kaufen":true,"kddi":true,"kerryhotels":true,"kerrylogistics":true,"kerryproperties":true,"kfh":true,"kia":true,"kim":true,"kinder":true,"kindle":true,"kitchen":true,"kiwi":true,"koeln":true,"komatsu":true,"kosher":true,"kpmg":true,"kpn":true,"krd":true,"kred":true,"kuokgroup":true,"kyoto":true,"lacaixa":true,"ladbrokes":true,"lamborghini":true,"lamer":true,"lancaster":true,"lancia":true,"lancome":true,"land":true,"landrover":true,"lanxess":true,"lasalle":true,"lat":true,"latino":true,"latrobe":true,"law":true,"lawyer":true,"lds":true,"lease":true,"leclerc":true,"lefrak":true,"legal":true,"lego":true,"lexus":true,"lgbt":true,"liaison":true,"lidl":true,"life":true,"lifeinsurance":true,"lifestyle":true,"lighting":true,"like":true,"lilly":true,"limited":true,"limo":true,"lincoln":true,"linde":true,"link":true,"lipsy":true,"live":true,"living":true,"lixil":true,"loan":true,"loans":true,"locker":true,"locus":true,"loft":true,"lol":true,"london":true,"lotte":true,"lotto":true,"love":true,"lpl":true,"lplfinancial":true,"ltd":true,"ltda":true,"lundbeck":true,"lupin":true,"luxe":true,"luxury":true,"macys":true,"madrid":true,"maif":true,"maison":true,"makeup":true,"man":true,"management":true,"mango":true,"map":true,"market":true,"marketing":true,"markets":true,"marriott":true,"marshalls":true,"maserati":true,"mattel":true,"mba":true,"mckinsey":true,"med":true,"media":true,"meet":true,"melbourne":true,"meme":true,"memorial":true,"men":true,"menu":true,"meo":true,"merckmsd":true,"metlife":true,"miami":true,"microsoft":true,"mini":true,"mint":true,"mit":true,"mitsubishi":true,"mlb":true,"mls":true,"mma":true,"mobile":true,"mobily":true,"moda":true,"moe":true,"moi":true,"mom":true,"monash":true,"money":true,"monster":true,"mopar":true,"mormon":true,"mortgage":true,"moscow":true,"moto":true,"motorcycles":true,"mov":true,"movie":true,"movistar":true,"msd":true,"mtn":true,"mtpc":true,"mtr":true,"mutual":true,"nab":true,"nadex":true,"nagoya":true,"nationwide":true,"natura":true,"navy":true,"nba":true,"nec":true,"netbank":true,"netflix":true,"network":true,"neustar":true,"new":true,"newholland":true,"news":true,"next":true,"nextdirect":true,"nexus":true,"nfl":true,"ngo":true,"nhk":true,"nico":true,"nike":true,"nikon":true,"ninja":true,"nissan":true,"nissay":true,"nokia":true,"northwesternmutual":true,"norton":true,"now":true,"nowruz":true,"nowtv":true,"nra":true,"nrw":true,"ntt":true,"nyc":true,"obi":true,"observer":true,"off":true,"office":true,"okinawa":true,"olayan":true,"olayangroup":true,"oldnavy":true,"ollo":true,"omega":true,"one":true,"ong":true,"onl":true,"online":true,"onyourside":true,"ooo":true,"open":true,"oracle":true,"orange":true,"organic":true,"origins":true,"osaka":true,"otsuka":true,"ott":true,"ovh":true,"page":true,"panasonic":true,"panerai":true,"paris":true,"pars":true,"partners":true,"parts":true,"party":true,"passagens":true,"pay":true,"pccw":true,"pet":true,"pfizer":true,"pharmacy":true,"phd":true,"philips":true,"phone":true,"photo":true,"photography":true,"photos":true,"physio":true,"piaget":true,"pics":true,"pictet":true,"pictures":true,"pid":true,"pin":true,"ping":true,"pink":true,"pioneer":true,"pizza":true,"place":true,"play":true,"playstation":true,"plumbing":true,"plus":true,"pnc":true,"pohl":true,"poker":true,"politie":true,"porn":true,"pramerica":true,"praxi":true,"press":true,"prime":true,"prod":true,"productions":true,"prof":true,"progressive":true,"promo":true,"properties":true,"property":true,"protection":true,"pru":true,"prudential":true,"pub":true,"pwc":true,"qpon":true,"quebec":true,"quest":true,"qvc":true,"racing":true,"radio":true,"raid":true,"read":true,"realestate":true,"realtor":true,"realty":true,"recipes":true,"red":true,"redstone":true,"redumbrella":true,"rehab":true,"reise":true,"reisen":true,"reit":true,"reliance":true,"ren":true,"rent":true,"rentals":true,"repair":true,"report":true,"republican":true,"rest":true,"restaurant":true,"review":true,"reviews":true,"rexroth":true,"rich":true,"richardli":true,"ricoh":true,"rightathome":true,"ril":true,"rio":true,"rip":true,"rmit":true,"rocher":true,"rocks":true,"rodeo":true,"rogers":true,"room":true,"rsvp":true,"rugby":true,"ruhr":true,"run":true,"rwe":true,"ryukyu":true,"saarland":true,"safe":true,"safety":true,"sakura":true,"sale":true,"salon":true,"samsclub":true,"samsung":true,"sandvik":true,"sandvikcoromant":true,"sanofi":true,"sap":true,"sapo":true,"sarl":true,"sas":true,"save":true,"saxo":true,"sbi":true,"sbs":true,"sca":true,"scb":true,"schaeffler":true,"schmidt":true,"scholarships":true,"school":true,"schule":true,"schwarz":true,"science":true,"scjohnson":true,"scor":true,"scot":true,"search":true,"seat":true,"secure":true,"security":true,"seek":true,"select":true,"sener":true,"services":true,"ses":true,"seven":true,"sew":true,"sex":true,"sexy":true,"sfr":true,"shangrila":true,"sharp":true,"shaw":true,"shell":true,"shia":true,"shiksha":true,"shoes":true,"shop":true,"shopping":true,"shouji":true,"show":true,"showtime":true,"shriram":true,"silk":true,"sina":true,"singles":true,"site":true,"ski":true,"skin":true,"sky":true,"skype":true,"sling":true,"smart":true,"smile":true,"sncf":true,"soccer":true,"social":true,"softbank":true,"software":true,"sohu":true,"solar":true,"solutions":true,"song":true,"sony":true,"soy":true,"space":true,"spiegel":true,"spot":true,"spreadbetting":true,"srl":true,"srt":true,"stada":true,"staples":true,"star":true,"starhub":true,"statebank":true,"statefarm":true,"statoil":true,"stc":true,"stcgroup":true,"stockholm":true,"storage":true,"store":true,"stream":true,"studio":true,"study":true,"style":true,"sucks":true,"supplies":true,"supply":true,"support":true,"surf":true,"surgery":true,"suzuki":true,"swatch":true,"swiftcover":true,"swiss":true,"sydney":true,"symantec":true,"systems":true,"tab":true,"taipei":true,"talk":true,"taobao":true,"target":true,"tatamotors":true,"tatar":true,"tattoo":true,"tax":true,"taxi":true,"tci":true,"tdk":true,"team":true,"tech":true,"technology":true,"telecity":true,"telefonica":true,"temasek":true,"tennis":true,"teva":true,"thd":true,"theater":true,"theatre":true,"tiaa":true,"tickets":true,"tienda":true,"tiffany":true,"tips":true,"tires":true,"tirol":true,"tjmaxx":true,"tjx":true,"tkmaxx":true,"tmall":true,"today":true,"tokyo":true,"tools":true,"top":true,"toray":true,"toshiba":true,"total":true,"tours":true,"town":true,"toyota":true,"toys":true,"trade":true,"trading":true,"training":true,"travelchannel":true,"travelers":true,"travelersinsurance":true,"trust":true,"trv":true,"tube":true,"tui":true,"tunes":true,"tushu":true,"tvs":true,"ubank":true,"ubs":true,"uconnect":true,"unicom":true,"university":true,"uno":true,"uol":true,"ups":true,"vacations":true,"vana":true,"vanguard":true,"vegas":true,"ventures":true,"verisign":true,"versicherung":true,"vet":true,"viajes":true,"video":true,"vig":true,"viking":true,"villas":true,"vin":true,"vip":true,"virgin":true,"visa":true,"vision":true,"vista":true,"vistaprint":true,"viva":true,"vivo":true,"vlaanderen":true,"vodka":true,"volkswagen":true,"volvo":true,"vote":true,"voting":true,"voto":true,"voyage":true,"vuelos":true,"wales":true,"walmart":true,"walter":true,"wang":true,"wanggou":true,"warman":true,"watch":true,"watches":true,"weather":true,"weatherchannel":true,"webcam":true,"weber":true,"website":true,"wed":true,"wedding":true,"weibo":true,"weir":true,"whoswho":true,"wien":true,"wiki":true,"williamhill":true,"win":true,"windows":true,"wine":true,"winners":true,"wme":true,"wolterskluwer":true,"woodside":true,"work":true,"works":true,"world":true,"wow":true,"wtc":true,"wtf":true,"xbox":true,"xerox":true,"xfinity":true,"xihuan":true,"xin":true,"xn--11b4c3d":true,"xn--1ck2e1b":true,"xn--1qqw23a":true,"xn--30rr7y":true,"xn--3bst00m":true,"xn--3ds443g":true,"xn--3oq18vl8pn36a":true,"xn--3pxu8k":true,"xn--42c2d9a":true,"xn--45q11c":true,"xn--4gbrim":true,"xn--55qw42g":true,"xn--55qx5d":true,"xn--5su34j936bgsg":true,"xn--5tzm5g":true,"xn--6frz82g":true,"xn--6qq986b3xl":true,"xn--80adxhks":true,"xn--80aqecdr1a":true,"xn--80asehdb":true,"xn--80aswg":true,"xn--8y0a063a":true,"xn--9dbq2a":true,"xn--9et52u":true,"xn--9krt00a":true,"xn--b4w605ferd":true,"xn--bck1b9a5dre4c":true,"xn--c1avg":true,"xn--c2br7g":true,"xn--cck2b3b":true,"xn--cg4bki":true,"xn--czr694b":true,"xn--czrs0t":true,"xn--czru2d":true,"xn--d1acj3b":true,"xn--eckvdtc9d":true,"xn--efvy88h":true,"xn--estv75g":true,"xn--fct429k":true,"xn--fhbei":true,"xn--fiq228c5hs":true,"xn--fiq64b":true,"xn--fjq720a":true,"xn--flw351e":true,"xn--fzys8d69uvgm":true,"xn--g2xx48c":true,"xn--gckr3f0f":true,"xn--gk3at1e":true,"xn--hxt814e":true,"xn--i1b6b1a6a2e":true,"xn--imr513n":true,"xn--io0a7i":true,"xn--j1aef":true,"xn--jlq61u9w7b":true,"xn--jvr189m":true,"xn--kcrx77d1x4a":true,"xn--kpu716f":true,"xn--kput3i":true,"xn--mgba3a3ejt":true,"xn--mgba7c0bbn0a":true,"xn--mgbaakc7dvf":true,"xn--mgbab2bd":true,"xn--mgbb9fbpob":true,"xn--mgbca7dzdo":true,"xn--mgbi4ecexp":true,"xn--mgbt3dhd":true,"xn--mk1bu44c":true,"xn--mxtq1m":true,"xn--ngbc5azd":true,"xn--ngbe9e0a":true,"xn--ngbrx":true,"xn--nqv7f":true,"xn--nqv7fs00ema":true,"xn--nyqy26a":true,"xn--p1acf":true,"xn--pbt977c":true,"xn--pssy2u":true,"xn--q9jyb4c":true,"xn--qcka1pmc":true,"xn--rhqv96g":true,"xn--rovu88b":true,"xn--ses554g":true,"xn--t60b56a":true,"xn--tckwe":true,"xn--tiq49xqyj":true,"xn--unup4y":true,"xn--vermgensberater-ctb":true,"xn--vermgensberatung-pwb":true,"xn--vhquv":true,"xn--vuq861b":true,"xn--w4r85el8fhu5dnra":true,"xn--w4rs40l":true,"xn--xhq521b":true,"xn--zfr164b":true,"xperia":true,"xyz":true,"yachts":true,"yahoo":true,"yamaxun":true,"yandex":true,"yodobashi":true,"yoga":true,"yokohama":true,"you":true,"youtube":true,"yun":true,"zappos":true,"zara":true,"zero":true,"zip":true,"zippo":true,"zone":true,"zuerich":true,"cc.ua":true,"inf.ua":true,"ltd.ua":true,"1password.ca":true,"1password.com":true,"1password.eu":true,"beep.pl":true,"*.compute.estate":true,"*.alces.network":true,"alwaysdata.net":true,"cloudfront.net":true,"*.compute.amazonaws.com":true,"*.compute-1.amazonaws.com":true,"*.compute.amazonaws.com.cn":true,"us-east-1.amazonaws.com":true,"cn-north-1.eb.amazonaws.com.cn":true,"elasticbeanstalk.com":true,"ap-northeast-1.elasticbeanstalk.com":true,"ap-northeast-2.elasticbeanstalk.com":true,"ap-south-1.elasticbeanstalk.com":true,"ap-southeast-1.elasticbeanstalk.com":true,"ap-southeast-2.elasticbeanstalk.com":true,"ca-central-1.elasticbeanstalk.com":true,"eu-central-1.elasticbeanstalk.com":true,"eu-west-1.elasticbeanstalk.com":true,"eu-west-2.elasticbeanstalk.com":true,"eu-west-3.elasticbeanstalk.com":true,"sa-east-1.elasticbeanstalk.com":true,"us-east-1.elasticbeanstalk.com":true,"us-east-2.elasticbeanstalk.com":true,"us-gov-west-1.elasticbeanstalk.com":true,"us-west-1.elasticbeanstalk.com":true,"us-west-2.elasticbeanstalk.com":true,"*.elb.amazonaws.com":true,"*.elb.amazonaws.com.cn":true,"s3.amazonaws.com":true,"s3-ap-northeast-1.amazonaws.com":true,"s3-ap-northeast-2.amazonaws.com":true,"s3-ap-south-1.amazonaws.com":true,"s3-ap-southeast-1.amazonaws.com":true,"s3-ap-southeast-2.amazonaws.com":true,"s3-ca-central-1.amazonaws.com":true,"s3-eu-central-1.amazonaws.com":true,"s3-eu-west-1.amazonaws.com":true,"s3-eu-west-2.amazonaws.com":true,"s3-eu-west-3.amazonaws.com":true,"s3-external-1.amazonaws.com":true,"s3-fips-us-gov-west-1.amazonaws.com":true,"s3-sa-east-1.amazonaws.com":true,"s3-us-gov-west-1.amazonaws.com":true,"s3-us-east-2.amazonaws.com":true,"s3-us-west-1.amazonaws.com":true,"s3-us-west-2.amazonaws.com":true,"s3.ap-northeast-2.amazonaws.com":true,"s3.ap-south-1.amazonaws.com":true,"s3.cn-north-1.amazonaws.com.cn":true,"s3.ca-central-1.amazonaws.com":true,"s3.eu-central-1.amazonaws.com":true,"s3.eu-west-2.amazonaws.com":true,"s3.eu-west-3.amazonaws.com":true,"s3.us-east-2.amazonaws.com":true,"s3.dualstack.ap-northeast-1.amazonaws.com":true,"s3.dualstack.ap-northeast-2.amazonaws.com":true,"s3.dualstack.ap-south-1.amazonaws.com":true,"s3.dualstack.ap-southeast-1.amazonaws.com":true,"s3.dualstack.ap-southeast-2.amazonaws.com":true,"s3.dualstack.ca-central-1.amazonaws.com":true,"s3.dualstack.eu-central-1.amazonaws.com":true,"s3.dualstack.eu-west-1.amazonaws.com":true,"s3.dualstack.eu-west-2.amazonaws.com":true,"s3.dualstack.eu-west-3.amazonaws.com":true,"s3.dualstack.sa-east-1.amazonaws.com":true,"s3.dualstack.us-east-1.amazonaws.com":true,"s3.dualstack.us-east-2.amazonaws.com":true,"s3-website-us-east-1.amazonaws.com":true,"s3-website-us-west-1.amazonaws.com":true,"s3-website-us-west-2.amazonaws.com":true,"s3-website-ap-northeast-1.amazonaws.com":true,"s3-website-ap-southeast-1.amazonaws.com":true,"s3-website-ap-southeast-2.amazonaws.com":true,"s3-website-eu-west-1.amazonaws.com":true,"s3-website-sa-east-1.amazonaws.com":true,"s3-website.ap-northeast-2.amazonaws.com":true,"s3-website.ap-south-1.amazonaws.com":true,"s3-website.ca-central-1.amazonaws.com":true,"s3-website.eu-central-1.amazonaws.com":true,"s3-website.eu-west-2.amazonaws.com":true,"s3-website.eu-west-3.amazonaws.com":true,"s3-website.us-east-2.amazonaws.com":true,"t3l3p0rt.net":true,"tele.amune.org":true,"on-aptible.com":true,"user.party.eus":true,"pimienta.org":true,"poivron.org":true,"potager.org":true,"sweetpepper.org":true,"myasustor.com":true,"myfritz.net":true,"*.awdev.ca":true,"*.advisor.ws":true,"backplaneapp.io":true,"betainabox.com":true,"bnr.la":true,"boomla.net":true,"boxfuse.io":true,"square7.ch":true,"bplaced.com":true,"bplaced.de":true,"square7.de":true,"bplaced.net":true,"square7.net":true,"browsersafetymark.io":true,"mycd.eu":true,"ae.org":true,"ar.com":true,"br.com":true,"cn.com":true,"com.de":true,"com.se":true,"de.com":true,"eu.com":true,"gb.com":true,"gb.net":true,"hu.com":true,"hu.net":true,"jp.net":true,"jpn.com":true,"kr.com":true,"mex.com":true,"no.com":true,"qc.com":true,"ru.com":true,"sa.com":true,"se.com":true,"se.net":true,"uk.com":true,"uk.net":true,"us.com":true,"uy.com":true,"za.bz":true,"za.com":true,"africa.com":true,"gr.com":true,"in.net":true,"us.org":true,"co.com":true,"c.la":true,"certmgr.org":true,"xenapponazure.com":true,"virtueeldomein.nl":true,"c66.me":true,"cloud66.ws":true,"jdevcloud.com":true,"wpdevcloud.com":true,"cloudaccess.host":true,"freesite.host":true,"cloudaccess.net":true,"cloudcontrolled.com":true,"cloudcontrolapp.com":true,"co.ca":true,"co.cz":true,"c.cdn77.org":true,"cdn77-ssl.net":true,"r.cdn77.net":true,"rsc.cdn77.org":true,"ssl.origin.cdn77-secure.org":true,"cloudns.asia":true,"cloudns.biz":true,"cloudns.club":true,"cloudns.cc":true,"cloudns.eu":true,"cloudns.in":true,"cloudns.info":true,"cloudns.org":true,"cloudns.pro":true,"cloudns.pw":true,"cloudns.us":true,"co.nl":true,"co.no":true,"webhosting.be":true,"hosting-cluster.nl":true,"dyn.cosidns.de":true,"dynamisches-dns.de":true,"dnsupdater.de":true,"internet-dns.de":true,"l-o-g-i-n.de":true,"dynamic-dns.info":true,"feste-ip.net":true,"knx-server.net":true,"static-access.net":true,"realm.cz":true,"*.cryptonomic.net":true,"cupcake.is":true,"cyon.link":true,"cyon.site":true,"daplie.me":true,"localhost.daplie.me":true,"biz.dk":true,"co.dk":true,"firm.dk":true,"reg.dk":true,"store.dk":true,"debian.net":true,"dedyn.io":true,"dnshome.de":true,"drayddns.com":true,"dreamhosters.com":true,"mydrobo.com":true,"drud.io":true,"drud.us":true,"duckdns.org":true,"dy.fi":true,"tunk.org":true,"dyndns-at-home.com":true,"dyndns-at-work.com":true,"dyndns-blog.com":true,"dyndns-free.com":true,"dyndns-home.com":true,"dyndns-ip.com":true,"dyndns-mail.com":true,"dyndns-office.com":true,"dyndns-pics.com":true,"dyndns-remote.com":true,"dyndns-server.com":true,"dyndns-web.com":true,"dyndns-wiki.com":true,"dyndns-work.com":true,"dyndns.biz":true,"dyndns.info":true,"dyndns.org":true,"dyndns.tv":true,"at-band-camp.net":true,"ath.cx":true,"barrel-of-knowledge.info":true,"barrell-of-knowledge.info":true,"better-than.tv":true,"blogdns.com":true,"blogdns.net":true,"blogdns.org":true,"blogsite.org":true,"boldlygoingnowhere.org":true,"broke-it.net":true,"buyshouses.net":true,"cechire.com":true,"dnsalias.com":true,"dnsalias.net":true,"dnsalias.org":true,"dnsdojo.com":true,"dnsdojo.net":true,"dnsdojo.org":true,"does-it.net":true,"doesntexist.com":true,"doesntexist.org":true,"dontexist.com":true,"dontexist.net":true,"dontexist.org":true,"doomdns.com":true,"doomdns.org":true,"dvrdns.org":true,"dyn-o-saur.com":true,"dynalias.com":true,"dynalias.net":true,"dynalias.org":true,"dynathome.net":true,"dyndns.ws":true,"endofinternet.net":true,"endofinternet.org":true,"endoftheinternet.org":true,"est-a-la-maison.com":true,"est-a-la-masion.com":true,"est-le-patron.com":true,"est-mon-blogueur.com":true,"for-better.biz":true,"for-more.biz":true,"for-our.info":true,"for-some.biz":true,"for-the.biz":true,"forgot.her.name":true,"forgot.his.name":true,"from-ak.com":true,"from-al.com":true,"from-ar.com":true,"from-az.net":true,"from-ca.com":true,"from-co.net":true,"from-ct.com":true,"from-dc.com":true,"from-de.com":true,"from-fl.com":true,"from-ga.com":true,"from-hi.com":true,"from-ia.com":true,"from-id.com":true,"from-il.com":true,"from-in.com":true,"from-ks.com":true,"from-ky.com":true,"from-la.net":true,"from-ma.com":true,"from-md.com":true,"from-me.org":true,"from-mi.com":true,"from-mn.com":true,"from-mo.com":true,"from-ms.com":true,"from-mt.com":true,"from-nc.com":true,"from-nd.com":true,"from-ne.com":true,"from-nh.com":true,"from-nj.com":true,"from-nm.com":true,"from-nv.com":true,"from-ny.net":true,"from-oh.com":true,"from-ok.com":true,"from-or.com":true,"from-pa.com":true,"from-pr.com":true,"from-ri.com":true,"from-sc.com":true,"from-sd.com":true,"from-tn.com":true,"from-tx.com":true,"from-ut.com":true,"from-va.com":true,"from-vt.com":true,"from-wa.com":true,"from-wi.com":true,"from-wv.com":true,"from-wy.com":true,"ftpaccess.cc":true,"fuettertdasnetz.de":true,"game-host.org":true,"game-server.cc":true,"getmyip.com":true,"gets-it.net":true,"go.dyndns.org":true,"gotdns.com":true,"gotdns.org":true,"groks-the.info":true,"groks-this.info":true,"ham-radio-op.net":true,"here-for-more.info":true,"hobby-site.com":true,"hobby-site.org":true,"home.dyndns.org":true,"homedns.org":true,"homeftp.net":true,"homeftp.org":true,"homeip.net":true,"homelinux.com":true,"homelinux.net":true,"homelinux.org":true,"homeunix.com":true,"homeunix.net":true,"homeunix.org":true,"iamallama.com":true,"in-the-band.net":true,"is-a-anarchist.com":true,"is-a-blogger.com":true,"is-a-bookkeeper.com":true,"is-a-bruinsfan.org":true,"is-a-bulls-fan.com":true,"is-a-candidate.org":true,"is-a-caterer.com":true,"is-a-celticsfan.org":true,"is-a-chef.com":true,"is-a-chef.net":true,"is-a-chef.org":true,"is-a-conservative.com":true,"is-a-cpa.com":true,"is-a-cubicle-slave.com":true,"is-a-democrat.com":true,"is-a-designer.com":true,"is-a-doctor.com":true,"is-a-financialadvisor.com":true,"is-a-geek.com":true,"is-a-geek.net":true,"is-a-geek.org":true,"is-a-green.com":true,"is-a-guru.com":true,"is-a-hard-worker.com":true,"is-a-hunter.com":true,"is-a-knight.org":true,"is-a-landscaper.com":true,"is-a-lawyer.com":true,"is-a-liberal.com":true,"is-a-libertarian.com":true,"is-a-linux-user.org":true,"is-a-llama.com":true,"is-a-musician.com":true,"is-a-nascarfan.com":true,"is-a-nurse.com":true,"is-a-painter.com":true,"is-a-patsfan.org":true,"is-a-personaltrainer.com":true,"is-a-photographer.com":true,"is-a-player.com":true,"is-a-republican.com":true,"is-a-rockstar.com":true,"is-a-socialist.com":true,"is-a-soxfan.org":true,"is-a-student.com":true,"is-a-teacher.com":true,"is-a-techie.com":true,"is-a-therapist.com":true,"is-an-accountant.com":true,"is-an-actor.com":true,"is-an-actress.com":true,"is-an-anarchist.com":true,"is-an-artist.com":true,"is-an-engineer.com":true,"is-an-entertainer.com":true,"is-by.us":true,"is-certified.com":true,"is-found.org":true,"is-gone.com":true,"is-into-anime.com":true,"is-into-cars.com":true,"is-into-cartoons.com":true,"is-into-games.com":true,"is-leet.com":true,"is-lost.org":true,"is-not-certified.com":true,"is-saved.org":true,"is-slick.com":true,"is-uberleet.com":true,"is-very-bad.org":true,"is-very-evil.org":true,"is-very-good.org":true,"is-very-nice.org":true,"is-very-sweet.org":true,"is-with-theband.com":true,"isa-geek.com":true,"isa-geek.net":true,"isa-geek.org":true,"isa-hockeynut.com":true,"issmarterthanyou.com":true,"isteingeek.de":true,"istmein.de":true,"kicks-ass.net":true,"kicks-ass.org":true,"knowsitall.info":true,"land-4-sale.us":true,"lebtimnetz.de":true,"leitungsen.de":true,"likes-pie.com":true,"likescandy.com":true,"merseine.nu":true,"mine.nu":true,"misconfused.org":true,"mypets.ws":true,"myphotos.cc":true,"neat-url.com":true,"office-on-the.net":true,"on-the-web.tv":true,"podzone.net":true,"podzone.org":true,"readmyblog.org":true,"saves-the-whales.com":true,"scrapper-site.net":true,"scrapping.cc":true,"selfip.biz":true,"selfip.com":true,"selfip.info":true,"selfip.net":true,"selfip.org":true,"sells-for-less.com":true,"sells-for-u.com":true,"sells-it.net":true,"sellsyourhome.org":true,"servebbs.com":true,"servebbs.net":true,"servebbs.org":true,"serveftp.net":true,"serveftp.org":true,"servegame.org":true,"shacknet.nu":true,"simple-url.com":true,"space-to-rent.com":true,"stuff-4-sale.org":true,"stuff-4-sale.us":true,"teaches-yoga.com":true,"thruhere.net":true,"traeumtgerade.de":true,"webhop.biz":true,"webhop.info":true,"webhop.net":true,"webhop.org":true,"worse-than.tv":true,"writesthisblog.com":true,"ddnss.de":true,"dyn.ddnss.de":true,"dyndns.ddnss.de":true,"dyndns1.de":true,"dyn-ip24.de":true,"home-webserver.de":true,"dyn.home-webserver.de":true,"myhome-server.de":true,"ddnss.org":true,"definima.net":true,"definima.io":true,"ddnsfree.com":true,"ddnsgeek.com":true,"giize.com":true,"gleeze.com":true,"kozow.com":true,"loseyourip.com":true,"ooguy.com":true,"theworkpc.com":true,"casacam.net":true,"dynu.net":true,"accesscam.org":true,"camdvr.org":true,"freeddns.org":true,"mywire.org":true,"webredirect.org":true,"myddns.rocks":true,"blogsite.xyz":true,"dynv6.net":true,"e4.cz":true,"mytuleap.com":true,"enonic.io":true,"customer.enonic.io":true,"eu.org":true,"al.eu.org":true,"asso.eu.org":true,"at.eu.org":true,"au.eu.org":true,"be.eu.org":true,"bg.eu.org":true,"ca.eu.org":true,"cd.eu.org":true,"ch.eu.org":true,"cn.eu.org":true,"cy.eu.org":true,"cz.eu.org":true,"de.eu.org":true,"dk.eu.org":true,"edu.eu.org":true,"ee.eu.org":true,"es.eu.org":true,"fi.eu.org":true,"fr.eu.org":true,"gr.eu.org":true,"hr.eu.org":true,"hu.eu.org":true,"ie.eu.org":true,"il.eu.org":true,"in.eu.org":true,"int.eu.org":true,"is.eu.org":true,"it.eu.org":true,"jp.eu.org":true,"kr.eu.org":true,"lt.eu.org":true,"lu.eu.org":true,"lv.eu.org":true,"mc.eu.org":true,"me.eu.org":true,"mk.eu.org":true,"mt.eu.org":true,"my.eu.org":true,"net.eu.org":true,"ng.eu.org":true,"nl.eu.org":true,"no.eu.org":true,"nz.eu.org":true,"paris.eu.org":true,"pl.eu.org":true,"pt.eu.org":true,"q-a.eu.org":true,"ro.eu.org":true,"ru.eu.org":true,"se.eu.org":true,"si.eu.org":true,"sk.eu.org":true,"tr.eu.org":true,"uk.eu.org":true,"us.eu.org":true,"eu-1.evennode.com":true,"eu-2.evennode.com":true,"eu-3.evennode.com":true,"eu-4.evennode.com":true,"us-1.evennode.com":true,"us-2.evennode.com":true,"us-3.evennode.com":true,"us-4.evennode.com":true,"twmail.cc":true,"twmail.net":true,"twmail.org":true,"mymailer.com.tw":true,"url.tw":true,"apps.fbsbx.com":true,"ru.net":true,"adygeya.ru":true,"bashkiria.ru":true,"bir.ru":true,"cbg.ru":true,"com.ru":true,"dagestan.ru":true,"grozny.ru":true,"kalmykia.ru":true,"kustanai.ru":true,"marine.ru":true,"mordovia.ru":true,"msk.ru":true,"mytis.ru":true,"nalchik.ru":true,"nov.ru":true,"pyatigorsk.ru":true,"spb.ru":true,"vladikavkaz.ru":true,"vladimir.ru":true,"abkhazia.su":true,"adygeya.su":true,"aktyubinsk.su":true,"arkhangelsk.su":true,"armenia.su":true,"ashgabad.su":true,"azerbaijan.su":true,"balashov.su":true,"bashkiria.su":true,"bryansk.su":true,"bukhara.su":true,"chimkent.su":true,"dagestan.su":true,"east-kazakhstan.su":true,"exnet.su":true,"georgia.su":true,"grozny.su":true,"ivanovo.su":true,"jambyl.su":true,"kalmykia.su":true,"kaluga.su":true,"karacol.su":true,"karaganda.su":true,"karelia.su":true,"khakassia.su":true,"krasnodar.su":true,"kurgan.su":true,"kustanai.su":true,"lenug.su":true,"mangyshlak.su":true,"mordovia.su":true,"msk.su":true,"murmansk.su":true,"nalchik.su":true,"navoi.su":true,"north-kazakhstan.su":true,"nov.su":true,"obninsk.su":true,"penza.su":true,"pokrovsk.su":true,"sochi.su":true,"spb.su":true,"tashkent.su":true,"termez.su":true,"togliatti.su":true,"troitsk.su":true,"tselinograd.su":true,"tula.su":true,"tuva.su":true,"vladikavkaz.su":true,"vladimir.su":true,"vologda.su":true,"channelsdvr.net":true,"fastlylb.net":true,"map.fastlylb.net":true,"freetls.fastly.net":true,"map.fastly.net":true,"a.prod.fastly.net":true,"global.prod.fastly.net":true,"a.ssl.fastly.net":true,"b.ssl.fastly.net":true,"global.ssl.fastly.net":true,"fhapp.xyz":true,"fedorainfracloud.org":true,"fedorapeople.org":true,"cloud.fedoraproject.org":true,"app.os.fedoraproject.org":true,"app.os.stg.fedoraproject.org":true,"filegear.me":true,"firebaseapp.com":true,"flynnhub.com":true,"flynnhosting.net":true,"freebox-os.com":true,"freeboxos.com":true,"fbx-os.fr":true,"fbxos.fr":true,"freebox-os.fr":true,"freeboxos.fr":true,"*.futurecms.at":true,"futurehosting.at":true,"futuremailing.at":true,"*.ex.ortsinfo.at":true,"*.kunden.ortsinfo.at":true,"*.statics.cloud":true,"service.gov.uk":true,"github.io":true,"githubusercontent.com":true,"gitlab.io":true,"homeoffice.gov.uk":true,"ro.im":true,"shop.ro":true,"goip.de":true,"*.0emm.com":true,"appspot.com":true,"blogspot.ae":true,"blogspot.al":true,"blogspot.am":true,"blogspot.ba":true,"blogspot.be":true,"blogspot.bg":true,"blogspot.bj":true,"blogspot.ca":true,"blogspot.cf":true,"blogspot.ch":true,"blogspot.cl":true,"blogspot.co.at":true,"blogspot.co.id":true,"blogspot.co.il":true,"blogspot.co.ke":true,"blogspot.co.nz":true,"blogspot.co.uk":true,"blogspot.co.za":true,"blogspot.com":true,"blogspot.com.ar":true,"blogspot.com.au":true,"blogspot.com.br":true,"blogspot.com.by":true,"blogspot.com.co":true,"blogspot.com.cy":true,"blogspot.com.ee":true,"blogspot.com.eg":true,"blogspot.com.es":true,"blogspot.com.mt":true,"blogspot.com.ng":true,"blogspot.com.tr":true,"blogspot.com.uy":true,"blogspot.cv":true,"blogspot.cz":true,"blogspot.de":true,"blogspot.dk":true,"blogspot.fi":true,"blogspot.fr":true,"blogspot.gr":true,"blogspot.hk":true,"blogspot.hr":true,"blogspot.hu":true,"blogspot.ie":true,"blogspot.in":true,"blogspot.is":true,"blogspot.it":true,"blogspot.jp":true,"blogspot.kr":true,"blogspot.li":true,"blogspot.lt":true,"blogspot.lu":true,"blogspot.md":true,"blogspot.mk":true,"blogspot.mr":true,"blogspot.mx":true,"blogspot.my":true,"blogspot.nl":true,"blogspot.no":true,"blogspot.pe":true,"blogspot.pt":true,"blogspot.qa":true,"blogspot.re":true,"blogspot.ro":true,"blogspot.rs":true,"blogspot.ru":true,"blogspot.se":true,"blogspot.sg":true,"blogspot.si":true,"blogspot.sk":true,"blogspot.sn":true,"blogspot.td":true,"blogspot.tw":true,"blogspot.ug":true,"blogspot.vn":true,"cloudfunctions.net":true,"cloud.goog":true,"codespot.com":true,"googleapis.com":true,"googlecode.com":true,"pagespeedmobilizer.com":true,"publishproxy.com":true,"withgoogle.com":true,"withyoutube.com":true,"hashbang.sh":true,"hasura-app.io":true,"hepforge.org":true,"herokuapp.com":true,"herokussl.com":true,"moonscale.net":true,"iki.fi":true,"biz.at":true,"info.at":true,"info.cx":true,"ac.leg.br":true,"al.leg.br":true,"am.leg.br":true,"ap.leg.br":true,"ba.leg.br":true,"ce.leg.br":true,"df.leg.br":true,"es.leg.br":true,"go.leg.br":true,"ma.leg.br":true,"mg.leg.br":true,"ms.leg.br":true,"mt.leg.br":true,"pa.leg.br":true,"pb.leg.br":true,"pe.leg.br":true,"pi.leg.br":true,"pr.leg.br":true,"rj.leg.br":true,"rn.leg.br":true,"ro.leg.br":true,"rr.leg.br":true,"rs.leg.br":true,"sc.leg.br":true,"se.leg.br":true,"sp.leg.br":true,"to.leg.br":true,"pixolino.com":true,"ipifony.net":true,"*.triton.zone":true,"*.cns.joyent.com":true,"js.org":true,"keymachine.de":true,"knightpoint.systems":true,"co.krd":true,"edu.krd":true,"git-repos.de":true,"lcube-server.de":true,"svn-repos.de":true,"linkyard.cloud":true,"linkyard-cloud.ch":true,"we.bs":true,"barsy.bg":true,"barsyonline.com":true,"barsy.de":true,"barsy.eu":true,"barsy.in":true,"barsy.net":true,"barsy.online":true,"barsy.support":true,"*.magentosite.cloud":true,"hb.cldmail.ru":true,"cloud.metacentrum.cz":true,"custom.metacentrum.cz":true,"meteorapp.com":true,"eu.meteorapp.com":true,"co.pl":true,"azurewebsites.net":true,"azure-mobile.net":true,"cloudapp.net":true,"mozilla-iot.org":true,"bmoattachments.org":true,"net.ru":true,"org.ru":true,"pp.ru":true,"bitballoon.com":true,"netlify.com":true,"4u.com":true,"ngrok.io":true,"nh-serv.co.uk":true,"nfshost.com":true,"nsupdate.info":true,"nerdpol.ovh":true,"blogsyte.com":true,"brasilia.me":true,"cable-modem.org":true,"ciscofreak.com":true,"collegefan.org":true,"couchpotatofries.org":true,"damnserver.com":true,"ddns.me":true,"ditchyourip.com":true,"dnsfor.me":true,"dnsiskinky.com":true,"dvrcam.info":true,"dynns.com":true,"eating-organic.net":true,"fantasyleague.cc":true,"geekgalaxy.com":true,"golffan.us":true,"health-carereform.com":true,"homesecuritymac.com":true,"homesecuritypc.com":true,"hopto.me":true,"ilovecollege.info":true,"loginto.me":true,"mlbfan.org":true,"mmafan.biz":true,"myactivedirectory.com":true,"mydissent.net":true,"myeffect.net":true,"mymediapc.net":true,"mypsx.net":true,"mysecuritycamera.com":true,"mysecuritycamera.net":true,"mysecuritycamera.org":true,"net-freaks.com":true,"nflfan.org":true,"nhlfan.net":true,"no-ip.ca":true,"no-ip.co.uk":true,"no-ip.net":true,"noip.us":true,"onthewifi.com":true,"pgafan.net":true,"point2this.com":true,"pointto.us":true,"privatizehealthinsurance.net":true,"quicksytes.com":true,"read-books.org":true,"securitytactics.com":true,"serveexchange.com":true,"servehumour.com":true,"servep2p.com":true,"servesarcasm.com":true,"stufftoread.com":true,"ufcfan.org":true,"unusualperson.com":true,"workisboring.com":true,"3utilities.com":true,"bounceme.net":true,"ddns.net":true,"ddnsking.com":true,"gotdns.ch":true,"hopto.org":true,"myftp.biz":true,"myftp.org":true,"myvnc.com":true,"no-ip.biz":true,"no-ip.info":true,"no-ip.org":true,"noip.me":true,"redirectme.net":true,"servebeer.com":true,"serveblog.net":true,"servecounterstrike.com":true,"serveftp.com":true,"servegame.com":true,"servehalflife.com":true,"servehttp.com":true,"serveirc.com":true,"serveminecraft.net":true,"servemp3.com":true,"servepics.com":true,"servequake.com":true,"sytes.net":true,"webhop.me":true,"zapto.org":true,"stage.nodeart.io":true,"nodum.co":true,"nodum.io":true,"nyc.mn":true,"nom.ae":true,"nom.ai":true,"nom.al":true,"nym.by":true,"nym.bz":true,"nom.cl":true,"nom.gd":true,"nom.gl":true,"nym.gr":true,"nom.gt":true,"nom.hn":true,"nom.im":true,"nym.kz":true,"nym.la":true,"nom.li":true,"nym.li":true,"nym.lt":true,"nym.lu":true,"nym.me":true,"nom.mk":true,"nym.mx":true,"nom.nu":true,"nym.nz":true,"nym.pe":true,"nym.pt":true,"nom.pw":true,"nom.qa":true,"nom.rs":true,"nom.si":true,"nym.sk":true,"nym.su":true,"nym.sx":true,"nym.tw":true,"nom.ug":true,"nom.uy":true,"nom.vc":true,"nom.vg":true,"cya.gg":true,"nid.io":true,"opencraft.hosting":true,"operaunite.com":true,"outsystemscloud.com":true,"ownprovider.com":true,"oy.lc":true,"pgfog.com":true,"pagefrontapp.com":true,"art.pl":true,"gliwice.pl":true,"krakow.pl":true,"poznan.pl":true,"wroc.pl":true,"zakopane.pl":true,"pantheonsite.io":true,"gotpantheon.com":true,"mypep.link":true,"on-web.fr":true,"*.platform.sh":true,"*.platformsh.site":true,"xen.prgmr.com":true,"priv.at":true,"protonet.io":true,"chirurgiens-dentistes-en-france.fr":true,"byen.site":true,"qa2.com":true,"dev-myqnapcloud.com":true,"alpha-myqnapcloud.com":true,"myqnapcloud.com":true,"*.quipelements.com":true,"vapor.cloud":true,"vaporcloud.io":true,"rackmaze.com":true,"rackmaze.net":true,"rhcloud.com":true,"resindevice.io":true,"devices.resinstaging.io":true,"hzc.io":true,"wellbeingzone.eu":true,"ptplus.fit":true,"wellbeingzone.co.uk":true,"sandcats.io":true,"logoip.de":true,"logoip.com":true,"schokokeks.net":true,"scrysec.com":true,"firewall-gateway.com":true,"firewall-gateway.de":true,"my-gateway.de":true,"my-router.de":true,"spdns.de":true,"spdns.eu":true,"firewall-gateway.net":true,"my-firewall.org":true,"myfirewall.org":true,"spdns.org":true,"*.s5y.io":true,"*.sensiosite.cloud":true,"biz.ua":true,"co.ua":true,"pp.ua":true,"shiftedit.io":true,"myshopblocks.com":true,"1kapp.com":true,"appchizi.com":true,"applinzi.com":true,"sinaapp.com":true,"vipsinaapp.com":true,"bounty-full.com":true,"alpha.bounty-full.com":true,"beta.bounty-full.com":true,"static.land":true,"dev.static.land":true,"sites.static.land":true,"apps.lair.io":true,"*.stolos.io":true,"spacekit.io":true,"stackspace.space":true,"storj.farm":true,"temp-dns.com":true,"diskstation.me":true,"dscloud.biz":true,"dscloud.me":true,"dscloud.mobi":true,"dsmynas.com":true,"dsmynas.net":true,"dsmynas.org":true,"familyds.com":true,"familyds.net":true,"familyds.org":true,"i234.me":true,"myds.me":true,"synology.me":true,"vpnplus.to":true,"taifun-dns.de":true,"gda.pl":true,"gdansk.pl":true,"gdynia.pl":true,"med.pl":true,"sopot.pl":true,"cust.dev.thingdust.io":true,"cust.disrec.thingdust.io":true,"cust.prod.thingdust.io":true,"cust.testing.thingdust.io":true,"bloxcms.com":true,"townnews-staging.com":true,"12hp.at":true,"2ix.at":true,"4lima.at":true,"lima-city.at":true,"12hp.ch":true,"2ix.ch":true,"4lima.ch":true,"lima-city.ch":true,"trafficplex.cloud":true,"de.cool":true,"12hp.de":true,"2ix.de":true,"4lima.de":true,"lima-city.de":true,"1337.pictures":true,"clan.rip":true,"lima-city.rocks":true,"webspace.rocks":true,"lima.zone":true,"*.transurl.be":true,"*.transurl.eu":true,"*.transurl.nl":true,"tuxfamily.org":true,"dd-dns.de":true,"diskstation.eu":true,"diskstation.org":true,"dray-dns.de":true,"draydns.de":true,"dyn-vpn.de":true,"dynvpn.de":true,"mein-vigor.de":true,"my-vigor.de":true,"my-wan.de":true,"syno-ds.de":true,"synology-diskstation.de":true,"synology-ds.de":true,"uber.space":true,"hk.com":true,"hk.org":true,"ltd.hk":true,"inc.hk":true,"lib.de.us":true,"2038.io":true,"router.management":true,"v-info.info":true,"wedeploy.io":true,"wedeploy.me":true,"wedeploy.sh":true,"remotewd.com":true,"wmflabs.org":true,"cistron.nl":true,"demon.nl":true,"xs4all.space":true,"official.academy":true,"yolasite.com":true,"ybo.faith":true,"yombo.me":true,"homelink.one":true,"ybo.party":true,"ybo.review":true,"ybo.science":true,"ybo.trade":true,"za.net":true,"za.org":true,"now.sh":true}); - -// END of automatically generated file - - -/***/ }), -/* 386 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/*jshint unused:false */ - -function Store() { -} -exports.Store = Store; - -// Stores may be synchronous, but are still required to use a -// Continuation-Passing Style API. The CookieJar itself will expose a "*Sync" -// API that converts from synchronous-callbacks to imperative style. -Store.prototype.synchronous = false; - -Store.prototype.findCookie = function(domain, path, key, cb) { - throw new Error('findCookie is not implemented'); -}; - -Store.prototype.findCookies = function(domain, path, cb) { - throw new Error('findCookies is not implemented'); -}; - -Store.prototype.putCookie = function(cookie, cb) { - throw new Error('putCookie is not implemented'); -}; - -Store.prototype.updateCookie = function(oldCookie, newCookie, cb) { - // recommended default implementation: - // return this.putCookie(newCookie, cb); - throw new Error('updateCookie is not implemented'); -}; - -Store.prototype.removeCookie = function(domain, path, key, cb) { - throw new Error('removeCookie is not implemented'); -}; - -Store.prototype.removeCookies = function(domain, path, cb) { - throw new Error('removeCookies is not implemented'); -}; - -Store.prototype.getAllCookies = function(cb) { - throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)'); -}; - - -/***/ }), -/* 387 */ -/***/ (function(module, exports) { - -module.exports = function () { - // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi - var origPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = function (_, stack) { return stack; }; - var stack = (new Error()).stack; - Error.prepareStackTrace = origPrepareStackTrace; - return stack[2].getFileName(); -}; - - -/***/ }), -/* 388 */ -/***/ (function(module, exports, __webpack_require__) { - -var path = __webpack_require__(1); -var fs = __webpack_require__(12); -var parse = path.parse || __webpack_require__(846); - -module.exports = function nodeModulesPaths(start, opts) { - var modules = opts && opts.moduleDirectory - ? [].concat(opts.moduleDirectory) - : ['node_modules']; - - // ensure that `start` is an absolute path at this point, - // resolving against the process' current working directory - var absoluteStart = path.resolve(start); - - if (opts && opts.preserveSymlinks === false) { - try { - absoluteStart = fs.realpathSync(absoluteStart); - } catch (err) { - if (err.code !== 'ENOENT') { - throw err; - } - } - } - - var prefix = '/'; - if (/^([A-Za-z]:)/.test(absoluteStart)) { - prefix = ''; - } else if (/^\\\\/.test(absoluteStart)) { - prefix = '\\\\'; - } - - var paths = [absoluteStart]; - var parsed = parse(absoluteStart); - while (parsed.dir !== paths[paths.length - 1]) { - paths.push(parsed.dir); - parsed = parse(parsed.dir); - } - - var dirs = paths.reduce(function (dirs, aPath) { - return dirs.concat(modules.map(function (moduleDir) { - return path.join(prefix, aPath, moduleDir); - })); - }, []); - - return opts && opts.paths ? dirs.concat(opts.paths) : dirs; -}; - - -/***/ }), -/* 389 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BehaviorSubject; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ObjectUnsubscribedError__ = __webpack_require__(179); -/** PURE_IMPORTS_START tslib,_Subject,_util_ObjectUnsubscribedError PURE_IMPORTS_END */ - - - -var BehaviorSubject = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BehaviorSubject, _super); - function BehaviorSubject(_value) { - var _this = _super.call(this) || this; - _this._value = _value; - return _this; - } - Object.defineProperty(BehaviorSubject.prototype, "value", { - get: function () { - return this.getValue(); - }, - enumerable: true, - configurable: true - }); - BehaviorSubject.prototype._subscribe = function (subscriber) { - var subscription = _super.prototype._subscribe.call(this, subscriber); - if (subscription && !subscription.closed) { - subscriber.next(this._value); - } - return subscription; - }; - BehaviorSubject.prototype.getValue = function () { - if (this.hasError) { - throw this.thrownError; - } - else if (this.closed) { - throw new __WEBPACK_IMPORTED_MODULE_2__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); - } - else { - return this._value; - } - }; - BehaviorSubject.prototype.next = function (value) { - _super.prototype.next.call(this, this._value = value); - }; - return BehaviorSubject; -}(__WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */])); - -//# sourceMappingURL=BehaviorSubject.js.map - - -/***/ }), -/* 390 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return empty; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__config__ = __webpack_require__(175); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_hostReportError__ = __webpack_require__(263); -/** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */ - - -var empty = { - closed: true, - next: function (value) { }, - error: function (err) { - if (__WEBPACK_IMPORTED_MODULE_0__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { - throw err; - } - else { - __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_hostReportError__["a" /* hostReportError */])(err); - } - }, - complete: function () { } -}; -//# sourceMappingURL=Observer.js.map - - -/***/ }), -/* 391 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Scheduler; }); -var Scheduler = /*@__PURE__*/ (function () { - function Scheduler(SchedulerAction, now) { - if (now === void 0) { - now = Scheduler.now; - } - this.SchedulerAction = SchedulerAction; - this.now = now; - } - Scheduler.prototype.schedule = function (work, delay, state) { - if (delay === void 0) { - delay = 0; - } - return new this.SchedulerAction(this, work).schedule(state, delay); - }; - Scheduler.now = function () { return Date.now(); }; - return Scheduler; -}()); - -//# sourceMappingURL=Scheduler.js.map - - -/***/ }), -/* 392 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SubjectSubscription; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31); -/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */ - - -var SubjectSubscription = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubjectSubscription, _super); - function SubjectSubscription(subject, subscriber) { - var _this = _super.call(this) || this; - _this.subject = subject; - _this.subscriber = subscriber; - _this.closed = false; - return _this; - } - SubjectSubscription.prototype.unsubscribe = function () { - if (this.closed) { - return; - } - this.closed = true; - var subject = this.subject; - var observers = subject.observers; - this.subject = null; - if (!observers || observers.length === 0 || subject.isStopped || subject.closed) { - return; - } - var subscriberIndex = observers.indexOf(this.subscriber); - if (subscriberIndex !== -1) { - observers.splice(subscriberIndex, 1); - } - }; - return SubjectSubscription; -}(__WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */])); - -//# sourceMappingURL=SubjectSubscription.js.map - - -/***/ }), -/* 393 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ConnectableObservable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return connectableObservableDescriptor; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observable__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscriber__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Subscription__ = __webpack_require__(31); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__operators_refCount__ = __webpack_require__(256); -/** PURE_IMPORTS_START tslib,_Subject,_Observable,_Subscriber,_Subscription,_operators_refCount PURE_IMPORTS_END */ - - - - - - -var ConnectableObservable = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ConnectableObservable, _super); - function ConnectableObservable(source, subjectFactory) { - var _this = _super.call(this) || this; - _this.source = source; - _this.subjectFactory = subjectFactory; - _this._refCount = 0; - _this._isComplete = false; - return _this; - } - ConnectableObservable.prototype._subscribe = function (subscriber) { - return this.getSubject().subscribe(subscriber); - }; - ConnectableObservable.prototype.getSubject = function () { - var subject = this._subject; - if (!subject || subject.isStopped) { - this._subject = this.subjectFactory(); - } - return this._subject; - }; - ConnectableObservable.prototype.connect = function () { - var connection = this._connection; - if (!connection) { - this._isComplete = false; - connection = this._connection = new __WEBPACK_IMPORTED_MODULE_4__Subscription__["a" /* Subscription */](); - connection.add(this.source - .subscribe(new ConnectableSubscriber(this.getSubject(), this))); - if (connection.closed) { - this._connection = null; - connection = __WEBPACK_IMPORTED_MODULE_4__Subscription__["a" /* Subscription */].EMPTY; - } - else { - this._connection = connection; - } - } - return connection; - }; - ConnectableObservable.prototype.refCount = function () { - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__operators_refCount__["a" /* refCount */])()(this); - }; - return ConnectableObservable; -}(__WEBPACK_IMPORTED_MODULE_2__Observable__["a" /* Observable */])); - -var connectableProto = ConnectableObservable.prototype; -var connectableObservableDescriptor = { - operator: { value: null }, - _refCount: { value: 0, writable: true }, - _subject: { value: null, writable: true }, - _connection: { value: null, writable: true }, - _subscribe: { value: connectableProto._subscribe }, - _isComplete: { value: connectableProto._isComplete, writable: true }, - getSubject: { value: connectableProto.getSubject }, - connect: { value: connectableProto.connect }, - refCount: { value: connectableProto.refCount } -}; -var ConnectableSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ConnectableSubscriber, _super); - function ConnectableSubscriber(destination, connectable) { - var _this = _super.call(this, destination) || this; - _this.connectable = connectable; - return _this; - } - ConnectableSubscriber.prototype._error = function (err) { - this._unsubscribe(); - _super.prototype._error.call(this, err); - }; - ConnectableSubscriber.prototype._complete = function () { - this.connectable._isComplete = true; - this._unsubscribe(); - _super.prototype._complete.call(this); - }; - ConnectableSubscriber.prototype._unsubscribe = function () { - var connectable = this.connectable; - if (connectable) { - this.connectable = null; - var connection = connectable._connection; - connectable._refCount = 0; - connectable._subject = null; - connectable._connection = null; - if (connection) { - connection.unsubscribe(); - } - } - }; - return ConnectableSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subject__["b" /* SubjectSubscriber */])); -var RefCountOperator = /*@__PURE__*/ (function () { - function RefCountOperator(connectable) { - this.connectable = connectable; - } - RefCountOperator.prototype.call = function (subscriber, source) { - var connectable = this.connectable; - connectable._refCount++; - var refCounter = new RefCountSubscriber(subscriber, connectable); - var subscription = source.subscribe(refCounter); - if (!refCounter.closed) { - refCounter.connection = connectable.connect(); - } - return subscription; - }; - return RefCountOperator; -}()); -var RefCountSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RefCountSubscriber, _super); - function RefCountSubscriber(destination, connectable) { - var _this = _super.call(this, destination) || this; - _this.connectable = connectable; - return _this; - } - RefCountSubscriber.prototype._unsubscribe = function () { - var connectable = this.connectable; - if (!connectable) { - this.connection = null; - return; - } - this.connectable = null; - var refCount = connectable._refCount; - if (refCount <= 0) { - this.connection = null; - return; - } - connectable._refCount = refCount - 1; - if (refCount > 1) { - this.connection = null; - return; - } - var connection = this.connection; - var sharedConnection = connectable._connection; - this.connection = null; - if (sharedConnection && (!connection || sharedConnection === connection)) { - sharedConnection.unsubscribe(); - } - }; - return RefCountSubscriber; -}(__WEBPACK_IMPORTED_MODULE_3__Subscriber__["a" /* Subscriber */])); -//# sourceMappingURL=ConnectableObservable.js.map - - -/***/ }), -/* 394 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = merge; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isScheduler__ = __webpack_require__(56); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__operators_mergeAll__ = __webpack_require__(255); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__fromArray__ = __webpack_require__(81); -/** PURE_IMPORTS_START _Observable,_util_isScheduler,_operators_mergeAll,_fromArray PURE_IMPORTS_END */ - - - - -function merge() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i] = arguments[_i]; - } - var concurrent = Number.POSITIVE_INFINITY; - var scheduler = null; - var last = observables[observables.length - 1]; - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isScheduler__["a" /* isScheduler */])(last)) { - scheduler = observables.pop(); - if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') { - concurrent = observables.pop(); - } - } - else if (typeof last === 'number') { - concurrent = observables.pop(); - } - if (scheduler === null && observables.length === 1 && observables[0] instanceof __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */]) { - return observables[0]; - } - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__operators_mergeAll__["a" /* mergeAll */])(concurrent)(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__fromArray__["a" /* fromArray */])(observables, scheduler)); -} -//# sourceMappingURL=merge.js.map - - -/***/ }), -/* 395 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return NEVER; }); -/* harmony export (immutable) */ __webpack_exports__["a"] = never; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_noop__ = __webpack_require__(181); -/** PURE_IMPORTS_START _Observable,_util_noop PURE_IMPORTS_END */ - - -var NEVER = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__WEBPACK_IMPORTED_MODULE_1__util_noop__["a" /* noop */]); -function never() { - return NEVER; -} -//# sourceMappingURL=never.js.map - - -/***/ }), -/* 396 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = race; -/* unused harmony export RaceOperator */ -/* unused harmony export RaceSubscriber */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isArray__ = __webpack_require__(48); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__fromArray__ = __webpack_require__(81); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19); -/** PURE_IMPORTS_START tslib,_util_isArray,_fromArray,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ - - - - - -function race() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i] = arguments[_i]; - } - if (observables.length === 1) { - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isArray__["a" /* isArray */])(observables[0])) { - observables = observables[0]; - } - else { - return observables[0]; - } - } - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__fromArray__["a" /* fromArray */])(observables, undefined).lift(new RaceOperator()); -} -var RaceOperator = /*@__PURE__*/ (function () { - function RaceOperator() { - } - RaceOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new RaceSubscriber(subscriber)); - }; - return RaceOperator; -}()); - -var RaceSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RaceSubscriber, _super); - function RaceSubscriber(destination) { - var _this = _super.call(this, destination) || this; - _this.hasFirst = false; - _this.observables = []; - _this.subscriptions = []; - return _this; - } - RaceSubscriber.prototype._next = function (observable) { - this.observables.push(observable); - }; - RaceSubscriber.prototype._complete = function () { - var observables = this.observables; - var len = observables.length; - if (len === 0) { - this.destination.complete(); - } - else { - for (var i = 0; i < len && !this.hasFirst; i++) { - var observable = observables[i]; - var subscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, observable, observable, i); - if (this.subscriptions) { - this.subscriptions.push(subscription); + catch (err0) { + switch (err0.code) { + case 'ENOENT' : + made = sync(path.dirname(p), opts, made); + sync(p, opts, made); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + var stat; + try { + stat = xfs.statSync(p); } - this.add(subscription); - } - this.observables = null; - } - }; - RaceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { - if (!this.hasFirst) { - this.hasFirst = true; - for (var i = 0; i < this.subscriptions.length; i++) { - if (i !== outerIndex) { - var subscription = this.subscriptions[i]; - subscription.unsubscribe(); - this.remove(subscription); + catch (err1) { + throw err0; } - } - this.subscriptions = null; + if (!stat.isDirectory()) throw err0; + break; } - this.destination.next(innerValue); - }; - return RaceSubscriber; -}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */])); + } -//# sourceMappingURL=race.js.map + return made; +}; /***/ }), -/* 397 */ +/* 146 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = timer; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(47); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isNumeric__ = __webpack_require__(180); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isScheduler__ = __webpack_require__(56); -/** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */ - - - - -function timer(dueTime, periodOrScheduler, scheduler) { - if (dueTime === void 0) { - dueTime = 0; - } - var period = -1; - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isNumeric__["a" /* isNumeric */])(periodOrScheduler)) { - period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler); - } - else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isScheduler__["a" /* isScheduler */])(periodOrScheduler)) { - scheduler = periodOrScheduler; - } - if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isScheduler__["a" /* isScheduler */])(scheduler)) { - scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */]; - } - return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { - var due = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isNumeric__["a" /* isNumeric */])(dueTime) - ? dueTime - : (+dueTime - scheduler.now()); - return scheduler.schedule(dispatch, due, { - index: 0, period: period, subscriber: subscriber - }); - }); -} -function dispatch(state) { - var index = state.index, period = state.period, subscriber = state.subscriber; - subscriber.next(index); - if (subscriber.closed) { - return; - } - else if (period === -1) { - return subscriber.complete(); - } - state.index = index + 1; - this.schedule(state, period); -} -//# sourceMappingURL=timer.js.map - - -/***/ }), -/* 398 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = audit; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_tryCatch__ = __webpack_require__(58); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_errorObject__ = __webpack_require__(55); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19); -/** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ - - - - - -function audit(durationSelector) { - return function auditOperatorFunction(source) { - return source.lift(new AuditOperator(durationSelector)); - }; -} -var AuditOperator = /*@__PURE__*/ (function () { - function AuditOperator(durationSelector) { - this.durationSelector = durationSelector; - } - AuditOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector)); - }; - return AuditOperator; -}()); -var AuditSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AuditSubscriber, _super); - function AuditSubscriber(destination, durationSelector) { - var _this = _super.call(this, destination) || this; - _this.durationSelector = durationSelector; - _this.hasValue = false; - return _this; - } - AuditSubscriber.prototype._next = function (value) { - this.value = value; - this.hasValue = true; - if (!this.throttled) { - var duration = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_tryCatch__["a" /* tryCatch */])(this.durationSelector)(value); - if (duration === __WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */]) { - this.destination.error(__WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */].e); - } - else { - var innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, duration); - if (!innerSubscription || innerSubscription.closed) { - this.clearThrottle(); - } - else { - this.add(this.throttled = innerSubscription); - } - } - } - }; - AuditSubscriber.prototype.clearThrottle = function () { - var _a = this, value = _a.value, hasValue = _a.hasValue, throttled = _a.throttled; - if (throttled) { - this.remove(throttled); - this.throttled = null; - throttled.unsubscribe(); - } - if (hasValue) { - this.value = null; - this.hasValue = false; - this.destination.next(value); - } - }; - AuditSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) { - this.clearThrottle(); - }; - AuditSubscriber.prototype.notifyComplete = function () { - this.clearThrottle(); - }; - return AuditSubscriber; -}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */])); -//# sourceMappingURL=audit.js.map - - -/***/ }), -/* 399 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = concatAll; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mergeAll__ = __webpack_require__(255); -/** PURE_IMPORTS_START _mergeAll PURE_IMPORTS_END */ - -function concatAll() { - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeAll__["a" /* mergeAll */])(1); -} -//# sourceMappingURL=concatAll.js.map - - -/***/ }), -/* 400 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = concatMap; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mergeMap__ = __webpack_require__(136); -/** PURE_IMPORTS_START _mergeMap PURE_IMPORTS_END */ - -function concatMap(project, resultSelector) { - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeMap__["a" /* mergeMap */])(project, resultSelector, 1); -} -//# sourceMappingURL=concatMap.js.map - - -/***/ }), -/* 401 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = distinctUntilChanged; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(58); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(55); -/** PURE_IMPORTS_START tslib,_Subscriber,_util_tryCatch,_util_errorObject PURE_IMPORTS_END */ - - - - -function distinctUntilChanged(compare, keySelector) { - return function (source) { return source.lift(new DistinctUntilChangedOperator(compare, keySelector)); }; -} -var DistinctUntilChangedOperator = /*@__PURE__*/ (function () { - function DistinctUntilChangedOperator(compare, keySelector) { - this.compare = compare; - this.keySelector = keySelector; - } - DistinctUntilChangedOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector)); - }; - return DistinctUntilChangedOperator; -}()); -var DistinctUntilChangedSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DistinctUntilChangedSubscriber, _super); - function DistinctUntilChangedSubscriber(destination, compare, keySelector) { - var _this = _super.call(this, destination) || this; - _this.keySelector = keySelector; - _this.hasKey = false; - if (typeof compare === 'function') { - _this.compare = compare; - } - return _this; - } - DistinctUntilChangedSubscriber.prototype.compare = function (x, y) { - return x === y; - }; - DistinctUntilChangedSubscriber.prototype._next = function (value) { - var keySelector = this.keySelector; - var key = value; - if (keySelector) { - key = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.keySelector)(value); - if (key === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) { - return this.destination.error(__WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e); - } - } - var result = false; - if (this.hasKey) { - result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.compare)(this.key, key); - if (result === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) { - return this.destination.error(__WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e); - } - } - else { - this.hasKey = true; - } - if (Boolean(result) === false) { - this.key = key; - this.destination.next(value); - } - }; - return DistinctUntilChangedSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); -//# sourceMappingURL=distinctUntilChanged.js.map - - -/***/ }), -/* 402 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = find; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return FindValueOperator; }); -/* unused harmony export FindValueSubscriber */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); +/* harmony export (immutable) */ __webpack_exports__["a"] = defaultIfEmpty; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ -function find(predicate, thisArg) { - if (typeof predicate !== 'function') { - throw new TypeError('predicate is not a function'); +function defaultIfEmpty(defaultValue) { + if (defaultValue === void 0) { + defaultValue = null; } - return function (source) { return source.lift(new FindValueOperator(predicate, source, false, thisArg)); }; + return function (source) { return source.lift(new DefaultIfEmptyOperator(defaultValue)); }; } -var FindValueOperator = /*@__PURE__*/ (function () { - function FindValueOperator(predicate, source, yieldIndex, thisArg) { - this.predicate = predicate; - this.source = source; - this.yieldIndex = yieldIndex; - this.thisArg = thisArg; +var DefaultIfEmptyOperator = /*@__PURE__*/ (function () { + function DefaultIfEmptyOperator(defaultValue) { + this.defaultValue = defaultValue; } - FindValueOperator.prototype.call = function (observer, source) { - return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg)); + DefaultIfEmptyOperator.prototype.call = function (subscriber, source) { + return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue)); }; - return FindValueOperator; + return DefaultIfEmptyOperator; }()); - -var FindValueSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](FindValueSubscriber, _super); - function FindValueSubscriber(destination, predicate, source, yieldIndex, thisArg) { +var DefaultIfEmptySubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DefaultIfEmptySubscriber, _super); + function DefaultIfEmptySubscriber(destination, defaultValue) { var _this = _super.call(this, destination) || this; - _this.predicate = predicate; - _this.source = source; - _this.yieldIndex = yieldIndex; - _this.thisArg = thisArg; - _this.index = 0; + _this.defaultValue = defaultValue; + _this.isEmpty = true; return _this; } - FindValueSubscriber.prototype.notifyComplete = function (value) { - var destination = this.destination; - destination.next(value); - destination.complete(); - this.unsubscribe(); + DefaultIfEmptySubscriber.prototype._next = function (value) { + this.isEmpty = false; + this.destination.next(value); }; - FindValueSubscriber.prototype._next = function (value) { - var _a = this, predicate = _a.predicate, thisArg = _a.thisArg; - var index = this.index++; - try { - var result = predicate.call(thisArg || this, value, index, this.source); - if (result) { - this.notifyComplete(this.yieldIndex ? index : value); - } - } - catch (err) { - this.destination.error(err); - } - }; - FindValueSubscriber.prototype._complete = function () { - this.notifyComplete(this.yieldIndex ? -1 : undefined); - }; - return FindValueSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); - -//# sourceMappingURL=find.js.map - - -/***/ }), -/* 403 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["b"] = groupBy; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupedObservable; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(31); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Observable__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Subject__ = __webpack_require__(43); -/** PURE_IMPORTS_START tslib,_Subscriber,_Subscription,_Observable,_Subject PURE_IMPORTS_END */ - - - - - -function groupBy(keySelector, elementSelector, durationSelector, subjectSelector) { - return function (source) { - return source.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector)); - }; -} -var GroupByOperator = /*@__PURE__*/ (function () { - function GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector) { - this.keySelector = keySelector; - this.elementSelector = elementSelector; - this.durationSelector = durationSelector; - this.subjectSelector = subjectSelector; - } - GroupByOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector)); - }; - return GroupByOperator; -}()); -var GroupBySubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](GroupBySubscriber, _super); - function GroupBySubscriber(destination, keySelector, elementSelector, durationSelector, subjectSelector) { - var _this = _super.call(this, destination) || this; - _this.keySelector = keySelector; - _this.elementSelector = elementSelector; - _this.durationSelector = durationSelector; - _this.subjectSelector = subjectSelector; - _this.groups = null; - _this.attemptedToUnsubscribe = false; - _this.count = 0; - return _this; - } - GroupBySubscriber.prototype._next = function (value) { - var key; - try { - key = this.keySelector(value); - } - catch (err) { - this.error(err); - return; - } - this._group(value, key); - }; - GroupBySubscriber.prototype._group = function (value, key) { - var groups = this.groups; - if (!groups) { - groups = this.groups = new Map(); - } - var group = groups.get(key); - var element; - if (this.elementSelector) { - try { - element = this.elementSelector(value); - } - catch (err) { - this.error(err); - } - } - else { - element = value; - } - if (!group) { - group = (this.subjectSelector ? this.subjectSelector() : new __WEBPACK_IMPORTED_MODULE_4__Subject__["a" /* Subject */]()); - groups.set(key, group); - var groupedObservable = new GroupedObservable(key, group, this); - this.destination.next(groupedObservable); - if (this.durationSelector) { - var duration = void 0; - try { - duration = this.durationSelector(new GroupedObservable(key, group)); - } - catch (err) { - this.error(err); - return; - } - this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this))); - } - } - if (!group.closed) { - group.next(element); - } - }; - GroupBySubscriber.prototype._error = function (err) { - var groups = this.groups; - if (groups) { - groups.forEach(function (group, key) { - group.error(err); - }); - groups.clear(); - } - this.destination.error(err); - }; - GroupBySubscriber.prototype._complete = function () { - var groups = this.groups; - if (groups) { - groups.forEach(function (group, key) { - group.complete(); - }); - groups.clear(); + DefaultIfEmptySubscriber.prototype._complete = function () { + if (this.isEmpty) { + this.destination.next(this.defaultValue); } this.destination.complete(); }; - GroupBySubscriber.prototype.removeGroup = function (key) { - this.groups.delete(key); - }; - GroupBySubscriber.prototype.unsubscribe = function () { - if (!this.closed) { - this.attemptedToUnsubscribe = true; - if (this.count === 0) { - _super.prototype.unsubscribe.call(this); - } - } - }; - return GroupBySubscriber; + return DefaultIfEmptySubscriber; }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); -var GroupDurationSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](GroupDurationSubscriber, _super); - function GroupDurationSubscriber(key, group, parent) { - var _this = _super.call(this, group) || this; - _this.key = key; - _this.group = group; - _this.parent = parent; - return _this; - } - GroupDurationSubscriber.prototype._next = function (value) { - this.complete(); - }; - GroupDurationSubscriber.prototype._unsubscribe = function () { - var _a = this, parent = _a.parent, key = _a.key; - this.key = this.parent = null; - if (parent) { - parent.removeGroup(key); - } - }; - return GroupDurationSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); -var GroupedObservable = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](GroupedObservable, _super); - function GroupedObservable(key, groupSubject, refCountSubscription) { - var _this = _super.call(this) || this; - _this.key = key; - _this.groupSubject = groupSubject; - _this.refCountSubscription = refCountSubscription; - return _this; - } - GroupedObservable.prototype._subscribe = function (subscriber) { - var subscription = new __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */](); - var _a = this, refCountSubscription = _a.refCountSubscription, groupSubject = _a.groupSubject; - if (refCountSubscription && !refCountSubscription.closed) { - subscription.add(new InnerRefCountSubscription(refCountSubscription)); - } - subscription.add(groupSubject.subscribe(subscriber)); - return subscription; - }; - return GroupedObservable; -}(__WEBPACK_IMPORTED_MODULE_3__Observable__["a" /* Observable */])); - -var InnerRefCountSubscription = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](InnerRefCountSubscription, _super); - function InnerRefCountSubscription(parent) { - var _this = _super.call(this) || this; - _this.parent = parent; - parent.count++; - return _this; - } - InnerRefCountSubscription.prototype.unsubscribe = function () { - var parent = this.parent; - if (!parent.closed && !this.closed) { - _super.prototype.unsubscribe.call(this); - parent.count -= 1; - if (parent.count === 0 && parent.attemptedToUnsubscribe) { - parent.unsubscribe(); - } - } - }; - return InnerRefCountSubscription; -}(__WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */])); -//# sourceMappingURL=groupBy.js.map +//# sourceMappingURL=defaultIfEmpty.js.map /***/ }), -/* 404 */ +/* 147 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony export (immutable) */ __webpack_exports__["b"] = observeOn; -/* unused harmony export ObserveOnOperator */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ObserveOnSubscriber; }); -/* unused harmony export ObserveOnMessage */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Notification__ = __webpack_require__(174); -/** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */ +/* harmony export (immutable) */ __webpack_exports__["a"] = filter; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ - -function observeOn(scheduler, delay) { - if (delay === void 0) { - delay = 0; - } - return function observeOnOperatorFunction(source) { - return source.lift(new ObserveOnOperator(scheduler, delay)); +function filter(predicate, thisArg) { + return function filterOperatorFunction(source) { + return source.lift(new FilterOperator(predicate, thisArg)); }; } -var ObserveOnOperator = /*@__PURE__*/ (function () { - function ObserveOnOperator(scheduler, delay) { - if (delay === void 0) { - delay = 0; - } - this.scheduler = scheduler; - this.delay = delay; +var FilterOperator = /*@__PURE__*/ (function () { + function FilterOperator(predicate, thisArg) { + this.predicate = predicate; + this.thisArg = thisArg; } - ObserveOnOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay)); + FilterOperator.prototype.call = function (subscriber, source) { + return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg)); }; - return ObserveOnOperator; + return FilterOperator; }()); - -var ObserveOnSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ObserveOnSubscriber, _super); - function ObserveOnSubscriber(destination, scheduler, delay) { - if (delay === void 0) { - delay = 0; - } +var FilterSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](FilterSubscriber, _super); + function FilterSubscriber(destination, predicate, thisArg) { var _this = _super.call(this, destination) || this; - _this.scheduler = scheduler; - _this.delay = delay; + _this.predicate = predicate; + _this.thisArg = thisArg; + _this.count = 0; return _this; } - ObserveOnSubscriber.dispatch = function (arg) { - var notification = arg.notification, destination = arg.destination; - notification.observe(destination); - this.unsubscribe(); + FilterSubscriber.prototype._next = function (value) { + var result; + try { + result = this.predicate.call(this.thisArg, value, this.count++); + } + catch (err) { + this.destination.error(err); + return; + } + if (result) { + this.destination.next(value); + } }; - ObserveOnSubscriber.prototype.scheduleMessage = function (notification) { + return FilterSubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=filter.js.map + + +/***/ }), +/* 148 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = mergeMap; +/* unused harmony export MergeMapOperator */ +/* unused harmony export MergeMapSubscriber */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_subscribeToResult__ = __webpack_require__(14); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__InnerSubscriber__ = __webpack_require__(84); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map__ = __webpack_require__(46); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__observable_from__ = __webpack_require__(62); +/** PURE_IMPORTS_START tslib,_util_subscribeToResult,_OuterSubscriber,_InnerSubscriber,_map,_observable_from PURE_IMPORTS_END */ + + + + + + +function mergeMap(project, resultSelector, concurrent) { + if (concurrent === void 0) { + concurrent = Number.POSITIVE_INFINITY; + } + if (typeof resultSelector === 'function') { + return function (source) { return source.pipe(mergeMap(function (a, i) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__observable_from__["a" /* from */])(project(a, i)).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__map__["a" /* map */])(function (b, ii) { return resultSelector(a, b, i, ii); })); }, concurrent)); }; + } + else if (typeof resultSelector === 'number') { + concurrent = resultSelector; + } + return function (source) { return source.lift(new MergeMapOperator(project, concurrent)); }; +} +var MergeMapOperator = /*@__PURE__*/ (function () { + function MergeMapOperator(project, concurrent) { + if (concurrent === void 0) { + concurrent = Number.POSITIVE_INFINITY; + } + this.project = project; + this.concurrent = concurrent; + } + MergeMapOperator.prototype.call = function (observer, source) { + return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent)); + }; + return MergeMapOperator; +}()); + +var MergeMapSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MergeMapSubscriber, _super); + function MergeMapSubscriber(destination, project, concurrent) { + if (concurrent === void 0) { + concurrent = Number.POSITIVE_INFINITY; + } + var _this = _super.call(this, destination) || this; + _this.project = project; + _this.concurrent = concurrent; + _this.hasCompleted = false; + _this.buffer = []; + _this.active = 0; + _this.index = 0; + return _this; + } + MergeMapSubscriber.prototype._next = function (value) { + if (this.active < this.concurrent) { + this._tryNext(value); + } + else { + this.buffer.push(value); + } + }; + MergeMapSubscriber.prototype._tryNext = function (value) { + var result; + var index = this.index++; + try { + result = this.project(value, index); + } + catch (err) { + this.destination.error(err); + return; + } + this.active++; + this._innerSub(result, value, index); + }; + MergeMapSubscriber.prototype._innerSub = function (ish, value, index) { + var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_3__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined); var destination = this.destination; - destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination))); + destination.add(innerSubscriber); + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_subscribeToResult__["a" /* subscribeToResult */])(this, ish, value, index, innerSubscriber); }; - ObserveOnSubscriber.prototype._next = function (value) { - this.scheduleMessage(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createNext(value)); - }; - ObserveOnSubscriber.prototype._error = function (err) { - this.scheduleMessage(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createError(err)); + MergeMapSubscriber.prototype._complete = function () { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } this.unsubscribe(); }; - ObserveOnSubscriber.prototype._complete = function () { - this.scheduleMessage(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createComplete()); - this.unsubscribe(); + MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { + this.destination.next(innerValue); }; - return ObserveOnSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); + MergeMapSubscriber.prototype.notifyComplete = function (innerSub) { + var buffer = this.buffer; + this.remove(innerSub); + this.active--; + if (buffer.length > 0) { + this._next(buffer.shift()); + } + else if (this.active === 0 && this.hasCompleted) { + this.destination.complete(); + } + }; + return MergeMapSubscriber; +}(__WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__["a" /* OuterSubscriber */])); -var ObserveOnMessage = /*@__PURE__*/ (function () { - function ObserveOnMessage(notification, destination) { - this.notification = notification; - this.destination = destination; - } - return ObserveOnMessage; -}()); - -//# sourceMappingURL=observeOn.js.map +//# sourceMappingURL=mergeMap.js.map /***/ }), -/* 405 */ +/* 149 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = tap; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_noop__ = __webpack_require__(181); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isFunction__ = __webpack_require__(142); -/** PURE_IMPORTS_START tslib,_Subscriber,_util_noop,_util_isFunction PURE_IMPORTS_END */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncAction; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Action__ = __webpack_require__(918); +/** PURE_IMPORTS_START tslib,_Action PURE_IMPORTS_END */ - - -function tap(nextOrObserver, error, complete) { - return function tapOperatorFunction(source) { - return source.lift(new DoOperator(nextOrObserver, error, complete)); - }; -} -var DoOperator = /*@__PURE__*/ (function () { - function DoOperator(nextOrObserver, error, complete) { - this.nextOrObserver = nextOrObserver; - this.error = error; - this.complete = complete; - } - DoOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete)); - }; - return DoOperator; -}()); -var TapSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TapSubscriber, _super); - function TapSubscriber(destination, observerOrNext, error, complete) { - var _this = _super.call(this, destination) || this; - _this._tapNext = __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */]; - _this._tapError = __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */]; - _this._tapComplete = __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */]; - _this._tapError = error || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */]; - _this._tapComplete = complete || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */]; - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isFunction__["a" /* isFunction */])(observerOrNext)) { - _this._context = _this; - _this._tapNext = observerOrNext; - } - else if (observerOrNext) { - _this._context = observerOrNext; - _this._tapNext = observerOrNext.next || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */]; - _this._tapError = observerOrNext.error || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */]; - _this._tapComplete = observerOrNext.complete || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */]; - } - return _this; - } - TapSubscriber.prototype._next = function (value) { - try { - this._tapNext.call(this._context, value); - } - catch (err) { - this.destination.error(err); - return; - } - this.destination.next(value); - }; - TapSubscriber.prototype._error = function (err) { - try { - this._tapError.call(this._context, err); - } - catch (err) { - this.destination.error(err); - return; - } - this.destination.error(err); - }; - TapSubscriber.prototype._complete = function () { - try { - this._tapComplete.call(this._context); - } - catch (err) { - this.destination.error(err); - return; - } - return this.destination.complete(); - }; - return TapSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); -//# sourceMappingURL=tap.js.map - - -/***/ }), -/* 406 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return defaultThrottleConfig; }); -/* harmony export (immutable) */ __webpack_exports__["a"] = throttle; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19); -/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ - - - -var defaultThrottleConfig = { - leading: true, - trailing: false -}; -function throttle(durationSelector, config) { - if (config === void 0) { - config = defaultThrottleConfig; - } - return function (source) { return source.lift(new ThrottleOperator(durationSelector, config.leading, config.trailing)); }; -} -var ThrottleOperator = /*@__PURE__*/ (function () { - function ThrottleOperator(durationSelector, leading, trailing) { - this.durationSelector = durationSelector; - this.leading = leading; - this.trailing = trailing; - } - ThrottleOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing)); - }; - return ThrottleOperator; -}()); -var ThrottleSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ThrottleSubscriber, _super); - function ThrottleSubscriber(destination, durationSelector, _leading, _trailing) { - var _this = _super.call(this, destination) || this; - _this.destination = destination; - _this.durationSelector = durationSelector; - _this._leading = _leading; - _this._trailing = _trailing; - _this._hasValue = false; - return _this; - } - ThrottleSubscriber.prototype._next = function (value) { - this._hasValue = true; - this._sendValue = value; - if (!this._throttled) { - if (this._leading) { - this.send(); - } - else { - this.throttle(value); - } - } - }; - ThrottleSubscriber.prototype.send = function () { - var _a = this, _hasValue = _a._hasValue, _sendValue = _a._sendValue; - if (_hasValue) { - this.destination.next(_sendValue); - this.throttle(_sendValue); - } - this._hasValue = false; - this._sendValue = null; - }; - ThrottleSubscriber.prototype.throttle = function (value) { - var duration = this.tryDurationSelector(value); - if (duration) { - this.add(this._throttled = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(this, duration)); - } - }; - ThrottleSubscriber.prototype.tryDurationSelector = function (value) { - try { - return this.durationSelector(value); - } - catch (err) { - this.destination.error(err); - return null; - } - }; - ThrottleSubscriber.prototype.throttlingDone = function () { - var _a = this, _throttled = _a._throttled, _trailing = _a._trailing; - if (_throttled) { - _throttled.unsubscribe(); - } - this._throttled = null; - if (_trailing) { - this.send(); - } - }; - ThrottleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.throttlingDone(); - }; - ThrottleSubscriber.prototype.notifyComplete = function () { - this.throttlingDone(); - }; - return ThrottleSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */])); -//# sourceMappingURL=throttle.js.map - - -/***/ }), -/* 407 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = timeoutWith; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(47); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isDate__ = __webpack_require__(413); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19); -/** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ - - - - - -function timeoutWith(due, withObservable, scheduler) { - if (scheduler === void 0) { - scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */]; - } - return function (source) { - var absoluteTimeout = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isDate__["a" /* isDate */])(due); - var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due); - return source.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler)); - }; -} -var TimeoutWithOperator = /*@__PURE__*/ (function () { - function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) { - this.waitFor = waitFor; - this.absoluteTimeout = absoluteTimeout; - this.withObservable = withObservable; - this.scheduler = scheduler; - } - TimeoutWithOperator.prototype.call = function (subscriber, source) { - return source.subscribe(new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler)); - }; - return TimeoutWithOperator; -}()); -var TimeoutWithSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TimeoutWithSubscriber, _super); - function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) { - var _this = _super.call(this, destination) || this; - _this.absoluteTimeout = absoluteTimeout; - _this.waitFor = waitFor; - _this.withObservable = withObservable; +var AsyncAction = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsyncAction, _super); + function AsyncAction(scheduler, work) { + var _this = _super.call(this, scheduler, work) || this; _this.scheduler = scheduler; - _this.action = null; - _this.scheduleTimeout(); + _this.work = work; + _this.pending = false; return _this; } - TimeoutWithSubscriber.dispatchTimeout = function (subscriber) { - var withObservable = subscriber.withObservable; - subscriber._unsubscribeAndRecycle(); - subscriber.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(subscriber, withObservable)); - }; - TimeoutWithSubscriber.prototype.scheduleTimeout = function () { - var action = this.action; - if (action) { - this.action = action.schedule(this, this.waitFor); + AsyncAction.prototype.schedule = function (state, delay) { + if (delay === void 0) { + delay = 0; } - else { - this.add(this.action = this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, this)); + if (this.closed) { + return this; + } + this.state = state; + var id = this.id; + var scheduler = this.scheduler; + if (id != null) { + this.id = this.recycleAsyncId(scheduler, id, delay); + } + this.pending = true; + this.delay = delay; + this.id = this.id || this.requestAsyncId(scheduler, this.id, delay); + return this; + }; + AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) { + if (delay === void 0) { + delay = 0; + } + return setInterval(scheduler.flush.bind(scheduler, this), delay); + }; + AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) { + if (delay === void 0) { + delay = 0; + } + if (delay !== null && this.delay === delay && this.pending === false) { + return id; + } + clearInterval(id); + }; + AsyncAction.prototype.execute = function (state, delay) { + if (this.closed) { + return new Error('executing a cancelled action'); + } + this.pending = false; + var error = this._execute(state, delay); + if (error) { + return error; + } + else if (this.pending === false && this.id != null) { + this.id = this.recycleAsyncId(this.scheduler, this.id, null); } }; - TimeoutWithSubscriber.prototype._next = function (value) { - if (!this.absoluteTimeout) { - this.scheduleTimeout(); + AsyncAction.prototype._execute = function (state, delay) { + var errored = false; + var errorValue = undefined; + try { + this.work(state); + } + catch (e) { + errored = true; + errorValue = !!e && e || new Error(e); + } + if (errored) { + this.unsubscribe(); + return errorValue; } - _super.prototype._next.call(this, value); }; - TimeoutWithSubscriber.prototype._unsubscribe = function () { - this.action = null; + AsyncAction.prototype._unsubscribe = function () { + var id = this.id; + var scheduler = this.scheduler; + var actions = scheduler.actions; + var index = actions.indexOf(this); + this.work = null; + this.state = null; + this.pending = false; this.scheduler = null; - this.withObservable = null; + if (index !== -1) { + actions.splice(index, 1); + } + if (id != null) { + this.id = this.recycleAsyncId(scheduler, id, null); + } + this.delay = null; }; - return TimeoutWithSubscriber; -}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */])); -//# sourceMappingURL=timeoutWith.js.map + return AsyncAction; +}(__WEBPACK_IMPORTED_MODULE_1__Action__["a" /* Action */])); + +//# sourceMappingURL=AsyncAction.js.map /***/ }), -/* 408 */ +/* 150 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return asap; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AsapAction__ = __webpack_require__(994); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsapScheduler__ = __webpack_require__(995); -/** PURE_IMPORTS_START _AsapAction,_AsapScheduler PURE_IMPORTS_END */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncScheduler; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Scheduler__ = __webpack_require__(420); +/** PURE_IMPORTS_START tslib,_Scheduler PURE_IMPORTS_END */ -var asap = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_1__AsapScheduler__["a" /* AsapScheduler */](__WEBPACK_IMPORTED_MODULE_0__AsapAction__["a" /* AsapAction */]); -//# sourceMappingURL=asap.js.map - - -/***/ }), -/* 409 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return queue; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__QueueAction__ = __webpack_require__(996); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__QueueScheduler__ = __webpack_require__(997); -/** PURE_IMPORTS_START _QueueAction,_QueueScheduler PURE_IMPORTS_END */ - - -var queue = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_1__QueueScheduler__["a" /* QueueScheduler */](__WEBPACK_IMPORTED_MODULE_0__QueueAction__["a" /* QueueAction */]); -//# sourceMappingURL=queue.js.map - - -/***/ }), -/* 410 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TimeoutError; }); -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function TimeoutErrorImpl() { - Error.call(this); - this.message = 'Timeout has occurred'; - this.name = 'TimeoutError'; - return this; -} -TimeoutErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype); -var TimeoutError = TimeoutErrorImpl; -//# sourceMappingURL=TimeoutError.js.map - - -/***/ }), -/* 411 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UnsubscriptionError; }); -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function UnsubscriptionErrorImpl(errors) { - Error.call(this); - this.message = errors ? - errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ') : ''; - this.name = 'UnsubscriptionError'; - this.errors = errors; - return this; -} -UnsubscriptionErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype); -var UnsubscriptionError = UnsubscriptionErrorImpl; -//# sourceMappingURL=UnsubscriptionError.js.map - - -/***/ }), -/* 412 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isArrayLike; }); -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; }); -//# sourceMappingURL=isArrayLike.js.map - - -/***/ }), -/* 413 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = isDate; -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function isDate(value) { - return value instanceof Date && !isNaN(+value); -} -//# sourceMappingURL=isDate.js.map - - -/***/ }), -/* 414 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = isObject; -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function isObject(x) { - return x != null && typeof x === 'object'; -} -//# sourceMappingURL=isObject.js.map - - -/***/ }), -/* 415 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = isPromise; -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -function isPromise(value) { - return value && typeof value.subscribe !== 'function' && typeof value.then === 'function'; -} -//# sourceMappingURL=isPromise.js.map - - -/***/ }), -/* 416 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeTo; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__subscribeToArray__ = __webpack_require__(417); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__subscribeToPromise__ = __webpack_require__(420); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__subscribeToIterable__ = __webpack_require__(418); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__subscribeToObservable__ = __webpack_require__(419); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__isArrayLike__ = __webpack_require__(412); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isPromise__ = __webpack_require__(415); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__isObject__ = __webpack_require__(414); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__symbol_iterator__ = __webpack_require__(139); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__symbol_observable__ = __webpack_require__(111); -/** PURE_IMPORTS_START _Observable,_subscribeToArray,_subscribeToPromise,_subscribeToIterable,_subscribeToObservable,_isArrayLike,_isPromise,_isObject,_symbol_iterator,_symbol_observable PURE_IMPORTS_END */ - - - - - - - - - - -var subscribeTo = function (result) { - if (result instanceof __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */]) { - return function (subscriber) { - if (result._isScalar) { - subscriber.next(result.value); - subscriber.complete(); - return undefined; +var AsyncScheduler = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsyncScheduler, _super); + function AsyncScheduler(SchedulerAction, now) { + if (now === void 0) { + now = __WEBPACK_IMPORTED_MODULE_1__Scheduler__["a" /* Scheduler */].now; + } + var _this = _super.call(this, SchedulerAction, function () { + if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) { + return AsyncScheduler.delegate.now(); } else { - return result.subscribe(subscriber); + return now(); } - }; + }) || this; + _this.actions = []; + _this.active = false; + _this.scheduled = undefined; + return _this; } - else if (result && typeof result[__WEBPACK_IMPORTED_MODULE_9__symbol_observable__["a" /* observable */]] === 'function') { - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__subscribeToObservable__["a" /* subscribeToObservable */])(result); - } - else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__isArrayLike__["a" /* isArrayLike */])(result)) { - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__subscribeToArray__["a" /* subscribeToArray */])(result); - } - else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__isPromise__["a" /* isPromise */])(result)) { - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__subscribeToPromise__["a" /* subscribeToPromise */])(result); - } - else if (result && typeof result[__WEBPACK_IMPORTED_MODULE_8__symbol_iterator__["a" /* iterator */]] === 'function') { - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__subscribeToIterable__["a" /* subscribeToIterable */])(result); - } - else { - var value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__isObject__["a" /* isObject */])(result) ? 'an invalid object' : "'" + result + "'"; - var msg = "You provided " + value + " where a stream was expected." - + ' You can provide an Observable, Promise, Array, or Iterable.'; - throw new TypeError(msg); - } -}; -//# sourceMappingURL=subscribeTo.js.map - - -/***/ }), -/* 417 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeToArray; }); -/** PURE_IMPORTS_START PURE_IMPORTS_END */ -var subscribeToArray = function (array) { - return function (subscriber) { - for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) { - subscriber.next(array[i]); + AsyncScheduler.prototype.schedule = function (work, delay, state) { + if (delay === void 0) { + delay = 0; } - if (!subscriber.closed) { - subscriber.complete(); - } - }; -}; -//# sourceMappingURL=subscribeToArray.js.map - - -/***/ }), -/* 418 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeToIterable; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_iterator__ = __webpack_require__(139); -/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */ - -var subscribeToIterable = function (iterable) { - return function (subscriber) { - var iterator = iterable[__WEBPACK_IMPORTED_MODULE_0__symbol_iterator__["a" /* iterator */]](); - do { - var item = iterator.next(); - if (item.done) { - subscriber.complete(); - break; - } - subscriber.next(item.value); - if (subscriber.closed) { - break; - } - } while (true); - if (typeof iterator.return === 'function') { - subscriber.add(function () { - if (iterator.return) { - iterator.return(); - } - }); - } - return subscriber; - }; -}; -//# sourceMappingURL=subscribeToIterable.js.map - - -/***/ }), -/* 419 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeToObservable; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_observable__ = __webpack_require__(111); -/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */ - -var subscribeToObservable = function (obj) { - return function (subscriber) { - var obs = obj[__WEBPACK_IMPORTED_MODULE_0__symbol_observable__["a" /* observable */]](); - if (typeof obs.subscribe !== 'function') { - throw new TypeError('Provided object does not correctly implement Symbol.observable'); + if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) { + return AsyncScheduler.delegate.schedule(work, delay, state); } else { - return obs.subscribe(subscriber); + return _super.prototype.schedule.call(this, work, delay, state); } }; -}; -//# sourceMappingURL=subscribeToObservable.js.map + AsyncScheduler.prototype.flush = function (action) { + var actions = this.actions; + if (this.active) { + actions.push(action); + return; + } + var error; + this.active = true; + do { + if (error = action.execute(action.state, action.delay)) { + break; + } + } while (action = actions.shift()); + this.active = false; + if (error) { + while (action = actions.shift()) { + action.unsubscribe(); + } + throw error; + } + }; + return AsyncScheduler; +}(__WEBPACK_IMPORTED_MODULE_1__Scheduler__["a" /* Scheduler */])); + +//# sourceMappingURL=AsyncScheduler.js.map /***/ }), -/* 420 */ +/* 151 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeToPromise; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__hostReportError__ = __webpack_require__(263); -/** PURE_IMPORTS_START _hostReportError PURE_IMPORTS_END */ - -var subscribeToPromise = function (promise) { - return function (subscriber) { - promise.then(function (value) { - if (!subscriber.closed) { - subscriber.next(value); - subscriber.complete(); - } - }, function (err) { return subscriber.error(err); }) - .then(null, __WEBPACK_IMPORTED_MODULE_0__hostReportError__["a" /* hostReportError */]); - return subscriber; - }; -}; -//# sourceMappingURL=subscribeToPromise.js.map +/* unused harmony export getSymbolIterator */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return iterator; }); +/* unused harmony export $$iterator */ +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +function getSymbolIterator() { + if (typeof Symbol !== 'function' || !Symbol.iterator) { + return '@@iterator'; + } + return Symbol.iterator; +} +var iterator = /*@__PURE__*/ getSymbolIterator(); +var $$iterator = iterator; +//# sourceMappingURL=iterator.js.map /***/ }), -/* 421 */ -/***/ (function(module, exports, __webpack_require__) { - -// Note: since nyc uses this module to output coverage, any lines -// that are in the direct sync flow of nyc's outputCoverage are -// ignored, since we can never get coverage for them. -var assert = __webpack_require__(50) -var signals = __webpack_require__(1006) - -var EE = __webpack_require__(95) -/* istanbul ignore if */ -if (typeof EE !== 'function') { - EE = EE.EventEmitter -} - -var emitter -if (process.__signal_exit_emitter__) { - emitter = process.__signal_exit_emitter__ -} else { - emitter = process.__signal_exit_emitter__ = new EE() - emitter.count = 0 - emitter.emitted = {} -} - -// Because this emitter is a global, we have to check to see if a -// previous version of this library failed to enable infinite listeners. -// I know what you're about to say. But literally everything about -// signal-exit is a compromise with evil. Get used to it. -if (!emitter.infinite) { - emitter.setMaxListeners(Infinity) - emitter.infinite = true -} - -module.exports = function (cb, opts) { - assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') - - if (loaded === false) { - load() - } - - var ev = 'exit' - if (opts && opts.alwaysLast) { - ev = 'afterexit' - } - - var remove = function () { - emitter.removeListener(ev, cb) - if (emitter.listeners('exit').length === 0 && - emitter.listeners('afterexit').length === 0) { - unload() - } - } - emitter.on(ev, cb) - - return remove -} - -module.exports.unload = unload -function unload () { - if (!loaded) { - return - } - loaded = false - - signals.forEach(function (sig) { - try { - process.removeListener(sig, sigListeners[sig]) - } catch (er) {} - }) - process.emit = originalProcessEmit - process.reallyExit = originalProcessReallyExit - emitter.count -= 1 -} - -function emit (event, code, signal) { - if (emitter.emitted[event]) { - return - } - emitter.emitted[event] = true - emitter.emit(event, code, signal) -} - -// { : , ... } -var sigListeners = {} -signals.forEach(function (sig) { - sigListeners[sig] = function listener () { - // If there are no other listeners, an exit is coming! - // Simplest way: remove us and then re-send the signal. - // We know that this will kill the process, so we can - // safely emit now. - var listeners = process.listeners(sig) - if (listeners.length === emitter.count) { - unload() - emit('exit', null, sig) - /* istanbul ignore next */ - emit('afterexit', null, sig) - /* istanbul ignore next */ - process.kill(process.pid, sig) - } - } -}) - -module.exports.signals = function () { - return signals -} - -module.exports.load = load - -var loaded = false - -function load () { - if (loaded) { - return - } - loaded = true - - // This is the number of onSignalExit's that are in play. - // It's important so that we can count the correct number of - // listeners on signals, and don't wait for the other one to - // handle it instead of us. - emitter.count += 1 - - signals = signals.filter(function (sig) { - try { - process.on(sig, sigListeners[sig]) - return true - } catch (er) { - return false - } - }) - - process.emit = processEmit - process.reallyExit = processReallyExit -} - -var originalProcessReallyExit = process.reallyExit -function processReallyExit (code) { - process.exitCode = code || 0 - emit('exit', process.exitCode, null) - /* istanbul ignore next */ - emit('afterexit', process.exitCode, null) - /* istanbul ignore next */ - originalProcessReallyExit.call(process, process.exitCode) -} - -var originalProcessEmit = process.emit -function processEmit (ev, arg) { - if (ev === 'exit') { - if (arg !== undefined) { - process.exitCode = arg - } - var ret = originalProcessEmit.apply(this, arguments) - emit('exit', process.exitCode, null) - /* istanbul ignore next */ - emit('afterexit', process.exitCode, null) - return ret - } else { - return originalProcessEmit.apply(this, arguments) - } -} - - -/***/ }), -/* 422 */ -/***/ (function(module, exports, __webpack_require__) { +/* 152 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -var scan = __webpack_require__(1011) -var parse = __webpack_require__(1010) - -module.exports = function (source) { - return parse(scan(source)) +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArgumentOutOfRangeError; }); +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +function ArgumentOutOfRangeErrorImpl() { + Error.call(this); + this.message = 'argument out of range'; + this.name = 'ArgumentOutOfRangeError'; + return this; } +ArgumentOutOfRangeErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype); +var ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl; +//# sourceMappingURL=ArgumentOutOfRangeError.js.map /***/ }), -/* 423 */ -/***/ (function(module, exports) { +/* 153 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EmptyError; }); +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +function EmptyErrorImpl() { + Error.call(this); + this.message = 'no elements in sequence'; + this.name = 'EmptyError'; + return this; +} +EmptyErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype); +var EmptyError = EmptyErrorImpl; +//# sourceMappingURL=EmptyError.js.map -module.exports = ["0BSD","AAL","Abstyles","Adobe-2006","Adobe-Glyph","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","Afmparse","AGPL-1.0","AGPL-3.0-only","AGPL-3.0-or-later","Aladdin","AMDPLPA","AML","AMPAS","ANTLR-PD","Apache-1.0","Apache-1.1","Apache-2.0","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","Artistic-1.0-cl8","Artistic-1.0-Perl","Artistic-1.0","Artistic-2.0","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Borceux","BSD-1-Clause","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","BSD-2-Clause-Patent","BSD-2-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-LBNL","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause","BSD-4-Clause-UC","BSD-4-Clause","BSD-Protection","BSD-Source-Code","BSL-1.0","bzip2-1.0.5","bzip2-1.0.6","Caldera","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-3.0","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-4.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDLA-Permissive-1.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","ClArtistic","CNRI-Jython","CNRI-Python-GPL-Compatible","CNRI-Python","Condor-1.1","CPAL-1.0","CPL-1.0","CPOL-1.02","Crossword","CrystalStacker","CUA-OPL-1.0","Cube","curl","D-FSL-1.0","diffmark","DOC","Dotseqn","DSDP","dvipdfm","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","eGenix","Entessa","EPL-1.0","EPL-2.0","ErlPL-1.1","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Eurosym","Fair","Frameworx-1.0","FreeImage","FSFAP","FSFUL","FSFULLR","FTL","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-only","GFDL-1.3-or-later","Giftware","GL2PS","Glide","Glulxe","gnuplot","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","gSOAP-1.3b","HaskellReport","HPND","IBM-pibs","ICU","IJG","ImageMagick","iMatix","Imlib2","Info-ZIP","Intel-ACPI","Intel","Interbase-1.0","IPA","IPL-1.0","ISC","JasPer-2.0","JSON","LAL-1.2","LAL-1.3","Latex2e","Leptonica","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","Libpng","libtiff","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","MakeIndex","MirOS","MIT-advertising","MIT-CMU","MIT-enna","MIT-feh","MIT","MITNFA","Motosoto","mpich2","MPL-1.0","MPL-1.1","MPL-2.0-no-copyleft-exception","MPL-2.0","MS-PL","MS-RL","MTLL","Multics","Mup","NASA-1.3","Naumen","NBPL-1.0","NCSA","Net-SNMP","NetCDF","Newsletr","NGPL","NLOD-1.0","NLPL","Nokia","NOSL","Noweb","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTP","OCCT-PL","OCLC-2.0","ODbL-1.0","OFL-1.0","OFL-1.1","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0.1","OLDAP-2.0","OLDAP-2.1","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OML","OpenSSL","OPL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","PDDL-1.0","PHP-3.0","PHP-3.01","Plexus","PostgreSQL","psfrag","psutils","Python-2.0","Qhull","QPL-1.0","Rdisc","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Ruby","SAX-PD","Saxpath","SCEA","Sendmail","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SimPL-2.0","SISSL-1.2","SISSL","Sleepycat","SMLNJ","SMPPL","SNIA","Spencer-86","Spencer-94","Spencer-99","SPL-1.0","SugarCRM-1.1.3","SWL","TCL","TCP-wrappers","TMate","TORQUE-1.1","TOSL","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","Unlicense","UPL-1.0","Vim","VOSTROM","VSL-1.0","W3C-19980720","W3C-20150513","W3C","Watcom-1.0","Wsuipa","WTFPL","X11","Xerox","XFree86-1.1","xinetd","Xnet","xpp","XSkat","YPL-1.0","YPL-1.1","Zed","Zend-2.0","Zimbra-1.3","Zimbra-1.4","zlib-acknowledgement","Zlib","ZPL-1.1","ZPL-2.0","ZPL-2.1"] /***/ }), -/* 424 */ +/* 154 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = isFunction; +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +function isFunction(x) { + return typeof x === 'function'; +} +//# sourceMappingURL=isFunction.js.map + + +/***/ }), +/* 155 */ /***/ (function(module, exports, __webpack_require__) { -// Copyright 2015 Joyent, Inc. +// Copyright 2016 Joyent, Inc. -module.exports = { - Verifier: Verifier, - Signer: Signer -}; +module.exports = Certificate; -var nacl; -var stream = __webpack_require__(35); -var util = __webpack_require__(9); -var assert = __webpack_require__(22); -var Buffer = __webpack_require__(20).Buffer; -var Signature = __webpack_require__(70); +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var crypto = __webpack_require__(12); +var Fingerprint = __webpack_require__(156); +var Signature = __webpack_require__(74); +var errs = __webpack_require__(73); +var util = __webpack_require__(3); +var utils = __webpack_require__(26); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(33); +var Identity = __webpack_require__(158); -function Verifier(key, hashAlgo) { - if (nacl === undefined) - nacl = __webpack_require__(71); +var formats = {}; +formats['openssh'] = __webpack_require__(940); +formats['x509'] = __webpack_require__(456); +formats['pem'] = __webpack_require__(941); - if (hashAlgo.toLowerCase() !== 'sha512') - throw (new Error('ED25519 only supports the use of ' + - 'SHA-512 hashes')); +var CertificateParseError = errs.CertificateParseError; +var InvalidAlgorithmError = errs.InvalidAlgorithmError; - this.key = key; - this.chunks = []; - - stream.Writable.call(this, {}); -} -util.inherits(Verifier, stream.Writable); - -Verifier.prototype._write = function (chunk, enc, cb) { - this.chunks.push(chunk); - cb(); -}; - -Verifier.prototype.update = function (chunk) { - if (typeof (chunk) === 'string') - chunk = Buffer.from(chunk, 'binary'); - this.chunks.push(chunk); -}; - -Verifier.prototype.verify = function (signature, fmt) { - var sig; - if (Signature.isSignature(signature, [2, 0])) { - if (signature.type !== 'ed25519') - return (false); - sig = signature.toBuffer('raw'); - - } else if (typeof (signature) === 'string') { - sig = Buffer.from(signature, 'base64'); - - } else if (Signature.isSignature(signature, [1, 0])) { - throw (new Error('signature was created by too old ' + - 'a version of sshpk and cannot be verified')); +function Certificate(opts) { + assert.object(opts, 'options'); + assert.arrayOfObject(opts.subjects, 'options.subjects'); + utils.assertCompatible(opts.subjects[0], Identity, [1, 0], + 'options.subjects'); + utils.assertCompatible(opts.subjectKey, Key, [1, 0], + 'options.subjectKey'); + utils.assertCompatible(opts.issuer, Identity, [1, 0], 'options.issuer'); + if (opts.issuerKey !== undefined) { + utils.assertCompatible(opts.issuerKey, Key, [1, 0], + 'options.issuerKey'); } + assert.object(opts.signatures, 'options.signatures'); + assert.buffer(opts.serial, 'options.serial'); + assert.date(opts.validFrom, 'options.validFrom'); + assert.date(opts.validUntil, 'optons.validUntil'); - assert.buffer(sig); - return (nacl.sign.detached.verify( - new Uint8Array(Buffer.concat(this.chunks)), - new Uint8Array(sig), - new Uint8Array(this.key.part.A.data))); -}; + assert.optionalArrayOfString(opts.purposes, 'options.purposes'); -function Signer(key, hashAlgo) { - if (nacl === undefined) - nacl = __webpack_require__(71); + this._hashCache = {}; - if (hashAlgo.toLowerCase() !== 'sha512') - throw (new Error('ED25519 only supports the use of ' + - 'SHA-512 hashes')); - - this.key = key; - this.chunks = []; - - stream.Writable.call(this, {}); -} -util.inherits(Signer, stream.Writable); - -Signer.prototype._write = function (chunk, enc, cb) { - this.chunks.push(chunk); - cb(); -}; - -Signer.prototype.update = function (chunk) { - if (typeof (chunk) === 'string') - chunk = Buffer.from(chunk, 'binary'); - this.chunks.push(chunk); -}; - -Signer.prototype.sign = function () { - var sig = nacl.sign.detached( - new Uint8Array(Buffer.concat(this.chunks)), - new Uint8Array(Buffer.concat([ - this.key.part.k.data, this.key.part.A.data]))); - var sigBuf = Buffer.from(sig); - var sigObj = Signature.parse(sigBuf, 'ed25519', 'raw'); - sigObj.hashAlgorithm = 'sha512'; - return (sigObj); -}; - - -/***/ }), -/* 425 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = { - read: read, - write: write -}; - -var assert = __webpack_require__(22); -var Buffer = __webpack_require__(20).Buffer; -var utils = __webpack_require__(32); -var Key = __webpack_require__(34); -var PrivateKey = __webpack_require__(39); - -var pem = __webpack_require__(82); -var ssh = __webpack_require__(426); -var rfc4253 = __webpack_require__(92); -var dnssec = __webpack_require__(266); - -var DNSSEC_PRIVKEY_HEADER_PREFIX = 'Private-key-format: v1'; - -function read(buf, options) { - if (typeof (buf) === 'string') { - if (buf.trim().match(/^[-]+[ ]*BEGIN/)) - return (pem.read(buf, options)); - if (buf.match(/^\s*ssh-[a-z]/)) - return (ssh.read(buf, options)); - if (buf.match(/^\s*ecdsa-/)) - return (ssh.read(buf, options)); - if (findDNSSECHeader(buf)) - return (dnssec.read(buf, options)); - buf = Buffer.from(buf, 'binary'); - } else { - assert.buffer(buf); - if (findPEMHeader(buf)) - return (pem.read(buf, options)); - if (findSSHHeader(buf)) - return (ssh.read(buf, options)); - if (findDNSSECHeader(buf)) - return (dnssec.read(buf, options)); - } - if (buf.readUInt32BE(0) < buf.length) - return (rfc4253.read(buf, options)); - throw (new Error('Failed to auto-detect format of key')); + this.subjects = opts.subjects; + this.issuer = opts.issuer; + this.subjectKey = opts.subjectKey; + this.issuerKey = opts.issuerKey; + this.signatures = opts.signatures; + this.serial = opts.serial; + this.validFrom = opts.validFrom; + this.validUntil = opts.validUntil; + this.purposes = opts.purposes; } -function findSSHHeader(buf) { - var offset = 0; - while (offset < buf.length && - (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9)) - ++offset; - if (offset + 4 <= buf.length && - buf.slice(offset, offset + 4).toString('ascii') === 'ssh-') - return (true); - if (offset + 6 <= buf.length && - buf.slice(offset, offset + 6).toString('ascii') === 'ecdsa-') - return (true); - return (false); -} +Certificate.formats = formats; -function findPEMHeader(buf) { - var offset = 0; - while (offset < buf.length && - (buf[offset] === 32 || buf[offset] === 10)) - ++offset; - if (buf[offset] !== 45) +Certificate.prototype.toBuffer = function (format, options) { + if (format === undefined) + format = 'x509'; + assert.string(format, 'format'); + assert.object(formats[format], 'formats[format]'); + assert.optionalObject(options, 'options'); + + return (formats[format].write(this, options)); +}; + +Certificate.prototype.toString = function (format, options) { + if (format === undefined) + format = 'pem'; + return (this.toBuffer(format, options).toString()); +}; + +Certificate.prototype.fingerprint = function (algo) { + if (algo === undefined) + algo = 'sha256'; + assert.string(algo, 'algorithm'); + var opts = { + type: 'certificate', + hash: this.hash(algo), + algorithm: algo + }; + return (new Fingerprint(opts)); +}; + +Certificate.prototype.hash = function (algo) { + assert.string(algo, 'algorithm'); + algo = algo.toLowerCase(); + if (algs.hashAlgs[algo] === undefined) + throw (new InvalidAlgorithmError(algo)); + + if (this._hashCache[algo]) + return (this._hashCache[algo]); + + var hash = crypto.createHash(algo). + update(this.toBuffer('x509')).digest(); + this._hashCache[algo] = hash; + return (hash); +}; + +Certificate.prototype.isExpired = function (when) { + if (when === undefined) + when = new Date(); + return (!((when.getTime() >= this.validFrom.getTime()) && + (when.getTime() < this.validUntil.getTime()))); +}; + +Certificate.prototype.isSignedBy = function (issuerCert) { + utils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer'); + + if (!this.issuer.equals(issuerCert.subjects[0])) return (false); - while (offset < buf.length && - (buf[offset] === 45)) - ++offset; - while (offset < buf.length && - (buf[offset] === 32)) - ++offset; - if (offset + 5 > buf.length || - buf.slice(offset, offset + 5).toString('ascii') !== 'BEGIN') + if (this.issuer.purposes && this.issuer.purposes.length > 0 && + this.issuer.purposes.indexOf('ca') === -1) { return (false); - return (true); -} - -function findDNSSECHeader(buf) { - // private case first - if (buf.length <= DNSSEC_PRIVKEY_HEADER_PREFIX.length) - return (false); - var headerCheck = buf.slice(0, DNSSEC_PRIVKEY_HEADER_PREFIX.length); - if (headerCheck.toString('ascii') === DNSSEC_PRIVKEY_HEADER_PREFIX) - return (true); - - // public-key RFC3110 ? - // 'domain.com. IN KEY ...' or 'domain.com. IN DNSKEY ...' - // skip any comment-lines - if (typeof (buf) !== 'string') { - buf = buf.toString('ascii'); } - var lines = buf.split('\n'); - var line = 0; - /* JSSTYLED */ - while (lines[line].match(/^\;/)) - line++; - if (lines[line].toString('ascii').match(/\. IN KEY /)) - return (true); - if (lines[line].toString('ascii').match(/\. IN DNSKEY /)) - return (true); - return (false); -} -function write(key, options) { - throw (new Error('"auto" format cannot be used for writing')); -} - - -/***/ }), -/* 426 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = { - read: read, - write: write + return (this.isSignedByKey(issuerCert.subjectKey)); }; -var assert = __webpack_require__(22); -var Buffer = __webpack_require__(20).Buffer; -var rfc4253 = __webpack_require__(92); -var utils = __webpack_require__(32); -var Key = __webpack_require__(34); -var PrivateKey = __webpack_require__(39); +Certificate.prototype.isSignedByKey = function (issuerKey) { + utils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey'); -var sshpriv = __webpack_require__(182); - -/*JSSTYLED*/ -var SSHKEY_RE = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/; -/*JSSTYLED*/ -var SSHKEY_RE2 = /^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/; - -function read(buf, options) { - if (typeof (buf) !== 'string') { - assert.buffer(buf, 'buf'); - buf = buf.toString('ascii'); + if (this.issuerKey !== undefined) { + return (this.issuerKey. + fingerprint('sha512').matches(issuerKey)); } - var trimmed = buf.trim().replace(/[\\\r]/g, ''); - var m = trimmed.match(SSHKEY_RE); - if (!m) - m = trimmed.match(SSHKEY_RE2); - assert.ok(m, 'key must match regex'); + var fmt = Object.keys(this.signatures)[0]; + var valid = formats[fmt].verify(this, issuerKey); + if (valid) + this.issuerKey = issuerKey; + return (valid); +}; - var type = rfc4253.algToKeyType(m[1]); - var kbuf = Buffer.from(m[2], 'base64'); +Certificate.prototype.signWith = function (key) { + utils.assertCompatible(key, PrivateKey, [1, 2], 'key'); + var fmts = Object.keys(formats); + var didOne = false; + for (var i = 0; i < fmts.length; ++i) { + if (fmts[i] !== 'pem') { + var ret = formats[fmts[i]].sign(this, key); + if (ret === true) + didOne = true; + } + } + if (!didOne) { + throw (new Error('Failed to sign the certificate for any ' + + 'available certificate formats')); + } +}; + +Certificate.createSelfSigned = function (subjectOrSubjects, key, options) { + var subjects; + if (Array.isArray(subjectOrSubjects)) + subjects = subjectOrSubjects; + else + subjects = [subjectOrSubjects]; + + assert.arrayOfObject(subjects); + subjects.forEach(function (subject) { + utils.assertCompatible(subject, Identity, [1, 0], 'subject'); + }); + + utils.assertCompatible(key, PrivateKey, [1, 2], 'private key'); + + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalObject(options.validFrom, 'options.validFrom'); + assert.optionalObject(options.validUntil, 'options.validUntil'); + var validFrom = options.validFrom; + var validUntil = options.validUntil; + if (validFrom === undefined) + validFrom = new Date(); + if (validUntil === undefined) { + assert.optionalNumber(options.lifetime, 'options.lifetime'); + var lifetime = options.lifetime; + if (lifetime === undefined) + lifetime = 10*365*24*3600; + validUntil = new Date(); + validUntil.setTime(validUntil.getTime() + lifetime*1000); + } + assert.optionalBuffer(options.serial, 'options.serial'); + var serial = options.serial; + if (serial === undefined) + serial = Buffer.from('0000000000000001', 'hex'); + + var purposes = options.purposes; + if (purposes === undefined) + purposes = []; + + if (purposes.indexOf('signature') === -1) + purposes.push('signature'); + + /* Self-signed certs are always CAs. */ + if (purposes.indexOf('ca') === -1) + purposes.push('ca'); + if (purposes.indexOf('crl') === -1) + purposes.push('crl'); /* - * This is a bit tricky. If we managed to parse the key and locate the - * key comment with the regex, then do a non-partial read and assert - * that we have consumed all bytes. If we couldn't locate the key - * comment, though, there may be whitespace shenanigans going on that - * have conjoined the comment to the rest of the key. We do a partial - * read in this case to try to make the best out of a sorry situation. + * If we weren't explicitly given any other purposes, do the sensible + * thing and add some basic ones depending on the subject type. */ - var key; - var ret = {}; - if (m[4]) { - try { - key = rfc4253.read(kbuf); - - } catch (e) { - m = trimmed.match(SSHKEY_RE2); - assert.ok(m, 'key must match regex'); - kbuf = Buffer.from(m[2], 'base64'); - key = rfc4253.readInternal(ret, 'public', kbuf); + if (purposes.length <= 3) { + var hostSubjects = subjects.filter(function (subject) { + return (subject.type === 'host'); + }); + var userSubjects = subjects.filter(function (subject) { + return (subject.type === 'user'); + }); + if (hostSubjects.length > 0) { + if (purposes.indexOf('serverAuth') === -1) + purposes.push('serverAuth'); + } + if (userSubjects.length > 0) { + if (purposes.indexOf('clientAuth') === -1) + purposes.push('clientAuth'); + } + if (userSubjects.length > 0 || hostSubjects.length > 0) { + if (purposes.indexOf('keyAgreement') === -1) + purposes.push('keyAgreement'); + if (key.type === 'rsa' && + purposes.indexOf('encryption') === -1) + purposes.push('encryption'); } - } else { - key = rfc4253.readInternal(ret, 'public', kbuf); } - assert.strictEqual(type, key.type); + var cert = new Certificate({ + subjects: subjects, + issuer: subjects[0], + subjectKey: key.toPublic(), + issuerKey: key.toPublic(), + signatures: {}, + serial: serial, + validFrom: validFrom, + validUntil: validUntil, + purposes: purposes + }); + cert.signWith(key); - if (m[4] && m[4].length > 0) { - key.comment = m[4]; + return (cert); +}; - } else if (ret.consumed) { - /* - * Now the magic: trying to recover the key comment when it's - * gotten conjoined to the key or otherwise shenanigan'd. - * - * Work out how much base64 we used, then drop all non-base64 - * chars from the beginning up to this point in the the string. - * Then offset in this and try to make up for missing = chars. - */ - var data = m[2] + (m[3] ? m[3] : ''); - var realOffset = Math.ceil(ret.consumed / 3) * 4; - data = data.slice(0, realOffset - 2). /*JSSTYLED*/ - replace(/[^a-zA-Z0-9+\/=]/g, '') + - data.slice(realOffset - 2); +Certificate.create = + function (subjectOrSubjects, key, issuer, issuerKey, options) { + var subjects; + if (Array.isArray(subjectOrSubjects)) + subjects = subjectOrSubjects; + else + subjects = [subjectOrSubjects]; - var padding = ret.consumed % 3; - if (padding > 0 && - data.slice(realOffset - 1, realOffset) !== '=') - realOffset--; - while (data.slice(realOffset, realOffset + 1) === '=') - realOffset++; + assert.arrayOfObject(subjects); + subjects.forEach(function (subject) { + utils.assertCompatible(subject, Identity, [1, 0], 'subject'); + }); - /* Finally, grab what we think is the comment & clean it up. */ - var trailer = data.slice(realOffset); - trailer = trailer.replace(/[\r\n]/g, ' '). - replace(/^\s+/, ''); - if (trailer.match(/^[a-zA-Z0-9]/)) - key.comment = trailer; + utils.assertCompatible(key, Key, [1, 0], 'key'); + if (PrivateKey.isPrivateKey(key)) + key = key.toPublic(); + utils.assertCompatible(issuer, Identity, [1, 0], 'issuer'); + utils.assertCompatible(issuerKey, PrivateKey, [1, 2], 'issuer key'); + + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalObject(options.validFrom, 'options.validFrom'); + assert.optionalObject(options.validUntil, 'options.validUntil'); + var validFrom = options.validFrom; + var validUntil = options.validUntil; + if (validFrom === undefined) + validFrom = new Date(); + if (validUntil === undefined) { + assert.optionalNumber(options.lifetime, 'options.lifetime'); + var lifetime = options.lifetime; + if (lifetime === undefined) + lifetime = 10*365*24*3600; + validUntil = new Date(); + validUntil.setTime(validUntil.getTime() + lifetime*1000); + } + assert.optionalBuffer(options.serial, 'options.serial'); + var serial = options.serial; + if (serial === undefined) + serial = Buffer.from('0000000000000001', 'hex'); + + var purposes = options.purposes; + if (purposes === undefined) + purposes = []; + + if (purposes.indexOf('signature') === -1) + purposes.push('signature'); + + if (options.ca === true) { + if (purposes.indexOf('ca') === -1) + purposes.push('ca'); + if (purposes.indexOf('crl') === -1) + purposes.push('crl'); } - return (key); -} + var hostSubjects = subjects.filter(function (subject) { + return (subject.type === 'host'); + }); + var userSubjects = subjects.filter(function (subject) { + return (subject.type === 'user'); + }); + if (hostSubjects.length > 0) { + if (purposes.indexOf('serverAuth') === -1) + purposes.push('serverAuth'); + } + if (userSubjects.length > 0) { + if (purposes.indexOf('clientAuth') === -1) + purposes.push('clientAuth'); + } + if (userSubjects.length > 0 || hostSubjects.length > 0) { + if (purposes.indexOf('keyAgreement') === -1) + purposes.push('keyAgreement'); + if (key.type === 'rsa' && + purposes.indexOf('encryption') === -1) + purposes.push('encryption'); + } -function write(key, options) { - assert.object(key); - if (!Key.isKey(key)) - throw (new Error('Must be a public key')); + var cert = new Certificate({ + subjects: subjects, + issuer: issuer, + subjectKey: key, + issuerKey: issuerKey.toPublic(), + signatures: {}, + serial: serial, + validFrom: validFrom, + validUntil: validUntil, + purposes: purposes + }); + cert.signWith(issuerKey); - var parts = []; - var alg = rfc4253.keyTypeToAlg(key); - parts.push(alg); + return (cert); +}; - var buf = rfc4253.write(key); - parts.push(buf.toString('base64')); +Certificate.parse = function (data, format, options) { + if (typeof (data) !== 'string') + assert.buffer(data, 'data'); + if (format === undefined) + format = 'auto'; + assert.string(format, 'format'); + if (typeof (options) === 'string') + options = { filename: options }; + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalString(options.filename, 'options.filename'); + if (options.filename === undefined) + options.filename = '(unnamed)'; - if (key.comment) - parts.push(key.comment); + assert.object(formats[format], 'formats[format]'); - return (Buffer.from(parts.join(' '))); -} + try { + var k = formats[format].read(data, options); + return (k); + } catch (e) { + throw (new CertificateParseError(options.filename, format, e)); + } +}; + +Certificate.isCertificate = function (obj, ver) { + return (utils.isCompatible(obj, Certificate, ver)); +}; + +/* + * API versions for Certificate: + * [1,0] -- initial ver + */ +Certificate.prototype._sshpkApiVersion = [1, 0]; + +Certificate._oldVersionDetect = function (obj) { + return ([1, 0]); +}; /***/ }), -/* 427 */ +/* 156 */ /***/ (function(module, exports, __webpack_require__) { -// Copyright 2017 Joyent, Inc. +// Copyright 2015 Joyent, Inc. + +module.exports = Fingerprint; + +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var crypto = __webpack_require__(12); +var errs = __webpack_require__(73); +var Key = __webpack_require__(27); +var Certificate = __webpack_require__(155); +var utils = __webpack_require__(26); + +var FingerprintFormatError = errs.FingerprintFormatError; +var InvalidAlgorithmError = errs.InvalidAlgorithmError; + +function Fingerprint(opts) { + assert.object(opts, 'options'); + assert.string(opts.type, 'options.type'); + assert.buffer(opts.hash, 'options.hash'); + assert.string(opts.algorithm, 'options.algorithm'); + + this.algorithm = opts.algorithm.toLowerCase(); + if (algs.hashAlgs[this.algorithm] !== true) + throw (new InvalidAlgorithmError(this.algorithm)); + + this.hash = opts.hash; + this.type = opts.type; +} + +Fingerprint.prototype.toString = function (format) { + if (format === undefined) { + if (this.algorithm === 'md5') + format = 'hex'; + else + format = 'base64'; + } + assert.string(format); + + switch (format) { + case 'hex': + return (addColons(this.hash.toString('hex'))); + case 'base64': + return (sshBase64Format(this.algorithm, + this.hash.toString('base64'))); + default: + throw (new FingerprintFormatError(undefined, format)); + } +}; + +Fingerprint.prototype.matches = function (other) { + assert.object(other, 'key or certificate'); + if (this.type === 'key') { + utils.assertCompatible(other, Key, [1, 0], 'key'); + } else { + utils.assertCompatible(other, Certificate, [1, 0], + 'certificate'); + } + + var theirHash = other.hash(this.algorithm); + var theirHash2 = crypto.createHash(this.algorithm). + update(theirHash).digest('base64'); + + if (this.hash2 === undefined) + this.hash2 = crypto.createHash(this.algorithm). + update(this.hash).digest('base64'); + + return (this.hash2 === theirHash2); +}; + +Fingerprint.parse = function (fp, options) { + assert.string(fp, 'fingerprint'); + + var alg, hash, enAlgs; + if (Array.isArray(options)) { + enAlgs = options; + options = {}; + } + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + if (options.enAlgs !== undefined) + enAlgs = options.enAlgs; + assert.optionalArrayOfString(enAlgs, 'algorithms'); + + var parts = fp.split(':'); + if (parts.length == 2) { + alg = parts[0].toLowerCase(); + /*JSSTYLED*/ + var base64RE = /^[A-Za-z0-9+\/=]+$/; + if (!base64RE.test(parts[1])) + throw (new FingerprintFormatError(fp)); + try { + hash = Buffer.from(parts[1], 'base64'); + } catch (e) { + throw (new FingerprintFormatError(fp)); + } + } else if (parts.length > 2) { + alg = 'md5'; + if (parts[0].toLowerCase() === 'md5') + parts = parts.slice(1); + parts = parts.join(''); + /*JSSTYLED*/ + var md5RE = /^[a-fA-F0-9]+$/; + if (!md5RE.test(parts)) + throw (new FingerprintFormatError(fp)); + try { + hash = Buffer.from(parts, 'hex'); + } catch (e) { + throw (new FingerprintFormatError(fp)); + } + } + + if (alg === undefined) + throw (new FingerprintFormatError(fp)); + + if (algs.hashAlgs[alg] === undefined) + throw (new InvalidAlgorithmError(alg)); + + if (enAlgs !== undefined) { + enAlgs = enAlgs.map(function (a) { return a.toLowerCase(); }); + if (enAlgs.indexOf(alg) === -1) + throw (new InvalidAlgorithmError(alg)); + } + + return (new Fingerprint({ + algorithm: alg, + hash: hash, + type: options.type || 'key' + })); +}; + +function addColons(s) { + /*JSSTYLED*/ + return (s.replace(/(.{2})(?=.)/g, '$1:')); +} + +function base64Strip(s) { + /*JSSTYLED*/ + return (s.replace(/=*$/, '')); +} + +function sshBase64Format(alg, h) { + return (alg.toUpperCase() + ':' + base64Strip(h)); +} + +Fingerprint.isFingerprint = function (obj, ver) { + return (utils.isCompatible(obj, Fingerprint, ver)); +}; + +/* + * API versions for Fingerprint: + * [1,0] -- initial ver + * [1,1] -- first tagged ver + */ +Fingerprint.prototype._sshpkApiVersion = [1, 1]; + +Fingerprint._oldVersionDetect = function (obj) { + assert.func(obj.toString); + assert.func(obj.matches); + return ([1, 0]); +}; + + +/***/ }), +/* 157 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2015 Joyent, Inc. module.exports = { read: read, - verify: verify, - sign: sign, - signAsync: signAsync, - write: write + readPkcs8: readPkcs8, + write: write, + writePkcs8: writePkcs8, + + readECDSACurve: readECDSACurve, + writeECDSACurve: writeECDSACurve }; -var assert = __webpack_require__(22); -var asn1 = __webpack_require__(66); -var Buffer = __webpack_require__(20).Buffer; -var algs = __webpack_require__(38); -var utils = __webpack_require__(32); -var Key = __webpack_require__(34); -var PrivateKey = __webpack_require__(39); -var pem = __webpack_require__(82); -var Identity = __webpack_require__(146); -var Signature = __webpack_require__(70); -var Certificate = __webpack_require__(143); -var pkcs8 = __webpack_require__(145); +var assert = __webpack_require__(16); +var asn1 = __webpack_require__(65); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var utils = __webpack_require__(26); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(33); +var pem = __webpack_require__(86); -/* - * This file is based on RFC5280 (X.509). - */ +function read(buf, options) { + return (pem.read(buf, options, 'pkcs8')); +} + +function write(key, options) { + return (pem.write(key, options, 'pkcs8')); +} /* Helper to read in a single mpint */ function readMPInt(der, nm) { @@ -76780,1007 +41647,1036 @@ function readMPInt(der, nm) { return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); } -function verify(cert, key) { - var sig = cert.signatures.x509; - assert.object(sig, 'x509 signature'); - - var algParts = sig.algo.split('-'); - if (algParts[0] !== key.type) - return (false); - - var blob = sig.cache; - if (blob === undefined) { - var der = new asn1.BerWriter(); - writeTBSCert(cert, der); - blob = der.buffer; +function readPkcs8(alg, type, der) { + /* Private keys in pkcs#8 format have a weird extra int */ + if (der.peek() === asn1.Ber.Integer) { + assert.strictEqual(type, 'private', + 'unexpected Integer at start of public key'); + der.readString(asn1.Ber.Integer, true); } - var verifier = key.createVerify(algParts[1]); - verifier.write(blob); - return (verifier.verify(sig.signature)); -} - -function Local(i) { - return (asn1.Ber.Context | asn1.Ber.Constructor | i); -} - -function Context(i) { - return (asn1.Ber.Context | i); -} - -var SIGN_ALGS = { - 'rsa-md5': '1.2.840.113549.1.1.4', - 'rsa-sha1': '1.2.840.113549.1.1.5', - 'rsa-sha256': '1.2.840.113549.1.1.11', - 'rsa-sha384': '1.2.840.113549.1.1.12', - 'rsa-sha512': '1.2.840.113549.1.1.13', - 'dsa-sha1': '1.2.840.10040.4.3', - 'dsa-sha256': '2.16.840.1.101.3.4.3.2', - 'ecdsa-sha1': '1.2.840.10045.4.1', - 'ecdsa-sha256': '1.2.840.10045.4.3.2', - 'ecdsa-sha384': '1.2.840.10045.4.3.3', - 'ecdsa-sha512': '1.2.840.10045.4.3.4', - 'ed25519-sha512': '1.3.101.112' -}; -Object.keys(SIGN_ALGS).forEach(function (k) { - SIGN_ALGS[SIGN_ALGS[k]] = k; -}); -SIGN_ALGS['1.3.14.3.2.3'] = 'rsa-md5'; -SIGN_ALGS['1.3.14.3.2.29'] = 'rsa-sha1'; - -var EXTS = { - 'issuerKeyId': '2.5.29.35', - 'altName': '2.5.29.17', - 'basicConstraints': '2.5.29.19', - 'keyUsage': '2.5.29.15', - 'extKeyUsage': '2.5.29.37' -}; - -function read(buf, options) { - if (typeof (buf) === 'string') { - buf = Buffer.from(buf, 'binary'); - } - assert.buffer(buf, 'buf'); - - var der = new asn1.BerReader(buf); - der.readSequence(); - if (Math.abs(der.length - der.remain) > 1) { - throw (new Error('DER sequence does not contain whole byte ' + - 'stream')); - } + var next = der.offset + der.length; - var tbsStart = der.offset; - der.readSequence(); - var sigOffset = der.offset + der.length; - var tbsEnd = sigOffset; - - if (der.peek() === Local(0)) { - der.readSequence(Local(0)); - var version = der.readInt(); - assert.ok(version <= 3, - 'only x.509 versions up to v3 supported'); - } - - var cert = {}; - cert.signatures = {}; - var sig = (cert.signatures.x509 = {}); - sig.extras = {}; - - cert.serial = readMPInt(der, 'serial'); - - der.readSequence(); - var after = der.offset + der.length; - var certAlgOid = der.readOID(); - var certAlg = SIGN_ALGS[certAlgOid]; - if (certAlg === undefined) - throw (new Error('unknown signature algorithm ' + certAlgOid)); - - der._offset = after; - cert.issuer = Identity.parseAsn1(der); - - der.readSequence(); - cert.validFrom = readDate(der); - cert.validUntil = readDate(der); - - cert.subjects = [Identity.parseAsn1(der)]; - - der.readSequence(); - after = der.offset + der.length; - cert.subjectKey = pkcs8.readPkcs8(undefined, 'public', der); - der._offset = after; - - /* issuerUniqueID */ - if (der.peek() === Local(1)) { - der.readSequence(Local(1)); - sig.extras.issuerUniqueID = - buf.slice(der.offset, der.offset + der.length); - der._offset += der.length; - } - - /* subjectUniqueID */ - if (der.peek() === Local(2)) { - der.readSequence(Local(2)); - sig.extras.subjectUniqueID = - buf.slice(der.offset, der.offset + der.length); - der._offset += der.length; - } - - /* extensions */ - if (der.peek() === Local(3)) { - der.readSequence(Local(3)); - var extEnd = der.offset + der.length; - der.readSequence(); - - while (der.offset < extEnd) - readExtension(cert, buf, der); - - assert.strictEqual(der.offset, extEnd); - } - - assert.strictEqual(der.offset, sigOffset); - - der.readSequence(); - after = der.offset + der.length; - var sigAlgOid = der.readOID(); - var sigAlg = SIGN_ALGS[sigAlgOid]; - if (sigAlg === undefined) - throw (new Error('unknown signature algorithm ' + sigAlgOid)); - der._offset = after; - - var sigData = der.readString(asn1.Ber.BitString, true); - if (sigData[0] === 0) - sigData = sigData.slice(1); - var algParts = sigAlg.split('-'); - - sig.signature = Signature.parse(sigData, algParts[0], 'asn1'); - sig.signature.hashAlgorithm = algParts[1]; - sig.algo = sigAlg; - sig.cache = buf.slice(tbsStart, tbsEnd); - - return (new Certificate(cert)); -} - -function readDate(der) { - if (der.peek() === asn1.Ber.UTCTime) { - return (utcTimeToDate(der.readString(asn1.Ber.UTCTime))); - } else if (der.peek() === asn1.Ber.GeneralizedTime) { - return (gTimeToDate(der.readString(asn1.Ber.GeneralizedTime))); - } else { - throw (new Error('Unsupported date format')); - } -} - -/* RFC5280, section 4.2.1.6 (GeneralName type) */ -var ALTNAME = { - OtherName: Local(0), - RFC822Name: Context(1), - DNSName: Context(2), - X400Address: Local(3), - DirectoryName: Local(4), - EDIPartyName: Local(5), - URI: Context(6), - IPAddress: Context(7), - OID: Context(8) -}; - -/* RFC5280, section 4.2.1.12 (KeyPurposeId) */ -var EXTPURPOSE = { - 'serverAuth': '1.3.6.1.5.5.7.3.1', - 'clientAuth': '1.3.6.1.5.5.7.3.2', - 'codeSigning': '1.3.6.1.5.5.7.3.3', - - /* See https://github.com/joyent/oid-docs/blob/master/root.md */ - 'joyentDocker': '1.3.6.1.4.1.38678.1.4.1', - 'joyentCmon': '1.3.6.1.4.1.38678.1.4.2' -}; -var EXTPURPOSE_REV = {}; -Object.keys(EXTPURPOSE).forEach(function (k) { - EXTPURPOSE_REV[EXTPURPOSE[k]] = k; -}); - -var KEYUSEBITS = [ - 'signature', 'identity', 'keyEncryption', - 'encryption', 'keyAgreement', 'ca', 'crl' -]; - -function readExtension(cert, buf, der) { - der.readSequence(); - var after = der.offset + der.length; - var extId = der.readOID(); - var id; - var sig = cert.signatures.x509; - sig.extras.exts = []; - - var critical; - if (der.peek() === asn1.Ber.Boolean) - critical = der.readBoolean(); - - switch (extId) { - case (EXTS.basicConstraints): - der.readSequence(asn1.Ber.OctetString); - der.readSequence(); - var bcEnd = der.offset + der.length; - var ca = false; - if (der.peek() === asn1.Ber.Boolean) - ca = der.readBoolean(); - if (cert.purposes === undefined) - cert.purposes = []; - if (ca === true) - cert.purposes.push('ca'); - var bc = { oid: extId, critical: critical }; - if (der.offset < bcEnd && der.peek() === asn1.Ber.Integer) - bc.pathLen = der.readInt(); - sig.extras.exts.push(bc); - break; - case (EXTS.extKeyUsage): - der.readSequence(asn1.Ber.OctetString); - der.readSequence(); - if (cert.purposes === undefined) - cert.purposes = []; - var ekEnd = der.offset + der.length; - while (der.offset < ekEnd) { - var oid = der.readOID(); - cert.purposes.push(EXTPURPOSE_REV[oid] || oid); + var oid = der.readOID(); + switch (oid) { + case '1.2.840.113549.1.1.1': + der._offset = next; + if (type === 'public') + return (readPkcs8RSAPublic(der)); + else + return (readPkcs8RSAPrivate(der)); + case '1.2.840.10040.4.1': + if (type === 'public') + return (readPkcs8DSAPublic(der)); + else + return (readPkcs8DSAPrivate(der)); + case '1.2.840.10045.2.1': + if (type === 'public') + return (readPkcs8ECDSAPublic(der)); + else + return (readPkcs8ECDSAPrivate(der)); + case '1.3.101.112': + if (type === 'public') { + return (readPkcs8EdDSAPublic(der)); + } else { + return (readPkcs8EdDSAPrivate(der)); } - /* - * This is a bit of a hack: in the case where we have a cert - * that's only allowed to do serverAuth or clientAuth (and not - * the other), we want to make sure all our Subjects are of - * the right type. But we already parsed our Subjects and - * decided if they were hosts or users earlier (since it appears - * first in the cert). - * - * So we go through and mutate them into the right kind here if - * it doesn't match. This might not be hugely beneficial, as it - * seems that single-purpose certs are not often seen in the - * wild. - */ - if (cert.purposes.indexOf('serverAuth') !== -1 && - cert.purposes.indexOf('clientAuth') === -1) { - cert.subjects.forEach(function (ide) { - if (ide.type !== 'host') { - ide.type = 'host'; - ide.hostname = ide.uid || - ide.email || - ide.components[0].value; - } - }); - } else if (cert.purposes.indexOf('clientAuth') !== -1 && - cert.purposes.indexOf('serverAuth') === -1) { - cert.subjects.forEach(function (ide) { - if (ide.type !== 'user') { - ide.type = 'user'; - ide.uid = ide.hostname || - ide.email || - ide.components[0].value; - } - }); + case '1.3.101.110': + if (type === 'public') { + return (readPkcs8X25519Public(der)); + } else { + return (readPkcs8X25519Private(der)); } - sig.extras.exts.push({ oid: extId, critical: critical }); - break; - case (EXTS.keyUsage): - der.readSequence(asn1.Ber.OctetString); - var bits = der.readString(asn1.Ber.BitString, true); - var setBits = readBitField(bits, KEYUSEBITS); - setBits.forEach(function (bit) { - if (cert.purposes === undefined) - cert.purposes = []; - if (cert.purposes.indexOf(bit) === -1) - cert.purposes.push(bit); - }); - sig.extras.exts.push({ oid: extId, critical: critical, - bits: bits }); - break; - case (EXTS.altName): - der.readSequence(asn1.Ber.OctetString); - der.readSequence(); - var aeEnd = der.offset + der.length; - while (der.offset < aeEnd) { - switch (der.peek()) { - case ALTNAME.OtherName: - case ALTNAME.EDIPartyName: - der.readSequence(); - der._offset += der.length; - break; - case ALTNAME.OID: - der.readOID(ALTNAME.OID); - break; - case ALTNAME.RFC822Name: - /* RFC822 specifies email addresses */ - var email = der.readString(ALTNAME.RFC822Name); - id = Identity.forEmail(email); - if (!cert.subjects[0].equals(id)) - cert.subjects.push(id); - break; - case ALTNAME.DirectoryName: - der.readSequence(ALTNAME.DirectoryName); - id = Identity.parseAsn1(der); - if (!cert.subjects[0].equals(id)) - cert.subjects.push(id); - break; - case ALTNAME.DNSName: - var host = der.readString( - ALTNAME.DNSName); - id = Identity.forHost(host); - if (!cert.subjects[0].equals(id)) - cert.subjects.push(id); - break; - default: - der.readString(der.peek()); + default: + throw (new Error('Unknown key type OID ' + oid)); + } +} + +function readPkcs8RSAPublic(der) { + // bit string sequence + der.readSequence(asn1.Ber.BitString); + der.readByte(); + der.readSequence(); + + // modulus + var n = readMPInt(der, 'modulus'); + var e = readMPInt(der, 'exponent'); + + // now, make the key + var key = { + type: 'rsa', + source: der.originalInput, + parts: [ + { name: 'e', data: e }, + { name: 'n', data: n } + ] + }; + + return (new Key(key)); +} + +function readPkcs8RSAPrivate(der) { + der.readSequence(asn1.Ber.OctetString); + der.readSequence(); + + var ver = readMPInt(der, 'version'); + assert.equal(ver[0], 0x0, 'unknown RSA private key version'); + + // modulus then public exponent + var n = readMPInt(der, 'modulus'); + var e = readMPInt(der, 'public exponent'); + var d = readMPInt(der, 'private exponent'); + var p = readMPInt(der, 'prime1'); + var q = readMPInt(der, 'prime2'); + var dmodp = readMPInt(der, 'exponent1'); + var dmodq = readMPInt(der, 'exponent2'); + var iqmp = readMPInt(der, 'iqmp'); + + // now, make the key + var key = { + type: 'rsa', + parts: [ + { name: 'n', data: n }, + { name: 'e', data: e }, + { name: 'd', data: d }, + { name: 'iqmp', data: iqmp }, + { name: 'p', data: p }, + { name: 'q', data: q }, + { name: 'dmodp', data: dmodp }, + { name: 'dmodq', data: dmodq } + ] + }; + + return (new PrivateKey(key)); +} + +function readPkcs8DSAPublic(der) { + der.readSequence(); + + var p = readMPInt(der, 'p'); + var q = readMPInt(der, 'q'); + var g = readMPInt(der, 'g'); + + // bit string sequence + der.readSequence(asn1.Ber.BitString); + der.readByte(); + + var y = readMPInt(der, 'y'); + + // now, make the key + var key = { + type: 'dsa', + parts: [ + { name: 'p', data: p }, + { name: 'q', data: q }, + { name: 'g', data: g }, + { name: 'y', data: y } + ] + }; + + return (new Key(key)); +} + +function readPkcs8DSAPrivate(der) { + der.readSequence(); + + var p = readMPInt(der, 'p'); + var q = readMPInt(der, 'q'); + var g = readMPInt(der, 'g'); + + der.readSequence(asn1.Ber.OctetString); + var x = readMPInt(der, 'x'); + + /* The pkcs#8 format does not include the public key */ + var y = utils.calculateDSAPublic(g, p, x); + + var key = { + type: 'dsa', + parts: [ + { name: 'p', data: p }, + { name: 'q', data: q }, + { name: 'g', data: g }, + { name: 'y', data: y }, + { name: 'x', data: x } + ] + }; + + return (new PrivateKey(key)); +} + +function readECDSACurve(der) { + var curveName, curveNames; + var j, c, cd; + + if (der.peek() === asn1.Ber.OID) { + var oid = der.readOID(); + + curveNames = Object.keys(algs.curves); + for (j = 0; j < curveNames.length; ++j) { + c = curveNames[j]; + cd = algs.curves[c]; + if (cd.pkcs8oid === oid) { + curveName = c; break; } } - sig.extras.exts.push({ oid: extId, critical: critical }); - break; - default: - sig.extras.exts.push({ - oid: extId, - critical: critical, - data: der.readString(asn1.Ber.OctetString, true) - }); - break; + + } else { + // ECParameters sequence + der.readSequence(); + var version = der.readString(asn1.Ber.Integer, true); + assert.strictEqual(version[0], 1, 'ECDSA key not version 1'); + + var curve = {}; + + // FieldID sequence + der.readSequence(); + var fieldTypeOid = der.readOID(); + assert.strictEqual(fieldTypeOid, '1.2.840.10045.1.1', + 'ECDSA key is not from a prime-field'); + var p = curve.p = utils.mpNormalize( + der.readString(asn1.Ber.Integer, true)); + /* + * p always starts with a 1 bit, so count the zeros to get its + * real size. + */ + curve.size = p.length * 8 - utils.countZeros(p); + + // Curve sequence + der.readSequence(); + curve.a = utils.mpNormalize( + der.readString(asn1.Ber.OctetString, true)); + curve.b = utils.mpNormalize( + der.readString(asn1.Ber.OctetString, true)); + if (der.peek() === asn1.Ber.BitString) + curve.s = der.readString(asn1.Ber.BitString, true); + + // Combined Gx and Gy + curve.G = der.readString(asn1.Ber.OctetString, true); + assert.strictEqual(curve.G[0], 0x4, + 'uncompressed G is required'); + + curve.n = utils.mpNormalize( + der.readString(asn1.Ber.Integer, true)); + curve.h = utils.mpNormalize( + der.readString(asn1.Ber.Integer, true)); + assert.strictEqual(curve.h[0], 0x1, 'a cofactor=1 curve is ' + + 'required'); + + curveNames = Object.keys(algs.curves); + var ks = Object.keys(curve); + for (j = 0; j < curveNames.length; ++j) { + c = curveNames[j]; + cd = algs.curves[c]; + var equal = true; + for (var i = 0; i < ks.length; ++i) { + var k = ks[i]; + if (cd[k] === undefined) + continue; + if (typeof (cd[k]) === 'object' && + cd[k].equals !== undefined) { + if (!cd[k].equals(curve[k])) { + equal = false; + break; + } + } else if (Buffer.isBuffer(cd[k])) { + if (cd[k].toString('binary') + !== curve[k].toString('binary')) { + equal = false; + break; + } + } else { + if (cd[k] !== curve[k]) { + equal = false; + break; + } + } + } + if (equal) { + curveName = c; + break; + } + } + } + return (curveName); +} + +function readPkcs8ECDSAPrivate(der) { + var curveName = readECDSACurve(der); + assert.string(curveName, 'a known elliptic curve'); + + der.readSequence(asn1.Ber.OctetString); + der.readSequence(); + + var version = readMPInt(der, 'version'); + assert.equal(version[0], 1, 'unknown version of ECDSA key'); + + var d = der.readString(asn1.Ber.OctetString, true); + der.readSequence(0xa1); + + var Q = der.readString(asn1.Ber.BitString, true); + Q = utils.ecNormalize(Q); + + var key = { + type: 'ecdsa', + parts: [ + { name: 'curve', data: Buffer.from(curveName) }, + { name: 'Q', data: Q }, + { name: 'd', data: d } + ] + }; + + return (new PrivateKey(key)); +} + +function readPkcs8ECDSAPublic(der) { + var curveName = readECDSACurve(der); + assert.string(curveName, 'a known elliptic curve'); + + var Q = der.readString(asn1.Ber.BitString, true); + Q = utils.ecNormalize(Q); + + var key = { + type: 'ecdsa', + parts: [ + { name: 'curve', data: Buffer.from(curveName) }, + { name: 'Q', data: Q } + ] + }; + + return (new Key(key)); +} + +function readPkcs8EdDSAPublic(der) { + if (der.peek() === 0x00) + der.readByte(); + + var A = utils.readBitString(der); + + var key = { + type: 'ed25519', + parts: [ + { name: 'A', data: utils.zeroPadToLength(A, 32) } + ] + }; + + return (new Key(key)); +} + +function readPkcs8X25519Public(der) { + var A = utils.readBitString(der); + + var key = { + type: 'curve25519', + parts: [ + { name: 'A', data: utils.zeroPadToLength(A, 32) } + ] + }; + + return (new Key(key)); +} + +function readPkcs8EdDSAPrivate(der) { + if (der.peek() === 0x00) + der.readByte(); + + der.readSequence(asn1.Ber.OctetString); + var k = der.readString(asn1.Ber.OctetString, true); + k = utils.zeroPadToLength(k, 32); + + var A; + if (der.peek() === asn1.Ber.BitString) { + A = utils.readBitString(der); + A = utils.zeroPadToLength(A, 32); + } else { + A = utils.calculateED25519Public(k); } - der._offset = after; + var key = { + type: 'ed25519', + parts: [ + { name: 'A', data: utils.zeroPadToLength(A, 32) }, + { name: 'k', data: utils.zeroPadToLength(k, 32) } + ] + }; + + return (new PrivateKey(key)); } -var UTCTIME_RE = - /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; -function utcTimeToDate(t) { - var m = t.match(UTCTIME_RE); - assert.ok(m, 'timestamps must be in UTC'); - var d = new Date(); +function readPkcs8X25519Private(der) { + if (der.peek() === 0x00) + der.readByte(); - var thisYear = d.getUTCFullYear(); - var century = Math.floor(thisYear / 100) * 100; + der.readSequence(asn1.Ber.OctetString); + var k = der.readString(asn1.Ber.OctetString, true); + k = utils.zeroPadToLength(k, 32); - var year = parseInt(m[1], 10); - if (thisYear % 100 < 50 && year >= 60) - year += (century - 1); - else - year += century; - d.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10)); - d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); - if (m[6] && m[6].length > 0) - d.setUTCSeconds(parseInt(m[6], 10)); - return (d); + var A = utils.calculateX25519Public(k); + + var key = { + type: 'curve25519', + parts: [ + { name: 'A', data: utils.zeroPadToLength(A, 32) }, + { name: 'k', data: utils.zeroPadToLength(k, 32) } + ] + }; + + return (new PrivateKey(key)); } -var GTIME_RE = - /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; -function gTimeToDate(t) { - var m = t.match(GTIME_RE); - assert.ok(m); - var d = new Date(); +function writePkcs8(der, key) { + der.startSequence(); - d.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1, - parseInt(m[3], 10)); - d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); - if (m[6] && m[6].length > 0) - d.setUTCSeconds(parseInt(m[6], 10)); - return (d); + if (PrivateKey.isPrivateKey(key)) { + var sillyInt = Buffer.from([0]); + der.writeBuffer(sillyInt, asn1.Ber.Integer); + } + + der.startSequence(); + switch (key.type) { + case 'rsa': + der.writeOID('1.2.840.113549.1.1.1'); + if (PrivateKey.isPrivateKey(key)) + writePkcs8RSAPrivate(key, der); + else + writePkcs8RSAPublic(key, der); + break; + case 'dsa': + der.writeOID('1.2.840.10040.4.1'); + if (PrivateKey.isPrivateKey(key)) + writePkcs8DSAPrivate(key, der); + else + writePkcs8DSAPublic(key, der); + break; + case 'ecdsa': + der.writeOID('1.2.840.10045.2.1'); + if (PrivateKey.isPrivateKey(key)) + writePkcs8ECDSAPrivate(key, der); + else + writePkcs8ECDSAPublic(key, der); + break; + case 'ed25519': + der.writeOID('1.3.101.112'); + if (PrivateKey.isPrivateKey(key)) + throw (new Error('Ed25519 private keys in pkcs8 ' + + 'format are not supported')); + writePkcs8EdDSAPublic(key, der); + break; + default: + throw (new Error('Unsupported key type: ' + key.type)); + } + + der.endSequence(); } -function zeroPad(n) { - var s = '' + n; - while (s.length < 2) - s = '0' + s; - return (s); +function writePkcs8RSAPrivate(key, der) { + der.writeNull(); + der.endSequence(); + + der.startSequence(asn1.Ber.OctetString); + der.startSequence(); + + var version = Buffer.from([0]); + der.writeBuffer(version, asn1.Ber.Integer); + + der.writeBuffer(key.part.n.data, asn1.Ber.Integer); + der.writeBuffer(key.part.e.data, asn1.Ber.Integer); + der.writeBuffer(key.part.d.data, asn1.Ber.Integer); + der.writeBuffer(key.part.p.data, asn1.Ber.Integer); + der.writeBuffer(key.part.q.data, asn1.Ber.Integer); + if (!key.part.dmodp || !key.part.dmodq) + utils.addRSAMissing(key); + der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer); + der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer); + der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer); + + der.endSequence(); + der.endSequence(); } -function dateToUTCTime(d) { - var s = ''; - s += zeroPad(d.getUTCFullYear() % 100); - s += zeroPad(d.getUTCMonth() + 1); - s += zeroPad(d.getUTCDate()); - s += zeroPad(d.getUTCHours()); - s += zeroPad(d.getUTCMinutes()); - s += zeroPad(d.getUTCSeconds()); - s += 'Z'; - return (s); +function writePkcs8RSAPublic(key, der) { + der.writeNull(); + der.endSequence(); + + der.startSequence(asn1.Ber.BitString); + der.writeByte(0x00); + + der.startSequence(); + der.writeBuffer(key.part.n.data, asn1.Ber.Integer); + der.writeBuffer(key.part.e.data, asn1.Ber.Integer); + der.endSequence(); + + der.endSequence(); } -function sign(cert, key) { - if (cert.signatures.x509 === undefined) - cert.signatures.x509 = {}; - var sig = cert.signatures.x509; +function writePkcs8DSAPrivate(key, der) { + der.startSequence(); + der.writeBuffer(key.part.p.data, asn1.Ber.Integer); + der.writeBuffer(key.part.q.data, asn1.Ber.Integer); + der.writeBuffer(key.part.g.data, asn1.Ber.Integer); + der.endSequence(); - sig.algo = key.type + '-' + key.defaultHashAlgorithm(); - if (SIGN_ALGS[sig.algo] === undefined) + der.endSequence(); + + der.startSequence(asn1.Ber.OctetString); + der.writeBuffer(key.part.x.data, asn1.Ber.Integer); + der.endSequence(); +} + +function writePkcs8DSAPublic(key, der) { + der.startSequence(); + der.writeBuffer(key.part.p.data, asn1.Ber.Integer); + der.writeBuffer(key.part.q.data, asn1.Ber.Integer); + der.writeBuffer(key.part.g.data, asn1.Ber.Integer); + der.endSequence(); + der.endSequence(); + + der.startSequence(asn1.Ber.BitString); + der.writeByte(0x00); + der.writeBuffer(key.part.y.data, asn1.Ber.Integer); + der.endSequence(); +} + +function writeECDSACurve(key, der) { + var curve = algs.curves[key.curve]; + if (curve.pkcs8oid) { + /* This one has a name in pkcs#8, so just write the oid */ + der.writeOID(curve.pkcs8oid); + + } else { + // ECParameters sequence + der.startSequence(); + + var version = Buffer.from([1]); + der.writeBuffer(version, asn1.Ber.Integer); + + // FieldID sequence + der.startSequence(); + der.writeOID('1.2.840.10045.1.1'); // prime-field + der.writeBuffer(curve.p, asn1.Ber.Integer); + der.endSequence(); + + // Curve sequence + der.startSequence(); + var a = curve.p; + if (a[0] === 0x0) + a = a.slice(1); + der.writeBuffer(a, asn1.Ber.OctetString); + der.writeBuffer(curve.b, asn1.Ber.OctetString); + der.writeBuffer(curve.s, asn1.Ber.BitString); + der.endSequence(); + + der.writeBuffer(curve.G, asn1.Ber.OctetString); + der.writeBuffer(curve.n, asn1.Ber.Integer); + var h = curve.h; + if (!h) { + h = Buffer.from([1]); + } + der.writeBuffer(h, asn1.Ber.Integer); + + // ECParameters + der.endSequence(); + } +} + +function writePkcs8ECDSAPublic(key, der) { + writeECDSACurve(key, der); + der.endSequence(); + + var Q = utils.ecNormalize(key.part.Q.data, true); + der.writeBuffer(Q, asn1.Ber.BitString); +} + +function writePkcs8ECDSAPrivate(key, der) { + writeECDSACurve(key, der); + der.endSequence(); + + der.startSequence(asn1.Ber.OctetString); + der.startSequence(); + + var version = Buffer.from([1]); + der.writeBuffer(version, asn1.Ber.Integer); + + der.writeBuffer(key.part.d.data, asn1.Ber.OctetString); + + der.startSequence(0xa1); + var Q = utils.ecNormalize(key.part.Q.data, true); + der.writeBuffer(Q, asn1.Ber.BitString); + der.endSequence(); + + der.endSequence(); + der.endSequence(); +} + +function writePkcs8EdDSAPublic(key, der) { + der.endSequence(); + + utils.writeBitString(der, key.part.A.data); +} + +function writePkcs8EdDSAPrivate(key, der) { + der.endSequence(); + + var k = utils.mpNormalize(key.part.k.data, true); + der.startSequence(asn1.Ber.OctetString); + der.writeBuffer(k, asn1.Ber.OctetString); + der.endSequence(); +} + + +/***/ }), +/* 158 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2017 Joyent, Inc. + +module.exports = Identity; + +var assert = __webpack_require__(16); +var algs = __webpack_require__(32); +var crypto = __webpack_require__(12); +var Fingerprint = __webpack_require__(156); +var Signature = __webpack_require__(74); +var errs = __webpack_require__(73); +var util = __webpack_require__(3); +var utils = __webpack_require__(26); +var asn1 = __webpack_require__(65); +var Buffer = __webpack_require__(15).Buffer; + +/*JSSTYLED*/ +var DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i; + +var oids = {}; +oids.cn = '2.5.4.3'; +oids.o = '2.5.4.10'; +oids.ou = '2.5.4.11'; +oids.l = '2.5.4.7'; +oids.s = '2.5.4.8'; +oids.c = '2.5.4.6'; +oids.sn = '2.5.4.4'; +oids.dc = '0.9.2342.19200300.100.1.25'; +oids.uid = '0.9.2342.19200300.100.1.1'; +oids.mail = '0.9.2342.19200300.100.1.3'; + +var unoids = {}; +Object.keys(oids).forEach(function (k) { + unoids[oids[k]] = k; +}); + +function Identity(opts) { + var self = this; + assert.object(opts, 'options'); + assert.arrayOfObject(opts.components, 'options.components'); + this.components = opts.components; + this.componentLookup = {}; + this.components.forEach(function (c) { + if (c.name && !c.oid) + c.oid = oids[c.name]; + if (c.oid && !c.name) + c.name = unoids[c.oid]; + if (self.componentLookup[c.name] === undefined) + self.componentLookup[c.name] = []; + self.componentLookup[c.name].push(c); + }); + if (this.componentLookup.cn && this.componentLookup.cn.length > 0) { + this.cn = this.componentLookup.cn[0].value; + } + assert.optionalString(opts.type, 'options.type'); + if (opts.type === undefined) { + if (this.components.length === 1 && + this.componentLookup.cn && + this.componentLookup.cn.length === 1 && + this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { + this.type = 'host'; + this.hostname = this.componentLookup.cn[0].value; + + } else if (this.componentLookup.dc && + this.components.length === this.componentLookup.dc.length) { + this.type = 'host'; + this.hostname = this.componentLookup.dc.map( + function (c) { + return (c.value); + }).join('.'); + + } else if (this.componentLookup.uid && + this.components.length === + this.componentLookup.uid.length) { + this.type = 'user'; + this.uid = this.componentLookup.uid[0].value; + + } else if (this.componentLookup.cn && + this.componentLookup.cn.length === 1 && + this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { + this.type = 'host'; + this.hostname = this.componentLookup.cn[0].value; + + } else if (this.componentLookup.uid && + this.componentLookup.uid.length === 1) { + this.type = 'user'; + this.uid = this.componentLookup.uid[0].value; + + } else if (this.componentLookup.mail && + this.componentLookup.mail.length === 1) { + this.type = 'email'; + this.email = this.componentLookup.mail[0].value; + + } else if (this.componentLookup.cn && + this.componentLookup.cn.length === 1) { + this.type = 'user'; + this.uid = this.componentLookup.cn[0].value; + + } else { + this.type = 'unknown'; + } + } else { + this.type = opts.type; + if (this.type === 'host') + this.hostname = opts.hostname; + else if (this.type === 'user') + this.uid = opts.uid; + else if (this.type === 'email') + this.email = opts.email; + else + throw (new Error('Unknown type ' + this.type)); + } +} + +Identity.prototype.toString = function () { + return (this.components.map(function (c) { + return (c.name.toUpperCase() + '=' + c.value); + }).join(', ')); +}; + +/* + * These are from X.680 -- PrintableString allowed chars are in section 37.4 + * table 8. Spec for IA5Strings is "1,6 + SPACE + DEL" where 1 refers to + * ISO IR #001 (standard ASCII control characters) and 6 refers to ISO IR #006 + * (the basic ASCII character set). + */ +/* JSSTYLED */ +var NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\/:=?-]/; +/* JSSTYLED */ +var NOT_IA5 = /[^\x00-\x7f]/; + +Identity.prototype.toAsn1 = function (der, tag) { + der.startSequence(tag); + this.components.forEach(function (c) { + der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set); + der.startSequence(); + der.writeOID(c.oid); + /* + * If we fit in a PrintableString, use that. Otherwise use an + * IA5String or UTF8String. + * + * If this identity was parsed from a DN, use the ASN.1 types + * from the original representation (otherwise this might not + * be a full match for the original in some validators). + */ + if (c.asn1type === asn1.Ber.Utf8String || + c.value.match(NOT_IA5)) { + var v = Buffer.from(c.value, 'utf8'); + der.writeBuffer(v, asn1.Ber.Utf8String); + + } else if (c.asn1type === asn1.Ber.IA5String || + c.value.match(NOT_PRINTABLE)) { + der.writeString(c.value, asn1.Ber.IA5String); + + } else { + var type = asn1.Ber.PrintableString; + if (c.asn1type !== undefined) + type = c.asn1type; + der.writeString(c.value, type); + } + der.endSequence(); + der.endSequence(); + }); + der.endSequence(); +}; + +function globMatch(a, b) { + if (a === '**' || b === '**') + return (true); + var aParts = a.split('.'); + var bParts = b.split('.'); + if (aParts.length !== bParts.length) return (false); - - var der = new asn1.BerWriter(); - writeTBSCert(cert, der); - var blob = der.buffer; - sig.cache = blob; - - var signer = key.createSign(); - signer.write(blob); - cert.signatures.x509.signature = signer.sign(); - + for (var i = 0; i < aParts.length; ++i) { + if (aParts[i] === '*' || bParts[i] === '*') + continue; + if (aParts[i] !== bParts[i]) + return (false); + } return (true); } -function signAsync(cert, signer, done) { - if (cert.signatures.x509 === undefined) - cert.signatures.x509 = {}; - var sig = cert.signatures.x509; - - var der = new asn1.BerWriter(); - writeTBSCert(cert, der); - var blob = der.buffer; - sig.cache = blob; - - signer(blob, function (err, signature) { - if (err) { - done(err); - return; +Identity.prototype.equals = function (other) { + if (!Identity.isIdentity(other, [1, 0])) + return (false); + if (other.components.length !== this.components.length) + return (false); + for (var i = 0; i < this.components.length; ++i) { + if (this.components[i].oid !== other.components[i].oid) + return (false); + if (!globMatch(this.components[i].value, + other.components[i].value)) { + return (false); } - sig.algo = signature.type + '-' + signature.hashAlgorithm; - if (SIGN_ALGS[sig.algo] === undefined) { - done(new Error('Invalid signing algorithm "' + - sig.algo + '"')); - return; - } - sig.signature = signature; - done(); + } + return (true); +}; + +Identity.forHost = function (hostname) { + assert.string(hostname, 'hostname'); + return (new Identity({ + type: 'host', + hostname: hostname, + components: [ { name: 'cn', value: hostname } ] + })); +}; + +Identity.forUser = function (uid) { + assert.string(uid, 'uid'); + return (new Identity({ + type: 'user', + uid: uid, + components: [ { name: 'uid', value: uid } ] + })); +}; + +Identity.forEmail = function (email) { + assert.string(email, 'email'); + return (new Identity({ + type: 'email', + email: email, + components: [ { name: 'mail', value: email } ] + })); +}; + +Identity.parseDN = function (dn) { + assert.string(dn, 'dn'); + var parts = dn.split(','); + var cmps = parts.map(function (c) { + c = c.trim(); + var eqPos = c.indexOf('='); + var name = c.slice(0, eqPos).toLowerCase(); + var value = c.slice(eqPos + 1); + return ({ name: name, value: value }); }); -} + return (new Identity({ components: cmps })); +}; -function write(cert, options) { - var sig = cert.signatures.x509; - assert.object(sig, 'x509 signature'); - - var der = new asn1.BerWriter(); - der.startSequence(); - if (sig.cache) { - der._ensure(sig.cache.length); - sig.cache.copy(der._buf, der._offset); - der._offset += sig.cache.length; - } else { - writeTBSCert(cert, der); - } - - der.startSequence(); - der.writeOID(SIGN_ALGS[sig.algo]); - if (sig.algo.match(/^rsa-/)) - der.writeNull(); - der.endSequence(); - - var sigData = sig.signature.toBuffer('asn1'); - var data = Buffer.alloc(sigData.length + 1); - data[0] = 0; - sigData.copy(data, 1); - der.writeBuffer(data, asn1.Ber.BitString); - der.endSequence(); - - return (der.buffer); -} - -function writeTBSCert(cert, der) { - var sig = cert.signatures.x509; - assert.object(sig, 'x509 signature'); - - der.startSequence(); - - der.startSequence(Local(0)); - der.writeInt(2); - der.endSequence(); - - der.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer); - - der.startSequence(); - der.writeOID(SIGN_ALGS[sig.algo]); - if (sig.algo.match(/^rsa-/)) - der.writeNull(); - der.endSequence(); - - cert.issuer.toAsn1(der); - - der.startSequence(); - der.writeString(dateToUTCTime(cert.validFrom), asn1.Ber.UTCTime); - der.writeString(dateToUTCTime(cert.validUntil), asn1.Ber.UTCTime); - der.endSequence(); - - var subject = cert.subjects[0]; - var altNames = cert.subjects.slice(1); - subject.toAsn1(der); - - pkcs8.writePkcs8(der, cert.subjectKey); - - if (sig.extras && sig.extras.issuerUniqueID) { - der.writeBuffer(sig.extras.issuerUniqueID, Local(1)); - } - - if (sig.extras && sig.extras.subjectUniqueID) { - der.writeBuffer(sig.extras.subjectUniqueID, Local(2)); - } - - if (altNames.length > 0 || subject.type === 'host' || - (cert.purposes !== undefined && cert.purposes.length > 0) || - (sig.extras && sig.extras.exts)) { - der.startSequence(Local(3)); - der.startSequence(); - - var exts = []; - if (cert.purposes !== undefined && cert.purposes.length > 0) { - exts.push({ - oid: EXTS.basicConstraints, - critical: true - }); - exts.push({ - oid: EXTS.keyUsage, - critical: true - }); - exts.push({ - oid: EXTS.extKeyUsage, - critical: true - }); +Identity.parseAsn1 = function (der, top) { + var components = []; + der.readSequence(top); + var end = der.offset + der.length; + while (der.offset < end) { + der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set); + var after = der.offset + der.length; + der.readSequence(); + var oid = der.readOID(); + var type = der.peek(); + var value; + switch (type) { + case asn1.Ber.PrintableString: + case asn1.Ber.IA5String: + case asn1.Ber.OctetString: + case asn1.Ber.T61String: + value = der.readString(type); + break; + case asn1.Ber.Utf8String: + value = der.readString(type, true); + value = value.toString('utf8'); + break; + case asn1.Ber.CharacterString: + case asn1.Ber.BMPString: + value = der.readString(type, true); + value = value.toString('utf16le'); + break; + default: + throw (new Error('Unknown asn1 type ' + type)); } - exts.push({ oid: EXTS.altName }); - if (sig.extras && sig.extras.exts) - exts = sig.extras.exts; - - for (var i = 0; i < exts.length; ++i) { - der.startSequence(); - der.writeOID(exts[i].oid); - - if (exts[i].critical !== undefined) - der.writeBoolean(exts[i].critical); - - if (exts[i].oid === EXTS.altName) { - der.startSequence(asn1.Ber.OctetString); - der.startSequence(); - if (subject.type === 'host') { - der.writeString(subject.hostname, - Context(2)); - } - for (var j = 0; j < altNames.length; ++j) { - if (altNames[j].type === 'host') { - der.writeString( - altNames[j].hostname, - ALTNAME.DNSName); - } else if (altNames[j].type === - 'email') { - der.writeString( - altNames[j].email, - ALTNAME.RFC822Name); - } else { - /* - * Encode anything else as a - * DN style name for now. - */ - der.startSequence( - ALTNAME.DirectoryName); - altNames[j].toAsn1(der); - der.endSequence(); - } - } - der.endSequence(); - der.endSequence(); - } else if (exts[i].oid === EXTS.basicConstraints) { - der.startSequence(asn1.Ber.OctetString); - der.startSequence(); - var ca = (cert.purposes.indexOf('ca') !== -1); - var pathLen = exts[i].pathLen; - der.writeBoolean(ca); - if (pathLen !== undefined) - der.writeInt(pathLen); - der.endSequence(); - der.endSequence(); - } else if (exts[i].oid === EXTS.extKeyUsage) { - der.startSequence(asn1.Ber.OctetString); - der.startSequence(); - cert.purposes.forEach(function (purpose) { - if (purpose === 'ca') - return; - if (KEYUSEBITS.indexOf(purpose) !== -1) - return; - var oid = purpose; - if (EXTPURPOSE[purpose] !== undefined) - oid = EXTPURPOSE[purpose]; - der.writeOID(oid); - }); - der.endSequence(); - der.endSequence(); - } else if (exts[i].oid === EXTS.keyUsage) { - der.startSequence(asn1.Ber.OctetString); - /* - * If we parsed this certificate from a byte - * stream (i.e. we didn't generate it in sshpk) - * then we'll have a ".bits" property on the - * ext with the original raw byte contents. - * - * If we have this, use it here instead of - * regenerating it. This guarantees we output - * the same data we parsed, so signatures still - * validate. - */ - if (exts[i].bits !== undefined) { - der.writeBuffer(exts[i].bits, - asn1.Ber.BitString); - } else { - var bits = writeBitField(cert.purposes, - KEYUSEBITS); - der.writeBuffer(bits, - asn1.Ber.BitString); - } - der.endSequence(); - } else { - der.writeBuffer(exts[i].data, - asn1.Ber.OctetString); - } - - der.endSequence(); - } - - der.endSequence(); - der.endSequence(); + components.push({ oid: oid, asn1type: type, value: value }); + der._offset = after; } + der._offset = end; + return (new Identity({ + components: components + })); +}; - der.endSequence(); -} +Identity.isIdentity = function (obj, ver) { + return (utils.isCompatible(obj, Identity, ver)); +}; /* - * Reads an ASN.1 BER bitfield out of the Buffer produced by doing - * `BerReader#readString(asn1.Ber.BitString)`. That function gives us the raw - * contents of the BitString tag, which is a count of unused bits followed by - * the bits as a right-padded byte string. - * - * `bits` is the Buffer, `bitIndex` should contain an array of string names - * for the bits in the string, ordered starting with bit #0 in the ASN.1 spec. - * - * Returns an array of Strings, the names of the bits that were set to 1. + * API versions for Identity: + * [1,0] -- initial ver */ -function readBitField(bits, bitIndex) { - var bitLen = 8 * (bits.length - 1) - bits[0]; - var setBits = {}; - for (var i = 0; i < bitLen; ++i) { - var byteN = 1 + Math.floor(i / 8); - var bit = 7 - (i % 8); - var mask = 1 << bit; - var bitVal = ((bits[byteN] & mask) !== 0); - var name = bitIndex[i]; - if (bitVal && typeof (name) === 'string') { - setBits[name] = true; - } - } - return (Object.keys(setBits)); -} +Identity.prototype._sshpkApiVersion = [1, 0]; -/* - * `setBits` is an array of strings, containing the names for each bit that - * sould be set to 1. `bitIndex` is same as in `readBitField()`. - * - * Returns a Buffer, ready to be written out with `BerWriter#writeString()`. - */ -function writeBitField(setBits, bitIndex) { - var bitLen = bitIndex.length; - var blen = Math.ceil(bitLen / 8); - var unused = blen * 8 - bitLen; - var bits = Buffer.alloc(1 + blen); // zero-filled - bits[0] = unused; - for (var i = 0; i < bitLen; ++i) { - var byteN = 1 + Math.floor(i / 8); - var bit = 7 - (i % 8); - var mask = 1 << bit; - var name = bitIndex[i]; - if (name === undefined) - continue; - var bitVal = (setBits.indexOf(name) !== -1); - if (bitVal) { - bits[byteN] |= mask; - } - } - return (bits); -} +Identity._oldVersionDetect = function (obj) { + return ([1, 0]); +}; /***/ }), -/* 428 */ +/* 159 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. +// Copyright 2015 Joyent, Inc. +module.exports = SSHBuffer; +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; -/**/ +function SSHBuffer(opts) { + assert.object(opts, 'options'); + if (opts.buffer !== undefined) + assert.buffer(opts.buffer, 'options.buffer'); -var Buffer = __webpack_require__(59).Buffer; -/**/ + this._size = opts.buffer ? opts.buffer.length : 1024; + this._buffer = opts.buffer || Buffer.alloc(this._size); + this._offset = 0; +} -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.toLowerCase()) { - case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': - return true; - default: - return false; - } +SSHBuffer.prototype.toBuffer = function () { + return (this._buffer.slice(0, this._offset)); }; -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } +SSHBuffer.prototype.atEnd = function () { + return (this._offset >= this._buffer.length); }; -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.StringDecoder = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); -} - -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; +SSHBuffer.prototype.remainder = function () { + return (this._buffer.slice(this._offset)); }; -StringDecoder.prototype.end = utf8End; - -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; - -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; +SSHBuffer.prototype.skip = function (n) { + this._offset += n; }; -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. If an invalid byte is detected, -2 is returned. -function utf8CheckByte(byte) { - if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; - return byte >> 6 === 0x02 ? -1 : -2; -} +SSHBuffer.prototype.expand = function () { + this._size *= 2; + var buf = Buffer.alloc(this._size); + this._buffer.copy(buf, 0); + this._buffer = buf; +}; -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; - } - return 0; -} +SSHBuffer.prototype.readPart = function () { + return ({data: this.readBuffer()}); +}; -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'; - } - } - } -} +SSHBuffer.prototype.readBuffer = function () { + var len = this._buffer.readUInt32BE(this._offset); + this._offset += 4; + assert.ok(this._offset + len <= this._buffer.length, + 'length out of bounds at +0x' + this._offset.toString(16) + + ' (data truncated?)'); + var buf = this._buffer.slice(this._offset, this._offset + len); + this._offset += len; + return (buf); +}; -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} +SSHBuffer.prototype.readString = function () { + return (this.readBuffer().toString()); +}; -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} +SSHBuffer.prototype.readCString = function () { + var offset = this._offset; + while (offset < this._buffer.length && + this._buffer[offset] !== 0x00) + offset++; + assert.ok(offset < this._buffer.length, 'c string does not terminate'); + var str = this._buffer.slice(this._offset, offset).toString(); + this._offset = offset + 1; + return (str); +}; -// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'; - return r; -} +SSHBuffer.prototype.readInt = function () { + var v = this._buffer.readUInt32BE(this._offset); + this._offset += 4; + return (v); +}; -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); -} +SSHBuffer.prototype.readInt64 = function () { + assert.ok(this._offset + 8 < this._buffer.length, + 'buffer not long enough to read Int64'); + var v = this._buffer.slice(this._offset, this._offset + 8); + this._offset += 8; + return (v); +}; -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; -} +SSHBuffer.prototype.readChar = function () { + var v = this._buffer[this._offset++]; + return (v); +}; -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString('base64', i, buf.length - n); -} +SSHBuffer.prototype.writeBuffer = function (buf) { + while (this._offset + 4 + buf.length > this._size) + this.expand(); + this._buffer.writeUInt32BE(buf.length, this._offset); + this._offset += 4; + buf.copy(this._buffer, this._offset); + this._offset += buf.length; +}; -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} +SSHBuffer.prototype.writeString = function (str) { + this.writeBuffer(Buffer.from(str, 'utf8')); +}; -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} +SSHBuffer.prototype.writeCString = function (str) { + while (this._offset + 1 + str.length > this._size) + this.expand(); + this._buffer.write(str, this._offset); + this._offset += str.length; + this._buffer[this._offset++] = 0; +}; + +SSHBuffer.prototype.writeInt = function (v) { + while (this._offset + 4 > this._size) + this.expand(); + this._buffer.writeUInt32BE(v, this._offset); + this._offset += 4; +}; + +SSHBuffer.prototype.writeInt64 = function (v) { + assert.buffer(v, 'value'); + if (v.length > 8) { + var lead = v.slice(0, v.length - 8); + for (var i = 0; i < lead.length; ++i) { + assert.strictEqual(lead[i], 0, + 'must fit in 64 bits of precision'); + } + v = v.slice(v.length - 8, v.length); + } + while (this._offset + 8 > this._size) + this.expand(); + v.copy(this._buffer, this._offset); + this._offset += 8; +}; + +SSHBuffer.prototype.writeChar = function (v) { + while (this._offset + 1 > this._size) + this.expand(); + this._buffer[this._offset++] = v; +}; + +SSHBuffer.prototype.writePart = function (p) { + this.writeBuffer(p.data); +}; + +SSHBuffer.prototype.write = function (buf) { + while (this._offset + buf.length > this._size) + this.expand(); + buf.copy(this._buffer, this._offset); + this._offset += buf.length; +}; -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} /***/ }), -/* 429 */ +/* 160 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77801,470 +42697,7 @@ module.exports = x => { /***/ }), -/* 430 */ -/***/ (function(module, exports, __webpack_require__) { - -var toBuffer = __webpack_require__(433) -var alloc = __webpack_require__(324) - -var ZEROS = '0000000000000000000' -var SEVENS = '7777777777777777777' -var ZERO_OFFSET = '0'.charCodeAt(0) -var USTAR = 'ustar\x0000' -var MASK = parseInt('7777', 8) - -var clamp = function (index, len, defaultValue) { - if (typeof index !== 'number') return defaultValue - index = ~~index // Coerce to integer. - if (index >= len) return len - if (index >= 0) return index - index += len - if (index >= 0) return index - return 0 -} - -var toType = function (flag) { - switch (flag) { - case 0: - return 'file' - case 1: - return 'link' - case 2: - return 'symlink' - case 3: - return 'character-device' - case 4: - return 'block-device' - case 5: - return 'directory' - case 6: - return 'fifo' - case 7: - return 'contiguous-file' - case 72: - return 'pax-header' - case 55: - return 'pax-global-header' - case 27: - return 'gnu-long-link-path' - case 28: - case 30: - return 'gnu-long-path' - } - - return null -} - -var toTypeflag = function (flag) { - switch (flag) { - case 'file': - return 0 - case 'link': - return 1 - case 'symlink': - return 2 - case 'character-device': - return 3 - case 'block-device': - return 4 - case 'directory': - return 5 - case 'fifo': - return 6 - case 'contiguous-file': - return 7 - case 'pax-header': - return 72 - } - - return 0 -} - -var indexOf = function (block, num, offset, end) { - for (; offset < end; offset++) { - if (block[offset] === num) return offset - } - return end -} - -var cksum = function (block) { - var sum = 8 * 32 - for (var i = 0; i < 148; i++) sum += block[i] - for (var j = 156; j < 512; j++) sum += block[j] - return sum -} - -var encodeOct = function (val, n) { - val = val.toString(8) - if (val.length > n) return SEVENS.slice(0, n) + ' ' - else return ZEROS.slice(0, n - val.length) + val + ' ' -} - -/* Copied from the node-tar repo and modified to meet - * tar-stream coding standard. - * - * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349 - */ -function parse256 (buf) { - // first byte MUST be either 80 or FF - // 80 for positive, FF for 2's comp - var positive - if (buf[0] === 0x80) positive = true - else if (buf[0] === 0xFF) positive = false - else return null - - // build up a base-256 tuple from the least sig to the highest - var zero = false - var tuple = [] - for (var i = buf.length - 1; i > 0; i--) { - var byte = buf[i] - if (positive) tuple.push(byte) - else if (zero && byte === 0) tuple.push(0) - else if (zero) { - zero = false - tuple.push(0x100 - byte) - } else tuple.push(0xFF - byte) - } - - var sum = 0 - var l = tuple.length - for (i = 0; i < l; i++) { - sum += tuple[i] * Math.pow(256, i) - } - - return positive ? sum : -1 * sum -} - -var decodeOct = function (val, offset, length) { - val = val.slice(offset, offset + length) - offset = 0 - - // If prefixed with 0x80 then parse as a base-256 integer - if (val[offset] & 0x80) { - return parse256(val) - } else { - // Older versions of tar can prefix with spaces - while (offset < val.length && val[offset] === 32) offset++ - var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length) - while (offset < end && val[offset] === 0) offset++ - if (end === offset) return 0 - return parseInt(val.slice(offset, end).toString(), 8) - } -} - -var decodeStr = function (val, offset, length, encoding) { - return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding) -} - -var addLength = function (str) { - var len = Buffer.byteLength(str) - var digits = Math.floor(Math.log(len) / Math.log(10)) + 1 - if (len + digits >= Math.pow(10, digits)) digits++ - - return (len + digits) + str -} - -exports.decodeLongPath = function (buf, encoding) { - return decodeStr(buf, 0, buf.length, encoding) -} - -exports.encodePax = function (opts) { // TODO: encode more stuff in pax - var result = '' - if (opts.name) result += addLength(' path=' + opts.name + '\n') - if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\n') - var pax = opts.pax - if (pax) { - for (var key in pax) { - result += addLength(' ' + key + '=' + pax[key] + '\n') - } - } - return toBuffer(result) -} - -exports.decodePax = function (buf) { - var result = {} - - while (buf.length) { - var i = 0 - while (i < buf.length && buf[i] !== 32) i++ - var len = parseInt(buf.slice(0, i).toString(), 10) - if (!len) return result - - var b = buf.slice(i + 1, len - 1).toString() - var keyIndex = b.indexOf('=') - if (keyIndex === -1) return result - result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1) - - buf = buf.slice(len) - } - - return result -} - -exports.encode = function (opts) { - var buf = alloc(512) - var name = opts.name - var prefix = '' - - if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/' - if (Buffer.byteLength(name) !== name.length) return null // utf-8 - - while (Buffer.byteLength(name) > 100) { - var i = name.indexOf('/') - if (i === -1) return null - prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i) - name = name.slice(i + 1) - } - - if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null - if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null - - buf.write(name) - buf.write(encodeOct(opts.mode & MASK, 6), 100) - buf.write(encodeOct(opts.uid, 6), 108) - buf.write(encodeOct(opts.gid, 6), 116) - buf.write(encodeOct(opts.size, 11), 124) - buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136) - - buf[156] = ZERO_OFFSET + toTypeflag(opts.type) - - if (opts.linkname) buf.write(opts.linkname, 157) - - buf.write(USTAR, 257) - if (opts.uname) buf.write(opts.uname, 265) - if (opts.gname) buf.write(opts.gname, 297) - buf.write(encodeOct(opts.devmajor || 0, 6), 329) - buf.write(encodeOct(opts.devminor || 0, 6), 337) - - if (prefix) buf.write(prefix, 345) - - buf.write(encodeOct(cksum(buf), 6), 148) - - return buf -} - -exports.decode = function (buf, filenameEncoding) { - var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET - - var name = decodeStr(buf, 0, 100, filenameEncoding) - var mode = decodeOct(buf, 100, 8) - var uid = decodeOct(buf, 108, 8) - var gid = decodeOct(buf, 116, 8) - var size = decodeOct(buf, 124, 12) - var mtime = decodeOct(buf, 136, 12) - var type = toType(typeflag) - var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding) - var uname = decodeStr(buf, 265, 32) - var gname = decodeStr(buf, 297, 32) - var devmajor = decodeOct(buf, 329, 8) - var devminor = decodeOct(buf, 337, 8) - - if (buf[345]) name = decodeStr(buf, 345, 155, filenameEncoding) + '/' + name - - // to support old tar versions that use trailing / to indicate dirs - if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5 - - var c = cksum(buf) - - // checksum is still initial value if header was null. - if (c === 8 * 32) return null - - // valid checksum - if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?') - - return { - name: name, - mode: mode, - uid: uid, - gid: gid, - size: size, - mtime: new Date(1000 * mtime), - type: type, - linkname: linkname, - uname: uname, - gname: gname, - devmajor: devmajor, - devminor: devminor - } -} - - -/***/ }), -/* 431 */ -/***/ (function(module, exports, __webpack_require__) { - -exports.extract = __webpack_require__(1022) -exports.pack = __webpack_require__(1023) - - -/***/ }), -/* 432 */ -/***/ (function(module, exports, __webpack_require__) { - -var Transform = __webpack_require__(866) - , inherits = __webpack_require__(9).inherits - , xtend = __webpack_require__(437) - -function DestroyableTransform(opts) { - Transform.call(this, opts) - this._destroyed = false -} - -inherits(DestroyableTransform, Transform) - -DestroyableTransform.prototype.destroy = function(err) { - if (this._destroyed) return - this._destroyed = true - - var self = this - process.nextTick(function() { - if (err) - self.emit('error', err) - self.emit('close') - }) -} - -// a noop _transform function -function noop (chunk, enc, callback) { - callback(null, chunk) -} - - -// create a new export function, used by both the main export and -// the .ctor export, contains common logic for dealing with arguments -function through2 (construct) { - return function (options, transform, flush) { - if (typeof options == 'function') { - flush = transform - transform = options - options = {} - } - - if (typeof transform != 'function') - transform = noop - - if (typeof flush != 'function') - flush = null - - return construct(options, transform, flush) - } -} - - -// main export, just make me a transform stream! -module.exports = through2(function (options, transform, flush) { - var t2 = new DestroyableTransform(options) - - t2._transform = transform - - if (flush) - t2._flush = flush - - return t2 -}) - - -// make me a reusable prototype that I can `new`, or implicitly `new` -// with a constructor call -module.exports.ctor = through2(function (options, transform, flush) { - function Through2 (override) { - if (!(this instanceof Through2)) - return new Through2(override) - - this.options = xtend(options, override) - - DestroyableTransform.call(this, this.options) - } - - inherits(Through2, DestroyableTransform) - - Through2.prototype._transform = transform - - if (flush) - Through2.prototype._flush = flush - - return Through2 -}) - - -module.exports.obj = through2(function (options, transform, flush) { - var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options)) - - t2._transform = transform - - if (flush) - t2._flush = flush - - return t2 -}) - - -/***/ }), -/* 433 */ -/***/ (function(module, exports) { - -module.exports = toBuffer - -var makeBuffer = Buffer.from && Buffer.from !== Uint8Array.from ? Buffer.from : bufferFrom - -function bufferFrom (buf, enc) { - return new Buffer(buf, enc) -} - -function toBuffer (buf, enc) { - if (Buffer.isBuffer(buf)) return buf - if (typeof buf === 'string') return makeBuffer(buf, enc) - if (Array.isArray(buf)) return makeBuffer(buf) - throw new Error('Input should be a buffer or a string') -} - - -/***/ }), -/* 434 */ -/***/ (function(module, exports) { - -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -var byteToHex = []; -for (var i = 0; i < 256; ++i) { - byteToHex[i] = (i + 0x100).toString(16).substr(1); -} - -function bytesToUuid(buf, offset) { - var i = offset || 0; - var bth = byteToHex; - // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 - return ([bth[buf[i++]], bth[buf[i++]], - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], - bth[buf[i++]], bth[buf[i++]], - bth[buf[i++]], bth[buf[i++]]]).join(''); -} - -module.exports = bytesToUuid; - - -/***/ }), -/* 435 */ -/***/ (function(module, exports, __webpack_require__) { - -// Unique ID creation requires a high quality random # generator. In node.js -// this is pretty straight-forward - we use the crypto API. - -var crypto = __webpack_require__(21); - -module.exports = function nodeRNG() { - return crypto.randomBytes(16); -}; - - -/***/ }), -/* 436 */ +/* 161 */ /***/ (function(module, exports) { // Returns a wrapper function that returns a wrapped callback @@ -78303,8979 +42736,7 @@ function wrappy (fn, cb) { /***/ }), -/* 437 */ -/***/ (function(module, exports) { - -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} - - -/***/ }), -/* 438 */ -/***/ (function(module, exports) { - -module.exports = {"name":"yarn","installationMethod":"unknown","version":"1.21.1","license":"BSD-2-Clause","preferGlobal":true,"description":"📦🐈 Fast, reliable, and secure dependency management.","dependencies":{"@zkochan/cmd-shim":"^3.1.0","babel-runtime":"^6.26.0","bytes":"^3.0.0","camelcase":"^4.0.0","chalk":"^2.1.0","cli-table3":"^0.4.0","commander":"^2.9.0","death":"^1.0.0","debug":"^3.0.0","deep-equal":"^1.0.1","detect-indent":"^5.0.0","dnscache":"^1.0.1","glob":"^7.1.1","gunzip-maybe":"^1.4.0","hash-for-dep":"^1.2.3","imports-loader":"^0.8.0","ini":"^1.3.4","inquirer":"^6.2.0","invariant":"^2.2.0","is-builtin-module":"^2.0.0","is-ci":"^1.0.10","is-webpack-bundle":"^1.0.0","js-yaml":"^3.13.1","leven":"^2.0.0","loud-rejection":"^1.2.0","micromatch":"^2.3.11","mkdirp":"^0.5.1","node-emoji":"^1.6.1","normalize-url":"^2.0.0","npm-logical-tree":"^1.2.1","object-path":"^0.11.2","proper-lockfile":"^2.0.0","puka":"^1.0.0","read":"^1.0.7","request":"^2.87.0","request-capture-har":"^1.2.2","rimraf":"^2.5.0","semver":"^5.1.0","ssri":"^5.3.0","strip-ansi":"^4.0.0","strip-bom":"^3.0.0","tar-fs":"^1.16.0","tar-stream":"^1.6.1","uuid":"^3.0.1","v8-compile-cache":"^2.0.0","validate-npm-package-license":"^3.0.4","yn":"^2.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-eslint":"^7.2.3","babel-loader":"^6.2.5","babel-plugin-array-includes":"^2.0.3","babel-plugin-inline-import":"^3.0.0","babel-plugin-transform-builtin-extend":"^1.1.2","babel-plugin-transform-inline-imports-commonjs":"^1.0.0","babel-plugin-transform-runtime":"^6.4.3","babel-preset-env":"^1.6.0","babel-preset-flow":"^6.23.0","babel-preset-stage-0":"^6.0.0","babylon":"^6.5.0","commitizen":"^2.9.6","cz-conventional-changelog":"^2.0.0","eslint":"^4.3.0","eslint-config-fb-strict":"^22.0.0","eslint-plugin-babel":"^5.0.0","eslint-plugin-flowtype":"^2.35.0","eslint-plugin-jasmine":"^2.6.2","eslint-plugin-jest":"^21.0.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-prefer-object-spread":"^1.2.1","eslint-plugin-prettier":"^2.1.2","eslint-plugin-react":"^7.1.0","eslint-plugin-relay":"^0.0.28","eslint-plugin-yarn-internal":"file:scripts/eslint-rules","execa":"^0.11.0","fancy-log":"^1.3.2","flow-bin":"^0.66.0","git-release-notes":"^3.0.0","gulp":"^4.0.0","gulp-babel":"^7.0.0","gulp-if":"^2.0.1","gulp-newer":"^1.0.0","gulp-plumber":"^1.0.1","gulp-sourcemaps":"^2.2.0","jest":"^22.4.4","jsinspect":"^0.12.6","minimatch":"^3.0.4","mock-stdin":"^0.3.0","prettier":"^1.5.2","string-replace-loader":"^2.1.1","temp":"^0.8.3","webpack":"^2.1.0-beta.25","yargs":"^6.3.0"},"resolutions":{"sshpk":"^1.14.2"},"engines":{"node":">=4.0.0"},"repository":"yarnpkg/yarn","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"scripts":{"build":"gulp build","build-bundle":"node ./scripts/build-webpack.js","build-chocolatey":"powershell ./scripts/build-chocolatey.ps1","build-deb":"./scripts/build-deb.sh","build-dist":"bash ./scripts/build-dist.sh","build-win-installer":"scripts\\build-windows-installer.bat","changelog":"git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md","dupe-check":"yarn jsinspect ./src","lint":"eslint . && flow check","pkg-tests":"yarn --cwd packages/pkg-tests jest yarn.test.js","prettier":"eslint src __tests__ --fix","release-branch":"./scripts/release-branch.sh","test":"yarn lint && yarn test-only","test-only":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose","test-only-debug":"node --inspect-brk --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --verbose","test-coverage":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose","watch":"gulp watch","commit":"git-cz"},"jest":{"collectCoverageFrom":["src/**/*.js"],"testEnvironment":"node","modulePathIgnorePatterns":["__tests__/fixtures/","packages/pkg-tests/pkg-tests-fixtures","dist/"],"testPathIgnorePatterns":["__tests__/(fixtures|__mocks__)/","updates/","_(temp|mock|install|init|helpers).js$","packages/pkg-tests"]},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}} - -/***/ }), -/* 439 */ -/***/ (function(module, exports) { - -module.exports = require("constants"); - -/***/ }), -/* 440 */ -/***/ (function(module, exports) { - -module.exports = require("tls"); - -/***/ }), -/* 441 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = handleSignals; - -var _child; - -function _load_child() { - return _child = __webpack_require__(61); -} - -function forwardSignalAndExit(signal) { - (0, (_child || _load_child()).forwardSignalToSpawnedProcesses)(signal); - // We want to exit immediately here since `SIGTERM` means that - // If we lose stdout messages due to abrupt exit, shoot the messenger? - process.exit(1); // eslint-disable-line no-process-exit -} -function handleSignals() { - process.on('SIGTERM', function () { - forwardSignalAndExit('SIGTERM'); - }); -} - -/***/ }), -/* 442 */ -/***/ (function(module, exports) { - - -var defaultConfig = { - uncaughtException: false, - SIGINT: true, - SIGTERM: true, - SIGQUIT: true -} - -var DEBUG = false - -function ON_DEATH (callback) { - var handlers = []; - Object.keys(defaultConfig).forEach(function(key) { - var val = defaultConfig[key] - var handler = null; - if (val) { - if (DEBUG) { - handler = function() { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift(key) - console.log('Trapped ' + key) - callback.apply(null, args) - }; - process.on(key, handler) - } else { - handler = function() { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift(key) - callback.apply(null, args) - } - process.on(key, handler) - } - handlers.push([key, handler]) - } - }) - return function OFF_DEATH() { - handlers.forEach(function (args) { - var key = args[0]; - var handler = args[1]; - process.removeListener(key, handler); - }) - } -} - -module.exports = function (arg) { - if (typeof arg === 'object') { - if (arg['debug']) - DEBUG = arg.debug - if (arg['DEBUG']) - DEBUG = arg.DEBUG - delete arg.debug; delete arg.DEBUG; - - Object.keys(arg).forEach(function(key) { - defaultConfig[key] = arg[key] - }) - - if (DEBUG) - console.log('ON_DEATH: debug mode enabled for pid [%d]', process.pid) - - return ON_DEATH - } else if (typeof arg === 'function') { - return ON_DEATH(arg) - } -} - - - -/***/ }), -/* 443 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var util = __webpack_require__(9); -var onExit = __webpack_require__(421); -var currentlyUnhandled = __webpack_require__(681); - -var installed = false; - -module.exports = function (log) { - if (installed) { - return; - } - - installed = true; - - log = log || console.error; - - var listUnhandled = currentlyUnhandled(); - - onExit(function () { - var unhandledRejections = listUnhandled(); - - if (unhandledRejections.length > 0) { - unhandledRejections.forEach(function (x) { - var err = x.reason; - - if (!(err instanceof Error)) { - err = new Error('Promise rejected with value: ' + util.inspect(err)); - } - - log(err.stack); - }); - - process.exitCode = 1; - } - }); -}; - - -/***/ }), -/* 444 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -const fs = __webpack_require__(362); -const path = __webpack_require__(1); -const retry = __webpack_require__(891); -const syncFs = __webpack_require__(851); - -const locks = {}; - -function getLockFile(file) { - return `${file}.lock`; -} - -function canonicalPath(file, options, callback) { - if (!options.realpath) { - return callback(null, path.resolve(file)); - } - - // Use realpath to resolve symlinks - // It also resolves relative paths - options.fs.realpath(file, callback); -} - -function acquireLock(file, options, callback) { - // Use mkdir to create the lockfile (atomic operation) - options.fs.mkdir(getLockFile(file), (err) => { - // If successful, we are done - if (!err) { - return callback(); - } - - // If error is not EEXIST then some other error occurred while locking - if (err.code !== 'EEXIST') { - return callback(err); - } - - // Otherwise, check if lock is stale by analyzing the file mtime - if (options.stale <= 0) { - return callback(Object.assign(new Error('Lock file is already being hold'), { code: 'ELOCKED', file })); - } - - options.fs.stat(getLockFile(file), (err, stat) => { - if (err) { - // Retry if the lockfile has been removed (meanwhile) - // Skip stale check to avoid recursiveness - if (err.code === 'ENOENT') { - return acquireLock(file, Object.assign({}, options, { stale: 0 }), callback); - } - - return callback(err); - } - - if (!isLockStale(stat, options)) { - return callback(Object.assign(new Error('Lock file is already being hold'), { code: 'ELOCKED', file })); - } - - // If it's stale, remove it and try again! - // Skip stale check to avoid recursiveness - removeLock(file, options, (err) => { - if (err) { - return callback(err); - } - - acquireLock(file, Object.assign({}, options, { stale: 0 }), callback); - }); - }); - }); -} - -function isLockStale(stat, options) { - return stat.mtime.getTime() < Date.now() - options.stale; -} - -function removeLock(file, options, callback) { - // Remove lockfile, ignoring ENOENT errors - options.fs.rmdir(getLockFile(file), (err) => { - if (err && err.code !== 'ENOENT') { - return callback(err); - } - - callback(); - }); -} - -function updateLock(file, options) { - const lock = locks[file]; - - /* istanbul ignore next */ - if (lock.updateTimeout) { - return; - } - - lock.updateDelay = lock.updateDelay || options.update; - lock.updateTimeout = setTimeout(() => { - const mtime = Date.now() / 1000; - - lock.updateTimeout = null; - - options.fs.utimes(getLockFile(file), mtime, mtime, (err) => { - // Ignore if the lock was released - if (lock.released) { - return; - } - - // Verify if we are within the stale threshold - if (lock.lastUpdate <= Date.now() - options.stale && - lock.lastUpdate > Date.now() - options.stale * 2) { - return compromisedLock(file, lock, Object.assign(new Error(lock.updateError || 'Unable to update lock within the stale \ -threshold'), { code: 'ECOMPROMISED' })); - } - - // If the file is older than (stale * 2), we assume the clock is moved manually, - // which we consider a valid case - - // If it failed to update the lockfile, keep trying unless - // the lockfile was deleted! - if (err) { - if (err.code === 'ENOENT') { - return compromisedLock(file, lock, Object.assign(err, { code: 'ECOMPROMISED' })); - } - - lock.updateError = err; - lock.updateDelay = 1000; - return updateLock(file, options); - } - - // All ok, keep updating.. - lock.lastUpdate = Date.now(); - lock.updateError = null; - lock.updateDelay = null; - updateLock(file, options); - }); - }, lock.updateDelay); - - // Unref the timer so that the nodejs process can exit freely - // This is safe because all acquired locks will be automatically released - // on process exit - - // We first check that `lock.updateTimeout.unref` exists because some users - // may be using this module outside of NodeJS (e.g., in an electron app), - // and in those cases `setTimeout` return an integer. - if (lock.updateTimeout.unref) { - lock.updateTimeout.unref(); - } -} - -function compromisedLock(file, lock, err) { - lock.released = true; // Signal the lock has been released - /* istanbul ignore next */ - lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update - - if (locks[file] === lock) { - delete locks[file]; - } - - lock.compromised(err); -} - -// ----------------------------------------- - -function lock(file, options, compromised, callback) { - if (typeof options === 'function') { - callback = compromised; - compromised = options; - options = null; - } - - if (!callback) { - callback = compromised; - compromised = null; - } - - options = Object.assign({ - stale: 10000, - update: null, - realpath: true, - retries: 0, - fs, - }, options); - - options.retries = options.retries || 0; - options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries; - options.stale = Math.max(options.stale || 0, 2000); - options.update = options.update == null ? options.stale / 2 : options.update || 0; - options.update = Math.max(Math.min(options.update, options.stale / 2), 1000); - compromised = compromised || function (err) { throw err; }; - - // Resolve to a canonical file path - canonicalPath(file, options, (err, file) => { - if (err) { - return callback(err); - } - - // Attempt to acquire the lock - const operation = retry.operation(options.retries); - - operation.attempt(() => { - acquireLock(file, options, (err) => { - if (operation.retry(err)) { - return; - } - - if (err) { - return callback(operation.mainError()); - } - - // We now own the lock - const lock = locks[file] = { - options, - compromised, - lastUpdate: Date.now(), - }; - - // We must keep the lock fresh to avoid staleness - updateLock(file, options); - - callback(null, (releasedCallback) => { - if (lock.released) { - return releasedCallback && - releasedCallback(Object.assign(new Error('Lock is already released'), { code: 'ERELEASED' })); - } - - // Not necessary to use realpath twice when unlocking - unlock(file, Object.assign({}, options, { realpath: false }), releasedCallback); - }); - }); - }); - }); -} - -function unlock(file, options, callback) { - if (typeof options === 'function') { - callback = options; - options = null; - } - - options = Object.assign({ - fs, - realpath: true, - }, options); - - callback = callback || function () {}; - - // Resolve to a canonical file path - canonicalPath(file, options, (err, file) => { - if (err) { - return callback(err); - } - - // Skip if the lock is not acquired - const lock = locks[file]; - - if (!lock) { - return callback(Object.assign(new Error('Lock is not acquired/owned by you'), { code: 'ENOTACQUIRED' })); - } - - lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update - lock.released = true; // Signal the lock has been released - delete locks[file]; // Delete from locks - - removeLock(file, options, callback); - }); -} - -function lockSync(file, options, compromised) { - if (typeof options === 'function') { - compromised = options; - options = null; - } - - options = options || {}; - options.fs = syncFs(options.fs || fs); - options.retries = options.retries || 0; - options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries; - - // Retries are not allowed because it requires the flow to be sync - if (options.retries.retries) { - throw Object.assign(new Error('Cannot use retries with the sync api'), { code: 'ESYNC' }); - } - - let err; - let release; - - lock(file, options, compromised, (_err, _release) => { - err = _err; - release = _release; - }); - - if (err) { - throw err; - } - - return release; -} - -function unlockSync(file, options) { - options = options || {}; - options.fs = syncFs(options.fs || fs); - - let err; - - unlock(file, options, (_err) => { - err = _err; - }); - - if (err) { - throw err; - } -} - -function check(file, options, callback) { - if (typeof options === 'function') { - callback = options; - options = null; - } - - options = Object.assign({ - stale: 10000, - realpath: true, - fs, - }, options); - - options.stale = Math.max(options.stale || 0, 2000); - - // Resolve to a canonical file path - canonicalPath(file, options, (err, file) => { - if (err) { - return callback(err); - } - - // Check if lockfile exists - options.fs.stat(getLockFile(file), (err, stat) => { - if (err) { - // if does not exist, file is not locked. Otherwise, callback with error - return (err.code === 'ENOENT') ? callback(null, false) : callback(err); - } - - if (options.stale <= 0) { return callback(null, true); } - - // Otherwise, check if lock is stale by analyzing the file mtime - return callback(null, !isLockStale(stat, options)); - }); - }); -} - -function checkSync(file, options) { - options = options || {}; - options.fs = syncFs(options.fs || fs); - - let err; - let locked; - - check(file, options, (_err, _locked) => { - err = _err; - locked = _locked; - }); - - if (err) { - throw err; - } - - return locked; -} - - -// Remove acquired locks on exit -/* istanbul ignore next */ -process.on('exit', () => { - Object.keys(locks).forEach((file) => { - try { locks[file].options.fs.rmdirSync(getLockFile(file)); } catch (e) { /* empty */ } - }); -}); - -module.exports = lock; -module.exports.lock = lock; -module.exports.unlock = unlock; -module.exports.lockSync = lockSync; -module.exports.unlockSync = unlockSync; -module.exports.check = check; -module.exports.checkSync = checkSync; - - -/***/ }), -/* 445 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var KEYWORDS = [ - 'multipleOf', - 'maximum', - 'exclusiveMaximum', - 'minimum', - 'exclusiveMinimum', - 'maxLength', - 'minLength', - 'pattern', - 'additionalItems', - 'maxItems', - 'minItems', - 'uniqueItems', - 'maxProperties', - 'minProperties', - 'required', - 'additionalProperties', - 'enum', - 'format', - 'const' -]; - -module.exports = function (metaSchema, keywordsJsonPointers) { - for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. - * @param {Object} options optional options with properties `separator` and `dataVar`. - * @return {String} human readable string with all errors descriptions - */ -function errorsText(errors, options) { - errors = errors || this.errors; - if (!errors) return 'No errors'; - options = options || {}; - var separator = options.separator === undefined ? ', ' : options.separator; - var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; - - var text = ''; - for (var i=0; i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; -// For the source: https://gist.github.com/dperini/729294 -// For test cases: https://mathiasbynens.be/demo/url-regex -// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983. -// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu; -var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; -var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; -var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$|^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; -var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; - - -module.exports = formats; - -function formats(mode) { - mode = mode == 'full' ? 'full' : 'fast'; - return util.copy(formats[mode]); -} - - -formats.fast = { - // date: http://tools.ietf.org/html/rfc3339#section-5.6 - date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, - // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 - time: /^[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i, - 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i, - // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js - uri: /^(?:[a-z][a-z0-9+-.]*)(?::|\/)\/?[^\s]*$/i, - 'uri-reference': /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i, - 'uri-template': URITEMPLATE, - url: URL, - // email (sources from jsen validator): - // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 - // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') - email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, - hostname: HOSTNAME, - // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html - ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, - // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses - ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, - regex: regex, - // uuid: http://tools.ietf.org/html/rfc4122 - uuid: UUID, - // JSON-pointer: https://tools.ietf.org/html/rfc6901 - // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A - 'json-pointer': JSON_POINTER, - // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 - 'relative-json-pointer': RELATIVE_JSON_POINTER -}; - - -formats.full = { - date: date, - time: time, - 'date-time': date_time, - uri: uri, - 'uri-reference': URIREF, - 'uri-template': URITEMPLATE, - url: URL, - email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, - hostname: hostname, - ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, - ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, - regex: regex, - uuid: UUID, - 'json-pointer': JSON_POINTER, - 'relative-json-pointer': RELATIVE_JSON_POINTER -}; - - -function date(str) { - // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 - var matches = str.match(DATE); - if (!matches) return false; - - var month = +matches[1]; - var day = +matches[2]; - return month >= 1 && month <= 12 && day >= 1 && day <= DAYS[month]; -} - - -function time(str, full) { - var matches = str.match(TIME); - if (!matches) return false; - - var hour = matches[1]; - var minute = matches[2]; - var second = matches[3]; - var timeZone = matches[5]; - return hour <= 23 && minute <= 59 && second <= 59 && (!full || timeZone); -} - - -var DATE_TIME_SEPARATOR = /t|\s/i; -function date_time(str) { - // http://tools.ietf.org/html/rfc3339#section-5.6 - var dateTime = str.split(DATE_TIME_SEPARATOR); - return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); -} - - -function hostname(str) { - // https://tools.ietf.org/html/rfc1034#section-3.5 - // https://tools.ietf.org/html/rfc1123#section-2 - return str.length <= 255 && HOSTNAME.test(str); -} - - -var NOT_URI_FRAGMENT = /\/|:/; -function uri(str) { - // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." - return NOT_URI_FRAGMENT.test(str) && URI.test(str); -} - - -var Z_ANCHOR = /[^\\]\\Z/; -function regex(str) { - if (Z_ANCHOR.test(str)) return false; - try { - new RegExp(str); - return true; - } catch(e) { - return false; - } -} - - -/***/ }), -/* 451 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var resolve = __webpack_require__(191) - , util = __webpack_require__(96) - , errorClasses = __webpack_require__(190) - , stableStringify = __webpack_require__(358); - -var validateGenerator = __webpack_require__(283); - -/** - * Functions below are used inside compiled validations function - */ - -var co = __webpack_require__(327); -var ucs2length = util.ucs2length; -var equal = __webpack_require__(192); - -// this error is thrown by async schemas to return validation errors via exception -var ValidationError = errorClasses.Validation; - -module.exports = compile; - - -/** - * Compiles schema to validation function - * @this Ajv - * @param {Object} schema schema object - * @param {Object} root object with information about the root schema for this schema - * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution - * @param {String} baseId base ID for IDs in the schema - * @return {Function} validation function - */ -function compile(schema, root, localRefs, baseId) { - /* jshint validthis: true, evil: true */ - /* eslint no-shadow: 0 */ - var self = this - , opts = this._opts - , refVal = [ undefined ] - , refs = {} - , patterns = [] - , patternsHash = {} - , defaults = [] - , defaultsHash = {} - , customRules = []; - - root = root || { schema: schema, refVal: refVal, refs: refs }; - - var c = checkCompiling.call(this, schema, root, baseId); - var compilation = this._compilations[c.index]; - if (c.compiling) return (compilation.callValidate = callValidate); - - var formats = this._formats; - var RULES = this.RULES; - - try { - var v = localCompile(schema, root, localRefs, baseId); - compilation.validate = v; - var cv = compilation.callValidate; - if (cv) { - cv.schema = v.schema; - cv.errors = null; - cv.refs = v.refs; - cv.refVal = v.refVal; - cv.root = v.root; - cv.$async = v.$async; - if (opts.sourceCode) cv.source = v.source; - } - return v; - } finally { - endCompiling.call(this, schema, root, baseId); - } - - function callValidate() { - var validate = compilation.validate; - var result = validate.apply(null, arguments); - callValidate.errors = validate.errors; - return result; - } - - function localCompile(_schema, _root, localRefs, baseId) { - var isRoot = !_root || (_root && _root.schema == _schema); - if (_root.schema != root.schema) - return compile.call(self, _schema, _root, localRefs, baseId); - - var $async = _schema.$async === true; - - var sourceCode = validateGenerator({ - isTop: true, - schema: _schema, - isRoot: isRoot, - baseId: baseId, - root: _root, - schemaPath: '', - errSchemaPath: '#', - errorPath: '""', - MissingRefError: errorClasses.MissingRef, - RULES: RULES, - validate: validateGenerator, - util: util, - resolve: resolve, - resolveRef: resolveRef, - usePattern: usePattern, - useDefault: useDefault, - useCustomRule: useCustomRule, - opts: opts, - formats: formats, - logger: self.logger, - self: self - }); - - sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) - + vars(defaults, defaultCode) + vars(customRules, customRuleCode) - + sourceCode; - - if (opts.processCode) sourceCode = opts.processCode(sourceCode); - // console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); - var validate; - try { - var makeValidate = new Function( - 'self', - 'RULES', - 'formats', - 'root', - 'refVal', - 'defaults', - 'customRules', - 'co', - 'equal', - 'ucs2length', - 'ValidationError', - sourceCode - ); - - validate = makeValidate( - self, - RULES, - formats, - root, - refVal, - defaults, - customRules, - co, - equal, - ucs2length, - ValidationError - ); - - refVal[0] = validate; - } catch(e) { - self.logger.error('Error compiling schema, function code:', sourceCode); - throw e; - } - - validate.schema = _schema; - validate.errors = null; - validate.refs = refs; - validate.refVal = refVal; - validate.root = isRoot ? validate : _root; - if ($async) validate.$async = true; - if (opts.sourceCode === true) { - validate.source = { - code: sourceCode, - patterns: patterns, - defaults: defaults - }; - } - - return validate; - } - - function resolveRef(baseId, ref, isRoot) { - ref = resolve.url(baseId, ref); - var refIndex = refs[ref]; - var _refVal, refCode; - if (refIndex !== undefined) { - _refVal = refVal[refIndex]; - refCode = 'refVal[' + refIndex + ']'; - return resolvedRef(_refVal, refCode); - } - if (!isRoot && root.refs) { - var rootRefId = root.refs[ref]; - if (rootRefId !== undefined) { - _refVal = root.refVal[rootRefId]; - refCode = addLocalRef(ref, _refVal); - return resolvedRef(_refVal, refCode); - } - } - - refCode = addLocalRef(ref); - var v = resolve.call(self, localCompile, root, ref); - if (v === undefined) { - var localSchema = localRefs && localRefs[ref]; - if (localSchema) { - v = resolve.inlineRef(localSchema, opts.inlineRefs) - ? localSchema - : compile.call(self, localSchema, root, localRefs, baseId); - } - } - - if (v === undefined) { - removeLocalRef(ref); - } else { - replaceLocalRef(ref, v); - return resolvedRef(v, refCode); - } - } - - function addLocalRef(ref, v) { - var refId = refVal.length; - refVal[refId] = v; - refs[ref] = refId; - return 'refVal' + refId; - } - - function removeLocalRef(ref) { - delete refs[ref]; - } - - function replaceLocalRef(ref, v) { - var refId = refs[ref]; - refVal[refId] = v; - } - - function resolvedRef(refVal, code) { - return typeof refVal == 'object' || typeof refVal == 'boolean' - ? { code: code, schema: refVal, inline: true } - : { code: code, $async: refVal && refVal.$async }; - } - - function usePattern(regexStr) { - var index = patternsHash[regexStr]; - if (index === undefined) { - index = patternsHash[regexStr] = patterns.length; - patterns[index] = regexStr; - } - return 'pattern' + index; - } - - function useDefault(value) { - switch (typeof value) { - case 'boolean': - case 'number': - return '' + value; - case 'string': - return util.toQuotedString(value); - case 'object': - if (value === null) return 'null'; - var valueStr = stableStringify(value); - var index = defaultsHash[valueStr]; - if (index === undefined) { - index = defaultsHash[valueStr] = defaults.length; - defaults[index] = value; - } - return 'default' + index; - } - } - - function useCustomRule(rule, schema, parentSchema, it) { - var validateSchema = rule.definition.validateSchema; - if (validateSchema && self._opts.validateSchema !== false) { - var valid = validateSchema(schema); - if (!valid) { - var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); - if (self._opts.validateSchema == 'log') self.logger.error(message); - else throw new Error(message); - } - } - - var compile = rule.definition.compile - , inline = rule.definition.inline - , macro = rule.definition.macro; - - var validate; - if (compile) { - validate = compile.call(self, schema, parentSchema, it); - } else if (macro) { - validate = macro.call(self, schema, parentSchema, it); - if (opts.validateSchema !== false) self.validateSchema(validate, true); - } else if (inline) { - validate = inline.call(self, it, rule.keyword, schema, parentSchema); - } else { - validate = rule.definition.validate; - if (!validate) return; - } - - if (validate === undefined) - throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); - - var index = customRules.length; - customRules[index] = validate; - - return { - code: 'customRule' + index, - validate: validate - }; - } -} - - -/** - * Checks if the schema is currently compiled - * @this Ajv - * @param {Object} schema schema to compile - * @param {Object} root root object - * @param {String} baseId base schema ID - * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) - */ -function checkCompiling(schema, root, baseId) { - /* jshint validthis: true */ - var index = compIndex.call(this, schema, root, baseId); - if (index >= 0) return { index: index, compiling: true }; - index = this._compilations.length; - this._compilations[index] = { - schema: schema, - root: root, - baseId: baseId - }; - return { index: index, compiling: false }; -} - - -/** - * Removes the schema from the currently compiled list - * @this Ajv - * @param {Object} schema schema to compile - * @param {Object} root root object - * @param {String} baseId base schema ID - */ -function endCompiling(schema, root, baseId) { - /* jshint validthis: true */ - var i = compIndex.call(this, schema, root, baseId); - if (i >= 0) this._compilations.splice(i, 1); -} - - -/** - * Index of schema compilation in the currently compiled list - * @this Ajv - * @param {Object} schema schema to compile - * @param {Object} root root object - * @param {String} baseId base schema ID - * @return {Integer} compilation index - */ -function compIndex(schema, root, baseId) { - /* jshint validthis: true */ - for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) { - // high surrogate, and there is a next character - value = str.charCodeAt(pos); - if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate - } - } - return length; -}; - - -/***/ }), -/* 454 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_allOf(it, $keyword, $ruleType) { - var out = ' '; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $currentBaseId = $it.baseId, - $allSchemasEmpty = true; - var arr1 = $schema; - if (arr1) { - var $sch, $i = -1, - l1 = arr1.length - 1; - while ($i < l1) { - $sch = arr1[$i += 1]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - $allSchemasEmpty = false; - $it.schema = $sch; - $it.schemaPath = $schemaPath + '[' + $i + ']'; - $it.errSchemaPath = $errSchemaPath + '/' + $i; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } - } - if ($breakOnError) { - if ($allSchemasEmpty) { - out += ' if (true) { '; - } else { - out += ' ' + ($closingBraces.slice(0, -1)) + ' '; - } - } - out = it.util.cleanUpCode(out); - return out; -} - - -/***/ }), -/* 455 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_anyOf(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $noEmptySchema = $schema.every(function($sch) { - return it.util.schemaHasRules($sch, it.RULES.all); - }); - if ($noEmptySchema) { - var $currentBaseId = $it.baseId; - out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - var arr1 = $schema; - if (arr1) { - var $sch, $i = -1, - l1 = arr1.length - 1; - while ($i < l1) { - $sch = arr1[$i += 1]; - $it.schema = $sch; - $it.schemaPath = $schemaPath + '[' + $i + ']'; - $it.errSchemaPath = $errSchemaPath + '/' + $i; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; - $closingBraces += '}'; - } - } - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should match some schema in anyOf\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError(vErrors); '; - } else { - out += ' validate.errors = vErrors; return false; '; - } - } - out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; - if (it.opts.allErrors) { - out += ' } '; - } - out = it.util.cleanUpCode(out); - } else { - if ($breakOnError) { - out += ' if (true) { '; - } - } - return out; -} - - -/***/ }), -/* 456 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_const(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - if (!$isData) { - out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; - } - out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should be equal to constant\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' }'; - if ($breakOnError) { - out += ' else { '; - } - return out; -} - - -/***/ }), -/* 457 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_contains(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $idx = 'i' + $lvl, - $dataNxt = $it.dataLevel = it.dataLevel + 1, - $nextData = 'data' + $dataNxt, - $currentBaseId = it.baseId, - $nonEmptySchema = it.util.schemaHasRules($schema, it.RULES.all); - out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; - if ($nonEmptySchema) { - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - $it.schema = $schema; - $it.schemaPath = $schemaPath; - $it.errSchemaPath = $errSchemaPath; - out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); - var $passData = $data + '[' + $idx + ']'; - $it.dataPathArr[$dataNxt] = $idx; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - out += ' if (' + ($nextValid) + ') break; } '; - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {'; - } else { - out += ' if (' + ($data) + '.length == 0) {'; - } - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should contain a valid item\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } else { '; - if ($nonEmptySchema) { - out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; - } - if (it.opts.allErrors) { - out += ' } '; - } - out = it.util.cleanUpCode(out); - return out; -} - - -/***/ }), -/* 458 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_custom(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - var $rule = this, - $definition = 'definition' + $lvl, - $rDef = $rule.definition, - $closingBraces = ''; - var $compile, $inline, $macro, $ruleValidate, $validateCode; - if ($isData && $rDef.$data) { - $validateCode = 'keywordValidate' + $lvl; - var $validateSchema = $rDef.validateSchema; - out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; - } else { - $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); - if (!$ruleValidate) return; - $schemaValue = 'validate.schema' + $schemaPath; - $validateCode = $ruleValidate.code; - $compile = $rDef.compile; - $inline = $rDef.inline; - $macro = $rDef.macro; - } - var $ruleErrs = $validateCode + '.errors', - $i = 'i' + $lvl, - $ruleErr = 'ruleErr' + $lvl, - $asyncKeyword = $rDef.async; - if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); - if (!($inline || $macro)) { - out += '' + ($ruleErrs) + ' = null;'; - } - out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; - if ($isData && $rDef.$data) { - $closingBraces += '}'; - out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { '; - if ($validateSchema) { - $closingBraces += '}'; - out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { '; - } - } - if ($inline) { - if ($rDef.statements) { - out += ' ' + ($ruleValidate.validate) + ' '; - } else { - out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; - } - } else if ($macro) { - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - $it.schema = $ruleValidate.validate; - $it.schemaPath = ''; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' ' + ($code); - } else { - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; - out += ' ' + ($validateCode) + '.call( '; - if (it.opts.passContext) { - out += 'this'; - } else { - out += 'self'; - } - if ($compile || $rDef.schema === false) { - out += ' , ' + ($data) + ' '; - } else { - out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; - } - out += ' , (dataPath || \'\')'; - if (it.errorPath != '""') { - out += ' + ' + (it.errorPath); - } - var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', - $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; - out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; - var def_callRuleValidate = out; - out = $$outStack.pop(); - if ($rDef.errors === false) { - out += ' ' + ($valid) + ' = '; - if ($asyncKeyword) { - out += '' + (it.yieldAwait); - } - out += '' + (def_callRuleValidate) + '; '; - } else { - if ($asyncKeyword) { - $ruleErrs = 'customErrors' + $lvl; - out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = ' + (it.yieldAwait) + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; - } else { - out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; - } - } - } - if ($rDef.modifying) { - out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; - } - out += '' + ($closingBraces); - if ($rDef.valid) { - if ($breakOnError) { - out += ' if (true) { '; - } - } else { - out += ' if ( '; - if ($rDef.valid === undefined) { - out += ' !'; - if ($macro) { - out += '' + ($nextValid); - } else { - out += '' + ($valid); - } - } else { - out += ' ' + (!$rDef.valid) + ' '; - } - out += ') { '; - $errorKeyword = $rule.keyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - var def_customError = out; - out = $$outStack.pop(); - if ($inline) { - if ($rDef.errors) { - if ($rDef.errors != 'full') { - out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '= 0) { - if ($breakOnError) { - out += ' if (true) { '; - } - return out; - } else { - throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); - } - } - var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate; - var $formatType = $isObject && $format.type || 'string'; - if ($isObject) { - var $async = $format.async === true; - $format = $format.validate; - } - if ($formatType != $ruleType) { - if ($breakOnError) { - out += ' if (true) { '; - } - return out; - } - if ($async) { - if (!it.async) throw new Error('async format in sync schema'); - var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; - out += ' if (!(' + (it.yieldAwait) + ' ' + ($formatRef) + '(' + ($data) + '))) { '; - } else { - out += ' if (! '; - var $formatRef = 'formats' + it.util.getProperty($schema); - if ($isObject) $formatRef += '.validate'; - if (typeof $format == 'function') { - out += ' ' + ($formatRef) + '(' + ($data) + ') '; - } else { - out += ' ' + ($formatRef) + '.test(' + ($data) + ') '; - } - out += ') { '; - } - } - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: '; - if ($isData) { - out += '' + ($schemaValue); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should match format "'; - if ($isData) { - out += '\' + ' + ($schemaValue) + ' + \''; - } else { - out += '' + (it.util.escapeQuotes($schema)); - } - out += '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - if ($breakOnError) { - out += ' else { '; - } - return out; -} - - -/***/ }), -/* 462 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_items(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $idx = 'i' + $lvl, - $dataNxt = $it.dataLevel = it.dataLevel + 1, - $nextData = 'data' + $dataNxt, - $currentBaseId = it.baseId; - out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; - if (Array.isArray($schema)) { - var $additionalItems = it.schema.additionalItems; - if ($additionalItems === false) { - out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; '; - var $currErrSchemaPath = $errSchemaPath; - $errSchemaPath = it.errSchemaPath + '/additionalItems'; - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' '; - } - if (it.opts.verbose) { - out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - $errSchemaPath = $currErrSchemaPath; - if ($breakOnError) { - $closingBraces += '}'; - out += ' else { '; - } - } - var arr1 = $schema; - if (arr1) { - var $sch, $i = -1, - l1 = arr1.length - 1; - while ($i < l1) { - $sch = arr1[$i += 1]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; - var $passData = $data + '[' + $i + ']'; - $it.schema = $sch; - $it.schemaPath = $schemaPath + '[' + $i + ']'; - $it.errSchemaPath = $errSchemaPath + '/' + $i; - $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); - $it.dataPathArr[$dataNxt] = $i; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } - } - if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) { - $it.schema = $additionalItems; - $it.schemaPath = it.schemaPath + '.additionalItems'; - $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; - out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); - var $passData = $data + '[' + $idx + ']'; - $it.dataPathArr[$dataNxt] = $idx; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - out += ' } } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } else if (it.util.schemaHasRules($schema, it.RULES.all)) { - $it.schema = $schema; - $it.schemaPath = $schemaPath; - $it.errSchemaPath = $errSchemaPath; - out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); - var $passData = $data + '[' + $idx + ']'; - $it.dataPathArr[$dataNxt] = $idx; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - out += ' }'; - } - if ($breakOnError) { - out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; - } - out = it.util.cleanUpCode(out); - return out; -} - - -/***/ }), -/* 463 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_multipleOf(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - out += 'var division' + ($lvl) + ';if ('; - if ($isData) { - out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; - } - out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; - if (it.opts.multipleOfPrecision) { - out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; - } else { - out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; - } - out += ' ) '; - if ($isData) { - out += ' ) '; - } - out += ' ) { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be multiple of '; - if ($isData) { - out += '\' + ' + ($schemaValue); - } else { - out += '' + ($schemaValue) + '\''; - } - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + ($schema); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += '} '; - if ($breakOnError) { - out += ' else { '; - } - return out; -} - - -/***/ }), -/* 464 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_not(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - $it.level++; - var $nextValid = 'valid' + $it.level; - if (it.util.schemaHasRules($schema, it.RULES.all)) { - $it.schema = $schema; - $it.schemaPath = $schemaPath; - $it.errSchemaPath = $errSchemaPath; - out += ' var ' + ($errs) + ' = errors; '; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - $it.createErrors = false; - var $allErrorsOption; - if ($it.opts.allErrors) { - $allErrorsOption = $it.opts.allErrors; - $it.opts.allErrors = false; - } - out += ' ' + (it.validate($it)) + ' '; - $it.createErrors = true; - if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' if (' + ($nextValid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT be valid\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; - if (it.opts.allErrors) { - out += ' } '; - } - } else { - out += ' var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT be valid\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if ($breakOnError) { - out += ' if (false) { '; - } - } - return out; -} - - -/***/ }), -/* 465 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_oneOf(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - out += 'var ' + ($errs) + ' = errors;var prevValid' + ($lvl) + ' = false;var ' + ($valid) + ' = false;'; - var $currentBaseId = $it.baseId; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - var arr1 = $schema; - if (arr1) { - var $sch, $i = -1, - l1 = arr1.length - 1; - while ($i < l1) { - $sch = arr1[$i += 1]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - $it.schema = $sch; - $it.schemaPath = $schemaPath + '[' + $i + ']'; - $it.errSchemaPath = $errSchemaPath + '/' + $i; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - } else { - out += ' var ' + ($nextValid) + ' = true; '; - } - if ($i) { - out += ' if (' + ($nextValid) + ' && prevValid' + ($lvl) + ') ' + ($valid) + ' = false; else { '; - $closingBraces += '}'; - } - out += ' if (' + ($nextValid) + ') ' + ($valid) + ' = prevValid' + ($lvl) + ' = true;'; - } - } - it.compositeRule = $it.compositeRule = $wasComposite; - out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should match exactly one schema in oneOf\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError(vErrors); '; - } else { - out += ' validate.errors = vErrors; return false; '; - } - } - out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; - if (it.opts.allErrors) { - out += ' } '; - } - return out; -} - - -/***/ }), -/* 466 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_pattern(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); - out += 'if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; - } - out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; - if ($isData) { - out += '' + ($schemaValue); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should match pattern "'; - if ($isData) { - out += '\' + ' + ($schemaValue) + ' + \''; - } else { - out += '' + (it.util.escapeQuotes($schema)); - } - out += '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += '} '; - if ($breakOnError) { - out += ' else { '; - } - return out; -} - - -/***/ }), -/* 467 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_properties(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $key = 'key' + $lvl, - $idx = 'idx' + $lvl, - $dataNxt = $it.dataLevel = it.dataLevel + 1, - $nextData = 'data' + $dataNxt, - $dataProperties = 'dataProperties' + $lvl; - var $schemaKeys = Object.keys($schema || {}), - $pProperties = it.schema.patternProperties || {}, - $pPropertyKeys = Object.keys($pProperties), - $aProperties = it.schema.additionalProperties, - $someProperties = $schemaKeys.length || $pPropertyKeys.length, - $noAdditional = $aProperties === false, - $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, - $removeAdditional = it.opts.removeAdditional, - $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, - $ownProperties = it.opts.ownProperties, - $currentBaseId = it.baseId; - var $required = it.schema.required; - if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); - if (it.opts.patternGroups) { - var $pgProperties = it.schema.patternGroups || {}, - $pgPropertyKeys = Object.keys($pgProperties); - } - out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; - if ($ownProperties) { - out += ' var ' + ($dataProperties) + ' = undefined;'; - } - if ($checkAdditional) { - if ($ownProperties) { - out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; - } else { - out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; - } - if ($someProperties) { - out += ' var isAdditional' + ($lvl) + ' = !(false '; - if ($schemaKeys.length) { - if ($schemaKeys.length > 5) { - out += ' || validate.schema' + ($schemaPath) + '[' + ($key) + '] '; - } else { - var arr1 = $schemaKeys; - if (arr1) { - var $propertyKey, i1 = -1, - l1 = arr1.length - 1; - while (i1 < l1) { - $propertyKey = arr1[i1 += 1]; - out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; - } - } - } - } - if ($pPropertyKeys.length) { - var arr2 = $pPropertyKeys; - if (arr2) { - var $pProperty, $i = -1, - l2 = arr2.length - 1; - while ($i < l2) { - $pProperty = arr2[$i += 1]; - out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; - } - } - } - if (it.opts.patternGroups && $pgPropertyKeys.length) { - var arr3 = $pgPropertyKeys; - if (arr3) { - var $pgProperty, $i = -1, - l3 = arr3.length - 1; - while ($i < l3) { - $pgProperty = arr3[$i += 1]; - out += ' || ' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ') '; - } - } - } - out += ' ); if (isAdditional' + ($lvl) + ') { '; - } - if ($removeAdditional == 'all') { - out += ' delete ' + ($data) + '[' + ($key) + ']; '; - } else { - var $currentErrorPath = it.errorPath; - var $additionalProperty = '\' + ' + $key + ' + \''; - if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - } - if ($noAdditional) { - if ($removeAdditional) { - out += ' delete ' + ($data) + '[' + ($key) + ']; '; - } else { - out += ' ' + ($nextValid) + ' = false; '; - var $currErrSchemaPath = $errSchemaPath; - $errSchemaPath = it.errSchemaPath + '/additionalProperties'; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have additional properties\' '; - } - if (it.opts.verbose) { - out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - $errSchemaPath = $currErrSchemaPath; - if ($breakOnError) { - out += ' break; '; - } - } - } else if ($additionalIsSchema) { - if ($removeAdditional == 'failing') { - out += ' var ' + ($errs) + ' = errors; '; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - $it.schema = $aProperties; - $it.schemaPath = it.schemaPath + '.additionalProperties'; - $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; - $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; - it.compositeRule = $it.compositeRule = $wasComposite; - } else { - $it.schema = $aProperties; - $it.schemaPath = it.schemaPath + '.additionalProperties'; - $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; - $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - } - } - it.errorPath = $currentErrorPath; - } - if ($someProperties) { - out += ' } '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - var $useDefaults = it.opts.useDefaults && !it.compositeRule; - if ($schemaKeys.length) { - var arr4 = $schemaKeys; - if (arr4) { - var $propertyKey, i4 = -1, - l4 = arr4.length - 1; - while (i4 < l4) { - $propertyKey = arr4[i4 += 1]; - var $sch = $schema[$propertyKey]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - var $prop = it.util.getProperty($propertyKey), - $passData = $data + $prop, - $hasDefault = $useDefaults && $sch.default !== undefined; - $it.schema = $sch; - $it.schemaPath = $schemaPath + $prop; - $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); - $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); - $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - $code = it.util.varReplace($code, $nextData, $passData); - var $useData = $passData; - } else { - var $useData = $nextData; - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; - } - if ($hasDefault) { - out += ' ' + ($code) + ' '; - } else { - if ($requiredHash && $requiredHash[$propertyKey]) { - out += ' if ( ' + ($useData) + ' === undefined '; - if ($ownProperties) { - out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; - } - out += ') { ' + ($nextValid) + ' = false; '; - var $currentErrorPath = it.errorPath, - $currErrSchemaPath = $errSchemaPath, - $missingProperty = it.util.escapeQuotes($propertyKey); - if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); - } - $errSchemaPath = it.errSchemaPath + '/required'; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - $errSchemaPath = $currErrSchemaPath; - it.errorPath = $currentErrorPath; - out += ' } else { '; - } else { - if ($breakOnError) { - out += ' if ( ' + ($useData) + ' === undefined '; - if ($ownProperties) { - out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; - } - out += ') { ' + ($nextValid) + ' = true; } else { '; - } else { - out += ' if (' + ($useData) + ' !== undefined '; - if ($ownProperties) { - out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; - } - out += ' ) { '; - } - } - out += ' ' + ($code) + ' } '; - } - } - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } - } - if ($pPropertyKeys.length) { - var arr5 = $pPropertyKeys; - if (arr5) { - var $pProperty, i5 = -1, - l5 = arr5.length - 1; - while (i5 < l5) { - $pProperty = arr5[i5 += 1]; - var $sch = $pProperties[$pProperty]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - $it.schema = $sch; - $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); - $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); - if ($ownProperties) { - out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; - } else { - out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; - } - out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - out += ' } '; - if ($breakOnError) { - out += ' else ' + ($nextValid) + ' = true; '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } - } - } - if (it.opts.patternGroups && $pgPropertyKeys.length) { - var arr6 = $pgPropertyKeys; - if (arr6) { - var $pgProperty, i6 = -1, - l6 = arr6.length - 1; - while (i6 < l6) { - $pgProperty = arr6[i6 += 1]; - var $pgSchema = $pgProperties[$pgProperty], - $sch = $pgSchema.schema; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - $it.schema = $sch; - $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema'; - $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + it.util.escapeFragment($pgProperty) + '/schema'; - out += ' var pgPropCount' + ($lvl) + ' = 0; '; - if ($ownProperties) { - out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; - } else { - out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; - } - out += ' if (' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ')) { pgPropCount' + ($lvl) + '++; '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - out += ' } '; - if ($breakOnError) { - out += ' else ' + ($nextValid) + ' = true; '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - var $pgMin = $pgSchema.minimum, - $pgMax = $pgSchema.maximum; - if ($pgMin !== undefined || $pgMax !== undefined) { - out += ' var ' + ($valid) + ' = true; '; - var $currErrSchemaPath = $errSchemaPath; - if ($pgMin !== undefined) { - var $limit = $pgMin, - $reason = 'minimum', - $moreOrLess = 'less'; - out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' >= ' + ($pgMin) + '; '; - $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - if ($pgMax !== undefined) { - out += ' else '; - } - } - if ($pgMax !== undefined) { - var $limit = $pgMax, - $reason = 'maximum', - $moreOrLess = 'more'; - out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' <= ' + ($pgMax) + '; '; - $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - } - $errSchemaPath = $currErrSchemaPath; - if ($breakOnError) { - out += ' if (' + ($valid) + ') { '; - $closingBraces += '}'; - } - } - } - } - } - } - if ($breakOnError) { - out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; - } - out = it.util.cleanUpCode(out); - return out; -} - - -/***/ }), -/* 468 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_propertyNames(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - if (it.util.schemaHasRules($schema, it.RULES.all)) { - $it.schema = $schema; - $it.schemaPath = $schemaPath; - $it.errSchemaPath = $errSchemaPath; - var $key = 'key' + $lvl, - $idx = 'idx' + $lvl, - $i = 'i' + $lvl, - $invalidName = '\' + ' + $key + ' + \'', - $dataNxt = $it.dataLevel = it.dataLevel + 1, - $nextData = 'data' + $dataNxt, - $dataProperties = 'dataProperties' + $lvl, - $ownProperties = it.opts.ownProperties, - $currentBaseId = it.baseId; - out += ' var ' + ($errs) + ' = errors; '; - if ($ownProperties) { - out += ' var ' + ($dataProperties) + ' = undefined; '; - } - if ($ownProperties) { - out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; - } else { - out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; - } - out += ' var startErrs' + ($lvl) + ' = errors; '; - var $passData = $key; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + '= it.opts.loopRequired, - $ownProperties = it.opts.ownProperties; - if ($breakOnError) { - out += ' var missing' + ($lvl) + '; '; - if ($loopRequired) { - if (!$isData) { - out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; - } - var $i = 'i' + $lvl, - $propertyPath = 'schema' + $lvl + '[' + $i + ']', - $missingProperty = '\' + ' + $propertyPath + ' + \''; - if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); - } - out += ' var ' + ($valid) + ' = true; '; - if ($isData) { - out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; - } - out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined '; - if ($ownProperties) { - out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; - } - out += '; if (!' + ($valid) + ') break; } '; - if ($isData) { - out += ' } '; - } - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } else { '; - } else { - out += ' if ( '; - var arr2 = $required; - if (arr2) { - var $propertyKey, $i = -1, - l2 = arr2.length - 1; - while ($i < l2) { - $propertyKey = arr2[$i += 1]; - if ($i) { - out += ' || '; - } - var $prop = it.util.getProperty($propertyKey), - $useData = $data + $prop; - out += ' ( ( ' + ($useData) + ' === undefined '; - if ($ownProperties) { - out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; - } - out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; - } - } - out += ') { '; - var $propertyPath = 'missing' + $lvl, - $missingProperty = '\' + ' + $propertyPath + ' + \''; - if (it.opts._errorDataPathProperty) { - it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; - } - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } else { '; - } - } else { - if ($loopRequired) { - if (!$isData) { - out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; - } - var $i = 'i' + $lvl, - $propertyPath = 'schema' + $lvl + '[' + $i + ']', - $missingProperty = '\' + ' + $propertyPath + ' + \''; - if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); - } - if ($isData) { - out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; - } - out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined '; - if ($ownProperties) { - out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; - } - out += ') { var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; - if ($isData) { - out += ' } '; - } - } else { - var arr3 = $required; - if (arr3) { - var $propertyKey, i3 = -1, - l3 = arr3.length - 1; - while (i3 < l3) { - $propertyKey = arr3[i3 += 1]; - var $prop = it.util.getProperty($propertyKey), - $missingProperty = it.util.escapeQuotes($propertyKey), - $useData = $data + $prop; - if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); - } - out += ' if ( ' + ($useData) + ' === undefined '; - if ($ownProperties) { - out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; - } - out += ') { var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; - } - } - } - } - it.errorPath = $currentErrorPath; - } else if ($breakOnError) { - out += ' if (true) {'; - } - return out; -} - - -/***/ }), -/* 471 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - if (($schema || $isData) && it.opts.uniqueItems !== false) { - if ($isData) { - out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; - } - out += ' var ' + ($valid) + ' = true; if (' + ($data) + '.length > 1) { var i = ' + ($data) + '.length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } } '; - if ($isData) { - out += ' } '; - } - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + ($schema); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - if ($breakOnError) { - out += ' else { '; - } - } else { - if ($breakOnError) { - out += ' if (true) { '; - } - } - return out; -} - - -/***/ }), -/* 472 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; -var customRuleCode = __webpack_require__(458); - -module.exports = { - add: addKeyword, - get: getKeyword, - remove: removeKeyword -}; - -/** - * Define custom keyword - * @this Ajv - * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). - * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. - * @return {Ajv} this for method chaining - */ -function addKeyword(keyword, definition) { - /* jshint validthis: true */ - /* eslint no-shadow: 0 */ - var RULES = this.RULES; - - if (RULES.keywords[keyword]) - throw new Error('Keyword ' + keyword + ' is already defined'); - - if (!IDENTIFIER.test(keyword)) - throw new Error('Keyword ' + keyword + ' is not a valid identifier'); - - if (definition) { - if (definition.macro && definition.valid !== undefined) - throw new Error('"valid" option cannot be used with macro keywords'); - - var dataType = definition.type; - if (Array.isArray(dataType)) { - var i, len = dataType.length; - for (i=0; i { - if (typeof x !== 'number') { - throw new TypeError('The `x` argument is required'); - } - - if (typeof y !== 'number') { - return ESC + (x + 1) + 'G'; - } - - return ESC + (y + 1) + ';' + (x + 1) + 'H'; -}; - -x.cursorMove = (x, y) => { - if (typeof x !== 'number') { - throw new TypeError('The `x` argument is required'); - } - - let ret = ''; - - if (x < 0) { - ret += ESC + (-x) + 'D'; - } else if (x > 0) { - ret += ESC + x + 'C'; - } - - if (y < 0) { - ret += ESC + (-y) + 'A'; - } else if (y > 0) { - ret += ESC + y + 'B'; - } - - return ret; -}; - -x.cursorUp = count => ESC + (typeof count === 'number' ? count : 1) + 'A'; -x.cursorDown = count => ESC + (typeof count === 'number' ? count : 1) + 'B'; -x.cursorForward = count => ESC + (typeof count === 'number' ? count : 1) + 'C'; -x.cursorBackward = count => ESC + (typeof count === 'number' ? count : 1) + 'D'; - -x.cursorLeft = ESC + 'G'; -x.cursorSavePosition = ESC + (isTerminalApp ? '7' : 's'); -x.cursorRestorePosition = ESC + (isTerminalApp ? '8' : 'u'); -x.cursorGetPosition = ESC + '6n'; -x.cursorNextLine = ESC + 'E'; -x.cursorPrevLine = ESC + 'F'; -x.cursorHide = ESC + '?25l'; -x.cursorShow = ESC + '?25h'; - -x.eraseLines = count => { - let clear = ''; - - for (let i = 0; i < count; i++) { - clear += x.eraseLine + (i < count - 1 ? x.cursorUp() : ''); - } - - if (count) { - clear += x.cursorLeft; - } - - return clear; -}; - -x.eraseEndLine = ESC + 'K'; -x.eraseStartLine = ESC + '1K'; -x.eraseLine = ESC + '2K'; -x.eraseDown = ESC + 'J'; -x.eraseUp = ESC + '1J'; -x.eraseScreen = ESC + '2J'; -x.scrollUp = ESC + 'S'; -x.scrollDown = ESC + 'T'; - -x.clearScreen = '\u001Bc'; -x.beep = BEL; - -x.link = (text, url) => { - return [ - OSC, - '8', - SEP, - SEP, - url, - BEL, - text, - OSC, - '8', - SEP, - SEP, - BEL - ].join(''); -}; - -x.image = (buf, opts) => { - opts = opts || {}; - - let ret = OSC + '1337;File=inline=1'; - - if (opts.width) { - ret += `;width=${opts.width}`; - } - - if (opts.height) { - ret += `;height=${opts.height}`; - } - - if (opts.preserveAspectRatio === false) { - ret += ';preserveAspectRatio=0'; - } - - return ret + ':' + buf.toString('base64') + BEL; -}; - -x.iTerm = {}; - -x.iTerm.setCwd = cwd => OSC + '50;CurrentDir=' + (cwd || process.cwd()) + BEL; - - -/***/ }), -/* 478 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function () { - return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; -}; - - -/***/ }), -/* 479 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(module) { -const colorConvert = __webpack_require__(606); - -const wrapAnsi16 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => function () { - const rgb = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - gray: [90, 39], - - // Bright color - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Fix humans - styles.color.grey = styles.color.gray; - - for (const groupName of Object.keys(styles)) { - const group = styles[groupName]; - - for (const styleName of Object.keys(group)) { - const style = group[styleName]; - - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - } - - const ansi2ansi = n => n; - const rgb2rgb = (r, g, b) => [r, g, b]; - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - styles.color.ansi = { - ansi: wrapAnsi16(ansi2ansi, 0) - }; - styles.color.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 0) - }; - styles.color.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 0) - }; - - styles.bgColor.ansi = { - ansi: wrapAnsi16(ansi2ansi, 10) - }; - styles.bgColor.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 10) - }; - styles.bgColor.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 10) - }; - - for (let key of Object.keys(colorConvert)) { - if (typeof colorConvert[key] !== 'object') { - continue; - } - - const suite = colorConvert[key]; - - if (key === 'ansi16') { - key = 'ansi'; - } - - if ('ansi16' in suite) { - styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); - styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); - } - - if ('ansi256' in suite) { - styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); - styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); - } - - if ('rgb' in suite) { - styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); - styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); - } - } - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(150)(module))) - -/***/ }), -/* 480 */ -/***/ (function(module, exports) { - -function webpackEmptyContext(req) { - throw new Error("Cannot find module '" + req + "'."); -} -webpackEmptyContext.keys = function() { return []; }; -webpackEmptyContext.resolve = webpackEmptyContext; -module.exports = webpackEmptyContext; -webpackEmptyContext.id = 480; - -/***/ }), -/* 481 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - // global key for user preferred registration -var REGISTRATION_KEY = '@@any-promise/REGISTRATION', - // Prior registration (preferred or detected) - registered = null - -/** - * Registers the given implementation. An implementation must - * be registered prior to any call to `require("any-promise")`, - * typically on application load. - * - * If called with no arguments, will return registration in - * following priority: - * - * For Node.js: - * - * 1. Previous registration - * 2. global.Promise if node.js version >= 0.12 - * 3. Auto detected promise based on first sucessful require of - * known promise libraries. Note this is a last resort, as the - * loaded library is non-deterministic. node.js >= 0.12 will - * always use global.Promise over this priority list. - * 4. Throws error. - * - * For Browser: - * - * 1. Previous registration - * 2. window.Promise - * 3. Throws error. - * - * Options: - * - * Promise: Desired Promise constructor - * global: Boolean - Should the registration be cached in a global variable to - * allow cross dependency/bundle registration? (default true) - */ -module.exports = function(root, loadImplementation){ - return function register(implementation, opts){ - implementation = implementation || null - opts = opts || {} - // global registration unless explicitly {global: false} in options (default true) - var registerGlobal = opts.global !== false; - - // load any previous global registration - if(registered === null && registerGlobal){ - registered = root[REGISTRATION_KEY] || null - } - - if(registered !== null - && implementation !== null - && registered.implementation !== implementation){ - // Throw error if attempting to redefine implementation - throw new Error('any-promise already defined as "'+registered.implementation+ - '". You can only register an implementation before the first '+ - ' call to require("any-promise") and an implementation cannot be changed') - } - - if(registered === null){ - // use provided implementation - if(implementation !== null && typeof opts.Promise !== 'undefined'){ - registered = { - Promise: opts.Promise, - implementation: implementation - } - } else { - // require implementation if implementation is specified but not provided - registered = loadImplementation(implementation) - } - - if(registerGlobal){ - // register preference globally in case multiple installations - root[REGISTRATION_KEY] = registered - } - } - - return registered - } -} - - -/***/ }), -/* 482 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = __webpack_require__(481)(global, loadImplementation); - -/** - * Node.js version of loadImplementation. - * - * Requires the given implementation and returns the registration - * containing {Promise, implementation} - * - * If implementation is undefined or global.Promise, loads it - * Otherwise uses require - */ -function loadImplementation(implementation){ - var impl = null - - if(shouldPreferGlobalPromise(implementation)){ - // if no implementation or env specified use global.Promise - impl = { - Promise: global.Promise, - implementation: 'global.Promise' - } - } else if(implementation){ - // if implementation specified, require it - var lib = !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()) - impl = { - Promise: lib.Promise || lib, - implementation: implementation - } - } else { - // try to auto detect implementation. This is non-deterministic - // and should prefer other branches, but this is our last chance - // to load something without throwing error - impl = tryAutoDetect() - } - - if(impl === null){ - throw new Error('Cannot find any-promise implementation nor'+ - ' global.Promise. You must install polyfill or call'+ - ' require("any-promise/register") with your preferred'+ - ' implementation, e.g. require("any-promise/register/bluebird")'+ - ' on application load prior to any require("any-promise").') - } - - return impl -} - -/** - * Determines if the global.Promise should be preferred if an implementation - * has not been registered. - */ -function shouldPreferGlobalPromise(implementation){ - if(implementation){ - return implementation === 'global.Promise' - } else if(typeof global.Promise !== 'undefined'){ - // Load global promise if implementation not specified - // Versions < 0.11 did not have global Promise - // Do not use for version < 0.12 as version 0.11 contained buggy versions - var version = (/v(\d+)\.(\d+)\.(\d+)/).exec(process.version) - return !(version && +version[1] == 0 && +version[2] < 12) - } - - // do not have global.Promise or another implementation was specified - return false -} - -/** - * Look for common libs as last resort there is no guarantee that - * this will return a desired implementation or even be deterministic. - * The priority is also nearly arbitrary. We are only doing this - * for older versions of Node.js <0.12 that do not have a reasonable - * global.Promise implementation and we the user has not registered - * the preference. This preserves the behavior of any-promise <= 0.1 - * and may be deprecated or removed in the future - */ -function tryAutoDetect(){ - var libs = [ - "es6-promise", - "promise", - "native-promise-only", - "bluebird", - "rsvp", - "when", - "q", - "pinkie", - "lie", - "vow"] - var i = 0, len = libs.length - for(; i < len; i++){ - try { - return loadImplementation(libs[i]) - } catch(e){} - } - return null -} - - -/***/ }), -/* 483 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * arr-flatten - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - - - -module.exports = function (arr) { - return flat(arr, []); -}; - -function flat(arr, res) { - var i = 0, cur; - var len = arr.length; - for (; i < len; i++) { - cur = arr[i]; - Array.isArray(cur) ? flat(cur, res) : res.push(cur); - } - return res; -} - - -/***/ }), -/* 484 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function (arr, predicate, ctx) { - if (typeof Array.prototype.findIndex === 'function') { - return arr.findIndex(predicate, ctx); - } - - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - - var list = Object(arr); - var len = list.length; - - if (len === 0) { - return -1; - } - - for (var i = 0; i < len; i++) { - if (predicate.call(ctx, list[i], i, list)) { - return i; - } - } - - return -1; -}; - - -/***/ }), -/* 485 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var rawAsap = __webpack_require__(486); -var freeTasks = []; - -/** - * Calls a task as soon as possible after returning, in its own event, with - * priority over IO events. An exception thrown in a task can be handled by - * `process.on("uncaughtException") or `domain.on("error")`, but will otherwise - * crash the process. If the error is handled, all subsequent tasks will - * resume. - * - * @param {{call}} task A callable object, typically a function that takes no - * arguments. - */ -module.exports = asap; -function asap(task) { - var rawTask; - if (freeTasks.length) { - rawTask = freeTasks.pop(); - } else { - rawTask = new RawTask(); - } - rawTask.task = task; - rawTask.domain = process.domain; - rawAsap(rawTask); -} - -function RawTask() { - this.task = null; - this.domain = null; -} - -RawTask.prototype.call = function () { - if (this.domain) { - this.domain.enter(); - } - var threw = true; - try { - this.task.call(); - threw = false; - // If the task throws an exception (presumably) Node.js restores the - // domain stack for the next event. - if (this.domain) { - this.domain.exit(); - } - } finally { - // We use try/finally and a threw flag to avoid messing up stack traces - // when we catch and release errors. - if (threw) { - // In Node.js, uncaught exceptions are considered fatal errors. - // Re-throw them to interrupt flushing! - // Ensure that flushing continues if an uncaught exception is - // suppressed listening process.on("uncaughtException") or - // domain.on("error"). - rawAsap.requestFlush(); - } - // If the task threw an error, we do not want to exit the domain here. - // Exiting the domain would prevent the domain from catching the error. - this.task = null; - this.domain = null; - freeTasks.push(this); - } -}; - - - -/***/ }), -/* 486 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var domain; // The domain module is executed on demand -var hasSetImmediate = typeof setImmediate === "function"; - -// Use the fastest means possible to execute a task in its own turn, with -// priority over other events including network IO events in Node.js. -// -// An exception thrown by a task will permanently interrupt the processing of -// subsequent tasks. The higher level `asap` function ensures that if an -// exception is thrown by a task, that the task queue will continue flushing as -// soon as possible, but if you use `rawAsap` directly, you are responsible to -// either ensure that no exceptions are thrown from your task, or to manually -// call `rawAsap.requestFlush` if an exception is thrown. -module.exports = rawAsap; -function rawAsap(task) { - if (!queue.length) { - requestFlush(); - flushing = true; - } - // Avoids a function call - queue[queue.length] = task; -} - -var queue = []; -// Once a flush has been requested, no further calls to `requestFlush` are -// necessary until the next `flush` completes. -var flushing = false; -// The position of the next task to execute in the task queue. This is -// preserved between calls to `flush` so that it can be resumed if -// a task throws an exception. -var index = 0; -// If a task schedules additional tasks recursively, the task queue can grow -// unbounded. To prevent memory excaustion, the task queue will periodically -// truncate already-completed tasks. -var capacity = 1024; - -// The flush function processes all tasks that have been scheduled with -// `rawAsap` unless and until one of those tasks throws an exception. -// If a task throws an exception, `flush` ensures that its state will remain -// consistent and will resume where it left off when called again. -// However, `flush` does not make any arrangements to be called again if an -// exception is thrown. -function flush() { - while (index < queue.length) { - var currentIndex = index; - // Advance the index before calling the task. This ensures that we will - // begin flushing on the next task the task throws an error. - index = index + 1; - queue[currentIndex].call(); - // Prevent leaking memory for long chains of recursive calls to `asap`. - // If we call `asap` within tasks scheduled by `asap`, the queue will - // grow, but to avoid an O(n) walk for every task we execute, we don't - // shift tasks off the queue after they have been executed. - // Instead, we periodically shift 1024 tasks off the queue. - if (index > capacity) { - // Manually shift all values starting at the index back to the - // beginning of the queue. - for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { - queue[scan] = queue[scan + index]; - } - queue.length -= index; - index = 0; - } - } - queue.length = 0; - index = 0; - flushing = false; -} - -rawAsap.requestFlush = requestFlush; -function requestFlush() { - // Ensure flushing is not bound to any domain. - // It is not sufficient to exit the domain, because domains exist on a stack. - // To execute code outside of any domain, the following dance is necessary. - var parentDomain = process.domain; - if (parentDomain) { - if (!domain) { - // Lazy execute the domain module. - // Only employed if the user elects to use domains. - domain = __webpack_require__(1038); - } - domain.active = process.domain = null; - } - - // `setImmediate` is slower that `process.nextTick`, but `process.nextTick` - // cannot handle recursion. - // `requestFlush` will only be called recursively from `asap.js`, to resume - // flushing after an error is thrown into a domain. - // Conveniently, `setImmediate` was introduced in the same version - // `process.nextTick` started throwing recursion errors. - if (flushing && hasSetImmediate) { - setImmediate(flush); - } else { - process.nextTick(flush); - } - - if (parentDomain) { - domain.active = process.domain = parentDomain; - } -} - - -/***/ }), -/* 487 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2011 Mark Cavage All rights reserved. - -var errors = __webpack_require__(193); -var types = __webpack_require__(194); - -var Reader = __webpack_require__(488); -var Writer = __webpack_require__(489); - - -// --- Exports - -module.exports = { - - Reader: Reader, - - Writer: Writer - -}; - -for (var t in types) { - if (types.hasOwnProperty(t)) - module.exports[t] = types[t]; -} -for (var e in errors) { - if (errors.hasOwnProperty(e)) - module.exports[e] = errors[e]; -} - - -/***/ }), -/* 488 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2011 Mark Cavage All rights reserved. - -var assert = __webpack_require__(50); -var Buffer = __webpack_require__(20).Buffer; - -var ASN1 = __webpack_require__(194); -var errors = __webpack_require__(193); - - -// --- Globals - -var newInvalidAsn1Error = errors.newInvalidAsn1Error; - - - -// --- API - -function Reader(data) { - if (!data || !Buffer.isBuffer(data)) - throw new TypeError('data must be a node Buffer'); - - this._buf = data; - this._size = data.length; - - // These hold the "current" state - this._len = 0; - this._offset = 0; -} - -Object.defineProperty(Reader.prototype, 'length', { - enumerable: true, - get: function () { return (this._len); } -}); - -Object.defineProperty(Reader.prototype, 'offset', { - enumerable: true, - get: function () { return (this._offset); } -}); - -Object.defineProperty(Reader.prototype, 'remain', { - get: function () { return (this._size - this._offset); } -}); - -Object.defineProperty(Reader.prototype, 'buffer', { - get: function () { return (this._buf.slice(this._offset)); } -}); - - -/** - * Reads a single byte and advances offset; you can pass in `true` to make this - * a "peek" operation (i.e., get the byte, but don't advance the offset). - * - * @param {Boolean} peek true means don't move offset. - * @return {Number} the next byte, null if not enough data. - */ -Reader.prototype.readByte = function (peek) { - if (this._size - this._offset < 1) - return null; - - var b = this._buf[this._offset] & 0xff; - - if (!peek) - this._offset += 1; - - return b; -}; - - -Reader.prototype.peek = function () { - return this.readByte(true); -}; - - -/** - * Reads a (potentially) variable length off the BER buffer. This call is - * not really meant to be called directly, as callers have to manipulate - * the internal buffer afterwards. - * - * As a result of this call, you can call `Reader.length`, until the - * next thing called that does a readLength. - * - * @return {Number} the amount of offset to advance the buffer. - * @throws {InvalidAsn1Error} on bad ASN.1 - */ -Reader.prototype.readLength = function (offset) { - if (offset === undefined) - offset = this._offset; - - if (offset >= this._size) - return null; - - var lenB = this._buf[offset++] & 0xff; - if (lenB === null) - return null; - - if ((lenB & 0x80) === 0x80) { - lenB &= 0x7f; - - if (lenB === 0) - throw newInvalidAsn1Error('Indefinite length not supported'); - - if (lenB > 4) - throw newInvalidAsn1Error('encoding too long'); - - if (this._size - offset < lenB) - return null; - - this._len = 0; - for (var i = 0; i < lenB; i++) - this._len = (this._len << 8) + (this._buf[offset++] & 0xff); - - } else { - // Wasn't a variable length - this._len = lenB; - } - - return offset; -}; - - -/** - * Parses the next sequence in this BER buffer. - * - * To get the length of the sequence, call `Reader.length`. - * - * @return {Number} the sequence's tag. - */ -Reader.prototype.readSequence = function (tag) { - var seq = this.peek(); - if (seq === null) - return null; - if (tag !== undefined && tag !== seq) - throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + - ': got 0x' + seq.toString(16)); - - var o = this.readLength(this._offset + 1); // stored in `length` - if (o === null) - return null; - - this._offset = o; - return seq; -}; - - -Reader.prototype.readInt = function () { - return this._readTag(ASN1.Integer); -}; - - -Reader.prototype.readBoolean = function () { - return (this._readTag(ASN1.Boolean) === 0 ? false : true); -}; - - -Reader.prototype.readEnumeration = function () { - return this._readTag(ASN1.Enumeration); -}; - - -Reader.prototype.readString = function (tag, retbuf) { - if (!tag) - tag = ASN1.OctetString; - - var b = this.peek(); - if (b === null) - return null; - - if (b !== tag) - throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + - ': got 0x' + b.toString(16)); - - var o = this.readLength(this._offset + 1); // stored in `length` - - if (o === null) - return null; - - if (this.length > this._size - o) - return null; - - this._offset = o; - - if (this.length === 0) - return retbuf ? Buffer.alloc(0) : ''; - - var str = this._buf.slice(this._offset, this._offset + this.length); - this._offset += this.length; - - return retbuf ? str : str.toString('utf8'); -}; - -Reader.prototype.readOID = function (tag) { - if (!tag) - tag = ASN1.OID; - - var b = this.readString(tag, true); - if (b === null) - return null; - - var values = []; - var value = 0; - - for (var i = 0; i < b.length; i++) { - var byte = b[i] & 0xff; - - value <<= 7; - value += byte & 0x7f; - if ((byte & 0x80) === 0) { - values.push(value); - value = 0; - } - } - - value = values.shift(); - values.unshift(value % 40); - values.unshift((value / 40) >> 0); - - return values.join('.'); -}; - - -Reader.prototype._readTag = function (tag) { - assert.ok(tag !== undefined); - - var b = this.peek(); - - if (b === null) - return null; - - if (b !== tag) - throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + - ': got 0x' + b.toString(16)); - - var o = this.readLength(this._offset + 1); // stored in `length` - if (o === null) - return null; - - if (this.length > 4) - throw newInvalidAsn1Error('Integer too long: ' + this.length); - - if (this.length > this._size - o) - return null; - this._offset = o; - - var fb = this._buf[this._offset]; - var value = 0; - - for (var i = 0; i < this.length; i++) { - value <<= 8; - value |= (this._buf[this._offset++] & 0xff); - } - - if ((fb & 0x80) === 0x80 && i !== 4) - value -= (1 << (i * 8)); - - return value >> 0; -}; - - - -// --- Exported API - -module.exports = Reader; - - -/***/ }), -/* 489 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2011 Mark Cavage All rights reserved. - -var assert = __webpack_require__(50); -var Buffer = __webpack_require__(20).Buffer; -var ASN1 = __webpack_require__(194); -var errors = __webpack_require__(193); - - -// --- Globals - -var newInvalidAsn1Error = errors.newInvalidAsn1Error; - -var DEFAULT_OPTS = { - size: 1024, - growthFactor: 8 -}; - - -// --- Helpers - -function merge(from, to) { - assert.ok(from); - assert.equal(typeof (from), 'object'); - assert.ok(to); - assert.equal(typeof (to), 'object'); - - var keys = Object.getOwnPropertyNames(from); - keys.forEach(function (key) { - if (to[key]) - return; - - var value = Object.getOwnPropertyDescriptor(from, key); - Object.defineProperty(to, key, value); - }); - - return to; -} - - - -// --- API - -function Writer(options) { - options = merge(DEFAULT_OPTS, options || {}); - - this._buf = Buffer.alloc(options.size || 1024); - this._size = this._buf.length; - this._offset = 0; - this._options = options; - - // A list of offsets in the buffer where we need to insert - // sequence tag/len pairs. - this._seq = []; -} - -Object.defineProperty(Writer.prototype, 'buffer', { - get: function () { - if (this._seq.length) - throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)'); - - return (this._buf.slice(0, this._offset)); - } -}); - -Writer.prototype.writeByte = function (b) { - if (typeof (b) !== 'number') - throw new TypeError('argument must be a Number'); - - this._ensure(1); - this._buf[this._offset++] = b; -}; - - -Writer.prototype.writeInt = function (i, tag) { - if (typeof (i) !== 'number') - throw new TypeError('argument must be a Number'); - if (typeof (tag) !== 'number') - tag = ASN1.Integer; - - var sz = 4; - - while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) && - (sz > 1)) { - sz--; - i <<= 8; - } - - if (sz > 4) - throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff'); - - this._ensure(2 + sz); - this._buf[this._offset++] = tag; - this._buf[this._offset++] = sz; - - while (sz-- > 0) { - this._buf[this._offset++] = ((i & 0xff000000) >>> 24); - i <<= 8; - } - -}; - - -Writer.prototype.writeNull = function () { - this.writeByte(ASN1.Null); - this.writeByte(0x00); -}; - - -Writer.prototype.writeEnumeration = function (i, tag) { - if (typeof (i) !== 'number') - throw new TypeError('argument must be a Number'); - if (typeof (tag) !== 'number') - tag = ASN1.Enumeration; - - return this.writeInt(i, tag); -}; - - -Writer.prototype.writeBoolean = function (b, tag) { - if (typeof (b) !== 'boolean') - throw new TypeError('argument must be a Boolean'); - if (typeof (tag) !== 'number') - tag = ASN1.Boolean; - - this._ensure(3); - this._buf[this._offset++] = tag; - this._buf[this._offset++] = 0x01; - this._buf[this._offset++] = b ? 0xff : 0x00; -}; - - -Writer.prototype.writeString = function (s, tag) { - if (typeof (s) !== 'string') - throw new TypeError('argument must be a string (was: ' + typeof (s) + ')'); - if (typeof (tag) !== 'number') - tag = ASN1.OctetString; - - var len = Buffer.byteLength(s); - this.writeByte(tag); - this.writeLength(len); - if (len) { - this._ensure(len); - this._buf.write(s, this._offset); - this._offset += len; - } -}; - - -Writer.prototype.writeBuffer = function (buf, tag) { - if (typeof (tag) !== 'number') - throw new TypeError('tag must be a number'); - if (!Buffer.isBuffer(buf)) - throw new TypeError('argument must be a buffer'); - - this.writeByte(tag); - this.writeLength(buf.length); - this._ensure(buf.length); - buf.copy(this._buf, this._offset, 0, buf.length); - this._offset += buf.length; -}; - - -Writer.prototype.writeStringArray = function (strings) { - if ((!strings instanceof Array)) - throw new TypeError('argument must be an Array[String]'); - - var self = this; - strings.forEach(function (s) { - self.writeString(s); - }); -}; - -// This is really to solve DER cases, but whatever for now -Writer.prototype.writeOID = function (s, tag) { - if (typeof (s) !== 'string') - throw new TypeError('argument must be a string'); - if (typeof (tag) !== 'number') - tag = ASN1.OID; - - if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) - throw new Error('argument is not a valid OID string'); - - function encodeOctet(bytes, octet) { - if (octet < 128) { - bytes.push(octet); - } else if (octet < 16384) { - bytes.push((octet >>> 7) | 0x80); - bytes.push(octet & 0x7F); - } else if (octet < 2097152) { - bytes.push((octet >>> 14) | 0x80); - bytes.push(((octet >>> 7) | 0x80) & 0xFF); - bytes.push(octet & 0x7F); - } else if (octet < 268435456) { - bytes.push((octet >>> 21) | 0x80); - bytes.push(((octet >>> 14) | 0x80) & 0xFF); - bytes.push(((octet >>> 7) | 0x80) & 0xFF); - bytes.push(octet & 0x7F); - } else { - bytes.push(((octet >>> 28) | 0x80) & 0xFF); - bytes.push(((octet >>> 21) | 0x80) & 0xFF); - bytes.push(((octet >>> 14) | 0x80) & 0xFF); - bytes.push(((octet >>> 7) | 0x80) & 0xFF); - bytes.push(octet & 0x7F); - } - } - - var tmp = s.split('.'); - var bytes = []; - bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); - tmp.slice(2).forEach(function (b) { - encodeOctet(bytes, parseInt(b, 10)); - }); - - var self = this; - this._ensure(2 + bytes.length); - this.writeByte(tag); - this.writeLength(bytes.length); - bytes.forEach(function (b) { - self.writeByte(b); - }); -}; - - -Writer.prototype.writeLength = function (len) { - if (typeof (len) !== 'number') - throw new TypeError('argument must be a Number'); - - this._ensure(4); - - if (len <= 0x7f) { - this._buf[this._offset++] = len; - } else if (len <= 0xff) { - this._buf[this._offset++] = 0x81; - this._buf[this._offset++] = len; - } else if (len <= 0xffff) { - this._buf[this._offset++] = 0x82; - this._buf[this._offset++] = len >> 8; - this._buf[this._offset++] = len; - } else if (len <= 0xffffff) { - this._buf[this._offset++] = 0x83; - this._buf[this._offset++] = len >> 16; - this._buf[this._offset++] = len >> 8; - this._buf[this._offset++] = len; - } else { - throw newInvalidAsn1Error('Length too long (> 4 bytes)'); - } -}; - -Writer.prototype.startSequence = function (tag) { - if (typeof (tag) !== 'number') - tag = ASN1.Sequence | ASN1.Constructor; - - this.writeByte(tag); - this._seq.push(this._offset); - this._ensure(3); - this._offset += 3; -}; - - -Writer.prototype.endSequence = function () { - var seq = this._seq.pop(); - var start = seq + 3; - var len = this._offset - start; - - if (len <= 0x7f) { - this._shift(start, len, -2); - this._buf[seq] = len; - } else if (len <= 0xff) { - this._shift(start, len, -1); - this._buf[seq] = 0x81; - this._buf[seq + 1] = len; - } else if (len <= 0xffff) { - this._buf[seq] = 0x82; - this._buf[seq + 1] = len >> 8; - this._buf[seq + 2] = len; - } else if (len <= 0xffffff) { - this._shift(start, len, 1); - this._buf[seq] = 0x83; - this._buf[seq + 1] = len >> 16; - this._buf[seq + 2] = len >> 8; - this._buf[seq + 3] = len; - } else { - throw newInvalidAsn1Error('Sequence too long'); - } -}; - - -Writer.prototype._shift = function (start, len, shift) { - assert.ok(start !== undefined); - assert.ok(len !== undefined); - assert.ok(shift); - - this._buf.copy(this._buf, start + shift, start, start + len); - this._offset += shift; -}; - -Writer.prototype._ensure = function (len) { - assert.ok(len); - - if (this._size - this._offset < len) { - var sz = this._size * this._options.growthFactor; - if (sz - this._offset < len) - sz += len; - - var buf = Buffer.alloc(sz); - - this._buf.copy(buf, 0, 0, this._offset); - this._buf = buf; - this._size = sz; - } -}; - - - -// --- Exported API - -module.exports = Writer; - - -/***/ }), -/* 490 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = -{ - parallel : __webpack_require__(492), - serial : __webpack_require__(493), - serialOrdered : __webpack_require__(290) -}; - - -/***/ }), -/* 491 */ -/***/ (function(module, exports) { - -module.exports = defer; - -/** - * Runs provided function on next iteration of the event loop - * - * @param {function} fn - function to run - */ -function defer(fn) -{ - var nextTick = typeof setImmediate == 'function' - ? setImmediate - : ( - typeof process == 'object' && typeof process.nextTick == 'function' - ? process.nextTick - : null - ); - - if (nextTick) - { - nextTick(fn); - } - else - { - setTimeout(fn, 0); - } -} - - -/***/ }), -/* 492 */ -/***/ (function(module, exports, __webpack_require__) { - -var iterate = __webpack_require__(287) - , initState = __webpack_require__(288) - , terminator = __webpack_require__(289) - ; - -// Public API -module.exports = parallel; - -/** - * Runs iterator over provided array elements in parallel - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function parallel(list, iterator, callback) -{ - var state = initState(list); - - while (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, function(error, result) - { - if (error) - { - callback(error, result); - return; - } - - // looks like it's the last one - if (Object.keys(state.jobs).length === 0) - { - callback(null, state.results); - return; - } - }); - - state.index++; - } - - return terminator.bind(state, callback); -} - - -/***/ }), -/* 493 */ -/***/ (function(module, exports, __webpack_require__) { - -var serialOrdered = __webpack_require__(290); - -// Public API -module.exports = serial; - -/** - * Runs iterator over provided array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serial(list, iterator, callback) -{ - return serialOrdered(list, iterator, null, callback); -} - - -/***/ }), -/* 494 */ -/***/ (function(module, exports, __webpack_require__) { - - -/*! - * Copyright 2010 LearnBoost - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Module dependencies. - */ - -var crypto = __webpack_require__(21) - , parse = __webpack_require__(29).parse - ; - -/** - * Valid keys. - */ - -var keys = - [ 'acl' - , 'location' - , 'logging' - , 'notification' - , 'partNumber' - , 'policy' - , 'requestPayment' - , 'torrent' - , 'uploadId' - , 'uploads' - , 'versionId' - , 'versioning' - , 'versions' - , 'website' - ] - -/** - * Return an "Authorization" header value with the given `options` - * in the form of "AWS :" - * - * @param {Object} options - * @return {String} - * @api private - */ - -function authorization (options) { - return 'AWS ' + options.key + ':' + sign(options) -} - -module.exports = authorization -module.exports.authorization = authorization - -/** - * Simple HMAC-SHA1 Wrapper - * - * @param {Object} options - * @return {String} - * @api private - */ - -function hmacSha1 (options) { - return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') -} - -module.exports.hmacSha1 = hmacSha1 - -/** - * Create a base64 sha1 HMAC for `options`. - * - * @param {Object} options - * @return {String} - * @api private - */ - -function sign (options) { - options.message = stringToSign(options) - return hmacSha1(options) -} -module.exports.sign = sign - -/** - * Create a base64 sha1 HMAC for `options`. - * - * Specifically to be used with S3 presigned URLs - * - * @param {Object} options - * @return {String} - * @api private - */ - -function signQuery (options) { - options.message = queryStringToSign(options) - return hmacSha1(options) -} -module.exports.signQuery= signQuery - -/** - * Return a string for sign() with the given `options`. - * - * Spec: - * - * \n - * \n - * \n - * \n - * [headers\n] - * - * - * @param {Object} options - * @return {String} - * @api private - */ - -function stringToSign (options) { - var headers = options.amazonHeaders || '' - if (headers) headers += '\n' - var r = - [ options.verb - , options.md5 - , options.contentType - , options.date ? options.date.toUTCString() : '' - , headers + options.resource - ] - return r.join('\n') -} -module.exports.stringToSign = stringToSign - -/** - * Return a string for sign() with the given `options`, but is meant exclusively - * for S3 presigned URLs - * - * Spec: - * - * \n - * - * - * @param {Object} options - * @return {String} - * @api private - */ - -function queryStringToSign (options){ - return 'GET\n\n\n' + options.date + '\n' + options.resource -} -module.exports.queryStringToSign = queryStringToSign - -/** - * Perform the following: - * - * - ignore non-amazon headers - * - lowercase fields - * - sort lexicographically - * - trim whitespace between ":" - * - join with newline - * - * @param {Object} headers - * @return {String} - * @api private - */ - -function canonicalizeHeaders (headers) { - var buf = [] - , fields = Object.keys(headers) - ; - for (var i = 0, len = fields.length; i < len; ++i) { - var field = fields[i] - , val = headers[field] - , field = field.toLowerCase() - ; - if (0 !== field.indexOf('x-amz')) continue - buf.push(field + ':' + val) - } - return buf.sort().join('\n') -} -module.exports.canonicalizeHeaders = canonicalizeHeaders - -/** - * Perform the following: - * - * - ignore non sub-resources - * - sort lexicographically - * - * @param {String} resource - * @return {String} - * @api private - */ - -function canonicalizeResource (resource) { - var url = parse(resource, true) - , path = url.pathname - , buf = [] - ; - - Object.keys(url.query).forEach(function(key){ - if (!~keys.indexOf(key)) return - var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) - buf.push(key + val) - }) - - return path + (buf.length ? '?' + buf.sort().join('&') : '') -} -module.exports.canonicalizeResource = canonicalizeResource - - -/***/ }), -/* 495 */ -/***/ (function(module, exports, __webpack_require__) { - -var aws4 = exports, - url = __webpack_require__(29), - querystring = __webpack_require__(185), - crypto = __webpack_require__(21), - lru = __webpack_require__(496), - credentialsCache = lru(1000) - -// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html - -function hmac(key, string, encoding) { - return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) -} - -function hash(string, encoding) { - return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) -} - -// This function assumes the string has already been percent encoded -function encodeRfc3986(urlEncodedString) { - return urlEncodedString.replace(/[!'()*]/g, function(c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) -} - -// request: { path | body, [host], [method], [headers], [service], [region] } -// credentials: { accessKeyId, secretAccessKey, [sessionToken] } -function RequestSigner(request, credentials) { - - if (typeof request === 'string') request = url.parse(request) - - var headers = request.headers = (request.headers || {}), - hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host) - - this.request = request - this.credentials = credentials || this.defaultCredentials() - - this.service = request.service || hostParts[0] || '' - this.region = request.region || hostParts[1] || 'us-east-1' - - // SES uses a different domain from the service name - if (this.service === 'email') this.service = 'ses' - - if (!request.method && request.body) - request.method = 'POST' - - if (!headers.Host && !headers.host) { - headers.Host = request.hostname || request.host || this.createHost() - - // If a port is specified explicitly, use it as is - if (request.port) - headers.Host += ':' + request.port - } - if (!request.hostname && !request.host) - request.hostname = headers.Host || headers.host - - this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' -} - -RequestSigner.prototype.matchHost = function(host) { - var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/) - var hostParts = (match || []).slice(1, 3) - - // ES's hostParts are sometimes the other way round, if the value that is expected - // to be region equals ‘es’ switch them back - // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com - if (hostParts[1] === 'es') - hostParts = hostParts.reverse() - - return hostParts -} - -// http://docs.aws.amazon.com/general/latest/gr/rande.html -RequestSigner.prototype.isSingleRegion = function() { - // Special case for S3 and SimpleDB in us-east-1 - if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true - - return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] - .indexOf(this.service) >= 0 -} - -RequestSigner.prototype.createHost = function() { - var region = this.isSingleRegion() ? '' : - (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region, - service = this.service === 'ses' ? 'email' : this.service - return service + region + '.amazonaws.com' -} - -RequestSigner.prototype.prepareRequest = function() { - this.parsePath() - - var request = this.request, headers = request.headers, query - - if (request.signQuery) { - - this.parsedPath.query = query = this.parsedPath.query || {} - - if (this.credentials.sessionToken) - query['X-Amz-Security-Token'] = this.credentials.sessionToken - - if (this.service === 's3' && !query['X-Amz-Expires']) - query['X-Amz-Expires'] = 86400 - - if (query['X-Amz-Date']) - this.datetime = query['X-Amz-Date'] - else - query['X-Amz-Date'] = this.getDateTime() - - query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' - query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() - query['X-Amz-SignedHeaders'] = this.signedHeaders() - - } else { - - if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { - if (request.body && !headers['Content-Type'] && !headers['content-type']) - headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' - - if (request.body && !headers['Content-Length'] && !headers['content-length']) - headers['Content-Length'] = Buffer.byteLength(request.body) - - if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) - headers['X-Amz-Security-Token'] = this.credentials.sessionToken - - if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) - headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') - - if (headers['X-Amz-Date'] || headers['x-amz-date']) - this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] - else - headers['X-Amz-Date'] = this.getDateTime() - } - - delete headers.Authorization - delete headers.authorization - } -} - -RequestSigner.prototype.sign = function() { - if (!this.parsedPath) this.prepareRequest() - - if (this.request.signQuery) { - this.parsedPath.query['X-Amz-Signature'] = this.signature() - } else { - this.request.headers.Authorization = this.authHeader() - } - - this.request.path = this.formatPath() - - return this.request -} - -RequestSigner.prototype.getDateTime = function() { - if (!this.datetime) { - var headers = this.request.headers, - date = new Date(headers.Date || headers.date || new Date) - - this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') - - // Remove the trailing 'Z' on the timestamp string for CodeCommit git access - if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) - } - return this.datetime -} - -RequestSigner.prototype.getDate = function() { - return this.getDateTime().substr(0, 8) -} - -RequestSigner.prototype.authHeader = function() { - return [ - 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), - 'SignedHeaders=' + this.signedHeaders(), - 'Signature=' + this.signature(), - ].join(', ') -} - -RequestSigner.prototype.signature = function() { - var date = this.getDate(), - cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), - kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) - if (!kCredentials) { - kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) - kRegion = hmac(kDate, this.region) - kService = hmac(kRegion, this.service) - kCredentials = hmac(kService, 'aws4_request') - credentialsCache.set(cacheKey, kCredentials) - } - return hmac(kCredentials, this.stringToSign(), 'hex') -} - -RequestSigner.prototype.stringToSign = function() { - return [ - 'AWS4-HMAC-SHA256', - this.getDateTime(), - this.credentialString(), - hash(this.canonicalString(), 'hex'), - ].join('\n') -} - -RequestSigner.prototype.canonicalString = function() { - if (!this.parsedPath) this.prepareRequest() - - var pathStr = this.parsedPath.path, - query = this.parsedPath.query, - headers = this.request.headers, - queryStr = '', - normalizePath = this.service !== 's3', - decodePath = this.service === 's3' || this.request.doNotEncodePath, - decodeSlashesInPath = this.service === 's3', - firstValOnly = this.service === 's3', - bodyHash - - if (this.service === 's3' && this.request.signQuery) { - bodyHash = 'UNSIGNED-PAYLOAD' - } else if (this.isCodeCommitGit) { - bodyHash = '' - } else { - bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || - hash(this.request.body || '', 'hex') - } - - if (query) { - queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { - if (!key) return obj - obj[key] = !Array.isArray(query[key]) ? query[key] : - (firstValOnly ? query[key][0] : query[key].slice().sort()) - return obj - }, {}))) - } - if (pathStr !== '/') { - if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') - pathStr = pathStr.split('/').reduce(function(path, piece) { - if (normalizePath && piece === '..') { - path.pop() - } else if (!normalizePath || piece !== '.') { - if (decodePath) piece = decodeURIComponent(piece) - path.push(encodeRfc3986(encodeURIComponent(piece))) - } - return path - }, []).join('/') - if (pathStr[0] !== '/') pathStr = '/' + pathStr - if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') - } - - return [ - this.request.method || 'GET', - pathStr, - queryStr, - this.canonicalHeaders() + '\n', - this.signedHeaders(), - bodyHash, - ].join('\n') -} - -RequestSigner.prototype.canonicalHeaders = function() { - var headers = this.request.headers - function trimAll(header) { - return header.toString().trim().replace(/\s+/g, ' ') - } - return Object.keys(headers) - .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) - .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) - .join('\n') -} - -RequestSigner.prototype.signedHeaders = function() { - return Object.keys(this.request.headers) - .map(function(key) { return key.toLowerCase() }) - .sort() - .join(';') -} - -RequestSigner.prototype.credentialString = function() { - return [ - this.getDate(), - this.region, - this.service, - 'aws4_request', - ].join('/') -} - -RequestSigner.prototype.defaultCredentials = function() { - var env = process.env - return { - accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, - secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, - sessionToken: env.AWS_SESSION_TOKEN, - } -} - -RequestSigner.prototype.parsePath = function() { - var path = this.request.path || '/', - queryIx = path.indexOf('?'), - query = null - - if (queryIx >= 0) { - query = querystring.parse(path.slice(queryIx + 1)) - path = path.slice(0, queryIx) - } - - // S3 doesn't always encode characters > 127 correctly and - // all services don't encode characters > 255 correctly - // So if there are non-reserved chars (and it's not already all % encoded), just encode them all - if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) { - path = path.split('/').map(function(piece) { - return encodeURIComponent(decodeURIComponent(piece)) - }).join('/') - } - - this.parsedPath = { - path: path, - query: query, - } -} - -RequestSigner.prototype.formatPath = function() { - var path = this.parsedPath.path, - query = this.parsedPath.query - - if (!query) return path - - // Services don't support empty query string keys - if (query[''] != null) delete query[''] - - return path + '?' + encodeRfc3986(querystring.stringify(query)) -} - -aws4.RequestSigner = RequestSigner - -aws4.sign = function(request, credentials) { - return new RequestSigner(request, credentials).sign() -} - - -/***/ }), -/* 496 */ -/***/ (function(module, exports) { - -module.exports = function(size) { - return new LruCache(size) -} - -function LruCache(size) { - this.capacity = size | 0 - this.map = Object.create(null) - this.list = new DoublyLinkedList() -} - -LruCache.prototype.get = function(key) { - var node = this.map[key] - if (node == null) return undefined - this.used(node) - return node.val -} - -LruCache.prototype.set = function(key, val) { - var node = this.map[key] - if (node != null) { - node.val = val - } else { - if (!this.capacity) this.prune() - if (!this.capacity) return false - node = new DoublyLinkedNode(key, val) - this.map[key] = node - this.capacity-- - } - this.used(node) - return true -} - -LruCache.prototype.used = function(node) { - this.list.moveToFront(node) -} - -LruCache.prototype.prune = function() { - var node = this.list.pop() - if (node != null) { - delete this.map[node.key] - this.capacity++ - } -} - - -function DoublyLinkedList() { - this.firstNode = null - this.lastNode = null -} - -DoublyLinkedList.prototype.moveToFront = function(node) { - if (this.firstNode == node) return - - this.remove(node) - - if (this.firstNode == null) { - this.firstNode = node - this.lastNode = node - node.prev = null - node.next = null - } else { - node.prev = null - node.next = this.firstNode - node.next.prev = node - this.firstNode = node - } -} - -DoublyLinkedList.prototype.pop = function() { - var lastNode = this.lastNode - if (lastNode != null) { - this.remove(lastNode) - } - return lastNode -} - -DoublyLinkedList.prototype.remove = function(node) { - if (this.firstNode == node) { - this.firstNode = node.next - } else if (node.prev != null) { - node.prev.next = node.next - } - if (this.lastNode == node) { - this.lastNode = node.prev - } else if (node.next != null) { - node.next.prev = node.prev - } -} - - -function DoublyLinkedNode(key, val) { - this.key = key - this.val = val - this.prev = null - this.next = null -} - - -/***/ }), -/* 497 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _ = __webpack_require__(45); - -/** - * Choice object - * Normalize input as choice object - * @constructor - * @param {String|Object} val Choice value. If an object is passed, it should contains - * at least one of `value` or `name` property - */ - -module.exports = function Choice(val, answers) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Choice); - - // Don't process Choice and Separator object - if (val instanceof Choice || val.type === 'separator') { - return val; - } - - if (_.isString(val)) { - this.name = val; - this.value = val; - this.short = val; - } else { - _.extend(this, val, { - name: val.name || val.value, - value: 'value' in val ? val.value : val.name, - short: val.short || val.name || val.value - }); - } - - if (_.isFunction(val.disabled)) { - this.disabled = val.disabled(answers); - } else { - this.disabled = val.disabled; - } -}; - -/***/ }), -/* 498 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var assert = __webpack_require__(50); -var _ = __webpack_require__(45); -var Separator = __webpack_require__(152); -var Choice = __webpack_require__(497); - -/** - * Choices collection - * Collection of multiple `choice` object - * @constructor - * @param {Array} choices All `choice` to keep in the collection - */ - -module.exports = function () { - function Choices(choices, answers) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Choices); - - this.choices = choices.map(function (val) { - if (val.type === 'separator') { - if (!(val instanceof Separator)) { - val = new Separator(val.line); - } - return val; - } - return new Choice(val, answers); - }); - - this.realChoices = this.choices.filter(Separator.exclude).filter(function (item) { - return !item.disabled; - }); - - Object.defineProperty(this, 'length', { - get() { - return this.choices.length; - }, - set(val) { - this.choices.length = val; - } - }); - - Object.defineProperty(this, 'realLength', { - get() { - return this.realChoices.length; - }, - set() { - throw new Error('Cannot set `realLength` of a Choices collection'); - } - }); - } - - /** - * Get a valid choice from the collection - * @param {Number} selector The selected choice index - * @return {Choice|Undefined} Return the matched choice or undefined - */ - - Choices.prototype.getChoice = function getChoice(selector) { - assert(_.isNumber(selector)); - return this.realChoices[selector]; - }; - - /** - * Get a raw element from the collection - * @param {Number} selector The selected index value - * @return {Choice|Undefined} Return the matched choice or undefined - */ - - Choices.prototype.get = function get(selector) { - assert(_.isNumber(selector)); - return this.choices[selector]; - }; - - /** - * Match the valid choices against a where clause - * @param {Object} whereClause Lodash `where` clause - * @return {Array} Matching choices or empty array - */ - - Choices.prototype.where = function where(whereClause) { - return _.filter(this.realChoices, whereClause); - }; - - /** - * Pluck a particular key from the choices - * @param {String} propertyName Property name to select - * @return {Array} Selected properties - */ - - Choices.prototype.pluck = function pluck(propertyName) { - return _.map(this.realChoices, propertyName); - }; - - // Expose usual Array methods - - - Choices.prototype.indexOf = function indexOf() { - return this.choices.indexOf.apply(this.choices, arguments); - }; - - Choices.prototype.forEach = function forEach() { - return this.choices.forEach.apply(this.choices, arguments); - }; - - Choices.prototype.filter = function filter() { - return this.choices.filter.apply(this.choices, arguments); - }; - - Choices.prototype.find = function find(func) { - return _.find(this.choices, func); - }; - - Choices.prototype.push = function push() { - var objs = _.map(arguments, function (val) { - return new Choice(val); - }); - this.choices.push.apply(this.choices, objs); - this.realChoices = this.choices.filter(Separator.exclude); - return this.choices; - }; - - return Choices; -}(); - -/***/ }), -/* 499 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * `list` type prompt - */ - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _ = __webpack_require__(45); -var chalk = __webpack_require__(36); -var cliCursor = __webpack_require__(325); -var figures = __webpack_require__(236); - -var _require = __webpack_require__(65), - map = _require.map, - takeUntil = _require.takeUntil; - -var Base = __webpack_require__(73); -var observe = __webpack_require__(74); -var Paginator = __webpack_require__(153); - -var CheckboxPrompt = function (_Base) { - (0, (_inherits2 || _load_inherits()).default)(CheckboxPrompt, _Base); - - function CheckboxPrompt(questions, rl, answers) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, CheckboxPrompt); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers)); - - if (!_this.opt.choices) { - _this.throwParamError('choices'); - } - - if (_.isArray(_this.opt.default)) { - _this.opt.choices.forEach(function (choice) { - if (this.opt.default.indexOf(choice.value) >= 0) { - choice.checked = true; - } - }, _this); - } - - _this.pointer = 0; - _this.firstRender = true; - - // Make sure no default is set (so it won't be printed) - _this.opt.default = null; - - _this.paginator = new Paginator(_this.screen); - return _this; - } - - /** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - - CheckboxPrompt.prototype._run = function _run(cb) { - this.done = cb; - - var events = observe(this.rl); - - var validation = this.handleSubmitEvents(events.line.pipe(map(this.getCurrentValue.bind(this)))); - validation.success.forEach(this.onEnd.bind(this)); - validation.error.forEach(this.onError.bind(this)); - - events.normalizedUpKey.pipe(takeUntil(validation.success)).forEach(this.onUpKey.bind(this)); - events.normalizedDownKey.pipe(takeUntil(validation.success)).forEach(this.onDownKey.bind(this)); - events.numberKey.pipe(takeUntil(validation.success)).forEach(this.onNumberKey.bind(this)); - events.spaceKey.pipe(takeUntil(validation.success)).forEach(this.onSpaceKey.bind(this)); - events.aKey.pipe(takeUntil(validation.success)).forEach(this.onAllKey.bind(this)); - events.iKey.pipe(takeUntil(validation.success)).forEach(this.onInverseKey.bind(this)); - - // Init the prompt - cliCursor.hide(); - this.render(); - this.firstRender = false; - - return this; - }; - - /** - * Render the prompt to screen - * @return {CheckboxPrompt} self - */ - - CheckboxPrompt.prototype.render = function render(error) { - // Render question - var message = this.getQuestion(); - var bottomContent = ''; - - if (this.firstRender) { - message += '(Press ' + chalk.cyan.bold('') + ' to select, ' + chalk.cyan.bold('') + ' to toggle all, ' + chalk.cyan.bold('') + ' to invert selection)'; - } - - // Render choices or answer depending on the state - if (this.status === 'answered') { - message += chalk.cyan(this.selection.join(', ')); - } else { - var choicesStr = renderChoices(this.opt.choices, this.pointer); - var indexPosition = this.opt.choices.indexOf(this.opt.choices.getChoice(this.pointer)); - message += '\n' + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize); - } - - if (error) { - bottomContent = chalk.red('>> ') + error; - } - - this.screen.render(message, bottomContent); - }; - - /** - * When user press `enter` key - */ - - CheckboxPrompt.prototype.onEnd = function onEnd(state) { - this.status = 'answered'; - - // Rerender prompt (and clean subline error) - this.render(); - - this.screen.done(); - cliCursor.show(); - this.done(state.value); - }; - - CheckboxPrompt.prototype.onError = function onError(state) { - this.render(state.isValid); - }; - - CheckboxPrompt.prototype.getCurrentValue = function getCurrentValue() { - var choices = this.opt.choices.filter(function (choice) { - return Boolean(choice.checked) && !choice.disabled; - }); - - this.selection = _.map(choices, 'short'); - return _.map(choices, 'value'); - }; - - CheckboxPrompt.prototype.onUpKey = function onUpKey() { - var len = this.opt.choices.realLength; - this.pointer = this.pointer > 0 ? this.pointer - 1 : len - 1; - this.render(); - }; - - CheckboxPrompt.prototype.onDownKey = function onDownKey() { - var len = this.opt.choices.realLength; - this.pointer = this.pointer < len - 1 ? this.pointer + 1 : 0; - this.render(); - }; - - CheckboxPrompt.prototype.onNumberKey = function onNumberKey(input) { - if (input <= this.opt.choices.realLength) { - this.pointer = input - 1; - this.toggleChoice(this.pointer); - } - this.render(); - }; - - CheckboxPrompt.prototype.onSpaceKey = function onSpaceKey() { - this.toggleChoice(this.pointer); - this.render(); - }; - - CheckboxPrompt.prototype.onAllKey = function onAllKey() { - var shouldBeChecked = Boolean(this.opt.choices.find(function (choice) { - return choice.type !== 'separator' && !choice.checked; - })); - - this.opt.choices.forEach(function (choice) { - if (choice.type !== 'separator') { - choice.checked = shouldBeChecked; - } - }); - - this.render(); - }; - - CheckboxPrompt.prototype.onInverseKey = function onInverseKey() { - this.opt.choices.forEach(function (choice) { - if (choice.type !== 'separator') { - choice.checked = !choice.checked; - } - }); - - this.render(); - }; - - CheckboxPrompt.prototype.toggleChoice = function toggleChoice(index) { - var item = this.opt.choices.getChoice(index); - if (item !== undefined) { - this.opt.choices.getChoice(index).checked = !item.checked; - } - }; - - return CheckboxPrompt; -}(Base); - -/** - * Function for rendering checkbox choices - * @param {Number} pointer Position of the pointer - * @return {String} Rendered content - */ - -function renderChoices(choices, pointer) { - var output = ''; - var separatorOffset = 0; - - choices.forEach(function (choice, i) { - if (choice.type === 'separator') { - separatorOffset++; - output += ' ' + choice + '\n'; - return; - } - - if (choice.disabled) { - separatorOffset++; - output += ' - ' + choice.name; - output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')'; - } else { - var line = getCheckbox(choice.checked) + ' ' + choice.name; - if (i - separatorOffset === pointer) { - output += chalk.cyan(figures.pointer + line); - } else { - output += ' ' + line; - } - } - - output += '\n'; - }); - - return output.replace(/\n$/, ''); -} - -/** - * Get the checkbox - * @param {Boolean} checked - add a X or not to the checkbox - * @return {String} Composited checkbox string - */ - -function getCheckbox(checked) { - return checked ? chalk.green(figures.radioOn) : figures.radioOff; -} - -module.exports = CheckboxPrompt; - -/***/ }), -/* 500 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * `confirm` type prompt - */ - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _ = __webpack_require__(45); -var chalk = __webpack_require__(36); - -var _require = __webpack_require__(65), - take = _require.take, - takeUntil = _require.takeUntil; - -var Base = __webpack_require__(73); -var observe = __webpack_require__(74); - -var ConfirmPrompt = function (_Base) { - (0, (_inherits2 || _load_inherits()).default)(ConfirmPrompt, _Base); - - function ConfirmPrompt(questions, rl, answers) { - var _ret; - - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ConfirmPrompt); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers)); - - var rawDefault = true; - - _.extend(_this.opt, { - filter: function filter(input) { - var value = rawDefault; - if (input != null && input !== '') { - value = /^y(es)?/i.test(input); - } - return value; - } - }); - - if (_.isBoolean(_this.opt.default)) { - rawDefault = _this.opt.default; - } - - _this.opt.default = rawDefault ? 'Y/n' : 'y/N'; - - return _ret = _this, (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(_this, _ret); - } - - /** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - - ConfirmPrompt.prototype._run = function _run(cb) { - this.done = cb; - - // Once user confirm (enter key) - var events = observe(this.rl); - events.keypress.pipe(takeUntil(events.line)).forEach(this.onKeypress.bind(this)); - - events.line.pipe(take(1)).forEach(this.onEnd.bind(this)); - - // Init - this.render(); - - return this; - }; - - /** - * Render the prompt to screen - * @return {ConfirmPrompt} self - */ - - ConfirmPrompt.prototype.render = function render(answer) { - var message = this.getQuestion(); - - if (typeof answer === 'boolean') { - message += chalk.cyan(answer ? 'Yes' : 'No'); - } else { - message += this.rl.line; - } - - this.screen.render(message); - - return this; - }; - - /** - * When user press `enter` key - */ - - ConfirmPrompt.prototype.onEnd = function onEnd(input) { - this.status = 'answered'; - - var output = this.opt.filter(input); - this.render(output); - - this.screen.done(); - this.done(output); - }; - - /** - * When user press a key - */ - - ConfirmPrompt.prototype.onKeypress = function onKeypress() { - this.render(); - }; - - return ConfirmPrompt; -}(Base); - -module.exports = ConfirmPrompt; - -/***/ }), -/* 501 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * `editor` type prompt - */ - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var chalk = __webpack_require__(36); -var editAsync = __webpack_require__(758).editAsync; -var Base = __webpack_require__(73); -var observe = __webpack_require__(74); - -var _require = __webpack_require__(172), - Subject = _require.Subject; - -var EditorPrompt = function (_Base) { - (0, (_inherits2 || _load_inherits()).default)(EditorPrompt, _Base); - - function EditorPrompt() { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, EditorPrompt); - return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.apply(this, arguments)); - } - - /** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - - EditorPrompt.prototype._run = function _run(cb) { - this.done = cb; - - this.editorResult = new Subject(); - - // Open Editor on "line" (Enter Key) - var events = observe(this.rl); - this.lineSubscription = events.line.subscribe(this.startExternalEditor.bind(this)); - - // Trigger Validation when editor closes - var validation = this.handleSubmitEvents(this.editorResult); - validation.success.forEach(this.onEnd.bind(this)); - validation.error.forEach(this.onError.bind(this)); - - // Prevents default from being printed on screen (can look weird with multiple lines) - this.currentText = this.opt.default; - this.opt.default = null; - - // Init - this.render(); - - return this; - }; - - /** - * Render the prompt to screen - * @return {EditorPrompt} self - */ - - EditorPrompt.prototype.render = function render(error) { - var bottomContent = ''; - var message = this.getQuestion(); - - if (this.status === 'answered') { - message += chalk.dim('Received'); - } else { - message += chalk.dim('Press to launch your preferred editor.'); - } - - if (error) { - bottomContent = chalk.red('>> ') + error; - } - - this.screen.render(message, bottomContent); - }; - - /** - * Launch $EDITOR on user press enter - */ - - EditorPrompt.prototype.startExternalEditor = function startExternalEditor() { - // Pause Readline to prevent stdin and stdout from being modified while the editor is showing - this.rl.pause(); - editAsync(this.currentText, this.endExternalEditor.bind(this)); - }; - - EditorPrompt.prototype.endExternalEditor = function endExternalEditor(error, result) { - this.rl.resume(); - if (error) { - this.editorResult.error(error); - } else { - this.editorResult.next(result); - } - }; - - EditorPrompt.prototype.onEnd = function onEnd(state) { - this.editorResult.unsubscribe(); - this.lineSubscription.unsubscribe(); - this.answer = state.value; - this.status = 'answered'; - // Re-render prompt - this.render(); - this.screen.done(); - this.done(this.answer); - }; - - EditorPrompt.prototype.onError = function onError(state) { - this.render(state.isValid); - }; - - return EditorPrompt; -}(Base); - -module.exports = EditorPrompt; - -/***/ }), -/* 502 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * `rawlist` type prompt - */ - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _ = __webpack_require__(45); -var chalk = __webpack_require__(36); - -var _require = __webpack_require__(65), - map = _require.map, - takeUntil = _require.takeUntil; - -var Base = __webpack_require__(73); -var Separator = __webpack_require__(152); -var observe = __webpack_require__(74); -var Paginator = __webpack_require__(153); - -var ExpandPrompt = function (_Base) { - (0, (_inherits2 || _load_inherits()).default)(ExpandPrompt, _Base); - - function ExpandPrompt(questions, rl, answers) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ExpandPrompt); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers)); - - if (!_this.opt.choices) { - _this.throwParamError('choices'); - } - - _this.validateChoices(_this.opt.choices); - - // Add the default `help` (/expand) option - _this.opt.choices.push({ - key: 'h', - name: 'Help, list all options', - value: 'help' - }); - - _this.opt.validate = function (choice) { - if (choice == null) { - return 'Please enter a valid command'; - } - - return choice !== 'help'; - }; - - // Setup the default string (capitalize the default key) - _this.opt.default = _this.generateChoicesString(_this.opt.choices, _this.opt.default); - - _this.paginator = new Paginator(_this.screen); - return _this; - } - - /** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - - ExpandPrompt.prototype._run = function _run(cb) { - this.done = cb; - - // Save user answer and update prompt to show selected option. - var events = observe(this.rl); - var validation = this.handleSubmitEvents(events.line.pipe(map(this.getCurrentValue.bind(this)))); - validation.success.forEach(this.onSubmit.bind(this)); - validation.error.forEach(this.onError.bind(this)); - this.keypressObs = events.keypress.pipe(takeUntil(validation.success)).forEach(this.onKeypress.bind(this)); - - // Init the prompt - this.render(); - - return this; - }; - - /** - * Render the prompt to screen - * @return {ExpandPrompt} self - */ - - ExpandPrompt.prototype.render = function render(error, hint) { - var message = this.getQuestion(); - var bottomContent = ''; - - if (this.status === 'answered') { - message += chalk.cyan(this.answer); - } else if (this.status === 'expanded') { - var choicesStr = renderChoices(this.opt.choices, this.selectedKey); - message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize); - message += '\n Answer: '; - } - - message += this.rl.line; - - if (error) { - bottomContent = chalk.red('>> ') + error; - } - - if (hint) { - bottomContent = chalk.cyan('>> ') + hint; - } - - this.screen.render(message, bottomContent); - }; - - ExpandPrompt.prototype.getCurrentValue = function getCurrentValue(input) { - if (!input) { - input = this.rawDefault; - } - var selected = this.opt.choices.where({ key: input.toLowerCase().trim() })[0]; - if (!selected) { - return null; - } - - return selected.value; - }; - - /** - * Generate the prompt choices string - * @return {String} Choices string - */ - - ExpandPrompt.prototype.getChoices = function getChoices() { - var _this2 = this; - - var output = ''; - - this.opt.choices.forEach(function (choice) { - output += '\n '; - - if (choice.type === 'separator') { - output += ' ' + choice; - return; - } - - var choiceStr = choice.key + ') ' + choice.name; - if (_this2.selectedKey === choice.key) { - choiceStr = chalk.cyan(choiceStr); - } - output += choiceStr; - }); - - return output; - }; - - ExpandPrompt.prototype.onError = function onError(state) { - if (state.value === 'help') { - this.selectedKey = ''; - this.status = 'expanded'; - this.render(); - return; - } - this.render(state.isValid); - }; - - /** - * When user press `enter` key - */ - - ExpandPrompt.prototype.onSubmit = function onSubmit(state) { - this.status = 'answered'; - var choice = this.opt.choices.where({ value: state.value })[0]; - this.answer = choice.short || choice.name; - - // Re-render prompt - this.render(); - this.screen.done(); - this.done(state.value); - }; - - /** - * When user press a key - */ - - ExpandPrompt.prototype.onKeypress = function onKeypress() { - this.selectedKey = this.rl.line.toLowerCase(); - var selected = this.opt.choices.where({ key: this.selectedKey })[0]; - if (this.status === 'expanded') { - this.render(); - } else { - this.render(null, selected ? selected.name : null); - } - }; - - /** - * Validate the choices - * @param {Array} choices - */ - - ExpandPrompt.prototype.validateChoices = function validateChoices(choices) { - var formatError; - var errors = []; - var keymap = {}; - choices.filter(Separator.exclude).forEach(function (choice) { - if (!choice.key || choice.key.length !== 1) { - formatError = true; - } - if (keymap[choice.key]) { - errors.push(choice.key); - } - keymap[choice.key] = true; - choice.key = String(choice.key).toLowerCase(); - }); - - if (formatError) { - throw new Error('Format error: `key` param must be a single letter and is required.'); - } - if (keymap.h) { - throw new Error('Reserved key error: `key` param cannot be `h` - this value is reserved.'); - } - if (errors.length) { - throw new Error('Duplicate key error: `key` param must be unique. Duplicates: ' + _.uniq(errors).join(', ')); - } - }; - - /** - * Generate a string out of the choices keys - * @param {Array} choices - * @param {Number|String} default - the choice index or name to capitalize - * @return {String} The rendered choices key string - */ - - - ExpandPrompt.prototype.generateChoicesString = function generateChoicesString(choices, defaultChoice) { - var defIndex = choices.realLength - 1; - if (_.isNumber(defaultChoice) && this.opt.choices.getChoice(defaultChoice)) { - defIndex = defaultChoice; - } else if (_.isString(defaultChoice)) { - var index = _.findIndex(choices.realChoices, function (_ref) { - var value = _ref.value; - return value === defaultChoice; - }); - defIndex = index === -1 ? defIndex : index; - } - var defStr = this.opt.choices.pluck('key'); - this.rawDefault = defStr[defIndex]; - defStr[defIndex] = String(defStr[defIndex]).toUpperCase(); - return defStr.join(''); - }; - - return ExpandPrompt; -}(Base); - -/** - * Function for rendering checkbox choices - * @param {String} pointer Selected key - * @return {String} Rendered content - */ - -function renderChoices(choices, pointer) { - var output = ''; - - choices.forEach(function (choice) { - output += '\n '; - - if (choice.type === 'separator') { - output += ' ' + choice; - return; - } - - var choiceStr = choice.key + ') ' + choice.name; - if (pointer === choice.key) { - choiceStr = chalk.cyan(choiceStr); - } - output += choiceStr; - }); - - return output; -} - -module.exports = ExpandPrompt; - -/***/ }), -/* 503 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * `list` type prompt - */ - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _ = __webpack_require__(45); -var chalk = __webpack_require__(36); -var figures = __webpack_require__(236); -var cliCursor = __webpack_require__(325); -var runAsync = __webpack_require__(171); - -var _require = __webpack_require__(65), - flatMap = _require.flatMap, - map = _require.map, - take = _require.take, - takeUntil = _require.takeUntil; - -var Base = __webpack_require__(73); -var observe = __webpack_require__(74); -var Paginator = __webpack_require__(153); - -var ListPrompt = function (_Base) { - (0, (_inherits2 || _load_inherits()).default)(ListPrompt, _Base); - - function ListPrompt(questions, rl, answers) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ListPrompt); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers)); - - if (!_this.opt.choices) { - _this.throwParamError('choices'); - } - - _this.firstRender = true; - _this.selected = 0; - - var def = _this.opt.default; - - // If def is a Number, then use as index. Otherwise, check for value. - if (_.isNumber(def) && def >= 0 && def < _this.opt.choices.realLength) { - _this.selected = def; - } else if (!_.isNumber(def) && def != null) { - var index = _.findIndex(_this.opt.choices.realChoices, function (_ref) { - var value = _ref.value; - return value === def; - }); - _this.selected = Math.max(index, 0); - } - - // Make sure no default is set (so it won't be printed) - _this.opt.default = null; - - _this.paginator = new Paginator(_this.screen); - return _this; - } - - /** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - - ListPrompt.prototype._run = function _run(cb) { - this.done = cb; - - var self = this; - - var events = observe(this.rl); - events.normalizedUpKey.pipe(takeUntil(events.line)).forEach(this.onUpKey.bind(this)); - events.normalizedDownKey.pipe(takeUntil(events.line)).forEach(this.onDownKey.bind(this)); - events.numberKey.pipe(takeUntil(events.line)).forEach(this.onNumberKey.bind(this)); - events.line.pipe(take(1), map(this.getCurrentValue.bind(this)), flatMap(function (value) { - return runAsync(self.opt.filter)(value).catch(function (err) { - return err; - }); - })).forEach(this.onSubmit.bind(this)); - - // Init the prompt - cliCursor.hide(); - this.render(); - - return this; - }; - - /** - * Render the prompt to screen - * @return {ListPrompt} self - */ - - ListPrompt.prototype.render = function render() { - // Render question - var message = this.getQuestion(); - - if (this.firstRender) { - message += chalk.dim('(Use arrow keys)'); - } - - // Render choices or answer depending on the state - if (this.status === 'answered') { - message += chalk.cyan(this.opt.choices.getChoice(this.selected).short); - } else { - var choicesStr = listRender(this.opt.choices, this.selected); - var indexPosition = this.opt.choices.indexOf(this.opt.choices.getChoice(this.selected)); - message += '\n' + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize); - } - - this.firstRender = false; - - this.screen.render(message); - }; - - /** - * When user press `enter` key - */ - - ListPrompt.prototype.onSubmit = function onSubmit(value) { - this.status = 'answered'; - - // Rerender prompt - this.render(); - - this.screen.done(); - cliCursor.show(); - this.done(value); - }; - - ListPrompt.prototype.getCurrentValue = function getCurrentValue() { - return this.opt.choices.getChoice(this.selected).value; - }; - - /** - * When user press a key - */ - - - ListPrompt.prototype.onUpKey = function onUpKey() { - var len = this.opt.choices.realLength; - this.selected = this.selected > 0 ? this.selected - 1 : len - 1; - this.render(); - }; - - ListPrompt.prototype.onDownKey = function onDownKey() { - var len = this.opt.choices.realLength; - this.selected = this.selected < len - 1 ? this.selected + 1 : 0; - this.render(); - }; - - ListPrompt.prototype.onNumberKey = function onNumberKey(input) { - if (input <= this.opt.choices.realLength) { - this.selected = input - 1; - } - this.render(); - }; - - return ListPrompt; -}(Base); - -/** - * Function for rendering list choices - * @param {Number} pointer Position of the pointer - * @return {String} Rendered content - */ - - -function listRender(choices, pointer) { - var output = ''; - var separatorOffset = 0; - - choices.forEach(function (choice, i) { - if (choice.type === 'separator') { - separatorOffset++; - output += ' ' + choice + '\n'; - return; - } - - if (choice.disabled) { - separatorOffset++; - output += ' - ' + choice.name; - output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')'; - output += '\n'; - return; - } - - var isSelected = i - separatorOffset === pointer; - var line = (isSelected ? figures.pointer + ' ' : ' ') + choice.name; - if (isSelected) { - line = chalk.cyan(line); - } - output += line + ' \n'; - }); - - return output.replace(/\n$/, ''); -} - -module.exports = ListPrompt; - -/***/ }), -/* 504 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * `input` type prompt - */ - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Input = __webpack_require__(291); - -/** - * Extention of the Input prompt specifically for use with number inputs. - */ - -var NumberPrompt = function (_Input) { - (0, (_inherits2 || _load_inherits()).default)(NumberPrompt, _Input); - - function NumberPrompt() { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NumberPrompt); - return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Input.apply(this, arguments)); - } - - NumberPrompt.prototype.filterInput = function filterInput(input) { - if (input && typeof input === 'string') { - input = input.trim(); - // Match a number in the input - var numberMatch = input.match(/(^-?\d+|^\d+\.\d*|^\d*\.\d+)(e\d+)?$/); - // If a number is found, return that input. - if (numberMatch) { - return Number(numberMatch[0]); - } - } - // If the input was invalid return the default value. - return this.opt.default == null ? NaN : this.opt.default; - }; - - return NumberPrompt; -}(Input); - -module.exports = NumberPrompt; - -/***/ }), -/* 505 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * `password` type prompt - */ - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var chalk = __webpack_require__(36); - -var _require = __webpack_require__(65), - map = _require.map, - takeUntil = _require.takeUntil; - -var Base = __webpack_require__(73); -var observe = __webpack_require__(74); - -function mask(input, maskChar) { - input = String(input); - maskChar = typeof maskChar === 'string' ? maskChar : '*'; - if (input.length === 0) { - return ''; - } - - return new Array(input.length + 1).join(maskChar); -} - -var PasswordPrompt = function (_Base) { - (0, (_inherits2 || _load_inherits()).default)(PasswordPrompt, _Base); - - function PasswordPrompt() { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PasswordPrompt); - return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.apply(this, arguments)); - } - - /** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - - PasswordPrompt.prototype._run = function _run(cb) { - this.done = cb; - - var events = observe(this.rl); - - // Once user confirm (enter key) - var submit = events.line.pipe(map(this.filterInput.bind(this))); - - var validation = this.handleSubmitEvents(submit); - validation.success.forEach(this.onEnd.bind(this)); - validation.error.forEach(this.onError.bind(this)); - - if (this.opt.mask) { - events.keypress.pipe(takeUntil(validation.success)).forEach(this.onKeypress.bind(this)); - } - - // Init - this.render(); - - return this; - }; - - /** - * Render the prompt to screen - * @return {PasswordPrompt} self - */ - - PasswordPrompt.prototype.render = function render(error) { - var message = this.getQuestion(); - var bottomContent = ''; - - if (this.status === 'answered') { - message += this.opt.mask ? chalk.cyan(mask(this.answer, this.opt.mask)) : chalk.italic.dim('[hidden]'); - } else if (this.opt.mask) { - message += mask(this.rl.line || '', this.opt.mask); - } else { - message += chalk.italic.dim('[input is hidden] '); - } - - if (error) { - bottomContent = '\n' + chalk.red('>> ') + error; - } - - this.screen.render(message, bottomContent); - }; - - /** - * When user press `enter` key - */ - - PasswordPrompt.prototype.filterInput = function filterInput(input) { - if (!input) { - return this.opt.default == null ? '' : this.opt.default; - } - return input; - }; - - PasswordPrompt.prototype.onEnd = function onEnd(state) { - this.status = 'answered'; - this.answer = state.value; - - // Re-render prompt - this.render(); - - this.screen.done(); - this.done(state.value); - }; - - PasswordPrompt.prototype.onError = function onError(state) { - this.render(state.isValid); - }; - - PasswordPrompt.prototype.onKeypress = function onKeypress() { - this.render(); - }; - - return PasswordPrompt; -}(Base); - -module.exports = PasswordPrompt; - -/***/ }), -/* 506 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * `rawlist` type prompt - */ - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _ = __webpack_require__(45); -var chalk = __webpack_require__(36); - -var _require = __webpack_require__(65), - map = _require.map, - takeUntil = _require.takeUntil; - -var Base = __webpack_require__(73); -var Separator = __webpack_require__(152); -var observe = __webpack_require__(74); -var Paginator = __webpack_require__(153); - -var RawListPrompt = function (_Base) { - (0, (_inherits2 || _load_inherits()).default)(RawListPrompt, _Base); - - function RawListPrompt(questions, rl, answers) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, RawListPrompt); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers)); - - if (!_this.opt.choices) { - _this.throwParamError('choices'); - } - - _this.opt.validChoices = _this.opt.choices.filter(Separator.exclude); - - _this.selected = 0; - _this.rawDefault = 0; - - _.extend(_this.opt, { - validate: function validate(val) { - return val != null; - } - }); - - var def = _this.opt.default; - if (_.isNumber(def) && def >= 0 && def < _this.opt.choices.realLength) { - _this.selected = def; - _this.rawDefault = def; - } else if (!_.isNumber(def) && def != null) { - var index = _.findIndex(_this.opt.choices.realChoices, function (_ref) { - var value = _ref.value; - return value === def; - }); - var safeIndex = Math.max(index, 0); - _this.selected = safeIndex; - _this.rawDefault = safeIndex; - } - - // Make sure no default is set (so it won't be printed) - _this.opt.default = null; - - _this.paginator = new Paginator(); - return _this; - } - - /** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - - RawListPrompt.prototype._run = function _run(cb) { - this.done = cb; - - // Once user confirm (enter key) - var events = observe(this.rl); - var submit = events.line.pipe(map(this.getCurrentValue.bind(this))); - - var validation = this.handleSubmitEvents(submit); - validation.success.forEach(this.onEnd.bind(this)); - validation.error.forEach(this.onError.bind(this)); - - events.keypress.pipe(takeUntil(validation.success)).forEach(this.onKeypress.bind(this)); - - // Init the prompt - this.render(); - - return this; - }; - - /** - * Render the prompt to screen - * @return {RawListPrompt} self - */ - - RawListPrompt.prototype.render = function render(error) { - // Render question - var message = this.getQuestion(); - var bottomContent = ''; - - if (this.status === 'answered') { - message += chalk.cyan(this.answer); - } else { - var choicesStr = renderChoices(this.opt.choices, this.selected); - message += this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize); - message += '\n Answer: '; - } - - message += this.rl.line; - - if (error) { - bottomContent = '\n' + chalk.red('>> ') + error; - } - - this.screen.render(message, bottomContent); - }; - - /** - * When user press `enter` key - */ - - RawListPrompt.prototype.getCurrentValue = function getCurrentValue(index) { - if (index == null || index === '') { - index = this.rawDefault; - } else { - index -= 1; - } - - var choice = this.opt.choices.getChoice(index); - return choice ? choice.value : null; - }; - - RawListPrompt.prototype.onEnd = function onEnd(state) { - this.status = 'answered'; - this.answer = state.value; - - // Re-render prompt - this.render(); - - this.screen.done(); - this.done(state.value); - }; - - RawListPrompt.prototype.onError = function onError() { - this.render('Please enter a valid index'); - }; - - /** - * When user press a key - */ - - RawListPrompt.prototype.onKeypress = function onKeypress() { - var index = this.rl.line.length ? Number(this.rl.line) - 1 : 0; - - if (this.opt.choices.getChoice(index)) { - this.selected = index; - } else { - this.selected = undefined; - } - - this.render(); - }; - - return RawListPrompt; -}(Base); - -/** - * Function for rendering list choices - * @param {Number} pointer Position of the pointer - * @return {String} Rendered content - */ - -function renderChoices(choices, pointer) { - var output = ''; - var separatorOffset = 0; - - choices.forEach(function (choice, i) { - output += '\n '; - - if (choice.type === 'separator') { - separatorOffset++; - output += ' ' + choice; - return; - } - - var index = i - separatorOffset; - var display = index + 1 + ') ' + choice.name; - if (index === pointer) { - display = chalk.cyan(display); - } - output += display; - }); - - return output; -} - -module.exports = RawListPrompt; - -/***/ }), -/* 507 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * Sticky bottom bar user interface - */ - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var through = __webpack_require__(1026); -var Base = __webpack_require__(292); -var rlUtils = __webpack_require__(293); -var _ = __webpack_require__(45); - -var BottomBar = function (_Base) { - (0, (_inherits2 || _load_inherits()).default)(BottomBar, _Base); - - function BottomBar(opt) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BottomBar); - - opt = opt || {}; - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, opt)); - - _this.log = through(_this.writeLog.bind(_this)); - _this.bottomBar = opt.bottomBar || ''; - _this.render(); - return _this; - } - - /** - * Render the prompt to screen - * @return {BottomBar} self - */ - - BottomBar.prototype.render = function render() { - this.write(this.bottomBar); - return this; - }; - - BottomBar.prototype.clean = function clean() { - rlUtils.clearLine(this.rl, this.bottomBar.split('\n').length); - return this; - }; - - /** - * Update the bottom bar content and rerender - * @param {String} bottomBar Bottom bar content - * @return {BottomBar} self - */ - - BottomBar.prototype.updateBottomBar = function updateBottomBar(bottomBar) { - rlUtils.clearLine(this.rl, 1); - this.rl.output.unmute(); - this.clean(); - this.bottomBar = bottomBar; - this.render(); - this.rl.output.mute(); - return this; - }; - - /** - * Write out log data - * @param {String} data - The log data to be output - * @return {BottomBar} self - */ - - BottomBar.prototype.writeLog = function writeLog(data) { - this.rl.output.unmute(); - this.clean(); - this.rl.output.write(this.enforceLF(data.toString())); - this.render(); - this.rl.output.mute(); - return this; - }; - - /** - * Make sure line end on a line feed - * @param {String} str Input string - * @return {String} The input string with a final line feed - */ - - BottomBar.prototype.enforceLF = function enforceLF(str) { - return str.match(/[\r\n]$/) ? str : str + '\n'; - }; - - /** - * Helper for writing message in Prompt - * @param {BottomBar} prompt - The Prompt object that extends tty - * @param {String} message - The message to be output - */ - - - BottomBar.prototype.write = function write(message) { - var msgLines = message.split(/\n/); - this.height = msgLines.length; - - // Write message to screen and setPrompt to control backspace - this.rl.setPrompt(_.last(msgLines)); - - if (this.rl.output.rows === 0 && this.rl.output.columns === 0) { - /* When it's a tty through serial port there's no terminal info and the render will malfunction, - so we need enforce the cursor to locate to the leftmost position for rendering. */ - rlUtils.left(this.rl, message.length + this.rl.line.length); - } - this.rl.output.write(message); - }; - - return BottomBar; -}(Base); - -module.exports = BottomBar; - -/***/ }), -/* 508 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _ = __webpack_require__(45); - -var _require = __webpack_require__(172), - defer = _require.defer, - empty = _require.empty, - from = _require.from, - of = _require.of; - -var _require2 = __webpack_require__(65), - concatMap = _require2.concatMap, - filter = _require2.filter, - publish = _require2.publish, - reduce = _require2.reduce; - -var runAsync = __webpack_require__(171); -var utils = __webpack_require__(510); -var Base = __webpack_require__(292); - -/** - * Base interface class other can inherits from - */ - -var PromptUI = function (_Base) { - (0, (_inherits2 || _load_inherits()).default)(PromptUI, _Base); - - function PromptUI(prompts, opt) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PromptUI); - - var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, opt)); - - _this.prompts = prompts; - return _this; - } - - PromptUI.prototype.run = function run(questions) { - var _this2 = this; - - // Keep global reference to the answers - this.answers = {}; - - // Make sure questions is an array. - if (_.isPlainObject(questions)) { - questions = [questions]; - } - - // Create an observable, unless we received one as parameter. - // Note: As this is a public interface, we cannot do an instanceof check as we won't - // be using the exact same object in memory. - var obs = _.isArray(questions) ? from(questions) : questions; - - this.process = obs.pipe(concatMap(this.processQuestion.bind(this)), publish() // Creates a hot Observable. It prevents duplicating prompts. - ); - - this.process.connect(); - - return this.process.pipe(reduce(function (answers, answer) { - _.set(_this2.answers, answer.name, answer.answer); - return _this2.answers; - }, {})).toPromise((_promise || _load_promise()).default).then(this.onCompletion.bind(this)); - }; - - /** - * Once all prompt are over - */ - - PromptUI.prototype.onCompletion = function onCompletion() { - this.close(); - - return this.answers; - }; - - PromptUI.prototype.processQuestion = function processQuestion(question) { - var _this3 = this; - - question = _.clone(question); - return defer(function () { - var obs = of(question); - - return obs.pipe(concatMap(_this3.setDefaultType.bind(_this3)), concatMap(_this3.filterIfRunnable.bind(_this3)), concatMap(function () { - return utils.fetchAsyncQuestionProperty(question, 'message', _this3.answers); - }), concatMap(function () { - return utils.fetchAsyncQuestionProperty(question, 'default', _this3.answers); - }), concatMap(function () { - return utils.fetchAsyncQuestionProperty(question, 'choices', _this3.answers); - }), concatMap(_this3.fetchAnswer.bind(_this3))); - }); - }; - - PromptUI.prototype.fetchAnswer = function fetchAnswer(question) { - var _this4 = this; - - var Prompt = this.prompts[question.type]; - this.activePrompt = new Prompt(question, this.rl, this.answers); - return defer(function () { - return from(_this4.activePrompt.run().then(function (answer) { - return { name: question.name, answer: answer }; - })); - }); - }; - - PromptUI.prototype.setDefaultType = function setDefaultType(question) { - // Default type to input - if (!this.prompts[question.type]) { - question.type = 'input'; - } - return defer(function () { - return of(question); - }); - }; - - PromptUI.prototype.filterIfRunnable = function filterIfRunnable(question) { - if (question.when === false) { - return empty(); - } - - if (!_.isFunction(question.when)) { - return of(question); - } - - var answers = this.answers; - return defer(function () { - return from(runAsync(question.when)(answers).then(function (shouldRun) { - if (shouldRun) { - return question; - } - })).pipe(filter(function (val) { - return val != null; - })); - }); - }; - - return PromptUI; -}(Base); - -module.exports = PromptUI; - -/***/ }), -/* 509 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _ = __webpack_require__(45); -var util = __webpack_require__(293); -var cliWidth = __webpack_require__(604); -var stripAnsi = __webpack_require__(269); -var stringWidth = __webpack_require__(777); - -function height(content) { - return content.split('\n').length; -} - -function lastLine(content) { - return _.last(content.split('\n')); -} - -var ScreenManager = function () { - function ScreenManager(rl) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ScreenManager); - - // These variables are keeping information to allow correct prompt re-rendering - this.height = 0; - this.extraLinesUnderPrompt = 0; - - this.rl = rl; - } - - ScreenManager.prototype.render = function render(content, bottomContent) { - this.rl.output.unmute(); - this.clean(this.extraLinesUnderPrompt); - - /** - * Write message to screen and setPrompt to control backspace - */ - - var promptLine = lastLine(content); - var rawPromptLine = stripAnsi(promptLine); - - // Remove the rl.line from our prompt. We can't rely on the content of - // rl.line (mainly because of the password prompt), so just rely on it's - // length. - var prompt = rawPromptLine; - if (this.rl.line.length) { - prompt = prompt.slice(0, -this.rl.line.length); - } - this.rl.setPrompt(prompt); - - // SetPrompt will change cursor position, now we can get correct value - var cursorPos = this.rl._getCursorPos(); - var width = this.normalizedCliWidth(); - - content = this.forceLineReturn(content, width); - if (bottomContent) { - bottomContent = this.forceLineReturn(bottomContent, width); - } - // Manually insert an extra line if we're at the end of the line. - // This prevent the cursor from appearing at the beginning of the - // current line. - if (rawPromptLine.length % width === 0) { - content += '\n'; - } - var fullContent = content + (bottomContent ? '\n' + bottomContent : ''); - this.rl.output.write(fullContent); - - /** - * Re-adjust the cursor at the correct position. - */ - - // We need to consider parts of the prompt under the cursor as part of the bottom - // content in order to correctly cleanup and re-render. - var promptLineUpDiff = Math.floor(rawPromptLine.length / width) - cursorPos.rows; - var bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0); - if (bottomContentHeight > 0) { - util.up(this.rl, bottomContentHeight); - } - - // Reset cursor at the beginning of the line - util.left(this.rl, stringWidth(lastLine(fullContent))); - - // Adjust cursor on the right - if (cursorPos.cols > 0) { - util.right(this.rl, cursorPos.cols); - } - - /** - * Set up state for next re-rendering - */ - this.extraLinesUnderPrompt = bottomContentHeight; - this.height = height(fullContent); - - this.rl.output.mute(); - }; - - ScreenManager.prototype.clean = function clean(extraLines) { - if (extraLines > 0) { - util.down(this.rl, extraLines); - } - util.clearLine(this.rl, this.height); - }; - - ScreenManager.prototype.done = function done() { - this.rl.setPrompt(''); - this.rl.output.unmute(); - this.rl.output.write('\n'); - }; - - ScreenManager.prototype.releaseCursor = function releaseCursor() { - if (this.extraLinesUnderPrompt > 0) { - util.down(this.rl, this.extraLinesUnderPrompt); - } - }; - - ScreenManager.prototype.normalizedCliWidth = function normalizedCliWidth() { - var width = cliWidth({ - defaultWidth: 80, - output: this.rl.output - }); - return width; - }; - - ScreenManager.prototype.breakLines = function breakLines(lines, width) { - // Break lines who're longer than the cli width so we can normalize the natural line - // returns behavior across terminals. - width = width || this.normalizedCliWidth(); - var regex = new RegExp('(?:(?:\\033[[0-9;]*m)*.?){1,' + width + '}', 'g'); - return lines.map(function (line) { - var chunk = line.match(regex); - // Last match is always empty - chunk.pop(); - return chunk || ''; - }); - }; - - ScreenManager.prototype.forceLineReturn = function forceLineReturn(content, width) { - width = width || this.normalizedCliWidth(); - return _.flatten(this.breakLines(content.split('\n'), width)).join('\n'); - }; - - return ScreenManager; -}(); - -module.exports = ScreenManager; - -/***/ }), -/* 510 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _ = __webpack_require__(45); - -var _require = __webpack_require__(172), - from = _require.from, - of = _require.of; - -var runAsync = __webpack_require__(171); - -/** - * Resolve a question property value if it is passed as a function. - * This method will overwrite the property on the question object with the received value. - * @param {Object} question - Question object - * @param {String} prop - Property to fetch name - * @param {Object} answers - Answers object - * @return {Rx.Observable} - Observable emitting once value is known - */ - -exports.fetchAsyncQuestionProperty = function (question, prop, answers) { - if (!_.isFunction(question[prop])) { - return of(question); - } - - return from(runAsync(question[prop])(answers).then(function (value) { - question[prop] = value; - return question; - })); -}; - -/***/ }), -/* 511 */ +/* 162 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87285,269 +42746,1165 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = function (message) { - return { - useless: true, - run() { - throw new (_errors || _load_errors()).MessageError(message); - }, - setFlags: function setFlags() {}, - hasWrapper: function hasWrapper() { - return true; - } - }; -}; +var _extends2; + +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(22)); +} + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +exports.extractWorkspaces = extractWorkspaces; + +var _executeLifecycleScript; + +function _load_executeLifecycleScript() { + return _executeLifecycleScript = __webpack_require__(111); +} + +var _path; + +function _load_path() { + return _path = __webpack_require__(376); +} + +var _conversion; + +function _load_conversion() { + return _conversion = __webpack_require__(336); +} + +var _index; + +function _load_index() { + return _index = _interopRequireDefault(__webpack_require__(220)); +} var _errors; function _load_errors() { - return _errors = __webpack_require__(6); + return _errors = __webpack_require__(5); } -/***/ }), -/* 512 */ -/***/ (function(module, exports, __webpack_require__) { +var _fs; -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.examples = exports.hasWrapper = exports.run = undefined; - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(6)); } -exports.setFlags = setFlags; +var _constants; -var _buildSubCommands2; - -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62)); +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); } +var _packageConstraintResolver; + +function _load_packageConstraintResolver() { + return _packageConstraintResolver = _interopRequireDefault(__webpack_require__(554)); +} + +var _requestManager; + +function _load_requestManager() { + return _requestManager = _interopRequireDefault(__webpack_require__(377)); +} + +var _index2; + +function _load_index2() { + return _index2 = __webpack_require__(57); +} + +var _index3; + +function _load_index3() { + return _index3 = __webpack_require__(200); +} + +var _map; + +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(29)); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var notYetImplemented = function notYetImplemented() { - return (_promise || _load_promise()).default.reject(new Error('This command is not implemented yet.')); -}; +const detectIndent = __webpack_require__(635); +const invariant = __webpack_require__(9); +const path = __webpack_require__(0); +const micromatch = __webpack_require__(114); +const isCi = __webpack_require__(396); -function setFlags(commander) { - commander.description('Has not been implemented yet'); -} - -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('access', { - public: notYetImplemented, - restricted: notYetImplemented, - grant: notYetImplemented, - revoke: notYetImplemented, - lsPackages: notYetImplemented, - lsCollaborators: notYetImplemented, - edit: notYetImplemented -}, ['WARNING: This command yet to be implemented.', 'public []', 'restricted []', 'grant []', 'revoke []', 'ls-packages [||]', 'ls-collaborators [ []]', 'edit []']), - run = _buildSubCommands.run, - hasWrapper = _buildSubCommands.hasWrapper, - examples = _buildSubCommands.examples; - -exports.run = run; -exports.hasWrapper = hasWrapper; -exports.examples = examples; - -/***/ }), -/* 513 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var binFolder = path.join(config.cwd, config.registryFolders[0], '.bin'); - if (args.length === 0) { - reporter.log(binFolder, { force: true }); - } else { - var binEntries = yield (0, (_run || _load_run()).getBinEntries)(config); - - var binName = args[0]; - var binPath = binEntries.get(binName); - - if (binPath) { - reporter.log(binPath, { force: true }); - } else { - reporter.error(reporter.lang('packageBinaryNotFound', binName)); - } - } +function sortObject(object) { + const sortedObject = {}; + Object.keys(object).sort().forEach(item => { + sortedObject[item] = object[item]; }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _run; - -function _load_run() { - return _run = __webpack_require__(302); + return sortedObject; } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +class Config { + constructor(reporter) { + this.constraintResolver = new (_packageConstraintResolver || _load_packageConstraintResolver()).default(this, reporter); + this.requestManager = new (_requestManager || _load_requestManager()).default(reporter); + this.reporter = reporter; + this._init({}); + } -var path = __webpack_require__(1); - -function hasWrapper(commander) { - return false; -} - -function setFlags(commander) { - commander.description('Displays the location of the yarn bin folder.'); -} - -/***/ }), -/* 514 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; + // -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.examples = exports.run = undefined; + // -var _stringify; -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(40)); -} + // cache packages in offline mirror folder as new .tgz files -var _asyncToGenerator2; -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} + // -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; -var _buildSubCommands2; + // -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62)); -} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + // -var CONFIG_KEYS = [ -// 'reporter', -'registryFolders', 'linkedModules', -// 'registries', -'cache', 'cwd', 'looseSemver', 'commandName', 'preferOffline', 'modulesFolder', 'globalFolder', 'linkFolder', 'offline', 'binLinks', 'ignorePlatform', 'ignoreScripts', 'disablePrepublish', 'nonInteractive', 'workspaceRootFolder', 'lockfileFolder', 'networkConcurrency', 'childConcurrency', 'networkTimeout', 'workspacesEnabled', 'workspacesNohoistEnabled', 'pruneOfflineMirror', 'enableMetaFolder', 'enableLockfileVersions', 'linkFileDependencies', 'cacheFolder', 'tempFolder', 'production']; -/* eslint object-shorthand: 0 */ -function hasWrapper(flags, args) { - return args[0] !== 'get'; -} + // -function setFlags(commander) { - commander.description('Manages the yarn configuration files.'); -} -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('config', { - set(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (args.length === 0 || args.length > 2) { - return false; - } - var key = args[0], - _args$ = args[1], - val = _args$ === undefined ? true : _args$; + // - var yarnConfig = config.registries.yarn; - yield yarnConfig.saveHomeConfig({ [key]: val }); - reporter.success(reporter.lang('configSet', key, val)); - return true; - })(); - }, - get(config, reporter, flags, args) { - if (args.length !== 1) { - return false; + // + + + // + + + // + + + // + + + // + + + // + + + // Whether we should ignore executing lifecycle scripts + + + // + + + // + + + // + + + // + + + /** + * Execute a promise produced by factory if it doesn't exist in our cache with + * the associated key. + */ + + getCache(key, factory) { + const cached = this.cache[key]; + if (cached) { + return cached; } - reporter.log(String(config.getOption(args[0])), { force: true }); - return true; - }, + return this.cache[key] = factory().catch(err => { + this.cache[key] = null; + throw err; + }); + } - delete: function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (args.length !== 1) { - return false; + /** + * Get a config option from our yarn config. + */ + + getOption(key, resolve = false) { + const value = this.registries.yarn.getOption(key); + + if (resolve && typeof value === 'string' && value.length) { + return (0, (_path || _load_path()).resolveWithHome)(value); + } + + return value; + } + + /** + * Reduce a list of versions to a single one based on an input range. + */ + + resolveConstraints(versions, range) { + return this.constraintResolver.reduce(versions, range); + } + + /** + * Initialise config. Fetch registry options, find package roots. + */ + + init(opts = {}) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + _this._init(opts); + + _this.workspaceRootFolder = yield _this.findWorkspaceRoot(_this.cwd); + _this.lockfileFolder = _this.workspaceRootFolder || _this.cwd; + + // using focus in a workspace root is not allowed + if (_this.focus && (!_this.workspaceRootFolder || _this.cwd === _this.workspaceRootFolder)) { + throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('workspacesFocusRootCheck')); } - var key = args[0]; - var yarnConfig = config.registries.yarn; - yield yarnConfig.saveHomeConfig({ [key]: undefined }); - reporter.success(reporter.lang('configDelete', key)); - return true; + if (_this.focus) { + const focusedWorkspaceManifest = yield _this.readRootManifest(); + _this.focusedWorkspaceName = focusedWorkspaceManifest.name; + } + + _this.linkedModules = []; + + let linkedModules; + try { + linkedModules = yield (_fs || _load_fs()).readdir(_this.linkFolder); + } catch (err) { + if (err.code === 'ENOENT') { + linkedModules = []; + } else { + throw err; + } + } + + for (var _iterator = linkedModules, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const dir = _ref; + + const linkedPath = path.join(_this.linkFolder, dir); + + if (dir[0] === '@') { + // it's a scope, not a package + const scopedLinked = yield (_fs || _load_fs()).readdir(linkedPath); + _this.linkedModules.push(...scopedLinked.map(function (scopedDir) { + return path.join(dir, scopedDir); + })); + } else { + _this.linkedModules.push(dir); + } + } + + for (var _iterator2 = Object.keys((_index2 || _load_index2()).registries), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + const key = _ref2; + + const Registry = (_index2 || _load_index2()).registries[key]; + + const extraneousRcFiles = Registry === (_index2 || _load_index2()).registries.yarn ? _this.extraneousYarnrcFiles : []; + + // instantiate registry + const registry = new Registry(_this.cwd, _this.registries, _this.requestManager, _this.reporter, _this.enableDefaultRc, extraneousRcFiles); + yield registry.init({ + registry: opts.registry + }); + + _this.registries[key] = registry; + if (_this.registryFolders.indexOf(registry.folder) === -1) { + _this.registryFolders.push(registry.folder); + } + } + + if (_this.modulesFolder) { + _this.registryFolders = [_this.modulesFolder]; + } + + _this.networkConcurrency = opts.networkConcurrency || Number(_this.getOption('network-concurrency')) || (_constants || _load_constants()).NETWORK_CONCURRENCY; + + _this.childConcurrency = opts.childConcurrency || Number(_this.getOption('child-concurrency')) || Number(process.env.CHILD_CONCURRENCY) || (_constants || _load_constants()).CHILD_CONCURRENCY; + + _this.networkTimeout = opts.networkTimeout || Number(_this.getOption('network-timeout')) || (_constants || _load_constants()).NETWORK_TIMEOUT; + + const httpProxy = opts.httpProxy || _this.getOption('proxy'); + const httpsProxy = opts.httpsProxy || _this.getOption('https-proxy'); + _this.requestManager.setOptions({ + userAgent: String(_this.getOption('user-agent')), + httpProxy: httpProxy === false ? false : String(httpProxy || ''), + httpsProxy: httpsProxy === false ? false : String(httpsProxy || ''), + strictSSL: Boolean(_this.getOption('strict-ssl')), + ca: Array.prototype.concat(opts.ca || _this.getOption('ca') || []).map(String), + cafile: String(opts.cafile || _this.getOption('cafile', true) || ''), + cert: String(opts.cert || _this.getOption('cert') || ''), + key: String(opts.key || _this.getOption('key') || ''), + networkConcurrency: _this.networkConcurrency, + networkTimeout: _this.networkTimeout + }); + + _this.globalFolder = opts.globalFolder || String(_this.getOption('global-folder', true)); + if (_this.globalFolder === 'undefined') { + _this.globalFolder = (_constants || _load_constants()).GLOBAL_MODULE_DIRECTORY; + } + + let cacheRootFolder = opts.cacheFolder || _this.getOption('cache-folder', true); + + if (!cacheRootFolder) { + let preferredCacheFolders = (_constants || _load_constants()).PREFERRED_MODULE_CACHE_DIRECTORIES; + const preferredCacheFolder = opts.preferredCacheFolder || _this.getOption('preferred-cache-folder', true); + + if (preferredCacheFolder) { + preferredCacheFolders = [String(preferredCacheFolder)].concat(preferredCacheFolders); + } + + const cacheFolderQuery = yield (_fs || _load_fs()).getFirstSuitableFolder(preferredCacheFolders, (_fs || _load_fs()).constants.W_OK | (_fs || _load_fs()).constants.X_OK | (_fs || _load_fs()).constants.R_OK // eslint-disable-line no-bitwise + ); + for (var _iterator3 = cacheFolderQuery.skipped, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + const skippedEntry = _ref3; + + _this.reporter.warn(_this.reporter.lang('cacheFolderSkipped', skippedEntry.folder)); + } + + cacheRootFolder = cacheFolderQuery.folder; + if (cacheRootFolder && cacheFolderQuery.skipped.length > 0) { + _this.reporter.warn(_this.reporter.lang('cacheFolderSelected', cacheRootFolder)); + } + } + + if (!cacheRootFolder) { + throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('cacheFolderMissing')); + } else { + _this._cacheRootFolder = String(cacheRootFolder); + } + + const manifest = yield _this.maybeReadManifest(_this.lockfileFolder); + + const plugnplayByEnv = _this.getOption('plugnplay-override'); + if (plugnplayByEnv != null) { + _this.plugnplayEnabled = plugnplayByEnv !== 'false' && plugnplayByEnv !== '0'; + _this.plugnplayPersist = false; + } else if (opts.enablePnp || opts.disablePnp) { + _this.plugnplayEnabled = !!opts.enablePnp; + _this.plugnplayPersist = true; + } else if (manifest && manifest.installConfig && manifest.installConfig.pnp) { + _this.plugnplayEnabled = !!manifest.installConfig.pnp; + _this.plugnplayPersist = false; + } else { + _this.plugnplayEnabled = false; + _this.plugnplayPersist = false; + } + + if (process.platform === 'win32') { + const cacheRootFolderDrive = path.parse(_this._cacheRootFolder).root.toLowerCase(); + const lockfileFolderDrive = path.parse(_this.lockfileFolder).root.toLowerCase(); + + if (cacheRootFolderDrive !== lockfileFolderDrive) { + if (_this.plugnplayEnabled) { + _this.reporter.warn(_this.reporter.lang('plugnplayWindowsSupport')); + } + _this.plugnplayEnabled = false; + _this.plugnplayPersist = false; + } + } + + _this.plugnplayShebang = String(_this.getOption('plugnplay-shebang') || '') || '/usr/bin/env node'; + _this.plugnplayBlacklist = String(_this.getOption('plugnplay-blacklist') || '') || null; + + _this.ignoreScripts = opts.ignoreScripts || Boolean(_this.getOption('ignore-scripts', false)); + + _this.workspacesEnabled = _this.getOption('workspaces-experimental') !== false; + _this.workspacesNohoistEnabled = _this.getOption('workspaces-nohoist-experimental') !== false; + + _this.offlineCacheFolder = String(_this.getOption('offline-cache-folder') || '') || null; + + _this.pruneOfflineMirror = Boolean(_this.getOption('yarn-offline-mirror-pruning')); + _this.enableMetaFolder = Boolean(_this.getOption('enable-meta-folder')); + _this.enableLockfileVersions = Boolean(_this.getOption('yarn-enable-lockfile-versions')); + _this.linkFileDependencies = Boolean(_this.getOption('yarn-link-file-dependencies')); + _this.packBuiltPackages = Boolean(_this.getOption('experimental-pack-script-packages-in-mirror')); + + _this.autoAddIntegrity = !(0, (_conversion || _load_conversion()).boolifyWithDefault)(String(_this.getOption('unsafe-disable-integrity-migration')), true); + + //init & create cacheFolder, tempFolder + _this.cacheFolder = path.join(_this._cacheRootFolder, 'v' + String((_constants || _load_constants()).CACHE_VERSION)); + _this.tempFolder = opts.tempFolder || path.join(_this.cacheFolder, '.tmp'); + yield (_fs || _load_fs()).mkdirp(_this.cacheFolder); + yield (_fs || _load_fs()).mkdirp(_this.tempFolder); + + if (opts.production !== undefined) { + _this.production = Boolean(opts.production); + } else { + _this.production = Boolean(_this.getOption('production')) || process.env.NODE_ENV === 'production' && process.env.NPM_CONFIG_PRODUCTION !== 'false' && process.env.YARN_PRODUCTION !== 'false'; + } + + if (_this.workspaceRootFolder && !_this.workspacesEnabled) { + throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('workspacesDisabled')); + } + })(); + } + + _init(opts) { + this.registryFolders = []; + this.linkedModules = []; + + this.registries = (0, (_map || _load_map()).default)(); + this.cache = (0, (_map || _load_map()).default)(); + + // Ensure the cwd is always an absolute path. + this.cwd = path.resolve(opts.cwd || this.cwd || process.cwd()); + + this.looseSemver = opts.looseSemver == undefined ? true : opts.looseSemver; + + this.commandName = opts.commandName || ''; + + this.enableDefaultRc = opts.enableDefaultRc !== false; + this.extraneousYarnrcFiles = opts.extraneousYarnrcFiles || []; + + this.preferOffline = !!opts.preferOffline; + this.modulesFolder = opts.modulesFolder; + this.linkFolder = opts.linkFolder || (_constants || _load_constants()).LINK_REGISTRY_DIRECTORY; + this.offline = !!opts.offline; + this.binLinks = !!opts.binLinks; + this.updateChecksums = !!opts.updateChecksums; + this.plugnplayUnplugged = []; + this.plugnplayPurgeUnpluggedPackages = false; + + this.ignorePlatform = !!opts.ignorePlatform; + this.ignoreScripts = !!opts.ignoreScripts; + + this.disablePrepublish = !!opts.disablePrepublish; + + // $FlowFixMe$ + this.nonInteractive = !!opts.nonInteractive || isCi || !process.stdout.isTTY; + + this.requestManager.setOptions({ + offline: !!opts.offline && !opts.preferOffline, + captureHar: !!opts.captureHar }); - function _delete(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - } + this.focus = !!opts.focus; + this.focusedWorkspaceName = ''; - return _delete; - }(), - - list(config, reporter, flags, args) { - if (args.length) { - return false; - } - - reporter.info(reporter.lang('configYarn')); - reporter.inspect(config.registries.yarn.config); - - reporter.info(reporter.lang('configNpm')); - reporter.inspect(config.registries.npm.config); - - return true; - }, - - current(config, reporter, flags, args) { - if (args.length) { - return false; - } - - reporter.log((0, (_stringify || _load_stringify()).default)(config, CONFIG_KEYS, 2), { force: true }); - - return true; + this.otp = opts.otp || ''; } -}), - run = _buildSubCommands.run, - examples = _buildSubCommands.examples; -exports.run = run; -exports.examples = examples; + /** + * Generate a name suitable as unique filesystem identifier for the specified package. + */ + + generateUniquePackageSlug(pkg) { + let slug = pkg.name; + + slug = slug.replace(/[^@a-z0-9]+/g, '-'); + slug = slug.replace(/^-+|-+$/g, ''); + + if (pkg.registry) { + slug = `${pkg.registry}-${slug}`; + } else { + slug = `unknown-${slug}`; + } + + const hash = pkg.remote.hash; + + + if (pkg.version) { + slug += `-${pkg.version}`; + } + + if (pkg.uid && pkg.version !== pkg.uid) { + slug += `-${pkg.uid}`; + } else if (hash) { + slug += `-${hash}`; + } + + return slug; + } + + /** + * Generate an absolute module path. + */ + + generateModuleCachePath(pkg) { + invariant(this.cacheFolder, 'No package root'); + invariant(pkg, 'Undefined package'); + + const slug = this.generateUniquePackageSlug(pkg); + return path.join(this.cacheFolder, slug, 'node_modules', pkg.name); + } + + /** + */ + + getUnpluggedPath() { + return path.join(this.lockfileFolder, '.pnp', 'unplugged'); + } + + /** + */ + + generatePackageUnpluggedPath(pkg) { + const slug = this.generateUniquePackageSlug(pkg); + return path.join(this.getUnpluggedPath(), slug, 'node_modules', pkg.name); + } + + /** + */ + + listUnpluggedPackageFolders() { + var _this2 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const unpluggedPackages = new Map(); + const unpluggedPath = _this2.getUnpluggedPath(); + + if (!(yield (_fs || _load_fs()).exists(unpluggedPath))) { + return unpluggedPackages; + } + + for (var _iterator4 = yield (_fs || _load_fs()).readdir(unpluggedPath), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + const unpluggedName = _ref4; + + const nmListing = yield (_fs || _load_fs()).readdir(path.join(unpluggedPath, unpluggedName, 'node_modules')); + invariant(nmListing.length === 1, 'A single folder should be in the unplugged directory'); + + const target = path.join(unpluggedPath, unpluggedName, `node_modules`, nmListing[0]); + unpluggedPackages.set(unpluggedName, target); + } + + return unpluggedPackages; + })(); + } + + /** + * Execute lifecycle scripts in the specified directory. Ignoring when the --ignore-scripts flag has been + * passed. + */ + + executeLifecycleScript(commandName, cwd) { + if (this.ignoreScripts) { + return Promise.resolve(); + } else { + return (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execFromManifest)(this, commandName, cwd || this.cwd); + } + } + + /** + * Generate an absolute temporary filename location based on the input filename. + */ + + getTemp(filename) { + invariant(this.tempFolder, 'No temp folder'); + return path.join(this.tempFolder, filename); + } + + /** + * Remote packages may be cached in a file system to be available for offline installation. + * Second time the same package needs to be installed it will be loaded from there. + * Given a package's filename, return a path in the offline mirror location. + */ + + getOfflineMirrorPath(packageFilename) { + let mirrorPath; + + var _arr = ['npm', 'yarn']; + for (var _i5 = 0; _i5 < _arr.length; _i5++) { + const key = _arr[_i5]; + const registry = this.registries[key]; + + if (registry == null) { + continue; + } + + const registryMirrorPath = registry.config['yarn-offline-mirror']; + + if (registryMirrorPath === false) { + return null; + } + + if (registryMirrorPath == null) { + continue; + } + + mirrorPath = registryMirrorPath; + } + + if (mirrorPath == null) { + return null; + } + + if (packageFilename == null) { + return mirrorPath; + } + + return path.join(mirrorPath, path.basename(packageFilename)); + } + + /** + * Checker whether the folder input is a valid module folder. We output a yarn metadata + * file when we've successfully setup a folder so use this as a marker. + */ + + isValidModuleDest(dest) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (!(yield (_fs || _load_fs()).exists(dest))) { + return false; + } + + if (!(yield (_fs || _load_fs()).exists(path.join(dest, (_constants || _load_constants()).METADATA_FILENAME)))) { + return false; + } + + return true; + })(); + } + + /** + * Read package metadata and normalized package info. + */ + + readPackageMetadata(dir) { + var _this3 = this; + + return this.getCache(`metadata-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const metadata = yield _this3.readJson(path.join(dir, (_constants || _load_constants()).METADATA_FILENAME)); + const pkg = yield _this3.readManifest(dir, metadata.registry); + + return { + package: pkg, + artifacts: metadata.artifacts || [], + hash: metadata.hash, + remote: metadata.remote, + registry: metadata.registry + }; + })); + } + + /** + * Read normalized package info according yarn-metadata.json + * throw an error if package.json was not found + */ + + readManifest(dir, priorityRegistry, isRoot = false) { + var _this4 = this; + + return this.getCache(`manifest-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const manifest = yield _this4.maybeReadManifest(dir, priorityRegistry, isRoot); + + if (manifest) { + return manifest; + } else { + throw new (_errors || _load_errors()).MessageError(_this4.reporter.lang('couldntFindPackagejson', dir), 'ENOENT'); + } + })); + } + + /** + * try get the manifest file by looking + * 1. manifest file in cache + * 2. manifest file in registry + */ + maybeReadManifest(dir, priorityRegistry, isRoot = false) { + var _this5 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const metadataLoc = path.join(dir, (_constants || _load_constants()).METADATA_FILENAME); + + if (yield (_fs || _load_fs()).exists(metadataLoc)) { + const metadata = yield _this5.readJson(metadataLoc); + + if (!priorityRegistry) { + priorityRegistry = metadata.priorityRegistry; + } + + if (typeof metadata.manifest !== 'undefined') { + return metadata.manifest; + } + } + + if (priorityRegistry) { + const file = yield _this5.tryManifest(dir, priorityRegistry, isRoot); + if (file) { + return file; + } + } + + for (var _iterator5 = Object.keys((_index2 || _load_index2()).registries), _isArray5 = Array.isArray(_iterator5), _i6 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref7; + + if (_isArray5) { + if (_i6 >= _iterator5.length) break; + _ref7 = _iterator5[_i6++]; + } else { + _i6 = _iterator5.next(); + if (_i6.done) break; + _ref7 = _i6.value; + } + + const registry = _ref7; + + if (priorityRegistry === registry) { + continue; + } + + const file = yield _this5.tryManifest(dir, registry, isRoot); + if (file) { + return file; + } + } + + return null; + })(); + } + + /** + * Read the root manifest. + */ + + readRootManifest() { + return this.readManifest(this.cwd, 'npm', true); + } + + /** + * Try and find package info with the input directory and registry. + */ + + tryManifest(dir, registry, isRoot) { + var _this6 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const filename = (_index2 || _load_index2()).registries[registry].filename; + + const loc = path.join(dir, filename); + if (yield (_fs || _load_fs()).exists(loc)) { + const data = yield _this6.readJson(loc); + data._registry = registry; + data._loc = loc; + return (0, (_index || _load_index()).default)(data, dir, _this6, isRoot); + } else { + return null; + } + })(); + } + + findManifest(dir, isRoot) { + var _this7 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + for (var _iterator6 = (_index2 || _load_index2()).registryNames, _isArray6 = Array.isArray(_iterator6), _i7 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref8; + + if (_isArray6) { + if (_i7 >= _iterator6.length) break; + _ref8 = _iterator6[_i7++]; + } else { + _i7 = _iterator6.next(); + if (_i7.done) break; + _ref8 = _i7.value; + } + + const registry = _ref8; + + const manifest = yield _this7.tryManifest(dir, registry, isRoot); + + if (manifest) { + return manifest; + } + } + + return null; + })(); + } + + findWorkspaceRoot(initial) { + var _this8 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + let previous = null; + let current = path.normalize(initial); + if (!(yield (_fs || _load_fs()).exists(current))) { + throw new (_errors || _load_errors()).MessageError(_this8.reporter.lang('folderMissing', current)); + } + + do { + const manifest = yield _this8.findManifest(current, true); + const ws = extractWorkspaces(manifest); + if (ws && ws.packages) { + const relativePath = path.relative(current, initial); + if (relativePath === '' || micromatch([relativePath], ws.packages).length > 0) { + return current; + } else { + return null; + } + } + + previous = current; + current = path.dirname(current); + } while (current !== previous); + + return null; + })(); + } + + resolveWorkspaces(root, rootManifest) { + var _this9 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const workspaces = {}; + if (!_this9.workspacesEnabled) { + return workspaces; + } + + const ws = _this9.getWorkspaces(rootManifest, true); + const patterns = ws && ws.packages ? ws.packages : []; + + if (!Array.isArray(patterns)) { + throw new (_errors || _load_errors()).MessageError(_this9.reporter.lang('workspacesSettingMustBeArray')); + } + + const registryFilenames = (_index2 || _load_index2()).registryNames.map(function (registryName) { + return _this9.registries[registryName].constructor.filename; + }).join('|'); + const trailingPattern = `/+(${registryFilenames})`; + // anything under folder (node_modules) should be ignored, thus use the '**' instead of shallow match "*" + const ignorePatterns = _this9.registryFolders.map(function (folder) { + return `/${folder}/**/+(${registryFilenames})`; + }); + + const files = yield Promise.all(patterns.map(function (pattern) { + return (_fs || _load_fs()).glob(pattern.replace(/\/?$/, trailingPattern), { + cwd: root, + ignore: ignorePatterns.map(function (ignorePattern) { + return pattern.replace(/\/?$/, ignorePattern); + }) + }); + })); + + for (var _iterator7 = new Set([].concat(...files)), _isArray7 = Array.isArray(_iterator7), _i8 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref9; + + if (_isArray7) { + if (_i8 >= _iterator7.length) break; + _ref9 = _iterator7[_i8++]; + } else { + _i8 = _iterator7.next(); + if (_i8.done) break; + _ref9 = _i8.value; + } + + const file = _ref9; + + const loc = path.join(root, path.dirname(file)); + const manifest = yield _this9.findManifest(loc, false); + + if (!manifest) { + continue; + } + + if (!manifest.name) { + _this9.reporter.warn(_this9.reporter.lang('workspaceNameMandatory', loc)); + continue; + } + if (!manifest.version) { + _this9.reporter.warn(_this9.reporter.lang('workspaceVersionMandatory', loc)); + continue; + } + + if (Object.prototype.hasOwnProperty.call(workspaces, manifest.name)) { + throw new (_errors || _load_errors()).MessageError(_this9.reporter.lang('workspaceNameDuplicate', manifest.name)); + } + + workspaces[manifest.name] = { loc, manifest }; + } + + return workspaces; + })(); + } + + // workspaces functions + getWorkspaces(manifest, shouldThrow = false) { + if (!manifest || !this.workspacesEnabled) { + return undefined; + } + + const ws = extractWorkspaces(manifest); + + if (!ws) { + return ws; + } + + // validate eligibility + let wsCopy = (0, (_extends2 || _load_extends()).default)({}, ws); + const warnings = []; + const errors = []; + + // packages + if (wsCopy.packages && wsCopy.packages.length > 0 && !manifest.private) { + errors.push(this.reporter.lang('workspacesRequirePrivateProjects')); + wsCopy = undefined; + } + // nohoist + if (wsCopy && wsCopy.nohoist && wsCopy.nohoist.length > 0) { + if (!this.workspacesNohoistEnabled) { + warnings.push(this.reporter.lang('workspacesNohoistDisabled', manifest.name)); + wsCopy.nohoist = undefined; + } else if (!manifest.private) { + errors.push(this.reporter.lang('workspacesNohoistRequirePrivatePackages', manifest.name)); + wsCopy.nohoist = undefined; + } + } + + if (errors.length > 0 && shouldThrow) { + throw new (_errors || _load_errors()).MessageError(errors.join('\n')); + } + + const msg = errors.concat(warnings).join('\n'); + if (msg.length > 0) { + this.reporter.warn(msg); + } + + return wsCopy; + } + + /** + * Description + */ + + getFolder(pkg) { + let registryName = pkg._registry; + if (!registryName) { + const ref = pkg._reference; + invariant(ref, 'expected reference'); + registryName = ref.registry; + } + return this.registries[registryName].folder; + } + + /** + * Get root manifests. + */ + + getRootManifests() { + var _this10 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const manifests = {}; + for (var _iterator8 = (_index2 || _load_index2()).registryNames, _isArray8 = Array.isArray(_iterator8), _i9 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { + var _ref10; + + if (_isArray8) { + if (_i9 >= _iterator8.length) break; + _ref10 = _iterator8[_i9++]; + } else { + _i9 = _iterator8.next(); + if (_i9.done) break; + _ref10 = _i9.value; + } + + const registryName = _ref10; + + const registry = (_index2 || _load_index2()).registries[registryName]; + const jsonLoc = path.join(_this10.cwd, registry.filename); + + let object = {}; + let exists = false; + let indent; + if (yield (_fs || _load_fs()).exists(jsonLoc)) { + exists = true; + + const info = yield _this10.readJson(jsonLoc, (_fs || _load_fs()).readJsonAndFile); + object = info.object; + indent = detectIndent(info.content).indent || undefined; + } + manifests[registryName] = { loc: jsonLoc, object, exists, indent }; + } + return manifests; + })(); + } + + /** + * Save root manifests. + */ + + saveRootManifests(manifests) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + for (var _iterator9 = (_index2 || _load_index2()).registryNames, _isArray9 = Array.isArray(_iterator9), _i10 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { + var _ref11; + + if (_isArray9) { + if (_i10 >= _iterator9.length) break; + _ref11 = _iterator9[_i10++]; + } else { + _i10 = _iterator9.next(); + if (_i10.done) break; + _ref11 = _i10.value; + } + + const registryName = _ref11; + var _manifests$registryNa = manifests[registryName]; + const loc = _manifests$registryNa.loc, + object = _manifests$registryNa.object, + exists = _manifests$registryNa.exists, + indent = _manifests$registryNa.indent; + + if (!exists && !Object.keys(object).length) { + continue; + } + + for (var _iterator10 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray10 = Array.isArray(_iterator10), _i11 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { + var _ref12; + + if (_isArray10) { + if (_i11 >= _iterator10.length) break; + _ref12 = _iterator10[_i11++]; + } else { + _i11 = _iterator10.next(); + if (_i11.done) break; + _ref12 = _i11.value; + } + + const field = _ref12; + + if (object[field]) { + object[field] = sortObject(object[field]); + } + } + + yield (_fs || _load_fs()).writeFilePreservingEol(loc, JSON.stringify(object, null, indent || (_constants || _load_constants()).DEFAULT_INDENT) + '\n'); + } + })(); + } + + /** + * Call the passed factory (defaults to fs.readJson) and rethrow a pretty error message if it was the result + * of a syntax error. + */ + + readJson(loc, factory = (_fs || _load_fs()).readJson) { + try { + return factory(loc); + } catch (err) { + if (err instanceof SyntaxError) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('jsonError', loc, err.message)); + } else { + throw err; + } + } + } + + static create(opts = {}, reporter = new (_index3 || _load_index3()).NoopReporter()) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const config = new Config(reporter); + yield config.init(opts); + return config; + })(); + } +} + +exports.default = Config; +function extractWorkspaces(manifest) { + if (!manifest || !manifest.workspaces) { + return undefined; + } + + if (Array.isArray(manifest.workspaces)) { + return { packages: manifest.workspaces }; + } + + if (manifest.workspaces.packages && Array.isArray(manifest.workspaces.packages) || manifest.workspaces.nohoist && Array.isArray(manifest.workspaces.nohoist)) { + return manifest.workspaces; + } + + return undefined; +} /***/ }), -/* 515 */ +/* 163 */ +/***/ (function(module, exports) { + +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; + + +/***/ }), +/* 164 */ +/***/ (function(module, exports) { + +module.exports = require("net"); + +/***/ }), +/* 165 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87556,7 +43913,7 @@ exports.examples = examples; Object.defineProperty(exports, "__esModule", { value: true }); -exports.run = undefined; +exports.run = exports.Add = undefined; var _asyncToGenerator2; @@ -87567,372 +43924,127 @@ function _load_asyncToGenerator() { var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); + return _extends2 = _interopRequireDefault(__webpack_require__(22)); } -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var builderName = args[0], - rest = args.slice(1); - - - if (!builderName) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName')); +let run = exports.run = (() => { + var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (!args.length) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('missingAddDependencies')); } - var _coerceCreatePackageN = coerceCreatePackageName(builderName), - packageName = _coerceCreatePackageN.fullName, - commandName = _coerceCreatePackageN.name; + const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); - var linkLoc = path.join(config.linkFolder, commandName); - if (yield (_fs || _load_fs()).exists(linkLoc)) { - reporter.info(reporter.lang('linkUsing', packageName)); - } else { - yield (0, (_global || _load_global()).run)(config, reporter, {}, ['add', packageName]); - } - - var binFolder = yield (0, (_global || _load_global()).getBinFolder)(config, {}); - var command = path.resolve(binFolder, commandName); - var env = yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)('create', config.cwd, config); - - yield (_child || _load_child()).spawn(command, rest, { stdio: `inherit`, shell: true, env }); - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; -exports.parsePackageName = parsePackageName; -exports.coerceCreatePackageName = coerceCreatePackageName; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _child; - -function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(61)); -} - -var _executeLifecycleScript; - -function _load_executeLifecycleScript() { - return _executeLifecycleScript = __webpack_require__(100); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _global; - -function _load_global() { - return _global = __webpack_require__(115); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var path = __webpack_require__(1); - -function setFlags(commander) { - commander.description('Creates new projects from any create-* starter kits.'); -} - -function hasWrapper(commander, args) { - return true; -} - -function parsePackageName(str) { - if (str.charAt(0) === '/') { - throw new Error(`Name should not start with "/", got "${str}"`); - } - if (str.charAt(0) === '.') { - throw new Error(`Name should not start with ".", got "${str}"`); - } - var parts = str.split('/'); - var isScoped = str.charAt(0) === '@'; - if (isScoped && parts[0] === '@') { - throw new Error(`Scope should not be empty, got "${str}"`); - } - var scope = isScoped ? parts[0] : ''; - var name = parts[isScoped ? 1 : 0] || ''; - var path = parts.slice(isScoped ? 2 : 1).join('/'); - var fullName = [scope, name].filter(Boolean).join('/'); - var full = [scope, name, path].filter(Boolean).join('/'); - - return { fullName, name, scope, path, full }; -} - -function coerceCreatePackageName(str) { - var pkgNameObj = parsePackageName(str); - var coercedName = pkgNameObj.name !== '' ? `create-${pkgNameObj.name}` : `create`; - var coercedPkgNameObj = (0, (_extends2 || _load_extends()).default)({}, pkgNameObj, { - name: coercedName, - fullName: [pkgNameObj.scope, coercedName].filter(Boolean).join('/'), - full: [pkgNameObj.scope, coercedName, pkgNameObj.path].filter(Boolean).join('/') - }); - return coercedPkgNameObj; -} - -/***/ }), -/* 516 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var env = yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)(`exec`, config.cwd, config); - - if (args.length < 1) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('execMissingCommand')); - } - - var execName = args[0], - rest = args.slice(1); - - yield (_child || _load_child()).spawn(execName, rest, { stdio: 'inherit', env }); - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _child; - -function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(61)); -} - -var _executeLifecycleScript; - -function _load_executeLifecycleScript() { - return _executeLifecycleScript = __webpack_require__(100); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function setFlags(commander) {} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 517 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.examples = exports.run = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var manifest = void 0; - if (flags.useManifest) { - manifest = yield config.readJson(flags.useManifest); - } else { - manifest = yield config.readRootManifest(); - } - if (!manifest.name) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noName')); - } - if (!manifest.version) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noVersion')); - } - - var entry = { - name: manifest.name, - version: manifest.version, - resolved: flags.resolved, - registry: flags.registry || manifest._registry, - optionalDependencies: manifest.optionalDependencies, - dependencies: manifest.dependencies - }; - var pattern = flags.pattern || `${entry.name}@${entry.version}`; - reporter.log((0, (_lockfile || _load_lockfile()).stringify)({ - [pattern]: (0, (_lockfile || _load_lockfile()).implodeEntry)(pattern, entry) + yield (0, (_install || _load_install()).wrapLifecycle)(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const install = new Add(args, flags, config, reporter, lockfile); + yield install.init(); })); }); return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); + return _ref7.apply(this, arguments); }; -}(); +})(); exports.hasWrapper = hasWrapper; exports.setFlags = setFlags; -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - var _lockfile; function _load_lockfile() { - return _lockfile = __webpack_require__(25); + return _lockfile = _interopRequireDefault(__webpack_require__(19)); } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _normalizePattern2; -function hasWrapper(commander, args) { - return false; +function _load_normalizePattern() { + return _normalizePattern2 = __webpack_require__(37); } -function setFlags(commander) { - commander.description('Generates a lock file entry.'); - commander.option('--use-manifest ', 'description'); - commander.option('--resolved ', 'description'); - commander.option('--registry ', 'description'); +var _workspaceLayout; + +function _load_workspaceLayout() { + return _workspaceLayout = _interopRequireDefault(__webpack_require__(90)); } -var examples = exports.examples = ['generate-lock-entry', 'generate-lock-entry --use-manifest ./package.json', 'generate-lock-entry --resolved local-file.tgz#hash']; - -/***/ }), -/* 518 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; -exports.run = run; - var _index; function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(273)); + return _index = __webpack_require__(78); +} + +var _list; + +function _load_list() { + return _list = __webpack_require__(358); +} + +var _install; + +function _load_install() { + return _install = __webpack_require__(34); +} + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(5); } var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(13)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } -var _misc; +var _fs; -function _load_misc() { - return _misc = __webpack_require__(28); +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(6)); } -var _aliases; +var _invariant; -function _load_aliases() { - return _aliases = _interopRequireDefault(__webpack_require__(294)); +function _load_invariant() { + return _invariant = _interopRequireDefault(__webpack_require__(9)); +} + +var _path; + +function _load_path() { + return _path = _interopRequireDefault(__webpack_require__(0)); +} + +var _semver; + +function _load_semver() { + return _semver = _interopRequireDefault(__webpack_require__(21)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var chalk = __webpack_require__(36); +const SILENCE_DEPENDENCY_TYPE_WARNINGS = ['upgrade', 'upgrade-interactive']; -function hasWrapper(flags, args) { - return false; -} - -function setFlags(commander) { - commander.description('Displays help information.'); -} - -function run(config, reporter, commander, args) { - if (args.length) { - var commandName = args.shift(); - if (Object.prototype.hasOwnProperty.call((_index || _load_index()).default, commandName)) { - var command = (_index || _load_index()).default[commandName]; - if (command) { - command.setFlags(commander); - var examples = (command.examples || []).map(function (example) { - return ` $ yarn ${example}`; - }); - if (examples.length) { - commander.on('--help', function () { - reporter.log(reporter.lang('helpExamples', reporter.rawText(examples.join('\n')))); - }); - } - // eslint-disable-next-line yarn-internal/warn-language - commander.on('--help', function () { - return reporter.log(' ' + command.getDocsInfo + '\n'); - }); - commander.help(); - return (_promise || _load_promise()).default.resolve(); - } - } +class Add extends (_install || _load_install()).Install { + constructor(args, flags, config, reporter, lockfile) { + const workspaceRootIsCwd = config.cwd === config.lockfileFolder; + const _flags = flags ? (0, (_extends2 || _load_extends()).default)({}, flags, { workspaceRootIsCwd }) : { workspaceRootIsCwd }; + super(_flags, config, reporter, lockfile); + this.args = args; + // only one flag is supported, so we can figure out which one was passed to `yarn add` + this.flagToOrigin = [flags.dev && 'devDependencies', flags.optional && 'optionalDependencies', flags.peer && 'peerDependencies', 'dependencies'].filter(Boolean).shift(); } - commander.on('--help', function () { - var commandsText = []; - for (var _iterator = (0, (_keys || _load_keys()).default)((_index || _load_index()).default).sort((_misc || _load_misc()).sortAlpha), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + /** + * TODO + */ + + prepareRequests(requests) { + const requestsWithArgs = requests.slice(); + + for (var _iterator = this.args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { @@ -87944,2838 +44056,328 @@ function run(config, reporter, commander, args) { _ref = _i.value; } - var name = _ref; + const pattern = _ref; - if ((_index || _load_index()).default[name].useless || (0, (_keys || _load_keys()).default)((_aliases || _load_aliases()).default).map(function (key) { - return (_aliases || _load_aliases()).default[key]; - }).indexOf(name) > -1) { - continue; - } - if ((_aliases || _load_aliases()).default[name]) { - commandsText.push(` - ${(0, (_misc || _load_misc()).hyphenate)(name)} / ${(_aliases || _load_aliases()).default[name]}`); - } else { - commandsText.push(` - ${(0, (_misc || _load_misc()).hyphenate)(name)}`); - } - } - reporter.log(reporter.lang('helpCommands', reporter.rawText(commandsText.join('\n')))); - reporter.log(reporter.lang('helpCommandsMore', reporter.rawText(chalk.bold('yarn help COMMAND')))); - reporter.log(reporter.lang('helpLearnMore', reporter.rawText(chalk.bold((_constants || _load_constants()).YARN_DOCS)))); - }); - - commander.options.sort((_misc || _load_misc()).sortOptionsByFlags); - - commander.help(); - return (_promise || _load_promise()).default.resolve(); -} - -/***/ }), -/* 519 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.Import = exports.noArguments = undefined; - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _classCallCheck2; - -function _load_classCallCheck() { - return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3)); -} - -var _possibleConstructorReturn2; - -function _load_possibleConstructorReturn() { - return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11)); -} - -var _inherits2; - -function _load_inherits() { - return _inherits2 = _interopRequireDefault(__webpack_require__(10)); -} - -var run = exports.run = function () { - var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var imp = new Import(flags, config, reporter, new (_lockfile || _load_lockfile()).default({ cache: {} })); - yield imp.init(); - }); - - return function run(_x7, _x8, _x9, _x10) { - return _ref15.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _install; - -function _load_install() { - return _install = __webpack_require__(41); -} - -var _check; - -function _load_check() { - return _check = __webpack_require__(298); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(75); -} - -var _baseResolver; - -function _load_baseResolver() { - return _baseResolver = _interopRequireDefault(__webpack_require__(117)); -} - -var _hostedGitResolver; - -function _load_hostedGitResolver() { - return _hostedGitResolver = _interopRequireDefault(__webpack_require__(99)); -} - -var _hostedGitResolver2; - -function _load_hostedGitResolver2() { - return _hostedGitResolver2 = __webpack_require__(99); -} - -var _gistResolver; - -function _load_gistResolver() { - return _gistResolver = _interopRequireDefault(__webpack_require__(205)); -} - -var _gistResolver2; - -function _load_gistResolver2() { - return _gistResolver2 = __webpack_require__(205); -} - -var _gitResolver; - -function _load_gitResolver() { - return _gitResolver = _interopRequireDefault(__webpack_require__(118)); -} - -var _fileResolver; - -function _load_fileResolver() { - return _fileResolver = _interopRequireDefault(__webpack_require__(204)); -} - -var _packageResolver; - -function _load_packageResolver() { - return _packageResolver = _interopRequireDefault(__webpack_require__(309)); -} - -var _packageRequest; - -function _load_packageRequest() { - return _packageRequest = _interopRequireDefault(__webpack_require__(116)); -} - -var _packageReference; - -function _load_packageReference() { - return _packageReference = _interopRequireDefault(__webpack_require__(308)); -} - -var _packageFetcher; - -function _load_packageFetcher() { - return _packageFetcher = _interopRequireWildcard(__webpack_require__(199)); -} - -var _packageLinker; - -function _load_packageLinker() { - return _packageLinker = _interopRequireDefault(__webpack_require__(200)); -} - -var _packageCompatibility; - -function _load_packageCompatibility() { - return _packageCompatibility = _interopRequireWildcard(__webpack_require__(198)); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -var _normalizePattern9; - -function _load_normalizePattern() { - return _normalizePattern9 = __webpack_require__(52); -} - -var _logicalDependencyTree; - -function _load_logicalDependencyTree() { - return _logicalDependencyTree = __webpack_require__(571); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _misc; - -function _load_misc() { - return _misc = _interopRequireWildcard(__webpack_require__(28)); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(13); -} - -var _semver; - -function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(27)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var invariant = __webpack_require__(15); -var path = __webpack_require__(1); -var uuid = __webpack_require__(113); -var ssri = __webpack_require__(93); -var nodeVersion = process.versions.node.split('-')[0]; - -var noArguments = exports.noArguments = true; - -var ImportResolver = function (_BaseResolver) { - (0, (_inherits2 || _load_inherits()).default)(ImportResolver, _BaseResolver); - - function ImportResolver() { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ImportResolver); - return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseResolver.apply(this, arguments)); - } - - ImportResolver.prototype.getCwd = function getCwd() { - if (this.request.parentRequest) { - var parent = this.resolver.getStrictResolvedPattern(this.request.parentRequest.pattern); - invariant(parent._loc, 'expected package location'); - return path.dirname(parent._loc); - } - return this.config.cwd; - }; - - ImportResolver.prototype.resolveHostedGit = function resolveHostedGit(info, Resolver) { - var _normalizePattern = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern), - range = _normalizePattern.range; - - var exploded = (0, (_hostedGitResolver2 || _load_hostedGitResolver2()).explodeHostedGitFragment)(range, this.reporter); - var hash = info.gitHead; - invariant(hash, 'expected package gitHead'); - var url = Resolver.getTarballUrl(exploded, hash); - info._uid = hash; - info._remote = { - resolved: url, - type: 'tarball', - registry: this.registry, - reference: url, - hash: null - }; - return info; - }; - - ImportResolver.prototype.resolveGist = function resolveGist(info, Resolver) { - var _normalizePattern2 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern), - range = _normalizePattern2.range; - - var _explodeGistFragment = (0, (_gistResolver2 || _load_gistResolver2()).explodeGistFragment)(range, this.reporter), - id = _explodeGistFragment.id; - - var hash = info.gitHead; - invariant(hash, 'expected package gitHead'); - var url = `https://gist.github.com/${id}.git`; - info._uid = hash; - info._remote = { - resolved: `${url}#${hash}`, - type: 'git', - registry: this.registry, - reference: url, - hash - }; - return info; - }; - - ImportResolver.prototype.resolveGit = function resolveGit(info, Resolver) { - var url = info._resolved; - var hash = info.gitHead; - invariant(url, 'expected package _resolved'); - invariant(hash, 'expected package gitHead'); - info._uid = hash; - info._remote = { - resolved: `${url}#${hash}`, - type: 'git', - registry: this.registry, - reference: url, - hash - }; - return info; - }; - - ImportResolver.prototype.resolveFile = function resolveFile(info, Resolver) { - var _normalizePattern3 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern), - range = _normalizePattern3.range; - - var loc = (_misc || _load_misc()).removePrefix(range, 'file:'); - if (!path.isAbsolute(loc)) { - loc = path.join(this.config.cwd, loc); - } - info._uid = info.version; - info._remote = { - type: 'copy', - registry: this.registry, - hash: `${uuid.v4()}-${new Date().getTime()}`, - reference: loc - }; - return info; - }; - - ImportResolver.prototype.resolveRegistry = function resolveRegistry(info) { - var url = info._resolved; - var hash = info._shasum; - invariant(url, 'expected package _resolved'); - invariant(hash, 'expected package _shasum'); - if (this.config.getOption('registry') === (_constants || _load_constants()).YARN_REGISTRY) { - url = url.replace((_constants || _load_constants()).NPM_REGISTRY_RE, (_constants || _load_constants()).YARN_REGISTRY); - } - info._uid = info.version; - info._remote = { - resolved: `${url}#${hash}`, - type: 'tarball', - registry: this.registry, - reference: url, - integrity: info._integrity ? ssri.parse(info._integrity) : ssri.fromHex(hash, 'sha1'), - hash - }; - return info; - }; - - ImportResolver.prototype.resolveImport = function resolveImport(info) { - var _normalizePattern4 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern), - range = _normalizePattern4.range; - - var Resolver = (0, (_index || _load_index()).getExoticResolver)(range); - if (Resolver && Resolver.prototype instanceof (_hostedGitResolver || _load_hostedGitResolver()).default) { - return this.resolveHostedGit(info, Resolver); - } else if (Resolver && Resolver === (_gistResolver || _load_gistResolver()).default) { - return this.resolveGist(info, Resolver); - } else if (Resolver && Resolver === (_gitResolver || _load_gitResolver()).default) { - return this.resolveGit(info, Resolver); - } else if (Resolver && Resolver === (_fileResolver || _load_fileResolver()).default) { - return this.resolveFile(info, Resolver); - } - return this.resolveRegistry(info); - }; - - ImportResolver.prototype.resolveLocation = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { - var info = yield this.config.tryManifest(loc, 'npm', false); - if (!info) { - return null; - } - return this.resolveImport(info); - }); - - function resolveLocation(_x) { - return _ref.apply(this, arguments); - } - - return resolveLocation; - }(); - - ImportResolver.prototype.resolveFixedVersion = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (fixedVersionPattern) { - var _normalizePattern5 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(fixedVersionPattern), - range = _normalizePattern5.range; - - var exoticResolver = (0, (_index || _load_index()).getExoticResolver)(range); - var manifest = exoticResolver ? yield this.request.findExoticVersionInfo(exoticResolver, range) : yield this.request.findVersionOnRegistry(fixedVersionPattern); - return manifest; - }); - - function resolveFixedVersion(_x2) { - return _ref2.apply(this, arguments); - } - - return resolveFixedVersion; - }(); - - ImportResolver.prototype._resolveFromFixedVersions = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _this2 = this; - - invariant(this.request instanceof ImportPackageRequest, 'request must be ImportPackageRequest'); - - var _normalizePattern6 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern), - name = _normalizePattern6.name; - - invariant(this.request.dependencyTree instanceof (_logicalDependencyTree || _load_logicalDependencyTree()).LogicalDependencyTree, 'dependencyTree on request must be LogicalDependencyTree'); - var fixedVersionPattern = this.request.dependencyTree.getFixedVersionPattern(name, this.request.parentNames); - var info = yield this.config.getCache(`import-resolver-${fixedVersionPattern}`, function () { - return _this2.resolveFixedVersion(fixedVersionPattern); + requestsWithArgs.push({ + pattern, + registry: 'npm', + optional: false }); - if (info) { - return info; - } - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('importResolveFailed', name, this.getCwd())); - }); - - function _resolveFromFixedVersions() { - return _ref3.apply(this, arguments); } - - return _resolveFromFixedVersions; - }(); - - ImportResolver.prototype._resolveFromNodeModules = function () { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _this3 = this; - - var _normalizePattern7 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern), - name = _normalizePattern7.name; - - var cwd = this.getCwd(); - - var _loop = function* _loop() { - var loc = path.join(cwd, 'node_modules', name); - var info = yield _this3.config.getCache(`import-resolver-${loc}`, function () { - return _this3.resolveLocation(loc); - }); - if (info) { - return { - v: info - }; - } - cwd = path.resolve(cwd, '../..'); - }; - - while (!path.relative(this.config.cwd, cwd).startsWith('..')) { - var _ret = yield* _loop(); - - if (typeof _ret === "object") return _ret.v; - } - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('importResolveFailed', name, this.getCwd())); - }); - - function _resolveFromNodeModules() { - return _ref4.apply(this, arguments); - } - - return _resolveFromNodeModules; - }(); - - ImportResolver.prototype.resolve = function resolve() { - if (this.request instanceof ImportPackageRequest && this.request.dependencyTree) { - return this._resolveFromFixedVersions(); - } else { - return this._resolveFromNodeModules(); - } - }; - - return ImportResolver; -}((_baseResolver || _load_baseResolver()).default); - -var ImportPackageRequest = function (_PackageRequest) { - (0, (_inherits2 || _load_inherits()).default)(ImportPackageRequest, _PackageRequest); - - function ImportPackageRequest(req, dependencyTree, resolver) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ImportPackageRequest); - - var _this4 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _PackageRequest.call(this, req, resolver)); - - _this4.import = _this4.parentRequest instanceof ImportPackageRequest ? _this4.parentRequest.import : true; - _this4.dependencyTree = dependencyTree; - return _this4; + return requestsWithArgs; } - ImportPackageRequest.prototype.getRootName = function getRootName() { - return this.resolver instanceof ImportPackageResolver && this.resolver.rootName || 'root'; - }; + /** + * returns version for a pattern based on Manifest + */ + getPatternVersion(pattern, pkg) { + const tilde = this.flags.tilde; + const configPrefix = String(this.config.getOption('save-prefix')); + const exact = this.flags.exact || Boolean(this.config.getOption('save-exact')) || configPrefix === ''; - ImportPackageRequest.prototype.getParentHumanName = function getParentHumanName() { - return [this.getRootName()].concat(this.parentNames).join(' > '); - }; + var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern); - ImportPackageRequest.prototype.reportResolvedRangeMatch = function reportResolvedRangeMatch(info, resolved) { - if (info.version === resolved.version) { - return; + const hasVersion = _normalizePattern.hasVersion, + range = _normalizePattern.range; + + let version; + + if ((0, (_index || _load_index()).getExoticResolver)(pattern)) { + // wasn't a name/range tuple so this is just a raw exotic pattern + version = pattern; + } else if (hasVersion && range && ((_semver || _load_semver()).default.satisfies(pkg.version, range) || (0, (_index || _load_index()).getExoticResolver)(range))) { + // if the user specified a range then use it verbatim + version = range; } - this.reporter.warn(this.reporter.lang('importResolvedRangeMatch', resolved.version, resolved.name, info.version, this.getParentHumanName())); - }; - ImportPackageRequest.prototype._findResolvedManifest = function _findResolvedManifest(info) { - var _normalizePattern8 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern), - range = _normalizePattern8.range, - name = _normalizePattern8.name; + if (!version || (_semver || _load_semver()).default.valid(version)) { + let prefix = configPrefix || '^'; - var solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; - var resolved = this.resolver.getExactVersionMatch(name, solvedRange, info); - if (resolved) { - return resolved; + if (tilde) { + prefix = '~'; + } else if (version || exact) { + prefix = ''; + } + version = `${prefix}${pkg.version}`; } - invariant(info._remote, 'expected package remote'); - var ref = new (_packageReference || _load_packageReference()).default(this, info, info._remote); - info._reference = ref; - return info; - }; - ImportPackageRequest.prototype.resolveToExistingVersion = function resolveToExistingVersion(info) { - var resolved = this._findResolvedManifest(info); - invariant(resolved, 'should have found a resolved reference'); - var ref = resolved._reference; - invariant(ref, 'should have a package reference'); - ref.addRequest(this); - ref.addPattern(this.pattern, resolved); - ref.addOptional(this.optional); - }; - - ImportPackageRequest.prototype.findVersionInfo = function findVersionInfo() { - var _this5 = this; - - if (!this.import) { - this.reporter.verbose(this.reporter.lang('skippingImport', this.pattern, this.getParentHumanName())); - return _PackageRequest.prototype.findVersionInfo.call(this); - } - var resolver = new ImportResolver(this, this.pattern); - return resolver.resolve().catch(function () { - _this5.import = false; - _this5.reporter.warn(_this5.reporter.lang('importFailed', _this5.pattern, _this5.getParentHumanName())); - return _PackageRequest.prototype.findVersionInfo.call(_this5); - }); - }; - - return ImportPackageRequest; -}((_packageRequest || _load_packageRequest()).default); - -var ImportPackageResolver = function (_PackageResolver) { - (0, (_inherits2 || _load_inherits()).default)(ImportPackageResolver, _PackageResolver); - - function ImportPackageResolver(config, lockfile) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ImportPackageResolver); - - var _this6 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _PackageResolver.call(this, config, lockfile)); - - _this6.next = []; - _this6.rootName = 'root'; - return _this6; + return version; } - ImportPackageResolver.prototype.find = function find(req) { - this.next.push(req); - return (_promise || _load_promise()).default.resolve(); - }; - - ImportPackageResolver.prototype.findOne = function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (req) { - if (this.activity) { - this.activity.tick(req.pattern); - } - var request = new ImportPackageRequest(req, this.dependencyTree, this); - yield request.find({ fresh: false }); - }); - - function findOne(_x3) { - return _ref5.apply(this, arguments); - } - - return findOne; - }(); - - ImportPackageResolver.prototype.findAll = function () { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (deps) { - var _this7 = this; - - yield (_promise || _load_promise()).default.all(deps.map(function (dep) { - return _this7.findOne(dep); - })); - deps = this.next; - this.next = []; - if (!deps.length) { - // all required package versions have been discovered, so now packages that - // resolved to existing versions can be resolved to their best available version - this.resolvePackagesWithExistingVersions(); - return; - } - yield this.findAll(deps); - }); - - function findAll(_x4) { - return _ref6.apply(this, arguments); - } - - return findAll; - }(); - - ImportPackageResolver.prototype.resetOptional = function resetOptional() { - for (var pattern in this.patterns) { - var ref = this.patterns[pattern]._reference; - invariant(ref, 'expected reference'); - ref.optional = null; - for (var _iterator = ref.requests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref7; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref7 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref7 = _i.value; - } - - var req = _ref7; - - ref.addOptional(req.optional); - } - } - }; - - ImportPackageResolver.prototype.init = function () { - var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (deps) { - var _ref9 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { isFlat: false, isFrozen: false, workspaceLayout: undefined }, - isFlat = _ref9.isFlat, - isFrozen = _ref9.isFrozen, - workspaceLayout = _ref9.workspaceLayout; - - this.flat = Boolean(isFlat); - var activity = this.activity = this.reporter.activity(); - yield this.findAll(deps); - this.resetOptional(); - activity.end(); - this.activity = null; - }); - - function init(_x5) { - return _ref8.apply(this, arguments); - } - - return init; - }(); - - return ImportPackageResolver; -}((_packageResolver || _load_packageResolver()).default); - -var Import = exports.Import = function (_Install) { - (0, (_inherits2 || _load_inherits()).default)(Import, _Install); - - function Import(flags, config, reporter, lockfile) { - (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Import); - - var _this8 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Install.call(this, flags, config, reporter, lockfile)); - - _this8.resolver = new ImportPackageResolver(_this8.config, _this8.lockfile); - _this8.linker = new (_packageLinker || _load_packageLinker()).default(config, _this8.resolver); - return _this8; - } - - Import.prototype.createLogicalDependencyTree = function createLogicalDependencyTree(packageJson, packageLock) { - invariant(packageJson, 'package.json should exist'); - invariant(packageLock, 'package-lock.json should exist'); - invariant(this.resolver instanceof ImportPackageResolver, 'resolver should be an ImportPackageResolver'); - try { - this.resolver.dependencyTree = new (_logicalDependencyTree || _load_logicalDependencyTree()).LogicalDependencyTree(packageJson, packageLock); - } catch (e) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('importSourceFilesCorrupted')); - } - }; - - Import.prototype.getExternalLockfileContents = function () { - var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - try { - var _ref11 = yield (_promise || _load_promise()).default.all([(_fs || _load_fs()).readFile(path.join(this.config.cwd, (_constants || _load_constants()).NODE_PACKAGE_JSON)), (_fs || _load_fs()).readFile(path.join(this.config.cwd, (_constants || _load_constants()).NPM_LOCK_FILENAME))]), - _packageJson = _ref11[0], - _packageLock = _ref11[1]; - - return { packageJson: _packageJson, packageLock: _packageLock }; - } catch (e) { - return { packageJson: null, packageLock: null }; - } - }); - - function getExternalLockfileContents() { - return _ref10.apply(this, arguments); - } - - return getExternalLockfileContents; - }(); - - Import.prototype.init = function () { - var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (yield (_fs || _load_fs()).exists(path.join(this.config.cwd, (_constants || _load_constants()).LOCKFILE_FILENAME))) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('lockfileExists')); - } - - var _ref13 = yield this.getExternalLockfileContents(), - packageJson = _ref13.packageJson, - packageLock = _ref13.packageLock; - - var importSource = packageJson && packageLock && (_semver || _load_semver()).default.satisfies(nodeVersion, '>=5.0.0') ? 'package-lock.json' : 'node_modules'; - if (importSource === 'package-lock.json') { - this.reporter.info(this.reporter.lang('importPackageLock')); - this.createLogicalDependencyTree(packageJson, packageLock); - } - if (importSource === 'node_modules') { - this.reporter.info(this.reporter.lang('importNodeModules')); - yield (0, (_check || _load_check()).verifyTreeCheck)(this.config, this.reporter, {}, []); - } - - var _ref14 = yield this.fetchRequestFromCwd(), - requests = _ref14.requests, - patterns = _ref14.patterns, - manifest = _ref14.manifest; - - if (manifest.name && this.resolver instanceof ImportPackageResolver) { - this.resolver.rootName = manifest.name; - } - yield this.resolver.init(requests, { isFlat: this.flags.flat, isFrozen: this.flags.frozenLockfile }); - var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(this.resolver.getManifests(), this.config); - this.resolver.updateManifests(manifests); - yield (_packageCompatibility || _load_packageCompatibility()).check(this.resolver.getManifests(), this.config, this.flags.ignoreEngines); - yield this.linker.resolvePeerModules(); - yield this.saveLockfileAndIntegrity(patterns); - return patterns; - }); - - function init() { - return _ref12.apply(this, arguments); - } - - return init; - }(); - - return Import; -}((_install || _load_install()).Install); - -function setFlags(commander) { - commander.description('Generates yarn.lock from an npm package-lock.json file or an existing npm-installed node_modules folder.'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 520 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = undefined; - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (args.length > 2) { - reporter.error(reporter.lang('tooManyArguments', 2)); - return; - } - - var packageName = args.shift() || '.'; - - // Handle the case when we are referencing a local package. - if (packageName === '.') { - packageName = (yield config.readRootManifest()).name; - } - - var packageInput = (_npmRegistry || _load_npmRegistry()).default.escapeName(packageName); - - var _parsePackageName = (0, (_parsePackageName2 || _load_parsePackageName()).default)(packageInput), - name = _parsePackageName.name, - version = _parsePackageName.version; - - var result = void 0; - try { - result = yield config.registries.npm.request(name, { unfiltered: true }); - } catch (e) { - reporter.error(reporter.lang('infoFail')); - return; - } - if (!result) { - reporter.error(reporter.lang('infoFail')); - return; - } - - result = clean(result); - - var versions = result.versions; - // $FlowFixMe - result.versions = (0, (_keys || _load_keys()).default)(versions).sort(semver.compareLoose); - result.version = version || result['dist-tags'].latest; - result = (0, (_assign || _load_assign()).default)(result, versions[result.version]); - - var fieldPath = args.shift(); - var fields = fieldPath ? fieldPath.split('.') : []; - - // Readmes can be long so exclude them unless explicitly asked for. - if (fields[0] !== 'readme') { - delete result.readme; - } - - result = fields.reduce(function (prev, cur) { - return prev && prev[cur]; - }, result); - reporter.inspect(result); - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _npmRegistry; - -function _load_npmRegistry() { - return _npmRegistry = _interopRequireDefault(__webpack_require__(84)); -} - -var _parsePackageName2; - -function _load_parsePackageName() { - return _parsePackageName2 = _interopRequireDefault(__webpack_require__(577)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var semver = __webpack_require__(27); - -function clean(object) { - if (Array.isArray(object)) { - var result = []; - object.forEach(function (item) { - item = clean(item); - if (item) { - result.push(item); - } - }); - return result; - } else if (typeof object === 'object') { - var _result = {}; - for (var key in object) { - if (key.startsWith('_')) { - continue; - } - - var item = clean(object[key]); - if (item) { - _result[key] = item; - } - } - return _result; - } else if (object) { - return object; - } else { - return null; - } -} - -function setFlags(commander) { - commander.description('Shows information about a package.'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 521 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getGitConfigInfo = exports.run = exports.shouldRunInCurrentCwd = undefined; - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (flags.install) { - var lockfilePath = path.resolve(config.cwd, 'yarn.lock'); - if (!(yield (_fs || _load_fs()).exists(lockfilePath))) { - yield (_fs || _load_fs()).writeFile(lockfilePath, ''); - } - yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [process.argv[1], 'policies', 'set-version', flags.install], { - stdio: 'inherit', - cwd: config.cwd - }); - yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [process.argv[1], 'init'].concat(flags.yes ? ['-y'] : [], flags.private ? ['-p'] : []), { - stdio: 'inherit', - cwd: config.cwd - }); - return; - } - - var manifests = yield config.getRootManifests(); - - var repository = {}; - var author = { - name: config.getOption('init-author-name'), - email: config.getOption('init-author-email'), - url: config.getOption('init-author-url') - }; - if (yield (_fs || _load_fs()).exists(path.join(config.cwd, '.git'))) { - // get git origin of the cwd - try { - repository = { - type: 'git', - url: yield (_child || _load_child()).spawn('git', ['config', 'remote.origin.url'], { - cwd: config.cwd - }) - }; - } catch (ex) { - // Ignore - Git repo may not have an origin URL yet (eg. if it only exists locally) - } - - if (author.name === undefined) { - author.name = yield getGitConfigInfo('user.name'); - } - - if (author.email === undefined) { - author.email = yield getGitConfigInfo('user.email'); - } - } - - var keys = [{ - key: 'name', - question: 'name', - default: path.basename(config.cwd), - validation: (_validate || _load_validate()).isValidPackageName, - validationError: 'invalidPackageName' - }, { - key: 'version', - question: 'version', - default: String(config.getOption('init-version')) - }, { - key: 'description', - question: 'description', - default: '' - }, { - key: 'main', - question: 'entry point', - default: 'index.js' - }, { - key: 'repository', - question: 'repository url', - default: (0, (_util || _load_util()).extractRepositoryUrl)(repository) - }, { - key: 'author', - question: 'author', - default: (0, (_util || _load_util()).stringifyPerson)(author) - }, { - key: 'license', - question: 'license', - default: String(config.getOption('init-license')) - }, { - key: 'private', - question: 'private', - default: config.getOption('init-private') || '', - inputFormatter: yn - }]; - - // get answers - var pkg = {}; - for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { + preparePatterns(patterns) { + const preparedPatterns = patterns.slice(); + for (var _iterator2 = this.resolver.dedupePatterns(this.args), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref2; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - var entry = _ref2; - var yes = flags.yes, - privateFlag = flags.private; - var manifestKey = entry.key; - var question = entry.question, - def = entry.default; - - - for (var _iterator4 = (_index || _load_index()).registryNames, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref5; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref5 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref5 = _i4.value; - } - - var _registryName = _ref5; - var object = manifests[_registryName].object; - - var val = objectPath.get(object, manifestKey); - if (!val) { - break; - } - if (typeof val === 'object') { - if (manifestKey === 'author') { - val = (0, (_util || _load_util()).stringifyPerson)(val); - } else if (manifestKey === 'repository') { - val = (0, (_util || _load_util()).extractRepositoryUrl)(val); - } - } - def = val; - } - - if (manifestKey === 'private' && privateFlag) { - def = true; - } - - if (def) { - question += ` (${String(def)})`; - } - - var answer = void 0; - var validAnswer = false; - - if (yes) { - answer = def; - } else { - // loop until a valid answer is provided, if validation is on entry - if (entry.validation) { - while (!validAnswer) { - answer = (yield reporter.question(question)) || def; - // validate answer - if (entry.validation(String(answer))) { - validAnswer = true; - } else { - reporter.error(reporter.lang('invalidPackageName')); - } - } - } else { - answer = (yield reporter.question(question)) || def; - } - } - - if (answer) { - if (entry.inputFormatter) { - answer = entry.inputFormatter(answer); - } - objectPath.set(pkg, manifestKey, answer); - } - } - - if (pkg.repository && (_githubResolver || _load_githubResolver()).default.isVersion(pkg.repository)) { - pkg.repository = `https://github.com/${pkg.repository}`; - } - - // save answers - var targetManifests = []; - for (var _iterator2 = (_index || _load_index()).registryNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref3; - if (_isArray2) { if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; + _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; - _ref3 = _i2.value; + _ref2 = _i2.value; } - var registryName = _ref3; + const pattern = _ref2; - var info = manifests[registryName]; - if (info.exists) { - targetManifests.push(info); + const pkg = this.resolver.getResolvedPattern(pattern); + (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${pattern}`); + const version = this.getPatternVersion(pattern, pkg); + const newPattern = `${pkg.name}@${version}`; + preparedPatterns.push(newPattern); + this.addedPatterns.push(newPattern); + if (newPattern === pattern) { + continue; } + this.resolver.replacePattern(pattern, newPattern); } - if (!targetManifests.length) { - targetManifests.push(manifests.npm); - } - for (var _iterator3 = targetManifests, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref4; + return preparedPatterns; + } - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } - - var targetManifest = _ref4; - - (0, (_assign || _load_assign()).default)(targetManifest.object, pkg); - reporter.success(`Saved ${path.basename(targetManifest.loc)}`); + preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) { + // remove the newly added patterns if cwd != root and update the in-memory package dependency instead + if (cwdIsRoot) { + return patterns; } - yield config.saveRootManifests(manifests); - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -var getGitConfigInfo = exports.getGitConfigInfo = function () { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (credential) { - var spawn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_child || _load_child()).spawn; - + let manifest; + const cwdPackage = `${cwdManifest.name}@${cwdManifest.version}`; try { - // try to get author default based on git config - return yield spawn('git', ['config', credential]); + manifest = this.resolver.getStrictResolvedPattern(cwdPackage); } catch (e) { - return ''; + this.reporter.warn(this.reporter.lang('unknownPackage', cwdPackage)); + return patterns; } - }); - return function getGitConfigInfo(_x5) { - return _ref6.apply(this, arguments); - }; -}(); + let newPatterns = patterns; + this._iterateAddedPackages((pattern, registry, dependencyType, pkgName, version) => { + // remove added package from patterns list + const filtered = newPatterns.filter(p => p !== pattern); + (0, (_invariant || _load_invariant()).default)(newPatterns.length - filtered.length > 0, `expect added pattern '${pattern}' in the list: ${patterns.toString()}`); + newPatterns = filtered; -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _util; - -function _load_util() { - return _util = __webpack_require__(209); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(60); -} - -var _githubResolver; - -function _load_githubResolver() { - return _githubResolver = _interopRequireDefault(__webpack_require__(310)); -} - -var _child; - -function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(61)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _validate; - -function _load_validate() { - return _validate = _interopRequireWildcard(__webpack_require__(119)); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(13); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var objectPath = __webpack_require__(244); - -var path = __webpack_require__(1); -var yn = __webpack_require__(1035); - -function setFlags(commander) { - commander.description('Interactively creates or updates a package.json file.'); - commander.option('-y, --yes', 'use default options'); - commander.option('-p, --private', 'use default options and private true'); - commander.option('-i, --install ', 'install a specific Yarn release'); -} - -function hasWrapper(commander, args) { - return true; -} - -var shouldRunInCurrentCwd = exports.shouldRunInCurrentCwd = true; - -/***/ }), -/* 522 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.examples = exports.run = undefined; - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(42)); -} - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var getManifests = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); - var install = new (_install || _load_install()).Install((0, (_extends2 || _load_extends()).default)({ skipIntegrityCheck: true }, flags), config, new (_baseReporter || _load_baseReporter()).default(), lockfile); - yield install.hydrate(true); - - var manifests = install.resolver.getManifests(); - - // sort by name - manifests = manifests.sort(function (a, b) { - if (!a.name && !b.name) { - return 0; + // add new package into in-memory manifest so they can be linked properly + manifest[dependencyType] = manifest[dependencyType] || {}; + if (manifest[dependencyType][pkgName] === version) { + // package already existed + return; } - if (!a.name) { - return 1; - } + // update dependencies in the manifest + (0, (_invariant || _load_invariant()).default)(manifest._reference, 'manifest._reference should not be null'); + const ref = manifest._reference; - if (!b.name) { - return -1; - } - - return a.name.localeCompare(b.name); + ref['dependencies'] = ref['dependencies'] || []; + ref['dependencies'].push(pattern); }); - // filter ignored manifests - manifests = manifests.filter(function (manifest) { - var ref = manifest._reference; - return !!ref && !ref.ignore; - }); + return newPatterns; + } - return manifests; - }); + bailout(patterns, workspaceLayout) { + var _this = this; - return function getManifests(_x, _x2) { - return _ref.apply(this, arguments); - }; -}(); + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const lockfileCache = _this.lockfile.cache; + if (!lockfileCache) { + return false; + } + const match = yield _this.integrityChecker.check(patterns, lockfileCache, _this.flags, workspaceLayout); + const haveLockfile = yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(_this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); + if (match.integrityFileMissing && haveLockfile) { + // Integrity file missing, force script installations + _this.scripts.setForce(true); + } + return false; + })(); + } -var list = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var manifests = yield getManifests(config, flags); - var manifestsByLicense = new (_map || _load_map()).default(); + /** + * Description + */ - for (var _iterator = manifests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref4; + init() { + var _this2 = this; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref4 = _iterator[_i++]; + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const isWorkspaceRoot = _this2.config.workspaceRootFolder && _this2.config.cwd === _this2.config.workspaceRootFolder; + + // running "yarn add something" in a workspace root is often a mistake + if (isWorkspaceRoot && !_this2.flags.ignoreWorkspaceRootCheck) { + throw new (_errors || _load_errors()).MessageError(_this2.reporter.lang('workspacesAddRootCheck')); + } + + _this2.addedPatterns = []; + const patterns = yield (_install || _load_install()).Install.prototype.init.call(_this2); + yield _this2.maybeOutputSaveTree(patterns); + return patterns; + })(); + } + + applyChanges(manifests) { + var _this3 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield (_install || _load_install()).Install.prototype.applyChanges.call(_this3, manifests); + + // fill rootPatternsToOrigin without `excludePatterns` + yield (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(_this3); + + _this3._iterateAddedPackages(function (pattern, registry, dependencyType, pkgName, version) { + // add it to manifest + const object = manifests[registry].object; + + + object[dependencyType] = object[dependencyType] || {}; + object[dependencyType][pkgName] = version; + if (SILENCE_DEPENDENCY_TYPE_WARNINGS.indexOf(_this3.config.commandName) === -1 && dependencyType !== _this3.flagToOrigin) { + _this3.reporter.warn(_this3.reporter.lang('moduleAlreadyInManifest', pkgName, dependencyType, _this3.flagToOrigin)); + } + }); + + return true; + })(); + } + + /** + * Description + */ + + fetchRequestFromCwd() { + return (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(this, this.args); + } + + /** + * Output a tree of any newly added dependencies. + */ + + maybeOutputSaveTree(patterns) { + var _this4 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // don't limit the shown tree depth + const opts = { + reqDepth: 0 + }; + + // restore the original patterns + const merged = [...patterns, ..._this4.addedPatterns]; + + var _ref3 = yield (0, (_list || _load_list()).buildTree)(_this4.resolver, _this4.linker, merged, opts, true, true); + + const trees = _ref3.trees, + count = _ref3.count; + + + if (count === 1) { + _this4.reporter.success(_this4.reporter.lang('savedNewDependency')); } else { - _i = _iterator.next(); - if (_i.done) break; - _ref4 = _i.value; + _this4.reporter.success(_this4.reporter.lang('savedNewDependencies', count)); } - var _ref3 = _ref4; - var name = _ref3.name, - version = _ref3.version, - license = _ref3.license, - repository = _ref3.repository, - homepage = _ref3.homepage, - author = _ref3.author; - - var licenseKey = license || 'UNKNOWN'; - var url = repository ? repository.url : homepage; - var vendorUrl = homepage || author && author.url; - var vendorName = author && author.name; - - if (!manifestsByLicense.has(licenseKey)) { - manifestsByLicense.set(licenseKey, new (_map || _load_map()).default()); + if (!count) { + return; } - var byLicense = manifestsByLicense.get(licenseKey); - invariant(byLicense, 'expected value'); - byLicense.set(`${name}@${version}`, { - name, - version, - url, - vendorUrl, - vendorName - }); - } - - if (flags.json) { - var body = []; - - manifestsByLicense.forEach(function (license, licenseKey) { - license.forEach(function (_ref5) { - var name = _ref5.name, - version = _ref5.version, - url = _ref5.url, - vendorUrl = _ref5.vendorUrl, - vendorName = _ref5.vendorName; - - body.push([name, version, licenseKey, url || 'Unknown', vendorUrl || 'Unknown', vendorName || 'Unknown']); - }); - }); - - reporter.table(['Name', 'Version', 'License', 'URL', 'VendorUrl', 'VendorName'], body); - } else { - var trees = []; - - manifestsByLicense.forEach(function (license, licenseKey) { - var licenseTree = []; - - license.forEach(function (_ref6) { - var name = _ref6.name, - version = _ref6.version, - url = _ref6.url, - vendorUrl = _ref6.vendorUrl, - vendorName = _ref6.vendorName; - - var children = []; - - if (url) { - children.push({ name: `${reporter.format.bold('URL:')} ${url}` }); - } - - if (vendorUrl) { - children.push({ name: `${reporter.format.bold('VendorUrl:')} ${vendorUrl}` }); - } - - if (vendorName) { - children.push({ name: `${reporter.format.bold('VendorName:')} ${vendorName}` }); - } - - licenseTree.push({ - name: `${name}@${version}`, - children - }); - }); - - trees.push({ - name: licenseKey, - children: licenseTree - }); - }); - - reporter.tree('licenses', trees, { force: true }); - } - }); - - return function list(_x3, _x4, _x5, _x6) { - return _ref2.apply(this, arguments); - }; -}(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _baseReporter; - -function _load_baseReporter() { - return _baseReporter = _interopRequireDefault(__webpack_require__(98)); -} - -var _install; - -function _load_install() { - return _install = __webpack_require__(41); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -var _buildSubCommands2; - -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var invariant = __webpack_require__(15); - -function hasWrapper(flags, args) { - return args[0] != 'generate-disclaimer'; -} - -function setFlags(commander) { - commander.description('Lists licenses for installed packages.'); -} - -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('licenses', { - ls(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - reporter.warn(`\`yarn licenses ls\` is deprecated. Please use \`yarn licenses list\`.`); - yield list(config, reporter, flags, args); - })(); - }, - - list(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield list(config, reporter, flags, args); - })(); - }, - - generateDisclaimer(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - /* eslint-disable no-console */ - - // `reporter.log` dumps a bunch of ANSI escapes to clear the current line and - // is for abstracting the console output so it can be consumed by other tools - // (JSON output being the primary one). This command is only for text consumption - // and you should just be dumping it to a TXT file. Using a reporter here has the - // potential to mess up the output since it might print ansi escapes. - var manifests = yield getManifests(config, flags); - var manifest = yield config.readRootManifest(); - - // Create a map of license text to manifest so that packages with exactly - // the same license text are grouped together. - var manifestsByLicense = new (_map || _load_map()).default(); - for (var _iterator2 = manifests, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref7; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref7 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref7 = _i2.value; - } - - var _manifest = _ref7; - var licenseText = _manifest.licenseText, - noticeText = _manifest.noticeText; - - var licenseKey = void 0; - if (!licenseText) { - continue; - } - - if (!noticeText) { - licenseKey = licenseText; - } else { - licenseKey = `${licenseText}\n\nNOTICE\n\n${noticeText}`; - } - - if (!manifestsByLicense.has(licenseKey)) { - manifestsByLicense.set(licenseKey, new (_map || _load_map()).default()); - } - - var byLicense = manifestsByLicense.get(licenseKey); - invariant(byLicense, 'expected value'); - byLicense.set(_manifest.name, _manifest); - } - - console.log('THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED ' + `IN PORTIONS OF THE ${String(manifest.name).toUpperCase().replace(/-/g, ' ')} PRODUCT.`); - console.log(); - - for (var _iterator3 = manifestsByLicense, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref9; + const resolverPatterns = new Set(); + for (var _iterator3 = patterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; if (_isArray3) { if (_i3 >= _iterator3.length) break; - _ref9 = _iterator3[_i3++]; + _ref4 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; - _ref9 = _i3.value; + _ref4 = _i3.value; } - var _ref8 = _ref9; - var licenseKey = _ref8[0]; - var _manifests = _ref8[1]; + const pattern = _ref4; - console.log('-----'); - console.log(); + var _ref5 = _this4.resolver.getResolvedPattern(pattern) || {}; - var names = []; - var urls = []; - for (var _iterator4 = _manifests, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref11; + const version = _ref5.version, + name = _ref5.name; - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref11 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref11 = _i4.value; - } - - var _ref10 = _ref11; - var name = _ref10[0]; - var repository = _ref10[1].repository; - - names.push(name); - if (repository && repository.url) { - urls.push(_manifests.size === 1 ? repository.url : `${repository.url} (${name})`); - } - } - - var heading = []; - heading.push(`The following software may be included in this product: ${names.join(', ')}.`); - if (urls.length > 0) { - heading.push(`A copy of the source code may be downloaded from ${urls.join(', ')}.`); - } - heading.push('This software contains the following license and notice below:'); - - console.log(heading.join(' ')); - console.log(); - - if (licenseKey) { - console.log(licenseKey.trim()); - } else { - // what do we do here? base it on `license`? - } - - console.log(); + resolverPatterns.add(`${name}@${version}`); } + const directRequireDependencies = trees.filter(function ({ name }) { + return resolverPatterns.has(name); + }); + + _this4.reporter.info(_this4.reporter.lang('directDependencies')); + _this4.reporter.tree('newDirectDependencies', directRequireDependencies); + _this4.reporter.info(_this4.reporter.lang('allDependencies')); + _this4.reporter.tree('newAllDependencies', trees); })(); } -}), - run = _buildSubCommands.run, - examples = _buildSubCommands.examples; -exports.run = run; -exports.examples = examples; + /** + * Save added packages to manifest if any of the --save flags were used. + */ -/***/ }), -/* 523 */ -/***/ (function(module, exports, __webpack_require__) { + savePackages() { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {})(); + } -"use strict"; + _iterateAddedPackages(f) { + const patternOrigins = Object.keys(this.rootPatternsToOrigin); + // add new patterns to their appropriate registry manifest + for (var _iterator4 = this.addedPatterns, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref6; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - yield config.registries.yarn.saveHomeConfig({ - username: undefined, - email: undefined - }); - - reporter.success(reporter.lang('clearedCredentials')); - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function setFlags(commander) { - commander.description('Clears registry username and email.'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 524 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = undefined; - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var pnpPath = `${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`; - - var nodeOptions = process.env.NODE_OPTIONS || ''; - if (yield (_fs || _load_fs()).exists(pnpPath)) { - nodeOptions = `--require ${pnpPath} ${nodeOptions}`; - } - - try { - yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, args, { - stdio: 'inherit', - cwd: flags.into || config.cwd, - env: (0, (_extends2 || _load_extends()).default)({}, process.env, { NODE_OPTIONS: nodeOptions }) - }); - } catch (err) { - throw err; - } - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _child; - -function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(61)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(13); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function setFlags(commander) { - commander.description('Runs Node with the same version that the one used by Yarn itself, and by default from the project root'); - commander.usage('node [--into PATH] [... args]'); - commander.option('--into ', 'Sets the cwd to the specified location'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 525 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.requireLockfile = undefined; - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder); - var install = new (_install || _load_install()).Install((0, (_extends2 || _load_extends()).default)({}, flags, { includeWorkspaceDeps: true }), config, reporter, lockfile); - var deps = yield (_packageRequest || _load_packageRequest()).default.getOutdatedPackages(lockfile, install, config, reporter); - - if (args.length) { - var requested = new (_set || _load_set()).default(args); - - deps = deps.filter(function (_ref2) { - var name = _ref2.name; - return requested.has(name); - }); - } - - var getNameFromHint = function getNameFromHint(hint) { - return hint ? `${hint}Dependencies` : 'dependencies'; - }; - var colorizeName = function colorizeName(_ref3) { - var current = _ref3.current, - latest = _ref3.latest, - name = _ref3.name; - return reporter.format[(0, (_colorForVersions || _load_colorForVersions()).default)(current, latest)](name); - }; - - if (deps.length) { - var usesWorkspaces = !!config.workspaceRootFolder; - var body = deps.map(function (info) { - var row = [colorizeName(info), info.current, (0, (_colorizeDiff || _load_colorizeDiff()).default)(info.current, info.wanted, reporter), reporter.format.cyan(info.latest), info.workspaceName || '', getNameFromHint(info.hint), reporter.format.cyan(info.url)]; - if (!usesWorkspaces) { - row.splice(4, 1); - } - return row; - }); - - var red = reporter.format.red(''); - var yellow = reporter.format.yellow(''); - var green = reporter.format.green(''); - reporter.info(reporter.lang('legendColorsForVersionUpdates', red, yellow, green)); - - var header = ['Package', 'Current', 'Wanted', 'Latest', 'Workspace', 'Package Type', 'URL']; - if (!usesWorkspaces) { - header.splice(4, 1); - } - reporter.table(header, body); - - return 1; - } - return 0; - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _packageRequest; - -function _load_packageRequest() { - return _packageRequest = _interopRequireDefault(__webpack_require__(116)); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -var _install; - -function _load_install() { - return _install = __webpack_require__(41); -} - -var _colorForVersions; - -function _load_colorForVersions() { - return _colorForVersions = _interopRequireDefault(__webpack_require__(312)); -} - -var _colorizeDiff; - -function _load_colorizeDiff() { - return _colorizeDiff = _interopRequireDefault(__webpack_require__(313)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var requireLockfile = exports.requireLockfile = true; - -function setFlags(commander) { - commander.description('Checks for outdated package dependencies.'); - commander.usage('outdated [packages ...]'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 526 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.examples = exports.hasWrapper = exports.run = exports.mutate = undefined; - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var mutate = exports.mutate = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (args, config, reporter, buildMessages, mutator) { - if (args.length !== 2 && args.length !== 1) { - return false; - } - - var username = args.shift(); - var name = yield (0, (_tag || _load_tag()).getName)(args, config); - if (!(0, (_validate || _load_validate()).isValidPackageName)(name)) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName')); - } - - var msgs = buildMessages(username, name); - reporter.step(1, 3, reporter.lang('loggingIn')); - var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name); - - reporter.step(2, 3, msgs.info); - var user = yield config.registries.npm.request(`-/user/org.couchdb.user:${username}`); - var error = false; - if (user) { - // get package - var _pkg = yield config.registries.npm.request((_npmRegistry || _load_npmRegistry()).default.escapeName(name)); - if (_pkg) { - _pkg.maintainers = _pkg.maintainers || []; - error = mutator({ name: user.name, email: user.email }, _pkg); + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref6 = _iterator4[_i4++]; } else { - error = true; - reporter.error(reporter.lang('unknownPackage', name)); + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref6 = _i4.value; } - // update package - if (_pkg && !error) { - var res = yield config.registries.npm.request(`${(_npmRegistry || _load_npmRegistry()).default.escapeName(name)}/-rev/${_pkg._rev}`, { - method: 'PUT', - body: { - _id: _pkg._id, - _rev: _pkg._rev, - maintainers: _pkg.maintainers - } - }); + const pattern = _ref6; - if (res != null && res.success) { - reporter.success(msgs.success); - } else { - error = true; - reporter.error(msgs.error); + const pkg = this.resolver.getResolvedPattern(pattern); + (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${pattern}`); + const version = this.getPatternVersion(pattern, pkg); + const ref = pkg._reference; + (0, (_invariant || _load_invariant()).default)(ref, 'expected package reference'); + // lookup the package to determine dependency type; used during `yarn upgrade` + const depType = patternOrigins.reduce((acc, prev) => { + if (prev.indexOf(`${pkg.name}@`) === 0) { + return this.rootPatternsToOrigin[prev]; } - } - } else { - error = true; - reporter.error(reporter.lang('unknownUser', username)); + return acc; + }, null); + + // depType is calculated when `yarn upgrade` command is used + const target = depType || this.flagToOrigin; + + f(pattern, ref.registry, target, pkg.name, version); } - - reporter.step(3, 3, reporter.lang('revokingToken')); - yield revoke(); - - if (error) { - throw new Error(); - } else { - return true; - } - }); - - return function mutate(_x, _x2, _x3, _x4, _x5) { - return _ref.apply(this, arguments); - }; -}(); - -var list = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (args.length > 1) { - return false; - } - var name = yield (0, (_tag || _load_tag()).getName)(args, config); - reporter.step(1, 1, reporter.lang('ownerGetting', name)); - var pkg = yield config.registries.npm.request(name, { unfiltered: true }); - if (pkg) { - var owners = pkg.maintainers; - if (!owners || !owners.length) { - reporter.warn(reporter.lang('ownerNone')); - } else { - for (var _iterator = owners, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref3; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref3 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref3 = _i.value; - } - - var owner = _ref3; - - reporter.info(`${owner.name} <${owner.email}>`); - } - } - } else { - reporter.error(reporter.lang('ownerGettingFailed')); - } - - if (pkg) { - return true; - } else { - throw new Error(); - } - }); - - return function list(_x6, _x7, _x8, _x9) { - return _ref2.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _buildSubCommands2; - -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62)); -} - -var _validate; - -function _load_validate() { - return _validate = __webpack_require__(119); -} - -var _tag; - -function _load_tag() { - return _tag = __webpack_require__(303); -} - -var _login; - -function _load_login() { - return _login = __webpack_require__(97); -} - -var _npmRegistry; - -function _load_npmRegistry() { - return _npmRegistry = _interopRequireDefault(__webpack_require__(84)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function remove(config, reporter, flags, args) { - return mutate(args, config, reporter, function (username, name) { - return { - info: reporter.lang('ownerRemoving', username, name), - success: reporter.lang('ownerRemoved'), - error: reporter.lang('ownerRemoveError') - }; - }, function (user, pkg) { - var found = false; - - pkg.maintainers = pkg.maintainers.filter(function (o) { - var match = o.name === user.name; - found = found || match; - return !match; - }); - - if (!found) { - reporter.error(reporter.lang('userNotAnOwner', user.name)); - } - - return found; - }); -} - -function setFlags(commander) { - commander.description('Manages package owners.'); -} - -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('owner', { - add(config, reporter, flags, args) { - return mutate(args, config, reporter, function (username, name) { - return { - info: reporter.lang('ownerAdding', username, name), - success: reporter.lang('ownerAdded'), - error: reporter.lang('ownerAddingFailed') - }; - }, function (user, pkg) { - for (var _iterator2 = pkg.maintainers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref4; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref4 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref4 = _i2.value; - } - - var owner = _ref4; - - if (owner.name === user) { - reporter.error(reporter.lang('ownerAlready')); - return true; - } - } - - pkg.maintainers.push(user); - - return false; - }); - }, - - rm(config, reporter, flags, args) { - reporter.warn(`\`yarn owner rm\` is deprecated. Please use \`yarn owner remove\`.`); - return remove(config, reporter, flags, args); - }, - - remove(config, reporter, flags, args) { - return remove(config, reporter, flags, args); - }, - - ls(config, reporter, flags, args) { - reporter.warn(`\`yarn owner ls\` is deprecated. Please use \`yarn owner list\`.`); - return list(config, reporter, flags, args); - }, - - list(config, reporter, flags, args) { - return list(config, reporter, flags, args); } -}, ['add [[<@scope>/]]', 'remove [[<@scope>/]]', 'list [<@scope>/]']), - run = _buildSubCommands.run, - hasWrapper = _buildSubCommands.hasWrapper, - examples = _buildSubCommands.examples; - -exports.run = run; -exports.hasWrapper = hasWrapper; -exports.examples = examples; - -/***/ }), -/* 527 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.examples = exports.setFlags = exports.run = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -var fetchReleases = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { - var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref2$includePrerelea = _ref2.includePrereleases, - includePrereleases = _ref2$includePrerelea === undefined ? false : _ref2$includePrerelea; - - var token = process.env.GITHUB_TOKEN; - var tokenUrlParameter = token ? `?access_token=${token}` : ''; - var request = yield config.requestManager.request({ - url: `https://api.github.com/repos/yarnpkg/yarn/releases${tokenUrlParameter}`, - json: true - }); - - var releases = request.filter(function (release) { - if (release.draft) { - return false; - } - - if (release.prerelease && !includePrereleases) { - return false; - } - - // $FlowFixMe - release.version = semver.coerce(release.tag_name); - - if (!release.version) { - return false; - } - - if (!getBundleAsset(release)) { - return false; - } - - return true; - }); - - releases.sort(function (a, b) { - // $FlowFixMe - return -semver.compare(a.version, b.version); - }); - - return releases; - }); - - return function fetchReleases(_x) { - return _ref.apply(this, arguments); - }; -}(); - -exports.hasWrapper = hasWrapper; - -var _buildSubCommands2; - -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62)); -} - -var _rc; - -function _load_rc() { - return _rc = __webpack_require__(274); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = __webpack_require__(25); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var chalk = __webpack_require__(36); -var invariant = __webpack_require__(15); -var path = __webpack_require__(1); -var semver = __webpack_require__(27); - -function getBundleAsset(release) { - return release.assets.find(function (asset) { - return asset.name.match(/^yarn-[0-9]+\.[0-9]+\.[0-9]+\.js$/); - }); -} - -function fetchBundle(config, url) { - return config.requestManager.request({ - url, - buffer: true - }); -} - -function hasWrapper(flags, args) { - return false; -} - -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('policies', { - setVersion(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var range = args[0] || 'latest'; - var allowRc = flags.rc; - - reporter.log(`Resolving ${chalk.yellow(range)} to a url...`); - - if (range === 'rc') { - range = 'latest'; - allowRc = true; - } - - if (range === 'latest') { - range = '*'; - } - - var bundleUrl = void 0; - var bundleVersion = void 0; - - if (range === 'nightly' || range === 'nightlies') { - bundleUrl = 'https://nightly.yarnpkg.com/latest.js'; - bundleVersion = 'nightly'; - } else if (range === 'berry' || range === 'v2' || range === '2') { - bundleUrl = 'https://github.com/yarnpkg/berry/raw/master/packages/berry-cli/bin/berry.js'; - bundleVersion = 'berry'; - } else { - var releases = yield fetchReleases(config, { - includePrereleases: allowRc - }); - - var release = releases.find(function (release) { - // $FlowFixMe - return semver.satisfies(release.version, range); - }); - - if (!release) { - throw new Error(`Release not found: ${range}`); - } - - var asset = getBundleAsset(release); - invariant(asset, 'The bundle asset should exist'); - - bundleUrl = asset.browser_download_url; - bundleVersion = release.version.version; - } - - reporter.log(`Downloading ${chalk.green(bundleUrl)}...`); - - var bundle = yield fetchBundle(config, bundleUrl); - var rc = (0, (_rc || _load_rc()).getRcConfigForFolder)(config.lockfileFolder); - - var yarnPath = path.resolve(config.lockfileFolder, `.yarn/releases/yarn-${bundleVersion}.js`); - reporter.log(`Saving it into ${chalk.magenta(yarnPath)}...`); - yield (_fs || _load_fs()).mkdirp(path.dirname(yarnPath)); - yield (_fs || _load_fs()).writeFile(yarnPath, bundle); - yield (_fs || _load_fs()).chmod(yarnPath, 0o755); - - var rcPath = `${config.lockfileFolder}/.yarnrc`; - reporter.log(`Updating ${chalk.magenta(rcPath)}...`); - rc['yarn-path'] = path.relative(config.lockfileFolder, yarnPath); - yield (_fs || _load_fs()).writeFilePreservingEol(rcPath, `${(0, (_lockfile || _load_lockfile()).stringify)(rc)}\n`); - - reporter.log(`Done!`); - })(); - } -}), - run = _buildSubCommands.run, - setFlags = _buildSubCommands.setFlags, - examples = _buildSubCommands.examples; - -exports.run = run; -exports.setFlags = setFlags; -exports.examples = examples; - -/***/ }), -/* 528 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = undefined; - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var publish = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, pkg, flags, dir) { - var access = flags.access; - - // if no access level is provided, check package.json for `publishConfig.access` - // see: https://docs.npmjs.com/files/package.json#publishconfig - if (!access && pkg && pkg.publishConfig && pkg.publishConfig.access) { - access = pkg.publishConfig.access; - } - - // validate access argument - if (access && access !== 'public' && access !== 'restricted') { - throw new (_errors || _load_errors()).MessageError(config.reporter.lang('invalidAccess')); - } - - // TODO this might modify package.json, do we need to reload it? - yield config.executeLifecycleScript('prepublish'); - yield config.executeLifecycleScript('prepare'); - yield config.executeLifecycleScript('prepublishOnly'); - yield config.executeLifecycleScript('prepack'); - - // get tarball stream - var stat = yield (_fs || _load_fs()).lstat(dir); - var stream = void 0; - if (stat.isDirectory()) { - stream = yield (0, (_pack || _load_pack()).pack)(config); - } else if (stat.isFile()) { - stream = fs2.createReadStream(dir); - } else { - throw new Error("Don't know how to handle this file type"); - } - var buffer = yield new (_promise || _load_promise()).default(function (resolve, reject) { - var data = []; - invariant(stream, 'expected stream'); - stream.on('data', data.push.bind(data)).on('end', function () { - return resolve(Buffer.concat(data)); - }).on('error', reject); - }); - - yield config.executeLifecycleScript('postpack'); - - // copy normalized package and remove internal keys as they may be sensitive or yarn specific - pkg = (0, (_assign || _load_assign()).default)({}, pkg); - for (var key in pkg) { - if (key[0] === '_') { - delete pkg[key]; - } - } - - var tag = flags.tag || 'latest'; - var tbName = `${pkg.name}-${pkg.version}.tgz`; - var tbURI = `${pkg.name}/-/${tbName}`; - - // create body - var root = { - _id: pkg.name, - access, - name: pkg.name, - description: pkg.description, - 'dist-tags': { - [tag]: pkg.version - }, - versions: { - [pkg.version]: pkg - }, - readme: pkg.readme || '', - _attachments: { - [tbName]: { - content_type: 'application/octet-stream', - data: buffer.toString('base64'), - length: buffer.length - } - } - }; - - pkg._id = `${pkg.name}@${pkg.version}`; - pkg.dist = pkg.dist || {}; - pkg.dist.shasum = crypto.createHash('sha1').update(buffer).digest('hex'); - pkg.dist.integrity = ssri.fromData(buffer).toString(); - - var registry = String(config.getOption('registry')); - pkg.dist.tarball = url.resolve(registry, tbURI).replace(/^https:\/\//, 'http://'); - - // publish package - try { - yield config.registries.npm.request((_npmRegistry || _load_npmRegistry()).default.escapeName(pkg.name), { - registry: pkg && pkg.publishConfig && pkg.publishConfig.registry, - method: 'PUT', - body: root - }); - } catch (error) { - throw new (_errors || _load_errors()).MessageError(config.reporter.lang('publishFail', error.message)); - } - - yield config.executeLifecycleScript('publish'); - yield config.executeLifecycleScript('postpublish'); - }); - - return function publish(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -var run = exports.run = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - // validate arguments - var dir = args[0] ? (_path || _load_path()).default.resolve(config.cwd, args[0]) : config.cwd; - if (args.length > 1) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('tooManyArguments', 1)); - } - if (!(yield (_fs || _load_fs()).exists(dir))) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownFolderOrTarball')); - } - - var stat = yield (_fs || _load_fs()).lstat(dir); - var publishPath = dir; - if (stat.isDirectory()) { - config.cwd = (_path || _load_path()).default.resolve(dir); - publishPath = config.cwd; - } - - // validate package fields that are required for publishing - // $FlowFixMe - var pkg = yield config.readRootManifest(); - if (pkg.private) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('publishPrivate')); - } - if (!pkg.name) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noName')); - } - - var registry = ''; - - if (pkg && pkg.publishConfig && pkg.publishConfig.registry) { - registry = pkg.publishConfig.registry; - } - - reporter.step(1, 4, reporter.lang('bumpingVersion')); - var commitVersion = yield (0, (_version || _load_version()).setVersion)(config, reporter, flags, [], false); - - // - reporter.step(2, 4, reporter.lang('loggingIn')); - var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, pkg.name, flags, registry); - - // - reporter.step(3, 4, reporter.lang('publishing')); - yield publish(config, pkg, flags, publishPath); - yield commitVersion(); - reporter.success(reporter.lang('published')); - - // - reporter.step(4, 4, reporter.lang('revokingToken')); - yield revoke(); - }); - - return function run(_x5, _x6, _x7, _x8) { - return _ref2.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _npmRegistry; - -function _load_npmRegistry() { - return _npmRegistry = _interopRequireDefault(__webpack_require__(84)); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _version; - -function _load_version() { - return _version = __webpack_require__(305); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _pack; - -function _load_pack() { - return _pack = __webpack_require__(155); -} - -var _login; - -function _load_login() { - return _login = __webpack_require__(97); -} - -var _path; - -function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(1)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var invariant = __webpack_require__(15); - -var crypto = __webpack_require__(21); -var url = __webpack_require__(29); -var fs2 = __webpack_require__(12); -var ssri = __webpack_require__(93); - -function setFlags(commander) { - (0, (_version || _load_version()).setFlags)(commander); - commander.description('Publishes a package to the npm registry.'); - commander.usage('publish [|] [--tag ] [--access ]'); - commander.option('--access [access]', 'access'); - commander.option('--tag [tag]', 'tag'); -} - -function hasWrapper(commander, args) { +exports.Add = Add; +function hasWrapper(commander) { return true; } -/***/ }), -/* 529 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.examples = exports.hasWrapper = exports.run = undefined; - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var removeTeamUser = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter) { - reporter.step(2, 3, reporter.lang('teamRemovingUser')); - reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user`, { - method: 'DELETE', - body: { - user: parts.user - } - }))); - return true; - }); - - return function removeTeamUser(_x6, _x7, _x8) { - return _ref2.apply(this, arguments); - }; -}(); - -var list = function () { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter) { - reporter.step(2, 3, reporter.lang('teamListing')); - var uriParams = '?format=cli'; - if (parts.team) { - reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user${uriParams}`))); - } else { - reporter.inspect((yield config.registries.npm.request(`org/${parts.scope}/team${uriParams}`))); - } - return true; - }); - - return function list(_x9, _x10, _x11) { - return _ref3.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; - -var _buildSubCommands2; - -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62)); -} - -var _login; - -function _load_login() { - return _login = __webpack_require__(97); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function explodeScopeTeam(arg, requireTeam, reporter) { - var _arg$split = arg.split(':'), - scope = _arg$split[0], - team = _arg$split[1], - parts = _arg$split.slice(2); - - if (parts.length) { - return false; - } - - if (requireTeam && !team) { - return false; - } - - return { - scope: scope || '', - team: team || '', - user: '' - }; -} - -function warnDeprecation(reporter, deprecationWarning) { - var command = 'yarn team'; - reporter.warn(reporter.lang('deprecatedCommand', `${command} ${deprecationWarning.deprecatedCommand}`, `${command} ${deprecationWarning.currentCommand}`)); -} - -function wrapRequired(callback, requireTeam, deprecationInfo) { - return function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (deprecationInfo) { - warnDeprecation(reporter, deprecationInfo); - } - - if (!args.length) { - return false; - } - - var parts = explodeScopeTeam(args[0], requireTeam, reporter); - if (!parts) { - return false; - } - - reporter.step(1, 3, reporter.lang('loggingIn')); - var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter); - - var res = yield callback(parts, config, reporter, flags, args); - if (!res) { - return res; - } - - reporter.step(3, 3, reporter.lang('revokingToken')); - yield revoke(); - return true; - }); - - return function (_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; - }(); -} - -function wrapRequiredTeam(callback) { - var requireTeam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - var subCommandDeprecated = arguments[2]; - - return wrapRequired(function (parts, config, reporter, flags, args) { - if (args.length === 1) { - return callback(parts, config, reporter, flags, args); - } else { - return false; - } - }, requireTeam, subCommandDeprecated); -} - -function wrapRequiredUser(callback, subCommandDeprecated) { - return wrapRequired(function (parts, config, reporter, flags, args) { - if (args.length === 2) { - return callback((0, (_extends2 || _load_extends()).default)({ - user: args[1] - }, parts), config, reporter, flags, args); - } else { - return false; - } - }, true, subCommandDeprecated); -} - function setFlags(commander) { - commander.description('Maintain team memberships'); + commander.description('Installs a package and any packages that it depends on.'); + commander.usage('add [packages ...] [flags]'); + commander.option('-W, --ignore-workspace-root-check', 'required to run yarn add inside a workspace root'); + commander.option('-D, --dev', 'save package to your `devDependencies`'); + commander.option('-P, --peer', 'save package to your `peerDependencies`'); + commander.option('-O, --optional', 'save package to your `optionalDependencies`'); + commander.option('-E, --exact', 'install exact version'); + commander.option('-T, --tilde', 'install most recent release with the same minor version'); + commander.option('-A, --audit', 'Run vulnerability audit on installed packages'); } -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('team', { - create: wrapRequiredTeam(function () { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) { - reporter.step(2, 3, reporter.lang('teamCreating')); - reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}`, { - method: 'PUT', - body: { - team: parts.team - } - }))); - return true; - }); - - return function (_x12, _x13, _x14, _x15, _x16) { - return _ref4.apply(this, arguments); - }; - }()), - - destroy: wrapRequiredTeam(function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) { - reporter.step(2, 3, reporter.lang('teamRemoving')); - reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}`, { - method: 'DELETE' - }))); - return true; - }); - - return function (_x17, _x18, _x19, _x20, _x21) { - return _ref5.apply(this, arguments); - }; - }()), - - add: wrapRequiredUser(function () { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) { - reporter.step(2, 3, reporter.lang('teamAddingUser')); - reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user`, { - method: 'PUT', - body: { - user: parts.user - } - }))); - return true; - }); - - return function (_x22, _x23, _x24, _x25, _x26) { - return _ref6.apply(this, arguments); - }; - }()), - - rm: wrapRequiredUser(function (parts, config, reporter, flags, args) { - removeTeamUser(parts, config, reporter); - }, { - deprecatedCommand: 'rm', - currentCommand: 'remove' - }), - - remove: wrapRequiredUser(function (parts, config, reporter, flags, args) { - removeTeamUser(parts, config, reporter); - }), - - ls: wrapRequiredTeam(function (parts, config, reporter, flags, args) { - list(parts, config, reporter); - }, false, { - deprecatedCommand: 'ls', - currentCommand: 'list' - }), - - list: wrapRequiredTeam(function (parts, config, reporter, flags, args) { - list(parts, config, reporter); - }, false) -}, ['create ', 'destroy ', 'add ', 'remove ', 'list |']), - run = _buildSubCommands.run, - hasWrapper = _buildSubCommands.hasWrapper, - examples = _buildSubCommands.examples; - -exports.run = run; -exports.hasWrapper = hasWrapper; -exports.examples = examples; - /***/ }), -/* 530 */ +/* 166 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90784,13 +44386,7 @@ exports.examples = examples; Object.defineProperty(exports, "__esModule", { value: true }); -exports.run = undefined; - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} +exports.run = exports.pack = exports.packTarball = undefined; var _asyncToGenerator2; @@ -90798,10 +44394,28 @@ function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (args.length) { - for (var _iterator = args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { +let packTarball = exports.packTarball = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, { mapHeader } = {}) { + const pkg = yield config.readRootManifest(); + const bundleDependencies = pkg.bundleDependencies, + main = pkg.main, + onlyFiles = pkg.files; + + // include required files + + let filters = NEVER_IGNORE.slice(); + // include default filters unless `files` is used + if (!onlyFiles) { + filters = filters.concat(DEFAULT_IGNORE); + } + if (main) { + filters = filters.concat((0, (_filter || _load_filter()).ignoreLinesToRegex)(['!/' + main])); + } + + // include bundleDependencies + let bundleDependenciesFiles = []; + if (bundleDependencies) { + for (var _iterator = bundleDependencies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref2; if (_isArray) { @@ -90813,2686 +44427,392 @@ var run = exports.run = function () { _ref2 = _i.value; } - var name = _ref2; + const dependency = _ref2; - var linkLoc = path.join(config.linkFolder, name); - if (yield (_fs || _load_fs()).exists(linkLoc)) { - yield (_fs || _load_fs()).unlink(path.join((yield (0, (_link || _load_link()).getRegistryFolder)(config, name)), name)); - reporter.success(reporter.lang('linkDisusing', name)); - reporter.info(reporter.lang('linkDisusingMessage', name)); - } else { - throw new (_errors || _load_errors()).MessageError(reporter.lang('linkMissing', name)); - } - } - } else { - // remove from registry - var manifest = yield config.readRootManifest(); - var _name = manifest.name; - if (!_name) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownPackageName')); - } + const dependencyList = depsFor(dependency, config.cwd); - var _linkLoc = path.join(config.linkFolder, _name); - if (yield (_fs || _load_fs()).exists(_linkLoc)) { - // If there is a `bin` defined in the package.json, - // link each bin to the global bin - if (manifest.bin) { - var globalBinFolder = yield (0, (_global || _load_global()).getBinFolder)(config, flags); - for (var binName in manifest.bin) { - var binDestLoc = path.join(globalBinFolder, binName); - if (yield (_fs || _load_fs()).exists(binDestLoc)) { - yield (_fs || _load_fs()).unlink(binDestLoc); - if (process.platform === 'win32') { - yield (_fs || _load_fs()).unlink(binDestLoc + '.cmd'); - } - } + for (var _iterator2 = dependencyList, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; } + + const dep = _ref3; + + const filesForBundledDep = yield (_fs || _load_fs()).walk(dep.baseDir, null, new Set(FOLDERS_IGNORE)); + bundleDependenciesFiles = bundleDependenciesFiles.concat(filesForBundledDep); } - - yield (_fs || _load_fs()).unlink(_linkLoc); - - reporter.success(reporter.lang('linkUnregistered', _name)); - reporter.info(reporter.lang('linkUnregisteredMessage', _name)); - } else { - throw new (_errors || _load_errors()).MessageError(reporter.lang('linkMissing', _name)); } } - }); - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _link; - -function _load_link() { - return _link = __webpack_require__(299); -} - -var _global; - -function _load_global() { - return _global = __webpack_require__(115); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var path = __webpack_require__(1); - -function setFlags(commander) { - commander.description('Unlink a previously created symlink for a package.'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 531 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.clearAll = exports.clearSome = exports.run = undefined; - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (!config.plugnplayEnabled) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('unplugDisabled')); - } - if (!args.length && flags.clear) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('tooFewArguments', 1)); - } - if (args.length && flags.clearAll) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noArguments')); - } - - if (flags.clearAll) { - yield clearAll(config); - } else if (flags.clear) { - yield clearSome(config, new (_set || _load_set()).default(args)); - } else if (args.length > 0) { - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); - yield (0, (_install || _load_install()).wrapLifecycle)(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); - install.linker.unplugged = args; - yield install.init(); + // `files` field + if (onlyFiles) { + let lines = ['*']; + lines = lines.concat(onlyFiles.map(function (filename) { + return `!${filename}`; + }), onlyFiles.map(function (filename) { + return `!${path.join(filename, '**')}`; })); + const regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines, './'); + filters = filters.concat(regexes); } - var unpluggedPackageFolders = yield config.listUnpluggedPackageFolders(); + const files = yield (_fs || _load_fs()).walk(config.cwd, null, new Set(FOLDERS_IGNORE)); + const dotIgnoreFiles = (0, (_filter || _load_filter()).filterOverridenGitignores)(files); - for (var _iterator = unpluggedPackageFolders.values(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref3; + // create ignores + for (var _iterator3 = dotIgnoreFiles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; - if (_isArray) { - if (_i >= _iterator.length) break; - _ref3 = _iterator[_i++]; + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; } else { - _i = _iterator.next(); - if (_i.done) break; - _ref3 = _i.value; + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; } - var target = _ref3; + const file = _ref4; - reporter.log(target, { force: true }); + const raw = yield (_fs || _load_fs()).readFile(file.absolute); + const lines = raw.split('\n'); + + const regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines, path.dirname(file.relative)); + filters = filters.concat(regexes); } - }); - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); + // files to definitely keep, takes precedence over ignore filter + const keepFiles = new Set(); -var clearSome = exports.clearSome = function () { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, filters) { - var unpluggedPackageFolders = yield config.listUnpluggedPackageFolders(); - var removeList = []; + // files to definitely ignore + const ignoredFiles = new Set(); - for (var _iterator2 = unpluggedPackageFolders.entries(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref6; + // list of files that didn't match any of our patterns, if a directory in the chain above was matched + // then we should inherit it + const possibleKeepFiles = new Set(); - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref6 = _iterator2[_i2++]; + // apply filters + (0, (_filter || _load_filter()).sortFilter)(files, filters, keepFiles, possibleKeepFiles, ignoredFiles); + + // add the files for the bundled dependencies to the set of files to keep + for (var _iterator4 = bundleDependenciesFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref5; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref5 = _iterator4[_i4++]; } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref6 = _i2.value; + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref5 = _i4.value; } - var _ref5 = _ref6; - var unpluggedName = _ref5[0]; - var target = _ref5[1]; + const file = _ref5; - var _ref8 = yield (_fs || _load_fs()).readJson(path.join(target, 'package.json')), - name = _ref8.name; - - var toBeRemoved = filters.has(name); - - if (toBeRemoved) { - removeList.push(path.join(config.getUnpluggedPath(), unpluggedName)); - } + const realPath = yield (_fs || _load_fs()).realpath(config.cwd); + keepFiles.add(path.relative(realPath, file.absolute)); } - if (removeList.length === unpluggedPackageFolders.size) { - yield (_fs || _load_fs()).unlink(config.getUnpluggedPath()); - } else { - for (var _iterator3 = removeList, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref7; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref7 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref7 = _i3.value; - } - - var unpluggedPackagePath = _ref7; - - yield (_fs || _load_fs()).unlink(unpluggedPackagePath); - } - } - }); - - return function clearSome(_x5, _x6) { - return _ref4.apply(this, arguments); - }; -}(); - -var clearAll = exports.clearAll = function () { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { - yield (_fs || _load_fs()).unlink(config.getUnpluggedPath()); - }); - - return function clearAll(_x7) { - return _ref9.apply(this, arguments); - }; -}(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -var _install; - -function _load_install() { - return _install = __webpack_require__(41); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var path = __webpack_require__(1); - -function hasWrapper(commander) { - return true; -} - -function setFlags(commander) { - commander.description('Temporarily copies a package (with an optional @range suffix) outside of the global cache for debugging purposes'); - commander.usage('unplug [packages ...] [flags]'); - commander.option('--clear', 'Delete the selected packages'); - commander.option('--clear-all', 'Delete all unplugged packages'); -} - -/***/ }), -/* 532 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = undefined; - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var versions = { yarn: (_yarnVersion || _load_yarnVersion()).version }; - - var pkg = yield config.maybeReadManifest(config.cwd); - if (pkg && pkg.name && pkg.version) { - versions[pkg.name] = pkg.version; - } - - (0, (_assign || _load_assign()).default)(versions, process.versions); - - reporter.inspect(versions); - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _yarnVersion; - -function _load_yarnVersion() { - return _yarnVersion = __webpack_require__(114); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function setFlags(commander) { - commander.description('Displays version information of currently installed Yarn, Node.js, and its dependencies.'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 533 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.requireLockfile = undefined; - -var _from; - -function _load_from() { - return _from = _interopRequireDefault(__webpack_require__(53)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var cleanQuery = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, query) { - // if a location was passed then turn it into a hash query - if (path.isAbsolute(query) && (yield (_fs || _load_fs()).exists(query))) { - // absolute path - query = path.relative(config.cwd, query); - } - - // remove references to node_modules with hashes - query = query.replace(/([\\/]|^)node_modules[\\/]/g, '#'); - - // remove trailing hashes - query = query.replace(/^#+/g, ''); - - // remove trailing paths from each part of the query, skip second part of path for scoped packages - var queryParts = query.split('#'); - queryParts = queryParts.map(function (part) { - var parts = part.split(/[\\/]/g); - - if (part[0] === '@') { - parts = parts.slice(0, 2); - } else { - parts = parts.slice(0, 1); - } - - return parts.join('/'); - }); - query = queryParts.join('#'); - - return query; - }); - - return function cleanQuery(_x, _x2) { - return _ref.apply(this, arguments); - }; -}(); - -var getPackageSize = function () { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (tuple) { - var loc = tuple[0]; - - - var files = yield (_fs || _load_fs()).walk(loc, null, new (_set || _load_set()).default([(_constants || _load_constants()).METADATA_FILENAME, (_constants || _load_constants()).TARBALL_FILENAME])); - - var sizes = yield (_promise || _load_promise()).default.all(files.map(function (walkFile) { - return (_fs || _load_fs()).getFileSizeOnDisk(walkFile.absolute); - })); - - return sum(sizes); - }); - - return function getPackageSize(_x3) { - return _ref2.apply(this, arguments); - }; -}(); - -var run = exports.run = function () { - var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (!args.length) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('missingWhyDependency')); - } - if (args.length > 1) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('tooManyArguments', 1)); - } - - var query = yield cleanQuery(config, args[0]); - - reporter.step(1, 4, reporter.lang('whyStart', args[0]), emoji.get('thinking_face')); - - // init - reporter.step(2, 4, reporter.lang('whyInitGraph'), emoji.get('truck')); - var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); - var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); - - var _ref8 = yield install.fetchRequestFromCwd(), - depRequests = _ref8.requests, - patterns = _ref8.patterns, - workspaceLayout = _ref8.workspaceLayout; - - yield install.resolver.init(depRequests, { - isFlat: install.flags.flat, - isFrozen: install.flags.frozenLockfile, - workspaceLayout - }); - var hoisted = yield install.linker.getFlatHoistedTree(patterns); - - // finding - reporter.step(3, 4, reporter.lang('whyFinding'), emoji.get('mag')); - - var matches = queryWhy(query, hoisted); - - if (matches.length <= 0) { - reporter.error(reporter.lang('whyUnknownMatch')); - return; - } - - var processMatch = function () { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (match) { - var matchInfo = match[1]; - - var matchRef = matchInfo.pkg._reference; - invariant(matchRef, 'expected reference'); - - var distinctMatchPatterns = new (_set || _load_set()).default(matchRef.patterns); - var reasons = []; - - // reason: dependency of these modules - if (matchInfo.originalParentPath.length > 0) { - reasons.push({ - type: 'whyDependedOn', - typeSimple: 'whyDependedOnSimple', - value: toStandardPathString(matchInfo.originalParentPath) - }); - } - - // reason: exists in manifest - var rootType = void 0; - for (var _iterator3 = distinctMatchPatterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref10; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref10 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref10 = _i3.value; - } - - var pattern = _ref10; - - rootType = install.rootPatternsToOrigin[pattern]; - if (rootType) { - reasons.push({ - type: 'whySpecified', - typeSimple: 'whySpecifiedSimple', - value: rootType - }); - } - } - - // reason: this is hoisted from these modules - for (var _iterator4 = matchInfo.previousPaths, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref11; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref11 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref11 = _i4.value; - } - - var _path = _ref11; - - reasons.push({ - type: 'whyHoistedFrom', - typeSimple: 'whyHoistedFromSimple', - value: toStandardPathString(_path) - }); - } - - // package sizes - var packageSize = 0; - var directSizes = []; - var transitiveSizes = []; - try { - packageSize = yield getPackageSize(match); - } catch (e) {} - - var dependencies = (0, (_from || _load_from()).default)(collect(hoisted, new (_set || _load_set()).default(), match)); - var transitiveDependencies = (0, (_from || _load_from()).default)(collect(hoisted, new (_set || _load_set()).default(), match, { recursive: true })); - - try { - directSizes = yield (_promise || _load_promise()).default.all(dependencies.map(getPackageSize)); - transitiveSizes = yield (_promise || _load_promise()).default.all(transitiveDependencies.map(getPackageSize)); - } catch (e) {} - - var transitiveKeys = new (_set || _load_set()).default(transitiveDependencies.map(function (_ref12) { - var info = _ref12[1]; - return info.key; - })); - var sharedDependencies = getSharedDependencies(hoisted, transitiveKeys); - - // prepare output: populate reporter - reporter.info(reporter.lang('whyMatch', `${matchInfo.key}@${matchInfo.pkg.version}`)); - // - // reason: hoisted/nohoist - if (matchInfo.isNohoist) { - reasons.push({ - type: 'whyNotHoisted', - typeSimple: 'whyNotHoistedSimple', - value: matchInfo.nohoistList - }); - } else if (query === matchInfo.originalKey) { - reporter.info(reporter.lang('whyHoistedTo', matchInfo.key)); - } - - if (reasons.length === 1) { - reporter.info(reporter.lang(reasons[0].typeSimple, reasons[0].value)); - } else if (reasons.length > 1) { - reporter.info(reporter.lang('whyReasons')); - reporter.list('reasons', reasons.map(function (reason) { - return reporter.lang(reason.type, reason.value); - })); - } else { - reporter.error(reporter.lang('whyWhoKnows')); - } - - if (packageSize) { - // stats: file size of this dependency without any dependencies - reporter.info(reporter.lang('whyDiskSizeWithout', bytes(packageSize))); - - // stats: file size of this dependency including dependencies that aren't shared - reporter.info(reporter.lang('whyDiskSizeUnique', bytes(packageSize + sum(directSizes)))); - - // stats: file size of this dependency including dependencies - reporter.info(reporter.lang('whyDiskSizeTransitive', bytes(packageSize + sum(transitiveSizes)))); - - // stats: shared transitive dependencies - reporter.info(reporter.lang('whySharedDependencies', sharedDependencies.size)); - } - }); - - return function processMatch(_x9) { - return _ref9.apply(this, arguments); - }; - }(); - - reporter.step(4, 4, reporter.lang('whyCalculating'), emoji.get('aerial_tramway')); - for (var _iterator5 = matches, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) { - var _ref13; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref13 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref13 = _i5.value; - } - - var match = _ref13; - - yield processMatch(match); - } - }); - - return function run(_x5, _x6, _x7, _x8) { - return _ref7.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; -exports.queryWhy = queryWhy; - -var _install; - -function _load_install() { - return _install = __webpack_require__(41); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(13); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(8)); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(25)); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var requireLockfile = exports.requireLockfile = true; - -var invariant = __webpack_require__(15); -var bytes = __webpack_require__(593); -var emoji = __webpack_require__(242); -var path = __webpack_require__(1); - -function sum(array) { - return array.length ? array.reduce(function (a, b) { - return a + b; - }, 0) : 0; -} - -function collect(hoistManifests, allDependencies, dependency) { - var _ref3 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { recursive: false }, - recursive = _ref3.recursive; - - var depInfo = dependency[1]; - - var deps = depInfo.pkg.dependencies; - - if (!deps) { - return allDependencies; - } - - var dependencyKeys = new (_set || _load_set()).default((0, (_keys || _load_keys()).default)(deps)); - var directDependencies = []; - - for (var _iterator = hoistManifests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref4; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref4 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref4 = _i.value; - } - - var dep = _ref4; - var info = dep[1]; - - - if (!allDependencies.has(dep) && dependencyKeys.has(info.key)) { - allDependencies.add(dep); - directDependencies.push(dep); - } - } - - if (recursive) { - directDependencies.forEach(function (dependency) { - return collect(hoistManifests, allDependencies, dependency, { recursive: true }); - }); - } - - return allDependencies; -} - -function getSharedDependencies(hoistManifests, transitiveKeys) { - var sharedDependencies = new (_set || _load_set()).default(); - for (var _iterator2 = hoistManifests, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref6; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref6 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref6 = _i2.value; - } - - var _ref5 = _ref6; - var info = _ref5[1]; - - if (!transitiveKeys.has(info.key) && info.pkg.dependencies) { - (0, (_keys || _load_keys()).default)(info.pkg.dependencies).forEach(function (dependency) { - if (transitiveKeys.has(dependency) && !sharedDependencies.has(dependency)) { - sharedDependencies.add(dependency); - } - }); - } - } - return sharedDependencies; -} - -function setFlags(commander) { - commander.description('Identifies why a package has been installed, detailing which other packages depend on it.'); -} - -function hasWrapper(commander, args) { - return true; -} - -// to conform to the current standard '#' as package tree separator -function toStandardPathString(pathString) { - var str = pathString.replace(/\//g, '#'); - if (str[0] === '#') { - return str.slice(1); - } - return str; -} - -function queryWhy(pattern, hoisted) { - var nohoistPattern = `#${pattern}`; - var found = []; - for (var _iterator6 = hoisted, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) { - var _ref15; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref15 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref15 = _i6.value; - } - - var _ref14 = _ref15; - var loc = _ref14[0]; - var info = _ref14[1]; - - if (info.key === pattern || info.previousPaths.indexOf(pattern) >= 0 || info.key.endsWith(nohoistPattern)) { - found.push([loc, info]); - } - } - return found; -} - -/***/ }), -/* 534 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var run = exports.run = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var workspaceRootFolder = config.workspaceRootFolder; - - - if (!workspaceRootFolder) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd)); - } - - if (flags.originalArgs < 1) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceMissingWorkspace')); - } - - if (flags.originalArgs < 2) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceMissingCommand')); - } - - var manifest = yield config.findManifest(workspaceRootFolder, false); - invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property'); - - var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest); - - var _ref2 = flags.originalArgs || [], - workspaceName = _ref2[0], - rest = _ref2.slice(1); - - if (!Object.prototype.hasOwnProperty.call(workspaces, workspaceName)) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceUnknownWorkspace', workspaceName)); - } - - var workspace = workspaces[workspaceName]; - - try { - yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [(_constants || _load_constants()).YARN_BIN_PATH].concat(rest), { - stdio: 'inherit', - cwd: workspace.loc - }); - } catch (err) { - throw err; - } - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _child; - -function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(61)); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(13); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var invariant = __webpack_require__(15); - -function setFlags(commander) {} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 535 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.examples = exports.setFlags = exports.run = exports.runScript = exports.info = undefined; - -var _from; - -function _load_from() { - return _from = _interopRequireDefault(__webpack_require__(53)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _keys; - -function _load_keys() { - return _keys = _interopRequireDefault(__webpack_require__(14)); -} - -var _stringify; - -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(40)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var info = exports.info = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var workspaceRootFolder = config.workspaceRootFolder; - - - if (!workspaceRootFolder) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd)); - } - - var manifest = yield config.findManifest(workspaceRootFolder, false); - invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property'); - - var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest); - - var publicData = {}; - - for (var _iterator = (0, (_keys || _load_keys()).default)(workspaces), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) { - var _ref2; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - var workspaceName = _ref2; - var _workspaces$workspace = workspaces[workspaceName], - loc = _workspaces$workspace.loc, - _manifest = _workspaces$workspace.manifest; - - - var workspaceDependencies = new (_set || _load_set()).default(); - var mismatchedWorkspaceDependencies = new (_set || _load_set()).default(); - - for (var _iterator2 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) { - var _ref3; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; - } - - var dependencyType = _ref3; - - if (dependencyType !== 'peerDependencies') { - for (var _iterator3 = (0, (_keys || _load_keys()).default)(_manifest[dependencyType] || {}), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) { - var _ref4; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } - - var dependencyName = _ref4; - - if (Object.prototype.hasOwnProperty.call(workspaces, dependencyName)) { - invariant(_manifest && _manifest[dependencyType], 'The request should exist'); - var requestedRange = _manifest[dependencyType][dependencyName]; - if (semver.satisfies(workspaces[dependencyName].manifest.version, requestedRange)) { - workspaceDependencies.add(dependencyName); - } else { - mismatchedWorkspaceDependencies.add(dependencyName); - } - } - } - } - } - - publicData[workspaceName] = { - location: path.relative(config.lockfileFolder, loc).replace(/\\/g, '/'), - workspaceDependencies: (0, (_from || _load_from()).default)(workspaceDependencies), - mismatchedWorkspaceDependencies: (0, (_from || _load_from()).default)(mismatchedWorkspaceDependencies) - }; - } - - reporter.log((0, (_stringify || _load_stringify()).default)(publicData, null, 2), { force: true }); - }); - - return function info(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -}(); - -var runScript = exports.runScript = function () { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - var workspaceRootFolder = config.workspaceRootFolder; - - - if (!workspaceRootFolder) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd)); - } - - var manifest = yield config.findManifest(workspaceRootFolder, false); - invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property'); - - var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest); - - try { - var _ref6 = flags.originalArgs || [], - _ = _ref6[0], - rest = _ref6.slice(1); - - for (var _iterator4 = (0, (_keys || _load_keys()).default)(workspaces), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) { - var _ref7; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref7 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref7 = _i4.value; - } - - var workspaceName = _ref7; - var loc = workspaces[workspaceName].loc; - - reporter.log(`${os.EOL}> ${workspaceName}`); - yield (_child || _load_child()).spawn((_constants2 || _load_constants2()).NODE_BIN_PATH, [(_constants2 || _load_constants2()).YARN_BIN_PATH].concat(rest), { - stdio: 'inherit', - cwd: loc + return packWithIgnoreAndHeaders(config.cwd, function (name) { + const relative = path.relative(config.cwd, name); + // Don't ignore directories, since we need to recurse inside them to check for unignored files. + if (fs2.lstatSync(name).isDirectory()) { + const isParentOfKeptFile = Array.from(keepFiles).some(function (name) { + return !path.relative(relative, name).startsWith('..'); }); + return !isParentOfKeptFile; } - } catch (err) { - throw err; - } + // Otherwise, ignore a file if we're not supposed to keep it. + return !keepFiles.has(relative); + }, { mapHeader }); }); - return function runScript(_x5, _x6, _x7, _x8) { - return _ref5.apply(this, arguments); - }; -}(); - -exports.hasWrapper = hasWrapper; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _buildSubCommands2; - -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62)); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(13); -} - -var _child; - -function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(61)); -} - -var _constants2; - -function _load_constants2() { - return _constants2 = __webpack_require__(13); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var invariant = __webpack_require__(15); -var path = __webpack_require__(1); -var os = __webpack_require__(72); -var semver = __webpack_require__(27); - -function hasWrapper(commander, args) { - return true; -} - -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('workspaces', { - info(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield info(config, reporter, flags, args); - })(); - }, - run(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield runScript(config, reporter, flags, args); - })(); - } -}), - run = _buildSubCommands.run, - setFlags = _buildSubCommands.setFlags, - examples = _buildSubCommands.examples; - -exports.run = run; -exports.setFlags = setFlags; -exports.examples = examples; - -/***/ }), -/* 536 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(module) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.autoRun = exports.main = undefined; - -var _assign; - -function _load_assign() { - return _assign = _interopRequireDefault(__webpack_require__(23)); -} - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(24)); -} - -var _getIterator2; - -function _load_getIterator() { - return _getIterator2 = _interopRequireDefault(__webpack_require__(4)); -} - -var _stringify; - -function _load_stringify() { - return _stringify = _interopRequireDefault(__webpack_require__(40)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireDefault(__webpack_require__(7)); -} - -var _set; - -function _load_set() { - return _set = _interopRequireDefault(__webpack_require__(16)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var main = exports.main = function () { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref2) { - var startArgs = _ref2.startArgs, - args = _ref2.args, - endArgs = _ref2.endArgs; - - var collect = function collect(val, acc) { - acc.push(val); - return acc; - }; - - (0, (_loudRejection || _load_loudRejection()).default)(); - (0, (_signalHandler || _load_signalHandler()).default)(); - - // set global options - (_commander || _load_commander()).default.version((_yarnVersion || _load_yarnVersion()).version, '-v, --version'); - (_commander || _load_commander()).default.usage('[command] [flags]'); - (_commander || _load_commander()).default.option('--no-default-rc', 'prevent Yarn from automatically detecting yarnrc and npmrc files'); - (_commander || _load_commander()).default.option('--use-yarnrc ', 'specifies a yarnrc file that Yarn should use (.yarnrc only, not .npmrc)', collect, []); - (_commander || _load_commander()).default.option('--verbose', 'output verbose messages on internal operations'); - (_commander || _load_commander()).default.option('--offline', 'trigger an error if any required dependencies are not available in local cache'); - (_commander || _load_commander()).default.option('--prefer-offline', 'use network only if dependencies are not available in local cache'); - (_commander || _load_commander()).default.option('--enable-pnp, --pnp', "enable the Plug'n'Play installation"); - (_commander || _load_commander()).default.option('--disable-pnp', "disable the Plug'n'Play installation"); - (_commander || _load_commander()).default.option('--strict-semver'); - (_commander || _load_commander()).default.option('--json', 'format Yarn log messages as lines of JSON (see jsonlines.org)'); - (_commander || _load_commander()).default.option('--ignore-scripts', "don't run lifecycle scripts"); - (_commander || _load_commander()).default.option('--har', 'save HAR output of network traffic'); - (_commander || _load_commander()).default.option('--ignore-platform', 'ignore platform checks'); - (_commander || _load_commander()).default.option('--ignore-engines', 'ignore engines check'); - (_commander || _load_commander()).default.option('--ignore-optional', 'ignore optional dependencies'); - (_commander || _load_commander()).default.option('--force', 'install and build packages even if they were built before, overwrite lockfile'); - (_commander || _load_commander()).default.option('--skip-integrity-check', 'run install without checking if node_modules is installed'); - (_commander || _load_commander()).default.option('--check-files', 'install will verify file tree of packages for consistency'); - (_commander || _load_commander()).default.option('--no-bin-links', "don't generate bin links when setting up packages"); - (_commander || _load_commander()).default.option('--flat', 'only allow one version of a package'); - (_commander || _load_commander()).default.option('--prod, --production [prod]', '', (_conversion || _load_conversion()).boolify); - (_commander || _load_commander()).default.option('--no-lockfile', "don't read or generate a lockfile"); - (_commander || _load_commander()).default.option('--pure-lockfile', "don't generate a lockfile"); - (_commander || _load_commander()).default.option('--frozen-lockfile', "don't generate a lockfile and fail if an update is needed"); - (_commander || _load_commander()).default.option('--update-checksums', 'update package checksums from current repository'); - (_commander || _load_commander()).default.option('--link-duplicates', 'create hardlinks to the repeated modules in node_modules'); - (_commander || _load_commander()).default.option('--link-folder ', 'specify a custom folder to store global links'); - (_commander || _load_commander()).default.option('--global-folder ', 'specify a custom folder to store global packages'); - (_commander || _load_commander()).default.option('--modules-folder ', 'rather than installing modules into the node_modules folder relative to the cwd, output them here'); - (_commander || _load_commander()).default.option('--preferred-cache-folder ', 'specify a custom folder to store the yarn cache if possible'); - (_commander || _load_commander()).default.option('--cache-folder ', 'specify a custom folder that must be used to store the yarn cache'); - (_commander || _load_commander()).default.option('--mutex [:specifier]', 'use a mutex to ensure only one yarn instance is executing'); - (_commander || _load_commander()).default.option('--emoji [bool]', 'enable emoji in output', (_conversion || _load_conversion()).boolify, process.platform === 'darwin' || process.env.TERM_PROGRAM === 'Hyper' || process.env.TERM_PROGRAM === 'HyperTerm' || process.env.TERM_PROGRAM === 'Terminus'); - (_commander || _load_commander()).default.option('-s, --silent', 'skip Yarn console logs, other types of logs (script output) will be printed'); - (_commander || _load_commander()).default.option('--cwd ', 'working directory to use', process.cwd()); - (_commander || _load_commander()).default.option('--proxy ', ''); - (_commander || _load_commander()).default.option('--https-proxy ', ''); - (_commander || _load_commander()).default.option('--registry ', 'override configuration registry'); - (_commander || _load_commander()).default.option('--no-progress', 'disable progress bar'); - (_commander || _load_commander()).default.option('--network-concurrency ', 'maximum number of concurrent network requests', parseInt); - (_commander || _load_commander()).default.option('--network-timeout ', 'TCP timeout for network requests', parseInt); - (_commander || _load_commander()).default.option('--non-interactive', 'do not show interactive prompts'); - (_commander || _load_commander()).default.option('--scripts-prepend-node-path [bool]', 'prepend the node executable dir to the PATH in scripts', (_conversion || _load_conversion()).boolify); - (_commander || _load_commander()).default.option('--no-node-version-check', 'do not warn when using a potentially unsupported Node version'); - (_commander || _load_commander()).default.option('--focus', 'Focus on a single workspace by installing remote copies of its sibling workspaces.'); - (_commander || _load_commander()).default.option('--otp ', 'one-time password for two factor authentication'); - - // if -v is the first command, then always exit after returning the version - if (args[0] === '-v') { - console.log((_yarnVersion || _load_yarnVersion()).version.trim()); - process.exitCode = 0; - return; - } - - // get command name - var firstNonFlagIndex = args.findIndex(function (arg, idx, arr) { - var isOption = arg.startsWith('-'); - var prev = idx > 0 && arr[idx - 1]; - var prevOption = prev && prev.startsWith('-') && (_commander || _load_commander()).default.optionFor(prev); - var boundToPrevOption = prevOption && (prevOption.optional || prevOption.required); - - return !isOption && !boundToPrevOption; - }); - var preCommandArgs = void 0; - var commandName = ''; - if (firstNonFlagIndex > -1) { - preCommandArgs = args.slice(0, firstNonFlagIndex); - commandName = args[firstNonFlagIndex]; - args = args.slice(firstNonFlagIndex + 1); - } else { - preCommandArgs = args; - args = []; - } - - var isKnownCommand = Object.prototype.hasOwnProperty.call((_index3 || _load_index3()).default, commandName); - var isHelp = function isHelp(arg) { - return arg === '--help' || arg === '-h'; - }; - var helpInPre = preCommandArgs.findIndex(isHelp); - var helpInArgs = args.findIndex(isHelp); - var setHelpMode = function setHelpMode() { - if (isKnownCommand) { - args.unshift(commandName); - } - commandName = 'help'; - isKnownCommand = true; - }; - - if (helpInPre > -1) { - preCommandArgs.splice(helpInPre); - setHelpMode(); - } else if (isKnownCommand && helpInArgs === 0) { - args.splice(helpInArgs); - setHelpMode(); - } - - if (!commandName) { - commandName = 'install'; - isKnownCommand = true; - } - - if (!isKnownCommand) { - // if command is not recognized, then set default to `run` - args.unshift(commandName); - commandName = 'run'; - } - var command = (_index3 || _load_index3()).default[commandName]; - - var warnAboutRunDashDash = false; - // we are using "yarn