@introspection-ai/recipes 0.55.0 → 0.57.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.
Files changed (190) hide show
  1. package/dist/artifact-links.d.ts +25 -0
  2. package/dist/artifact-links.d.ts.map +1 -0
  3. package/dist/artifact-links.js +92 -0
  4. package/dist/artifact-links.js.map +1 -0
  5. package/dist/artifact-viewer-tui.d.ts +2 -1
  6. package/dist/artifact-viewer-tui.d.ts.map +1 -1
  7. package/dist/artifact-viewer-tui.js.map +1 -1
  8. package/dist/artifact-viewer.d.ts +2 -1
  9. package/dist/artifact-viewer.d.ts.map +1 -1
  10. package/dist/artifact-viewer.js +49 -3
  11. package/dist/artifact-viewer.js.map +1 -1
  12. package/dist/artifact.d.ts +5 -4
  13. package/dist/artifact.d.ts.map +1 -1
  14. package/dist/artifact.js +4 -1
  15. package/dist/artifact.js.map +1 -1
  16. package/dist/batch/files.d.ts +16 -0
  17. package/dist/batch/files.d.ts.map +1 -0
  18. package/dist/batch/files.js +58 -0
  19. package/dist/batch/files.js.map +1 -0
  20. package/dist/batch/index.d.ts +67 -0
  21. package/dist/batch/index.d.ts.map +1 -0
  22. package/dist/batch/index.js +109 -0
  23. package/dist/batch/index.js.map +1 -0
  24. package/dist/batch/limiter.d.ts +20 -0
  25. package/dist/batch/limiter.d.ts.map +1 -0
  26. package/dist/batch/limiter.js +54 -0
  27. package/dist/batch/limiter.js.map +1 -0
  28. package/dist/batch/lines.d.ts +58 -0
  29. package/dist/batch/lines.d.ts.map +1 -0
  30. package/dist/batch/lines.js +77 -0
  31. package/dist/batch/lines.js.map +1 -0
  32. package/dist/batch/params.d.ts +30 -0
  33. package/dist/batch/params.d.ts.map +1 -0
  34. package/dist/batch/params.js +48 -0
  35. package/dist/batch/params.js.map +1 -0
  36. package/dist/batch/runner.d.ts +77 -0
  37. package/dist/batch/runner.d.ts.map +1 -0
  38. package/dist/batch/runner.js +240 -0
  39. package/dist/batch/runner.js.map +1 -0
  40. package/dist/batch/shards.d.ts +42 -0
  41. package/dist/batch/shards.d.ts.map +1 -0
  42. package/dist/batch/shards.js +115 -0
  43. package/dist/batch/shards.js.map +1 -0
  44. package/dist/child/agent.d.ts.map +1 -1
  45. package/dist/child/agent.js +6 -5
  46. package/dist/child/agent.js.map +1 -1
  47. package/dist/child/session.d.ts +1 -0
  48. package/dist/child/session.d.ts.map +1 -1
  49. package/dist/child/session.js +9 -6
  50. package/dist/child/session.js.map +1 -1
  51. package/dist/mcp/daemon/server.d.ts +0 -2
  52. package/dist/mcp/daemon/server.d.ts.map +1 -1
  53. package/dist/mcp/daemon/server.js +1 -1
  54. package/dist/mcp/daemon/server.js.map +1 -1
  55. package/dist/mcp-chunks/{auth-command-PZLSOYAT.js → auth-command-WE7QY6RH.js} +27 -27
  56. package/dist/mcp-chunks/call-arguments-2ABANGLE.js +16 -0
  57. package/dist/mcp-chunks/{call-command-VILJIFYG.js → call-command-OOBUGVTM.js} +56 -70
  58. package/dist/mcp-chunks/{chunk-N2U2FODH.js → chunk-2PTK6KBV.js} +4 -4
  59. package/dist/mcp-chunks/{chunk-F2X4Y2TQ.js → chunk-2R2HWX2E.js} +1 -1
  60. package/dist/mcp-chunks/{chunk-ORJND4AI.js → chunk-2R7UGABC.js} +70 -70
  61. package/dist/mcp-chunks/{chunk-US63Y6XE.js → chunk-32UZRZIL.js} +1 -1
  62. package/dist/mcp-chunks/{chunk-THRMUZZD.js → chunk-37VJZIFW.js} +8 -8
  63. package/dist/mcp-chunks/{chunk-5Z6WSV5D.js → chunk-3KSDZBUJ.js} +5 -5
  64. package/dist/mcp-chunks/{chunk-JTPTAO4M.js → chunk-44KI6DPL.js} +24 -15
  65. package/dist/mcp-chunks/{chunk-BHXCAVFP.js → chunk-4ACA5GWL.js} +1 -1
  66. package/dist/mcp-chunks/{chunk-E76ZUBOJ.js → chunk-4NABHXDS.js} +4 -4
  67. package/dist/mcp-chunks/{chunk-AJDK5Z7O.js → chunk-4SO2DY7F.js} +2 -3
  68. package/dist/mcp-chunks/{chunk-I6UFV7RW.js → chunk-5ZQKSEUN.js} +1 -1
  69. package/dist/mcp-chunks/{chunk-KZGUH7E2.js → chunk-73TMUGJL.js} +2039 -1148
  70. package/dist/mcp-chunks/{chunk-UVRJ3AAD.js → chunk-7KOGD2JK.js} +2 -2
  71. package/dist/mcp-chunks/{chunk-KJ5FPQF6.js → chunk-7SQZWTDU.js} +30 -26
  72. package/dist/mcp-chunks/{chunk-MYAMG6VL.js → chunk-ABPXAKP7.js} +89 -28
  73. package/dist/mcp-chunks/{chunk-2YV72LUA.js → chunk-AIUZOMBB.js} +12 -12
  74. package/dist/mcp-chunks/{chunk-V42T3QNK.js → chunk-BI6L3SYV.js} +9 -9
  75. package/dist/mcp-chunks/{chunk-757ZF552.js → chunk-CFRA424Y.js} +4 -4
  76. package/dist/mcp-chunks/{chunk-DU4SDPEV.js → chunk-CIQX62WO.js} +2 -2
  77. package/dist/mcp-chunks/{chunk-MHUMLEBO.js → chunk-CWM4RO33.js} +1 -1
  78. package/dist/mcp-chunks/{chunk-TUPFPO4L.js → chunk-DEYGZRBD.js} +5 -5
  79. package/dist/mcp-chunks/{chunk-3SXP4S2A.js → chunk-DL3GVI4M.js} +2 -2
  80. package/dist/mcp-chunks/{chunk-O7SIXJM6.js → chunk-EUHXZKP2.js} +108 -108
  81. package/dist/mcp-chunks/{chunk-H5PBSJP3.js → chunk-EV3SP7ME.js} +1 -1
  82. package/dist/mcp-chunks/chunk-EVEVCVYR.js +42 -0
  83. package/dist/mcp-chunks/{chunk-RUF27IUF.js → chunk-FDVES4CU.js} +2 -2
  84. package/dist/mcp-chunks/{chunk-L2MSWQDL.js → chunk-FJNWUAGR.js} +1 -1
  85. package/dist/mcp-chunks/{chunk-IWCVZ46B.js → chunk-G5DK4L6M.js} +2 -2
  86. package/dist/mcp-chunks/{chunk-3ETUDW7N.js → chunk-GQM53HF7.js} +1 -1
  87. package/dist/mcp-chunks/{chunk-2AKSS7WR.js → chunk-H44A4G2O.js} +2 -2
  88. package/dist/mcp-chunks/{chunk-WDWSA7RL.js → chunk-HGEKP2E5.js} +4 -4
  89. package/dist/mcp-chunks/{chunk-ELHS763C.js → chunk-HKMH4N3Z.js} +1 -1
  90. package/dist/mcp-chunks/{chunk-GZ53GNFP.js → chunk-HPFIAALB.js} +13 -10
  91. package/dist/mcp-chunks/chunk-KUJUYFDC.js +224 -0
  92. package/dist/mcp-chunks/{chunk-OIK5AH2S.js → chunk-MG6EVYIM.js} +41 -19
  93. package/dist/mcp-chunks/{chunk-QNXOIF5U.js → chunk-MSPGQEWX.js} +12 -12
  94. package/dist/mcp-chunks/{chunk-JEHI2YU4.js → chunk-MW3YO24Q.js} +3 -3
  95. package/dist/mcp-chunks/{chunk-WQL7FJQ3.js → chunk-NJR33E7V.js} +4 -4
  96. package/dist/mcp-chunks/{chunk-7U5NSQ5T.js → chunk-OSK2JGFH.js} +2 -2
  97. package/dist/mcp-chunks/{chunk-ZEA3Y5ZD.js → chunk-QHD5RXW4.js} +7 -7
  98. package/dist/mcp-chunks/{chunk-TC2JPBFB.js → chunk-QYR3UKJS.js} +7 -4
  99. package/dist/mcp-chunks/{chunk-3FRLDHVD.js → chunk-SYBDN4SV.js} +5 -5
  100. package/dist/mcp-chunks/{chunk-3P3KGT4H.js → chunk-TQ5T5VO7.js} +2 -2
  101. package/dist/mcp-chunks/{chunk-OWGTNJNR.js → chunk-TT3LOCMN.js} +2 -2
  102. package/dist/mcp-chunks/{chunk-3LENTPGE.js → chunk-TTVO6RCP.js} +2 -2
  103. package/dist/mcp-chunks/{chunk-IRSL7JRH.js → chunk-UY2QWZB3.js} +53 -49
  104. package/dist/mcp-chunks/{chunk-B6S43WID.js → chunk-VJ45Y5IO.js} +1 -1
  105. package/dist/mcp-chunks/{chunk-IRARVOUM.js → chunk-VJ5VDK6D.js} +1 -1
  106. package/dist/mcp-chunks/{chunk-6O42UGLI.js → chunk-VLJQSE6L.js} +9 -9
  107. package/dist/mcp-chunks/{chunk-HNQSUT44.js → chunk-W47YAN6W.js} +3 -3
  108. package/dist/mcp-chunks/{chunk-66VSGFXA.js → chunk-XU4D5QN2.js} +1 -1
  109. package/dist/mcp-chunks/{chunk-CXST5CVH.js → chunk-Y7JQJ352.js} +22 -18
  110. package/dist/mcp-chunks/{chunk-3HSC6NHZ.js → chunk-Y7UTXETL.js} +1 -1
  111. package/dist/mcp-chunks/{chunk-O3RTM5HD.js → chunk-YFPPHEDE.js} +1 -1
  112. package/dist/mcp-chunks/{chunk-N6YUOYDS.js → chunk-YGT57XUN.js} +2 -2
  113. package/dist/mcp-chunks/{chunk-BUOGKTKK.js → chunk-Z43KJRXY.js} +1 -1
  114. package/dist/mcp-chunks/{chunk-6P3KAQ5N.js → chunk-Z5XOB522.js} +1 -1
  115. package/dist/mcp-chunks/{chunk-63L6SHK3.js → chunk-ZEMVGFKG.js} +2 -2
  116. package/dist/mcp-chunks/{chunk-MEQXX43K.js → chunk-ZJZ53NIB.js} +1 -1
  117. package/dist/mcp-chunks/{cli-UQ5QXFXU.js → cli-TJFAYJO4.js} +81 -283
  118. package/dist/mcp-chunks/client-LDKUW5K5.js +32 -0
  119. package/dist/mcp-chunks/{config-command-ZSPJI34E.js → config-command-YGNK2VVL.js} +29 -29
  120. package/dist/mcp-chunks/daemon-command-UYAYRHVD.js +36 -0
  121. package/dist/mcp-chunks/dist-5JNZD3JV.js +69 -0
  122. package/dist/mcp-chunks/{dist-Q7WSCBBK.js → dist-IFOLXE2R.js} +351 -1305
  123. package/dist/mcp-chunks/{emit-ts-command-SY4LQE4S.js → emit-ts-command-4EVF6CIG.js} +28 -25
  124. package/dist/mcp-chunks/{generate-cli-runner-LQBBQ7F5.js → generate-cli-runner-UFVSXJVK.js} +58 -49
  125. package/dist/mcp-chunks/generated-daemon-runtime-LTH36X2R.js +32 -0
  126. package/dist/mcp-chunks/{inspect-cli-command-JPX4ON6N.js → inspect-cli-command-L3JGLLTG.js} +11 -11
  127. package/dist/mcp-chunks/{launch-UG7IH27P.js → launch-LUKDWKH4.js} +1 -1
  128. package/dist/mcp-chunks/{lifecycle-QBYGUHQ3.js → lifecycle-H57PYAZ5.js} +1 -1
  129. package/dist/mcp-chunks/{list-command-SDITI3ZM.js → list-command-QBO4LK5Q.js} +53 -42
  130. package/dist/mcp-chunks/logger-LvdykevT-BQ5B4N5O.js +995 -0
  131. package/dist/mcp-chunks/{output-utils-YTMZTA7J.js → output-utils-MB3PEV2M.js} +3 -3
  132. package/dist/mcp-chunks/{pi-mcp-runtime-OLO25D7A.js → pi-mcp-runtime-OIMIJV5A.js} +73 -17
  133. package/dist/mcp-chunks/{prompt-DkftHXS7-N7UENQ4C.js → prompt-DkftHXS7-TE2LNPAM.js} +1 -1
  134. package/dist/mcp-chunks/{record-command-JGTMATYI.js → record-command-RYDP3Y2A.js} +5 -5
  135. package/dist/mcp-chunks/{replay-command-S2VAC4RW.js → replay-command-QDJCQ5JU.js} +6 -6
  136. package/dist/mcp-chunks/{resource-command-SRFQQROJ.js → resource-command-RKHHQBFP.js} +9 -9
  137. package/dist/mcp-chunks/{result-utils-JASGNHXK.js → result-utils-ZD5GFX7P.js} +3 -3
  138. package/dist/mcp-chunks/runtime-F7PP4V25.js +39 -0
  139. package/dist/mcp-chunks/{runtime-wrapper-7HYO3NM5.js → runtime-wrapper-AV4JCNRF.js} +3 -3
  140. package/dist/mcp-chunks/{serve-command-YKSIXG7K.js → serve-command-MRPTK4XX.js} +26 -26
  141. package/dist/mcp-chunks/server-2WSYXDII.js +43 -0
  142. package/dist/mcp-chunks/{timeouts-BJWDJEMH.js → timeouts-2SQIDYBE.js} +4 -3
  143. package/dist/mcp-chunks/{vault-command-EYOIFWEY.js → vault-command-6JVDCFWU.js} +5 -5
  144. package/dist/mcp-chunks/{webapi-WMMA3OEC.js → webapi-CI4O7AUX.js} +1 -1
  145. package/dist/mcp-daemon.js +35 -31
  146. package/dist/mcp-run-worker.js +34 -30
  147. package/dist/model-binding.d.ts +34 -3
  148. package/dist/model-binding.d.ts.map +1 -1
  149. package/dist/model-binding.js +174 -4
  150. package/dist/model-binding.js.map +1 -1
  151. package/dist/otel-baggage.d.ts +7 -0
  152. package/dist/otel-baggage.d.ts.map +1 -0
  153. package/dist/otel-baggage.js +7 -0
  154. package/dist/otel-baggage.js.map +1 -0
  155. package/dist/recipe/manifest.generated.d.ts +2 -1
  156. package/dist/recipe/manifest.generated.d.ts.map +1 -1
  157. package/dist/recipe/manifest.generated.js +2 -1
  158. package/dist/recipe/manifest.generated.js.map +1 -1
  159. package/dist/recipe/model.d.ts +2 -0
  160. package/dist/recipe/model.d.ts.map +1 -1
  161. package/dist/recipe/model.js +15 -1
  162. package/dist/recipe/model.js.map +1 -1
  163. package/dist/review.d.ts +1 -1
  164. package/dist/review.d.ts.map +1 -1
  165. package/dist/review.js +1 -1
  166. package/dist/review.js.map +1 -1
  167. package/dist/session.d.ts +9 -2
  168. package/dist/session.d.ts.map +1 -1
  169. package/dist/session.js +86 -16
  170. package/dist/session.js.map +1 -1
  171. package/dist/suggestion-picker.d.ts +2 -2
  172. package/dist/suggestion-picker.d.ts.map +1 -1
  173. package/dist/suggestion-picker.js +5 -3
  174. package/dist/suggestion-picker.js.map +1 -1
  175. package/docs/README.md +19 -18
  176. package/docs/batch.md +223 -0
  177. package/docs/pi-extension.md +42 -0
  178. package/docs/recipe-format.md +14 -3
  179. package/package.json +20 -15
  180. package/skills/documents/SKILL.md +6 -2
  181. package/skills/issues/SKILL.md +2 -1
  182. package/skills/search/SKILL.md +3 -0
  183. package/skills/signature/SKILL.md +4 -4
  184. package/dist/mcp-chunks/call-arguments-GCXZA4HC.js +0 -16
  185. package/dist/mcp-chunks/client-SBELHRAE.js +0 -32
  186. package/dist/mcp-chunks/daemon-command-MQS6AP2W.js +0 -32
  187. package/dist/mcp-chunks/dist-SDPPH7XQ.js +0 -65
  188. package/dist/mcp-chunks/generated-daemon-runtime-TUCZ3JEP.js +0 -32
  189. package/dist/mcp-chunks/runtime-5SOGEUTQ.js +0 -39
  190. package/dist/mcp-chunks/server-HQBFWAJR.js +0 -41
