@squidcloud/cli 1.0.484 → 1.0.485
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -208,6 +208,7 @@ module.exports = function (/**String*/ input, /** object */ options) {
|
|
|
208
208
|
* Remove the entry from the file or the entry and all it's nested directories and files if the given entry is a directory
|
|
209
209
|
*
|
|
210
210
|
* @param {ZipEntry|string} entry
|
|
211
|
+
* @param {boolean} withsubfolders
|
|
211
212
|
* @returns {void}
|
|
212
213
|
*/
|
|
213
214
|
deleteFile: function (entry, withsubfolders = true) {
|
|
@@ -492,7 +493,7 @@ module.exports = function (/**String*/ input, /** object */ options) {
|
|
|
492
493
|
addLocalFolderAsync2: function (options, callback) {
|
|
493
494
|
const self = this;
|
|
494
495
|
options = typeof options === "object" ? options : { localPath: options };
|
|
495
|
-
localPath = pth.resolve(fixPath(options.localPath));
|
|
496
|
+
const localPath = pth.resolve(fixPath(options.localPath));
|
|
496
497
|
let { zipPath, filter, namefix } = options;
|
|
497
498
|
|
|
498
499
|
if (filter instanceof RegExp) {
|
|
@@ -511,7 +512,7 @@ module.exports = function (/**String*/ input, /** object */ options) {
|
|
|
511
512
|
zipPath = zipPath ? fixPath(zipPath) : "";
|
|
512
513
|
|
|
513
514
|
// Check Namefix function
|
|
514
|
-
if (namefix
|
|
515
|
+
if (namefix === "latin1") {
|
|
515
516
|
namefix = (str) =>
|
|
516
517
|
str
|
|
517
518
|
.normalize("NFD")
|
|
@@ -687,7 +688,7 @@ module.exports = function (/**String*/ input, /** object */ options) {
|
|
|
687
688
|
|
|
688
689
|
var entryName = canonical(item.entryName);
|
|
689
690
|
|
|
690
|
-
var target = sanitize(targetPath, outFileName && !item.isDirectory ? outFileName : maintainEntryPath ? entryName : pth.basename(entryName));
|
|
691
|
+
var target = sanitize(targetPath, outFileName && !item.isDirectory ? canonical(outFileName) : maintainEntryPath ? entryName : pth.basename(entryName));
|
|
691
692
|
|
|
692
693
|
if (item.isDirectory) {
|
|
693
694
|
var children = _zip.getEntryChildren(item);
|
|
@@ -728,7 +729,7 @@ module.exports = function (/**String*/ input, /** object */ options) {
|
|
|
728
729
|
return false;
|
|
729
730
|
}
|
|
730
731
|
|
|
731
|
-
for (var entry
|
|
732
|
+
for (var entry of _zip.entries) {
|
|
732
733
|
try {
|
|
733
734
|
if (entry.isDirectory) {
|
|
734
735
|
continue;
|
|
@@ -1050,6 +1051,7 @@ module.exports = function () {
|
|
|
1050
1051
|
switch (val) {
|
|
1051
1052
|
case Constants.STORED:
|
|
1052
1053
|
this.version = 10;
|
|
1054
|
+
break;
|
|
1053
1055
|
case Constants.DEFLATED:
|
|
1054
1056
|
default:
|
|
1055
1057
|
this.version = 20;
|
|
@@ -1252,7 +1254,11 @@ module.exports = function () {
|
|
|
1252
1254
|
// version needed to extract
|
|
1253
1255
|
data.writeUInt16LE(_version, Constants.LOCVER);
|
|
1254
1256
|
// general purpose bit flag
|
|
1255
|
-
data
|
|
1257
|
+
// clear bit 3 (data descriptor): we always write the real crc-32
|
|
1258
|
+
// and sizes into this local header, so no trailing descriptor is
|
|
1259
|
+
// emitted. Leaving the flag set would make the output unreadable
|
|
1260
|
+
// (see issue #555).
|
|
1261
|
+
data.writeUInt16LE(_flags & ~Constants.FLG_DESC, Constants.LOCFLG);
|
|
1256
1262
|
// compression method
|
|
1257
1263
|
data.writeUInt16LE(_method, Constants.LOCHOW);
|
|
1258
1264
|
// modification time (2 bytes time, 2 bytes date)
|
|
@@ -1280,7 +1286,9 @@ module.exports = function () {
|
|
|
1280
1286
|
// version needed to extract
|
|
1281
1287
|
data.writeUInt16LE(_version, Constants.CENVER);
|
|
1282
1288
|
// encrypt, decrypt flags
|
|
1283
|
-
data
|
|
1289
|
+
// clear bit 3 (data descriptor) to match the local header we emit
|
|
1290
|
+
// (real crc/sizes are written, no descriptor follows the data) — issue #555
|
|
1291
|
+
data.writeUInt16LE(_flags & ~Constants.FLG_DESC, Constants.CENFLG);
|
|
1284
1292
|
// compression method
|
|
1285
1293
|
data.writeUInt16LE(_method, Constants.CENHOW);
|
|
1286
1294
|
// modification time (2 bytes time, 2 bytes date)
|
|
@@ -1365,6 +1373,8 @@ module.exports = function () {
|
|
|
1365
1373
|
_offset = 0,
|
|
1366
1374
|
_commentLength = 0;
|
|
1367
1375
|
|
|
1376
|
+
const needsZip64 = () => _volumeEntries > Constants.EF_ZIP64_OR_16 || _totalEntries > Constants.EF_ZIP64_OR_16 || _size > Constants.EF_ZIP64_OR_32 || _offset > Constants.EF_ZIP64_OR_32;
|
|
1377
|
+
|
|
1368
1378
|
return {
|
|
1369
1379
|
get diskEntries() {
|
|
1370
1380
|
return _volumeEntries;
|
|
@@ -1402,7 +1412,7 @@ module.exports = function () {
|
|
|
1402
1412
|
},
|
|
1403
1413
|
|
|
1404
1414
|
get mainHeaderSize() {
|
|
1405
|
-
return Constants.ENDHDR + _commentLength;
|
|
1415
|
+
return (needsZip64() ? Constants.ZIP64HDR + Constants.END64HDR : 0) + Constants.ENDHDR + _commentLength;
|
|
1406
1416
|
},
|
|
1407
1417
|
|
|
1408
1418
|
loadFromBinary: function (/*Buffer*/ data) {
|
|
@@ -1432,7 +1442,7 @@ module.exports = function () {
|
|
|
1432
1442
|
// total number of entries
|
|
1433
1443
|
_totalEntries = Utils.readBigUInt64LE(data, Constants.ZIP64TOT);
|
|
1434
1444
|
// central directory size in bytes
|
|
1435
|
-
_size = Utils.readBigUInt64LE(data, Constants.
|
|
1445
|
+
_size = Utils.readBigUInt64LE(data, Constants.ZIP64SIZB);
|
|
1436
1446
|
// offset of first CEN header
|
|
1437
1447
|
_offset = Utils.readBigUInt64LE(data, Constants.ZIP64OFF);
|
|
1438
1448
|
|
|
@@ -1441,22 +1451,67 @@ module.exports = function () {
|
|
|
1441
1451
|
},
|
|
1442
1452
|
|
|
1443
1453
|
toBinary: function () {
|
|
1444
|
-
|
|
1454
|
+
if (!needsZip64()) {
|
|
1455
|
+
var b = Buffer.alloc(Constants.ENDHDR + _commentLength);
|
|
1456
|
+
// "PK 05 06" signature
|
|
1457
|
+
b.writeUInt32LE(Constants.ENDSIG, 0);
|
|
1458
|
+
b.writeUInt32LE(0, 4);
|
|
1459
|
+
// number of entries on this volume
|
|
1460
|
+
b.writeUInt16LE(_volumeEntries, Constants.ENDSUB);
|
|
1461
|
+
// total number of entries
|
|
1462
|
+
b.writeUInt16LE(_totalEntries, Constants.ENDTOT);
|
|
1463
|
+
// central directory size in bytes
|
|
1464
|
+
b.writeUInt32LE(_size, Constants.ENDSIZ);
|
|
1465
|
+
// offset of first CEN header
|
|
1466
|
+
b.writeUInt32LE(_offset, Constants.ENDOFF);
|
|
1467
|
+
// zip file comment length
|
|
1468
|
+
b.writeUInt16LE(_commentLength, Constants.ENDCOM);
|
|
1469
|
+
// fill comment memory with spaces so no garbage is left there
|
|
1470
|
+
b.fill(" ", Constants.ENDHDR);
|
|
1471
|
+
|
|
1472
|
+
return b;
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
var b = Buffer.alloc(this.mainHeaderSize);
|
|
1476
|
+
let offset = 0;
|
|
1477
|
+
|
|
1478
|
+
// Zip64 end of central directory record.
|
|
1479
|
+
b.writeUInt32LE(Constants.ZIP64SIG, offset);
|
|
1480
|
+
Utils.writeBigUInt64LE(b, Constants.ZIP64HDR - Constants.ZIP64LEAD, offset + Constants.ZIP64SIZE);
|
|
1481
|
+
b.writeUInt16LE(45, offset + Constants.ZIP64VEM);
|
|
1482
|
+
b.writeUInt16LE(45, offset + Constants.ZIP64VER);
|
|
1483
|
+
b.writeUInt32LE(0, offset + Constants.ZIP64DSK);
|
|
1484
|
+
b.writeUInt32LE(0, offset + Constants.ZIP64DSKDIR);
|
|
1485
|
+
Utils.writeBigUInt64LE(b, _volumeEntries, offset + Constants.ZIP64SUB);
|
|
1486
|
+
Utils.writeBigUInt64LE(b, _totalEntries, offset + Constants.ZIP64TOT);
|
|
1487
|
+
Utils.writeBigUInt64LE(b, _size, offset + Constants.ZIP64SIZB);
|
|
1488
|
+
Utils.writeBigUInt64LE(b, _offset, offset + Constants.ZIP64OFF);
|
|
1489
|
+
|
|
1490
|
+
const zip64EndOffset = _offset + _size;
|
|
1491
|
+
offset += Constants.ZIP64HDR;
|
|
1492
|
+
|
|
1493
|
+
// Zip64 end of central directory locator.
|
|
1494
|
+
b.writeUInt32LE(Constants.END64SIG, offset);
|
|
1495
|
+
b.writeUInt32LE(0, offset + Constants.END64START);
|
|
1496
|
+
Utils.writeBigUInt64LE(b, zip64EndOffset, offset + Constants.END64OFF);
|
|
1497
|
+
b.writeUInt32LE(1, offset + Constants.END64NUMDISKS);
|
|
1498
|
+
offset += Constants.END64HDR;
|
|
1499
|
+
|
|
1445
1500
|
// "PK 05 06" signature
|
|
1446
|
-
b.writeUInt32LE(Constants.ENDSIG,
|
|
1447
|
-
b.writeUInt32LE(0, 4);
|
|
1501
|
+
b.writeUInt32LE(Constants.ENDSIG, offset);
|
|
1502
|
+
b.writeUInt32LE(0, offset + 4);
|
|
1448
1503
|
// number of entries on this volume
|
|
1449
|
-
b.writeUInt16LE(_volumeEntries, Constants.ENDSUB);
|
|
1504
|
+
b.writeUInt16LE(Math.min(_volumeEntries, Constants.EF_ZIP64_OR_16), offset + Constants.ENDSUB);
|
|
1450
1505
|
// total number of entries
|
|
1451
|
-
b.writeUInt16LE(_totalEntries, Constants.ENDTOT);
|
|
1506
|
+
b.writeUInt16LE(Math.min(_totalEntries, Constants.EF_ZIP64_OR_16), offset + Constants.ENDTOT);
|
|
1452
1507
|
// central directory size in bytes
|
|
1453
|
-
b.writeUInt32LE(_size, Constants.ENDSIZ);
|
|
1508
|
+
b.writeUInt32LE(Math.min(_size, Constants.EF_ZIP64_OR_32), offset + Constants.ENDSIZ);
|
|
1454
1509
|
// offset of first CEN header
|
|
1455
|
-
b.writeUInt32LE(_offset, Constants.ENDOFF);
|
|
1510
|
+
b.writeUInt32LE(Math.min(_offset, Constants.EF_ZIP64_OR_32), offset + Constants.ENDOFF);
|
|
1456
1511
|
// zip file comment length
|
|
1457
|
-
b.writeUInt16LE(_commentLength, Constants.ENDCOM);
|
|
1512
|
+
b.writeUInt16LE(_commentLength, offset + Constants.ENDCOM);
|
|
1458
1513
|
// fill comment memory with spaces so no garbage is left there
|
|
1459
|
-
b.fill(" ", Constants.ENDHDR);
|
|
1514
|
+
b.fill(" ", offset + Constants.ENDHDR);
|
|
1460
1515
|
|
|
1461
1516
|
return b;
|
|
1462
1517
|
},
|
|
@@ -1541,7 +1596,7 @@ exports.ZipCrypto = __webpack_require__(7186);
|
|
|
1541
1596
|
/***/ 1297
|
|
1542
1597
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1543
1598
|
|
|
1544
|
-
const version = +(process
|
|
1599
|
+
const version = +(process?.versions?.node ?? "").split(".")[0] || 0;
|
|
1545
1600
|
|
|
1546
1601
|
module.exports = function (/*Buffer*/ inbuf, /*number*/ expectedLength) {
|
|
1547
1602
|
var zlib = __webpack_require__(3106);
|
|
@@ -2383,13 +2438,13 @@ Utils.findLast = function (arr, callback) {
|
|
|
2383
2438
|
return void 0;
|
|
2384
2439
|
};
|
|
2385
2440
|
|
|
2386
|
-
// make
|
|
2441
|
+
// make absolute paths taking prefix as root folder
|
|
2387
2442
|
Utils.sanitize = function (/*string*/ prefix, /*string*/ name) {
|
|
2388
2443
|
prefix = pth.resolve(pth.normalize(prefix));
|
|
2389
2444
|
var parts = name.split("/");
|
|
2390
2445
|
for (var i = 0, l = parts.length; i < l; i++) {
|
|
2391
2446
|
var path = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));
|
|
2392
|
-
if (path.
|
|
2447
|
+
if (path === prefix || path.startsWith(prefix + pth.sep)) {
|
|
2393
2448
|
return path;
|
|
2394
2449
|
}
|
|
2395
2450
|
}
|
|
@@ -2414,6 +2469,13 @@ Utils.readBigUInt64LE = function (/*Buffer*/ buffer, /*int*/ index) {
|
|
|
2414
2469
|
return hi * 0x100000000 + lo;
|
|
2415
2470
|
};
|
|
2416
2471
|
|
|
2472
|
+
Utils.writeBigUInt64LE = function (/*Buffer*/ buffer, /*Number*/ value, /*int*/ index) {
|
|
2473
|
+
const lo = value >>> 0;
|
|
2474
|
+
const hi = Math.floor(value / 0x100000000) >>> 0;
|
|
2475
|
+
buffer.writeUInt32LE(lo, index);
|
|
2476
|
+
buffer.writeUInt32LE(hi, index + 4);
|
|
2477
|
+
};
|
|
2478
|
+
|
|
2417
2479
|
Utils.fromDOS2Date = function (val) {
|
|
2418
2480
|
return new Date(((val >> 25) & 0x7f) + 1980, Math.max(((val >> 21) & 0x0f) - 1, 0), Math.max((val >> 16) & 0x1f, 1), (val >> 11) & 0x1f, (val >> 5) & 0x3f, (val & 0x1f) << 1);
|
|
2419
2481
|
};
|
|
@@ -3194,7 +3256,7 @@ module.exports = function (/*Buffer|null*/ inBuffer, /** object */ options) {
|
|
|
3194
3256
|
// write main header
|
|
3195
3257
|
const mh = mainHeader.toBinary();
|
|
3196
3258
|
if (_comment) {
|
|
3197
|
-
_comment.copy(mh,
|
|
3259
|
+
_comment.copy(mh, mh.length - _comment.length); // add zip file comment
|
|
3198
3260
|
}
|
|
3199
3261
|
mh.copy(outBuffer, dindex);
|
|
3200
3262
|
|
|
@@ -3272,7 +3334,7 @@ module.exports = function (/*Buffer|null*/ inBuffer, /** object */ options) {
|
|
|
3272
3334
|
|
|
3273
3335
|
const mh = mainHeader.toBinary();
|
|
3274
3336
|
if (_comment) {
|
|
3275
|
-
_comment.copy(mh,
|
|
3337
|
+
_comment.copy(mh, mh.length - _comment.length); // add zip file comment
|
|
3276
3338
|
}
|
|
3277
3339
|
|
|
3278
3340
|
mh.copy(outBuffer, dindex); // write main header
|
|
@@ -3321,56 +3383,21 @@ module.exports = ({onlyFirst = false} = {}) => {
|
|
|
3321
3383
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
3322
3384
|
|
|
3323
3385
|
"use strict";
|
|
3324
|
-
__webpack_require__.r(__webpack_exports__);
|
|
3325
3386
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3326
|
-
/* harmony export */ $a: () => (/* binding */ W),
|
|
3327
|
-
/* harmony export */ $u: () => (/* binding */ G),
|
|
3328
3387
|
/* harmony export */ arrayAssertion: () => (/* binding */ S),
|
|
3329
|
-
/* harmony export */ assertArray: () => (/* binding */ E),
|
|
3330
|
-
/* harmony export */ assertBoolean: () => (/* binding */ Z),
|
|
3331
|
-
/* harmony export */ assertDate: () => (/* binding */ O),
|
|
3332
|
-
/* harmony export */ assertEmail: () => (/* binding */ q),
|
|
3333
|
-
/* harmony export */ assertHexString: () => (/* binding */ N),
|
|
3334
|
-
/* harmony export */ assertNonNullable: () => (/* binding */ V),
|
|
3335
|
-
/* harmony export */ assertNumber: () => (/* binding */ z),
|
|
3336
|
-
/* harmony export */ assertObject: () => (/* binding */ b),
|
|
3337
|
-
/* harmony export */ assertRecord: () => (/* binding */ B),
|
|
3338
|
-
/* harmony export */ assertString: () => (/* binding */ k),
|
|
3339
3388
|
/* harmony export */ assertTruthy: () => (/* binding */ g),
|
|
3340
|
-
/* harmony export */ assertUuid: () => (/* binding */ I),
|
|
3341
|
-
/* harmony export */ callValueAssertion: () => (/* binding */ j),
|
|
3342
|
-
/* harmony export */ checkArrayHasUniqueElements: () => (/* binding */ e),
|
|
3343
|
-
/* harmony export */ checkArraysHasEqualElementsByComparator: () => (/* binding */ r),
|
|
3344
|
-
/* harmony export */ checkArraysHaveEqualElements: () => (/* binding */ o),
|
|
3345
|
-
/* harmony export */ fail: () => (/* binding */ v),
|
|
3346
3389
|
/* harmony export */ formatError: () => (/* binding */ x),
|
|
3347
|
-
/* harmony export */ formatValue: () => (/* binding */ $),
|
|
3348
|
-
/* harmony export */ getAssertionErrorFromProvider: () => (/* binding */ m),
|
|
3349
|
-
/* harmony export */ getErrorMessage: () => (/* binding */ p),
|
|
3350
3390
|
/* harmony export */ getMessageFromError: () => (/* binding */ X),
|
|
3351
|
-
/* harmony export */ isBoolean: () => (/* binding */ u),
|
|
3352
|
-
/* harmony export */ isDate: () => (/* binding */ t),
|
|
3353
|
-
/* harmony export */ isEmail: () => (/* binding */ s),
|
|
3354
|
-
/* harmony export */ isHexString: () => (/* binding */ A),
|
|
3355
|
-
/* harmony export */ isNonNullable: () => (/* binding */ D),
|
|
3356
|
-
/* harmony export */ isNumber: () => (/* binding */ n),
|
|
3357
|
-
/* harmony export */ isString: () => (/* binding */ F),
|
|
3358
|
-
/* harmony export */ isUuid: () => (/* binding */ l),
|
|
3359
|
-
/* harmony export */ nullOr: () => (/* binding */ K),
|
|
3360
|
-
/* harmony export */ objectAssertion: () => (/* binding */ _),
|
|
3361
3391
|
/* harmony export */ recordAssertion: () => (/* binding */ U),
|
|
3362
|
-
/* harmony export */
|
|
3363
|
-
/* harmony export */ stringAssertion: () => (/* binding */ M),
|
|
3364
|
-
/* harmony export */ truthy: () => (/* binding */ C),
|
|
3365
|
-
/* harmony export */ tryCatch: () => (/* binding */ P),
|
|
3366
|
-
/* harmony export */ undefinedOr: () => (/* binding */ J),
|
|
3367
|
-
/* harmony export */ validateArray: () => (/* binding */ R),
|
|
3368
|
-
/* harmony export */ validateObject: () => (/* binding */ Q),
|
|
3369
|
-
/* harmony export */ validateRecord: () => (/* binding */ T),
|
|
3370
|
-
/* harmony export */ valueOr: () => (/* binding */ H)
|
|
3392
|
+
/* harmony export */ truthy: () => (/* binding */ C)
|
|
3371
3393
|
/* harmony export */ });
|
|
3394
|
+
/* unused harmony exports $a, $u, assertArray, assertBoolean, assertDate, assertEmail, assertHexString, assertNonNullable, assertNumber, assertObject, assertRecord, assertUuid, callValueAssertion, checkArrayHasUniqueElements, checkArraysHasEqualElementsByComparator, checkArraysHaveEqualElements, fail, formatValue, getAssertionErrorFromProvider, getErrorMessage, isBoolean, isDate, isEmail, isHexString, isNonNullable, isNumber, isString, isUuid, nullOr, objectAssertion, setDefaultAssertionErrorFactory, stringAssertion, tryCatch, undefinedOr, validateArray, validateObject, validateRecord, valueOr */
|
|
3372
3395
|
function u(u){return"boolean"==typeof u}function F(u){return"string"==typeof u}function n(u){return"number"==typeof u}function t(u){return u instanceof Date}function e(u,F){if(u.length<=1)return!0;const n=new Set;for(const t of u){const u=F(t);if(n.has(u))return!1;n.add(u)}return!0}function o(u,F){return r(u,F,((u,F)=>u===F))}function r(u,F,n){if(u===F)return!0;if(!u||!F)return!1;if(u.length!==F.length)return!1;for(let t=0;t<u.length;t++)if(!n(u[t],F[t]))return!1;return!0}const i=/^[-!#$%&'*+/\d=?A-Z^_a-z{|}~](\.?[-!#$%&'*+/\d=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z\d])*\.[a-zA-Z](-?[a-zA-Z\d])+$/,a=/^(?!\.)((?!.*\.{2})[a-zA-Z0-9\u0080-\u00FF\u0100-\u017F\u0180-\u024F\u0250-\u02AF\u0300-\u036F\u0370-\u03FF\u0400-\u04FF\u0500-\u052F\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u0700-\u074F\u0750-\u077F\u0780-\u07BF\u07C0-\u07FF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u2FF0-\u2FFF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u3190-\u319F\u31C0-\u31EF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA700-\uA71F\uA800-\uA82F\uA840-\uA87F\uAC00-\uD7AF\uF900-\uFAFF.!#$%&'*+-/=?^_`{|}~\-\d]+)@(?!\.)([a-zA-Z0-9\u0080-\u00FF\u0100-\u017F\u0180-\u024F\u0250-\u02AF\u0300-\u036F\u0370-\u03FF\u0400-\u04FF\u0500-\u052F\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u0700-\u074F\u0750-\u077F\u0780-\u07BF\u07C0-\u07FF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u2FF0-\u2FFF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u3190-\u319F\u31C0-\u31EF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA700-\uA71F\uA800-\uA82F\uA840-\uA87F\uAC00-\uD7AF\uF900-\uFAFF\-.\d]+)((\.([a-zA-Z\u0080-\u00FF\u0100-\u017F\u0180-\u024F\u0250-\u02AF\u0300-\u036F\u0370-\u03FF\u0400-\u04FF\u0500-\u052F\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u0700-\u074F\u0750-\u077F\u0780-\u07BF\u07C0-\u07FF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u2FF0-\u2FFF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u3190-\u319F\u31C0-\u31EF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA700-\uA71F\uA800-\uA82F\uA840-\uA87F\uAC00-\uD7AF\uF900-\uFAFF]){2,63})+)$/i;function s(u,n={allowInternationalDomains:!1}){if(!F(u)||0===u.length||u.length>254)return!1;if(!(n.allowInternationalDomains?a:i).test(u))return!1;const t=u.split("@");return!(t[0].length>64)&&!t[1].split(".").some((u=>u.length>63))}const c=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function l(u){return F(u)&&c.test(u)}const f=/^[0-9a-fA-F]*$/;function A(u){return F(u)&&f.test(u)}function D(u){return null!=u}function $(u){return void 0===u?"<undefined>":"symbol"==typeof u?u.toString():null===u?"<null>":`<${typeof u}:${u}>`}const d=u=>new Error(u);let h=d;function y(u){h=u||d}function g(u,F,...n){u||v(F,...n)}function C(u,F,...n){return g(u,F,...n),u}function v(u,...F){const n=m(u);if("object"==typeof n)throw n;throw h(n||"Assertion error",...F)}function m(u){return void 0===u?"":"string"==typeof u?u:u()}function p(u){const F=m(u);return"string"==typeof F?F:F.message||"<no error message>"}function b(u,F,n=void 0,t={}){const e=()=>p(n),o=u=>{const F=e();return 0===F.length?u:`${F} ${u}`};g("object"==typeof u,(()=>o("is not an object: "+typeof u))),g(void 0!==u,(()=>o("is not defined"))),g(null!==u,(()=>o("is null"))),g(!Array.isArray(u),(()=>o("is an array.")));const r=Object.entries(F);if(t.failOnUnknownFields){const F=t.allowedUnknownFieldNames||[];for(const n in u)g(F.includes(n)||r.some((([u])=>n===u)),o(`property can't be checked: ${n}`))}let i;for(const[F,n]of r){g("function"==typeof n||"object"==typeof n&&null!==n,(()=>`${e()}.${F} assertion is not an object or a function: ${typeof n}`));const t=u[F],o=()=>`${e()}.${F}`;if("object"==typeof n)g(!Array.isArray(t),(()=>`${e()}.${o()} use arrayAssertion() to create a ValueAssertion for an array`)),b(t,n,o);else if(g("function"==typeof n,(()=>`${e()}.${o()} assertion is not a function`)),"$o"===F)i=n;else{const u=n(t,o);g(void 0===u,`Assertion function must assert (void) but it returns a value: ${u}. Wrap with $u()?`)}}i&&i(u,n)}function E(u,F,n={},t=void 0){var o,r;const i=L(t);g(Array.isArray(u),(()=>`${i()}value is not an array: ${u}`));const a=null!==(o=n.minLength)&&void 0!==o?o:0,s=null!==(r=n.maxLength)&&void 0!==r?r:1/0;g(u.length>=a,(()=>`${i()}array length < minLength. Array length: ${u.length}, minLength: ${a}`)),g(u.length<=s,(()=>`${i()}array length > maxLength. Array length: ${u.length}, maxLength: ${s}`)),n.uniqueByIdentity&&g(e(u,n.uniqueByIdentity),(()=>`${i()}array contains non-unique elements`));let c=0;const l=()=>`${i("no-space-separator")}[${c}]`;for(;c<u.length;c++)w(u[c],F,l)}function B(u,F,n={},t=void 0){const e=L(t);g("object"==typeof u,(()=>`${e()}value is not an object: ${$(u)}`)),g(null!==u,(()=>`${e()}value is null`)),g(!Array.isArray(u),(()=>`${e()}the value is not a record, but is an array`));for(const[t,o]of Object.entries(u)){const u=()=>`${e("no-space-separator")}['${t}']`;n.keyAssertion&&w(t,n.keyAssertion,(()=>`${u()}, key assertion failed:`)),w(o,F,u);const{keyField:r}=n;if(r){g("object"==typeof o&&null!==o,(()=>`${u()} is not an object: ${$(o)}`));const F=o[r];g(F===t,(()=>`${u()} key value does not match object field '${r}' value: ${$(F)}`))}}n.$o&&n.$o(u,t)}function j(u,F,n){F(u,n)}function L(u){return(F="with-space-separator")=>{const n=p(u);return n?`${n}${"with-space-separator"===F?" ":""}`:""}}function w(u,F,n){"object"==typeof F?(g(!Array.isArray(u),(()=>`${n}: use arrayAssertion() to create a ValueAssertion for an array`)),b(u,F,n)):j(u,F,n)}function x(u,F,n){const t=m(u);if("object"==typeof t)throw t;return`${t?`${t}: `:""}${F} ${$(n)}`}const k=(u,n=void 0)=>{g(F(u),(()=>x(n,"Not a string",u)))},z=(u,F=void 0)=>{g(n(u),(()=>x(F,"Not a number",u)))},Z=(F,n=void 0)=>{g(u(F),(()=>x(n,"Not a boolean",F)))},I=(u,F=void 0)=>{g(l(u),(()=>x(F,"Invalid uuid",u)))},N=(u,F=void 0)=>{g(A(u),(()=>x(F,"Invalid hex string",u)))},q=(u,F=void 0)=>{g(s(u),(()=>x(F,"Invalid email",u)))},O=(u,F=void 0)=>{g(u instanceof Date,(()=>x(F,"Invalid Date",u)))};function V(u,F){g(D(u),(()=>x(F,"Value is "+(void 0===u?"undefined":"null"),u)))}function _(u,F=void 0){return n=>b(n,u,F)}function S(u,F={}){const{minLength:n,maxLength:t}=F;return g((null!=n?n:0)<=(null!=t?t:1/0),`minLength must be < maxLength! minLength ${n}, maxLength: ${t}`),g((null!=n?n:0)>=0,`minLength must be a positive number: ${n}`),g((null!=t?t:0)>=0,`maxLength must be a positive number: ${t}`),(n,t=void 0)=>{E(n,u,F,t)}}function U(u,F={}){return(n,t=void 0)=>{B(n,u,F,t)}}function W(u,F){return g("function"==typeof u,`"check" is not a function: ${u}`),(n,t=void 0)=>g(u(n),(()=>{let u=p(t)||"Check is failed";return u.endsWith(":")||(u+=":"),`${u} ${p(F)||("object"==typeof n?"[object]":`'${n}'`)}`}))}function G(u,F){return W(u,F)}function H(u,F){return(n,t=void 0)=>{n!==u&&("object"==typeof F?b(n,F,t):j(n,F,t))}}function J(u){return H(void 0,u)}function K(u){return H(null,u)}const M=u=>(F,n=void 0)=>{var t,e;k(F,n),g(F.length>=(null!==(t=u.minLength)&&void 0!==t?t:0),`${p(n)} length is too small: ${F.length} < ${u.minLength}`),g(F.length<=(null!==(e=u.maxLength)&&void 0!==e?e:1/0),`${p(n)} length is too large ${F.length} > ${u.maxLength}`)};function P(u){try{u()}catch(u){return u instanceof Error&&u.message||`${u}`}}function Q(u,F,n=void 0,t={}){return P((()=>b(u,F,n,t)))}function R(u,F,n={},t=void 0){return P((()=>E(u,F,n,t)))}function T(u,F,n={},t=void 0){return P((()=>B(u,F,n,t)))}function X(u,F){return u instanceof Error?u.message:null!=F?F:`${u}`}
|
|
3373
3396
|
//# sourceMappingURL=index.esm.js.map
|
|
3397
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
3398
|
+
/* harmony export */ "assertString", 0, /* binding */ k
|
|
3399
|
+
/* harmony export */ ]);
|
|
3400
|
+
|
|
3374
3401
|
|
|
3375
3402
|
/***/ },
|
|
3376
3403
|
|
|
@@ -8454,7 +8481,7 @@ module.exports = (string, columns, options) => {
|
|
|
8454
8481
|
/***/ },
|
|
8455
8482
|
|
|
8456
8483
|
/***/ 1218
|
|
8457
|
-
(__unused_webpack_module, exports) {
|
|
8484
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
8458
8485
|
|
|
8459
8486
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
8460
8487
|
//
|
|
@@ -8558,7 +8585,7 @@ function isPrimitive(arg) {
|
|
|
8558
8585
|
}
|
|
8559
8586
|
exports.isPrimitive = isPrimitive;
|
|
8560
8587
|
|
|
8561
|
-
exports.isBuffer = Buffer.isBuffer;
|
|
8588
|
+
exports.isBuffer = __webpack_require__(181).Buffer.isBuffer;
|
|
8562
8589
|
|
|
8563
8590
|
function objectToString(o) {
|
|
8564
8591
|
return Object.prototype.toString.call(o);
|
|
@@ -12471,6 +12498,114 @@ const runCallbacks = (callbacks, err, result) => {
|
|
|
12471
12498
|
// eslint-disable-next-line jsdoc/reject-any-type
|
|
12472
12499
|
/** @typedef {any} EXPECTED_ANY */
|
|
12473
12500
|
|
|
12501
|
+
/**
|
|
12502
|
+
* The first pending cache hit is held in these slots (a scheduled tick is
|
|
12503
|
+
* pending iff `firstCallback` is set); later hits from the same synchronous
|
|
12504
|
+
* burst spill into `dispatchQueue` as flat [callback, err, result] triples
|
|
12505
|
+
* and are drained by the same tick. This keeps the common single-hit case
|
|
12506
|
+
* as cheap as a plain `nextTick` while bursts share one tick.
|
|
12507
|
+
* @type {FileSystemCallback<EXPECTED_ANY> | undefined}
|
|
12508
|
+
*/
|
|
12509
|
+
let firstCallback;
|
|
12510
|
+
/** @type {Error | null} */
|
|
12511
|
+
let firstErr = null;
|
|
12512
|
+
/** @type {EXPECTED_ANY} */
|
|
12513
|
+
let firstResult;
|
|
12514
|
+
/** @type {EXPECTED_ANY[]} */
|
|
12515
|
+
let dispatchQueue = [];
|
|
12516
|
+
let dispatchQueueLength = 0;
|
|
12517
|
+
/** @type {EXPECTED_ANY[]} */
|
|
12518
|
+
let spareQueue = [];
|
|
12519
|
+
// upper bound on the spill-array capacity kept alive between bursts
|
|
12520
|
+
const MAX_RETAINED_QUEUE_LENGTH = 1024;
|
|
12521
|
+
|
|
12522
|
+
const runDispatch = () => {
|
|
12523
|
+
const callback = /** @type {FileSystemCallback<EXPECTED_ANY>} */ (
|
|
12524
|
+
firstCallback
|
|
12525
|
+
);
|
|
12526
|
+
const err = firstErr;
|
|
12527
|
+
const result = firstResult;
|
|
12528
|
+
// clear before calling: hits made from inside a callback start a new tick
|
|
12529
|
+
firstCallback = undefined;
|
|
12530
|
+
firstErr = null;
|
|
12531
|
+
firstResult = undefined;
|
|
12532
|
+
if (dispatchQueueLength === 0) {
|
|
12533
|
+
// single hit: no queue bookkeeping, a throw affects nobody else
|
|
12534
|
+
callback(err, result);
|
|
12535
|
+
return;
|
|
12536
|
+
}
|
|
12537
|
+
const queue = dispatchQueue;
|
|
12538
|
+
const length = dispatchQueueLength;
|
|
12539
|
+
// ping-pong the two arrays so draining never allocates
|
|
12540
|
+
dispatchQueue = spareQueue;
|
|
12541
|
+
dispatchQueueLength = 0;
|
|
12542
|
+
let i = -3;
|
|
12543
|
+
try {
|
|
12544
|
+
callback(err, result);
|
|
12545
|
+
for (i = 0; i < length; i += 3) {
|
|
12546
|
+
queue[i](queue[i + 1], queue[i + 2]);
|
|
12547
|
+
}
|
|
12548
|
+
} finally {
|
|
12549
|
+
// a throwing callback must not starve the rest: re-schedule the
|
|
12550
|
+
// remainder ahead of anything scheduled during this drain (matching
|
|
12551
|
+
// the old per-tick FIFO order) and rethrow
|
|
12552
|
+
i += 3;
|
|
12553
|
+
if (i < length) {
|
|
12554
|
+
if (firstCallback === undefined) {
|
|
12555
|
+
// no reentrant hit took the slot, so `dispatchQueue` is empty
|
|
12556
|
+
firstCallback = queue[i];
|
|
12557
|
+
firstErr = queue[i + 1];
|
|
12558
|
+
firstResult = queue[i + 2];
|
|
12559
|
+
nextTick(runDispatch);
|
|
12560
|
+
for (let j = i + 3; j < length; j++) {
|
|
12561
|
+
dispatchQueue[dispatchQueueLength++] = queue[j];
|
|
12562
|
+
}
|
|
12563
|
+
} else {
|
|
12564
|
+
// a reentrant hit claimed the slot (and scheduled the tick);
|
|
12565
|
+
// displace it behind the remainder to keep FIFO order
|
|
12566
|
+
const rest = queue.slice(i, length);
|
|
12567
|
+
rest.push(firstCallback, firstErr, firstResult);
|
|
12568
|
+
for (let j = 0; j < dispatchQueueLength; j++) {
|
|
12569
|
+
rest.push(dispatchQueue[j]);
|
|
12570
|
+
}
|
|
12571
|
+
[firstCallback, firstErr, firstResult] = rest;
|
|
12572
|
+
dispatchQueue = rest.slice(3);
|
|
12573
|
+
dispatchQueueLength = dispatchQueue.length;
|
|
12574
|
+
}
|
|
12575
|
+
}
|
|
12576
|
+
// release references but keep the backing store, so the next burst
|
|
12577
|
+
// does not have to re-grow the array from scratch
|
|
12578
|
+
for (let j = 0; j < length; j++) queue[j] = undefined;
|
|
12579
|
+
// bound the permanently retained capacity after a rare giant burst
|
|
12580
|
+
if (queue.length > MAX_RETAINED_QUEUE_LENGTH) {
|
|
12581
|
+
queue.length = MAX_RETAINED_QUEUE_LENGTH;
|
|
12582
|
+
}
|
|
12583
|
+
spareQueue = queue;
|
|
12584
|
+
}
|
|
12585
|
+
};
|
|
12586
|
+
|
|
12587
|
+
/**
|
|
12588
|
+
* Cache hits stay asynchronous, but all hits from the same synchronous
|
|
12589
|
+
* execution share a single `nextTick` instead of scheduling one each.
|
|
12590
|
+
* @param {FileSystemCallback<EXPECTED_ANY>} callback callback
|
|
12591
|
+
* @param {Error | null} err error
|
|
12592
|
+
* @param {EXPECTED_ANY} result result
|
|
12593
|
+
*/
|
|
12594
|
+
const scheduleDispatch = (callback, err, result) => {
|
|
12595
|
+
if (firstCallback === undefined) {
|
|
12596
|
+
firstCallback = callback;
|
|
12597
|
+
firstErr = err;
|
|
12598
|
+
firstResult = result;
|
|
12599
|
+
nextTick(runDispatch);
|
|
12600
|
+
} else {
|
|
12601
|
+
const queue = dispatchQueue;
|
|
12602
|
+
queue[dispatchQueueLength] = callback;
|
|
12603
|
+
queue[dispatchQueueLength + 1] = err;
|
|
12604
|
+
queue[dispatchQueueLength + 2] = result;
|
|
12605
|
+
dispatchQueueLength += 3;
|
|
12606
|
+
}
|
|
12607
|
+
};
|
|
12608
|
+
|
|
12474
12609
|
class OperationMergerBackend {
|
|
12475
12610
|
/**
|
|
12476
12611
|
* @param {EXPECTED_FUNCTION | undefined} provider async method in filesystem
|
|
@@ -12671,8 +12806,10 @@ class CacheBackend {
|
|
|
12671
12806
|
// Check in cache
|
|
12672
12807
|
const cacheEntry = this._data.get(strPath);
|
|
12673
12808
|
if (cacheEntry !== undefined) {
|
|
12674
|
-
if (cacheEntry.err)
|
|
12675
|
-
|
|
12809
|
+
if (cacheEntry.err) {
|
|
12810
|
+
return scheduleDispatch(callback, cacheEntry.err, undefined);
|
|
12811
|
+
}
|
|
12812
|
+
return scheduleDispatch(callback, null, cacheEntry.result);
|
|
12676
12813
|
}
|
|
12677
12814
|
|
|
12678
12815
|
// Check if there is already the same operation running
|
|
@@ -12774,9 +12911,10 @@ class CacheBackend {
|
|
|
12774
12911
|
|
|
12775
12912
|
/**
|
|
12776
12913
|
* @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set<string | URL | Buffer | number>)=} what what to purge
|
|
12914
|
+
* @param {{ exact?: boolean }=} options options; `exact: true` removes only entries whose key matches `what` exactly instead of any entry whose key starts with `what`
|
|
12777
12915
|
*/
|
|
12778
|
-
purge(what) {
|
|
12779
|
-
if (
|
|
12916
|
+
purge(what, options) {
|
|
12917
|
+
if (what === undefined || what === null) {
|
|
12780
12918
|
if (this._mode !== STORAGE_MODE_IDLE) {
|
|
12781
12919
|
this._data.clear();
|
|
12782
12920
|
for (const level of this._levels) {
|
|
@@ -12784,13 +12922,56 @@ class CacheBackend {
|
|
|
12784
12922
|
}
|
|
12785
12923
|
this._enterIdleMode();
|
|
12786
12924
|
}
|
|
12787
|
-
|
|
12925
|
+
return;
|
|
12926
|
+
}
|
|
12927
|
+
const exact =
|
|
12928
|
+
options !== undefined && options !== null && options.exact === true;
|
|
12929
|
+
if (exact) {
|
|
12930
|
+
if (
|
|
12931
|
+
typeof what === "string" ||
|
|
12932
|
+
Buffer.isBuffer(what) ||
|
|
12933
|
+
what instanceof URL ||
|
|
12934
|
+
typeof what === "number"
|
|
12935
|
+
) {
|
|
12936
|
+
const strWhat = typeof what !== "string" ? what.toString() : what;
|
|
12937
|
+
const data = this._data.get(strWhat);
|
|
12938
|
+
if (data !== undefined) {
|
|
12939
|
+
this._data.delete(strWhat);
|
|
12940
|
+
data.level.delete(strWhat);
|
|
12941
|
+
}
|
|
12942
|
+
} else {
|
|
12943
|
+
for (const item of what) {
|
|
12944
|
+
const strItem = typeof item !== "string" ? item.toString() : item;
|
|
12945
|
+
const data = this._data.get(strItem);
|
|
12946
|
+
if (data !== undefined) {
|
|
12947
|
+
this._data.delete(strItem);
|
|
12948
|
+
data.level.delete(strItem);
|
|
12949
|
+
}
|
|
12950
|
+
}
|
|
12951
|
+
}
|
|
12952
|
+
if (this._data.size === 0) {
|
|
12953
|
+
this._enterIdleMode();
|
|
12954
|
+
}
|
|
12955
|
+
return;
|
|
12956
|
+
}
|
|
12957
|
+
if (
|
|
12788
12958
|
typeof what === "string" ||
|
|
12789
12959
|
Buffer.isBuffer(what) ||
|
|
12790
12960
|
what instanceof URL ||
|
|
12791
12961
|
typeof what === "number"
|
|
12792
12962
|
) {
|
|
12793
12963
|
const strWhat = typeof what !== "string" ? what.toString() : what;
|
|
12964
|
+
if (strWhat === "") {
|
|
12965
|
+
// empty string is a prefix of every key — short-circuit the O(n) scan
|
|
12966
|
+
if (this._mode !== STORAGE_MODE_IDLE) {
|
|
12967
|
+
this._data.clear();
|
|
12968
|
+
for (const level of this._levels) {
|
|
12969
|
+
level.clear();
|
|
12970
|
+
}
|
|
12971
|
+
this._enterIdleMode();
|
|
12972
|
+
}
|
|
12973
|
+
return;
|
|
12974
|
+
}
|
|
12794
12975
|
for (const [key, data] of this._data) {
|
|
12795
12976
|
if (key.startsWith(strWhat)) {
|
|
12796
12977
|
this._data.delete(key);
|
|
@@ -12821,7 +13002,7 @@ class CacheBackend {
|
|
|
12821
13002
|
* @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set<string | URL | Buffer | number>)=} what what to purge
|
|
12822
13003
|
*/
|
|
12823
13004
|
purgeParent(what) {
|
|
12824
|
-
if (
|
|
13005
|
+
if (what === undefined || what === null) {
|
|
12825
13006
|
this.purge();
|
|
12826
13007
|
} else if (
|
|
12827
13008
|
typeof what === "string" ||
|
|
@@ -13080,15 +13261,20 @@ module.exports = class CachedInputFileSystem {
|
|
|
13080
13261
|
|
|
13081
13262
|
/**
|
|
13082
13263
|
* @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set<string | URL | Buffer | number>)=} what what to purge
|
|
13264
|
+
* @param {{ exact?: boolean }=} options options; `exact: true` removes only cache entries whose key matches `what` exactly instead of any entry whose key starts with `what`
|
|
13083
13265
|
*/
|
|
13084
|
-
purge(what) {
|
|
13085
|
-
this._statBackend.purge(what);
|
|
13086
|
-
this._lstatBackend.purge(what);
|
|
13087
|
-
|
|
13088
|
-
|
|
13089
|
-
|
|
13090
|
-
|
|
13091
|
-
|
|
13266
|
+
purge(what, options) {
|
|
13267
|
+
this._statBackend.purge(what, options);
|
|
13268
|
+
this._lstatBackend.purge(what, options);
|
|
13269
|
+
if (options !== undefined && options !== null && options.exact === true) {
|
|
13270
|
+
this._readdirBackend.purge(what, options);
|
|
13271
|
+
} else {
|
|
13272
|
+
this._readdirBackend.purgeParent(what);
|
|
13273
|
+
}
|
|
13274
|
+
this._readFileBackend.purge(what, options);
|
|
13275
|
+
this._readlinkBackend.purge(what, options);
|
|
13276
|
+
this._readJsonBackend.purge(what, options);
|
|
13277
|
+
this._realpathBackend.purge(what, options);
|
|
13092
13278
|
}
|
|
13093
13279
|
};
|
|
13094
13280
|
|
|
@@ -13344,6 +13530,7 @@ module.exports = class DescriptionFilePlugin {
|
|
|
13344
13530
|
|
|
13345
13531
|
|
|
13346
13532
|
const forEachBail = __webpack_require__(8048);
|
|
13533
|
+
const { decodeText } = __webpack_require__(1912);
|
|
13347
13534
|
|
|
13348
13535
|
/** @typedef {import("./Resolver")} Resolver */
|
|
13349
13536
|
/** @typedef {import("./Resolver").JsonObject} JsonObject */
|
|
@@ -13498,7 +13685,7 @@ function loadDescriptionFile(
|
|
|
13498
13685
|
|
|
13499
13686
|
if (content) {
|
|
13500
13687
|
try {
|
|
13501
|
-
json = JSON.parse(content
|
|
13688
|
+
json = JSON.parse(decodeText(content));
|
|
13502
13689
|
} catch (/** @type {unknown} */ err_) {
|
|
13503
13690
|
return onJson(/** @type {Error} */ (err_));
|
|
13504
13691
|
}
|
|
@@ -13680,12 +13867,14 @@ module.exports = class ExportsFieldPlugin {
|
|
|
13680
13867
|
* @param {Set<string>} conditionNames condition names
|
|
13681
13868
|
* @param {string | string[]} fieldNamePath name path
|
|
13682
13869
|
* @param {string | ResolveStepHook} target target
|
|
13870
|
+
* @param {boolean=} restrictions whether `restrictions` are configured (enables exports-target fallback when a target is filtered out)
|
|
13683
13871
|
*/
|
|
13684
|
-
constructor(source, conditionNames, fieldNamePath, target) {
|
|
13872
|
+
constructor(source, conditionNames, fieldNamePath, target, restrictions) {
|
|
13685
13873
|
this.source = source;
|
|
13686
13874
|
this.target = target;
|
|
13687
13875
|
this.conditionNames = conditionNames;
|
|
13688
13876
|
this.fieldName = fieldNamePath;
|
|
13877
|
+
this.restrictions = Boolean(restrictions);
|
|
13689
13878
|
// `null` is cached for description files that have no exports field,
|
|
13690
13879
|
// so subsequent resolves against the same package.json skip the
|
|
13691
13880
|
// `DescriptionFileUtils.getField` walk entirely.
|
|
@@ -13789,6 +13978,13 @@ module.exports = class ExportsFieldPlugin {
|
|
|
13789
13978
|
);
|
|
13790
13979
|
}
|
|
13791
13980
|
|
|
13981
|
+
// When `restrictions` are configured, share a marker down the
|
|
13982
|
+
// chain so RestrictionsPlugin can tell us it filtered out an
|
|
13983
|
+
// otherwise-valid target — then we fall back instead of erroring.
|
|
13984
|
+
const restrictionsMarker = this.restrictions
|
|
13985
|
+
? { blocked: false }
|
|
13986
|
+
: undefined;
|
|
13987
|
+
|
|
13792
13988
|
forEachBail(
|
|
13793
13989
|
paths,
|
|
13794
13990
|
/**
|
|
@@ -13844,6 +14040,12 @@ module.exports = class ExportsFieldPlugin {
|
|
|
13844
14040
|
query,
|
|
13845
14041
|
fragment,
|
|
13846
14042
|
};
|
|
14043
|
+
// Attach the marker only when restrictions are configured, so
|
|
14044
|
+
// resolves without restrictions keep their request shape and
|
|
14045
|
+
// never leak the property onto the result.
|
|
14046
|
+
if (restrictionsMarker) {
|
|
14047
|
+
obj.__restrictionsMarker = restrictionsMarker;
|
|
14048
|
+
}
|
|
13847
14049
|
|
|
13848
14050
|
resolver.doResolve(
|
|
13849
14051
|
target,
|
|
@@ -13871,12 +14073,19 @@ module.exports = class ExportsFieldPlugin {
|
|
|
13871
14073
|
// is a hard error, not a signal to continue searching up the directory tree.
|
|
13872
14074
|
// See: https://github.com/webpack/enhanced-resolve/issues/399
|
|
13873
14075
|
if (!result) {
|
|
14076
|
+
// Exception: the target existed but `restrictions` filtered it
|
|
14077
|
+
// out — return no result so the next `modules` entry is tried.
|
|
14078
|
+
if (restrictionsMarker && restrictionsMarker.blocked) {
|
|
14079
|
+
return callback(null, null);
|
|
14080
|
+
}
|
|
13874
14081
|
return callback(
|
|
13875
14082
|
new Error(
|
|
13876
14083
|
`Package path ${remainingRequest} is exported from package ${request.descriptionFileRoot}, but no valid target file was found (see exports field in ${request.descriptionFilePath})`,
|
|
13877
14084
|
),
|
|
13878
14085
|
);
|
|
13879
14086
|
}
|
|
14087
|
+
// Drop the internal marker before it reaches the result.
|
|
14088
|
+
if (restrictionsMarker) delete result.__restrictionsMarker;
|
|
13880
14089
|
callback(null, result);
|
|
13881
14090
|
},
|
|
13882
14091
|
);
|
|
@@ -14007,6 +14216,14 @@ module.exports = class ExtensionAliasPlugin {
|
|
|
14007
14216
|
const stoppingCallback = (err, result) => {
|
|
14008
14217
|
if (err) return callback(err);
|
|
14009
14218
|
if (result) return callback(null, result);
|
|
14219
|
+
// Listing the source extension among its own aliases keeps the
|
|
14220
|
+
// original request valid, so it must still be resolvable in its
|
|
14221
|
+
// normal (not fully specified) form: as a directory, or with
|
|
14222
|
+
// extensions appended. Only a mapping that drops the source
|
|
14223
|
+
// extension is strict.
|
|
14224
|
+
if (isAliasString ? alias === extension : alias.includes(extension)) {
|
|
14225
|
+
return callback();
|
|
14226
|
+
}
|
|
14010
14227
|
// Don't allow other aliasing or raw request
|
|
14011
14228
|
return callback(null, null);
|
|
14012
14229
|
};
|
|
@@ -14971,18 +15188,25 @@ module.exports = class ParsePlugin {
|
|
|
14971
15188
|
*/
|
|
14972
15189
|
apply(resolver) {
|
|
14973
15190
|
const target = resolver.ensureHook(this.target);
|
|
15191
|
+
const { requestOptions } = this;
|
|
14974
15192
|
resolver
|
|
14975
15193
|
.getHook(this.source)
|
|
14976
15194
|
.tapAsync("ParsePlugin", (request, resolveContext, callback) => {
|
|
14977
15195
|
const parsed = resolver.parse(/** @type {string} */ (request.request));
|
|
14978
15196
|
/** @type {ResolveRequest} */
|
|
14979
|
-
|
|
14980
|
-
|
|
14981
|
-
|
|
14982
|
-
|
|
14983
|
-
|
|
14984
|
-
|
|
14985
|
-
|
|
15197
|
+
// Single spread + direct field assignment instead of
|
|
15198
|
+
// `{ ...request, ...parsed, ...requestOptions }` — avoids
|
|
15199
|
+
// two extra property enumerations on every resolve.
|
|
15200
|
+
// Keep in sync with Resolver.parse() output shape.
|
|
15201
|
+
const obj = { ...request };
|
|
15202
|
+
obj.request = parsed.request;
|
|
15203
|
+
obj.query = parsed.query || request.query || "";
|
|
15204
|
+
obj.fragment = parsed.fragment || request.fragment || "";
|
|
15205
|
+
obj.module = parsed.module;
|
|
15206
|
+
obj.directory = parsed.directory;
|
|
15207
|
+
obj.file = parsed.file;
|
|
15208
|
+
obj.internal = parsed.internal;
|
|
15209
|
+
Object.assign(obj, requestOptions);
|
|
14986
15210
|
if (parsed && resolveContext.log) {
|
|
14987
15211
|
if (parsed.module) resolveContext.log("Parsed request is a module");
|
|
14988
15212
|
if (parsed.directory) {
|
|
@@ -15186,6 +15410,7 @@ const {
|
|
|
15186
15410
|
createCachedJoin,
|
|
15187
15411
|
getType,
|
|
15188
15412
|
normalize,
|
|
15413
|
+
toPath,
|
|
15189
15414
|
} = __webpack_require__(6932);
|
|
15190
15415
|
|
|
15191
15416
|
/* eslint-disable jsdoc/check-alignment */
|
|
@@ -15196,8 +15421,8 @@ const _withResolvers =
|
|
|
15196
15421
|
? /**
|
|
15197
15422
|
* @param {Resolver} self resolver
|
|
15198
15423
|
* @param {Context} context context information object
|
|
15199
|
-
* @param {string} path context path
|
|
15200
|
-
* @param {string} request request string
|
|
15424
|
+
* @param {string | URL} path context path or a `file:` URL instance
|
|
15425
|
+
* @param {string | URL} request request string or a `file:` URL instance
|
|
15201
15426
|
* @param {ResolveContext} resolveContext resolve context
|
|
15202
15427
|
* @returns {Promise<string | false>} result
|
|
15203
15428
|
*/
|
|
@@ -15213,8 +15438,8 @@ const _withResolvers =
|
|
|
15213
15438
|
: /**
|
|
15214
15439
|
* @param {Resolver} self resolver
|
|
15215
15440
|
* @param {Context} context context information object
|
|
15216
|
-
* @param {string} path context path
|
|
15217
|
-
* @param {string} request request string
|
|
15441
|
+
* @param {string | URL} path context path or a `file:` URL instance
|
|
15442
|
+
* @param {string | URL} request request string or a `file:` URL instance
|
|
15218
15443
|
* @param {ResolveContext} resolveContext resolve context
|
|
15219
15444
|
* @returns {Promise<string | false>} result
|
|
15220
15445
|
*/
|
|
@@ -15574,6 +15799,7 @@ const HASH_ESCAPE_RE = /#/g;
|
|
|
15574
15799
|
* @property {string=} __innerRequest inner request for internal usage
|
|
15575
15800
|
* @property {string=} __innerRequest_request inner request for internal usage
|
|
15576
15801
|
* @property {string=} __innerRequest_relativePath inner relative path for internal usage
|
|
15802
|
+
* @property {{ blocked: boolean }=} __restrictionsMarker internal: shared marker `RestrictionsPlugin` flips when it filters out an existing target, letting `ExportsFieldPlugin` fall back instead of erroring
|
|
15577
15803
|
*/
|
|
15578
15804
|
|
|
15579
15805
|
/** @typedef {BaseResolveRequest & Partial<ParsedIdentifier>} ResolveRequest */
|
|
@@ -15862,27 +16088,27 @@ class Resolver {
|
|
|
15862
16088
|
|
|
15863
16089
|
/**
|
|
15864
16090
|
* @overload
|
|
15865
|
-
* @param {string}
|
|
15866
|
-
* @param {string}
|
|
16091
|
+
* @param {string | URL} parent context path or a `file:` URL instance
|
|
16092
|
+
* @param {string | URL} specifier request string or a `file:` URL instance
|
|
15867
16093
|
* @param {ResolveContext=} resolveContext resolve context
|
|
15868
16094
|
* @returns {string | false} result
|
|
15869
16095
|
*/
|
|
15870
16096
|
/**
|
|
15871
16097
|
* @overload
|
|
15872
16098
|
* @param {Context} context context information object
|
|
15873
|
-
* @param {string}
|
|
15874
|
-
* @param {string}
|
|
16099
|
+
* @param {string | URL} parent context path or a `file:` URL instance
|
|
16100
|
+
* @param {string | URL} specifier request string or a `file:` URL instance
|
|
15875
16101
|
* @param {ResolveContext=} resolveContext resolve context
|
|
15876
16102
|
* @returns {string | false} result
|
|
15877
16103
|
*/
|
|
15878
16104
|
/**
|
|
15879
|
-
* @param {Context | string} context context information object or context path when no context is provided
|
|
15880
|
-
* @param {string | ResolveContext=}
|
|
15881
|
-
* @param {string | ResolveContext=}
|
|
16105
|
+
* @param {Context | string | URL} context context information object, or the context path (string or `file:` URL instance) when no context is provided
|
|
16106
|
+
* @param {string | URL | ResolveContext=} parent context path (string or `file:` URL instance) or resolve context when no context is provided
|
|
16107
|
+
* @param {string | URL | ResolveContext=} specifier request string (or `file:` URL instance) or resolve context when no context is provided
|
|
15882
16108
|
* @param {ResolveContext=} resolveContext resolve context
|
|
15883
16109
|
* @returns {string | false} result
|
|
15884
16110
|
*/
|
|
15885
|
-
resolveSync(context,
|
|
16111
|
+
resolveSync(context, parent, specifier, resolveContext) {
|
|
15886
16112
|
/** @type {Error | null | undefined} */
|
|
15887
16113
|
let err;
|
|
15888
16114
|
/** @type {string | false | undefined} */
|
|
@@ -15893,8 +16119,8 @@ class Resolver {
|
|
|
15893
16119
|
// caller supplied a resolveContext.
|
|
15894
16120
|
this.resolve(
|
|
15895
16121
|
/** @type {Context} */ (context),
|
|
15896
|
-
/** @type {string} */ (
|
|
15897
|
-
/** @type {string} */ (
|
|
16122
|
+
/** @type {string} */ (parent),
|
|
16123
|
+
/** @type {string} */ (specifier),
|
|
15898
16124
|
/** @type {ResolveContext} */ (resolveContext) || {},
|
|
15899
16125
|
(_err, r) => {
|
|
15900
16126
|
err = _err;
|
|
@@ -15914,49 +16140,49 @@ class Resolver {
|
|
|
15914
16140
|
|
|
15915
16141
|
/**
|
|
15916
16142
|
* @overload
|
|
15917
|
-
* @param {string}
|
|
15918
|
-
* @param {string}
|
|
16143
|
+
* @param {string | URL} parent context path or a `file:` URL instance
|
|
16144
|
+
* @param {string | URL} specifier request string or a `file:` URL instance
|
|
15919
16145
|
* @param {ResolveContext=} resolveContext resolve context
|
|
15920
16146
|
* @returns {Promise<string | false>} result
|
|
15921
16147
|
*/
|
|
15922
16148
|
/**
|
|
15923
16149
|
* @overload
|
|
15924
16150
|
* @param {Context} context context information object
|
|
15925
|
-
* @param {string}
|
|
15926
|
-
* @param {string}
|
|
16151
|
+
* @param {string | URL} parent context path or a `file:` URL instance
|
|
16152
|
+
* @param {string | URL} specifier request string or a `file:` URL instance
|
|
15927
16153
|
* @param {ResolveContext=} resolveContext resolve context
|
|
15928
16154
|
* @returns {Promise<string | false>} result
|
|
15929
16155
|
*/
|
|
15930
16156
|
/**
|
|
15931
|
-
* @param {Context | string} context context information object or context path when no context is provided
|
|
15932
|
-
* @param {string | ResolveContext=}
|
|
15933
|
-
* @param {string | ResolveContext=}
|
|
16157
|
+
* @param {Context | string | URL} context context information object, or the context path (string or `file:` URL instance) when no context is provided
|
|
16158
|
+
* @param {string | URL | ResolveContext=} parent context path (string or `file:` URL instance) or resolve context when no context is provided
|
|
16159
|
+
* @param {string | URL | ResolveContext=} specifier request string (or `file:` URL instance) or resolve context when no context is provided
|
|
15934
16160
|
* @param {ResolveContext=} resolveContext resolve context
|
|
15935
16161
|
* @returns {Promise<string | false>} result
|
|
15936
16162
|
*/
|
|
15937
|
-
resolvePromise(context,
|
|
16163
|
+
resolvePromise(context, parent, specifier, resolveContext) {
|
|
15938
16164
|
// `|| {}` ensures the 5-arg fast path inside `resolve()` is reached
|
|
15939
16165
|
// even when the caller doesn't pass a resolveContext.
|
|
15940
16166
|
return _withResolvers(
|
|
15941
16167
|
this,
|
|
15942
16168
|
/** @type {Context} */ (context),
|
|
15943
|
-
/** @type {string} */ (
|
|
15944
|
-
/** @type {string} */ (
|
|
16169
|
+
/** @type {string} */ (parent),
|
|
16170
|
+
/** @type {string} */ (specifier),
|
|
15945
16171
|
/** @type {ResolveContext} */ (resolveContext) || {},
|
|
15946
16172
|
);
|
|
15947
16173
|
}
|
|
15948
16174
|
|
|
15949
16175
|
/**
|
|
15950
16176
|
* @overload
|
|
15951
|
-
* @param {string}
|
|
15952
|
-
* @param {string}
|
|
16177
|
+
* @param {string | URL} parent context path or a `file:` URL instance
|
|
16178
|
+
* @param {string | URL} specifier request string or a `file:` URL instance
|
|
15953
16179
|
* @param {ResolveCallback} callback callback function
|
|
15954
16180
|
* @returns {void}
|
|
15955
16181
|
*/
|
|
15956
16182
|
/**
|
|
15957
16183
|
* @overload
|
|
15958
|
-
* @param {string}
|
|
15959
|
-
* @param {string}
|
|
16184
|
+
* @param {string | URL} parent context path or a `file:` URL instance
|
|
16185
|
+
* @param {string | URL} specifier request string or a `file:` URL instance
|
|
15960
16186
|
* @param {ResolveContext} resolveContext resolve context
|
|
15961
16187
|
* @param {ResolveCallback} callback callback function
|
|
15962
16188
|
* @returns {void}
|
|
@@ -15964,29 +16190,29 @@ class Resolver {
|
|
|
15964
16190
|
/**
|
|
15965
16191
|
* @overload
|
|
15966
16192
|
* @param {Context} context context information object
|
|
15967
|
-
* @param {string}
|
|
15968
|
-
* @param {string}
|
|
16193
|
+
* @param {string | URL} parent context path or a `file:` URL instance
|
|
16194
|
+
* @param {string | URL} specifier request string or a `file:` URL instance
|
|
15969
16195
|
* @param {ResolveCallback} callback callback function
|
|
15970
16196
|
* @returns {void}
|
|
15971
16197
|
*/
|
|
15972
16198
|
/**
|
|
15973
16199
|
* @overload
|
|
15974
16200
|
* @param {Context} context context information object
|
|
15975
|
-
* @param {string}
|
|
15976
|
-
* @param {string}
|
|
16201
|
+
* @param {string | URL} parent context path or a `file:` URL instance
|
|
16202
|
+
* @param {string | URL} specifier request string or a `file:` URL instance
|
|
15977
16203
|
* @param {ResolveContext} resolveContext resolve context
|
|
15978
16204
|
* @param {ResolveCallback} callback callback function
|
|
15979
16205
|
* @returns {void}
|
|
15980
16206
|
*/
|
|
15981
16207
|
/**
|
|
15982
|
-
* @param {Context | string} context context information object or context path when no context is provided
|
|
15983
|
-
* @param {string | ResolveContext | ResolveCallback=}
|
|
15984
|
-
* @param {string | ResolveContext | ResolveCallback=}
|
|
16208
|
+
* @param {Context | string | URL} context context information object, or the context path (string or `file:` URL instance) when no context is provided
|
|
16209
|
+
* @param {string | URL | ResolveContext | ResolveCallback=} parent context path (string or `file:` URL instance) or (when no context) resolve context or callback
|
|
16210
|
+
* @param {string | URL | ResolveContext | ResolveCallback=} specifier request string (or `file:` URL instance) or (when no context) resolve context or callback
|
|
15985
16211
|
* @param {ResolveContext | ResolveCallback=} resolveContext resolve context or callback when no resolve context is provided
|
|
15986
16212
|
* @param {ResolveCallback=} callback callback function
|
|
15987
16213
|
* @returns {void}
|
|
15988
16214
|
*/
|
|
15989
|
-
resolve(context,
|
|
16215
|
+
resolve(context, parent, specifier, resolveContext, callback) {
|
|
15990
16216
|
// Fast path for the common 5-arg call (`resolver.resolve(ctx, from,
|
|
15991
16217
|
// req, resolveCtx, cb)`) — every call from `resolveSync` /
|
|
15992
16218
|
// `resolvePromise` plus the vast majority of direct API callers.
|
|
@@ -16005,8 +16231,9 @@ class Resolver {
|
|
|
16005
16231
|
// proceed straight to per-arg validation below
|
|
16006
16232
|
} else {
|
|
16007
16233
|
// Slow path: shift positional args based on what was supplied.
|
|
16008
|
-
// Shift when context is omitted (first positional arg is the
|
|
16009
|
-
|
|
16234
|
+
// Shift when context is omitted (first positional arg is the parent,
|
|
16235
|
+
// either a string or a `file:` URL instance).
|
|
16236
|
+
if (typeof context === "string" || context instanceof URL) {
|
|
16010
16237
|
// Keep an already-supplied callback (resolveSync / resolvePromise
|
|
16011
16238
|
// always pass one in the 5th position).
|
|
16012
16239
|
if (typeof callback !== "function") {
|
|
@@ -16015,9 +16242,11 @@ class Resolver {
|
|
|
16015
16242
|
);
|
|
16016
16243
|
}
|
|
16017
16244
|
resolveContext =
|
|
16018
|
-
/** @type {ResolveContext | ResolveCallback | undefined} */ (
|
|
16019
|
-
|
|
16020
|
-
|
|
16245
|
+
/** @type {ResolveContext | ResolveCallback | undefined} */ (
|
|
16246
|
+
specifier
|
|
16247
|
+
);
|
|
16248
|
+
specifier = /** @type {string} */ (parent);
|
|
16249
|
+
parent = context;
|
|
16021
16250
|
context = {};
|
|
16022
16251
|
}
|
|
16023
16252
|
// 4-arg form: the resolveContext slot holds the callback.
|
|
@@ -16034,18 +16263,24 @@ class Resolver {
|
|
|
16034
16263
|
context = {};
|
|
16035
16264
|
}
|
|
16036
16265
|
}
|
|
16037
|
-
|
|
16038
|
-
|
|
16266
|
+
// Accept `file:` URL instances for parent/specifier, converting to a
|
|
16267
|
+
// filesystem path (mirrors the URL support in resolve options). The
|
|
16268
|
+
// `instanceof` check sits on the error branch, so the common string
|
|
16269
|
+
// case keeps its single `typeof` check on this hot path.
|
|
16270
|
+
if (typeof parent !== "string") {
|
|
16271
|
+
if (parent instanceof URL) parent = toPath(parent);
|
|
16272
|
+
else return callback(new Error("path argument is not a string"));
|
|
16039
16273
|
}
|
|
16040
|
-
if (typeof
|
|
16041
|
-
|
|
16274
|
+
if (typeof specifier !== "string") {
|
|
16275
|
+
if (specifier instanceof URL) specifier = toPath(specifier);
|
|
16276
|
+
else return callback(new Error("request argument is not a string"));
|
|
16042
16277
|
}
|
|
16043
16278
|
|
|
16044
16279
|
/** @type {ResolveRequest} */
|
|
16045
16280
|
const obj = {
|
|
16046
16281
|
context,
|
|
16047
|
-
path,
|
|
16048
|
-
request,
|
|
16282
|
+
path: parent,
|
|
16283
|
+
request: specifier,
|
|
16049
16284
|
};
|
|
16050
16285
|
|
|
16051
16286
|
/** @type {ResolveContextYield | undefined} */
|
|
@@ -16074,8 +16309,6 @@ class Resolver {
|
|
|
16074
16309
|
};
|
|
16075
16310
|
}
|
|
16076
16311
|
|
|
16077
|
-
const message = `resolve '${request}' in '${path}'`;
|
|
16078
|
-
|
|
16079
16312
|
/**
|
|
16080
16313
|
* @param {ResolveRequest} result result
|
|
16081
16314
|
* @returns {void}
|
|
@@ -16103,10 +16336,11 @@ class Resolver {
|
|
|
16103
16336
|
};
|
|
16104
16337
|
|
|
16105
16338
|
/**
|
|
16339
|
+
* @param {string} message resolve message
|
|
16106
16340
|
* @param {string[]} log logs
|
|
16107
16341
|
* @returns {void}
|
|
16108
16342
|
*/
|
|
16109
|
-
const finishWithoutResolve = (log) => {
|
|
16343
|
+
const finishWithoutResolve = (message, log) => {
|
|
16110
16344
|
/**
|
|
16111
16345
|
* @type {ErrorWithDetail}
|
|
16112
16346
|
*/
|
|
@@ -16117,6 +16351,7 @@ class Resolver {
|
|
|
16117
16351
|
};
|
|
16118
16352
|
|
|
16119
16353
|
if (resolveContext.log) {
|
|
16354
|
+
const message = `resolve '${specifier}' in '${parent}'`;
|
|
16120
16355
|
// We need log anyway to capture it in case of an error
|
|
16121
16356
|
const parentLog = resolveContext.log;
|
|
16122
16357
|
/** @type {string[]} */
|
|
@@ -16147,66 +16382,68 @@ class Resolver {
|
|
|
16147
16382
|
|
|
16148
16383
|
if (result) return finishResolved(result);
|
|
16149
16384
|
|
|
16150
|
-
return finishWithoutResolve(log);
|
|
16385
|
+
return finishWithoutResolve(message, log);
|
|
16151
16386
|
},
|
|
16152
16387
|
);
|
|
16153
16388
|
}
|
|
16154
16389
|
// Try to resolve assuming there is no error
|
|
16155
16390
|
// We don't log stuff in this case
|
|
16156
|
-
|
|
16157
|
-
|
|
16158
|
-
|
|
16159
|
-
|
|
16160
|
-
|
|
16161
|
-
|
|
16162
|
-
|
|
16163
|
-
|
|
16164
|
-
|
|
16165
|
-
|
|
16166
|
-
|
|
16167
|
-
|
|
16168
|
-
(err, result) => {
|
|
16169
|
-
if (err) return callback(err);
|
|
16170
|
-
|
|
16171
|
-
if (yieldCalled || (result && yield_)) {
|
|
16172
|
-
return /** @type {ResolveContextYield} */ (finishYield)(
|
|
16173
|
-
/** @type {ResolveRequest} */ (result),
|
|
16174
|
-
);
|
|
16391
|
+
// When there is no yield wrapper, the caller's resolveContext can
|
|
16392
|
+
// be passed directly — its `log` is already falsy (we are in the
|
|
16393
|
+
// !log branch) and `yield` is undefined, so a fresh wrapper would
|
|
16394
|
+
// be an identical copy.
|
|
16395
|
+
const rc = yield_
|
|
16396
|
+
? {
|
|
16397
|
+
log: undefined,
|
|
16398
|
+
yield: yield_,
|
|
16399
|
+
fileDependencies: resolveContext.fileDependencies,
|
|
16400
|
+
contextDependencies: resolveContext.contextDependencies,
|
|
16401
|
+
missingDependencies: resolveContext.missingDependencies,
|
|
16402
|
+
stack: resolveContext.stack,
|
|
16175
16403
|
}
|
|
16404
|
+
: resolveContext;
|
|
16405
|
+
return this.doResolve(this.hooks.resolve, obj, null, rc, (err, result) => {
|
|
16406
|
+
if (err) return callback(err);
|
|
16176
16407
|
|
|
16177
|
-
|
|
16408
|
+
if (yieldCalled || (result && yield_)) {
|
|
16409
|
+
return /** @type {ResolveContextYield} */ (finishYield)(
|
|
16410
|
+
/** @type {ResolveRequest} */ (result),
|
|
16411
|
+
);
|
|
16412
|
+
}
|
|
16178
16413
|
|
|
16179
|
-
|
|
16180
|
-
// so we redo the resolving for the log info
|
|
16181
|
-
// this is more expensive to the success case
|
|
16182
|
-
// is assumed by default
|
|
16183
|
-
/** @type {string[]} */
|
|
16184
|
-
const log = [];
|
|
16414
|
+
if (result) return finishResolved(result);
|
|
16185
16415
|
|
|
16186
|
-
|
|
16187
|
-
|
|
16188
|
-
|
|
16189
|
-
|
|
16190
|
-
|
|
16191
|
-
|
|
16192
|
-
|
|
16193
|
-
stack: resolveContext.stack,
|
|
16194
|
-
},
|
|
16195
|
-
(err, result) => {
|
|
16196
|
-
if (err) return callback(err);
|
|
16416
|
+
// log is missing for the error details
|
|
16417
|
+
// so we redo the resolving for the log info
|
|
16418
|
+
// this is more expensive to the success case
|
|
16419
|
+
// is assumed by default
|
|
16420
|
+
const message = `resolve '${specifier}' in '${parent}'`;
|
|
16421
|
+
/** @type {string[]} */
|
|
16422
|
+
const log = [];
|
|
16197
16423
|
|
|
16198
|
-
|
|
16199
|
-
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
|
|
16203
|
-
|
|
16424
|
+
return this.doResolve(
|
|
16425
|
+
this.hooks.resolve,
|
|
16426
|
+
obj,
|
|
16427
|
+
message,
|
|
16428
|
+
{
|
|
16429
|
+
log: (msg) => log.push(msg),
|
|
16430
|
+
yield: yield_,
|
|
16431
|
+
stack: resolveContext.stack,
|
|
16432
|
+
},
|
|
16433
|
+
(err, result) => {
|
|
16434
|
+
if (err) return callback(err);
|
|
16204
16435
|
|
|
16205
|
-
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
|
|
16209
|
-
|
|
16436
|
+
// In a case that there is a race condition and yield will be called
|
|
16437
|
+
if (yieldCalled || (result && yield_)) {
|
|
16438
|
+
return /** @type {ResolveContextYield} */ (finishYield)(
|
|
16439
|
+
/** @type {ResolveRequest} */ (result),
|
|
16440
|
+
);
|
|
16441
|
+
}
|
|
16442
|
+
|
|
16443
|
+
return finishWithoutResolve(message, log);
|
|
16444
|
+
},
|
|
16445
|
+
);
|
|
16446
|
+
});
|
|
16210
16447
|
}
|
|
16211
16448
|
|
|
16212
16449
|
/**
|
|
@@ -16266,11 +16503,19 @@ class Resolver {
|
|
|
16266
16503
|
this.hooks.resolveStep.call(hook, request);
|
|
16267
16504
|
|
|
16268
16505
|
if (hook.isUsed()) {
|
|
16269
|
-
//
|
|
16270
|
-
//
|
|
16271
|
-
//
|
|
16272
|
-
//
|
|
16273
|
-
|
|
16506
|
+
// No-log fast path: when the context was created internally
|
|
16507
|
+
// (stack is already a StackEntry from a prior doResolve), we
|
|
16508
|
+
// can mutate stack in-place and restore it in the callback,
|
|
16509
|
+
// avoiding the createInnerContext allocation entirely.
|
|
16510
|
+
if (!resolveContext.log && rawStack instanceof StackEntry) {
|
|
16511
|
+
resolveContext.stack = stackEntry;
|
|
16512
|
+
return hook.callAsync(request, resolveContext, (err, result) => {
|
|
16513
|
+
resolveContext.stack = rawStack;
|
|
16514
|
+
if (err) return callback(err);
|
|
16515
|
+
if (result) return callback(null, result);
|
|
16516
|
+
callback();
|
|
16517
|
+
});
|
|
16518
|
+
}
|
|
16274
16519
|
const innerContext = createInnerContext(
|
|
16275
16520
|
resolveContext,
|
|
16276
16521
|
stackEntry,
|
|
@@ -16442,7 +16687,7 @@ const TryNextPlugin = __webpack_require__(9413);
|
|
|
16442
16687
|
const TsconfigPathsPlugin = __webpack_require__(528);
|
|
16443
16688
|
const UnsafeCachePlugin = __webpack_require__(3177);
|
|
16444
16689
|
const UseFilePlugin = __webpack_require__(492);
|
|
16445
|
-
const { PathType, getType } = __webpack_require__(6932);
|
|
16690
|
+
const { PathType, getType, toPath } = __webpack_require__(6932);
|
|
16446
16691
|
|
|
16447
16692
|
/** @typedef {import("./AliasPlugin").AliasOption} AliasOptionEntry */
|
|
16448
16693
|
/** @typedef {import("./ExtensionAliasPlugin").ExtensionAliasOption} ExtensionAliasOption */
|
|
@@ -16456,6 +16701,9 @@ const { PathType, getType } = __webpack_require__(6932);
|
|
|
16456
16701
|
|
|
16457
16702
|
/** @typedef {string | string[] | false} AliasOptionNewRequest */
|
|
16458
16703
|
/** @typedef {{ [k: string]: AliasOptionNewRequest }} AliasOptions */
|
|
16704
|
+
/** @typedef {string | URL | (string | URL)[] | false} UserAliasOptionNewRequest */
|
|
16705
|
+
/** @typedef {{ [k: string]: UserAliasOptionNewRequest }} UserAliasOptions */
|
|
16706
|
+
/** @typedef {{ alias: UserAliasOptionNewRequest, name: string, onlyModule?: boolean }} UserAliasOptionEntry */
|
|
16459
16707
|
/** @typedef {{ [k: string]: string | string[] }} ExtensionAliasOptions */
|
|
16460
16708
|
/** @typedef {false | 0 | "" | null | undefined} Falsy */
|
|
16461
16709
|
/** @typedef {{ apply: (resolver: Resolver) => void } | ((this: Resolver, resolver: Resolver) => void) | Falsy} Plugin */
|
|
@@ -16467,10 +16715,17 @@ const { PathType, getType } = __webpack_require__(6932);
|
|
|
16467
16715
|
* @property {string=} baseUrl Override baseUrl from tsconfig.json. If provided, this value will be used instead of the baseUrl in the tsconfig file
|
|
16468
16716
|
*/
|
|
16469
16717
|
|
|
16718
|
+
/**
|
|
16719
|
+
* @typedef {object} UserTsconfigOptions
|
|
16720
|
+
* @property {(string | URL)=} configFile A path, or `file:` `URL` instance, pointing at the tsconfig file
|
|
16721
|
+
* @property {((string | URL)[] | "auto")=} references References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths or `file:` `URL` instances
|
|
16722
|
+
* @property {(string | URL)=} baseUrl Override baseUrl from tsconfig.json with a path or `file:` `URL` instance
|
|
16723
|
+
*/
|
|
16724
|
+
|
|
16470
16725
|
/**
|
|
16471
16726
|
* @typedef {object} UserResolveOptions
|
|
16472
|
-
* @property {(
|
|
16473
|
-
* @property {(
|
|
16727
|
+
* @property {(UserAliasOptions | UserAliasOptionEntry[])=} alias A list of module alias configurations or an object which maps key to value
|
|
16728
|
+
* @property {(UserAliasOptions | UserAliasOptionEntry[])=} fallback A list of module alias configurations or an object which maps key to value, applied only after modules option
|
|
16474
16729
|
* @property {ExtensionAliasOptions=} extensionAlias An object which maps extension to extension aliases
|
|
16475
16730
|
* @property {boolean=} extensionAliasForExports Also apply `extensionAlias` to paths resolved through the package.json `exports` field. Off by default (Node.js-aligned); when enabled, matches TypeScript's behavior for packages that ship TS sources alongside compiled JS.
|
|
16476
16731
|
* @property {(string | string[])[]=} aliasFields A list of alias fields in description files
|
|
@@ -16486,19 +16741,19 @@ const { PathType, getType } = __webpack_require__(6932);
|
|
|
16486
16741
|
* @property {(Cache | boolean)=} unsafeCache Use this cache object to unsafely cache the successful requests
|
|
16487
16742
|
* @property {boolean=} symlinks Resolve symlinks to their symlinked location
|
|
16488
16743
|
* @property {Resolver=} resolver A prepared Resolver to which the plugins are attached
|
|
16489
|
-
* @property {string[] | string=} modules A list of directories to resolve modules from, can be absolute path or
|
|
16744
|
+
* @property {(string | URL)[] | string | URL=} modules A list of directories to resolve modules from, can be absolute path, folder name, or a `file:` `URL` instance
|
|
16490
16745
|
* @property {(string | string[] | { name: string | string[], forceRelative: boolean })[]=} mainFields A list of main fields in description files
|
|
16491
16746
|
* @property {string[]=} mainFiles A list of main files in directories
|
|
16492
16747
|
* @property {Plugin[]=} plugins A list of additional resolve plugins which should be applied
|
|
16493
16748
|
* @property {PnpApi | null=} pnpApi A PnP API that should be used - null is "never", undefined is "auto"
|
|
16494
|
-
* @property {string[]=} roots A list of root paths
|
|
16749
|
+
* @property {(string | URL)[]=} roots A list of root paths, each an absolute path or a `file:` `URL` instance
|
|
16495
16750
|
* @property {boolean=} fullySpecified The request is already fully specified and no extensions or directories are resolved for it
|
|
16496
16751
|
* @property {boolean=} resolveToContext Resolve to a context instead of a file
|
|
16497
|
-
* @property {(string | RegExp)[]=} restrictions A list of resolve restrictions
|
|
16752
|
+
* @property {(string | URL | RegExp)[]=} restrictions A list of resolve restrictions, each an absolute path, a `file:` `URL` instance, or a RegExp
|
|
16498
16753
|
* @property {boolean=} useSyncFileSystemCalls Use only the sync constraints of the file system calls
|
|
16499
16754
|
* @property {boolean=} preferRelative Prefer to resolve module requests as relative requests before falling back to modules
|
|
16500
16755
|
* @property {boolean=} preferAbsolute Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
|
|
16501
|
-
* @property {string | boolean |
|
|
16756
|
+
* @property {string | URL | boolean | UserTsconfigOptions=} tsconfig TypeScript config file path (or `file:` `URL` instance) or config object with configFile and references
|
|
16502
16757
|
*/
|
|
16503
16758
|
|
|
16504
16759
|
/**
|
|
@@ -16570,23 +16825,69 @@ function processPnpApiOption(option) {
|
|
|
16570
16825
|
}
|
|
16571
16826
|
|
|
16572
16827
|
/**
|
|
16573
|
-
* @param {
|
|
16828
|
+
* @param {UserAliasOptionNewRequest} alias alias target(s)
|
|
16829
|
+
* @returns {AliasOptionNewRequest} target(s) with file `URL` instances converted to paths
|
|
16830
|
+
*/
|
|
16831
|
+
function toPathAlias(alias) {
|
|
16832
|
+
if (alias === false) return false;
|
|
16833
|
+
return Array.isArray(alias) ? alias.map(toPath) : toPath(alias);
|
|
16834
|
+
}
|
|
16835
|
+
|
|
16836
|
+
/**
|
|
16837
|
+
* @param {UserAliasOptions | UserAliasOptionEntry[] | undefined} alias alias
|
|
16574
16838
|
* @returns {AliasOptionEntry[]} normalized aliases
|
|
16575
16839
|
*/
|
|
16576
16840
|
function normalizeAlias(alias) {
|
|
16577
|
-
|
|
16578
|
-
|
|
16579
|
-
|
|
16580
|
-
|
|
16581
|
-
|
|
16582
|
-
|
|
16583
|
-
|
|
16584
|
-
|
|
16585
|
-
}
|
|
16841
|
+
if (typeof alias === "object" && !Array.isArray(alias) && alias !== null) {
|
|
16842
|
+
return Object.keys(alias).map((key) => {
|
|
16843
|
+
/** @type {AliasOptionEntry} */
|
|
16844
|
+
const obj = {
|
|
16845
|
+
name: key,
|
|
16846
|
+
onlyModule: false,
|
|
16847
|
+
alias: toPathAlias(alias[key]),
|
|
16848
|
+
};
|
|
16586
16849
|
|
|
16587
|
-
|
|
16588
|
-
|
|
16589
|
-
|
|
16850
|
+
if (/\$$/.test(key)) {
|
|
16851
|
+
obj.onlyModule = true;
|
|
16852
|
+
obj.name = key.slice(0, -1);
|
|
16853
|
+
}
|
|
16854
|
+
|
|
16855
|
+
return obj;
|
|
16856
|
+
});
|
|
16857
|
+
}
|
|
16858
|
+
|
|
16859
|
+
return alias
|
|
16860
|
+
? alias.map((item) => ({ ...item, alias: toPathAlias(item.alias) }))
|
|
16861
|
+
: [];
|
|
16862
|
+
}
|
|
16863
|
+
|
|
16864
|
+
/**
|
|
16865
|
+
* @param {string | URL | boolean | UserTsconfigOptions | undefined} tsconfig tsconfig option
|
|
16866
|
+
* @returns {string | boolean | TsconfigOptions} normalized tsconfig with file `URL` instances converted to paths
|
|
16867
|
+
*/
|
|
16868
|
+
function normalizeTsconfig(tsconfig) {
|
|
16869
|
+
if (tsconfig === undefined) return false;
|
|
16870
|
+
if (typeof tsconfig === "boolean") return tsconfig;
|
|
16871
|
+
if (typeof tsconfig === "string" || tsconfig instanceof URL) {
|
|
16872
|
+
return toPath(tsconfig);
|
|
16873
|
+
}
|
|
16874
|
+
|
|
16875
|
+
/** @type {TsconfigOptions} */
|
|
16876
|
+
const result = {};
|
|
16877
|
+
|
|
16878
|
+
if (tsconfig.configFile !== undefined) {
|
|
16879
|
+
result.configFile = toPath(tsconfig.configFile);
|
|
16880
|
+
}
|
|
16881
|
+
if (tsconfig.baseUrl !== undefined) {
|
|
16882
|
+
result.baseUrl = toPath(tsconfig.baseUrl);
|
|
16883
|
+
}
|
|
16884
|
+
if (tsconfig.references !== undefined) {
|
|
16885
|
+
result.references = Array.isArray(tsconfig.references)
|
|
16886
|
+
? tsconfig.references.map(toPath)
|
|
16887
|
+
: tsconfig.references;
|
|
16888
|
+
}
|
|
16889
|
+
|
|
16890
|
+
return result;
|
|
16590
16891
|
}
|
|
16591
16892
|
|
|
16592
16893
|
/**
|
|
@@ -16693,9 +16994,9 @@ function createOptions(options) {
|
|
|
16693
16994
|
resolver: options.resolver,
|
|
16694
16995
|
modules: mergeFilteredToArray(
|
|
16695
16996
|
Array.isArray(options.modules)
|
|
16696
|
-
? options.modules
|
|
16997
|
+
? options.modules.map(toPath)
|
|
16697
16998
|
: options.modules
|
|
16698
|
-
? [options.modules]
|
|
16999
|
+
? [toPath(options.modules)]
|
|
16699
17000
|
: ["node_modules"],
|
|
16700
17001
|
(item) => {
|
|
16701
17002
|
const type = getType(item);
|
|
@@ -16706,14 +17007,16 @@ function createOptions(options) {
|
|
|
16706
17007
|
mainFiles: new Set(options.mainFiles || ["index"]),
|
|
16707
17008
|
plugins: options.plugins || [],
|
|
16708
17009
|
pnpApi: processPnpApiOption(options.pnpApi),
|
|
16709
|
-
roots: new Set(options.roots
|
|
17010
|
+
roots: new Set(options.roots ? options.roots.map(toPath) : undefined),
|
|
16710
17011
|
fullySpecified: options.fullySpecified || false,
|
|
16711
17012
|
resolveToContext: options.resolveToContext || false,
|
|
16712
17013
|
preferRelative: options.preferRelative || false,
|
|
16713
17014
|
preferAbsolute: options.preferAbsolute || false,
|
|
16714
|
-
restrictions: new Set(
|
|
16715
|
-
|
|
16716
|
-
|
|
17015
|
+
restrictions: new Set(
|
|
17016
|
+
options.restrictions &&
|
|
17017
|
+
options.restrictions.map((r) => (r instanceof RegExp ? r : toPath(r))),
|
|
17018
|
+
),
|
|
17019
|
+
tsconfig: normalizeTsconfig(options.tsconfig),
|
|
16717
17020
|
};
|
|
16718
17021
|
}
|
|
16719
17022
|
|
|
@@ -17017,6 +17320,7 @@ module.exports.createResolver = function createResolver(options) {
|
|
|
17017
17320
|
conditionNames,
|
|
17018
17321
|
exportsField,
|
|
17019
17322
|
exportsFieldTarget,
|
|
17323
|
+
restrictions.size > 0,
|
|
17020
17324
|
),
|
|
17021
17325
|
);
|
|
17022
17326
|
}
|
|
@@ -17198,7 +17502,7 @@ module.exports.createResolver = function createResolver(options) {
|
|
|
17198
17502
|
/***/ },
|
|
17199
17503
|
|
|
17200
17504
|
/***/ 2620
|
|
17201
|
-
(module) {
|
|
17505
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
17202
17506
|
|
|
17203
17507
|
"use strict";
|
|
17204
17508
|
/*
|
|
@@ -17208,23 +17512,24 @@ module.exports.createResolver = function createResolver(options) {
|
|
|
17208
17512
|
|
|
17209
17513
|
|
|
17210
17514
|
|
|
17515
|
+
const { isInside, normalize } = __webpack_require__(6932);
|
|
17516
|
+
|
|
17211
17517
|
/** @typedef {import("./Resolver")} Resolver */
|
|
17212
17518
|
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
|
|
17213
17519
|
|
|
17214
|
-
|
|
17215
|
-
|
|
17520
|
+
/**
|
|
17521
|
+
* @typedef {object} PathRestriction
|
|
17522
|
+
* @property {"path"} type type of the restriction
|
|
17523
|
+
* @property {string} rule normalized path the request has to be inside of
|
|
17524
|
+
*/
|
|
17216
17525
|
|
|
17217
17526
|
/**
|
|
17218
|
-
* @
|
|
17219
|
-
* @
|
|
17220
|
-
* @
|
|
17527
|
+
* @typedef {object} RegExpRestriction
|
|
17528
|
+
* @property {"regexp"} type type of the restriction
|
|
17529
|
+
* @property {RegExp} rule pattern the request has to match
|
|
17221
17530
|
*/
|
|
17222
|
-
|
|
17223
|
-
|
|
17224
|
-
if (path.length === parent.length) return true;
|
|
17225
|
-
const charCode = path.charCodeAt(parent.length);
|
|
17226
|
-
return charCode === slashCode || charCode === backslashCode;
|
|
17227
|
-
};
|
|
17531
|
+
|
|
17532
|
+
/** @typedef {PathRestriction | RegExpRestriction} Restriction */
|
|
17228
17533
|
|
|
17229
17534
|
module.exports = class RestrictionsPlugin {
|
|
17230
17535
|
/**
|
|
@@ -17234,6 +17539,17 @@ module.exports = class RestrictionsPlugin {
|
|
|
17234
17539
|
constructor(source, restrictions) {
|
|
17235
17540
|
this.source = source;
|
|
17236
17541
|
this.restrictions = restrictions;
|
|
17542
|
+
// Restrictions never change, so bringing them into the shape requests
|
|
17543
|
+
// arrive in is done once here instead of on every request.
|
|
17544
|
+
/** @type {Restriction[]} */
|
|
17545
|
+
this._restrictions = [];
|
|
17546
|
+
for (const rule of restrictions) {
|
|
17547
|
+
this._restrictions.push(
|
|
17548
|
+
typeof rule === "string"
|
|
17549
|
+
? { type: "path", rule: normalize(rule) }
|
|
17550
|
+
: { type: "regexp", rule },
|
|
17551
|
+
);
|
|
17552
|
+
}
|
|
17237
17553
|
}
|
|
17238
17554
|
|
|
17239
17555
|
/**
|
|
@@ -17246,24 +17562,28 @@ module.exports = class RestrictionsPlugin {
|
|
|
17246
17562
|
.tapAsync("RestrictionsPlugin", (request, resolveContext, callback) => {
|
|
17247
17563
|
if (typeof request.path === "string") {
|
|
17248
17564
|
const { path } = request;
|
|
17249
|
-
for (const
|
|
17250
|
-
if (
|
|
17251
|
-
if (
|
|
17252
|
-
|
|
17253
|
-
|
|
17254
|
-
|
|
17255
|
-
|
|
17256
|
-
}
|
|
17257
|
-
return callback(null, null);
|
|
17565
|
+
for (const restriction of this._restrictions) {
|
|
17566
|
+
if (restriction.type === "path") {
|
|
17567
|
+
if (isInside(restriction.rule, path)) continue;
|
|
17568
|
+
if (resolveContext.log) {
|
|
17569
|
+
resolveContext.log(
|
|
17570
|
+
`${path} is not inside of the restriction ${restriction.rule}`,
|
|
17571
|
+
);
|
|
17258
17572
|
}
|
|
17259
|
-
} else
|
|
17573
|
+
} else {
|
|
17574
|
+
if (restriction.rule.test(path)) continue;
|
|
17260
17575
|
if (resolveContext.log) {
|
|
17261
17576
|
resolveContext.log(
|
|
17262
|
-
`${path} doesn't match the restriction ${rule}`,
|
|
17577
|
+
`${path} doesn't match the restriction ${restriction.rule}`,
|
|
17263
17578
|
);
|
|
17264
17579
|
}
|
|
17265
|
-
return callback(null, null);
|
|
17266
17580
|
}
|
|
17581
|
+
// Target existed (FileExistsPlugin already passed) but is
|
|
17582
|
+
// outside the jail; signal ExportsFieldPlugin to fall back.
|
|
17583
|
+
if (request.__restrictionsMarker) {
|
|
17584
|
+
request.__restrictionsMarker.blocked = true;
|
|
17585
|
+
}
|
|
17586
|
+
return callback(null, null);
|
|
17267
17587
|
}
|
|
17268
17588
|
}
|
|
17269
17589
|
|
|
@@ -17635,7 +17955,18 @@ module.exports = class SymlinkPlugin {
|
|
|
17635
17955
|
obj,
|
|
17636
17956
|
`resolved symlink to ${result}`,
|
|
17637
17957
|
resolveContext,
|
|
17638
|
-
|
|
17958
|
+
(err, innerResult) => {
|
|
17959
|
+
if (err) return callback(err);
|
|
17960
|
+
// The symlink-resolved (real) path is authoritative. If
|
|
17961
|
+
// resolving it produced a result, use it. If it did not —
|
|
17962
|
+
// e.g. a `restrictions` rule rejected the real target —
|
|
17963
|
+
// stop here with no result instead of letting the next
|
|
17964
|
+
// plugin report the original in-root symlink path, which
|
|
17965
|
+
// would leave the symlink unresolved and bypass
|
|
17966
|
+
// `restrictions`.
|
|
17967
|
+
if (innerResult) return callback(null, innerResult);
|
|
17968
|
+
return callback(null, null);
|
|
17969
|
+
},
|
|
17639
17970
|
);
|
|
17640
17971
|
},
|
|
17641
17972
|
);
|
|
@@ -18390,6 +18721,7 @@ module.exports = class TsconfigPathsPlugin {
|
|
|
18390
18721
|
|
|
18391
18722
|
/**
|
|
18392
18723
|
* @param {string} dir current directory
|
|
18724
|
+
* @returns {void}
|
|
18393
18725
|
*/
|
|
18394
18726
|
const check = (dir) => {
|
|
18395
18727
|
const candidate = resolver.join(dir, configFileName);
|
|
@@ -18397,7 +18729,10 @@ module.exports = class TsconfigPathsPlugin {
|
|
|
18397
18729
|
if (!statErr) {
|
|
18398
18730
|
// Found — load it
|
|
18399
18731
|
this._loadTsconfigPathsMap(resolver, candidate, (loadErr, result) => {
|
|
18400
|
-
if (loadErr)
|
|
18732
|
+
if (loadErr) {
|
|
18733
|
+
// Auto mode: soft-fail silently.
|
|
18734
|
+
return callback(null, null);
|
|
18735
|
+
}
|
|
18401
18736
|
callback(null, result);
|
|
18402
18737
|
});
|
|
18403
18738
|
return;
|
|
@@ -18591,47 +18926,10 @@ module.exports = class TsconfigPathsPlugin {
|
|
|
18591
18926
|
extendedConfigValue,
|
|
18592
18927
|
);
|
|
18593
18928
|
|
|
18594
|
-
|
|
18595
|
-
|
|
18596
|
-
|
|
18597
|
-
|
|
18598
|
-
// "@scope/name" should resolve to node_modules/@scope/name/tsconfig.json,
|
|
18599
|
-
// not node_modules/@scope/name.json
|
|
18600
|
-
// See: test/fixtures/tsconfig-paths/extends-pkg-entry/
|
|
18601
|
-
if (
|
|
18602
|
-
typeof originalExtendedConfigValue === "string" &&
|
|
18603
|
-
originalExtendedConfigValue.startsWith("@") &&
|
|
18604
|
-
originalExtendedConfigValue.split("/").length === 2
|
|
18605
|
-
) {
|
|
18606
|
-
extendedConfigPath = resolver.join(
|
|
18607
|
-
currentDir,
|
|
18608
|
-
normalize(
|
|
18609
|
-
`node_modules/${originalExtendedConfigValue}/${DEFAULT_CONFIG_FILE}`,
|
|
18610
|
-
),
|
|
18611
|
-
);
|
|
18612
|
-
} else if (extendedConfigValue.includes("/")) {
|
|
18613
|
-
// Handle package sub-path extends like "react/tsconfig":
|
|
18614
|
-
// "react/tsconfig" resolves to node_modules/react/tsconfig.json
|
|
18615
|
-
// See: test/fixtures/tsconfig-paths/extends-npm/
|
|
18616
|
-
extendedConfigPath = resolver.join(
|
|
18617
|
-
currentDir,
|
|
18618
|
-
normalize(`node_modules/${extendedConfigValue}`),
|
|
18619
|
-
);
|
|
18620
|
-
} else if (
|
|
18621
|
-
!originalExtendedConfigValue.startsWith(".") &&
|
|
18622
|
-
!originalExtendedConfigValue.startsWith("/")
|
|
18623
|
-
) {
|
|
18624
|
-
// Handle unscoped package extends like "my-base-config" (no sub-path):
|
|
18625
|
-
// "my-base-config" should resolve to node_modules/my-base-config/tsconfig.json
|
|
18626
|
-
extendedConfigPath = resolver.join(
|
|
18627
|
-
currentDir,
|
|
18628
|
-
normalize(
|
|
18629
|
-
`node_modules/${originalExtendedConfigValue}/${DEFAULT_CONFIG_FILE}`,
|
|
18630
|
-
),
|
|
18631
|
-
);
|
|
18632
|
-
}
|
|
18633
|
-
}
|
|
18634
|
-
|
|
18929
|
+
/**
|
|
18930
|
+
* @param {string} extendedConfigPath resolved config path to load
|
|
18931
|
+
*/
|
|
18932
|
+
const loadExtended = (extendedConfigPath) => {
|
|
18635
18933
|
this._loadTsconfig(
|
|
18636
18934
|
resolver,
|
|
18637
18935
|
extendedConfigPath,
|
|
@@ -18659,9 +18957,85 @@ module.exports = class TsconfigPathsPlugin {
|
|
|
18659
18957
|
callback(null, cfg);
|
|
18660
18958
|
},
|
|
18661
18959
|
);
|
|
18960
|
+
};
|
|
18961
|
+
|
|
18962
|
+
fileSystem.stat(initialExtendedConfigPath, (existsErr) => {
|
|
18963
|
+
if (!existsErr) return loadExtended(initialExtendedConfigPath);
|
|
18964
|
+
|
|
18965
|
+
// The relative form does not exist — treat the value as a package
|
|
18966
|
+
// specifier and compute its `node_modules/<...>` sub-path.
|
|
18967
|
+
let nodeModulesSubPath = null;
|
|
18968
|
+
if (
|
|
18969
|
+
typeof originalExtendedConfigValue === "string" &&
|
|
18970
|
+
originalExtendedConfigValue.startsWith("@") &&
|
|
18971
|
+
originalExtendedConfigValue.split("/").length === 2
|
|
18972
|
+
) {
|
|
18973
|
+
// Scoped package, no sub-path ("@scope/name") →
|
|
18974
|
+
// node_modules/@scope/name/tsconfig.json (not @scope/name.json).
|
|
18975
|
+
// See: test/fixtures/tsconfig-paths/extends-pkg-entry/
|
|
18976
|
+
nodeModulesSubPath = `${originalExtendedConfigValue}/${DEFAULT_CONFIG_FILE}`;
|
|
18977
|
+
} else if (
|
|
18978
|
+
extendedConfigValue.includes("/") &&
|
|
18979
|
+
!originalExtendedConfigValue.startsWith(".") &&
|
|
18980
|
+
!originalExtendedConfigValue.startsWith("/")
|
|
18981
|
+
) {
|
|
18982
|
+
// Package sub-path ("react/tsconfig", "@scope/name/tsconfig") →
|
|
18983
|
+
// node_modules/react/tsconfig.json.
|
|
18984
|
+
// See: test/fixtures/tsconfig-paths/extends-npm/
|
|
18985
|
+
nodeModulesSubPath = extendedConfigValue;
|
|
18986
|
+
} else if (
|
|
18987
|
+
!originalExtendedConfigValue.startsWith(".") &&
|
|
18988
|
+
!originalExtendedConfigValue.startsWith("/")
|
|
18989
|
+
) {
|
|
18990
|
+
// Unscoped package, no sub-path ("my-base-config") →
|
|
18991
|
+
// node_modules/my-base-config/tsconfig.json.
|
|
18992
|
+
nodeModulesSubPath = `${originalExtendedConfigValue}/${DEFAULT_CONFIG_FILE}`;
|
|
18993
|
+
}
|
|
18994
|
+
|
|
18995
|
+
// Not a package specifier (relative/absolute) — load the missing
|
|
18996
|
+
// path anyway so the read surfaces its own ENOENT.
|
|
18997
|
+
if (nodeModulesSubPath === null) {
|
|
18998
|
+
return loadExtended(initialExtendedConfigPath);
|
|
18999
|
+
}
|
|
19000
|
+
|
|
19001
|
+
// Walk ancestor node_modules like Node.js/TypeScript so a package
|
|
19002
|
+
// hoisted to a parent workspace directory is found. #21457
|
|
19003
|
+
const subPath = normalize(`node_modules/${nodeModulesSubPath}`);
|
|
19004
|
+
this._findExtendsInNodeModules(resolver, currentDir, subPath, (found) => {
|
|
19005
|
+
loadExtended(found || resolver.join(currentDir, subPath));
|
|
19006
|
+
});
|
|
18662
19007
|
});
|
|
18663
19008
|
}
|
|
18664
19009
|
|
|
19010
|
+
/**
|
|
19011
|
+
* Walk up from startDir looking for `<dir>/<subPath>` (a
|
|
19012
|
+
* `node_modules/...` sub-path), matching Node.js module resolution so a
|
|
19013
|
+
* package hoisted to a parent workspace's node_modules is found.
|
|
19014
|
+
* @param {Resolver} resolver the resolver
|
|
19015
|
+
* @param {string} startDir directory to start searching from
|
|
19016
|
+
* @param {string} subPath node_modules-relative sub-path to look for
|
|
19017
|
+
* @param {(found: string | null) => void} callback receives the found path or null
|
|
19018
|
+
* @returns {void}
|
|
19019
|
+
*/
|
|
19020
|
+
_findExtendsInNodeModules(resolver, startDir, subPath, callback) {
|
|
19021
|
+
const { fileSystem } = resolver;
|
|
19022
|
+
|
|
19023
|
+
/**
|
|
19024
|
+
* @param {string} dir current directory
|
|
19025
|
+
*/
|
|
19026
|
+
const check = (dir) => {
|
|
19027
|
+
const candidate = resolver.join(dir, subPath);
|
|
19028
|
+
fileSystem.stat(candidate, (statErr) => {
|
|
19029
|
+
if (!statErr) return callback(candidate);
|
|
19030
|
+
const parentDir = resolver.dirname(dir);
|
|
19031
|
+
if (parentDir === dir) return callback(null);
|
|
19032
|
+
check(parentDir);
|
|
19033
|
+
});
|
|
19034
|
+
};
|
|
19035
|
+
|
|
19036
|
+
check(startDir);
|
|
19037
|
+
}
|
|
19038
|
+
|
|
18665
19039
|
/**
|
|
18666
19040
|
* Load referenced tsconfig projects and store in referenceMatchMap
|
|
18667
19041
|
* Simple implementation matching tsconfig-paths-webpack-plugin:
|
|
@@ -19393,24 +19767,24 @@ const memoize = __webpack_require__(7043);
|
|
|
19393
19767
|
|
|
19394
19768
|
/**
|
|
19395
19769
|
* @typedef {{
|
|
19396
|
-
* (context: Context,
|
|
19397
|
-
* (context: Context,
|
|
19398
|
-
* (
|
|
19399
|
-
* (
|
|
19770
|
+
* (context: Context, parent: string | URL, specifier: string | URL, resolveContext: ResolveContext, callback: ResolveCallback): void,
|
|
19771
|
+
* (context: Context, parent: string | URL, specifier: string | URL, callback: ResolveCallback): void,
|
|
19772
|
+
* (parent: string | URL, specifier: string | URL, resolveContext: ResolveContext, callback: ResolveCallback): void,
|
|
19773
|
+
* (parent: string | URL, specifier: string | URL, callback: ResolveCallback): void,
|
|
19400
19774
|
* }} ResolveFunctionAsync
|
|
19401
19775
|
*/
|
|
19402
19776
|
|
|
19403
19777
|
/**
|
|
19404
19778
|
* @typedef {{
|
|
19405
|
-
* (context: Context,
|
|
19406
|
-
* (
|
|
19779
|
+
* (context: Context, parent: string | URL, specifier: string | URL, resolveContext?: ResolveContext): string | false,
|
|
19780
|
+
* (parent: string | URL, specifier: string | URL, resolveContext?: ResolveContext): string | false,
|
|
19407
19781
|
* }} ResolveFunction
|
|
19408
19782
|
*/
|
|
19409
19783
|
|
|
19410
19784
|
/**
|
|
19411
19785
|
* @typedef {{
|
|
19412
|
-
* (context: Context,
|
|
19413
|
-
* (
|
|
19786
|
+
* (context: Context, parent: string | URL, specifier: string | URL, resolveContext?: ResolveContext): Promise<string | false>,
|
|
19787
|
+
* (parent: string | URL, specifier: string | URL, resolveContext?: ResolveContext): Promise<string | false>,
|
|
19414
19788
|
* }} ResolveFunctionPromise
|
|
19415
19789
|
*/
|
|
19416
19790
|
|
|
@@ -19442,18 +19816,18 @@ const getAsyncResolver = memoize(() =>
|
|
|
19442
19816
|
*/
|
|
19443
19817
|
const resolve =
|
|
19444
19818
|
/**
|
|
19445
|
-
* @param {object | string} context context
|
|
19446
|
-
* @param {string}
|
|
19447
|
-
* @param {string | ResolveContext | ResolveCallback}
|
|
19819
|
+
* @param {object | string | URL} context context
|
|
19820
|
+
* @param {string | URL} parent parent path
|
|
19821
|
+
* @param {string | URL | ResolveContext | ResolveCallback} specifier specifier to resolve
|
|
19448
19822
|
* @param {ResolveContext | ResolveCallback=} resolveContext resolve context
|
|
19449
19823
|
* @param {ResolveCallback=} callback callback
|
|
19450
19824
|
*/
|
|
19451
|
-
(context,
|
|
19452
|
-
if (typeof context === "string") {
|
|
19825
|
+
(context, parent, specifier, resolveContext, callback) => {
|
|
19826
|
+
if (typeof context === "string" || context instanceof URL) {
|
|
19453
19827
|
callback = /** @type {ResolveCallback} */ (resolveContext);
|
|
19454
|
-
resolveContext = /** @type {ResolveContext} */ (
|
|
19455
|
-
|
|
19456
|
-
|
|
19828
|
+
resolveContext = /** @type {ResolveContext} */ (specifier);
|
|
19829
|
+
specifier = parent;
|
|
19830
|
+
parent = context;
|
|
19457
19831
|
context = getNodeContext();
|
|
19458
19832
|
}
|
|
19459
19833
|
if (typeof callback !== "function") {
|
|
@@ -19461,8 +19835,8 @@ const resolve =
|
|
|
19461
19835
|
}
|
|
19462
19836
|
getAsyncResolver().resolve(
|
|
19463
19837
|
context,
|
|
19464
|
-
|
|
19465
|
-
/** @type {string} */ (
|
|
19838
|
+
parent,
|
|
19839
|
+
/** @type {string} */ (specifier),
|
|
19466
19840
|
/** @type {ResolveContext} */ (resolveContext),
|
|
19467
19841
|
/** @type {ResolveCallback} */ (callback),
|
|
19468
19842
|
);
|
|
@@ -19482,23 +19856,23 @@ const getSyncResolver = memoize(() =>
|
|
|
19482
19856
|
*/
|
|
19483
19857
|
const resolveSync =
|
|
19484
19858
|
/**
|
|
19485
|
-
* @param {object | string} context context
|
|
19486
|
-
* @param {string}
|
|
19487
|
-
* @param {string | ResolveContext | undefined}
|
|
19859
|
+
* @param {object | string | URL} context context
|
|
19860
|
+
* @param {string | URL} parent parent path
|
|
19861
|
+
* @param {string | URL | ResolveContext | undefined} specifier specifier to resolve
|
|
19488
19862
|
* @param {ResolveContext=} resolveContext resolve context
|
|
19489
19863
|
* @returns {string | false} resolved path
|
|
19490
19864
|
*/
|
|
19491
|
-
(context,
|
|
19492
|
-
if (typeof context === "string") {
|
|
19493
|
-
resolveContext = /** @type {ResolveContext} */ (
|
|
19494
|
-
|
|
19495
|
-
|
|
19865
|
+
(context, parent, specifier, resolveContext) => {
|
|
19866
|
+
if (typeof context === "string" || context instanceof URL) {
|
|
19867
|
+
resolveContext = /** @type {ResolveContext} */ (specifier);
|
|
19868
|
+
specifier = parent;
|
|
19869
|
+
parent = context;
|
|
19496
19870
|
context = getNodeContext();
|
|
19497
19871
|
}
|
|
19498
19872
|
return getSyncResolver().resolveSync(
|
|
19499
19873
|
context,
|
|
19500
|
-
|
|
19501
|
-
/** @type {string} */ (
|
|
19874
|
+
parent,
|
|
19875
|
+
/** @type {string} */ (specifier),
|
|
19502
19876
|
/** @type {ResolveContext} */ (resolveContext),
|
|
19503
19877
|
);
|
|
19504
19878
|
};
|
|
@@ -19508,23 +19882,23 @@ const resolveSync =
|
|
|
19508
19882
|
*/
|
|
19509
19883
|
const resolvePromise =
|
|
19510
19884
|
/**
|
|
19511
|
-
* @param {object | string} context context
|
|
19512
|
-
* @param {string}
|
|
19513
|
-
* @param {string | ResolveContext | undefined}
|
|
19885
|
+
* @param {object | string | URL} context context
|
|
19886
|
+
* @param {string | URL} parent parent path
|
|
19887
|
+
* @param {string | URL | ResolveContext | undefined} specifier specifier to resolve
|
|
19514
19888
|
* @param {ResolveContext=} resolveContext resolve context
|
|
19515
19889
|
* @returns {Promise<string | false>} resolved path
|
|
19516
19890
|
*/
|
|
19517
|
-
(context,
|
|
19518
|
-
if (typeof context === "string") {
|
|
19519
|
-
resolveContext = /** @type {ResolveContext} */ (
|
|
19520
|
-
|
|
19521
|
-
|
|
19891
|
+
(context, parent, specifier, resolveContext) => {
|
|
19892
|
+
if (typeof context === "string" || context instanceof URL) {
|
|
19893
|
+
resolveContext = /** @type {ResolveContext} */ (specifier);
|
|
19894
|
+
specifier = parent;
|
|
19895
|
+
parent = context;
|
|
19522
19896
|
context = getNodeContext();
|
|
19523
19897
|
}
|
|
19524
19898
|
return getAsyncResolver().resolvePromise(
|
|
19525
19899
|
context,
|
|
19526
|
-
|
|
19527
|
-
/** @type {string} */ (
|
|
19900
|
+
parent,
|
|
19901
|
+
/** @type {string} */ (specifier),
|
|
19528
19902
|
/** @type {ResolveContext} */ (resolveContext),
|
|
19529
19903
|
);
|
|
19530
19904
|
};
|
|
@@ -19537,22 +19911,22 @@ const resolvePromise =
|
|
|
19537
19911
|
*/
|
|
19538
19912
|
function create(options) {
|
|
19539
19913
|
const resolver = getResolverFactory().createResolver({
|
|
19540
|
-
fileSystem: getNodeFileSystem(),
|
|
19541
19914
|
...options,
|
|
19915
|
+
fileSystem: options.fileSystem || getNodeFileSystem(),
|
|
19542
19916
|
});
|
|
19543
19917
|
/**
|
|
19544
|
-
* @param {object | string} context Custom context
|
|
19545
|
-
* @param {string}
|
|
19546
|
-
* @param {string | ResolveContext | ResolveCallback}
|
|
19918
|
+
* @param {object | string | URL} context Custom context
|
|
19919
|
+
* @param {string | URL} parent Base/parent path
|
|
19920
|
+
* @param {string | URL | ResolveContext | ResolveCallback} specifier Specifier to resolve
|
|
19547
19921
|
* @param {ResolveContext | ResolveCallback=} resolveContext Resolve context
|
|
19548
19922
|
* @param {ResolveCallback=} callback Result callback
|
|
19549
19923
|
*/
|
|
19550
|
-
return function create(context,
|
|
19551
|
-
if (typeof context === "string") {
|
|
19924
|
+
return function create(context, parent, specifier, resolveContext, callback) {
|
|
19925
|
+
if (typeof context === "string" || context instanceof URL) {
|
|
19552
19926
|
callback = /** @type {ResolveCallback} */ (resolveContext);
|
|
19553
|
-
resolveContext = /** @type {ResolveContext} */ (
|
|
19554
|
-
|
|
19555
|
-
|
|
19927
|
+
resolveContext = /** @type {ResolveContext} */ (specifier);
|
|
19928
|
+
specifier = parent;
|
|
19929
|
+
parent = context;
|
|
19556
19930
|
context = getNodeContext();
|
|
19557
19931
|
}
|
|
19558
19932
|
if (typeof callback !== "function") {
|
|
@@ -19560,8 +19934,8 @@ function create(options) {
|
|
|
19560
19934
|
}
|
|
19561
19935
|
resolver.resolve(
|
|
19562
19936
|
context,
|
|
19563
|
-
|
|
19564
|
-
/** @type {string} */ (
|
|
19937
|
+
parent,
|
|
19938
|
+
/** @type {string} */ (specifier),
|
|
19565
19939
|
/** @type {ResolveContext} */ (resolveContext),
|
|
19566
19940
|
callback,
|
|
19567
19941
|
);
|
|
@@ -19575,27 +19949,27 @@ function create(options) {
|
|
|
19575
19949
|
function createSync(options) {
|
|
19576
19950
|
const resolver = getResolverFactory().createResolver({
|
|
19577
19951
|
useSyncFileSystemCalls: true,
|
|
19578
|
-
fileSystem: getNodeFileSystem(),
|
|
19579
19952
|
...options,
|
|
19953
|
+
fileSystem: options.fileSystem || getNodeFileSystem(),
|
|
19580
19954
|
});
|
|
19581
19955
|
/**
|
|
19582
|
-
* @param {object | string} context custom context
|
|
19583
|
-
* @param {string}
|
|
19584
|
-
* @param {string | ResolveContext | undefined}
|
|
19956
|
+
* @param {object | string | URL} context custom context
|
|
19957
|
+
* @param {string | URL} parent base/parent path
|
|
19958
|
+
* @param {string | URL | ResolveContext | undefined} specifier specifier to resolve
|
|
19585
19959
|
* @param {ResolveContext=} resolveContext Resolve context
|
|
19586
19960
|
* @returns {string | false} Resolved path or false
|
|
19587
19961
|
*/
|
|
19588
|
-
return function createSync(context,
|
|
19589
|
-
if (typeof context === "string") {
|
|
19590
|
-
resolveContext = /** @type {ResolveContext} */ (
|
|
19591
|
-
|
|
19592
|
-
|
|
19962
|
+
return function createSync(context, parent, specifier, resolveContext) {
|
|
19963
|
+
if (typeof context === "string" || context instanceof URL) {
|
|
19964
|
+
resolveContext = /** @type {ResolveContext} */ (specifier);
|
|
19965
|
+
specifier = parent;
|
|
19966
|
+
parent = context;
|
|
19593
19967
|
context = getNodeContext();
|
|
19594
19968
|
}
|
|
19595
19969
|
return resolver.resolveSync(
|
|
19596
19970
|
context,
|
|
19597
|
-
|
|
19598
|
-
/** @type {string} */ (
|
|
19971
|
+
parent,
|
|
19972
|
+
/** @type {string} */ (specifier),
|
|
19599
19973
|
/** @type {ResolveContext} */ (resolveContext),
|
|
19600
19974
|
);
|
|
19601
19975
|
};
|
|
@@ -19607,27 +19981,27 @@ function createSync(options) {
|
|
|
19607
19981
|
*/
|
|
19608
19982
|
function createPromise(options) {
|
|
19609
19983
|
const resolver = getResolverFactory().createResolver({
|
|
19610
|
-
fileSystem: getNodeFileSystem(),
|
|
19611
19984
|
...options,
|
|
19985
|
+
fileSystem: options.fileSystem || getNodeFileSystem(),
|
|
19612
19986
|
});
|
|
19613
19987
|
/**
|
|
19614
|
-
* @param {object | string} context Custom context
|
|
19615
|
-
* @param {string}
|
|
19616
|
-
* @param {string | ResolveContext | undefined}
|
|
19988
|
+
* @param {object | string | URL} context Custom context
|
|
19989
|
+
* @param {string | URL} parent Base/parent path
|
|
19990
|
+
* @param {string | URL | ResolveContext | undefined} specifier Specifier to resolve
|
|
19617
19991
|
* @param {ResolveContext=} resolveContext Resolve context
|
|
19618
19992
|
* @returns {Promise<string | false>} resolved path
|
|
19619
19993
|
*/
|
|
19620
|
-
return function createPromise(context,
|
|
19621
|
-
if (typeof context === "string") {
|
|
19622
|
-
resolveContext = /** @type {ResolveContext} */ (
|
|
19623
|
-
|
|
19624
|
-
|
|
19994
|
+
return function createPromise(context, parent, specifier, resolveContext) {
|
|
19995
|
+
if (typeof context === "string" || context instanceof URL) {
|
|
19996
|
+
resolveContext = /** @type {ResolveContext} */ (specifier);
|
|
19997
|
+
specifier = parent;
|
|
19998
|
+
parent = context;
|
|
19625
19999
|
context = getNodeContext();
|
|
19626
20000
|
}
|
|
19627
20001
|
return resolver.resolvePromise(
|
|
19628
20002
|
context,
|
|
19629
|
-
|
|
19630
|
-
/** @type {string} */ (
|
|
20003
|
+
parent,
|
|
20004
|
+
/** @type {string} */ (specifier),
|
|
19631
20005
|
/** @type {ResolveContext} */ (resolveContext),
|
|
19632
20006
|
);
|
|
19633
20007
|
};
|
|
@@ -20448,6 +20822,7 @@ module.exports.processImportsField = function processImportsField(
|
|
|
20448
20822
|
|
|
20449
20823
|
|
|
20450
20824
|
|
|
20825
|
+
const memoize = __webpack_require__(7043);
|
|
20451
20826
|
const stripJsonComments = __webpack_require__(959);
|
|
20452
20827
|
|
|
20453
20828
|
/** @typedef {import("../Resolver").FileSystem} FileSystem */
|
|
@@ -20458,9 +20833,33 @@ const stripJsonComments = __webpack_require__(959);
|
|
|
20458
20833
|
* @property {boolean=} stripComments Whether to strip JSONC comments
|
|
20459
20834
|
*/
|
|
20460
20835
|
|
|
20461
|
-
/** @type {WeakMap<Buffer, JsonObject>} */
|
|
20836
|
+
/** @type {WeakMap<Buffer | Uint8Array, JsonObject>} */
|
|
20462
20837
|
const _stripCommentsCache = new WeakMap();
|
|
20463
20838
|
|
|
20839
|
+
// Only constructed for non-Buffer input: on Node the `Buffer.isBuffer` branch
|
|
20840
|
+
// in `decodeText` handles decoding, so the global `TextDecoder` (Node 11+,
|
|
20841
|
+
// always present in browsers/Deno/Bun) is only reached off the Buffer path.
|
|
20842
|
+
// `ignoreBOM: true` keeps a leading BOM in the output, matching
|
|
20843
|
+
// `Buffer.toString("utf8")` so both decode paths behave identically.
|
|
20844
|
+
// eslint-disable-next-line n/no-unsupported-features/node-builtins
|
|
20845
|
+
const getDecoder = memoize(() => new TextDecoder("utf-8", { ignoreBOM: true }));
|
|
20846
|
+
|
|
20847
|
+
/**
|
|
20848
|
+
* Decode a file's raw contents to text without assuming a Node runtime. A
|
|
20849
|
+
* `Buffer` (Node) uses its fast native `toString`; any other binary input
|
|
20850
|
+
* (`Uint8Array` from a browser/Deno/Bun file system) goes through
|
|
20851
|
+
* `TextDecoder`, and strings are returned as-is.
|
|
20852
|
+
* @param {string | Buffer | Uint8Array} data raw file contents
|
|
20853
|
+
* @returns {string} decoded text
|
|
20854
|
+
*/
|
|
20855
|
+
const decodeText = (data) => {
|
|
20856
|
+
if (typeof data === "string") return data;
|
|
20857
|
+
if (typeof Buffer !== "undefined" && Buffer.isBuffer(data)) {
|
|
20858
|
+
return data.toString("utf8");
|
|
20859
|
+
}
|
|
20860
|
+
return getDecoder().decode(data);
|
|
20861
|
+
};
|
|
20862
|
+
|
|
20464
20863
|
/**
|
|
20465
20864
|
* Read and parse JSON file (supports JSONC with comments).
|
|
20466
20865
|
* Callback-based so a synchronous `fileSystem` stays synchronous all the
|
|
@@ -20486,16 +20885,21 @@ function readJson(fileSystem, jsonFilePath, options, callback) {
|
|
|
20486
20885
|
|
|
20487
20886
|
fileSystem.readFile(jsonFilePath, (err, data) => {
|
|
20488
20887
|
if (err) return callback(err);
|
|
20489
|
-
const buf = /** @type {Buffer} */ (data);
|
|
20888
|
+
const buf = /** @type {Buffer | Uint8Array | string} */ (data);
|
|
20889
|
+
|
|
20890
|
+
// The strip-comments cache is keyed by the file-contents object; a file
|
|
20891
|
+
// system may hand back a plain string, which cannot be a WeakMap key, so
|
|
20892
|
+
// only cache when the contents are an object.
|
|
20893
|
+
const cacheable = stripComments && typeof buf === "object";
|
|
20490
20894
|
|
|
20491
|
-
if (
|
|
20895
|
+
if (cacheable) {
|
|
20492
20896
|
const cached = _stripCommentsCache.get(buf);
|
|
20493
20897
|
if (cached !== undefined) return callback(null, cached);
|
|
20494
20898
|
}
|
|
20495
20899
|
|
|
20496
20900
|
let result;
|
|
20497
20901
|
try {
|
|
20498
|
-
const jsonText = buf
|
|
20902
|
+
const jsonText = decodeText(buf);
|
|
20499
20903
|
const jsonWithoutComments = stripComments
|
|
20500
20904
|
? stripJsonComments(jsonText, {
|
|
20501
20905
|
trailingCommas: true,
|
|
@@ -20507,7 +20911,7 @@ function readJson(fileSystem, jsonFilePath, options, callback) {
|
|
|
20507
20911
|
return callback(/** @type {Error} */ (parseErr));
|
|
20508
20912
|
}
|
|
20509
20913
|
|
|
20510
|
-
if (
|
|
20914
|
+
if (cacheable) {
|
|
20511
20915
|
_stripCommentsCache.set(buf, result);
|
|
20512
20916
|
}
|
|
20513
20917
|
|
|
@@ -20515,6 +20919,7 @@ function readJson(fileSystem, jsonFilePath, options, callback) {
|
|
|
20515
20919
|
});
|
|
20516
20920
|
}
|
|
20517
20921
|
|
|
20922
|
+
module.exports.decodeText = decodeText;
|
|
20518
20923
|
module.exports.readJson = readJson;
|
|
20519
20924
|
|
|
20520
20925
|
|
|
@@ -20531,9 +20936,7 @@ module.exports.readJson = readJson;
|
|
|
20531
20936
|
|
|
20532
20937
|
|
|
20533
20938
|
|
|
20534
|
-
const
|
|
20535
|
-
|
|
20536
|
-
const getUrl = memorize(() => __webpack_require__(7016));
|
|
20939
|
+
const { fileURLToPath } = __webpack_require__(7016);
|
|
20537
20940
|
|
|
20538
20941
|
const PATH_QUERY_FRAGMENT_REGEXP =
|
|
20539
20942
|
/^(#?(?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/;
|
|
@@ -20570,7 +20973,7 @@ function parseIdentifier(identifier) {
|
|
|
20570
20973
|
}
|
|
20571
20974
|
|
|
20572
20975
|
if (FILE_REG_EXP.test(identifier)) {
|
|
20573
|
-
identifier =
|
|
20976
|
+
identifier = fileURLToPath(identifier);
|
|
20574
20977
|
}
|
|
20575
20978
|
|
|
20576
20979
|
const firstEscape = identifier.indexOf("\0");
|
|
@@ -20689,6 +21092,7 @@ var __webpack_unused_export__;
|
|
|
20689
21092
|
|
|
20690
21093
|
|
|
20691
21094
|
const path = __webpack_require__(6928);
|
|
21095
|
+
const { fileURLToPath } = __webpack_require__(7016);
|
|
20692
21096
|
|
|
20693
21097
|
const CHAR_HASH = "#".charCodeAt(0);
|
|
20694
21098
|
const CHAR_SLASH = "/".charCodeAt(0);
|
|
@@ -20699,7 +21103,6 @@ const CHAR_LOWER_A = "a".charCodeAt(0);
|
|
|
20699
21103
|
const CHAR_LOWER_Z = "z".charCodeAt(0);
|
|
20700
21104
|
const CHAR_DOT = ".".charCodeAt(0);
|
|
20701
21105
|
const CHAR_COLON = ":".charCodeAt(0);
|
|
20702
|
-
const CHAR_QUESTION = "?".charCodeAt(0);
|
|
20703
21106
|
|
|
20704
21107
|
const posixNormalize = path.posix.normalize;
|
|
20705
21108
|
const winNormalize = path.win32.normalize;
|
|
@@ -20722,20 +21125,6 @@ const deprecatedInvalidSegmentRegEx =
|
|
|
20722
21125
|
const invalidSegmentRegEx =
|
|
20723
21126
|
/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i;
|
|
20724
21127
|
|
|
20725
|
-
/**
|
|
20726
|
-
* @param {string} maybePath a path known to start with `\\`
|
|
20727
|
-
* @returns {PathType} AbsoluteWin for `\\?\…` / `\\.\…`, otherwise Normal
|
|
20728
|
-
*/
|
|
20729
|
-
const getDosDeviceType = (maybePath) => {
|
|
20730
|
-
if (maybePath.length >= 4 && maybePath.charCodeAt(3) === CHAR_BACKSLASH) {
|
|
20731
|
-
const c2 = maybePath.charCodeAt(2);
|
|
20732
|
-
if (c2 === CHAR_QUESTION || c2 === CHAR_DOT) {
|
|
20733
|
-
return PathType.AbsoluteWin;
|
|
20734
|
-
}
|
|
20735
|
-
}
|
|
20736
|
-
return PathType.Normal;
|
|
20737
|
-
};
|
|
20738
|
-
|
|
20739
21128
|
/**
|
|
20740
21129
|
* @param {string} maybePath a path
|
|
20741
21130
|
* @returns {PathType} type of path
|
|
@@ -20781,6 +21170,9 @@ const getType = (maybePath) => {
|
|
|
20781
21170
|
) {
|
|
20782
21171
|
return PathType.AbsoluteWin;
|
|
20783
21172
|
}
|
|
21173
|
+
if (c0 === CHAR_BACKSLASH && c1 === CHAR_BACKSLASH) {
|
|
21174
|
+
return PathType.AbsoluteWin;
|
|
21175
|
+
}
|
|
20784
21176
|
return PathType.Normal;
|
|
20785
21177
|
}
|
|
20786
21178
|
}
|
|
@@ -20815,12 +21207,11 @@ const getType = (maybePath) => {
|
|
|
20815
21207
|
return PathType.AbsoluteWin;
|
|
20816
21208
|
}
|
|
20817
21209
|
}
|
|
20818
|
-
//
|
|
20819
|
-
//
|
|
20820
|
-
// `
|
|
20821
|
-
// only pay the two-byte gate for non-DOS inputs.
|
|
21210
|
+
// Two leading backslashes root a UNC share (`\\server\share`) or a DOS
|
|
21211
|
+
// device path (`\\?\…`, `\\.\…`); `path.win32` reads either as absolute,
|
|
21212
|
+
// so both belong on `path.win32` and not on posix.
|
|
20822
21213
|
if (c0 === CHAR_BACKSLASH && c1 === CHAR_BACKSLASH) {
|
|
20823
|
-
return
|
|
21214
|
+
return PathType.AbsoluteWin;
|
|
20824
21215
|
}
|
|
20825
21216
|
return PathType.Normal;
|
|
20826
21217
|
};
|
|
@@ -20980,39 +21371,154 @@ const isRelativeRequest = (request) => {
|
|
|
20980
21371
|
};
|
|
20981
21372
|
|
|
20982
21373
|
/**
|
|
20983
|
-
*
|
|
21374
|
+
* Whether this is a Windows path, in which `/` and `\` are interchangeable and
|
|
21375
|
+
* paths compare case-insensitively, as opposed to a posix path, in which `\` is
|
|
21376
|
+
* an ordinary filename character. Decided by the root — a drive letter or a
|
|
21377
|
+
* leading `\` — which is where `path.win32` and `path.posix` disagree about
|
|
21378
|
+
* `parse(maybePath).root`, and never by the host platform, since Windows paths
|
|
21379
|
+
* are resolved on posix hosts and in browsers too. A path starting with `//`
|
|
21380
|
+
* stays posix: `path.win32` reads it as a UNC root, but here it cannot be told
|
|
21381
|
+
* apart from a posix path, where `\` has to keep being a filename character.
|
|
21382
|
+
* @param {string} maybePath a path
|
|
21383
|
+
* @returns {boolean} true, when the path is a Windows path
|
|
21384
|
+
*/
|
|
21385
|
+
const isWindowsPath = (maybePath) => {
|
|
21386
|
+
const c0 = maybePath.charCodeAt(0);
|
|
21387
|
+
if (c0 === CHAR_BACKSLASH) return true;
|
|
21388
|
+
if (maybePath.charCodeAt(1) !== CHAR_COLON) return false;
|
|
21389
|
+
return (
|
|
21390
|
+
(c0 >= CHAR_A && c0 <= CHAR_Z) || (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z)
|
|
21391
|
+
);
|
|
21392
|
+
};
|
|
21393
|
+
|
|
21394
|
+
/**
|
|
21395
|
+
* @param {number} charCode a char code
|
|
21396
|
+
* @param {boolean} windowsPath whether `\` separates segments
|
|
21397
|
+
* @returns {boolean} true, when the char code separates path segments
|
|
21398
|
+
*/
|
|
21399
|
+
const isSeparator = (charCode, windowsPath) =>
|
|
21400
|
+
charCode === CHAR_SLASH || (windowsPath && charCode === CHAR_BACKSLASH);
|
|
21401
|
+
|
|
21402
|
+
/**
|
|
21403
|
+
* @param {string} parentPath parent directory path
|
|
21404
|
+
* @param {boolean} windowsPath whether `parentPath` is a Windows path
|
|
21405
|
+
* @returns {number} length of `parentPath` without its trailing separators
|
|
21406
|
+
*/
|
|
21407
|
+
const parentPathLength = (parentPath, windowsPath) => {
|
|
21408
|
+
let end = parentPath.length;
|
|
21409
|
+
while (end > 0 && isSeparator(parentPath.charCodeAt(end - 1), windowsPath)) {
|
|
21410
|
+
end--;
|
|
21411
|
+
}
|
|
21412
|
+
return end;
|
|
21413
|
+
};
|
|
21414
|
+
|
|
21415
|
+
/**
|
|
21416
|
+
* Cold path of `startsWithPath`: Node lowercases whole paths rather than single
|
|
21417
|
+
* characters, which only makes a difference outside of ASCII.
|
|
21418
|
+
* @param {string} parentPath parent directory path
|
|
21419
|
+
* @param {number} length number of characters to compare
|
|
21420
|
+
* @param {string} childPath child path to check
|
|
21421
|
+
* @returns {boolean} true, when both prefixes name the same Windows path
|
|
21422
|
+
*/
|
|
21423
|
+
const equalsWindowsPrefix = (parentPath, length, childPath) =>
|
|
21424
|
+
childPath.slice(0, length).replace(/\//g, "\\").toLowerCase() ===
|
|
21425
|
+
parentPath.slice(0, length).replace(/\//g, "\\").toLowerCase();
|
|
21426
|
+
|
|
21427
|
+
/**
|
|
21428
|
+
* @param {string} parentPath parent directory path
|
|
21429
|
+
* @param {number} length number of characters of `parentPath` to compare
|
|
21430
|
+
* @param {string} childPath child path to check
|
|
21431
|
+
* @param {boolean} windowsPath whether `parentPath` is a Windows path
|
|
21432
|
+
* @returns {boolean} true, when `childPath` starts with that prefix
|
|
21433
|
+
*/
|
|
21434
|
+
const startsWithPath = (parentPath, length, childPath, windowsPath) => {
|
|
21435
|
+
if (childPath.length < length) return false;
|
|
21436
|
+
// The common case is an exact prefix of a parent without trailing
|
|
21437
|
+
// separators, which `startsWith` answers natively and without a slice. For
|
|
21438
|
+
// a posix parent that is the whole answer, only a Windows one has more
|
|
21439
|
+
// spellings of the same path to try.
|
|
21440
|
+
if (length === parentPath.length) {
|
|
21441
|
+
if (childPath.startsWith(parentPath)) return true;
|
|
21442
|
+
if (!windowsPath) return false;
|
|
21443
|
+
}
|
|
21444
|
+
for (let i = 0; i < length; i++) {
|
|
21445
|
+
const childCharCode = childPath.charCodeAt(i);
|
|
21446
|
+
const parentCharCode = parentPath.charCodeAt(i);
|
|
21447
|
+
if (childCharCode === parentCharCode) continue;
|
|
21448
|
+
if (!windowsPath) return false;
|
|
21449
|
+
// Windows mixes `/` and `\` freely and compares case-insensitively.
|
|
21450
|
+
if (isSeparator(childCharCode, true) && isSeparator(parentCharCode, true)) {
|
|
21451
|
+
continue;
|
|
21452
|
+
}
|
|
21453
|
+
if (childCharCode > 127 || parentCharCode > 127) {
|
|
21454
|
+
return equalsWindowsPrefix(parentPath, length, childPath);
|
|
21455
|
+
}
|
|
21456
|
+
const childLower =
|
|
21457
|
+
childCharCode >= CHAR_A && childCharCode <= CHAR_Z
|
|
21458
|
+
? childCharCode + 32
|
|
21459
|
+
: childCharCode;
|
|
21460
|
+
const parentLower =
|
|
21461
|
+
parentCharCode >= CHAR_A && parentCharCode <= CHAR_Z
|
|
21462
|
+
? parentCharCode + 32
|
|
21463
|
+
: parentCharCode;
|
|
21464
|
+
if (childLower !== parentLower) return false;
|
|
21465
|
+
}
|
|
21466
|
+
return true;
|
|
21467
|
+
};
|
|
21468
|
+
|
|
21469
|
+
/**
|
|
21470
|
+
* Whether childPath is parentPath itself or a path under it, the answer node's
|
|
21471
|
+
* `relative(parentPath, childPath)` gives: not escaping upward and not
|
|
21472
|
+
* absolute. A trailing separator on the parent is not part of the boundary, so
|
|
21473
|
+
* `/a/b/` contains exactly what `/a/b` contains.
|
|
21474
|
+
* @param {string} parentPath parent directory path
|
|
21475
|
+
* @param {string} childPath child path to check
|
|
21476
|
+
* @returns {boolean} true if childPath is parentPath or is under it
|
|
21477
|
+
*/
|
|
21478
|
+
const isInside = (parentPath, childPath) => {
|
|
21479
|
+
const windowsPath = isWindowsPath(parentPath);
|
|
21480
|
+
const length = parentPathLength(parentPath, windowsPath);
|
|
21481
|
+
if (!startsWithPath(parentPath, length, childPath, windowsPath)) return false;
|
|
21482
|
+
// The parent itself, or a segment boundary right after it so that `/a/b`
|
|
21483
|
+
// does not contain the sibling `/a/b-other`.
|
|
21484
|
+
return (
|
|
21485
|
+
childPath.length === length ||
|
|
21486
|
+
isSeparator(childPath.charCodeAt(length), windowsPath)
|
|
21487
|
+
);
|
|
21488
|
+
};
|
|
21489
|
+
|
|
21490
|
+
/**
|
|
21491
|
+
* Check if childPath is a subdirectory of parentPath. Compares like `isInside`,
|
|
21492
|
+
* except that a path is not a subpath of itself.
|
|
20984
21493
|
*
|
|
20985
21494
|
* Called from `TsconfigPathsPlugin._selectPathsDataForContext` inside a loop
|
|
20986
21495
|
* over every tsconfig-paths context on every resolve, so it's worth keeping
|
|
20987
|
-
* cheap
|
|
20988
|
-
*
|
|
20989
|
-
* `endsWith` calls; and skips `normalize()` entirely in the common case
|
|
20990
|
-
* (parent has no trailing separator), since all we really need is the same
|
|
20991
|
-
* anchoring effect — a cheap `startsWith` plus a separator char check on the
|
|
20992
|
-
* byte immediately after `parentPath.length`.
|
|
21496
|
+
* cheap: a native `startsWith` plus a separator char check answers it, and the
|
|
21497
|
+
* character loop only runs for a Windows path that the prefix test missed.
|
|
20993
21498
|
* @param {string} parentPath parent directory path
|
|
20994
21499
|
* @param {string} childPath child path to check
|
|
20995
21500
|
* @returns {boolean} true if childPath is under parentPath
|
|
20996
21501
|
*/
|
|
20997
21502
|
const isSubPath = (parentPath, childPath) => {
|
|
20998
|
-
const
|
|
20999
|
-
|
|
21000
|
-
|
|
21001
|
-
|
|
21002
|
-
|
|
21003
|
-
}
|
|
21004
|
-
const lastChar = parentPath.charCodeAt(parentLen - 1);
|
|
21005
|
-
if (lastChar === CHAR_SLASH || lastChar === CHAR_BACKSLASH) {
|
|
21006
|
-
// Parent already ends with a separator — a plain prefix test is enough.
|
|
21007
|
-
return childPath.startsWith(parentPath);
|
|
21008
|
-
}
|
|
21009
|
-
if (childPath.length <= parentLen) return false;
|
|
21010
|
-
if (!childPath.startsWith(parentPath)) return false;
|
|
21011
|
-
// Must be followed by a separator so "/app" doesn't match "/app-other".
|
|
21012
|
-
const nextChar = childPath.charCodeAt(parentLen);
|
|
21013
|
-
return nextChar === CHAR_SLASH || nextChar === CHAR_BACKSLASH;
|
|
21503
|
+
const windowsPath = isWindowsPath(parentPath);
|
|
21504
|
+
const length = parentPathLength(parentPath, windowsPath);
|
|
21505
|
+
if (childPath.length <= length) return false;
|
|
21506
|
+
if (!startsWithPath(parentPath, length, childPath, windowsPath)) return false;
|
|
21507
|
+
return isSeparator(childPath.charCodeAt(length), windowsPath);
|
|
21014
21508
|
};
|
|
21015
21509
|
|
|
21510
|
+
/**
|
|
21511
|
+
* Convert a `file:` `URL` instance to a filesystem path; any other input
|
|
21512
|
+
* (including plain strings) is returned unchanged. Mirrors Node's `fs`, which
|
|
21513
|
+
* treats strings as literal paths and only `URL` objects as URLs (see
|
|
21514
|
+
* nodejs/node#17658) — so a directory literally named `file:` is never
|
|
21515
|
+
* mistaken for a URL.
|
|
21516
|
+
* @param {string | URL} maybeURL a path string or a `file:` `URL` instance
|
|
21517
|
+
* @returns {string} a filesystem path
|
|
21518
|
+
*/
|
|
21519
|
+
const toPath = (maybeURL) =>
|
|
21520
|
+
maybeURL instanceof URL ? fileURLToPath(maybeURL) : maybeURL;
|
|
21521
|
+
|
|
21016
21522
|
module.exports.PathType = PathType;
|
|
21017
21523
|
module.exports.createCachedBasename = createCachedBasename;
|
|
21018
21524
|
module.exports.createCachedDirname = createCachedDirname;
|
|
@@ -21021,10 +21527,13 @@ module.exports.deprecatedInvalidSegmentRegEx = deprecatedInvalidSegmentRegEx;
|
|
|
21021
21527
|
__webpack_unused_export__ = dirname;
|
|
21022
21528
|
module.exports.getType = getType;
|
|
21023
21529
|
module.exports.invalidSegmentRegEx = invalidSegmentRegEx;
|
|
21530
|
+
module.exports.isInside = isInside;
|
|
21024
21531
|
module.exports.isRelativeRequest = isRelativeRequest;
|
|
21025
21532
|
module.exports.isSubPath = isSubPath;
|
|
21533
|
+
__webpack_unused_export__ = isWindowsPath;
|
|
21026
21534
|
__webpack_unused_export__ = join;
|
|
21027
21535
|
module.exports.normalize = normalize;
|
|
21536
|
+
module.exports.toPath = toPath;
|
|
21028
21537
|
|
|
21029
21538
|
|
|
21030
21539
|
/***/ },
|
|
@@ -23858,35 +24367,12 @@ module.exports = Array.isArray || function (arr) {
|
|
|
23858
24367
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
23859
24368
|
|
|
23860
24369
|
"use strict";
|
|
23861
|
-
__webpack_require__.r(__webpack_exports__);
|
|
23862
24370
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23863
|
-
/* harmony export */ LOG_LEVELS: () => (/* binding */ e),
|
|
23864
|
-
/* harmony export */ createDateTimePipe: () => (/* binding */ g),
|
|
23865
|
-
/* harmony export */ createJsonPipe: () => (/* binding */ x),
|
|
23866
|
-
/* harmony export */ createJsonStringifyPipe: () => (/* binding */ P),
|
|
23867
|
-
/* harmony export */ createLogCachePipe: () => (/* binding */ O),
|
|
23868
24371
|
/* harmony export */ createLogLevelFilterPipe: () => (/* binding */ V),
|
|
23869
|
-
/* harmony export */
|
|
23870
|
-
/* harmony export */ createNoopPipe: () => (/* binding */ M),
|
|
23871
|
-
/* harmony export */ estimateArgsSizeByStringify: () => (/* binding */ L),
|
|
23872
|
-
/* harmony export */ generateUuidSimple: () => (/* binding */ v),
|
|
23873
|
-
/* harmony export */ getConsoleOverrides: () => (/* binding */ l),
|
|
23874
|
-
/* harmony export */ getDefaultDateTimePipeOptions: () => (/* binding */ f),
|
|
23875
|
-
/* harmony export */ getDefaultJsonPipeOptions: () => (/* binding */ h),
|
|
23876
|
-
/* harmony export */ getDefaultJsonSimplifierOptions: () => (/* binding */ y),
|
|
23877
|
-
/* harmony export */ getDefaultJsonStringifyPipeOptions: () => (/* binding */ S),
|
|
23878
|
-
/* harmony export */ getDefaultLogCachePipeOptions: () => (/* binding */ j),
|
|
23879
|
-
/* harmony export */ getLogMessageFilterPipeOptions: () => (/* binding */ I),
|
|
23880
|
-
/* harmony export */ getOriginalConsoleMethods: () => (/* binding */ u),
|
|
23881
|
-
/* harmony export */ installConsoleOverride: () => (/* binding */ o),
|
|
23882
|
-
/* harmony export */ installConsoleOverrides: () => (/* binding */ i),
|
|
23883
|
-
/* harmony export */ simplifyJson: () => (/* binding */ d),
|
|
23884
|
-
/* harmony export */ simplifyValue: () => (/* binding */ b),
|
|
23885
|
-
/* harmony export */ uninstallAllConsoleOverrides: () => (/* binding */ c),
|
|
23886
|
-
/* harmony export */ uninstallConsoleOverride: () => (/* binding */ s),
|
|
23887
|
-
/* harmony export */ uninstallConsoleOverrides: () => (/* binding */ a)
|
|
24372
|
+
/* harmony export */ installConsoleOverrides: () => (/* binding */ i)
|
|
23888
24373
|
/* harmony export */ });
|
|
23889
|
-
|
|
24374
|
+
/* unused harmony exports LOG_LEVELS, createDateTimePipe, createJsonPipe, createJsonStringifyPipe, createLogCachePipe, createLogMessageFilterPipe, createNoopPipe, estimateArgsSizeByStringify, generateUuidSimple, getConsoleOverrides, getDefaultDateTimePipeOptions, getDefaultJsonPipeOptions, getDefaultJsonSimplifierOptions, getDefaultJsonStringifyPipeOptions, getDefaultLogCachePipeOptions, getLogMessageFilterPipeOptions, getOriginalConsoleMethods, installConsoleOverride, simplifyJson, simplifyValue, uninstallAllConsoleOverrides, uninstallConsoleOverride, uninstallConsoleOverrides */
|
|
24375
|
+
const e=["debug","error","info","log","trace","warn"],t=[],r=()=>{},n={debug:r,error:r,info:r,log:r,trace:r,warn:r};function o(e){i(...Array.isArray(e)?e:[e])}function i(...o){!function(){if(n.debug===r)for(const r of e)n[r]=console[r],console[r]=(...e)=>{var o,i,s;let a=r,c=e;for(const e of t){const t=e(a,...c);if(!t||(Array.isArray(t)?0===(null!==(o=null==t?void 0:t.length)&&void 0!==o?o:0):0===(null!==(s=null===(i=t.args)||void 0===i?void 0:i.length)&&void 0!==s?s:0)))return;Array.isArray(t)?c=t:(a=t.level,c=t.args)}n[a](...c)}}();for(const e of o)!t.includes(e)&&e.onInstall&&e.onInstall(),t.push(e)}function s(e){a(...Array.isArray(e)?e:[e])}function a(...o){for(const e of o)for(let r=t.indexOf(e);r>=0;r=t.indexOf(e)){const e=t.splice(r,1)[0];!t.includes(e)&&e.onUninstall&&e.onUninstall()}!function(){if(!(t.length>0)&&n.debug!==r)for(const t of e)console[t]=n[t],n[t]=r}()}function c(){for(const e of[...t])s(e)}function l(){return[...t]}function u(){if(n.debug!==r)return Object.assign({},n);const t={};for(const r of e)t[r]=console[r];return t}function f(){return{dateFormatter:e=>new Date(e).toISOString()}}function g({dateFormatter:e}=f()){return(t,...r)=>[e(Date.now()),...r]}function y(){return{maxDepthLimit:10,maxArrayLength:100,maxObjectPropertyCount:100,isIgnoredProperty:()=>!1,replacePropertyValue:(e,t)=>t,depthLimitValue:"[Depth limit ~]",arrayLengthLimitValue:"[Array, length: $length ~]",objectPropertyCountLimitValue:"[Object, properties: $count ~]",circularReferenceValue:"[Circular ~]",functionValue:"[Function ~]",symbolValue:"[Symbol ~]"}}const p=(/* unused pure expression or super */ null && ({maxDepthLimit:10,maxArrayLength:100,maxObjectPropertyCount:100,isIgnoredProperty:()=>!1,replacePropertyValue:(e,t)=>t,depthLimitValue:"[Depth limit ~]",arrayLengthLimitValue:"[Array, length: $length ~]",objectPropertyCountLimitValue:"[Object, properties: $count ~]",circularReferenceValue:"[Circular ~]",functionValue:"[Function ~]",symbolValue:"[Symbol ~]"})),m=(/* unused pure expression or super */ null && (["cause","message","name","stack"]));function d(e,t={},r=0,n=new Set){const o=Object.assign(Object.assign({},p),t);if(r>o.maxDepthLimit)return o.depthLimitValue;if("string"==typeof(e=b(e))||"boolean"==typeof e||"number"==typeof e||null==e)return e;if(n.has(e))return o.circularReferenceValue;if(n.add(e),Array.isArray(e))return e.length>o.maxArrayLength?o.arrayLengthLimitValue.replace("$length",`${e.length}`):e.map((e=>d(e,o,r+1,n)));const i=Object.entries(e);if(i.length>o.maxObjectPropertyCount)return o.objectPropertyCountLimitValue.replace("$count",`${i.length}`);const s={};for(const[e,t]of i)0===r&&o.isIgnoredProperty(e)||(s[e]=d(t,o,r+1,n));for(const t of m)if(!s[t]&&!o.isIgnoredProperty(t)){const i=e[t];void 0!==i&&(s[t]=d(i,o,r+1,n))}if(o.replacePropertyValue!==p.replacePropertyValue)for(const[e,t]of Object.entries(s))s[e]=o.replacePropertyValue(e,t);return s}function b(e,t={}){if(null==e)return e;switch(typeof e){case"undefined":case"boolean":case"string":return e;case"bigint":return`BigInt(${e.toString()})`;case"number":return isNaN(e)?"NaN":e===1/0?"Infinity":e===-1/0?"-Infinity":e;case"function":return t.functionValue||p.functionValue;case"symbol":return t.symbolValue||p.symbolValue;case"object":if(e instanceof Set)return[...e.keys()];if(e instanceof Map)return Object.fromEntries([...e.entries()]);if(e instanceof String||e instanceof Number||e instanceof Boolean)return e.valueOf();if(e instanceof Date)return e.toISOString()}return e}function h(){return Object.assign(Object.assign({},{maxDepthLimit:10,maxArrayLength:100,maxObjectPropertyCount:100,isIgnoredProperty:()=>!1,replacePropertyValue:(e,t)=>t,depthLimitValue:"[Depth limit ~]",arrayLengthLimitValue:"[Array, length: $length ~]",objectPropertyCountLimitValue:"[Object, properties: $count ~]",circularReferenceValue:"[Circular ~]",functionValue:"[Function ~]",symbolValue:"[Symbol ~]"}),{messagePropertyName:"message",levelPropertyName:"level",levelPropertyFormatter:e=>e,timestampPropertyName:"timestamp",timestampPropertyFormatter:e=>new Date(e).toISOString(),messageIdPropertyName:"message_id",messageIdPropertyProvider:v,isIgnoredProperty:()=>!1,getObjectMessageToken:e=>`$${e+1}`,pickFieldNameAsObjectMessageTokenForSingleFieldObjects:!1,undefinedMessageValue:void 0})}function x(e={}){const t=h(),r=Object.assign(Object.assign({},t),e);let n,o="";const i=(e,...i)=>{const s={};let a;s[r.messagePropertyName]=void 0;let c=0;for(let e=0;e<i.length;e++){const t=b(i[e]);let n=t;if("object"==typeof t&&null!==t){let o=d(t,r);if(r.pickFieldNameAsObjectMessageTokenForSingleFieldObjects&&"object"==typeof o&&null!==o){const e=Object.entries(o);if(1===e.length){const[t,r]=e[0],i=`$${t}`;if(void 0===s[i])if(n=i,null===(l=r)||"string"==typeof l||void 0===l||"number"==typeof l||"boolean"==typeof l){const e="string"==typeof r?"'":"";n+=`:[${e}${r}${e}]`,o=void 0}else o=r}}"string"!=typeof n&&(n=r.getObjectMessageToken(c,t,e),c++),s[n]=o}else void 0===t?void 0!==r.undefinedMessageValue&&(n+=r.undefinedMessageValue):n=t;a=void 0===a?`${n}`:`${a} ${n}`}var l;if(a&&(s[r.messagePropertyName]=a),r.levelPropertyName&&(s[r.levelPropertyName]=r.levelPropertyFormatter(e)),r.timestampPropertyName&&(s[r.timestampPropertyName]=r.timestampPropertyFormatter(Date.now())),r.messageIdPropertyName){let a=n||r.messageIdPropertyProvider(e,...i);void 0===a&&(a=t.messageIdPropertyProvider()),o=a,s[r.messageIdPropertyName]=o,n=void 0}return[s]};return i.getLastMessageId=()=>o,i.setNextMessageId=e=>{n=e},i}function v(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{const r=(e+Math.floor(16*Math.random()))%16;return e=Math.floor(e/16),("x"===t?r:3&r|8).toString(16)}))}function S(){return Object.assign(Object.assign({},h()),{preStringifyCallback:()=>{}})}function P(e={}){const t=Object.assign(Object.assign({},S()),e),r=x(t),n=(e,...n)=>{const o=r(e,...n);if(0===o.length)return[];const i=o[0];return t.preStringifyCallback(i),[JSON.stringify(i)]};return n.getLastMessageId=r.getLastMessageId,n.setNextMessageId=r.setNextMessageId,n}function j(){return{cacheSize:1e3,cacheSizeByStringify:-1}}function O(e={}){const t=Object.assign(Object.assign({},{cacheSize:1e3,cacheSizeByStringify:-1}),e);if(t.cacheSize<0||isNaN(t.cacheSize))throw new Error(`Invalid cache size: ${t.cacheSize}`);const r={size:0};let n=!1,o=0;function i(){r.first&&(o>0&&(o-=L(...r.first.value.args)),r.first=r.first.next,r.size--)}const s=(e,...a)=>{if(0===t.cacheSize||n)return a;var c;c={value:{level:e,args:a,timestamp:Date.now()}},void 0===r.last?r.first=c:r.last.next=c,r.last=c,r.size++,t.cacheSizeByStringify>=0&&(o+=L(...c.value.args));const l=r.size>t.cacheSize,u=t.cacheSizeByStringify>=0&&o>t.cacheSizeByStringify;if((l||u)&&t.onCacheSizeReached){n=!0;try{t.onCacheSizeReached(s)}finally{n=!1}}if(u){for(;o>t.cacheSizeByStringify&&void 0!==r.first;)i();o=Math.max(o,0),void 0===r.first&&(o=0)}else l&&i();return a};return s.getMessages=()=>{const e=[];let t=r.first;for(;void 0!==t;)e.push(t.value),t=t.next;return e},s.clearMessages=()=>{r.first=void 0,r.last=void 0,r.size=0,o=0},s.onInstall=()=>s.clearMessages(),s}function L(...e){let t=0;for(const r of e)void 0!==r&&(t+=JSON.stringify(d(r)).length);return t}function V(e={}){const t=Object.assign({excludedLogLevels:[]},e);return(e,...r)=>{const n="function"==typeof t.excludedLogLevels?t.excludedLogLevels(e):t.excludedLogLevels;return("boolean"==typeof n?n:n.includes(e))?[]:r}}function I(){return{isCaseSensitive:!1,excludedMessageTokens:[]}}function N(e){const{excludedMessageTokens:t,isCaseSensitive:r}=Object.assign(Object.assign({},{isCaseSensitive:!1,excludedMessageTokens:[]}),e),n=t.filter((e=>"string"==typeof e)).map((e=>r?e:e.toLowerCase())),o=t.filter((e=>"object"==typeof e));return t.sort(((e,t)=>typeof e==typeof t?0:"string"==typeof e?-1:1)),(e,...i)=>{if(0===t.length)return i;if(r){for(const e of i)if("string"==typeof e){if(n.some((t=>e.includes(t))))return[];if(o.some((t=>t.test(e))))return[]}}else for(const e of i)if("string"==typeof e){const t=e.toLowerCase();if(n.some((e=>t.includes(e))))return[];if(o.some((t=>t.test(e))))return[]}return i}}function M(){return(e,...t)=>t}
|
|
23890
24376
|
//# sourceMappingURL=index.esm.js.map
|
|
23891
24377
|
|
|
23892
24378
|
/***/ },
|
|
@@ -28457,7 +28943,7 @@ exports.decode = function (buf, filenameEncoding) {
|
|
|
28457
28943
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
28458
28944
|
|
|
28459
28945
|
exports.extract = __webpack_require__(7810)
|
|
28460
|
-
|
|
28946
|
+
/* unused reexport */ __webpack_require__(642)
|
|
28461
28947
|
|
|
28462
28948
|
|
|
28463
28949
|
/***/ },
|
|
@@ -31685,17 +32171,18 @@ module.exports = function toBuffer(data, encoding) {
|
|
|
31685
32171
|
(__unused_webpack_module, exports) {
|
|
31686
32172
|
|
|
31687
32173
|
"use strict";
|
|
32174
|
+
var __webpack_unused_export__;
|
|
31688
32175
|
|
|
31689
|
-
|
|
31690
|
-
|
|
31691
|
-
|
|
31692
|
-
|
|
31693
|
-
|
|
31694
|
-
|
|
32176
|
+
__webpack_unused_export__ = ({ value: true });
|
|
32177
|
+
__webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = exports.h3 = exports.VF = __webpack_unused_export__ = exports.F3 = exports.eS = exports.Eh = exports.dH = exports.mz = exports.Pq = exports.lZ = exports.I1 = exports.xV = exports.Kq = exports.oL = exports.hp = exports.AI_PROVIDER_TYPES = __webpack_unused_export__ = void 0;
|
|
32178
|
+
__webpack_unused_export__ = isVendorAiChatModelName;
|
|
32179
|
+
__webpack_unused_export__ = isAiEmbeddingsModelName;
|
|
32180
|
+
__webpack_unused_export__ = isIntegrationEmbeddingModelSpec;
|
|
32181
|
+
__webpack_unused_export__ = isIntegrationModelSpec;
|
|
31695
32182
|
/**
|
|
31696
32183
|
* @category AI
|
|
31697
32184
|
*/
|
|
31698
|
-
|
|
32185
|
+
__webpack_unused_export__ = ['cohere', 'none'];
|
|
31699
32186
|
/** List of available AI provider types. See AiProviderType. */
|
|
31700
32187
|
exports.AI_PROVIDER_TYPES = [
|
|
31701
32188
|
'anthropic',
|
|
@@ -31720,7 +32207,7 @@ exports.AI_PROVIDER_TYPES = [
|
|
|
31720
32207
|
* Public OpenAI chat model names (active models only).
|
|
31721
32208
|
* @category AI
|
|
31722
32209
|
*/
|
|
31723
|
-
exports.
|
|
32210
|
+
exports.hp = [
|
|
31724
32211
|
'gpt-5.4-mini',
|
|
31725
32212
|
'gpt-5.4-nano',
|
|
31726
32213
|
'gpt-5.5',
|
|
@@ -31733,57 +32220,57 @@ exports.OPENAI_CHAT_MODEL_NAMES = [
|
|
|
31733
32220
|
* Public Gemini chat model names (active models only).
|
|
31734
32221
|
* @category AI
|
|
31735
32222
|
*/
|
|
31736
|
-
exports.
|
|
32223
|
+
exports.oL = ['gemini-3.1-pro', 'gemini-3.6-flash', 'gemini-3.5-flash-lite'];
|
|
31737
32224
|
/**
|
|
31738
32225
|
* Public Grok chat model names (active models only).
|
|
31739
32226
|
* @category AI
|
|
31740
32227
|
*/
|
|
31741
|
-
exports.
|
|
32228
|
+
exports.Kq = ['grok-4.3', 'grok-4-1-fast-reasoning', 'grok-4-1-fast-non-reasoning'];
|
|
31742
32229
|
/**
|
|
31743
32230
|
* Public Anthropic chat model names (active models only).
|
|
31744
32231
|
* @category AI
|
|
31745
32232
|
*/
|
|
31746
|
-
exports.
|
|
32233
|
+
exports.xV = ['claude-haiku-4-5-20251001', 'claude-opus-5', 'claude-sonnet-5'];
|
|
31747
32234
|
/**
|
|
31748
32235
|
* The supported AI model names.
|
|
31749
32236
|
* @category AI
|
|
31750
32237
|
*/
|
|
31751
|
-
exports.
|
|
31752
|
-
...exports.
|
|
31753
|
-
...exports.
|
|
31754
|
-
...exports.
|
|
31755
|
-
...exports.
|
|
32238
|
+
exports.I1 = [
|
|
32239
|
+
...exports.hp,
|
|
32240
|
+
...exports.xV,
|
|
32241
|
+
...exports.oL,
|
|
32242
|
+
...exports.Kq,
|
|
31756
32243
|
];
|
|
31757
32244
|
/** Checks if the given model name is a global AI chat model name. */
|
|
31758
32245
|
function isVendorAiChatModelName(modelName) {
|
|
31759
|
-
return exports.
|
|
32246
|
+
return exports.I1.includes(modelName);
|
|
31760
32247
|
}
|
|
31761
32248
|
/**
|
|
31762
32249
|
* @category AI
|
|
31763
32250
|
*/
|
|
31764
|
-
exports.
|
|
32251
|
+
exports.lZ = ['text-embedding-3-small'];
|
|
31765
32252
|
/**
|
|
31766
32253
|
* @category AI
|
|
31767
32254
|
*/
|
|
31768
|
-
exports.
|
|
32255
|
+
exports.Pq = ['voyage-3-large'];
|
|
31769
32256
|
/**
|
|
31770
32257
|
* @category AI
|
|
31771
32258
|
*/
|
|
31772
|
-
exports.
|
|
32259
|
+
exports.mz = ['titan-embed-text-v2'];
|
|
31773
32260
|
/**
|
|
31774
32261
|
* @category AI
|
|
31775
32262
|
*/
|
|
31776
|
-
exports.
|
|
31777
|
-
...exports.
|
|
31778
|
-
...exports.
|
|
31779
|
-
...exports.
|
|
32263
|
+
exports.dH = [
|
|
32264
|
+
...exports.lZ,
|
|
32265
|
+
...exports.Pq,
|
|
32266
|
+
...exports.mz,
|
|
31780
32267
|
];
|
|
31781
32268
|
/**
|
|
31782
32269
|
* Checks if the given model name is a valid AI embeddings model name.
|
|
31783
32270
|
* @category AI
|
|
31784
32271
|
*/
|
|
31785
32272
|
function isAiEmbeddingsModelName(modelName) {
|
|
31786
|
-
return exports.
|
|
32273
|
+
return exports.dH.includes(modelName);
|
|
31787
32274
|
}
|
|
31788
32275
|
/**
|
|
31789
32276
|
* Type guard for `IntegrationEmbeddingModelSpec`.
|
|
@@ -31796,7 +32283,7 @@ function isIntegrationEmbeddingModelSpec(model) {
|
|
|
31796
32283
|
* The supported AI image generation model names.
|
|
31797
32284
|
* @category AI
|
|
31798
32285
|
*/
|
|
31799
|
-
exports.
|
|
32286
|
+
exports.Eh = [
|
|
31800
32287
|
'gpt-image-1',
|
|
31801
32288
|
'gpt-image-1-mini',
|
|
31802
32289
|
'gpt-image-1.5',
|
|
@@ -31807,7 +32294,7 @@ exports.OPENAI_IMAGE_MODEL_NAMES = [
|
|
|
31807
32294
|
/**
|
|
31808
32295
|
* @category AI
|
|
31809
32296
|
*/
|
|
31810
|
-
exports.
|
|
32297
|
+
exports.eS = [
|
|
31811
32298
|
'whisper-1',
|
|
31812
32299
|
'gpt-4o-transcribe',
|
|
31813
32300
|
'gpt-4o-mini-transcribe',
|
|
@@ -31815,47 +32302,47 @@ exports.OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES = [
|
|
|
31815
32302
|
/**
|
|
31816
32303
|
* @category AI
|
|
31817
32304
|
*/
|
|
31818
|
-
exports.
|
|
32305
|
+
exports.F3 = ['tts-1', 'tts-1-hd', 'gpt-4o-mini-tts'];
|
|
31819
32306
|
/**
|
|
31820
32307
|
* @category AI
|
|
31821
32308
|
*/
|
|
31822
|
-
|
|
31823
|
-
...exports.
|
|
31824
|
-
...exports.
|
|
32309
|
+
__webpack_unused_export__ = [
|
|
32310
|
+
...exports.eS,
|
|
32311
|
+
...exports.F3,
|
|
31825
32312
|
];
|
|
31826
32313
|
/**
|
|
31827
32314
|
* @category AI
|
|
31828
32315
|
*/
|
|
31829
|
-
exports.
|
|
32316
|
+
exports.VF = ['stable-diffusion-core'];
|
|
31830
32317
|
/**
|
|
31831
32318
|
* @category AI
|
|
31832
32319
|
*/
|
|
31833
|
-
exports.
|
|
32320
|
+
exports.h3 = ['flux-pro-1.1', 'flux-kontext-pro'];
|
|
31834
32321
|
/**
|
|
31835
32322
|
* @category AI
|
|
31836
32323
|
*/
|
|
31837
|
-
|
|
31838
|
-
...exports.
|
|
31839
|
-
...exports.
|
|
31840
|
-
...exports.
|
|
32324
|
+
__webpack_unused_export__ = [
|
|
32325
|
+
...exports.Eh,
|
|
32326
|
+
...exports.VF,
|
|
32327
|
+
...exports.h3,
|
|
31841
32328
|
];
|
|
31842
32329
|
/**
|
|
31843
32330
|
* @category AI
|
|
31844
32331
|
*/
|
|
31845
|
-
|
|
32332
|
+
__webpack_unused_export__ = [...exports.eS];
|
|
31846
32333
|
/**
|
|
31847
32334
|
* @category AI
|
|
31848
32335
|
*/
|
|
31849
|
-
|
|
32336
|
+
__webpack_unused_export__ = [...exports.F3];
|
|
31850
32337
|
/**
|
|
31851
32338
|
* @category AI
|
|
31852
32339
|
*/
|
|
31853
|
-
|
|
32340
|
+
__webpack_unused_export__ = ['mp3', 'opus', 'aac', 'flac', 'wav', 'pcm'];
|
|
31854
32341
|
/**
|
|
31855
32342
|
* Where a chat model offered to an app comes from. See {@link ModelIdSpec.source}.
|
|
31856
32343
|
* @category AI
|
|
31857
32344
|
*/
|
|
31858
|
-
|
|
32345
|
+
__webpack_unused_export__ = ['vendor', 'connector', 'custom'];
|
|
31859
32346
|
/**
|
|
31860
32347
|
* Type guard to check if a model selection is integration-based.
|
|
31861
32348
|
* @category AI
|
|
@@ -31871,8 +32358,9 @@ function isIntegrationModelSpec(model) {
|
|
|
31871
32358
|
(__unused_webpack_module, exports) {
|
|
31872
32359
|
|
|
31873
32360
|
"use strict";
|
|
32361
|
+
var __webpack_unused_export__;
|
|
31874
32362
|
|
|
31875
|
-
|
|
32363
|
+
__webpack_unused_export__ = ({ value: true });
|
|
31876
32364
|
exports.CONNECTOR_IDS = void 0;
|
|
31877
32365
|
/**
|
|
31878
32366
|
* List of all connector package names.
|
|
@@ -31912,12 +32400,13 @@ exports.CONNECTOR_IDS = [
|
|
|
31912
32400
|
(__unused_webpack_module, exports) {
|
|
31913
32401
|
|
|
31914
32402
|
"use strict";
|
|
32403
|
+
var __webpack_unused_export__;
|
|
31915
32404
|
|
|
31916
|
-
|
|
31917
|
-
exports.
|
|
31918
|
-
|
|
32405
|
+
__webpack_unused_export__ = ({ value: true });
|
|
32406
|
+
exports.EL = exports.y4 = exports.q7 = exports.lO = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = exports.INTEGRATION_TYPES = __webpack_unused_export__ = void 0;
|
|
32407
|
+
__webpack_unused_export__ = isBuiltInIntegrationId;
|
|
31919
32408
|
/** @internal */
|
|
31920
|
-
|
|
32409
|
+
__webpack_unused_export__ = 'ai_agents';
|
|
31921
32410
|
/** List of all integration types supported by Squid. */
|
|
31922
32411
|
exports.INTEGRATION_TYPES = [
|
|
31923
32412
|
'active_directory',
|
|
@@ -32008,7 +32497,7 @@ exports.INTEGRATION_TYPES = [
|
|
|
32008
32497
|
/**
|
|
32009
32498
|
* @category Database
|
|
32010
32499
|
*/
|
|
32011
|
-
|
|
32500
|
+
__webpack_unused_export__ = [
|
|
32012
32501
|
'bigquery',
|
|
32013
32502
|
'built_in_db',
|
|
32014
32503
|
'clickhouse',
|
|
@@ -32027,7 +32516,7 @@ exports.DATA_INTEGRATION_TYPES = [
|
|
|
32027
32516
|
/**
|
|
32028
32517
|
* @category Auth
|
|
32029
32518
|
*/
|
|
32030
|
-
|
|
32519
|
+
__webpack_unused_export__ = [
|
|
32031
32520
|
'auth0',
|
|
32032
32521
|
'jwt_rsa',
|
|
32033
32522
|
'jwt_hmac',
|
|
@@ -32038,34 +32527,40 @@ exports.AUTH_INTEGRATION_TYPES = [
|
|
|
32038
32527
|
'firebase_auth',
|
|
32039
32528
|
'azure-entra-external-id',
|
|
32040
32529
|
];
|
|
32530
|
+
/**
|
|
32531
|
+
* Auth integration types that can OAuth-protect an MCP server (see `McpOAuthOptions` and
|
|
32532
|
+
* `AiAgentMcpServerConfig.oauthIntegrationId`). Kept in sync with the providers supported by the
|
|
32533
|
+
* MCP OAuth validation in core.
|
|
32534
|
+
*/
|
|
32535
|
+
__webpack_unused_export__ = ['auth0'];
|
|
32041
32536
|
/** Supported integration types for GraphQL-based services. */
|
|
32042
|
-
|
|
32537
|
+
__webpack_unused_export__ = ['graphql'];
|
|
32043
32538
|
/** Supported integration types for HTTP-based services. */
|
|
32044
|
-
|
|
32539
|
+
__webpack_unused_export__ = ['api'];
|
|
32045
32540
|
/** Supported schema types for integrations */
|
|
32046
|
-
|
|
32541
|
+
__webpack_unused_export__ = ['data', 'api', 'graphql'];
|
|
32047
32542
|
/**
|
|
32048
32543
|
* @category Database
|
|
32049
32544
|
*/
|
|
32050
|
-
exports.
|
|
32545
|
+
exports.lO = 'built_in_db';
|
|
32051
32546
|
/**
|
|
32052
32547
|
* @category Queue
|
|
32053
32548
|
*/
|
|
32054
|
-
exports.
|
|
32549
|
+
exports.q7 = 'built_in_queue';
|
|
32055
32550
|
/**
|
|
32056
32551
|
* ID for the cloud specific storage integration: s3 (built_in_s3) or gcs (built_in_gcs).
|
|
32057
32552
|
* @category
|
|
32058
32553
|
*/
|
|
32059
|
-
exports.
|
|
32554
|
+
exports.y4 = 'built_in_storage';
|
|
32060
32555
|
/** Integration IDs used for built-in integrations by Squid. */
|
|
32061
|
-
exports.
|
|
32062
|
-
exports.
|
|
32063
|
-
exports.
|
|
32064
|
-
exports.
|
|
32556
|
+
exports.EL = [
|
|
32557
|
+
exports.lO,
|
|
32558
|
+
exports.q7,
|
|
32559
|
+
exports.y4,
|
|
32065
32560
|
];
|
|
32066
32561
|
/** Returns true if ID is a built-in integration ID in Squid. */
|
|
32067
32562
|
function isBuiltInIntegrationId(id) {
|
|
32068
|
-
return exports.
|
|
32563
|
+
return exports.EL.includes(id);
|
|
32069
32564
|
}
|
|
32070
32565
|
|
|
32071
32566
|
|
|
@@ -32075,25 +32570,89 @@ function isBuiltInIntegrationId(id) {
|
|
|
32075
32570
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
32076
32571
|
|
|
32077
32572
|
"use strict";
|
|
32573
|
+
var __webpack_unused_export__;
|
|
32078
32574
|
|
|
32079
|
-
|
|
32080
|
-
exports.
|
|
32575
|
+
__webpack_unused_export__ = ({ value: true });
|
|
32576
|
+
exports.SH = exports.a7 = exports.AR = void 0;
|
|
32577
|
+
__webpack_unused_export__ = validateAppIdFormat;
|
|
32578
|
+
__webpack_unused_export__ = assertAppIdFormat;
|
|
32579
|
+
__webpack_unused_export__ = appIdFromHost;
|
|
32580
|
+
__webpack_unused_export__ = parseAppId;
|
|
32081
32581
|
exports.appIdWithEnvironmentId = appIdWithEnvironmentId;
|
|
32082
32582
|
exports.appIdWithEnvironmentIdAndDevId = appIdWithEnvironmentIdAndDevId;
|
|
32083
|
-
|
|
32084
|
-
|
|
32085
|
-
|
|
32583
|
+
__webpack_unused_export__ = validateEnvironment;
|
|
32584
|
+
__webpack_unused_export__ = verifyWithSquidDevId;
|
|
32585
|
+
__webpack_unused_export__ = omitSquidDevId;
|
|
32086
32586
|
/**
|
|
32087
32587
|
* The appId is the unique identifier of an application.
|
|
32088
32588
|
* It is the combination of the application id (as shown in the console), environment id (dev, prod) and the
|
|
32089
32589
|
* developer id (if exists). For example - "fdgfd90ds-dev-1234567890abcdef"
|
|
32090
32590
|
*/
|
|
32091
32591
|
const assertic_1 = __webpack_require__(3205);
|
|
32592
|
+
/**
|
|
32593
|
+
* A DNS label may not exceed 63 bytes, and the appId is one — see [appIdFromHost].
|
|
32594
|
+
*
|
|
32595
|
+
* @internal
|
|
32596
|
+
*/
|
|
32597
|
+
exports.AR = 63;
|
|
32598
|
+
/**
|
|
32599
|
+
* Shortest appId the platform has ever accepted. Not a DNS constraint — a long-standing sanity
|
|
32600
|
+
* guard, kept so consolidating the checks does not quietly widen what is allowed.
|
|
32601
|
+
*
|
|
32602
|
+
* @internal
|
|
32603
|
+
*/
|
|
32604
|
+
exports.a7 = 3;
|
|
32605
|
+
/** @internal */
|
|
32606
|
+
exports.SH = `<appId>[-<environmentId>[-<squidDeveloperId>]], non-empty segments of [A-Za-z0-9], ${exports.a7}-${exports.AR} chars`;
|
|
32607
|
+
/**
|
|
32608
|
+
* Checks the appId format every parser in the stack depends on.
|
|
32609
|
+
*
|
|
32610
|
+
* Two independent reasons, and the appId is terminal inside its own format but inside neither:
|
|
32611
|
+
* - It is a DNS label. `getApplicationUrl` builds `<appId>.<environmentPrefix>.<baseDomain>` and
|
|
32612
|
+
* servers recover it with [appIdFromHost], so a `.` is truncated away before anything validates
|
|
32613
|
+
* it — `app-dev-john.doe` arrives as `app-dev-john`, silently resolving to a different app — while
|
|
32614
|
+
* `/`, `?`, `#`, `:` break URL construction outright, and 63 bytes is the label limit.
|
|
32615
|
+
* - It is the first half of the Redis identifier `<prefix>_<appId>_<clientId>`. clientIds may
|
|
32616
|
+
* contain `_`, so that split is only unambiguous while appIds do not.
|
|
32617
|
+
*
|
|
32618
|
+
* @internal
|
|
32619
|
+
*/
|
|
32620
|
+
function validateAppIdFormat(appId) {
|
|
32621
|
+
const segments = appId.split('-');
|
|
32622
|
+
const isValid = appId.length >= exports.a7 &&
|
|
32623
|
+
appId.length <= exports.AR &&
|
|
32624
|
+
segments.length <= 3 &&
|
|
32625
|
+
segments.every(segment => /^[A-Za-z0-9]+$/.test(segment));
|
|
32626
|
+
return isValid ? null : 'INVALID_FORMAT';
|
|
32627
|
+
}
|
|
32628
|
+
/**
|
|
32629
|
+
* [validateAppIdFormat] for callers that treat a malformed appId as a bug rather than as input.
|
|
32630
|
+
*
|
|
32631
|
+
* @internal
|
|
32632
|
+
*/
|
|
32633
|
+
function assertAppIdFormat(appId) {
|
|
32634
|
+
(0, assertic_1.assertTruthy)(!validateAppIdFormat(appId), `Invalid appId '${appId}'. Format: ${exports.SH}`);
|
|
32635
|
+
}
|
|
32636
|
+
/**
|
|
32637
|
+
* Recovers the appId from an application host such as `<appId>.<environmentPrefix>.<baseDomain>`.
|
|
32638
|
+
*
|
|
32639
|
+
* The one place that knows the appId is the first DNS label, so the assumption is stated once
|
|
32640
|
+
* rather than re-derived at every ingress. Returns the label as-is without validating it: callers
|
|
32641
|
+
* decide whether an unusable value is a rejected request or a thrown error.
|
|
32642
|
+
*
|
|
32643
|
+
* @internal
|
|
32644
|
+
*/
|
|
32645
|
+
function appIdFromHost(host) {
|
|
32646
|
+
return host.split('.')[0];
|
|
32647
|
+
}
|
|
32092
32648
|
/** @internal */
|
|
32093
32649
|
function parseAppId(appId) {
|
|
32094
32650
|
(0, assertic_1.assertString)(appId, 'Invalid application ID');
|
|
32095
|
-
const
|
|
32096
|
-
|
|
32651
|
+
const segments = appId.split('-');
|
|
32652
|
+
// Counted, not tested for a truthy fourth element: `app-dev-alice-` splits into four parts whose
|
|
32653
|
+
// last is '', which a truthiness check would accept.
|
|
32654
|
+
(0, assertic_1.assertTruthy)(segments.length < 4, `Invalid application ID: ${appId}`);
|
|
32655
|
+
const [appIdWithoutEnv, environmentId, squidDeveloperId] = segments;
|
|
32097
32656
|
return {
|
|
32098
32657
|
appId: appIdWithoutEnv,
|
|
32099
32658
|
environmentId: (environmentId ?? 'prod'),
|
|
@@ -32133,8 +32692,9 @@ function omitSquidDevId(appId) {
|
|
|
32133
32692
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
32134
32693
|
|
|
32135
32694
|
"use strict";
|
|
32695
|
+
var __webpack_unused_export__;
|
|
32136
32696
|
|
|
32137
|
-
|
|
32697
|
+
__webpack_unused_export__ = ({ value: true });
|
|
32138
32698
|
exports.CONNECTOR_METADATA_JSON_FILE = exports.CONNECTOR_IDS = void 0;
|
|
32139
32699
|
const connector_public_types_1 = __webpack_require__(3046);
|
|
32140
32700
|
Object.defineProperty(exports, "CONNECTOR_IDS", ({ enumerable: true, get: function () { return connector_public_types_1.CONNECTOR_IDS; } }));
|
|
@@ -32148,8 +32708,9 @@ exports.CONNECTOR_METADATA_JSON_FILE = 'connector-metadata.json';
|
|
|
32148
32708
|
(__unused_webpack_module, exports) {
|
|
32149
32709
|
|
|
32150
32710
|
"use strict";
|
|
32711
|
+
var __webpack_unused_export__;
|
|
32151
32712
|
|
|
32152
|
-
|
|
32713
|
+
__webpack_unused_export__ = ({ value: true });
|
|
32153
32714
|
exports.getConsoleAppRegionByStage = getConsoleAppRegionByStage;
|
|
32154
32715
|
/**
|
|
32155
32716
|
* Returns Console application Squid region for the given stage. */
|
|
@@ -32173,31 +32734,32 @@ function getConsoleAppRegionByStage(stage) {
|
|
|
32173
32734
|
(__unused_webpack_module, exports) {
|
|
32174
32735
|
|
|
32175
32736
|
"use strict";
|
|
32737
|
+
var __webpack_unused_export__;
|
|
32176
32738
|
|
|
32177
|
-
|
|
32178
|
-
|
|
32739
|
+
__webpack_unused_export__ = ({ value: true });
|
|
32740
|
+
__webpack_unused_export__ = __webpack_unused_export__ = exports.MILLIS_PER_DAY = __webpack_unused_export__ = __webpack_unused_export__ = exports.MILLIS_PER_SECOND = exports.LW = exports.FN = exports.xz = exports.NG = exports.fA = void 0;
|
|
32179
32741
|
/** @internal */
|
|
32180
|
-
exports.
|
|
32742
|
+
exports.fA = 60;
|
|
32181
32743
|
/** @internal */
|
|
32182
|
-
exports.
|
|
32744
|
+
exports.NG = 60 * exports.fA;
|
|
32183
32745
|
/** @internal */
|
|
32184
|
-
exports.
|
|
32746
|
+
exports.xz = 24 * exports.NG;
|
|
32185
32747
|
/** @internal */
|
|
32186
|
-
exports.
|
|
32748
|
+
exports.FN = 7 * exports.xz;
|
|
32187
32749
|
/** @internal */
|
|
32188
|
-
exports.
|
|
32750
|
+
exports.LW = 30 * exports.xz;
|
|
32189
32751
|
/** @internal */
|
|
32190
32752
|
exports.MILLIS_PER_SECOND = 1000;
|
|
32191
32753
|
/** @internal */
|
|
32192
|
-
|
|
32754
|
+
__webpack_unused_export__ = exports.fA * exports.MILLIS_PER_SECOND;
|
|
32193
32755
|
/** @internal */
|
|
32194
|
-
|
|
32756
|
+
__webpack_unused_export__ = exports.NG * exports.MILLIS_PER_SECOND;
|
|
32195
32757
|
/** @internal */
|
|
32196
|
-
exports.MILLIS_PER_DAY = exports.
|
|
32758
|
+
exports.MILLIS_PER_DAY = exports.xz * exports.MILLIS_PER_SECOND;
|
|
32197
32759
|
/** @internal */
|
|
32198
|
-
|
|
32760
|
+
__webpack_unused_export__ = exports.FN * exports.MILLIS_PER_SECOND;
|
|
32199
32761
|
/** @internal */
|
|
32200
|
-
|
|
32762
|
+
__webpack_unused_export__ = exports.LW * exports.MILLIS_PER_SECOND;
|
|
32201
32763
|
|
|
32202
32764
|
|
|
32203
32765
|
/***/ },
|
|
@@ -32284,9 +32846,10 @@ function getRuntimeVmLabel() {
|
|
|
32284
32846
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
32285
32847
|
|
|
32286
32848
|
"use strict";
|
|
32849
|
+
var __webpack_unused_export__;
|
|
32287
32850
|
|
|
32288
|
-
|
|
32289
|
-
|
|
32851
|
+
__webpack_unused_export__ = ({ value: true });
|
|
32852
|
+
__webpack_unused_export__ = __webpack_unused_export__ = exports.UD = __webpack_unused_export__ = exports.assertConnectorId = __webpack_unused_export__ = void 0;
|
|
32290
32853
|
const assertic_1 = __webpack_require__(3205);
|
|
32291
32854
|
const ai_common_public_types_1 = __webpack_require__(6587);
|
|
32292
32855
|
const integration_public_types_1 = __webpack_require__(6205);
|
|
@@ -32295,7 +32858,7 @@ const connector_types_1 = __webpack_require__(3420);
|
|
|
32295
32858
|
const assertIntegrationType = (value, context = undefined) => {
|
|
32296
32859
|
(0, assertic_1.assertTruthy)(integration_public_types_1.INTEGRATION_TYPES.includes(value), () => (0, assertic_1.formatError)(context, `Not a valid integration type`, value));
|
|
32297
32860
|
};
|
|
32298
|
-
|
|
32861
|
+
__webpack_unused_export__ = assertIntegrationType;
|
|
32299
32862
|
const assertConnectorId = (value, context = undefined) => {
|
|
32300
32863
|
(0, assertic_1.assertTruthy)(connector_types_1.CONNECTOR_IDS.includes(value), () => (0, assertic_1.formatError)(context, `Not a valid connector id`, value));
|
|
32301
32864
|
};
|
|
@@ -32305,15 +32868,15 @@ const assertNotBuiltInIntegrationType = (value, context = undefined) => {
|
|
|
32305
32868
|
(0, assertic_1.assertString)(value, context);
|
|
32306
32869
|
(0, assertic_1.assertTruthy)(!['built_in_db', 'built_in_queue', 'built_in_s3'].includes(value), () => (0, assertic_1.formatError)(context, `The value can't be a built-in integration type`, value));
|
|
32307
32870
|
};
|
|
32308
|
-
|
|
32871
|
+
__webpack_unused_export__ = assertNotBuiltInIntegrationType;
|
|
32309
32872
|
const assertAiProviderType = (value, context = undefined) => {
|
|
32310
32873
|
(0, assertic_1.assertTruthy)(ai_common_public_types_1.AI_PROVIDER_TYPES.includes(value), () => (0, assertic_1.formatError)(context, 'Invalid AI provider type', value));
|
|
32311
32874
|
};
|
|
32312
|
-
exports.
|
|
32313
|
-
|
|
32314
|
-
apiKeys: (0, assertic_1.recordAssertion)(assertic_1.assertString, { keyAssertion: exports.
|
|
32875
|
+
exports.UD = assertAiProviderType;
|
|
32876
|
+
__webpack_unused_export__ = {
|
|
32877
|
+
apiKeys: (0, assertic_1.recordAssertion)(assertic_1.assertString, { keyAssertion: exports.UD }),
|
|
32315
32878
|
};
|
|
32316
|
-
|
|
32879
|
+
__webpack_unused_export__ = {
|
|
32317
32880
|
appConnectors: (0, assertic_1.arrayAssertion)(exports.assertConnectorId, { uniqueByIdentity: (v) => v }),
|
|
32318
32881
|
};
|
|
32319
32882
|
|
|
@@ -32324,8 +32887,9 @@ exports.applicationAppConnectorsAssertion = {
|
|
|
32324
32887
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
32325
32888
|
|
|
32326
32889
|
"use strict";
|
|
32890
|
+
var __webpack_unused_export__;
|
|
32327
32891
|
|
|
32328
|
-
|
|
32892
|
+
__webpack_unused_export__ = ({ value: true });
|
|
32329
32893
|
exports.debugLogFilterPipe = void 0;
|
|
32330
32894
|
const logpipes_1 = __webpack_require__(6102);
|
|
32331
32895
|
const enable_debug_logs_decorator_1 = __webpack_require__(5692);
|
|
@@ -32347,9 +32911,10 @@ exports.debugLogFilterPipe = (0, logpipes_1.createLogLevelFilterPipe)({
|
|
|
32347
32911
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
32348
32912
|
|
|
32349
32913
|
"use strict";
|
|
32914
|
+
var __webpack_unused_export__;
|
|
32350
32915
|
|
|
32351
|
-
|
|
32352
|
-
|
|
32916
|
+
__webpack_unused_export__ = ({ value: true });
|
|
32917
|
+
__webpack_unused_export__ = EnableDebugLogs;
|
|
32353
32918
|
exports.isInDebugDecoratorContext = isInDebugDecoratorContext;
|
|
32354
32919
|
const async_hooks_1 = __webpack_require__(290);
|
|
32355
32920
|
const store = new async_hooks_1.AsyncLocalStorage();
|
|
@@ -32382,13 +32947,14 @@ function isInDebugDecoratorContext() {
|
|
|
32382
32947
|
(__unused_webpack_module, exports) {
|
|
32383
32948
|
|
|
32384
32949
|
"use strict";
|
|
32950
|
+
var __webpack_unused_export__;
|
|
32385
32951
|
|
|
32386
|
-
|
|
32387
|
-
|
|
32388
|
-
|
|
32952
|
+
__webpack_unused_export__ = ({ value: true });
|
|
32953
|
+
__webpack_unused_export__ = void 0;
|
|
32954
|
+
__webpack_unused_export__ = getGlobal;
|
|
32389
32955
|
exports.isDebugEnabled = isDebugEnabled;
|
|
32390
32956
|
exports.enableDebugLogs = enableDebugLogs;
|
|
32391
|
-
|
|
32957
|
+
__webpack_unused_export__ = disableTimestampsInLog;
|
|
32392
32958
|
/** @internal */
|
|
32393
32959
|
function getGlobal() {
|
|
32394
32960
|
if (typeof window !== 'undefined') {
|
|
@@ -32452,7 +33018,7 @@ class DebugLogger {
|
|
|
32452
33018
|
console.debug(`${getLogPrefixString()} DEBUG`, ...args);
|
|
32453
33019
|
}
|
|
32454
33020
|
}
|
|
32455
|
-
|
|
33021
|
+
__webpack_unused_export__ = DebugLogger;
|
|
32456
33022
|
function getLogPrefixString() {
|
|
32457
33023
|
if (isTimestampsEnabled()) {
|
|
32458
33024
|
const date = new Date();
|
|
@@ -32470,20 +33036,20 @@ function getLogPrefixString() {
|
|
|
32470
33036
|
(__unused_webpack_module, exports) {
|
|
32471
33037
|
|
|
32472
33038
|
"use strict";
|
|
33039
|
+
var __webpack_unused_export__;
|
|
32473
33040
|
|
|
32474
|
-
|
|
32475
|
-
exports.
|
|
32476
|
-
|
|
32477
|
-
|
|
33041
|
+
__webpack_unused_export__ = ({ value: true });
|
|
33042
|
+
exports.sQ = void 0;
|
|
33043
|
+
__webpack_unused_export__ = isKotlinPath;
|
|
33044
|
+
__webpack_unused_export__ = getEnvironmentPrefix;
|
|
32478
33045
|
exports.getApplicationUrl = getApplicationUrl;
|
|
32479
|
-
exports.
|
|
33046
|
+
exports.sQ = [
|
|
32480
33047
|
'application',
|
|
32481
33048
|
'auth',
|
|
32482
33049
|
'mutation',
|
|
32483
33050
|
'native-query',
|
|
32484
33051
|
'query',
|
|
32485
33052
|
'queue',
|
|
32486
|
-
'notification',
|
|
32487
33053
|
// Note: every `/ws/*` WebSocket path is served by the TypeScript core (port 8000), never Kotlin.
|
|
32488
33054
|
];
|
|
32489
33055
|
/**
|
|
@@ -32493,7 +33059,7 @@ exports.KOTLIN_CONTROLLERS = [
|
|
|
32493
33059
|
function isKotlinPath(path) {
|
|
32494
33060
|
const cleaned = path.replace(/^\/+/, '');
|
|
32495
33061
|
const first = cleaned.split('/')[0] || '';
|
|
32496
|
-
return exports.
|
|
33062
|
+
return exports.sQ.includes(first);
|
|
32497
33063
|
}
|
|
32498
33064
|
function getEnvironmentPrefix(shard, region, cloudId, stage) {
|
|
32499
33065
|
if (region === 'local') {
|
|
@@ -32547,10 +33113,11 @@ function isIOS(regionPrefix) {
|
|
|
32547
33113
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
32548
33114
|
|
|
32549
33115
|
"use strict";
|
|
33116
|
+
var __webpack_unused_export__;
|
|
32550
33117
|
|
|
32551
|
-
|
|
33118
|
+
__webpack_unused_export__ = ({ value: true });
|
|
32552
33119
|
exports.timeSince = timeSince;
|
|
32553
|
-
|
|
33120
|
+
__webpack_unused_export__ = timePeriod;
|
|
32554
33121
|
/*** The file contains logging helper methods. Used to reduce boilerplate code in logging functions. */
|
|
32555
33122
|
const time_units_1 = __webpack_require__(1929);
|
|
32556
33123
|
/**
|
|
@@ -32673,9 +33240,10 @@ async function populateOpenApiControllersMap(bundleData, codeDir, codeType) {
|
|
|
32673
33240
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
32674
33241
|
|
|
32675
33242
|
"use strict";
|
|
33243
|
+
var __webpack_unused_export__;
|
|
32676
33244
|
|
|
32677
|
-
|
|
32678
|
-
|
|
33245
|
+
__webpack_unused_export__ = ({ value: true });
|
|
33246
|
+
__webpack_unused_export__ = getProcessEnv;
|
|
32679
33247
|
exports.isEnvVarTruthy = isEnvVarTruthy;
|
|
32680
33248
|
const assertic_1 = __webpack_require__(3205);
|
|
32681
33249
|
function getProcessEnv(key) {
|
|
@@ -32699,11 +33267,12 @@ function isEnvVarTruthy(variableName) {
|
|
|
32699
33267
|
(__unused_webpack_module, exports) {
|
|
32700
33268
|
|
|
32701
33269
|
"use strict";
|
|
33270
|
+
var __webpack_unused_export__;
|
|
32702
33271
|
|
|
32703
|
-
|
|
33272
|
+
__webpack_unused_export__ = ({ value: true });
|
|
32704
33273
|
exports.parseSquidRegion = parseSquidRegion;
|
|
32705
|
-
|
|
32706
|
-
|
|
33274
|
+
__webpack_unused_export__ = isDefaultOrLocalRegion;
|
|
33275
|
+
__webpack_unused_export__ = getCloudId;
|
|
32707
33276
|
/**
|
|
32708
33277
|
* Checks if a string is a valid stage name.
|
|
32709
33278
|
*
|
|
@@ -33657,8 +34226,9 @@ async function deploy(consoleRegion, appId, bundlePath, apiKey, verbose, direct,
|
|
|
33657
34226
|
(__unused_webpack_module, exports) {
|
|
33658
34227
|
|
|
33659
34228
|
"use strict";
|
|
34229
|
+
var __webpack_unused_export__;
|
|
33660
34230
|
|
|
33661
|
-
|
|
34231
|
+
__webpack_unused_export__ = ({ value: true });
|
|
33662
34232
|
exports.environment = void 0;
|
|
33663
34233
|
exports.environment = {
|
|
33664
34234
|
consoleAppId: 'console',
|
|
@@ -33882,7 +34452,7 @@ function run() {
|
|
|
33882
34452
|
setupStartCommand(yargs_1.default);
|
|
33883
34453
|
setupUndeployCommand(yargs_1.default);
|
|
33884
34454
|
setupUpdateSkillsCommand(yargs_1.default);
|
|
33885
|
-
yargs_1.default.parse();
|
|
34455
|
+
void yargs_1.default.parse();
|
|
33886
34456
|
}
|
|
33887
34457
|
function setupStartCommand(yargs) {
|
|
33888
34458
|
yargs.command('start', 'Starts the local development server', yargs => {
|
|
@@ -34487,8 +35057,9 @@ async function startPython() {
|
|
|
34487
35057
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
34488
35058
|
|
|
34489
35059
|
"use strict";
|
|
35060
|
+
var __webpack_unused_export__;
|
|
34490
35061
|
|
|
34491
|
-
|
|
35062
|
+
__webpack_unused_export__ = ({ value: true });
|
|
34492
35063
|
exports.undeploy = undeploy;
|
|
34493
35064
|
const assertic_1 = __webpack_require__(3205);
|
|
34494
35065
|
const communication_types_1 = __webpack_require__(3443);
|
|
@@ -34837,8 +35408,9 @@ function exitWithError(...messages) {
|
|
|
34837
35408
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
34838
35409
|
|
|
34839
35410
|
"use strict";
|
|
35411
|
+
var __webpack_unused_export__;
|
|
34840
35412
|
|
|
34841
|
-
|
|
35413
|
+
__webpack_unused_export__ = ({ value: true });
|
|
34842
35414
|
exports.reportLocalBackendInitialized = reportLocalBackendInitialized;
|
|
34843
35415
|
const assertic_1 = __webpack_require__(3205);
|
|
34844
35416
|
const http_1 = __webpack_require__(866);
|
|
@@ -35651,6 +36223,9 @@ var typedArrays = availableTypedArrays();
|
|
|
35651
36223
|
|
|
35652
36224
|
var $slice = callBound('String.prototype.slice');
|
|
35653
36225
|
|
|
36226
|
+
/** @import { BoundSet, BoundSlice, Cache, Getter } from './types' */
|
|
36227
|
+
/** @import { TypedArrayName } from '.' */
|
|
36228
|
+
|
|
35654
36229
|
/** @type {<T = unknown>(array: readonly T[], value: unknown) => number} */
|
|
35655
36230
|
var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {
|
|
35656
36231
|
for (var i = 0; i < array.length; i += 1) {
|
|
@@ -35661,8 +36236,7 @@ var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(ar
|
|
|
35661
36236
|
return -1;
|
|
35662
36237
|
};
|
|
35663
36238
|
|
|
35664
|
-
/** @
|
|
35665
|
-
/** @type {import('./types').Cache} */
|
|
36239
|
+
/** @type {Cache} */
|
|
35666
36240
|
var cache = { __proto__: null };
|
|
35667
36241
|
if (hasToStringTag && gOPD && getProto) {
|
|
35668
36242
|
forEach(typedArrays, function (typedArray) {
|
|
@@ -35679,7 +36253,8 @@ if (hasToStringTag && gOPD && getProto) {
|
|
|
35679
36253
|
if (descriptor && descriptor.get) {
|
|
35680
36254
|
var bound = callBind(descriptor.get);
|
|
35681
36255
|
cache[
|
|
35682
|
-
/** @type {`$${
|
|
36256
|
+
/** @type {`$${TypedArrayName}`} */
|
|
36257
|
+
('$' + typedArray)
|
|
35683
36258
|
] = bound;
|
|
35684
36259
|
}
|
|
35685
36260
|
}
|
|
@@ -35689,62 +36264,72 @@ if (hasToStringTag && gOPD && getProto) {
|
|
|
35689
36264
|
var arr = new g[typedArray]();
|
|
35690
36265
|
var fn = arr.slice || arr.set;
|
|
35691
36266
|
if (fn) {
|
|
35692
|
-
var bound = /** @type {
|
|
36267
|
+
var bound = /** @type {BoundSlice | BoundSet} */ (
|
|
35693
36268
|
// @ts-expect-error TODO FIXME
|
|
35694
36269
|
callBind(fn)
|
|
35695
36270
|
);
|
|
35696
36271
|
cache[
|
|
35697
|
-
/** @type {`$${
|
|
36272
|
+
/** @type {`$${TypedArrayName}`} */
|
|
36273
|
+
('$' + typedArray)
|
|
35698
36274
|
] = bound;
|
|
35699
36275
|
}
|
|
35700
36276
|
});
|
|
35701
36277
|
}
|
|
35702
36278
|
|
|
35703
|
-
/** @type {(value: object) => false |
|
|
35704
|
-
|
|
35705
|
-
/** @type {ReturnType<typeof
|
|
36279
|
+
/** @type {(value: object) => false | TypedArrayName} */
|
|
36280
|
+
function tryTypedArrays(value) {
|
|
36281
|
+
/** @type {ReturnType<typeof tryTypedArrays>} */ var found = false;
|
|
35706
36282
|
forEach(
|
|
35707
|
-
/** @type {Record
|
|
35708
|
-
/** @
|
|
36283
|
+
/** @type {Record<`$${TypedArrayName}`, Getter>} */ (cache),
|
|
36284
|
+
/** @param {Getter} getter @param {`$${TypedArrayName}`} typedArray */
|
|
35709
36285
|
function (getter, typedArray) {
|
|
35710
36286
|
if (!found) {
|
|
35711
36287
|
try {
|
|
35712
36288
|
// @ts-expect-error a throw is fine here
|
|
35713
36289
|
if ('$' + getter(value) === typedArray) {
|
|
35714
|
-
found = /** @type {
|
|
36290
|
+
found = /** @type {TypedArrayName} */ ($slice(typedArray, 1));
|
|
35715
36291
|
}
|
|
35716
36292
|
} catch (e) { /**/ }
|
|
35717
36293
|
}
|
|
35718
36294
|
}
|
|
35719
36295
|
);
|
|
35720
36296
|
return found;
|
|
35721
|
-
}
|
|
36297
|
+
}
|
|
35722
36298
|
|
|
35723
|
-
/** @type {(value: object) => false |
|
|
35724
|
-
|
|
35725
|
-
/** @type {ReturnType<typeof
|
|
36299
|
+
/** @type {(value: object) => false | TypedArrayName} */
|
|
36300
|
+
function trySlices(value) {
|
|
36301
|
+
/** @type {ReturnType<typeof trySlices>} */ var found = false;
|
|
35726
36302
|
forEach(
|
|
35727
|
-
/** @type {Record
|
|
35728
|
-
/** @
|
|
36303
|
+
/** @type {Record<`$${TypedArrayName}`, Getter>} */(cache),
|
|
36304
|
+
/** @param {Getter} getter @param {`$${TypedArrayName}`} name */ function (getter, name) {
|
|
35729
36305
|
if (!found) {
|
|
35730
36306
|
try {
|
|
35731
36307
|
// @ts-expect-error a throw is fine here
|
|
35732
36308
|
getter(value);
|
|
35733
|
-
found = /** @type {
|
|
36309
|
+
found = /** @type {TypedArrayName} */ ($slice(name, 1));
|
|
35734
36310
|
} catch (e) { /**/ }
|
|
35735
36311
|
}
|
|
35736
36312
|
}
|
|
35737
36313
|
);
|
|
35738
36314
|
return found;
|
|
35739
|
-
}
|
|
36315
|
+
}
|
|
35740
36316
|
|
|
35741
|
-
/** @type {
|
|
36317
|
+
/** @type {(tag: unknown) => tag is typeof typedArrays[number]} */
|
|
36318
|
+
function isTATag(tag) {
|
|
36319
|
+
return $indexOf(typedArrays, tag) > -1;
|
|
36320
|
+
}
|
|
36321
|
+
|
|
36322
|
+
/**
|
|
36323
|
+
* @type {import('.')}
|
|
36324
|
+
* @param {unknown} value
|
|
36325
|
+
*/
|
|
35742
36326
|
module.exports = function whichTypedArray(value) {
|
|
35743
|
-
if (!value || typeof value !== 'object') {
|
|
36327
|
+
if (!value || typeof value !== 'object') {
|
|
36328
|
+
return false;
|
|
36329
|
+
}
|
|
35744
36330
|
if (!hasToStringTag) {
|
|
35745
|
-
/** @type {string} */
|
|
35746
36331
|
var tag = $slice($toString(value), 8, -1);
|
|
35747
|
-
if (
|
|
36332
|
+
if (isTATag(tag)) {
|
|
35748
36333
|
return tag;
|
|
35749
36334
|
}
|
|
35750
36335
|
if (tag !== 'Object') {
|
|
@@ -35830,7 +36415,7 @@ function extend() {
|
|
|
35830
36415
|
(module) {
|
|
35831
36416
|
|
|
35832
36417
|
function webpackEmptyContext(req) {
|
|
35833
|
-
|
|
36418
|
+
const e = new Error("Cannot find module '" + req + "'");
|
|
35834
36419
|
e.code = 'MODULE_NOT_FOUND';
|
|
35835
36420
|
throw e;
|
|
35836
36421
|
}
|
|
@@ -35845,7 +36430,7 @@ module.exports = webpackEmptyContext;
|
|
|
35845
36430
|
(module) {
|
|
35846
36431
|
|
|
35847
36432
|
function webpackEmptyContext(req) {
|
|
35848
|
-
|
|
36433
|
+
const e = new Error("Cannot find module '" + req + "'");
|
|
35849
36434
|
e.code = 'MODULE_NOT_FOUND';
|
|
35850
36435
|
throw e;
|
|
35851
36436
|
}
|
|
@@ -35860,7 +36445,7 @@ module.exports = webpackEmptyContext;
|
|
|
35860
36445
|
(module) {
|
|
35861
36446
|
|
|
35862
36447
|
function webpackEmptyContext(req) {
|
|
35863
|
-
|
|
36448
|
+
const e = new Error("Cannot find module '" + req + "'");
|
|
35864
36449
|
e.code = 'MODULE_NOT_FOUND';
|
|
35865
36450
|
throw e;
|
|
35866
36451
|
}
|
|
@@ -35874,6 +36459,7 @@ module.exports = webpackEmptyContext;
|
|
|
35874
36459
|
/***/ 3660
|
|
35875
36460
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
35876
36461
|
|
|
36462
|
+
var __webpack_unused_export__;
|
|
35877
36463
|
var fs = __webpack_require__(9896);
|
|
35878
36464
|
var zlib = __webpack_require__(3106);
|
|
35879
36465
|
var fd_slicer = __webpack_require__(4602);
|
|
@@ -35884,15 +36470,15 @@ var Transform = (__webpack_require__(2203).Transform);
|
|
|
35884
36470
|
var PassThrough = (__webpack_require__(2203).PassThrough);
|
|
35885
36471
|
var Writable = (__webpack_require__(2203).Writable);
|
|
35886
36472
|
|
|
35887
|
-
|
|
35888
|
-
|
|
36473
|
+
__webpack_unused_export__ = open;
|
|
36474
|
+
__webpack_unused_export__ = fromFd;
|
|
35889
36475
|
exports.fromBuffer = fromBuffer;
|
|
35890
|
-
|
|
35891
|
-
|
|
35892
|
-
|
|
35893
|
-
|
|
35894
|
-
|
|
35895
|
-
|
|
36476
|
+
__webpack_unused_export__ = fromRandomAccessReader;
|
|
36477
|
+
__webpack_unused_export__ = dosDateTimeToDate;
|
|
36478
|
+
__webpack_unused_export__ = validateFileName;
|
|
36479
|
+
__webpack_unused_export__ = ZipFile;
|
|
36480
|
+
__webpack_unused_export__ = Entry;
|
|
36481
|
+
__webpack_unused_export__ = RandomAccessReader;
|
|
35896
36482
|
|
|
35897
36483
|
function open(path, options, callback) {
|
|
35898
36484
|
if (typeof options === "function") {
|
|
@@ -37392,8 +37978,8 @@ module.exports = y18n;
|
|
|
37392
37978
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
37393
37979
|
|
|
37394
37980
|
"use strict";
|
|
37395
|
-
var t=__webpack_require__(2613);class e extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}let s,i=[];function n(t,o,a,h){s=h;let l={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return l;const r=/\.json|\..*rc$/.test(t.extends);let h=null;if(r)h=function(t,e){return s.path.resolve(t,e)}(o,t.extends);else try{h=/*require.resolve*/(__webpack_require__(7315).resolve(t.extends))}catch(e){return t}!function(t){if(i.indexOf(t)>-1)throw new e(`Circular extended configurations: '${t}'.`)}(h),i.push(h),l=r?JSON.parse(s.readFileSync(h,"utf8")):__webpack_require__(7315)(t.extends),delete t.extends,l=n(l,s.path.dirname(h),a,s)}return i=[],a?r(l,t):Object.assign({},l,t)}function r(t,e){const s={};function i(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(s,t);for(const n of Object.keys(e))i(e[n])&&i(s[n])?s[n]=r(t[n],e[n]):s[n]=e[n];return s}function o(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,i=e.shift();if(!i)throw new Error(`No command found in: ${t}`);const n={cmd:i.replace(s,""),demanded:[],optional:[]};return e.forEach(((t,i)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&i===e.length-1&&(r=!0),/^\[/.test(t)?n.optional.push({cmd:t.replace(s,"").split("|"),variadic:r}):n.demanded.push({cmd:t.replace(s,"").split("|"),variadic:r})})),n}const a=["first","second","third","fourth","fifth","sixth"];function h(t,s,i){try{let n=0;const[r,a,h]="object"==typeof t?[{demanded:[],optional:[]},t,s]:[o(`cmd ${t}`),s,i],f=[].slice.call(a);for(;f.length&&void 0===f[f.length-1];)f.pop();const d=h||f.length;if(d<r.demanded.length)throw new e(`Not enough arguments provided. Expected ${r.demanded.length} but received ${f.length}.`);const u=r.demanded.length+r.optional.length;if(d>u)throw new e(`Too many arguments provided. Expected max ${u} but received ${d}.`);r.demanded.forEach((t=>{const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1})),r.optional.forEach((t=>{if(0===f.length)return;const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1}))}catch(t){console.warn(t.stack)}}function l(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function c(t,s,i){throw new e(`Invalid ${a[i]||"manyith"} argument. Expected ${s.join(" or ")} but received ${t}.`)}function f(t){return!!t&&!!t.then&&"function"==typeof t.then}function d(t,e,s,i){s.assert.notStrictEqual(t,e,i)}function u(t,e){e.assert.strictEqual(typeof t,"string")}function p(t){return Object.keys(t)}function g(t={},e=(()=>!0)){const s={};return p(t).forEach((i=>{e(i,t[i])&&(s[i]=t[i])})),s}function m(){return process.versions.electron&&!process.defaultApp?0:1}function y(){return process.argv[m()]}var b=Object.freeze({__proto__:null,hideBin:function(t){return t.slice(m()+1)},getProcessArgvBin:y});function v(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)}function O(t,e,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(t,s):n?n.value=s:e.set(t,s),s}class w{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,s=!0,i=!1){if(h("<array|function> [boolean] [boolean] [boolean]",[t,e,s],arguments.length),Array.isArray(t)){for(let i=0;i<t.length;i++){if("function"!=typeof t[i])throw Error("middleware must be a function");const n=t[i];n.applyBeforeValidation=e,n.global=s}Array.prototype.push.apply(this.globalMiddleware,t)}else if("function"==typeof t){const n=t;n.applyBeforeValidation=e,n.global=s,n.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const s=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((t=>{const i=[...s[e]||[],e];return!t.option||!i.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function C(t,e,s,i){return s.reduce(((t,s)=>{if(s.applyBeforeValidation!==i)return t;if(s.mutates){if(s.applied)return t;s.applied=!0}if(f(t))return t.then((t=>Promise.all([t,s(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const i=s(t,e);return f(i)?i.then((e=>Object.assign(t,e))):Object.assign(t,i)}}),t)}function j(t,e,s=(t=>{throw t})){try{const s="function"==typeof t?t():t;return f(s)?s.then((t=>e(t))):e(s)}catch(t){return s(t)}}const M=/(^\*)|(^\$0)/;class _{constructor(t,e,s,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=s,this.validation=e}addDirectory(t,e,s,i){"boolean"!=typeof(i=i||{}).recurse&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);const n="function"==typeof i.visit?i.visit:t=>t;i.visit=(t,e,s)=>{const i=n(t,e,s);if(i){if(this.requireCache.has(e))return i;this.requireCache.add(e),this.addHandler(i)}return i},this.shim.requireDirectory({require:e,filename:s},t,i)}addHandler(t,e,s,i,n,r){let a=[];const h=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(n);if(i=i||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...a]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(k(s))return void this.addHandler([t].concat(a),e,s.builder,s.handler,s.middlewares,s.deprecated)}if("string"==typeof t){const n=o(t);a=a.map((t=>o(t).cmd));let l=!1;const c=[n.cmd].concat(a).filter((t=>!M.test(t)||(l=!0,!1)));0===c.length&&l&&c.push("$0"),l&&(n.cmd=c[0],a=c.slice(1),t=t.replace(M,n.cmd)),a.forEach((t=>{this.aliasMap[t]=n.cmd})),!1!==e&&this.usage.command(t,e,l,a,r),this.handlers[n.cmd]={original:t,description:e,handler:i,builder:s||{},middlewares:h,deprecated:r,demanded:n.demanded,optional:n.optional},l&&(this.defaultCommand=this.handlers[n.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,s,i,n,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),h=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const c=this.applyBuilderUpdateUsageAndParse(l,o,e,s.aliases,h,i,n,r);return f(c)?c.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,n,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,c.innerArgv,a,n,c.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,s,i,n,r,o,a){const h=e.builder;let l=s;if(x(h)){s.getInternalMethods().getUsageInstance().freeze();const c=h(s.getInternalMethods().reset(i),a);if(f(c))return c.then((i=>{var a;return l=(a=i)&&"function"==typeof a.getInternalMethods?i:s,this.parseAndUpdateUsage(t,e,l,n,r,o)}))}else(function(t){return"object"==typeof t})(h)&&(s.getInternalMethods().getUsageInstance().freeze(),l=s.getInternalMethods().reset(i),Object.keys(e.builder).forEach((t=>{l.option(t,h[t])})));return this.parseAndUpdateUsage(t,e,l,n,r,o)}parseAndUpdateUsage(t,e,s,i,n,r){t&&s.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,e),e.description);const o=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,n,r);return f(o)?o.then((t=>({aliases:s.parsed.aliases,innerArgv:t}))):{aliases:s.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const s=M.test(e.original)?e.original.replace(M,"").trim():e.original,i=t.filter((t=>!M.test(t)));return i.push(s),`$0 ${i.join(" ")}`}handleValidationAndGetResult(t,e,s,i,n,r,o,a){if(!r.getInternalMethods().getHasOutput()){const e=r.getInternalMethods().runValidation(n,a,r.parsed.error,t);s=j(s,(t=>(e(t),t)))}if(e.handler&&!r.getInternalMethods().getHasOutput()){r.getInternalMethods().setHasOutput();const i=!!r.getOptions().configuration["populate--"];r.getInternalMethods().postProcess(s,i,!1,!1),s=j(s=C(s,r,o,!1),(t=>{const s=e.handler(t);return f(s)?s.then((()=>t)):t})),t||r.getInternalMethods().getUsageInstance().cacheHelpMessage(),f(s)&&!r.getInternalMethods().hasParseCallback()&&s.catch((t=>{try{r.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(i.commands.pop(),i.fullCommands.pop()),s}applyMiddlewareAndGetResult(t,e,s,i,n,r,o){let a={};if(n)return s;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,s,i,o));const h=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),l=C(s,o,h,!0);return f(l)?l.then((s=>this.handleValidationAndGetResult(t,e,s,i,r,o,h,a))):this.handleValidationAndGetResult(t,e,l,i,r,o,h,a)}populatePositionals(t,e,s,i){e._=e._.slice(s.commands.length);const n=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(n.length,e._.length);n.length;){const t=n.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=s.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),i),o}populatePositional(t,e,s){const i=t.cmd[0];t.variadic?s[i]=e._.splice(0).map(String):e._.length&&(s[i]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},s=o(t);return s.demanded.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i,e.demand[s]=!0})),s.optional.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i})),e}postProcessPositionals(t,e,s,i){const n=Object.assign({},i.getOptions());n.default=Object.assign(s.default,n.default);for(const t of Object.keys(s.alias))n.alias[t]=(n.alias[t]||[]).concat(s.alias[t]);n.array=n.array.concat(s.array),n.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{n.configuration["unknown-options-as-args"]&&(n.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},n.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},n,{configuration:o}));if(a.error)i.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const s=Object.keys(e);Object.keys(e).forEach((t=>{s.push(...a.aliases[t])})),Object.keys(a.argv).forEach((n=>{s.includes(n)&&(e[n]||(e[n]=a.argv[n]),!this.isInConfigs(i,n)&&!this.isDefaulted(i,n)&&Object.prototype.hasOwnProperty.call(t,n)&&Object.prototype.hasOwnProperty.call(a.argv,n)&&(Array.isArray(t[n])||Array.isArray(a.argv[n]))?t[n]=[].concat(t[n],a.argv[n]):t[n]=a.argv[n])}))}}isDefaulted(t,e){const{default:s}=t.getOptions();return Object.prototype.hasOwnProperty.call(s,e)||Object.prototype.hasOwnProperty.call(s,this.shim.Parser.camelCase(e))}isInConfigs(t,e){const{configObjects:s}=t.getOptions();return s.some((t=>Object.prototype.hasOwnProperty.call(t,e)))||s.some((t=>Object.prototype.hasOwnProperty.call(t,this.shim.Parser.camelCase(e))))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=M.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(x(e))return e(t,!0);k(e)||Object.keys(e).forEach((s=>{t.option(s,e[s])}))}moduleName(t){const e=function(t){if(false)// removed by dead control flow
|
|
37396
|
-
{}for(let e,s=0,i=Object.keys(__webpack_require__.c);s<i.length;s++)if(e=__webpack_require__.c[i[s]],e.exports===t)return e;return null}(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:s}){for(const i of[t,e,s]){if("string"==typeof i||!1===i)return i;d(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();d(t,void 0,this.shim),({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t)}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function k(t){return"object"==typeof t&&!!t.builder&&"function"==typeof t.handler}function x(t){return"function"==typeof t}function E(t){"undefined"!=typeof process&&[process.stdout,process.stderr].forEach((e=>{const s=e;s._handle&&s.isTTY&&"function"==typeof s._handle.setBlocking&&s._handle.setBlocking(t)}))}function A(t){return"boolean"==typeof t}function P(t,s){const i=s.y18n.__,n={},r=[];n.failFn=function(t){r.push(t)};let o=null,a=null,h=!0;n.showHelpOnFail=function(e=!0,s){const[i,r]="string"==typeof e?[!0,e]:[e,s];return t.getInternalMethods().isGlobalContext()&&(a=r),o=r,h=i,n};let l=!1;n.fail=function(s,i){const c=t.getInternalMethods().getLoggerInstance();if(!r.length){if(t.getExitProcess()&&E(!0),!l){l=!0,h&&(t.showHelp("error"),c.error()),(s||i)&&c.error(s||i);const e=o||a;e&&((s||i)&&c.error(""),c.error(e))}if(i=i||new e(s),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,i);throw i}for(let t=r.length-1;t>=0;--t){const e=r[t];if(A(e)){if(i)throw i;if(s)throw Error(s)}else e(s,i,n)}};let c=[],f=!1;n.usage=(t,e)=>null===t?(f=!0,c=[],n):(f=!1,c.push([t,e||""]),n),n.getUsage=()=>c,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>i("Positionals:");let d=[];n.example=(t,e)=>{d.push([t,e||""])};let u=[];n.command=function(t,e,s,i,n=!1){s&&(u=u.map((t=>(t[2]=!1,t)))),u.push([t,e||"",s,i,n])},n.getCommands=()=>u;let p={};n.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{n.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{n.describe(e,t[e])})):p[t]=e},n.getDescriptions=()=>p;let m=[];n.epilog=t=>{m.push(t)};let y,b=!1;n.wrap=t=>{b=!0,y=t},n.getWrap=()=>s.getEnv("YARGS_DISABLE_WRAP")?null:(b||(y=function(){const t=80;return s.process.stdColumns?Math.min(t,s.process.stdColumns):t}(),b=!0),y);const v="__yargsString__:";function O(t,e,i){let n=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{n=Math.max(s.stringWidth(i?`${i} ${I(t[0])}`:I(t[0]))+$(t[0]),n)})),e&&(n=Math.min(n,parseInt((.5*e).toString(),10))),n}let w;function C(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function j(t,e){let s=`[${i("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}n.deferY18nLookup=t=>v+t,n.help=function(){if(w)return w;!function(){const e=t.getDemandedOptions(),s=t.getOptions();(Object.keys(s.alias)||[]).forEach((i=>{s.alias[i].forEach((r=>{p[r]&&n.describe(i,p[r]),r in e&&t.demandOption(i,e[r]),s.boolean.includes(r)&&t.boolean(i),s.count.includes(r)&&t.count(i),s.string.includes(r)&&t.string(i),s.normalize.includes(r)&&t.normalize(i),s.array.includes(r)&&t.array(i),s.number.includes(r)&&t.number(i)}))}))}();const e=t.customScriptName?t.$0:s.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),h=t.getGroups(),l=t.getOptions();let g=[];g=g.concat(Object.keys(p)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(l.default)),g=g.filter(C),g=Object.keys(g.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const y=n.getWrap(),b=s.cliui({width:y,wrap:!!y});if(!f)if(c.length)c.forEach((t=>{b.div({text:`${t[0].replace(/\$0/g,e)}`}),t[1]&&b.div({text:`${t[1]}`,padding:[1,0,0,0]})})),b.div();else if(u.length){let t=null;t=o._?`${e} <${i("command")}>\n`:`${e} [${i("command")}]\n`,b.div(`${t}`)}if(u.length>1||1===u.length&&!u[0][2]){b.div(i("Commands:"));const s=t.getInternalMethods().getContext(),n=s.commands.length?`${s.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(u=u.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=e?`${e} `:"";u.forEach((t=>{const s=`${r}${n}${t[0].replace(/^\$0 ?/,"")}`;b.span({text:s,padding:[0,2,0,2],width:O(u,y,`${e}${n}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${i("default")}]`),t[3]&&t[3].length&&o.push(`[${i("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${i("deprecated: %s",t[4])}]`):o.push(`[${i("deprecated")}]`)),o.length?b.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):b.div()})),b.div()}const M=(Object.keys(l.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter((e=>!t.parsed.newAliases[e]&&M.every((t=>-1===(l.alias[t]||[]).indexOf(e)))));const _=i("Options:");h[_]||(h[_]=[]),function(t,e,s,i){let n=[],r=null;Object.keys(s).forEach((t=>{n=n.concat(s[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==n.indexOf(t)))||s[i].push(t)}))}(g,l.alias,h,_);const k=t=>/^--/.test(I(t)),x=Object.keys(h).filter((t=>h[t].length>0)).map((t=>({groupName:t,normalizedKeys:h[t].filter(C).map((t=>{if(M.includes(t))return t;for(let e,s=0;void 0!==(e=M[s]);s++)if((l.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const s=e.reduce(((e,s)=>(e[s]=[s].concat(l.alias[s]||[]).map((e=>t===n.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?l.boolean.includes(s)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>k(t)===k(e)?0:k(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:s}}));if(x.filter((({groupName:t})=>t!==n.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>k(e[t])))))&&x.filter((({groupName:t})=>t!==n.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var s,i;k(e[t])&&(e[t]=(s=e[t],i=4,S(s)?{text:s.text,indentation:s.indentation+i}:{text:s,indentation:i}))}))})),x.forEach((({groupName:e,normalizedKeys:s,switches:o})=>{b.div(e),s.forEach((e=>{const s=o[e];let h=p[e]||"",c=null;h.includes(v)&&(h=i(h.substring(16))),l.boolean.includes(e)&&(c=`[${i("boolean")}]`),l.count.includes(e)&&(c=`[${i("count")}]`),l.string.includes(e)&&(c=`[${i("string")}]`),l.normalize.includes(e)&&(c=`[${i("string")}]`),l.array.includes(e)&&(c=`[${i("array")}]`),l.number.includes(e)&&(c=`[${i("number")}]`);const f=[e in a?(d=a[e],"string"==typeof d?`[${i("deprecated: %s",d)}]`:`[${i("deprecated")}]`):null,c,e in r?`[${i("required")}]`:null,l.choices&&l.choices[e]?`[${i("choices:")} ${n.stringifiedValues(l.choices[e])}]`:null,j(l.default[e],l.defaultDescription[e])].filter(Boolean).join(" ");var d;b.span({text:I(s),padding:[0,2,0,2+$(s)],width:O(o,y)+4},h);const u=!0===t.getInternalMethods().getUsageConfiguration()["hide-types"];f&&!u?b.div({text:f,padding:[0,0,0,2],align:"right"}):b.div()})),b.div()})),d.length&&(b.div(i("Examples:")),d.forEach((t=>{t[0]=t[0].replace(/\$0/g,e)})),d.forEach((t=>{""===t[1]?b.div({text:t[0],padding:[0,2,0,2]}):b.div({text:t[0],padding:[0,2,0,2],width:O(d,y)+4},{text:t[1]})})),b.div()),m.length>0){const t=m.map((t=>t.replace(/\$0/g,e))).join("\n");b.div(`${t}\n`)}return b.toString().replace(/\s*$/,"")},n.cacheHelpMessage=function(){w=this.help()},n.clearCachedHelpMessage=function(){w=void 0},n.hasCachedHelpMessage=function(){return!!w},n.showHelp=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(n.help())},n.functionDescription=t=>["(",t.name?s.Parser.decamelize(t.name,"-"):i("generated-value"),")"].join(""),n.stringifiedValues=function(t,e){let s="";const i=e||", ",n=[].concat(t);return t&&n.length?(n.forEach((t=>{s.length&&(s+=i),s+=JSON.stringify(t)})),s):s};let M=null;n.version=t=>{M=t},n.showVersion=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(M)},n.reset=function(t){return o=null,l=!1,c=[],f=!1,m=[],d=[],u=[],p=g(p,(e=>!t[e])),n};const _=[];return n.freeze=function(){_.push({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p})},n.unfreeze=function(t=!1){const e=_.pop();e&&(t?(p={...e.descriptions,...p},u=[...e.commands,...u],c=[...e.usages,...c],d=[...e.examples,...d],m=[...e.epilogs,...m]):({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p}=e))},n}function S(t){return"object"==typeof t}function $(t){return S(t)?t.indentation:0}function I(t){return S(t)?t.text:t}class D{constructor(t,e,s,i){var n,r,o;this.yargs=t,this.usage=e,this.command=s,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(n=this.shim.getEnv("SHELL"))||void 0===n?void 0:n.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,s,i){const n=this.command.getCommandHandlers();for(let e=0,s=t.length;e<s;++e)if(n[t[e]]&&n[t[e]].builder){const s=n[t[e]].builder;if(x(s)){this.indexAfterLastReset=e+1;const t=this.yargs.getInternalMethods().reset();return s(t,!0),t.argv}}const r=[];this.commandCompletions(r,t,s),this.optionCompletions(r,t,e,s),this.choicesFromOptionsCompletions(r,t,e,s),this.choicesFromPositionalsCompletions(r,t,e,s),i(null,r)}commandCompletions(t,e,s){const i=this.yargs.getInternalMethods().getContext().commands;s.match(/^-/)||i[i.length-1]===s||this.previousArgHasChoices(e)||this.usage.getCommands().forEach((s=>{const i=o(s[0]).cmd;if(-1===e.indexOf(i))if(this.zshShell){const e=s[1]||"";t.push(i.replace(/:/g,"\\:")+":"+e)}else t.push(i)}))}optionCompletions(t,e,s,i){if((i.match(/^-/)||""===i&&0===t.length)&&!this.previousArgHasChoices(e)){const s=this.yargs.getOptions(),n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach((r=>{const o=!!s.configuration["boolean-negation"]&&s.boolean.includes(r);n.includes(r)||s.hiddenOptions.includes(r)||this.argsContainKey(e,r,o)||this.completeOptionKey(r,t,i,o&&!!s.default[r])}))}}choicesFromOptionsCompletions(t,e,s,i){if(this.previousArgHasChoices(e)){const s=this.getPreviousArgChoices(e);s&&s.length>0&&t.push(...s.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,e,s,i){if(""===i&&t.length>0&&this.previousArgHasChoices(e))return;const n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=n[s._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(i)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],s="";if(!e.startsWith("-")&&t.length>1&&(s=e,e=t[t.length-2]),!e.startsWith("-"))return;const i=e.replace(/^-+/,""),n=this.yargs.getOptions(),r=[i,...this.yargs.getAliases()[i]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(n.key,t)&&Array.isArray(n.choices[t])){o=n.choices[t];break}return o?o.filter((t=>!s||t.startsWith(s))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,s){const i=e=>-1!==t.indexOf((/^[^0-9]$/.test(e)?"-":"--")+e);if(i(e))return!0;if(s&&i(`no-${e}`))return!0;if(this.aliases)for(const t of this.aliases[e])if(i(t))return!0;return!1}completeOptionKey(t,e,s,i){var n,r,o,a;let h=t;if(this.zshShell){const e=this.usage.getDescriptions(),s=null===(r=null===(n=null==this?void 0:this.aliases)||void 0===n?void 0:n[t])||void 0===r?void 0:r.find((t=>{const s=e[t];return"string"==typeof s&&s.length>0})),i=s?e[s]:void 0,l=null!==(a=null!==(o=e[t])&&void 0!==o?o:i)&&void 0!==a?a:"";h=`${t.replace(/:/g,"\\:")}:${l.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const l=!/^--/.test(s)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";e.push(l+h),i&&e.push(l+"no-"+h)}customCompletion(t,e,s,i){if(d(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(s,e);return f(t)?t.then((t=>{this.shim.process.nextTick((()=>{i(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{i(t,void 0)}))})):i(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(s,e,((n=i)=>this.defaultCompletion(t,e,s,n)),(t=>{i(null,t)})):this.customCompletionFunction(s,e,(t=>{i(null,t)}))}getCompletion(t,e){const s=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),n=this.customCompletionFunction?i=>this.customCompletion(t,i,s,e):i=>this.defaultCompletion(t,i,s,e);return f(i)?i.then(n):n(i)}generateCompletionScript(t,e){let s=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),s=s.replace(/{{app_name}}/g,i),s=s.replace(/{{completion_command}}/g,e),s.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function N(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const s=[];let i,n;for(i=0;i<=e.length;i++)s[i]=[i];for(n=0;n<=t.length;n++)s[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?s[i][n]=s[i-1][n-1]:i>1&&n>1&&e.charAt(i-2)===t.charAt(n-1)&&e.charAt(i-1)===t.charAt(n-2)?s[i][n]=s[i-2][n-2]+1:s[i][n]=Math.min(s[i-1][n-1]+1,Math.min(s[i][n-1]+1,s[i-1][n]+1));return s[e.length][t.length]}const H=["$0","--","_"];var z,W,q,U,F,L,V,G,R,T,B,Y,K,J,Z,X,Q,tt,et,st,it,nt,rt,ot,at,ht,lt,ct,ft,dt,ut,pt,gt,mt,yt;const bt=Symbol("copyDoubleDash"),vt=Symbol("copyDoubleDash"),Ot=Symbol("deleteFromParserHintObject"),wt=Symbol("emitWarning"),Ct=Symbol("freeze"),jt=Symbol("getDollarZero"),Mt=Symbol("getParserConfiguration"),_t=Symbol("getUsageConfiguration"),kt=Symbol("guessLocale"),xt=Symbol("guessVersion"),Et=Symbol("parsePositionalNumbers"),At=Symbol("pkgUp"),Pt=Symbol("populateParserHintArray"),St=Symbol("populateParserHintSingleValueDictionary"),$t=Symbol("populateParserHintArrayDictionary"),It=Symbol("populateParserHintDictionary"),Dt=Symbol("sanitizeKey"),Nt=Symbol("setKey"),Ht=Symbol("unfreeze"),zt=Symbol("validateAsync"),Wt=Symbol("getCommandInstance"),qt=Symbol("getContext"),Ut=Symbol("getHasOutput"),Ft=Symbol("getLoggerInstance"),Lt=Symbol("getParseContext"),Vt=Symbol("getUsageInstance"),Gt=Symbol("getValidationInstance"),Rt=Symbol("hasParseCallback"),Tt=Symbol("isGlobalContext"),Bt=Symbol("postProcess"),Yt=Symbol("rebase"),Kt=Symbol("reset"),Jt=Symbol("runYargsParserAndExecuteCommands"),Zt=Symbol("runValidation"),Xt=Symbol("setHasOutput"),Qt=Symbol("kTrackManuallySetKeys");class te{constructor(t=[],e,s,i){this.customScriptName=!1,this.parsed=!1,z.set(this,void 0),W.set(this,void 0),q.set(this,{commands:[],fullCommands:[]}),U.set(this,null),F.set(this,null),L.set(this,"show-hidden"),V.set(this,null),G.set(this,!0),R.set(this,{}),T.set(this,!0),B.set(this,[]),Y.set(this,void 0),K.set(this,{}),J.set(this,!1),Z.set(this,null),X.set(this,!0),Q.set(this,void 0),tt.set(this,""),et.set(this,void 0),st.set(this,void 0),it.set(this,{}),nt.set(this,null),rt.set(this,null),ot.set(this,{}),at.set(this,{}),ht.set(this,void 0),lt.set(this,!1),ct.set(this,void 0),ft.set(this,!1),dt.set(this,!1),ut.set(this,!1),pt.set(this,void 0),gt.set(this,{}),mt.set(this,null),yt.set(this,void 0),O(this,ct,i,"f"),O(this,ht,t,"f"),O(this,W,e,"f"),O(this,st,s,"f"),O(this,Y,new w(this),"f"),this.$0=this[jt](),this[Kt](),O(this,z,v(this,z,"f"),"f"),O(this,pt,v(this,pt,"f"),"f"),O(this,yt,v(this,yt,"f"),"f"),O(this,et,v(this,et,"f"),"f"),v(this,et,"f").showHiddenOpt=v(this,L,"f"),O(this,Q,this[vt](),"f")}addHelpOpt(t,e){return h("[string|boolean] [string]",[t,e],arguments.length),v(this,Z,"f")&&(this[Ot](v(this,Z,"f")),O(this,Z,null,"f")),!1===t&&void 0===e||(O(this,Z,"string"==typeof t?t:"help","f"),this.boolean(v(this,Z,"f")),this.describe(v(this,Z,"f"),e||v(this,pt,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(h("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const s="string"==typeof t?t:v(this,L,"f");return this.boolean(s),this.describe(s,e||v(this,pt,"f").deferY18nLookup("Show hidden options")),v(this,et,"f").showHiddenOpt=s,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return h("<object|string|array> [string|array]",[t,e],arguments.length),this[$t](this.alias.bind(this),"alias",t,e),this}array(t){return h("<array|string>",[t],arguments.length),this[Pt]("array",t),this[Qt](t),this}boolean(t){return h("<array|string>",[t],arguments.length),this[Pt]("boolean",t),this[Qt](t),this}check(t,e){return h("<function> [boolean]",[t,e],arguments.length),this.middleware(((e,s)=>j((()=>t(e,s.getOptions())),(s=>(s?("string"==typeof s||s instanceof Error)&&v(this,pt,"f").fail(s.toString(),s):v(this,pt,"f").fail(v(this,ct,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(v(this,pt,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return h("<object|string|array> [string|array]",[t,e],arguments.length),this[$t](this.choices.bind(this),"choices",t,e),this}coerce(t,s){if(h("<object|string|array> [function]",[t,s],arguments.length),Array.isArray(t)){if(!s)throw new e("coerce callback must be provided");for(const e of t)this.coerce(e,s);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!s)throw new e("coerce callback must be provided");return v(this,et,"f").key[t]=!0,v(this,Y,"f").addCoerceMiddleware(((i,n)=>{let r;return Object.prototype.hasOwnProperty.call(i,t)?j((()=>(r=n.getAliases(),s(i[t]))),(e=>{i[t]=e;const s=n.getInternalMethods().getParserConfiguration()["strip-aliased"];if(r[t]&&!0!==s)for(const s of r[t])i[s]=e;return i}),(t=>{throw new e(t.message)})):i}),t),this}conflicts(t,e){return h("<string|object> [string|array]",[t,e],arguments.length),v(this,yt,"f").conflicts(t,e),this}config(t="config",e,s){return h("[object|string] [string|function] [function]",[t,e,s],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(s=e,e=void 0),this.describe(t,e||v(this,pt,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{v(this,et,"f").config[t]=s||!0})),this):(t=n(t,v(this,W,"f"),this[Mt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(t),this)}completion(t,e,s){return h("[string] [string|boolean|function] [function]",[t,e,s],arguments.length),"function"==typeof e&&(s=e,e=void 0),O(this,F,t||v(this,F,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(v(this,F,"f"),e),s&&v(this,U,"f").registerFunction(s),this}command(t,e,s,i,n,r){return h("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,s,i,n,r],arguments.length),v(this,z,"f").addHandler(t,e,s,i,n,r),this}commands(t,e,s,i,n,r){return this.command(t,e,s,i,n,r)}commandDir(t,e){h("<string> [object]",[t,e],arguments.length);const s=v(this,st,"f")||v(this,ct,"f").require;return v(this,z,"f").addDirectory(t,s,v(this,ct,"f").getCallerFile(),e),this}count(t){return h("<array|string>",[t],arguments.length),this[Pt]("count",t),this[Qt](t),this}default(t,e,s){return h("<object|string|array> [*] [string]",[t,e,s],arguments.length),s&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]=s),"function"==typeof e&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]||(v(this,et,"f").defaultDescription[t]=v(this,pt,"f").functionDescription(e)),e=e.call()),this[St](this.default.bind(this),"default",t,e),this}defaults(t,e,s){return this.default(t,e,s)}demandCommand(t=1,e,s,i){return h("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,s,i],arguments.length),"number"!=typeof e&&(s=e,e=1/0),this.global("_",!1),v(this,et,"f").demandedCommands._={min:t,max:e,minMsg:s,maxMsg:i},this}demand(t,e,s){return Array.isArray(e)?(e.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})),e=1/0):"number"!=typeof e&&(s=e,e=1/0),"number"==typeof t?(d(s,!0,v(this,ct,"f")),this.demandCommand(t,e,s,s)):Array.isArray(t)?t.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})):"string"==typeof s?this.demandOption(t,s):!0!==s&&void 0!==s||this.demandOption(t),this}demandOption(t,e){return h("<object|string|array> [string]",[t,e],arguments.length),this[St](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return h("<string> [string|boolean]",[t,e],arguments.length),v(this,et,"f").deprecatedOptions[t]=e,this}describe(t,e){return h("<object|string|array> [string]",[t,e],arguments.length),this[Nt](t,!0),v(this,pt,"f").describe(t,e),this}detectLocale(t){return h("<boolean>",[t],arguments.length),O(this,G,t,"f"),this}env(t){return h("[string|boolean]",[t],arguments.length),!1===t?delete v(this,et,"f").envPrefix:v(this,et,"f").envPrefix=t||"",this}epilogue(t){return h("<string>",[t],arguments.length),v(this,pt,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return h("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):v(this,pt,"f").example(t,e),this}exit(t,e){O(this,J,!0,"f"),O(this,V,e,"f"),v(this,T,"f")&&v(this,ct,"f").process.exit(t)}exitProcess(t=!0){return h("[boolean]",[t],arguments.length),O(this,T,t,"f"),this}fail(t){if(h("<function|boolean>",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new e("Invalid first argument. Expected function or boolean 'false'");return v(this,pt,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return h("<array> [function]",[t,e],arguments.length),e?v(this,U,"f").getCompletion(t,e):new Promise(((e,s)=>{v(this,U,"f").getCompletion(t,((t,i)=>{t?s(t):e(i)}))}))}getDemandedOptions(){return h([],0),v(this,et,"f").demandedOptions}getDemandedCommands(){return h([],0),v(this,et,"f").demandedCommands}getDeprecatedOptions(){return h([],0),v(this,et,"f").deprecatedOptions}getDetectLocale(){return v(this,G,"f")}getExitProcess(){return v(this,T,"f")}getGroups(){return Object.assign({},v(this,K,"f"),v(this,at,"f"))}getHelp(){if(O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Jt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(t))return t.then((()=>v(this,pt,"f").help()))}const t=v(this,z,"f").runDefaultBuilderOn(this);if(f(t))return t.then((()=>v(this,pt,"f").help()))}return Promise.resolve(v(this,pt,"f").help())}getOptions(){return v(this,et,"f")}getStrict(){return v(this,ft,"f")}getStrictCommands(){return v(this,dt,"f")}getStrictOptions(){return v(this,ut,"f")}global(t,e){return h("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?v(this,et,"f").local=v(this,et,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{v(this,et,"f").local.includes(t)||v(this,et,"f").local.push(t)})),this}group(t,e){h("<string|array> <string>",[t,e],arguments.length);const s=v(this,at,"f")[e]||v(this,K,"f")[e];v(this,at,"f")[e]&&delete v(this,at,"f")[e];const i={};return v(this,K,"f")[e]=(s||[]).concat(t).filter((t=>!i[t]&&(i[t]=!0))),this}hide(t){return h("<string>",[t],arguments.length),v(this,et,"f").hiddenOptions.push(t),this}implies(t,e){return h("<string|object> [number|string|array]",[t,e],arguments.length),v(this,yt,"f").implies(t,e),this}locale(t){return h("[string]",[t],arguments.length),void 0===t?(this[kt](),v(this,ct,"f").y18n.getLocale()):(O(this,G,!1,"f"),v(this,ct,"f").y18n.setLocale(t),this)}middleware(t,e,s){return v(this,Y,"f").addMiddleware(t,!!e,s)}nargs(t,e){return h("<string|object|array> [number]",[t,e],arguments.length),this[St](this.nargs.bind(this),"narg",t,e),this}normalize(t){return h("<array|string>",[t],arguments.length),this[Pt]("normalize",t),this}number(t){return h("<array|string>",[t],arguments.length),this[Pt]("number",t),this[Qt](t),this}option(t,e){if(h("<string|object> [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Qt](t),!v(this,mt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[wt](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),v(this,et,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const s=e.deprecate||e.deprecated;s&&this.deprecateOption(t,s);const i=e.demand||e.required||e.require;i&&this.demand(t,i),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(v(this,et,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const n=e.describe||e.description||e.desc,r=v(this,pt,"f").getDescriptions();Object.prototype.hasOwnProperty.call(r,t)&&"string"!=typeof n||this.describe(t,n),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,s){h("[string|array] [function|boolean|object] [function]",[t,e,s],arguments.length),this[Ct](),void 0===t&&(t=v(this,ht,"f")),"object"==typeof e&&(O(this,rt,e,"f"),e=s),"function"==typeof e&&(O(this,nt,e,"f"),e=!1),e||O(this,ht,t,"f"),v(this,nt,"f")&&O(this,T,!1,"f");const i=this[Jt](t,!!e),n=this.parsed;return v(this,U,"f").setParsed(this.parsed),f(i)?i.then((t=>(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),t,v(this,tt,"f")),t))).catch((t=>{throw v(this,nt,"f")&&v(this,nt,"f")(t,this.parsed.argv,v(this,tt,"f")),t})).finally((()=>{this[Ht](),this.parsed=n})):(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),i,v(this,tt,"f")),this[Ht](),this.parsed=n,i)}parseAsync(t,e,s){const i=this.parse(t,e,s);return f(i)?i:Promise.resolve(i)}parseSync(t,s,i){const n=this.parse(t,s,i);if(f(n))throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return n}parserConfiguration(t){return h("<object>",[t],arguments.length),O(this,it,t,"f"),this}pkgConf(t,e){h("<string> [string]",[t,e],arguments.length);let s=null;const i=this[At](e||v(this,W,"f"));return i[t]&&"object"==typeof i[t]&&(s=n(i[t],e||v(this,W,"f"),this[Mt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(s)),this}positional(t,e){h("<string> <object>",[t,e],arguments.length);const s=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=g(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&s.includes(t)));const i=v(this,q,"f").fullCommands[v(this,q,"f").fullCommands.length-1],n=i?v(this,z,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return p(n).forEach((s=>{const i=n[s];Array.isArray(i)?-1!==i.indexOf(t)&&(e[s]=!0):i[t]&&!(s in e)&&(e[s]=i[t])})),this.group(t,v(this,pt,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return h("[boolean]",[t],arguments.length),O(this,lt,t,"f"),this}required(t,e,s){return this.demand(t,e,s)}require(t,e,s){return this.demand(t,e,s)}requiresArg(t){return h("<array|string|object> [number]",[t],arguments.length),"string"==typeof t&&v(this,et,"f").narg[t]||this[St](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return h("[string] [string]",[t,e],arguments.length),t=t||this.$0,v(this,Q,"f").log(v(this,U,"f").generateCompletionScript(t,e||v(this,F,"f")||"completion")),this}showHelp(t){if(h("[string|function]",[t],arguments.length),O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Jt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}const e=v(this,z,"f").runDefaultBuilderOn(this);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}return v(this,pt,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return h("[boolean|string] [string]",[t,e],arguments.length),v(this,pt,"f").showHelpOnFail(t,e),this}showVersion(t){return h("[string|function]",[t],arguments.length),v(this,pt,"f").showVersion(t),this}skipValidation(t){return h("<array|string>",[t],arguments.length),this[Pt]("skipValidation",t),this}strict(t){return h("[boolean]",[t],arguments.length),O(this,ft,!1!==t,"f"),this}strictCommands(t){return h("[boolean]",[t],arguments.length),O(this,dt,!1!==t,"f"),this}strictOptions(t){return h("[boolean]",[t],arguments.length),O(this,ut,!1!==t,"f"),this}string(t){return h("<array|string>",[t],arguments.length),this[Pt]("string",t),this[Qt](t),this}terminalWidth(){return h([],0),v(this,ct,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return h("<object>",[t],arguments.length),O(this,G,!1,"f"),v(this,ct,"f").y18n.updateLocale(t),this}usage(t,s,i,n){if(h("<string|null|undefined> [string|boolean] [function|object] [function]",[t,s,i,n],arguments.length),void 0!==s){if(d(t,null,v(this,ct,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,s,i,n);throw new e(".usage() description must start with $0 if being used as alias for .command()")}return v(this,pt,"f").usage(t),this}usageConfiguration(t){return h("<object>",[t],arguments.length),O(this,gt,t,"f"),this}version(t,e,s){const i="version";if(h("[boolean|string] [string] [string]",[t,e,s],arguments.length),v(this,mt,"f")&&(this[Ot](v(this,mt,"f")),v(this,pt,"f").version(void 0),O(this,mt,null,"f")),0===arguments.length)s=this[xt](),t=i;else if(1===arguments.length){if(!1===t)return this;s=t,t=i}else 2===arguments.length&&(s=e,e=void 0);return O(this,mt,"string"==typeof t?t:i,"f"),e=e||v(this,pt,"f").deferY18nLookup("Show version number"),v(this,pt,"f").version(s||void 0),this.boolean(v(this,mt,"f")),this.describe(v(this,mt,"f"),e),this}wrap(t){return h("<number|null|undefined>",[t],arguments.length),v(this,pt,"f").wrap(t),this}[(z=new WeakMap,W=new WeakMap,q=new WeakMap,U=new WeakMap,F=new WeakMap,L=new WeakMap,V=new WeakMap,G=new WeakMap,R=new WeakMap,T=new WeakMap,B=new WeakMap,Y=new WeakMap,K=new WeakMap,J=new WeakMap,Z=new WeakMap,X=new WeakMap,Q=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakMap,it=new WeakMap,nt=new WeakMap,rt=new WeakMap,ot=new WeakMap,at=new WeakMap,ht=new WeakMap,lt=new WeakMap,ct=new WeakMap,ft=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,mt=new WeakMap,yt=new WeakMap,bt)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[vt](){return{log:(...t)=>{this[Rt]()||console.log(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")},error:(...t)=>{this[Rt]()||console.error(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")}}}[Ot](t){p(v(this,et,"f")).forEach((e=>{if("configObjects"===e)return;const s=v(this,et,"f")[e];Array.isArray(s)?s.includes(t)&&s.splice(s.indexOf(t),1):"object"==typeof s&&delete s[t]})),delete v(this,pt,"f").getDescriptions()[t]}[wt](t,e,s){v(this,R,"f")[s]||(v(this,ct,"f").process.emitWarning(t,e),v(this,R,"f")[s]=!0)}[Ct](){v(this,B,"f").push({options:v(this,et,"f"),configObjects:v(this,et,"f").configObjects.slice(0),exitProcess:v(this,T,"f"),groups:v(this,K,"f"),strict:v(this,ft,"f"),strictCommands:v(this,dt,"f"),strictOptions:v(this,ut,"f"),completionCommand:v(this,F,"f"),output:v(this,tt,"f"),exitError:v(this,V,"f"),hasOutput:v(this,J,"f"),parsed:this.parsed,parseFn:v(this,nt,"f"),parseContext:v(this,rt,"f")}),v(this,pt,"f").freeze(),v(this,yt,"f").freeze(),v(this,z,"f").freeze(),v(this,Y,"f").freeze()}[jt](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(v(this,ct,"f").process.argv()[0])?v(this,ct,"f").process.argv().slice(1,2):v(this,ct,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[Yt](v(this,W,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.length<t.length?e:t})).join(" ").trim(),v(this,ct,"f").getEnv("_")&&v(this,ct,"f").getProcessArgvBin()===v(this,ct,"f").getEnv("_")&&(e=v(this,ct,"f").getEnv("_").replace(`${v(this,ct,"f").path.dirname(v(this,ct,"f").process.execPath())}/`,"")),e}[Mt](){return v(this,it,"f")}[_t](){return v(this,gt,"f")}[kt](){if(!v(this,G,"f"))return;const t=v(this,ct,"f").getEnv("LC_ALL")||v(this,ct,"f").getEnv("LC_MESSAGES")||v(this,ct,"f").getEnv("LANG")||v(this,ct,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[xt](){return this[At]().version||"unknown"}[Et](t){const e=t["--"]?t["--"]:t._;for(let t,s=0;void 0!==(t=e[s]);s++)v(this,ct,"f").Parser.looksLikeNumber(t)&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))&&(e[s]=Number(t));return t}[At](t){const e=t||"*";if(v(this,ot,"f")[e])return v(this,ot,"f")[e];let s={};try{let e=t||v(this,ct,"f").mainFilename;!t&&v(this,ct,"f").path.extname(e)&&(e=v(this,ct,"f").path.dirname(e));const i=v(this,ct,"f").findUp(e,((t,e)=>e.includes("package.json")?"package.json":void 0));d(i,void 0,v(this,ct,"f")),s=JSON.parse(v(this,ct,"f").readFileSync(i,"utf8"))}catch(t){}return v(this,ot,"f")[e]=s||{},v(this,ot,"f")[e]}[Pt](t,e){(e=[].concat(e)).forEach((e=>{e=this[Dt](e),v(this,et,"f")[t].push(e)}))}[St](t,e,s,i){this[It](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=s}))}[$t](t,e,s,i){this[It](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=(v(this,et,"f")[t][e]||[]).concat(s)}))}[It](t,e,s,i,n){if(Array.isArray(s))s.forEach((e=>{t(e,i)}));else if((t=>"object"==typeof t)(s))for(const e of p(s))t(e,s[e]);else n(e,this[Dt](s),i)}[Dt](t){return"__proto__"===t?"___proto___":t}[Nt](t,e){return this[St](this[Nt].bind(this),"key",t,e),this}[Ht](){var t,e,s,i,n,r,o,a,h,l,c,f;const u=v(this,B,"f").pop();let p;d(u,void 0,v(this,ct,"f")),t=this,e=this,s=this,i=this,n=this,r=this,o=this,a=this,h=this,l=this,c=this,f=this,({options:{set value(e){O(t,et,e,"f")}}.value,configObjects:p,exitProcess:{set value(t){O(e,T,t,"f")}}.value,groups:{set value(t){O(s,K,t,"f")}}.value,output:{set value(t){O(i,tt,t,"f")}}.value,exitError:{set value(t){O(n,V,t,"f")}}.value,hasOutput:{set value(t){O(r,J,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){O(o,ft,t,"f")}}.value,strictCommands:{set value(t){O(a,dt,t,"f")}}.value,strictOptions:{set value(t){O(h,ut,t,"f")}}.value,completionCommand:{set value(t){O(l,F,t,"f")}}.value,parseFn:{set value(t){O(c,nt,t,"f")}}.value,parseContext:{set value(t){O(f,rt,t,"f")}}.value}=u),v(this,et,"f").configObjects=p,v(this,pt,"f").unfreeze(),v(this,yt,"f").unfreeze(),v(this,z,"f").unfreeze(),v(this,Y,"f").unfreeze()}[zt](t,e){return j(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[Wt].bind(this),getContext:this[qt].bind(this),getHasOutput:this[Ut].bind(this),getLoggerInstance:this[Ft].bind(this),getParseContext:this[Lt].bind(this),getParserConfiguration:this[Mt].bind(this),getUsageConfiguration:this[_t].bind(this),getUsageInstance:this[Vt].bind(this),getValidationInstance:this[Gt].bind(this),hasParseCallback:this[Rt].bind(this),isGlobalContext:this[Tt].bind(this),postProcess:this[Bt].bind(this),reset:this[Kt].bind(this),runValidation:this[Zt].bind(this),runYargsParserAndExecuteCommands:this[Jt].bind(this),setHasOutput:this[Xt].bind(this)}}[Wt](){return v(this,z,"f")}[qt](){return v(this,q,"f")}[Ut](){return v(this,J,"f")}[Ft](){return v(this,Q,"f")}[Lt](){return v(this,rt,"f")||{}}[Vt](){return v(this,pt,"f")}[Gt](){return v(this,yt,"f")}[Rt](){return!!v(this,nt,"f")}[Tt](){return v(this,X,"f")}[Bt](t,e,s,i){if(s)return t;if(f(t))return t;e||(t=this[bt](t));return(this[Mt]()["parse-positional-numbers"]||void 0===this[Mt]()["parse-positional-numbers"])&&(t=this[Et](t)),i&&(t=C(t,this,v(this,Y,"f").getMiddleware(),!1)),t}[Kt](t={}){O(this,et,v(this,et,"f")||{},"f");const e={};e.local=v(this,et,"f").local||[],e.configObjects=v(this,et,"f").configObjects||[];const s={};e.local.forEach((e=>{s[e]=!0,(t[e]||[]).forEach((t=>{s[t]=!0}))})),Object.assign(v(this,at,"f"),Object.keys(v(this,K,"f")).reduce(((t,e)=>{const i=v(this,K,"f")[e].filter((t=>!(t in s)));return i.length>0&&(t[e]=i),t}),{})),O(this,K,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(v(this,et,"f")[t]||[]).filter((t=>!s[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=g(v(this,et,"f")[t],(t=>!s[t]))})),e.envPrefix=v(this,et,"f").envPrefix,O(this,et,e,"f"),O(this,pt,v(this,pt,"f")?v(this,pt,"f").reset(s):P(this,v(this,ct,"f")),"f"),O(this,yt,v(this,yt,"f")?v(this,yt,"f").reset(s):function(t,e,s){const i=s.y18n.__,n=s.y18n.__n,r={nonOptionCount:function(s){const i=t.getDemandedCommands(),r=s._.length+(s["--"]?s["--"].length:0)-t.getInternalMethods().getContext().commands.length;i._&&(r<i._.min||r>i._.max)&&(r<i._.min?void 0!==i._.minMsg?e.fail(i._.minMsg?i._.minMsg.replace(/\$0/g,r.toString()).replace(/\$1/,i._.min.toString()):null):e.fail(n("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",r,r.toString(),i._.min.toString())):r>i._.max&&(void 0!==i._.maxMsg?e.fail(i._.maxMsg?i._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,i._.max.toString()):null):e.fail(n("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),i._.max.toString()))))},positionalCount:function(t,s){s<t&&e.fail(n("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",s,s+"",t+""))},requiredArguments:function(t,s){let i=null;for(const e of Object.keys(s))Object.prototype.hasOwnProperty.call(t,e)&&void 0!==t[e]||(i=i||{},i[e]=s[e]);if(i){const t=[];for(const e of Object.keys(i)){const s=i[e];s&&t.indexOf(s)<0&&t.push(s)}const s=t.length?`\n${t.join("\n")}`:"";e.fail(n("Missing required argument: %s","Missing required arguments: %s",Object.keys(i).length,Object.keys(i).join(", ")+s))}},unknownArguments:function(s,i,o,a,h=!0){var l;const c=t.getInternalMethods().getCommandInstance().getCommands(),f=[],d=t.getInternalMethods().getContext();if(Object.keys(s).forEach((e=>{H.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,i)||f.push(e)})),h&&(d.commands.length>0||c.length>0||a)&&s._.slice(d.commands.length).forEach((t=>{c.includes(""+t)||f.push(""+t)})),h){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,i=d.commands.length+e;i<s._.length&&s._.slice(i).forEach((t=>{t=String(t),d.commands.includes(t)||f.includes(t)||f.push(t)}))}f.length&&e.fail(n("Unknown argument: %s","Unknown arguments: %s",f.length,f.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(s){const i=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||i.length>0)&&s._.slice(o.commands.length).forEach((t=>{i.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(n("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,s){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;const i=t.parsed.newAliases;return[e,...s[e]].some((t=>!Object.prototype.hasOwnProperty.call(i,t)||!i[e]))},limitedChoices:function(s){const n=t.getOptions(),r={};if(!Object.keys(n.choices).length)return;Object.keys(s).forEach((t=>{-1===H.indexOf(t)&&Object.prototype.hasOwnProperty.call(n.choices,t)&&[].concat(s[t]).forEach((e=>{-1===n.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=i("Invalid values:");o.forEach((t=>{a+=`\n ${i("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(n.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const s=Number(e);return"number"==typeof(e=isNaN(s)?e:s)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,i){h("<string|object> [array|number|string]",[e,i],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(i)?i.forEach((t=>r.implies(e,t))):(d(i,void 0,s),o[e].push(i)))},r.getImplied=function(){return o},r.implications=function(t){const s=[];if(Object.keys(o).forEach((e=>{const i=e;(o[e]||[]).forEach((e=>{let n=i;const r=e;n=a(t,n),e=a(t,e),n&&!e&&s.push(` ${i} -> ${r}`)}))})),s.length){let t=`${i("Implications failed:")}\n`;s.forEach((e=>{t+=e})),e.fail(t)}};let l={};r.conflicts=function(e,s){h("<string|object> [array|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),l[e]||(l[e]=[]),Array.isArray(s)?s.forEach((t=>r.conflicts(e,t))):l[e].push(s))},r.getConflicting=()=>l,r.conflicting=function(n){Object.keys(n).forEach((t=>{l[t]&&l[t].forEach((s=>{s&&void 0!==n[t]&&void 0!==n[s]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,s))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach((t=>{l[t].forEach((r=>{r&&void 0!==n[s.Parser.camelCase(t)]&&void 0!==n[s.Parser.camelCase(r)]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,s){s=s.sort(((t,e)=>e.length-t.length));let n=null,r=1/0;for(let e,i=0;void 0!==(e=s[i]);i++){const s=N(t,e);s<=3&&s<r&&(r=s,n=e)}n&&e.fail(i("Did you mean %s?",n))},r.reset=function(t){return o=g(o,(e=>!t[e])),l=g(l,(e=>!t[e])),r};const c=[];return r.freeze=function(){c.push({implied:o,conflicting:l})},r.unfreeze=function(){const t=c.pop();d(t,void 0,s),({implied:o,conflicting:l}=t)},r}(this,v(this,pt,"f"),v(this,ct,"f")),"f"),O(this,z,v(this,z,"f")?v(this,z,"f").reset():function(t,e,s,i){return new _(t,e,s,i)}(v(this,pt,"f"),v(this,yt,"f"),v(this,Y,"f"),v(this,ct,"f")),"f"),v(this,U,"f")||O(this,U,function(t,e,s,i){return new D(t,e,s,i)}(this,v(this,pt,"f"),v(this,z,"f"),v(this,ct,"f")),"f"),v(this,Y,"f").reset(),O(this,F,null,"f"),O(this,tt,"","f"),O(this,V,null,"f"),O(this,J,!1,"f"),this.parsed=!1,this}[Yt](t,e){return v(this,ct,"f").path.relative(t,e)}[Jt](t,s,i,n=0,r=!1){let o=!!i||r;t=t||v(this,ht,"f"),v(this,et,"f").__=v(this,ct,"f").y18n.__,v(this,et,"f").configuration=this[Mt]();const a=!!v(this,et,"f").configuration["populate--"],h=Object.assign({},v(this,et,"f").configuration,{"populate--":!0}),l=v(this,ct,"f").Parser.detailed(t,Object.assign({},v(this,et,"f"),{configuration:{"parse-positional-numbers":!1,...h}})),c=Object.assign(l.argv,v(this,rt,"f"));let d;const u=l.aliases;let p=!1,g=!1;Object.keys(c).forEach((t=>{t===v(this,Z,"f")&&c[t]?p=!0:t===v(this,mt,"f")&&c[t]&&(g=!0)})),c.$0=this.$0,this.parsed=l,0===n&&v(this,pt,"f").clearCachedHelpMessage();try{if(this[kt](),s)return this[Bt](c,a,!!i,!1);if(v(this,Z,"f")){[v(this,Z,"f")].concat(u[v(this,Z,"f")]||[]).filter((t=>t.length>1)).includes(""+c._[c._.length-1])&&(c._.pop(),p=!0)}O(this,X,!1,"f");const h=v(this,z,"f").getCommands(),m=v(this,U,"f").completionKey in c,y=p||m||r;if(c._.length){if(h.length){let t;for(let e,s=n||0;void 0!==c._[s];s++){if(e=String(c._[s]),h.includes(e)&&e!==v(this,F,"f")){const t=v(this,z,"f").runCommand(e,this,l,s+1,r,p||g||r);return this[Bt](t,a,!!i,!1)}if(!t&&e!==v(this,F,"f")){t=e;break}}!v(this,z,"f").hasDefaultCommand()&&v(this,lt,"f")&&t&&!y&&v(this,yt,"f").recommendCommands(t,h)}v(this,F,"f")&&c._.includes(v(this,F,"f"))&&!m&&(v(this,T,"f")&&E(!0),this.showCompletionScript(),this.exit(0))}if(v(this,z,"f").hasDefaultCommand()&&!y){const t=v(this,z,"f").runCommand(null,this,l,0,r,p||g||r);return this[Bt](t,a,!!i,!1)}if(m){v(this,T,"f")&&E(!0);const s=(t=[].concat(t)).slice(t.indexOf(`--${v(this,U,"f").completionKey}`)+1);return v(this,U,"f").getCompletion(s,((t,s)=>{if(t)throw new e(t.message);(s||[]).forEach((t=>{v(this,Q,"f").log(t)})),this.exit(0)})),this[Bt](c,!a,!!i,!1)}if(v(this,J,"f")||(p?(v(this,T,"f")&&E(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(v(this,T,"f")&&E(!0),o=!0,v(this,pt,"f").showVersion("log"),this.exit(0))),!o&&v(this,et,"f").skipValidation.length>0&&(o=Object.keys(c).some((t=>v(this,et,"f").skipValidation.indexOf(t)>=0&&!0===c[t]))),!o){if(l.error)throw new e(l.error.message);if(!m){const t=this[Zt](u,{},l.error);i||(d=C(c,this,v(this,Y,"f").getMiddleware(),!0)),d=this[zt](t,null!=d?d:c),f(d)&&!i&&(d=d.then((()=>C(c,this,v(this,Y,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof e))throw t;v(this,pt,"f").fail(t.message,t)}return this[Bt](null!=d?d:c,a,!!i,!0)}[Zt](t,s,i,n){const r={...this.getDemandedOptions()};return o=>{if(i)throw new e(i.message);v(this,yt,"f").nonOptionCount(o),v(this,yt,"f").requiredArguments(o,r);let a=!1;v(this,dt,"f")&&(a=v(this,yt,"f").unknownCommands(o)),v(this,ft,"f")&&!a?v(this,yt,"f").unknownArguments(o,t,s,!!n):v(this,ut,"f")&&v(this,yt,"f").unknownArguments(o,t,{},!1,!1),v(this,yt,"f").limitedChoices(o),v(this,yt,"f").implications(o),v(this,yt,"f").conflicting(o)}}[Xt](){O(this,J,!0,"f")}[Qt](t){if("string"==typeof t)v(this,et,"f").key[t]=!0;else for(const e of t)v(this,et,"f").key[e]=!0}}var ee,se;const{readFileSync:ie}=__webpack_require__(9896),{inspect:ne}=__webpack_require__(9023),{resolve:re}=__webpack_require__(6928),oe=__webpack_require__(9668),ae=__webpack_require__(6180);var he,le={assert:{notStrictEqual:t.notStrictEqual,strictEqual:t.strictEqual},cliui:__webpack_require__(164),findUp:__webpack_require__(7829),getEnv:t=>process.env[t],getCallerFile:__webpack_require__(2838),getProcessArgvBin:y,inspect:ne,mainFilename:null!==(se=null===(ee= false||void 0===__webpack_require__(7315)?void 0:__webpack_require__.c[__webpack_require__.s])||void 0===ee?void 0:ee.filename)&&void 0!==se?se:process.cwd(),Parser:ae,path:__webpack_require__(6928),process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:t=>{process.exit(t)},nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:ie,require:__webpack_require__(7315),requireDirectory:__webpack_require__(9386),stringWidth:__webpack_require__(4813),y18n:oe({directory:re(__dirname,"../locales"),updateFiles:!1})};const ce=(null===(he=null===process||void 0===process?void 0:process.env)||void 0===he?void 0:he.YARGS_MIN_NODE_VERSION)?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version){if(Number(process.version.match(/v([^.]+)/)[1])<ce)throw Error(`yargs supports a minimum Node.js version of ${ce}. Read our version support policy: https://github.com/yargs/yargs#supported-nodejs-versions`)}const fe=__webpack_require__(6180);var de,ue={applyExtends:n,cjsPlatformShim:le,Yargs:(de=le,(t=[],e=de.process.cwd(),s)=>{const i=new te(t,e,s,de);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}),argsert:h,isPromise:f,objFilter:g,parseCommand:o,Parser:fe,processArgv:b,YError:e};module.exports=ue;
|
|
37981
|
+
var t=__webpack_require__(2613);class e extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}let s,i=[];function n(t,o,a,h){s=h;let l={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return l;const r=/\.json|\..*rc$/.test(t.extends);let h=null;if(r)h=function(t,e){return s.path.resolve(t,e)}(o,t.extends);else try{h=/*require.resolve*/(__webpack_require__(7315).resolve(t.extends))}catch(e){return t}!function(t){if(i.indexOf(t)>-1)throw new e(`Circular extended configurations: '${t}'.`)}(h),i.push(h),l=r?JSON.parse(s.readFileSync(h,"utf8")):__webpack_require__(7315)(t.extends),delete t.extends,l=n(l,s.path.dirname(h),a,s)}return i=[],a?r(l,t):Object.assign({},l,t)}function r(t,e){const s={};function i(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(s,t);for(const n of Object.keys(e))i(e[n])&&i(s[n])?s[n]=r(t[n],e[n]):s[n]=e[n];return s}function o(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,i=e.shift();if(!i)throw new Error(`No command found in: ${t}`);const n={cmd:i.replace(s,""),demanded:[],optional:[]};return e.forEach((t,i)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&i===e.length-1&&(r=!0),/^\[/.test(t)?n.optional.push({cmd:t.replace(s,"").split("|"),variadic:r}):n.demanded.push({cmd:t.replace(s,"").split("|"),variadic:r})}),n}const a=["first","second","third","fourth","fifth","sixth"];function h(t,s,i){try{let n=0;const[r,a,h]="object"==typeof t?[{demanded:[],optional:[]},t,s]:[o(`cmd ${t}`),s,i],f=[].slice.call(a);for(;f.length&&void 0===f[f.length-1];)f.pop();const d=h||f.length;if(d<r.demanded.length)throw new e(`Not enough arguments provided. Expected ${r.demanded.length} but received ${f.length}.`);const u=r.demanded.length+r.optional.length;if(d>u)throw new e(`Too many arguments provided. Expected max ${u} but received ${d}.`);r.demanded.forEach(t=>{const e=l(f.shift());0===t.cmd.filter(t=>t===e||"*"===t).length&&c(e,t.cmd,n),n+=1}),r.optional.forEach(t=>{if(0===f.length)return;const e=l(f.shift());0===t.cmd.filter(t=>t===e||"*"===t).length&&c(e,t.cmd,n),n+=1})}catch(t){console.warn(t.stack)}}function l(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function c(t,s,i){throw new e(`Invalid ${a[i]||"manyith"} argument. Expected ${s.join(" or ")} but received ${t}.`)}function f(t){return!!t&&!!t.then&&"function"==typeof t.then}function d(t,e,s,i){s.assert.notStrictEqual(t,e,i)}function u(t,e){e.assert.strictEqual(typeof t,"string")}function p(t){return Object.keys(t)}function g(t={},e=()=>!0){const s={};return p(t).forEach(i=>{e(i,t[i])&&(s[i]=t[i])}),s}function m(){return process.versions.electron&&!process.defaultApp?0:1}function y(){return process.argv[m()]}var b=Object.freeze({__proto__:null,hideBin:function(t){return t.slice(m()+1)},getProcessArgvBin:y});function v(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)}function O(t,e,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(t,s):n?n.value=s:e.set(t,s),s}"function"==typeof SuppressedError&&SuppressedError;class w{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,s=!0,i=!1){if(h("<array|function> [boolean] [boolean] [boolean]",[t,e,s],arguments.length),Array.isArray(t)){for(let i=0;i<t.length;i++){if("function"!=typeof t[i])throw Error("middleware must be a function");const n=t[i];n.applyBeforeValidation=e,n.global=s}Array.prototype.push.apply(this.globalMiddleware,t)}else if("function"==typeof t){const n=t;n.applyBeforeValidation=e,n.global=s,n.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const s=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(t=>{const i=[...s[e]||[],e];return!t.option||!i.includes(t.option)}),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}}function C(t,e,s,i){return s.reduce((t,s)=>{if(s.applyBeforeValidation!==i)return t;if(s.mutates){if(s.applied)return t;s.applied=!0}if(f(t))return t.then(t=>Promise.all([t,s(t,e)])).then(([t,e])=>Object.assign(t,e));{const i=s(t,e);return f(i)?i.then(e=>Object.assign(t,e)):Object.assign(t,i)}},t)}function j(t,e,s=t=>{throw t}){try{const s="function"==typeof t?t():t;return f(s)?s.then(t=>e(t)):e(s)}catch(t){return s(t)}}const M=/(^\*)|(^\$0)/;class _{constructor(t,e,s,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=s,this.validation=e}addDirectory(t,e,s,i){"boolean"!=typeof(i=i||{}).recurse&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);const n="function"==typeof i.visit?i.visit:t=>t;i.visit=(t,e,s)=>{const i=n(t,e,s);if(i){if(this.requireCache.has(e))return i;this.requireCache.add(e),this.addHandler(i)}return i},this.shim.requireDirectory({require:e,filename:s},t,i)}addHandler(t,e,s,i,n,r){let a=[];const h=function(t){return t?t.map(t=>(t.applyBeforeValidation=!1,t)):[]}(n);if(i=i||(()=>{}),Array.isArray(t))if(function(t){return t.every(t=>"string"==typeof t)}(t))[t,...a]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(k(s))return void this.addHandler([t].concat(a),e,s.builder,s.handler,s.middlewares,s.deprecated)}if("string"==typeof t){const n=o(t);a=a.map(t=>o(t).cmd);let l=!1;const c=[n.cmd].concat(a).filter(t=>!M.test(t)||(l=!0,!1));0===c.length&&l&&c.push("$0"),l&&(n.cmd=c[0],a=c.slice(1),t=t.replace(M,n.cmd)),a.forEach(t=>{this.aliasMap[t]=n.cmd}),!1!==e&&this.usage.command(t,e,l,a,r),this.handlers[n.cmd]={original:t,description:e,handler:i,builder:s||{},middlewares:h,deprecated:r,demanded:n.demanded,optional:n.optional},l&&(this.defaultCommand=this.handlers[n.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,s,i,n,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),h=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const c=this.applyBuilderUpdateUsageAndParse(l,o,e,s.aliases,h,i,n,r);return f(c)?c.then(t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,n,t.aliases,e)):this.applyMiddlewareAndGetResult(l,o,c.innerArgv,a,n,c.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,s,i,n,r,o,a){const h=e.builder;let l=s;if(E(h)){s.getInternalMethods().getUsageInstance().freeze();const c=h(s.getInternalMethods().reset(i),a);if(f(c))return c.then(i=>{var a;return l=(a=i)&&"function"==typeof a.getInternalMethods?i:s,this.parseAndUpdateUsage(t,e,l,n,r,o)})}else(function(t){return"object"==typeof t})(h)&&(s.getInternalMethods().getUsageInstance().freeze(),l=s.getInternalMethods().reset(i),Object.keys(e.builder).forEach(t=>{l.option(t,h[t])}));return this.parseAndUpdateUsage(t,e,l,n,r,o)}parseAndUpdateUsage(t,e,s,i,n,r){t&&s.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,e),e.description);const o=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,n,r);return f(o)?o.then(t=>({aliases:s.parsed.aliases,innerArgv:t})):{aliases:s.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const s=M.test(e.original)?e.original.replace(M,"").trim():e.original,i=t.filter(t=>!M.test(t));return i.push(s),`$0 ${i.join(" ")}`}handleValidationAndGetResult(t,e,s,i,n,r,o,a){if(!r.getInternalMethods().getHasOutput()){const e=r.getInternalMethods().runValidation(n,a,r.parsed.error,t);s=j(s,t=>(e(t),t))}if(e.handler&&!r.getInternalMethods().getHasOutput()){r.getInternalMethods().setHasOutput();const i=!!r.getOptions().configuration["populate--"];r.getInternalMethods().postProcess(s,i,!1,!1),s=j(s=C(s,r,o,!1),t=>{const s=e.handler(t);return f(s)?s.then(()=>t):t}),t||r.getInternalMethods().getUsageInstance().cacheHelpMessage(),f(s)&&!r.getInternalMethods().hasParseCallback()&&s.catch(t=>{try{r.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}})}return t||(i.commands.pop(),i.fullCommands.pop()),s}applyMiddlewareAndGetResult(t,e,s,i,n,r,o){let a={};if(n)return s;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,s,i,o));const h=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),l=C(s,o,h,!0);return f(l)?l.then(s=>this.handleValidationAndGetResult(t,e,s,i,r,o,h,a)):this.handleValidationAndGetResult(t,e,l,i,r,o,h,a)}populatePositionals(t,e,s,i){e._=e._.slice(s.commands.length);const n=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(n.length,e._.length);n.length;){const t=n.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=s.commands.concat(e._.map(t=>""+t)),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),i),o}populatePositional(t,e,s){const i=t.cmd[0];t.variadic?s[i]=e._.splice(0).map(String):e._.length&&(s[i]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},s=o(t);return s.demanded.forEach(t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i,e.demand[s]=!0}),s.optional.forEach(t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i}),e}postProcessPositionals(t,e,s,i){const n=Object.assign({},i.getOptions());n.default=Object.assign(s.default,n.default);for(const t of Object.keys(s.alias))n.alias[t]=(n.alias[t]||[]).concat(s.alias[t]);n.array=n.array.concat(s.array),n.config={};const r=[];if(Object.keys(e).forEach(t=>{e[t].map(e=>{n.configuration["unknown-options-as-args"]&&(n.key[t]=!0),r.push(`--${t}`),r.push(e)})}),!r.length)return;const o=Object.assign({},n.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},n,{configuration:o}));if(a.error)i.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const s=Object.keys(e);Object.keys(e).forEach(t=>{s.push(...a.aliases[t])}),Object.keys(a.argv).forEach(n=>{s.includes(n)&&(e[n]||(e[n]=a.argv[n]),!this.isInConfigs(i,n)&&!this.isDefaulted(i,n)&&Object.prototype.hasOwnProperty.call(t,n)&&Object.prototype.hasOwnProperty.call(a.argv,n)&&(Array.isArray(t[n])||Array.isArray(a.argv[n]))?t[n]=[].concat(t[n],a.argv[n]):t[n]=a.argv[n])})}}isDefaulted(t,e){const{default:s}=t.getOptions();return Object.prototype.hasOwnProperty.call(s,e)||Object.prototype.hasOwnProperty.call(s,this.shim.Parser.camelCase(e))}isInConfigs(t,e){const{configObjects:s}=t.getOptions();return s.some(t=>Object.prototype.hasOwnProperty.call(t,e))||s.some(t=>Object.prototype.hasOwnProperty.call(t,this.shim.Parser.camelCase(e)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=M.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(E(e))return e(t,!0);k(e)||Object.keys(e).forEach(s=>{t.option(s,e[s])})}moduleName(t){const e=function(t){if(false)// removed by dead control flow
|
|
37982
|
+
{}for(let e,s=0,i=Object.keys(__webpack_require__.c);s<i.length;s++)if(e=__webpack_require__.c[i[s]],e.exports===t)return e;return null}(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:s}){for(const i of[t,e,s]){if("string"==typeof i||!1===i)return i;d(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();d(t,void 0,this.shim),({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t)}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function k(t){return"object"==typeof t&&!!t.builder&&"function"==typeof t.handler}function E(t){return"function"==typeof t}function x(t){"undefined"!=typeof process&&[process.stdout,process.stderr].forEach(e=>{const s=e;s._handle&&s.isTTY&&"function"==typeof s._handle.setBlocking&&s._handle.setBlocking(t)})}function A(t){return"boolean"==typeof t}function P(t,s){const i=s.y18n.__,n={},r=[];n.failFn=function(t){r.push(t)};let o=null,a=null,h=!0;n.showHelpOnFail=function(e=!0,s){const[i,r]="string"==typeof e?[!0,e]:[e,s];return t.getInternalMethods().isGlobalContext()&&(a=r),o=r,h=i,n};let l=!1;n.fail=function(s,i){const c=t.getInternalMethods().getLoggerInstance();if(!r.length){if(t.getExitProcess()&&x(!0),!l){l=!0,h&&(t.showHelp("error"),c.error()),(s||i)&&c.error(s||i);const e=o||a;e&&((s||i)&&c.error(""),c.error(e))}if(i=i||new e(s),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,i);throw i}for(let t=r.length-1;t>=0;--t){const e=r[t];if(A(e)){if(i)throw i;if(s)throw Error(s)}else e(s,i,n)}};let c=[],f=!1;n.usage=(t,e)=>null===t?(f=!0,c=[],n):(f=!1,c.push([t,e||""]),n),n.getUsage=()=>c,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>i("Positionals:");let d=[];n.example=(t,e)=>{d.push([t,e||""])};let u=[];n.command=function(t,e,s,i,n=!1){s&&(u=u.map(t=>(t[2]=!1,t))),u.push([t,e||"",s,i,n])},n.getCommands=()=>u;let p={};n.describe=function(t,e){Array.isArray(t)?t.forEach(t=>{n.describe(t,e)}):"object"==typeof t?Object.keys(t).forEach(e=>{n.describe(e,t[e])}):p[t]=e},n.getDescriptions=()=>p;let m=[];n.epilog=t=>{m.push(t)};let y,b=!1;n.wrap=t=>{b=!0,y=t},n.getWrap=()=>s.getEnv("YARGS_DISABLE_WRAP")?null:(b||(y=function(){const t=80;return s.process.stdColumns?Math.min(t,s.process.stdColumns):t}(),b=!0),y);const v="__yargsString__:";function O(t,e,i){let n=0;return Array.isArray(t)||(t=Object.values(t).map(t=>[t])),t.forEach(t=>{n=Math.max(s.stringWidth(i?`${i} ${I(t[0])}`:I(t[0]))+$(t[0]),n)}),e&&(n=Math.min(n,parseInt((.5*e).toString(),10))),n}let w;function C(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function j(t,e){let s=`[${i("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}n.deferY18nLookup=t=>v+t,n.help=function(){if(w)return w;!function(){const e=t.getDemandedOptions(),s=t.getOptions();(Object.keys(s.alias)||[]).forEach(i=>{s.alias[i].forEach(r=>{p[r]&&n.describe(i,p[r]),r in e&&t.demandOption(i,e[r]),s.boolean.includes(r)&&t.boolean(i),s.count.includes(r)&&t.count(i),s.string.includes(r)&&t.string(i),s.normalize.includes(r)&&t.normalize(i),s.array.includes(r)&&t.array(i),s.number.includes(r)&&t.number(i)})})}();const e=t.customScriptName?t.$0:s.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),h=t.getGroups(),l=t.getOptions();let g=[];g=g.concat(Object.keys(p)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(l.default)),g=g.filter(C),g=Object.keys(g.reduce((t,e)=>("_"!==e&&(t[e]=!0),t),{}));const y=n.getWrap(),b=s.cliui({width:y,wrap:!!y});if(!f)if(c.length)c.forEach(t=>{b.div({text:`${t[0].replace(/\$0/g,e)}`}),t[1]&&b.div({text:`${t[1]}`,padding:[1,0,0,0]})}),b.div();else if(u.length){let t=null;t=o._?`${e} <${i("command")}>\n`:`${e} [${i("command")}]\n`,b.div(`${t}`)}if(u.length>1||1===u.length&&!u[0][2]){b.div(i("Commands:"));const s=t.getInternalMethods().getContext(),n=s.commands.length?`${s.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(u=u.sort((t,e)=>t[0].localeCompare(e[0])));const r=e?`${e} `:"";u.forEach(t=>{const s=`${r}${n}${t[0].replace(/^\$0 ?/,"")}`;b.span({text:s,padding:[0,2,0,2],width:O(u,y,`${e}${n}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${i("default")}]`),t[3]&&t[3].length&&o.push(`[${i("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${i("deprecated: %s",t[4])}]`):o.push(`[${i("deprecated")}]`)),o.length?b.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):b.div()}),b.div()}const M=(Object.keys(l.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter(e=>!t.parsed.newAliases[e]&&M.every(t=>-1===(l.alias[t]||[]).indexOf(e)));const _=i("Options:");h[_]||(h[_]=[]),function(t,e,s,i){let n=[],r=null;Object.keys(s).forEach(t=>{n=n.concat(s[t])}),t.forEach(t=>{r=[t].concat(e[t]),r.some(t=>-1!==n.indexOf(t))||s[i].push(t)})}(g,l.alias,h,_);const k=t=>/^--/.test(I(t)),E=Object.keys(h).filter(t=>h[t].length>0).map(t=>({groupName:t,normalizedKeys:h[t].filter(C).map(t=>{if(M.includes(t))return t;for(let e,s=0;void 0!==(e=M[s]);s++)if((l.alias[e]||[]).includes(t))return e;return t})})).filter(({normalizedKeys:t})=>t.length>0).map(({groupName:t,normalizedKeys:e})=>{const s=e.reduce((e,s)=>(e[s]=[s].concat(l.alias[s]||[]).map(e=>t===n.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?l.boolean.includes(s)?"-":"--":e.length>1?"--":"-")+e).sort((t,e)=>k(t)===k(e)?0:k(t)?1:-1).join(", "),e),{});return{groupName:t,normalizedKeys:e,switches:s}});if(E.filter(({groupName:t})=>t!==n.getPositionalGroupName()).some(({normalizedKeys:t,switches:e})=>!t.every(t=>k(e[t])))&&E.filter(({groupName:t})=>t!==n.getPositionalGroupName()).forEach(({normalizedKeys:t,switches:e})=>{t.forEach(t=>{var s,i;k(e[t])&&(e[t]=(s=e[t],i=4,S(s)?{text:s.text,indentation:s.indentation+i}:{text:s,indentation:i}))})}),E.forEach(({groupName:e,normalizedKeys:s,switches:o})=>{b.div(e),s.forEach(e=>{const s=o[e];let h=p[e]||"",c=null;h.includes(v)&&(h=i(h.substring(16))),l.boolean.includes(e)&&(c=`[${i("boolean")}]`),l.count.includes(e)&&(c=`[${i("count")}]`),l.string.includes(e)&&(c=`[${i("string")}]`),l.normalize.includes(e)&&(c=`[${i("string")}]`),l.array.includes(e)&&(c=`[${i("array")}]`),l.number.includes(e)&&(c=`[${i("number")}]`);const f=[e in a?(d=a[e],"string"==typeof d?`[${i("deprecated: %s",d)}]`:`[${i("deprecated")}]`):null,c,e in r?`[${i("required")}]`:null,l.choices&&l.choices[e]?`[${i("choices:")} ${n.stringifiedValues(l.choices[e])}]`:null,j(l.default[e],l.defaultDescription[e])].filter(Boolean).join(" ");var d;b.span({text:I(s),padding:[0,2,0,2+$(s)],width:O(o,y)+4},h);const u=!0===t.getInternalMethods().getUsageConfiguration()["hide-types"];f&&!u?b.div({text:f,padding:[0,0,0,2],align:"right"}):b.div()}),b.div()}),d.length&&(b.div(i("Examples:")),d.forEach(t=>{t[0]=t[0].replace(/\$0/g,e)}),d.forEach(t=>{""===t[1]?b.div({text:t[0],padding:[0,2,0,2]}):b.div({text:t[0],padding:[0,2,0,2],width:O(d,y)+4},{text:t[1]})}),b.div()),m.length>0){const t=m.map(t=>t.replace(/\$0/g,e)).join("\n");b.div(`${t}\n`)}return b.toString().replace(/\s*$/,"")},n.cacheHelpMessage=function(){w=this.help()},n.clearCachedHelpMessage=function(){w=void 0},n.hasCachedHelpMessage=function(){return!!w},n.showHelp=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(n.help())},n.functionDescription=t=>["(",t.name?s.Parser.decamelize(t.name,"-"):i("generated-value"),")"].join(""),n.stringifiedValues=function(t,e){let s="";const i=e||", ",n=[].concat(t);return t&&n.length?(n.forEach(t=>{s.length&&(s+=i),s+=JSON.stringify(t)}),s):s};let M=null;n.version=t=>{M=t},n.showVersion=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(M)},n.reset=function(t){return o=null,l=!1,c=[],f=!1,m=[],d=[],u=[],p=g(p,e=>!t[e]),n};const _=[];return n.freeze=function(){_.push({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p})},n.unfreeze=function(t=!1){const e=_.pop();e&&(t?(p={...e.descriptions,...p},u=[...e.commands,...u],c=[...e.usages,...c],d=[...e.examples,...d],m=[...e.epilogs,...m]):({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p}=e))},n}function S(t){return"object"==typeof t}function $(t){return S(t)?t.indentation:0}function I(t){return S(t)?t.text:t}class D{constructor(t,e,s,i){var n,r,o;this.yargs=t,this.usage=e,this.command=s,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(n=this.shim.getEnv("SHELL"))||void 0===n?void 0:n.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,s,i){const n=this.command.getCommandHandlers();for(let e=0,s=t.length;e<s;++e)if(n[t[e]]&&n[t[e]].builder){const s=n[t[e]].builder;if(E(s)){this.indexAfterLastReset=e+1;const t=this.yargs.getInternalMethods().reset();return s(t,!0),t.argv}}const r=[];this.commandCompletions(r,t,s),this.optionCompletions(r,t,e,s),this.choicesFromOptionsCompletions(r,t,e,s),this.choicesFromPositionalsCompletions(r,t,e,s),i(null,r)}commandCompletions(t,e,s){const i=this.yargs.getInternalMethods().getContext().commands;s.match(/^-/)||i[i.length-1]===s||this.previousArgHasChoices(e)||this.usage.getCommands().forEach(s=>{const i=o(s[0]).cmd;if(-1===e.indexOf(i))if(this.zshShell){const e=s[1]||"";t.push(i.replace(/:/g,"\\:")+":"+e)}else t.push(i)})}optionCompletions(t,e,s,i){if((i.match(/^-/)||""===i&&0===t.length)&&!this.previousArgHasChoices(e)){const s=this.yargs.getOptions(),n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(r=>{const o=!!s.configuration["boolean-negation"]&&s.boolean.includes(r);n.includes(r)||s.hiddenOptions.includes(r)||this.argsContainKey(e,r,o)||this.completeOptionKey(r,t,i,o&&!!s.default[r])})}}choicesFromOptionsCompletions(t,e,s,i){if(this.previousArgHasChoices(e)){const s=this.getPreviousArgChoices(e);s&&s.length>0&&t.push(...s.map(t=>t.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(t,e,s,i){if(""===i&&t.length>0&&this.previousArgHasChoices(e))return;const n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=n[s._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(i)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],s="";if(!e.startsWith("-")&&t.length>1&&(s=e,e=t[t.length-2]),!e.startsWith("-"))return;const i=e.replace(/^-+/,""),n=this.yargs.getOptions(),r=[i,...this.yargs.getAliases()[i]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(n.key,t)&&Array.isArray(n.choices[t])){o=n.choices[t];break}return o?o.filter(t=>!s||t.startsWith(s)):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,s){const i=e=>-1!==t.indexOf((/^[^0-9]$/.test(e)?"-":"--")+e);if(i(e))return!0;if(s&&i(`no-${e}`))return!0;if(this.aliases)for(const t of this.aliases[e])if(i(t))return!0;return!1}completeOptionKey(t,e,s,i){var n,r,o,a;let h=t;if(this.zshShell){const e=this.usage.getDescriptions(),s=null===(r=null===(n=null==this?void 0:this.aliases)||void 0===n?void 0:n[t])||void 0===r?void 0:r.find(t=>{const s=e[t];return"string"==typeof s&&s.length>0}),i=s?e[s]:void 0,l=null!==(a=null!==(o=e[t])&&void 0!==o?o:i)&&void 0!==a?a:"";h=`${t.replace(/:/g,"\\:")}:${l.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const l=!/^--/.test(s)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";e.push(l+h),i&&e.push(l+"no-"+h)}customCompletion(t,e,s,i){if(d(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(s,e);return f(t)?t.then(t=>{this.shim.process.nextTick(()=>{i(null,t)})}).catch(t=>{this.shim.process.nextTick(()=>{i(t,void 0)})}):i(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(s,e,(n=i)=>this.defaultCompletion(t,e,s,n),t=>{i(null,t)}):this.customCompletionFunction(s,e,t=>{i(null,t)})}getCompletion(t,e){const s=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),n=this.customCompletionFunction?i=>this.customCompletion(t,i,s,e):i=>this.defaultCompletion(t,i,s,e);return f(i)?i.then(n):n(i)}generateCompletionScript(t,e){let s=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),s=s.replace(/{{app_name}}/g,i),s=s.replace(/{{completion_command}}/g,e),s.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function N(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const s=[];let i,n;for(i=0;i<=e.length;i++)s[i]=[i];for(n=0;n<=t.length;n++)s[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?s[i][n]=s[i-1][n-1]:i>1&&n>1&&e.charAt(i-2)===t.charAt(n-1)&&e.charAt(i-1)===t.charAt(n-2)?s[i][n]=s[i-2][n-2]+1:s[i][n]=Math.min(s[i-1][n-1]+1,Math.min(s[i][n-1]+1,s[i-1][n]+1));return s[e.length][t.length]}const H=["$0","--","_"];var z,W,q,U,F,L,V,G,R,T,B,Y,K,J,Z,X,Q,tt,et,st,it,nt,rt,ot,at,ht,lt,ct,ft,dt,ut,pt,gt,mt,yt;const bt=Symbol("copyDoubleDash"),vt=Symbol("copyDoubleDash"),Ot=Symbol("deleteFromParserHintObject"),wt=Symbol("emitWarning"),Ct=Symbol("freeze"),jt=Symbol("getDollarZero"),Mt=Symbol("getParserConfiguration"),_t=Symbol("getUsageConfiguration"),kt=Symbol("guessLocale"),Et=Symbol("guessVersion"),xt=Symbol("parsePositionalNumbers"),At=Symbol("pkgUp"),Pt=Symbol("populateParserHintArray"),St=Symbol("populateParserHintSingleValueDictionary"),$t=Symbol("populateParserHintArrayDictionary"),It=Symbol("populateParserHintDictionary"),Dt=Symbol("sanitizeKey"),Nt=Symbol("setKey"),Ht=Symbol("unfreeze"),zt=Symbol("validateAsync"),Wt=Symbol("getCommandInstance"),qt=Symbol("getContext"),Ut=Symbol("getHasOutput"),Ft=Symbol("getLoggerInstance"),Lt=Symbol("getParseContext"),Vt=Symbol("getUsageInstance"),Gt=Symbol("getValidationInstance"),Rt=Symbol("hasParseCallback"),Tt=Symbol("isGlobalContext"),Bt=Symbol("postProcess"),Yt=Symbol("rebase"),Kt=Symbol("reset"),Jt=Symbol("runYargsParserAndExecuteCommands"),Zt=Symbol("runValidation"),Xt=Symbol("setHasOutput"),Qt=Symbol("kTrackManuallySetKeys");class te{constructor(t=[],e,s,i){this.customScriptName=!1,this.parsed=!1,z.set(this,void 0),W.set(this,void 0),q.set(this,{commands:[],fullCommands:[]}),U.set(this,null),F.set(this,null),L.set(this,"show-hidden"),V.set(this,null),G.set(this,!0),R.set(this,{}),T.set(this,!0),B.set(this,[]),Y.set(this,void 0),K.set(this,{}),J.set(this,!1),Z.set(this,null),X.set(this,!0),Q.set(this,void 0),tt.set(this,""),et.set(this,void 0),st.set(this,void 0),it.set(this,{}),nt.set(this,null),rt.set(this,null),ot.set(this,{}),at.set(this,{}),ht.set(this,void 0),lt.set(this,!1),ct.set(this,void 0),ft.set(this,!1),dt.set(this,!1),ut.set(this,!1),pt.set(this,void 0),gt.set(this,{}),mt.set(this,null),yt.set(this,void 0),O(this,ct,i,"f"),O(this,ht,t,"f"),O(this,W,e,"f"),O(this,st,s,"f"),O(this,Y,new w(this),"f"),this.$0=this[jt](),this[Kt](),O(this,z,v(this,z,"f"),"f"),O(this,pt,v(this,pt,"f"),"f"),O(this,yt,v(this,yt,"f"),"f"),O(this,et,v(this,et,"f"),"f"),v(this,et,"f").showHiddenOpt=v(this,L,"f"),O(this,Q,this[vt](),"f")}addHelpOpt(t,e){return h("[string|boolean] [string]",[t,e],arguments.length),v(this,Z,"f")&&(this[Ot](v(this,Z,"f")),O(this,Z,null,"f")),!1===t&&void 0===e||(O(this,Z,"string"==typeof t?t:"help","f"),this.boolean(v(this,Z,"f")),this.describe(v(this,Z,"f"),e||v(this,pt,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(h("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const s="string"==typeof t?t:v(this,L,"f");return this.boolean(s),this.describe(s,e||v(this,pt,"f").deferY18nLookup("Show hidden options")),v(this,et,"f").showHiddenOpt=s,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return h("<object|string|array> [string|array]",[t,e],arguments.length),this[$t](this.alias.bind(this),"alias",t,e),this}array(t){return h("<array|string>",[t],arguments.length),this[Pt]("array",t),this[Qt](t),this}boolean(t){return h("<array|string>",[t],arguments.length),this[Pt]("boolean",t),this[Qt](t),this}check(t,e){return h("<function> [boolean]",[t,e],arguments.length),this.middleware((e,s)=>j(()=>t(e,s.getOptions()),s=>(s?("string"==typeof s||s instanceof Error)&&v(this,pt,"f").fail(s.toString(),s):v(this,pt,"f").fail(v(this,ct,"f").y18n.__("Argument check failed: %s",t.toString())),e),t=>(v(this,pt,"f").fail(t.message?t.message:t.toString(),t),e)),!1,e),this}choices(t,e){return h("<object|string|array> [string|array]",[t,e],arguments.length),this[$t](this.choices.bind(this),"choices",t,e),this}coerce(t,s){if(h("<object|string|array> [function]",[t,s],arguments.length),Array.isArray(t)){if(!s)throw new e("coerce callback must be provided");for(const e of t)this.coerce(e,s);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!s)throw new e("coerce callback must be provided");return v(this,et,"f").key[t]=!0,v(this,Y,"f").addCoerceMiddleware((i,n)=>{let r;return Object.prototype.hasOwnProperty.call(i,t)?j(()=>(r=n.getAliases(),s(i[t])),e=>{i[t]=e;const s=n.getInternalMethods().getParserConfiguration()["strip-aliased"];if(r[t]&&!0!==s)for(const s of r[t])i[s]=e;return i},t=>{throw new e(t.message)}):i},t),this}conflicts(t,e){return h("<string|object> [string|array]",[t,e],arguments.length),v(this,yt,"f").conflicts(t,e),this}config(t="config",e,s){return h("[object|string] [string|function] [function]",[t,e,s],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(s=e,e=void 0),this.describe(t,e||v(this,pt,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(t=>{v(this,et,"f").config[t]=s||!0}),this):(t=n(t,v(this,W,"f"),this[Mt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(t),this)}completion(t,e,s){return h("[string] [string|boolean|function] [function]",[t,e,s],arguments.length),"function"==typeof e&&(s=e,e=void 0),O(this,F,t||v(this,F,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(v(this,F,"f"),e),s&&v(this,U,"f").registerFunction(s),this}command(t,e,s,i,n,r){return h("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,s,i,n,r],arguments.length),v(this,z,"f").addHandler(t,e,s,i,n,r),this}commands(t,e,s,i,n,r){return this.command(t,e,s,i,n,r)}commandDir(t,e){h("<string> [object]",[t,e],arguments.length);const s=v(this,st,"f")||v(this,ct,"f").require;return v(this,z,"f").addDirectory(t,s,v(this,ct,"f").getCallerFile(),e),this}count(t){return h("<array|string>",[t],arguments.length),this[Pt]("count",t),this[Qt](t),this}default(t,e,s){return h("<object|string|array> [*] [string]",[t,e,s],arguments.length),s&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]=s),"function"==typeof e&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]||(v(this,et,"f").defaultDescription[t]=v(this,pt,"f").functionDescription(e)),e=e.call()),this[St](this.default.bind(this),"default",t,e),this}defaults(t,e,s){return this.default(t,e,s)}demandCommand(t=1,e,s,i){return h("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,s,i],arguments.length),"number"!=typeof e&&(s=e,e=1/0),this.global("_",!1),v(this,et,"f").demandedCommands._={min:t,max:e,minMsg:s,maxMsg:i},this}demand(t,e,s){return Array.isArray(e)?(e.forEach(t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)}),e=1/0):"number"!=typeof e&&(s=e,e=1/0),"number"==typeof t?(d(s,!0,v(this,ct,"f")),this.demandCommand(t,e,s,s)):Array.isArray(t)?t.forEach(t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)}):"string"==typeof s?this.demandOption(t,s):!0!==s&&void 0!==s||this.demandOption(t),this}demandOption(t,e){return h("<object|string|array> [string]",[t,e],arguments.length),this[St](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return h("<string> [string|boolean]",[t,e],arguments.length),v(this,et,"f").deprecatedOptions[t]=e,this}describe(t,e){return h("<object|string|array> [string]",[t,e],arguments.length),this[Nt](t,!0),v(this,pt,"f").describe(t,e),this}detectLocale(t){return h("<boolean>",[t],arguments.length),O(this,G,t,"f"),this}env(t){return h("[string|boolean]",[t],arguments.length),!1===t?delete v(this,et,"f").envPrefix:v(this,et,"f").envPrefix=t||"",this}epilogue(t){return h("<string>",[t],arguments.length),v(this,pt,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return h("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach(t=>this.example(...t)):v(this,pt,"f").example(t,e),this}exit(t,e){O(this,J,!0,"f"),O(this,V,e,"f"),v(this,T,"f")&&v(this,ct,"f").process.exit(t)}exitProcess(t=!0){return h("[boolean]",[t],arguments.length),O(this,T,t,"f"),this}fail(t){if(h("<function|boolean>",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new e("Invalid first argument. Expected function or boolean 'false'");return v(this,pt,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return h("<array> [function]",[t,e],arguments.length),e?v(this,U,"f").getCompletion(t,e):new Promise((e,s)=>{v(this,U,"f").getCompletion(t,(t,i)=>{t?s(t):e(i)})})}getDemandedOptions(){return h([],0),v(this,et,"f").demandedOptions}getDemandedCommands(){return h([],0),v(this,et,"f").demandedCommands}getDeprecatedOptions(){return h([],0),v(this,et,"f").deprecatedOptions}getDetectLocale(){return v(this,G,"f")}getExitProcess(){return v(this,T,"f")}getGroups(){return Object.assign({},v(this,K,"f"),v(this,at,"f"))}getHelp(){if(O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Jt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(t))return t.then(()=>v(this,pt,"f").help())}const t=v(this,z,"f").runDefaultBuilderOn(this);if(f(t))return t.then(()=>v(this,pt,"f").help())}return Promise.resolve(v(this,pt,"f").help())}getOptions(){return v(this,et,"f")}getStrict(){return v(this,ft,"f")}getStrictCommands(){return v(this,dt,"f")}getStrictOptions(){return v(this,ut,"f")}global(t,e){return h("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?v(this,et,"f").local=v(this,et,"f").local.filter(e=>-1===t.indexOf(e)):t.forEach(t=>{v(this,et,"f").local.includes(t)||v(this,et,"f").local.push(t)}),this}group(t,e){h("<string|array> <string>",[t,e],arguments.length);const s=v(this,at,"f")[e]||v(this,K,"f")[e];v(this,at,"f")[e]&&delete v(this,at,"f")[e];const i={};return v(this,K,"f")[e]=(s||[]).concat(t).filter(t=>!i[t]&&(i[t]=!0)),this}hide(t){return h("<string>",[t],arguments.length),v(this,et,"f").hiddenOptions.push(t),this}implies(t,e){return h("<string|object> [number|string|array]",[t,e],arguments.length),v(this,yt,"f").implies(t,e),this}locale(t){return h("[string]",[t],arguments.length),void 0===t?(this[kt](),v(this,ct,"f").y18n.getLocale()):(O(this,G,!1,"f"),v(this,ct,"f").y18n.setLocale(t),this)}middleware(t,e,s){return v(this,Y,"f").addMiddleware(t,!!e,s)}nargs(t,e){return h("<string|object|array> [number]",[t,e],arguments.length),this[St](this.nargs.bind(this),"narg",t,e),this}normalize(t){return h("<array|string>",[t],arguments.length),this[Pt]("normalize",t),this}number(t){return h("<array|string>",[t],arguments.length),this[Pt]("number",t),this[Qt](t),this}option(t,e){if(h("<string|object> [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach(e=>{this.options(e,t[e])});else{"object"!=typeof e&&(e={}),this[Qt](t),!v(this,mt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[wt](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),v(this,et,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const s=e.deprecate||e.deprecated;s&&this.deprecateOption(t,s);const i=e.demand||e.required||e.require;i&&this.demand(t,i),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(v(this,et,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const n=e.describe||e.description||e.desc,r=v(this,pt,"f").getDescriptions();Object.prototype.hasOwnProperty.call(r,t)&&"string"!=typeof n||this.describe(t,n),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,s){h("[string|array] [function|boolean|object] [function]",[t,e,s],arguments.length),this[Ct](),void 0===t&&(t=v(this,ht,"f")),"object"==typeof e&&(O(this,rt,e,"f"),e=s),"function"==typeof e&&(O(this,nt,e,"f"),e=!1),e||O(this,ht,t,"f"),v(this,nt,"f")&&O(this,T,!1,"f");const i=this[Jt](t,!!e),n=this.parsed;return v(this,U,"f").setParsed(this.parsed),f(i)?i.then(t=>(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),t,v(this,tt,"f")),t)).catch(t=>{throw v(this,nt,"f")&&v(this,nt,"f")(t,this.parsed.argv,v(this,tt,"f")),t}).finally(()=>{this[Ht](),this.parsed=n}):(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),i,v(this,tt,"f")),this[Ht](),this.parsed=n,i)}parseAsync(t,e,s){const i=this.parse(t,e,s);return f(i)?i:Promise.resolve(i)}parseSync(t,s,i){const n=this.parse(t,s,i);if(f(n))throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return n}parserConfiguration(t){return h("<object>",[t],arguments.length),O(this,it,t,"f"),this}pkgConf(t,e){h("<string> [string]",[t,e],arguments.length);let s=null;const i=this[At](e||v(this,W,"f"));return i[t]&&"object"==typeof i[t]&&(s=n(i[t],e||v(this,W,"f"),this[Mt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(s)),this}positional(t,e){h("<string> <object>",[t,e],arguments.length);const s=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=g(e,(t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&s.includes(t));const i=v(this,q,"f").fullCommands[v(this,q,"f").fullCommands.length-1],n=i?v(this,z,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return p(n).forEach(s=>{const i=n[s];Array.isArray(i)?-1!==i.indexOf(t)&&(e[s]=!0):i[t]&&!(s in e)&&(e[s]=i[t])}),this.group(t,v(this,pt,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return h("[boolean]",[t],arguments.length),O(this,lt,t,"f"),this}required(t,e,s){return this.demand(t,e,s)}require(t,e,s){return this.demand(t,e,s)}requiresArg(t){return h("<array|string|object> [number]",[t],arguments.length),"string"==typeof t&&v(this,et,"f").narg[t]||this[St](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return h("[string] [string]",[t,e],arguments.length),t=t||this.$0,v(this,Q,"f").log(v(this,U,"f").generateCompletionScript(t,e||v(this,F,"f")||"completion")),this}showHelp(t){if(h("[string|function]",[t],arguments.length),O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Jt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(e))return e.then(()=>{v(this,pt,"f").showHelp(t)}),this}const e=v(this,z,"f").runDefaultBuilderOn(this);if(f(e))return e.then(()=>{v(this,pt,"f").showHelp(t)}),this}return v(this,pt,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return h("[boolean|string] [string]",[t,e],arguments.length),v(this,pt,"f").showHelpOnFail(t,e),this}showVersion(t){return h("[string|function]",[t],arguments.length),v(this,pt,"f").showVersion(t),this}skipValidation(t){return h("<array|string>",[t],arguments.length),this[Pt]("skipValidation",t),this}strict(t){return h("[boolean]",[t],arguments.length),O(this,ft,!1!==t,"f"),this}strictCommands(t){return h("[boolean]",[t],arguments.length),O(this,dt,!1!==t,"f"),this}strictOptions(t){return h("[boolean]",[t],arguments.length),O(this,ut,!1!==t,"f"),this}string(t){return h("<array|string>",[t],arguments.length),this[Pt]("string",t),this[Qt](t),this}terminalWidth(){return h([],0),v(this,ct,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return h("<object>",[t],arguments.length),O(this,G,!1,"f"),v(this,ct,"f").y18n.updateLocale(t),this}usage(t,s,i,n){if(h("<string|null|undefined> [string|boolean] [function|object] [function]",[t,s,i,n],arguments.length),void 0!==s){if(d(t,null,v(this,ct,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,s,i,n);throw new e(".usage() description must start with $0 if being used as alias for .command()")}return v(this,pt,"f").usage(t),this}usageConfiguration(t){return h("<object>",[t],arguments.length),O(this,gt,t,"f"),this}version(t,e,s){const i="version";if(h("[boolean|string] [string] [string]",[t,e,s],arguments.length),v(this,mt,"f")&&(this[Ot](v(this,mt,"f")),v(this,pt,"f").version(void 0),O(this,mt,null,"f")),0===arguments.length)s=this[Et](),t=i;else if(1===arguments.length){if(!1===t)return this;s=t,t=i}else 2===arguments.length&&(s=e,e=void 0);return O(this,mt,"string"==typeof t?t:i,"f"),e=e||v(this,pt,"f").deferY18nLookup("Show version number"),v(this,pt,"f").version(s||void 0),this.boolean(v(this,mt,"f")),this.describe(v(this,mt,"f"),e),this}wrap(t){return h("<number|null|undefined>",[t],arguments.length),v(this,pt,"f").wrap(t),this}[(z=new WeakMap,W=new WeakMap,q=new WeakMap,U=new WeakMap,F=new WeakMap,L=new WeakMap,V=new WeakMap,G=new WeakMap,R=new WeakMap,T=new WeakMap,B=new WeakMap,Y=new WeakMap,K=new WeakMap,J=new WeakMap,Z=new WeakMap,X=new WeakMap,Q=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakMap,it=new WeakMap,nt=new WeakMap,rt=new WeakMap,ot=new WeakMap,at=new WeakMap,ht=new WeakMap,lt=new WeakMap,ct=new WeakMap,ft=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,mt=new WeakMap,yt=new WeakMap,bt)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[vt](){return{log:(...t)=>{this[Rt]()||console.log(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")},error:(...t)=>{this[Rt]()||console.error(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")}}}[Ot](t){p(v(this,et,"f")).forEach(e=>{if("configObjects"===e)return;const s=v(this,et,"f")[e];Array.isArray(s)?s.includes(t)&&s.splice(s.indexOf(t),1):"object"==typeof s&&delete s[t]}),delete v(this,pt,"f").getDescriptions()[t]}[wt](t,e,s){v(this,R,"f")[s]||(v(this,ct,"f").process.emitWarning(t,e),v(this,R,"f")[s]=!0)}[Ct](){v(this,B,"f").push({options:v(this,et,"f"),configObjects:v(this,et,"f").configObjects.slice(0),exitProcess:v(this,T,"f"),groups:v(this,K,"f"),strict:v(this,ft,"f"),strictCommands:v(this,dt,"f"),strictOptions:v(this,ut,"f"),completionCommand:v(this,F,"f"),output:v(this,tt,"f"),exitError:v(this,V,"f"),hasOutput:v(this,J,"f"),parsed:this.parsed,parseFn:v(this,nt,"f"),parseContext:v(this,rt,"f")}),v(this,pt,"f").freeze(),v(this,yt,"f").freeze(),v(this,z,"f").freeze(),v(this,Y,"f").freeze()}[jt](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(v(this,ct,"f").process.argv()[0])?v(this,ct,"f").process.argv().slice(1,2):v(this,ct,"f").process.argv().slice(0,1),e=t.map(t=>{const e=this[Yt](v(this,W,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.length<t.length?e:t}).join(" ").trim(),v(this,ct,"f").getEnv("_")&&v(this,ct,"f").getProcessArgvBin()===v(this,ct,"f").getEnv("_")&&(e=v(this,ct,"f").getEnv("_").replace(`${v(this,ct,"f").path.dirname(v(this,ct,"f").process.execPath())}/`,"")),e}[Mt](){return v(this,it,"f")}[_t](){return v(this,gt,"f")}[kt](){if(!v(this,G,"f"))return;const t=v(this,ct,"f").getEnv("LC_ALL")||v(this,ct,"f").getEnv("LC_MESSAGES")||v(this,ct,"f").getEnv("LANG")||v(this,ct,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[Et](){return this[At]().version||"unknown"}[xt](t){const e=t["--"]?t["--"]:t._;for(let t,s=0;void 0!==(t=e[s]);s++)v(this,ct,"f").Parser.looksLikeNumber(t)&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))&&(e[s]=Number(t));return t}[At](t){const e=t||"*";if(v(this,ot,"f")[e])return v(this,ot,"f")[e];let s={};try{let e=t||v(this,ct,"f").mainFilename;!t&&v(this,ct,"f").path.extname(e)&&(e=v(this,ct,"f").path.dirname(e));const i=v(this,ct,"f").findUp(e,(t,e)=>e.includes("package.json")?"package.json":void 0);d(i,void 0,v(this,ct,"f")),s=JSON.parse(v(this,ct,"f").readFileSync(i,"utf8"))}catch(t){}return v(this,ot,"f")[e]=s||{},v(this,ot,"f")[e]}[Pt](t,e){(e=[].concat(e)).forEach(e=>{e=this[Dt](e),v(this,et,"f")[t].push(e)})}[St](t,e,s,i){this[It](t,e,s,i,(t,e,s)=>{v(this,et,"f")[t][e]=s})}[$t](t,e,s,i){this[It](t,e,s,i,(t,e,s)=>{v(this,et,"f")[t][e]=(v(this,et,"f")[t][e]||[]).concat(s)})}[It](t,e,s,i,n){if(Array.isArray(s))s.forEach(e=>{t(e,i)});else if((t=>"object"==typeof t)(s))for(const e of p(s))t(e,s[e]);else n(e,this[Dt](s),i)}[Dt](t){return"__proto__"===t?"___proto___":t}[Nt](t,e){return this[St](this[Nt].bind(this),"key",t,e),this}[Ht](){var t,e,s,i,n,r,o,a,h,l,c,f;const u=v(this,B,"f").pop();let p;d(u,void 0,v(this,ct,"f")),t=this,e=this,s=this,i=this,n=this,r=this,o=this,a=this,h=this,l=this,c=this,f=this,({options:{set value(e){O(t,et,e,"f")}}.value,configObjects:p,exitProcess:{set value(t){O(e,T,t,"f")}}.value,groups:{set value(t){O(s,K,t,"f")}}.value,output:{set value(t){O(i,tt,t,"f")}}.value,exitError:{set value(t){O(n,V,t,"f")}}.value,hasOutput:{set value(t){O(r,J,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){O(o,ft,t,"f")}}.value,strictCommands:{set value(t){O(a,dt,t,"f")}}.value,strictOptions:{set value(t){O(h,ut,t,"f")}}.value,completionCommand:{set value(t){O(l,F,t,"f")}}.value,parseFn:{set value(t){O(c,nt,t,"f")}}.value,parseContext:{set value(t){O(f,rt,t,"f")}}.value}=u),v(this,et,"f").configObjects=p,v(this,pt,"f").unfreeze(),v(this,yt,"f").unfreeze(),v(this,z,"f").unfreeze(),v(this,Y,"f").unfreeze()}[zt](t,e){return j(e,e=>(t(e),e))}getInternalMethods(){return{getCommandInstance:this[Wt].bind(this),getContext:this[qt].bind(this),getHasOutput:this[Ut].bind(this),getLoggerInstance:this[Ft].bind(this),getParseContext:this[Lt].bind(this),getParserConfiguration:this[Mt].bind(this),getUsageConfiguration:this[_t].bind(this),getUsageInstance:this[Vt].bind(this),getValidationInstance:this[Gt].bind(this),hasParseCallback:this[Rt].bind(this),isGlobalContext:this[Tt].bind(this),postProcess:this[Bt].bind(this),reset:this[Kt].bind(this),runValidation:this[Zt].bind(this),runYargsParserAndExecuteCommands:this[Jt].bind(this),setHasOutput:this[Xt].bind(this)}}[Wt](){return v(this,z,"f")}[qt](){return v(this,q,"f")}[Ut](){return v(this,J,"f")}[Ft](){return v(this,Q,"f")}[Lt](){return v(this,rt,"f")||{}}[Vt](){return v(this,pt,"f")}[Gt](){return v(this,yt,"f")}[Rt](){return!!v(this,nt,"f")}[Tt](){return v(this,X,"f")}[Bt](t,e,s,i){if(s)return t;if(f(t))return t;e||(t=this[bt](t));return(this[Mt]()["parse-positional-numbers"]||void 0===this[Mt]()["parse-positional-numbers"])&&(t=this[xt](t)),i&&(t=C(t,this,v(this,Y,"f").getMiddleware(),!1)),t}[Kt](t={}){O(this,et,v(this,et,"f")||{},"f");const e={};e.local=v(this,et,"f").local||[],e.configObjects=v(this,et,"f").configObjects||[];const s={};e.local.forEach(e=>{s[e]=!0,(t[e]||[]).forEach(t=>{s[t]=!0})}),Object.assign(v(this,at,"f"),Object.keys(v(this,K,"f")).reduce((t,e)=>{const i=v(this,K,"f")[e].filter(t=>!(t in s));return i.length>0&&(t[e]=i),t},{})),O(this,K,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach(t=>{e[t]=(v(this,et,"f")[t]||[]).filter(t=>!s[t])}),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach(t=>{e[t]=g(v(this,et,"f")[t],t=>!s[t])}),e.envPrefix=v(this,et,"f").envPrefix,O(this,et,e,"f"),O(this,pt,v(this,pt,"f")?v(this,pt,"f").reset(s):P(this,v(this,ct,"f")),"f"),O(this,yt,v(this,yt,"f")?v(this,yt,"f").reset(s):function(t,e,s){const i=s.y18n.__,n=s.y18n.__n,r={nonOptionCount:function(s){const i=t.getDemandedCommands(),r=s._.length+(s["--"]?s["--"].length:0)-t.getInternalMethods().getContext().commands.length;i._&&(r<i._.min||r>i._.max)&&(r<i._.min?void 0!==i._.minMsg?e.fail(i._.minMsg?i._.minMsg.replace(/\$0/g,r.toString()).replace(/\$1/,i._.min.toString()):null):e.fail(n("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",r,r.toString(),i._.min.toString())):r>i._.max&&(void 0!==i._.maxMsg?e.fail(i._.maxMsg?i._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,i._.max.toString()):null):e.fail(n("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),i._.max.toString()))))},positionalCount:function(t,s){s<t&&e.fail(n("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",s,s+"",t+""))},requiredArguments:function(t,s){let i=null;for(const e of Object.keys(s))Object.prototype.hasOwnProperty.call(t,e)&&void 0!==t[e]||(i=i||{},i[e]=s[e]);if(i){const t=[];for(const e of Object.keys(i)){const s=i[e];s&&t.indexOf(s)<0&&t.push(s)}const s=t.length?`\n${t.join("\n")}`:"";e.fail(n("Missing required argument: %s","Missing required arguments: %s",Object.keys(i).length,Object.keys(i).join(", ")+s))}},unknownArguments:function(s,i,o,a,h=!0){var l;const c=t.getInternalMethods().getCommandInstance().getCommands(),f=[],d=t.getInternalMethods().getContext();if(Object.keys(s).forEach(e=>{H.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,i)||f.push(e)}),h&&(d.commands.length>0||c.length>0||a)&&s._.slice(d.commands.length).forEach(t=>{c.includes(""+t)||f.push(""+t)}),h){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,i=d.commands.length+e;i<s._.length&&s._.slice(i).forEach(t=>{t=String(t),d.commands.includes(t)||f.includes(t)||f.push(t)})}f.length&&e.fail(n("Unknown argument: %s","Unknown arguments: %s",f.length,f.map(t=>t.trim()?t:`"${t}"`).join(", ")))},unknownCommands:function(s){const i=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||i.length>0)&&s._.slice(o.commands.length).forEach(t=>{i.includes(""+t)||r.push(""+t)}),r.length>0&&(e.fail(n("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,s){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;const i=t.parsed.newAliases;return[e,...s[e]].some(t=>!Object.prototype.hasOwnProperty.call(i,t)||!i[e])},limitedChoices:function(s){const n=t.getOptions(),r={};if(!Object.keys(n.choices).length)return;Object.keys(s).forEach(t=>{-1===H.indexOf(t)&&Object.prototype.hasOwnProperty.call(n.choices,t)&&[].concat(s[t]).forEach(e=>{-1===n.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))})});const o=Object.keys(r);if(!o.length)return;let a=i("Invalid values:");o.forEach(t=>{a+=`\n ${i("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(n.choices[t]))}`}),e.fail(a)}};let o={};function a(t,e){const s=Number(e);return"number"==typeof(e=isNaN(s)?e:s)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,i){h("<string|object> [array|number|string]",[e,i],arguments.length),"object"==typeof e?Object.keys(e).forEach(t=>{r.implies(t,e[t])}):(t.global(e),o[e]||(o[e]=[]),Array.isArray(i)?i.forEach(t=>r.implies(e,t)):(d(i,void 0,s),o[e].push(i)))},r.getImplied=function(){return o},r.implications=function(t){const s=[];if(Object.keys(o).forEach(e=>{const i=e;(o[e]||[]).forEach(e=>{let n=i;const r=e;n=a(t,n),e=a(t,e),n&&!e&&s.push(` ${i} -> ${r}`)})}),s.length){let t=`${i("Implications failed:")}\n`;s.forEach(e=>{t+=e}),e.fail(t)}};let l={};r.conflicts=function(e,s){h("<string|object> [array|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach(t=>{r.conflicts(t,e[t])}):(t.global(e),l[e]||(l[e]=[]),Array.isArray(s)?s.forEach(t=>r.conflicts(e,t)):l[e].push(s))},r.getConflicting=()=>l,r.conflicting=function(n){Object.keys(n).forEach(t=>{l[t]&&l[t].forEach(s=>{s&&void 0!==n[t]&&void 0!==n[s]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,s))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(t=>{l[t].forEach(r=>{r&&void 0!==n[s.Parser.camelCase(t)]&&void 0!==n[s.Parser.camelCase(r)]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,r))})})},r.recommendCommands=function(t,s){s=s.sort((t,e)=>e.length-t.length);let n=null,r=1/0;for(let e,i=0;void 0!==(e=s[i]);i++){const s=N(t,e);s<=3&&s<r&&(r=s,n=e)}n&&e.fail(i("Did you mean %s?",n))},r.reset=function(t){return o=g(o,e=>!t[e]),l=g(l,e=>!t[e]),r};const c=[];return r.freeze=function(){c.push({implied:o,conflicting:l})},r.unfreeze=function(){const t=c.pop();d(t,void 0,s),({implied:o,conflicting:l}=t)},r}(this,v(this,pt,"f"),v(this,ct,"f")),"f"),O(this,z,v(this,z,"f")?v(this,z,"f").reset():function(t,e,s,i){return new _(t,e,s,i)}(v(this,pt,"f"),v(this,yt,"f"),v(this,Y,"f"),v(this,ct,"f")),"f"),v(this,U,"f")||O(this,U,function(t,e,s,i){return new D(t,e,s,i)}(this,v(this,pt,"f"),v(this,z,"f"),v(this,ct,"f")),"f"),v(this,Y,"f").reset(),O(this,F,null,"f"),O(this,tt,"","f"),O(this,V,null,"f"),O(this,J,!1,"f"),this.parsed=!1,this}[Yt](t,e){return v(this,ct,"f").path.relative(t,e)}[Jt](t,s,i,n=0,r=!1){let o=!!i||r;t=t||v(this,ht,"f"),v(this,et,"f").__=v(this,ct,"f").y18n.__,v(this,et,"f").configuration=this[Mt]();const a=!!v(this,et,"f").configuration["populate--"],h=Object.assign({},v(this,et,"f").configuration,{"populate--":!0}),l=v(this,ct,"f").Parser.detailed(t,Object.assign({},v(this,et,"f"),{configuration:{"parse-positional-numbers":!1,...h}})),c=Object.assign(l.argv,v(this,rt,"f"));let d;const u=l.aliases;let p=!1,g=!1;Object.keys(c).forEach(t=>{t===v(this,Z,"f")&&c[t]?p=!0:t===v(this,mt,"f")&&c[t]&&(g=!0)}),c.$0=this.$0,this.parsed=l,0===n&&v(this,pt,"f").clearCachedHelpMessage();try{if(this[kt](),s)return this[Bt](c,a,!!i,!1);if(v(this,Z,"f")){[v(this,Z,"f")].concat(u[v(this,Z,"f")]||[]).filter(t=>t.length>1).includes(""+c._[c._.length-1])&&(c._.pop(),p=!0)}O(this,X,!1,"f");const h=v(this,z,"f").getCommands(),m=v(this,U,"f").completionKey in c,y=p||m||r;if(c._.length){if(h.length){let t;for(let e,s=n||0;void 0!==c._[s];s++){if(e=String(c._[s]),h.includes(e)&&e!==v(this,F,"f")){const t=v(this,z,"f").runCommand(e,this,l,s+1,r,p||g||r);return this[Bt](t,a,!!i,!1)}if(!t&&e!==v(this,F,"f")){t=e;break}}!v(this,z,"f").hasDefaultCommand()&&v(this,lt,"f")&&t&&!y&&v(this,yt,"f").recommendCommands(t,h)}v(this,F,"f")&&c._.includes(v(this,F,"f"))&&!m&&(v(this,T,"f")&&x(!0),this.showCompletionScript(),this.exit(0))}if(v(this,z,"f").hasDefaultCommand()&&!y){const t=v(this,z,"f").runCommand(null,this,l,0,r,p||g||r);return this[Bt](t,a,!!i,!1)}if(m){v(this,T,"f")&&x(!0);const s=(t=[].concat(t)).slice(t.indexOf(`--${v(this,U,"f").completionKey}`)+1);return v(this,U,"f").getCompletion(s,(t,s)=>{if(t)throw new e(t.message);(s||[]).forEach(t=>{v(this,Q,"f").log(t)}),this.exit(0)}),this[Bt](c,!a,!!i,!1)}if(v(this,J,"f")||(p?(v(this,T,"f")&&x(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(v(this,T,"f")&&x(!0),o=!0,v(this,pt,"f").showVersion("log"),this.exit(0))),!o&&v(this,et,"f").skipValidation.length>0&&(o=Object.keys(c).some(t=>v(this,et,"f").skipValidation.indexOf(t)>=0&&!0===c[t])),!o){if(l.error)throw new e(l.error.message);if(!m){const t=this[Zt](u,{},l.error);i||(d=C(c,this,v(this,Y,"f").getMiddleware(),!0)),d=this[zt](t,null!=d?d:c),f(d)&&!i&&(d=d.then(()=>C(c,this,v(this,Y,"f").getMiddleware(),!1)))}}}catch(t){if(!(t instanceof e))throw t;v(this,pt,"f").fail(t.message,t)}return this[Bt](null!=d?d:c,a,!!i,!0)}[Zt](t,s,i,n){const r={...this.getDemandedOptions()};return o=>{if(i)throw new e(i.message);v(this,yt,"f").nonOptionCount(o),v(this,yt,"f").requiredArguments(o,r);let a=!1;v(this,dt,"f")&&(a=v(this,yt,"f").unknownCommands(o)),v(this,ft,"f")&&!a?v(this,yt,"f").unknownArguments(o,t,s,!!n):v(this,ut,"f")&&v(this,yt,"f").unknownArguments(o,t,{},!1,!1),v(this,yt,"f").limitedChoices(o),v(this,yt,"f").implications(o),v(this,yt,"f").conflicting(o)}}[Xt](){O(this,J,!0,"f")}[Qt](t){if("string"==typeof t)v(this,et,"f").key[t]=!0;else for(const e of t)v(this,et,"f").key[e]=!0}}var ee,se;const{readFileSync:ie}=__webpack_require__(9896),{inspect:ne}=__webpack_require__(9023),{resolve:re}=__webpack_require__(6928),oe=__webpack_require__(9668),ae=__webpack_require__(6180);var he,le={assert:{notStrictEqual:t.notStrictEqual,strictEqual:t.strictEqual},cliui:__webpack_require__(164),findUp:__webpack_require__(7829),getEnv:t=>process.env[t],getCallerFile:__webpack_require__(2838),getProcessArgvBin:y,inspect:ne,mainFilename:null!==(se=null===(ee= false||void 0===__webpack_require__(7315)?void 0:__webpack_require__.c[__webpack_require__.s])||void 0===ee?void 0:ee.filename)&&void 0!==se?se:process.cwd(),Parser:ae,path:__webpack_require__(6928),process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:t=>{process.exit(t)},nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:ie,require:__webpack_require__(7315),requireDirectory:__webpack_require__(9386),stringWidth:__webpack_require__(4813),y18n:oe({directory:re(__dirname,"../locales"),updateFiles:!1})};const ce=(null===(he=null===process||void 0===process?void 0:process.env)||void 0===he?void 0:he.YARGS_MIN_NODE_VERSION)?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version){if(Number(process.version.match(/v([^.]+)/)[1])<ce)throw Error(`yargs supports a minimum Node.js version of ${ce}. Read our version support policy: https://github.com/yargs/yargs#supported-nodejs-versions`)}const fe=__webpack_require__(6180);var de,ue={applyExtends:n,cjsPlatformShim:le,Yargs:(de=le,(t=[],e=de.process.cwd(),s)=>{const i=new te(t,e,s,de);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}),argsert:h,isPromise:f,objFilter:g,parseCommand:o,Parser:fe,processArgv:b,YError:e};module.exports=ue;
|
|
37397
37983
|
|
|
37398
37984
|
|
|
37399
37985
|
/***/ },
|
|
@@ -39416,24 +40002,24 @@ module.exports = /*#__PURE__*/JSON.parse('{"name":"seek-bzip","version":"1.0.6",
|
|
|
39416
40002
|
(module) {
|
|
39417
40003
|
|
|
39418
40004
|
"use strict";
|
|
39419
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@squidcloud/cli","version":"1.0.
|
|
40005
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@squidcloud/cli","version":"1.0.485","description":"The Squid CLI","main":"dist/index.js","scripts":{"start":"node dist/index.js","start-ts":"ts-node -r tsconfig-paths/register src/index.ts","prebuild":"rimraf dist","build":"webpack --mode=production","build:dev":"webpack --mode=development","lint":"eslint","link":"npm run build && chmod 755 dist/index.js && npm link","watch":"webpack --watch","deploy":"npm run build && npm pack --silent | xargs -I {} mv {} package.tgz && npm install -g package.tgz && rm -rf package.tgz","publish:public":"npm run build && npm publish --access public"},"files":["dist/**/*"],"bin":{"squid":"dist/index.js"},"keywords":[],"author":"","license":"ISC","engines":{"node":">=18.0.0"},"dependencies":{"@squidcloud/local-backend":"^1.0.485","adm-zip":"^0.5.16","copy-webpack-plugin":"^14.0.0","decompress":"^4.2.1","logpipes":"^1.11.0","nodemon":"^3.1.9","terser-webpack-plugin":"^5.5.0","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0","tsconfig-paths-webpack-plugin":"^4.1.0","webpack":"^5.106.2","zip-webpack-plugin":"^4.0.1"},"devDependencies":{"@types/adm-zip":"^0.5.7","@types/decompress":"^4.2.7","@types/node":"^20.19.9","terminal-link":"^3.0.0"}}');
|
|
39420
40006
|
|
|
39421
40007
|
/***/ }
|
|
39422
40008
|
|
|
39423
40009
|
/******/ });
|
|
39424
40010
|
/************************************************************************/
|
|
39425
40011
|
/******/ // The module cache
|
|
39426
|
-
/******/
|
|
40012
|
+
/******/ const __webpack_module_cache__ = {};
|
|
39427
40013
|
/******/
|
|
39428
40014
|
/******/ // The require function
|
|
39429
40015
|
/******/ function __webpack_require__(moduleId) {
|
|
39430
40016
|
/******/ // Check if module is in cache
|
|
39431
|
-
/******/
|
|
40017
|
+
/******/ const cachedModule = __webpack_module_cache__[moduleId];
|
|
39432
40018
|
/******/ if (cachedModule !== undefined) {
|
|
39433
40019
|
/******/ return cachedModule.exports;
|
|
39434
40020
|
/******/ }
|
|
39435
40021
|
/******/ // Create a new module (and put it into the cache)
|
|
39436
|
-
/******/
|
|
40022
|
+
/******/ const module = __webpack_module_cache__[moduleId] = {
|
|
39437
40023
|
/******/ id: moduleId,
|
|
39438
40024
|
/******/ loaded: false,
|
|
39439
40025
|
/******/ exports: {}
|
|
@@ -39455,11 +40041,26 @@ module.exports = /*#__PURE__*/JSON.parse('{"name":"@squidcloud/cli","version":"1
|
|
|
39455
40041
|
/************************************************************************/
|
|
39456
40042
|
/******/ /* webpack/runtime/define property getters */
|
|
39457
40043
|
/******/ (() => {
|
|
39458
|
-
/******/ // define getter functions for harmony exports
|
|
40044
|
+
/******/ // define getter/value functions for harmony exports
|
|
39459
40045
|
/******/ __webpack_require__.d = (exports, definition) => {
|
|
39460
|
-
/******/
|
|
39461
|
-
/******/
|
|
39462
|
-
/******/
|
|
40046
|
+
/******/ if(Array.isArray(definition)) {
|
|
40047
|
+
/******/ var i = 0;
|
|
40048
|
+
/******/ while(i < definition.length) {
|
|
40049
|
+
/******/ var key = definition[i++];
|
|
40050
|
+
/******/ var binding = definition[i++];
|
|
40051
|
+
/******/ if(!__webpack_require__.o(exports, key)) {
|
|
40052
|
+
/******/ if(binding === 0) {
|
|
40053
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
|
|
40054
|
+
/******/ } else {
|
|
40055
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
|
|
40056
|
+
/******/ }
|
|
40057
|
+
/******/ } else if(binding === 0) { i++; }
|
|
40058
|
+
/******/ }
|
|
40059
|
+
/******/ } else {
|
|
40060
|
+
/******/ for(var key in definition) {
|
|
40061
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
40062
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
40063
|
+
/******/ }
|
|
39463
40064
|
/******/ }
|
|
39464
40065
|
/******/ }
|
|
39465
40066
|
/******/ };
|
|
@@ -39474,7 +40075,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"name":"@squidcloud/cli","version":"1
|
|
|
39474
40075
|
/******/ (() => {
|
|
39475
40076
|
/******/ // define __esModule on exports
|
|
39476
40077
|
/******/ __webpack_require__.r = (exports) => {
|
|
39477
|
-
/******/ if(
|
|
40078
|
+
/******/ if(Symbol.toStringTag) {
|
|
39478
40079
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
39479
40080
|
/******/ }
|
|
39480
40081
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -39495,8 +40096,8 @@ module.exports = /*#__PURE__*/JSON.parse('{"name":"@squidcloud/cli","version":"1
|
|
|
39495
40096
|
/******/ // module cache are used so entry inlining is disabled
|
|
39496
40097
|
/******/ // startup
|
|
39497
40098
|
/******/ // Load entry module and return exports
|
|
39498
|
-
/******/
|
|
39499
|
-
/******/
|
|
40099
|
+
/******/ let __webpack_exports__ = __webpack_require__(__webpack_require__.s = 6568);
|
|
40100
|
+
/******/ const __webpack_export_target__ = exports;
|
|
39500
40101
|
/******/ for(var __webpack_i__ in __webpack_exports__) __webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
39501
40102
|
/******/ if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
|
|
39502
40103
|
/******/
|