@abaplint/cli 2.120.109 → 2.120.111
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/build/cli.js +1677 -79
- package/package.json +5 -5
package/build/cli.js
CHANGED
|
@@ -12209,7 +12209,7 @@ class AuthorityCheck {
|
|
|
12209
12209
|
getMatcher() {
|
|
12210
12210
|
const field = (0, combi_1.seq)("FIELD", expressions_1.Source);
|
|
12211
12211
|
const id = (0, combi_1.seq)("ID", expressions_1.Source, (0, combi_1.alt)(field, "DUMMY"));
|
|
12212
|
-
const ret = (0, combi_1.seq)("AUTHORITY-CHECK OBJECT", expressions_1.Source, (0, combi_1.opt)((0, combi_1.seq)("FOR USER", expressions_1.Source)), (0, combi_1.plus)(id));
|
|
12212
|
+
const ret = (0, combi_1.seq)("AUTHORITY-CHECK OBJECT", expressions_1.Source, (0, combi_1.opt)((0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.seq)("FOR USER", expressions_1.Source))), (0, combi_1.plus)(id));
|
|
12213
12213
|
return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, ret);
|
|
12214
12214
|
}
|
|
12215
12215
|
}
|
|
@@ -13102,7 +13102,7 @@ const version_1 = __webpack_require__(/*! ../../../version */ "../core/build/src
|
|
|
13102
13102
|
class Commit {
|
|
13103
13103
|
getMatcher() {
|
|
13104
13104
|
const work = (0, combi_1.seq)("WORK", (0, combi_1.opt)("AND WAIT"));
|
|
13105
|
-
return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("COMMIT", (0, combi_1.alt)(work, expressions_1.DatabaseConnection)));
|
|
13105
|
+
return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("COMMIT", (0, combi_1.alt)(work, (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, expressions_1.DatabaseConnection))));
|
|
13106
13106
|
}
|
|
13107
13107
|
}
|
|
13108
13108
|
exports.Commit = Commit;
|
|
@@ -13411,9 +13411,9 @@ class Convert {
|
|
|
13411
13411
|
const tim = (0, combi_1.seq)("TIME", expressions_1.Source);
|
|
13412
13412
|
const stamp = (0, combi_1.seq)("INTO TIME STAMP", expressions_1.Target);
|
|
13413
13413
|
const intoutc = (0, combi_1.ver)(version_1.Release.v754, (0, combi_1.seq)("INTO UTCLONG", expressions_1.Target), { also: combi_1.AlsoIn.OpenABAP });
|
|
13414
|
-
const invert = (0, combi_1.seq)("INTO INVERTED-DATE", expressions_1.Target);
|
|
13414
|
+
const invert = (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.seq)("INTO INVERTED-DATE", expressions_1.Target));
|
|
13415
13415
|
const date = (0, combi_1.seq)((0, combi_1.per)(dat, tim), (0, combi_1.per)(daylightSource, stamp, zone, invert, intoutc));
|
|
13416
|
-
const inv = (0, combi_1.seq)("INVERTED-DATE", expressions_1.Source, "INTO DATE", expressions_1.Target);
|
|
13416
|
+
const inv = (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.seq)("INVERTED-DATE", expressions_1.Source, "INTO DATE", expressions_1.Target));
|
|
13417
13417
|
const utclong = (0, combi_1.ver)(version_1.Release.v754, (0, combi_1.seq)("UTCLONG", expressions_1.Source, (0, combi_1.per)(zone, into, daylightTarget)), { also: combi_1.AlsoIn.OpenABAP });
|
|
13418
13418
|
return (0, combi_1.seq)("CONVERT", (0, combi_1.alt)(time, date, inv, utclong));
|
|
13419
13419
|
}
|
|
@@ -13981,13 +13981,14 @@ exports.Divide = Divide;
|
|
|
13981
13981
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13982
13982
|
exports.Do = void 0;
|
|
13983
13983
|
const combi_1 = __webpack_require__(/*! ../combi */ "../core/build/src/abap/2_statements/combi.js");
|
|
13984
|
+
const version_1 = __webpack_require__(/*! ../../../version */ "../core/build/src/version.js");
|
|
13984
13985
|
const expressions_1 = __webpack_require__(/*! ../expressions */ "../core/build/src/abap/2_statements/expressions/index.js");
|
|
13985
13986
|
class Do {
|
|
13986
13987
|
getMatcher() {
|
|
13987
13988
|
const range = (0, combi_1.seq)("RANGE", expressions_1.Source);
|
|
13988
13989
|
const vary = (0, combi_1.seq)("VARYING", expressions_1.Target, "FROM", expressions_1.Source, "NEXT", expressions_1.Source, (0, combi_1.optPrio)(range));
|
|
13989
13990
|
const times = (0, combi_1.seq)(expressions_1.Source, "TIMES");
|
|
13990
|
-
return (0, combi_1.seq)("DO", (0, combi_1.optPrio)((0, combi_1.per)((0, combi_1.plus)(vary), times)));
|
|
13991
|
+
return (0, combi_1.seq)("DO", (0, combi_1.optPrio)((0, combi_1.per)((0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.plus)(vary)), times)));
|
|
13991
13992
|
}
|
|
13992
13993
|
}
|
|
13993
13994
|
exports.Do = Do;
|
|
@@ -14810,9 +14811,10 @@ exports.ExecSQL = ExecSQL;
|
|
|
14810
14811
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14811
14812
|
exports.Exit = void 0;
|
|
14812
14813
|
const combi_1 = __webpack_require__(/*! ../combi */ "../core/build/src/abap/2_statements/combi.js");
|
|
14814
|
+
const version_1 = __webpack_require__(/*! ../../../version */ "../core/build/src/version.js");
|
|
14813
14815
|
class Exit {
|
|
14814
14816
|
getMatcher() {
|
|
14815
|
-
return (0, combi_1.seq)("EXIT", (0, combi_1.opt)((0, combi_1.alt)("FROM SQL", "FROM STEP-LOOP")));
|
|
14817
|
+
return (0, combi_1.seq)("EXIT", (0, combi_1.opt)((0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.alt)("FROM SQL", "FROM STEP-LOOP"))));
|
|
14816
14818
|
}
|
|
14817
14819
|
}
|
|
14818
14820
|
exports.Exit = Exit;
|
|
@@ -15685,8 +15687,9 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "../core/build/s
|
|
|
15685
15687
|
const version_1 = __webpack_require__(/*! ../../../version */ "../core/build/src/version.js");
|
|
15686
15688
|
class GetTime {
|
|
15687
15689
|
getMatcher() {
|
|
15688
|
-
const
|
|
15689
|
-
|
|
15690
|
+
const stamp = (0, combi_1.seq)("GET TIME STAMP FIELD", expressions_1.Target);
|
|
15691
|
+
const time = (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.seq)("GET TIME", (0, combi_1.opt)((0, combi_1.seq)("FIELD", expressions_1.Target))));
|
|
15692
|
+
return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.alt)(stamp, time));
|
|
15690
15693
|
}
|
|
15691
15694
|
}
|
|
15692
15695
|
exports.GetTime = GetTime;
|
|
@@ -17525,7 +17528,7 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "../core/build/s
|
|
|
17525
17528
|
class Perform {
|
|
17526
17529
|
getMatcher() {
|
|
17527
17530
|
const level = (0, combi_1.seq)("LEVEL", Expressions.Source);
|
|
17528
|
-
const commit = (0, combi_1.alt)((0, combi_1.seq)("ON COMMIT", (0, combi_1.opt)(level)), "ON ROLLBACK");
|
|
17531
|
+
const commit = (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.alt)((0, combi_1.seq)("ON COMMIT", (0, combi_1.opt)(level)), "ON ROLLBACK"));
|
|
17529
17532
|
const short = (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, (0, combi_1.seq)(Expressions.FormName, (0, combi_1.tok)(tokens_1.ParenLeft), Expressions.IncludeName, (0, combi_1.tok)(tokens_1.ParenRightW)));
|
|
17530
17533
|
const program = (0, combi_1.seq)("IN PROGRAM", (0, combi_1.opt)((0, combi_1.alt)(Expressions.Dynamic, Expressions.IncludeName)));
|
|
17531
17534
|
const found = (0, combi_1.str)("IF FOUND");
|
|
@@ -18382,7 +18385,7 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "../core/build/s
|
|
|
18382
18385
|
const version_1 = __webpack_require__(/*! ../../../version */ "../core/build/src/version.js");
|
|
18383
18386
|
class Rollback {
|
|
18384
18387
|
getMatcher() {
|
|
18385
|
-
return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("ROLLBACK", (0, combi_1.altPrio)("WORK", expressions_1.DatabaseConnection)));
|
|
18388
|
+
return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("ROLLBACK", (0, combi_1.altPrio)("WORK", (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, expressions_1.DatabaseConnection))));
|
|
18386
18389
|
}
|
|
18387
18390
|
}
|
|
18388
18391
|
exports.Rollback = Rollback;
|
|
@@ -20338,7 +20341,7 @@ class Wait {
|
|
|
20338
20341
|
const type = (0, combi_1.seq)("FOR", (0, combi_1.per)(channels, push, tasks));
|
|
20339
20342
|
const until = (0, combi_1.seq)((0, combi_1.opt)(type), "UNTIL", expressions_1.Cond, (0, combi_1.opt)(up));
|
|
20340
20343
|
const ret = (0, combi_1.seq)("WAIT", (0, combi_1.alt)(until, up));
|
|
20341
|
-
return (0, combi_1.verNotLang)(version_1.LanguageVersion.
|
|
20344
|
+
return (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, ret);
|
|
20342
20345
|
}
|
|
20343
20346
|
}
|
|
20344
20347
|
exports.Wait = Wait;
|
|
@@ -26208,6 +26211,9 @@ const spaghetti_scope_1 = __webpack_require__(/*! ./spaghetti_scope */ "../core/
|
|
|
26208
26211
|
const _identifier_1 = __webpack_require__(/*! ../4_file_information/_identifier */ "../core/build/src/abap/4_file_information/_identifier.js");
|
|
26209
26212
|
const _scope_type_1 = __webpack_require__(/*! ./_scope_type */ "../core/build/src/abap/5_syntax/_scope_type.js");
|
|
26210
26213
|
const syntax_1 = __webpack_require__(/*! ./syntax */ "../core/build/src/abap/5_syntax/syntax.js");
|
|
26214
|
+
const basic_1 = __webpack_require__(/*! ../types/basic */ "../core/build/src/abap/types/basic/index.js");
|
|
26215
|
+
/** scopes of constructor expressions, their names are local to the expression */
|
|
26216
|
+
const EXPRESSION_SCOPES = new Set([_scope_type_1.ScopeType.For, _scope_type_1.ScopeType.Let, _scope_type_1.ScopeType.OpenSQL]);
|
|
26211
26217
|
class CurrentScope {
|
|
26212
26218
|
static buildDefault(reg, obj) {
|
|
26213
26219
|
const s = new CurrentScope(reg, obj);
|
|
@@ -26230,6 +26236,11 @@ class CurrentScope {
|
|
|
26230
26236
|
}
|
|
26231
26237
|
constructor(reg, obj) {
|
|
26232
26238
|
this.localFriends = new Map();
|
|
26239
|
+
/** types of the FOR and LET names used in a procedure, key is the scope node of the procedure */
|
|
26240
|
+
this.localNameTypes = new WeakMap();
|
|
26241
|
+
/** row type of the members of a group, key is the identifier of the group variable,
|
|
26242
|
+
* a LOOP AT ... GROUP BY binds the group until its ENDLOOP */
|
|
26243
|
+
this.groupMemberTypes = new Map();
|
|
26233
26244
|
this.current = undefined;
|
|
26234
26245
|
this.parentObj = obj;
|
|
26235
26246
|
this.reg = reg;
|
|
@@ -26718,6 +26729,62 @@ class CurrentScope {
|
|
|
26718
26729
|
var _a;
|
|
26719
26730
|
return ((_a = this.localFriends.get(className.toUpperCase())) === null || _a === void 0 ? void 0 : _a.includes(friendName.toUpperCase())) === true;
|
|
26720
26731
|
}
|
|
26732
|
+
/**
|
|
26733
|
+
* Checks a local name of a constructor expression, FOR, LET and REDUCE INIT, before it is added,
|
|
26734
|
+
* returns the error message, or undefined when the name can be declared.
|
|
26735
|
+
* The name cannot be a data object of the procedure or of an enclosing expression, attributes and
|
|
26736
|
+
* globals seen from a method or a form are only obscured, which ABAP reports as a warning.
|
|
26737
|
+
* Within a procedure, a name can be reused by another expression only with the same type.
|
|
26738
|
+
*/
|
|
26739
|
+
checkLocalName(name, type) {
|
|
26740
|
+
const upper = name.toUpperCase();
|
|
26741
|
+
let procedure = this.current;
|
|
26742
|
+
while (procedure !== undefined) {
|
|
26743
|
+
if (procedure.getData().vars[upper] !== undefined) {
|
|
26744
|
+
return `Variable ${name} already defined`;
|
|
26745
|
+
}
|
|
26746
|
+
if (EXPRESSION_SCOPES.has(procedure.getIdentifier().stype) === false) {
|
|
26747
|
+
break;
|
|
26748
|
+
}
|
|
26749
|
+
procedure = procedure.getParent();
|
|
26750
|
+
}
|
|
26751
|
+
if (procedure === undefined || type === undefined || CurrentScope.isComparable(type) === false) {
|
|
26752
|
+
return undefined;
|
|
26753
|
+
}
|
|
26754
|
+
let names = this.localNameTypes.get(procedure);
|
|
26755
|
+
if (names === undefined) {
|
|
26756
|
+
names = new Map();
|
|
26757
|
+
this.localNameTypes.set(procedure, names);
|
|
26758
|
+
}
|
|
26759
|
+
const previous = names.get(upper);
|
|
26760
|
+
if (previous === undefined) {
|
|
26761
|
+
names.set(upper, type);
|
|
26762
|
+
}
|
|
26763
|
+
else if (previous.toText(0) !== type.toText(0)) {
|
|
26764
|
+
return `Variable ${name} already defined with a different type`;
|
|
26765
|
+
}
|
|
26766
|
+
return undefined;
|
|
26767
|
+
}
|
|
26768
|
+
/** types are compared by their structure, ABAP compares the declared types, so this finds a subset of the errors */
|
|
26769
|
+
static isComparable(type) {
|
|
26770
|
+
return !(type instanceof basic_1.VoidType)
|
|
26771
|
+
&& !(type instanceof basic_1.UnknownType)
|
|
26772
|
+
&& type.containsVoid() === false
|
|
26773
|
+
&& type.isGeneric() === false
|
|
26774
|
+
&& type.toText(0).includes("Unknown type") === false;
|
|
26775
|
+
}
|
|
26776
|
+
setGroupMemberType(group, rowType) {
|
|
26777
|
+
this.groupMemberTypes.set(CurrentScope.groupKey(group), rowType);
|
|
26778
|
+
}
|
|
26779
|
+
findGroupMemberType(group) {
|
|
26780
|
+
return this.groupMemberTypes.get(CurrentScope.groupKey(group));
|
|
26781
|
+
}
|
|
26782
|
+
removeGroupMemberType(group) {
|
|
26783
|
+
this.groupMemberTypes.delete(CurrentScope.groupKey(group));
|
|
26784
|
+
}
|
|
26785
|
+
static groupKey(group) {
|
|
26786
|
+
return group.getFilename() + ":" + group.getStart().getRow() + ":" + group.getStart().getCol();
|
|
26787
|
+
}
|
|
26721
26788
|
getEnclosingMethodName() {
|
|
26722
26789
|
let curr = this.current;
|
|
26723
26790
|
while (curr !== undefined) {
|
|
@@ -33366,9 +33433,11 @@ const _scope_type_1 = __webpack_require__(/*! ../_scope_type */ "../core/build/s
|
|
|
33366
33433
|
const component_cond_1 = __webpack_require__(/*! ./component_cond */ "../core/build/src/abap/5_syntax/expressions/component_cond.js");
|
|
33367
33434
|
const cond_1 = __webpack_require__(/*! ./cond */ "../core/build/src/abap/5_syntax/expressions/cond.js");
|
|
33368
33435
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/abap/types/basic/index.js");
|
|
33436
|
+
const loop_group_by_1 = __webpack_require__(/*! ./loop_group_by */ "../core/build/src/abap/5_syntax/expressions/loop_group_by.js");
|
|
33369
33437
|
const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "../core/build/src/abap/types/_typed_identifier.js");
|
|
33370
33438
|
const _reference_1 = __webpack_require__(/*! ../_reference */ "../core/build/src/abap/5_syntax/_reference.js");
|
|
33371
33439
|
const let_1 = __webpack_require__(/*! ./let */ "../core/build/src/abap/5_syntax/expressions/let.js");
|
|
33440
|
+
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
33372
33441
|
class For {
|
|
33373
33442
|
static runSyntax(node, input) {
|
|
33374
33443
|
var _a;
|
|
@@ -33392,13 +33461,19 @@ class For {
|
|
|
33392
33461
|
for (const f of inlineField) {
|
|
33393
33462
|
inline_field_definition_1.InlineFieldDefinition.runSyntax(f, input);
|
|
33394
33463
|
}
|
|
33464
|
+
let groupsSource = undefined;
|
|
33395
33465
|
if (groupsToken !== undefined) {
|
|
33396
|
-
const
|
|
33397
|
-
|
|
33398
|
-
|
|
33399
|
-
|
|
33466
|
+
const message = input.scope.checkLocalName(groupsToken.getStr(), undefined);
|
|
33467
|
+
if (message !== undefined) {
|
|
33468
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, groupsToken, message));
|
|
33469
|
+
return scoped;
|
|
33470
|
+
}
|
|
33471
|
+
groupsSource = this.runGroups(node, groupsToken, input);
|
|
33400
33472
|
}
|
|
33401
33473
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
33474
|
+
if (s === groupsSource) {
|
|
33475
|
+
continue;
|
|
33476
|
+
}
|
|
33402
33477
|
source_1.Source.runSyntax(s, input);
|
|
33403
33478
|
}
|
|
33404
33479
|
for (const s of node.findDirectExpressions(Expressions.ComponentCond)) {
|
|
@@ -33412,6 +33487,32 @@ class For {
|
|
|
33412
33487
|
}
|
|
33413
33488
|
return scoped;
|
|
33414
33489
|
}
|
|
33490
|
+
/** FOR GROUPS group OF wa IN itab GROUP BY key, returns the itab source */
|
|
33491
|
+
static runGroups(node, groupsToken, input) {
|
|
33492
|
+
var _a;
|
|
33493
|
+
const tableSource = node.findExpressionAfterToken("IN");
|
|
33494
|
+
let rowType = basic_1.VoidType.get("ForGroups");
|
|
33495
|
+
if ((tableSource === null || tableSource === void 0 ? void 0 : tableSource.get()) instanceof Expressions.Source) {
|
|
33496
|
+
const tableType = source_1.Source.runSyntax(tableSource, input);
|
|
33497
|
+
if (tableType instanceof basic_1.TableType) {
|
|
33498
|
+
rowType = tableType.getRowType();
|
|
33499
|
+
}
|
|
33500
|
+
}
|
|
33501
|
+
const waToken = (_a = node.findExpressionAfterToken("OF")) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
33502
|
+
if (waToken !== undefined) {
|
|
33503
|
+
const wa = new _typed_identifier_1.TypedIdentifier(waToken, input.filename, rowType, ["inline" /* IdentifierMeta.InlineDefinition */]);
|
|
33504
|
+
input.scope.addIdentifier(wa);
|
|
33505
|
+
input.scope.addReference(waToken, wa, _reference_1.ReferenceType.DataWriteReference, input.filename);
|
|
33506
|
+
}
|
|
33507
|
+
const keyType = node.findDirectTokenByText("BY") !== undefined
|
|
33508
|
+
? loop_group_by_1.LoopGroupBy.runKey(node, input)
|
|
33509
|
+
: basic_1.VoidType.get("ForGroups");
|
|
33510
|
+
const group = new _typed_identifier_1.TypedIdentifier(groupsToken, input.filename, keyType, ["inline" /* IdentifierMeta.InlineDefinition */]);
|
|
33511
|
+
input.scope.addIdentifier(group);
|
|
33512
|
+
input.scope.addReference(groupsToken, group, _reference_1.ReferenceType.DataWriteReference, input.filename);
|
|
33513
|
+
input.scope.setGroupMemberType(group, rowType);
|
|
33514
|
+
return (tableSource === null || tableSource === void 0 ? void 0 : tableSource.get()) instanceof Expressions.Source ? tableSource : undefined;
|
|
33515
|
+
}
|
|
33415
33516
|
}
|
|
33416
33517
|
exports.For = For;
|
|
33417
33518
|
//# sourceMappingURL=for.js.map
|
|
@@ -33861,8 +33962,8 @@ class InlineFieldDefinition {
|
|
|
33861
33962
|
type = new unknown_type_1.UnknownType("InlineFieldDefinition, fallback");
|
|
33862
33963
|
}
|
|
33863
33964
|
const name = field.getStr();
|
|
33864
|
-
|
|
33865
|
-
|
|
33965
|
+
const message = input.scope.checkLocalName(name, type);
|
|
33966
|
+
if (message !== undefined) {
|
|
33866
33967
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
33867
33968
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
33868
33969
|
}
|
|
@@ -34001,6 +34102,7 @@ const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/
|
|
|
34001
34102
|
const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "../core/build/src/abap/types/_typed_identifier.js");
|
|
34002
34103
|
const _reference_1 = __webpack_require__(/*! ../_reference */ "../core/build/src/abap/5_syntax/_reference.js");
|
|
34003
34104
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
34105
|
+
const loop_group_by_1 = __webpack_require__(/*! ./loop_group_by */ "../core/build/src/abap/5_syntax/expressions/loop_group_by.js");
|
|
34004
34106
|
class InlineLoopDefinition {
|
|
34005
34107
|
static runSyntax(node, input) {
|
|
34006
34108
|
if (node === undefined) {
|
|
@@ -34013,8 +34115,12 @@ class InlineLoopDefinition {
|
|
|
34013
34115
|
const source = node.findDirectExpression(Expressions.Source);
|
|
34014
34116
|
if (source && target) {
|
|
34015
34117
|
const sourceType = source_1.Source.runSyntax(source, input);
|
|
34016
|
-
|
|
34017
|
-
|
|
34118
|
+
const inGroup = node.concatTokens().toUpperCase().includes(" IN GROUP ");
|
|
34119
|
+
let rowType = inGroup ? loop_group_by_1.LoopGroupBy.findMemberType(source, input) : undefined;
|
|
34120
|
+
if (rowType !== undefined) {
|
|
34121
|
+
// FOR ... IN GROUP, the members have the row type of the grouped table
|
|
34122
|
+
}
|
|
34123
|
+
else if (sourceType instanceof basic_1.TableType) {
|
|
34018
34124
|
rowType = sourceType.getRowType();
|
|
34019
34125
|
}
|
|
34020
34126
|
else if (sourceType instanceof basic_1.VoidType) {
|
|
@@ -34026,7 +34132,7 @@ class InlineLoopDefinition {
|
|
|
34026
34132
|
return;
|
|
34027
34133
|
}
|
|
34028
34134
|
if (rowType === undefined
|
|
34029
|
-
&&
|
|
34135
|
+
&& inGroup
|
|
34030
34136
|
&& sourceType !== undefined) {
|
|
34031
34137
|
rowType = sourceType;
|
|
34032
34138
|
}
|
|
@@ -34035,6 +34141,11 @@ class InlineLoopDefinition {
|
|
|
34035
34141
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
34036
34142
|
return;
|
|
34037
34143
|
}
|
|
34144
|
+
const message = input.scope.checkLocalName(target.getFirstToken().getStr(), rowType);
|
|
34145
|
+
if (message !== undefined) {
|
|
34146
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, target.getFirstToken(), message));
|
|
34147
|
+
return;
|
|
34148
|
+
}
|
|
34038
34149
|
const identifier = new _typed_identifier_1.TypedIdentifier(target.getFirstToken(), input.filename, rowType, ["inline" /* IdentifierMeta.InlineDefinition */]);
|
|
34039
34150
|
input.scope.addReference(target.getFirstToken(), identifier, _reference_1.ReferenceType.DataWriteReference, input.filename);
|
|
34040
34151
|
input.scope.addReference(target.getFirstToken(), identifier, _reference_1.ReferenceType.DataReadReference, input.filename);
|
|
@@ -34042,6 +34153,11 @@ class InlineLoopDefinition {
|
|
|
34042
34153
|
}
|
|
34043
34154
|
const index = node.findExpressionAfterToken("INTO");
|
|
34044
34155
|
if (index && index.get() instanceof Expressions.TargetField) {
|
|
34156
|
+
const message = input.scope.checkLocalName(index.getFirstToken().getStr(), basic_1.IntegerType.get());
|
|
34157
|
+
if (message !== undefined) {
|
|
34158
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, index.getFirstToken(), message));
|
|
34159
|
+
return;
|
|
34160
|
+
}
|
|
34045
34161
|
const identifier = new _typed_identifier_1.TypedIdentifier(index.getFirstToken(), input.filename, basic_1.IntegerType.get(), ["inline" /* IdentifierMeta.InlineDefinition */]);
|
|
34046
34162
|
input.scope.addReference(index.getFirstToken(), identifier, _reference_1.ReferenceType.DataWriteReference, input.filename);
|
|
34047
34163
|
input.scope.addIdentifier(identifier);
|
|
@@ -34162,34 +34278,144 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34162
34278
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
34163
34279
|
exports.LoopGroupBy = void 0;
|
|
34164
34280
|
const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
|
|
34281
|
+
const nodes_1 = __webpack_require__(/*! ../../nodes */ "../core/build/src/abap/nodes/index.js");
|
|
34165
34282
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/abap/types/basic/index.js");
|
|
34166
|
-
const
|
|
34283
|
+
const _reference_1 = __webpack_require__(/*! ../_reference */ "../core/build/src/abap/5_syntax/_reference.js");
|
|
34167
34284
|
const inline_data_1 = __webpack_require__(/*! ./inline_data */ "../core/build/src/abap/5_syntax/expressions/inline_data.js");
|
|
34168
34285
|
const fstarget_1 = __webpack_require__(/*! ./fstarget */ "../core/build/src/abap/5_syntax/expressions/fstarget.js");
|
|
34169
34286
|
const target_1 = __webpack_require__(/*! ./target */ "../core/build/src/abap/5_syntax/expressions/target.js");
|
|
34170
34287
|
const source_1 = __webpack_require__(/*! ./source */ "../core/build/src/abap/5_syntax/expressions/source.js");
|
|
34288
|
+
const field_chain_1 = __webpack_require__(/*! ./field_chain */ "../core/build/src/abap/5_syntax/expressions/field_chain.js");
|
|
34171
34289
|
class LoopGroupBy {
|
|
34172
|
-
|
|
34173
|
-
|
|
34174
|
-
|
|
34290
|
+
/**
|
|
34291
|
+
* @param rowType row type of the grouped table, the type of the members of each group
|
|
34292
|
+
* @param representative the row target of the LOOP, it is the group when GROUP BY has no target
|
|
34293
|
+
*/
|
|
34294
|
+
static runSyntax(node, input, rowType, representative) {
|
|
34295
|
+
var _a;
|
|
34296
|
+
const keyType = this.runKey(node, input);
|
|
34297
|
+
const groupTarget = node.findDirectExpression(Expressions.LoopGroupByTarget);
|
|
34298
|
+
const target = groupTarget === null || groupTarget === void 0 ? void 0 : groupTarget.findDirectExpression(Expressions.Target);
|
|
34299
|
+
const fsTarget = groupTarget === null || groupTarget === void 0 ? void 0 : groupTarget.findDirectExpression(Expressions.FSTarget);
|
|
34300
|
+
if (target) {
|
|
34301
|
+
const inline = target.findDirectExpression(Expressions.InlineData);
|
|
34175
34302
|
if (inline) {
|
|
34176
|
-
|
|
34303
|
+
const isReference = (groupTarget === null || groupTarget === void 0 ? void 0 : groupTarget.findDirectTokenByText("REFERENCE")) !== undefined;
|
|
34304
|
+
inline_data_1.InlineData.runSyntax(inline, input, isReference ? new basic_1.DataReference(keyType) : keyType);
|
|
34177
34305
|
}
|
|
34178
34306
|
else {
|
|
34179
|
-
target_1.Target.runSyntax(
|
|
34307
|
+
target_1.Target.runSyntax(target, input);
|
|
34180
34308
|
}
|
|
34181
34309
|
}
|
|
34182
|
-
|
|
34183
|
-
fstarget_1.FSTarget.runSyntax(
|
|
34310
|
+
else if (fsTarget) {
|
|
34311
|
+
fstarget_1.FSTarget.runSyntax(fsTarget, input, keyType);
|
|
34312
|
+
}
|
|
34313
|
+
// bind the group until ENDLOOP, see unbind(), also when the row type is unknown
|
|
34314
|
+
const group = this.findTargetIdentifier((_a = target !== null && target !== void 0 ? target : fsTarget) !== null && _a !== void 0 ? _a : representative, input.scope);
|
|
34315
|
+
if (group) {
|
|
34316
|
+
input.scope.setGroupMemberType(group, rowType !== null && rowType !== void 0 ? rowType : basic_1.VoidType.get("GroupMember"));
|
|
34317
|
+
}
|
|
34318
|
+
}
|
|
34319
|
+
/** the row target of a LOOP, it is the group when GROUP BY has no target */
|
|
34320
|
+
static findRepresentative(loop) {
|
|
34321
|
+
var _a;
|
|
34322
|
+
const loopTarget = loop.findDirectExpression(Expressions.LoopTarget);
|
|
34323
|
+
return (_a = loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.findDirectExpression(Expressions.Target)) !== null && _a !== void 0 ? _a : loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.findDirectExpression(Expressions.FSTarget);
|
|
34324
|
+
}
|
|
34325
|
+
/** called at the end of a LOOP structure, the group of a LOOP AT ... GROUP BY is not bound after its ENDLOOP */
|
|
34326
|
+
static unbind(loop, scope) {
|
|
34327
|
+
var _a, _b;
|
|
34328
|
+
const groupBy = loop.findDirectExpression(Expressions.LoopGroupBy);
|
|
34329
|
+
if (groupBy === undefined) {
|
|
34330
|
+
return;
|
|
34331
|
+
}
|
|
34332
|
+
const groupTarget = groupBy.findDirectExpression(Expressions.LoopGroupByTarget);
|
|
34333
|
+
const node = (_b = (_a = groupTarget === null || groupTarget === void 0 ? void 0 : groupTarget.findDirectExpression(Expressions.Target)) !== null && _a !== void 0 ? _a : groupTarget === null || groupTarget === void 0 ? void 0 : groupTarget.findDirectExpression(Expressions.FSTarget)) !== null && _b !== void 0 ? _b : this.findRepresentative(loop);
|
|
34334
|
+
const group = this.findTargetIdentifier(node, scope);
|
|
34335
|
+
if (group) {
|
|
34336
|
+
scope.removeGroupMemberType(group);
|
|
34184
34337
|
}
|
|
34185
|
-
|
|
34186
|
-
|
|
34338
|
+
}
|
|
34339
|
+
/** LOOP AT GROUP group, the name of the group when it is a variable that no enclosing group loop binds */
|
|
34340
|
+
static findUnboundGroup(source, input) {
|
|
34341
|
+
if (source === undefined) {
|
|
34342
|
+
return undefined;
|
|
34187
34343
|
}
|
|
34188
|
-
|
|
34189
|
-
|
|
34190
|
-
|
|
34344
|
+
const name = this.groupName(source);
|
|
34345
|
+
const found = input.scope.findVariable(name);
|
|
34346
|
+
if (found === undefined || input.scope.findGroupMemberType(found) !== undefined) {
|
|
34347
|
+
return undefined;
|
|
34348
|
+
}
|
|
34349
|
+
return name;
|
|
34350
|
+
}
|
|
34351
|
+
/** type of the group key, from GROUP BY expr or GROUP BY ( name = expr ... ) */
|
|
34352
|
+
static runKey(node, input) {
|
|
34353
|
+
const components = node.findDirectExpressions(Expressions.LoopGroupByComponent);
|
|
34354
|
+
if (components.length === 0) {
|
|
34355
|
+
// LOOP: the key is the first child of LoopGroupBy, FOR GROUPS: the key follows GROUP BY
|
|
34356
|
+
const key = node.get() instanceof Expressions.LoopGroupBy ? node.getFirstChild() : node.findExpressionAfterToken("BY");
|
|
34357
|
+
let type = undefined;
|
|
34358
|
+
if (key instanceof nodes_1.ExpressionNode && key.get() instanceof Expressions.Source) {
|
|
34359
|
+
type = source_1.Source.runSyntax(key, input);
|
|
34360
|
+
}
|
|
34361
|
+
else if (key instanceof nodes_1.ExpressionNode && key.get() instanceof Expressions.FieldChain) {
|
|
34362
|
+
type = field_chain_1.FieldChain.runSyntax(key, input, _reference_1.ReferenceType.DataReadReference);
|
|
34363
|
+
}
|
|
34364
|
+
return type !== null && type !== void 0 ? type : basic_1.VoidType.get("GroupKey");
|
|
34365
|
+
}
|
|
34366
|
+
const fields = [];
|
|
34367
|
+
let dynamic = false;
|
|
34368
|
+
for (const c of components) {
|
|
34369
|
+
const single = c.findDirectExpression(Expressions.ComponentCompareSingle);
|
|
34370
|
+
if (single) {
|
|
34371
|
+
const source = single.findDirectExpression(Expressions.Source);
|
|
34372
|
+
const type = source ? source_1.Source.runSyntax(source, input) : undefined;
|
|
34373
|
+
const name = single.findDirectExpression(Expressions.ComponentChainSimple);
|
|
34374
|
+
if (name === undefined) {
|
|
34375
|
+
dynamic = true;
|
|
34376
|
+
continue;
|
|
34377
|
+
}
|
|
34378
|
+
fields.push({ name: name.concatTokens(), type: type !== null && type !== void 0 ? type : basic_1.VoidType.get("GroupKey") });
|
|
34379
|
+
}
|
|
34380
|
+
else {
|
|
34381
|
+
// GROUP SIZE and GROUP INDEX
|
|
34382
|
+
const name = c.findDirectExpression(Expressions.ComponentName);
|
|
34383
|
+
if (name) {
|
|
34384
|
+
fields.push({ name: name.concatTokens(), type: basic_1.IntegerType.get() });
|
|
34385
|
+
}
|
|
34191
34386
|
}
|
|
34192
34387
|
}
|
|
34388
|
+
if (dynamic === true || fields.length === 0) {
|
|
34389
|
+
return basic_1.VoidType.get("GroupKey");
|
|
34390
|
+
}
|
|
34391
|
+
return new basic_1.StructureType(fields);
|
|
34392
|
+
}
|
|
34393
|
+
/** the group variable in LOOP AT GROUP group and FOR ... IN GROUP group */
|
|
34394
|
+
static findMemberType(source, input) {
|
|
34395
|
+
if (source === undefined) {
|
|
34396
|
+
return undefined;
|
|
34397
|
+
}
|
|
34398
|
+
const found = input.scope.findVariable(this.groupName(source));
|
|
34399
|
+
return found ? input.scope.findGroupMemberType(found) : undefined;
|
|
34400
|
+
}
|
|
34401
|
+
static groupName(source) {
|
|
34402
|
+
return source.concatTokens().replace(/\s/g, "").replace(/->\*$/, "");
|
|
34403
|
+
}
|
|
34404
|
+
static findTargetIdentifier(node, scope) {
|
|
34405
|
+
var _a;
|
|
34406
|
+
var _b, _c;
|
|
34407
|
+
if (node === undefined) {
|
|
34408
|
+
return undefined;
|
|
34409
|
+
}
|
|
34410
|
+
const inline = (_b = node.findDirectExpression(Expressions.InlineData)) !== null && _b !== void 0 ? _b : node.findDirectExpression(Expressions.InlineFS);
|
|
34411
|
+
let name;
|
|
34412
|
+
if (inline) {
|
|
34413
|
+
name = (_a = ((_c = inline.findFirstExpression(Expressions.TargetField)) !== null && _c !== void 0 ? _c : inline.findFirstExpression(Expressions.TargetFieldSymbol))) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();
|
|
34414
|
+
}
|
|
34415
|
+
else if (node.getChildren().length === 1) {
|
|
34416
|
+
name = node.getFirstToken().getStr();
|
|
34417
|
+
}
|
|
34418
|
+
return scope.findVariable(name);
|
|
34193
34419
|
}
|
|
34194
34420
|
}
|
|
34195
34421
|
exports.LoopGroupBy = LoopGroupBy;
|
|
@@ -35982,6 +36208,8 @@ const _reference_1 = __webpack_require__(/*! ../_reference */ "../core/build/src
|
|
|
35982
36208
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
35983
36209
|
const version_1 = __webpack_require__(/*! ../../../version */ "../core/build/src/version.js");
|
|
35984
36210
|
const _check_database_fields_1 = __webpack_require__(/*! ./_check_database_fields */ "../core/build/src/abap/5_syntax/expressions/_check_database_fields.js");
|
|
36211
|
+
const field_chain_1 = __webpack_require__(/*! ./field_chain */ "../core/build/src/abap/5_syntax/expressions/field_chain.js");
|
|
36212
|
+
const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "../core/build/src/abap/1_lexer/tokens/index.js");
|
|
35985
36213
|
const isSimple = /^\w+$/;
|
|
35986
36214
|
// SQL functions where the result has the same type as the first argument
|
|
35987
36215
|
const sameTypeAsFirstArgument = new Set(["UPPER", "LOWER", "LTRIM", "RTRIM"]);
|
|
@@ -36190,7 +36418,7 @@ class Select {
|
|
|
36190
36418
|
if (intoStructure) {
|
|
36191
36419
|
const inlineList = intoStructure.findAllExpressions(Expressions.InlineData);
|
|
36192
36420
|
if (inlineList.length === 1) {
|
|
36193
|
-
inline_data_1.InlineData.runSyntax(inlineList[0], input, this.buildStructureType(fields, dbSources, input
|
|
36421
|
+
inline_data_1.InlineData.runSyntax(inlineList[0], input, this.buildStructureType(fields, dbSources, input, from));
|
|
36194
36422
|
}
|
|
36195
36423
|
else {
|
|
36196
36424
|
for (const inline of inlineList) {
|
|
@@ -36257,13 +36485,19 @@ class Select {
|
|
|
36257
36485
|
return basic_1.IntegerType.get();
|
|
36258
36486
|
}
|
|
36259
36487
|
}
|
|
36260
|
-
static buildStructureType(fields, dbSources,
|
|
36488
|
+
static buildStructureType(fields, dbSources, input, from) {
|
|
36261
36489
|
var _a, _b, _c, _d, _e, _f;
|
|
36490
|
+
const scope = input.scope;
|
|
36262
36491
|
if (fields.length === 1 && dbSources.length === 1) {
|
|
36263
36492
|
// COUNT( * ) yields an integer regardless of the (possibly dynamic) table
|
|
36264
36493
|
if (/^count\(\s*\*\s*\)$/i.test(fields[0].code)) {
|
|
36265
36494
|
return this.countResultType(scope);
|
|
36266
36495
|
}
|
|
36496
|
+
// a host variable yields its own type regardless of the table
|
|
36497
|
+
const hostType = this.findHostFieldType(fields[0], input);
|
|
36498
|
+
if (hostType) {
|
|
36499
|
+
return hostType;
|
|
36500
|
+
}
|
|
36267
36501
|
const dbType = (_a = dbSources[0]) === null || _a === void 0 ? void 0 : _a.parseType(scope.getRegistry());
|
|
36268
36502
|
if (dbType === undefined) {
|
|
36269
36503
|
const name = ((_b = dbSources[0]) === null || _b === void 0 ? void 0 : _b.getName()) || "buildStructureTypeError";
|
|
@@ -36415,6 +36649,30 @@ class Select {
|
|
|
36415
36649
|
}
|
|
36416
36650
|
return components;
|
|
36417
36651
|
}
|
|
36652
|
+
/** returns the type of the field list entry if it is a single ABAP host variable, "@var" or "@( var )" */
|
|
36653
|
+
static findHostFieldType(field, input) {
|
|
36654
|
+
var _a;
|
|
36655
|
+
if (!(field.expression.get() instanceof Expressions.SQLField)) {
|
|
36656
|
+
return undefined;
|
|
36657
|
+
}
|
|
36658
|
+
const children = field.expression.getChildren().filter(c => !(c.get() instanceof Expressions.SQLAsName) && c.concatTokens().toUpperCase() !== "AS");
|
|
36659
|
+
if (!(((_a = children[0]) === null || _a === void 0 ? void 0 : _a.get()) instanceof tokens_1.WAt)) {
|
|
36660
|
+
return undefined;
|
|
36661
|
+
}
|
|
36662
|
+
// "@var" has two children, "@( var )" has four, anything else is an expression
|
|
36663
|
+
const chain = children.length === 2 ? children[1] : children.length === 4 ? children[2] : undefined;
|
|
36664
|
+
if (!(chain instanceof nodes_1.ExpressionNode) || !(chain.get() instanceof Expressions.SimpleFieldChain2)) {
|
|
36665
|
+
return undefined;
|
|
36666
|
+
}
|
|
36667
|
+
// only resolve the type here, errors for the host variable are not reported by this lookup
|
|
36668
|
+
const issues = [];
|
|
36669
|
+
const type = field_chain_1.FieldChain.runSyntax(chain, Object.assign(Object.assign({}, input), { issues }));
|
|
36670
|
+
// a generic host type cannot type the inline declaration, keep it voided
|
|
36671
|
+
if (issues.length > 0 || type === undefined || type.isGeneric()) {
|
|
36672
|
+
return undefined;
|
|
36673
|
+
}
|
|
36674
|
+
return type;
|
|
36675
|
+
}
|
|
36418
36676
|
/** returns the SQLFunction node if the field list entry is a single SQL function call */
|
|
36419
36677
|
static findFunctionColumn(field, requireAlias = true) {
|
|
36420
36678
|
if (requireAlias === true && field.as === "") {
|
|
@@ -44935,6 +45193,17 @@ class Loop {
|
|
|
44935
45193
|
}
|
|
44936
45194
|
if (sourceType instanceof basic_1.TableType) {
|
|
44937
45195
|
rowType = sourceType.getRowType();
|
|
45196
|
+
}
|
|
45197
|
+
else if (concat.startsWith("LOOP AT GROUP ")) {
|
|
45198
|
+
const unbound = loop_group_by_1.LoopGroupBy.findUnboundGroup(firstSource, input);
|
|
45199
|
+
if (unbound !== undefined) {
|
|
45200
|
+
const message = `No group is bound to "${unbound}"`;
|
|
45201
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
45202
|
+
return;
|
|
45203
|
+
}
|
|
45204
|
+
rowType = loop_group_by_1.LoopGroupBy.findMemberType(firstSource, input);
|
|
45205
|
+
}
|
|
45206
|
+
if (rowType) {
|
|
44938
45207
|
sourceType = rowType;
|
|
44939
45208
|
if (targetConcat === null || targetConcat === void 0 ? void 0 : targetConcat.startsWith("REFERENCE INTO ")) {
|
|
44940
45209
|
sourceType = new basic_1.DataReference(sourceType);
|
|
@@ -45020,7 +45289,7 @@ class Loop {
|
|
|
45020
45289
|
}
|
|
45021
45290
|
const group = node.findDirectExpression(Expressions.LoopGroupBy);
|
|
45022
45291
|
if (group) {
|
|
45023
|
-
loop_group_by_1.LoopGroupBy.runSyntax(group, input);
|
|
45292
|
+
loop_group_by_1.LoopGroupBy.runSyntax(group, input, rowType, loop_group_by_1.LoopGroupBy.findRepresentative(node));
|
|
45024
45293
|
}
|
|
45025
45294
|
}
|
|
45026
45295
|
}
|
|
@@ -45670,6 +45939,7 @@ const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/
|
|
|
45670
45939
|
const nodes_1 = __webpack_require__(/*! ../../nodes */ "../core/build/src/abap/nodes/index.js");
|
|
45671
45940
|
class Move {
|
|
45672
45941
|
runSyntax(node, input) {
|
|
45942
|
+
var _a;
|
|
45673
45943
|
const targets = node.findDirectExpressions(Expressions.Target);
|
|
45674
45944
|
const firstTarget = targets[0];
|
|
45675
45945
|
const inline = firstTarget === null || firstTarget === void 0 ? void 0 : firstTarget.findDirectExpression(Expressions.InlineData);
|
|
@@ -45710,6 +45980,13 @@ class Move {
|
|
|
45710
45980
|
sourceType = dereference_1.Dereference.runSyntax(node, sourceType, input);
|
|
45711
45981
|
}
|
|
45712
45982
|
if (inline) {
|
|
45983
|
+
// the length of a text symbol depends on the text pool, "DATA(x) = TEXT-abc." does not compile
|
|
45984
|
+
const sourceChildren = (_a = source === null || source === void 0 ? void 0 : source.getChildren()) !== null && _a !== void 0 ? _a : [];
|
|
45985
|
+
if (sourceChildren.length === 1 && sourceChildren[0].get() instanceof Expressions.TextElement) {
|
|
45986
|
+
const message = `"${source.concatTokens().toUpperCase()}" has a generic type that cannot be used for declarations`;
|
|
45987
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, source.getFirstToken(), message));
|
|
45988
|
+
return;
|
|
45989
|
+
}
|
|
45713
45990
|
if (sourceType instanceof basic_1.PackedType && (source === null || source === void 0 ? void 0 : source.findDirectExpression(Expressions.ArithOperator))) {
|
|
45714
45991
|
sourceType = new basic_1.PackedType(8, 0);
|
|
45715
45992
|
}
|
|
@@ -50960,6 +51237,7 @@ const statics_1 = __webpack_require__(/*! ./structures/statics */ "../core/build
|
|
|
50960
51237
|
const constants_1 = __webpack_require__(/*! ./structures/constants */ "../core/build/src/abap/5_syntax/structures/constants.js");
|
|
50961
51238
|
const cleanup_1 = __webpack_require__(/*! ./structures/cleanup */ "../core/build/src/abap/5_syntax/structures/cleanup.js");
|
|
50962
51239
|
const try_1 = __webpack_require__(/*! ./structures/try */ "../core/build/src/abap/5_syntax/structures/try.js");
|
|
51240
|
+
const loop_group_by_1 = __webpack_require__(/*! ./expressions/loop_group_by */ "../core/build/src/abap/5_syntax/expressions/loop_group_by.js");
|
|
50963
51241
|
const class_definition_1 = __webpack_require__(/*! ../types/class_definition */ "../core/build/src/abap/types/class_definition.js");
|
|
50964
51242
|
const interface_definition_1 = __webpack_require__(/*! ../types/interface_definition */ "../core/build/src/abap/types/interface_definition.js");
|
|
50965
51243
|
const delete_memory_1 = __webpack_require__(/*! ./statements/delete_memory */ "../core/build/src/abap/5_syntax/statements/delete_memory.js");
|
|
@@ -51385,6 +51663,12 @@ class SyntaxLogic {
|
|
|
51385
51663
|
if (loop === true) {
|
|
51386
51664
|
this.loopTables.pop();
|
|
51387
51665
|
}
|
|
51666
|
+
if (node instanceof nodes_1.StructureNode && node.get() instanceof Structures.Loop) {
|
|
51667
|
+
const loopStatement = node.findDirectStatement(Statements.Loop);
|
|
51668
|
+
if (loopStatement) {
|
|
51669
|
+
loop_group_by_1.LoopGroupBy.unbind(loopStatement, this.scope);
|
|
51670
|
+
}
|
|
51671
|
+
}
|
|
51388
51672
|
if (node instanceof nodes_1.StructureNode) {
|
|
51389
51673
|
this.sortedLines.leave(node);
|
|
51390
51674
|
}
|
|
@@ -55588,6 +55872,7 @@ const Expressions = __importStar(__webpack_require__(/*! ../2_statements/express
|
|
|
55588
55872
|
const events_1 = __webpack_require__(/*! ../2_statements/statements/events */ "../core/build/src/abap/2_statements/statements/events.js");
|
|
55589
55873
|
const expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js");
|
|
55590
55874
|
const method_param_1 = __webpack_require__(/*! ../5_syntax/expressions/method_param */ "../core/build/src/abap/5_syntax/expressions/method_param.js");
|
|
55875
|
+
const _syntax_input_1 = __webpack_require__(/*! ../5_syntax/_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
55591
55876
|
class EventDefinition extends _identifier_1.Identifier {
|
|
55592
55877
|
constructor(node, _visibility, input) {
|
|
55593
55878
|
if (!(node.get() instanceof events_1.Events)) {
|
|
@@ -55610,10 +55895,21 @@ class EventDefinition extends _identifier_1.Identifier {
|
|
|
55610
55895
|
}
|
|
55611
55896
|
///////////////
|
|
55612
55897
|
parse(node, input) {
|
|
55898
|
+
var _a;
|
|
55899
|
+
var _b;
|
|
55613
55900
|
for (const e of node.findAllExpressions(expressions_1.MethodParam)) {
|
|
55901
|
+
if (this.isPassByValue(e) === false) {
|
|
55902
|
+
const name = (_b = (_a = e.findDirectExpression(Expressions.MethodParamName)) === null || _a === void 0 ? void 0 : _a.concatTokens()) !== null && _b !== void 0 ? _b : "";
|
|
55903
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, e.getFirstToken(), "Event parameter " + name + " must be passed by VALUE"));
|
|
55904
|
+
}
|
|
55614
55905
|
this.parameters.push(method_param_1.MethodParam.runSyntax(e, input, []));
|
|
55615
55906
|
}
|
|
55616
55907
|
}
|
|
55908
|
+
// event parameters can only be passed by value
|
|
55909
|
+
isPassByValue(param) {
|
|
55910
|
+
const first = param.getFirstToken().getStr().toUpperCase();
|
|
55911
|
+
return first === "VALUE" || first === "!VALUE";
|
|
55912
|
+
}
|
|
55617
55913
|
}
|
|
55618
55914
|
exports.EventDefinition = EventDefinition;
|
|
55619
55915
|
//# sourceMappingURL=event_definition.js.map
|
|
@@ -55789,6 +56085,13 @@ class FunctionModuleDefinition {
|
|
|
55789
56085
|
isGlobalParameters() {
|
|
55790
56086
|
return this.globalParameters;
|
|
55791
56087
|
}
|
|
56088
|
+
/** the classic exceptions, or the exception classes if isClassBasedExceptions() */
|
|
56089
|
+
getExceptions() {
|
|
56090
|
+
return this.exceptions;
|
|
56091
|
+
}
|
|
56092
|
+
isClassBasedExceptions() {
|
|
56093
|
+
return this.classBasedExceptions;
|
|
56094
|
+
}
|
|
55792
56095
|
///////////////
|
|
55793
56096
|
parse(data) {
|
|
55794
56097
|
if (data.FUNCNAME === undefined) {
|
|
@@ -55798,6 +56101,8 @@ class FunctionModuleDefinition {
|
|
|
55798
56101
|
this.description = data.SHORT_TEXT;
|
|
55799
56102
|
this.parameters = [];
|
|
55800
56103
|
this.globalParameters = data.GLOBAL_FLAG === "X";
|
|
56104
|
+
this.exceptions = [];
|
|
56105
|
+
this.classBasedExceptions = data.EXCEPTION_CLASSES === "X";
|
|
55801
56106
|
this.moduleType = FunctionModuleType.regular;
|
|
55802
56107
|
if (data.REMOTE_CALL === "R") {
|
|
55803
56108
|
this.moduleType = FunctionModuleType.remote;
|
|
@@ -55866,6 +56171,13 @@ class FunctionModuleDefinition {
|
|
|
55866
56171
|
});
|
|
55867
56172
|
}
|
|
55868
56173
|
}
|
|
56174
|
+
if (data.EXCEPTION) {
|
|
56175
|
+
for (const exception of (0, xml_utils_1.xmlToArray)(data.EXCEPTION.RSEXC)) {
|
|
56176
|
+
if (typeof exception.EXCEPTION === "string") {
|
|
56177
|
+
this.exceptions.push(exception.EXCEPTION);
|
|
56178
|
+
}
|
|
56179
|
+
}
|
|
56180
|
+
}
|
|
55869
56181
|
}
|
|
55870
56182
|
}
|
|
55871
56183
|
exports.FunctionModuleDefinition = FunctionModuleDefinition;
|
|
@@ -73998,7 +74310,7 @@ class Registry {
|
|
|
73998
74310
|
}
|
|
73999
74311
|
static abaplintVersion() {
|
|
74000
74312
|
// magic, see build script "version.js"
|
|
74001
|
-
return "2.120.
|
|
74313
|
+
return "2.120.111";
|
|
74002
74314
|
}
|
|
74003
74315
|
getDDICReferences() {
|
|
74004
74316
|
return this.ddicReferences;
|
|
@@ -89267,6 +89579,11 @@ ${indentation} output = ${uniqueName}.\n`;
|
|
|
89267
89579
|
if (this.lowReg.getConfig().isOpenABAP()) {
|
|
89268
89580
|
return undefined;
|
|
89269
89581
|
}
|
|
89582
|
+
else if (node.get() instanceof Statements.Loop
|
|
89583
|
+
&& node.concatTokens().toUpperCase().startsWith("LOOP AT GROUP ")) {
|
|
89584
|
+
// rewritten by the LOOP GROUP downport, the inline target is outlined afterwards
|
|
89585
|
+
return undefined;
|
|
89586
|
+
}
|
|
89270
89587
|
for (const i of node.findAllExpressionsRecursive(Expressions.InlineData)) {
|
|
89271
89588
|
const nameToken = (_a = i.findDirectExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
89272
89589
|
if (nameToken === undefined) {
|
|
@@ -92455,6 +92772,155 @@ exports.FullyTypeITabs = FullyTypeITabs;
|
|
|
92455
92772
|
|
|
92456
92773
|
/***/ },
|
|
92457
92774
|
|
|
92775
|
+
/***/ "../core/build/src/rules/function_module_parameter_names.js"
|
|
92776
|
+
/*!******************************************************************!*\
|
|
92777
|
+
!*** ../core/build/src/rules/function_module_parameter_names.js ***!
|
|
92778
|
+
\******************************************************************/
|
|
92779
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
92780
|
+
|
|
92781
|
+
"use strict";
|
|
92782
|
+
|
|
92783
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
92784
|
+
exports.FunctionModuleParameterNames = exports.FunctionModuleParameterNamesConf = void 0;
|
|
92785
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
|
|
92786
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
|
|
92787
|
+
const function_group_1 = __webpack_require__(/*! ../objects/function_group */ "../core/build/src/objects/function_group.js");
|
|
92788
|
+
const _naming_rule_config_1 = __webpack_require__(/*! ./_naming_rule_config */ "../core/build/src/rules/_naming_rule_config.js");
|
|
92789
|
+
const name_validator_1 = __webpack_require__(/*! ../utils/name_validator */ "../core/build/src/utils/name_validator.js");
|
|
92790
|
+
const function_module_definition_1 = __webpack_require__(/*! ../abap/types/function_module_definition */ "../core/build/src/abap/types/function_module_definition.js");
|
|
92791
|
+
const position_1 = __webpack_require__(/*! ../position */ "../core/build/src/position.js");
|
|
92792
|
+
class FunctionModuleParameterNamesConf extends _naming_rule_config_1.NamingRuleConfig {
|
|
92793
|
+
constructor() {
|
|
92794
|
+
super(...arguments);
|
|
92795
|
+
/** The pattern for importing parameters */
|
|
92796
|
+
this.importing = "^I._.+$";
|
|
92797
|
+
/** The pattern for exporting parameters */
|
|
92798
|
+
this.exporting = "^E._.+$";
|
|
92799
|
+
/** The pattern for changing parameters */
|
|
92800
|
+
this.changing = "^C._.+$";
|
|
92801
|
+
/** The pattern for tables parameters */
|
|
92802
|
+
this.tables = "^T._.+$";
|
|
92803
|
+
}
|
|
92804
|
+
}
|
|
92805
|
+
exports.FunctionModuleParameterNamesConf = FunctionModuleParameterNamesConf;
|
|
92806
|
+
class FunctionModuleParameterNames {
|
|
92807
|
+
constructor() {
|
|
92808
|
+
this.conf = new FunctionModuleParameterNamesConf();
|
|
92809
|
+
this.regex = this.compile();
|
|
92810
|
+
}
|
|
92811
|
+
getMetadata() {
|
|
92812
|
+
return {
|
|
92813
|
+
key: "function_module_parameter_names",
|
|
92814
|
+
title: "Function module parameter naming conventions",
|
|
92815
|
+
shortDescription: `Allows you to enforce a pattern, such as a prefix, for function module parameter names`,
|
|
92816
|
+
extendedInformation: `Checks the parameters of function modules in function groups,
|
|
92817
|
+
with a separate pattern for importing, exporting, changing and tables parameters.`,
|
|
92818
|
+
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
92819
|
+
badExample: `FUNCTION z_get_name.
|
|
92820
|
+
*" IMPORTING
|
|
92821
|
+
*" VALUE(CUSTOMER) TYPE STRING
|
|
92822
|
+
*" EXPORTING
|
|
92823
|
+
*" VALUE(NAME) TYPE STRING
|
|
92824
|
+
ENDFUNCTION.`,
|
|
92825
|
+
goodExample: `FUNCTION z_get_name.
|
|
92826
|
+
*" IMPORTING
|
|
92827
|
+
*" VALUE(IV_CUSTOMER) TYPE STRING
|
|
92828
|
+
*" EXPORTING
|
|
92829
|
+
*" VALUE(EV_NAME) TYPE STRING
|
|
92830
|
+
ENDFUNCTION.`,
|
|
92831
|
+
};
|
|
92832
|
+
}
|
|
92833
|
+
getDescription(expected, actual) {
|
|
92834
|
+
return this.conf.patternKind === "required" ?
|
|
92835
|
+
"Function module parameter name does not match pattern " + expected + ": " + actual :
|
|
92836
|
+
"Function module parameter name must not match pattern " + expected + ": " + actual;
|
|
92837
|
+
}
|
|
92838
|
+
getConfig() {
|
|
92839
|
+
return this.conf;
|
|
92840
|
+
}
|
|
92841
|
+
setConfig(conf) {
|
|
92842
|
+
this.conf = conf;
|
|
92843
|
+
this.regex = this.compile();
|
|
92844
|
+
}
|
|
92845
|
+
compile() {
|
|
92846
|
+
return {
|
|
92847
|
+
importing: new RegExp(this.conf.importing, "i"),
|
|
92848
|
+
exporting: new RegExp(this.conf.exporting, "i"),
|
|
92849
|
+
changing: new RegExp(this.conf.changing, "i"),
|
|
92850
|
+
tables: new RegExp(this.conf.tables, "i"),
|
|
92851
|
+
ignorePatterns: name_validator_1.NameValidator.compileIgnorePatterns(this.conf),
|
|
92852
|
+
};
|
|
92853
|
+
}
|
|
92854
|
+
initialize(_reg) {
|
|
92855
|
+
return this;
|
|
92856
|
+
}
|
|
92857
|
+
run(obj) {
|
|
92858
|
+
if (this.conf.patternKind === undefined) {
|
|
92859
|
+
this.conf.patternKind = "required";
|
|
92860
|
+
}
|
|
92861
|
+
if (!(obj instanceof function_group_1.FunctionGroup)) {
|
|
92862
|
+
return [];
|
|
92863
|
+
}
|
|
92864
|
+
let ret = [];
|
|
92865
|
+
for (const module of obj.getModules()) {
|
|
92866
|
+
ret = ret.concat(this.checkModule(obj, module));
|
|
92867
|
+
}
|
|
92868
|
+
return ret;
|
|
92869
|
+
}
|
|
92870
|
+
checkModule(obj, module) {
|
|
92871
|
+
const ret = [];
|
|
92872
|
+
for (const p of module.getParameters()) {
|
|
92873
|
+
let expected;
|
|
92874
|
+
let regex;
|
|
92875
|
+
switch (p.direction) {
|
|
92876
|
+
case function_module_definition_1.FunctionModuleParameterDirection.importing:
|
|
92877
|
+
expected = this.conf.importing;
|
|
92878
|
+
regex = this.regex.importing;
|
|
92879
|
+
break;
|
|
92880
|
+
case function_module_definition_1.FunctionModuleParameterDirection.exporting:
|
|
92881
|
+
expected = this.conf.exporting;
|
|
92882
|
+
regex = this.regex.exporting;
|
|
92883
|
+
break;
|
|
92884
|
+
case function_module_definition_1.FunctionModuleParameterDirection.changing:
|
|
92885
|
+
expected = this.conf.changing;
|
|
92886
|
+
regex = this.regex.changing;
|
|
92887
|
+
break;
|
|
92888
|
+
case function_module_definition_1.FunctionModuleParameterDirection.tables:
|
|
92889
|
+
expected = this.conf.tables;
|
|
92890
|
+
regex = this.regex.tables;
|
|
92891
|
+
break;
|
|
92892
|
+
default:
|
|
92893
|
+
continue;
|
|
92894
|
+
}
|
|
92895
|
+
const issue = this.checkParameter(obj, module, p, expected, regex);
|
|
92896
|
+
if (issue) {
|
|
92897
|
+
ret.push(issue);
|
|
92898
|
+
}
|
|
92899
|
+
}
|
|
92900
|
+
return ret;
|
|
92901
|
+
}
|
|
92902
|
+
checkParameter(obj, module, param, expected, regex) {
|
|
92903
|
+
if (!name_validator_1.NameValidator.violatesRule(param.name, regex, this.conf, this.regex.ignorePatterns)) {
|
|
92904
|
+
return undefined;
|
|
92905
|
+
}
|
|
92906
|
+
// the parameter is only defined in the XML, so report at the start of the module file, if it exists
|
|
92907
|
+
const file = this.findModuleFile(obj, module) || obj.getMainABAPFile();
|
|
92908
|
+
if (file === undefined) {
|
|
92909
|
+
return undefined;
|
|
92910
|
+
}
|
|
92911
|
+
const message = this.getDescription(expected, param.name);
|
|
92912
|
+
return issue_1.Issue.atPosition(file, new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);
|
|
92913
|
+
}
|
|
92914
|
+
findModuleFile(obj, module) {
|
|
92915
|
+
const search = "." + module.getName().toLowerCase().replace(/\//g, "#") + ".abap";
|
|
92916
|
+
return obj.getABAPFiles().find(f => f.getFilename().toLowerCase().endsWith(search));
|
|
92917
|
+
}
|
|
92918
|
+
}
|
|
92919
|
+
exports.FunctionModuleParameterNames = FunctionModuleParameterNames;
|
|
92920
|
+
//# sourceMappingURL=function_module_parameter_names.js.map
|
|
92921
|
+
|
|
92922
|
+
/***/ },
|
|
92923
|
+
|
|
92458
92924
|
/***/ "../core/build/src/rules/function_module_recommendations.js"
|
|
92459
92925
|
/*!******************************************************************!*\
|
|
92460
92926
|
!*** ../core/build/src/rules/function_module_recommendations.js ***!
|
|
@@ -94903,6 +95369,7 @@ __exportStar(__webpack_require__(/*! ./forbidden_void_type */ "../core/build/src
|
|
|
94903
95369
|
__exportStar(__webpack_require__(/*! ./form_tables_obsolete */ "../core/build/src/rules/form_tables_obsolete.js"), exports);
|
|
94904
95370
|
__exportStar(__webpack_require__(/*! ./fully_type_constants */ "../core/build/src/rules/fully_type_constants.js"), exports);
|
|
94905
95371
|
__exportStar(__webpack_require__(/*! ./fully_type_itabs */ "../core/build/src/rules/fully_type_itabs.js"), exports);
|
|
95372
|
+
__exportStar(__webpack_require__(/*! ./function_module_parameter_names */ "../core/build/src/rules/function_module_parameter_names.js"), exports);
|
|
94906
95373
|
__exportStar(__webpack_require__(/*! ./function_module_recommendations */ "../core/build/src/rules/function_module_recommendations.js"), exports);
|
|
94907
95374
|
__exportStar(__webpack_require__(/*! ./functional_writing */ "../core/build/src/rules/functional_writing.js"), exports);
|
|
94908
95375
|
__exportStar(__webpack_require__(/*! ./generic_regex */ "../core/build/src/rules/generic_regex.js"), exports);
|
|
@@ -95009,6 +95476,7 @@ __exportStar(__webpack_require__(/*! ./single_use_expression_temp */ "../core/bu
|
|
|
95009
95476
|
__exportStar(__webpack_require__(/*! ./slow_parameter_passing */ "../core/build/src/rules/slow_parameter_passing.js"), exports);
|
|
95010
95477
|
__exportStar(__webpack_require__(/*! ./smim_consistency */ "../core/build/src/rules/smim_consistency.js"), exports);
|
|
95011
95478
|
__exportStar(__webpack_require__(/*! ./sort_empty_key */ "../core/build/src/rules/sort_empty_key.js"), exports);
|
|
95479
|
+
__exportStar(__webpack_require__(/*! ./sort_required */ "../core/build/src/rules/sort_required.js"), exports);
|
|
95012
95480
|
__exportStar(__webpack_require__(/*! ./space_before_colon */ "../core/build/src/rules/space_before_colon.js"), exports);
|
|
95013
95481
|
__exportStar(__webpack_require__(/*! ./space_before_dot */ "../core/build/src/rules/space_before_dot.js"), exports);
|
|
95014
95482
|
__exportStar(__webpack_require__(/*! ./sql_escape_host_variables */ "../core/build/src/rules/sql_escape_host_variables.js"), exports);
|
|
@@ -95020,6 +95488,7 @@ __exportStar(__webpack_require__(/*! ./strict_sql */ "../core/build/src/rules/st
|
|
|
95020
95488
|
__exportStar(__webpack_require__(/*! ./subrc_after_assign */ "../core/build/src/rules/subrc_after_assign.js"), exports);
|
|
95021
95489
|
__exportStar(__webpack_require__(/*! ./superclass_final */ "../core/build/src/rules/superclass_final.js"), exports);
|
|
95022
95490
|
__exportStar(__webpack_require__(/*! ./superfluous_value */ "../core/build/src/rules/superfluous_value.js"), exports);
|
|
95491
|
+
__exportStar(__webpack_require__(/*! ./suspicious_loop */ "../core/build/src/rules/suspicious_loop.js"), exports);
|
|
95023
95492
|
__exportStar(__webpack_require__(/*! ./sy_modification */ "../core/build/src/rules/sy_modification.js"), exports);
|
|
95024
95493
|
__exportStar(__webpack_require__(/*! ./sy_read_restriction */ "../core/build/src/rules/sy_read_restriction.js"), exports);
|
|
95025
95494
|
__exportStar(__webpack_require__(/*! ./tabl_enhancement_category */ "../core/build/src/rules/tabl_enhancement_category.js"), exports);
|
|
@@ -95029,6 +95498,7 @@ __exportStar(__webpack_require__(/*! ./try_without_catch */ "../core/build/src/r
|
|
|
95029
95498
|
__exportStar(__webpack_require__(/*! ./type_form_parameters */ "../core/build/src/rules/type_form_parameters.js"), exports);
|
|
95030
95499
|
__exportStar(__webpack_require__(/*! ./types_naming */ "../core/build/src/rules/types_naming.js"), exports);
|
|
95031
95500
|
__exportStar(__webpack_require__(/*! ./uncaught_exception */ "../core/build/src/rules/uncaught_exception.js"), exports);
|
|
95501
|
+
__exportStar(__webpack_require__(/*! ./unhandled_classic_exception */ "../core/build/src/rules/unhandled_classic_exception.js"), exports);
|
|
95032
95502
|
__exportStar(__webpack_require__(/*! ./unit_test_assertions */ "../core/build/src/rules/unit_test_assertions.js"), exports);
|
|
95033
95503
|
__exportStar(__webpack_require__(/*! ./unknown_types */ "../core/build/src/rules/unknown_types.js"), exports);
|
|
95034
95504
|
__exportStar(__webpack_require__(/*! ./unnecessary_chaining */ "../core/build/src/rules/unnecessary_chaining.js"), exports);
|
|
@@ -109926,6 +110396,503 @@ exports.SortEmptyKey = SortEmptyKey;
|
|
|
109926
110396
|
|
|
109927
110397
|
/***/ },
|
|
109928
110398
|
|
|
110399
|
+
/***/ "../core/build/src/rules/sort_required.js"
|
|
110400
|
+
/*!************************************************!*\
|
|
110401
|
+
!*** ../core/build/src/rules/sort_required.js ***!
|
|
110402
|
+
\************************************************/
|
|
110403
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
110404
|
+
|
|
110405
|
+
"use strict";
|
|
110406
|
+
|
|
110407
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
110408
|
+
if (k2 === undefined) k2 = k;
|
|
110409
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
110410
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
110411
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
110412
|
+
}
|
|
110413
|
+
Object.defineProperty(o, k2, desc);
|
|
110414
|
+
}) : (function(o, m, k, k2) {
|
|
110415
|
+
if (k2 === undefined) k2 = k;
|
|
110416
|
+
o[k2] = m[k];
|
|
110417
|
+
}));
|
|
110418
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
110419
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
110420
|
+
}) : function(o, v) {
|
|
110421
|
+
o["default"] = v;
|
|
110422
|
+
});
|
|
110423
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
110424
|
+
var ownKeys = function(o) {
|
|
110425
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
110426
|
+
var ar = [];
|
|
110427
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
110428
|
+
return ar;
|
|
110429
|
+
};
|
|
110430
|
+
return ownKeys(o);
|
|
110431
|
+
};
|
|
110432
|
+
return function (mod) {
|
|
110433
|
+
if (mod && mod.__esModule) return mod;
|
|
110434
|
+
var result = {};
|
|
110435
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
110436
|
+
__setModuleDefault(result, mod);
|
|
110437
|
+
return result;
|
|
110438
|
+
};
|
|
110439
|
+
})();
|
|
110440
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
110441
|
+
exports.SortRequired = exports.SortRequiredConf = void 0;
|
|
110442
|
+
const Expressions = __importStar(__webpack_require__(/*! ../abap/2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
|
|
110443
|
+
const Statements = __importStar(__webpack_require__(/*! ../abap/2_statements/statements */ "../core/build/src/abap/2_statements/statements/index.js"));
|
|
110444
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
|
|
110445
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
|
|
110446
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
|
|
110447
|
+
const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "../core/build/src/abap/5_syntax/syntax.js");
|
|
110448
|
+
const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "../core/build/src/objects/_abap_object.js");
|
|
110449
|
+
const basic_1 = __webpack_require__(/*! ../abap/types/basic */ "../core/build/src/abap/types/basic/index.js");
|
|
110450
|
+
const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "../core/build/src/abap/nodes/index.js");
|
|
110451
|
+
const _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ "../core/build/src/abap/types/_typed_identifier.js");
|
|
110452
|
+
const severity_1 = __webpack_require__(/*! ../severity */ "../core/build/src/severity.js");
|
|
110453
|
+
class SortRequiredConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
110454
|
+
constructor() {
|
|
110455
|
+
super(...arguments);
|
|
110456
|
+
this.severity = severity_1.Severity.Warning;
|
|
110457
|
+
/** Check READ TABLE ... WITH KEY ... BINARY SEARCH */
|
|
110458
|
+
this.binarySearch = true;
|
|
110459
|
+
/** Check DELETE ADJACENT DUPLICATES ... COMPARING */
|
|
110460
|
+
this.adjacentDuplicates = true;
|
|
110461
|
+
}
|
|
110462
|
+
}
|
|
110463
|
+
exports.SortRequiredConf = SortRequiredConf;
|
|
110464
|
+
/** what a statement that writes the table does to its order */
|
|
110465
|
+
var Fill;
|
|
110466
|
+
(function (Fill) {
|
|
110467
|
+
/** SELECT without ORDER BY, or APPEND, INSERT or COLLECT in such a SELECT loop: rows in no defined order */
|
|
110468
|
+
Fill[Fill["unordered"] = 0] = "unordered";
|
|
110469
|
+
/** CLEAR, DELETE, MODIFY, SORT, and APPEND, INSERT or COLLECT elsewhere: the code can add the rows in order */
|
|
110470
|
+
Fill[Fill["none"] = 1] = "none";
|
|
110471
|
+
/** anything else: the rows can come sorted from elsewhere */
|
|
110472
|
+
Fill[Fill["unknown"] = 2] = "unknown";
|
|
110473
|
+
})(Fill || (Fill = {}));
|
|
110474
|
+
class SortRequired {
|
|
110475
|
+
constructor() {
|
|
110476
|
+
this.conf = new SortRequiredConf();
|
|
110477
|
+
}
|
|
110478
|
+
getMetadata() {
|
|
110479
|
+
return {
|
|
110480
|
+
key: "sort_required",
|
|
110481
|
+
title: "BINARY SEARCH or DELETE ADJACENT DUPLICATES without a matching SORT",
|
|
110482
|
+
shortDescription: `BINARY SEARCH or DELETE ADJACENT DUPLICATES ... COMPARING on a local table not sorted by those fields`,
|
|
110483
|
+
extendedInformation: `READ TABLE ... WITH KEY ... BINARY SEARCH only finds the row when the table is sorted ascending by
|
|
110484
|
+
the key fields, in the order of the key. DELETE ADJACENT DUPLICATES ... COMPARING only removes all duplicates
|
|
110485
|
+
when rows with equal values in the compared fields are next to each other. Neither statement checks the order:
|
|
110486
|
+
on an unsorted table they give wrong results, without a dump.
|
|
110487
|
+
|
|
110488
|
+
Checked: a standard table declared with DATA in the method, form or function module, read with WITH KEY
|
|
110489
|
+
and BINARY SEARCH, or with DELETE ADJACENT DUPLICATES ... COMPARING. Reported when
|
|
110490
|
+
- the last SORT of the table before the statement is not by the key fields: for BINARY SEARCH they must be
|
|
110491
|
+
the first sort fields, in the same order and ascending; for COMPARING the first sort fields must be the
|
|
110492
|
+
compared fields, in any order. A SORT without BY uses the primary key.
|
|
110493
|
+
- there is no SORT of the table before the statement, and it is filled by a SELECT without ORDER BY: the
|
|
110494
|
+
database returns the rows in no defined order.
|
|
110495
|
+
|
|
110496
|
+
Not reported: parameters, attributes, global and static variables, a table that can get its rows sorted
|
|
110497
|
+
from elsewhere (an assignment, a method or function call, APPEND or INSERT LINES OF, SELECT ... ORDER BY)
|
|
110498
|
+
after the SORT or, without a SORT, anywhere in the procedure, a table without SORT filled only by APPEND,
|
|
110499
|
+
INSERT or COLLECT (the code can add the rows in order), sorted and hashed tables, SORT with STABLE or with
|
|
110500
|
+
dynamic fields, a SORT later in a loop around the statement, a SORT without BY on a default key of a
|
|
110501
|
+
structured row, WITH TABLE KEY, USING KEY, dynamic components and COMPARING ALL FIELDS.
|
|
110502
|
+
See also sort_empty_key and sequential_read_sorted.`,
|
|
110503
|
+
tags: [_irule_1.RuleTag.SingleFile],
|
|
110504
|
+
badExample: `SORT lt_titles BY id.
|
|
110505
|
+
DELETE ADJACENT DUPLICATES FROM lt_titles COMPARING spras id.
|
|
110506
|
+
SELECT * FROM tadir INTO TABLE lt_tadir WHERE devclass = lv_package.
|
|
110507
|
+
READ TABLE lt_tadir WITH KEY object = lv_type obj_name = lv_name BINARY SEARCH TRANSPORTING NO FIELDS.`,
|
|
110508
|
+
goodExample: `SORT lt_titles BY spras id.
|
|
110509
|
+
DELETE ADJACENT DUPLICATES FROM lt_titles COMPARING spras id.
|
|
110510
|
+
SELECT * FROM tadir INTO TABLE lt_tadir WHERE devclass = lv_package.
|
|
110511
|
+
SORT lt_tadir BY object obj_name.
|
|
110512
|
+
READ TABLE lt_tadir WITH KEY object = lv_type obj_name = lv_name BINARY SEARCH TRANSPORTING NO FIELDS.`,
|
|
110513
|
+
};
|
|
110514
|
+
}
|
|
110515
|
+
getConfig() {
|
|
110516
|
+
return this.conf;
|
|
110517
|
+
}
|
|
110518
|
+
initialize(reg) {
|
|
110519
|
+
this.reg = reg;
|
|
110520
|
+
return this;
|
|
110521
|
+
}
|
|
110522
|
+
setConfig(conf) {
|
|
110523
|
+
this.conf = conf;
|
|
110524
|
+
}
|
|
110525
|
+
run(obj) {
|
|
110526
|
+
if (!(obj instanceof _abap_object_1.ABAPObject) || obj.getType() === "INTF") {
|
|
110527
|
+
return [];
|
|
110528
|
+
}
|
|
110529
|
+
const issues = [];
|
|
110530
|
+
let spaghetti = undefined;
|
|
110531
|
+
for (const file of obj.getABAPFiles()) {
|
|
110532
|
+
const statements = file.getStatements();
|
|
110533
|
+
for (let i = 0; i < statements.length; i++) {
|
|
110534
|
+
const statement = statements[i];
|
|
110535
|
+
let table;
|
|
110536
|
+
let fields;
|
|
110537
|
+
let binary;
|
|
110538
|
+
if (statement.get() instanceof Statements.ReadTable && this.conf.binarySearch !== false) {
|
|
110539
|
+
binary = true;
|
|
110540
|
+
table = statement.getChildren().find(c => c instanceof nodes_1.ExpressionNode);
|
|
110541
|
+
fields = this.readKey(statement);
|
|
110542
|
+
}
|
|
110543
|
+
else if (statement.get() instanceof Statements.DeleteInternal && this.conf.adjacentDuplicates !== false) {
|
|
110544
|
+
binary = false;
|
|
110545
|
+
table = statement.findDirectExpression(Expressions.Target);
|
|
110546
|
+
fields = this.comparing(statement);
|
|
110547
|
+
}
|
|
110548
|
+
else {
|
|
110549
|
+
continue;
|
|
110550
|
+
}
|
|
110551
|
+
if (table === undefined || fields === undefined || /^[\w/]+$/.test(table.concatTokens()) === false) {
|
|
110552
|
+
continue;
|
|
110553
|
+
}
|
|
110554
|
+
const name = table.concatTokens().toUpperCase();
|
|
110555
|
+
const start = this.procedureStart(i, statements);
|
|
110556
|
+
if (start === undefined) {
|
|
110557
|
+
continue;
|
|
110558
|
+
}
|
|
110559
|
+
const end = this.procedureEnd(i, statements);
|
|
110560
|
+
if (spaghetti === undefined) {
|
|
110561
|
+
spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;
|
|
110562
|
+
}
|
|
110563
|
+
const id = this.findReference(table, spaghetti, file);
|
|
110564
|
+
const declaration = id === undefined ? undefined : this.findDeclaration(id, file, statements, start, i);
|
|
110565
|
+
const type = id === null || id === void 0 ? void 0 : id.getType();
|
|
110566
|
+
if (declaration === undefined || !(type instanceof basic_1.TableType) || this.isStandard(type, declaration) === false) {
|
|
110567
|
+
continue;
|
|
110568
|
+
}
|
|
110569
|
+
const verb = binary ? "READ TABLE ... BINARY SEARCH" : "DELETE ADJACENT DUPLICATES ... COMPARING";
|
|
110570
|
+
const sortIndex = this.previousSort(name, statements, start, i);
|
|
110571
|
+
let message = undefined;
|
|
110572
|
+
if (sortIndex !== undefined) {
|
|
110573
|
+
const sortFields = this.sortFields(statements[sortIndex], type);
|
|
110574
|
+
if (sortFields !== undefined
|
|
110575
|
+
&& this.matches(sortFields, fields, binary) === false
|
|
110576
|
+
&& this.writtenUnknown(name, statements, sortIndex, i) === false) {
|
|
110577
|
+
const by = sortFields.map(f => f.name.toLowerCase() + (f.descending ? " DESCENDING" : "")).join(" ");
|
|
110578
|
+
message = `${verb} on ${table.concatTokens()} needs it sorted by ${fields.join(" ").toLowerCase()}, `
|
|
110579
|
+
+ `the SORT before is by ${by}`;
|
|
110580
|
+
}
|
|
110581
|
+
}
|
|
110582
|
+
else if (this.sortedLaterInLoop(name, statements, start, i) === false
|
|
110583
|
+
&& this.writtenUnknown(name, statements, start, end) === false
|
|
110584
|
+
&& this.filledUnordered(name, statements, start, end) === true) {
|
|
110585
|
+
message = `${verb} on ${table.concatTokens()} needs it sorted by ${fields.join(" ").toLowerCase()}, `
|
|
110586
|
+
+ `there is no SORT before`;
|
|
110587
|
+
}
|
|
110588
|
+
if (message !== undefined) {
|
|
110589
|
+
issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));
|
|
110590
|
+
}
|
|
110591
|
+
}
|
|
110592
|
+
}
|
|
110593
|
+
return issues;
|
|
110594
|
+
}
|
|
110595
|
+
////////////////
|
|
110596
|
+
/** the components of WITH KEY, for a READ TABLE ... BINARY SEARCH with a free key */
|
|
110597
|
+
readKey(statement) {
|
|
110598
|
+
if (statement.findDirectTokenByText("BINARY") === undefined
|
|
110599
|
+
|| statement.findDirectTokenByText("USING") !== undefined
|
|
110600
|
+
|| statement.findDirectTokenByText("COMPONENTS") !== undefined) {
|
|
110601
|
+
return undefined;
|
|
110602
|
+
}
|
|
110603
|
+
const tokens = statement.getTokens().map(t => t.getStr().toUpperCase());
|
|
110604
|
+
const withKey = tokens.findIndex((t, index) => t === "WITH" && tokens[index + 1] === "KEY");
|
|
110605
|
+
const compare = statement.findDirectExpression(Expressions.ComponentCompareSimple);
|
|
110606
|
+
if (withKey < 0 || compare === undefined || compare.findDirectExpression(Expressions.Dynamic) !== undefined) {
|
|
110607
|
+
return undefined;
|
|
110608
|
+
}
|
|
110609
|
+
return compare.findDirectExpressions(Expressions.ComponentChainSimple).map(c => c.concatTokens().toUpperCase());
|
|
110610
|
+
}
|
|
110611
|
+
/** the fields after COMPARING, for a DELETE ADJACENT DUPLICATES with static fields */
|
|
110612
|
+
comparing(statement) {
|
|
110613
|
+
if (statement.findDirectTokenByText("ADJACENT") === undefined
|
|
110614
|
+
|| statement.findDirectTokenByText("USING") !== undefined
|
|
110615
|
+
|| statement.findDirectTokenByText("ALL") !== undefined
|
|
110616
|
+
|| statement.findDirectTokenByText("COMPARING") === undefined
|
|
110617
|
+
|| statement.findDirectExpression(Expressions.Dynamic) !== undefined
|
|
110618
|
+
|| statement.findDirectExpression(Expressions.FieldOffset) !== undefined
|
|
110619
|
+
|| statement.findDirectExpression(Expressions.FieldLength) !== undefined) {
|
|
110620
|
+
return undefined;
|
|
110621
|
+
}
|
|
110622
|
+
return statement.findDirectExpressions(Expressions.SimpleFieldChain2).map(c => c.concatTokens().toUpperCase());
|
|
110623
|
+
}
|
|
110624
|
+
/** the sort fields of a SORT, undefined when not known */
|
|
110625
|
+
sortFields(statement, type) {
|
|
110626
|
+
var _a;
|
|
110627
|
+
if (statement.findDirectTokenByText("STABLE") !== undefined
|
|
110628
|
+
|| statement.findDirectExpression(Expressions.Dynamic) !== undefined
|
|
110629
|
+
|| statement.findDirectExpression(Expressions.SourceFieldSymbol) !== undefined) {
|
|
110630
|
+
return undefined;
|
|
110631
|
+
}
|
|
110632
|
+
const children = statement.getChildren();
|
|
110633
|
+
const by = children.findIndex(c => c.concatTokens().toUpperCase() === "BY");
|
|
110634
|
+
const descending = children.slice(0, by < 0 ? children.length : by)
|
|
110635
|
+
.some(c => c.concatTokens().toUpperCase() === "DESCENDING");
|
|
110636
|
+
if (by < 0) {
|
|
110637
|
+
return (_a = this.primaryKey(type)) === null || _a === void 0 ? void 0 : _a.map(name => ({ name, descending }));
|
|
110638
|
+
}
|
|
110639
|
+
const result = [];
|
|
110640
|
+
for (let j = by + 1; j < children.length; j++) {
|
|
110641
|
+
const child = children[j];
|
|
110642
|
+
const text = child.concatTokens().toUpperCase();
|
|
110643
|
+
if (child.get() instanceof Expressions.ComponentChain) {
|
|
110644
|
+
result.push({ name: text, descending });
|
|
110645
|
+
}
|
|
110646
|
+
else if (text === "DESCENDING" && result.length > 0) {
|
|
110647
|
+
result[result.length - 1].descending = true;
|
|
110648
|
+
}
|
|
110649
|
+
else if (text === "ASCENDING" && result.length > 0) {
|
|
110650
|
+
result[result.length - 1].descending = false;
|
|
110651
|
+
}
|
|
110652
|
+
}
|
|
110653
|
+
return result;
|
|
110654
|
+
}
|
|
110655
|
+
/** the primary key components, undefined for a default key of a structured row or when not known */
|
|
110656
|
+
primaryKey(type) {
|
|
110657
|
+
var _a;
|
|
110658
|
+
const row = type.getRowType();
|
|
110659
|
+
if (row instanceof basic_1.VoidType || row instanceof basic_1.UnknownType || row.isGeneric()) {
|
|
110660
|
+
return undefined;
|
|
110661
|
+
}
|
|
110662
|
+
const keyType = type.getOptions().keyType;
|
|
110663
|
+
const fields = ((_a = type.getOptions().primaryKey) === null || _a === void 0 ? void 0 : _a.keyFields) || [];
|
|
110664
|
+
if (keyType === basic_1.TableKeyType.user && fields.length > 0) {
|
|
110665
|
+
return fields;
|
|
110666
|
+
}
|
|
110667
|
+
else if (keyType === basic_1.TableKeyType.empty) {
|
|
110668
|
+
return [];
|
|
110669
|
+
}
|
|
110670
|
+
return row instanceof basic_1.StructureType || row instanceof basic_1.TableType ? undefined : ["TABLE_LINE"];
|
|
110671
|
+
}
|
|
110672
|
+
matches(sortFields, fields, binary) {
|
|
110673
|
+
if (sortFields.length < fields.length) {
|
|
110674
|
+
return false;
|
|
110675
|
+
}
|
|
110676
|
+
const first = sortFields.slice(0, fields.length);
|
|
110677
|
+
if (binary === true) {
|
|
110678
|
+
return first.every((f, index) => f.name === fields[index] && f.descending === false);
|
|
110679
|
+
}
|
|
110680
|
+
const names = first.map(f => f.name);
|
|
110681
|
+
return fields.every(f => names.includes(f));
|
|
110682
|
+
}
|
|
110683
|
+
/** index of the last SORT of the table before the statement, in the same procedure */
|
|
110684
|
+
previousSort(name, statements, start, index) {
|
|
110685
|
+
for (let i = index - 1; i > start; i--) {
|
|
110686
|
+
if (this.isSortOf(statements[i], name)) {
|
|
110687
|
+
return i;
|
|
110688
|
+
}
|
|
110689
|
+
}
|
|
110690
|
+
return undefined;
|
|
110691
|
+
}
|
|
110692
|
+
/** a SORT of the table after the statement but inside a loop around it runs before the next pass */
|
|
110693
|
+
sortedLaterInLoop(name, statements, start, index) {
|
|
110694
|
+
let outer = undefined;
|
|
110695
|
+
let depth = 0;
|
|
110696
|
+
for (let i = index - 1; i > start; i--) {
|
|
110697
|
+
if (this.endsLoop(statements[i])) {
|
|
110698
|
+
depth++;
|
|
110699
|
+
}
|
|
110700
|
+
else if (this.startsLoop(statements[i])) {
|
|
110701
|
+
if (depth === 0) {
|
|
110702
|
+
outer = i;
|
|
110703
|
+
}
|
|
110704
|
+
else {
|
|
110705
|
+
depth--;
|
|
110706
|
+
}
|
|
110707
|
+
}
|
|
110708
|
+
}
|
|
110709
|
+
if (outer === undefined) {
|
|
110710
|
+
return false;
|
|
110711
|
+
}
|
|
110712
|
+
depth = 0;
|
|
110713
|
+
for (let i = outer + 1; i < statements.length; i++) {
|
|
110714
|
+
const statement = statements[i];
|
|
110715
|
+
if (this.startsLoop(statement)) {
|
|
110716
|
+
depth++;
|
|
110717
|
+
}
|
|
110718
|
+
else if (this.endsLoop(statement)) {
|
|
110719
|
+
if (depth === 0) {
|
|
110720
|
+
return false;
|
|
110721
|
+
}
|
|
110722
|
+
depth--;
|
|
110723
|
+
}
|
|
110724
|
+
else if (i > index && this.isSortOf(statement, name)) {
|
|
110725
|
+
return true;
|
|
110726
|
+
}
|
|
110727
|
+
}
|
|
110728
|
+
return false;
|
|
110729
|
+
}
|
|
110730
|
+
isSortOf(statement, name) {
|
|
110731
|
+
var _a;
|
|
110732
|
+
return statement.get() instanceof Statements.Sort
|
|
110733
|
+
&& ((_a = statement.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase()) === name;
|
|
110734
|
+
}
|
|
110735
|
+
/** true when a statement between from and to fills the table from a source that can be sorted */
|
|
110736
|
+
writtenUnknown(name, statements, from, to) {
|
|
110737
|
+
for (let i = from + 1; i < to; i++) {
|
|
110738
|
+
if (this.writes(statements[i], name) && this.fillKind(i, statements, name) === Fill.unknown) {
|
|
110739
|
+
return true;
|
|
110740
|
+
}
|
|
110741
|
+
}
|
|
110742
|
+
return false;
|
|
110743
|
+
}
|
|
110744
|
+
/** true when a statement in the procedure brings rows in no defined order */
|
|
110745
|
+
filledUnordered(name, statements, start, end) {
|
|
110746
|
+
for (let i = start + 1; i < end; i++) {
|
|
110747
|
+
if (this.writes(statements[i], name) && this.fillKind(i, statements, name) === Fill.unordered) {
|
|
110748
|
+
return true;
|
|
110749
|
+
}
|
|
110750
|
+
}
|
|
110751
|
+
return false;
|
|
110752
|
+
}
|
|
110753
|
+
writes(statement, name) {
|
|
110754
|
+
return statement.get() instanceof Statements.Data === false
|
|
110755
|
+
&& statement.findAllExpressions(Expressions.Target).some(t => this.targetName(t) === name);
|
|
110756
|
+
}
|
|
110757
|
+
targetName(target) {
|
|
110758
|
+
var _a;
|
|
110759
|
+
const inline = target.findDirectExpression(Expressions.InlineData);
|
|
110760
|
+
if (inline !== undefined) {
|
|
110761
|
+
return ((_a = inline.findDirectExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase()) || "";
|
|
110762
|
+
}
|
|
110763
|
+
return target.concatTokens().toUpperCase();
|
|
110764
|
+
}
|
|
110765
|
+
fillKind(index, statements, name) {
|
|
110766
|
+
var _a;
|
|
110767
|
+
const statement = statements[index];
|
|
110768
|
+
const s = statement.get();
|
|
110769
|
+
if (s instanceof Statements.Clear
|
|
110770
|
+
|| s instanceof Statements.Refresh
|
|
110771
|
+
|| s instanceof Statements.Free
|
|
110772
|
+
|| s instanceof Statements.DeleteInternal
|
|
110773
|
+
|| s instanceof Statements.ModifyInternal
|
|
110774
|
+
|| s instanceof Statements.Sort) {
|
|
110775
|
+
return Fill.none;
|
|
110776
|
+
}
|
|
110777
|
+
else if (s instanceof Statements.Append || s instanceof Statements.InsertInternal || s instanceof Statements.Collect) {
|
|
110778
|
+
if (statement.findDirectTokenByText("LINES") !== undefined || statement.findDirectTokenByText("SORTED") !== undefined) {
|
|
110779
|
+
return Fill.unknown;
|
|
110780
|
+
}
|
|
110781
|
+
const loop = this.innermostLoop(index, statements);
|
|
110782
|
+
return loop !== undefined && this.selectsUnordered(loop) ? Fill.unordered : Fill.none;
|
|
110783
|
+
}
|
|
110784
|
+
else if (s instanceof Statements.Select || s instanceof Statements.SelectLoop) {
|
|
110785
|
+
const target = (_a = statement.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.Target);
|
|
110786
|
+
return target !== undefined && this.targetName(target) === name && this.selectsUnordered(statement)
|
|
110787
|
+
? Fill.unordered : Fill.unknown;
|
|
110788
|
+
}
|
|
110789
|
+
return Fill.unknown;
|
|
110790
|
+
}
|
|
110791
|
+
selectsUnordered(statement) {
|
|
110792
|
+
return (statement.get() instanceof Statements.Select || statement.get() instanceof Statements.SelectLoop)
|
|
110793
|
+
&& statement.findFirstExpression(Expressions.SQLOrderBy) === undefined;
|
|
110794
|
+
}
|
|
110795
|
+
innermostLoop(index, statements) {
|
|
110796
|
+
let depth = 0;
|
|
110797
|
+
for (let i = index - 1; i >= 0; i--) {
|
|
110798
|
+
if (this.endsLoop(statements[i])) {
|
|
110799
|
+
depth++;
|
|
110800
|
+
}
|
|
110801
|
+
else if (this.startsLoop(statements[i])) {
|
|
110802
|
+
if (depth === 0) {
|
|
110803
|
+
return statements[i];
|
|
110804
|
+
}
|
|
110805
|
+
depth--;
|
|
110806
|
+
}
|
|
110807
|
+
}
|
|
110808
|
+
return undefined;
|
|
110809
|
+
}
|
|
110810
|
+
/** the DATA statement or inline declaration of the table inside the procedure, before the statement;
|
|
110811
|
+
* parameters, attributes, globals and statics are declared elsewhere or with another statement */
|
|
110812
|
+
findDeclaration(id, file, statements, start, index) {
|
|
110813
|
+
if (id.getFilename() !== file.getFilename()) {
|
|
110814
|
+
return undefined;
|
|
110815
|
+
}
|
|
110816
|
+
const position = id.getStart();
|
|
110817
|
+
for (let i = start + 1; i < index; i++) {
|
|
110818
|
+
const statement = statements[i];
|
|
110819
|
+
if (position.isBetween(statement.getStart(), statement.getEnd()) === false) {
|
|
110820
|
+
continue;
|
|
110821
|
+
}
|
|
110822
|
+
const inline = statement.findAllExpressions(Expressions.InlineData)
|
|
110823
|
+
.some(d => position.isBetween(d.getFirstToken().getStart(), d.getLastToken().getEnd()));
|
|
110824
|
+
return statement.get() instanceof Statements.Data || inline ? statement : undefined;
|
|
110825
|
+
}
|
|
110826
|
+
return undefined;
|
|
110827
|
+
}
|
|
110828
|
+
/** a standard table; the result of an inline SELECT has no access type set, it is a standard table */
|
|
110829
|
+
isStandard(type, declaration) {
|
|
110830
|
+
const access = type.getAccessType();
|
|
110831
|
+
if (access === undefined) {
|
|
110832
|
+
return declaration.get() instanceof Statements.Select || declaration.get() instanceof Statements.SelectLoop;
|
|
110833
|
+
}
|
|
110834
|
+
return access === basic_1.TableAccessType.standard;
|
|
110835
|
+
}
|
|
110836
|
+
findReference(node, spaghetti, file) {
|
|
110837
|
+
const start = node.getFirstToken().getStart();
|
|
110838
|
+
const scope = spaghetti.lookupPosition(start, file.getFilename());
|
|
110839
|
+
for (const r of (scope === null || scope === void 0 ? void 0 : scope.getData().references) || []) {
|
|
110840
|
+
if (r.position.getStart().equals(start) && r.resolved instanceof _typed_identifier_1.TypedIdentifier) {
|
|
110841
|
+
return r.resolved;
|
|
110842
|
+
}
|
|
110843
|
+
}
|
|
110844
|
+
return undefined;
|
|
110845
|
+
}
|
|
110846
|
+
procedureStart(index, statements) {
|
|
110847
|
+
for (let i = index - 1; i >= 0; i--) {
|
|
110848
|
+
const s = statements[i].get();
|
|
110849
|
+
if (s instanceof Statements.MethodImplementation
|
|
110850
|
+
|| s instanceof Statements.Form
|
|
110851
|
+
|| s instanceof Statements.FunctionModule
|
|
110852
|
+
|| s instanceof Statements.Module) {
|
|
110853
|
+
return i;
|
|
110854
|
+
}
|
|
110855
|
+
else if (s instanceof Statements.EndMethod
|
|
110856
|
+
|| s instanceof Statements.EndForm
|
|
110857
|
+
|| s instanceof Statements.EndFunction
|
|
110858
|
+
|| s instanceof Statements.EndModule) {
|
|
110859
|
+
return undefined;
|
|
110860
|
+
}
|
|
110861
|
+
}
|
|
110862
|
+
return undefined;
|
|
110863
|
+
}
|
|
110864
|
+
procedureEnd(index, statements) {
|
|
110865
|
+
for (let i = index + 1; i < statements.length; i++) {
|
|
110866
|
+
const s = statements[i].get();
|
|
110867
|
+
if (s instanceof Statements.EndMethod
|
|
110868
|
+
|| s instanceof Statements.EndForm
|
|
110869
|
+
|| s instanceof Statements.EndFunction
|
|
110870
|
+
|| s instanceof Statements.EndModule) {
|
|
110871
|
+
return i;
|
|
110872
|
+
}
|
|
110873
|
+
}
|
|
110874
|
+
return statements.length;
|
|
110875
|
+
}
|
|
110876
|
+
startsLoop(statement) {
|
|
110877
|
+
const s = statement.get();
|
|
110878
|
+
return s instanceof Statements.Loop
|
|
110879
|
+
|| s instanceof Statements.Do
|
|
110880
|
+
|| s instanceof Statements.While
|
|
110881
|
+
|| s instanceof Statements.SelectLoop;
|
|
110882
|
+
}
|
|
110883
|
+
endsLoop(statement) {
|
|
110884
|
+
const s = statement.get();
|
|
110885
|
+
return s instanceof Statements.EndLoop
|
|
110886
|
+
|| s instanceof Statements.EndDo
|
|
110887
|
+
|| s instanceof Statements.EndWhile
|
|
110888
|
+
|| s instanceof Statements.EndSelect;
|
|
110889
|
+
}
|
|
110890
|
+
}
|
|
110891
|
+
exports.SortRequired = SortRequired;
|
|
110892
|
+
//# sourceMappingURL=sort_required.js.map
|
|
110893
|
+
|
|
110894
|
+
/***/ },
|
|
110895
|
+
|
|
109929
110896
|
/***/ "../core/build/src/rules/space_before_colon.js"
|
|
109930
110897
|
/*!*****************************************************!*\
|
|
109931
110898
|
!*** ../core/build/src/rules/space_before_colon.js ***!
|
|
@@ -111287,31 +112254,192 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
111287
112254
|
};
|
|
111288
112255
|
})();
|
|
111289
112256
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
111290
|
-
exports.SuperfluousValue = exports.SuperfluousValueConf = void 0;
|
|
111291
|
-
const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
|
|
111292
|
-
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "../core/build/src/rules/_abap_rule.js");
|
|
111293
|
-
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
|
|
112257
|
+
exports.SuperfluousValue = exports.SuperfluousValueConf = void 0;
|
|
112258
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
|
|
112259
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "../core/build/src/rules/_abap_rule.js");
|
|
112260
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
|
|
112261
|
+
const Expressions = __importStar(__webpack_require__(/*! ../abap/2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
|
|
112262
|
+
const Statements = __importStar(__webpack_require__(/*! ../abap/2_statements/statements */ "../core/build/src/abap/2_statements/statements/index.js"));
|
|
112263
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
|
|
112264
|
+
const version_1 = __webpack_require__(/*! ../version */ "../core/build/src/version.js");
|
|
112265
|
+
class SuperfluousValueConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
112266
|
+
}
|
|
112267
|
+
exports.SuperfluousValueConf = SuperfluousValueConf;
|
|
112268
|
+
class SuperfluousValue extends _abap_rule_1.ABAPRule {
|
|
112269
|
+
constructor() {
|
|
112270
|
+
super(...arguments);
|
|
112271
|
+
this.conf = new SuperfluousValueConf();
|
|
112272
|
+
}
|
|
112273
|
+
getMetadata() {
|
|
112274
|
+
return {
|
|
112275
|
+
key: "superfluous_value",
|
|
112276
|
+
title: "Superfluous VALUE",
|
|
112277
|
+
shortDescription: `Find superfluous VALUE expressions`,
|
|
112278
|
+
extendedInformation: `Left hand side is inline, VALUE is inferred, value body is simple, from v740sp02 and up`,
|
|
112279
|
+
tags: [_irule_1.RuleTag.SingleFile],
|
|
112280
|
+
badExample: `DATA(message_entry) = VALUE #( message_table[ msgno = msgno ] ).`,
|
|
112281
|
+
goodExample: `DATA(message_entry) = message_table[ msgno = msgno ].`,
|
|
112282
|
+
};
|
|
112283
|
+
}
|
|
112284
|
+
getConfig() {
|
|
112285
|
+
return this.conf;
|
|
112286
|
+
}
|
|
112287
|
+
setConfig(conf) {
|
|
112288
|
+
this.conf = conf;
|
|
112289
|
+
}
|
|
112290
|
+
runParsed(file) {
|
|
112291
|
+
var _a, _b;
|
|
112292
|
+
const output = [];
|
|
112293
|
+
if (!(0, version_1.releaseAtLeast)(this.reg.getConfig().getRelease(), version_1.Release.v740sp02)
|
|
112294
|
+
&& this.reg.getConfig().getLanguageVersion() !== version_1.LanguageVersion.Cloud) {
|
|
112295
|
+
return [];
|
|
112296
|
+
}
|
|
112297
|
+
const struc = file.getStructure();
|
|
112298
|
+
if (struc === undefined) {
|
|
112299
|
+
return []; // syntax error
|
|
112300
|
+
}
|
|
112301
|
+
for (const m of struc.findAllStatements(Statements.Move)) {
|
|
112302
|
+
if (((_a = m.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.InlineData)) === undefined) {
|
|
112303
|
+
continue;
|
|
112304
|
+
}
|
|
112305
|
+
const source = m.findDirectExpression(Expressions.Source);
|
|
112306
|
+
if (source === undefined) {
|
|
112307
|
+
continue;
|
|
112308
|
+
}
|
|
112309
|
+
const type = (_b = source.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
112310
|
+
if (type !== "#") {
|
|
112311
|
+
continue;
|
|
112312
|
+
}
|
|
112313
|
+
const body = source.findDirectExpression(Expressions.ValueBody);
|
|
112314
|
+
if (body === undefined) {
|
|
112315
|
+
continue;
|
|
112316
|
+
}
|
|
112317
|
+
if (body.getChildren().length === 1) {
|
|
112318
|
+
const message = "Superfluous VALUE expression";
|
|
112319
|
+
const issue = issue_1.Issue.atStatement(file, m, message, this.getMetadata().key, this.conf.severity);
|
|
112320
|
+
output.push(issue);
|
|
112321
|
+
}
|
|
112322
|
+
}
|
|
112323
|
+
return output;
|
|
112324
|
+
}
|
|
112325
|
+
}
|
|
112326
|
+
exports.SuperfluousValue = SuperfluousValue;
|
|
112327
|
+
//# sourceMappingURL=superfluous_value.js.map
|
|
112328
|
+
|
|
112329
|
+
/***/ },
|
|
112330
|
+
|
|
112331
|
+
/***/ "../core/build/src/rules/suspicious_loop.js"
|
|
112332
|
+
/*!**************************************************!*\
|
|
112333
|
+
!*** ../core/build/src/rules/suspicious_loop.js ***!
|
|
112334
|
+
\**************************************************/
|
|
112335
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
112336
|
+
|
|
112337
|
+
"use strict";
|
|
112338
|
+
|
|
112339
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
112340
|
+
if (k2 === undefined) k2 = k;
|
|
112341
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
112342
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
112343
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
112344
|
+
}
|
|
112345
|
+
Object.defineProperty(o, k2, desc);
|
|
112346
|
+
}) : (function(o, m, k, k2) {
|
|
112347
|
+
if (k2 === undefined) k2 = k;
|
|
112348
|
+
o[k2] = m[k];
|
|
112349
|
+
}));
|
|
112350
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
112351
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
112352
|
+
}) : function(o, v) {
|
|
112353
|
+
o["default"] = v;
|
|
112354
|
+
});
|
|
112355
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
112356
|
+
var ownKeys = function(o) {
|
|
112357
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
112358
|
+
var ar = [];
|
|
112359
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
112360
|
+
return ar;
|
|
112361
|
+
};
|
|
112362
|
+
return ownKeys(o);
|
|
112363
|
+
};
|
|
112364
|
+
return function (mod) {
|
|
112365
|
+
if (mod && mod.__esModule) return mod;
|
|
112366
|
+
var result = {};
|
|
112367
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
112368
|
+
__setModuleDefault(result, mod);
|
|
112369
|
+
return result;
|
|
112370
|
+
};
|
|
112371
|
+
})();
|
|
112372
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
112373
|
+
exports.SuspiciousLoop = exports.SuspiciousLoopConf = void 0;
|
|
111294
112374
|
const Expressions = __importStar(__webpack_require__(/*! ../abap/2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
|
|
111295
112375
|
const Statements = __importStar(__webpack_require__(/*! ../abap/2_statements/statements */ "../core/build/src/abap/2_statements/statements/index.js"));
|
|
111296
|
-
const
|
|
111297
|
-
const
|
|
111298
|
-
|
|
111299
|
-
|
|
111300
|
-
|
|
111301
|
-
|
|
112376
|
+
const Structures = __importStar(__webpack_require__(/*! ../abap/3_structures/structures */ "../core/build/src/abap/3_structures/structures/index.js"));
|
|
112377
|
+
const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "../core/build/src/abap/nodes/index.js");
|
|
112378
|
+
const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "../core/build/src/abap/5_syntax/_reference.js");
|
|
112379
|
+
const _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ "../core/build/src/abap/types/_typed_identifier.js");
|
|
112380
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
|
|
112381
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
|
|
112382
|
+
const severity_1 = __webpack_require__(/*! ../severity */ "../core/build/src/severity.js");
|
|
112383
|
+
const _procedure_analysis_1 = __webpack_require__(/*! ./_procedure_analysis */ "../core/build/src/rules/_procedure_analysis.js");
|
|
112384
|
+
class SuspiciousLoopConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
111302
112385
|
constructor() {
|
|
111303
112386
|
super(...arguments);
|
|
111304
|
-
this.
|
|
112387
|
+
this.severity = severity_1.Severity.Warning;
|
|
112388
|
+
/** Report WHILE loops whose condition the loop body never changes, or sets to the same value in every iteration.
|
|
112389
|
+
* The loop runs zero times, once or forever */
|
|
112390
|
+
this.unchangedCondition = true;
|
|
112391
|
+
}
|
|
112392
|
+
}
|
|
112393
|
+
exports.SuspiciousLoopConf = SuspiciousLoopConf;
|
|
112394
|
+
const NESTED_LOOPS = [Structures.Loop, Structures.Do, Structures.While, Structures.Select,
|
|
112395
|
+
Structures.Provide, Structures.LoopAtScreen, Structures.LoopExtract];
|
|
112396
|
+
/** statements that leave the loop, or may leave it, wherever they are in the loop body */
|
|
112397
|
+
const LEAVING = [Statements.Return, Statements.Raise, Statements.Message, Statements.Leave,
|
|
112398
|
+
Statements.Submit, Statements.Stop, Statements.Reject];
|
|
112399
|
+
/** statements which run no other code than the method calls they contain */
|
|
112400
|
+
const CALLING = [Statements.Call, Statements.Move, Statements.If, Statements.ElseIf,
|
|
112401
|
+
Statements.Case, Statements.When, Statements.Append, Statements.InsertInternal, Statements.Concatenate];
|
|
112402
|
+
class SuspiciousLoop {
|
|
112403
|
+
constructor() {
|
|
112404
|
+
this.conf = new SuspiciousLoopConf();
|
|
111305
112405
|
}
|
|
111306
112406
|
getMetadata() {
|
|
111307
112407
|
return {
|
|
111308
|
-
key: "
|
|
111309
|
-
title: "
|
|
111310
|
-
shortDescription: `
|
|
111311
|
-
extendedInformation: `
|
|
111312
|
-
|
|
111313
|
-
|
|
111314
|
-
|
|
112408
|
+
key: "suspicious_loop",
|
|
112409
|
+
title: "Suspicious loop",
|
|
112410
|
+
shortDescription: `Finds WHILE loops whose condition the loop body never changes`,
|
|
112411
|
+
extendedInformation: `Option unchangedCondition: reports a WHILE loop when the loop body cannot change its condition
|
|
112412
|
+
after the first iteration. Then the loop runs zero times, once or forever.
|
|
112413
|
+
|
|
112414
|
+
The condition may read local variables of the METHOD, FORM or FUNCTION, constants, builtin functions
|
|
112415
|
+
like lines( ), and attributes and parameters without ->. Each local variable in it is either
|
|
112416
|
+
* not written in the loop body, or
|
|
112417
|
+
* only written by var = source. directly in the loop body, not in a nested block, where the source is
|
|
112418
|
+
the same in every iteration: no method calls, field symbols or ->*, and it only reads constants,
|
|
112419
|
+
local variables that the loop body does not write, and other data that the loop body does not write.
|
|
112420
|
+
Attributes and parameters in the condition must not be written in the loop body either.
|
|
112421
|
+
|
|
112422
|
+
When the condition or a source reads data that is not local, the loop body must not call methods,
|
|
112423
|
+
functions or forms, except instance methods via local reference variables, and must not write via
|
|
112424
|
+
field symbols or ->*. A source that reads local->attribute also needs that the loop body calls no
|
|
112425
|
+
method via that local.
|
|
112426
|
+
|
|
112427
|
+
Not reported: conditions with system fields like sy-subrc, field symbols, -> or method calls, local
|
|
112428
|
+
variables whose address is taken, loop bodies with EXIT, RETURN, RAISE, MESSAGE, LEAVE, SUBMIT, STOP or
|
|
112429
|
+
REJECT, and, when the condition variables are written, loop bodies with CONTINUE or CHECK.
|
|
112430
|
+
Objects with syntax errors, macros or unknown statements are skipped, as are procedures with dynamic code,
|
|
112431
|
+
INCLUDE, test seams, enhancements or native SQL.`,
|
|
112432
|
+
tags: [],
|
|
112433
|
+
badExample: `DATA(lo_x) = previous.
|
|
112434
|
+
WHILE lo_x IS BOUND.
|
|
112435
|
+
result = result && lo_x->get_text( ).
|
|
112436
|
+
lo_x = previous->previous.
|
|
112437
|
+
ENDWHILE.`,
|
|
112438
|
+
goodExample: `DATA(lo_x) = previous.
|
|
112439
|
+
WHILE lo_x IS BOUND.
|
|
112440
|
+
result = result && lo_x->get_text( ).
|
|
112441
|
+
lo_x = lo_x->previous.
|
|
112442
|
+
ENDWHILE.`,
|
|
111315
112443
|
};
|
|
111316
112444
|
}
|
|
111317
112445
|
getConfig() {
|
|
@@ -111320,44 +112448,226 @@ class SuperfluousValue extends _abap_rule_1.ABAPRule {
|
|
|
111320
112448
|
setConfig(conf) {
|
|
111321
112449
|
this.conf = conf;
|
|
111322
112450
|
}
|
|
111323
|
-
|
|
111324
|
-
|
|
111325
|
-
|
|
111326
|
-
|
|
111327
|
-
|
|
112451
|
+
initialize(reg) {
|
|
112452
|
+
this.reg = reg;
|
|
112453
|
+
return this;
|
|
112454
|
+
}
|
|
112455
|
+
run(obj) {
|
|
112456
|
+
if (this.conf.unchangedCondition === false) {
|
|
111328
112457
|
return [];
|
|
111329
112458
|
}
|
|
111330
|
-
const
|
|
111331
|
-
if (
|
|
111332
|
-
return [];
|
|
112459
|
+
const analysis = _procedure_analysis_1.ObjectAnalysis.run(this.reg, obj);
|
|
112460
|
+
if (analysis === undefined) {
|
|
112461
|
+
return [];
|
|
111333
112462
|
}
|
|
111334
|
-
|
|
111335
|
-
|
|
112463
|
+
const issues = [];
|
|
112464
|
+
for (const procedure of analysis.procedures) {
|
|
112465
|
+
if (procedure.supported === false) {
|
|
111336
112466
|
continue;
|
|
111337
112467
|
}
|
|
111338
|
-
const
|
|
111339
|
-
|
|
112468
|
+
for (const loop of procedure.structure.findAllStructuresRecursive(Structures.While)) {
|
|
112469
|
+
const issue = this.unchangedCondition(procedure, loop);
|
|
112470
|
+
if (issue !== undefined) {
|
|
112471
|
+
issues.push(issue);
|
|
112472
|
+
}
|
|
112473
|
+
}
|
|
112474
|
+
}
|
|
112475
|
+
return issues;
|
|
112476
|
+
}
|
|
112477
|
+
////////////////
|
|
112478
|
+
unchangedCondition(procedure, loop) {
|
|
112479
|
+
const statement = loop.findDirectStatement(Statements.While);
|
|
112480
|
+
const end = loop.findDirectStatement(Statements.EndWhile);
|
|
112481
|
+
const cond = statement === null || statement === void 0 ? void 0 : statement.findDirectExpression(Expressions.Cond);
|
|
112482
|
+
if (statement === undefined || end === undefined || cond === undefined
|
|
112483
|
+
|| statement.findDirectTokenByText("VARY") !== undefined
|
|
112484
|
+
|| cond.getAllTokens().some(t => t.getStr() === "->")) {
|
|
112485
|
+
return undefined;
|
|
112486
|
+
}
|
|
112487
|
+
const reads = this.reads(procedure, cond);
|
|
112488
|
+
if (reads === undefined || reads.locals.length + reads.others.length === 0) {
|
|
112489
|
+
return undefined;
|
|
112490
|
+
}
|
|
112491
|
+
const from = procedure.index(statement);
|
|
112492
|
+
const to = procedure.index(end);
|
|
112493
|
+
const body = loop.findDirectStructure(Structures.Body);
|
|
112494
|
+
let continues = false;
|
|
112495
|
+
for (const found of body === undefined ? [] : this.loopControl(body, false)) {
|
|
112496
|
+
const type = found.get();
|
|
112497
|
+
if (type instanceof Statements.Continue || type instanceof Statements.Check) {
|
|
112498
|
+
continues = true;
|
|
112499
|
+
}
|
|
112500
|
+
else {
|
|
112501
|
+
return undefined;
|
|
112502
|
+
}
|
|
112503
|
+
}
|
|
112504
|
+
if (reads.others.some(o => this.writtenIn(procedure, o, from, to))
|
|
112505
|
+
|| (reads.others.length > 0 && this.mayChangeOtherData(procedure, from, to, []))) {
|
|
112506
|
+
return undefined;
|
|
112507
|
+
}
|
|
112508
|
+
let written = undefined;
|
|
112509
|
+
for (const variable of reads.locals) {
|
|
112510
|
+
for (const write of variable.writes()) {
|
|
112511
|
+
if (write.index <= from || write.index >= to) {
|
|
112512
|
+
continue;
|
|
112513
|
+
}
|
|
112514
|
+
else if (continues || body === undefined
|
|
112515
|
+
|| this.sameValueWrite(procedure, write.statement, write.token, body, from, to) === false) {
|
|
112516
|
+
return undefined;
|
|
112517
|
+
}
|
|
112518
|
+
written = variable.identifier.getName();
|
|
112519
|
+
}
|
|
112520
|
+
}
|
|
112521
|
+
const names = [...reads.locals.map(v => v.identifier.getName()), ...reads.others.map(o => o.getName())].join(", ");
|
|
112522
|
+
const message = written === undefined
|
|
112523
|
+
? `WHILE condition never changes, the loop body does not write ${names}, the loop runs zero times or forever`
|
|
112524
|
+
: `WHILE condition does not change after the first iteration, the loop body sets ${written} `
|
|
112525
|
+
+ `to the same value in every iteration, the loop runs once or forever`;
|
|
112526
|
+
return issue_1.Issue.atStatement(procedure.file, statement, message, this.getMetadata().key, this.conf.severity);
|
|
112527
|
+
}
|
|
112528
|
+
/** data read by the condition or source, undefined if it reads anything that can change unseen */
|
|
112529
|
+
reads(procedure, node) {
|
|
112530
|
+
var _a;
|
|
112531
|
+
if (node.findFirstExpression(Expressions.SourceFieldSymbol) !== undefined
|
|
112532
|
+
|| node.findFirstExpression(Expressions.Dereference) !== undefined
|
|
112533
|
+
|| node.findFirstExpression(Expressions.NewObject) !== undefined) {
|
|
112534
|
+
return undefined;
|
|
112535
|
+
}
|
|
112536
|
+
for (const call of node.findAllExpressionsRecursive(Expressions.MethodCall)) {
|
|
112537
|
+
if (this.isBuiltinCall(procedure, call) === false) {
|
|
112538
|
+
return undefined;
|
|
112539
|
+
}
|
|
112540
|
+
}
|
|
112541
|
+
const ret = { locals: [], others: [], receivers: [] };
|
|
112542
|
+
const tokens = node.getAllTokens();
|
|
112543
|
+
for (const field of [...node.findAllExpressionsRecursive(Expressions.SourceField),
|
|
112544
|
+
...node.findAllExpressionsRecursive(Expressions.AttributeName)]) {
|
|
112545
|
+
const token = field.getFirstToken();
|
|
112546
|
+
const identifier = procedure.identifierAt(token);
|
|
112547
|
+
if ((0, _procedure_analysis_1.isImmutable)(identifier)) {
|
|
111340
112548
|
continue;
|
|
111341
112549
|
}
|
|
111342
|
-
const
|
|
111343
|
-
if (
|
|
112550
|
+
const local = procedure.local(identifier);
|
|
112551
|
+
if (local !== undefined) {
|
|
112552
|
+
if (local.escapes()) {
|
|
112553
|
+
return undefined;
|
|
112554
|
+
}
|
|
112555
|
+
if (ret.locals.includes(local) === false) {
|
|
112556
|
+
ret.locals.push(local);
|
|
112557
|
+
}
|
|
112558
|
+
const index = tokens.findIndex(t => t.getStart().equals(token.getStart()));
|
|
112559
|
+
if (((_a = tokens[index + 1]) === null || _a === void 0 ? void 0 : _a.getStr()) === "->") {
|
|
112560
|
+
ret.receivers.push(local);
|
|
112561
|
+
}
|
|
112562
|
+
}
|
|
112563
|
+
else if (!(identifier instanceof _typed_identifier_1.TypedIdentifier)
|
|
112564
|
+
|| identifier.getMeta().includes("built-in" /* IdentifierMeta.BuiltIn */)) {
|
|
112565
|
+
// unknown, or system fields like sy-subrc, which change without a write reference
|
|
112566
|
+
return undefined;
|
|
112567
|
+
}
|
|
112568
|
+
else if (ret.others.includes(identifier) === false) {
|
|
112569
|
+
ret.others.push(identifier);
|
|
112570
|
+
}
|
|
112571
|
+
}
|
|
112572
|
+
return ret;
|
|
112573
|
+
}
|
|
112574
|
+
isBuiltinCall(procedure, call) {
|
|
112575
|
+
var _a;
|
|
112576
|
+
const name = (_a = call.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
112577
|
+
if (name === undefined) {
|
|
112578
|
+
return false;
|
|
112579
|
+
}
|
|
112580
|
+
const references = procedure.analysis.referencesAt(procedure.file.getFilename(), name);
|
|
112581
|
+
return references.length > 0 && references.every(r => r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference);
|
|
112582
|
+
}
|
|
112583
|
+
/** statements in the loop body that leave the loop or go to its next iteration */
|
|
112584
|
+
loopControl(node, nested) {
|
|
112585
|
+
const ret = [];
|
|
112586
|
+
for (const child of node.getChildren()) {
|
|
112587
|
+
if (child instanceof nodes_1.StructureNode) {
|
|
112588
|
+
ret.push(...this.loopControl(child, nested || NESTED_LOOPS.some(l => child.get() instanceof l)));
|
|
111344
112589
|
continue;
|
|
111345
112590
|
}
|
|
111346
|
-
const
|
|
111347
|
-
if (
|
|
112591
|
+
const type = child.get();
|
|
112592
|
+
if (LEAVING.some(l => type instanceof l)
|
|
112593
|
+
|| (nested === false && (type instanceof Statements.Exit
|
|
112594
|
+
|| type instanceof Statements.Continue || type instanceof Statements.Check))) {
|
|
112595
|
+
ret.push(child);
|
|
112596
|
+
}
|
|
112597
|
+
}
|
|
112598
|
+
return ret;
|
|
112599
|
+
}
|
|
112600
|
+
/** var = source. directly in the loop body, the source has the same value in every iteration */
|
|
112601
|
+
sameValueWrite(procedure, statement, token, body, from, to) {
|
|
112602
|
+
const move = (0, _procedure_analysis_1.plainMove)(statement);
|
|
112603
|
+
if (move === undefined || move.operator !== "=" || (0, _procedure_analysis_1.singleTarget)(move.target) !== token
|
|
112604
|
+
|| procedure.block(statement) !== body || procedure.isSimple(statement) === false) {
|
|
112605
|
+
return false;
|
|
112606
|
+
}
|
|
112607
|
+
const reads = this.reads(procedure, move.source);
|
|
112608
|
+
if (reads === undefined
|
|
112609
|
+
|| reads.locals.some(l => l.writes().some(w => w.index > from && w.index < to))
|
|
112610
|
+
|| reads.others.some(o => this.writtenIn(procedure, o, from, to))) {
|
|
112611
|
+
return false;
|
|
112612
|
+
}
|
|
112613
|
+
return reads.others.length === 0 || this.mayChangeOtherData(procedure, from, to, reads.receivers) === false;
|
|
112614
|
+
}
|
|
112615
|
+
writtenIn(procedure, identifier, from, to) {
|
|
112616
|
+
for (const reference of procedure.analysis.referencesTo(identifier)) {
|
|
112617
|
+
if (reference.referenceType !== _reference_1.ReferenceType.DataWriteReference || !procedure.contains(reference.position)) {
|
|
111348
112618
|
continue;
|
|
111349
112619
|
}
|
|
111350
|
-
|
|
111351
|
-
|
|
111352
|
-
|
|
111353
|
-
|
|
112620
|
+
const statement = procedure.statementOf(reference.position.getToken());
|
|
112621
|
+
const index = statement === undefined ? -1 : procedure.index(statement);
|
|
112622
|
+
if (index > from && index < to) {
|
|
112623
|
+
return true;
|
|
111354
112624
|
}
|
|
111355
112625
|
}
|
|
111356
|
-
return
|
|
112626
|
+
return false;
|
|
112627
|
+
}
|
|
112628
|
+
/** the loop body calls methods, functions or forms, or writes via field symbols or ->*, which can change
|
|
112629
|
+
* attributes and other data that is not local; instance methods via local reference variables are accepted,
|
|
112630
|
+
* unless the variable is one of the receivers */
|
|
112631
|
+
mayChangeOtherData(procedure, from, to, receivers) {
|
|
112632
|
+
for (let index = from + 1; index < to; index++) {
|
|
112633
|
+
const statement = procedure.statements[index];
|
|
112634
|
+
if (statement.findFirstExpression(Expressions.TargetFieldSymbol) !== undefined
|
|
112635
|
+
|| statement.findFirstExpression(Expressions.Dereference) !== undefined) {
|
|
112636
|
+
return true;
|
|
112637
|
+
}
|
|
112638
|
+
else if (procedure.isCallFree(statement)) {
|
|
112639
|
+
continue;
|
|
112640
|
+
}
|
|
112641
|
+
const type = statement.get();
|
|
112642
|
+
if (!CALLING.some(c => type instanceof c) || statement.findFirstExpression(Expressions.NewObject) !== undefined) {
|
|
112643
|
+
return true;
|
|
112644
|
+
}
|
|
112645
|
+
const tokens = procedure.tokensOf(statement);
|
|
112646
|
+
const methodSource = statement.findDirectExpression(Expressions.MethodSource);
|
|
112647
|
+
if (methodSource !== undefined && this.localReceiver(procedure, tokens, methodSource.getLastToken(), receivers) === false) {
|
|
112648
|
+
return true;
|
|
112649
|
+
}
|
|
112650
|
+
for (const call of statement.findAllExpressionsRecursive(Expressions.MethodCall)) {
|
|
112651
|
+
if (this.isBuiltinCall(procedure, call) === false
|
|
112652
|
+
&& this.localReceiver(procedure, tokens, call.getFirstToken(), receivers) === false) {
|
|
112653
|
+
return true;
|
|
112654
|
+
}
|
|
112655
|
+
}
|
|
112656
|
+
}
|
|
112657
|
+
return false;
|
|
112658
|
+
}
|
|
112659
|
+
/** the method name token is preceded by local->, a local reference variable that is not one of the receivers */
|
|
112660
|
+
localReceiver(procedure, tokens, name, receivers) {
|
|
112661
|
+
const index = tokens.findIndex(t => t.getStart().equals(name.getStart()));
|
|
112662
|
+
if (index < 2 || tokens[index - 1].getStr() !== "->") {
|
|
112663
|
+
return false;
|
|
112664
|
+
}
|
|
112665
|
+
const local = procedure.local(procedure.identifierAt(tokens[index - 2]));
|
|
112666
|
+
return local !== undefined && receivers.includes(local) === false;
|
|
111357
112667
|
}
|
|
111358
112668
|
}
|
|
111359
|
-
exports.
|
|
111360
|
-
//# sourceMappingURL=
|
|
112669
|
+
exports.SuspiciousLoop = SuspiciousLoop;
|
|
112670
|
+
//# sourceMappingURL=suspicious_loop.js.map
|
|
111361
112671
|
|
|
111362
112672
|
/***/ },
|
|
111363
112673
|
|
|
@@ -112558,6 +113868,294 @@ exports.UncaughtException = UncaughtException;
|
|
|
112558
113868
|
|
|
112559
113869
|
/***/ },
|
|
112560
113870
|
|
|
113871
|
+
/***/ "../core/build/src/rules/unhandled_classic_exception.js"
|
|
113872
|
+
/*!**************************************************************!*\
|
|
113873
|
+
!*** ../core/build/src/rules/unhandled_classic_exception.js ***!
|
|
113874
|
+
\**************************************************************/
|
|
113875
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
113876
|
+
|
|
113877
|
+
"use strict";
|
|
113878
|
+
|
|
113879
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
113880
|
+
if (k2 === undefined) k2 = k;
|
|
113881
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
113882
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
113883
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
113884
|
+
}
|
|
113885
|
+
Object.defineProperty(o, k2, desc);
|
|
113886
|
+
}) : (function(o, m, k, k2) {
|
|
113887
|
+
if (k2 === undefined) k2 = k;
|
|
113888
|
+
o[k2] = m[k];
|
|
113889
|
+
}));
|
|
113890
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
113891
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
113892
|
+
}) : function(o, v) {
|
|
113893
|
+
o["default"] = v;
|
|
113894
|
+
});
|
|
113895
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
113896
|
+
var ownKeys = function(o) {
|
|
113897
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
113898
|
+
var ar = [];
|
|
113899
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
113900
|
+
return ar;
|
|
113901
|
+
};
|
|
113902
|
+
return ownKeys(o);
|
|
113903
|
+
};
|
|
113904
|
+
return function (mod) {
|
|
113905
|
+
if (mod && mod.__esModule) return mod;
|
|
113906
|
+
var result = {};
|
|
113907
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
113908
|
+
__setModuleDefault(result, mod);
|
|
113909
|
+
return result;
|
|
113910
|
+
};
|
|
113911
|
+
})();
|
|
113912
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
113913
|
+
exports.UnhandledClassicException = exports.UnhandledClassicExceptionConf = void 0;
|
|
113914
|
+
const Statements = __importStar(__webpack_require__(/*! ../abap/2_statements/statements */ "../core/build/src/abap/2_statements/statements/index.js"));
|
|
113915
|
+
const Expressions = __importStar(__webpack_require__(/*! ../abap/2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
|
|
113916
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
|
|
113917
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "../core/build/src/rules/_abap_rule.js");
|
|
113918
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
|
|
113919
|
+
const severity_1 = __webpack_require__(/*! ../severity */ "../core/build/src/severity.js");
|
|
113920
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
|
|
113921
|
+
const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "../core/build/src/abap/5_syntax/syntax.js");
|
|
113922
|
+
const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "../core/build/src/abap/5_syntax/_reference.js");
|
|
113923
|
+
const types_1 = __webpack_require__(/*! ../abap/types */ "../core/build/src/abap/types/index.js");
|
|
113924
|
+
const virtual_position_1 = __webpack_require__(/*! ../virtual_position */ "../core/build/src/virtual_position.js");
|
|
113925
|
+
class UnhandledClassicExceptionConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
113926
|
+
constructor() {
|
|
113927
|
+
super(...arguments);
|
|
113928
|
+
this.severity = severity_1.Severity.Warning;
|
|
113929
|
+
/** Report an EXCEPTIONS list without OTHERS, unless the method or function module is known and all its exceptions are listed */
|
|
113930
|
+
this.missingOthers = true;
|
|
113931
|
+
/** Report a call without EXCEPTIONS, including a functional call, of a method or function module that declares classic exceptions */
|
|
113932
|
+
this.missingExceptions = true;
|
|
113933
|
+
/** missingExceptions: do not report a method call whose arguments are all literals or me, like describe_by_name( 'T100' ) */
|
|
113934
|
+
this.allowLiteralArguments = true;
|
|
113935
|
+
}
|
|
113936
|
+
}
|
|
113937
|
+
exports.UnhandledClassicExceptionConf = UnhandledClassicExceptionConf;
|
|
113938
|
+
class UnhandledClassicException extends _abap_rule_1.ABAPRule {
|
|
113939
|
+
constructor() {
|
|
113940
|
+
super(...arguments);
|
|
113941
|
+
this.conf = new UnhandledClassicExceptionConf();
|
|
113942
|
+
}
|
|
113943
|
+
getMetadata() {
|
|
113944
|
+
return {
|
|
113945
|
+
key: "unhandled_classic_exception",
|
|
113946
|
+
title: "Unhandled classic exception",
|
|
113947
|
+
shortDescription: `Finds calls that do not map every classic exception the callee can raise`,
|
|
113948
|
+
extendedInformation: `A classic exception that is raised with RAISE and not mapped in the EXCEPTIONS addition of the call
|
|
113949
|
+
ends in the runtime error RAISE_EXCEPTION. TRY ... CATCH cx_root does not catch it.
|
|
113950
|
+
|
|
113951
|
+
missingOthers: reports CALL FUNCTION and method calls with an EXCEPTIONS list without OTHERS.
|
|
113952
|
+
Not reported if the function module or method is known and every exception it declares is listed,
|
|
113953
|
+
for CALL FUNCTION ... DESTINATION this includes SYSTEM_FAILURE and COMMUNICATION_FAILURE.
|
|
113954
|
+
CALL FUNCTION ... STARTING NEW TASK, IN UPDATE TASK and IN BACKGROUND are not checked.
|
|
113955
|
+
|
|
113956
|
+
missingExceptions: reports calls without EXCEPTIONS of a method or function module that declares classic exceptions,
|
|
113957
|
+
this includes functional calls, which cannot have EXCEPTIONS.
|
|
113958
|
+
With allowLiteralArguments, a method call whose arguments are all literals or me is not reported.
|
|
113959
|
+
|
|
113960
|
+
Signatures are taken from the registry, including dependencies. Methods and function modules that are not
|
|
113961
|
+
found (void) are only checked by missingOthers.
|
|
113962
|
+
|
|
113963
|
+
Does not report any issues if the code contains syntax errors`,
|
|
113964
|
+
tags: [_irule_1.RuleTag.Syntax],
|
|
113965
|
+
badExample: `CALL FUNCTION 'Z_READ'
|
|
113966
|
+
EXCEPTIONS
|
|
113967
|
+
not_found = 1.
|
|
113968
|
+
|
|
113969
|
+
lo_type = cl_abap_typedescr=>describe_by_name( lv_name ).`,
|
|
113970
|
+
goodExample: `CALL FUNCTION 'Z_READ'
|
|
113971
|
+
EXCEPTIONS
|
|
113972
|
+
not_found = 1
|
|
113973
|
+
OTHERS = 2.
|
|
113974
|
+
|
|
113975
|
+
cl_abap_typedescr=>describe_by_name(
|
|
113976
|
+
EXPORTING
|
|
113977
|
+
p_name = lv_name
|
|
113978
|
+
RECEIVING
|
|
113979
|
+
p_descr_ref = lo_type
|
|
113980
|
+
EXCEPTIONS
|
|
113981
|
+
type_not_found = 1
|
|
113982
|
+
OTHERS = 2 ).`,
|
|
113983
|
+
};
|
|
113984
|
+
}
|
|
113985
|
+
initialize(reg) {
|
|
113986
|
+
super.initialize(reg);
|
|
113987
|
+
this.functionModules = undefined;
|
|
113988
|
+
return this;
|
|
113989
|
+
}
|
|
113990
|
+
getConfig() {
|
|
113991
|
+
return this.conf;
|
|
113992
|
+
}
|
|
113993
|
+
setConfig(conf) {
|
|
113994
|
+
this.conf = conf;
|
|
113995
|
+
}
|
|
113996
|
+
runParsed(file, obj) {
|
|
113997
|
+
var _a;
|
|
113998
|
+
if (obj.getType() === "INTF" || file.getStructure() === undefined) {
|
|
113999
|
+
return [];
|
|
114000
|
+
}
|
|
114001
|
+
const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();
|
|
114002
|
+
if (syntax.issues.length > 0) {
|
|
114003
|
+
return [];
|
|
114004
|
+
}
|
|
114005
|
+
const methods = new Map();
|
|
114006
|
+
this.findMethodReferences(syntax.spaghetti.getTop(), file.getFilename(), methods);
|
|
114007
|
+
const issues = [];
|
|
114008
|
+
for (const statement of file.getStatements()) {
|
|
114009
|
+
if (statement.get() instanceof Statements.CallFunction) {
|
|
114010
|
+
issues.push(...this.checkCallFunction(statement, file));
|
|
114011
|
+
continue;
|
|
114012
|
+
}
|
|
114013
|
+
if (statement.get() instanceof Statements.Call) {
|
|
114014
|
+
const source = statement.findDirectExpression(Expressions.MethodSource);
|
|
114015
|
+
const body = statement.findDirectExpression(Expressions.MethodCallBody);
|
|
114016
|
+
const nameNode = source === null || source === void 0 ? void 0 : source.getLastChild();
|
|
114017
|
+
if (nameNode) {
|
|
114018
|
+
const token = nameNode.getFirstToken();
|
|
114019
|
+
const callee = nameNode.get() instanceof Expressions.Dynamic ? undefined : this.findMethod(methods, token);
|
|
114020
|
+
const issue = this.checkCall(file, token, callee, body === null || body === void 0 ? void 0 : body.findDirectExpression(Expressions.MethodParameters), (body === null || body === void 0 ? void 0 : body.findDirectTokenByText("EXCEPTION-TABLE")) !== undefined, false, this.onlyLiterals(body));
|
|
114021
|
+
if (issue) {
|
|
114022
|
+
issues.push(issue);
|
|
114023
|
+
}
|
|
114024
|
+
}
|
|
114025
|
+
}
|
|
114026
|
+
for (const call of statement.findAllExpressionsRecursive(Expressions.MethodCall)) {
|
|
114027
|
+
const token = (_a = call.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
114028
|
+
if (token === undefined) {
|
|
114029
|
+
continue;
|
|
114030
|
+
}
|
|
114031
|
+
const param = call.findDirectExpression(Expressions.MethodCallParam);
|
|
114032
|
+
const parameters = param === null || param === void 0 ? void 0 : param.findDirectExpression(Expressions.MethodParameters);
|
|
114033
|
+
const issue = this.checkCall(file, token, this.findMethod(methods, token), parameters, false, false, this.onlyLiterals(param));
|
|
114034
|
+
if (issue) {
|
|
114035
|
+
issues.push(issue);
|
|
114036
|
+
}
|
|
114037
|
+
}
|
|
114038
|
+
}
|
|
114039
|
+
return issues;
|
|
114040
|
+
}
|
|
114041
|
+
checkCallFunction(statement, file) {
|
|
114042
|
+
if (statement.findDirectTokenByText("STARTING")
|
|
114043
|
+
|| statement.findDirectTokenByText("UPDATE")
|
|
114044
|
+
|| statement.findDirectTokenByText("BACKGROUND")) {
|
|
114045
|
+
return [];
|
|
114046
|
+
}
|
|
114047
|
+
const nameNode = statement.findDirectExpression(Expressions.FunctionName);
|
|
114048
|
+
if (nameNode === undefined) {
|
|
114049
|
+
return [];
|
|
114050
|
+
}
|
|
114051
|
+
let callee = undefined;
|
|
114052
|
+
if (nameNode.findFirstExpression(Expressions.FieldChain) === undefined) {
|
|
114053
|
+
const name = nameNode.concatTokens().replace(/'/g, "").replace(/`/g, "");
|
|
114054
|
+
const module = this.findFunctionModule(name);
|
|
114055
|
+
if (module) {
|
|
114056
|
+
callee = {
|
|
114057
|
+
name: module.getName(),
|
|
114058
|
+
exceptions: module.isClassBasedExceptions() ? [] : module.getExceptions().map(e => e.toUpperCase()),
|
|
114059
|
+
};
|
|
114060
|
+
}
|
|
114061
|
+
}
|
|
114062
|
+
const issue = this.checkCall(file, nameNode.getFirstToken(), callee, statement.findDirectExpression(Expressions.FunctionParameters), statement.findDirectTokenByText("EXCEPTION-TABLE") !== undefined, statement.findDirectExpression(Expressions.Destination) !== undefined, false);
|
|
114063
|
+
return issue ? [issue] : [];
|
|
114064
|
+
}
|
|
114065
|
+
checkCall(file, token, callee, parameters, exceptionTable, destination, onlyLiterals) {
|
|
114066
|
+
if (exceptionTable === true) {
|
|
114067
|
+
return undefined;
|
|
114068
|
+
}
|
|
114069
|
+
const list = parameters === null || parameters === void 0 ? void 0 : parameters.findDirectExpression(Expressions.ParameterListExceptions);
|
|
114070
|
+
if (list === undefined) {
|
|
114071
|
+
if (this.conf.missingExceptions === false
|
|
114072
|
+
|| callee === undefined
|
|
114073
|
+
|| callee.exceptions.length === 0
|
|
114074
|
+
|| (this.conf.allowLiteralArguments === true && onlyLiterals === true)) {
|
|
114075
|
+
return undefined;
|
|
114076
|
+
}
|
|
114077
|
+
const message = `Classic exceptions of "${callee.name}" not handled: ${callee.exceptions.join(", ")}, call it with EXCEPTIONS`;
|
|
114078
|
+
return issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);
|
|
114079
|
+
}
|
|
114080
|
+
if (this.conf.missingOthers === false) {
|
|
114081
|
+
return undefined;
|
|
114082
|
+
}
|
|
114083
|
+
const listed = list.findDirectExpressions(Expressions.ParameterException)
|
|
114084
|
+
.map(e => e.getFirstChild().concatTokens().toUpperCase());
|
|
114085
|
+
if (listed.includes("OTHERS")) {
|
|
114086
|
+
return undefined;
|
|
114087
|
+
}
|
|
114088
|
+
const position = parameters.findDirectTokenByText("EXCEPTIONS") || list.getFirstToken();
|
|
114089
|
+
if (callee === undefined) {
|
|
114090
|
+
const message = "EXCEPTIONS without OTHERS, an exception that is not listed ends in a runtime error";
|
|
114091
|
+
return issue_1.Issue.atToken(file, position, message, this.getMetadata().key, this.conf.severity);
|
|
114092
|
+
}
|
|
114093
|
+
const expected = [...callee.exceptions];
|
|
114094
|
+
if (destination === true) {
|
|
114095
|
+
expected.push("SYSTEM_FAILURE", "COMMUNICATION_FAILURE");
|
|
114096
|
+
}
|
|
114097
|
+
const missing = expected.filter(e => listed.includes(e) === false);
|
|
114098
|
+
if (missing.length === 0) {
|
|
114099
|
+
return undefined;
|
|
114100
|
+
}
|
|
114101
|
+
const message = `EXCEPTIONS without OTHERS, not mapped: ${missing.join(", ")}`;
|
|
114102
|
+
return issue_1.Issue.atToken(file, position, message, this.getMetadata().key, this.conf.severity);
|
|
114103
|
+
}
|
|
114104
|
+
/** true if the call has arguments and all of them are literals or me, like describe_by_name( 'T100' ) */
|
|
114105
|
+
onlyLiterals(node) {
|
|
114106
|
+
if (node === undefined || node.findFirstExpression(Expressions.MethodCall) !== undefined) {
|
|
114107
|
+
return false;
|
|
114108
|
+
}
|
|
114109
|
+
const sources = node.findAllExpressions(Expressions.Source);
|
|
114110
|
+
return sources.length > 0
|
|
114111
|
+
&& sources.every(s => { var _a; return (s.getChildren().length === 1 && ((_a = s.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Constant)
|
|
114112
|
+
|| s.concatTokens().toUpperCase() === "ME"; });
|
|
114113
|
+
}
|
|
114114
|
+
findMethod(methods, token) {
|
|
114115
|
+
const method = methods.get(UnhandledClassicException.positionKey(token.getStart()));
|
|
114116
|
+
if (method === undefined) {
|
|
114117
|
+
return undefined;
|
|
114118
|
+
}
|
|
114119
|
+
return {
|
|
114120
|
+
name: method.getName(),
|
|
114121
|
+
exceptions: method.getExceptions().map(e => e.toUpperCase()),
|
|
114122
|
+
};
|
|
114123
|
+
}
|
|
114124
|
+
findMethodReferences(node, filename, found) {
|
|
114125
|
+
for (const r of node.getData().references) {
|
|
114126
|
+
if (r.referenceType === _reference_1.ReferenceType.MethodReference
|
|
114127
|
+
&& r.position.getFilename() === filename
|
|
114128
|
+
&& r.resolved instanceof types_1.MethodDefinition) {
|
|
114129
|
+
found.set(UnhandledClassicException.positionKey(r.position.getStart()), r.resolved);
|
|
114130
|
+
}
|
|
114131
|
+
}
|
|
114132
|
+
for (const child of node.getChildren()) {
|
|
114133
|
+
this.findMethodReferences(child, filename, found);
|
|
114134
|
+
}
|
|
114135
|
+
}
|
|
114136
|
+
findFunctionModule(name) {
|
|
114137
|
+
if (this.functionModules === undefined) {
|
|
114138
|
+
this.functionModules = new Map();
|
|
114139
|
+
for (const fugr of this.reg.getObjectsByType("FUGR")) {
|
|
114140
|
+
for (const module of fugr.getModules()) {
|
|
114141
|
+
this.functionModules.set(module.getName().toUpperCase(), module);
|
|
114142
|
+
}
|
|
114143
|
+
}
|
|
114144
|
+
}
|
|
114145
|
+
return this.functionModules.get(name.toUpperCase());
|
|
114146
|
+
}
|
|
114147
|
+
static positionKey(p) {
|
|
114148
|
+
if (p instanceof virtual_position_1.VirtualPosition) {
|
|
114149
|
+
return p.getRow() + ":" + p.getCol() + ":" + p.vrow + ":" + p.vcol;
|
|
114150
|
+
}
|
|
114151
|
+
return p.getRow() + ":" + p.getCol();
|
|
114152
|
+
}
|
|
114153
|
+
}
|
|
114154
|
+
exports.UnhandledClassicException = UnhandledClassicException;
|
|
114155
|
+
//# sourceMappingURL=unhandled_classic_exception.js.map
|
|
114156
|
+
|
|
114157
|
+
/***/ },
|
|
114158
|
+
|
|
112561
114159
|
/***/ "../core/build/src/rules/unit_test_assertions.js"
|
|
112562
114160
|
/*!*******************************************************!*\
|
|
112563
114161
|
!*** ../core/build/src/rules/unit_test_assertions.js ***!
|
|
@@ -123465,7 +125063,7 @@ module.exports = require("zlib");
|
|
|
123465
125063
|
|
|
123466
125064
|
"use strict";
|
|
123467
125065
|
var C=(r,t)=>()=>{try{return t||r((t={exports:{}}).exports,t),t.exports}catch(e){throw t=0,e}};var ms=C(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.range=tt.balanced=void 0;var Ei=(r,t,e)=>{let s=r instanceof RegExp?ps(r,e):r,i=t instanceof RegExp?ps(t,e):t,n=s!==null&&i!=null&&(0,tt.range)(s,i,e);return n&&{start:n[0],end:n[1],pre:e.slice(0,n[0]),body:e.slice(n[0]+s.length,n[1]),post:e.slice(n[1]+i.length)}};tt.balanced=Ei;var ps=(r,t)=>{let e=t.match(r);return e?e[0]:null},Oi=(r,t,e)=>{let s,i,n,o,h,a=e.indexOf(r),l=e.indexOf(t,a+1),c=a;if(a>=0&&l>0){if(r===t)return[a,l];for(s=[],n=e.length;c>=0&&!h;){if(c===a)s.push(c),a=e.indexOf(r,c+1);else if(s.length===1){let u=s.pop();u!==void 0&&(h=[u,l])}else i=s.pop(),i!==void 0&&i<n&&(n=i,o=l),l=e.indexOf(t,c+1);c=a<l&&a>=0?a:l}s.length&&o!==void 0&&(h=[n,o])}return h};tt.range=Oi});var vs=C(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.EXPANSION_MAX_REWRITES=T.EXPANSION_MAX_DEPTH=T.EXPANSION_MAX_LENGTH=T.EXPANSION_MAX=void 0;T.expand=Wi;var gs=ms(),ws="\0SLASH"+Math.random()+"\0",bs="\0OPEN"+Math.random()+"\0",xe="\0CLOSE"+Math.random()+"\0",ys="\0COMMA"+Math.random()+"\0",Ss="\0PERIOD"+Math.random()+"\0",xi=new RegExp(ws,"g"),Ci=new RegExp(bs,"g"),Mi=new RegExp(xe,"g"),ki=new RegExp(ys,"g"),Ai=new RegExp(Ss,"g"),Ri=/\\\\/g,Pi=/\\{/g,Ti=/\\}/g,Fi=/\\,/g,ji=/\\\./g;T.EXPANSION_MAX=1e5;T.EXPANSION_MAX_LENGTH=4e6;T.EXPANSION_MAX_DEPTH=1e3;T.EXPANSION_MAX_REWRITES=1e3;function _e(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}function Ni(r){return r.replace(Ri,ws).replace(Pi,bs).replace(Ti,xe).replace(Fi,ys).replace(ji,Ss)}function Di(r){return r.replace(xi,"\\").replace(Ci,"{").replace(Mi,"}").replace(ki,",").replace(Ai,".")}function Ee(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}function Li(r){let t=[],e="";for(;;){let s=(0,gs.balanced)("{","}",r);if(!s){let a=r.split(",");return a[0]=e+a[0],Ee(t,a),t}let{pre:i,body:n,post:o}=s,h=i.split(",");if(h[0]=e+h[0],h[h.length-1]+="{"+n+"}",!o.length)return Ee(t,h),t;e=h.pop(),Ee(t,h),r=o}}function Wi(r,t={}){if(!r)return[];let{max:e=T.EXPANSION_MAX,maxLength:s=T.EXPANSION_MAX_LENGTH,maxDepth:i=T.EXPANSION_MAX_DEPTH,maxRewrites:n=T.EXPANSION_MAX_REWRITES}=t;return r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),Oe(Ni(r),e,s,i,0,n,!0).map(Di)}function zi(r){return"{"+r+"}"}function Bi(r){return/^-?0\d/.test(r)}function Gi(r,t){return r<=t}function Ii(r,t){return r>=t}function ct(r,t,e,s,i,n){let o=[],h=0;for(let a=0;a<r.length;a++)for(let l=0;l<e.length;l++){if(o.length>=s)return o;let c=r[a]+t+e[l];if(!(n&&!c)){if(h+c.length>i)return o;o.push(c),h+=c.length}}return o}function $i(r,t,e,s){let i=r.split(/\.\./),n=[];if(i[0]===void 0||i[1]===void 0)return n;let o=_e(i[0]),h=_e(i[1]),a=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(_e(i[2])),1):1,c=Gi;h<o&&(l*=-1,c=Ii);let f=i.some(Bi),p=0;for(let g=o;c(g,h)&&n.length<e;g+=l){let d;if(t)d=String.fromCharCode(g),d==="\\"&&(d="");else if(d=String(g),f){let b=a-d.length;if(b>0){let m=new Array(b+1).join("0");g<0?d="-"+m+d.slice(1):d=m+d}}if(p+d.length>s)break;n.push(d),p+=d.length}return n}function Oe(r,t,e,s,i,n,o){if(i>s)return[r];let h=[""],a=0,l=!1,c=!0;for(;;){let u=(0,gs.balanced)("{","}",r);if(!u)return ct(h,r,[""],t,e,l);let f=u.pre;if(/\$$/.test(f)){if(h=ct(h,f+"{"+u.body+"}",[""],t,e,l&&!u.post.length),c=!1,!u.post.length)break;r=u.post;continue}let p=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(u.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(u.body),d=p||g,b=u.body.indexOf(",")>=0;if(!d&&!b){if(a<n&&u.post.match(/,(?!,).*\}/)){a++,r=u.pre+"{"+u.body+xe+u.post,o=!0;continue}return ct(h,f+"{"+u.body+"}"+u.post,[""],t,e,l)}c&&(l=o&&!d,c=!1);let m;if(d)m=$i(u.body,g,t,e);else{let y=Li(u.body);if(y.length===1&&y[0]!==void 0&&(y=Oe(y[0],t,e,s,i+1,n,!1).map(zi),y.length===1)){if(h=ct(h,f+y[0],[""],t,e,l&&!u.post.length),!u.post.length)break;r=u.post;continue}let _=l&&!u.post.length&&!f;for(let S=0;_&&S<h.length;S++)h[S]&&(_=!1);m=[];let v=0;t:for(let S=0;S<y.length;S++){let K=Oe(y[S],t,e,s,i+1,n,!1);for(let B=0;B<K.length;B++){let U=K[B];if(!(_&&!U)){if(m.length>=t||v+U.length>e)break t;m.push(U),v+=U.length}}}}if(h=ct(h,f,m,t,e,l&&!u.post.length),!u.post.length)break;r=u.post}return h}});var Es=C(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.numericRange=void 0;var Me=(r,t)=>r===t?{t:"lit",ch:String(r)}:{t:"class",re:new RegExp(`^[${r}-${t}]$`)},Ce=(r,t)=>t.map(e=>[Me(r,r),...e]),ut=(r,t)=>{if(!r)return[[]];let e=+r[0],s=+t[0],i=r.slice(1),n=t.slice(1);if(e===s)return Ce(e,ut(i,n));let o="0".repeat(i.length),h="9".repeat(i.length),a=[];i!==o&&a.push(...Ce(e++,ut(i,h)));let l=n===h?[]:Ce(s--,ut(o,n));return e<=s&&a.push([Me(e,s),...Array.from(i,()=>Me(0,9))]),a.push(...l),a},_s=(r,t,e)=>{if(e)return ut(String(r).padStart(e,"0"),String(t).padStart(e,"0"));let s=[];for(let i=String(r).length;i<=String(t).length;i++){let n=Math.max(r,i===1?0:10**(i-1)),o=Math.min(t,10**i-1);s.push(...ut(String(n),String(o)))}return s},Ui=(r,t)=>{let e=Number(r),s=Number(t);if(!Number.isSafeInteger(e)||!Number.isSafeInteger(s))return;e>s&&([e,s]=[s,e]);let n=/^-?0\d/.test(r)||/^-?0\d/.test(t)?Math.max(r.length,t.length):0,o=[];if(e<0){let h=_s(Math.max(-s,1),-e,n&&n-1);o.push(...h.map(a=>[{t:"lit",ch:"-"},...a]))}return s>=0&&o.push(..._s(Math.max(e,0),s,n)),o};jt.numericRange=Ui});var Os=C(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.parseClass=void 0;var qi={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}"],"[:alpha:]":["\\p{L}\\p{Nl}"],"[:ascii:]":["\\x00-\\x7f"],"[:blank:]":["\\p{Zs}\\t"],"[:cntrl:]":["\\p{Cc}"],"[:digit:]":["\\p{Nd}"],"[:graph:]":["\\p{Z}\\p{C}",!0],"[:lower:]":["\\p{Ll}"],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}\\p{S}"],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f"],"[:upper:]":["\\p{Lu}"],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}"],"[:xdigit:]":["A-Fa-f0-9"]},ft=r=>r.replace(/[[\]\\-]/g,"\\$&"),ke=/$./,Hi=(r,t,e=!1,s)=>{let i=m=>{let y=s?m.normalize(s):m;return[...y].length===1?y:m},n=t;if(r.charAt(n)!=="[")throw new Error("not in a brace expression");let o=[],h=[],a=n+1,l=!1,c=!1,u=!1,f=n,p="";t:for(;a<r.length;){let m=String.fromCodePoint(r.codePointAt(a));if((m==="!"||m==="^")&&a===n+1){u=!0,a++;continue}if(m==="]"&&l&&!c){f=a+1;break}if(l=!0,m==="\\"&&!c){c=!0,a++;continue}if(m==="["&&!c){for(let[_,[v,S]]of Object.entries(qi))if(r.startsWith(_,a)){if(p)return[ke,r.length-n];a+=_.length,S?h.push(v):o.push(v);continue t}}c=!1;let y=i(m);if(p){y.codePointAt(0)>p.codePointAt(0)?o.push(ft(p)+"-"+ft(y)):y===p&&o.push(ft(y)),p="",a+=m.length;continue}if(r.startsWith("-]",a+m.length)){o.push(ft(y+"-")),a+=m.length+1;continue}if(r.startsWith("-",a+m.length)){p=y,a+=m.length+1;continue}o.push(ft(y)),a+=m.length}if(f<a)return[ke,0];if(!o.length&&!h.length)return[ke,r.length-n];let g="["+(u?"^":"")+o.join("")+"]",d="["+(u?"":"^")+h.join("")+"]",b="^"+(o.length&&h.length?"("+g+"|"+d+")":o.length?g:d);return[new RegExp(b,e?"iu":"u"),f-n]};Nt.parseClass=Hi});var Ns=C(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.Matcher=void 0;var Xi=Es(),Ki=Os(),Ae={t:"match",id:0},Vi="!?+*@",et=r=>({t:"lit",ch:r}),Yi=r=>r.replace(/[\\^$.*+?()[\]{}|/]/g,"\\$&"),ks=r=>new RegExp(`^${Yi(r)}$`,"iu"),Dt=new Map,As=r=>{let t=Dt.get(r);return t||(t=ks(r),Dt.size>=1e3&&Dt.clear(),Dt.set(r,t)),t},Fe=(r,t)=>{if(t===r.ch)return!0;if(!r.re)return!1;let e=t.charCodeAt(0);if(e>=128)return r.re.test(t);let s=r.ascii??=new Uint8Array(128);return s[e]||=r.re.test(t)?1:2,s[e]===1},Ji=(r,t,e,s,i)=>{let n=[];for(let o=0;o<r.length;){let h=String.fromCodePoint(r.codePointAt(o));if(i){let a=h==="\\"&&r.startsWith(i,o+1)?1:0;if(a||h===i){let l=o+a+i.length,c=r.indexOf(i,l),u=/^(-?\d+)\.\.(-?\d+)$/.exec(r.slice(l,c)),f=c!==-1&&u&&(0,Xi.numericRange)(u[1],u[2]);if(f){n.push({t:"ext",type:"@",alts:f}),o=c+i.length;continue}}}if(h==="\\"){let a=r.codePointAt(o+1),l=a===void 0?h:String.fromCodePoint(a);n.push(et(l)),o+=1+l.length;continue}if(h==="["){let[a,l]=(0,Ki.parseClass)(r,o,t,s);if(l){n.push({t:"class",re:a}),o+=l;continue}}if(!e&&Vi.includes(h)&&r[o+1]==="("){n.push({t:"open",type:h}),o+=2;continue}n.push(!e&&h==="|"?{t:"bar"}:!e&&h===")"?{t:"close"}:h==="*"?{t:"star"}:h==="?"?{t:"any"}:et(h)),o+=h.length}return n},Zi=r=>{let t=new Map,e=[];return r.forEach((s,i)=>{s.t==="open"?e.push(i):s.t==="close"&&e.length&&t.set(e.pop(),i)}),t},Rs=(r,t,e,s,i)=>{let n=[],o=[n];for(let h=e;h<s;h++){let a=r[h],l=t.get(h);if(a.t==="open"&&l!==void 0){let c=Rs(r,t,h+1,l,!1);n.push({t:"ext",type:a.type,alts:c}),h=l}else a.t==="bar"&&!i?o.push(n=[]):a.t==="open"?n.push(et(a.type),et("(")):a.t==="bar"?n.push(et("|")):a.t==="close"?n.push(et(")")):n.push(a)}return o},Ps=(r,t)=>{let e=[],s="",i=()=>{for(let n of s.normalize(t))e.push(et(n));s=""};for(let n of r){if(n.t==="lit"){s+=n.ch;continue}i(),e.push(n.t==="ext"?{...n,alts:n.alts.map(o=>Ps(o,t))}:n)}return i(),e},Qi=(r,t)=>{let e=1,s=h=>({t:"split",id:e++,out:h}),i=(h,a)=>h.reduceRight((l,c)=>n(c,l),a),n=(h,a)=>{switch(h.t){case"lit":let f=t?As(h.ch):void 0;return{t:"lit",id:e++,ch:h.ch,re:f,next:a};case"any":case"star":return{t:h.t,id:e++,next:a};case"class":return{t:"class",id:e++,re:h.re,next:a}}let l=f=>h.alts.map(p=>i(p,f));switch(h.type){case"@":return s(l(a));case"?":return s([a,...l(a)]);case"!":return{t:"neg",id:e++,sub:s(l(Ae)),next:a}}let c=s([]),u=s(l(c));return c.out.push(a,u),h.type==="*"?c:u};return[i(r,Ae),e]},tn=r=>{let t=[],e=new Set,s=n=>n.t==="match"?"match":String(n.id),i=(n,o)=>{if(n.t==="match"||e.has(n))return;e.add(n);let h=a=>t.push(`${o}${n.id}: ${a}`);switch(n.t){case"split":h(`split -> ${n.out.map(s).join(", ")}`);for(let a of n.out)i(a,o);return;case"neg":return h(`!(${s(n.sub)}) -> ${s(n.next)}`),i(n.sub,o+" "),i(n.next,o);case"lit":h(`${JSON.stringify(n.ch)} -> ${s(n.next)}`);break;case"class":h(`${n.re} -> ${s(n.next)}`);break;default:h(`${n.t==="any"?"?":"*"} -> ${s(n.next)}`)}i(n.next,o)};return i(r,""),[`start -> ${s(r)}`,...t].join(`
|
|
123468
|
-
`)},Re=class{gen;threads=[];match=!1;runs=[];ids=[];constructor(t){this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},Ts=(r,t)=>r.ids.length!==t.ids.length||r.runs.length!==t.runs.length||r.ids.some((e,s)=>e!==t.ids[s])?!1:r.runs.every(e=>t.runs.some(s=>s.neg===e.neg&&Ts(s.state,e.state))),xs=r=>({has:new Float64Array(r),seen:new Float64Array(r),gen:0}),dt=class{dots;dotStart;#t;constructor(t,e,s){this.dots=t,this.dotStart=e,this.#t=s}state(){return new Re(++this.#t.gen)}done(t){return t.ids=t.threads.map(e=>e.id).sort((e,s)=>e-s),t.match&&t.ids.unshift(Ae.id),t}#n(t,e){let{seen:s}=this.#t;return s[e.id]===t.gen?!1:(s[e.id]=t.gen,!0)}#i(t,e){let{has:s}=this.#t;return s[e.id]===t.gen?!1:(s[e.id]=t.gen,t.threads.push(e),!0)}restricted(t,e){return e&&(this.dots||this.dotStart&&t===0)}add(t,e,s,i){switch(e.t){case"split":if(!this.#n(t,e))return;for(let o of e.out)this.add(t,o,s,i);return;case"neg":if(!this.#n(t,e))return;let n=this.state();return this.add(n,e.sub,s,!1),this.done(n),this.addRun(t,{t:"run",neg:e,state:n},s,i);case"star":if(this.restricted(s,i))return;this.#i(t,e)&&this.add(t,e.next,s,i);return;case"match":t.match=!0;return;default:this.#i(t,e)}}addRun(t,e,s,i){for(let n of t.runs)if(n.neg===e.neg&&Ts(n.state,e.state))return;t.runs.push(e),e.state.match||this.add(t,e.neg.next,s,i)}step(t,e,s,i){let n=this.state();for(let o of t.threads)switch(o.t){case"lit":Fe(o,e)&&this.add(n,o.next,s+1,i);break;case"any":this.restricted(s,i)||this.add(n,o.next,s+1,i);break;case"class":!this.restricted(s,i)&&o.re.test(e)&&this.add(n,o.next,s+1,i);break;case"star":this.restricted(s,i)||this.add(n,o,s+1,i)}if(!this.restricted(s,i))for(let o of t.runs){if(o.state.dead){this.addRun(n,o,s+1,i);continue}let h=this.step(o.state,e,s,!1);this.addRun(n,{t:"run",neg:o.neg,state:h},s+1,i)}return this.done(n)}},Fs=r=>{let t=r.ids.join();if(!r.runs.length)return t;let e=r.runs.map(s=>`${s.neg.id}(${Fs(s.state)})`);return`${t}|${e.sort().join("|")}`},en=1<<18,Pe=class{#t;#n=new Map;#i=0;#o;#r;#d;#f;constructor(t,e){this.#t=t,this.#d=new dt(!1,!1,e),this.#f=new dt(!1,!0,e)}#u(t){return{state:t,match:t.match,dead:t.dead,next:new Map}}#h(t){let e=Fs(t),s=this.#n.get(e);if(s)return s;this.#i>en&&this.#m();let i=this.#u(t);return this.#n.set(e,i),this.#i+=e.length+1,i}#m(){this.#n.clear(),this.#i=0,this.#o=void 0,this.#r=void 0}start(t){if(t){if(this.#r)return this.#r;let s=this.#f.state();return this.#f.add(s,this.#t,0,!0),this.#r=this.#u(this.#f.done(s))}if(this.#o)return this.#o;let e=this.#d.state();return this.#d.add(e,this.#t,0,!0),this.#o=this.#h(this.#d.done(e))}next(t,e){let s=e.charCodeAt(0),i=s<128?void 0:t.next.get(e);if(i)return i;let n=t===this.#r?this.#h(this.#f.step(t.state,e,0,!0)):this.#h(this.#d.step(t.state,e,1,!0));return s<128?(t.ascii||(t.ascii=new Array(128),this.#i+=128),t.ascii[s]=n):t.next.set(e,n),this.#i++,n}},sn=r=>{let t=[];for(let e=r;e.t!=="match";e=e.next){if(e.t==="split"||e.t==="neg")return;t.push(e)}return t},nn=(r,t,e,s)=>{let i=0,n=e,o=-1,h=0;for(;n<s;){let a=r[i];if(a?.t==="star"){o=i++,h=n;continue}let l=t[n];if(a&&(a.t==="any"||a.t==="lit"&&Fe(a,l)||a.t==="class"&&a.re.test(l))){i++,n++;continue}if(o===-1)return!1;i=o+1,n=++h}for(;r[i]?.t==="star";)i++;return i===r.length},js=r=>{let t=0,e=0;for(let s of r){let[i,n]=rn(s);t+=i,e+=n}return[t,e]},rn=r=>{if(r.t==="star")return[0,1/0];if(r.t!=="ext")return[1,1];if(r.type==="!")return[0,1/0];let t=r.alts.map(js),e=Math.min(...t.map(n=>n[0])),s=Math.max(...t.map(n=>n[1])),i=s===0?0:1/0;return r.type==="@"?[e,s]:r.type==="?"?[0,s]:r.type==="*"?[0,i]:[e,i]},Cs=(r,t,e)=>{for(let s=0;s<r.length;s++)if(!Fe(r[s],t[e+s]))return!1;return!0},on=/[/\ud800-\udfff]/,hn=/[\ud800-\udfff]/,Lt=r=>hn.test(r)?[...r]:r,Ms=r=>{if(r.includes("/"))throw new Error("can only match a single path portion, got: "+r)},Te=class{pattern;options;#t;#n;#i;#o;#r;#d=!1;#f;#u;#h=!1;#m=0;#l=1/0;#a=[];#s=[];#b;#E;#y=!1;#g;#w;constructor(t,e={}){if(t.includes("/"))throw new Error("can only match a single path portion, got pattern: "+t);this.pattern=t,this.options=e;let{nocase:s=!1,noext:i=!1,normalize:n}=e;this.#w=n===!0?"NFC":n||void 0;let o=/^[?*+@]\(\)$/.test(t),h=Ji(t,s,i||o,this.#w,e.rangeMark),[a]=Rs(h,Zi(h),0,h.length,!0);this.#w&&(a=Ps(a,this.#w));let[l,c]=Qi(a,s);if(this.#t=l,this.#n=c,a.every(u=>u.t==="lit"))this.#r=a.map(u=>u.ch).join(""),this.#d=s;else{let u=g=>g.t!=="lit"?void 0:s?{ch:g.ch,re:As(g.ch)}:{ch:g.ch};for(let g of a){let d=u(g);if(!d)break;this.#a.push(d)}for(let g=a.length-1;g>=0;g--){let d=u(a[g]);if(!d)break;this.#s.unshift(d)}this.#y=!!(this.#a.length||this.#s.length),s||(this.#b=this.#a.map(g=>g.ch).join(""),this.#E=this.#s.map(g=>g.ch).join("")),this.#u=sn(this.#t)?.slice(this.#a.length,-this.#s.length||void 0),this.#h=!!this.#u?.every(g=>g.t==="star"||g.t==="any");let[f,p]=js(a);this.#m=f,this.#l=p}}test(t){return this.#w?(Ms(t),this.#p(t.normalize(this.#w))):on.test(t)?(Ms(t),this.#p(t,[...t])):this.#p(t,t)}testUnchecked(t){return this.#p(this.#w?t.normalize(this.#w):t)}#p(t,e){if(this.#r!==void 0)return this.#d?(this.#f??=ks(this.#r)).test(t):t===this.#r;let s=this.#m,i=this.#l;if(e===void 0){let c=t.length,u=c+1>>1;if(c<s||u>i)return!1;(u<s||c>i)&&(e=Lt(t))}if(e!==void 0&&(e.length<s||e.length>i))return!1;let n=this.#a.length;if(this.#y)if(this.#b!==void 0&&this.#E!==void 0){if(!t.startsWith(this.#b)||!t.endsWith(this.#E))return!1}else{e??=Lt(t);let c=e.length-this.#s.length;if(!Cs(this.#a,e,0)||!Cs(this.#s,e,c))return!1}let o=!this.options.dot&&t.startsWith(".");if(this.#u){if(t==="."||t===".."||o&&!n)return!1;if(this.#h)return!0;e??=Lt(t);let c=e.length-this.#s.length;return nn(this.#u,e,n,c)}if(e??=Lt(t),t==="."||t===".."){this.#i??=xs(this.#n);let c=this.#o??=new dt(!0,!1,this.#i),u=c.state();c.add(u,this.#t,0,!0);let f=c.done(u);for(let p=0;p<e.length;p++)f=c.step(f,e[p],p,!0);return f.match}this.#i??=xs(this.#n);let h=this.#g??=new Pe(this.#t,this.#i),a=h.start(o),l=e===t;for(let c=0;c<e.length;c++){if(a.dead)return!1;let u=l?t.charCodeAt(c):e[c].charCodeAt(0);a=a.ascii?.[u]??h.next(a,e[c])}return a.match}toString(){return tn(this.#t)}};Wt.Matcher=Te});var Ds=C(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.assertValidPattern=void 0;var an=1024*64,ln=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>an)throw new TypeError("pattern is too long")};zt.assertValidPattern=ln});var je=C(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.escape=void 0;var cn=(r,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):t?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");Bt.escape=cn});var Ne=C(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.unescape=void 0;var un=(r,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?r.replace(/\[([^/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?r.replace(/\[([^/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");Gt.unescape=un});var Y=C(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.unescape=w.escape=w.Minimatch=w.match=w.braceExpand=w.defaults=w.filter=w.GLOBSTAR=w.sep=w.minimatch=void 0;var fn=vs(),Ls=Ns(),Ut=Ds(),dn=je(),pn=Ne(),mn=(r,t,e={})=>((0,Ut.assertValidPattern)(t),!e.nocomment&&t.charAt(0)==="#"?!1:wn(t,e).match(r));w.minimatch=mn;var ot=new Map,gn=256,wn=(r,t)=>{let e=r+"\0"+JSON.stringify(t),s=ot.get(e);return s?ot.delete(e):(s=new ht(r,{...t}),ot.size>=gn&&ot.delete(ot.keys().next().value)),ot.set(e,s),s},$s=typeof process=="object"&&process?process.env?.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ws={win32:{sep:"\\"},posix:{sep:"/"}};w.sep=$s==="win32"?Ws.win32.sep:Ws.posix.sep;w.minimatch.sep=w.sep;w.GLOBSTAR=Symbol("globstar **");w.minimatch.GLOBSTAR=w.GLOBSTAR;var bn=(r,t={})=>e=>(0,w.minimatch)(e,r,t);w.filter=bn;w.minimatch.filter=w.filter;var q=(r,t={})=>Object.assign({},r,t),yn=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return w.minimatch;let t=w.minimatch;return Object.assign((s,i,n={})=>t(s,i,q(r,n)),{Minimatch:class extends t.Minimatch{constructor(i,n={}){super(i,q(r,n))}static defaults(i){return t.defaults(q(r,i)).Minimatch}},unescape:(s,i={})=>t.unescape(s,q(r,i)),escape:(s,i={})=>t.escape(s,q(r,i)),filter:(s,i={})=>t.filter(s,q(r,i)),defaults:s=>t.defaults(q(r,s)),braceExpand:(s,i={})=>t.braceExpand(s,q(r,i)),match:(s,i,n={})=>t.match(s,i,q(r,n)),sep:t.sep,GLOBSTAR:w.GLOBSTAR})};w.defaults=yn;w.minimatch.defaults=w.defaults;var Sn=(r,t={})=>((0,Ut.assertValidPattern)(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,fn.expand)(r,{max:t.braceExpandMax}));w.braceExpand=Sn;w.minimatch.braceExpand=w.braceExpand;var vn=100,_n=/(?<![\\$])\{(-?\d+)\.\.(-?\d+)\}/g,En=(r,t,e={})=>{let s=new ht(t,e);return r=r.filter(i=>s.match(i)),s.options.nonull&&!r.length&&r.push(t),r};w.match=En;w.minimatch.match=w.match;var zs=/[?*]|[+@!]\(.*?\)|\[|\]/,Us=(r,t)=>{let e=t+1;(r.charAt(e)==="!"||r.charAt(e)==="^")&&e++;let s=!1;for(;e<r.length;e++){let i=r.charAt(e);if(i==="]"&&s)return e;s=!0,i==="\\"&&e++}return-1},On=(r,t)=>{if(!t&&(r==="+()"||r==="@()"))return r;let e="";for(let s=0;s<r.length;s++){let i=r.charAt(s);if(i==="\\")e+=r.charAt(++s)||i;else{if(i==="*"||i==="?")return;if(i==="["){let n=Us(r,s);if(n===-1){e+=i;continue}let o=r.slice(s+1,n);if(o.startsWith("\\")&&(o=o.slice(1)),[...o].length!==1||"!^".includes(r.charAt(s+1)))return;e+=o,s=n}else{if(!t&&"+@!".includes(i)&&r.charAt(s+1)==="("&&r.includes(")",s+2))return;e+=i}}}return e},xn=r=>{if(/^[?*+@]\(\)$/.test(r)||r.includes("[:"))return!1;let t=0;for(let e=0;e<r.length;e++){let s=r.charAt(e);if(s==="\\"){if(++e===r.length)return!1}else if(s==="["){let i=Us(r,e);i!==-1&&(e=i)}else if("+@!?*".includes(s)&&r.charAt(e+1)==="(")t++,e++;else if(s===")"){if(!t--)return!1}else if(s==="|"&&!t)return!1}return!t},De,Bs,V=(r,t)=>typeof r=="string"?t===r:t!==""&&r.testUnchecked(t),Gs=(r,t,e,s,i)=>V(r,t)?e:s!==void 0&&V(r,s)?i:-1,Be=r=>r==="."||r==="..",Le=r=>typeof r=="string"&&/^[a-z]:$/i.test(r),$t=r=>typeof r=="string"&&/^unc$/i.test(r),We=r=>{if(r[0]!==""||r[1]!=="")return-1;let t=r[2]!=="?"?2:$t(r[3])?4:-1,e=r[t],s=r[t+1];return t!==-1&&e!==void 0&&e!==""&&e!==w.GLOBSTAR&&s!==void 0&&s!==""&&s!==w.GLOBSTAR?t:-1},It=(r,t)=>!Be(r)&&(t||!r.startsWith(".")),pt=(r,t,e,s,i)=>{for(let n=t;n<e;){if(r.charCodeAt(n)===46){if(!s)return!0;let h=r.charCodeAt(n+1)===46?n+2:n+1;if(h>=e||qt(r.charCodeAt(h),i))return!0}let o=Ge(r,n,i);if(o===-1)return!1;for(n=o+1;n<e&&qt(r.charCodeAt(n),i);)n++}return!1},qt=(r,t)=>t==="/"?r===47:t==="\\"?r===92:r===47||r===92,Ge=(r,t,e)=>{if(e!=="both")return r.indexOf(e,t);let s=r.indexOf("/",t),i=r.indexOf("\\",t);return s===-1?i:i===-1?s:Math.min(s,i)},Is=(r,t,e)=>e!=="both"?r.lastIndexOf(e,t):Math.max(r.lastIndexOf("/",t),r.lastIndexOf("\\",t)),ze={},ht=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;#t;#n;#i;#o;#r=[];#d=[];#f=[];#u=new Map;#h=!1;#m;#l=new WeakMap;constructor(t,e={}){(0,Ut.assertValidPattern)(t),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=t,this.platform=e.platform||$s,this.isWindows=this.platform==="win32";let s="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[s]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.#t=!this.preserveMultipleSlashes,this.#i=(e.optimizationLevel??1)>=2;let i=e.normalize;this.#o=i===!0?"NFC":i||void 0,this.make();let n=this.set.map(o=>this.#s(o));this.#f=this.set.map((o,h)=>this.#t&&o.length-1>n[h]),this.#r=this.set.map((o,h)=>{let a=this.#f[h]?o.length-1:o.length,l=o.slice(n[h]+1,a).filter(c=>typeof c=="string"&&!!c);return[...new Set(l)]}),this.#n=this.#r.some(o=>o.length),this.#d=this.set.map((o,h)=>{let[a,l,c]=o;if(this.#f[h]&&o.length===2&&a===w.GLOBSTAR&&l!==w.GLOBSTAR)return"tail";if(this.#f[h]&&e.matchBase&&o.length===1&&a!==w.GLOBSTAR&&a!=="")return"base";if(!(!this.#t||n[h]!==-1)){if(o.length===3&&a===w.GLOBSTAR&&c===w.GLOBSTAR&&l!==w.GLOBSTAR&&l!==""&&this.maxGlobstarRecursion>0)return"mid";if(o.length===2&&l===w.GLOBSTAR&&a!==w.GLOBSTAR&&a!=="")return"head"}})}#a(t){return this.#o?t.normalize(this.#o):t}#s(t){if(!this.isWindows)return-1;if(Le(t[0]))return 0;if(t[0]===""&&t[1]===""&&t[2]==="?"&&Le(t[3]))return 3;let s=We(t);return s===-1?-1:s+1}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.#M())];let s=this.globSet.map(n=>this.#e(n));this.globParts=this.preprocess(s),this.#h=!0;let i=this.globParts.map((n,o,h)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=n[2]==="?"&&$t(n[3])?6:4,l=n[0]===""&&n[1]===""&&(n[2]==="?"||!zs.test(n[2]))&&n.slice(3,a).every(u=>!zs.test(u)),c=/^[a-z]:/i.test(n[0]);if(l)return[...n.slice(0,a).map(u=>this.#a(u)),...n.slice(a).map(u=>this.parse(u))];if(c)return[this.#a(n[0]),...n.slice(1).map(u=>this.parse(u))]}return n.map(a=>this.parse(a))});if(this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let o=this.set[n];o[0]===""&&o[1]===""&&this.globParts[n][2]==="?"&&(Le(o[3])||$t(this.globParts[n][3]))&&($t(this.globParts[n][3])&&(o[3]="UNC"),o[2]="?")}e.noext||this.mergeRows(),this.#h=!1,this.set.forEach((n,o)=>{for(let h=0;h<n.length;h++)n[h]===ze&&(n[h]=this.parse(this.globParts[o][h]))})}mergeRows(){let t=!0;for(;t;){t=!1;let e=Math.max(0,...this.set.map(s=>s.length));for(let s=0;s<e;s++){let i=new Map;this.set.forEach((o,h)=>{if(!(o[s]instanceof Ls.Matcher||o[s]===ze)||!xn(this.globParts[h][s]))return;let a=[...this.globParts[h]];a[s]="";let l=`${o.length}/${a.join("/")}`,c=i.get(l);c?c.push(h):i.set(l,[h])});let n=new Set;for(let o of i.values()){if(o.length<2)continue;let[h,...a]=o,c=`@(${o.map(u=>this.globParts[u][s]).join("|")})`;this.globParts[h][s]=c,this.set[h][s]=this.parse(c);for(let u of a)n.add(u)}n.size&&(t=!0,this.set=this.set.filter((o,h)=>!n.has(h)),this.globParts=this.globParts.filter((o,h)=>!n.has(h)))}}}preprocess(t){if(this.options.noglobstar)for(let s of t)for(let i=0;i<s.length;i++)s[i]==="**"&&(s[i]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let i=s;for(;e[i+1]==="**";)i++;i!==s&&e.splice(s,i-s)}return e})}levelOneOptimize(t){return t.map(e=>{let s=this.#s(e)+1;return e=e.reduce((i,n)=>{let o=i[i.length-1];return n==="**"&&o==="**"?i:n===".."&&i.length>s&&o&&o!==".."&&o!=="."&&o!=="**"?(i.pop(),i):(i.push(n),i)},[]),e.length===0?[""]:e})}#b(t){let e=!this.isWindows||!t.includes("\\")?"/":t.includes("/")?"both":"\\",s=this.#t?0:-1,i="",n=0,o,h=0,a=!!this.options.dot;t:for(let l=0;l<this.set.length;l++){let c=this.set[l],u=c[c.length-1],f=s!==-1&&this.#f[l]&&u!==w.GLOBSTAR;if(f&&s===0){let d=Is(t,t.length,e);if(n=d+1,i=t.slice(n),i===""&&d>=0){let m=d;for(;m>0&&qt(t.charCodeAt(m-1),e);)m--;h=m===0?0:Is(t,m-1,e)+1,o=t.slice(h,m)}let b=this.#i&&(Be(i)||i===""&&o!==void 0&&Be(o));s=b?-1:1,f=!b}let p=-1;if(f&&typeof u=="string"&&(p=Gs(u,i,n,o,h),p===-1))continue;if(this.#n){for(let d of this.#r[l])if(!t.includes(d))continue t}if(f&&typeof u=="object"&&(p=Gs(u,i,n,o,h),p===-1))continue;let g=this.#d[l];if(g==="base"&&f)return"yes";if(g==="tail"&&f){if(this.#i&&pt(t,0,p,!0,e))return"maybe";if(!pt(t,0,p,a,e))return"yes";continue}if(g==="mid"||g==="head"){let d=this.#y(t,c,g==="head",a,e);if(d!=="no")return d;continue}return"maybe"}return"no"}#E(t,e,s){let i=!!this.options.dot,n=t.length;if(s==="head"){if(n<2||!V(e[0],t[0]))return!1;for(let h=1;h<n;h++)if(!It(t[h],i))return!1;return!0}let o=e[1];if(s==="tail"){let h=n-1;if(!V(o,t[h])&&(t[h]!==""||n===1||!V(o,t[--h])))return!1;for(let a=0;a<h;a++)if(!It(t[a],i))return!1;return!0}for(let h=0;h<n;h++){if(V(o,t[h])&&h+1<n){let a=h+1;for(;a<n&&It(t[a],i);)a++;if(a===n)return!0}if(!It(t[h],i))return!1}return!1}#y(t,e,s,i,n){if(this.#i&&pt(t,0,t.length,!0,n))return"maybe";let o=e[s?0:1],h=0;for(let a=Ge(t,h,n);a!==-1;a=Ge(t,h,n)){let l=a+1;for(;l<t.length&&qt(t.charCodeAt(l),n);)l++;if((typeof o=="string"?a-h===o.length&&t.startsWith(o,h):a>h&&o.testUnchecked(t.slice(h,a)))&&!pt(t,l,t.length,i,n))return"yes";if(s||pt(t,h,l,i,n))return"no";h=l}return"no"}#g(t){let e=De;return e?.f===t&&e.isWindows===this.isWindows&&e.preserveMultipleSlashes===this.preserveMultipleSlashes&&e.normalize===this.#o?e:void 0}#w(t){let{isWindows:e,preserveMultipleSlashes:s}=this,i=this.#e(e?t.split("\\").join("/"):t),n=this.#o;return n&&(i=i.map(o=>o.normalize(n))),De={f:t,isWindows:e,preserveMultipleSlashes:s,normalize:n,parts:i},De}#p(t){let e=[...t],s=!1;do{if(s=!1,!this.preserveMultipleSlashes){for(let o=1;o<e.length-1;o++){let h=e[o];o===1&&h===""&&e[0]===""||(h==="."||h==="")&&(s=!0,e.splice(o,1),o--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(s=!0,e.pop())}let i=this.#s(e)+1,n=i;for(;(n=e.indexOf("..",n+1))!==-1;){let o=e[n-1];o&&o!=="."&&o!==".."&&o!=="**"&&(s=!0,e.splice(n-1,2),n=Math.max(n-2,i))}}while(s);return e.length===0?[""]:e}firstPhasePreProcess(t){let{braceExpandMax:e=1e5}=this.options,s=0,i=1e6,n=!1;do{n=!1;for(let o of t){let h=-1;for(;(h=o.indexOf("**",h+1))!==-1;){let c=h;for(;o[c+1]==="**";)c++;c>h&&o.splice(h+1,c-h);let u=o[h+1],f=o[h+2],p=o[h+3];if(u!==".."||!f||f==="."||f===".."||!p||p==="."||p==="..")continue;let g=o.length-1;if(t.length>=e||s+g>i)throw new RangeError("optimizationLevel 2: too many patterns from '**/..'");n=!0,o.splice(h,1);let d=o.slice(0);d[h]="**",s+=g,t.push(d),h--}if(!this.preserveMultipleSlashes){for(let c=1;c<o.length-1;c++){let u=o[c];c===1&&u===""&&o[0]===""||(u==="."||u==="")&&(n=!0,o.splice(c,1),c--)}o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")&&(n=!0,o.pop())}let a=this.#s(o)+1,l=a;for(;(l=o.indexOf("..",l+1))!==-1;){let c=o[l-1];if(c&&c!=="."&&c!==".."&&c!=="**"){n=!0;let f=l===1&&o[l+1]==="**"?["."]:[];o.splice(l-1,2,...f),o.length===0&&o.push(""),l=Math.max(l-2,a)}}}}while(n);return t}secondPhasePreProcess(t){let e=new Set,s=t.filter(o=>{let h=o.join("/");return e.has(h)?!1:(e.add(h),!0)}),i=new Map;for(let o of s){let h=[];for(let a=0;a<o.length;a++)o[a]==="*"&&h.push(a);h.length&&i.set(h.join(","),h)}if(!i.size||s.length*i.size>1e5)return s;let{dot:n}=this.options;return s.filter(o=>{for(let h of i.values()){if(h[h.length-1]>=o.length)continue;let a=[...o],l=!0,c=!1;for(let u of h){let f=o[u];if(f!=="*"){if(!f||f==="**"||!n&&f.startsWith(".")){l=!1;break}a[u]="*",c=!0}}if(l&&c&&e.has(a.join("/")))return!1}return!0})}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}#O(t,e,s,i){let n=0,o=0,h=this.isWindows?We(e):-1,a=h===-1?-1:We(s);if(a!==-1){let l=s[a],c=s[a+1];typeof l!="string"||typeof c!="string"?(n=h,o=a):e[h].toLowerCase()===l.toLowerCase()&&e[h+1].toLowerCase()===c.toLowerCase()&&(n=h+2,o=a+2)}else if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof s[0]=="string"&&/^[a-z]:$/i.test(s[0]),f=!u&&s[0]===""&&s[1]===""&&s[2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3]),p=c?3:l?0:void 0,g=f?3:u?0:void 0;if(typeof p=="number"&&typeof g=="number"){let[d,b]=[t[p],s[g]];d.toLowerCase()===b.toLowerCase()&&(o=g+1,n=p+1)}}return t=e,s.includes(w.GLOBSTAR)?this.#x(t,s,i,n,o):this.#S(t,s,i,n,o)}#x(t,e,s,i,n){let{head:o,body:h,tail:a,segments:l}=this.#v(e,s,n);if(o.length){let u=i+o.length;if(!this.#S(t,o,s,i,0,u))return!1;i+=o.length,n+=o.length}let c=0;if(a.length){if(a.length+i>t.length)return!1;let u=t.length-a.length;if(this.#S(t,a,s,u,0))c=a.length;else{if(t[t.length-1]!==""||i+a.length===t.length||(u--,!this.#S(t,a,s,u,0)))return!1;c=a.length+1}}if(!h.length){let u=!!c;for(let f=i;f<t.length-c;f++){let p=String(t[f]);if(u=!0,p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return s||u}return!!this.#_(t,l,t.length-c,i,0,s,0,!!c,new Set)}#v(t,e,s){let i=this.#l.get(t);i||(i=[],this.#l.set(t,i));let n=s*2+(e?1:0),o=i[n];if(o)return o;let h=t.indexOf(w.GLOBSTAR,s),a=t.lastIndexOf(w.GLOBSTAR),l=t.slice(s,h),c=t.slice(h+1,e?void 0:a),u=e?[]:t.slice(a+1),f=[[[],0]],p=f[0],g=0,d=[0];for(let m of c)m===w.GLOBSTAR?(d.push(g),p=[[],0],f.push(p)):(p[0].push(m),g++);f.forEach((m,y)=>{m[1]=g-d[y]});let b={head:l,body:c,tail:u,segments:f};return i[n]=b,b}#_(t,e,s,i,n,o,h,a,l){let c=e[n];if(!c){if(o)return i>=s||i===s-1&&t[i]==="";for(let g=i;g<s;g++){a=!0;let d=t[g];if(d==="."||d===".."||!this.options.dot&&d.startsWith("."))return!1}return a}let[u,f]=c,p=o?s:s-f;for(;i<=p;){let g=n*(t.length+1)+i;if(l.has(g))return!1;if(l.add(g),this.#S(t,u,o,i,0,i+u.length)&&h<this.maxGlobstarRecursion){let m=this.#_(t,e,s,i+u.length,n+1,o,h+1,a,l);if(m!==!1)return m}if(i===p)break;let b=t[i];if(b==="."||b===".."||!this.options.dot&&b.startsWith("."))return!1;i++}return o||null}#S(t,e,s,i,n,o=t.length){let h,a,l,c;for(h=i,a=n,c=Math.min(o,t.length),l=e.length;h<c&&a<l;h++,a++){let u=e[a],f=t[h];if(u===!1||u===w.GLOBSTAR||!V(u,f))return!1}if(h===c&&a===l)return!0;if(h===c)return s;if(a===l)return h===c-1&&t[h]==="";throw new Error("wtf?")}braceExpand(){return(0,w.braceExpand)(this.pattern,this.options)}#M(){let{pattern:t}=this;if(this.options.nobrace)return this.braceExpand();let e=57344;for(;t.includes(String.fromCharCode(e));)if(++e>63743)return this.braceExpand();let s=String.fromCharCode(e),i=!1,n=t.replace(_n,(h,a,l)=>{let c=Number(a),u=Number(l);return!Number.isSafeInteger(c)||!Number.isSafeInteger(u)||Math.abs(c-u)+1<vn?h:(i=!0,`${s}${a}..${l}${s}`)});if(!i)return this.braceExpand();let o=(0,w.braceExpand)(n,this.options);for(let h of o)for(let a of h.split("/")){let l=a.indexOf("[");if(l!==-1&&l<a.lastIndexOf(s))return this.braceExpand()}return this.#m=s,o}parse(t){(0,Ut.assertValidPattern)(t);let e=this.options;if(t==="**")return w.GLOBSTAR;if(t==="")return"";let{nocase:s,nocaseMagicOnly:i,noext:n=!1,dot:o,normalize:h}=e,a=this.#m,l=a&&t.includes(a)?void 0:On(t,n);if(l!==void 0&&!(s&&!i&&t.toUpperCase()!==t.toLowerCase()))return this.#a(l);if(this.#h)return ze;let c=this.#u.get(t);return c||(c=new Ls.Matcher(t,{nocase:s,noext:n,dot:o,normalize:h,...a&&{rangeMark:a}}),this.#u.set(t,c)),c}#e(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options,i=this.#g(t);if(!i){if(!e&&!this.#o&&(this.#t||this.#n)&&Bs!==t){Bs=t;let l=this.#b(t);if(l==="no")return s.flipNegate?!1:this.negate;if(l==="yes")return s.flipNegate?!0:!this.negate}i=this.#w(t)}let n=i.parts,o=this.#i?i.resolved??=this.#p(n):n,h=this.set,a=n[n.length-1];if(!a)for(let l=n.length-2;!a&&l>=0;l--)a=n[l];for(let l=0;l<h.length;l++){let c=h[l],u=e?void 0:this.#d[l];if(u==="base"?V(c[0],a):u?this.#E(o,c,u):s.matchBase&&c.length===1?this.#O([a],[a],c,e):this.#O(n,o,c,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return w.minimatch.defaults(t).Minimatch}};w.Minimatch=ht;var Cn=je();Object.defineProperty(w,"escape",{enumerable:!0,get:function(){return Cn.escape}});var Mn=Ne();Object.defineProperty(w,"unescape",{enumerable:!0,get:function(){return Mn.unescape}});w.minimatch.Minimatch=ht;w.minimatch.escape=dn.escape;w.minimatch.unescape=pn.unescape});var Ys=C(Xt=>{"use strict";var Hs=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),kn=Hs(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.tracing=r.metrics=void 0;var t=__webpack_require__(/*! node:diagnostics_channel */ "node:diagnostics_channel");r.metrics=(0,t.channel)("lru-cache:metrics"),r.tracing=(0,t.tracingChannel)("lru-cache")}),An=Hs(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.defaultPerf=void 0,r.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(Xt,"__esModule",{value:!0});Xt.LRUCache=void 0;var O=kn(),Rn=An(),Ie=()=>O.metrics.hasSubscribers||O.tracing.hasSubscribers,Xs=new Set,qs=typeof process=="object"&&process?process:{},Pn=(r,t,e,s)=>{typeof qs.emitWarning=="function"?qs.emitWarning(r,t,e,s):console.error(`[${e}] ${t}: ${r}`)},Tn=r=>!Xs.has(r),J=r=>!!r&&r===Math.floor(r)&&r>0&&isFinite(r),Ks=r=>J(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Ht:null:null,Ht=class extends Array{constructor(r){super(r),this.fill(0)}},Fn=class mt{heap;length;static#t=!1;static create(t){let e=Ks(t);if(!e)return[];mt.#t=!0;let s=new mt(t,e);return mt.#t=!1,s}constructor(t,e){if(!mt.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},jn=class Vs{#t;#n;#i;#o;#r;#d;#f;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#h;#m;#l;#a;#s;#b;#E;#y;#g;#w;#p;#O;#x;#v;#_;#S;#M;#e;#P;static unsafeExposeInternals(t){return{starts:t.#x,ttls:t.#v,autopurgeTimers:t.#_,sizes:t.#O,keyMap:t.#l,keyList:t.#a,valList:t.#s,next:t.#b,prev:t.#E,get head(){return t.#y},get tail(){return t.#g},free:t.#w,isBackgroundFetch:e=>t.#c(e),backgroundFetch:(e,s,i,n)=>t.#L(e,s,i,n),moveToTail:e=>t.#K(e),indexes:e=>t.#A(e),rindexes:e=>t.#R(e),isStale:e=>t.#C(e)}}get max(){return this.#t}get maxSize(){return this.#n}get calculatedSize(){return this.#m}get size(){return this.#h}get fetchMethod(){return this.#d}get memoMethod(){return this.#f}get dispose(){return this.#i}get onInsert(){return this.#o}get disposeAfter(){return this.#r}constructor(t){let{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:h,allowStale:a,dispose:l,onInsert:c,disposeAfter:u,noDisposeOnSet:f,noUpdateTTL:p,maxSize:g=0,maxEntrySize:d=0,sizeCalculation:b,fetchMethod:m,memoMethod:y,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:K,ignoreFetchAbort:B,backgroundFetchSize:U=1,perf:rt}=t;if(this.backgroundFetchSize=U,rt!==void 0&&typeof rt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=rt??Rn.defaultPerf,e!==0&&!J(e))throw new TypeError("max option must be a nonnegative integer");let Se=e?Ks(e):Array;if(!Se)throw new Error("invalid max value: "+e);if(this.#t=e,this.#n=g,this.maxEntrySize=d||this.#n,this.sizeCalculation=b,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=y,m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#d=m,this.#M=!!m,this.#l=new Map,this.#a=Array.from({length:e}).fill(void 0),this.#s=Array.from({length:e}).fill(void 0),this.#b=new Se(e),this.#E=new Se(e),this.#y=0,this.#g=0,this.#w=Fn.create(e),this.#h=0,this.#m=0,typeof l=="function"&&(this.#i=l),typeof c=="function"&&(this.#o=c),typeof u=="function"?(this.#r=u,this.#p=[]):(this.#r=void 0,this.#p=void 0),this.#S=!!this.#i,this.#P=!!this.#o,this.#e=!!this.#r,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!K,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#n!==0&&!J(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!J(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#U()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h,this.ttlResolution=J(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!J(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T()}if(this.#t===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#n){let ve="LRU_CACHE_UNBOUNDED";Tn(ve)&&(Xs.add(ve),Pn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ve,Vs))}}getRemainingTTL(t){return this.#l.has(t)?1/0:0}#T(){let t=new Ht(this.#t),e=new Ht(this.#t);this.#v=t,this.#x=e;let s=this.ttlAutopurge?Array.from({length:this.#t}):void 0;this.#_=s,this.#z=(a,l,c=this.#u.now())=>{e[a]=l!==0?c:0,t[a]=l,i(a,l)},this.#k=a=>{e[a]=t[a]!==0?this.#u.now():0,i(a,t[a])};let i=this.ttlAutopurge?(a,l)=>{if(s?.[a]&&(clearTimeout(s[a]),s[a]=void 0),l&&l!==0&&s){let c=setTimeout(()=>{this.#C(a)?(this.#W(this.#a[a],"expire"),s[a]=void 0):i(a,h(a))},l+1);c.unref&&c.unref(),s[a]=c}}:()=>{};this.#F=(a,l)=>{if(t[l]){let c=t[l],u=e[l];if(!c||!u)return;a.ttl=c,a.start=u,a.now=n||o();let f=a.now-u;a.remainingTTL=c-f}};let n=0,o=()=>{let a=this.#u.now();if(this.ttlResolution>0){n=a;let l=setTimeout(()=>n=0,this.ttlResolution);l.unref&&l.unref()}return a};this.getRemainingTTL=a=>{let l=this.#l.get(a);return l===void 0?0:h(l)};let h=a=>{let l=t[a],c=e[a];if(!l||!c)return 1/0;let u=(n||o())-c;return l-u};this.#C=a=>{let l=e[a],c=t[a];return!!c&&!!l&&(n||o())-l>c}}#k=()=>{};#F=()=>{};#z=()=>{};#C=()=>!1;#U(){let t=new Ht(this.#t);this.#m=0,this.#O=t,this.#N=e=>{this.#m-=t[e],t[e]=0},this.#B=(e,s,i,n)=>{if(!J(i)){if(this.#c(s))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(s,e),!J(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#j=(e,s,i)=>{if(t[e]=s,this.#n){let n=this.#n-t[e];for(;this.#m>n;)this.#$(!0)}this.#m+=t[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#m)}}#N=t=>{};#j=(t,e,s)=>{};#B=(t,e,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#g;this.#G(e)&&((t||!this.#C(e))&&(yield e),e!==this.#y);)e=this.#E[e]}*#R({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#y;this.#G(e)&&((t||!this.#C(e))&&(yield e),e!==this.#g);)e=this.#b[e]}#G(t){return t!==void 0&&this.#l.get(this.#a[t])===t}*entries(){for(let t of this.#A())this.#s[t]!==void 0&&this.#a[t]!==void 0&&!this.#c(this.#s[t])&&(yield[this.#a[t],this.#s[t]])}*rentries(){for(let t of this.#R())this.#s[t]!==void 0&&this.#a[t]!==void 0&&!this.#c(this.#s[t])&&(yield[this.#a[t],this.#s[t]])}*keys(){for(let t of this.#A()){let e=this.#a[t];e!==void 0&&!this.#c(this.#s[t])&&(yield e)}}*rkeys(){for(let t of this.#R()){let e=this.#a[t];e!==void 0&&!this.#c(this.#s[t])&&(yield e)}}*values(){for(let t of this.#A())this.#s[t]!==void 0&&!this.#c(this.#s[t])&&(yield this.#s[t])}*rvalues(){for(let t of this.#R())this.#s[t]!==void 0&&!this.#c(this.#s[t])&&(yield this.#s[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#A()){let i=this.#s[s],n=this.#c(i)?i.__staleWhileFetching:i;if(n!==void 0&&t(n,this.#a[s],this))return this.#X(this.#a[s],e)}}forEach(t,e=this){for(let s of this.#A()){let i=this.#s[s],n=this.#c(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#a[s],this)}}rforEach(t,e=this){for(let s of this.#R()){let i=this.#s[s],n=this.#c(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#a[s],this)}}purgeStale(){let t=!1;for(let e of this.#R({allowStale:!0}))this.#C(e)&&(this.#W(this.#a[e],"expire"),t=!0);return t}info(t){let e=this.#l.get(t);if(e===void 0)return;let s=this.#s[e],i=this.#c(s)?s.__staleWhileFetching:s;if(i===void 0)return;let n={value:i};if(this.#v&&this.#x){let o=this.#v[e],h=this.#x[e];if(o&&h){let a=o-(this.#u.now()-h);n.ttl=a,n.start=Date.now()}}return this.#O&&(n.size=this.#O[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let s=this.#a[e],i=this.#s[e],n=this.#c(i)?i.__staleWhileFetching:i;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#v&&this.#x){o.ttl=this.#v[e];let h=this.#u.now()-this.#x[e];o.start=Math.floor(Date.now()-h)}this.#O&&(o.size=this.#O[e]),t.unshift([s,o])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let i=Date.now()-s.start;s.start=this.#u.now()-i}this.#D(e,s.value,s)}}set(t,e,s={}){let{status:i=O.metrics.hasSubscribers?{}:void 0}=s;s.status=i,i&&(i.op="set",i.key=t,e!==void 0&&(i.value=e),i.cache=this);let n=this.#D(t,e,s);return i&&O.metrics.hasSubscribers&&O.metrics.publish(i),n}#D(t,e,s,i){let{ttl:n=this.ttl,start:o,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=s,c=this.#c(e);if(e===void 0)return l&&(l.set="deleted"),this.delete(t),this;let{noUpdateTTL:u=this.noUpdateTTL}=s;l&&!c&&(l.value=e);let f=this.#B(t,e,s.size||0,a,l);if(this.maxEntrySize&&f>this.maxEntrySize)return this.#W(t,"set"),l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this;let p=this.#h===0?void 0:this.#l.get(t);if(p===void 0)p=this.#h===0?this.#g:this.#w.length!==0?this.#w.pop():this.#h===this.#t?this.#$(!1):this.#h,this.#a[p]=t,this.#s[p]=e,this.#l.set(t,p),this.#b[this.#g]=p,this.#E[p]=this.#g,this.#g=p,this.#h++,this.#j(p,f,l),l&&(l.set="add"),u=!1,this.#P&&!c&&this.#o?.(e,t,"add");else{this.#K(p);let g=this.#s[p];if(e!==g){if(!h)if(this.#c(g)){g!==i&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=g;d!==void 0&&d!==e&&(this.#S&&this.#i?.(d,t,"set"),this.#e&&this.#p?.push([d,t,"set"]))}else this.#S&&this.#i?.(g,t,"set"),this.#e&&this.#p?.push([g,t,"set"]);if(this.#N(p),this.#j(p,f,l),this.#s[p]=e,!c){let d=g&&this.#c(g)?g.__staleWhileFetching:g,b=d===void 0?"add":e!==d?"replace":"update";l&&(l.set=b,d!==void 0&&(l.oldValue=d)),this.#P&&this.onInsert?.(e,t,b)}}else c||(l&&(l.set="update"),this.#P&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#v&&this.#T(),this.#v&&(u||this.#z(p,n,o),l&&this.#F(l,p)),!h&&this.#e&&this.#p){let g=this.#p,d;for(;d=g?.shift();)this.#r?.(...d)}return this}pop(){try{for(;this.#h;){let t=this.#s[this.#y];if(this.#$(!0),this.#c(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#e&&this.#p){let t=this.#p,e;for(;e=t?.shift();)this.#r?.(...e)}}}#$(t){let e=this.#y,s=this.#a[e],i=this.#s[e],n=this.#c(i);n&&i.__abortController.abort(new Error("evicted"));let o=n?i.__staleWhileFetching:i;return(this.#S||this.#e)&&o!==void 0&&(this.#S&&this.#i?.(o,s,"evict"),this.#e&&this.#p?.push([o,s,"evict"])),this.#N(e),this.#_?.[e]&&(clearTimeout(this.#_[e]),this.#_[e]=void 0),t&&(this.#a[e]=void 0,this.#s[e]=void 0,this.#w.push(e)),this.#h===1?(this.#y=this.#g=0,this.#w.length=0):this.#y=this.#b[e],this.#l.delete(s),this.#h--,e}has(t,e={}){let{status:s=O.metrics.hasSubscribers?{}:void 0}=e;e.status=s,s&&(s.op="has",s.key=t,s.cache=this);let i=this.#V(t,e);return O.metrics.hasSubscribers&&O.metrics.publish(s),i}#V(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,n=this.#l.get(t);if(n!==void 0){let o=this.#s[n];if(this.#c(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#C(n))i&&(i.has="stale",this.#F(i,n));else return s&&this.#k(n),i&&(i.has="hit",this.#F(i,n)),!0}else i&&(i.has="miss");return!1}peek(t,e={}){let{status:s=Ie()?{}:void 0}=e;s&&(s.op="peek",s.key=t,s.cache=this),e.status=s;let i=this.#q(t,e);return O.metrics.hasSubscribers&&O.metrics.publish(s),i}#q(t,e){let{status:s,allowStale:i=this.allowStale}=e,n=this.#l.get(t);if(n===void 0||!i&&this.#C(n)){s&&(s.peek=n===void 0?"miss":"stale");return}let o=this.#s[n],h=this.#c(o)?o.__staleWhileFetching:o;return s&&(h!==void 0?(s.peek="hit",s.value=h):s.peek="miss"),h}#L(t,e,s,i){let n=e===void 0?void 0:this.#s[e];if(this.#c(n))return n;let o=new AbortController,{signal:h}=s;h?.addEventListener("abort",()=>o.abort(h.reason),{signal:o.signal});let a={signal:o.signal,options:s,context:i},l=(d,b=!1)=>{let{aborted:m}=o.signal,y=s.ignoreFetchAbort&&d!==void 0,_=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&d!==void 0);if(s.status&&(m&&!b?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,y&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),m&&!y&&!b)return u(o.signal.reason,_);let v=p,S=this.#s[e];return(S===p||S===void 0&&y&&b)&&(d===void 0?v.__staleWhileFetching!==void 0?this.#s[e]=v.__staleWhileFetching:this.#W(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.#D(t,d,a.options,v))),d},c=d=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=d),u(d,!1)),u=(d,b)=>{let{aborted:m}=o.signal,y=m&&s.allowStaleOnFetchAbort,_=y||s.allowStaleOnFetchRejection,v=_||s.noDeleteOnFetchRejection,S=p;if(this.#s[e]===p&&(!v||!b&&S.__staleWhileFetching===void 0?this.#W(t,"fetch"):y||(this.#s[e]=S.__staleWhileFetching)),_)return s.status&&S.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),S.__staleWhileFetching;if(S.__returned===S)throw d},f=(d,b)=>{let m=this.#d?.(t,n,a);o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(d(void 0),s.allowStaleOnFetchAbort&&(d=y=>l(y,!0)))}),m&&m instanceof Promise?m.then(y=>d(y===void 0?void 0:y),b):m!==void 0&&d(m)};s.status&&(s.status.fetchDispatched=!0);let p=new Promise(f).then(l,c),g=Object.assign(p,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#D(t,g,{...a.options,status:void 0}),e=this.#l.get(t)):this.#s[e]=g,g}#c(t){if(!this.#M)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let s=O.tracing.hasSubscribers,{status:i=Ie()?{}:void 0}=e;e.status=i,i&&e.context&&(i.context=e.context);let n=this.#H(t,e);return i&&s&&(i.trace=!0,O.tracing.tracePromise(()=>n,i).catch(()=>{})),n}async#H(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:d,forceRefresh:b=!1,status:m,signal:y}=e;if(m&&(m.op="fetch",m.key=t,b&&(m.forceRefresh=!0),m.cache=this),!this.#M)return m&&(m.fetch="get"),this.#X(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:m});let _={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:h,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:p,status:m,signal:y},v=this.#l.get(t);if(v===void 0){m&&(m.fetch="miss");let S=this.#L(t,v,_,d);return S.__returned=S}else{let S=this.#s[v];if(this.#c(S)){let rt=s&&S.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",rt&&(m.returnedStale=!0)),rt?S.__staleWhileFetching:S.__returned=S}let K=this.#C(v);if(!b&&!K)return m&&(m.fetch="hit"),this.#K(v),i&&this.#k(v),m&&this.#F(m,v),S;let B=this.#L(t,v,_,d),U=B.__staleWhileFetching!==void 0&&s;return m&&(m.fetch=K?"stale":"refresh",U&&K&&(m.returnedStale=!0)),U?B.__staleWhileFetching:B.__returned=B}}forceFetch(t,e={}){let s=O.tracing.hasSubscribers,{status:i=Ie()?{}:void 0}=e;e.status=i,i&&e.context&&(i.context=e.context);let n=this.#I(t,e);return i&&s&&(i.trace=!0,O.tracing.tracePromise(()=>n,i).catch(()=>{})),n}async#I(t,e={}){let s=await this.#H(t,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,e={}){let{status:s=O.metrics.hasSubscribers?{}:void 0}=e;e.status=s,s&&(s.op="memo",s.key=t,e.context&&(s.context=e.context),s.cache=this);let i=this.#Z(t,e);return s&&(s.value=i),O.metrics.hasSubscribers&&O.metrics.publish(s),i}#Z(t,e={}){let s=this.#f;if(!s)throw new Error("no memoMethod provided to constructor");let{context:i,status:n,forceRefresh:o,...h}=e;n&&o&&(n.forceRefresh=!0);let a=this.#X(t,h),l=o||a===void 0;if(n&&(n.memo=l?"miss":"hit",l||(n.value=a)),!l)return a;let c=s(t,a,{options:h,context:i});return n&&(n.value=c),this.#D(t,c,h),c}get(t,e={}){let{status:s=O.metrics.hasSubscribers?{}:void 0}=e;e.status=s,s&&(s.op="get",s.key=t,s.cache=this);let i=this.#X(t,e);return s&&(i!==void 0&&(s.value=i),O.metrics.hasSubscribers&&O.metrics.publish(s)),i}#X(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,h=this.#l.get(t);if(h===void 0){o&&(o.get="miss");return}let a=this.#s[h],l=this.#c(a);return o&&this.#F(o,h),this.#C(h)?l?(o&&(o.get="stale-fetching"),s&&a.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#W(t,"expire"),o&&(o.get="stale"),s?(o&&(o.returnedStale=!0),a):void 0):(o&&(o.get=l?"fetching":"hit"),this.#K(h),i&&this.#k(h),l?a.__staleWhileFetching:a)}#Y(t,e){this.#E[e]=t,this.#b[t]=e}#K(t){t!==this.#g&&(t===this.#y?this.#y=this.#b[t]:this.#Y(this.#E[t],this.#b[t]),this.#Y(this.#g,t),this.#g=t)}delete(t){return this.#W(t,"delete")}#W(t,e){O.metrics.hasSubscribers&&O.metrics.publish({op:"delete",delete:e,key:t,cache:this});let s=!1;if(this.#h!==0){let i=this.#l.get(t);if(i!==void 0)if(this.#_?.[i]&&(clearTimeout(this.#_[i]),this.#_[i]=void 0),s=!0,this.#h===1)this.#J(e);else{this.#N(i);let n=this.#s[i];if(this.#c(n)?n.__abortController.abort(new Error("deleted")):(this.#S||this.#e)&&(this.#S&&this.#i?.(n,t,e),this.#e&&this.#p?.push([n,t,e])),this.#l.delete(t),this.#a[i]=void 0,this.#s[i]=void 0,i===this.#g)this.#g=this.#E[i];else if(i===this.#y)this.#y=this.#b[i];else{let o=this.#E[i];this.#b[o]=this.#b[i];let h=this.#b[i];this.#E[h]=this.#E[i]}this.#h--,this.#w.push(i)}}if(this.#e&&this.#p?.length){let i=this.#p,n;for(;n=i?.shift();)this.#r?.(...n)}return s}clear(){return this.#J("delete")}#J(t){for(let e of this.#R({allowStale:!0})){let s=this.#s[e];if(this.#c(s))s.__abortController.abort(new Error("deleted"));else{let i=this.#a[e];this.#S&&this.#i?.(s,i,t),this.#e&&this.#p?.push([s,i,t])}}if(this.#l.clear(),this.#s.fill(void 0),this.#a.fill(void 0),this.#v&&this.#x){this.#v.fill(0),this.#x.fill(0);for(let e of this.#_??[])e!==void 0&&clearTimeout(e);this.#_?.fill(void 0)}if(this.#O&&this.#O.fill(0),this.#y=0,this.#g=0,this.#w.length=0,this.#m=0,this.#h=0,this.#e&&this.#p){let e=this.#p,s;for(;s=e?.shift();)this.#r?.(...s)}}};Xt.LRUCache=jn});var Ye=C(j=>{"use strict";var Nn=j&&j.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(j,"__esModule",{value:!0});j.Minipass=j.isWritable=j.isReadable=j.isStream=void 0;var Js=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ve=__webpack_require__(/*! node:events */ "node:events"),ei=Nn(__webpack_require__(/*! node:stream */ "node:stream")),Dn=__webpack_require__(/*! node:string_decoder */ "node:string_decoder"),Ln=r=>!!r&&typeof r=="object"&&(r instanceof te||r instanceof ei.default||(0,j.isReadable)(r)||(0,j.isWritable)(r));j.isStream=Ln;var Wn=r=>!!r&&typeof r=="object"&&r instanceof Ve.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==ei.default.Writable.prototype.pipe;j.isReadable=Wn;var zn=r=>!!r&&typeof r=="object"&&r instanceof Ve.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function";j.isWritable=zn;var H=Symbol("EOF"),X=Symbol("maybeEmitEnd"),Z=Symbol("emittedEnd"),Kt=Symbol("emittingEnd"),gt=Symbol("emittedError"),Vt=Symbol("closed"),Zs=Symbol("read"),Yt=Symbol("flush"),Qs=Symbol("flushChunk"),W=Symbol("encoding"),at=Symbol("decoder"),M=Symbol("flowing"),wt=Symbol("paused"),lt=Symbol("resume"),k=Symbol("buffer"),F=Symbol("pipes"),A=Symbol("bufferLength"),$e=Symbol("bufferPush"),Jt=Symbol("bufferShift"),P=Symbol("objectMode"),x=Symbol("destroyed"),Ue=Symbol("error"),qe=Symbol("emitData"),ti=Symbol("emitEnd"),He=Symbol("emitEnd2"),G=Symbol("async"),Xe=Symbol("abort"),Zt=Symbol("aborted"),bt=Symbol("signal"),st=Symbol("dataListeners"),N=Symbol("discarded"),yt=r=>Promise.resolve().then(r),Bn=r=>r(),Gn=r=>r==="end"||r==="finish"||r==="prefinish",In=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,$n=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Qt=class{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[lt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ke=class extends Qt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=i=>this.dest.emit("error",i),t.on("error",this.proxyErrors)}},Un=r=>!!r.objectMode,qn=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",te=class extends Ve.EventEmitter{[M]=!1;[wt]=!1;[F]=[];[k]=[];[P];[W];[G];[at];[H]=!1;[Z]=!1;[Kt]=!1;[Vt]=!1;[gt]=null;[A]=0;[x]=!1;[bt];[Zt]=!1;[st]=0;[N]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Un(e)?(this[P]=!0,this[W]=null):qn(e)?(this[W]=e.encoding,this[P]=!1):(this[P]=!1,this[W]=null),this[G]=!!e.async,this[at]=this[W]?new Dn.StringDecoder(this[W]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[k]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[F]});let{signal:s}=e;s&&(this[bt]=s,s.aborted?this[Xe]():s.addEventListener("abort",()=>this[Xe]()))}get bufferLength(){return this[A]}get encoding(){return this[W]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[P]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[G]}set async(t){this[G]=this[G]||!!t}[Xe](){this[Zt]=!0,this.emit("abort",this[bt]?.reason),this.destroy(this[bt]?.reason)}get aborted(){return this[Zt]}set aborted(t){}write(t,e,s){if(this[Zt])return!1;if(this[H])throw new Error("write after end");if(this[x])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let i=this[G]?yt:Bn;if(!this[P]&&!Buffer.isBuffer(t)){if($n(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(In(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[P]?(this[M]&&this[A]!==0&&this[Yt](!0),this[M]?this.emit("data",t):this[$e](t),this[A]!==0&&this.emit("readable"),s&&i(s),this[M]):t.length?(typeof t=="string"&&!(e===this[W]&&!this[at]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[W]&&(t=this[at].write(t)),this[M]&&this[A]!==0&&this[Yt](!0),this[M]?this.emit("data",t):this[$e](t),this[A]!==0&&this.emit("readable"),s&&i(s),this[M]):(this[A]!==0&&this.emit("readable"),s&&i(s),this[M])}read(t){if(this[x])return null;if(this[N]=!1,this[A]===0||t===0||t&&t>this[A])return this[X](),null;this[P]&&(t=null),this[k].length>1&&!this[P]&&(this[k]=[this[W]?this[k].join(""):Buffer.concat(this[k],this[A])]);let e=this[Zs](t||null,this[k][0]);return this[X](),e}[Zs](t,e){if(this[P])this[Jt]();else{let s=e;t===s.length||t===null?this[Jt]():typeof s=="string"?(this[k][0]=s.slice(t),e=s.slice(0,t),this[A]-=t):(this[k][0]=s.subarray(t),e=s.subarray(0,t),this[A]-=t)}return this.emit("data",e),!this[k].length&&!this[H]&&this.emit("drain"),e}end(t,e,s){return typeof t=="function"&&(s=t,t=void 0),typeof e=="function"&&(s=e,e="utf8"),t!==void 0&&this.write(t,e),s&&this.once("end",s),this[H]=!0,this.writable=!1,(this[M]||!this[wt])&&this[X](),this}[lt](){this[x]||(!this[st]&&!this[F].length&&(this[N]=!0),this[wt]=!1,this[M]=!0,this.emit("resume"),this[k].length?this[Yt]():this[H]?this[X]():this.emit("drain"))}resume(){return this[lt]()}pause(){this[M]=!1,this[wt]=!0,this[N]=!1}get destroyed(){return this[x]}get flowing(){return this[M]}get paused(){return this[wt]}[$e](t){this[P]?this[A]+=1:this[A]+=t.length,this[k].push(t)}[Jt](){return this[P]?this[A]-=1:this[A]-=this[k][0].length,this[k].shift()}[Yt](t=!1){do;while(this[Qs](this[Jt]())&&this[k].length);!t&&!this[k].length&&!this[H]&&this.emit("drain")}[Qs](t){return this.emit("data",t),this[M]}pipe(t,e){if(this[x])return t;this[N]=!1;let s=this[Z];return e=e||{},t===Js.stdout||t===Js.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[F].push(e.proxyErrors?new Ke(this,t,e):new Qt(this,t,e)),this[G]?yt(()=>this[lt]()):this[lt]()),t}unpipe(t){let e=this[F].find(s=>s.dest===t);e&&(this[F].length===1?(this[M]&&this[st]===0&&(this[M]=!1),this[F]=[]):this[F].splice(this[F].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t==="data")this[N]=!1,this[st]++,!this[F].length&&!this[M]&&this[lt]();else if(t==="readable"&&this[A]!==0)super.emit("readable");else if(Gn(t)&&this[Z])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[gt]){let i=e;this[G]?yt(()=>i.call(this,this[gt])):i.call(this,this[gt])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t==="data"&&(this[st]=this.listeners("data").length,this[st]===0&&!this[N]&&!this[F].length&&(this[M]=!1)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[st]=0,!this[N]&&!this[F].length&&(this[M]=!1)),e}get emittedEnd(){return this[Z]}[X](){!this[Kt]&&!this[Z]&&!this[x]&&this[k].length===0&&this[H]&&(this[Kt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Vt]&&this.emit("close"),this[Kt]=!1)}emit(t,...e){let s=e[0];if(t!=="error"&&t!=="close"&&t!==x&&this[x])return!1;if(t==="data")return!this[P]&&!s?!1:this[G]?(yt(()=>this[qe](s)),!0):this[qe](s);if(t==="end")return this[ti]();if(t==="close"){if(this[Vt]=!0,!this[Z]&&!this[x])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[gt]=s,super.emit(Ue,s);let n=!this[bt]||this.listeners("error").length?super.emit("error",s):!1;return this[X](),n}else if(t==="resume"){let n=super.emit("resume");return this[X](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let i=super.emit(t,...e);return this[X](),i}[qe](t){for(let s of this[F])s.dest.write(t)===!1&&this.pause();let e=this[N]?!1:super.emit("data",t);return this[X](),e}[ti](){return this[Z]?!1:(this[Z]=!0,this.readable=!1,this[G]?(yt(()=>this[He]()),!0):this[He]())}[He](){if(this[at]){let e=this[at].end();if(e){for(let s of this[F])s.dest.write(e);this[N]||super.emit("data",e)}}for(let e of this[F])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[P]||(t.dataLength=0);let e=this.promise();return this.on("data",s=>{t.push(s),this[P]||(t.dataLength+=s.length)}),await e,t}async concat(){if(this[P])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[W]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(x,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[N]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[H])return e();let n,o,h=u=>{this.off("data",a),this.off("end",l),this.off(x,c),e(),o(u)},a=u=>{this.off("error",h),this.off("end",l),this.off(x,c),this.pause(),n({value:u,done:!!this[H]})},l=()=>{this.off("error",h),this.off("data",a),this.off(x,c),e(),n({done:!0,value:void 0})},c=()=>h(new Error("stream destroyed"));return new Promise((u,f)=>{o=f,n=u,this.once(x,c),this.once("error",h),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[N]=!1;let t=!1,e=()=>(this.pause(),this.off(Ue,e),this.off(x,e),this.off("end",e),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return e();let i=this.read();return i===null?e():{done:!1,value:i}};return this.once("end",e),this.once(Ue,e),this.once(x,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[x])return t?this.emit("error",t):this.emit(x),this;this[x]=!0,this[N]=!0,this[k].length=0,this[A]=0;let e=this;return typeof e.close=="function"&&!this[Vt]&&e.close(),t?this.emit("error",t):this.emit(x),this}static get isStream(){return j.isStream}};j.Minipass=te});var mi=C(E=>{"use strict";var Hn=E&&E.__createBinding||(Object.create?(function(r,t,e,s){s===void 0&&(s=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,s,i)}):(function(r,t,e,s){s===void 0&&(s=e),r[s]=t[e]})),Xn=E&&E.__setModuleDefault||(Object.create?(function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}):function(r,t){r.default=t}),Kn=E&&E.__importStar||(function(){var r=function(t){return r=Object.getOwnPropertyNames||function(e){var s=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s[s.length]=i);return s},r(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var s=r(t),i=0;i<s.length;i++)s[i]!=="default"&&Hn(e,t,s[i]);return Xn(e,t),e}})();Object.defineProperty(E,"__esModule",{value:!0});E.PathScurry=E.Path=E.PathScurryDarwin=E.PathScurryPosix=E.PathScurryWin32=E.PathScurryBase=E.PathPosix=E.PathWin32=E.PathBase=E.ChildrenCache=E.ResolveCache=void 0;var ae=Ys(),re=__webpack_require__(/*! node:path */ "node:path"),Vn=__webpack_require__(/*! node:url */ "node:url"),vt=__webpack_require__(/*! fs */ "fs"),Yn=Kn(__webpack_require__(/*! node:fs */ "node:fs")),Jn=vt.realpathSync.native,ee=__webpack_require__(/*! node:fs/promises */ "node:fs/promises"),si=Ye(),_t={lstatSync:vt.lstatSync,readdir:vt.readdir,readdirSync:vt.readdirSync,readlinkSync:vt.readlinkSync,realpathSync:Jn,promises:{lstat:ee.lstat,readdir:ee.readdir,readlink:ee.readlink,realpath:ee.realpath}},ai=r=>!r||r===_t||r===Yn?_t:{..._t,...r,promises:{..._t.promises,...r.promises}},Zn=/^\\\\\?\\([a-z]:)\\?$/i,Qn=/^\\\\\?\\UNC\\([^\\]+\\[^\\]+)\\?$/i,tr=/^\\\\[^\\?]+\\[^\\]+$/,ii=r=>r.replace(/\//g,"\\").replace(Zn,"$1\\").replace(Qn,"\\\\$1\\").replace(tr,"$&\\"),er=/^[\\/]{2}\?[\\/]unc[\\/][^\\/]+[\\/][^\\/]+(?:[\\/]|$)/i,sr=/^[\\/]{2}\?[\\/](?=[a-z]:)/i,ir=/^[\\/]{2}\?[\\/]unc(?=[\\/][^\\/]+[\\/][^\\/])/i,nr=/[\\/]/,L=0,li=1,ci=2,I=4,ui=6,fi=8,it=10,di=12,D=15,St=~D,Je=16,ni=32,Et=64,z=128,se=256,ne=512,ri=Et|z|ne,rr=1023,Ze=r=>r.isFile()?fi:r.isDirectory()?I:r.isSymbolicLink()?it:r.isCharacterDevice()?ci:r.isBlockDevice()?ui:r.isSocket()?di:r.isFIFO()?li:L,oi=new ae.LRUCache({max:2**12}),Ot=r=>{let t=oi.get(r);if(t)return t;let e=r.normalize("NFKD");return oi.set(r,e),e},hi=new ae.LRUCache({max:2**12}),ie=r=>{let t=hi.get(r);if(t)return t;let e=Ot(r.toLowerCase());return hi.set(r,e),e},xt=class extends ae.LRUCache{constructor(){super({max:256})}};E.ResolveCache=xt;var oe=class extends ae.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}};E.ChildrenCache=oe;var pi=Symbol("PathScurry setAsCwd"),R=class{name;root;roots;parent;nocase;isCWD=!1;#t;#n;get dev(){return this.#n}#i;get mode(){return this.#i}#o;get nlink(){return this.#o}#r;get uid(){return this.#r}#d;get gid(){return this.#d}#f;get rdev(){return this.#f}#u;get blksize(){return this.#u}#h;get ino(){return this.#h}#m;get size(){return this.#m}#l;get blocks(){return this.#l}#a;get atimeMs(){return this.#a}#s;get mtimeMs(){return this.#s}#b;get ctimeMs(){return this.#b}#E;get birthtimeMs(){return this.#E}#y;get atime(){return this.#y}#g;get mtime(){return this.#g}#w;get ctime(){return this.#w}#p;get birthtime(){return this.#p}#O;#x;#v;#_;#S;#M;#e;#P;#T;#k;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=L,s,i,n,o,h){this.name=t,this.#O=n?ie(t):Ot(t),this.#e=e&rr,this.nocase=n,this.roots=i,this.root=s||this,this.#P=o,this.#v=h.fullpath,this.#S=h.relative,this.#M=h.relativePosix,this.parent=h.parent,this.parent?this.#t=this.parent.#t:this.#t=ai(h.fs)}get fs(){return this.#t}depth(){return this.#x!==void 0?this.#x:this.parent?this.#x=this.parent.depth()+1:this.#x=0}childrenCache(){return this.#P}resolve(t){if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#F(i):this.#F(i)}#F(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#P.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#P.set(this,e),this.#e&=~Je,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),i=this.nocase?ie(t):Ot(t);for(let a of s)if(a.#O===i)return a;let n=this.parent?this.sep:"",o=this.#v?this.#v+n+t:void 0,h=this.newChild(t,L,{...e,parent:this,fullpath:o});return this.canReaddir()||(h.#e|=z),s.push(h),h}relative(){if(this.isCWD)return"";if(this.#S!==void 0)return this.#S;let t=this.name,e=this.parent;if(!e)return this.#S=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#M!==void 0)return this.#M;let t=this.name,e=this.parent;if(!e)return this.#M=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#v!==void 0)return this.#v;let t=this.name,e=this.parent;if(!e)return this.#v=this.name;let i=e.fullpath()+(e.parent?this.sep:"")+t;return this.#v=i}fullpathPosix(){if(this.#_!==void 0)return this.#_;if(this.sep==="/")return this.#_=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#_=`//?/${i}`:this.#_=i}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return this.#_=s}isUnknown(){return(this.#e&D)===L}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#e&D)===fi}isDirectory(){return(this.#e&D)===I}isCharacterDevice(){return(this.#e&D)===ci}isBlockDevice(){return(this.#e&D)===ui}isFIFO(){return(this.#e&D)===li}isSocket(){return(this.#e&D)===di}isSymbolicLink(){return(this.#e&it)===it}lstatCached(){return this.#e&ni?this:void 0}readlinkCached(){return this.#T}realpathCached(){return this.#k}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#T)return!0;if(!this.parent)return!1;let t=this.#e&D;return!(t!==L&&t!==it||this.#e&se||this.#e&z)}calledReaddir(){return!!(this.#e&Je)}isENOENT(){return!!(this.#e&z)}isNamed(t){return this.nocase?this.#O===ie(t):this.#O===Ot(t)}async readlink(){let t=this.#T;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#T=s}catch(e){this.#R(e.code);return}}readlinkSync(){let t=this.#T;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#T=s}catch(e){this.#R(e.code);return}}#z(t){this.#e|=Je;for(let e=t.provisional;e<t.length;e++){let s=t[e];s&&s.#C()}}#C(){this.#e&z||(this.#e=(this.#e|z)&St,this.#U())}#U(){let t=this.children();t.provisional=0;for(let e of t)e.#C()}#N(){this.#e|=ne,this.#j()}#j(){if(this.#e&Et)return;let t=this.#e;(t&D)===I&&(t&=St),this.#e=t|Et,this.#U()}#B(t=""){t==="ENOTDIR"||t==="EPERM"?this.#j():t==="ENOENT"?this.#C():this.children().provisional=0}#A(t=""){t==="ENOTDIR"?this.parent.#j():t==="ENOENT"&&this.#C()}#R(t=""){let e=this.#e;e|=se,t==="ENOENT"&&(e|=z),(t==="EINVAL"||t==="UNKNOWN")&&(e&=St),this.#e=e,t==="ENOTDIR"&&this.parent&&this.parent.#j()}#G(t,e){return this.#$(t,e)||this.#D(t,e)}#D(t,e){let s=Ze(t),i=this.newChild(t.name,s,{parent:this}),n=i.#e&D;return n!==I&&n!==it&&n!==L&&(i.#e|=Et),e.unshift(i),e.provisional++,i}#$(t,e){for(let s=e.provisional;s<e.length;s++){let i=e[s];if((this.nocase?ie(t.name):Ot(t.name))===i.#O)return this.#V(t,i,s,e)}}#V(t,e,s,i){let n=e.name;return e.#e=e.#e&St|Ze(t),n!==t.name&&(e.name=t.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(e)),i.provisional++,e}async lstat(){if((this.#e&z)===0)try{return this.#q(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#A(t.code)}}lstatSync(){if((this.#e&z)===0)try{return this.#q(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#A(t.code)}}#q(t){let{atime:e,atimeMs:s,birthtime:i,birthtimeMs:n,blksize:o,blocks:h,ctime:a,ctimeMs:l,dev:c,gid:u,ino:f,mode:p,mtime:g,mtimeMs:d,nlink:b,rdev:m,size:y,uid:_}=t;this.#y=e,this.#a=s,this.#p=i,this.#E=n,this.#u=o,this.#l=h,this.#w=a,this.#b=l,this.#n=c,this.#d=u,this.#h=f,this.#i=p,this.#g=g,this.#s=d,this.#o=b,this.#f=m,this.#m=y,this.#r=_;let v=Ze(t);this.#e=this.#e&St|v|ni,v!==L&&v!==I&&v!==it&&(this.#e|=Et)}#L=[];#c=!1;#H(t){this.#c=!1;let e=this.#L.slice();this.#L.length=0,e.forEach(s=>s(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);e?t(null,n):queueMicrotask(()=>t(null,n));return}if(this.#L.push(t),this.#c)return;this.#c=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(n,o)=>{if(n)this.#B(n.code),s.provisional=0;else{for(let h of o)this.#G(h,s);this.#z(s)}this.#H(s.slice(0,s.provisional))})}#I;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#I)await this.#I;else{let s=()=>{};this.#I=new Promise(i=>s=i);try{for(let i of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#G(i,t);this.#z(t)}catch(i){this.#B(i.code),t.provisional=0}this.#I=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#G(s,t);this.#z(t)}catch(s){this.#B(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#e&ri)return!1;let t=D&this.#e;return t===L||t===I||t===it}shouldWalk(t,e){return(this.#e&I)===I&&!(this.#e&ri)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#k)return this.#k;if(!((ne|se|z)&this.#e))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#k=this.resolve(t)}catch{this.#N()}}realpathSync(){if(this.#k)return this.#k;if(!((ne|se|z)&this.#e))try{let t=this.#t.realpathSync(this.fullpath());return this.#k=this.resolve(t)}catch{this.#N()}}[pi](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),s=[],i=this;for(;i&&i.parent;)e.add(i),i.#S=s.join(this.sep),i.#M=s.join("/"),i=i.parent,s.push("..");for(i=t;i&&i.parent&&!e.has(i);)i.#S=void 0,i.#M=void 0,i=i.parent}};E.PathBase=R;var Ct=class r extends R{sep="\\";splitSep=nr;constructor(t,e=L,s,i,n,o,h){super(t,e,s,i,n,o,h)}newChild(t,e=L,s={}){return new r(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return er.exec(t)?.[0]??re.win32.parse(t).root}getRoot(t){if(t=ii(t.toUpperCase()),t===this.root.name||/^[\\/]$/.test(t))return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new At(t,{nocase:this.nocase,fs:this.fs}).root}sameRoot(t,e=this.root.name){return ii(t.toUpperCase())===e}};E.PathWin32=Ct;var Mt=class r extends R{splitSep="/";sep="/";constructor(t,e=L,s,i,n,o,h){super(t,e,s,i,n,o,h)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=L,s={}){return new r(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}};E.PathPosix=Mt;var kt=class{root;rootPath;roots;cwd;#t;#n;#i;nocase;#o;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:n=16*1024,fs:o=_t}={}){this.#o=ai(o),(t instanceof URL||t.startsWith("file://"))&&(t=(0,Vn.fileURLToPath)(t));let h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),this.#t=new xt,this.#n=new xt,this.#i=new oe(n);let a=h.substring(this.rootPath.length).split(s);if(a.length===1&&!a[0]&&a.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#o),this.roots[this.rootPath]=this.root;let l=this.root,c=a.length-1,u=e.sep,f=this.rootPath,p=!1;for(let g of a){let d=c--;l=l.child(g,{relative:new Array(d).fill("..").join(u),relativePosix:new Array(d).fill("..").join("/"),fullpath:f+=(p?"":u)+g}),p=!0}this.cwd=l}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#i}resolve(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#t.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpath();return this.#t.set(e,i),i}resolvePosix(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#n.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpathPosix();return this.#n.set(e,i),i}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let i=await t.readdir();return s?i:i.map(n=>n.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set,l=(u,f)=>{a.add(u),u.readdirCB((p,g)=>{if(p)return f(p);let d=g.length;if(!d)return f();let b=()=>{--d===0&&f()};for(let m of g)(!n||n(m))&&h.push(s?m:m.fullpath()),i&&m.isSymbolicLink()?m.realpath().then(y=>y?.isUnknown()?y.lstat():y).then(y=>y?.shouldWalk(a,o)?l(y,b):b()):m.shouldWalk(a,o)?l(m,b):b()},!0)},c=t;return new Promise((u,f)=>{l(c,p=>{if(p)return f(p);u(h)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set([t]);for(let l of a){let c=l.readdirSync();for(let u of c){(!n||n(u))&&h.push(s?u:u.fullpath());let f=u;if(u.isSymbolicLink()){if(!(i&&(f=u.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(a,o)&&a.add(f)}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e;(!n||n(t))&&(yield s?t:t.fullpath());let h=new Set([t]);for(let a of h){let l=a.readdirSync();for(let c of l){(!n||n(c))&&(yield s?c:c.fullpath());let u=c;if(c.isSymbolicLink()){if(!(i&&(u=c.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(h,o)&&h.add(u)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=new si.Minipass({objectMode:!0});(!n||n(t))&&h.write(s?t:t.fullpath());let a=new Set,l=[t],c=0,u=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){c===0&&h.end();return}c++,a.add(p);let g=(b,m,y=!1)=>{if(b)return h.emit("error",b);if(i&&!y){let _=[];for(let v of m)v.isSymbolicLink()&&_.push(v.realpath().then(S=>S?.isUnknown()?S.lstat():S));if(_.length){Promise.all(_).then(()=>g(null,m,!0));return}}for(let _ of m)_&&(!n||n(_))&&(h.write(s?_:_.fullpath())||(f=!0));c--;for(let _ of m){let v=_.realpathCached()||_;v.shouldWalk(a,o)&&l.push(v)}f&&!h.flowing?h.once("drain",u):d||u()},d=!0;p.readdirCB(g,!0),d=!1}};return u(),h}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=new si.Minipass({objectMode:!0}),a=new Set;(!n||n(t))&&h.write(s?t:t.fullpath());let l=[t],c=0,u=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){c===0&&h.end();return}c++,a.add(p);let g=p.readdirSync();for(let d of g)(!n||n(d))&&(h.write(s?d:d.fullpath())||(f=!0));c--;for(let d of g){let b=d;if(d.isSymbolicLink()){if(!(i&&(b=d.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(a,o)&&l.push(b)}}f&&!h.flowing&&h.once("drain",u)};return u(),h}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[pi](e)}};E.PathScurryBase=kt;var At=class extends kt{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;typeof t=="string"&&!t.startsWith("file://")&&(t=t.replace(sr,"").replace(ir,"\\")),super(t,re.win32,"\\",{...e,nocase:s}),this.nocase=s;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(t){return re.win32.parse(t).root.toUpperCase()}newRoot(t){return new Ct(this.rootPath,I,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}};E.PathScurryWin32=At;var Rt=class extends kt{sep="/";constructor(t=process.cwd(),e={}){let{nocase:s=!1}=e;super(t,re.posix,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new Mt(this.rootPath,I,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}};E.PathScurryPosix=Rt;var he=class extends Rt{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}};E.PathScurryDarwin=he;E.Path=process.platform==="win32"?Ct:Mt;E.PathScurry=process.platform==="win32"?At:process.platform==="darwin"?he:Rt});var ts=C(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.Pattern=void 0;var or=Y(),hr=r=>r.length>=1,ar=r=>r.length>=1,lr=Symbol.for("nodejs.util.inspect.custom"),Qe=class r{#t;#n;#i;length;#o;#r;#d;#f;#u;#h;#m=!0;constructor(t,e,s,i){if(!hr(t))throw new TypeError("empty pattern list");if(!ar(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#n=e,this.#i=s,this.#o=i,this.#i===0){if(this.isUNC()){let n=this.#l()?6:4,o=this.#t.slice(0,n),h=this.#n.slice(0,n),a=this.#t.slice(n),l=this.#n.slice(n);a[0]===""&&(a.shift(),l.shift());let c=[...o,""].join("/"),u=[...h,""].join("/");this.#t=[c,...a],this.#n=[u,...l],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#t,[h,...a]=this.#n;o[0]===""&&(o.shift(),a.shift());let l=`${n}/`,c=`${h}/`;this.#t=[l,...o],this.#n=[c,...a],this.length=this.#t.length}}}[lr](){return`Pattern <${this.#n.slice(this.#i).join("/")}>`}pattern(){return this.#t[this.#i]}isString(){return typeof this.#t[this.#i]=="string"}isGlobstar(){return this.#t[this.#i]===or.GLOBSTAR}isMatcher(){return typeof this.#t[this.#i]=="object"}globString(){return this.#d=this.#d||(this.#i===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#r!==void 0?this.#r:this.hasMore()?(this.#r=new r(this.#t,this.#n,this.#i+1,this.#o),this.#r.#h=this.#h,this.#r.#u=this.#u,this.#r.#f=this.#f,this.#r):this.#r=null}#l(){let t=this.#t;return t[2]==="?"&&typeof t[3]=="string"&&/^unc$/i.test(t[3])}isUNC(){let t=this.#t,e=this.#l()?4:2;return this.#u!==void 0?this.#u:this.#u=this.#o==="win32"&&this.#i===0&&t[0]===""&&t[1]===""&&typeof t[e]=="string"&&!!t[e]&&typeof t[e+1]=="string"&&!!t[e+1]}isDrive(){let t=this.#t;return this.#f!==void 0?this.#f:this.#f=this.#o==="win32"&&this.#i===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#h!==void 0?this.#h:this.#h=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#i===0?t:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#m)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#m?!1:(this.#m=!1,!0)}};le.Pattern=Qe});var is=C(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.Ignore=void 0;var es=Y(),cr=ts(),ur=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ss=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;slashRoot;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:n,normalize:o,platform:h=ur,root:a,windowsPathsNoEscape:l,allowWindowsEscape:c},u){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=h,l=!!l||c===!1,this.mmopts={dot:!0,nobrace:e,nocase:s,noext:i,noglobstar:n,normalize:o,optimizationLevel:2,platform:h,nocomment:!0,nonegate:!0,windowsPathsNoEscape:l};let f=u?.resolve(a??"/").fullpath()??"/";this.slashRoot=(0,es.escape)(f.replace(/\\/g,"/").replace(/\/$/,""),{windowsPathsNoEscape:l});for(let p of t)this.add(p)}add(t){let e=new es.Minimatch(t,this.mmopts);for(let s=0;s<e.set.length;s++){let i=e.set[s],n=e.globParts[s];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let o=new cr.Pattern(i,n,0,this.platform),h=o.root()==="/"?`${this.slashRoot}/${o.rest()?.globString()??""}`:o.globString(),a=new es.Minimatch(h,this.mmopts),l=n[n.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(a):this.relative.push(a),l&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(t){let e=t.fullpath(),s=`${e}/`,i=t.relative()||".",n=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(n))return!0;for(let o of this.absolute)if(o.match(e)||o.match(s))return!0;return!1}childrenIgnored(t){let e=`${t.fullpath()}/`,s=`${t.relative()||"."}/`;for(let i of this.relativeChildren)if(i.match(s))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}};ce.Ignore=ss});var wi=C($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.Processor=$.SubWalks=$.MatchRecord=$.HasWalkedCache=void 0;var gi=Y(),ue=class r{parent;store;constructor(t){this.parent=t}copy(){return new r(this)}#t(t){let e=this.store?.get(t);return e||!this.parent?e:this.parent.#t(t)}hasWalked(t,e){return!!this.#t(t.fullpath())?.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),i=this.#t(s);i?i.add(e.globString()):(this.store??=new Map).set(s,new Set([e.globString()]))}};$.HasWalkedCache=ue;var fe=class r{static ABSOLUTE=2;static IF_DIR=1;store=new Map;add(t,e,s){let i=(e?r.ABSOLUTE:0)|(s?r.IF_DIR:0),n=this.store.get(t);this.store.set(t,n===void 0?i:i&n)}};$.MatchRecord=fe;var de=class{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(i=>i.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}};$.SubWalks=de;var ns=class r{hasWalkedCache;matches=new fe;subwalks=new de;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new ue}processPatterns(t,e){this.patterns=e;let s=e.map(i=>[t,i]);for(let[i,n]of s){this.hasWalkedCache.storeWalked(i,n);let o=n.root(),h=n.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let u=n.rest();if(u)n=u;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let a,l,c=!1;for(;typeof(a=n.pattern())=="string"&&(l=n.rest());)i=i.resolve(a),n=l,c=!0;if(a=n.pattern(),l=n.rest(),c){if(this.hasWalkedCache.hasWalked(i,n))continue;this.hasWalkedCache.storeWalked(i,n)}if(typeof a=="string"){let u=a===".."||a===""||a===".";this.matches.add(i.resolve(a),h,u);continue}else if(a===gi.GLOBSTAR){(!i.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(i,n);let u=l?.pattern(),f=l?.rest();if(!l||(u===""||u===".")&&!f)this.matches.add(i,h,u===""||u===".");else if(u===".."){let p=i.parent||i;f?this.hasWalkedCache.hasWalked(p,f)||this.subwalks.add(p,f):this.matches.add(p,h,!0)}}else typeof a=="object"&&this.subwalks.add(i,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),i=this.child();for(let n of e)for(let o of s){let h=o.isAbsolute(),a=o.pattern(),l=o.rest();a===gi.GLOBSTAR?i.testGlobstar(n,o,l,h):typeof a=="object"?i.testMatcher(n,a,l,h):i.testString(n,a,l,h)}return i}testGlobstar(t,e,s,i){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),i);else if(n===".."){let o=t.parent||t;this.subwalks.add(o,s)}else typeof n=="object"&&this.testMatcher(t,n,s.rest(),i)}}testMatcher(t,e,s,i){e.testUnchecked(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}};$.Processor=ns});var yi=C(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.GlobStream=Q.GlobWalker=Q.GlobUtil=void 0;var fr=Ye(),bi=is(),rs=wi(),{ABSOLUTE:pe,IF_DIR:me}=rs.MatchRecord,dr=(r,t,e)=>typeof r=="string"?new bi.Ignore([r],t,e):Array.isArray(r)?new bi.Ignore(r,t,e):r,Pt=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#n;#i;signal;maxDepth;includeChildMatches;constructor(t,e,s){if(this.patterns=t,this.path=e,this.opts=s,this.#i=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#n=dr(s.ignore??[],s,e),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#o(t){return this.seen.has(t)||!!this.#n?.ignored?.(t)}#r(t){return!!this.#n?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.paused?this.#t.push(t):t()}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s,i;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;i=s}else i=t;let o=i.isUnknown()||this.opts.stat?await i.lstat():i;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let h=await o.realpath();h&&(h.isUnknown()||this.opts.stat)&&await h.lstat()}return this.matchCheckTest(o,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#o(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s,i;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;i=s}else i=t;let o=i.isUnknown()||this.opts.stat?i.lstatSync():i;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let h=o.realpathSync();h&&(h?.isUnknown()||this.opts.stat)&&h.lstatSync()}return this.matchCheckTest(o,e)}matchFinish(t,e){this.#o(t)||this.#d(t,e)}#d(t,e){if(!this.includeChildMatches&&this.#n?.add){let n=`${t.relativePosix()}/**`;this.#n.add(n)}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!n.startsWith(`..${this.#i}`)?`.${this.#i}`:"";this.matchEmit(n?o+n+i:`.${i}`)}}async match(t,e,s){let i=await this.matchCheck(t,s);i&&this.matchFinish(i,e)}matchSync(t,e,s){let i=this.matchCheckSync(t,s);i&&this.#d(i,e)}walkCB(t,e,s){if(this.signal?.aborted)return s();this.walkCB2(t,e,new rs.Processor(this.opts),s)}walkCB2(t,e,s,i){if(this.#r(t)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2(t,e,s,i));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a]of s.matches.store)this.#o(h)||(n++,this.match(h,!!(a&pe),!!(a&me)).then(()=>o()));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirCached();h.calledReaddir()?this.walkCB3(h,a,s,o):h.readdirCB((l,c)=>this.walkCB3(h,c,s,o),!0)}o()}walkCB3(t,e,s,i){let n=s.filterEntries(t,e),o=1,h=()=>{--o===0&&i()};for(let[a,l]of n.matches.store)this.#o(a)||(o++,this.match(a,!!(l&pe),!!(l&me)).then(()=>h()));for(let[a,l]of n.subwalks.entries())o++,this.walkCB2(a,l,n.child(),h);h()}walkCBSync(t,e,s){if(this.signal?.aborted)return s();this.walkCB2Sync(t,e,new rs.Processor(this.opts),s)}walkCB2Sync(t,e,s,i){if(this.#r(t)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,i));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a]of s.matches.store)this.#o(h)||this.matchSync(h,!!(a&pe),!!(a&me));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirSync();this.walkCB3Sync(h,a,s,o)}o()}walkCB3Sync(t,e,s,i){let n=s.filterEntries(t,e),o=1,h=()=>{--o===0&&i()};for(let[a,l]of n.matches.store)this.#o(a)||this.matchSync(a,!!(l&pe),!!(l&me));for(let[a,l]of n.subwalks.entries())o++,this.walkCB2Sync(a,l,n.child(),h);h()}};Q.GlobUtil=Pt;var os=class extends Pt{matches=[];constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.push(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};Q.GlobWalker=os;var hs=class extends Pt{results;constructor(t,e,s){super(t,e,s),this.results=new fr.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};Q.GlobStream=hs});var ls=C(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.Glob=void 0;var pr=Y(),mr=__webpack_require__(/*! node:url */ "node:url"),ge=mi(),gr=ts(),we=yi(),wr=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",as=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,mr.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");let s=typeof t=="string"?[t]:t;if(this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(s=s.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");s=s.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=s,this.platform=e.platform||wr,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=e.platform==="win32"?ge.PathScurryWin32:e.platform==="darwin"?ge.PathScurryDarwin:e.platform?ge.PathScurryPosix:ge.PathScurry;this.scurry=new l(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={braceExpandMax:1e4,...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape},o=this.pattern.map(l=>new pr.Minimatch(l,n)),[h,a]=o.reduce((l,c)=>(l[0].push(...c.set),l[1].push(...c.globParts),l),[[],[]]);this.patterns=h.map((l,c)=>{let u=a[c];if(!u)throw new Error("invalid pattern object");return new gr.Pattern(l,u,0,this.platform)})}async walk(){return await new we.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()}walkSync(){return new we.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()}stream(){return new we.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new we.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};be.Glob=as});var cs=C(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.hasMagic=void 0;var br=Y(),yr=(r,t={})=>{for(let e of Array.isArray(r)?r:[r])if(new br.Minimatch(e,t).hasMagic())return!0;return!1};ye.hasMagic=yr});Object.defineProperty(exports, "__esModule", ({value:!0}));exports.glob=exports.sync=exports.iterate=exports.iterateSync=exports.stream=exports.streamSync=exports.Ignore=exports.hasMagic=exports.Glob=exports.unescape=exports.escape=void 0;exports.globStreamSync=Tt;exports.globStream=us;exports.globSync=fs;exports.globIterateSync=Ft;exports.globIterate=ds;var Si=Y(),nt=ls(),Sr=cs(),_i=Y();Object.defineProperty(exports, "escape", ({enumerable:!0,get:function(){return _i.escape}}));Object.defineProperty(exports, "unescape", ({enumerable:!0,get:function(){return _i.unescape}}));var vr=ls();Object.defineProperty(exports, "Glob", ({enumerable:!0,get:function(){return vr.Glob}}));var _r=cs();Object.defineProperty(exports, "hasMagic", ({enumerable:!0,get:function(){return _r.hasMagic}}));var Er=is();Object.defineProperty(exports, "Ignore", ({enumerable:!0,get:function(){return Er.Ignore}}));function Tt(r,t={}){return new nt.Glob(r,t).streamSync()}function us(r,t={}){return new nt.Glob(r,t).stream()}function fs(r,t={}){return new nt.Glob(r,t).walkSync()}async function vi(r,t={}){return new nt.Glob(r,t).walk()}function Ft(r,t={}){return new nt.Glob(r,t).iterateSync()}function ds(r,t={}){return new nt.Glob(r,t).iterate()}exports.streamSync=Tt;exports.stream=Object.assign(us,{sync:Tt});exports.iterateSync=Ft;exports.iterate=Object.assign(ds,{sync:Ft});exports.sync=Object.assign(fs,{stream:Tt,iterate:Ft});exports.glob=Object.assign(vi,{glob:vi,globSync:fs,sync:exports.sync,globStream:us,stream:exports.stream,globStreamSync:Tt,streamSync:exports.streamSync,globIterate:ds,iterate:exports.iterate,globIterateSync:Ft,iterateSync:exports.iterateSync,Glob:nt.Glob,hasMagic:Sr.hasMagic,escape:Si.escape,unescape:Si.unescape});exports.glob.glob=exports.glob;
|
|
125066
|
+
`)},Re=class{gen;threads=[];match=!1;runs=[];ids=[];constructor(t){this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},Ts=(r,t)=>r.ids.length!==t.ids.length||r.runs.length!==t.runs.length||r.ids.some((e,s)=>e!==t.ids[s])?!1:r.runs.every(e=>t.runs.some(s=>s.neg===e.neg&&Ts(s.state,e.state))),xs=r=>({has:new Float64Array(r),seen:new Float64Array(r),gen:0}),dt=class{dots;dotStart;#t;constructor(t,e,s){this.dots=t,this.dotStart=e,this.#t=s}state(){return new Re(++this.#t.gen)}done(t){return t.ids=t.threads.map(e=>e.id).sort((e,s)=>e-s),t.match&&t.ids.unshift(Ae.id),t}#n(t,e){let{seen:s}=this.#t;return s[e.id]===t.gen?!1:(s[e.id]=t.gen,!0)}#i(t,e){let{has:s}=this.#t;return s[e.id]===t.gen?!1:(s[e.id]=t.gen,t.threads.push(e),!0)}restricted(t,e){return e&&(this.dots||this.dotStart&&t===0)}add(t,e,s,i){switch(e.t){case"split":if(!this.#n(t,e))return;for(let o of e.out)this.add(t,o,s,i);return;case"neg":if(!this.#n(t,e))return;let n=this.state();return this.add(n,e.sub,s,!1),this.done(n),this.addRun(t,{t:"run",neg:e,state:n},s,i);case"star":if(this.restricted(s,i))return;this.#i(t,e)&&this.add(t,e.next,s,i);return;case"match":t.match=!0;return;default:this.#i(t,e)}}addRun(t,e,s,i){for(let n of t.runs)if(n.neg===e.neg&&Ts(n.state,e.state))return;t.runs.push(e),e.state.match||this.add(t,e.neg.next,s,i)}step(t,e,s,i){let n=this.state();for(let o of t.threads)switch(o.t){case"lit":Fe(o,e)&&this.add(n,o.next,s+1,i);break;case"any":this.restricted(s,i)||this.add(n,o.next,s+1,i);break;case"class":!this.restricted(s,i)&&o.re.test(e)&&this.add(n,o.next,s+1,i);break;case"star":this.restricted(s,i)||this.add(n,o,s+1,i)}if(!this.restricted(s,i))for(let o of t.runs){if(o.state.dead){this.addRun(n,o,s+1,i);continue}let h=this.step(o.state,e,s,!1);this.addRun(n,{t:"run",neg:o.neg,state:h},s+1,i)}return this.done(n)}},Fs=r=>{let t=r.ids.join();if(!r.runs.length)return t;let e=r.runs.map(s=>`${s.neg.id}(${Fs(s.state)})`);return`${t}|${e.sort().join("|")}`},en=1<<18,Pe=class{#t;#n=new Map;#i=0;#o;#r;#d;#f;constructor(t,e){this.#t=t,this.#d=new dt(!1,!1,e),this.#f=new dt(!1,!0,e)}#u(t){return{state:t,match:t.match,dead:t.dead,next:new Map}}#h(t){let e=Fs(t),s=this.#n.get(e);if(s)return s;this.#i>en&&this.#m();let i=this.#u(t);return this.#n.set(e,i),this.#i+=e.length+1,i}#m(){this.#n.clear(),this.#i=0,this.#o=void 0,this.#r=void 0}start(t){if(t){if(this.#r)return this.#r;let s=this.#f.state();return this.#f.add(s,this.#t,0,!0),this.#r=this.#u(this.#f.done(s))}if(this.#o)return this.#o;let e=this.#d.state();return this.#d.add(e,this.#t,0,!0),this.#o=this.#h(this.#d.done(e))}next(t,e){let s=e.charCodeAt(0),i=s<128?void 0:t.next.get(e);if(i)return i;let n=t===this.#r?this.#h(this.#f.step(t.state,e,0,!0)):this.#h(this.#d.step(t.state,e,1,!0));return s<128?(t.ascii||(t.ascii=new Array(128),this.#i+=128),t.ascii[s]=n):t.next.set(e,n),this.#i++,n}},sn=r=>{let t=[];for(let e=r;e.t!=="match";e=e.next){if(e.t==="split"||e.t==="neg")return;t.push(e)}return t},nn=(r,t,e,s)=>{let i=0,n=e,o=-1,h=0;for(;n<s;){let a=r[i];if(a?.t==="star"){o=i++,h=n;continue}let l=t[n];if(a&&(a.t==="any"||a.t==="lit"&&Fe(a,l)||a.t==="class"&&a.re.test(l))){i++,n++;continue}if(o===-1)return!1;i=o+1,n=++h}for(;r[i]?.t==="star";)i++;return i===r.length},js=r=>{let t=0,e=0;for(let s of r){let[i,n]=rn(s);t+=i,e+=n}return[t,e]},rn=r=>{if(r.t==="star")return[0,1/0];if(r.t!=="ext")return[1,1];if(r.type==="!")return[0,1/0];let t=r.alts.map(js),e=Math.min(...t.map(n=>n[0])),s=Math.max(...t.map(n=>n[1])),i=s===0?0:1/0;return r.type==="@"?[e,s]:r.type==="?"?[0,s]:r.type==="*"?[0,i]:[e,i]},Cs=(r,t,e)=>{for(let s=0;s<r.length;s++)if(!Fe(r[s],t[e+s]))return!1;return!0},on=/[/\ud800-\udfff]/,hn=/[\ud800-\udfff]/,Lt=r=>hn.test(r)?[...r]:r,Ms=r=>{if(r.includes("/"))throw new Error("can only match a single path portion, got: "+r)},Te=class{pattern;options;#t;#n;#i;#o;#r;#d=!1;#f;#u;#h=!1;#m=0;#l=1/0;#a=[];#s=[];#b;#E;#y=!1;#g;#w;constructor(t,e={}){if(t.includes("/"))throw new Error("can only match a single path portion, got pattern: "+t);this.pattern=t,this.options=e;let{nocase:s=!1,noext:i=!1,normalize:n}=e;this.#w=n===!0?"NFC":n||void 0;let o=/^[?*+@]\(\)$/.test(t),h=Ji(t,s,i||o,this.#w,e.rangeMark),[a]=Rs(h,Zi(h),0,h.length,!0);this.#w&&(a=Ps(a,this.#w));let[l,c]=Qi(a,s);if(this.#t=l,this.#n=c,a.every(u=>u.t==="lit"))this.#r=a.map(u=>u.ch).join(""),this.#d=s;else{let u=g=>g.t!=="lit"?void 0:s?{ch:g.ch,re:As(g.ch)}:{ch:g.ch};for(let g of a){let d=u(g);if(!d)break;this.#a.push(d)}for(let g=a.length-1;g>=0;g--){let d=u(a[g]);if(!d)break;this.#s.unshift(d)}this.#y=!!(this.#a.length||this.#s.length),s||(this.#b=this.#a.map(g=>g.ch).join(""),this.#E=this.#s.map(g=>g.ch).join("")),this.#u=sn(this.#t)?.slice(this.#a.length,-this.#s.length||void 0),this.#h=!!this.#u?.every(g=>g.t==="star"||g.t==="any");let[f,p]=js(a);this.#m=f,this.#l=p}}test(t){return this.#w?(Ms(t),this.#p(t.normalize(this.#w))):on.test(t)?(Ms(t),this.#p(t,[...t])):this.#p(t,t)}testUnchecked(t){return this.#p(this.#w?t.normalize(this.#w):t)}#p(t,e){if(this.#r!==void 0)return this.#d?(this.#f??=ks(this.#r)).test(t):t===this.#r;let s=this.#m,i=this.#l;if(e===void 0){let c=t.length,u=c+1>>1;if(c<s||u>i)return!1;(u<s||c>i)&&(e=Lt(t))}if(e!==void 0&&(e.length<s||e.length>i))return!1;let n=this.#a.length;if(this.#y)if(this.#b!==void 0&&this.#E!==void 0){if(!t.startsWith(this.#b)||!t.endsWith(this.#E))return!1}else{e??=Lt(t);let c=e.length-this.#s.length;if(!Cs(this.#a,e,0)||!Cs(this.#s,e,c))return!1}let o=!this.options.dot&&t.startsWith(".");if(this.#u){if(t==="."||t===".."||o&&!n)return!1;if(this.#h)return!0;e??=Lt(t);let c=e.length-this.#s.length;return nn(this.#u,e,n,c)}if(e??=Lt(t),t==="."||t===".."){this.#i??=xs(this.#n);let c=this.#o??=new dt(!0,!1,this.#i),u=c.state();c.add(u,this.#t,0,!0);let f=c.done(u);for(let p=0;p<e.length;p++)f=c.step(f,e[p],p,!0);return f.match}this.#i??=xs(this.#n);let h=this.#g??=new Pe(this.#t,this.#i),a=h.start(o),l=e===t;for(let c=0;c<e.length;c++){if(a.dead)return!1;let u=l?t.charCodeAt(c):e[c].charCodeAt(0);a=a.ascii?.[u]??h.next(a,e[c])}return a.match}toString(){return tn(this.#t)}};Wt.Matcher=Te});var Ds=C(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.assertValidPattern=void 0;var an=1024*64,ln=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>an)throw new TypeError("pattern is too long")};zt.assertValidPattern=ln});var je=C(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.escape=void 0;var cn=(r,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):t?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");Bt.escape=cn});var Ne=C(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.unescape=void 0;var un=(r,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?r.replace(/\[([^/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?r.replace(/\[([^/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");Gt.unescape=un});var Y=C(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.unescape=w.escape=w.Minimatch=w.match=w.braceExpand=w.defaults=w.filter=w.GLOBSTAR=w.sep=w.minimatch=void 0;var fn=vs(),Ls=Ns(),Ut=Ds(),dn=je(),pn=Ne(),mn=(r,t,e={})=>((0,Ut.assertValidPattern)(t),!e.nocomment&&t.charAt(0)==="#"?!1:wn(t,e).match(r));w.minimatch=mn;var ot=new Map,gn=256,wn=(r,t)=>{let e=r+"\0"+JSON.stringify(t),s=ot.get(e);return s?ot.delete(e):(s=new ht(r,{...t}),ot.size>=gn&&ot.delete(ot.keys().next().value)),ot.set(e,s),s},$s=typeof process=="object"&&process?process.env?.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ws={win32:{sep:"\\"},posix:{sep:"/"}};w.sep=$s==="win32"?Ws.win32.sep:Ws.posix.sep;w.minimatch.sep=w.sep;w.GLOBSTAR=Symbol("globstar **");w.minimatch.GLOBSTAR=w.GLOBSTAR;var bn=(r,t={})=>e=>(0,w.minimatch)(e,r,t);w.filter=bn;w.minimatch.filter=w.filter;var q=(r,t={})=>Object.assign({},r,t),yn=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return w.minimatch;let t=w.minimatch;return Object.assign((s,i,n={})=>t(s,i,q(r,n)),{Minimatch:class extends t.Minimatch{constructor(i,n={}){super(i,q(r,n))}static defaults(i){return t.defaults(q(r,i)).Minimatch}},unescape:(s,i={})=>t.unescape(s,q(r,i)),escape:(s,i={})=>t.escape(s,q(r,i)),filter:(s,i={})=>t.filter(s,q(r,i)),defaults:s=>t.defaults(q(r,s)),braceExpand:(s,i={})=>t.braceExpand(s,q(r,i)),match:(s,i,n={})=>t.match(s,i,q(r,n)),sep:t.sep,GLOBSTAR:w.GLOBSTAR})};w.defaults=yn;w.minimatch.defaults=w.defaults;var Sn=(r,t={})=>((0,Ut.assertValidPattern)(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,fn.expand)(r,{max:t.braceExpandMax}));w.braceExpand=Sn;w.minimatch.braceExpand=w.braceExpand;var vn=100,_n=/(?<![\\$])\{(-?\d+)\.\.(-?\d+)\}/g,En=(r,t,e={})=>{let s=new ht(t,e);return r=r.filter(i=>s.match(i)),s.options.nonull&&!r.length&&r.push(t),r};w.match=En;w.minimatch.match=w.match;var zs=/[?*]|[+@!]\(.*?\)|\[|\]/,Us=(r,t)=>{let e=t+1;(r.charAt(e)==="!"||r.charAt(e)==="^")&&e++;let s=!1;for(;e<r.length;e++){let i=r.charAt(e);if(i==="]"&&s)return e;s=!0,i==="\\"&&e++}return-1},On=(r,t)=>{if(!t&&(r==="+()"||r==="@()"))return r;let e="";for(let s=0;s<r.length;s++){let i=r.charAt(s);if(i==="\\")e+=r.charAt(++s)||i;else{if(i==="*"||i==="?")return;if(i==="["){let n=Us(r,s);if(n===-1){e+=i;continue}let o=r.slice(s+1,n);if(o.startsWith("\\")&&(o=o.slice(1)),[...o].length!==1||"!^".includes(r.charAt(s+1)))return;e+=o,s=n}else{if(!t&&"+@!".includes(i)&&r.charAt(s+1)==="("&&r.includes(")",s+2))return;e+=i}}}return e},xn=r=>{if(/^[?*+@]\(\)$/.test(r)||r.includes("[:"))return!1;let t=0;for(let e=0;e<r.length;e++){let s=r.charAt(e);if(s==="\\"){if(++e===r.length)return!1}else if(s==="["){let i=Us(r,e);i!==-1&&(e=i)}else if("+@!?*".includes(s)&&r.charAt(e+1)==="(")t++,e++;else if(s===")"){if(!t--)return!1}else if(s==="|"&&!t)return!1}return!t},De,Bs,V=(r,t)=>typeof r=="string"?t===r:t!==""&&r.testUnchecked(t),Gs=(r,t,e,s,i)=>V(r,t)?e:s!==void 0&&V(r,s)?i:-1,Be=r=>r==="."||r==="..",Le=r=>typeof r=="string"&&/^[a-z]:$/i.test(r),$t=r=>typeof r=="string"&&/^unc$/i.test(r),We=r=>{if(r[0]!==""||r[1]!=="")return-1;let t=r[2]!=="?"?2:$t(r[3])?4:-1,e=r[t],s=r[t+1];return t!==-1&&e!==void 0&&e!==""&&e!==w.GLOBSTAR&&s!==void 0&&s!==""&&s!==w.GLOBSTAR?t:-1},It=(r,t)=>!Be(r)&&(t||!r.startsWith(".")),pt=(r,t,e,s,i)=>{for(let n=t;n<e;){if(r.charCodeAt(n)===46){if(!s)return!0;let h=r.charCodeAt(n+1)===46?n+2:n+1;if(h>=e||qt(r.charCodeAt(h),i))return!0}let o=Ge(r,n,i);if(o===-1)return!1;for(n=o+1;n<e&&qt(r.charCodeAt(n),i);)n++}return!1},qt=(r,t)=>t==="/"?r===47:t==="\\"?r===92:r===47||r===92,Ge=(r,t,e)=>{if(e!=="both")return r.indexOf(e,t);let s=r.indexOf("/",t),i=r.indexOf("\\",t);return s===-1?i:i===-1?s:Math.min(s,i)},Is=(r,t,e)=>e!=="both"?r.lastIndexOf(e,t):Math.max(r.lastIndexOf("/",t),r.lastIndexOf("\\",t)),ze={},ht=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;#t;#n;#i;#o;#r=[];#d=[];#f=[];#u=new Map;#h=!1;#m;#l=new WeakMap;constructor(t,e={}){(0,Ut.assertValidPattern)(t),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=t,this.platform=e.platform||$s,this.isWindows=this.platform==="win32";let s="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[s]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.#t=!this.preserveMultipleSlashes,this.#i=(e.optimizationLevel??1)>=2;let i=e.normalize;this.#o=i===!0?"NFC":i||void 0,this.make();let n=this.set.map(o=>this.#s(o));this.#f=this.set.map((o,h)=>this.#t&&o.length-1>n[h]),this.#r=this.set.map((o,h)=>{let a=this.#f[h]?o.length-1:o.length,l=o.slice(n[h]+1,a).filter(c=>typeof c=="string"&&!!c);return[...new Set(l)]}),this.#n=this.#r.some(o=>o.length),this.#d=this.set.map((o,h)=>{let[a,l,c]=o;if(this.#f[h]&&o.length===2&&a===w.GLOBSTAR&&l!==w.GLOBSTAR)return"tail";if(this.#f[h]&&e.matchBase&&o.length===1&&a!==w.GLOBSTAR&&a!=="")return"base";if(!(!this.#t||n[h]!==-1)){if(o.length===3&&a===w.GLOBSTAR&&c===w.GLOBSTAR&&l!==w.GLOBSTAR&&l!==""&&this.maxGlobstarRecursion>0)return"mid";if(o.length===2&&l===w.GLOBSTAR&&a!==w.GLOBSTAR&&a!=="")return"head"}})}#a(t){return this.#o?t.normalize(this.#o):t}#s(t){if(!this.isWindows)return-1;if(Le(t[0]))return 0;if(t[0]===""&&t[1]===""&&t[2]==="?"&&Le(t[3]))return 3;let s=We(t);return s===-1?-1:s+1}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.#M())];let s=this.globSet.map(n=>this.#e(n));this.globParts=this.preprocess(s),this.#h=!0;let i=this.globParts.map((n,o,h)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=n[2]==="?"&&$t(n[3])?6:4,l=n[0]===""&&n[1]===""&&(n[2]==="?"||!zs.test(n[2]))&&n.slice(3,a).every(u=>!zs.test(u)),c=/^[a-z]:/i.test(n[0]);if(l)return[...n.slice(0,a).map(u=>this.#a(u)),...n.slice(a).map(u=>this.parse(u))];if(c)return[this.#a(n[0]),...n.slice(1).map(u=>this.parse(u))]}return n.map(a=>this.parse(a))});if(this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let o=this.set[n];o[0]===""&&o[1]===""&&this.globParts[n][2]==="?"&&(Le(o[3])||$t(this.globParts[n][3]))&&($t(this.globParts[n][3])&&(o[3]="UNC"),o[2]="?")}e.noext||this.mergeRows(),this.#h=!1,this.set.forEach((n,o)=>{for(let h=0;h<n.length;h++)n[h]===ze&&(n[h]=this.parse(this.globParts[o][h]))})}mergeRows(){let t=!0;for(;t;){t=!1;let e=Math.max(0,...this.set.map(s=>s.length));for(let s=0;s<e;s++){let i=new Map;this.set.forEach((o,h)=>{if(!(o[s]instanceof Ls.Matcher||o[s]===ze)||!xn(this.globParts[h][s]))return;let a=[...this.globParts[h]];a[s]="";let l=`${o.length}/${a.join("/")}`,c=i.get(l);c?c.push(h):i.set(l,[h])});let n=new Set;for(let o of i.values()){if(o.length<2)continue;let[h,...a]=o,c=`@(${o.map(u=>this.globParts[u][s]).join("|")})`;this.globParts[h][s]=c,this.set[h][s]=this.parse(c);for(let u of a)n.add(u)}n.size&&(t=!0,this.set=this.set.filter((o,h)=>!n.has(h)),this.globParts=this.globParts.filter((o,h)=>!n.has(h)))}}}preprocess(t){if(this.options.noglobstar)for(let s of t)for(let i=0;i<s.length;i++)s[i]==="**"&&(s[i]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let i=s;for(;e[i+1]==="**";)i++;i!==s&&e.splice(s,i-s)}return e})}levelOneOptimize(t){return t.map(e=>{let s=this.#s(e)+1;return e=e.reduce((i,n)=>{let o=i[i.length-1];return n==="**"&&o==="**"?i:n===".."&&i.length>s&&o&&o!==".."&&o!=="."&&o!=="**"?(i.pop(),i):(i.push(n),i)},[]),e.length===0?[""]:e})}#b(t){let e=!this.isWindows||!t.includes("\\")?"/":t.includes("/")?"both":"\\",s=this.#t?0:-1,i="",n=0,o,h=0,a=!!this.options.dot;t:for(let l=0;l<this.set.length;l++){let c=this.set[l],u=c[c.length-1],f=s!==-1&&this.#f[l]&&u!==w.GLOBSTAR;if(f&&s===0){let d=Is(t,t.length,e);if(n=d+1,i=t.slice(n),i===""&&d>=0){let m=d;for(;m>0&&qt(t.charCodeAt(m-1),e);)m--;h=m===0?0:Is(t,m-1,e)+1,o=t.slice(h,m)}let b=this.#i&&(Be(i)||i===""&&o!==void 0&&Be(o));s=b?-1:1,f=!b}let p=-1;if(f&&typeof u=="string"&&(p=Gs(u,i,n,o,h),p===-1))continue;if(this.#n){for(let d of this.#r[l])if(!t.includes(d))continue t}if(f&&typeof u=="object"&&(p=Gs(u,i,n,o,h),p===-1))continue;let g=this.#d[l];if(g==="base"&&f)return"yes";if(g==="tail"&&f){if(this.#i&&pt(t,0,p,!0,e))return"maybe";if(!pt(t,0,p,a,e))return"yes";continue}if(g==="mid"||g==="head"){let d=this.#y(t,c,g==="head",a,e);if(d!=="no")return d;continue}return"maybe"}return"no"}#E(t,e,s){let i=!!this.options.dot,n=t.length;if(s==="head"){if(n<2||!V(e[0],t[0]))return!1;for(let h=1;h<n;h++)if(!It(t[h],i))return!1;return!0}let o=e[1];if(s==="tail"){let h=n-1;if(!V(o,t[h])&&(t[h]!==""||n===1||!V(o,t[--h])))return!1;for(let a=0;a<h;a++)if(!It(t[a],i))return!1;return!0}for(let h=0;h<n;h++){if(V(o,t[h])&&h+1<n){let a=h+1;for(;a<n&&It(t[a],i);)a++;if(a===n)return!0}if(!It(t[h],i))return!1}return!1}#y(t,e,s,i,n){if(this.#i&&pt(t,0,t.length,!0,n))return"maybe";let o=e[s?0:1],h=0;for(let a=Ge(t,h,n);a!==-1;a=Ge(t,h,n)){let l=a+1;for(;l<t.length&&qt(t.charCodeAt(l),n);)l++;if((typeof o=="string"?a-h===o.length&&t.startsWith(o,h):a>h&&o.testUnchecked(t.slice(h,a)))&&!pt(t,l,t.length,i,n))return"yes";if(s||pt(t,h,l,i,n))return"no";h=l}return"no"}#g(t){let e=De;return e?.f===t&&e.isWindows===this.isWindows&&e.preserveMultipleSlashes===this.preserveMultipleSlashes&&e.normalize===this.#o?e:void 0}#w(t){let{isWindows:e,preserveMultipleSlashes:s}=this,i=this.#e(e?t.split("\\").join("/"):t),n=this.#o;return n&&(i=i.map(o=>o.normalize(n))),De={f:t,isWindows:e,preserveMultipleSlashes:s,normalize:n,parts:i},De}#p(t){let e=[...t],s=!1;do{if(s=!1,!this.preserveMultipleSlashes){for(let o=1;o<e.length-1;o++){let h=e[o];o===1&&h===""&&e[0]===""||(h==="."||h==="")&&(s=!0,e.splice(o,1),o--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(s=!0,e.pop())}let i=this.#s(e)+1,n=i;for(;(n=e.indexOf("..",n+1))!==-1;){let o=e[n-1];o&&o!=="."&&o!==".."&&o!=="**"&&(s=!0,e.splice(n-1,2),n=Math.max(n-2,i))}}while(s);return e.length===0?[""]:e}firstPhasePreProcess(t){let{braceExpandMax:e=1e5}=this.options,s=0,i=1e6,n=!1;do{n=!1;for(let o of t){let h=-1;for(;(h=o.indexOf("**",h+1))!==-1;){let c=h;for(;o[c+1]==="**";)c++;c>h&&o.splice(h+1,c-h);let u=o[h+1],f=o[h+2],p=o[h+3];if(u!==".."||!f||f==="."||f===".."||!p||p==="."||p==="..")continue;let g=o.length-1;if(t.length>=e||s+g>i)throw new RangeError("optimizationLevel 2: too many patterns from '**/..'");n=!0,o.splice(h,1);let d=o.slice(0);d[h]="**",s+=g,t.push(d),h--}if(!this.preserveMultipleSlashes){for(let c=1;c<o.length-1;c++){let u=o[c];c===1&&u===""&&o[0]===""||(u==="."||u==="")&&(n=!0,o.splice(c,1),c--)}o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")&&(n=!0,o.pop())}let a=this.#s(o)+1,l=a;for(;(l=o.indexOf("..",l+1))!==-1;){let c=o[l-1];if(c&&c!=="."&&c!==".."&&c!=="**"){n=!0;let f=l===1&&o[l+1]==="**"?["."]:[];o.splice(l-1,2,...f),o.length===0&&o.push(""),l=Math.max(l-2,a)}}}}while(n);return t}secondPhasePreProcess(t){let e=new Set,s=t.filter(o=>{let h=o.join("/");return e.has(h)?!1:(e.add(h),!0)}),i=new Map;for(let o of s){let h=[];for(let a=0;a<o.length;a++)o[a]==="*"&&h.push(a);h.length&&i.set(h.join(","),h)}if(!i.size||s.length*i.size>1e5)return s;let{dot:n}=this.options;return s.filter(o=>{for(let h of i.values()){if(h[h.length-1]>=o.length)continue;let a=[...o],l=!0,c=!1;for(let u of h){let f=o[u];if(f!=="*"){if(!f||f==="**"||!n&&f.startsWith(".")){l=!1;break}a[u]="*",c=!0}}if(l&&c&&e.has(a.join("/")))return!1}return!0})}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}#O(t,e,s,i){let n=0,o=0,h=this.isWindows?We(e):-1,a=h===-1?-1:We(s);if(a!==-1){let l=s[a],c=s[a+1];typeof l!="string"||typeof c!="string"?(n=h,o=a):e[h].toLowerCase()===l.toLowerCase()&&e[h+1].toLowerCase()===c.toLowerCase()&&(n=h+2,o=a+2)}else if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof s[0]=="string"&&/^[a-z]:$/i.test(s[0]),f=!u&&s[0]===""&&s[1]===""&&s[2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3]),p=c?3:l?0:void 0,g=f?3:u?0:void 0;if(typeof p=="number"&&typeof g=="number"){let[d,b]=[t[p],s[g]];d.toLowerCase()===b.toLowerCase()&&(o=g+1,n=p+1)}}return t=e,s.includes(w.GLOBSTAR)?this.#x(t,s,i,n,o):this.#S(t,s,i,n,o)}#x(t,e,s,i,n){let{head:o,body:h,tail:a,segments:l}=this.#v(e,s,n);if(o.length){let u=i+o.length;if(!this.#S(t,o,s,i,0,u))return!1;i+=o.length,n+=o.length}let c=0;if(a.length){if(a.length+i>t.length)return!1;let u=t.length-a.length;if(this.#S(t,a,s,u,0))c=a.length;else{if(t[t.length-1]!==""||i+a.length===t.length||(u--,!this.#S(t,a,s,u,0)))return!1;c=a.length+1}}if(!h.length){let u=!!c;for(let f=i;f<t.length-c;f++){let p=String(t[f]);if(u=!0,p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return s||u}return!!this.#_(t,l,t.length-c,i,0,s,0,!!c,new Set)}#v(t,e,s){let i=this.#l.get(t);i||(i=[],this.#l.set(t,i));let n=s*2+(e?1:0),o=i[n];if(o)return o;let h=t.indexOf(w.GLOBSTAR,s),a=t.lastIndexOf(w.GLOBSTAR),l=t.slice(s,h),c=t.slice(h+1,e?void 0:a),u=e?[]:t.slice(a+1),f=[[[],0]],p=f[0],g=0,d=[0];for(let m of c)m===w.GLOBSTAR?(d.push(g),p=[[],0],f.push(p)):(p[0].push(m),g++);f.forEach((m,y)=>{m[1]=g-d[y]});let b={head:l,body:c,tail:u,segments:f};return i[n]=b,b}#_(t,e,s,i,n,o,h,a,l){let c=e[n];if(!c){if(o)return i>=s||i===s-1&&t[i]==="";for(let g=i;g<s;g++){a=!0;let d=t[g];if(d==="."||d===".."||!this.options.dot&&d.startsWith("."))return!1}return a}let[u,f]=c,p=o?s:s-f;for(;i<=p;){let g=n*(t.length+1)+i;if(l.has(g))return!1;if(l.add(g),this.#S(t,u,o,i,0,i+u.length)&&h<this.maxGlobstarRecursion){let m=this.#_(t,e,s,i+u.length,n+1,o,h+1,a,l);if(m!==!1)return m}if(i===p)break;let b=t[i];if(b==="."||b===".."||!this.options.dot&&b.startsWith("."))return!1;i++}return o||null}#S(t,e,s,i,n,o=t.length){let h,a,l,c;for(h=i,a=n,c=Math.min(o,t.length),l=e.length;h<c&&a<l;h++,a++){let u=e[a],f=t[h];if(u===!1||u===w.GLOBSTAR||!V(u,f))return!1}if(h===c&&a===l)return!0;if(h===c)return s;if(a===l)return h===c-1&&t[h]==="";throw new Error("wtf?")}braceExpand(){return(0,w.braceExpand)(this.pattern,this.options)}#M(){let{pattern:t}=this;if(this.options.nobrace)return this.braceExpand();let e=57344;for(;t.includes(String.fromCharCode(e));)if(++e>63743)return this.braceExpand();let s=String.fromCharCode(e),i=!1,n=t.replace(_n,(h,a,l)=>{let c=Number(a),u=Number(l);return!Number.isSafeInteger(c)||!Number.isSafeInteger(u)||Math.abs(c-u)+1<vn?h:(i=!0,`${s}${a}..${l}${s}`)});if(!i)return this.braceExpand();let o=(0,w.braceExpand)(n,this.options);for(let h of o)for(let a of h.split("/")){let l=a.indexOf("[");if(l!==-1&&l<a.lastIndexOf(s))return this.braceExpand()}return this.#m=s,o}parse(t){(0,Ut.assertValidPattern)(t);let e=this.options;if(t==="**")return w.GLOBSTAR;if(t==="")return"";let{nocase:s,nocaseMagicOnly:i,noext:n=!1,dot:o,normalize:h}=e,a=this.#m,l=a&&t.includes(a)?void 0:On(t,n);if(l!==void 0&&!(s&&!i&&t.toUpperCase()!==t.toLowerCase()))return this.#a(l);if(this.#h)return ze;let c=this.#u.get(t);return c||(c=new Ls.Matcher(t,{nocase:s,noext:n,dot:o,normalize:h,...a&&{rangeMark:a}}),this.#u.set(t,c)),c}#e(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options,i=this.#g(t);if(!i){if(!e&&!this.#o&&(this.#t||this.#n)&&Bs!==t){Bs=t;let l=this.#b(t);if(l==="no")return s.flipNegate?!1:this.negate;if(l==="yes")return s.flipNegate?!0:!this.negate}i=this.#w(t)}let n=i.parts,o=this.#i?i.resolved??=this.#p(n):n,h=this.set,a=n[n.length-1];if(!a)for(let l=n.length-2;!a&&l>=0;l--)a=n[l];for(let l=0;l<h.length;l++){let c=h[l],u=e?void 0:this.#d[l];if(u==="base"?V(c[0],a):u?this.#E(o,c,u):s.matchBase&&c.length===1?this.#O([a],[a],c,e):this.#O(n,o,c,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return w.minimatch.defaults(t).Minimatch}};w.Minimatch=ht;var Cn=je();Object.defineProperty(w,"escape",{enumerable:!0,get:function(){return Cn.escape}});var Mn=Ne();Object.defineProperty(w,"unescape",{enumerable:!0,get:function(){return Mn.unescape}});w.minimatch.Minimatch=ht;w.minimatch.escape=dn.escape;w.minimatch.unescape=pn.unescape});var Ys=C(Xt=>{"use strict";var Hs=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),kn=Hs(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.tracing=r.metrics=void 0;var t=__webpack_require__(/*! node:diagnostics_channel */ "node:diagnostics_channel");r.metrics=(0,t.channel)("lru-cache:metrics"),r.tracing=(0,t.tracingChannel)("lru-cache")}),An=Hs(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.defaultPerf=void 0,r.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(Xt,"__esModule",{value:!0});Xt.LRUCache=void 0;var O=kn(),Rn=An(),Ie=()=>O.metrics.hasSubscribers||O.tracing.hasSubscribers,Xs=new Set,qs=typeof process=="object"&&process?process:{},Pn=(r,t,e,s)=>{typeof qs.emitWarning=="function"?qs.emitWarning(r,t,e,s):console.error(`[${e}] ${t}: ${r}`)},Tn=r=>!Xs.has(r),J=r=>!!r&&r===Math.floor(r)&&r>0&&isFinite(r),Ks=r=>J(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Ht:null:null,Ht=class extends Array{constructor(r){super(r),this.fill(0)}},Fn=class mt{heap;length;static#t=!1;static create(t){let e=Ks(t);if(!e)return[];mt.#t=!0;let s=new mt(t,e);return mt.#t=!1,s}constructor(t,e){if(!mt.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},jn=class Vs{#t;#n;#i;#o;#r;#d;#f;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#h;#m;#l;#a;#s;#b;#E;#y;#g;#w;#p;#O;#x;#v;#_;#S;#M;#e;#P;static unsafeExposeInternals(t){return{starts:t.#x,ttls:t.#v,autopurgeTimers:t.#_,sizes:t.#O,keyMap:t.#l,keyList:t.#a,valList:t.#s,next:t.#b,prev:t.#E,get head(){return t.#y},get tail(){return t.#g},free:t.#w,isBackgroundFetch:e=>t.#c(e),backgroundFetch:(e,s,i,n)=>t.#L(e,s,i,n),moveToTail:e=>t.#K(e),indexes:e=>t.#A(e),rindexes:e=>t.#R(e),isStale:e=>t.#C(e)}}get max(){return this.#t}get maxSize(){return this.#n}get calculatedSize(){return this.#m}get size(){return this.#h}get fetchMethod(){return this.#d}get memoMethod(){return this.#f}get dispose(){return this.#i}get onInsert(){return this.#o}get disposeAfter(){return this.#r}constructor(t){let{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:h,allowStale:a,dispose:l,onInsert:c,disposeAfter:u,noDisposeOnSet:f,noUpdateTTL:p,maxSize:g=0,maxEntrySize:d=0,sizeCalculation:b,fetchMethod:m,memoMethod:y,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:K,ignoreFetchAbort:B,backgroundFetchSize:U=1,perf:rt}=t;if(this.backgroundFetchSize=U,rt!==void 0&&typeof rt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=rt??Rn.defaultPerf,e!==0&&!J(e))throw new TypeError("max option must be a nonnegative integer");let Se=e?Ks(e):Array;if(!Se)throw new Error("invalid max value: "+e);if(this.#t=e,this.#n=g,this.maxEntrySize=d||this.#n,this.sizeCalculation=b,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=y,m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#d=m,this.#M=!!m,this.#l=new Map,this.#a=Array.from({length:e}).fill(void 0),this.#s=Array.from({length:e}).fill(void 0),this.#b=new Se(e),this.#E=new Se(e),this.#y=0,this.#g=0,this.#w=Fn.create(e),this.#h=0,this.#m=0,typeof l=="function"&&(this.#i=l),typeof c=="function"&&(this.#o=c),typeof u=="function"?(this.#r=u,this.#p=[]):(this.#r=void 0,this.#p=void 0),this.#S=!!this.#i,this.#P=!!this.#o,this.#e=!!this.#r,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!K,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#n!==0&&!J(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!J(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#U()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h,this.ttlResolution=J(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!J(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T()}if(this.#t===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#n){let ve="LRU_CACHE_UNBOUNDED";Tn(ve)&&(Xs.add(ve),Pn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ve,Vs))}}getRemainingTTL(t){return this.#l.has(t)?1/0:0}#T(){let t=new Ht(this.#t),e=new Ht(this.#t);this.#v=t,this.#x=e;let s=this.ttlAutopurge?Array.from({length:this.#t}):void 0;this.#_=s,this.#z=(a,l,c=this.#u.now())=>{e[a]=l!==0?c:0,t[a]=l,i(a,l)},this.#k=a=>{e[a]=t[a]!==0?this.#u.now():0,i(a,t[a])};let i=this.ttlAutopurge?(a,l)=>{if(s?.[a]&&(clearTimeout(s[a]),s[a]=void 0),l&&l!==0&&s){let c=setTimeout(()=>{this.#C(a)?(this.#W(this.#a[a],"expire"),s[a]=void 0):i(a,h(a))},l+1);c.unref&&c.unref(),s[a]=c}}:()=>{};this.#F=(a,l)=>{if(t[l]){let c=t[l],u=e[l];if(!c||!u)return;a.ttl=c,a.start=u,a.now=n||o();let f=a.now-u;a.remainingTTL=c-f}};let n=0,o=()=>{let a=this.#u.now();if(this.ttlResolution>0){n=a;let l=setTimeout(()=>n=0,this.ttlResolution);l.unref&&l.unref()}return a};this.getRemainingTTL=a=>{let l=this.#l.get(a);return l===void 0?0:h(l)};let h=a=>{let l=t[a],c=e[a];if(!l||!c)return 1/0;let u=(n||o())-c;return l-u};this.#C=a=>{let l=e[a],c=t[a];return!!c&&!!l&&(n||o())-l>c}}#k=()=>{};#F=()=>{};#z=()=>{};#C=()=>!1;#U(){let t=new Ht(this.#t);this.#m=0,this.#O=t,this.#N=e=>{this.#m-=t[e],t[e]=0},this.#B=(e,s,i,n)=>{if(!J(i)){if(this.#c(s))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(s,e),!J(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#j=(e,s,i)=>{if(t[e]=s,this.#n){let n=this.#n-t[e];for(;this.#m>n;)this.#$(!0)}this.#m+=t[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#m)}}#N=t=>{};#j=(t,e,s)=>{};#B=(t,e,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#g;this.#G(e)&&((t||!this.#C(e))&&(yield e),e!==this.#y);)e=this.#E[e]}*#R({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#y;this.#G(e)&&((t||!this.#C(e))&&(yield e),e!==this.#g);)e=this.#b[e]}#G(t){return t!==void 0&&this.#l.get(this.#a[t])===t}*entries(){for(let t of this.#A())this.#s[t]!==void 0&&this.#a[t]!==void 0&&!this.#c(this.#s[t])&&(yield[this.#a[t],this.#s[t]])}*rentries(){for(let t of this.#R())this.#s[t]!==void 0&&this.#a[t]!==void 0&&!this.#c(this.#s[t])&&(yield[this.#a[t],this.#s[t]])}*keys(){for(let t of this.#A()){let e=this.#a[t];e!==void 0&&!this.#c(this.#s[t])&&(yield e)}}*rkeys(){for(let t of this.#R()){let e=this.#a[t];e!==void 0&&!this.#c(this.#s[t])&&(yield e)}}*values(){for(let t of this.#A())this.#s[t]!==void 0&&!this.#c(this.#s[t])&&(yield this.#s[t])}*rvalues(){for(let t of this.#R())this.#s[t]!==void 0&&!this.#c(this.#s[t])&&(yield this.#s[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#A()){let i=this.#s[s],n=this.#c(i)?i.__staleWhileFetching:i;if(n!==void 0&&t(n,this.#a[s],this))return this.#X(this.#a[s],e)}}forEach(t,e=this){for(let s of this.#A()){let i=this.#s[s],n=this.#c(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#a[s],this)}}rforEach(t,e=this){for(let s of this.#R()){let i=this.#s[s],n=this.#c(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#a[s],this)}}purgeStale(){let t=!1;for(let e of this.#R({allowStale:!0}))this.#C(e)&&(this.#W(this.#a[e],"expire"),t=!0);return t}info(t){let e=this.#l.get(t);if(e===void 0)return;let s=this.#s[e],i=this.#c(s)?s.__staleWhileFetching:s;if(i===void 0)return;let n={value:i};if(this.#v&&this.#x){let o=this.#v[e],h=this.#x[e];if(o&&h){let a=o-(this.#u.now()-h);n.ttl=a,n.start=Date.now()}}return this.#O&&(n.size=this.#O[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let s=this.#a[e],i=this.#s[e],n=this.#c(i)?i.__staleWhileFetching:i;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#v&&this.#x){o.ttl=this.#v[e];let h=this.#u.now()-this.#x[e];o.start=Math.floor(Date.now()-h)}this.#O&&(o.size=this.#O[e]),t.unshift([s,o])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let i=Date.now()-s.start;s.start=this.#u.now()-i}this.#D(e,s.value,s)}}set(t,e,s={}){let{status:i=O.metrics.hasSubscribers?{}:void 0}=s;s.status=i,i&&(i.op="set",i.key=t,e!==void 0&&(i.value=e),i.cache=this);let n=this.#D(t,e,s);return i&&O.metrics.hasSubscribers&&O.metrics.publish(i),n}#D(t,e,s,i){let{ttl:n=this.ttl,start:o,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=s,c=this.#c(e);if(e===void 0)return l&&(l.set="deleted"),this.delete(t),this;let{noUpdateTTL:u=this.noUpdateTTL}=s;l&&!c&&(l.value=e);let f=this.#B(t,e,s.size||0,a,l);if(this.maxEntrySize&&f>this.maxEntrySize)return this.#W(t,"set"),l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this;let p=this.#h===0?void 0:this.#l.get(t);if(p===void 0)p=this.#h===0?this.#g:this.#w.length!==0?this.#w.pop():this.#h===this.#t?this.#$(!1):this.#h,this.#a[p]=t,this.#s[p]=e,this.#l.set(t,p),this.#b[this.#g]=p,this.#E[p]=this.#g,this.#g=p,this.#h++,this.#j(p,f,l),l&&(l.set="add"),u=!1,this.#P&&!c&&this.#o?.(e,t,"add");else{this.#K(p);let g=this.#s[p];if(e!==g){if(!h)if(this.#c(g)){g!==i&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=g;d!==void 0&&d!==e&&(this.#S&&this.#i?.(d,t,"set"),this.#e&&this.#p?.push([d,t,"set"]))}else this.#S&&this.#i?.(g,t,"set"),this.#e&&this.#p?.push([g,t,"set"]);if(this.#N(p),this.#j(p,f,l),this.#s[p]=e,!c){let d=g&&this.#c(g)?g.__staleWhileFetching:g,b=d===void 0?"add":e!==d?"replace":"update";l&&(l.set=b,d!==void 0&&(l.oldValue=d)),this.#P&&this.onInsert?.(e,t,b)}}else c||(l&&(l.set="update"),this.#P&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#v&&this.#T(),this.#v&&(u||this.#z(p,n,o),l&&this.#F(l,p)),!h&&this.#e&&this.#p){let g=this.#p,d;for(;d=g?.shift();)this.#r?.(...d)}return this}pop(){try{for(;this.#h;){let t=this.#s[this.#y];if(this.#$(!0),this.#c(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#e&&this.#p){let t=this.#p,e;for(;e=t?.shift();)this.#r?.(...e)}}}#$(t){let e=this.#y,s=this.#a[e],i=this.#s[e],n=this.#c(i);n&&i.__abortController.abort(new Error("evicted"));let o=n?i.__staleWhileFetching:i;return(this.#S||this.#e)&&o!==void 0&&(this.#S&&this.#i?.(o,s,"evict"),this.#e&&this.#p?.push([o,s,"evict"])),this.#N(e),this.#_?.[e]&&(clearTimeout(this.#_[e]),this.#_[e]=void 0),t&&(this.#a[e]=void 0,this.#s[e]=void 0,this.#w.push(e)),this.#h===1?(this.#y=this.#g=0,this.#w.length=0):this.#y=this.#b[e],this.#l.delete(s),this.#h--,e}has(t,e={}){let{status:s=O.metrics.hasSubscribers?{}:void 0}=e;e.status=s,s&&(s.op="has",s.key=t,s.cache=this);let i=this.#V(t,e);return O.metrics.hasSubscribers&&O.metrics.publish(s),i}#V(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,n=this.#l.get(t);if(n!==void 0){let o=this.#s[n];if(this.#c(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#C(n))i&&(i.has="stale",this.#F(i,n));else return s&&this.#k(n),i&&(i.has="hit",this.#F(i,n)),!0}else i&&(i.has="miss");return!1}peek(t,e={}){let{status:s=Ie()?{}:void 0}=e;s&&(s.op="peek",s.key=t,s.cache=this),e.status=s;let i=this.#q(t,e);return O.metrics.hasSubscribers&&O.metrics.publish(s),i}#q(t,e){let{status:s,allowStale:i=this.allowStale}=e,n=this.#l.get(t);if(n===void 0||!i&&this.#C(n)){s&&(s.peek=n===void 0?"miss":"stale");return}let o=this.#s[n],h=this.#c(o)?o.__staleWhileFetching:o;return s&&(h!==void 0?(s.peek="hit",s.value=h):s.peek="miss"),h}#L(t,e,s,i){let n=e===void 0?void 0:this.#s[e];if(this.#c(n))return n;let o=new AbortController,{signal:h}=s;h?.addEventListener("abort",()=>o.abort(h.reason),{signal:o.signal});let a={signal:o.signal,options:s,context:i},l=(d,b=!1)=>{let{aborted:m}=o.signal,y=s.ignoreFetchAbort&&d!==void 0,_=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&d!==void 0);if(s.status&&(m&&!b?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,y&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),m&&!y&&!b)return u(o.signal.reason,_);let v=p,S=this.#s[e];return(S===p||S===void 0&&y&&b)&&(d===void 0?v.__staleWhileFetching!==void 0?this.#s[e]=v.__staleWhileFetching:this.#W(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.#D(t,d,a.options,v))),d},c=d=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=d),u(d,!1)),u=(d,b)=>{let{aborted:m}=o.signal,y=m&&s.allowStaleOnFetchAbort,_=y||s.allowStaleOnFetchRejection,v=_||s.noDeleteOnFetchRejection,S=p;if(this.#s[e]===p&&(!v||!b&&S.__staleWhileFetching===void 0?this.#W(t,"fetch"):y||(this.#s[e]=S.__staleWhileFetching)),_)return s.status&&S.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),S.__staleWhileFetching;if(S.__returned===S)throw d},f=(d,b)=>{let m=this.#d?.(t,n,a);o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(d(void 0),s.allowStaleOnFetchAbort&&(d=y=>l(y,!0)))}),m&&m instanceof Promise?m.then(y=>d(y===void 0?void 0:y),b):m!==void 0&&d(m)};s.status&&(s.status.fetchDispatched=!0);let p=new Promise(f).then(l,c),g=Object.assign(p,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#D(t,g,{...a.options,status:void 0}),e=this.#l.get(t)):this.#s[e]=g,g}#c(t){if(!this.#M)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let s=O.tracing.hasSubscribers,{status:i=Ie()?{}:void 0}=e;e.status=i,i&&e.context&&(i.context=e.context);let n=this.#H(t,e);return i&&s&&(i.trace=!0,O.tracing.tracePromise(()=>n,i).catch(()=>{})),n}async#H(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:d,forceRefresh:b=!1,status:m,signal:y}=e;if(m&&(m.op="fetch",m.key=t,b&&(m.forceRefresh=!0),m.cache=this),!this.#M)return m&&(m.fetch="get"),this.#X(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:m});let _={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:h,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:p,status:m,signal:y},v=this.#l.get(t);if(v===void 0){m&&(m.fetch="miss");let S=this.#L(t,v,_,d);return S.__returned=S}else{let S=this.#s[v];if(this.#c(S)){let rt=s&&S.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",rt&&(m.returnedStale=!0)),rt?S.__staleWhileFetching:S.__returned=S}let K=this.#C(v);if(!b&&!K)return m&&(m.fetch="hit"),this.#K(v),i&&this.#k(v),m&&this.#F(m,v),S;let B=this.#L(t,v,_,d),U=B.__staleWhileFetching!==void 0&&s;return m&&(m.fetch=K?"stale":"refresh",U&&K&&(m.returnedStale=!0)),U?B.__staleWhileFetching:B.__returned=B}}forceFetch(t,e={}){let s=O.tracing.hasSubscribers,{status:i=Ie()?{}:void 0}=e;e.status=i,i&&e.context&&(i.context=e.context);let n=this.#I(t,e);return i&&s&&(i.trace=!0,O.tracing.tracePromise(()=>n,i).catch(()=>{})),n}async#I(t,e={}){let s=await this.#H(t,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,e={}){let{status:s=O.metrics.hasSubscribers?{}:void 0}=e;e.status=s,s&&(s.op="memo",s.key=t,e.context&&(s.context=e.context),s.cache=this);let i=this.#Z(t,e);return s&&(s.value=i),O.metrics.hasSubscribers&&O.metrics.publish(s),i}#Z(t,e={}){let s=this.#f;if(!s)throw new Error("no memoMethod provided to constructor");let{context:i,status:n,forceRefresh:o,...h}=e;n&&o&&(n.forceRefresh=!0);let a=this.#X(t,h),l=o||a===void 0;if(n&&(n.memo=l?"miss":"hit",l||(n.value=a)),!l)return a;let c=s(t,a,{options:h,context:i});return n&&(n.value=c),this.#D(t,c,h),c}get(t,e={}){let{status:s=O.metrics.hasSubscribers?{}:void 0}=e;e.status=s,s&&(s.op="get",s.key=t,s.cache=this);let i=this.#X(t,e);return s&&(i!==void 0&&(s.value=i),O.metrics.hasSubscribers&&O.metrics.publish(s)),i}#X(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,h=this.#l.get(t);if(h===void 0){o&&(o.get="miss");return}let a=this.#s[h],l=this.#c(a);return o&&this.#F(o,h),this.#C(h)?l?(o&&(o.get="stale-fetching"),s&&a.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#W(t,"expire"),o&&(o.get="stale"),s?(o&&(o.returnedStale=!0),a):void 0):(o&&(o.get=l?"fetching":"hit"),this.#K(h),i&&this.#k(h),l?a.__staleWhileFetching:a)}#Y(t,e){this.#E[e]=t,this.#b[t]=e}#K(t){t!==this.#g&&(t===this.#y?this.#y=this.#b[t]:this.#Y(this.#E[t],this.#b[t]),this.#Y(this.#g,t),this.#g=t)}delete(t){return this.#W(t,"delete")}#W(t,e){O.metrics.hasSubscribers&&O.metrics.publish({op:"delete",delete:e,key:t,cache:this});let s=!1;if(this.#h!==0){let i=this.#l.get(t);if(i!==void 0)if(this.#_?.[i]&&(clearTimeout(this.#_[i]),this.#_[i]=void 0),s=!0,this.#h===1)this.#J(e);else{this.#N(i);let n=this.#s[i];if(this.#c(n)?n.__abortController.abort(new Error("deleted")):(this.#S||this.#e)&&(this.#S&&this.#i?.(n,t,e),this.#e&&this.#p?.push([n,t,e])),this.#l.delete(t),this.#a[i]=void 0,this.#s[i]=void 0,i===this.#g)this.#g=this.#E[i];else if(i===this.#y)this.#y=this.#b[i];else{let o=this.#E[i];this.#b[o]=this.#b[i];let h=this.#b[i];this.#E[h]=this.#E[i]}this.#h--,this.#w.push(i)}}if(this.#e&&this.#p?.length){let i=this.#p,n;for(;n=i?.shift();)this.#r?.(...n)}return s}clear(){return this.#J("delete")}#J(t){for(let e of this.#R({allowStale:!0})){let s=this.#s[e];if(this.#c(s))s.__abortController.abort(new Error("deleted"));else{let i=this.#a[e];this.#S&&this.#i?.(s,i,t),this.#e&&this.#p?.push([s,i,t])}}if(this.#l.clear(),this.#s.fill(void 0),this.#a.fill(void 0),this.#v&&this.#x){this.#v.fill(0),this.#x.fill(0);for(let e of this.#_??[])e!==void 0&&clearTimeout(e);this.#_?.fill(void 0)}if(this.#O&&this.#O.fill(0),this.#y=0,this.#g=0,this.#w.length=0,this.#m=0,this.#h=0,this.#e&&this.#p){let e=this.#p,s;for(;s=e?.shift();)this.#r?.(...s)}}};Xt.LRUCache=jn});var Ye=C(j=>{"use strict";var Nn=j&&j.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(j,"__esModule",{value:!0});j.Minipass=j.isWritable=j.isReadable=j.isStream=void 0;var Js=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ve=__webpack_require__(/*! node:events */ "node:events"),ei=Nn(__webpack_require__(/*! node:stream */ "node:stream")),Dn=__webpack_require__(/*! node:string_decoder */ "node:string_decoder"),Ln=r=>!!r&&typeof r=="object"&&(r instanceof te||r instanceof ei.default||(0,j.isReadable)(r)||(0,j.isWritable)(r));j.isStream=Ln;var Wn=r=>!!r&&typeof r=="object"&&r instanceof Ve.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==ei.default.Writable.prototype.pipe;j.isReadable=Wn;var zn=r=>!!r&&typeof r=="object"&&r instanceof Ve.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function";j.isWritable=zn;var H=Symbol("EOF"),X=Symbol("maybeEmitEnd"),Z=Symbol("emittedEnd"),Kt=Symbol("emittingEnd"),gt=Symbol("emittedError"),Vt=Symbol("closed"),Zs=Symbol("read"),Yt=Symbol("flush"),Qs=Symbol("flushChunk"),W=Symbol("encoding"),at=Symbol("decoder"),M=Symbol("flowing"),wt=Symbol("paused"),lt=Symbol("resume"),k=Symbol("buffer"),F=Symbol("pipes"),A=Symbol("bufferLength"),$e=Symbol("bufferPush"),Jt=Symbol("bufferShift"),P=Symbol("objectMode"),x=Symbol("destroyed"),Ue=Symbol("error"),qe=Symbol("emitData"),ti=Symbol("emitEnd"),He=Symbol("emitEnd2"),G=Symbol("async"),Xe=Symbol("abort"),Zt=Symbol("aborted"),bt=Symbol("signal"),st=Symbol("dataListeners"),N=Symbol("discarded"),yt=r=>Promise.resolve().then(r),Bn=r=>r(),Gn=r=>r==="end"||r==="finish"||r==="prefinish",In=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,$n=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Qt=class{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[lt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ke=class extends Qt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=i=>this.dest.emit("error",i),t.on("error",this.proxyErrors)}},Un=r=>!!r.objectMode,qn=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",te=class extends Ve.EventEmitter{[M]=!1;[wt]=!1;[F]=[];[k]=[];[P];[W];[G];[at];[H]=!1;[Z]=!1;[Kt]=!1;[Vt]=!1;[gt]=null;[A]=0;[x]=!1;[bt];[Zt]=!1;[st]=0;[N]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Un(e)?(this[P]=!0,this[W]=null):qn(e)?(this[W]=e.encoding,this[P]=!1):(this[P]=!1,this[W]=null),this[G]=!!e.async,this[at]=this[W]?new Dn.StringDecoder(this[W]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[k]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[F]});let{signal:s}=e;s&&(this[bt]=s,s.aborted?this[Xe]():s.addEventListener("abort",()=>this[Xe]()))}get bufferLength(){return this[A]}get encoding(){return this[W]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[P]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[G]}set async(t){this[G]=this[G]||!!t}[Xe](){this[Zt]=!0,this.emit("abort",this[bt]?.reason),this.destroy(this[bt]?.reason)}get aborted(){return this[Zt]}set aborted(t){}write(t,e,s){if(this[Zt])return!1;if(this[H])throw new Error("write after end");if(this[x])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let i=this[G]?yt:Bn;if(!this[P]&&!Buffer.isBuffer(t)){if($n(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(In(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[P]?(this[M]&&this[A]!==0&&this[Yt](!0),this[M]?this.emit("data",t):this[$e](t),this[A]!==0&&this.emit("readable"),s&&i(s),this[M]):t.length?(typeof t=="string"&&!(e===this[W]&&!this[at]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[W]&&(t=this[at].write(t)),this[M]&&this[A]!==0&&this[Yt](!0),this[M]?this.emit("data",t):this[$e](t),this[A]!==0&&this.emit("readable"),s&&i(s),this[M]):(this[A]!==0&&this.emit("readable"),s&&i(s),this[M])}read(t){if(this[x])return null;if(this[N]=!1,this[A]===0||t===0||t&&t>this[A])return this[X](),null;this[P]&&(t=null),this[k].length>1&&!this[P]&&(this[k]=[this[W]?this[k].join(""):Buffer.concat(this[k],this[A])]);let e=this[Zs](t||null,this[k][0]);return this[X](),e}[Zs](t,e){if(this[P])this[Jt]();else{let s=e;t===s.length||t===null?this[Jt]():typeof s=="string"?(this[k][0]=s.slice(t),e=s.slice(0,t),this[A]-=t):(this[k][0]=s.subarray(t),e=s.subarray(0,t),this[A]-=t)}return this.emit("data",e),!this[k].length&&!this[H]&&this.emit("drain"),e}end(t,e,s){return typeof t=="function"&&(s=t,t=void 0),typeof e=="function"&&(s=e,e="utf8"),t!==void 0&&this.write(t,e),s&&this.once("end",s),this[H]=!0,this.writable=!1,(this[M]||!this[wt])&&this[X](),this}[lt](){this[x]||(!this[st]&&!this[F].length&&(this[N]=!0),this[wt]=!1,this[M]=!0,this.emit("resume"),this[k].length?this[Yt]():this[H]?this[X]():this.emit("drain"))}resume(){return this[lt]()}pause(){this[M]=!1,this[wt]=!0,this[N]=!1}get destroyed(){return this[x]}get flowing(){return this[M]}get paused(){return this[wt]}[$e](t){this[P]?this[A]+=1:this[A]+=t.length,this[k].push(t)}[Jt](){return this[P]?this[A]-=1:this[A]-=this[k][0].length,this[k].shift()}[Yt](t=!1){do;while(this[Qs](this[Jt]())&&this[k].length);!t&&!this[k].length&&!this[H]&&this.emit("drain")}[Qs](t){return this.emit("data",t),this[M]}pipe(t,e){if(this[x])return t;this[N]=!1;let s=this[Z];return e=e||{},t===Js.stdout||t===Js.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[F].push(e.proxyErrors?new Ke(this,t,e):new Qt(this,t,e)),this[G]?yt(()=>this[lt]()):this[lt]()),t}unpipe(t){let e=this[F].find(s=>s.dest===t);e&&(this[F].length===1?(this[M]&&this[st]===0&&(this[M]=!1),this[F]=[]):this[F].splice(this[F].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t==="data")this[N]=!1,this[st]++,!this[F].length&&!this[M]&&this[lt]();else if(t==="readable"&&this[A]!==0)super.emit("readable");else if(Gn(t)&&this[Z])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[gt]){let i=e;this[G]?yt(()=>i.call(this,this[gt])):i.call(this,this[gt])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t==="data"&&(this[st]=this.listeners("data").length,this[st]===0&&!this[N]&&!this[F].length&&(this[M]=!1)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[st]=0,!this[N]&&!this[F].length&&(this[M]=!1)),e}get emittedEnd(){return this[Z]}[X](){!this[Kt]&&!this[Z]&&!this[x]&&this[k].length===0&&this[H]&&(this[Kt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Vt]&&this.emit("close"),this[Kt]=!1)}emit(t,...e){let s=e[0];if(t!=="error"&&t!=="close"&&t!==x&&this[x])return!1;if(t==="data")return!this[P]&&!s?!1:this[G]?(yt(()=>this[qe](s)),!0):this[qe](s);if(t==="end")return this[ti]();if(t==="close"){if(this[Vt]=!0,!this[Z]&&!this[x])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[gt]=s,super.emit(Ue,s);let n=!this[bt]||this.listeners("error").length?super.emit("error",s):!1;return this[X](),n}else if(t==="resume"){let n=super.emit("resume");return this[X](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let i=super.emit(t,...e);return this[X](),i}[qe](t){for(let s of this[F])s.dest.write(t)===!1&&this.pause();let e=this[N]?!1:super.emit("data",t);return this[X](),e}[ti](){return this[Z]?!1:(this[Z]=!0,this.readable=!1,this[G]?(yt(()=>this[He]()),!0):this[He]())}[He](){if(this[at]){let e=this[at].end();if(e){for(let s of this[F])s.dest.write(e);this[N]||super.emit("data",e)}}for(let e of this[F])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[P]||(t.dataLength=0);let e=this.promise();return this.on("data",s=>{t.push(s),this[P]||(t.dataLength+=s.length)}),await e,t}async concat(){if(this[P])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[W]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(x,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[N]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[H])return e();let n,o,h=u=>{this.off("data",a),this.off("end",l),this.off(x,c),e(),o(u)},a=u=>{this.off("error",h),this.off("end",l),this.off(x,c),this.pause(),n({value:u,done:!!this[H]})},l=()=>{this.off("error",h),this.off("data",a),this.off(x,c),e(),n({done:!0,value:void 0})},c=()=>h(new Error("stream destroyed"));return new Promise((u,f)=>{o=f,n=u,this.once(x,c),this.once("error",h),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[N]=!1;let t=!1,e=()=>(this.pause(),this.off(Ue,e),this.off(x,e),this.off("end",e),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return e();let i=this.read();return i===null?e():{done:!1,value:i}};return this.once("end",e),this.once(Ue,e),this.once(x,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[x])return t?this.emit("error",t):this.emit(x),this;this[x]=!0,this[N]=!0,this[k].length=0,this[A]=0;let e=this;return typeof e.close=="function"&&!this[Vt]&&e.close(),t?this.emit("error",t):this.emit(x),this}static get isStream(){return j.isStream}};j.Minipass=te});var mi=C(E=>{"use strict";var Hn=E&&E.__createBinding||(Object.create?(function(r,t,e,s){s===void 0&&(s=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,s,i)}):(function(r,t,e,s){s===void 0&&(s=e),r[s]=t[e]})),Xn=E&&E.__setModuleDefault||(Object.create?(function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}):function(r,t){r.default=t}),Kn=E&&E.__importStar||(function(){var r=function(t){return r=Object.getOwnPropertyNames||function(e){var s=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s[s.length]=i);return s},r(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var s=r(t),i=0;i<s.length;i++)s[i]!=="default"&&Hn(e,t,s[i]);return Xn(e,t),e}})();Object.defineProperty(E,"__esModule",{value:!0});E.PathScurry=E.Path=E.PathScurryDarwin=E.PathScurryPosix=E.PathScurryWin32=E.PathScurryBase=E.PathPosix=E.PathWin32=E.PathBase=E.ChildrenCache=E.ResolveCache=void 0;var ae=Ys(),re=__webpack_require__(/*! node:path */ "node:path"),Vn=__webpack_require__(/*! node:url */ "node:url"),vt=__webpack_require__(/*! fs */ "fs"),Yn=Kn(__webpack_require__(/*! node:fs */ "node:fs")),Jn=vt.realpathSync.native,ee=__webpack_require__(/*! node:fs/promises */ "node:fs/promises"),si=Ye(),_t={lstatSync:vt.lstatSync,readdir:vt.readdir,readdirSync:vt.readdirSync,readlinkSync:vt.readlinkSync,realpathSync:Jn,promises:{lstat:ee.lstat,readdir:ee.readdir,readlink:ee.readlink,realpath:ee.realpath}},ai=r=>!r||r===_t||r===Yn?_t:{..._t,...r,promises:{..._t.promises,...r.promises}},Zn=/^\\\\\?\\([a-z]:)\\?$/i,Qn=/^\\\\\?\\UNC\\([^\\]+\\[^\\]+)\\?$/i,tr=/^\\\\[^\\?]+\\[^\\]+$/,ii=r=>r.replace(/\//g,"\\").replace(Zn,"$1\\").replace(Qn,"\\\\$1\\").replace(tr,"$&\\"),er=/^[\\/]{2}\?[\\/]unc[\\/][^\\/]+[\\/][^\\/]+(?:[\\/]|$)/i,sr=/^[\\/]{2}\?[\\/](?=[a-z]:)/i,ir=/^[\\/]{2}\?[\\/]unc(?=[\\/][^\\/]+[\\/][^\\/])/i,nr=/[\\/]/,L=0,li=1,ci=2,I=4,ui=6,fi=8,it=10,di=12,D=15,St=~D,Je=16,ni=32,Et=64,z=128,se=256,ne=512,ri=Et|z|ne,rr=1023,Ze=r=>r.isFile()?fi:r.isDirectory()?I:r.isSymbolicLink()?it:r.isCharacterDevice()?ci:r.isBlockDevice()?ui:r.isSocket()?di:r.isFIFO()?li:L,oi=new ae.LRUCache({max:2**12}),Ot=r=>{let t=oi.get(r);if(t)return t;let e=r.normalize("NFKD");return oi.set(r,e),e},hi=new ae.LRUCache({max:2**12}),ie=r=>{let t=hi.get(r);if(t)return t;let e=Ot(r.toLowerCase());return hi.set(r,e),e},xt=class extends ae.LRUCache{constructor(){super({max:256})}};E.ResolveCache=xt;var oe=class extends ae.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}};E.ChildrenCache=oe;var pi=Symbol("PathScurry setAsCwd"),R=class{name;root;roots;parent;nocase;isCWD=!1;#t;#n;get dev(){return this.#n}#i;get mode(){return this.#i}#o;get nlink(){return this.#o}#r;get uid(){return this.#r}#d;get gid(){return this.#d}#f;get rdev(){return this.#f}#u;get blksize(){return this.#u}#h;get ino(){return this.#h}#m;get size(){return this.#m}#l;get blocks(){return this.#l}#a;get atimeMs(){return this.#a}#s;get mtimeMs(){return this.#s}#b;get ctimeMs(){return this.#b}#E;get birthtimeMs(){return this.#E}#y;get atime(){return this.#y}#g;get mtime(){return this.#g}#w;get ctime(){return this.#w}#p;get birthtime(){return this.#p}#O;#x;#v;#_;#S;#M;#e;#P;#T;#k;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=L,s,i,n,o,h){this.name=t,this.#O=n?ie(t):Ot(t),this.#e=e&rr,this.nocase=n,this.roots=i,this.root=s||this,this.#P=o,this.#v=h.fullpath,this.#S=h.relative,this.#M=h.relativePosix,this.parent=h.parent,this.parent?this.#t=this.parent.#t:this.#t=ai(h.fs)}get fs(){return this.#t}depth(){return this.#x!==void 0?this.#x:this.parent?this.#x=this.parent.depth()+1:this.#x=0}childrenCache(){return this.#P}resolve(t){if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#F(i):this.#F(i)}#F(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#P.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#P.set(this,e),this.#e&=~Je,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),i=this.nocase?ie(t):Ot(t);for(let a of s)if(a.#O===i)return a;let n=this.parent?this.sep:"",o=this.#v?this.#v+n+t:void 0,h=this.newChild(t,L,{...e,parent:this,fullpath:o});return this.canReaddir()||(h.#e|=z),s.push(h),h}relative(){if(this.isCWD)return"";if(this.#S!==void 0)return this.#S;let t=this.name,e=this.parent;if(!e)return this.#S=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#M!==void 0)return this.#M;let t=this.name,e=this.parent;if(!e)return this.#M=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#v!==void 0)return this.#v;let t=this.name,e=this.parent;if(!e)return this.#v=this.name;let i=e.fullpath()+(e.parent?this.sep:"")+t;return this.#v=i}fullpathPosix(){if(this.#_!==void 0)return this.#_;if(this.sep==="/")return this.#_=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#_=`//?/${i}`:this.#_=i}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return this.#_=s}isUnknown(){return(this.#e&D)===L}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#e&D)===fi}isDirectory(){return(this.#e&D)===I}isCharacterDevice(){return(this.#e&D)===ci}isBlockDevice(){return(this.#e&D)===ui}isFIFO(){return(this.#e&D)===li}isSocket(){return(this.#e&D)===di}isSymbolicLink(){return(this.#e&it)===it}lstatCached(){return this.#e&ni?this:void 0}readlinkCached(){return this.#T}realpathCached(){return this.#k}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#T)return!0;if(!this.parent)return!1;let t=this.#e&D;return!(t!==L&&t!==it||this.#e&se||this.#e&z)}calledReaddir(){return!!(this.#e&Je)}isENOENT(){return!!(this.#e&z)}isNamed(t){return this.nocase?this.#O===ie(t):this.#O===Ot(t)}async readlink(){let t=this.#T;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#T=s}catch(e){this.#R(e.code);return}}readlinkSync(){let t=this.#T;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#T=s}catch(e){this.#R(e.code);return}}#z(t){this.#e|=Je;for(let e=t.provisional;e<t.length;e++){let s=t[e];s&&s.#C()}}#C(){this.#e&z||(this.#e=(this.#e|z)&St,this.#U())}#U(){let t=this.children();t.provisional=0;for(let e of t)e.#C()}#N(){this.#e|=ne,this.#j()}#j(){if(this.#e&Et)return;let t=this.#e;(t&D)===I&&(t&=St),this.#e=t|Et,this.#U()}#B(t=""){t==="ENOTDIR"||t==="EPERM"?this.#j():t==="ENOENT"?this.#C():this.children().provisional=0}#A(t=""){t==="ENOTDIR"?this.parent.#j():t==="ENOENT"&&this.#C()}#R(t=""){let e=this.#e;e|=se,t==="ENOENT"&&(e|=z),(t==="EINVAL"||t==="UNKNOWN")&&(e&=St),this.#e=e,t==="ENOTDIR"&&this.parent&&this.parent.#j()}#G(t,e){return this.#$(t,e)||this.#D(t,e)}#D(t,e){let s=Ze(t),i=this.newChild(t.name,s,{parent:this}),n=i.#e&D;return n!==I&&n!==it&&n!==L&&(i.#e|=Et),e.unshift(i),e.provisional++,i}#$(t,e){for(let s=e.provisional;s<e.length;s++){let i=e[s];if((this.nocase?ie(t.name):Ot(t.name))===i.#O)return this.#V(t,i,s,e)}}#V(t,e,s,i){let n=e.name;return e.#e=e.#e&St|Ze(t),n!==t.name&&(e.name=t.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(e)),i.provisional++,e}async lstat(){if((this.#e&z)===0)try{return this.#q(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#A(t.code)}}lstatSync(){if((this.#e&z)===0)try{return this.#q(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#A(t.code)}}#q(t){let{atime:e,atimeMs:s,birthtime:i,birthtimeMs:n,blksize:o,blocks:h,ctime:a,ctimeMs:l,dev:c,gid:u,ino:f,mode:p,mtime:g,mtimeMs:d,nlink:b,rdev:m,size:y,uid:_}=t;this.#y=e,this.#a=s,this.#p=i,this.#E=n,this.#u=o,this.#l=h,this.#w=a,this.#b=l,this.#n=c,this.#d=u,this.#h=f,this.#i=p,this.#g=g,this.#s=d,this.#o=b,this.#f=m,this.#m=y,this.#r=_;let v=Ze(t);this.#e=this.#e&St|v|ni,v!==L&&v!==I&&v!==it&&(this.#e|=Et)}#L=[];#c=!1;#H(t){this.#c=!1;let e=this.#L.slice();this.#L.length=0,e.forEach(s=>s(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);e?t(null,n):queueMicrotask(()=>t(null,n));return}if(this.#L.push(t),this.#c)return;this.#c=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(n,o)=>{if(n)this.#B(n.code),s.provisional=0;else{for(let h of o)this.#G(h,s);this.#z(s)}this.#H(s.slice(0,s.provisional))})}#I;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#I)await this.#I;else{let s=()=>{};this.#I=new Promise(i=>s=i);try{for(let i of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#G(i,t);this.#z(t)}catch(i){this.#B(i.code),t.provisional=0}this.#I=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#G(s,t);this.#z(t)}catch(s){this.#B(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#e&ri)return!1;let t=D&this.#e;return t===L||t===I||t===it}shouldWalk(t,e){return(this.#e&I)===I&&!(this.#e&ri)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#k)return this.#k;if(!((ne|se|z)&this.#e))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#k=this.resolve(t)}catch{this.#N()}}realpathSync(){if(this.#k)return this.#k;if(!((ne|se|z)&this.#e))try{let t=this.#t.realpathSync(this.fullpath());return this.#k=this.resolve(t)}catch{this.#N()}}[pi](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),s=[],i=this;for(;i&&i.parent;)e.add(i),i.#S=s.join(this.sep),i.#M=s.join("/"),i=i.parent,s.push("..");for(i=t;i&&i.parent&&!e.has(i);)i.#S=void 0,i.#M=void 0,i=i.parent}};E.PathBase=R;var Ct=class r extends R{sep="\\";splitSep=nr;constructor(t,e=L,s,i,n,o,h){super(t,e,s,i,n,o,h)}newChild(t,e=L,s={}){return new r(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return er.exec(t)?.[0]??re.win32.parse(t).root}getRoot(t){if(t=ii(t.toUpperCase()),t===this.root.name||/^[\\/]$/.test(t))return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new At(t,{nocase:this.nocase,fs:this.fs}).root}sameRoot(t,e=this.root.name){return ii(t.toUpperCase())===e}};E.PathWin32=Ct;var Mt=class r extends R{splitSep="/";sep="/";constructor(t,e=L,s,i,n,o,h){super(t,e,s,i,n,o,h)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=L,s={}){return new r(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}};E.PathPosix=Mt;var kt=class{root;rootPath;roots;cwd;#t;#n;#i;nocase;#o;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:n=16*1024,fs:o=_t}={}){this.#o=ai(o),(t instanceof URL||t.startsWith("file://"))&&(t=(0,Vn.fileURLToPath)(t));let h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),this.#t=new xt,this.#n=new xt,this.#i=new oe(n);let a=h.substring(this.rootPath.length).split(s);if(a.length===1&&!a[0]&&a.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#o),this.roots[this.rootPath]=this.root;let l=this.root,c=a.length-1,u=e.sep,f=this.rootPath,p=!1;for(let g of a){let d=c--;l=l.child(g,{relative:new Array(d).fill("..").join(u),relativePosix:new Array(d).fill("..").join("/"),fullpath:f+=(p?"":u)+g}),p=!0}this.cwd=l}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#i}resolve(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#t.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpath();return this.#t.set(e,i),i}resolvePosix(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#n.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpathPosix();return this.#n.set(e,i),i}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let i=await t.readdir();return s?i:i.map(n=>n.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set,l=(u,f)=>{a.add(u),u.readdirCB((p,g)=>{if(p)return f(p);let d=g.length;if(!d)return f();let b=()=>{--d===0&&f()};for(let m of g)(!n||n(m))&&h.push(s?m:m.fullpath()),i&&m.isSymbolicLink()?m.realpath().then(y=>y?.isUnknown()?y.lstat():y).then(y=>y?.shouldWalk(a,o)?l(y,b):b()):m.shouldWalk(a,o)?l(m,b):b()},!0)},c=t;return new Promise((u,f)=>{l(c,p=>{if(p)return f(p);u(h)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set([t]);for(let l of a){let c=l.readdirSync();for(let u of c){(!n||n(u))&&h.push(s?u:u.fullpath());let f=u;if(u.isSymbolicLink()){if(!(i&&(f=u.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(a,o)&&a.add(f)}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e;(!n||n(t))&&(yield s?t:t.fullpath());let h=new Set([t]);for(let a of h){let l=a.readdirSync();for(let c of l){(!n||n(c))&&(yield s?c:c.fullpath());let u=c;if(c.isSymbolicLink()){if(!(i&&(u=c.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(h,o)&&h.add(u)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=new si.Minipass({objectMode:!0});(!n||n(t))&&h.write(s?t:t.fullpath());let a=new Set,l=[t],c=0,u=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){c===0&&h.end();return}c++,a.add(p);let g=(b,m,y=!1)=>{if(b)return h.emit("error",b);if(i&&!y){let _=[];for(let v of m)v.isSymbolicLink()&&_.push(v.realpath().then(S=>S?.isUnknown()?S.lstat():S));if(_.length){Promise.all(_).then(()=>g(null,m,!0));return}}for(let _ of m)_&&(!n||n(_))&&(h.write(s?_:_.fullpath())||(f=!0));c--;for(let _ of m){let v=_.realpathCached()||_;v.shouldWalk(a,o)&&l.push(v)}f&&!h.flowing?h.once("drain",u):d||u()},d=!0;p.readdirCB(g,!0),d=!1}};return u(),h}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=new si.Minipass({objectMode:!0}),a=new Set;(!n||n(t))&&h.write(s?t:t.fullpath());let l=[t],c=0,u=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){c===0&&h.end();return}c++,a.add(p);let g=p.readdirSync();for(let d of g)(!n||n(d))&&(h.write(s?d:d.fullpath())||(f=!0));c--;for(let d of g){let b=d;if(d.isSymbolicLink()){if(!(i&&(b=d.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(a,o)&&l.push(b)}}f&&!h.flowing&&h.once("drain",u)};return u(),h}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[pi](e)}};E.PathScurryBase=kt;var At=class extends kt{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;typeof t=="string"&&!t.startsWith("file://")&&(t=t.replace(sr,"").replace(ir,"\\")),super(t,re.win32,"\\",{...e,nocase:s}),this.nocase=s;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(t){return re.win32.parse(t).root.toUpperCase()}newRoot(t){return new Ct(this.rootPath,I,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}};E.PathScurryWin32=At;var Rt=class extends kt{sep="/";constructor(t=process.cwd(),e={}){let{nocase:s=!1}=e;super(t,re.posix,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new Mt(this.rootPath,I,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}};E.PathScurryPosix=Rt;var he=class extends Rt{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}};E.PathScurryDarwin=he;E.Path=process.platform==="win32"?Ct:Mt;E.PathScurry=process.platform==="win32"?At:process.platform==="darwin"?he:Rt});var ts=C(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.Pattern=void 0;var or=Y(),hr=r=>r.length>=1,ar=r=>r.length>=1,lr=Symbol.for("nodejs.util.inspect.custom"),Qe=class r{#t;#n;#i;length;#o;#r;#d;#f;#u;#h;#m=!0;constructor(t,e,s,i){if(!hr(t))throw new TypeError("empty pattern list");if(!ar(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#n=e,this.#i=s,this.#o=i,this.#i===0){if(this.isUNC()){let n=this.#l()?6:4,o=this.#t.slice(0,n),h=this.#n.slice(0,n),a=this.#t.slice(n),l=this.#n.slice(n);a[0]===""&&(a.shift(),l.shift());let c=[...o,""].join("/"),u=[...h,""].join("/");this.#t=[c,...a],this.#n=[u,...l],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#t,[h,...a]=this.#n;o[0]===""&&(o.shift(),a.shift());let l=`${n}/`,c=`${h}/`;this.#t=[l,...o],this.#n=[c,...a],this.length=this.#t.length}}}[lr](){return`Pattern <${this.#n.slice(this.#i).join("/")}>`}pattern(){return this.#t[this.#i]}isString(){return typeof this.#t[this.#i]=="string"}isGlobstar(){return this.#t[this.#i]===or.GLOBSTAR}isMatcher(){return typeof this.#t[this.#i]=="object"}globString(){return this.#d=this.#d||(this.#i===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#r!==void 0?this.#r:this.hasMore()?(this.#r=new r(this.#t,this.#n,this.#i+1,this.#o),this.#r.#h=this.#h,this.#r.#u=this.#u,this.#r.#f=this.#f,this.#r):this.#r=null}#l(){let t=this.#t;return t[2]==="?"&&typeof t[3]=="string"&&/^unc$/i.test(t[3])}isUNC(){let t=this.#t,e=this.#l()?4:2;return this.#u!==void 0?this.#u:this.#u=this.#o==="win32"&&this.#i===0&&t[0]===""&&t[1]===""&&typeof t[e]=="string"&&!!t[e]&&typeof t[e+1]=="string"&&!!t[e+1]}isDrive(){let t=this.#t;return this.#f!==void 0?this.#f:this.#f=this.#o==="win32"&&this.#i===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#h!==void 0?this.#h:this.#h=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#i===0?t:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#m)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#m?!1:(this.#m=!1,!0)}};le.Pattern=Qe});var is=C(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.Ignore=void 0;var es=Y(),cr=ts(),ur=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ss=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;slashRoot;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:n,normalize:o,platform:h=ur,root:a,windowsPathsNoEscape:l,allowWindowsEscape:c,braceExpandMax:u=1e4},f){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=h,l=!!l||c===!1,this.mmopts={braceExpandMax:u,dot:!0,nobrace:e,nocase:s,noext:i,noglobstar:n,normalize:o,optimizationLevel:2,platform:h,nocomment:!0,nonegate:!0,windowsPathsNoEscape:l};let p=f?.resolve(a??"/").fullpath()??"/";this.slashRoot=(0,es.escape)(p.replace(/\\/g,"/").replace(/\/$/,""),{magicalBraces:!0,windowsPathsNoEscape:l});for(let g of t)this.add(g)}add(t){let e=new es.Minimatch(t,this.mmopts);for(let s=0;s<e.set.length;s++){let i=e.set[s],n=e.globParts[s];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let o=new cr.Pattern(i,n,0,this.platform),h=o.root()==="/"?`${this.slashRoot}/${o.rest()?.globString()??""}`:o.globString(),a=new es.Minimatch(h,this.mmopts),l=n[n.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(a):this.relative.push(a),l&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(t){let e=t.fullpath(),s=`${e}/`,i=t.relative()||".",n=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(n))return!0;for(let o of this.absolute)if(o.match(e)||o.match(s))return!0;return!1}childrenIgnored(t){let e=`${t.fullpath()}/`,s=`${t.relative()||"."}/`;for(let i of this.relativeChildren)if(i.match(s))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}};ce.Ignore=ss});var wi=C($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.Processor=$.SubWalks=$.MatchRecord=$.HasWalkedCache=void 0;var gi=Y(),ue=class r{parent;store;constructor(t){this.parent=t}copy(){return new r(this)}#t(t){let e=this.store?.get(t);return e||!this.parent?e:this.parent.#t(t)}hasWalked(t,e){return!!this.#t(t.fullpath())?.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),i=this.#t(s);i?i.add(e.globString()):(this.store??=new Map).set(s,new Set([e.globString()]))}};$.HasWalkedCache=ue;var fe=class r{static ABSOLUTE=2;static IF_DIR=1;store=new Map;add(t,e,s){let i=(e?r.ABSOLUTE:0)|(s?r.IF_DIR:0),n=this.store.get(t);this.store.set(t,n===void 0?i:i&n)}};$.MatchRecord=fe;var de=class{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(i=>i.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}};$.SubWalks=de;var ns=class r{hasWalkedCache;matches=new fe;subwalks=new de;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new ue}processPatterns(t,e){this.patterns=e;let s=e.map(i=>[t,i]);for(let[i,n]of s){this.hasWalkedCache.storeWalked(i,n);let o=n.root(),h=n.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let u=n.rest();if(u)n=u;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let a,l,c=!1;for(;typeof(a=n.pattern())=="string"&&(l=n.rest());)i=i.resolve(a),n=l,c=!0;if(a=n.pattern(),l=n.rest(),c){if(this.hasWalkedCache.hasWalked(i,n))continue;this.hasWalkedCache.storeWalked(i,n)}if(typeof a=="string"){let u=a===".."||a===""||a===".";this.matches.add(i.resolve(a),h,u);continue}else if(a===gi.GLOBSTAR){(!i.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(i,n);let u=l?.pattern(),f=l?.rest();if(!l||(u===""||u===".")&&!f)this.matches.add(i,h,u===""||u===".");else if(u===".."){let p=i.parent||i;f?this.hasWalkedCache.hasWalked(p,f)||this.subwalks.add(p,f):this.matches.add(p,h,!0)}}else typeof a=="object"&&this.subwalks.add(i,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),i=this.child();for(let n of e)for(let o of s){let h=o.isAbsolute(),a=o.pattern(),l=o.rest();a===gi.GLOBSTAR?i.testGlobstar(n,o,l,h):typeof a=="object"?i.testMatcher(n,a,l,h):i.testString(n,a,l,h)}return i}testGlobstar(t,e,s,i){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),i);else if(n===".."){let o=t.parent||t;this.subwalks.add(o,s)}else typeof n=="object"&&this.testMatcher(t,n,s.rest(),i)}}testMatcher(t,e,s,i){e.testUnchecked(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}};$.Processor=ns});var yi=C(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.GlobStream=Q.GlobWalker=Q.GlobUtil=void 0;var fr=Ye(),bi=is(),rs=wi(),{ABSOLUTE:pe,IF_DIR:me}=rs.MatchRecord,dr=(r,t,e)=>typeof r=="string"?new bi.Ignore([r],t,e):Array.isArray(r)?new bi.Ignore(r,t,e):r,Pt=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#n;#i;signal;maxDepth;includeChildMatches;constructor(t,e,s){if(this.patterns=t,this.path=e,this.opts=s,this.#i=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#n=dr(s.ignore??[],s,e),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#o(t){return this.seen.has(t)||!!this.#n?.ignored?.(t)}#r(t){return!!this.#n?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.paused?this.#t.push(t):t()}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s,i;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;i=s}else i=t;let o=i.isUnknown()||this.opts.stat?await i.lstat():i;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let h=await o.realpath();h&&(h.isUnknown()||this.opts.stat)&&await h.lstat()}return this.matchCheckTest(o,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#o(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s,i;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;i=s}else i=t;let o=i.isUnknown()||this.opts.stat?i.lstatSync():i;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let h=o.realpathSync();h&&(h?.isUnknown()||this.opts.stat)&&h.lstatSync()}return this.matchCheckTest(o,e)}matchFinish(t,e){this.#o(t)||this.#d(t,e)}#d(t,e){if(!this.includeChildMatches&&this.#n?.add){let n=`${t.relativePosix()}/**`;this.#n.add(n)}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!n.startsWith(`..${this.#i}`)?`.${this.#i}`:"";this.matchEmit(n?o+n+i:`.${i}`)}}async match(t,e,s){let i=await this.matchCheck(t,s);i&&this.matchFinish(i,e)}matchSync(t,e,s){let i=this.matchCheckSync(t,s);i&&this.#d(i,e)}walkCB(t,e,s){if(this.signal?.aborted)return s();this.walkCB2(t,e,new rs.Processor(this.opts),s)}walkCB2(t,e,s,i){if(this.#r(t)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2(t,e,s,i));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a]of s.matches.store)this.#o(h)||(n++,this.match(h,!!(a&pe),!!(a&me)).then(()=>o()));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirCached();h.calledReaddir()?this.walkCB3(h,a,s,o):h.readdirCB((l,c)=>this.walkCB3(h,c,s,o),!0)}o()}walkCB3(t,e,s,i){let n=s.filterEntries(t,e),o=1,h=()=>{--o===0&&i()};for(let[a,l]of n.matches.store)this.#o(a)||(o++,this.match(a,!!(l&pe),!!(l&me)).then(()=>h()));for(let[a,l]of n.subwalks.entries())o++,this.walkCB2(a,l,n.child(),h);h()}walkCBSync(t,e,s){if(this.signal?.aborted)return s();this.walkCB2Sync(t,e,new rs.Processor(this.opts),s)}walkCB2Sync(t,e,s,i){if(this.#r(t)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,i));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a]of s.matches.store)this.#o(h)||this.matchSync(h,!!(a&pe),!!(a&me));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirSync();this.walkCB3Sync(h,a,s,o)}o()}walkCB3Sync(t,e,s,i){let n=s.filterEntries(t,e),o=1,h=()=>{--o===0&&i()};for(let[a,l]of n.matches.store)this.#o(a)||this.matchSync(a,!!(l&pe),!!(l&me));for(let[a,l]of n.subwalks.entries())o++,this.walkCB2Sync(a,l,n.child(),h);h()}};Q.GlobUtil=Pt;var os=class extends Pt{matches=[];constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.push(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};Q.GlobWalker=os;var hs=class extends Pt{results;constructor(t,e,s){super(t,e,s),this.results=new fr.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};Q.GlobStream=hs});var ls=C(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.Glob=void 0;var pr=Y(),mr=__webpack_require__(/*! node:url */ "node:url"),ge=mi(),gr=ts(),we=yi(),wr=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",as=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,mr.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");let s=typeof t=="string"?[t]:t;if(this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(s=s.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");s=s.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=s,this.platform=e.platform||wr,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=e.platform==="win32"?ge.PathScurryWin32:e.platform==="darwin"?ge.PathScurryDarwin:e.platform?ge.PathScurryPosix:ge.PathScurry;this.scurry=new l(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={braceExpandMax:1e4,...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape},o=this.pattern.map(l=>new pr.Minimatch(l,n)),[h,a]=o.reduce((l,c)=>(l[0].push(...c.set),l[1].push(...c.globParts),l),[[],[]]);this.patterns=h.map((l,c)=>{let u=a[c];if(!u)throw new Error("invalid pattern object");return new gr.Pattern(l,u,0,this.platform)})}async walk(){return await new we.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()}walkSync(){return new we.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()}stream(){return new we.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new we.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};be.Glob=as});var cs=C(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.hasMagic=void 0;var br=Y(),yr=(r,t={})=>{for(let e of Array.isArray(r)?r:[r])if(new br.Minimatch(e,t).hasMagic())return!0;return!1};ye.hasMagic=yr});Object.defineProperty(exports, "__esModule", ({value:!0}));exports.glob=exports.sync=exports.iterate=exports.iterateSync=exports.stream=exports.streamSync=exports.Ignore=exports.hasMagic=exports.Glob=exports.unescape=exports.escape=void 0;exports.globStreamSync=Tt;exports.globStream=us;exports.globSync=fs;exports.globIterateSync=Ft;exports.globIterate=ds;var Si=Y(),nt=ls(),Sr=cs(),_i=Y();Object.defineProperty(exports, "escape", ({enumerable:!0,get:function(){return _i.escape}}));Object.defineProperty(exports, "unescape", ({enumerable:!0,get:function(){return _i.unescape}}));var vr=ls();Object.defineProperty(exports, "Glob", ({enumerable:!0,get:function(){return vr.Glob}}));var _r=cs();Object.defineProperty(exports, "hasMagic", ({enumerable:!0,get:function(){return _r.hasMagic}}));var Er=is();Object.defineProperty(exports, "Ignore", ({enumerable:!0,get:function(){return Er.Ignore}}));function Tt(r,t={}){return new nt.Glob(r,t).streamSync()}function us(r,t={}){return new nt.Glob(r,t).stream()}function fs(r,t={}){return new nt.Glob(r,t).walkSync()}async function vi(r,t={}){return new nt.Glob(r,t).walk()}function Ft(r,t={}){return new nt.Glob(r,t).iterateSync()}function ds(r,t={}){return new nt.Glob(r,t).iterate()}exports.streamSync=Tt;exports.stream=Object.assign(us,{sync:Tt});exports.iterateSync=Ft;exports.iterate=Object.assign(ds,{sync:Ft});exports.sync=Object.assign(fs,{stream:Tt,iterate:Ft});exports.glob=Object.assign(vi,{glob:vi,globSync:fs,sync:exports.sync,globStream:us,stream:exports.stream,globStreamSync:Tt,streamSync:exports.streamSync,globIterate:ds,iterate:exports.iterate,globIterateSync:Ft,iterateSync:exports.iterateSync,Glob:nt.Glob,hasMagic:Sr.hasMagic,escape:Si.escape,unescape:Si.unescape});exports.glob.glob=exports.glob;
|
|
123469
125067
|
//# sourceMappingURL=index.min.js.map
|
|
123470
125068
|
|
|
123471
125069
|
|