@hyperfixi/mcp-server 2.3.0 → 2.4.0

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.
@@ -114,11 +114,11 @@ function embrace(str) {
114
114
  function isPadded(el) {
115
115
  return /^-?0\d/.test(el);
116
116
  }
117
- function lte(i, y2) {
118
- return i <= y2;
117
+ function lte(i, y) {
118
+ return i <= y;
119
119
  }
120
- function gte(i, y2) {
121
- return i >= y2;
120
+ function gte(i, y) {
121
+ return i >= y;
122
122
  }
123
123
  function expand_(str, max, isTop) {
124
124
  const expansions = [];
@@ -128,8 +128,8 @@ function expand_(str, max, isTop) {
128
128
  const pre = m.pre;
129
129
  const post = m.post.length ? expand_(m.post, max, false) : [""];
130
130
  if (/\$$/.test(m.pre)) {
131
- for (let k = 0; k < post.length && k < max; k++) {
132
- const expansion = pre + "{" + m.body + "}" + post[k];
131
+ for (let k2 = 0; k2 < post.length && k2 < max; k2++) {
132
+ const expansion = pre + "{" + m.body + "}" + post[k2];
133
133
  expansions.push(expansion);
134
134
  }
135
135
  } else {
@@ -158,50 +158,50 @@ function expand_(str, max, isTop) {
158
158
  }
159
159
  let N;
160
160
  if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
161
- const x2 = numeric(n[0]);
162
- const y2 = numeric(n[1]);
161
+ const x = numeric(n[0]);
162
+ const y = numeric(n[1]);
163
163
  const width = Math.max(n[0].length, n[1].length);
164
- let incr = n.length === 3 && n[2] !== void 0 ? Math.abs(numeric(n[2])) : 1;
164
+ let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
165
165
  let test = lte;
166
- const reverse = y2 < x2;
166
+ const reverse = y < x;
167
167
  if (reverse) {
168
168
  incr *= -1;
169
169
  test = gte;
170
170
  }
171
171
  const pad = n.some(isPadded);
172
172
  N = [];
173
- for (let i = x2; test(i, y2); i += incr) {
174
- let c3;
173
+ for (let i = x; test(i, y) && N.length < max; i += incr) {
174
+ let c;
175
175
  if (isAlphaSequence) {
176
- c3 = String.fromCharCode(i);
177
- if (c3 === "\\") {
178
- c3 = "";
176
+ c = String.fromCharCode(i);
177
+ if (c === "\\") {
178
+ c = "";
179
179
  }
180
180
  } else {
181
- c3 = String(i);
181
+ c = String(i);
182
182
  if (pad) {
183
- const need = width - c3.length;
183
+ const need = width - c.length;
184
184
  if (need > 0) {
185
- const z2 = new Array(need + 1).join("0");
185
+ const z = new Array(need + 1).join("0");
186
186
  if (i < 0) {
187
- c3 = "-" + z2 + c3.slice(1);
187
+ c = "-" + z + c.slice(1);
188
188
  } else {
189
- c3 = z2 + c3;
189
+ c = z + c;
190
190
  }
191
191
  }
192
192
  }
193
193
  }
194
- N.push(c3);
194
+ N.push(c);
195
195
  }
196
196
  } else {
197
197
  N = [];
198
- for (let j = 0; j < n.length; j++) {
199
- N.push.apply(N, expand_(n[j], max, false));
198
+ for (let j2 = 0; j2 < n.length; j2++) {
199
+ N.push.apply(N, expand_(n[j2], max, false));
200
200
  }
201
201
  }
202
- for (let j = 0; j < N.length; j++) {
203
- for (let k = 0; k < post.length && expansions.length < max; k++) {
204
- const expansion = pre + N[j] + post[k];
202
+ for (let j2 = 0; j2 < N.length; j2++) {
203
+ for (let k2 = 0; k2 < post.length && expansions.length < max; k2++) {
204
+ const expansion = pre + N[j2] + post[k2];
205
205
  if (!isTop || isSequence || expansion) {
206
206
  expansions.push(expansion);
207
207
  }
@@ -257,26 +257,26 @@ var parseClass = (glob2, position) => {
257
257
  let endPos = pos;
258
258
  let rangeStart = "";
259
259
  WHILE: while (i < glob2.length) {
260
- const c3 = glob2.charAt(i);
261
- if ((c3 === "!" || c3 === "^") && i === pos + 1) {
260
+ const c = glob2.charAt(i);
261
+ if ((c === "!" || c === "^") && i === pos + 1) {
262
262
  negate = true;
263
263
  i++;
264
264
  continue;
265
265
  }
266
- if (c3 === "]" && sawStart && !escaping) {
266
+ if (c === "]" && sawStart && !escaping) {
267
267
  endPos = i + 1;
268
268
  break;
269
269
  }
270
270
  sawStart = true;
271
- if (c3 === "\\") {
271
+ if (c === "\\") {
272
272
  if (!escaping) {
273
273
  escaping = true;
274
274
  i++;
275
275
  continue;
276
276
  }
277
277
  }
278
- if (c3 === "[" && !escaping) {
279
- for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
278
+ if (c === "[" && !escaping) {
279
+ for (const [cls, [unip, u3, neg]] of Object.entries(posixClasses)) {
280
280
  if (glob2.startsWith(cls, i)) {
281
281
  if (rangeStart) {
282
282
  return ["$.", false, glob2.length - pos, true];
@@ -286,33 +286,33 @@ var parseClass = (glob2, position) => {
286
286
  negs.push(unip);
287
287
  else
288
288
  ranges.push(unip);
289
- uflag = uflag || u;
289
+ uflag = uflag || u3;
290
290
  continue WHILE;
291
291
  }
292
292
  }
293
293
  }
294
294
  escaping = false;
295
295
  if (rangeStart) {
296
- if (c3 > rangeStart) {
297
- ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c3));
298
- } else if (c3 === rangeStart) {
299
- ranges.push(braceEscape(c3));
296
+ if (c > rangeStart) {
297
+ ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
298
+ } else if (c === rangeStart) {
299
+ ranges.push(braceEscape(c));
300
300
  }
301
301
  rangeStart = "";
302
302
  i++;
303
303
  continue;
304
304
  }
305
305
  if (glob2.startsWith("-]", i + 1)) {
306
- ranges.push(braceEscape(c3 + "-"));
306
+ ranges.push(braceEscape(c + "-"));
307
307
  i += 2;
308
308
  continue;
309
309
  }
310
310
  if (glob2.startsWith("-", i + 1)) {
311
- rangeStart = c3;
311
+ rangeStart = c;
312
312
  i += 2;
313
313
  continue;
314
314
  }
315
- ranges.push(braceEscape(c3));
315
+ ranges.push(braceEscape(c));
316
316
  i++;
317
317
  }
318
318
  if (endPos < i) {
@@ -334,16 +334,16 @@ var parseClass = (glob2, position) => {
334
334
  // ../../node_modules/minimatch/dist/esm/unescape.js
335
335
  var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
336
336
  if (magicalBraces) {
337
- return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
337
+ return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1");
338
338
  }
339
- return windowsPathsNoEscape ? s.replace(/\[([^\/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
339
+ return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
340
340
  };
341
341
 
342
342
  // ../../node_modules/minimatch/dist/esm/ast.js
343
343
  var _a;
344
344
  var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
345
- var isExtglobType = (c3) => types.has(c3);
346
- var isExtglobAST = (c3) => isExtglobType(c3.type);
345
+ var isExtglobType = (c) => types.has(c);
346
+ var isExtglobAST = (c) => isExtglobType(c.type);
347
347
  var adoptionMap = /* @__PURE__ */ new Map([
348
348
  ["!", ["@"]],
349
349
  ["?", ["?", "@"]],
@@ -456,13 +456,7 @@ var AST = class {
456
456
  }
457
457
  // reconstructs the pattern
458
458
  toString() {
459
- if (this.#toString !== void 0)
460
- return this.#toString;
461
- if (!this.type) {
462
- return this.#toString = this.#parts.map((p) => String(p)).join("");
463
- } else {
464
- return this.#toString = this.type + "(" + this.#parts.map((p) => String(p)).join("|") + ")";
465
- }
459
+ return this.#toString !== void 0 ? this.#toString : !this.type ? this.#toString = this.#parts.map((p) => String(p)).join("") : this.#toString = this.type + "(" + this.#parts.map((p) => String(p)).join("|") + ")";
466
460
  }
467
461
  #fillNegs() {
468
462
  if (this !== this.#root)
@@ -546,11 +540,11 @@ var AST = class {
546
540
  this.push(part.clone(this));
547
541
  }
548
542
  clone(parent) {
549
- const c3 = new _a(this.type, parent);
543
+ const c = new _a(this.type, parent);
550
544
  for (const p of this.#parts) {
551
- c3.copyIn(p);
545
+ c.copyIn(p);
552
546
  }
553
- return c3;
547
+ return c;
554
548
  }
555
549
  static #parseAST(str, ast, pos, opt, extDepth) {
556
550
  const maxDepth = opt.maxExtglobRecursion ?? 2;
@@ -562,39 +556,39 @@ var AST = class {
562
556
  let i2 = pos;
563
557
  let acc2 = "";
564
558
  while (i2 < str.length) {
565
- const c3 = str.charAt(i2++);
566
- if (escaping || c3 === "\\") {
559
+ const c = str.charAt(i2++);
560
+ if (escaping || c === "\\") {
567
561
  escaping = !escaping;
568
- acc2 += c3;
562
+ acc2 += c;
569
563
  continue;
570
564
  }
571
565
  if (inBrace) {
572
566
  if (i2 === braceStart + 1) {
573
- if (c3 === "^" || c3 === "!") {
567
+ if (c === "^" || c === "!") {
574
568
  braceNeg = true;
575
569
  }
576
- } else if (c3 === "]" && !(i2 === braceStart + 2 && braceNeg)) {
570
+ } else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
577
571
  inBrace = false;
578
572
  }
579
- acc2 += c3;
573
+ acc2 += c;
580
574
  continue;
581
- } else if (c3 === "[") {
575
+ } else if (c === "[") {
582
576
  inBrace = true;
583
577
  braceStart = i2;
584
578
  braceNeg = false;
585
- acc2 += c3;
579
+ acc2 += c;
586
580
  continue;
587
581
  }
588
- const doRecurse = !opt.noext && isExtglobType(c3) && str.charAt(i2) === "(" && extDepth <= maxDepth;
582
+ const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth;
589
583
  if (doRecurse) {
590
584
  ast.push(acc2);
591
585
  acc2 = "";
592
- const ext2 = new _a(c3, ast);
586
+ const ext2 = new _a(c, ast);
593
587
  i2 = _a.#parseAST(str, ext2, i2, opt, extDepth + 1);
594
588
  ast.push(ext2);
595
589
  continue;
596
590
  }
597
- acc2 += c3;
591
+ acc2 += c;
598
592
  }
599
593
  ast.push(acc2);
600
594
  return i2;
@@ -604,48 +598,48 @@ var AST = class {
604
598
  const parts = [];
605
599
  let acc = "";
606
600
  while (i < str.length) {
607
- const c3 = str.charAt(i++);
608
- if (escaping || c3 === "\\") {
601
+ const c = str.charAt(i++);
602
+ if (escaping || c === "\\") {
609
603
  escaping = !escaping;
610
- acc += c3;
604
+ acc += c;
611
605
  continue;
612
606
  }
613
607
  if (inBrace) {
614
608
  if (i === braceStart + 1) {
615
- if (c3 === "^" || c3 === "!") {
609
+ if (c === "^" || c === "!") {
616
610
  braceNeg = true;
617
611
  }
618
- } else if (c3 === "]" && !(i === braceStart + 2 && braceNeg)) {
612
+ } else if (c === "]" && !(i === braceStart + 2 && braceNeg)) {
619
613
  inBrace = false;
620
614
  }
621
- acc += c3;
615
+ acc += c;
622
616
  continue;
623
- } else if (c3 === "[") {
617
+ } else if (c === "[") {
624
618
  inBrace = true;
625
619
  braceStart = i;
626
620
  braceNeg = false;
627
- acc += c3;
621
+ acc += c;
628
622
  continue;
629
623
  }
630
- const doRecurse = !opt.noext && isExtglobType(c3) && str.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
631
- (extDepth <= maxDepth || ast && ast.#canAdoptType(c3));
624
+ const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
625
+ (extDepth <= maxDepth || ast && ast.#canAdoptType(c));
632
626
  if (doRecurse) {
633
- const depthAdd = ast && ast.#canAdoptType(c3) ? 0 : 1;
627
+ const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
634
628
  part.push(acc);
635
629
  acc = "";
636
- const ext2 = new _a(c3, part);
630
+ const ext2 = new _a(c, part);
637
631
  part.push(ext2);
638
632
  i = _a.#parseAST(str, ext2, i, opt, extDepth + depthAdd);
639
633
  continue;
640
634
  }
641
- if (c3 === "|") {
635
+ if (c === "|") {
642
636
  part.push(acc);
643
637
  acc = "";
644
638
  parts.push(part);
645
639
  part = new _a(null, ast);
646
640
  continue;
647
641
  }
648
- if (c3 === ")") {
642
+ if (c === ")") {
649
643
  if (acc === "" && ast.#parts.length === 0) {
650
644
  ast.#emptyExt = true;
651
645
  }
@@ -654,7 +648,7 @@ var AST = class {
654
648
  ast.push(...parts, part);
655
649
  return i;
656
650
  }
657
- acc += c3;
651
+ acc += c;
658
652
  }
659
653
  ast.type = null;
660
654
  ast.#hasMagic = void 0;
@@ -674,8 +668,8 @@ var AST = class {
674
668
  }
675
669
  return this.#canAdoptType(gc.type, map);
676
670
  }
677
- #canAdoptType(c3, map = adoptionAnyMap) {
678
- return !!map.get(this.type)?.includes(c3);
671
+ #canAdoptType(c, map = adoptionAnyMap) {
672
+ return !!map.get(this.type)?.includes(c);
679
673
  }
680
674
  #adoptWithSpace(child, index) {
681
675
  const gc = child.#parts[0];
@@ -693,9 +687,9 @@ var AST = class {
693
687
  }
694
688
  this.#toString = void 0;
695
689
  }
696
- #canUsurpType(c3) {
690
+ #canUsurpType(c) {
697
691
  const m = usurpMap.get(this.type);
698
- return !!m?.has(c3);
692
+ return !!m?.has(c);
699
693
  }
700
694
  #canUsurp(child) {
701
695
  if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
@@ -908,18 +902,18 @@ var AST = class {
908
902
  do {
909
903
  done = true;
910
904
  for (let i = 0; i < this.#parts.length; i++) {
911
- const c3 = this.#parts[i];
912
- if (typeof c3 === "object") {
913
- c3.#flatten();
914
- if (this.#canAdopt(c3)) {
905
+ const c = this.#parts[i];
906
+ if (typeof c === "object") {
907
+ c.#flatten();
908
+ if (this.#canAdopt(c)) {
915
909
  done = false;
916
- this.#adopt(c3, i);
917
- } else if (this.#canAdoptWithSpace(c3)) {
910
+ this.#adopt(c, i);
911
+ } else if (this.#canAdoptWithSpace(c)) {
918
912
  done = false;
919
- this.#adoptWithSpace(c3, i);
920
- } else if (this.#canUsurp(c3)) {
913
+ this.#adoptWithSpace(c, i);
914
+ } else if (this.#canUsurp(c)) {
921
915
  done = false;
922
- this.#usurp(c3);
916
+ this.#usurp(c);
923
917
  }
924
918
  }
925
919
  }
@@ -943,13 +937,13 @@ var AST = class {
943
937
  let uflag = false;
944
938
  let inStar = false;
945
939
  for (let i = 0; i < glob2.length; i++) {
946
- const c3 = glob2.charAt(i);
940
+ const c = glob2.charAt(i);
947
941
  if (escaping) {
948
942
  escaping = false;
949
- re += (reSpecials.has(c3) ? "\\" : "") + c3;
943
+ re += (reSpecials.has(c) ? "\\" : "") + c;
950
944
  continue;
951
945
  }
952
- if (c3 === "*") {
946
+ if (c === "*") {
953
947
  if (inStar)
954
948
  continue;
955
949
  inStar = true;
@@ -959,7 +953,7 @@ var AST = class {
959
953
  } else {
960
954
  inStar = false;
961
955
  }
962
- if (c3 === "\\") {
956
+ if (c === "\\") {
963
957
  if (i === glob2.length - 1) {
964
958
  re += "\\\\";
965
959
  } else {
@@ -967,7 +961,7 @@ var AST = class {
967
961
  }
968
962
  continue;
969
963
  }
970
- if (c3 === "[") {
964
+ if (c === "[") {
971
965
  const [src, needUflag, consumed, magic] = parseClass(glob2, i);
972
966
  if (consumed) {
973
967
  re += src;
@@ -977,12 +971,12 @@ var AST = class {
977
971
  continue;
978
972
  }
979
973
  }
980
- if (c3 === "?") {
974
+ if (c === "?") {
981
975
  re += qmark;
982
976
  hasMagic2 = true;
983
977
  continue;
984
978
  }
985
- re += regExpEscape(c3);
979
+ re += regExpEscape(c);
986
980
  }
987
981
  return [re, unescape(glob2), !!hasMagic2, uflag];
988
982
  }
@@ -1005,7 +999,7 @@ var minimatch = (p, pattern, options = {}) => {
1005
999
  }
1006
1000
  return new Minimatch(pattern, options).match(p);
1007
1001
  };
1008
- var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
1002
+ var starDotExtRE = /^\*+([^+@!?*[(]*)$/;
1009
1003
  var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
1010
1004
  var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
1011
1005
  var starDotExtTestNocase = (ext2) => {
@@ -1024,7 +1018,7 @@ var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
1024
1018
  var starRE = /^\*+$/;
1025
1019
  var starTest = (f) => f.length !== 0 && !f.startsWith(".");
1026
1020
  var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
1027
- var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
1021
+ var qmarksRE = /^\?+([^+@!?*[(]*)?$/;
1028
1022
  var qmarksTestNocase = ([$0, ext2 = ""]) => {
1029
1023
  const noext = qmarksTestNoExt([$0]);
1030
1024
  if (!ext2)
@@ -1243,10 +1237,10 @@ var Minimatch = class {
1243
1237
  // of patterns that we have to process.
1244
1238
  preprocess(globParts) {
1245
1239
  if (this.options.noglobstar) {
1246
- for (let i = 0; i < globParts.length; i++) {
1247
- for (let j = 0; j < globParts[i].length; j++) {
1248
- if (globParts[i][j] === "**") {
1249
- globParts[i][j] = "*";
1240
+ for (const partset of globParts) {
1241
+ for (let j2 = 0; j2 < partset.length; j2++) {
1242
+ if (partset[j2] === "**") {
1243
+ partset[j2] = "*";
1250
1244
  }
1251
1245
  }
1252
1246
  }
@@ -1324,7 +1318,7 @@ var Minimatch = class {
1324
1318
  let dd = 0;
1325
1319
  while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
1326
1320
  const p = parts[dd - 1];
1327
- if (p && p !== "." && p !== ".." && p !== "**") {
1321
+ if (p && p !== "." && p !== ".." && p !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p))) {
1328
1322
  didSomething = true;
1329
1323
  parts.splice(dd - 1, 2);
1330
1324
  dd -= 2;
@@ -1422,11 +1416,11 @@ var Minimatch = class {
1422
1416
  // ^-- not valid because ** doens't follow symlinks
1423
1417
  secondPhasePreProcess(globParts) {
1424
1418
  for (let i = 0; i < globParts.length - 1; i++) {
1425
- for (let j = i + 1; j < globParts.length; j++) {
1426
- const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
1419
+ for (let j2 = i + 1; j2 < globParts.length; j2++) {
1420
+ const matched = this.partsMatch(globParts[i], globParts[j2], !this.preserveMultipleSlashes);
1427
1421
  if (matched) {
1428
1422
  globParts[i] = [];
1429
- globParts[j] = matched;
1423
+ globParts[j2] = matched;
1430
1424
  break;
1431
1425
  }
1432
1426
  }
@@ -1740,7 +1734,7 @@ var Minimatch = class {
1740
1734
  re = "^(?!" + re + ").+$";
1741
1735
  try {
1742
1736
  this.regexp = new RegExp(re, [...flags].join(""));
1743
- } catch (ex) {
1737
+ } catch {
1744
1738
  this.regexp = false;
1745
1739
  }
1746
1740
  return this.regexp;
@@ -1748,7 +1742,7 @@ var Minimatch = class {
1748
1742
  slashSplit(p) {
1749
1743
  if (this.preserveMultipleSlashes) {
1750
1744
  return p.split("/");
1751
- } else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
1745
+ } else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
1752
1746
  return ["", ...p.split(/\/+/)];
1753
1747
  } else {
1754
1748
  return p.split(/\/+/);
@@ -1779,8 +1773,7 @@ var Minimatch = class {
1779
1773
  filename = ff[i];
1780
1774
  }
1781
1775
  }
1782
- for (let i = 0; i < set.length; i++) {
1783
- const pattern = set[i];
1776
+ for (const pattern of set) {
1784
1777
  let file = ff;
1785
1778
  if (options.matchBase && pattern.length === 1) {
1786
1779
  file = [filename];
@@ -1810,79 +1803,54 @@ minimatch.unescape = unescape;
1810
1803
  // ../../node_modules/glob/dist/esm/glob.js
1811
1804
  import { fileURLToPath as fileURLToPath2 } from "url";
1812
1805
 
1813
- // ../../node_modules/lru-cache/dist/esm/index.min.js
1814
- var x = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
1815
- var I = /* @__PURE__ */ new Set();
1816
- var R = typeof process == "object" && process ? process : {};
1817
- var U = (c3, t, e, i) => {
1818
- typeof R.emitWarning == "function" ? R.emitWarning(c3, t, e, i) : console.error(`[${e}] ${t}: ${c3}`);
1806
+ // ../../node_modules/lru-cache/dist/esm/node/index.min.js
1807
+ import { tracingChannel as G, channel as P } from "diagnostics_channel";
1808
+ var S = P("lru-cache:metrics");
1809
+ var W = G("lru-cache");
1810
+ var L = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
1811
+ var D = () => S.hasSubscribers || W.hasSubscribers;
1812
+ var U = /* @__PURE__ */ new Set();
1813
+ var M = typeof process == "object" && process ? process : {};
1814
+ var k = (u3, e, t, i) => {
1815
+ typeof M.emitWarning == "function" ? M.emitWarning(u3, e, t, i) : console.error(`[${t}] ${e}: ${u3}`);
1819
1816
  };
1820
- var C = globalThis.AbortController;
1821
- var D = globalThis.AbortSignal;
1822
- if (typeof C > "u") {
1823
- D = class {
1824
- onabort;
1825
- _onabort = [];
1826
- reason;
1827
- aborted = false;
1828
- addEventListener(i, s) {
1829
- this._onabort.push(s);
1830
- }
1831
- }, C = class {
1832
- constructor() {
1833
- t();
1834
- }
1835
- signal = new D();
1836
- abort(i) {
1837
- if (!this.signal.aborted) {
1838
- this.signal.reason = i, this.signal.aborted = true;
1839
- for (let s of this.signal._onabort) s(i);
1840
- this.signal.onabort?.(i);
1841
- }
1842
- }
1843
- };
1844
- let c3 = R.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
1845
- c3 && (c3 = false, U("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t));
1846
- };
1847
- }
1848
- var G = (c3) => !I.has(c3);
1849
- var H = Symbol("type");
1850
- var y = (c3) => c3 && c3 === Math.floor(c3) && c3 > 0 && isFinite(c3);
1851
- var M = (c3) => y(c3) ? c3 <= Math.pow(2, 8) ? Uint8Array : c3 <= Math.pow(2, 16) ? Uint16Array : c3 <= Math.pow(2, 32) ? Uint32Array : c3 <= Number.MAX_SAFE_INTEGER ? z : null : null;
1852
- var z = class extends Array {
1853
- constructor(t) {
1854
- super(t), this.fill(0);
1817
+ var H = (u3) => !U.has(u3);
1818
+ var T = (u3) => !!u3 && u3 === Math.floor(u3) && u3 > 0 && isFinite(u3);
1819
+ var j = (u3) => T(u3) ? u3 <= Math.pow(2, 8) ? Uint8Array : u3 <= Math.pow(2, 16) ? Uint16Array : u3 <= Math.pow(2, 32) ? Uint32Array : u3 <= Number.MAX_SAFE_INTEGER ? O : null : null;
1820
+ var O = class extends Array {
1821
+ constructor(e) {
1822
+ super(e), this.fill(0);
1855
1823
  }
1856
1824
  };
1857
- var W = class c {
1825
+ var R = class u {
1858
1826
  heap;
1859
1827
  length;
1860
1828
  static #o = false;
1861
- static create(t) {
1862
- let e = M(t);
1863
- if (!e) return [];
1864
- c.#o = true;
1865
- let i = new c(t, e);
1866
- return c.#o = false, i;
1829
+ static create(e) {
1830
+ let t = j(e);
1831
+ if (!t) return [];
1832
+ u.#o = true;
1833
+ let i = new u(e, t);
1834
+ return u.#o = false, i;
1867
1835
  }
1868
- constructor(t, e) {
1869
- if (!c.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
1870
- this.heap = new e(t), this.length = 0;
1836
+ constructor(e, t) {
1837
+ if (!u.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
1838
+ this.heap = new t(e), this.length = 0;
1871
1839
  }
1872
- push(t) {
1873
- this.heap[this.length++] = t;
1840
+ push(e) {
1841
+ this.heap[this.length++] = e;
1874
1842
  }
1875
1843
  pop() {
1876
1844
  return this.heap[--this.length];
1877
1845
  }
1878
1846
  };
1879
- var L = class c2 {
1847
+ var I = class u2 {
1880
1848
  #o;
1881
1849
  #c;
1882
- #w;
1883
- #C;
1884
1850
  #S;
1885
- #L;
1851
+ #O;
1852
+ #w;
1853
+ #M;
1886
1854
  #I;
1887
1855
  #m;
1888
1856
  get perf() {
@@ -1903,31 +1871,32 @@ var L = class c2 {
1903
1871
  allowStaleOnFetchAbort;
1904
1872
  allowStaleOnFetchRejection;
1905
1873
  ignoreFetchAbort;
1874
+ backgroundFetchSize;
1906
1875
  #n;
1907
- #_;
1876
+ #b;
1908
1877
  #s;
1909
1878
  #i;
1910
1879
  #t;
1911
- #a;
1912
- #u;
1913
1880
  #l;
1881
+ #u;
1882
+ #a;
1914
1883
  #h;
1915
- #b;
1916
- #r;
1917
1884
  #y;
1918
- #A;
1885
+ #r;
1886
+ #_;
1887
+ #F;
1919
1888
  #d;
1920
1889
  #g;
1921
1890
  #T;
1922
- #v;
1923
- #f;
1924
1891
  #U;
1925
- static unsafeExposeInternals(t) {
1926
- return { starts: t.#A, ttls: t.#d, autopurgeTimers: t.#g, sizes: t.#y, keyMap: t.#s, keyList: t.#i, valList: t.#t, next: t.#a, prev: t.#u, get head() {
1927
- return t.#l;
1892
+ #f;
1893
+ #x;
1894
+ static unsafeExposeInternals(e) {
1895
+ return { starts: e.#F, ttls: e.#d, autopurgeTimers: e.#g, sizes: e.#_, keyMap: e.#s, keyList: e.#i, valList: e.#t, next: e.#l, prev: e.#u, get head() {
1896
+ return e.#a;
1928
1897
  }, get tail() {
1929
- return t.#h;
1930
- }, free: t.#b, isBackgroundFetch: (e) => t.#e(e), backgroundFetch: (e, i, s, n) => t.#G(e, i, s, n), moveToTail: (e) => t.#D(e), indexes: (e) => t.#F(e), rindexes: (e) => t.#O(e), isStale: (e) => t.#p(e) };
1898
+ return e.#h;
1899
+ }, free: e.#y, isBackgroundFetch: (t) => e.#e(t), backgroundFetch: (t, i, s, n) => e.#P(t, i, s, n), moveToTail: (t) => e.#L(t), indexes: (t) => e.#A(t), rindexes: (t) => e.#z(t), isStale: (t) => e.#p(t) };
1931
1900
  }
1932
1901
  get max() {
1933
1902
  return this.#o;
@@ -1936,425 +1905,482 @@ var L = class c2 {
1936
1905
  return this.#c;
1937
1906
  }
1938
1907
  get calculatedSize() {
1939
- return this.#_;
1908
+ return this.#b;
1940
1909
  }
1941
1910
  get size() {
1942
1911
  return this.#n;
1943
1912
  }
1944
1913
  get fetchMethod() {
1945
- return this.#L;
1914
+ return this.#M;
1946
1915
  }
1947
1916
  get memoMethod() {
1948
1917
  return this.#I;
1949
1918
  }
1950
1919
  get dispose() {
1951
- return this.#w;
1920
+ return this.#S;
1952
1921
  }
1953
1922
  get onInsert() {
1954
- return this.#C;
1923
+ return this.#O;
1955
1924
  }
1956
1925
  get disposeAfter() {
1957
- return this.#S;
1926
+ return this.#w;
1958
1927
  }
1959
- constructor(t) {
1960
- let { max: e = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: o, updateAgeOnHas: h, allowStale: r, dispose: a, onInsert: w, disposeAfter: f, noDisposeOnSet: d, noUpdateTTL: g, maxSize: A = 0, maxEntrySize: p = 0, sizeCalculation: _, fetchMethod: l, memoMethod: S, noDeleteOnFetchRejection: b, noDeleteOnStaleGet: m, allowStaleOnFetchRejection: u, allowStaleOnFetchAbort: T, ignoreFetchAbort: F, perf: v } = t;
1961
- if (v !== void 0 && typeof v?.now != "function") throw new TypeError("perf option must have a now() method if specified");
1962
- if (this.#m = v ?? x, e !== 0 && !y(e)) throw new TypeError("max option must be a nonnegative integer");
1963
- let O = e ? M(e) : Array;
1964
- if (!O) throw new Error("invalid max value: " + e);
1965
- if (this.#o = e, this.#c = A, this.maxEntrySize = p || this.#c, this.sizeCalculation = _, this.sizeCalculation) {
1928
+ constructor(e) {
1929
+ let { max: t = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: r, updateAgeOnHas: h, allowStale: a, dispose: o, onInsert: d, disposeAfter: y, noDisposeOnSet: _, noUpdateTTL: c, maxSize: g = 0, maxEntrySize: f = 0, sizeCalculation: b, fetchMethod: l, memoMethod: w, noDeleteOnFetchRejection: F, noDeleteOnStaleGet: m, allowStaleOnFetchRejection: p, allowStaleOnFetchAbort: A, ignoreFetchAbort: z, backgroundFetchSize: C = 1, perf: E } = e;
1930
+ if (this.backgroundFetchSize = C, E !== void 0 && typeof E?.now != "function") throw new TypeError("perf option must have a now() method if specified");
1931
+ if (this.#m = E ?? L, t !== 0 && !T(t)) throw new TypeError("max option must be a nonnegative integer");
1932
+ let v = t ? j(t) : Array;
1933
+ if (!v) throw new Error("invalid max value: " + t);
1934
+ if (this.#o = t, this.#c = g, this.maxEntrySize = f || this.#c, this.sizeCalculation = b, this.sizeCalculation) {
1966
1935
  if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
1967
1936
  if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
1968
1937
  }
1969
- if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
1970
- if (this.#I = S, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
1971
- if (this.#L = l, this.#v = !!l, this.#s = /* @__PURE__ */ new Map(), this.#i = new Array(e).fill(void 0), this.#t = new Array(e).fill(void 0), this.#a = new O(e), this.#u = new O(e), this.#l = 0, this.#h = 0, this.#b = W.create(e), this.#n = 0, this.#_ = 0, typeof a == "function" && (this.#w = a), typeof w == "function" && (this.#C = w), typeof f == "function" ? (this.#S = f, this.#r = []) : (this.#S = void 0, this.#r = void 0), this.#T = !!this.#w, this.#U = !!this.#C, this.#f = !!this.#S, this.noDisposeOnSet = !!d, this.noUpdateTTL = !!g, this.noDeleteOnFetchRejection = !!b, this.allowStaleOnFetchRejection = !!u, this.allowStaleOnFetchAbort = !!T, this.ignoreFetchAbort = !!F, this.maxEntrySize !== 0) {
1972
- if (this.#c !== 0 && !y(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
1973
- if (!y(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
1974
- this.#B();
1938
+ if (w !== void 0 && typeof w != "function") throw new TypeError("memoMethod must be a function if defined");
1939
+ if (this.#I = w, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
1940
+ if (this.#M = l, this.#U = !!l, this.#s = /* @__PURE__ */ new Map(), this.#i = Array.from({ length: t }).fill(void 0), this.#t = Array.from({ length: t }).fill(void 0), this.#l = new v(t), this.#u = new v(t), this.#a = 0, this.#h = 0, this.#y = R.create(t), this.#n = 0, this.#b = 0, typeof o == "function" && (this.#S = o), typeof d == "function" && (this.#O = d), typeof y == "function" ? (this.#w = y, this.#r = []) : (this.#w = void 0, this.#r = void 0), this.#T = !!this.#S, this.#x = !!this.#O, this.#f = !!this.#w, this.noDisposeOnSet = !!_, this.noUpdateTTL = !!c, this.noDeleteOnFetchRejection = !!F, this.allowStaleOnFetchRejection = !!p, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
1941
+ if (this.#c !== 0 && !T(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
1942
+ if (!T(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
1943
+ this.#X();
1975
1944
  }
1976
- if (this.allowStale = !!r, this.noDeleteOnStaleGet = !!m, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!h, this.ttlResolution = y(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
1977
- if (!y(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
1978
- this.#j();
1945
+ if (this.allowStale = !!a, this.noDeleteOnStaleGet = !!m, this.updateAgeOnGet = !!r, this.updateAgeOnHas = !!h, this.ttlResolution = T(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
1946
+ if (!T(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
1947
+ this.#k();
1979
1948
  }
1980
1949
  if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
1981
1950
  if (!this.ttlAutopurge && !this.#o && !this.#c) {
1982
- let E = "LRU_CACHE_UNBOUNDED";
1983
- G(E) && (I.add(E), U("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, c2));
1951
+ let x = "LRU_CACHE_UNBOUNDED";
1952
+ H(x) && (U.add(x), k("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", x, u2));
1984
1953
  }
1985
1954
  }
1986
- getRemainingTTL(t) {
1987
- return this.#s.has(t) ? 1 / 0 : 0;
1955
+ getRemainingTTL(e) {
1956
+ return this.#s.has(e) ? 1 / 0 : 0;
1988
1957
  }
1989
- #j() {
1990
- let t = new z(this.#o), e = new z(this.#o);
1991
- this.#d = t, this.#A = e;
1992
- let i = this.ttlAutopurge ? new Array(this.#o) : void 0;
1993
- this.#g = i, this.#N = (h, r, a = this.#m.now()) => {
1994
- e[h] = r !== 0 ? a : 0, t[h] = r, s(h, r);
1995
- }, this.#R = (h) => {
1996
- e[h] = t[h] !== 0 ? this.#m.now() : 0, s(h, t[h]);
1958
+ #k() {
1959
+ let e = new O(this.#o), t = new O(this.#o);
1960
+ this.#d = e, this.#F = t;
1961
+ let i = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
1962
+ this.#g = i, this.#H = (h, a, o = this.#m.now()) => {
1963
+ t[h] = a !== 0 ? o : 0, e[h] = a, s(h, a);
1964
+ }, this.#D = (h) => {
1965
+ t[h] = e[h] !== 0 ? this.#m.now() : 0, s(h, e[h]);
1997
1966
  };
1998
- let s = this.ttlAutopurge ? (h, r) => {
1999
- if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0), r && r !== 0 && i) {
2000
- let a = setTimeout(() => {
1967
+ let s = this.ttlAutopurge ? (h, a) => {
1968
+ if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0), a && a !== 0 && i) {
1969
+ let o = setTimeout(() => {
2001
1970
  this.#p(h) && this.#E(this.#i[h], "expire");
2002
- }, r + 1);
2003
- a.unref && a.unref(), i[h] = a;
1971
+ }, a + 1);
1972
+ o.unref && o.unref(), i[h] = o;
2004
1973
  }
2005
1974
  } : () => {
2006
1975
  };
2007
- this.#z = (h, r) => {
2008
- if (t[r]) {
2009
- let a = t[r], w = e[r];
2010
- if (!a || !w) return;
2011
- h.ttl = a, h.start = w, h.now = n || o();
2012
- let f = h.now - w;
2013
- h.remainingTTL = a - f;
1976
+ this.#v = (h, a) => {
1977
+ if (e[a]) {
1978
+ let o = e[a], d = t[a];
1979
+ if (!o || !d) return;
1980
+ h.ttl = o, h.start = d, h.now = n || r();
1981
+ let y = h.now - d;
1982
+ h.remainingTTL = o - y;
2014
1983
  }
2015
1984
  };
2016
- let n = 0, o = () => {
1985
+ let n = 0, r = () => {
2017
1986
  let h = this.#m.now();
2018
1987
  if (this.ttlResolution > 0) {
2019
1988
  n = h;
2020
- let r = setTimeout(() => n = 0, this.ttlResolution);
2021
- r.unref && r.unref();
1989
+ let a = setTimeout(() => n = 0, this.ttlResolution);
1990
+ a.unref && a.unref();
2022
1991
  }
2023
1992
  return h;
2024
1993
  };
2025
1994
  this.getRemainingTTL = (h) => {
2026
- let r = this.#s.get(h);
2027
- if (r === void 0) return 0;
2028
- let a = t[r], w = e[r];
2029
- if (!a || !w) return 1 / 0;
2030
- let f = (n || o()) - w;
2031
- return a - f;
1995
+ let a = this.#s.get(h);
1996
+ if (a === void 0) return 0;
1997
+ let o = e[a], d = t[a];
1998
+ if (!o || !d) return 1 / 0;
1999
+ let y = (n || r()) - d;
2000
+ return o - y;
2032
2001
  }, this.#p = (h) => {
2033
- let r = e[h], a = t[h];
2034
- return !!a && !!r && (n || o()) - r > a;
2002
+ let a = t[h], o = e[h];
2003
+ return !!o && !!a && (n || r()) - a > o;
2035
2004
  };
2036
2005
  }
2037
- #R = () => {
2006
+ #D = () => {
2038
2007
  };
2039
- #z = () => {
2008
+ #v = () => {
2040
2009
  };
2041
- #N = () => {
2010
+ #H = () => {
2042
2011
  };
2043
2012
  #p = () => false;
2044
- #B() {
2045
- let t = new z(this.#o);
2046
- this.#_ = 0, this.#y = t, this.#W = (e) => {
2047
- this.#_ -= t[e], t[e] = 0;
2048
- }, this.#P = (e, i, s, n) => {
2049
- if (this.#e(i)) return 0;
2050
- if (!y(s)) if (n) {
2051
- if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
2052
- if (s = n(i, e), !y(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
2053
- } else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
2013
+ #X() {
2014
+ let e = new O(this.#o);
2015
+ this.#b = 0, this.#_ = e, this.#R = (t) => {
2016
+ this.#b -= e[t], e[t] = 0;
2017
+ }, this.#N = (t, i, s, n) => {
2018
+ if (!T(s)) {
2019
+ if (this.#e(i)) return this.backgroundFetchSize;
2020
+ if (n) {
2021
+ if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
2022
+ if (s = n(i, t), !T(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
2023
+ } else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
2024
+ }
2054
2025
  return s;
2055
- }, this.#M = (e, i, s) => {
2056
- if (t[e] = i, this.#c) {
2057
- let n = this.#c - t[e];
2058
- for (; this.#_ > n; ) this.#x(true);
2026
+ }, this.#j = (t, i, s) => {
2027
+ if (e[t] = i, this.#c) {
2028
+ let n = this.#c - e[t];
2029
+ for (; this.#b > n; ) this.#G(true);
2059
2030
  }
2060
- this.#_ += t[e], s && (s.entrySize = i, s.totalCalculatedSize = this.#_);
2031
+ this.#b += e[t], s && (s.entrySize = i, s.totalCalculatedSize = this.#b);
2061
2032
  };
2062
2033
  }
2063
- #W = (t) => {
2034
+ #R = (e) => {
2064
2035
  };
2065
- #M = (t, e, i) => {
2036
+ #j = (e, t, i) => {
2066
2037
  };
2067
- #P = (t, e, i, s) => {
2038
+ #N = (e, t, i, s) => {
2068
2039
  if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
2069
2040
  return 0;
2070
2041
  };
2071
- *#F({ allowStale: t = this.allowStale } = {}) {
2072
- if (this.#n) for (let e = this.#h; !(!this.#H(e) || ((t || !this.#p(e)) && (yield e), e === this.#l)); ) e = this.#u[e];
2042
+ *#A({ allowStale: e = this.allowStale } = {}) {
2043
+ if (this.#n) for (let t = this.#h; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#a); ) t = this.#u[t];
2073
2044
  }
2074
- *#O({ allowStale: t = this.allowStale } = {}) {
2075
- if (this.#n) for (let e = this.#l; !(!this.#H(e) || ((t || !this.#p(e)) && (yield e), e === this.#h)); ) e = this.#a[e];
2045
+ *#z({ allowStale: e = this.allowStale } = {}) {
2046
+ if (this.#n) for (let t = this.#a; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#h); ) t = this.#l[t];
2076
2047
  }
2077
- #H(t) {
2078
- return t !== void 0 && this.#s.get(this.#i[t]) === t;
2048
+ #V(e) {
2049
+ return e !== void 0 && this.#s.get(this.#i[e]) === e;
2079
2050
  }
2080
2051
  *entries() {
2081
- for (let t of this.#F()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
2052
+ for (let e of this.#A()) this.#t[e] !== void 0 && this.#i[e] !== void 0 && !this.#e(this.#t[e]) && (yield [this.#i[e], this.#t[e]]);
2082
2053
  }
2083
2054
  *rentries() {
2084
- for (let t of this.#O()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
2055
+ for (let e of this.#z()) this.#t[e] !== void 0 && this.#i[e] !== void 0 && !this.#e(this.#t[e]) && (yield [this.#i[e], this.#t[e]]);
2085
2056
  }
2086
2057
  *keys() {
2087
- for (let t of this.#F()) {
2088
- let e = this.#i[t];
2089
- e !== void 0 && !this.#e(this.#t[t]) && (yield e);
2058
+ for (let e of this.#A()) {
2059
+ let t = this.#i[e];
2060
+ t !== void 0 && !this.#e(this.#t[e]) && (yield t);
2090
2061
  }
2091
2062
  }
2092
2063
  *rkeys() {
2093
- for (let t of this.#O()) {
2094
- let e = this.#i[t];
2095
- e !== void 0 && !this.#e(this.#t[t]) && (yield e);
2064
+ for (let e of this.#z()) {
2065
+ let t = this.#i[e];
2066
+ t !== void 0 && !this.#e(this.#t[e]) && (yield t);
2096
2067
  }
2097
2068
  }
2098
2069
  *values() {
2099
- for (let t of this.#F()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
2070
+ for (let e of this.#A()) this.#t[e] !== void 0 && !this.#e(this.#t[e]) && (yield this.#t[e]);
2100
2071
  }
2101
2072
  *rvalues() {
2102
- for (let t of this.#O()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
2073
+ for (let e of this.#z()) this.#t[e] !== void 0 && !this.#e(this.#t[e]) && (yield this.#t[e]);
2103
2074
  }
2104
2075
  [Symbol.iterator]() {
2105
2076
  return this.entries();
2106
2077
  }
2107
2078
  [Symbol.toStringTag] = "LRUCache";
2108
- find(t, e = {}) {
2109
- for (let i of this.#F()) {
2079
+ find(e, t = {}) {
2080
+ for (let i of this.#A()) {
2110
2081
  let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
2111
- if (n !== void 0 && t(n, this.#i[i], this)) return this.get(this.#i[i], e);
2082
+ if (n !== void 0 && e(n, this.#i[i], this)) return this.#C(this.#i[i], t);
2112
2083
  }
2113
2084
  }
2114
- forEach(t, e = this) {
2115
- for (let i of this.#F()) {
2085
+ forEach(e, t = this) {
2086
+ for (let i of this.#A()) {
2116
2087
  let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
2117
- n !== void 0 && t.call(e, n, this.#i[i], this);
2088
+ n !== void 0 && e.call(t, n, this.#i[i], this);
2118
2089
  }
2119
2090
  }
2120
- rforEach(t, e = this) {
2121
- for (let i of this.#O()) {
2091
+ rforEach(e, t = this) {
2092
+ for (let i of this.#z()) {
2122
2093
  let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
2123
- n !== void 0 && t.call(e, n, this.#i[i], this);
2094
+ n !== void 0 && e.call(t, n, this.#i[i], this);
2124
2095
  }
2125
2096
  }
2126
2097
  purgeStale() {
2127
- let t = false;
2128
- for (let e of this.#O({ allowStale: true })) this.#p(e) && (this.#E(this.#i[e], "expire"), t = true);
2129
- return t;
2130
- }
2131
- info(t) {
2132
- let e = this.#s.get(t);
2133
- if (e === void 0) return;
2134
- let i = this.#t[e], s = this.#e(i) ? i.__staleWhileFetching : i;
2098
+ let e = false;
2099
+ for (let t of this.#z({ allowStale: true })) this.#p(t) && (this.#E(this.#i[t], "expire"), e = true);
2100
+ return e;
2101
+ }
2102
+ info(e) {
2103
+ let t = this.#s.get(e);
2104
+ if (t === void 0) return;
2105
+ let i = this.#t[t], s = this.#e(i) ? i.__staleWhileFetching : i;
2135
2106
  if (s === void 0) return;
2136
2107
  let n = { value: s };
2137
- if (this.#d && this.#A) {
2138
- let o = this.#d[e], h = this.#A[e];
2139
- if (o && h) {
2140
- let r = o - (this.#m.now() - h);
2141
- n.ttl = r, n.start = Date.now();
2108
+ if (this.#d && this.#F) {
2109
+ let r = this.#d[t], h = this.#F[t];
2110
+ if (r && h) {
2111
+ let a = r - (this.#m.now() - h);
2112
+ n.ttl = a, n.start = Date.now();
2142
2113
  }
2143
2114
  }
2144
- return this.#y && (n.size = this.#y[e]), n;
2115
+ return this.#_ && (n.size = this.#_[t]), n;
2145
2116
  }
2146
2117
  dump() {
2147
- let t = [];
2148
- for (let e of this.#F({ allowStale: true })) {
2149
- let i = this.#i[e], s = this.#t[e], n = this.#e(s) ? s.__staleWhileFetching : s;
2118
+ let e = [];
2119
+ for (let t of this.#A({ allowStale: true })) {
2120
+ let i = this.#i[t], s = this.#t[t], n = this.#e(s) ? s.__staleWhileFetching : s;
2150
2121
  if (n === void 0 || i === void 0) continue;
2151
- let o = { value: n };
2152
- if (this.#d && this.#A) {
2153
- o.ttl = this.#d[e];
2154
- let h = this.#m.now() - this.#A[e];
2155
- o.start = Math.floor(Date.now() - h);
2122
+ let r = { value: n };
2123
+ if (this.#d && this.#F) {
2124
+ r.ttl = this.#d[t];
2125
+ let h = this.#m.now() - this.#F[t];
2126
+ r.start = Math.floor(Date.now() - h);
2156
2127
  }
2157
- this.#y && (o.size = this.#y[e]), t.unshift([i, o]);
2128
+ this.#_ && (r.size = this.#_[t]), e.unshift([i, r]);
2158
2129
  }
2159
- return t;
2130
+ return e;
2160
2131
  }
2161
- load(t) {
2132
+ load(e) {
2162
2133
  this.clear();
2163
- for (let [e, i] of t) {
2134
+ for (let [t, i] of e) {
2164
2135
  if (i.start) {
2165
2136
  let s = Date.now() - i.start;
2166
2137
  i.start = this.#m.now() - s;
2167
2138
  }
2168
- this.set(e, i.value, i);
2169
- }
2170
- }
2171
- set(t, e, i = {}) {
2172
- if (e === void 0) return this.delete(t), this;
2173
- let { ttl: s = this.ttl, start: n, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: r } = i, { noUpdateTTL: a = this.noUpdateTTL } = i, w = this.#P(t, e, i.size || 0, h);
2174
- if (this.maxEntrySize && w > this.maxEntrySize) return r && (r.set = "miss", r.maxEntrySizeExceeded = true), this.#E(t, "set"), this;
2175
- let f = this.#n === 0 ? void 0 : this.#s.get(t);
2176
- if (f === void 0) f = this.#n === 0 ? this.#h : this.#b.length !== 0 ? this.#b.pop() : this.#n === this.#o ? this.#x(false) : this.#n, this.#i[f] = t, this.#t[f] = e, this.#s.set(t, f), this.#a[this.#h] = f, this.#u[f] = this.#h, this.#h = f, this.#n++, this.#M(f, w, r), r && (r.set = "add"), a = false, this.#U && this.#C?.(e, t, "add");
2139
+ this.#W(t, i.value, i);
2140
+ }
2141
+ }
2142
+ set(e, t, i = {}) {
2143
+ let { status: s = S.hasSubscribers ? {} : void 0 } = i;
2144
+ i.status = s, s && (s.op = "set", s.key = e, t !== void 0 && (s.value = t), s.cache = this);
2145
+ let n = this.#W(e, t, i);
2146
+ return s && S.hasSubscribers && S.publish(s), n;
2147
+ }
2148
+ #W(e, t, i, s) {
2149
+ let { ttl: n = this.ttl, start: r, noDisposeOnSet: h = this.noDisposeOnSet, sizeCalculation: a = this.sizeCalculation, status: o } = i, d = this.#e(t);
2150
+ if (t === void 0) return o && (o.set = "deleted"), this.delete(e), this;
2151
+ let { noUpdateTTL: y = this.noUpdateTTL } = i;
2152
+ o && !d && (o.value = t);
2153
+ let _ = this.#N(e, t, i.size || 0, a, o);
2154
+ if (this.maxEntrySize && _ > this.maxEntrySize) return this.#E(e, "set"), o && (o.set = "miss", o.maxEntrySizeExceeded = true), this;
2155
+ let c = this.#n === 0 ? void 0 : this.#s.get(e);
2156
+ if (c === void 0) c = this.#n === 0 ? this.#h : this.#y.length !== 0 ? this.#y.pop() : this.#n === this.#o ? this.#G(false) : this.#n, this.#i[c] = e, this.#t[c] = t, this.#s.set(e, c), this.#l[this.#h] = c, this.#u[c] = this.#h, this.#h = c, this.#n++, this.#j(c, _, o), o && (o.set = "add"), y = false, this.#x && !d && this.#O?.(t, e, "add");
2177
2157
  else {
2178
- this.#D(f);
2179
- let d = this.#t[f];
2180
- if (e !== d) {
2181
- if (this.#v && this.#e(d)) {
2182
- d.__abortController.abort(new Error("replaced"));
2183
- let { __staleWhileFetching: g } = d;
2184
- g !== void 0 && !o && (this.#T && this.#w?.(g, t, "set"), this.#f && this.#r?.push([g, t, "set"]));
2185
- } else o || (this.#T && this.#w?.(d, t, "set"), this.#f && this.#r?.push([d, t, "set"]));
2186
- if (this.#W(f), this.#M(f, w, r), this.#t[f] = e, r) {
2187
- r.set = "replace";
2188
- let g = d && this.#e(d) ? d.__staleWhileFetching : d;
2189
- g !== void 0 && (r.oldValue = g);
2158
+ this.#L(c);
2159
+ let g = this.#t[c];
2160
+ if (t !== g) {
2161
+ if (!h) if (this.#e(g)) {
2162
+ g !== s && g.__abortController.abort(new Error("replaced"));
2163
+ let { __staleWhileFetching: f } = g;
2164
+ f !== void 0 && f !== t && (this.#T && this.#S?.(f, e, "set"), this.#f && this.#r?.push([f, e, "set"]));
2165
+ } else this.#T && this.#S?.(g, e, "set"), this.#f && this.#r?.push([g, e, "set"]);
2166
+ if (this.#R(c), this.#j(c, _, o), this.#t[c] = t, !d) {
2167
+ let f = g && this.#e(g) ? g.__staleWhileFetching : g, b = f === void 0 ? "add" : t !== f ? "replace" : "update";
2168
+ o && (o.set = b, f !== void 0 && (o.oldValue = f)), this.#x && this.onInsert?.(t, e, b);
2190
2169
  }
2191
- } else r && (r.set = "update");
2192
- this.#U && this.onInsert?.(e, t, e === d ? "update" : "replace");
2170
+ } else d || (o && (o.set = "update"), this.#x && this.onInsert?.(t, e, "update"));
2193
2171
  }
2194
- if (s !== 0 && !this.#d && this.#j(), this.#d && (a || this.#N(f, s, n), r && this.#z(r, f)), !o && this.#f && this.#r) {
2195
- let d = this.#r, g;
2196
- for (; g = d?.shift(); ) this.#S?.(...g);
2172
+ if (n !== 0 && !this.#d && this.#k(), this.#d && (y || this.#H(c, n, r), o && this.#v(o, c)), !h && this.#f && this.#r) {
2173
+ let g = this.#r, f;
2174
+ for (; f = g?.shift(); ) this.#w?.(...f);
2197
2175
  }
2198
2176
  return this;
2199
2177
  }
2200
2178
  pop() {
2201
2179
  try {
2202
2180
  for (; this.#n; ) {
2203
- let t = this.#t[this.#l];
2204
- if (this.#x(true), this.#e(t)) {
2205
- if (t.__staleWhileFetching) return t.__staleWhileFetching;
2206
- } else if (t !== void 0) return t;
2181
+ let e = this.#t[this.#a];
2182
+ if (this.#G(true), this.#e(e)) {
2183
+ if (e.__staleWhileFetching) return e.__staleWhileFetching;
2184
+ } else if (e !== void 0) return e;
2207
2185
  }
2208
2186
  } finally {
2209
2187
  if (this.#f && this.#r) {
2210
- let t = this.#r, e;
2211
- for (; e = t?.shift(); ) this.#S?.(...e);
2188
+ let e = this.#r, t;
2189
+ for (; t = e?.shift(); ) this.#w?.(...t);
2212
2190
  }
2213
2191
  }
2214
2192
  }
2215
- #x(t) {
2216
- let e = this.#l, i = this.#i[e], s = this.#t[e];
2217
- return this.#v && this.#e(s) ? s.__abortController.abort(new Error("evicted")) : (this.#T || this.#f) && (this.#T && this.#w?.(s, i, "evict"), this.#f && this.#r?.push([s, i, "evict"])), this.#W(e), this.#g?.[e] && (clearTimeout(this.#g[e]), this.#g[e] = void 0), t && (this.#i[e] = void 0, this.#t[e] = void 0, this.#b.push(e)), this.#n === 1 ? (this.#l = this.#h = 0, this.#b.length = 0) : this.#l = this.#a[e], this.#s.delete(i), this.#n--, e;
2193
+ #G(e) {
2194
+ let t = this.#a, i = this.#i[t], s = this.#t[t], n = this.#e(s);
2195
+ n && s.__abortController.abort(new Error("evicted"));
2196
+ let r = n ? s.__staleWhileFetching : s;
2197
+ return (this.#T || this.#f) && r !== void 0 && (this.#T && this.#S?.(r, i, "evict"), this.#f && this.#r?.push([r, i, "evict"])), this.#R(t), this.#g?.[t] && (clearTimeout(this.#g[t]), this.#g[t] = void 0), e && (this.#i[t] = void 0, this.#t[t] = void 0, this.#y.push(t)), this.#n === 1 ? (this.#a = this.#h = 0, this.#y.length = 0) : this.#a = this.#l[t], this.#s.delete(i), this.#n--, t;
2198
+ }
2199
+ has(e, t = {}) {
2200
+ let { status: i = S.hasSubscribers ? {} : void 0 } = t;
2201
+ t.status = i, i && (i.op = "has", i.key = e, i.cache = this);
2202
+ let s = this.#Y(e, t);
2203
+ return S.hasSubscribers && S.publish(i), s;
2218
2204
  }
2219
- has(t, e = {}) {
2220
- let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = e, n = this.#s.get(t);
2205
+ #Y(e, t = {}) {
2206
+ let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = t, n = this.#s.get(e);
2221
2207
  if (n !== void 0) {
2222
- let o = this.#t[n];
2223
- if (this.#e(o) && o.__staleWhileFetching === void 0) return false;
2224
- if (this.#p(n)) s && (s.has = "stale", this.#z(s, n));
2225
- else return i && this.#R(n), s && (s.has = "hit", this.#z(s, n)), true;
2208
+ let r = this.#t[n];
2209
+ if (this.#e(r) && r.__staleWhileFetching === void 0) return false;
2210
+ if (this.#p(n)) s && (s.has = "stale", this.#v(s, n));
2211
+ else return i && this.#D(n), s && (s.has = "hit", this.#v(s, n)), true;
2226
2212
  } else s && (s.has = "miss");
2227
2213
  return false;
2228
2214
  }
2229
- peek(t, e = {}) {
2230
- let { allowStale: i = this.allowStale } = e, s = this.#s.get(t);
2231
- if (s === void 0 || !i && this.#p(s)) return;
2232
- let n = this.#t[s];
2233
- return this.#e(n) ? n.__staleWhileFetching : n;
2215
+ peek(e, t = {}) {
2216
+ let { status: i = D() ? {} : void 0 } = t;
2217
+ i && (i.op = "peek", i.key = e, i.cache = this), t.status = i;
2218
+ let s = this.#J(e, t);
2219
+ return S.hasSubscribers && S.publish(i), s;
2234
2220
  }
2235
- #G(t, e, i, s) {
2236
- let n = e === void 0 ? void 0 : this.#t[e];
2221
+ #J(e, t) {
2222
+ let { status: i, allowStale: s = this.allowStale } = t, n = this.#s.get(e);
2223
+ if (n === void 0 || !s && this.#p(n)) {
2224
+ i && (i.peek = n === void 0 ? "miss" : "stale");
2225
+ return;
2226
+ }
2227
+ let r = this.#t[n], h = this.#e(r) ? r.__staleWhileFetching : r;
2228
+ return i && (h !== void 0 ? (i.peek = "hit", i.value = h) : i.peek = "miss"), h;
2229
+ }
2230
+ #P(e, t, i, s) {
2231
+ let n = t === void 0 ? void 0 : this.#t[t];
2237
2232
  if (this.#e(n)) return n;
2238
- let o = new C(), { signal: h } = i;
2239
- h?.addEventListener("abort", () => o.abort(h.reason), { signal: o.signal });
2240
- let r = { signal: o.signal, options: i, context: s }, a = (p, _ = false) => {
2241
- let { aborted: l } = o.signal, S = i.ignoreFetchAbort && p !== void 0, b = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && p !== void 0);
2242
- if (i.status && (l && !_ ? (i.status.fetchAborted = true, i.status.fetchError = o.signal.reason, S && (i.status.fetchAbortIgnored = true)) : i.status.fetchResolved = true), l && !S && !_) return f(o.signal.reason, b);
2243
- let m = g, u = this.#t[e];
2244
- return (u === g || S && _ && u === void 0) && (p === void 0 ? m.__staleWhileFetching !== void 0 ? this.#t[e] = m.__staleWhileFetching : this.#E(t, "fetch") : (i.status && (i.status.fetchUpdated = true), this.set(t, p, r.options))), p;
2245
- }, w = (p) => (i.status && (i.status.fetchRejected = true, i.status.fetchError = p), f(p, false)), f = (p, _) => {
2246
- let { aborted: l } = o.signal, S = l && i.allowStaleOnFetchAbort, b = S || i.allowStaleOnFetchRejection, m = b || i.noDeleteOnFetchRejection, u = g;
2247
- if (this.#t[e] === g && (!m || !_ && u.__staleWhileFetching === void 0 ? this.#E(t, "fetch") : S || (this.#t[e] = u.__staleWhileFetching)), b) return i.status && u.__staleWhileFetching !== void 0 && (i.status.returnedStale = true), u.__staleWhileFetching;
2248
- if (u.__returned === u) throw p;
2249
- }, d = (p, _) => {
2250
- let l = this.#L?.(t, n, r);
2251
- l && l instanceof Promise && l.then((S) => p(S === void 0 ? void 0 : S), _), o.signal.addEventListener("abort", () => {
2252
- (!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (p(void 0), i.allowStaleOnFetchAbort && (p = (S) => a(S, true)));
2253
- });
2233
+ let r = new AbortController(), { signal: h } = i;
2234
+ h?.addEventListener("abort", () => r.abort(h.reason), { signal: r.signal });
2235
+ let a = { signal: r.signal, options: i, context: s }, o = (f, b = false) => {
2236
+ let { aborted: l } = r.signal, w = i.ignoreFetchAbort && f !== void 0, F = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && f !== void 0);
2237
+ if (i.status && (l && !b ? (i.status.fetchAborted = true, i.status.fetchError = r.signal.reason, w && (i.status.fetchAbortIgnored = true)) : i.status.fetchResolved = true), l && !w && !b) return y(r.signal.reason, F);
2238
+ let m = c, p = this.#t[t];
2239
+ return (p === c || p === void 0 && w && b) && (f === void 0 ? m.__staleWhileFetching !== void 0 ? this.#t[t] = m.__staleWhileFetching : this.#E(e, "fetch") : (i.status && (i.status.fetchUpdated = true), this.#W(e, f, a.options, m))), f;
2240
+ }, d = (f) => (i.status && (i.status.fetchRejected = true, i.status.fetchError = f), y(f, false)), y = (f, b) => {
2241
+ let { aborted: l } = r.signal, w = l && i.allowStaleOnFetchAbort, F = w || i.allowStaleOnFetchRejection, m = F || i.noDeleteOnFetchRejection, p = c;
2242
+ if (this.#t[t] === c && (!m || !b && p.__staleWhileFetching === void 0 ? this.#E(e, "fetch") : w || (this.#t[t] = p.__staleWhileFetching)), F) return i.status && p.__staleWhileFetching !== void 0 && (i.status.returnedStale = true), p.__staleWhileFetching;
2243
+ if (p.__returned === p) throw f;
2244
+ }, _ = (f, b) => {
2245
+ let l = this.#M?.(e, n, a);
2246
+ r.signal.addEventListener("abort", () => {
2247
+ (!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (f(void 0), i.allowStaleOnFetchAbort && (f = (w) => o(w, true)));
2248
+ }), l && l instanceof Promise ? l.then((w) => f(w === void 0 ? void 0 : w), b) : l !== void 0 && f(l);
2254
2249
  };
2255
2250
  i.status && (i.status.fetchDispatched = true);
2256
- let g = new Promise(d).then(a, w), A = Object.assign(g, { __abortController: o, __staleWhileFetching: n, __returned: void 0 });
2257
- return e === void 0 ? (this.set(t, A, { ...r.options, status: void 0 }), e = this.#s.get(t)) : this.#t[e] = A, A;
2258
- }
2259
- #e(t) {
2260
- if (!this.#v) return false;
2261
- let e = t;
2262
- return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof C;
2263
- }
2264
- async fetch(t, e = {}) {
2265
- let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: r = 0, sizeCalculation: a = this.sizeCalculation, noUpdateTTL: w = this.noUpdateTTL, noDeleteOnFetchRejection: f = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: g = this.ignoreFetchAbort, allowStaleOnFetchAbort: A = this.allowStaleOnFetchAbort, context: p, forceRefresh: _ = false, status: l, signal: S } = e;
2266
- if (!this.#v) return l && (l.fetch = "get"), this.get(t, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, status: l });
2267
- let b = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, ttl: o, noDisposeOnSet: h, size: r, sizeCalculation: a, noUpdateTTL: w, noDeleteOnFetchRejection: f, allowStaleOnFetchRejection: d, allowStaleOnFetchAbort: A, ignoreFetchAbort: g, status: l, signal: S }, m = this.#s.get(t);
2251
+ let c = new Promise(_).then(o, d), g = Object.assign(c, { __abortController: r, __staleWhileFetching: n, __returned: void 0 });
2252
+ return t === void 0 ? (this.#W(e, g, { ...a.options, status: void 0 }), t = this.#s.get(e)) : this.#t[t] = g, g;
2253
+ }
2254
+ #e(e) {
2255
+ if (!this.#U) return false;
2256
+ let t = e;
2257
+ return !!t && t instanceof Promise && t.hasOwnProperty("__staleWhileFetching") && t.__abortController instanceof AbortController;
2258
+ }
2259
+ fetch(e, t = {}) {
2260
+ let i = W.hasSubscribers, { status: s = D() ? {} : void 0 } = t;
2261
+ t.status = s, s && t.context && (s.context = t.context);
2262
+ let n = this.#B(e, t);
2263
+ return s && i && (s.trace = true, W.tracePromise(() => n, s).catch(() => {
2264
+ })), n;
2265
+ }
2266
+ async #B(e, t = {}) {
2267
+ let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: r = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: a = 0, sizeCalculation: o = this.sizeCalculation, noUpdateTTL: d = this.noUpdateTTL, noDeleteOnFetchRejection: y = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: _ = this.allowStaleOnFetchRejection, ignoreFetchAbort: c = this.ignoreFetchAbort, allowStaleOnFetchAbort: g = this.allowStaleOnFetchAbort, context: f, forceRefresh: b = false, status: l, signal: w } = t;
2268
+ if (l && (l.op = "fetch", l.key = e, b && (l.forceRefresh = true), l.cache = this), !this.#U) return l && (l.fetch = "get"), this.#C(e, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, status: l });
2269
+ let F = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, ttl: r, noDisposeOnSet: h, size: a, sizeCalculation: o, noUpdateTTL: d, noDeleteOnFetchRejection: y, allowStaleOnFetchRejection: _, allowStaleOnFetchAbort: g, ignoreFetchAbort: c, status: l, signal: w }, m = this.#s.get(e);
2268
2270
  if (m === void 0) {
2269
2271
  l && (l.fetch = "miss");
2270
- let u = this.#G(t, m, b, p);
2271
- return u.__returned = u;
2272
+ let p = this.#P(e, m, F, f);
2273
+ return p.__returned = p;
2272
2274
  } else {
2273
- let u = this.#t[m];
2274
- if (this.#e(u)) {
2275
- let E = i && u.__staleWhileFetching !== void 0;
2276
- return l && (l.fetch = "inflight", E && (l.returnedStale = true)), E ? u.__staleWhileFetching : u.__returned = u;
2275
+ let p = this.#t[m];
2276
+ if (this.#e(p)) {
2277
+ let v = i && p.__staleWhileFetching !== void 0;
2278
+ return l && (l.fetch = "inflight", v && (l.returnedStale = true)), v ? p.__staleWhileFetching : p.__returned = p;
2277
2279
  }
2278
- let T = this.#p(m);
2279
- if (!_ && !T) return l && (l.fetch = "hit"), this.#D(m), s && this.#R(m), l && this.#z(l, m), u;
2280
- let F = this.#G(t, m, b, p), O = F.__staleWhileFetching !== void 0 && i;
2281
- return l && (l.fetch = T ? "stale" : "refresh", O && T && (l.returnedStale = true)), O ? F.__staleWhileFetching : F.__returned = F;
2280
+ let A = this.#p(m);
2281
+ if (!b && !A) return l && (l.fetch = "hit"), this.#L(m), s && this.#D(m), l && this.#v(l, m), p;
2282
+ let z = this.#P(e, m, F, f), E = z.__staleWhileFetching !== void 0 && i;
2283
+ return l && (l.fetch = A ? "stale" : "refresh", E && A && (l.returnedStale = true)), E ? z.__staleWhileFetching : z.__returned = z;
2282
2284
  }
2283
2285
  }
2284
- async forceFetch(t, e = {}) {
2285
- let i = await this.fetch(t, e);
2286
+ forceFetch(e, t = {}) {
2287
+ let i = W.hasSubscribers, { status: s = D() ? {} : void 0 } = t;
2288
+ t.status = s, s && t.context && (s.context = t.context);
2289
+ let n = this.#K(e, t);
2290
+ return s && i && (s.trace = true, W.tracePromise(() => n, s).catch(() => {
2291
+ })), n;
2292
+ }
2293
+ async #K(e, t = {}) {
2294
+ let i = await this.#B(e, t);
2286
2295
  if (i === void 0) throw new Error("fetch() returned undefined");
2287
2296
  return i;
2288
2297
  }
2289
- memo(t, e = {}) {
2298
+ memo(e, t = {}) {
2299
+ let { status: i = S.hasSubscribers ? {} : void 0 } = t;
2300
+ t.status = i, i && (i.op = "memo", i.key = e, t.context && (i.context = t.context), i.cache = this);
2301
+ let s = this.#Q(e, t);
2302
+ return i && (i.value = s), S.hasSubscribers && S.publish(i), s;
2303
+ }
2304
+ #Q(e, t = {}) {
2290
2305
  let i = this.#I;
2291
2306
  if (!i) throw new Error("no memoMethod provided to constructor");
2292
- let { context: s, forceRefresh: n, ...o } = e, h = this.get(t, o);
2293
- if (!n && h !== void 0) return h;
2294
- let r = i(t, h, { options: o, context: s });
2295
- return this.set(t, r, o), r;
2296
- }
2297
- get(t, e = {}) {
2298
- let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = e, h = this.#s.get(t);
2299
- if (h !== void 0) {
2300
- let r = this.#t[h], a = this.#e(r);
2301
- return o && this.#z(o, h), this.#p(h) ? (o && (o.get = "stale"), a ? (o && i && r.__staleWhileFetching !== void 0 && (o.returnedStale = true), i ? r.__staleWhileFetching : void 0) : (n || this.#E(t, "expire"), o && i && (o.returnedStale = true), i ? r : void 0)) : (o && (o.get = "hit"), a ? r.__staleWhileFetching : (this.#D(h), s && this.#R(h), r));
2302
- } else o && (o.get = "miss");
2307
+ let { context: s, status: n, forceRefresh: r, ...h } = t;
2308
+ n && r && (n.forceRefresh = true);
2309
+ let a = this.#C(e, h), o = r || a === void 0;
2310
+ if (n && (n.memo = o ? "miss" : "hit", o || (n.value = a)), !o) return a;
2311
+ let d = i(e, a, { options: h, context: s });
2312
+ return n && (n.value = d), this.#W(e, d, h), d;
2313
+ }
2314
+ get(e, t = {}) {
2315
+ let { status: i = S.hasSubscribers ? {} : void 0 } = t;
2316
+ t.status = i, i && (i.op = "get", i.key = e, i.cache = this);
2317
+ let s = this.#C(e, t);
2318
+ return i && (s !== void 0 && (i.value = s), S.hasSubscribers && S.publish(i)), s;
2319
+ }
2320
+ #C(e, t = {}) {
2321
+ let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: r } = t, h = this.#s.get(e);
2322
+ if (h === void 0) {
2323
+ r && (r.get = "miss");
2324
+ return;
2325
+ }
2326
+ let a = this.#t[h], o = this.#e(a);
2327
+ return r && this.#v(r, h), this.#p(h) ? o ? (r && (r.get = "stale-fetching"), i && a.__staleWhileFetching !== void 0 ? (r && (r.returnedStale = true), a.__staleWhileFetching) : void 0) : (n || this.#E(e, "expire"), r && (r.get = "stale"), i ? (r && (r.returnedStale = true), a) : void 0) : (r && (r.get = o ? "fetching" : "hit"), this.#L(h), s && this.#D(h), o ? a.__staleWhileFetching : a);
2303
2328
  }
2304
- #k(t, e) {
2305
- this.#u[e] = t, this.#a[t] = e;
2329
+ #$(e, t) {
2330
+ this.#u[t] = e, this.#l[e] = t;
2306
2331
  }
2307
- #D(t) {
2308
- t !== this.#h && (t === this.#l ? this.#l = this.#a[t] : this.#k(this.#u[t], this.#a[t]), this.#k(this.#h, t), this.#h = t);
2332
+ #L(e) {
2333
+ e !== this.#h && (e === this.#a ? this.#a = this.#l[e] : this.#$(this.#u[e], this.#l[e]), this.#$(this.#h, e), this.#h = e);
2309
2334
  }
2310
- delete(t) {
2311
- return this.#E(t, "delete");
2335
+ delete(e) {
2336
+ return this.#E(e, "delete");
2312
2337
  }
2313
- #E(t, e) {
2338
+ #E(e, t) {
2339
+ S.hasSubscribers && S.publish({ op: "delete", delete: t, key: e, cache: this });
2314
2340
  let i = false;
2315
2341
  if (this.#n !== 0) {
2316
- let s = this.#s.get(t);
2317
- if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i = true, this.#n === 1) this.#V(e);
2342
+ let s = this.#s.get(e);
2343
+ if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i = true, this.#n === 1) this.#q(t);
2318
2344
  else {
2319
- this.#W(s);
2345
+ this.#R(s);
2320
2346
  let n = this.#t[s];
2321
- if (this.#e(n) ? n.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#w?.(n, t, e), this.#f && this.#r?.push([n, t, e])), this.#s.delete(t), this.#i[s] = void 0, this.#t[s] = void 0, s === this.#h) this.#h = this.#u[s];
2322
- else if (s === this.#l) this.#l = this.#a[s];
2347
+ if (this.#e(n) ? n.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#S?.(n, e, t), this.#f && this.#r?.push([n, e, t])), this.#s.delete(e), this.#i[s] = void 0, this.#t[s] = void 0, s === this.#h) this.#h = this.#u[s];
2348
+ else if (s === this.#a) this.#a = this.#l[s];
2323
2349
  else {
2324
- let o = this.#u[s];
2325
- this.#a[o] = this.#a[s];
2326
- let h = this.#a[s];
2350
+ let r = this.#u[s];
2351
+ this.#l[r] = this.#l[s];
2352
+ let h = this.#l[s];
2327
2353
  this.#u[h] = this.#u[s];
2328
2354
  }
2329
- this.#n--, this.#b.push(s);
2355
+ this.#n--, this.#y.push(s);
2330
2356
  }
2331
2357
  }
2332
2358
  if (this.#f && this.#r?.length) {
2333
2359
  let s = this.#r, n;
2334
- for (; n = s?.shift(); ) this.#S?.(...n);
2360
+ for (; n = s?.shift(); ) this.#w?.(...n);
2335
2361
  }
2336
2362
  return i;
2337
2363
  }
2338
2364
  clear() {
2339
- return this.#V("delete");
2365
+ return this.#q("delete");
2340
2366
  }
2341
- #V(t) {
2342
- for (let e of this.#O({ allowStale: true })) {
2343
- let i = this.#t[e];
2367
+ #q(e) {
2368
+ for (let t of this.#z({ allowStale: true })) {
2369
+ let i = this.#t[t];
2344
2370
  if (this.#e(i)) i.__abortController.abort(new Error("deleted"));
2345
2371
  else {
2346
- let s = this.#i[e];
2347
- this.#T && this.#w?.(i, s, t), this.#f && this.#r?.push([i, s, t]);
2372
+ let s = this.#i[t];
2373
+ this.#T && this.#S?.(i, s, e), this.#f && this.#r?.push([i, s, e]);
2348
2374
  }
2349
2375
  }
2350
- if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#A) {
2351
- this.#d.fill(0), this.#A.fill(0);
2352
- for (let e of this.#g ?? []) e !== void 0 && clearTimeout(e);
2376
+ if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#F) {
2377
+ this.#d.fill(0), this.#F.fill(0);
2378
+ for (let t of this.#g ?? []) t !== void 0 && clearTimeout(t);
2353
2379
  this.#g?.fill(void 0);
2354
2380
  }
2355
- if (this.#y && this.#y.fill(0), this.#l = 0, this.#h = 0, this.#b.length = 0, this.#_ = 0, this.#n = 0, this.#f && this.#r) {
2356
- let e = this.#r, i;
2357
- for (; i = e?.shift(); ) this.#S?.(...i);
2381
+ if (this.#_ && this.#_.fill(0), this.#a = 0, this.#h = 0, this.#y.length = 0, this.#b = 0, this.#n = 0, this.#f && this.#r) {
2382
+ let t = this.#r, i;
2383
+ for (; i = t?.shift(); ) this.#w?.(...i);
2358
2384
  }
2359
2385
  }
2360
2386
  };
@@ -2697,16 +2723,16 @@ var Minipass = class extends EventEmitter {
2697
2723
  if (this[OBJECTMODE])
2698
2724
  this[BUFFERSHIFT]();
2699
2725
  else {
2700
- const c3 = chunk;
2701
- if (n === c3.length || n === null)
2726
+ const c = chunk;
2727
+ if (n === c.length || n === null)
2702
2728
  this[BUFFERSHIFT]();
2703
- else if (typeof c3 === "string") {
2704
- this[BUFFER][0] = c3.slice(n);
2705
- chunk = c3.slice(0, n);
2729
+ else if (typeof c === "string") {
2730
+ this[BUFFER][0] = c.slice(n);
2731
+ chunk = c.slice(0, n);
2706
2732
  this[BUFFERLENGTH] -= n;
2707
2733
  } else {
2708
- this[BUFFER][0] = c3.subarray(n);
2709
- chunk = c3.subarray(0, n);
2734
+ this[BUFFER][0] = c.subarray(n);
2735
+ chunk = c.subarray(0, n);
2710
2736
  this[BUFFERLENGTH] -= n;
2711
2737
  }
2712
2738
  }
@@ -3070,10 +3096,10 @@ var Minipass = class extends EventEmitter {
3070
3096
  if (!this[OBJECTMODE])
3071
3097
  buf.dataLength = 0;
3072
3098
  const p = this.promise();
3073
- this.on("data", (c3) => {
3074
- buf.push(c3);
3099
+ this.on("data", (c) => {
3100
+ buf.push(c);
3075
3101
  if (!this[OBJECTMODE])
3076
- buf.dataLength += c3.length;
3102
+ buf.dataLength += c.length;
3077
3103
  });
3078
3104
  await p;
3079
3105
  return buf;
@@ -3293,30 +3319,30 @@ var ENOREALPATH = 512;
3293
3319
  var ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
3294
3320
  var TYPEMASK = 1023;
3295
3321
  var entToType = (s) => s.isFile() ? IFREG : s.isDirectory() ? IFDIR : s.isSymbolicLink() ? IFLNK : s.isCharacterDevice() ? IFCHR : s.isBlockDevice() ? IFBLK : s.isSocket() ? IFSOCK : s.isFIFO() ? IFIFO : UNKNOWN;
3296
- var normalizeCache = new L({ max: 2 ** 12 });
3322
+ var normalizeCache = new I({ max: 2 ** 12 });
3297
3323
  var normalize = (s) => {
3298
- const c3 = normalizeCache.get(s);
3299
- if (c3)
3300
- return c3;
3324
+ const c = normalizeCache.get(s);
3325
+ if (c)
3326
+ return c;
3301
3327
  const n = s.normalize("NFKD");
3302
3328
  normalizeCache.set(s, n);
3303
3329
  return n;
3304
3330
  };
3305
- var normalizeNocaseCache = new L({ max: 2 ** 12 });
3331
+ var normalizeNocaseCache = new I({ max: 2 ** 12 });
3306
3332
  var normalizeNocase = (s) => {
3307
- const c3 = normalizeNocaseCache.get(s);
3308
- if (c3)
3309
- return c3;
3333
+ const c = normalizeNocaseCache.get(s);
3334
+ if (c)
3335
+ return c;
3310
3336
  const n = normalize(s.toLowerCase());
3311
3337
  normalizeNocaseCache.set(s, n);
3312
3338
  return n;
3313
3339
  };
3314
- var ResolveCache = class extends L {
3340
+ var ResolveCache = class extends I {
3315
3341
  constructor() {
3316
3342
  super({ max: 256 });
3317
3343
  }
3318
3344
  };
3319
- var ChildrenCache = class extends L {
3345
+ var ChildrenCache = class extends I {
3320
3346
  constructor(maxSize = 16 * 1024) {
3321
3347
  super({
3322
3348
  maxSize,
@@ -3876,9 +3902,9 @@ var PathBase = class {
3876
3902
  #readdirSuccess(children) {
3877
3903
  this.#type |= READDIR_CALLED;
3878
3904
  for (let p = children.provisional; p < children.length; p++) {
3879
- const c3 = children[p];
3880
- if (c3)
3881
- c3.#markENOENT();
3905
+ const c = children[p];
3906
+ if (c)
3907
+ c.#markENOENT();
3882
3908
  }
3883
3909
  }
3884
3910
  #markENOENT() {
@@ -3938,43 +3964,43 @@ var PathBase = class {
3938
3964
  this.parent.#markENOTDIR();
3939
3965
  }
3940
3966
  }
3941
- #readdirAddChild(e, c3) {
3942
- return this.#readdirMaybePromoteChild(e, c3) || this.#readdirAddNewChild(e, c3);
3967
+ #readdirAddChild(e, c) {
3968
+ return this.#readdirMaybePromoteChild(e, c) || this.#readdirAddNewChild(e, c);
3943
3969
  }
3944
- #readdirAddNewChild(e, c3) {
3970
+ #readdirAddNewChild(e, c) {
3945
3971
  const type = entToType(e);
3946
3972
  const child = this.newChild(e.name, type, { parent: this });
3947
3973
  const ifmt = child.#type & IFMT;
3948
3974
  if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {
3949
3975
  child.#type |= ENOTDIR;
3950
3976
  }
3951
- c3.unshift(child);
3952
- c3.provisional++;
3977
+ c.unshift(child);
3978
+ c.provisional++;
3953
3979
  return child;
3954
3980
  }
3955
- #readdirMaybePromoteChild(e, c3) {
3956
- for (let p = c3.provisional; p < c3.length; p++) {
3957
- const pchild = c3[p];
3981
+ #readdirMaybePromoteChild(e, c) {
3982
+ for (let p = c.provisional; p < c.length; p++) {
3983
+ const pchild = c[p];
3958
3984
  const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name);
3959
3985
  if (name !== pchild.#matchName) {
3960
3986
  continue;
3961
3987
  }
3962
- return this.#readdirPromoteChild(e, pchild, p, c3);
3988
+ return this.#readdirPromoteChild(e, pchild, p, c);
3963
3989
  }
3964
3990
  }
3965
- #readdirPromoteChild(e, p, index, c3) {
3991
+ #readdirPromoteChild(e, p, index, c) {
3966
3992
  const v = p.name;
3967
3993
  p.#type = p.#type & IFMT_UNKNOWN | entToType(e);
3968
3994
  if (v !== e.name)
3969
3995
  p.name = e.name;
3970
- if (index !== c3.provisional) {
3971
- if (index === c3.length - 1)
3972
- c3.pop();
3996
+ if (index !== c.provisional) {
3997
+ if (index === c.length - 1)
3998
+ c.pop();
3973
3999
  else
3974
- c3.splice(index, 1);
3975
- c3.unshift(p);
4000
+ c.splice(index, 1);
4001
+ c.unshift(p);
3976
4002
  }
3977
- c3.provisional++;
4003
+ c.provisional++;
3978
4004
  return p;
3979
4005
  }
3980
4006
  /**
@@ -4075,11 +4101,11 @@ var PathBase = class {
4075
4101
  }
4076
4102
  const children = this.children();
4077
4103
  if (this.calledReaddir()) {
4078
- const c3 = children.slice(0, children.provisional);
4104
+ const c = children.slice(0, children.provisional);
4079
4105
  if (allowZalgo)
4080
- cb(null, c3);
4106
+ cb(null, c);
4081
4107
  else
4082
- queueMicrotask(() => cb(null, c3));
4108
+ queueMicrotask(() => cb(null, c));
4083
4109
  return;
4084
4110
  }
4085
4111
  this.#onReaddirCB.push(cb);
@@ -5287,7 +5313,7 @@ var SubWalks = class {
5287
5313
  return subs;
5288
5314
  }
5289
5315
  entries() {
5290
- return this.keys().map((k) => [k, this.store.get(k)]);
5316
+ return this.keys().map((k2) => [k2, this.store.get(k2)]);
5291
5317
  }
5292
5318
  keys() {
5293
5319
  return [...this.store.keys()].filter((t) => t.canReaddir());
@@ -5330,8 +5356,8 @@ var Processor = class _Processor {
5330
5356
  let rest;
5331
5357
  let changed = false;
5332
5358
  while (typeof (p = pattern.pattern()) === "string" && (rest = pattern.rest())) {
5333
- const c3 = t.resolve(p);
5334
- t = c3;
5359
+ const c = t.resolve(p);
5360
+ t = c;
5335
5361
  pattern = rest;
5336
5362
  changed = true;
5337
5363
  }