@@ -2,11 +2,11 @@ import { createRequire as __createRequire } from "node:module"; const require =
2
2
  import {
3
3
  createMcpRuntime,
4
4
  usesPiMcpClient
5
- } from "./chunk-OWGTNJNR.js";
5
+ } from "./chunk-TT3LOCMN.js";
6
6
  import {
7
7
  createCallResult,
8
8
  describeConnectionIssue
9
- } from "./chunk-3SXP4S2A.js";
9
+ } from "./chunk-DL3GVI4M.js";
10
10
  import {
11
11
  __commonJS,
12
12
  __require,
@@ -295,8 +295,8 @@ var require_directives = __commonJS({
295
295
  if (parts.length < 2)
296
296
  return false;
297
297
  }
298
- const [handle, prefix] = parts;
299
- this.tags[handle] = prefix;
298
+ const [handle, prefix2] = parts;
299
+ this.tags[handle] = prefix2;
300
300
  return true;
301
301
  }
302
302
  case "%YAML": {
@@ -346,10 +346,10 @@ var require_directives = __commonJS({
346
346
  const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);
347
347
  if (!suffix)
348
348
  onError(`The ${source} tag has no suffix`);
349
- const prefix = this.tags[handle];
350
- if (prefix) {
349
+ const prefix2 = this.tags[handle];
350
+ if (prefix2) {
351
351
  try {
352
- return prefix + decodeURIComponent(suffix);
352
+ return prefix2 + decodeURIComponent(suffix);
353
353
  } catch (error) {
354
354
  onError(String(error));
355
355
  return null;
@@ -365,9 +365,9 @@ var require_directives = __commonJS({
365
365
  * taking into account current tag prefixes and defaults.
366
366
  */
367
367
  tagString(tag) {
368
- for (const [handle, prefix] of Object.entries(this.tags)) {
369
- if (tag.startsWith(prefix))
370
- return handle + escapeTagName(tag.substring(prefix.length));
368
+ for (const [handle, prefix2] of Object.entries(this.tags)) {
369
+ if (tag.startsWith(prefix2))
370
+ return handle + escapeTagName(tag.substring(prefix2.length));
371
371
  }
372
372
  return tag[0] === "!" ? tag : `!<${tag}>`;
373
373
  }
@@ -384,11 +384,11 @@ var require_directives = __commonJS({
384
384
  tagNames = Object.keys(tags);
385
385
  } else
386
386
  tagNames = [];
387
- for (const [handle, prefix] of tagEntries) {
388
- if (handle === "!!" && prefix === "tag:yaml.org,2002:")
387
+ for (const [handle, prefix2] of tagEntries) {
388
+ if (handle === "!!" && prefix2 === "tag:yaml.org,2002:")
389
389
  continue;
390
- if (!doc || tagNames.some((tn) => tn.startsWith(prefix)))
391
- lines.push(`%TAG ${handle} ${prefix}`);
390
+ if (!doc || tagNames.some((tn) => tn.startsWith(prefix2)))
391
+ lines.push(`%TAG ${handle} ${prefix2}`);
392
392
  }
393
393
  return lines.join("\n");
394
394
  }
@@ -423,14 +423,14 @@ var require_anchors = __commonJS({
423
423
  });
424
424
  return anchors;
425
425
  }
426
- function findNewAnchor(prefix, exclude) {
426
+ function findNewAnchor(prefix2, exclude) {
427
427
  for (let i = 1; true; ++i) {
428
- const name = `${prefix}${i}`;
428
+ const name = `${prefix2}${i}`;
429
429
  if (!exclude.has(name))
430
430
  return name;
431
431
  }
432
432
  }
433
- function createNodeAnchors(doc, prefix) {
433
+ function createNodeAnchors(doc, prefix2) {
434
434
  const aliasObjects = [];
435
435
  const sourceObjects = /* @__PURE__ */ new Map();
436
436
  let prevAnchors = null;
@@ -438,7 +438,7 @@ var require_anchors = __commonJS({
438
438
  onAnchor: (source) => {
439
439
  aliasObjects.push(source);
440
440
  prevAnchors ?? (prevAnchors = anchorNames(doc));
441
- const anchor = findNewAnchor(prefix, prevAnchors);
441
+ const anchor = findNewAnchor(prefix2, prevAnchors);
442
442
  prevAnchors.add(anchor);
443
443
  return anchor;
444
444
  },
@@ -1256,9 +1256,9 @@ ${indent}`) + "'";
1256
1256
  return quotedString(value, ctx);
1257
1257
  }
1258
1258
  const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? " " : "");
1259
- const literal = blockQuote === "literal" ? true : blockQuote === "folded" || type === Scalar.Scalar.BLOCK_FOLDED ? false : type === Scalar.Scalar.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, lineWidth, indent.length);
1259
+ const literal2 = blockQuote === "literal" ? true : blockQuote === "folded" || type === Scalar.Scalar.BLOCK_FOLDED ? false : type === Scalar.Scalar.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, lineWidth, indent.length);
1260
1260
  if (!value)
1261
- return literal ? "|\n" : ">\n";
1261
+ return literal2 ? "|\n" : ">\n";
1262
1262
  let chomp;
1263
1263
  let endStart;
1264
1264
  for (endStart = value.length; endStart > 0; --endStart) {
@@ -1307,7 +1307,7 @@ ${indent}`) + "'";
1307
1307
  if (onComment)
1308
1308
  onComment();
1309
1309
  }
1310
- if (!literal) {
1310
+ if (!literal2) {
1311
1311
  const foldedValue = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`);
1312
1312
  let literalFallback = false;
1313
1313
  const foldOptions = getFoldOptions(ctx, true);
@@ -1823,8 +1823,8 @@ var require_Pair = __commonJS({
1823
1823
  return new _Pair(key, value);
1824
1824
  }
1825
1825
  toJSON(_, ctx) {
1826
- const pair = ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {};
1827
- return addPairToJSMap.addPairToJSMap(ctx, pair, this);
1826
+ const pair2 = ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {};
1827
+ return addPairToJSMap.addPairToJSMap(ctx, pair2, this);
1828
1828
  }
1829
1829
  toString(ctx, onComment, onChompKeep) {
1830
1830
  return ctx?.doc ? stringifyPair.stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this);
@@ -2049,14 +2049,14 @@ var require_YAMLMap = __commonJS({
2049
2049
  * @param overwrite - If not set `true`, using a key that is already in the
2050
2050
  * collection will throw. Otherwise, overwrites the previous value.
2051
2051
  */
2052
- add(pair, overwrite) {
2052
+ add(pair2, overwrite) {
2053
2053
  let _pair;
2054
- if (identity.isPair(pair))
2055
- _pair = pair;
2056
- else if (!pair || typeof pair !== "object" || !("key" in pair)) {
2057
- _pair = new Pair.Pair(pair, pair?.value);
2054
+ if (identity.isPair(pair2))
2055
+ _pair = pair2;
2056
+ else if (!pair2 || typeof pair2 !== "object" || !("key" in pair2)) {
2057
+ _pair = new Pair.Pair(pair2, pair2?.value);
2058
2058
  } else
2059
- _pair = new Pair.Pair(pair.key, pair.value);
2059
+ _pair = new Pair.Pair(pair2.key, pair2.value);
2060
2060
  const prev = findPair(this.items, _pair.key);
2061
2061
  const sortEntries = this.schema?.sortMapEntries;
2062
2062
  if (prev) {
@@ -2431,10 +2431,10 @@ var require_int = __commonJS({
2431
2431
  var stringifyNumber = require_stringifyNumber();
2432
2432
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
2433
2433
  var intResolve = (str, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix);
2434
- function intStringify(node, radix, prefix) {
2434
+ function intStringify(node, radix, prefix2) {
2435
2435
  const { value } = node;
2436
2436
  if (intIdentify(value) && value >= 0)
2437
- return prefix + value.toString(radix);
2437
+ return prefix2 + value.toString(radix);
2438
2438
  return stringifyNumber.stringifyNumber(node);
2439
2439
  }
2440
2440
  var intOct = {
@@ -2647,16 +2647,16 @@ var require_pairs = __commonJS({
2647
2647
  else if (identity.isMap(item)) {
2648
2648
  if (item.items.length > 1)
2649
2649
  onError("Each pair must have its own sequence indicator");
2650
- const pair = item.items[0] || new Pair.Pair(new Scalar.Scalar(null));
2650
+ const pair2 = item.items[0] || new Pair.Pair(new Scalar.Scalar(null));
2651
2651
  if (item.commentBefore)
2652
- pair.key.commentBefore = pair.key.commentBefore ? `${item.commentBefore}
2653
- ${pair.key.commentBefore}` : item.commentBefore;
2652
+ pair2.key.commentBefore = pair2.key.commentBefore ? `${item.commentBefore}
2653
+ ${pair2.key.commentBefore}` : item.commentBefore;
2654
2654
  if (item.comment) {
2655
- const cn = pair.value ?? pair.key;
2655
+ const cn = pair2.value ?? pair2.key;
2656
2656
  cn.comment = cn.comment ? `${item.comment}
2657
2657
  ${cn.comment}` : item.comment;
2658
2658
  }
2659
- item = pair;
2659
+ item = pair2;
2660
2660
  }
2661
2661
  seq.items[i] = identity.isPair(item) ? item : new Pair.Pair(item);
2662
2662
  }
@@ -2737,13 +2737,13 @@ var require_omap = __commonJS({
2737
2737
  const map = /* @__PURE__ */ new Map();
2738
2738
  if (ctx?.onCreate)
2739
2739
  ctx.onCreate(map);
2740
- for (const pair of this.items) {
2740
+ for (const pair2 of this.items) {
2741
2741
  let key, value;
2742
- if (identity.isPair(pair)) {
2743
- key = toJS.toJS(pair.key, "", ctx);
2744
- value = toJS.toJS(pair.value, key, ctx);
2742
+ if (identity.isPair(pair2)) {
2743
+ key = toJS.toJS(pair2.key, "", ctx);
2744
+ value = toJS.toJS(pair2.value, key, ctx);
2745
2745
  } else {
2746
- key = toJS.toJS(pair, "", ctx);
2746
+ key = toJS.toJS(pair2, "", ctx);
2747
2747
  }
2748
2748
  if (map.has(key))
2749
2749
  throw new Error("Ordered maps must not include duplicate keys");
@@ -2896,11 +2896,11 @@ var require_int2 = __commonJS({
2896
2896
  const n = parseInt(str, radix);
2897
2897
  return sign === "-" ? -1 * n : n;
2898
2898
  }
2899
- function intStringify(node, radix, prefix) {
2899
+ function intStringify(node, radix, prefix2) {
2900
2900
  const { value } = node;
2901
2901
  if (intIdentify(value)) {
2902
2902
  const str = value.toString(radix);
2903
- return value < 0 ? "-" + prefix + str.substr(1) : prefix + str;
2903
+ return value < 0 ? "-" + prefix2 + str.substr(1) : prefix2 + str;
2904
2904
  }
2905
2905
  return stringifyNumber.stringifyNumber(node);
2906
2906
  }
@@ -2959,24 +2959,24 @@ var require_set = __commonJS({
2959
2959
  this.tag = _YAMLSet.tag;
2960
2960
  }
2961
2961
  add(key) {
2962
- let pair;
2962
+ let pair2;
2963
2963
  if (identity.isPair(key))
2964
- pair = key;
2964
+ pair2 = key;
2965
2965
  else if (key && typeof key === "object" && "key" in key && "value" in key && key.value === null)
2966
- pair = new Pair.Pair(key.key, null);
2966
+ pair2 = new Pair.Pair(key.key, null);
2967
2967
  else
2968
- pair = new Pair.Pair(key, null);
2969
- const prev = YAMLMap.findPair(this.items, pair.key);
2968
+ pair2 = new Pair.Pair(key, null);
2969
+ const prev = YAMLMap.findPair(this.items, pair2.key);
2970
2970
  if (!prev)
2971
- this.items.push(pair);
2971
+ this.items.push(pair2);
2972
2972
  }
2973
2973
  /**
2974
2974
  * If `keepPair` is `true`, returns the Pair matching `key`.
2975
2975
  * Otherwise, returns the value of that Pair's key.
2976
2976
  */
2977
2977
  get(key, keepPair) {
2978
- const pair = YAMLMap.findPair(this.items, key);
2979
- return !keepPair && identity.isPair(pair) ? identity.isScalar(pair.key) ? pair.key.value : pair.key : pair;
2978
+ const pair2 = YAMLMap.findPair(this.items, key);
2979
+ return !keepPair && identity.isPair(pair2) ? identity.isScalar(pair2.key) ? pair2.key.value : pair2.key : pair2;
2980
2980
  }
2981
2981
  set(key, value) {
2982
2982
  if (typeof value !== "boolean")
@@ -3951,7 +3951,7 @@ var require_util_map_includes = __commonJS({
3951
3951
  if (uniqueKeys === false)
3952
3952
  return false;
3953
3953
  const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity.isScalar(a) && identity.isScalar(b) && a.value === b.value;
3954
- return items.some((pair) => isEqual(pair.key, search));
3954
+ return items.some((pair2) => isEqual(pair2.key, search));
3955
3955
  }
3956
3956
  exports.mapIncludes = mapIncludes;
3957
3957
  }
@@ -4037,10 +4037,10 @@ var require_resolve_block_map = __commonJS({
4037
4037
  if (ctx.schema.compat)
4038
4038
  utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
4039
4039
  offset = valueNode.range[2];
4040
- const pair = new Pair.Pair(keyNode, valueNode);
4040
+ const pair2 = new Pair.Pair(keyNode, valueNode);
4041
4041
  if (ctx.options.keepSourceTokens)
4042
- pair.srcToken = collItem;
4043
- map.items.push(pair);
4042
+ pair2.srcToken = collItem;
4043
+ map.items.push(pair2);
4044
4044
  } else {
4045
4045
  if (implicitKey)
4046
4046
  onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values");
@@ -4050,10 +4050,10 @@ var require_resolve_block_map = __commonJS({
4050
4050
  else
4051
4051
  keyNode.comment = valueProps.comment;
4052
4052
  }
4053
- const pair = new Pair.Pair(keyNode);
4053
+ const pair2 = new Pair.Pair(keyNode);
4054
4054
  if (ctx.options.keepSourceTokens)
4055
- pair.srcToken = collItem;
4056
- map.items.push(pair);
4055
+ pair2.srcToken = collItem;
4056
+ map.items.push(pair2);
4057
4057
  }
4058
4058
  }
4059
4059
  if (commentEnd && commentEnd < offset)
@@ -4304,18 +4304,18 @@ var require_resolve_flow_collection = __commonJS({
4304
4304
  else
4305
4305
  keyNode.comment = valueProps.comment;
4306
4306
  }
4307
- const pair = new Pair.Pair(keyNode, valueNode);
4307
+ const pair2 = new Pair.Pair(keyNode, valueNode);
4308
4308
  if (ctx.options.keepSourceTokens)
4309
- pair.srcToken = collItem;
4309
+ pair2.srcToken = collItem;
4310
4310
  if (isMap) {
4311
4311
  const map = coll;
4312
4312
  if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
4313
4313
  onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
4314
- map.items.push(pair);
4314
+ map.items.push(pair2);
4315
4315
  } else {
4316
4316
  const map = new YAMLMap.YAMLMap(ctx.schema);
4317
4317
  map.flow = true;
4318
- map.items.push(pair);
4318
+ map.items.push(pair2);
4319
4319
  const endRange = (valueNode ?? keyNode).range;
4320
4320
  map.range = [keyNode.range[0], endRange[1], endRange[2]];
4321
4321
  coll.items.push(map);
@@ -7343,9 +7343,9 @@ var require_dist = __commonJS({
7343
7343
  }
7344
7344
  });
7345
7345
 
7346
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js
7346
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/constants.js
7347
7347
  var require_constants = __commonJS({
7348
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js"(exports, module) {
7348
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/constants.js"(exports, module) {
7349
7349
  "use strict";
7350
7350
  var SEMVER_SPEC_VERSION = "2.0.0";
7351
7351
  var MAX_LENGTH = 256;
@@ -7353,6 +7353,33 @@ var require_constants = __commonJS({
7353
7353
  9007199254740991;
7354
7354
  var MAX_SAFE_COMPONENT_LENGTH = 16;
7355
7355
  var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
7356
+ var WHITESPACE_CHARACTERS = [
7357
+ " ",
7358
+ "\n",
7359
+ "\v",
7360
+ "\f",
7361
+ "\r",
7362
+ " ",
7363
+ "\xA0",
7364
+ "\u1680",
7365
+ "\u2000",
7366
+ "\u2001",
7367
+ "\u2002",
7368
+ "\u2003",
7369
+ "\u2004",
7370
+ "\u2005",
7371
+ "\u2006",
7372
+ "\u2007",
7373
+ "\u2008",
7374
+ "\u2009",
7375
+ "\u200A",
7376
+ "\u2028",
7377
+ "\u2029",
7378
+ "\u202F",
7379
+ "\u205F",
7380
+ "\u3000",
7381
+ "\uFEFF"
7382
+ ];
7356
7383
  var RELEASE_TYPES = [
7357
7384
  "major",
7358
7385
  "premajor",
@@ -7367,6 +7394,7 @@ var require_constants = __commonJS({
7367
7394
  MAX_SAFE_COMPONENT_LENGTH,
7368
7395
  MAX_SAFE_BUILD_LENGTH,
7369
7396
  MAX_SAFE_INTEGER,
7397
+ WHITESPACE_CHARACTERS,
7370
7398
  RELEASE_TYPES,
7371
7399
  SEMVER_SPEC_VERSION,
7372
7400
  FLAG_INCLUDE_PRERELEASE: 1,
@@ -7375,9 +7403,9 @@ var require_constants = __commonJS({
7375
7403
  }
7376
7404
  });
7377
7405
 
7378
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js
7406
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/debug.js
7379
7407
  var require_debug = __commonJS({
7380
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js"(exports, module) {
7408
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/debug.js"(exports, module) {
7381
7409
  "use strict";
7382
7410
  var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
7383
7411
  };
@@ -7385,9 +7413,9 @@ var require_debug = __commonJS({
7385
7413
  }
7386
7414
  });
7387
7415
 
7388
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js
7416
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/re.js
7389
7417
  var require_re = __commonJS({
7390
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js"(exports, module) {
7418
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/re.js"(exports, module) {
7391
7419
  "use strict";
7392
7420
  var {
7393
7421
  MAX_SAFE_COMPONENT_LENGTH,
@@ -7473,9 +7501,9 @@ var require_re = __commonJS({
7473
7501
  }
7474
7502
  });
7475
7503
 
7476
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js
7504
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/parse-options.js
7477
7505
  var require_parse_options = __commonJS({
7478
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js"(exports, module) {
7506
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/parse-options.js"(exports, module) {
7479
7507
  "use strict";
7480
7508
  var looseOption = Object.freeze({ loose: true });
7481
7509
  var emptyOpts = Object.freeze({});
@@ -7492,9 +7520,9 @@ var require_parse_options = __commonJS({
7492
7520
  }
7493
7521
  });
7494
7522
 
7495
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js
7523
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/identifiers.js
7496
7524
  var require_identifiers = __commonJS({
7497
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js"(exports, module) {
7525
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/identifiers.js"(exports, module) {
7498
7526
  "use strict";
7499
7527
  var numeric2 = /^[0-9]+$/;
7500
7528
  var compareIdentifiers = (a, b) => {
@@ -7517,9 +7545,9 @@ var require_identifiers = __commonJS({
7517
7545
  }
7518
7546
  });
7519
7547
 
7520
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js
7548
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/classes/semver.js
7521
7549
  var require_semver = __commonJS({
7522
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js"(exports, module) {
7550
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/classes/semver.js"(exports, module) {
7523
7551
  "use strict";
7524
7552
  var debug = require_debug();
7525
7553
  var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
@@ -7809,9 +7837,9 @@ var require_semver = __commonJS({
7809
7837
  }
7810
7838
  });
7811
7839
 
7812
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js
7840
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/parse.js
7813
7841
  var require_parse = __commonJS({
7814
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports, module) {
7842
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/parse.js"(exports, module) {
7815
7843
  "use strict";
7816
7844
  var SemVer = require_semver();
7817
7845
  var parse2 = (version, options2, throwErrors = false) => {
@@ -7831,9 +7859,9 @@ var require_parse = __commonJS({
7831
7859
  }
7832
7860
  });
7833
7861
 
7834
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js
7862
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/valid.js
7835
7863
  var require_valid = __commonJS({
7836
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports, module) {
7864
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/valid.js"(exports, module) {
7837
7865
  "use strict";
7838
7866
  var parse2 = require_parse();
7839
7867
  var valid = (version, options2) => {
@@ -7844,9 +7872,9 @@ var require_valid = __commonJS({
7844
7872
  }
7845
7873
  });
7846
7874
 
7847
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js
7875
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/clean.js
7848
7876
  var require_clean = __commonJS({
7849
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js"(exports, module) {
7877
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/clean.js"(exports, module) {
7850
7878
  "use strict";
7851
7879
  var parse2 = require_parse();
7852
7880
  var clean = (version, options2) => {
@@ -7857,9 +7885,9 @@ var require_clean = __commonJS({
7857
7885
  }
7858
7886
  });
7859
7887
 
7860
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js
7888
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/inc.js
7861
7889
  var require_inc = __commonJS({
7862
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js"(exports, module) {
7890
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/inc.js"(exports, module) {
7863
7891
  "use strict";
7864
7892
  var SemVer = require_semver();
7865
7893
  var inc = (version, release, options2, identifier, identifierBase) => {
@@ -7881,9 +7909,9 @@ var require_inc = __commonJS({
7881
7909
  }
7882
7910
  });
7883
7911
 
7884
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js
7912
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/diff.js
7885
7913
  var require_diff = __commonJS({
7886
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js"(exports, module) {
7914
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/diff.js"(exports, module) {
7887
7915
  "use strict";
7888
7916
  var parse2 = require_parse();
7889
7917
  var diff = (version1, version2) => {
@@ -7909,15 +7937,15 @@ var require_diff = __commonJS({
7909
7937
  return "patch";
7910
7938
  }
7911
7939
  }
7912
- const prefix = highHasPre ? "pre" : "";
7940
+ const prefix2 = highHasPre ? "pre" : "";
7913
7941
  if (v1.major !== v2.major) {
7914
- return prefix + "major";
7942
+ return prefix2 + "major";
7915
7943
  }
7916
7944
  if (v1.minor !== v2.minor) {
7917
- return prefix + "minor";
7945
+ return prefix2 + "minor";
7918
7946
  }
7919
7947
  if (v1.patch !== v2.patch) {
7920
- return prefix + "patch";
7948
+ return prefix2 + "patch";
7921
7949
  }
7922
7950
  return "prerelease";
7923
7951
  };
@@ -7925,9 +7953,9 @@ var require_diff = __commonJS({
7925
7953
  }
7926
7954
  });
7927
7955
 
7928
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js
7956
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/major.js
7929
7957
  var require_major = __commonJS({
7930
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js"(exports, module) {
7958
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/major.js"(exports, module) {
7931
7959
  "use strict";
7932
7960
  var SemVer = require_semver();
7933
7961
  var major2 = (a, loose) => new SemVer(a, loose).major;
@@ -7935,9 +7963,9 @@ var require_major = __commonJS({
7935
7963
  }
7936
7964
  });
7937
7965
 
7938
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js
7966
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/minor.js
7939
7967
  var require_minor = __commonJS({
7940
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js"(exports, module) {
7968
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/minor.js"(exports, module) {
7941
7969
  "use strict";
7942
7970
  var SemVer = require_semver();
7943
7971
  var minor = (a, loose) => new SemVer(a, loose).minor;
@@ -7945,9 +7973,9 @@ var require_minor = __commonJS({
7945
7973
  }
7946
7974
  });
7947
7975
 
7948
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js
7976
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/patch.js
7949
7977
  var require_patch = __commonJS({
7950
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js"(exports, module) {
7978
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/patch.js"(exports, module) {
7951
7979
  "use strict";
7952
7980
  var SemVer = require_semver();
7953
7981
  var patch = (a, loose) => new SemVer(a, loose).patch;
@@ -7955,9 +7983,9 @@ var require_patch = __commonJS({
7955
7983
  }
7956
7984
  });
7957
7985
 
7958
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js
7986
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/prerelease.js
7959
7987
  var require_prerelease = __commonJS({
7960
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js"(exports, module) {
7988
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/prerelease.js"(exports, module) {
7961
7989
  "use strict";
7962
7990
  var parse2 = require_parse();
7963
7991
  var prerelease = (version, options2) => {
@@ -7968,9 +7996,9 @@ var require_prerelease = __commonJS({
7968
7996
  }
7969
7997
  });
7970
7998
 
7971
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js
7999
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/compare.js
7972
8000
  var require_compare = __commonJS({
7973
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js"(exports, module) {
8001
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/compare.js"(exports, module) {
7974
8002
  "use strict";
7975
8003
  var SemVer = require_semver();
7976
8004
  var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
@@ -7978,9 +8006,9 @@ var require_compare = __commonJS({
7978
8006
  }
7979
8007
  });
7980
8008
 
7981
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js
8009
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/rcompare.js
7982
8010
  var require_rcompare = __commonJS({
7983
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js"(exports, module) {
8011
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/rcompare.js"(exports, module) {
7984
8012
  "use strict";
7985
8013
  var compare = require_compare();
7986
8014
  var rcompare = (a, b, loose) => compare(b, a, loose);
@@ -7988,9 +8016,9 @@ var require_rcompare = __commonJS({
7988
8016
  }
7989
8017
  });
7990
8018
 
7991
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js
8019
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/compare-loose.js
7992
8020
  var require_compare_loose = __commonJS({
7993
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js"(exports, module) {
8021
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/compare-loose.js"(exports, module) {
7994
8022
  "use strict";
7995
8023
  var compare = require_compare();
7996
8024
  var compareLoose = (a, b) => compare(a, b, true);
@@ -7998,9 +8026,9 @@ var require_compare_loose = __commonJS({
7998
8026
  }
7999
8027
  });
8000
8028
 
8001
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js
8029
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/compare-build.js
8002
8030
  var require_compare_build = __commonJS({
8003
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js"(exports, module) {
8031
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/compare-build.js"(exports, module) {
8004
8032
  "use strict";
8005
8033
  var SemVer = require_semver();
8006
8034
  var compareBuild = (a, b, loose) => {
@@ -8012,9 +8040,9 @@ var require_compare_build = __commonJS({
8012
8040
  }
8013
8041
  });
8014
8042
 
8015
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js
8043
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/sort.js
8016
8044
  var require_sort = __commonJS({
8017
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js"(exports, module) {
8045
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/sort.js"(exports, module) {
8018
8046
  "use strict";
8019
8047
  var compareBuild = require_compare_build();
8020
8048
  var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
@@ -8022,9 +8050,9 @@ var require_sort = __commonJS({
8022
8050
  }
8023
8051
  });
8024
8052
 
8025
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js
8053
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/rsort.js
8026
8054
  var require_rsort = __commonJS({
8027
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js"(exports, module) {
8055
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/rsort.js"(exports, module) {
8028
8056
  "use strict";
8029
8057
  var compareBuild = require_compare_build();
8030
8058
  var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
@@ -8032,9 +8060,9 @@ var require_rsort = __commonJS({
8032
8060
  }
8033
8061
  });
8034
8062
 
8035
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js
8063
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/gt.js
8036
8064
  var require_gt = __commonJS({
8037
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js"(exports, module) {
8065
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/gt.js"(exports, module) {
8038
8066
  "use strict";
8039
8067
  var compare = require_compare();
8040
8068
  var gt = (a, b, loose) => compare(a, b, loose) > 0;
@@ -8042,9 +8070,9 @@ var require_gt = __commonJS({
8042
8070
  }
8043
8071
  });
8044
8072
 
8045
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js
8073
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/lt.js
8046
8074
  var require_lt = __commonJS({
8047
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js"(exports, module) {
8075
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/lt.js"(exports, module) {
8048
8076
  "use strict";
8049
8077
  var compare = require_compare();
8050
8078
  var lt = (a, b, loose) => compare(a, b, loose) < 0;
@@ -8052,9 +8080,9 @@ var require_lt = __commonJS({
8052
8080
  }
8053
8081
  });
8054
8082
 
8055
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js
8083
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/eq.js
8056
8084
  var require_eq = __commonJS({
8057
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js"(exports, module) {
8085
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/eq.js"(exports, module) {
8058
8086
  "use strict";
8059
8087
  var compare = require_compare();
8060
8088
  var eq = (a, b, loose) => compare(a, b, loose) === 0;
@@ -8062,9 +8090,9 @@ var require_eq = __commonJS({
8062
8090
  }
8063
8091
  });
8064
8092
 
8065
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js
8093
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/neq.js
8066
8094
  var require_neq = __commonJS({
8067
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js"(exports, module) {
8095
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/neq.js"(exports, module) {
8068
8096
  "use strict";
8069
8097
  var compare = require_compare();
8070
8098
  var neq = (a, b, loose) => compare(a, b, loose) !== 0;
@@ -8072,9 +8100,9 @@ var require_neq = __commonJS({
8072
8100
  }
8073
8101
  });
8074
8102
 
8075
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js
8103
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/gte.js
8076
8104
  var require_gte = __commonJS({
8077
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js"(exports, module) {
8105
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/gte.js"(exports, module) {
8078
8106
  "use strict";
8079
8107
  var compare = require_compare();
8080
8108
  var gte2 = (a, b, loose) => compare(a, b, loose) >= 0;
@@ -8082,9 +8110,9 @@ var require_gte = __commonJS({
8082
8110
  }
8083
8111
  });
8084
8112
 
8085
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js
8113
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/lte.js
8086
8114
  var require_lte = __commonJS({
8087
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js"(exports, module) {
8115
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/lte.js"(exports, module) {
8088
8116
  "use strict";
8089
8117
  var compare = require_compare();
8090
8118
  var lte2 = (a, b, loose) => compare(a, b, loose) <= 0;
@@ -8092,9 +8120,9 @@ var require_lte = __commonJS({
8092
8120
  }
8093
8121
  });
8094
8122
 
8095
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js
8123
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/cmp.js
8096
8124
  var require_cmp = __commonJS({
8097
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js"(exports, module) {
8125
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/cmp.js"(exports, module) {
8098
8126
  "use strict";
8099
8127
  var eq = require_eq();
8100
8128
  var neq = require_neq();
@@ -8142,9 +8170,9 @@ var require_cmp = __commonJS({
8142
8170
  }
8143
8171
  });
8144
8172
 
8145
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js
8173
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/coerce.js
8146
8174
  var require_coerce = __commonJS({
8147
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js"(exports, module) {
8175
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/coerce.js"(exports, module) {
8148
8176
  "use strict";
8149
8177
  var SemVer = require_semver();
8150
8178
  var parse2 = require_parse();
@@ -8181,16 +8209,16 @@ var require_coerce = __commonJS({
8181
8209
  const minor = match2[3] || "0";
8182
8210
  const patch = match2[4] || "0";
8183
8211
  const prerelease = options2.includePrerelease && match2[5] ? `-${match2[5]}` : "";
8184
- const build = options2.includePrerelease && match2[6] ? `+${match2[6]}` : "";
8185
- return parse2(`${major2}.${minor}.${patch}${prerelease}${build}`, options2);
8212
+ const build2 = options2.includePrerelease && match2[6] ? `+${match2[6]}` : "";
8213
+ return parse2(`${major2}.${minor}.${patch}${prerelease}${build2}`, options2);
8186
8214
  };
8187
8215
  module.exports = coerce;
8188
8216
  }
8189
8217
  });
8190
8218
 
8191
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js
8219
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/truncate.js
8192
8220
  var require_truncate = __commonJS({
8193
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js"(exports, module) {
8221
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/truncate.js"(exports, module) {
8194
8222
  "use strict";
8195
8223
  var parse2 = require_parse();
8196
8224
  var constants = require_constants();
@@ -8229,9 +8257,9 @@ var require_truncate = __commonJS({
8229
8257
  }
8230
8258
  });
8231
8259
 
8232
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js
8260
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/lrucache.js
8233
8261
  var require_lrucache = __commonJS({
8234
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js"(exports, module) {
8262
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/lrucache.js"(exports, module) {
8235
8263
  "use strict";
8236
8264
  var LRUCache = class {
8237
8265
  constructor() {
@@ -8267,9 +8295,200 @@ var require_lrucache = __commonJS({
8267
8295
  }
8268
8296
  });
8269
8297
 
8270
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js
8298
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/trim-comparator-whitespace.js
8299
+ var require_trim_comparator_whitespace = __commonJS({
8300
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/trim-comparator-whitespace.js"(exports, module) {
8301
+ "use strict";
8302
+ var {
8303
+ MAX_LENGTH,
8304
+ MAX_SAFE_BUILD_LENGTH,
8305
+ WHITESPACE_CHARACTERS
8306
+ } = require_constants();
8307
+ var whitespace = new Uint8Array(65536);
8308
+ for (const char of WHITESPACE_CHARACTERS) {
8309
+ whitespace[char.charCodeAt(0)] = 1;
8310
+ }
8311
+ var isWhitespace = (char) => char !== void 0 && whitespace[char.charCodeAt(0)] === 1;
8312
+ var isVersionPrefix = (char) => char === "v" || char === "=" || isWhitespace(char);
8313
+ var isDigit = (char) => char !== void 0 && char >= "0" && char <= "9";
8314
+ var isLetter = (char) => char !== void 0 && (char >= "a" && char <= "z" || char >= "A" && char <= "Z");
8315
+ var isIdentifierCharacter = (char) => isDigit(char) || isLetter(char) || char === "-";
8316
+ var isVersionStart = (char) => isDigit(char) || char === "x" || char === "X" || char === "*";
8317
+ var findDigitsEndIndex = (range3, start, limit, digitRuns) => {
8318
+ if (!isDigit(range3[start])) {
8319
+ return start;
8320
+ }
8321
+ if (start >= digitRuns.start && start < digitRuns.end) {
8322
+ return Math.min(start + limit, digitRuns.end);
8323
+ }
8324
+ if (start >= digitRuns.previousStart && start < digitRuns.previousEnd) {
8325
+ return Math.min(start + limit, digitRuns.previousEnd);
8326
+ }
8327
+ let end = start + 1;
8328
+ while (isDigit(range3[end])) {
8329
+ end++;
8330
+ }
8331
+ digitRuns.previousStart = digitRuns.start;
8332
+ digitRuns.previousEnd = digitRuns.end;
8333
+ digitRuns.start = start;
8334
+ digitRuns.end = end;
8335
+ return Math.min(start + limit, end);
8336
+ };
8337
+ var findVersionNumberEndIndex = (range3, start, loose, digitRuns) => {
8338
+ if (!loose && range3[start] === "0") {
8339
+ return start + 1;
8340
+ }
8341
+ return findDigitsEndIndex(range3, start, loose ? MAX_LENGTH : MAX_LENGTH + 1, digitRuns);
8342
+ };
8343
+ var findPrereleaseIdentifierEndIndex = (range3, start, loose, digitRuns) => {
8344
+ const digitsEnd = findDigitsEndIndex(range3, start, MAX_LENGTH, digitRuns);
8345
+ if (isLetter(range3[digitsEnd]) || range3[digitsEnd] === "-") {
8346
+ let end = digitsEnd + 1;
8347
+ const limit = end + MAX_SAFE_BUILD_LENGTH;
8348
+ while (end < limit && isIdentifierCharacter(range3[end])) {
8349
+ end++;
8350
+ }
8351
+ return end;
8352
+ }
8353
+ return findVersionNumberEndIndex(range3, start, loose, digitRuns);
8354
+ };
8355
+ var findPrereleaseEndIndex = (range3, start, loose, digitRuns) => {
8356
+ const hyphen = range3[start] === "-";
8357
+ if (!loose && !hyphen) {
8358
+ return start;
8359
+ }
8360
+ const identifierStart = start + (hyphen ? 1 : 0);
8361
+ let end = findPrereleaseIdentifierEndIndex(range3, identifierStart, loose, digitRuns);
8362
+ if (end === identifierStart) {
8363
+ if (!loose || !hyphen) {
8364
+ return start;
8365
+ }
8366
+ end = findPrereleaseIdentifierEndIndex(range3, start, loose, digitRuns);
8367
+ }
8368
+ while (range3[end] === ".") {
8369
+ const next = findPrereleaseIdentifierEndIndex(range3, end + 1, loose, digitRuns);
8370
+ if (next === end + 1) {
8371
+ break;
8372
+ }
8373
+ end = next;
8374
+ }
8375
+ return end;
8376
+ };
8377
+ var findBuildIdentifierEndIndex = (range3, start) => {
8378
+ let end = start;
8379
+ while (end - start < MAX_SAFE_BUILD_LENGTH && isIdentifierCharacter(range3[end])) {
8380
+ end++;
8381
+ }
8382
+ return end;
8383
+ };
8384
+ var findBuildEndIndex = (range3, start) => {
8385
+ if (range3[start] !== "+") {
8386
+ return start;
8387
+ }
8388
+ let end = findBuildIdentifierEndIndex(range3, start + 1);
8389
+ if (end === start + 1) {
8390
+ return start;
8391
+ }
8392
+ while (range3[end] === ".") {
8393
+ const next = findBuildIdentifierEndIndex(range3, end + 1);
8394
+ if (next === end + 1) {
8395
+ break;
8396
+ }
8397
+ end = next;
8398
+ }
8399
+ return end;
8400
+ };
8401
+ var findLooseFullVersionEndIndex = (range3, start, digitRuns) => {
8402
+ let end = start;
8403
+ for (let component = 0; component < 3; component++) {
8404
+ const next = findVersionNumberEndIndex(range3, end, true, digitRuns);
8405
+ if (next === end) {
8406
+ return start;
8407
+ }
8408
+ end = next;
8409
+ if (component < 2) {
8410
+ if (range3[end] !== ".") {
8411
+ return start;
8412
+ }
8413
+ end++;
8414
+ }
8415
+ }
8416
+ const prereleaseEnd = findPrereleaseEndIndex(range3, end, true, digitRuns);
8417
+ return findBuildEndIndex(range3, prereleaseEnd);
8418
+ };
8419
+ var findPartialVersionComponentEndIndex = (range3, start, digitRuns) => {
8420
+ if (isDigit(range3[start])) {
8421
+ return findVersionNumberEndIndex(range3, start, false, digitRuns);
8422
+ }
8423
+ return isVersionStart(range3[start]) ? start + 1 : start;
8424
+ };
8425
+ var findPartialVersionEndIndex = (range3, start, digitRuns) => {
8426
+ let end = findPartialVersionComponentEndIndex(range3, start, digitRuns);
8427
+ for (let component = 0; component < 2; component++) {
8428
+ if (range3[end] !== ".") {
8429
+ return end;
8430
+ }
8431
+ const next = findPartialVersionComponentEndIndex(range3, end + 1, digitRuns);
8432
+ if (next === end + 1) {
8433
+ return end;
8434
+ }
8435
+ end = next;
8436
+ }
8437
+ const prereleaseEnd = findPrereleaseEndIndex(range3, end, false, digitRuns);
8438
+ return findBuildEndIndex(range3, prereleaseEnd);
8439
+ };
8440
+ var findVersionEndIndex = (range3, start, digitRuns) => {
8441
+ const fullVersionEnd = findLooseFullVersionEndIndex(range3, start, digitRuns);
8442
+ return fullVersionEnd !== start ? fullVersionEnd : findPartialVersionEndIndex(range3, start, digitRuns);
8443
+ };
8444
+ var findRemovableWhitespaceIndex = (range3, matchStart) => {
8445
+ let position = matchStart;
8446
+ if (isWhitespace(range3[position])) {
8447
+ position++;
8448
+ }
8449
+ if (range3[position] === "<" || range3[position] === ">") {
8450
+ position++;
8451
+ }
8452
+ if (range3[position] === "=") {
8453
+ position++;
8454
+ }
8455
+ return isWhitespace(range3[position]) ? position : -1;
8456
+ };
8457
+ var trimComparatorWhitespace = (range3) => {
8458
+ let result = "";
8459
+ let copyFrom = 0;
8460
+ let cursor = 0;
8461
+ const digitRuns = { start: -1, end: -1, previousStart: -1, previousEnd: -1 };
8462
+ while (cursor < range3.length) {
8463
+ const matchStart = cursor;
8464
+ if (range3[cursor] === "<" || range3[cursor] === ">") {
8465
+ cursor++;
8466
+ } else if (!isVersionPrefix(range3[cursor]) && !isVersionStart(range3[cursor])) {
8467
+ cursor++;
8468
+ continue;
8469
+ }
8470
+ while (cursor < range3.length && isVersionPrefix(range3[cursor])) {
8471
+ cursor++;
8472
+ }
8473
+ if (!isVersionStart(range3[cursor])) {
8474
+ continue;
8475
+ }
8476
+ const whitespacePosition = findRemovableWhitespaceIndex(range3, matchStart);
8477
+ if (whitespacePosition !== -1) {
8478
+ result += range3.slice(copyFrom, whitespacePosition);
8479
+ copyFrom = whitespacePosition + 1;
8480
+ }
8481
+ cursor = findVersionEndIndex(range3, cursor, digitRuns);
8482
+ }
8483
+ return result + range3.slice(copyFrom);
8484
+ };
8485
+ module.exports = trimComparatorWhitespace;
8486
+ }
8487
+ });
8488
+
8489
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/classes/range.js
8271
8490
  var require_range = __commonJS({
8272
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js"(exports, module) {
8491
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/classes/range.js"(exports, module) {
8273
8492
  "use strict";
8274
8493
  var SPACE_CHARACTERS = /\s+/g;
8275
8494
  var Range = class _Range {
@@ -8340,7 +8559,7 @@ var require_range = __commonJS({
8340
8559
  range3 = range3.replace(BUILDSTRIPRE, "");
8341
8560
  const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
8342
8561
  const memoKey = memoOpts + ":" + range3;
8343
- const cached = cache.get(memoKey);
8562
+ const cached = cache2.get(memoKey);
8344
8563
  if (cached) {
8345
8564
  return cached;
8346
8565
  }
@@ -8348,7 +8567,7 @@ var require_range = __commonJS({
8348
8567
  const hr = loose ? re2[t.HYPHENRANGELOOSE] : re2[t.HYPHENRANGE];
8349
8568
  range3 = range3.replace(hr, hyphenReplace(this.options.includePrerelease));
8350
8569
  debug("hyphen replace", range3);
8351
- range3 = range3.replace(re2[t.COMPARATORTRIM], comparatorTrimReplace);
8570
+ range3 = trimComparatorWhitespace(range3);
8352
8571
  debug("comparator trim", range3);
8353
8572
  range3 = range3.replace(re2[t.TILDETRIM], tildeTrimReplace);
8354
8573
  debug("tilde trim", range3);
@@ -8374,7 +8593,7 @@ var require_range = __commonJS({
8374
8593
  rangeMap.delete("");
8375
8594
  }
8376
8595
  const result = [...rangeMap.values()];
8377
- cache.set(memoKey, result);
8596
+ cache2.set(memoKey, result);
8378
8597
  return result;
8379
8598
  }
8380
8599
  intersects(range3, options2) {
@@ -8413,16 +8632,16 @@ var require_range = __commonJS({
8413
8632
  };
8414
8633
  module.exports = Range;
8415
8634
  var LRU = require_lrucache();
8416
- var cache = new LRU();
8635
+ var cache2 = new LRU();
8417
8636
  var parseOptions = require_parse_options();
8418
8637
  var Comparator = require_comparator();
8419
8638
  var debug = require_debug();
8420
8639
  var SemVer = require_semver();
8640
+ var trimComparatorWhitespace = require_trim_comparator_whitespace();
8421
8641
  var {
8422
8642
  safeRe: re2,
8423
8643
  src,
8424
8644
  t,
8425
- comparatorTrimReplace,
8426
8645
  tildeTrimReplace,
8427
8646
  caretTrimReplace
8428
8647
  } = require_re();
@@ -8652,9 +8871,9 @@ var require_range = __commonJS({
8652
8871
  }
8653
8872
  });
8654
8873
 
8655
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js
8874
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/classes/comparator.js
8656
8875
  var require_comparator = __commonJS({
8657
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js"(exports, module) {
8876
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/classes/comparator.js"(exports, module) {
8658
8877
  "use strict";
8659
8878
  var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
8660
8879
  var Comparator = class _Comparator {
@@ -8765,9 +8984,9 @@ var require_comparator = __commonJS({
8765
8984
  }
8766
8985
  });
8767
8986
 
8768
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js
8987
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/satisfies.js
8769
8988
  var require_satisfies = __commonJS({
8770
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js"(exports, module) {
8989
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/satisfies.js"(exports, module) {
8771
8990
  "use strict";
8772
8991
  var Range = require_range();
8773
8992
  var satisfies = (version, range3, options2) => {
@@ -8782,9 +9001,9 @@ var require_satisfies = __commonJS({
8782
9001
  }
8783
9002
  });
8784
9003
 
8785
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js
9004
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/to-comparators.js
8786
9005
  var require_to_comparators = __commonJS({
8787
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js"(exports, module) {
9006
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/to-comparators.js"(exports, module) {
8788
9007
  "use strict";
8789
9008
  var Range = require_range();
8790
9009
  var toComparators = (range3, options2) => new Range(range3, options2).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
@@ -8792,9 +9011,9 @@ var require_to_comparators = __commonJS({
8792
9011
  }
8793
9012
  });
8794
9013
 
8795
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js
9014
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/max-satisfying.js
8796
9015
  var require_max_satisfying = __commonJS({
8797
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
9016
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
8798
9017
  "use strict";
8799
9018
  var SemVer = require_semver();
8800
9019
  var Range = require_range();
@@ -8821,9 +9040,9 @@ var require_max_satisfying = __commonJS({
8821
9040
  }
8822
9041
  });
8823
9042
 
8824
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js
9043
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/min-satisfying.js
8825
9044
  var require_min_satisfying = __commonJS({
8826
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
9045
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
8827
9046
  "use strict";
8828
9047
  var SemVer = require_semver();
8829
9048
  var Range = require_range();
@@ -8850,9 +9069,9 @@ var require_min_satisfying = __commonJS({
8850
9069
  }
8851
9070
  });
8852
9071
 
8853
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js
9072
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/min-version.js
8854
9073
  var require_min_version = __commonJS({
8855
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js"(exports, module) {
9074
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/min-version.js"(exports, module) {
8856
9075
  "use strict";
8857
9076
  var SemVer = require_semver();
8858
9077
  var Range = require_range();
@@ -8909,9 +9128,9 @@ var require_min_version = __commonJS({
8909
9128
  }
8910
9129
  });
8911
9130
 
8912
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js
9131
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/valid.js
8913
9132
  var require_valid2 = __commonJS({
8914
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js"(exports, module) {
9133
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/valid.js"(exports, module) {
8915
9134
  "use strict";
8916
9135
  var Range = require_range();
8917
9136
  var validRange = (range3, options2) => {
@@ -8925,9 +9144,9 @@ var require_valid2 = __commonJS({
8925
9144
  }
8926
9145
  });
8927
9146
 
8928
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js
9147
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/outside.js
8929
9148
  var require_outside = __commonJS({
8930
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js"(exports, module) {
9149
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/outside.js"(exports, module) {
8931
9150
  "use strict";
8932
9151
  var SemVer = require_semver();
8933
9152
  var Comparator = require_comparator();
@@ -8994,9 +9213,9 @@ var require_outside = __commonJS({
8994
9213
  }
8995
9214
  });
8996
9215
 
8997
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js
9216
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/gtr.js
8998
9217
  var require_gtr = __commonJS({
8999
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js"(exports, module) {
9218
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/gtr.js"(exports, module) {
9000
9219
  "use strict";
9001
9220
  var outside = require_outside();
9002
9221
  var gtr = (version, range3, options2) => outside(version, range3, ">", options2);
@@ -9004,9 +9223,9 @@ var require_gtr = __commonJS({
9004
9223
  }
9005
9224
  });
9006
9225
 
9007
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js
9226
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/ltr.js
9008
9227
  var require_ltr = __commonJS({
9009
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js"(exports, module) {
9228
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/ltr.js"(exports, module) {
9010
9229
  "use strict";
9011
9230
  var outside = require_outside();
9012
9231
  var ltr = (version, range3, options2) => outside(version, range3, "<", options2);
@@ -9014,9 +9233,9 @@ var require_ltr = __commonJS({
9014
9233
  }
9015
9234
  });
9016
9235
 
9017
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js
9236
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/intersects.js
9018
9237
  var require_intersects = __commonJS({
9019
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js"(exports, module) {
9238
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/intersects.js"(exports, module) {
9020
9239
  "use strict";
9021
9240
  var Range = require_range();
9022
9241
  var intersects = (r1, r2, options2) => {
@@ -9028,9 +9247,9 @@ var require_intersects = __commonJS({
9028
9247
  }
9029
9248
  });
9030
9249
 
9031
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js
9250
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/simplify.js
9032
9251
  var require_simplify = __commonJS({
9033
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js"(exports, module) {
9252
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/simplify.js"(exports, module) {
9034
9253
  "use strict";
9035
9254
  var satisfies = require_satisfies();
9036
9255
  var compare = require_compare();
@@ -9078,9 +9297,9 @@ var require_simplify = __commonJS({
9078
9297
  }
9079
9298
  });
9080
9299
 
9081
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js
9300
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/subset.js
9082
9301
  var require_subset = __commonJS({
9083
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js"(exports, module) {
9302
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/subset.js"(exports, module) {
9084
9303
  "use strict";
9085
9304
  var Range = require_range();
9086
9305
  var Comparator = require_comparator();
@@ -9240,9 +9459,9 @@ var require_subset = __commonJS({
9240
9459
  }
9241
9460
  });
9242
9461
 
9243
- // node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js
9462
+ // node_modules/.pnpm/semver@7.8.6/node_modules/semver/index.js
9244
9463
  var require_semver2 = __commonJS({
9245
- "node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js"(exports, module) {
9464
+ "node_modules/.pnpm/semver@7.8.6/node_modules/semver/index.js"(exports, module) {
9246
9465
  "use strict";
9247
9466
  var internalRe = require_re();
9248
9467
  var constants = require_constants();
@@ -10256,13 +10475,13 @@ function enumOf(property) {
10256
10475
  }
10257
10476
  function scalarOf(property) {
10258
10477
  const { type } = property;
10259
- const types2 = (Array.isArray(type) ? type : [type]).filter(
10478
+ const types = (Array.isArray(type) ? type : [type]).filter(
10260
10479
  (entry) => entry !== void 0 && entry !== "null"
10261
10480
  );
10262
- if (types2.length === 1 && SCALAR.has(String(types2[0])))
10263
- return String(types2[0]);
10481
+ if (types.length === 1 && SCALAR.has(String(types[0])))
10482
+ return String(types[0]);
10264
10483
  const variants = property.anyOf ?? property.oneOf;
10265
- if (types2.length === 0 && Array.isArray(variants)) {
10484
+ if (types.length === 0 && Array.isArray(variants)) {
10266
10485
  const typed = variants.map(record).filter((variant) => variant.type !== "null" && !("const" in variant));
10267
10486
  if (typed.length === 1) {
10268
10487
  const type2 = scalarOf(typed[0]);
@@ -10270,7 +10489,7 @@ function scalarOf(property) {
10270
10489
  }
10271
10490
  }
10272
10491
  const values = enumOf(property);
10273
- if (types2.length === 0 && values?.length) {
10492
+ if (types.length === 0 && values?.length) {
10274
10493
  const kinds = new Set(values.map((value) => typeof value));
10275
10494
  if (kinds.size === 1) {
10276
10495
  const [kind] = kinds;
@@ -11382,38 +11601,85 @@ function expand_(str, max, maxLength, maxDepth, depth, maxRewrites, isTop) {
11382
11601
  return acc;
11383
11602
  }
11384
11603
 
11385
- // node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js
11386
- var MAX_PATTERN_LENGTH = 1024 * 64;
11387
- var assertValidPattern = (pattern) => {
11388
- if (typeof pattern !== "string") {
11389
- throw new TypeError("invalid pattern");
11604
+ // node_modules/.pnpm/@isaacs+nonrecursive-glob-match@1.1.0/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/numeric-range.js
11605
+ var digit = (a, b) => a === b ? { t: "lit", ch: String(a) } : { t: "class", re: new RegExp(`^[${a}-${b}]$`) };
11606
+ var prefix = (d, alts) => alts.map((s) => [digit(d, d), ...s]);
11607
+ var fixed = (a, b) => {
11608
+ if (!a)
11609
+ return [[]];
11610
+ let lo = +a[0];
11611
+ let hi = +b[0];
11612
+ const ra = a.slice(1);
11613
+ const rb = b.slice(1);
11614
+ if (lo === hi)
11615
+ return prefix(lo, fixed(ra, rb));
11616
+ const zeros = "0".repeat(ra.length);
11617
+ const nines = "9".repeat(ra.length);
11618
+ const out = [];
11619
+ if (ra !== zeros)
11620
+ out.push(...prefix(lo++, fixed(ra, nines)));
11621
+ const last = rb === nines ? [] : prefix(hi--, fixed(zeros, rb));
11622
+ if (lo <= hi) {
11623
+ out.push([digit(lo, hi), ...Array.from(ra, () => digit(0, 9))]);
11390
11624
  }
11391
- if (pattern.length > MAX_PATTERN_LENGTH) {
11392
- throw new TypeError("pattern is too long");
11625
+ out.push(...last);
11626
+ return out;
11627
+ };
11628
+ var nonneg = (a, b, width) => {
11629
+ if (width) {
11630
+ return fixed(String(a).padStart(width, "0"), String(b).padStart(width, "0"));
11393
11631
  }
11632
+ const out = [];
11633
+ for (let len = String(a).length; len <= String(b).length; len++) {
11634
+ const lo = Math.max(a, len === 1 ? 0 : 10 ** (len - 1));
11635
+ const hi = Math.min(b, 10 ** len - 1);
11636
+ out.push(...fixed(String(lo), String(hi)));
11637
+ }
11638
+ return out;
11639
+ };
11640
+ var numericRange = (loStr, hiStr) => {
11641
+ let lo = Number(loStr);
11642
+ let hi = Number(hiStr);
11643
+ if (!Number.isSafeInteger(lo) || !Number.isSafeInteger(hi))
11644
+ return;
11645
+ if (lo > hi)
11646
+ [lo, hi] = [hi, lo];
11647
+ const padded = /^-?0\d/.test(loStr) || /^-?0\d/.test(hiStr);
11648
+ const width = padded ? Math.max(loStr.length, hiStr.length) : 0;
11649
+ const out = [];
11650
+ if (lo < 0) {
11651
+ const neg = nonneg(Math.max(-hi, 1), -lo, width && width - 1);
11652
+ out.push(...neg.map((s) => [{ t: "lit", ch: "-" }, ...s]));
11653
+ }
11654
+ if (hi >= 0)
11655
+ out.push(...nonneg(Math.max(lo, 0), hi, width));
11656
+ return out;
11394
11657
  };
11395
11658
 
11396
- // node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js
11659
+ // node_modules/.pnpm/@isaacs+nonrecursive-glob-match@1.1.0/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.js
11397
11660
  var posixClasses = {
11398
- "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
11399
- "[:alpha:]": ["\\p{L}\\p{Nl}", true],
11400
- "[:ascii:]": ["\\x00-\\x7f", false],
11401
- "[:blank:]": ["\\p{Zs}\\t", true],
11402
- "[:cntrl:]": ["\\p{Cc}", true],
11403
- "[:digit:]": ["\\p{Nd}", true],
11404
- "[:graph:]": ["\\p{Z}\\p{C}", true, true],
11405
- "[:lower:]": ["\\p{Ll}", true],
11661
+ "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}"],
11662
+ "[:alpha:]": ["\\p{L}\\p{Nl}"],
11663
+ "[:ascii:]": ["\\x00-\\x7f"],
11664
+ "[:blank:]": ["\\p{Zs}\\t"],
11665
+ "[:cntrl:]": ["\\p{Cc}"],
11666
+ "[:digit:]": ["\\p{Nd}"],
11667
+ "[:graph:]": ["\\p{Z}\\p{C}", true],
11668
+ "[:lower:]": ["\\p{Ll}"],
11406
11669
  "[:print:]": ["\\p{C}", true],
11407
- "[:punct:]": ["\\p{P}", true],
11408
- "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
11409
- "[:upper:]": ["\\p{Lu}", true],
11410
- "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
11411
- "[:xdigit:]": ["A-Fa-f0-9", false]
11670
+ "[:punct:]": ["\\p{P}\\p{S}"],
11671
+ "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f"],
11672
+ "[:upper:]": ["\\p{Lu}"],
11673
+ "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}"],
11674
+ "[:xdigit:]": ["A-Fa-f0-9"]
11412
11675
  };
11413
11676
  var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
11414
- var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
11415
- var rangesToString = (ranges) => ranges.join("");
11416
- var parseClass = (glob, position) => {
11677
+ var noMatch = /$./;
11678
+ var parseClass = (glob, position, nocase = false, form) => {
11679
+ const norm = (c) => {
11680
+ const n = form ? c.normalize(form) : c;
11681
+ return [...n].length === 1 ? n : c;
11682
+ };
11417
11683
  const pos = position;
11418
11684
  if (glob.charAt(pos) !== "[") {
11419
11685
  throw new Error("not in a brace expression");
@@ -11422,13 +11688,12 @@ var parseClass = (glob, position) => {
11422
11688
  const negs = [];
11423
11689
  let i = pos + 1;
11424
11690
  let sawStart = false;
11425
- let uflag = false;
11426
11691
  let escaping = false;
11427
11692
  let negate = false;
11428
11693
  let endPos = pos;
11429
11694
  let rangeStart = "";
11430
11695
  WHILE: while (i < glob.length) {
11431
- const c = glob.charAt(i);
11696
+ const c = String.fromCodePoint(glob.codePointAt(i));
11432
11697
  if ((c === "!" || c === "^") && i === pos + 1) {
11433
11698
  negate = true;
11434
11699
  i++;
@@ -11447,780 +11712,895 @@ var parseClass = (glob, position) => {
11447
11712
  }
11448
11713
  }
11449
11714
  if (c === "[" && !escaping) {
11450
- for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
11715
+ for (const [cls, [unip, neg]] of Object.entries(posixClasses)) {
11451
11716
  if (glob.startsWith(cls, i)) {
11452
11717
  if (rangeStart) {
11453
- return ["$.", false, glob.length - pos, true];
11718
+ return [noMatch, glob.length - pos];
11454
11719
  }
11455
11720
  i += cls.length;
11456
11721
  if (neg)
11457
11722
  negs.push(unip);
11458
11723
  else
11459
11724
  ranges.push(unip);
11460
- uflag = uflag || u;
11461
11725
  continue WHILE;
11462
11726
  }
11463
11727
  }
11464
11728
  }
11465
11729
  escaping = false;
11730
+ const n = norm(c);
11466
11731
  if (rangeStart) {
11467
- if (c > rangeStart) {
11468
- ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
11469
- } else if (c === rangeStart) {
11470
- ranges.push(braceEscape(c));
11732
+ if (n.codePointAt(0) > rangeStart.codePointAt(0)) {
11733
+ ranges.push(braceEscape(rangeStart) + "-" + braceEscape(n));
11734
+ } else if (n === rangeStart) {
11735
+ ranges.push(braceEscape(n));
11471
11736
  }
11472
11737
  rangeStart = "";
11473
- i++;
11738
+ i += c.length;
11474
11739
  continue;
11475
11740
  }
11476
- if (glob.startsWith("-]", i + 1)) {
11477
- ranges.push(braceEscape(c + "-"));
11478
- i += 2;
11741
+ if (glob.startsWith("-]", i + c.length)) {
11742
+ ranges.push(braceEscape(n + "-"));
11743
+ i += c.length + 1;
11479
11744
  continue;
11480
11745
  }
11481
- if (glob.startsWith("-", i + 1)) {
11482
- rangeStart = c;
11483
- i += 2;
11746
+ if (glob.startsWith("-", i + c.length)) {
11747
+ rangeStart = n;
11748
+ i += c.length + 1;
11484
11749
  continue;
11485
11750
  }
11486
- ranges.push(braceEscape(c));
11487
- i++;
11751
+ ranges.push(braceEscape(n));
11752
+ i += c.length;
11488
11753
  }
11489
11754
  if (endPos < i) {
11490
- return ["", false, 0, false];
11755
+ return [noMatch, 0];
11491
11756
  }
11492
11757
  if (!ranges.length && !negs.length) {
11493
- return ["$.", false, glob.length - pos, true];
11494
- }
11495
- if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
11496
- const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
11497
- return [regexpEscape(r), false, endPos - pos, false];
11758
+ return [noMatch, glob.length - pos];
11498
11759
  }
11499
- const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
11500
- const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
11501
- const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
11502
- return [comb, uflag, endPos - pos, true];
11760
+ const sranges = "[" + (negate ? "^" : "") + ranges.join("") + "]";
11761
+ const snegs = "[" + (negate ? "" : "^") + negs.join("") + "]";
11762
+ const comb = "^" + (ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs);
11763
+ return [new RegExp(comb, nocase ? "iu" : "u"), endPos - pos];
11503
11764
  };
11504
11765
 
11505
- // node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js
11506
- var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
11507
- if (magicalBraces) {
11508
- return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1");
11509
- }
11510
- return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
11766
+ // node_modules/.pnpm/@isaacs+nonrecursive-glob-match@1.1.0/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.js
11767
+ var MATCH = { t: "match", id: 0 };
11768
+ var extTypes = "!?+*@";
11769
+ var lit = (ch) => ({ t: "lit", ch });
11770
+ var reEscape = (s) => s.replace(/[\\^$.*+?()[\]{}|/]/g, "\\$&");
11771
+ var newFoldRe = (s) => new RegExp(`^${reEscape(s)}$`, "iu");
11772
+ var foldCache = /* @__PURE__ */ new Map();
11773
+ var foldRe = (ch) => {
11774
+ let re2 = foldCache.get(ch);
11775
+ if (!re2) {
11776
+ re2 = newFoldRe(ch);
11777
+ if (foldCache.size >= 1e3)
11778
+ foldCache.clear();
11779
+ foldCache.set(ch, re2);
11780
+ }
11781
+ return re2;
11511
11782
  };
11512
-
11513
- // node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js
11514
- var _a;
11515
- var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
11516
- var isExtglobType = (c) => types.has(c);
11517
- var isExtglobAST = (c) => isExtglobType(c.type);
11518
- var adoptionMap = /* @__PURE__ */ new Map([
11519
- ["!", ["@"]],
11520
- ["?", ["?", "@"]],
11521
- ["@", ["@"]],
11522
- ["*", ["*", "+", "?", "@"]],
11523
- ["+", ["+", "@"]]
11524
- ]);
11525
- var adoptionWithSpaceMap = /* @__PURE__ */ new Map([
11526
- ["!", ["?"]],
11527
- ["@", ["?"]],
11528
- ["+", ["?", "*"]]
11529
- ]);
11530
- var adoptionAnyMap = /* @__PURE__ */ new Map([
11531
- ["!", ["?", "@"]],
11532
- ["?", ["?", "@"]],
11533
- ["@", ["?", "@"]],
11534
- ["*", ["*", "+", "?", "@"]],
11535
- ["+", ["+", "@", "?", "*"]]
11536
- ]);
11537
- var usurpMap = /* @__PURE__ */ new Map([
11538
- ["!", /* @__PURE__ */ new Map([["!", "@"]])],
11539
- [
11540
- "?",
11541
- /* @__PURE__ */ new Map([
11542
- ["*", "*"],
11543
- ["+", "*"]
11544
- ])
11545
- ],
11546
- [
11547
- "@",
11548
- /* @__PURE__ */ new Map([
11549
- ["!", "!"],
11550
- ["?", "?"],
11551
- ["@", "@"],
11552
- ["*", "*"],
11553
- ["+", "+"]
11554
- ])
11555
- ],
11556
- [
11557
- "+",
11558
- /* @__PURE__ */ new Map([
11559
- ["?", "*"],
11560
- ["*", "*"]
11561
- ])
11562
- ]
11563
- ]);
11564
- var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
11565
- var startNoDot = "(?!\\.)";
11566
- var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
11567
- var justDots = /* @__PURE__ */ new Set(["..", "."]);
11568
- var reSpecials = new Set("().*{}+?[]^$\\!");
11569
- var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
11570
- var qmark = "[^/]";
11571
- var star = qmark + "*?";
11572
- var starNoEmpty = qmark + "+?";
11573
- var ID = 0;
11574
- var AST = class {
11575
- type;
11576
- #root;
11577
- #hasMagic;
11578
- #uflag = false;
11579
- #parts = [];
11580
- #parent;
11581
- #parentIndex;
11582
- #negs;
11583
- #filledNegs = false;
11584
- #options;
11585
- #toString;
11586
- // set to true if it's an extglob with no children
11587
- // (which really means one child of '')
11588
- #emptyExt = false;
11589
- id = ++ID;
11590
- get depth() {
11591
- return (this.#parent?.depth ?? -1) + 1;
11592
- }
11593
- [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
11594
- return {
11595
- "@@type": "AST",
11596
- id: this.id,
11597
- type: this.type,
11598
- root: this.#root.id,
11599
- parent: this.#parent?.id,
11600
- depth: this.depth,
11601
- partsLength: this.#parts.length,
11602
- parts: this.#parts
11603
- };
11604
- }
11605
- constructor(type, parent, options2 = {}) {
11606
- this.type = type;
11607
- if (type)
11608
- this.#hasMagic = true;
11609
- this.#parent = parent;
11610
- this.#root = this.#parent ? this.#parent.#root : this;
11611
- this.#options = this.#root === this ? options2 : this.#root.#options;
11612
- this.#negs = this.#root === this ? [] : this.#root.#negs;
11613
- if (type === "!" && !this.#root.#filledNegs)
11614
- this.#negs.push(this);
11615
- this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
11616
- }
11617
- get hasMagic() {
11618
- if (this.#hasMagic !== void 0)
11619
- return this.#hasMagic;
11620
- for (const p of this.#parts) {
11621
- if (typeof p === "string")
11622
- continue;
11623
- if (p.type || p.hasMagic)
11624
- return this.#hasMagic = true;
11625
- }
11626
- return this.#hasMagic;
11627
- }
11628
- // reconstructs the pattern
11629
- toString() {
11630
- 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("|") + ")";
11631
- }
11632
- #fillNegs() {
11633
- if (this !== this.#root)
11634
- throw new Error("should only call on root");
11635
- if (this.#filledNegs)
11636
- return this;
11637
- this.toString();
11638
- this.#filledNegs = true;
11639
- let n;
11640
- while (n = this.#negs.pop()) {
11641
- if (n.type !== "!")
11642
- continue;
11643
- let p = n;
11644
- let pp = p.#parent;
11645
- while (pp) {
11646
- for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
11647
- for (const part of n.#parts) {
11648
- if (typeof part === "string") {
11649
- throw new Error("string part in extglob AST??");
11650
- }
11651
- part.copyIn(pp.#parts[i]);
11652
- }
11783
+ var litMatch = (l, c) => {
11784
+ if (c === l.ch)
11785
+ return true;
11786
+ if (!l.re)
11787
+ return false;
11788
+ const code = c.charCodeAt(0);
11789
+ if (code >= 128)
11790
+ return l.re.test(c);
11791
+ const ascii = l.ascii ??= new Uint8Array(128);
11792
+ ascii[code] ||= l.re.test(c) ? 1 : 2;
11793
+ return ascii[code] === 1;
11794
+ };
11795
+ var tokenize = (p, nocase, noext, form, mark) => {
11796
+ const toks = [];
11797
+ for (let i = 0; i < p.length; ) {
11798
+ const c = String.fromCodePoint(p.codePointAt(i));
11799
+ if (mark) {
11800
+ const m = c === "\\" && p.startsWith(mark, i + 1) ? 1 : 0;
11801
+ if (m || c === mark) {
11802
+ const start = i + m + mark.length;
11803
+ const end = p.indexOf(mark, start);
11804
+ const r = /^(-?\d+)\.\.(-?\d+)$/.exec(p.slice(start, end));
11805
+ const alts = end !== -1 && r && numericRange(r[1], r[2]);
11806
+ if (alts) {
11807
+ toks.push({ t: "ext", type: "@", alts });
11808
+ i = end + mark.length;
11809
+ continue;
11653
11810
  }
11654
- p = pp;
11655
- pp = p.#parent;
11656
11811
  }
11657
11812
  }
11658
- return this;
11659
- }
11660
- push(...parts) {
11661
- for (const p of parts) {
11662
- if (p === "")
11813
+ if (c === "\\") {
11814
+ const e = p.codePointAt(i + 1);
11815
+ const ch = e === void 0 ? c : String.fromCodePoint(e);
11816
+ toks.push(lit(ch));
11817
+ i += 1 + ch.length;
11818
+ continue;
11819
+ }
11820
+ if (c === "[") {
11821
+ const [re2, consumed] = parseClass(p, i, nocase, form);
11822
+ if (consumed) {
11823
+ toks.push({ t: "class", re: re2 });
11824
+ i += consumed;
11663
11825
  continue;
11664
- if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
11665
- throw new Error("invalid part: " + p);
11666
11826
  }
11667
- this.#parts.push(p);
11668
11827
  }
11828
+ if (!noext && extTypes.includes(c) && p[i + 1] === "(") {
11829
+ toks.push({ t: "open", type: c });
11830
+ i += 2;
11831
+ continue;
11832
+ }
11833
+ toks.push(!noext && c === "|" ? { t: "bar" } : !noext && c === ")" ? { t: "close" } : c === "*" ? { t: "star" } : c === "?" ? { t: "any" } : lit(c));
11834
+ i += c.length;
11669
11835
  }
11670
- toJSON() {
11671
- const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
11672
- if (this.isStart() && !this.type)
11673
- ret.unshift([]);
11674
- if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!")) {
11675
- ret.push({});
11836
+ return toks;
11837
+ };
11838
+ var pair = (toks) => {
11839
+ const pairs = /* @__PURE__ */ new Map();
11840
+ const stack = [];
11841
+ toks.forEach((tok, i) => {
11842
+ if (tok.t === "open")
11843
+ stack.push(i);
11844
+ else if (tok.t === "close" && stack.length)
11845
+ pairs.set(stack.pop(), i);
11846
+ });
11847
+ return pairs;
11848
+ };
11849
+ var build = (toks, pairs, start, end, top) => {
11850
+ let seq = [];
11851
+ const alts = [seq];
11852
+ for (let i = start; i < end; i++) {
11853
+ const tok = toks[i];
11854
+ const close = pairs.get(i);
11855
+ if (tok.t === "open" && close !== void 0) {
11856
+ const sub = build(toks, pairs, i + 1, close, false);
11857
+ seq.push({ t: "ext", type: tok.type, alts: sub });
11858
+ i = close;
11859
+ } else if (tok.t === "bar" && !top) {
11860
+ alts.push(seq = []);
11861
+ } else if (tok.t === "open") {
11862
+ seq.push(lit(tok.type), lit("("));
11863
+ } else if (tok.t === "bar") {
11864
+ seq.push(lit("|"));
11865
+ } else if (tok.t === "close") {
11866
+ seq.push(lit(")"));
11867
+ } else {
11868
+ seq.push(tok);
11676
11869
  }
11677
- return ret;
11678
11870
  }
11679
- isStart() {
11680
- if (this.#root === this)
11681
- return true;
11682
- if (!this.#parent?.isStart())
11683
- return false;
11684
- if (this.#parentIndex === 0)
11685
- return true;
11686
- const p = this.#parent;
11687
- for (let i = 0; i < this.#parentIndex; i++) {
11688
- const pp = p.#parts[i];
11689
- if (!(pp instanceof _a && pp.type === "!")) {
11690
- return false;
11691
- }
11871
+ return alts;
11872
+ };
11873
+ var normalize = (items, form) => {
11874
+ const out = [];
11875
+ let run = "";
11876
+ const flush = () => {
11877
+ for (const ch of run.normalize(form))
11878
+ out.push(lit(ch));
11879
+ run = "";
11880
+ };
11881
+ for (const it of items) {
11882
+ if (it.t === "lit") {
11883
+ run += it.ch;
11884
+ continue;
11885
+ }
11886
+ flush();
11887
+ out.push(it.t === "ext" ? { ...it, alts: it.alts.map((a) => normalize(a, form)) } : it);
11888
+ }
11889
+ flush();
11890
+ return out;
11891
+ };
11892
+ var compile = (items, nocase) => {
11893
+ let id = 1;
11894
+ const split = (out) => ({ t: "split", id: id++, out });
11895
+ const seq = (items2, next) => items2.reduceRight((next2, it) => item(it, next2), next);
11896
+ const item = (it, next) => {
11897
+ switch (it.t) {
11898
+ case "lit":
11899
+ const re2 = nocase ? foldRe(it.ch) : void 0;
11900
+ return { t: "lit", id: id++, ch: it.ch, re: re2, next };
11901
+ case "any":
11902
+ case "star":
11903
+ return { t: it.t, id: id++, next };
11904
+ case "class":
11905
+ return { t: "class", id: id++, re: it.re, next };
11906
+ }
11907
+ const alts = (next2) => it.alts.map((a) => seq(a, next2));
11908
+ switch (it.type) {
11909
+ case "@":
11910
+ return split(alts(next));
11911
+ case "?":
11912
+ return split([next, ...alts(next)]);
11913
+ case "!":
11914
+ return { t: "neg", id: id++, sub: split(alts(MATCH)), next };
11915
+ }
11916
+ const after = split([]);
11917
+ const entry = split(alts(after));
11918
+ after.out.push(next, entry);
11919
+ return it.type === "*" ? after : entry;
11920
+ };
11921
+ const start = seq(items, MATCH);
11922
+ return [start, id];
11923
+ };
11924
+ var show = (start) => {
11925
+ const lines = [];
11926
+ const seen = /* @__PURE__ */ new Set();
11927
+ const ref = (n) => n.t === "match" ? "match" : String(n.id);
11928
+ const walk = (n, indent) => {
11929
+ if (n.t === "match" || seen.has(n))
11930
+ return;
11931
+ seen.add(n);
11932
+ const line = (desc) => lines.push(`${indent}${n.id}: ${desc}`);
11933
+ switch (n.t) {
11934
+ case "split":
11935
+ line(`split -> ${n.out.map(ref).join(", ")}`);
11936
+ for (const o of n.out)
11937
+ walk(o, indent);
11938
+ return;
11939
+ case "neg":
11940
+ line(`!(${ref(n.sub)}) -> ${ref(n.next)}`);
11941
+ walk(n.sub, indent + " ");
11942
+ return walk(n.next, indent);
11943
+ case "lit":
11944
+ line(`${JSON.stringify(n.ch)} -> ${ref(n.next)}`);
11945
+ break;
11946
+ case "class":
11947
+ line(`${n.re} -> ${ref(n.next)}`);
11948
+ break;
11949
+ default:
11950
+ line(`${n.t === "any" ? "?" : "*"} -> ${ref(n.next)}`);
11692
11951
  }
11952
+ walk(n.next, indent);
11953
+ };
11954
+ walk(start, "");
11955
+ return [`start -> ${ref(start)}`, ...lines].join("\n");
11956
+ };
11957
+ var State = class {
11958
+ // set by the Sim, to mark the nodes that this state has
11959
+ gen;
11960
+ threads = [];
11961
+ match = false;
11962
+ runs = [];
11963
+ // the sorted ids of the threads, with 0 for a match, once the
11964
+ // state is done
11965
+ ids = [];
11966
+ constructor(gen) {
11967
+ this.gen = gen;
11968
+ }
11969
+ // no threads, so nothing more can match
11970
+ get dead() {
11971
+ return !this.threads.length && !this.match && !this.runs.length;
11972
+ }
11973
+ };
11974
+ var sameState = (a, b) => {
11975
+ if (a.ids.length !== b.ids.length)
11976
+ return false;
11977
+ if (a.runs.length !== b.runs.length)
11978
+ return false;
11979
+ if (a.ids.some((id, i) => id !== b.ids[i]))
11980
+ return false;
11981
+ return a.runs.every((r) => b.runs.some((o) => o.neg === r.neg && sameState(o.state, r.state)));
11982
+ };
11983
+ var marks = (size) => ({
11984
+ has: new Float64Array(size),
11985
+ seen: new Float64Array(size),
11986
+ gen: 0
11987
+ });
11988
+ var Sim = class {
11989
+ // `.` and `..` only match literal dots, even with `dot:true`
11990
+ dots;
11991
+ // the string starts with `.`, and `dot:true` is not set
11992
+ dotStart;
11993
+ #marks;
11994
+ constructor(dots, dotStart, marks2) {
11995
+ this.dots = dots;
11996
+ this.dotStart = dotStart;
11997
+ this.#marks = marks2;
11998
+ }
11999
+ state() {
12000
+ return new State(++this.#marks.gen);
12001
+ }
12002
+ // sort the ids of a state, once it has all of its threads
12003
+ done(state) {
12004
+ state.ids = state.threads.map((n) => n.id).sort((a, b) => a - b);
12005
+ if (state.match)
12006
+ state.ids.unshift(MATCH.id);
12007
+ return state;
12008
+ }
12009
+ // true the first time that the state walks through the node, so
12010
+ // that loops in the graph stop
12011
+ #visit(state, node) {
12012
+ const { seen } = this.#marks;
12013
+ if (seen[node.id] === state.gen)
12014
+ return false;
12015
+ seen[node.id] = state.gen;
11693
12016
  return true;
11694
12017
  }
11695
- isEnd() {
11696
- if (this.#root === this)
11697
- return true;
11698
- if (this.#parent?.type === "!")
11699
- return true;
11700
- if (!this.#parent?.isEnd())
12018
+ #addThread(state, node) {
12019
+ const { has } = this.#marks;
12020
+ if (has[node.id] === state.gen)
11701
12021
  return false;
11702
- if (!this.type)
11703
- return this.#parent?.isEnd();
11704
- const pl = this.#parent ? this.#parent.#parts.length : 0;
11705
- return this.#parentIndex === pl - 1;
11706
- }
11707
- copyIn(part) {
11708
- if (typeof part === "string")
11709
- this.push(part);
11710
- else
11711
- this.push(part.clone(this));
11712
- }
11713
- clone(parent) {
11714
- const c = new _a(this.type, parent);
11715
- for (const p of this.#parts) {
11716
- c.copyIn(p);
11717
- }
11718
- return c;
11719
- }
11720
- static #parseAST(str, ast, pos, opt, extDepth) {
11721
- const maxDepth = opt.maxExtglobRecursion ?? 2;
11722
- let escaping = false;
11723
- let inBrace = false;
11724
- let braceStart = -1;
11725
- let braceNeg = false;
11726
- if (ast.type === null) {
11727
- let i2 = pos;
11728
- let acc2 = "";
11729
- while (i2 < str.length) {
11730
- const c = str.charAt(i2++);
11731
- if (escaping || c === "\\") {
11732
- escaping = !escaping;
11733
- acc2 += c;
11734
- continue;
11735
- }
11736
- if (inBrace) {
11737
- if (i2 === braceStart + 1) {
11738
- if (c === "^" || c === "!") {
11739
- braceNeg = true;
11740
- }
11741
- } else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
11742
- inBrace = false;
11743
- }
11744
- acc2 += c;
11745
- continue;
11746
- } else if (c === "[") {
11747
- inBrace = true;
11748
- braceStart = i2;
11749
- braceNeg = false;
11750
- acc2 += c;
11751
- continue;
11752
- }
11753
- const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth;
11754
- if (doRecurse) {
11755
- ast.push(acc2);
11756
- acc2 = "";
11757
- const ext2 = new _a(c, ast);
11758
- i2 = _a.#parseAST(str, ext2, i2, opt, extDepth + 1);
11759
- ast.push(ext2);
11760
- continue;
11761
- }
11762
- acc2 += c;
11763
- }
11764
- ast.push(acc2);
11765
- return i2;
12022
+ has[node.id] = state.gen;
12023
+ state.threads.push(node);
12024
+ return true;
12025
+ }
12026
+ // wildcards only match a leading dot if `dot:true`. In a negated
12027
+ // sub-pattern, this does not apply, because the negation itself
12028
+ // can not match a leading dot.
12029
+ restricted(i, top) {
12030
+ return top && (this.dots || this.dotStart && i === 0);
12031
+ }
12032
+ add(state, node, i, top) {
12033
+ switch (node.t) {
12034
+ case "split":
12035
+ if (!this.#visit(state, node))
12036
+ return;
12037
+ for (const o of node.out)
12038
+ this.add(state, o, i, top);
12039
+ return;
12040
+ case "neg":
12041
+ if (!this.#visit(state, node))
12042
+ return;
12043
+ const sub = this.state();
12044
+ this.add(sub, node.sub, i, false);
12045
+ this.done(sub);
12046
+ return this.addRun(state, { t: "run", neg: node, state: sub }, i, top);
12047
+ case "star":
12048
+ if (this.restricted(i, top))
12049
+ return;
12050
+ if (this.#addThread(state, node))
12051
+ this.add(state, node.next, i, top);
12052
+ return;
12053
+ case "match":
12054
+ state.match = true;
12055
+ return;
12056
+ default:
12057
+ this.#addThread(state, node);
11766
12058
  }
11767
- let i = pos + 1;
11768
- let part = new _a(null, ast);
11769
- const parts = [];
11770
- let acc = "";
11771
- while (i < str.length) {
11772
- const c = str.charAt(i++);
11773
- if (escaping || c === "\\") {
11774
- escaping = !escaping;
11775
- acc += c;
11776
- continue;
11777
- }
11778
- if (inBrace) {
11779
- if (i === braceStart + 1) {
11780
- if (c === "^" || c === "!") {
11781
- braceNeg = true;
12059
+ }
12060
+ addRun(state, run, i, top) {
12061
+ for (const r of state.runs) {
12062
+ if (r.neg === run.neg && sameState(r.state, run.state))
12063
+ return;
12064
+ }
12065
+ state.runs.push(run);
12066
+ if (!run.state.match) {
12067
+ this.add(state, run.neg.next, i, top);
12068
+ }
12069
+ }
12070
+ // the threads after char `c`, at index `i`
12071
+ step(state, c, i, top) {
12072
+ const next = this.state();
12073
+ for (const th of state.threads) {
12074
+ switch (th.t) {
12075
+ case "lit":
12076
+ if (litMatch(th, c)) {
12077
+ this.add(next, th.next, i + 1, top);
11782
12078
  }
11783
- } else if (c === "]" && !(i === braceStart + 2 && braceNeg)) {
11784
- inBrace = false;
11785
- }
11786
- acc += c;
11787
- continue;
11788
- } else if (c === "[") {
11789
- inBrace = true;
11790
- braceStart = i;
11791
- braceNeg = false;
11792
- acc += c;
11793
- continue;
11794
- }
11795
- const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
11796
- (extDepth <= maxDepth || ast && ast.#canAdoptType(c));
11797
- if (doRecurse) {
11798
- const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
11799
- part.push(acc);
11800
- acc = "";
11801
- const ext2 = new _a(c, part);
11802
- part.push(ext2);
11803
- i = _a.#parseAST(str, ext2, i, opt, extDepth + depthAdd);
11804
- continue;
11805
- }
11806
- if (c === "|") {
11807
- part.push(acc);
11808
- acc = "";
11809
- parts.push(part);
11810
- part = new _a(null, ast);
11811
- continue;
12079
+ break;
12080
+ case "any":
12081
+ if (!this.restricted(i, top))
12082
+ this.add(next, th.next, i + 1, top);
12083
+ break;
12084
+ case "class":
12085
+ if (!this.restricted(i, top) && th.re.test(c)) {
12086
+ this.add(next, th.next, i + 1, top);
12087
+ }
12088
+ break;
12089
+ case "star":
12090
+ if (!this.restricted(i, top))
12091
+ this.add(next, th, i + 1, top);
11812
12092
  }
11813
- if (c === ")") {
11814
- if (acc === "" && ast.#parts.length === 0) {
11815
- ast.#emptyExt = true;
12093
+ }
12094
+ if (!this.restricted(i, top)) {
12095
+ for (const run of state.runs) {
12096
+ if (run.state.dead) {
12097
+ this.addRun(next, run, i + 1, top);
12098
+ continue;
11816
12099
  }
11817
- part.push(acc);
11818
- acc = "";
11819
- ast.push(...parts, part);
11820
- return i;
12100
+ const sub = this.step(run.state, c, i, false);
12101
+ this.addRun(next, { t: "run", neg: run.neg, state: sub }, i + 1, top);
11821
12102
  }
11822
- acc += c;
11823
12103
  }
11824
- ast.type = null;
11825
- ast.#hasMagic = void 0;
11826
- ast.#parts = [str.substring(pos - 1)];
11827
- return i;
12104
+ return this.done(next);
11828
12105
  }
11829
- #canAdoptWithSpace(child) {
11830
- return this.#canAdopt(child, adoptionWithSpaceMap);
12106
+ };
12107
+ var stateKey = (state) => {
12108
+ const ids = state.ids.join();
12109
+ if (!state.runs.length)
12110
+ return ids;
12111
+ const runs = state.runs.map((r) => `${r.neg.id}(${stateKey(r.state)})`);
12112
+ return `${ids}|${runs.sort().join("|")}`;
12113
+ };
12114
+ var DFA_BUDGET = 1 << 18;
12115
+ var Dfa = class {
12116
+ #start;
12117
+ #states = /* @__PURE__ */ new Map();
12118
+ #size = 0;
12119
+ #plain;
12120
+ #dotStart;
12121
+ #sim;
12122
+ #dotSim;
12123
+ constructor(start, marks2) {
12124
+ this.#start = start;
12125
+ this.#sim = new Sim(false, false, marks2);
12126
+ this.#dotSim = new Sim(false, true, marks2);
12127
+ }
12128
+ #make(state) {
12129
+ return {
12130
+ state,
12131
+ match: state.match,
12132
+ dead: state.dead,
12133
+ next: /* @__PURE__ */ new Map()
12134
+ };
11831
12135
  }
11832
- #canAdopt(child, map = adoptionMap) {
11833
- if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
11834
- return false;
11835
- }
11836
- const gc = child.#parts[0];
11837
- if (!gc || typeof gc !== "object" || gc.type === null) {
11838
- return false;
12136
+ #intern(state) {
12137
+ const key = stateKey(state);
12138
+ const found = this.#states.get(key);
12139
+ if (found)
12140
+ return found;
12141
+ if (this.#size > DFA_BUDGET)
12142
+ this.#clear();
12143
+ const d = this.#make(state);
12144
+ this.#states.set(key, d);
12145
+ this.#size += key.length + 1;
12146
+ return d;
12147
+ }
12148
+ #clear() {
12149
+ this.#states.clear();
12150
+ this.#size = 0;
12151
+ this.#plain = void 0;
12152
+ this.#dotStart = void 0;
12153
+ }
12154
+ start(dotStart) {
12155
+ if (dotStart) {
12156
+ if (this.#dotStart)
12157
+ return this.#dotStart;
12158
+ const state2 = this.#dotSim.state();
12159
+ this.#dotSim.add(state2, this.#start, 0, true);
12160
+ return this.#dotStart = this.#make(this.#dotSim.done(state2));
12161
+ }
12162
+ if (this.#plain)
12163
+ return this.#plain;
12164
+ const state = this.#sim.state();
12165
+ this.#sim.add(state, this.#start, 0, true);
12166
+ return this.#plain = this.#intern(this.#sim.done(state));
12167
+ }
12168
+ // the next state, after a miss in `d.ascii`
12169
+ next(d, c) {
12170
+ const code = c.charCodeAt(0);
12171
+ const found = code < 128 ? void 0 : d.next.get(c);
12172
+ if (found)
12173
+ return found;
12174
+ const n = d === this.#dotStart ? this.#intern(this.#dotSim.step(d.state, c, 0, true)) : this.#intern(this.#sim.step(d.state, c, 1, true));
12175
+ if (code < 128) {
12176
+ if (!d.ascii) {
12177
+ d.ascii = new Array(128);
12178
+ this.#size += 128;
12179
+ }
12180
+ d.ascii[code] = n;
12181
+ } else {
12182
+ d.next.set(c, n);
11839
12183
  }
11840
- return this.#canAdoptType(gc.type, map);
12184
+ this.#size++;
12185
+ return n;
11841
12186
  }
11842
- #canAdoptType(c, map = adoptionAnyMap) {
11843
- return !!map.get(this.type)?.includes(c);
11844
- }
11845
- #adoptWithSpace(child, index) {
11846
- const gc = child.#parts[0];
11847
- const blank = new _a(null, gc, this.options);
11848
- blank.#parts.push("");
11849
- gc.push(blank);
11850
- this.#adopt(child, index);
12187
+ };
12188
+ var linear = (start) => {
12189
+ const nodes = [];
12190
+ for (let n = start; n.t !== "match"; n = n.next) {
12191
+ if (n.t === "split" || n.t === "neg")
12192
+ return void 0;
12193
+ nodes.push(n);
11851
12194
  }
11852
- #adopt(child, index) {
11853
- const gc = child.#parts[0];
11854
- this.#parts.splice(index, 1, ...gc.#parts);
11855
- for (const p of gc.#parts) {
11856
- if (typeof p === "object")
11857
- p.#parent = this;
12195
+ return nodes;
12196
+ };
12197
+ var testLinear = (nodes, chars, start, end) => {
12198
+ let ni = 0;
12199
+ let ci = start;
12200
+ let starNi = -1;
12201
+ let starCi = 0;
12202
+ while (ci < end) {
12203
+ const n = nodes[ni];
12204
+ if (n?.t === "star") {
12205
+ starNi = ni++;
12206
+ starCi = ci;
12207
+ continue;
11858
12208
  }
11859
- this.#toString = void 0;
11860
- }
11861
- #canUsurpType(c) {
11862
- const m = usurpMap.get(this.type);
11863
- return !!m?.has(c);
11864
- }
11865
- #canUsurp(child) {
11866
- if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
11867
- return false;
12209
+ const c = chars[ci];
12210
+ if (n && (n.t === "any" || n.t === "lit" && litMatch(n, c) || n.t === "class" && n.re.test(c))) {
12211
+ ni++;
12212
+ ci++;
12213
+ continue;
11868
12214
  }
11869
- const gc = child.#parts[0];
11870
- if (!gc || typeof gc !== "object" || gc.type === null) {
12215
+ if (starNi === -1)
11871
12216
  return false;
11872
- }
11873
- return this.#canUsurpType(gc.type);
12217
+ ni = starNi + 1;
12218
+ ci = ++starCi;
11874
12219
  }
11875
- #usurp(child) {
11876
- const m = usurpMap.get(this.type);
11877
- const gc = child.#parts[0];
11878
- const nt = m?.get(gc.type);
11879
- if (!nt)
12220
+ while (nodes[ni]?.t === "star")
12221
+ ni++;
12222
+ return ni === nodes.length;
12223
+ };
12224
+ var lengths = (items) => {
12225
+ let min = 0;
12226
+ let max = 0;
12227
+ for (const it of items) {
12228
+ const [lo, hi] = itemLengths(it);
12229
+ min += lo;
12230
+ max += hi;
12231
+ }
12232
+ return [min, max];
12233
+ };
12234
+ var itemLengths = (it) => {
12235
+ if (it.t === "star")
12236
+ return [0, Infinity];
12237
+ if (it.t !== "ext")
12238
+ return [1, 1];
12239
+ if (it.type === "!")
12240
+ return [0, Infinity];
12241
+ const alts = it.alts.map(lengths);
12242
+ const min = Math.min(...alts.map((a) => a[0]));
12243
+ const max = Math.max(...alts.map((a) => a[1]));
12244
+ const loop = max === 0 ? 0 : Infinity;
12245
+ return it.type === "@" ? [min, max] : it.type === "?" ? [0, max] : it.type === "*" ? [0, loop] : [min, loop];
12246
+ };
12247
+ var hasAffix = (lits, chars, start) => {
12248
+ for (let j = 0; j < lits.length; j++) {
12249
+ if (!litMatch(lits[j], chars[start + j]))
11880
12250
  return false;
11881
- this.#parts = gc.#parts;
11882
- for (const p of this.#parts) {
11883
- if (typeof p === "object") {
11884
- p.#parent = this;
11885
- }
11886
- }
11887
- this.type = nt;
11888
- this.#toString = void 0;
11889
- this.#emptyExt = false;
11890
- }
11891
- static fromGlob(pattern, options2 = {}) {
11892
- const ast = new _a(null, void 0, options2);
11893
- _a.#parseAST(pattern, ast, 0, options2, 0);
11894
- return ast;
11895
- }
11896
- // returns the regular expression if there's magic, or the unescaped
11897
- // string if not.
11898
- toMMPattern() {
11899
- if (this !== this.#root)
11900
- return this.#root.toMMPattern();
11901
- const glob = this.toString();
11902
- const [re2, body, hasMagic, uflag] = this.toRegExpSource();
11903
- const anyMagic = hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
11904
- if (!anyMagic) {
11905
- return body;
11906
- }
11907
- const flags = (this.#options.nocase ? "i" : "") + (uflag ? "u" : "");
11908
- return Object.assign(new RegExp(`^${re2}$`, flags), {
11909
- _src: re2,
11910
- _glob: glob
11911
- });
11912
12251
  }
11913
- get options() {
11914
- return this.#options;
11915
- }
11916
- // returns the string match, the regexp source, whether there's magic
11917
- // in the regexp (so a regular expression is required) and whether or
11918
- // not the uflag is needed for the regular expression (for posix classes)
11919
- // TODO: instead of injecting the start/end at this point, just return
11920
- // the BODY of the regexp, along with the start/end portions suitable
11921
- // for binding the start/end in either a joined full-path makeRe context
11922
- // (where we bind to (^|/), or a standalone matchPart context (where
11923
- // we bind to ^, and not /). Otherwise slashes get duped!
11924
- //
11925
- // In part-matching mode, the start is:
11926
- // - if not isStart: nothing
11927
- // - if traversal possible, but not allowed: ^(?!\.\.?$)
11928
- // - if dots allowed or not possible: ^
11929
- // - if dots possible and not allowed: ^(?!\.)
11930
- // end is:
11931
- // - if not isEnd(): nothing
11932
- // - else: $
11933
- //
11934
- // In full-path matching mode, we put the slash at the START of the
11935
- // pattern, so start is:
11936
- // - if first pattern: same as part-matching mode
11937
- // - if not isStart(): nothing
11938
- // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
11939
- // - if dots allowed or not possible: /
11940
- // - if dots possible and not allowed: /(?!\.)
11941
- // end is:
11942
- // - if last pattern, same as part-matching mode
11943
- // - else nothing
11944
- //
11945
- // Always put the (?:$|/) on negated tails, though, because that has to be
11946
- // there to bind the end of the negated pattern portion, and it's easier to
11947
- // just stick it in now rather than try to inject it later in the middle of
11948
- // the pattern.
11949
- //
11950
- // We can just always return the same end, and leave it up to the caller
11951
- // to know whether it's going to be used joined or in parts.
11952
- // And, if the start is adjusted slightly, can do the same there:
11953
- // - if not isStart: nothing
11954
- // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
11955
- // - if dots allowed or not possible: (?:/|^)
11956
- // - if dots possible and not allowed: (?:/|^)(?!\.)
11957
- //
11958
- // But it's better to have a simpler binding without a conditional, for
11959
- // performance, so probably better to return both start options.
11960
- //
11961
- // Then the caller just ignores the end if it's not the first pattern,
11962
- // and the start always gets applied.
11963
- //
11964
- // But that's always going to be $ if it's the ending pattern, or nothing,
11965
- // so the caller can just attach $ at the end of the pattern when building.
11966
- //
11967
- // So the todo is:
11968
- // - better detect what kind of start is needed
11969
- // - return both flavors of starting pattern
11970
- // - attach $ at the end of the pattern when creating the actual RegExp
11971
- //
11972
- // Ah, but wait, no, that all only applies to the root when the first pattern
11973
- // is not an extglob. If the first pattern IS an extglob, then we need all
11974
- // that dot prevention biz to live in the extglob portions, because eg
11975
- // +(*|.x*) can match .xy but not .yx.
11976
- //
11977
- // So, return the two flavors if it's #root and the first child is not an
11978
- // AST, otherwise leave it to the child AST to handle it, and there,
11979
- // use the (?:^|/) style of start binding.
11980
- //
11981
- // Even simplified further:
11982
- // - Since the start for a join is eg /(?!\.) and the start for a part
11983
- // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
11984
- // or start or whatever) and prepend ^ or / at the Regexp construction.
11985
- toRegExpSource(allowDot) {
11986
- const dot = allowDot ?? !!this.#options.dot;
11987
- if (this.#root === this) {
11988
- this.#flatten();
11989
- this.#fillNegs();
11990
- }
11991
- if (!isExtglobAST(this)) {
11992
- const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
11993
- const src = this.#parts.map((p) => {
11994
- const [re2, _, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
11995
- this.#hasMagic = this.#hasMagic || hasMagic;
11996
- this.#uflag = this.#uflag || uflag;
11997
- return re2;
11998
- }).join("");
11999
- let start2 = "";
12000
- if (this.isStart()) {
12001
- if (typeof this.#parts[0] === "string") {
12002
- const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
12003
- if (!dotTravAllowed) {
12004
- const aps = addPatternStart;
12005
- const needNoTrav = (
12006
- // dots are allowed, and the pattern starts with [ or .
12007
- dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
12008
- src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
12009
- src.startsWith("\\.\\.") && aps.has(src.charAt(4))
12010
- );
12011
- const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
12012
- start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
12013
- }
12014
- }
12015
- }
12016
- let end = "";
12017
- if (this.isEnd() && this.#root.#filledNegs && this.#parent?.type === "!") {
12018
- end = "(?:$|\\/)";
12019
- }
12020
- const final2 = start2 + src + end;
12021
- return [
12022
- final2,
12023
- unescape(src),
12024
- this.#hasMagic = !!this.#hasMagic,
12025
- this.#uflag
12026
- ];
12252
+ return true;
12253
+ };
12254
+ var slashOrSurrogate = /[/\ud800-\udfff]/;
12255
+ var surrogate = /[\ud800-\udfff]/;
12256
+ var codePoints = (s) => surrogate.test(s) ? [...s] : s;
12257
+ var noSlash = (s) => {
12258
+ if (s.includes("/")) {
12259
+ throw new Error("can only match a single path portion, got: " + s);
12260
+ }
12261
+ };
12262
+ var Matcher = class {
12263
+ pattern;
12264
+ options;
12265
+ #start;
12266
+ // the number of node ids
12267
+ #size;
12268
+ #marks;
12269
+ // the Sim for strings that are only `.` or `..`
12270
+ #dotsSim;
12271
+ // the string to compare, if the pattern has no magic. With
12272
+ // `nocase:true`, the RegExp that folds case is made when it is
12273
+ // first used.
12274
+ #literal;
12275
+ #literalFold = false;
12276
+ #literalRe;
12277
+ // the nodes between the prefix and suffix, if the graph is a
12278
+ // single chain
12279
+ #linear;
12280
+ // the linear nodes are only `*` and `?`, so the length bounds and
12281
+ // the prefix and suffix decide the match
12282
+ #wild = false;
12283
+ // the least and most chars that a match can have
12284
+ #min = 0;
12285
+ #max = Infinity;
12286
+ // the literals that a match must start and end with. Each one
12287
+ // matches exactly one char, and they are distinct items in the
12288
+ // pattern, so a string that does not have them can not match.
12289
+ #prefix = [];
12290
+ #suffix = [];
12291
+ // the prefix and suffix as strings, if they do not fold case
12292
+ #prefixStr;
12293
+ #suffixStr;
12294
+ // there is a prefix or suffix to check
12295
+ #affix = false;
12296
+ #dfa;
12297
+ #form;
12298
+ constructor(pattern, options2 = {}) {
12299
+ if (pattern.includes("/")) {
12300
+ throw new Error("can only match a single path portion, got pattern: " + pattern);
12027
12301
  }
12028
- const repeated = this.type === "*" || this.type === "+";
12029
- const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
12030
- let body = this.#partsToRegExp(dot);
12031
- if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
12032
- const s = this.toString();
12033
- const me = this;
12034
- me.#parts = [s];
12035
- me.type = null;
12036
- me.#hasMagic = void 0;
12037
- return [s, unescape(this.toString()), false, false];
12038
- }
12039
- let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
12040
- if (bodyDotAllowed === body) {
12041
- bodyDotAllowed = "";
12042
- }
12043
- if (bodyDotAllowed) {
12044
- body = `(?:${body})(?:${bodyDotAllowed})*?`;
12045
- }
12046
- let final = "";
12047
- if (this.type === "!" && this.#emptyExt) {
12048
- final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
12302
+ this.pattern = pattern;
12303
+ this.options = options2;
12304
+ const { nocase = false, noext = false, normalize: n } = options2;
12305
+ this.#form = n === true ? "NFC" : n || void 0;
12306
+ const literal2 = /^[?*+@]\(\)$/.test(pattern);
12307
+ const toks = tokenize(pattern, nocase, noext || literal2, this.#form, options2.rangeMark);
12308
+ let [items] = build(toks, pair(toks), 0, toks.length, true);
12309
+ if (this.#form)
12310
+ items = normalize(items, this.#form);
12311
+ const [start, size] = compile(items, nocase);
12312
+ this.#start = start;
12313
+ this.#size = size;
12314
+ if (items.every((it) => it.t === "lit")) {
12315
+ this.#literal = items.map((it) => it.ch).join("");
12316
+ this.#literalFold = nocase;
12049
12317
  } else {
12050
- const close = this.type === "!" ? (
12051
- // !() must match something,but !(x) can match ''
12052
- "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
12053
- ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
12054
- final = start + body + close;
12055
- }
12056
- return [
12057
- final,
12058
- unescape(body),
12059
- this.#hasMagic = !!this.#hasMagic,
12060
- this.#uflag
12061
- ];
12062
- }
12063
- #flatten() {
12064
- if (!isExtglobAST(this)) {
12065
- for (const p of this.#parts) {
12066
- if (typeof p === "object") {
12067
- p.#flatten();
12068
- }
12318
+ const lit2 = (it) => it.t !== "lit" ? void 0 : nocase ? { ch: it.ch, re: foldRe(it.ch) } : { ch: it.ch };
12319
+ for (const it of items) {
12320
+ const l = lit2(it);
12321
+ if (!l)
12322
+ break;
12323
+ this.#prefix.push(l);
12069
12324
  }
12070
- } else {
12071
- let iterations = 0;
12072
- let done = false;
12073
- do {
12074
- done = true;
12075
- for (let i = 0; i < this.#parts.length; i++) {
12076
- const c = this.#parts[i];
12077
- if (typeof c === "object") {
12078
- c.#flatten();
12079
- if (this.#canAdopt(c)) {
12080
- done = false;
12081
- this.#adopt(c, i);
12082
- } else if (this.#canAdoptWithSpace(c)) {
12083
- done = false;
12084
- this.#adoptWithSpace(c, i);
12085
- } else if (this.#canUsurp(c)) {
12086
- done = false;
12087
- this.#usurp(c);
12088
- }
12089
- }
12090
- }
12091
- } while (!done && ++iterations < 10);
12325
+ for (let j = items.length - 1; j >= 0; j--) {
12326
+ const l = lit2(items[j]);
12327
+ if (!l)
12328
+ break;
12329
+ this.#suffix.unshift(l);
12330
+ }
12331
+ this.#affix = !!(this.#prefix.length || this.#suffix.length);
12332
+ if (!nocase) {
12333
+ this.#prefixStr = this.#prefix.map((l) => l.ch).join("");
12334
+ this.#suffixStr = this.#suffix.map((l) => l.ch).join("");
12335
+ }
12336
+ this.#linear = linear(this.#start)?.slice(this.#prefix.length, -this.#suffix.length || void 0);
12337
+ this.#wild = !!this.#linear?.every((n2) => n2.t === "star" || n2.t === "any");
12338
+ const [min, max] = lengths(items);
12339
+ this.#min = min;
12340
+ this.#max = max;
12092
12341
  }
12093
- this.#toString = void 0;
12094
12342
  }
12095
- #partsToRegExp(dot) {
12096
- return this.#parts.map((p) => {
12097
- if (typeof p === "string") {
12098
- throw new Error("string type in extglob ast??");
12099
- }
12100
- const [re2, _, _hasMagic, uflag] = p.toRegExpSource(dot);
12101
- this.#uflag = this.#uflag || uflag;
12102
- return re2;
12103
- }).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
12343
+ test(s) {
12344
+ if (this.#form) {
12345
+ noSlash(s);
12346
+ return this.#test(s.normalize(this.#form));
12347
+ }
12348
+ if (slashOrSurrogate.test(s)) {
12349
+ noSlash(s);
12350
+ return this.#test(s, [...s]);
12351
+ }
12352
+ return this.#test(s, s);
12104
12353
  }
12105
- static #parseGlob(glob, hasMagic, noEmpty = false) {
12106
- let escaping = false;
12107
- let re2 = "";
12108
- let uflag = false;
12109
- let inStar = false;
12110
- for (let i = 0; i < glob.length; i++) {
12111
- const c = glob.charAt(i);
12112
- if (escaping) {
12113
- escaping = false;
12114
- re2 += (reSpecials.has(c) ? "\\" : "") + c;
12115
- continue;
12116
- }
12117
- if (c === "*") {
12118
- if (inStar)
12119
- continue;
12120
- inStar = true;
12121
- re2 += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
12122
- hasMagic = true;
12123
- continue;
12124
- } else {
12125
- inStar = false;
12126
- }
12127
- if (c === "\\") {
12128
- if (i === glob.length - 1) {
12129
- re2 += "\\\\";
12130
- } else {
12131
- escaping = true;
12354
+ /**
12355
+ * The same as {@link Matcher#test}, but the string is not checked
12356
+ * for `/` chars, so the result for a string that has one is not
12357
+ * defined. Only use it for a string that is known to be one path
12358
+ * portion, such as a part of a path that was split on `/`. It can
12359
+ * be faster, because some patterns do not need to look at each char
12360
+ * of the string.
12361
+ */
12362
+ testUnchecked(s) {
12363
+ return this.#test(this.#form ? s.normalize(this.#form) : s);
12364
+ }
12365
+ // Test a string that has no `/`. `chars` indexes it by code point.
12366
+ // If it is not given, it is only found if a step needs it.
12367
+ #test(s, chars) {
12368
+ if (this.#literal !== void 0) {
12369
+ return this.#literalFold ? (this.#literalRe ??= newFoldRe(this.#literal)).test(s) : s === this.#literal;
12370
+ }
12371
+ const min = this.#min;
12372
+ const max = this.#max;
12373
+ if (chars === void 0) {
12374
+ const most = s.length;
12375
+ const least = most + 1 >> 1;
12376
+ if (most < min || least > max)
12377
+ return false;
12378
+ if (least < min || most > max)
12379
+ chars = codePoints(s);
12380
+ }
12381
+ if (chars !== void 0 && (chars.length < min || chars.length > max)) {
12382
+ return false;
12383
+ }
12384
+ const prefix2 = this.#prefix.length;
12385
+ if (this.#affix) {
12386
+ if (this.#prefixStr !== void 0 && this.#suffixStr !== void 0) {
12387
+ if (!s.startsWith(this.#prefixStr) || !s.endsWith(this.#suffixStr)) {
12388
+ return false;
12132
12389
  }
12133
- continue;
12134
- }
12135
- if (c === "[") {
12136
- const [src, needUflag, consumed, magic] = parseClass(glob, i);
12137
- if (consumed) {
12138
- re2 += src;
12139
- uflag = uflag || needUflag;
12140
- i += consumed - 1;
12141
- hasMagic = hasMagic || magic;
12142
- continue;
12390
+ } else {
12391
+ chars ??= codePoints(s);
12392
+ const end = chars.length - this.#suffix.length;
12393
+ if (!hasAffix(this.#prefix, chars, 0) || !hasAffix(this.#suffix, chars, end)) {
12394
+ return false;
12143
12395
  }
12144
12396
  }
12145
- if (c === "?") {
12146
- re2 += qmark;
12147
- hasMagic = true;
12148
- continue;
12149
- }
12150
- re2 += regExpEscape(c);
12151
12397
  }
12152
- return [re2, unescape(glob), !!hasMagic, uflag];
12398
+ const dotStart = !this.options.dot && s.startsWith(".");
12399
+ if (this.#linear) {
12400
+ if (s === "." || s === "..")
12401
+ return false;
12402
+ if (dotStart && !prefix2)
12403
+ return false;
12404
+ if (this.#wild)
12405
+ return true;
12406
+ chars ??= codePoints(s);
12407
+ const end = chars.length - this.#suffix.length;
12408
+ return testLinear(this.#linear, chars, prefix2, end);
12409
+ }
12410
+ chars ??= codePoints(s);
12411
+ if (s === "." || s === "..") {
12412
+ this.#marks ??= marks(this.#size);
12413
+ const sim = this.#dotsSim ??= new Sim(true, false, this.#marks);
12414
+ const start = sim.state();
12415
+ sim.add(start, this.#start, 0, true);
12416
+ let state = sim.done(start);
12417
+ for (let i = 0; i < chars.length; i++) {
12418
+ state = sim.step(state, chars[i], i, true);
12419
+ }
12420
+ return state.match;
12421
+ }
12422
+ this.#marks ??= marks(this.#size);
12423
+ const dfa = this.#dfa ??= new Dfa(this.#start, this.#marks);
12424
+ let d = dfa.start(dotStart);
12425
+ const str = chars === s;
12426
+ for (let i = 0; i < chars.length; i++) {
12427
+ if (d.dead)
12428
+ return false;
12429
+ const code = str ? s.charCodeAt(i) : chars[i].charCodeAt(0);
12430
+ d = d.ascii?.[code] ?? dfa.next(d, chars[i]);
12431
+ }
12432
+ return d.match;
12433
+ }
12434
+ /** a readable listing of the state machine */
12435
+ toString() {
12436
+ return show(this.#start);
12437
+ }
12438
+ };
12439
+
12440
+ // node_modules/.pnpm/minimatch@11.0.9/node_modules/minimatch/dist/esm/assert-valid-pattern.js
12441
+ var MAX_PATTERN_LENGTH = 1024 * 64;
12442
+ var assertValidPattern = (pattern) => {
12443
+ if (typeof pattern !== "string") {
12444
+ throw new TypeError("invalid pattern");
12445
+ }
12446
+ if (pattern.length > MAX_PATTERN_LENGTH) {
12447
+ throw new TypeError("pattern is too long");
12153
12448
  }
12154
12449
  };
12155
- _a = AST;
12156
12450
 
12157
- // node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js
12451
+ // node_modules/.pnpm/minimatch@11.0.9/node_modules/minimatch/dist/esm/escape.js
12158
12452
  var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
12453
+ const e = magicalBraces ? windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&") : windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
12454
+ const c = e.charAt(0);
12455
+ if (c === "#") {
12456
+ return (windowsPathsNoEscape ? "[#]" : "\\#") + e.slice(1);
12457
+ }
12458
+ if (c === "!") {
12459
+ return (windowsPathsNoEscape ? "@(!)" : "\\!") + e.slice(1);
12460
+ }
12461
+ return e;
12462
+ };
12463
+
12464
+ // node_modules/.pnpm/minimatch@11.0.9/node_modules/minimatch/dist/esm/unescape.js
12465
+ var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
12466
+ if (windowsPathsNoEscape && s.startsWith("@(!)")) {
12467
+ return "!" + unescape(s.slice(4), { windowsPathsNoEscape, magicalBraces });
12468
+ }
12159
12469
  if (magicalBraces) {
12160
- return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&");
12470
+ return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1");
12161
12471
  }
12162
- return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
12472
+ return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
12163
12473
  };
12164
12474
 
12165
- // node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js
12166
- var minimatch = (p, pattern, options2 = {}) => {
12475
+ // node_modules/.pnpm/minimatch@11.0.9/node_modules/minimatch/dist/esm/index.js
12476
+ var DEFAULT_BRACE_EXPAND_MAX = 1e5;
12477
+ var DEFAULT_GLOB_STAR_RECURSION_MAX = 200;
12478
+ var AWE_KEY = "allowWindowsEscape";
12479
+ var minimatch = (p, pattern, options2) => {
12167
12480
  assertValidPattern(pattern);
12168
- if (!options2.nocomment && pattern.charAt(0) === "#") {
12481
+ if (!options2?.nocomment && pattern.charAt(0) === "#") {
12169
12482
  return false;
12170
12483
  }
12171
- return new Minimatch(pattern, options2).match(p);
12484
+ return cachedMinimatch(pattern, options2).match(p);
12172
12485
  };
12173
- var starDotExtRE = /^\*+([^+@!?*[(]*)$/;
12174
- var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
12175
- var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
12176
- var starDotExtTestNocase = (ext2) => {
12177
- ext2 = ext2.toLowerCase();
12178
- return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
12179
- };
12180
- var starDotExtTestNocaseDot = (ext2) => {
12181
- ext2 = ext2.toLowerCase();
12182
- return (f) => f.toLowerCase().endsWith(ext2);
12183
- };
12184
- var starDotStarRE = /^\*+\.\*+$/;
12185
- var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
12186
- var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
12187
- var dotStarRE = /^\.\*+$/;
12188
- var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
12189
- var starRE = /^\*+$/;
12190
- var starTest = (f) => f.length !== 0 && !f.startsWith(".");
12191
- var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
12192
- var qmarksRE = /^\?+([^+@!?*[(]*)?$/;
12193
- var qmarksTestNocase = ([$0, ext2 = ""]) => {
12194
- const noext = qmarksTestNoExt([$0]);
12195
- if (!ext2)
12196
- return noext;
12197
- ext2 = ext2.toLowerCase();
12198
- return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
12199
- };
12200
- var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
12201
- const noext = qmarksTestNoExtDot([$0]);
12202
- if (!ext2)
12203
- return noext;
12204
- ext2 = ext2.toLowerCase();
12205
- return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
12206
- };
12207
- var qmarksTestDot = ([$0, ext2 = ""]) => {
12208
- const noext = qmarksTestNoExtDot([$0]);
12209
- return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
12486
+ var cache = /* @__PURE__ */ new Map();
12487
+ var oldCache = /* @__PURE__ */ new Map();
12488
+ var cacheSize = 0;
12489
+ var cacheTotalWeight = 0;
12490
+ var cacheMax = 256;
12491
+ var cacheMaxWeight = 1 << 15;
12492
+ var cacheMaxEntryWeight = 1 << 12;
12493
+ var cacheWeight = (mm) => {
12494
+ let w = mm.pattern.length;
12495
+ for (const s of mm.globSet) {
12496
+ w += s.length + 1;
12497
+ if (w > cacheMaxEntryWeight)
12498
+ break;
12499
+ }
12500
+ return w;
12210
12501
  };
12211
- var qmarksTest = ([$0, ext2 = ""]) => {
12212
- const noext = qmarksTestNoExt([$0]);
12213
- return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
12502
+ var tri = (v) => v === void 0 ? 0 : v ? 2 : 1;
12503
+ var booleanWeights = new Map(Object.keys({
12504
+ nobrace: 0,
12505
+ nocomment: 0,
12506
+ nonegate: 0,
12507
+ noglobstar: 0,
12508
+ noext: 0,
12509
+ nonull: 0,
12510
+ partial: 0,
12511
+ dot: 0,
12512
+ nocase: 0,
12513
+ nocaseMagicOnly: 0,
12514
+ magicalBraces: 0,
12515
+ matchBase: 0,
12516
+ flipNegate: 0,
12517
+ preserveMultipleSlashes: 0,
12518
+ windowsNoMagicRoot: 0
12519
+ }).map((k, i) => [k, 24 * 3 ** i]));
12520
+ var optionsKey = (o) => {
12521
+ let n = 0;
12522
+ let wpe = false;
12523
+ for (const k in o) {
12524
+ const v = o[k];
12525
+ switch (k) {
12526
+ // the same test as the Minimatch constructor
12527
+ case "windowsPathsNoEscape":
12528
+ if (v)
12529
+ wpe = true;
12530
+ break;
12531
+ case AWE_KEY:
12532
+ if (v === false)
12533
+ wpe = true;
12534
+ break;
12535
+ case "platform": {
12536
+ const p = v || defaultPlatform;
12537
+ if (p === defaultPlatform)
12538
+ break;
12539
+ if (p === "darwin")
12540
+ n += 3;
12541
+ else if (p === "win32")
12542
+ n += 6;
12543
+ else if (p === "linux")
12544
+ n += 9;
12545
+ else
12546
+ return JSON.stringify(o);
12547
+ break;
12548
+ }
12549
+ case "optimizationLevel":
12550
+ if (v === void 0)
12551
+ break;
12552
+ n += v >= 2 ? 1 : v >= 1 ? 0 : 2;
12553
+ break;
12554
+ case "braceExpandMax":
12555
+ if (v !== void 0 && v !== DEFAULT_BRACE_EXPAND_MAX) {
12556
+ return JSON.stringify(o);
12557
+ }
12558
+ break;
12559
+ case "maxGlobstarRecursion":
12560
+ if (v !== void 0 && v !== DEFAULT_GLOB_STAR_RECURSION_MAX) {
12561
+ return JSON.stringify(o);
12562
+ }
12563
+ break;
12564
+ case "normalize":
12565
+ if (v !== void 0)
12566
+ return JSON.stringify(o);
12567
+ break;
12568
+ default:
12569
+ n += (booleanWeights.get(k) ?? 0) * tri(v);
12570
+ }
12571
+ }
12572
+ return wpe ? n + 12 : n;
12214
12573
  };
12215
- var qmarksTestNoExt = ([$0]) => {
12216
- const len = $0.length;
12217
- return (f) => f.length === len && !f.startsWith(".");
12574
+ var copyOptions = (o) => {
12575
+ const copy = {};
12576
+ for (const k in o)
12577
+ copy[k] = o[k];
12578
+ return copy;
12218
12579
  };
12219
- var qmarksTestNoExtDot = ([$0]) => {
12220
- const len = $0.length;
12221
- return (f) => f.length === len && f !== "." && f !== "..";
12580
+ var cachedMinimatch = (pattern, options2) => {
12581
+ const key = options2 ? optionsKey(options2) : 0;
12582
+ let mm = cache.get(key)?.get(pattern);
12583
+ if (mm)
12584
+ return mm;
12585
+ mm = oldCache.get(key)?.get(pattern) ?? new Minimatch(pattern, copyOptions(options2));
12586
+ const weight = cacheWeight(mm);
12587
+ if (weight > cacheMaxEntryWeight)
12588
+ return mm;
12589
+ if (cacheSize >= cacheMax || cacheTotalWeight + weight > cacheMaxWeight) {
12590
+ oldCache = cache;
12591
+ cache = /* @__PURE__ */ new Map();
12592
+ cacheSize = 0;
12593
+ cacheTotalWeight = 0;
12594
+ }
12595
+ let byPattern = cache.get(key);
12596
+ if (!byPattern)
12597
+ cache.set(key, byPattern = /* @__PURE__ */ new Map());
12598
+ byPattern.set(pattern, mm);
12599
+ cacheSize++;
12600
+ cacheTotalWeight += weight;
12601
+ return mm;
12222
12602
  };
12223
- var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
12603
+ var defaultPlatform = typeof process === "object" && process ? process.env?.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
12224
12604
  var path = {
12225
12605
  win32: { sep: "\\" },
12226
12606
  posix: { sep: "/" }
@@ -12229,11 +12609,10 @@ var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
12229
12609
  minimatch.sep = sep;
12230
12610
  var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
12231
12611
  minimatch.GLOBSTAR = GLOBSTAR;
12232
- var qmark2 = "[^/]";
12233
- var star2 = qmark2 + "*?";
12234
- var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
12235
- var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
12236
- var filter = (pattern, options2 = {}) => (p) => minimatch(p, pattern, options2);
12612
+ var filter = (pattern, options2) => {
12613
+ let mm;
12614
+ return (p) => (mm ??= cachedMinimatch(pattern, options2)).match(p);
12615
+ };
12237
12616
  minimatch.filter = filter;
12238
12617
  var ext = (a, b = {}) => Object.assign({}, a, b);
12239
12618
  var defaults = (def) => {
@@ -12251,21 +12630,10 @@ var defaults = (def) => {
12251
12630
  return orig.defaults(ext(def, options2)).Minimatch;
12252
12631
  }
12253
12632
  },
12254
- AST: class AST extends orig.AST {
12255
- /* c8 ignore start */
12256
- constructor(type, parent, options2 = {}) {
12257
- super(type, parent, ext(def, options2));
12258
- }
12259
- /* c8 ignore stop */
12260
- static fromGlob(pattern, options2 = {}) {
12261
- return orig.AST.fromGlob(pattern, ext(def, options2));
12262
- }
12263
- },
12264
12633
  unescape: (s, options2 = {}) => orig.unescape(s, ext(def, options2)),
12265
12634
  escape: (s, options2 = {}) => orig.escape(s, ext(def, options2)),
12266
12635
  filter: (pattern, options2 = {}) => orig.filter(pattern, ext(def, options2)),
12267
12636
  defaults: (options2) => orig.defaults(ext(def, options2)),
12268
- makeRe: (pattern, options2 = {}) => orig.makeRe(pattern, ext(def, options2)),
12269
12637
  braceExpand: (pattern, options2 = {}) => orig.braceExpand(pattern, ext(def, options2)),
12270
12638
  match: (list, pattern, options2 = {}) => orig.match(list, pattern, ext(def, options2)),
12271
12639
  sep: orig.sep,
@@ -12278,11 +12646,33 @@ var braceExpand = (pattern, options2 = {}) => {
12278
12646
  if (options2.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
12279
12647
  return [pattern];
12280
12648
  }
12281
- return expand(pattern, { max: options2.braceExpandMax });
12649
+ let p = pattern.replace(/\\\\/g, "\\\\\\\\");
12650
+ if (options2.windowsPathsNoEscape || options2[AWE_KEY] === false) {
12651
+ p = p.replace(/\[([{}])\]/g, "[\\$1]");
12652
+ }
12653
+ return expand(p, { max: options2.braceExpandMax });
12282
12654
  };
12283
12655
  minimatch.braceExpand = braceExpand;
12284
- var makeRe = (pattern, options2 = {}) => new Minimatch(pattern, options2).makeRe();
12285
- minimatch.makeRe = makeRe;
12656
+ var RANGE_MIN = 100;
12657
+ var rangeRe = /(?<![\\$])\{(-?\d+)\.\.(-?\d+)\}/g;
12658
+ var inRepeatOrNegExt = (portion, mark) => {
12659
+ const stack = [];
12660
+ for (let i = 0; i < portion.length; i++) {
12661
+ const c = portion.charAt(i);
12662
+ if (c === "\\") {
12663
+ i++;
12664
+ } else if (c === mark) {
12665
+ if (stack.some((t) => t !== "@" && t !== "?"))
12666
+ return true;
12667
+ } else if (portion.charAt(i + 1) === "(" && "!?+*@".includes(c)) {
12668
+ stack.push(c);
12669
+ i++;
12670
+ } else if (c === ")") {
12671
+ stack.pop();
12672
+ }
12673
+ }
12674
+ return false;
12675
+ };
12286
12676
  var match = (list, pattern, options2 = {}) => {
12287
12677
  const mm = new Minimatch(pattern, options2);
12288
12678
  list = list.filter((f) => mm.match(f));
@@ -12293,7 +12683,141 @@ var match = (list, pattern, options2 = {}) => {
12293
12683
  };
12294
12684
  minimatch.match = match;
12295
12685
  var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
12296
- var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
12686
+ var classEnd = (pattern, start) => {
12687
+ let i = start + 1;
12688
+ if (pattern.charAt(i) === "!" || pattern.charAt(i) === "^")
12689
+ i++;
12690
+ let sawStart = false;
12691
+ for (; i < pattern.length; i++) {
12692
+ const c = pattern.charAt(i);
12693
+ if (c === "]" && sawStart)
12694
+ return i;
12695
+ sawStart = true;
12696
+ if (c === "\\")
12697
+ i++;
12698
+ }
12699
+ return -1;
12700
+ };
12701
+ var literal = (pattern, noext) => {
12702
+ if (!noext && (pattern === "+()" || pattern === "@()"))
12703
+ return pattern;
12704
+ let lit2 = "";
12705
+ for (let i = 0; i < pattern.length; i++) {
12706
+ const c = pattern.charAt(i);
12707
+ if (c === "\\") {
12708
+ lit2 += pattern.charAt(++i) || c;
12709
+ } else if (c === "*" || c === "?") {
12710
+ return void 0;
12711
+ } else if (c === "[") {
12712
+ const close = classEnd(pattern, i);
12713
+ if (close === -1) {
12714
+ lit2 += c;
12715
+ continue;
12716
+ }
12717
+ let body = pattern.slice(i + 1, close);
12718
+ if (body.startsWith("\\"))
12719
+ body = body.slice(1);
12720
+ if ([...body].length !== 1 || "!^".includes(pattern.charAt(i + 1))) {
12721
+ return void 0;
12722
+ }
12723
+ lit2 += body;
12724
+ i = close;
12725
+ } else if (!noext && "+@!".includes(c) && pattern.charAt(i + 1) === "(" && pattern.includes(")", i + 2)) {
12726
+ return void 0;
12727
+ } else {
12728
+ lit2 += c;
12729
+ }
12730
+ }
12731
+ return lit2;
12732
+ };
12733
+ var MAX_EXTGLOBS = 256;
12734
+ var extglobCount = (pattern) => {
12735
+ let n = 0;
12736
+ for (let i = 0; i < pattern.length - 1; i++) {
12737
+ const c = pattern.charAt(i);
12738
+ if (c === "\\") {
12739
+ i++;
12740
+ } else if ("+@!?*".includes(c) && pattern.charAt(i + 1) === "(") {
12741
+ n++;
12742
+ i++;
12743
+ }
12744
+ }
12745
+ return n;
12746
+ };
12747
+ var assertValidExtglobs = (pattern) => {
12748
+ if (extglobCount(pattern) > MAX_EXTGLOBS) {
12749
+ throw new TypeError("pattern has too many extglobs");
12750
+ }
12751
+ };
12752
+ var extSafe = (pattern) => {
12753
+ if (/^[?*+@]\(\)$/.test(pattern) || pattern.includes("[:"))
12754
+ return false;
12755
+ let depth = 0;
12756
+ for (let i = 0; i < pattern.length; i++) {
12757
+ const c = pattern.charAt(i);
12758
+ if (c === "\\") {
12759
+ if (++i === pattern.length)
12760
+ return false;
12761
+ } else if (c === "[") {
12762
+ const close = classEnd(pattern, i);
12763
+ if (close !== -1)
12764
+ i = close;
12765
+ } else if ("+@!?*".includes(c) && pattern.charAt(i + 1) === "(") {
12766
+ depth++;
12767
+ i++;
12768
+ } else if (c === ")") {
12769
+ if (!depth--)
12770
+ return false;
12771
+ } else if (c === "|" && !depth) {
12772
+ return false;
12773
+ }
12774
+ }
12775
+ return !depth;
12776
+ };
12777
+ var lastSplit;
12778
+ var lastChecked;
12779
+ var portionMatch = (p, f) => typeof p === "string" ? f === p : f !== "" && p.testUnchecked(f);
12780
+ var endIndex = (p, last, lastStart, prev, prevStart) => portionMatch(p, last) ? lastStart : prev !== void 0 && portionMatch(p, prev) ? prevStart : -1;
12781
+ var isDots = (p) => p === "." || p === "..";
12782
+ var isDrive = (p) => typeof p === "string" && /^[a-z]:$/i.test(p);
12783
+ var isLongUNC = (p) => typeof p === "string" && /^unc$/i.test(p);
12784
+ var uncHost = (p) => {
12785
+ if (p[0] !== "" || p[1] !== "")
12786
+ return -1;
12787
+ const h = p[2] !== "?" ? 2 : isLongUNC(p[3]) ? 4 : -1;
12788
+ const host = p[h];
12789
+ const share = p[h + 1];
12790
+ return h !== -1 && host !== void 0 && host !== "" && host !== GLOBSTAR && share !== void 0 && share !== "" && share !== GLOBSTAR ? h : -1;
12791
+ };
12792
+ var walkable = (p, dot) => !isDots(p) && (dot || !p.startsWith("."));
12793
+ var dotPortion = (f, start, end, dot, sep2) => {
12794
+ for (let k = start; k < end; ) {
12795
+ if (f.charCodeAt(k) === 46) {
12796
+ if (!dot)
12797
+ return true;
12798
+ const n = f.charCodeAt(k + 1) === 46 ? k + 2 : k + 1;
12799
+ if (n >= end || isSep(f.charCodeAt(n), sep2))
12800
+ return true;
12801
+ }
12802
+ const s = nextSep(f, k, sep2);
12803
+ if (s === -1)
12804
+ return false;
12805
+ k = s + 1;
12806
+ while (k < end && isSep(f.charCodeAt(k), sep2))
12807
+ k++;
12808
+ }
12809
+ return false;
12810
+ };
12811
+ var isSep = (c, sep2) => sep2 === "/" ? c === 47 : sep2 === "\\" ? c === 92 : c === 47 || c === 92;
12812
+ var nextSep = (f, from, sep2) => {
12813
+ if (sep2 !== "both")
12814
+ return f.indexOf(sep2, from);
12815
+ const s = f.indexOf("/", from);
12816
+ const b = f.indexOf("\\", from);
12817
+ return s === -1 ? b : b === -1 ? s : Math.min(s, b);
12818
+ };
12819
+ var lastSep = (f, from, sep2) => sep2 !== "both" ? f.lastIndexOf(sep2, from) : Math.max(f.lastIndexOf("/", from), f.lastIndexOf("\\", from));
12820
+ var PENDING = {};
12297
12821
  var Minimatch = class {
12298
12822
  options;
12299
12823
  set;
@@ -12312,22 +12836,42 @@ var Minimatch = class {
12312
12836
  platform;
12313
12837
  windowsNoMagicRoot;
12314
12838
  maxGlobstarRecursion;
12315
- regexp;
12839
+ // the path can be checked against the last portion, and the string
12840
+ // portions, of each row before it is split. See #canMatch.
12841
+ #endCheck;
12842
+ #literalCheck;
12843
+ // level 2 resolves `.` and `..` portions in the path
12844
+ #level2;
12845
+ // the unicode normalization form, if any
12846
+ #form;
12847
+ // the string portions of each row in the set
12848
+ #literals = [];
12849
+ // the rows that #canMatch can match without splitting the path
12850
+ #shapes = [];
12851
+ // the rows whose last portion can be checked against the path's
12852
+ #endRows = [];
12853
+ // brace expansion can make the same portion in many rows, so they
12854
+ // share one Matcher, and the states that it caches
12855
+ #matchers = /* @__PURE__ */ new Map();
12856
+ // parse() returns PENDING in place of a Matcher
12857
+ #pending = false;
12858
+ // the char that marks numeric ranges in globSet, if any
12859
+ #rangeMark;
12860
+ // the GlobstarParts of each pattern row, by start index and partial
12861
+ #globstarParts = /* @__PURE__ */ new WeakMap();
12316
12862
  constructor(pattern, options2 = {}) {
12317
12863
  assertValidPattern(pattern);
12318
12864
  options2 = options2 || {};
12319
12865
  this.options = options2;
12320
- this.maxGlobstarRecursion = options2.maxGlobstarRecursion ?? 200;
12866
+ this.maxGlobstarRecursion = options2.maxGlobstarRecursion ?? DEFAULT_GLOB_STAR_RECURSION_MAX;
12321
12867
  this.pattern = pattern;
12322
12868
  this.platform = options2.platform || defaultPlatform;
12323
12869
  this.isWindows = this.platform === "win32";
12324
- const awe = "allowWindowsEscape";
12325
- this.windowsPathsNoEscape = !!options2.windowsPathsNoEscape || options2[awe] === false;
12870
+ this.windowsPathsNoEscape = !!options2.windowsPathsNoEscape || options2[AWE_KEY] === false;
12326
12871
  if (this.windowsPathsNoEscape) {
12327
12872
  this.pattern = this.pattern.replace(/\\/g, "/");
12328
12873
  }
12329
12874
  this.preserveMultipleSlashes = !!options2.preserveMultipleSlashes;
12330
- this.regexp = null;
12331
12875
  this.negate = false;
12332
12876
  this.nonegate = !!options2.nonegate;
12333
12877
  this.comment = false;
@@ -12338,7 +12882,58 @@ var Minimatch = class {
12338
12882
  this.globSet = [];
12339
12883
  this.globParts = [];
12340
12884
  this.set = [];
12885
+ this.#endCheck = !this.preserveMultipleSlashes;
12886
+ this.#level2 = (options2.optimizationLevel ?? 1) >= 2;
12887
+ const n = options2.normalize;
12888
+ this.#form = n === true ? "NFC" : n || void 0;
12341
12889
  this.make();
12890
+ const drives = this.set.map((row) => this.#rootIndex(row));
12891
+ this.#endRows = this.set.map((row, r) => this.#endCheck && row.length - 1 > drives[r]);
12892
+ this.#literals = this.set.map((row, r) => {
12893
+ const end = this.#endRows[r] ? row.length - 1 : row.length;
12894
+ const lits = row.slice(drives[r] + 1, end).filter((p) => typeof p === "string" && !!p);
12895
+ return [...new Set(lits)];
12896
+ });
12897
+ this.#literalCheck = this.#literals.some((l) => l.length);
12898
+ this.#shapes = this.set.map((row, r) => {
12899
+ const [p0, p1, p2] = row;
12900
+ if (this.#endRows[r] && row.length === 2) {
12901
+ if (p0 === GLOBSTAR && p1 !== GLOBSTAR)
12902
+ return "tail";
12903
+ }
12904
+ if (this.#endRows[r] && options2.matchBase && row.length === 1 && p0 !== GLOBSTAR && p0 !== "") {
12905
+ return "base";
12906
+ }
12907
+ if (!this.#endCheck || drives[r] !== -1)
12908
+ return void 0;
12909
+ if (row.length === 3 && p0 === GLOBSTAR && p2 === GLOBSTAR && p1 !== GLOBSTAR && p1 !== "" && // the portion between is only matched below this limit
12910
+ this.maxGlobstarRecursion > 0) {
12911
+ return "mid";
12912
+ }
12913
+ if (row.length === 2 && p1 === GLOBSTAR && p0 !== GLOBSTAR && p0 !== "") {
12914
+ return "head";
12915
+ }
12916
+ return void 0;
12917
+ });
12918
+ }
12919
+ // a string portion of a pattern, normalized if the option is set
12920
+ #norm(p) {
12921
+ return this.#form ? p.normalize(this.#form) : p;
12922
+ }
12923
+ // On Windows, the index of the last root portion of a row, as
12924
+ // #matchRow finds it: 0 for `c:/...`, 3 for `//?/c:/...` and
12925
+ // `//host/share/...`, and 5 for `//?/UNC/host/share/...`. Otherwise
12926
+ // -1.
12927
+ #rootIndex(row) {
12928
+ if (!this.isWindows)
12929
+ return -1;
12930
+ if (isDrive(row[0]))
12931
+ return 0;
12932
+ const uncDrive = row[0] === "" && row[1] === "" && row[2] === "?" && isDrive(row[3]);
12933
+ if (uncDrive)
12934
+ return 3;
12935
+ const h = uncHost(row);
12936
+ return h === -1 ? -1 : h + 1;
12342
12937
  }
12343
12938
  hasMagic() {
12344
12939
  if (this.options.magicalBraces && this.set.length > 1) {
@@ -12352,8 +12947,6 @@ var Minimatch = class {
12352
12947
  }
12353
12948
  return false;
12354
12949
  }
12355
- debug(..._) {
12356
- }
12357
12950
  make() {
12358
12951
  const pattern = this.pattern;
12359
12952
  const options2 = this.options;
@@ -12366,40 +12959,149 @@ var Minimatch = class {
12366
12959
  return;
12367
12960
  }
12368
12961
  this.parseNegate();
12369
- this.globSet = [...new Set(this.braceExpand())];
12370
- if (options2.debug) {
12371
- this.debug = (...args) => console.error(...args);
12372
- }
12373
- this.debug(this.pattern, this.globSet);
12374
- const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
12962
+ this.globSet = [...new Set(this.#expandBraces())];
12963
+ const rawGlobParts = this.globSet.map((s) => this.#slashSplit(s));
12375
12964
  this.globParts = this.preprocess(rawGlobParts);
12376
- this.debug(this.pattern, this.globParts);
12965
+ this.#pending = true;
12377
12966
  let set = this.globParts.map((s, _, __) => {
12378
12967
  if (this.isWindows && this.windowsNoMagicRoot) {
12379
- const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
12380
- const isDrive = /^[a-z]:/i.test(s[0]);
12968
+ const n = s[2] === "?" && isLongUNC(s[3]) ? 6 : 4;
12969
+ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && s.slice(3, n).every((p) => !globMagic.test(p));
12970
+ const isDrive2 = /^[a-z]:/i.test(s[0]);
12381
12971
  if (isUNC) {
12382
12972
  return [
12383
- ...s.slice(0, 4),
12384
- ...s.slice(4).map((ss) => this.parse(ss))
12973
+ ...s.slice(0, n).map((p) => this.#norm(p)),
12974
+ ...s.slice(n).map((ss) => this.parse(ss))
12975
+ ];
12976
+ } else if (isDrive2) {
12977
+ return [
12978
+ this.#norm(s[0]),
12979
+ ...s.slice(1).map((ss) => this.parse(ss))
12385
12980
  ];
12386
- } else if (isDrive) {
12387
- return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
12388
12981
  }
12389
12982
  }
12390
12983
  return s.map((ss) => this.parse(ss));
12391
12984
  });
12392
- this.debug(this.pattern, set);
12393
12985
  this.set = set.filter((s) => s.indexOf(false) === -1);
12394
12986
  if (this.isWindows) {
12395
12987
  for (let i = 0; i < this.set.length; i++) {
12396
12988
  const p = this.set[i];
12397
- if (p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
12989
+ if (p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && (isDrive(p[3]) || isLongUNC(this.globParts[i][3]))) {
12990
+ if (isLongUNC(this.globParts[i][3]))
12991
+ p[3] = "UNC";
12398
12992
  p[2] = "?";
12399
12993
  }
12400
12994
  }
12401
12995
  }
12402
- this.debug(this.pattern, this.set);
12996
+ if (!options2.noext)
12997
+ this.mergeRows();
12998
+ this.#pending = false;
12999
+ this.set.forEach((row, i) => {
13000
+ for (let k = 0; k < row.length; k++) {
13001
+ if (row[k] === PENDING) {
13002
+ row[k] = this.parse(this.globParts[i][k]);
13003
+ }
13004
+ }
13005
+ });
13006
+ }
13007
+ // Merge rows that only differ in one portion, where each of them
13008
+ // is a Matcher, into one row that matches any of them with
13009
+ // `@(a|b|...)`. Then a path is only walked once for all of them,
13010
+ // for example with `**/*.{js,ts}`.
13011
+ mergeRows() {
13012
+ let merged = true;
13013
+ while (merged) {
13014
+ merged = false;
13015
+ if (this.set.length < 2)
13016
+ return;
13017
+ let keys = this.#mergeKeys();
13018
+ const len = Math.max(0, ...this.set.map((r) => r.length));
13019
+ for (let k = 0; k < len; k++) {
13020
+ const groups = /* @__PURE__ */ new Map();
13021
+ const R = this.set.length + 1;
13022
+ this.set.forEach((row, i) => {
13023
+ if (!(row[k] instanceof Matcher || row[k] === PENDING) || !extSafe(this.globParts[i][k])) {
13024
+ return;
13025
+ }
13026
+ const { pre, suf } = keys[i];
13027
+ const key = pre[k] * R + suf[k + 1];
13028
+ const g = groups.get(key);
13029
+ if (g)
13030
+ g.push(i);
13031
+ else
13032
+ groups.set(key, [i]);
13033
+ });
13034
+ const drop = /* @__PURE__ */ new Set();
13035
+ for (const g of groups.values()) {
13036
+ if (g.length < 2)
13037
+ continue;
13038
+ const [first, ...rest] = g;
13039
+ const alts = g.map((i) => this.globParts[i][k]);
13040
+ const glob = `@(${alts.join("|")})`;
13041
+ if (extglobCount(glob) > MAX_EXTGLOBS)
13042
+ continue;
13043
+ this.globParts[first][k] = glob;
13044
+ this.set[first][k] = this.parse(glob);
13045
+ for (const i of rest)
13046
+ drop.add(i);
13047
+ }
13048
+ if (drop.size) {
13049
+ merged = true;
13050
+ this.set = this.set.filter((_, i) => !drop.has(i));
13051
+ this.globParts = this.globParts.filter((_, i) => !drop.has(i));
13052
+ if (this.set.length < 2)
13053
+ return;
13054
+ keys = this.#mergeKeys();
13055
+ }
13056
+ }
13057
+ }
13058
+ }
13059
+ // For each row, number ids for its prefixes and suffixes, such that
13060
+ // pre[k] identifies parts[0..k) and suf[k] identifies parts[k..n).
13061
+ // Two rows are the same other than at portion k exactly when they
13062
+ // have the same pre[k] and suf[k + 1]. This is linear in the size of
13063
+ // the rows, where joining the whole row for every k was quadratic.
13064
+ #mergeKeys() {
13065
+ const partIds = /* @__PURE__ */ new Map();
13066
+ const ids = this.globParts.map((parts) => parts.map((s) => {
13067
+ let id = partIds.get(s);
13068
+ if (id === void 0)
13069
+ partIds.set(s, id = partIds.size);
13070
+ return id;
13071
+ }));
13072
+ const P = partIds.size;
13073
+ const len = Math.max(0, ...ids.map((r) => r.length));
13074
+ const keys = ids.map((r) => ({
13075
+ pre: [0],
13076
+ suf: new Array(r.length + 1).fill(0)
13077
+ }));
13078
+ for (let k = 0; k < len; k++) {
13079
+ const m = /* @__PURE__ */ new Map();
13080
+ ids.forEach((r, i) => {
13081
+ if (k >= r.length)
13082
+ return;
13083
+ const { pre } = keys[i];
13084
+ const key = pre[k] * P + r[k];
13085
+ let id = m.get(key);
13086
+ if (id === void 0)
13087
+ m.set(key, id = m.size + 1);
13088
+ pre.push(id);
13089
+ });
13090
+ }
13091
+ for (let k = len - 1; k >= 0; k--) {
13092
+ const m = /* @__PURE__ */ new Map();
13093
+ ids.forEach((r, i) => {
13094
+ if (k >= r.length)
13095
+ return;
13096
+ const { suf } = keys[i];
13097
+ const key = suf[k + 1] * P + r[k];
13098
+ let id = m.get(key);
13099
+ if (id === void 0)
13100
+ m.set(key, id = m.size + 1);
13101
+ suf[k] = id;
13102
+ });
13103
+ }
13104
+ return keys;
12403
13105
  }
12404
13106
  // various transforms to equivalent pattern sets that are
12405
13107
  // faster to process in a filesystem walk. The goal is to
@@ -12446,13 +13148,14 @@ var Minimatch = class {
12446
13148
  // get rid of adjascent ** and resolve .. portions
12447
13149
  levelOneOptimize(globParts) {
12448
13150
  return globParts.map((parts) => {
13151
+ const root = this.#rootIndex(parts) + 1;
12449
13152
  parts = parts.reduce((set, part) => {
12450
13153
  const prev = set[set.length - 1];
12451
13154
  if (part === "**" && prev === "**") {
12452
13155
  return set;
12453
13156
  }
12454
13157
  if (part === "..") {
12455
- if (prev && prev !== ".." && prev !== "." && prev !== "**") {
13158
+ if (set.length > root && prev && prev !== ".." && prev !== "." && prev !== "**") {
12456
13159
  set.pop();
12457
13160
  return set;
12458
13161
  }
@@ -12463,10 +13166,188 @@ var Minimatch = class {
12463
13166
  return parts.length === 0 ? [""] : parts;
12464
13167
  });
12465
13168
  }
12466
- levelTwoFileOptimize(parts) {
12467
- if (!Array.isArray(parts)) {
12468
- parts = this.slashSplit(parts);
13169
+ // Check the path against each row before it is split. 'no' if no
13170
+ // row can match, so it does not need to be split. 'yes' if a row of
13171
+ // `**` and one more portion matches. 'maybe' if it must be split to
13172
+ // know. None of this applies with partial, where the path can end
13173
+ // before the row does.
13174
+ //
13175
+ // On Windows, `\` is a separator in the path too, and the portions of
13176
+ // a row up to its drive letter or UNC share are not checked (see
13177
+ // #rootIndex).
13178
+ //
13179
+ // Each string portion of a row must be a portion of the path, so the
13180
+ // path must contain it. Level 2 can only take portions out of the
13181
+ // path, so this is still true then.
13182
+ //
13183
+ // The last portion of a row must match the last portion of the path,
13184
+ // or the one before a trailing `/` (as a/* and a/**/* match a/b/).
13185
+ // This does not apply to rows that end in **, rows that end in a
13186
+ // root, or preserveMultipleSlashes (which can leave more
13187
+ // than one '' at the end). At level 2, it does not apply if that
13188
+ // portion is `.` or `..`, which can be
13189
+ // resolved away. Level 2 only takes other portions out of the
13190
+ // middle of the path.
13191
+ //
13192
+ // A row of `**/x` then matches if the ** can walk the portions
13193
+ // before the one that x matches, the same as #matchGlobstar. At
13194
+ // level 2, this is only known if none of them are `.` or `..`, so
13195
+ // that the path does not change when it is resolved.
13196
+ #canMatch(f) {
13197
+ const sep2 = !this.isWindows || !f.includes("\\") ? "/" : f.includes("/") ? "both" : "\\";
13198
+ let ends = this.#endCheck ? 0 : -1;
13199
+ let last = "";
13200
+ let lastStart = 0;
13201
+ let prev;
13202
+ let prevStart = 0;
13203
+ const dot = !!this.options.dot;
13204
+ ROWS: for (let r = 0; r < this.set.length; r++) {
13205
+ const row = this.set[r];
13206
+ const p = row[row.length - 1];
13207
+ let end = ends !== -1 && this.#endRows[r] && p !== GLOBSTAR;
13208
+ if (end && ends === 0) {
13209
+ const i = lastSep(f, f.length, sep2);
13210
+ lastStart = i + 1;
13211
+ last = f.slice(lastStart);
13212
+ if (last === "" && i >= 0) {
13213
+ let j = i;
13214
+ while (j > 0 && isSep(f.charCodeAt(j - 1), sep2))
13215
+ j--;
13216
+ prevStart = j === 0 ? 0 : lastSep(f, j - 1, sep2) + 1;
13217
+ prev = f.slice(prevStart, j);
13218
+ }
13219
+ const resolves = this.#level2 && (isDots(last) || last === "" && prev !== void 0 && isDots(prev));
13220
+ ends = resolves ? -1 : 1;
13221
+ end = !resolves;
13222
+ }
13223
+ let tailStart = -1;
13224
+ if (end && typeof p === "string") {
13225
+ tailStart = endIndex(p, last, lastStart, prev, prevStart);
13226
+ if (tailStart === -1)
13227
+ continue;
13228
+ }
13229
+ if (this.#literalCheck) {
13230
+ for (const l of this.#literals[r]) {
13231
+ if (!f.includes(l))
13232
+ continue ROWS;
13233
+ }
13234
+ }
13235
+ if (end && typeof p === "object") {
13236
+ tailStart = endIndex(p, last, lastStart, prev, prevStart);
13237
+ if (tailStart === -1)
13238
+ continue;
13239
+ }
13240
+ const shape = this.#shapes[r];
13241
+ if (shape === "base" && end)
13242
+ return "yes";
13243
+ if (shape === "tail" && end) {
13244
+ if (this.#level2 && dotPortion(f, 0, tailStart, true, sep2)) {
13245
+ return "maybe";
13246
+ }
13247
+ if (!dotPortion(f, 0, tailStart, dot, sep2))
13248
+ return "yes";
13249
+ continue;
13250
+ }
13251
+ if (shape === "mid" || shape === "head") {
13252
+ const m = this.#walk(f, row, shape === "head", dot, sep2);
13253
+ if (m !== "no")
13254
+ return m;
13255
+ continue;
13256
+ }
13257
+ return "maybe";
13258
+ }
13259
+ return "no";
13260
+ }
13261
+ // Match a row of a known shape against the split path, the same as
13262
+ // #matchGlobstar and #matchGlobStarBodySections do. None of these
13263
+ // rows have a drive letter, so they start at the first portion.
13264
+ #matchShape(file, row, shape) {
13265
+ const dot = !!this.options.dot;
13266
+ const n = file.length;
13267
+ if (shape === "head") {
13268
+ if (n < 2 || !portionMatch(row[0], file[0])) {
13269
+ return false;
13270
+ }
13271
+ for (let i = 1; i < n; i++)
13272
+ if (!walkable(file[i], dot))
13273
+ return false;
13274
+ return true;
13275
+ }
13276
+ const x = row[1];
13277
+ if (shape === "tail") {
13278
+ let t = n - 1;
13279
+ if (!portionMatch(x, file[t])) {
13280
+ if (file[t] !== "" || n === 1 || !portionMatch(x, file[--t])) {
13281
+ return false;
13282
+ }
13283
+ }
13284
+ for (let i = 0; i < t; i++)
13285
+ if (!walkable(file[i], dot))
13286
+ return false;
13287
+ return true;
13288
+ }
13289
+ for (let k = 0; k < n; k++) {
13290
+ if (portionMatch(x, file[k]) && k + 1 < n) {
13291
+ let i = k + 1;
13292
+ while (i < n && walkable(file[i], dot))
13293
+ i++;
13294
+ if (i === n)
13295
+ return true;
13296
+ }
13297
+ if (!walkable(file[k], dot))
13298
+ return false;
12469
13299
  }
13300
+ return false;
13301
+ }
13302
+ // Match a row of `**/x/**` or `x/**` against the path, the same as
13303
+ // #matchGlobstar and #matchGlobStarBodySections do once it is split.
13304
+ // x must match a portion (the first one, for `x/**`), the ** before
13305
+ // it must be able to walk the portions before that one, and there
13306
+ // must be a portion after it, which the ** after it can walk. At
13307
+ // level 2, this is only known if no portion is `.` or `..`.
13308
+ #walk(f, row, head, dot, sep2) {
13309
+ if (this.#level2 && dotPortion(f, 0, f.length, true, sep2))
13310
+ return "maybe";
13311
+ const x = row[head ? 0 : 1];
13312
+ let s = 0;
13313
+ for (let e = nextSep(f, s, sep2); e !== -1; e = nextSep(f, s, sep2)) {
13314
+ let next = e + 1;
13315
+ while (next < f.length && isSep(f.charCodeAt(next), sep2))
13316
+ next++;
13317
+ const hit = typeof x === "string" ? e - s === x.length && f.startsWith(x, s) : e > s && x.testUnchecked(f.slice(s, e));
13318
+ if (hit && !dotPortion(f, next, f.length, dot, sep2))
13319
+ return "yes";
13320
+ if (head || dotPortion(f, s, next, dot, sep2))
13321
+ return "no";
13322
+ s = next;
13323
+ }
13324
+ return "no";
13325
+ }
13326
+ // the last split, if it was the same path with the same split
13327
+ // settings
13328
+ #cachedSplit(f) {
13329
+ const last = lastSplit;
13330
+ return last?.f === f && last.isWindows === this.isWindows && last.preserveMultipleSlashes === this.preserveMultipleSlashes && last.normalize === this.#form ? last : void 0;
13331
+ }
13332
+ // split a path for match(), and keep the parts for the next call
13333
+ #split(f) {
13334
+ const { isWindows, preserveMultipleSlashes } = this;
13335
+ let parts = this.#slashSplit(isWindows ? f.split("\\").join("/") : f);
13336
+ const normalize2 = this.#form;
13337
+ if (normalize2)
13338
+ parts = parts.map((p) => p.normalize(normalize2));
13339
+ lastSplit = {
13340
+ f,
13341
+ isWindows,
13342
+ preserveMultipleSlashes,
13343
+ normalize: normalize2,
13344
+ parts
13345
+ };
13346
+ return lastSplit;
13347
+ }
13348
+ // resolve `.` and `..` portions of a path, for level 2
13349
+ #levelTwoFileOptimize(file) {
13350
+ const parts = [...file];
12470
13351
  let didSomething = false;
12471
13352
  do {
12472
13353
  didSomething = false;
@@ -12486,13 +13367,14 @@ var Minimatch = class {
12486
13367
  parts.pop();
12487
13368
  }
12488
13369
  }
12489
- let dd = 0;
13370
+ const root = this.#rootIndex(parts) + 1;
13371
+ let dd = root;
12490
13372
  while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
12491
13373
  const p = parts[dd - 1];
12492
- if (p && p !== "." && p !== ".." && p !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p))) {
13374
+ if (p && p !== "." && p !== ".." && p !== "**") {
12493
13375
  didSomething = true;
12494
13376
  parts.splice(dd - 1, 2);
12495
- dd -= 2;
13377
+ dd = Math.max(dd - 2, root);
12496
13378
  }
12497
13379
  }
12498
13380
  } while (didSomething);
@@ -12517,6 +13399,9 @@ var Minimatch = class {
12517
13399
  // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
12518
13400
  // this WOULD be allowed if ** did follow symlinks, or * didn't
12519
13401
  firstPhasePreProcess(globParts) {
13402
+ const { braceExpandMax = DEFAULT_BRACE_EXPAND_MAX } = this.options;
13403
+ let splitCells = 0;
13404
+ const maxSplitCells = 1e6;
12520
13405
  let didSomething = false;
12521
13406
  do {
12522
13407
  didSomething = false;
@@ -12538,10 +13423,15 @@ var Minimatch = class {
12538
13423
  if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
12539
13424
  continue;
12540
13425
  }
13426
+ const addedCells = parts.length - 1;
13427
+ if (globParts.length >= braceExpandMax || splitCells + addedCells > maxSplitCells) {
13428
+ throw new RangeError(`optimizationLevel 2: too many patterns from '**/..'`);
13429
+ }
12541
13430
  didSomething = true;
12542
13431
  parts.splice(gs, 1);
12543
13432
  const other = parts.slice(0);
12544
13433
  other[gs] = "**";
13434
+ splitCells += addedCells;
12545
13435
  globParts.push(other);
12546
13436
  gs--;
12547
13437
  }
@@ -12561,7 +13451,8 @@ var Minimatch = class {
12561
13451
  parts.pop();
12562
13452
  }
12563
13453
  }
12564
- let dd = 0;
13454
+ const root = this.#rootIndex(parts) + 1;
13455
+ let dd = root;
12565
13456
  while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
12566
13457
  const p = parts[dd - 1];
12567
13458
  if (p && p !== "." && p !== ".." && p !== "**") {
@@ -12571,7 +13462,7 @@ var Minimatch = class {
12571
13462
  parts.splice(dd - 1, 2, ...splin);
12572
13463
  if (parts.length === 0)
12573
13464
  parts.push("");
12574
- dd -= 2;
13465
+ dd = Math.max(dd - 2, root);
12575
13466
  }
12576
13467
  }
12577
13468
  }
@@ -12579,60 +13470,53 @@ var Minimatch = class {
12579
13470
  return globParts;
12580
13471
  }
12581
13472
  // second phase: multi-pattern dedupes
12582
- // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
12583
13473
  // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
12584
- // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
12585
- //
12586
- // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
12587
- // ^-- not valid because ** doens't follow symlinks
13474
+ // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
12588
13475
  secondPhasePreProcess(globParts) {
12589
- for (let i = 0; i < globParts.length - 1; i++) {
12590
- for (let j = i + 1; j < globParts.length; j++) {
12591
- const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
12592
- if (matched) {
12593
- globParts[i] = [];
12594
- globParts[j] = matched;
12595
- break;
13476
+ const keys = /* @__PURE__ */ new Set();
13477
+ const rows = globParts.filter((parts) => {
13478
+ const key = parts.join("/");
13479
+ if (keys.has(key))
13480
+ return false;
13481
+ keys.add(key);
13482
+ return true;
13483
+ });
13484
+ const stars = /* @__PURE__ */ new Map();
13485
+ for (const parts of rows) {
13486
+ const s = [];
13487
+ for (let i = 0; i < parts.length; i++) {
13488
+ if (parts[i] === "*")
13489
+ s.push(i);
13490
+ }
13491
+ if (s.length)
13492
+ stars.set(s.join(","), s);
13493
+ }
13494
+ if (!stars.size || rows.length * stars.size > 1e5)
13495
+ return rows;
13496
+ const { dot } = this.options;
13497
+ return rows.filter((parts) => {
13498
+ for (const s of stars.values()) {
13499
+ if (s[s.length - 1] >= parts.length)
13500
+ continue;
13501
+ const c = [...parts];
13502
+ let ok = true;
13503
+ let changed = false;
13504
+ for (const i of s) {
13505
+ const p = parts[i];
13506
+ if (p === "*")
13507
+ continue;
13508
+ if (!p || p === "**" || !dot && p.startsWith(".")) {
13509
+ ok = false;
13510
+ break;
13511
+ }
13512
+ c[i] = "*";
13513
+ changed = true;
12596
13514
  }
12597
- }
12598
- }
12599
- return globParts.filter((gs) => gs.length);
12600
- }
12601
- partsMatch(a, b, emptyGSMatch = false) {
12602
- let ai = 0;
12603
- let bi = 0;
12604
- let result = [];
12605
- let which = "";
12606
- while (ai < a.length && bi < b.length) {
12607
- if (a[ai] === b[bi]) {
12608
- result.push(which === "b" ? b[bi] : a[ai]);
12609
- ai++;
12610
- bi++;
12611
- } else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
12612
- result.push(a[ai]);
12613
- ai++;
12614
- } else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
12615
- result.push(b[bi]);
12616
- bi++;
12617
- } else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
12618
- if (which === "b")
12619
- return false;
12620
- which = "a";
12621
- result.push(a[ai]);
12622
- ai++;
12623
- bi++;
12624
- } else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
12625
- if (which === "a")
13515
+ if (ok && changed && keys.has(c.join("/")))
12626
13516
  return false;
12627
- which = "b";
12628
- result.push(b[bi]);
12629
- ai++;
12630
- bi++;
12631
- } else {
12632
- return false;
12633
13517
  }
12634
- }
12635
- return a.length === b.length && result;
13518
+ return true;
13519
+ });
12636
13520
  }
12637
13521
  parseNegate() {
12638
13522
  if (this.nonegate)
@@ -12648,15 +13532,28 @@ var Minimatch = class {
12648
13532
  this.pattern = pattern.slice(negateOffset);
12649
13533
  this.negate = negate;
12650
13534
  }
12651
- // set partial to true to test if, for example,
12652
- // "/a/b" matches the start of "/*/b/*/d"
12653
- // Partial means, if you run out of file before you run
12654
- // out of pattern, then that's fine, as long as all
12655
- // the parts match.
12656
- matchOne(file, pattern, partial = false) {
13535
+ // Match the parts of a path against one row of the set. `resolved`
13536
+ // is the parts after level 2 resolves `.` and `..` in them, or the
13537
+ // same parts below level 2. Set partial to true to test if, for
13538
+ // example, "/a/b" matches the start of "/*/b/*/d". Partial means, if
13539
+ // you run out of file before you run out of pattern, then that's
13540
+ // fine, as long as all the parts match.
13541
+ #matchRow(file, resolved, pattern, partial) {
12657
13542
  let fileStartIndex = 0;
12658
13543
  let patternStartIndex = 0;
12659
- if (this.isWindows) {
13544
+ const fh = this.isWindows ? uncHost(resolved) : -1;
13545
+ const ph = fh === -1 ? -1 : uncHost(pattern);
13546
+ if (ph !== -1) {
13547
+ const host = pattern[ph];
13548
+ const share = pattern[ph + 1];
13549
+ if (typeof host !== "string" || typeof share !== "string") {
13550
+ fileStartIndex = fh;
13551
+ patternStartIndex = ph;
13552
+ } else if (resolved[fh].toLowerCase() === host.toLowerCase() && resolved[fh + 1].toLowerCase() === share.toLowerCase()) {
13553
+ fileStartIndex = fh + 2;
13554
+ patternStartIndex = ph + 2;
13555
+ }
13556
+ } else if (this.isWindows) {
12660
13557
  const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
12661
13558
  const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
12662
13559
  const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
@@ -12669,36 +13566,22 @@ var Minimatch = class {
12669
13566
  pattern[pdi]
12670
13567
  ];
12671
13568
  if (fd.toLowerCase() === pd.toLowerCase()) {
12672
- pattern[pdi] = fd;
12673
- patternStartIndex = pdi;
12674
- fileStartIndex = fdi;
13569
+ patternStartIndex = pdi + 1;
13570
+ fileStartIndex = fdi + 1;
12675
13571
  }
12676
13572
  }
12677
13573
  }
12678
- const { optimizationLevel = 1 } = this.options;
12679
- if (optimizationLevel >= 2) {
12680
- file = this.levelTwoFileOptimize(file);
12681
- }
13574
+ file = resolved;
12682
13575
  if (pattern.includes(GLOBSTAR)) {
12683
13576
  return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
12684
13577
  }
12685
13578
  return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
12686
13579
  }
12687
13580
  #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
12688
- const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
12689
- const lastgs = pattern.lastIndexOf(GLOBSTAR);
12690
- const [head, body, tail] = partial ? [
12691
- pattern.slice(patternIndex, firstgs),
12692
- pattern.slice(firstgs + 1),
12693
- []
12694
- ] : [
12695
- pattern.slice(patternIndex, firstgs),
12696
- pattern.slice(firstgs + 1, lastgs),
12697
- pattern.slice(lastgs + 1)
12698
- ];
13581
+ const { head, body, tail, segments } = this.#getGlobstarParts(pattern, partial, patternIndex);
12699
13582
  if (head.length) {
12700
- const fileHead = file.slice(fileIndex, fileIndex + head.length);
12701
- if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
13583
+ const headEnd = fileIndex + head.length;
13584
+ if (!this.#matchOne(file, head, partial, fileIndex, 0, headEnd)) {
12702
13585
  return false;
12703
13586
  }
12704
13587
  fileIndex += head.length;
@@ -12724,8 +13607,8 @@ var Minimatch = class {
12724
13607
  }
12725
13608
  if (!body.length) {
12726
13609
  let sawSome = !!fileTailMatch;
12727
- for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) {
12728
- const f = String(file[i2]);
13610
+ for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
13611
+ const f = String(file[i]);
12729
13612
  sawSome = true;
12730
13613
  if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
12731
13614
  return false;
@@ -12733,33 +13616,57 @@ var Minimatch = class {
12733
13616
  }
12734
13617
  return partial || sawSome;
12735
13618
  }
12736
- const bodySegments = [[[], 0]];
12737
- let currentBody = bodySegments[0];
13619
+ return !!this.#matchGlobStarBodySections(file, segments, file.length - fileTailMatch, fileIndex, 0, partial, 0, !!fileTailMatch, /* @__PURE__ */ new Set());
13620
+ }
13621
+ // Split the pattern into head, tail, and middle of ** delimited
13622
+ // parts. The tail has to be at the end, and the others just have to
13623
+ // be found in order from the head. These only depend on the pattern
13624
+ // row, so they are kept for the next path.
13625
+ #getGlobstarParts(pattern, partial, patternIndex) {
13626
+ let byStart = this.#globstarParts.get(pattern);
13627
+ if (!byStart) {
13628
+ byStart = [];
13629
+ this.#globstarParts.set(pattern, byStart);
13630
+ }
13631
+ const key = patternIndex * 2 + (partial ? 1 : 0);
13632
+ const found = byStart[key];
13633
+ if (found)
13634
+ return found;
13635
+ const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
13636
+ const lastgs = pattern.lastIndexOf(GLOBSTAR);
13637
+ const head = pattern.slice(patternIndex, firstgs);
13638
+ const body = pattern.slice(firstgs + 1, partial ? void 0 : lastgs);
13639
+ const tail = partial ? [] : pattern.slice(lastgs + 1);
13640
+ const segments = [[[], 0]];
13641
+ let current = segments[0];
12738
13642
  let nonGsParts = 0;
12739
13643
  const nonGsPartsSums = [0];
12740
13644
  for (const b of body) {
12741
13645
  if (b === GLOBSTAR) {
12742
13646
  nonGsPartsSums.push(nonGsParts);
12743
- currentBody = [[], 0];
12744
- bodySegments.push(currentBody);
13647
+ current = [[], 0];
13648
+ segments.push(current);
12745
13649
  } else {
12746
- currentBody[0].push(b);
13650
+ current[0].push(b);
12747
13651
  nonGsParts++;
12748
13652
  }
12749
13653
  }
12750
- let i = bodySegments.length - 1;
12751
- const fileLength = file.length - fileTailMatch;
12752
- for (const b of bodySegments) {
12753
- b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
12754
- }
12755
- return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
13654
+ segments.forEach((b, i) => {
13655
+ b[1] = nonGsParts - nonGsPartsSums[i];
13656
+ });
13657
+ const parts = { head, body, tail, segments };
13658
+ byStart[key] = parts;
13659
+ return parts;
12756
13660
  }
12757
13661
  // return false for "nope, not matching"
12758
13662
  // return null for "not matching, cannot keep trying"
12759
- #matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
13663
+ #matchGlobStarBodySections(file, bodySegments, fileLength, fileIndex, bodyIndex, partial, globStarDepth, sawTail, tried) {
12760
13664
  const bs = bodySegments[bodyIndex];
12761
13665
  if (!bs) {
12762
- for (let i = fileIndex; i < file.length; i++) {
13666
+ if (partial) {
13667
+ return fileIndex >= fileLength || fileIndex === fileLength - 1 && file[fileIndex] === "";
13668
+ }
13669
+ for (let i = fileIndex; i < fileLength; i++) {
12763
13670
  sawTail = true;
12764
13671
  const f = file[i];
12765
13672
  if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
@@ -12768,15 +13675,22 @@ var Minimatch = class {
12768
13675
  }
12769
13676
  return sawTail;
12770
13677
  }
12771
- const [body, after] = bs;
13678
+ const [body, need] = bs;
13679
+ const after = partial ? fileLength : fileLength - need;
12772
13680
  while (fileIndex <= after) {
12773
- const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
13681
+ const key = bodyIndex * (file.length + 1) + fileIndex;
13682
+ if (tried.has(key))
13683
+ return false;
13684
+ tried.add(key);
13685
+ const m = this.#matchOne(file, body, partial, fileIndex, 0, fileIndex + body.length);
12774
13686
  if (m && globStarDepth < this.maxGlobstarRecursion) {
12775
- const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
13687
+ const sub = this.#matchGlobStarBodySections(file, bodySegments, fileLength, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail, tried);
12776
13688
  if (sub !== false) {
12777
13689
  return sub;
12778
13690
  }
12779
13691
  }
13692
+ if (fileIndex === after)
13693
+ break;
12780
13694
  const f = file[fileIndex];
12781
13695
  if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
12782
13696
  return false;
@@ -12785,28 +13699,18 @@ var Minimatch = class {
12785
13699
  }
12786
13700
  return partial || null;
12787
13701
  }
12788
- #matchOne(file, pattern, partial, fileIndex, patternIndex) {
13702
+ #matchOne(file, pattern, partial, fileIndex, patternIndex, fileEnd = file.length) {
12789
13703
  let fi;
12790
13704
  let pi;
12791
13705
  let pl;
12792
13706
  let fl;
12793
- for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
12794
- this.debug("matchOne loop");
13707
+ for (fi = fileIndex, pi = patternIndex, fl = Math.min(fileEnd, file.length), pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
12795
13708
  let p = pattern[pi];
12796
13709
  let f = file[fi];
12797
- this.debug(pattern, p, f);
12798
13710
  if (p === false || p === GLOBSTAR) {
12799
13711
  return false;
12800
13712
  }
12801
- let hit;
12802
- if (typeof p === "string") {
12803
- hit = f === p;
12804
- this.debug("string match", p, f, hit);
12805
- } else {
12806
- hit = p.test(f);
12807
- this.debug("pattern match", p, f, hit);
12808
- }
12809
- if (!hit)
13713
+ if (!portionMatch(p, f))
12810
13714
  return false;
12811
13715
  }
12812
13716
  if (fi === fl && pi === pl) {
@@ -12822,6 +13726,47 @@ var Minimatch = class {
12822
13726
  braceExpand() {
12823
13727
  return braceExpand(this.pattern, this.options);
12824
13728
  }
13729
+ // Expand braces, except numeric ranges such as {0..999} with at
13730
+ // least RANGE_MIN values. Each of those stays in its pattern as
13731
+ // `<mark>0..999<mark>`, for the Matcher to test. If a range might
13732
+ // be inside a [...] class, expand all of them instead.
13733
+ #expandBraces() {
13734
+ const { pattern } = this;
13735
+ if (this.options.nobrace)
13736
+ return this.braceExpand();
13737
+ let code = 57344;
13738
+ while (pattern.includes(String.fromCharCode(code))) {
13739
+ if (++code > 63743)
13740
+ return this.braceExpand();
13741
+ }
13742
+ const mark = String.fromCharCode(code);
13743
+ let found = false;
13744
+ const marked = pattern.replace(rangeRe, (m, lo, hi) => {
13745
+ const a = Number(lo);
13746
+ const b = Number(hi);
13747
+ if (!Number.isSafeInteger(a) || !Number.isSafeInteger(b) || Math.abs(a - b) + 1 < RANGE_MIN) {
13748
+ return m;
13749
+ }
13750
+ found = true;
13751
+ return `${mark}${lo}..${hi}${mark}`;
13752
+ });
13753
+ if (!found)
13754
+ return this.braceExpand();
13755
+ const set = braceExpand(marked, this.options);
13756
+ for (const p of set) {
13757
+ for (const portion of p.split("/")) {
13758
+ const c = portion.indexOf("[");
13759
+ if (c !== -1 && c < portion.lastIndexOf(mark)) {
13760
+ return this.braceExpand();
13761
+ }
13762
+ if (!this.options.noext && inRepeatOrNegExt(portion, mark)) {
13763
+ return this.braceExpand();
13764
+ }
13765
+ }
13766
+ }
13767
+ this.#rangeMark = mark;
13768
+ return set;
13769
+ }
12825
13770
  parse(pattern) {
12826
13771
  assertValidPattern(pattern);
12827
13772
  const options2 = this.options;
@@ -12829,88 +13774,30 @@ var Minimatch = class {
12829
13774
  return GLOBSTAR;
12830
13775
  if (pattern === "")
12831
13776
  return "";
12832
- let m;
12833
- let fastTest = null;
12834
- if (m = pattern.match(starRE)) {
12835
- fastTest = options2.dot ? starTestDot : starTest;
12836
- } else if (m = pattern.match(starDotExtRE)) {
12837
- fastTest = (options2.nocase ? options2.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options2.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
12838
- } else if (m = pattern.match(qmarksRE)) {
12839
- fastTest = (options2.nocase ? options2.dot ? qmarksTestNocaseDot : qmarksTestNocase : options2.dot ? qmarksTestDot : qmarksTest)(m);
12840
- } else if (m = pattern.match(starDotStarRE)) {
12841
- fastTest = options2.dot ? starDotStarTestDot : starDotStarTest;
12842
- } else if (m = pattern.match(dotStarRE)) {
12843
- fastTest = dotStarTest;
12844
- }
12845
- const re2 = AST.fromGlob(pattern, this.options).toMMPattern();
12846
- if (fastTest && typeof re2 === "object") {
12847
- Reflect.defineProperty(re2, "test", { value: fastTest });
12848
- }
12849
- return re2;
12850
- }
12851
- makeRe() {
12852
- if (this.regexp || this.regexp === false)
12853
- return this.regexp;
12854
- const set = this.set;
12855
- if (!set.length) {
12856
- this.regexp = false;
12857
- return this.regexp;
12858
- }
12859
- const options2 = this.options;
12860
- const twoStar = options2.noglobstar ? star2 : options2.dot ? twoStarDot : twoStarNoDot;
12861
- const flags = new Set(options2.nocase ? ["i"] : []);
12862
- let re2 = set.map((pattern) => {
12863
- const pp = pattern.map((p) => {
12864
- if (p instanceof RegExp) {
12865
- for (const f of p.flags.split(""))
12866
- flags.add(f);
12867
- }
12868
- return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
12869
- });
12870
- pp.forEach((p, i) => {
12871
- const next = pp[i + 1];
12872
- const prev = pp[i - 1];
12873
- if (p !== GLOBSTAR || prev === GLOBSTAR) {
12874
- return;
12875
- }
12876
- if (prev === void 0) {
12877
- if (next !== void 0 && next !== GLOBSTAR) {
12878
- pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
12879
- } else {
12880
- pp[i] = twoStar;
12881
- }
12882
- } else if (next === void 0) {
12883
- pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?";
12884
- } else if (next !== GLOBSTAR) {
12885
- pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
12886
- pp[i + 1] = GLOBSTAR;
12887
- }
13777
+ const { nocase, nocaseMagicOnly, noext = false, dot, normalize: normalize2 } = options2;
13778
+ const rangeMark = this.#rangeMark;
13779
+ const lit2 = rangeMark && pattern.includes(rangeMark) ? void 0 : literal(pattern, noext);
13780
+ if (lit2 !== void 0 && !(nocase && !nocaseMagicOnly && pattern.toUpperCase() !== pattern.toLowerCase())) {
13781
+ return this.#norm(lit2);
13782
+ }
13783
+ if (this.#pending)
13784
+ return PENDING;
13785
+ let m = this.#matchers.get(pattern);
13786
+ if (!m) {
13787
+ if (!noext)
13788
+ assertValidExtglobs(pattern);
13789
+ m = new Matcher(pattern, {
13790
+ nocase,
13791
+ noext,
13792
+ dot,
13793
+ normalize: normalize2,
13794
+ ...rangeMark && { rangeMark }
12888
13795
  });
12889
- const filtered = pp.filter((p) => p !== GLOBSTAR);
12890
- if (this.partial && filtered.length >= 1) {
12891
- const prefixes = [];
12892
- for (let i = 1; i <= filtered.length; i++) {
12893
- prefixes.push(filtered.slice(0, i).join("/"));
12894
- }
12895
- return "(?:" + prefixes.join("|") + ")";
12896
- }
12897
- return filtered.join("/");
12898
- }).join("|");
12899
- const [open2, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
12900
- re2 = "^" + open2 + re2 + close + "$";
12901
- if (this.partial) {
12902
- re2 = "^(?:\\/|" + open2 + re2.slice(1, -1) + close + ")$";
12903
- }
12904
- if (this.negate)
12905
- re2 = "^(?!" + re2 + ").+$";
12906
- try {
12907
- this.regexp = new RegExp(re2, [...flags].join(""));
12908
- } catch {
12909
- this.regexp = false;
13796
+ this.#matchers.set(pattern, m);
12910
13797
  }
12911
- return this.regexp;
13798
+ return m;
12912
13799
  }
12913
- slashSplit(p) {
13800
+ #slashSplit(p) {
12914
13801
  if (this.preserveMultipleSlashes) {
12915
13802
  return p.split("/");
12916
13803
  } else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
@@ -12920,7 +13807,6 @@ var Minimatch = class {
12920
13807
  }
12921
13808
  }
12922
13809
  match(f, partial = this.partial) {
12923
- this.debug("match", f, this.pattern);
12924
13810
  if (this.comment) {
12925
13811
  return false;
12926
13812
  }
@@ -12931,25 +13817,31 @@ var Minimatch = class {
12931
13817
  return true;
12932
13818
  }
12933
13819
  const options2 = this.options;
12934
- if (this.isWindows) {
12935
- f = f.split("\\").join("/");
12936
- }
12937
- const ff = this.slashSplit(f);
12938
- this.debug(this.pattern, "split", ff);
13820
+ let split = this.#cachedSplit(f);
13821
+ if (!split) {
13822
+ if (!partial && !this.#form && (this.#endCheck || this.#literalCheck) && lastChecked !== f) {
13823
+ lastChecked = f;
13824
+ const can = this.#canMatch(f);
13825
+ if (can === "no")
13826
+ return options2.flipNegate ? false : this.negate;
13827
+ if (can === "yes")
13828
+ return options2.flipNegate ? true : !this.negate;
13829
+ }
13830
+ split = this.#split(f);
13831
+ }
13832
+ const ff = split.parts;
13833
+ const resolved = this.#level2 ? split.resolved ??= this.#levelTwoFileOptimize(ff) : ff;
12939
13834
  const set = this.set;
12940
- this.debug(this.pattern, "set", set);
12941
13835
  let filename = ff[ff.length - 1];
12942
13836
  if (!filename) {
12943
13837
  for (let i = ff.length - 2; !filename && i >= 0; i--) {
12944
13838
  filename = ff[i];
12945
13839
  }
12946
13840
  }
12947
- for (const pattern of set) {
12948
- let file = ff;
12949
- if (options2.matchBase && pattern.length === 1) {
12950
- file = [filename];
12951
- }
12952
- const hit = this.matchOne(file, pattern, partial);
13841
+ for (let r = 0; r < set.length; r++) {
13842
+ const pattern = set[r];
13843
+ const shape = partial ? void 0 : this.#shapes[r];
13844
+ const hit = shape === "base" ? portionMatch(pattern[0], filename) : shape ? this.#matchShape(resolved, pattern, shape) : options2.matchBase && pattern.length === 1 ? this.#matchRow([filename], [filename], pattern, partial) : this.#matchRow(ff, resolved, pattern, partial);
12953
13845
  if (hit) {
12954
13846
  if (options2.flipNegate) {
12955
13847
  return true;
@@ -12966,7 +13858,6 @@ var Minimatch = class {
12966
13858
  return minimatch.defaults(def).Minimatch;
12967
13859
  }
12968
13860
  };
12969
- minimatch.AST = AST;
12970
13861
  minimatch.Minimatch = Minimatch;
12971
13862
  minimatch.escape = escape;
12972
13863
  minimatch.unescape = unescape;
@@ -13135,8 +14026,8 @@ function listOutputModeError(args) {
13135
14026
  return modes.size > 1 ? "mcp list accepts only one output mode: --schema, --all-parameters, or --status." : void 0;
13136
14027
  }
13137
14028
  function closestName(input2, candidates) {
13138
- const normalize = (value) => value.replace(/[^a-z0-9]/gi, "").toLowerCase();
13139
- const source = normalize(input2);
14029
+ const normalize2 = (value) => value.replace(/[^a-z0-9]/gi, "").toLowerCase();
14030
+ const source = normalize2(input2);
13140
14031
  const distance = (left, right) => {
13141
14032
  let previous = Array.from(
13142
14033
  { length: right.length + 1 },
@@ -13158,14 +14049,14 @@ function closestName(input2, candidates) {
13158
14049
  let best;
13159
14050
  let bestDistance = Number.POSITIVE_INFINITY;
13160
14051
  for (const candidate of candidates) {
13161
- const candidateDistance = distance(source, normalize(candidate));
14052
+ const candidateDistance = distance(source, normalize2(candidate));
13162
14053
  if (candidateDistance < bestDistance) {
13163
14054
  best = candidate;
13164
14055
  bestDistance = candidateDistance;
13165
14056
  }
13166
14057
  }
13167
14058
  if (!best) return void 0;
13168
- const baseline = Math.max(source.length, normalize(best).length, 1);
14059
+ const baseline = Math.max(source.length, normalize2(best).length, 1);
13169
14060
  return bestDistance <= Math.max(2, Math.floor(baseline / 3)) ? best : void 0;
13170
14061
  }
13171
14062
  function validateExactTarget(policy, server, tool) {
@@ -13302,7 +14193,7 @@ function loadMcporterCli() {
13302
14193
  if (mcporterCliPromise) return mcporterCliPromise;
13303
14194
  const previousDisableAutorun = process.env.MCPORTER_DISABLE_AUTORUN;
13304
14195
  process.env.MCPORTER_DISABLE_AUTORUN = "1";
13305
- mcporterCliPromise = import("./cli-UQ5QXFXU.js").finally(() => {
14196
+ mcporterCliPromise = import("./cli-TJFAYJO4.js").finally(() => {
13306
14197
  if (previousDisableAutorun === void 0) {
13307
14198
  delete process.env.MCPORTER_DISABLE_AUTORUN;
13308
14199
  } else {
@@ -14968,12 +15859,12 @@ function describeSharedCallError(error, server, tool) {
14968
15859
  return issue.rawMessage || (error instanceof Error ? error.message : String(error));
14969
15860
  }
14970
15861
  async function loadCallCatalogEntry(runtime, server, tool, timeoutMs) {
14971
- let cache = callCatalogCache.get(runtime);
14972
- if (!cache) {
14973
- cache = /* @__PURE__ */ new Map();
14974
- callCatalogCache.set(runtime, cache);
15862
+ let cache2 = callCatalogCache.get(runtime);
15863
+ if (!cache2) {
15864
+ cache2 = /* @__PURE__ */ new Map();
15865
+ callCatalogCache.set(runtime, cache2);
14975
15866
  }
14976
- let pending = cache.get(server);
15867
+ let pending = cache2.get(server);
14977
15868
  if (!pending) {
14978
15869
  pending = (async () => {
14979
15870
  const sessionServer = (await readSession()).servers.find(
@@ -14986,9 +15877,9 @@ async function loadCallCatalogEntry(runtime, server, tool, timeoutMs) {
14986
15877
  DEFAULT_LIST_TIMEOUT_MS
14987
15878
  );
14988
15879
  })();
14989
- cache.set(server, pending);
15880
+ cache2.set(server, pending);
14990
15881
  void pending.catch(() => {
14991
- if (cache?.get(server) === pending) cache.delete(server);
15882
+ if (cache2?.get(server) === pending) cache2.delete(server);
14992
15883
  });
14993
15884
  }
14994
15885
  const catalog = await withListTimeout(pending, timeoutMs).catch(