@stencil/core 4.39.0 → 4.40.1-dev.1766552834.64f6089

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 (39) hide show
  1. package/cli/index.cjs +1616 -41
  2. package/cli/index.js +1616 -41
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +2791 -2515
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +2 -2
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +1665 -90
  12. package/internal/app-data/index.cjs +1 -0
  13. package/internal/app-data/index.js +1 -0
  14. package/internal/app-data/package.json +1 -1
  15. package/internal/app-globals/package.json +1 -1
  16. package/internal/client/index.js +1746 -105
  17. package/internal/client/package.json +1 -1
  18. package/internal/client/patch-browser.js +1 -1
  19. package/internal/hydrate/index.js +1770 -133
  20. package/internal/hydrate/package.json +1 -1
  21. package/internal/hydrate/runner.js +1794 -104
  22. package/internal/package.json +1 -1
  23. package/internal/stencil-private.d.ts +25 -2
  24. package/internal/stencil-public-compiler.d.ts +33 -3
  25. package/internal/stencil-public-runtime.d.ts +14 -3
  26. package/internal/testing/index.js +1758 -133
  27. package/internal/testing/package.json +1 -1
  28. package/mock-doc/index.cjs +8 -1
  29. package/mock-doc/index.js +8 -1
  30. package/mock-doc/package.json +1 -1
  31. package/package.json +1 -1
  32. package/screenshot/index.js +1608 -30
  33. package/screenshot/package.json +1 -1
  34. package/screenshot/pixel-match.js +1 -1
  35. package/sys/node/index.js +28 -28
  36. package/sys/node/package.json +1 -1
  37. package/sys/node/worker.js +1 -1
  38. package/testing/index.js +1696 -109
  39. package/testing/package.json +1 -1
package/cli/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil CLI v4.39.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil CLI v4.40.1-dev.1766552834.64f6089 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -7,6 +7,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
8
  var __getProtoOf = Object.getPrototypeOf;
9
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __typeError = (msg) => {
11
+ throw TypeError(msg);
12
+ };
13
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
14
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
11
15
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
12
16
  }) : x)(function(x) {
@@ -36,6 +40,220 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
40
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
37
41
  mod
38
42
  ));
43
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
44
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
45
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
46
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
47
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
48
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
49
+
50
+ // node_modules/balanced-match/index.js
51
+ var require_balanced_match = __commonJS({
52
+ "node_modules/balanced-match/index.js"(exports, module) {
53
+ "use strict";
54
+ module.exports = balanced;
55
+ function balanced(a, b, str) {
56
+ if (a instanceof RegExp) a = maybeMatch(a, str);
57
+ if (b instanceof RegExp) b = maybeMatch(b, str);
58
+ var r = range(a, b, str);
59
+ return r && {
60
+ start: r[0],
61
+ end: r[1],
62
+ pre: str.slice(0, r[0]),
63
+ body: str.slice(r[0] + a.length, r[1]),
64
+ post: str.slice(r[1] + b.length)
65
+ };
66
+ }
67
+ function maybeMatch(reg, str) {
68
+ var m = str.match(reg);
69
+ return m ? m[0] : null;
70
+ }
71
+ balanced.range = range;
72
+ function range(a, b, str) {
73
+ var begs, beg, left, right, result;
74
+ var ai = str.indexOf(a);
75
+ var bi = str.indexOf(b, ai + 1);
76
+ var i = ai;
77
+ if (ai >= 0 && bi > 0) {
78
+ if (a === b) {
79
+ return [ai, bi];
80
+ }
81
+ begs = [];
82
+ left = str.length;
83
+ while (i >= 0 && !result) {
84
+ if (i == ai) {
85
+ begs.push(i);
86
+ ai = str.indexOf(a, i + 1);
87
+ } else if (begs.length == 1) {
88
+ result = [begs.pop(), bi];
89
+ } else {
90
+ beg = begs.pop();
91
+ if (beg < left) {
92
+ left = beg;
93
+ right = bi;
94
+ }
95
+ bi = str.indexOf(b, i + 1);
96
+ }
97
+ i = ai < bi && ai >= 0 ? ai : bi;
98
+ }
99
+ if (begs.length) {
100
+ result = [left, right];
101
+ }
102
+ }
103
+ return result;
104
+ }
105
+ }
106
+ });
107
+
108
+ // node_modules/brace-expansion/index.js
109
+ var require_brace_expansion = __commonJS({
110
+ "node_modules/brace-expansion/index.js"(exports, module) {
111
+ var balanced = require_balanced_match();
112
+ module.exports = expandTop;
113
+ var escSlash = "\0SLASH" + Math.random() + "\0";
114
+ var escOpen = "\0OPEN" + Math.random() + "\0";
115
+ var escClose = "\0CLOSE" + Math.random() + "\0";
116
+ var escComma = "\0COMMA" + Math.random() + "\0";
117
+ var escPeriod = "\0PERIOD" + Math.random() + "\0";
118
+ function numeric(str) {
119
+ return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
120
+ }
121
+ function escapeBraces(str) {
122
+ return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
123
+ }
124
+ function unescapeBraces(str) {
125
+ return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
126
+ }
127
+ function parseCommaParts(str) {
128
+ if (!str)
129
+ return [""];
130
+ var parts = [];
131
+ var m = balanced("{", "}", str);
132
+ if (!m)
133
+ return str.split(",");
134
+ var pre = m.pre;
135
+ var body = m.body;
136
+ var post = m.post;
137
+ var p = pre.split(",");
138
+ p[p.length - 1] += "{" + body + "}";
139
+ var postParts = parseCommaParts(post);
140
+ if (post.length) {
141
+ p[p.length - 1] += postParts.shift();
142
+ p.push.apply(p, postParts);
143
+ }
144
+ parts.push.apply(parts, p);
145
+ return parts;
146
+ }
147
+ function expandTop(str) {
148
+ if (!str)
149
+ return [];
150
+ if (str.substr(0, 2) === "{}") {
151
+ str = "\\{\\}" + str.substr(2);
152
+ }
153
+ return expand2(escapeBraces(str), true).map(unescapeBraces);
154
+ }
155
+ function embrace(str) {
156
+ return "{" + str + "}";
157
+ }
158
+ function isPadded(el) {
159
+ return /^-?0\d/.test(el);
160
+ }
161
+ function lte(i, y) {
162
+ return i <= y;
163
+ }
164
+ function gte(i, y) {
165
+ return i >= y;
166
+ }
167
+ function expand2(str, isTop) {
168
+ var expansions = [];
169
+ var m = balanced("{", "}", str);
170
+ if (!m) return [str];
171
+ var pre = m.pre;
172
+ var post = m.post.length ? expand2(m.post, false) : [""];
173
+ if (/\$$/.test(m.pre)) {
174
+ for (var k = 0; k < post.length; k++) {
175
+ var expansion = pre + "{" + m.body + "}" + post[k];
176
+ expansions.push(expansion);
177
+ }
178
+ } else {
179
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
180
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
181
+ var isSequence = isNumericSequence || isAlphaSequence;
182
+ var isOptions = m.body.indexOf(",") >= 0;
183
+ if (!isSequence && !isOptions) {
184
+ if (m.post.match(/,(?!,).*\}/)) {
185
+ str = m.pre + "{" + m.body + escClose + m.post;
186
+ return expand2(str);
187
+ }
188
+ return [str];
189
+ }
190
+ var n;
191
+ if (isSequence) {
192
+ n = m.body.split(/\.\./);
193
+ } else {
194
+ n = parseCommaParts(m.body);
195
+ if (n.length === 1) {
196
+ n = expand2(n[0], false).map(embrace);
197
+ if (n.length === 1) {
198
+ return post.map(function(p) {
199
+ return m.pre + n[0] + p;
200
+ });
201
+ }
202
+ }
203
+ }
204
+ var N;
205
+ if (isSequence) {
206
+ var x = numeric(n[0]);
207
+ var y = numeric(n[1]);
208
+ var width = Math.max(n[0].length, n[1].length);
209
+ var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
210
+ var test = lte;
211
+ var reverse = y < x;
212
+ if (reverse) {
213
+ incr *= -1;
214
+ test = gte;
215
+ }
216
+ var pad = n.some(isPadded);
217
+ N = [];
218
+ for (var i = x; test(i, y); i += incr) {
219
+ var c;
220
+ if (isAlphaSequence) {
221
+ c = String.fromCharCode(i);
222
+ if (c === "\\")
223
+ c = "";
224
+ } else {
225
+ c = String(i);
226
+ if (pad) {
227
+ var need = width - c.length;
228
+ if (need > 0) {
229
+ var z = new Array(need + 1).join("0");
230
+ if (i < 0)
231
+ c = "-" + z + c.slice(1);
232
+ else
233
+ c = z + c;
234
+ }
235
+ }
236
+ }
237
+ N.push(c);
238
+ }
239
+ } else {
240
+ N = [];
241
+ for (var j = 0; j < n.length; j++) {
242
+ N.push.apply(N, expand2(n[j], false));
243
+ }
244
+ }
245
+ for (var j = 0; j < N.length; j++) {
246
+ for (var k = 0; k < post.length; k++) {
247
+ var expansion = pre + N[j] + post[k];
248
+ if (!isTop || isSequence || expansion)
249
+ expansions.push(expansion);
250
+ }
251
+ }
252
+ }
253
+ return expansions;
254
+ }
255
+ }
256
+ });
39
257
 
40
258
  // node_modules/kleur/index.js
41
259
  var require_kleur = __commonJS({
@@ -1209,9 +1427,9 @@ var require_date = __commonJS({
1209
1427
  let result;
1210
1428
  this.parts = [];
1211
1429
  while (result = regex.exec(mask)) {
1212
- let match = result.shift();
1430
+ let match2 = result.shift();
1213
1431
  let idx = result.findIndex((gr) => gr != null);
1214
- this.parts.push(idx in regexGroups ? regexGroups[idx]({ token: result[idx] || match, date: this.date, parts: this.parts, locales: this.locales }) : result[idx] || match);
1432
+ this.parts.push(idx in regexGroups ? regexGroups[idx]({ token: result[idx] || match2, date: this.date, parts: this.parts, locales: this.locales }) : result[idx] || match2);
1215
1433
  }
1216
1434
  let parts = this.parts.reduce((arr, i) => {
1217
1435
  if (typeof i === "string" && typeof arr[arr.length - 1] === "string")
@@ -2228,9 +2446,9 @@ var require_prompts = __commonJS({
2228
2446
  $.date = (args) => toPrompt("DatePrompt", args);
2229
2447
  $.confirm = (args) => toPrompt("ConfirmPrompt", args);
2230
2448
  $.list = (args) => {
2231
- const sep = args.separator || ",";
2449
+ const sep2 = args.separator || ",";
2232
2450
  return toPrompt("TextPrompt", args, {
2233
- onSubmit: (str) => str.split(sep).map((s) => s.trim())
2451
+ onSubmit: (str) => str.split(sep2).map((s) => s.trim())
2234
2452
  });
2235
2453
  };
2236
2454
  $.toggle = (args) => toPrompt("TogglePrompt", args);
@@ -2595,12 +2813,12 @@ var shouldIgnoreError = (msg) => {
2595
2813
  var TASK_CANCELED_MSG = `task canceled`;
2596
2814
 
2597
2815
  // src/utils/path.ts
2598
- var normalizePath = (path, relativize = true) => {
2599
- if (typeof path !== "string") {
2816
+ var normalizePath = (path2, relativize = true) => {
2817
+ if (typeof path2 !== "string") {
2600
2818
  throw new Error(`invalid path to normalize`);
2601
2819
  }
2602
- path = normalizeSlashes(path.trim());
2603
- const components = pathComponents(path, getRootLength(path));
2820
+ path2 = normalizeSlashes(path2.trim());
2821
+ const components = pathComponents(path2, getRootLength(path2));
2604
2822
  const reducedComponents = reducePathComponents(components);
2605
2823
  const rootPart = reducedComponents[0];
2606
2824
  const secondPart = reducedComponents[1];
@@ -2608,12 +2826,12 @@ var normalizePath = (path, relativize = true) => {
2608
2826
  if (normalized === "") {
2609
2827
  return ".";
2610
2828
  }
2611
- if (rootPart === "" && secondPart && path.includes("/") && !secondPart.startsWith(".") && !secondPart.startsWith("@") && relativize) {
2829
+ if (rootPart === "" && secondPart && path2.includes("/") && !secondPart.startsWith(".") && !secondPart.startsWith("@") && relativize) {
2612
2830
  return "./" + normalized;
2613
2831
  }
2614
2832
  return normalized;
2615
2833
  };
2616
- var normalizeSlashes = (path) => path.replace(backslashRegExp, "/");
2834
+ var normalizeSlashes = (path2) => path2.replace(backslashRegExp, "/");
2617
2835
  var altDirectorySeparator = "\\";
2618
2836
  var urlSchemeSeparator = "://";
2619
2837
  var backslashRegExp = /\\/g;
@@ -2638,45 +2856,45 @@ var reducePathComponents = (components) => {
2638
2856
  }
2639
2857
  return reduced;
2640
2858
  };
2641
- var getRootLength = (path) => {
2642
- const rootLength = getEncodedRootLength(path);
2859
+ var getRootLength = (path2) => {
2860
+ const rootLength = getEncodedRootLength(path2);
2643
2861
  return rootLength < 0 ? ~rootLength : rootLength;
2644
2862
  };
2645
- var getEncodedRootLength = (path) => {
2646
- if (!path) return 0;
2647
- const ch0 = path.charCodeAt(0);
2863
+ var getEncodedRootLength = (path2) => {
2864
+ if (!path2) return 0;
2865
+ const ch0 = path2.charCodeAt(0);
2648
2866
  if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) {
2649
- if (path.charCodeAt(1) !== ch0) return 1;
2650
- const p1 = path.indexOf(ch0 === 47 /* slash */ ? "/" : altDirectorySeparator, 2);
2651
- if (p1 < 0) return path.length;
2867
+ if (path2.charCodeAt(1) !== ch0) return 1;
2868
+ const p1 = path2.indexOf(ch0 === 47 /* slash */ ? "/" : altDirectorySeparator, 2);
2869
+ if (p1 < 0) return path2.length;
2652
2870
  return p1 + 1;
2653
2871
  }
2654
- if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) {
2655
- const ch2 = path.charCodeAt(2);
2872
+ if (isVolumeCharacter(ch0) && path2.charCodeAt(1) === 58 /* colon */) {
2873
+ const ch2 = path2.charCodeAt(2);
2656
2874
  if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) return 3;
2657
- if (path.length === 2) return 2;
2875
+ if (path2.length === 2) return 2;
2658
2876
  }
2659
- const schemeEnd = path.indexOf(urlSchemeSeparator);
2877
+ const schemeEnd = path2.indexOf(urlSchemeSeparator);
2660
2878
  if (schemeEnd !== -1) {
2661
2879
  const authorityStart = schemeEnd + urlSchemeSeparator.length;
2662
- const authorityEnd = path.indexOf("/", authorityStart);
2880
+ const authorityEnd = path2.indexOf("/", authorityStart);
2663
2881
  if (authorityEnd !== -1) {
2664
- const scheme = path.slice(0, schemeEnd);
2665
- const authority = path.slice(authorityStart, authorityEnd);
2666
- if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
2667
- const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);
2882
+ const scheme = path2.slice(0, schemeEnd);
2883
+ const authority = path2.slice(authorityStart, authorityEnd);
2884
+ if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path2.charCodeAt(authorityEnd + 1))) {
2885
+ const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path2, authorityEnd + 2);
2668
2886
  if (volumeSeparatorEnd !== -1) {
2669
- if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) {
2887
+ if (path2.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) {
2670
2888
  return ~(volumeSeparatorEnd + 1);
2671
2889
  }
2672
- if (volumeSeparatorEnd === path.length) {
2890
+ if (volumeSeparatorEnd === path2.length) {
2673
2891
  return ~volumeSeparatorEnd;
2674
2892
  }
2675
2893
  }
2676
2894
  }
2677
2895
  return ~(authorityEnd + 1);
2678
2896
  }
2679
- return ~path.length;
2897
+ return ~path2.length;
2680
2898
  }
2681
2899
  return 0;
2682
2900
  };
@@ -2690,9 +2908,9 @@ var getFileUrlVolumeSeparatorEnd = (url, start) => {
2690
2908
  }
2691
2909
  return -1;
2692
2910
  };
2693
- var pathComponents = (path, rootLength) => {
2694
- const root = path.substring(0, rootLength);
2695
- const rest = path.substring(rootLength).split("/");
2911
+ var pathComponents = (path2, rootLength) => {
2912
+ const root = path2.substring(0, rootLength);
2913
+ const rest = path2.substring(rootLength).split("/");
2696
2914
  const restLen = rest.length;
2697
2915
  if (restLen > 0 && !rest[restLen - 1]) {
2698
2916
  rest.pop();
@@ -2700,6 +2918,1359 @@ var pathComponents = (path, rootLength) => {
2700
2918
  return [root, ...rest];
2701
2919
  };
2702
2920
 
2921
+ // node_modules/minimatch/dist/esm/index.js
2922
+ var import_brace_expansion = __toESM(require_brace_expansion(), 1);
2923
+
2924
+ // node_modules/minimatch/dist/esm/assert-valid-pattern.js
2925
+ var MAX_PATTERN_LENGTH = 1024 * 64;
2926
+ var assertValidPattern = (pattern) => {
2927
+ if (typeof pattern !== "string") {
2928
+ throw new TypeError("invalid pattern");
2929
+ }
2930
+ if (pattern.length > MAX_PATTERN_LENGTH) {
2931
+ throw new TypeError("pattern is too long");
2932
+ }
2933
+ };
2934
+
2935
+ // node_modules/minimatch/dist/esm/brace-expressions.js
2936
+ var posixClasses = {
2937
+ "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
2938
+ "[:alpha:]": ["\\p{L}\\p{Nl}", true],
2939
+ "[:ascii:]": ["\\x00-\\x7f", false],
2940
+ "[:blank:]": ["\\p{Zs}\\t", true],
2941
+ "[:cntrl:]": ["\\p{Cc}", true],
2942
+ "[:digit:]": ["\\p{Nd}", true],
2943
+ "[:graph:]": ["\\p{Z}\\p{C}", true, true],
2944
+ "[:lower:]": ["\\p{Ll}", true],
2945
+ "[:print:]": ["\\p{C}", true],
2946
+ "[:punct:]": ["\\p{P}", true],
2947
+ "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
2948
+ "[:upper:]": ["\\p{Lu}", true],
2949
+ "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
2950
+ "[:xdigit:]": ["A-Fa-f0-9", false]
2951
+ };
2952
+ var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
2953
+ var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
2954
+ var rangesToString = (ranges) => ranges.join("");
2955
+ var parseClass = (glob, position) => {
2956
+ const pos = position;
2957
+ if (glob.charAt(pos) !== "[") {
2958
+ throw new Error("not in a brace expression");
2959
+ }
2960
+ const ranges = [];
2961
+ const negs = [];
2962
+ let i = pos + 1;
2963
+ let sawStart = false;
2964
+ let uflag = false;
2965
+ let escaping = false;
2966
+ let negate = false;
2967
+ let endPos = pos;
2968
+ let rangeStart = "";
2969
+ WHILE: while (i < glob.length) {
2970
+ const c = glob.charAt(i);
2971
+ if ((c === "!" || c === "^") && i === pos + 1) {
2972
+ negate = true;
2973
+ i++;
2974
+ continue;
2975
+ }
2976
+ if (c === "]" && sawStart && !escaping) {
2977
+ endPos = i + 1;
2978
+ break;
2979
+ }
2980
+ sawStart = true;
2981
+ if (c === "\\") {
2982
+ if (!escaping) {
2983
+ escaping = true;
2984
+ i++;
2985
+ continue;
2986
+ }
2987
+ }
2988
+ if (c === "[" && !escaping) {
2989
+ for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
2990
+ if (glob.startsWith(cls, i)) {
2991
+ if (rangeStart) {
2992
+ return ["$.", false, glob.length - pos, true];
2993
+ }
2994
+ i += cls.length;
2995
+ if (neg)
2996
+ negs.push(unip);
2997
+ else
2998
+ ranges.push(unip);
2999
+ uflag = uflag || u;
3000
+ continue WHILE;
3001
+ }
3002
+ }
3003
+ }
3004
+ escaping = false;
3005
+ if (rangeStart) {
3006
+ if (c > rangeStart) {
3007
+ ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
3008
+ } else if (c === rangeStart) {
3009
+ ranges.push(braceEscape(c));
3010
+ }
3011
+ rangeStart = "";
3012
+ i++;
3013
+ continue;
3014
+ }
3015
+ if (glob.startsWith("-]", i + 1)) {
3016
+ ranges.push(braceEscape(c + "-"));
3017
+ i += 2;
3018
+ continue;
3019
+ }
3020
+ if (glob.startsWith("-", i + 1)) {
3021
+ rangeStart = c;
3022
+ i += 2;
3023
+ continue;
3024
+ }
3025
+ ranges.push(braceEscape(c));
3026
+ i++;
3027
+ }
3028
+ if (endPos < i) {
3029
+ return ["", false, 0, false];
3030
+ }
3031
+ if (!ranges.length && !negs.length) {
3032
+ return ["$.", false, glob.length - pos, true];
3033
+ }
3034
+ if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
3035
+ const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
3036
+ return [regexpEscape(r), false, endPos - pos, false];
3037
+ }
3038
+ const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
3039
+ const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
3040
+ const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
3041
+ return [comb, uflag, endPos - pos, true];
3042
+ };
3043
+
3044
+ // node_modules/minimatch/dist/esm/unescape.js
3045
+ var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
3046
+ return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
3047
+ };
3048
+
3049
+ // node_modules/minimatch/dist/esm/ast.js
3050
+ var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
3051
+ var isExtglobType = (c) => types.has(c);
3052
+ var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
3053
+ var startNoDot = "(?!\\.)";
3054
+ var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
3055
+ var justDots = /* @__PURE__ */ new Set(["..", "."]);
3056
+ var reSpecials = new Set("().*{}+?[]^$\\!");
3057
+ var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
3058
+ var qmark = "[^/]";
3059
+ var star = qmark + "*?";
3060
+ var starNoEmpty = qmark + "+?";
3061
+ var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn;
3062
+ var _AST = class _AST {
3063
+ constructor(type, parent, options = {}) {
3064
+ __privateAdd(this, _AST_instances);
3065
+ __publicField(this, "type");
3066
+ __privateAdd(this, _root);
3067
+ __privateAdd(this, _hasMagic);
3068
+ __privateAdd(this, _uflag, false);
3069
+ __privateAdd(this, _parts, []);
3070
+ __privateAdd(this, _parent);
3071
+ __privateAdd(this, _parentIndex);
3072
+ __privateAdd(this, _negs);
3073
+ __privateAdd(this, _filledNegs, false);
3074
+ __privateAdd(this, _options);
3075
+ __privateAdd(this, _toString);
3076
+ // set to true if it's an extglob with no children
3077
+ // (which really means one child of '')
3078
+ __privateAdd(this, _emptyExt, false);
3079
+ this.type = type;
3080
+ if (type)
3081
+ __privateSet(this, _hasMagic, true);
3082
+ __privateSet(this, _parent, parent);
3083
+ __privateSet(this, _root, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _root) : this);
3084
+ __privateSet(this, _options, __privateGet(this, _root) === this ? options : __privateGet(__privateGet(this, _root), _options));
3085
+ __privateSet(this, _negs, __privateGet(this, _root) === this ? [] : __privateGet(__privateGet(this, _root), _negs));
3086
+ if (type === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
3087
+ __privateGet(this, _negs).push(this);
3088
+ __privateSet(this, _parentIndex, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0);
3089
+ }
3090
+ get hasMagic() {
3091
+ if (__privateGet(this, _hasMagic) !== void 0)
3092
+ return __privateGet(this, _hasMagic);
3093
+ for (const p of __privateGet(this, _parts)) {
3094
+ if (typeof p === "string")
3095
+ continue;
3096
+ if (p.type || p.hasMagic)
3097
+ return __privateSet(this, _hasMagic, true);
3098
+ }
3099
+ return __privateGet(this, _hasMagic);
3100
+ }
3101
+ // reconstructs the pattern
3102
+ toString() {
3103
+ if (__privateGet(this, _toString) !== void 0)
3104
+ return __privateGet(this, _toString);
3105
+ if (!this.type) {
3106
+ return __privateSet(this, _toString, __privateGet(this, _parts).map((p) => String(p)).join(""));
3107
+ } else {
3108
+ return __privateSet(this, _toString, this.type + "(" + __privateGet(this, _parts).map((p) => String(p)).join("|") + ")");
3109
+ }
3110
+ }
3111
+ push(...parts) {
3112
+ for (const p of parts) {
3113
+ if (p === "")
3114
+ continue;
3115
+ if (typeof p !== "string" && !(p instanceof _AST && __privateGet(p, _parent) === this)) {
3116
+ throw new Error("invalid part: " + p);
3117
+ }
3118
+ __privateGet(this, _parts).push(p);
3119
+ }
3120
+ }
3121
+ toJSON() {
3122
+ var _a;
3123
+ const ret = this.type === null ? __privateGet(this, _parts).slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...__privateGet(this, _parts).map((p) => p.toJSON())];
3124
+ if (this.isStart() && !this.type)
3125
+ ret.unshift([]);
3126
+ if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")) {
3127
+ ret.push({});
3128
+ }
3129
+ return ret;
3130
+ }
3131
+ isStart() {
3132
+ var _a;
3133
+ if (__privateGet(this, _root) === this)
3134
+ return true;
3135
+ if (!((_a = __privateGet(this, _parent)) == null ? void 0 : _a.isStart()))
3136
+ return false;
3137
+ if (__privateGet(this, _parentIndex) === 0)
3138
+ return true;
3139
+ const p = __privateGet(this, _parent);
3140
+ for (let i = 0; i < __privateGet(this, _parentIndex); i++) {
3141
+ const pp = __privateGet(p, _parts)[i];
3142
+ if (!(pp instanceof _AST && pp.type === "!")) {
3143
+ return false;
3144
+ }
3145
+ }
3146
+ return true;
3147
+ }
3148
+ isEnd() {
3149
+ var _a, _b, _c;
3150
+ if (__privateGet(this, _root) === this)
3151
+ return true;
3152
+ if (((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")
3153
+ return true;
3154
+ if (!((_b = __privateGet(this, _parent)) == null ? void 0 : _b.isEnd()))
3155
+ return false;
3156
+ if (!this.type)
3157
+ return (_c = __privateGet(this, _parent)) == null ? void 0 : _c.isEnd();
3158
+ const pl = __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0;
3159
+ return __privateGet(this, _parentIndex) === pl - 1;
3160
+ }
3161
+ copyIn(part) {
3162
+ if (typeof part === "string")
3163
+ this.push(part);
3164
+ else
3165
+ this.push(part.clone(this));
3166
+ }
3167
+ clone(parent) {
3168
+ const c = new _AST(this.type, parent);
3169
+ for (const p of __privateGet(this, _parts)) {
3170
+ c.copyIn(p);
3171
+ }
3172
+ return c;
3173
+ }
3174
+ static fromGlob(pattern, options = {}) {
3175
+ var _a;
3176
+ const ast = new _AST(null, void 0, options);
3177
+ __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, pattern, ast, 0, options);
3178
+ return ast;
3179
+ }
3180
+ // returns the regular expression if there's magic, or the unescaped
3181
+ // string if not.
3182
+ toMMPattern() {
3183
+ if (this !== __privateGet(this, _root))
3184
+ return __privateGet(this, _root).toMMPattern();
3185
+ const glob = this.toString();
3186
+ const [re, body, hasMagic, uflag] = this.toRegExpSource();
3187
+ const anyMagic = hasMagic || __privateGet(this, _hasMagic) || __privateGet(this, _options).nocase && !__privateGet(this, _options).nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
3188
+ if (!anyMagic) {
3189
+ return body;
3190
+ }
3191
+ const flags = (__privateGet(this, _options).nocase ? "i" : "") + (uflag ? "u" : "");
3192
+ return Object.assign(new RegExp(`^${re}$`, flags), {
3193
+ _src: re,
3194
+ _glob: glob
3195
+ });
3196
+ }
3197
+ get options() {
3198
+ return __privateGet(this, _options);
3199
+ }
3200
+ // returns the string match, the regexp source, whether there's magic
3201
+ // in the regexp (so a regular expression is required) and whether or
3202
+ // not the uflag is needed for the regular expression (for posix classes)
3203
+ // TODO: instead of injecting the start/end at this point, just return
3204
+ // the BODY of the regexp, along with the start/end portions suitable
3205
+ // for binding the start/end in either a joined full-path makeRe context
3206
+ // (where we bind to (^|/), or a standalone matchPart context (where
3207
+ // we bind to ^, and not /). Otherwise slashes get duped!
3208
+ //
3209
+ // In part-matching mode, the start is:
3210
+ // - if not isStart: nothing
3211
+ // - if traversal possible, but not allowed: ^(?!\.\.?$)
3212
+ // - if dots allowed or not possible: ^
3213
+ // - if dots possible and not allowed: ^(?!\.)
3214
+ // end is:
3215
+ // - if not isEnd(): nothing
3216
+ // - else: $
3217
+ //
3218
+ // In full-path matching mode, we put the slash at the START of the
3219
+ // pattern, so start is:
3220
+ // - if first pattern: same as part-matching mode
3221
+ // - if not isStart(): nothing
3222
+ // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
3223
+ // - if dots allowed or not possible: /
3224
+ // - if dots possible and not allowed: /(?!\.)
3225
+ // end is:
3226
+ // - if last pattern, same as part-matching mode
3227
+ // - else nothing
3228
+ //
3229
+ // Always put the (?:$|/) on negated tails, though, because that has to be
3230
+ // there to bind the end of the negated pattern portion, and it's easier to
3231
+ // just stick it in now rather than try to inject it later in the middle of
3232
+ // the pattern.
3233
+ //
3234
+ // We can just always return the same end, and leave it up to the caller
3235
+ // to know whether it's going to be used joined or in parts.
3236
+ // And, if the start is adjusted slightly, can do the same there:
3237
+ // - if not isStart: nothing
3238
+ // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
3239
+ // - if dots allowed or not possible: (?:/|^)
3240
+ // - if dots possible and not allowed: (?:/|^)(?!\.)
3241
+ //
3242
+ // But it's better to have a simpler binding without a conditional, for
3243
+ // performance, so probably better to return both start options.
3244
+ //
3245
+ // Then the caller just ignores the end if it's not the first pattern,
3246
+ // and the start always gets applied.
3247
+ //
3248
+ // But that's always going to be $ if it's the ending pattern, or nothing,
3249
+ // so the caller can just attach $ at the end of the pattern when building.
3250
+ //
3251
+ // So the todo is:
3252
+ // - better detect what kind of start is needed
3253
+ // - return both flavors of starting pattern
3254
+ // - attach $ at the end of the pattern when creating the actual RegExp
3255
+ //
3256
+ // Ah, but wait, no, that all only applies to the root when the first pattern
3257
+ // is not an extglob. If the first pattern IS an extglob, then we need all
3258
+ // that dot prevention biz to live in the extglob portions, because eg
3259
+ // +(*|.x*) can match .xy but not .yx.
3260
+ //
3261
+ // So, return the two flavors if it's #root and the first child is not an
3262
+ // AST, otherwise leave it to the child AST to handle it, and there,
3263
+ // use the (?:^|/) style of start binding.
3264
+ //
3265
+ // Even simplified further:
3266
+ // - Since the start for a join is eg /(?!\.) and the start for a part
3267
+ // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
3268
+ // or start or whatever) and prepend ^ or / at the Regexp construction.
3269
+ toRegExpSource(allowDot) {
3270
+ var _a;
3271
+ const dot = allowDot != null ? allowDot : !!__privateGet(this, _options).dot;
3272
+ if (__privateGet(this, _root) === this)
3273
+ __privateMethod(this, _AST_instances, fillNegs_fn).call(this);
3274
+ if (!this.type) {
3275
+ const noEmpty = this.isStart() && this.isEnd();
3276
+ const src = __privateGet(this, _parts).map((p) => {
3277
+ var _a2;
3278
+ const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(_a2 = _AST, _AST_static, parseGlob_fn).call(_a2, p, __privateGet(this, _hasMagic), noEmpty) : p.toRegExpSource(allowDot);
3279
+ __privateSet(this, _hasMagic, __privateGet(this, _hasMagic) || hasMagic);
3280
+ __privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
3281
+ return re;
3282
+ }).join("");
3283
+ let start2 = "";
3284
+ if (this.isStart()) {
3285
+ if (typeof __privateGet(this, _parts)[0] === "string") {
3286
+ const dotTravAllowed = __privateGet(this, _parts).length === 1 && justDots.has(__privateGet(this, _parts)[0]);
3287
+ if (!dotTravAllowed) {
3288
+ const aps = addPatternStart;
3289
+ const needNoTrav = (
3290
+ // dots are allowed, and the pattern starts with [ or .
3291
+ dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
3292
+ src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
3293
+ src.startsWith("\\.\\.") && aps.has(src.charAt(4))
3294
+ );
3295
+ const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
3296
+ start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
3297
+ }
3298
+ }
3299
+ }
3300
+ let end = "";
3301
+ if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!") {
3302
+ end = "(?:$|\\/)";
3303
+ }
3304
+ const final2 = start2 + src + end;
3305
+ return [
3306
+ final2,
3307
+ unescape(src),
3308
+ __privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
3309
+ __privateGet(this, _uflag)
3310
+ ];
3311
+ }
3312
+ const repeated = this.type === "*" || this.type === "+";
3313
+ const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
3314
+ let body = __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, dot);
3315
+ if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
3316
+ const s = this.toString();
3317
+ __privateSet(this, _parts, [s]);
3318
+ this.type = null;
3319
+ __privateSet(this, _hasMagic, void 0);
3320
+ return [s, unescape(this.toString()), false, false];
3321
+ }
3322
+ let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, true);
3323
+ if (bodyDotAllowed === body) {
3324
+ bodyDotAllowed = "";
3325
+ }
3326
+ if (bodyDotAllowed) {
3327
+ body = `(?:${body})(?:${bodyDotAllowed})*?`;
3328
+ }
3329
+ let final = "";
3330
+ if (this.type === "!" && __privateGet(this, _emptyExt)) {
3331
+ final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
3332
+ } else {
3333
+ const close = this.type === "!" ? (
3334
+ // !() must match something,but !(x) can match ''
3335
+ "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
3336
+ ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
3337
+ final = start + body + close;
3338
+ }
3339
+ return [
3340
+ final,
3341
+ unescape(body),
3342
+ __privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
3343
+ __privateGet(this, _uflag)
3344
+ ];
3345
+ }
3346
+ };
3347
+ _root = new WeakMap();
3348
+ _hasMagic = new WeakMap();
3349
+ _uflag = new WeakMap();
3350
+ _parts = new WeakMap();
3351
+ _parent = new WeakMap();
3352
+ _parentIndex = new WeakMap();
3353
+ _negs = new WeakMap();
3354
+ _filledNegs = new WeakMap();
3355
+ _options = new WeakMap();
3356
+ _toString = new WeakMap();
3357
+ _emptyExt = new WeakMap();
3358
+ _AST_instances = new WeakSet();
3359
+ fillNegs_fn = function() {
3360
+ if (this !== __privateGet(this, _root))
3361
+ throw new Error("should only call on root");
3362
+ if (__privateGet(this, _filledNegs))
3363
+ return this;
3364
+ this.toString();
3365
+ __privateSet(this, _filledNegs, true);
3366
+ let n;
3367
+ while (n = __privateGet(this, _negs).pop()) {
3368
+ if (n.type !== "!")
3369
+ continue;
3370
+ let p = n;
3371
+ let pp = __privateGet(p, _parent);
3372
+ while (pp) {
3373
+ for (let i = __privateGet(p, _parentIndex) + 1; !pp.type && i < __privateGet(pp, _parts).length; i++) {
3374
+ for (const part of __privateGet(n, _parts)) {
3375
+ if (typeof part === "string") {
3376
+ throw new Error("string part in extglob AST??");
3377
+ }
3378
+ part.copyIn(__privateGet(pp, _parts)[i]);
3379
+ }
3380
+ }
3381
+ p = pp;
3382
+ pp = __privateGet(p, _parent);
3383
+ }
3384
+ }
3385
+ return this;
3386
+ };
3387
+ _AST_static = new WeakSet();
3388
+ parseAST_fn = function(str, ast, pos, opt) {
3389
+ var _a, _b;
3390
+ let escaping = false;
3391
+ let inBrace = false;
3392
+ let braceStart = -1;
3393
+ let braceNeg = false;
3394
+ if (ast.type === null) {
3395
+ let i2 = pos;
3396
+ let acc2 = "";
3397
+ while (i2 < str.length) {
3398
+ const c = str.charAt(i2++);
3399
+ if (escaping || c === "\\") {
3400
+ escaping = !escaping;
3401
+ acc2 += c;
3402
+ continue;
3403
+ }
3404
+ if (inBrace) {
3405
+ if (i2 === braceStart + 1) {
3406
+ if (c === "^" || c === "!") {
3407
+ braceNeg = true;
3408
+ }
3409
+ } else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
3410
+ inBrace = false;
3411
+ }
3412
+ acc2 += c;
3413
+ continue;
3414
+ } else if (c === "[") {
3415
+ inBrace = true;
3416
+ braceStart = i2;
3417
+ braceNeg = false;
3418
+ acc2 += c;
3419
+ continue;
3420
+ }
3421
+ if (!opt.noext && isExtglobType(c) && str.charAt(i2) === "(") {
3422
+ ast.push(acc2);
3423
+ acc2 = "";
3424
+ const ext2 = new _AST(c, ast);
3425
+ i2 = __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, str, ext2, i2, opt);
3426
+ ast.push(ext2);
3427
+ continue;
3428
+ }
3429
+ acc2 += c;
3430
+ }
3431
+ ast.push(acc2);
3432
+ return i2;
3433
+ }
3434
+ let i = pos + 1;
3435
+ let part = new _AST(null, ast);
3436
+ const parts = [];
3437
+ let acc = "";
3438
+ while (i < str.length) {
3439
+ const c = str.charAt(i++);
3440
+ if (escaping || c === "\\") {
3441
+ escaping = !escaping;
3442
+ acc += c;
3443
+ continue;
3444
+ }
3445
+ if (inBrace) {
3446
+ if (i === braceStart + 1) {
3447
+ if (c === "^" || c === "!") {
3448
+ braceNeg = true;
3449
+ }
3450
+ } else if (c === "]" && !(i === braceStart + 2 && braceNeg)) {
3451
+ inBrace = false;
3452
+ }
3453
+ acc += c;
3454
+ continue;
3455
+ } else if (c === "[") {
3456
+ inBrace = true;
3457
+ braceStart = i;
3458
+ braceNeg = false;
3459
+ acc += c;
3460
+ continue;
3461
+ }
3462
+ if (isExtglobType(c) && str.charAt(i) === "(") {
3463
+ part.push(acc);
3464
+ acc = "";
3465
+ const ext2 = new _AST(c, part);
3466
+ part.push(ext2);
3467
+ i = __privateMethod(_b = _AST, _AST_static, parseAST_fn).call(_b, str, ext2, i, opt);
3468
+ continue;
3469
+ }
3470
+ if (c === "|") {
3471
+ part.push(acc);
3472
+ acc = "";
3473
+ parts.push(part);
3474
+ part = new _AST(null, ast);
3475
+ continue;
3476
+ }
3477
+ if (c === ")") {
3478
+ if (acc === "" && __privateGet(ast, _parts).length === 0) {
3479
+ __privateSet(ast, _emptyExt, true);
3480
+ }
3481
+ part.push(acc);
3482
+ acc = "";
3483
+ ast.push(...parts, part);
3484
+ return i;
3485
+ }
3486
+ acc += c;
3487
+ }
3488
+ ast.type = null;
3489
+ __privateSet(ast, _hasMagic, void 0);
3490
+ __privateSet(ast, _parts, [str.substring(pos - 1)]);
3491
+ return i;
3492
+ };
3493
+ partsToRegExp_fn = function(dot) {
3494
+ return __privateGet(this, _parts).map((p) => {
3495
+ if (typeof p === "string") {
3496
+ throw new Error("string type in extglob ast??");
3497
+ }
3498
+ const [re, _, _hasMagic2, uflag] = p.toRegExpSource(dot);
3499
+ __privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
3500
+ return re;
3501
+ }).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
3502
+ };
3503
+ parseGlob_fn = function(glob, hasMagic, noEmpty = false) {
3504
+ let escaping = false;
3505
+ let re = "";
3506
+ let uflag = false;
3507
+ for (let i = 0; i < glob.length; i++) {
3508
+ const c = glob.charAt(i);
3509
+ if (escaping) {
3510
+ escaping = false;
3511
+ re += (reSpecials.has(c) ? "\\" : "") + c;
3512
+ continue;
3513
+ }
3514
+ if (c === "\\") {
3515
+ if (i === glob.length - 1) {
3516
+ re += "\\\\";
3517
+ } else {
3518
+ escaping = true;
3519
+ }
3520
+ continue;
3521
+ }
3522
+ if (c === "[") {
3523
+ const [src, needUflag, consumed, magic] = parseClass(glob, i);
3524
+ if (consumed) {
3525
+ re += src;
3526
+ uflag = uflag || needUflag;
3527
+ i += consumed - 1;
3528
+ hasMagic = hasMagic || magic;
3529
+ continue;
3530
+ }
3531
+ }
3532
+ if (c === "*") {
3533
+ if (noEmpty && glob === "*")
3534
+ re += starNoEmpty;
3535
+ else
3536
+ re += star;
3537
+ hasMagic = true;
3538
+ continue;
3539
+ }
3540
+ if (c === "?") {
3541
+ re += qmark;
3542
+ hasMagic = true;
3543
+ continue;
3544
+ }
3545
+ re += regExpEscape(c);
3546
+ }
3547
+ return [re, unescape(glob), !!hasMagic, uflag];
3548
+ };
3549
+ __privateAdd(_AST, _AST_static);
3550
+ var AST = _AST;
3551
+
3552
+ // node_modules/minimatch/dist/esm/escape.js
3553
+ var escape = (s, { windowsPathsNoEscape = false } = {}) => {
3554
+ return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
3555
+ };
3556
+
3557
+ // node_modules/minimatch/dist/esm/index.js
3558
+ var minimatch = (p, pattern, options = {}) => {
3559
+ assertValidPattern(pattern);
3560
+ if (!options.nocomment && pattern.charAt(0) === "#") {
3561
+ return false;
3562
+ }
3563
+ return new Minimatch(pattern, options).match(p);
3564
+ };
3565
+ var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
3566
+ var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
3567
+ var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
3568
+ var starDotExtTestNocase = (ext2) => {
3569
+ ext2 = ext2.toLowerCase();
3570
+ return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
3571
+ };
3572
+ var starDotExtTestNocaseDot = (ext2) => {
3573
+ ext2 = ext2.toLowerCase();
3574
+ return (f) => f.toLowerCase().endsWith(ext2);
3575
+ };
3576
+ var starDotStarRE = /^\*+\.\*+$/;
3577
+ var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
3578
+ var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
3579
+ var dotStarRE = /^\.\*+$/;
3580
+ var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
3581
+ var starRE = /^\*+$/;
3582
+ var starTest = (f) => f.length !== 0 && !f.startsWith(".");
3583
+ var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
3584
+ var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
3585
+ var qmarksTestNocase = ([$0, ext2 = ""]) => {
3586
+ const noext = qmarksTestNoExt([$0]);
3587
+ if (!ext2)
3588
+ return noext;
3589
+ ext2 = ext2.toLowerCase();
3590
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
3591
+ };
3592
+ var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
3593
+ const noext = qmarksTestNoExtDot([$0]);
3594
+ if (!ext2)
3595
+ return noext;
3596
+ ext2 = ext2.toLowerCase();
3597
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
3598
+ };
3599
+ var qmarksTestDot = ([$0, ext2 = ""]) => {
3600
+ const noext = qmarksTestNoExtDot([$0]);
3601
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
3602
+ };
3603
+ var qmarksTest = ([$0, ext2 = ""]) => {
3604
+ const noext = qmarksTestNoExt([$0]);
3605
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
3606
+ };
3607
+ var qmarksTestNoExt = ([$0]) => {
3608
+ const len = $0.length;
3609
+ return (f) => f.length === len && !f.startsWith(".");
3610
+ };
3611
+ var qmarksTestNoExtDot = ([$0]) => {
3612
+ const len = $0.length;
3613
+ return (f) => f.length === len && f !== "." && f !== "..";
3614
+ };
3615
+ var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
3616
+ var path = {
3617
+ win32: { sep: "\\" },
3618
+ posix: { sep: "/" }
3619
+ };
3620
+ var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
3621
+ minimatch.sep = sep;
3622
+ var GLOBSTAR = Symbol("globstar **");
3623
+ minimatch.GLOBSTAR = GLOBSTAR;
3624
+ var qmark2 = "[^/]";
3625
+ var star2 = qmark2 + "*?";
3626
+ var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
3627
+ var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
3628
+ var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
3629
+ minimatch.filter = filter;
3630
+ var ext = (a, b = {}) => Object.assign({}, a, b);
3631
+ var defaults = (def) => {
3632
+ if (!def || typeof def !== "object" || !Object.keys(def).length) {
3633
+ return minimatch;
3634
+ }
3635
+ const orig = minimatch;
3636
+ const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
3637
+ return Object.assign(m, {
3638
+ Minimatch: class Minimatch extends orig.Minimatch {
3639
+ constructor(pattern, options = {}) {
3640
+ super(pattern, ext(def, options));
3641
+ }
3642
+ static defaults(options) {
3643
+ return orig.defaults(ext(def, options)).Minimatch;
3644
+ }
3645
+ },
3646
+ AST: class AST extends orig.AST {
3647
+ /* c8 ignore start */
3648
+ constructor(type, parent, options = {}) {
3649
+ super(type, parent, ext(def, options));
3650
+ }
3651
+ /* c8 ignore stop */
3652
+ static fromGlob(pattern, options = {}) {
3653
+ return orig.AST.fromGlob(pattern, ext(def, options));
3654
+ }
3655
+ },
3656
+ unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
3657
+ escape: (s, options = {}) => orig.escape(s, ext(def, options)),
3658
+ filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
3659
+ defaults: (options) => orig.defaults(ext(def, options)),
3660
+ makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
3661
+ braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
3662
+ match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
3663
+ sep: orig.sep,
3664
+ GLOBSTAR
3665
+ });
3666
+ };
3667
+ minimatch.defaults = defaults;
3668
+ var braceExpand = (pattern, options = {}) => {
3669
+ assertValidPattern(pattern);
3670
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
3671
+ return [pattern];
3672
+ }
3673
+ return (0, import_brace_expansion.default)(pattern);
3674
+ };
3675
+ minimatch.braceExpand = braceExpand;
3676
+ var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
3677
+ minimatch.makeRe = makeRe;
3678
+ var match = (list, pattern, options = {}) => {
3679
+ const mm = new Minimatch(pattern, options);
3680
+ list = list.filter((f) => mm.match(f));
3681
+ if (mm.options.nonull && !list.length) {
3682
+ list.push(pattern);
3683
+ }
3684
+ return list;
3685
+ };
3686
+ minimatch.match = match;
3687
+ var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
3688
+ var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
3689
+ var Minimatch = class {
3690
+ options;
3691
+ set;
3692
+ pattern;
3693
+ windowsPathsNoEscape;
3694
+ nonegate;
3695
+ negate;
3696
+ comment;
3697
+ empty;
3698
+ preserveMultipleSlashes;
3699
+ partial;
3700
+ globSet;
3701
+ globParts;
3702
+ nocase;
3703
+ isWindows;
3704
+ platform;
3705
+ windowsNoMagicRoot;
3706
+ regexp;
3707
+ constructor(pattern, options = {}) {
3708
+ assertValidPattern(pattern);
3709
+ options = options || {};
3710
+ this.options = options;
3711
+ this.pattern = pattern;
3712
+ this.platform = options.platform || defaultPlatform;
3713
+ this.isWindows = this.platform === "win32";
3714
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
3715
+ if (this.windowsPathsNoEscape) {
3716
+ this.pattern = this.pattern.replace(/\\/g, "/");
3717
+ }
3718
+ this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
3719
+ this.regexp = null;
3720
+ this.negate = false;
3721
+ this.nonegate = !!options.nonegate;
3722
+ this.comment = false;
3723
+ this.empty = false;
3724
+ this.partial = !!options.partial;
3725
+ this.nocase = !!this.options.nocase;
3726
+ this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
3727
+ this.globSet = [];
3728
+ this.globParts = [];
3729
+ this.set = [];
3730
+ this.make();
3731
+ }
3732
+ hasMagic() {
3733
+ if (this.options.magicalBraces && this.set.length > 1) {
3734
+ return true;
3735
+ }
3736
+ for (const pattern of this.set) {
3737
+ for (const part of pattern) {
3738
+ if (typeof part !== "string")
3739
+ return true;
3740
+ }
3741
+ }
3742
+ return false;
3743
+ }
3744
+ debug(..._) {
3745
+ }
3746
+ make() {
3747
+ const pattern = this.pattern;
3748
+ const options = this.options;
3749
+ if (!options.nocomment && pattern.charAt(0) === "#") {
3750
+ this.comment = true;
3751
+ return;
3752
+ }
3753
+ if (!pattern) {
3754
+ this.empty = true;
3755
+ return;
3756
+ }
3757
+ this.parseNegate();
3758
+ this.globSet = [...new Set(this.braceExpand())];
3759
+ if (options.debug) {
3760
+ this.debug = (...args) => console.error(...args);
3761
+ }
3762
+ this.debug(this.pattern, this.globSet);
3763
+ const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
3764
+ this.globParts = this.preprocess(rawGlobParts);
3765
+ this.debug(this.pattern, this.globParts);
3766
+ let set = this.globParts.map((s, _, __) => {
3767
+ if (this.isWindows && this.windowsNoMagicRoot) {
3768
+ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
3769
+ const isDrive = /^[a-z]:/i.test(s[0]);
3770
+ if (isUNC) {
3771
+ return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
3772
+ } else if (isDrive) {
3773
+ return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
3774
+ }
3775
+ }
3776
+ return s.map((ss) => this.parse(ss));
3777
+ });
3778
+ this.debug(this.pattern, set);
3779
+ this.set = set.filter((s) => s.indexOf(false) === -1);
3780
+ if (this.isWindows) {
3781
+ for (let i = 0; i < this.set.length; i++) {
3782
+ const p = this.set[i];
3783
+ if (p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
3784
+ p[2] = "?";
3785
+ }
3786
+ }
3787
+ }
3788
+ this.debug(this.pattern, this.set);
3789
+ }
3790
+ // various transforms to equivalent pattern sets that are
3791
+ // faster to process in a filesystem walk. The goal is to
3792
+ // eliminate what we can, and push all ** patterns as far
3793
+ // to the right as possible, even if it increases the number
3794
+ // of patterns that we have to process.
3795
+ preprocess(globParts) {
3796
+ if (this.options.noglobstar) {
3797
+ for (let i = 0; i < globParts.length; i++) {
3798
+ for (let j = 0; j < globParts[i].length; j++) {
3799
+ if (globParts[i][j] === "**") {
3800
+ globParts[i][j] = "*";
3801
+ }
3802
+ }
3803
+ }
3804
+ }
3805
+ const { optimizationLevel = 1 } = this.options;
3806
+ if (optimizationLevel >= 2) {
3807
+ globParts = this.firstPhasePreProcess(globParts);
3808
+ globParts = this.secondPhasePreProcess(globParts);
3809
+ } else if (optimizationLevel >= 1) {
3810
+ globParts = this.levelOneOptimize(globParts);
3811
+ } else {
3812
+ globParts = this.adjascentGlobstarOptimize(globParts);
3813
+ }
3814
+ return globParts;
3815
+ }
3816
+ // just get rid of adjascent ** portions
3817
+ adjascentGlobstarOptimize(globParts) {
3818
+ return globParts.map((parts) => {
3819
+ let gs = -1;
3820
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
3821
+ let i = gs;
3822
+ while (parts[i + 1] === "**") {
3823
+ i++;
3824
+ }
3825
+ if (i !== gs) {
3826
+ parts.splice(gs, i - gs);
3827
+ }
3828
+ }
3829
+ return parts;
3830
+ });
3831
+ }
3832
+ // get rid of adjascent ** and resolve .. portions
3833
+ levelOneOptimize(globParts) {
3834
+ return globParts.map((parts) => {
3835
+ parts = parts.reduce((set, part) => {
3836
+ const prev = set[set.length - 1];
3837
+ if (part === "**" && prev === "**") {
3838
+ return set;
3839
+ }
3840
+ if (part === "..") {
3841
+ if (prev && prev !== ".." && prev !== "." && prev !== "**") {
3842
+ set.pop();
3843
+ return set;
3844
+ }
3845
+ }
3846
+ set.push(part);
3847
+ return set;
3848
+ }, []);
3849
+ return parts.length === 0 ? [""] : parts;
3850
+ });
3851
+ }
3852
+ levelTwoFileOptimize(parts) {
3853
+ if (!Array.isArray(parts)) {
3854
+ parts = this.slashSplit(parts);
3855
+ }
3856
+ let didSomething = false;
3857
+ do {
3858
+ didSomething = false;
3859
+ if (!this.preserveMultipleSlashes) {
3860
+ for (let i = 1; i < parts.length - 1; i++) {
3861
+ const p = parts[i];
3862
+ if (i === 1 && p === "" && parts[0] === "")
3863
+ continue;
3864
+ if (p === "." || p === "") {
3865
+ didSomething = true;
3866
+ parts.splice(i, 1);
3867
+ i--;
3868
+ }
3869
+ }
3870
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
3871
+ didSomething = true;
3872
+ parts.pop();
3873
+ }
3874
+ }
3875
+ let dd = 0;
3876
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
3877
+ const p = parts[dd - 1];
3878
+ if (p && p !== "." && p !== ".." && p !== "**") {
3879
+ didSomething = true;
3880
+ parts.splice(dd - 1, 2);
3881
+ dd -= 2;
3882
+ }
3883
+ }
3884
+ } while (didSomething);
3885
+ return parts.length === 0 ? [""] : parts;
3886
+ }
3887
+ // First phase: single-pattern processing
3888
+ // <pre> is 1 or more portions
3889
+ // <rest> is 1 or more portions
3890
+ // <p> is any portion other than ., .., '', or **
3891
+ // <e> is . or ''
3892
+ //
3893
+ // **/.. is *brutal* for filesystem walking performance, because
3894
+ // it effectively resets the recursive walk each time it occurs,
3895
+ // and ** cannot be reduced out by a .. pattern part like a regexp
3896
+ // or most strings (other than .., ., and '') can be.
3897
+ //
3898
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
3899
+ // <pre>/<e>/<rest> -> <pre>/<rest>
3900
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
3901
+ // **/**/<rest> -> **/<rest>
3902
+ //
3903
+ // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
3904
+ // this WOULD be allowed if ** did follow symlinks, or * didn't
3905
+ firstPhasePreProcess(globParts) {
3906
+ let didSomething = false;
3907
+ do {
3908
+ didSomething = false;
3909
+ for (let parts of globParts) {
3910
+ let gs = -1;
3911
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
3912
+ let gss = gs;
3913
+ while (parts[gss + 1] === "**") {
3914
+ gss++;
3915
+ }
3916
+ if (gss > gs) {
3917
+ parts.splice(gs + 1, gss - gs);
3918
+ }
3919
+ let next = parts[gs + 1];
3920
+ const p = parts[gs + 2];
3921
+ const p2 = parts[gs + 3];
3922
+ if (next !== "..")
3923
+ continue;
3924
+ if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
3925
+ continue;
3926
+ }
3927
+ didSomething = true;
3928
+ parts.splice(gs, 1);
3929
+ const other = parts.slice(0);
3930
+ other[gs] = "**";
3931
+ globParts.push(other);
3932
+ gs--;
3933
+ }
3934
+ if (!this.preserveMultipleSlashes) {
3935
+ for (let i = 1; i < parts.length - 1; i++) {
3936
+ const p = parts[i];
3937
+ if (i === 1 && p === "" && parts[0] === "")
3938
+ continue;
3939
+ if (p === "." || p === "") {
3940
+ didSomething = true;
3941
+ parts.splice(i, 1);
3942
+ i--;
3943
+ }
3944
+ }
3945
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
3946
+ didSomething = true;
3947
+ parts.pop();
3948
+ }
3949
+ }
3950
+ let dd = 0;
3951
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
3952
+ const p = parts[dd - 1];
3953
+ if (p && p !== "." && p !== ".." && p !== "**") {
3954
+ didSomething = true;
3955
+ const needDot = dd === 1 && parts[dd + 1] === "**";
3956
+ const splin = needDot ? ["."] : [];
3957
+ parts.splice(dd - 1, 2, ...splin);
3958
+ if (parts.length === 0)
3959
+ parts.push("");
3960
+ dd -= 2;
3961
+ }
3962
+ }
3963
+ }
3964
+ } while (didSomething);
3965
+ return globParts;
3966
+ }
3967
+ // second phase: multi-pattern dedupes
3968
+ // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
3969
+ // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
3970
+ // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
3971
+ //
3972
+ // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
3973
+ // ^-- not valid because ** doens't follow symlinks
3974
+ secondPhasePreProcess(globParts) {
3975
+ for (let i = 0; i < globParts.length - 1; i++) {
3976
+ for (let j = i + 1; j < globParts.length; j++) {
3977
+ const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
3978
+ if (!matched)
3979
+ continue;
3980
+ globParts[i] = matched;
3981
+ globParts[j] = [];
3982
+ }
3983
+ }
3984
+ return globParts.filter((gs) => gs.length);
3985
+ }
3986
+ partsMatch(a, b, emptyGSMatch = false) {
3987
+ let ai = 0;
3988
+ let bi = 0;
3989
+ let result = [];
3990
+ let which = "";
3991
+ while (ai < a.length && bi < b.length) {
3992
+ if (a[ai] === b[bi]) {
3993
+ result.push(which === "b" ? b[bi] : a[ai]);
3994
+ ai++;
3995
+ bi++;
3996
+ } else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
3997
+ result.push(a[ai]);
3998
+ ai++;
3999
+ } else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
4000
+ result.push(b[bi]);
4001
+ bi++;
4002
+ } else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
4003
+ if (which === "b")
4004
+ return false;
4005
+ which = "a";
4006
+ result.push(a[ai]);
4007
+ ai++;
4008
+ bi++;
4009
+ } else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
4010
+ if (which === "a")
4011
+ return false;
4012
+ which = "b";
4013
+ result.push(b[bi]);
4014
+ ai++;
4015
+ bi++;
4016
+ } else {
4017
+ return false;
4018
+ }
4019
+ }
4020
+ return a.length === b.length && result;
4021
+ }
4022
+ parseNegate() {
4023
+ if (this.nonegate)
4024
+ return;
4025
+ const pattern = this.pattern;
4026
+ let negate = false;
4027
+ let negateOffset = 0;
4028
+ for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) {
4029
+ negate = !negate;
4030
+ negateOffset++;
4031
+ }
4032
+ if (negateOffset)
4033
+ this.pattern = pattern.slice(negateOffset);
4034
+ this.negate = negate;
4035
+ }
4036
+ // set partial to true to test if, for example,
4037
+ // "/a/b" matches the start of "/*/b/*/d"
4038
+ // Partial means, if you run out of file before you run
4039
+ // out of pattern, then that's fine, as long as all
4040
+ // the parts match.
4041
+ matchOne(file, pattern, partial = false) {
4042
+ const options = this.options;
4043
+ if (this.isWindows) {
4044
+ const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
4045
+ const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
4046
+ const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
4047
+ const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
4048
+ const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
4049
+ const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
4050
+ if (typeof fdi === "number" && typeof pdi === "number") {
4051
+ const [fd, pd] = [file[fdi], pattern[pdi]];
4052
+ if (fd.toLowerCase() === pd.toLowerCase()) {
4053
+ pattern[pdi] = fd;
4054
+ if (pdi > fdi) {
4055
+ pattern = pattern.slice(pdi);
4056
+ } else if (fdi > pdi) {
4057
+ file = file.slice(fdi);
4058
+ }
4059
+ }
4060
+ }
4061
+ }
4062
+ const { optimizationLevel = 1 } = this.options;
4063
+ if (optimizationLevel >= 2) {
4064
+ file = this.levelTwoFileOptimize(file);
4065
+ }
4066
+ this.debug("matchOne", this, { file, pattern });
4067
+ this.debug("matchOne", file.length, pattern.length);
4068
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
4069
+ this.debug("matchOne loop");
4070
+ var p = pattern[pi];
4071
+ var f = file[fi];
4072
+ this.debug(pattern, p, f);
4073
+ if (p === false) {
4074
+ return false;
4075
+ }
4076
+ if (p === GLOBSTAR) {
4077
+ this.debug("GLOBSTAR", [pattern, p, f]);
4078
+ var fr = fi;
4079
+ var pr = pi + 1;
4080
+ if (pr === pl) {
4081
+ this.debug("** at the end");
4082
+ for (; fi < fl; fi++) {
4083
+ if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
4084
+ return false;
4085
+ }
4086
+ return true;
4087
+ }
4088
+ while (fr < fl) {
4089
+ var swallowee = file[fr];
4090
+ this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
4091
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
4092
+ this.debug("globstar found match!", fr, fl, swallowee);
4093
+ return true;
4094
+ } else {
4095
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
4096
+ this.debug("dot detected!", file, fr, pattern, pr);
4097
+ break;
4098
+ }
4099
+ this.debug("globstar swallow a segment, and continue");
4100
+ fr++;
4101
+ }
4102
+ }
4103
+ if (partial) {
4104
+ this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
4105
+ if (fr === fl) {
4106
+ return true;
4107
+ }
4108
+ }
4109
+ return false;
4110
+ }
4111
+ let hit;
4112
+ if (typeof p === "string") {
4113
+ hit = f === p;
4114
+ this.debug("string match", p, f, hit);
4115
+ } else {
4116
+ hit = p.test(f);
4117
+ this.debug("pattern match", p, f, hit);
4118
+ }
4119
+ if (!hit)
4120
+ return false;
4121
+ }
4122
+ if (fi === fl && pi === pl) {
4123
+ return true;
4124
+ } else if (fi === fl) {
4125
+ return partial;
4126
+ } else if (pi === pl) {
4127
+ return fi === fl - 1 && file[fi] === "";
4128
+ } else {
4129
+ throw new Error("wtf?");
4130
+ }
4131
+ }
4132
+ braceExpand() {
4133
+ return braceExpand(this.pattern, this.options);
4134
+ }
4135
+ parse(pattern) {
4136
+ assertValidPattern(pattern);
4137
+ const options = this.options;
4138
+ if (pattern === "**")
4139
+ return GLOBSTAR;
4140
+ if (pattern === "")
4141
+ return "";
4142
+ let m;
4143
+ let fastTest = null;
4144
+ if (m = pattern.match(starRE)) {
4145
+ fastTest = options.dot ? starTestDot : starTest;
4146
+ } else if (m = pattern.match(starDotExtRE)) {
4147
+ fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
4148
+ } else if (m = pattern.match(qmarksRE)) {
4149
+ fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
4150
+ } else if (m = pattern.match(starDotStarRE)) {
4151
+ fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
4152
+ } else if (m = pattern.match(dotStarRE)) {
4153
+ fastTest = dotStarTest;
4154
+ }
4155
+ const re = AST.fromGlob(pattern, this.options).toMMPattern();
4156
+ if (fastTest && typeof re === "object") {
4157
+ Reflect.defineProperty(re, "test", { value: fastTest });
4158
+ }
4159
+ return re;
4160
+ }
4161
+ makeRe() {
4162
+ if (this.regexp || this.regexp === false)
4163
+ return this.regexp;
4164
+ const set = this.set;
4165
+ if (!set.length) {
4166
+ this.regexp = false;
4167
+ return this.regexp;
4168
+ }
4169
+ const options = this.options;
4170
+ const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
4171
+ const flags = new Set(options.nocase ? ["i"] : []);
4172
+ let re = set.map((pattern) => {
4173
+ const pp = pattern.map((p) => {
4174
+ if (p instanceof RegExp) {
4175
+ for (const f of p.flags.split(""))
4176
+ flags.add(f);
4177
+ }
4178
+ return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
4179
+ });
4180
+ pp.forEach((p, i) => {
4181
+ const next = pp[i + 1];
4182
+ const prev = pp[i - 1];
4183
+ if (p !== GLOBSTAR || prev === GLOBSTAR) {
4184
+ return;
4185
+ }
4186
+ if (prev === void 0) {
4187
+ if (next !== void 0 && next !== GLOBSTAR) {
4188
+ pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
4189
+ } else {
4190
+ pp[i] = twoStar;
4191
+ }
4192
+ } else if (next === void 0) {
4193
+ pp[i - 1] = prev + "(?:\\/|" + twoStar + ")?";
4194
+ } else if (next !== GLOBSTAR) {
4195
+ pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
4196
+ pp[i + 1] = GLOBSTAR;
4197
+ }
4198
+ });
4199
+ return pp.filter((p) => p !== GLOBSTAR).join("/");
4200
+ }).join("|");
4201
+ const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
4202
+ re = "^" + open + re + close + "$";
4203
+ if (this.negate)
4204
+ re = "^(?!" + re + ").+$";
4205
+ try {
4206
+ this.regexp = new RegExp(re, [...flags].join(""));
4207
+ } catch (ex) {
4208
+ this.regexp = false;
4209
+ }
4210
+ return this.regexp;
4211
+ }
4212
+ slashSplit(p) {
4213
+ if (this.preserveMultipleSlashes) {
4214
+ return p.split("/");
4215
+ } else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
4216
+ return ["", ...p.split(/\/+/)];
4217
+ } else {
4218
+ return p.split(/\/+/);
4219
+ }
4220
+ }
4221
+ match(f, partial = this.partial) {
4222
+ this.debug("match", f, this.pattern);
4223
+ if (this.comment) {
4224
+ return false;
4225
+ }
4226
+ if (this.empty) {
4227
+ return f === "";
4228
+ }
4229
+ if (f === "/" && partial) {
4230
+ return true;
4231
+ }
4232
+ const options = this.options;
4233
+ if (this.isWindows) {
4234
+ f = f.split("\\").join("/");
4235
+ }
4236
+ const ff = this.slashSplit(f);
4237
+ this.debug(this.pattern, "split", ff);
4238
+ const set = this.set;
4239
+ this.debug(this.pattern, "set", set);
4240
+ let filename = ff[ff.length - 1];
4241
+ if (!filename) {
4242
+ for (let i = ff.length - 2; !filename && i >= 0; i--) {
4243
+ filename = ff[i];
4244
+ }
4245
+ }
4246
+ for (let i = 0; i < set.length; i++) {
4247
+ const pattern = set[i];
4248
+ let file = ff;
4249
+ if (options.matchBase && pattern.length === 1) {
4250
+ file = [filename];
4251
+ }
4252
+ const hit = this.matchOne(file, pattern, partial);
4253
+ if (hit) {
4254
+ if (options.flipNegate) {
4255
+ return true;
4256
+ }
4257
+ return !this.negate;
4258
+ }
4259
+ }
4260
+ if (options.flipNegate) {
4261
+ return false;
4262
+ }
4263
+ return this.negate;
4264
+ }
4265
+ static defaults(def) {
4266
+ return minimatch.defaults(def).Minimatch;
4267
+ }
4268
+ };
4269
+ minimatch.AST = AST;
4270
+ minimatch.Minimatch = Minimatch;
4271
+ minimatch.escape = escape;
4272
+ minimatch.unescape = unescape;
4273
+
2703
4274
  // src/utils/output-target.ts
2704
4275
  var isOutputTargetHydrate = (o) => o.type === DIST_HYDRATE_SCRIPT;
2705
4276
  var isOutputTargetDocs = (o) => o.type === DOCS_README || o.type === DOCS_JSON || o.type === DOCS_CUSTOM || o.type === DOCS_VSCODE;
@@ -2830,6 +4401,7 @@ var BUILD = {
2830
4401
  constructableCSS: true,
2831
4402
  devTools: false,
2832
4403
  shadowDelegatesFocus: true,
4404
+ shadowSlotAssignmentManual: false,
2833
4405
  initializeNextTick: false,
2834
4406
  asyncLoading: true,
2835
4407
  asyncQueue: false,
@@ -2861,6 +4433,9 @@ var H = win.HTMLElement || class {
2861
4433
  var supportsShadow = BUILD.shadowDom;
2862
4434
  var supportsConstructableStylesheets = BUILD.constructableCSS ? /* @__PURE__ */ (() => {
2863
4435
  try {
4436
+ if (!win.document.adoptedStyleSheets) {
4437
+ return false;
4438
+ }
2864
4439
  new CSSStyleSheet();
2865
4440
  return typeof new CSSStyleSheet().replaceSync === "function";
2866
4441
  } catch (e) {
@@ -3395,8 +4970,8 @@ function uuidv4() {
3395
4970
  return v.toString(16);
3396
4971
  });
3397
4972
  }
3398
- async function readJson(sys, path) {
3399
- const file = await sys.readFile(path);
4973
+ async function readJson(sys, path2) {
4974
+ const file = await sys.readFile(path2);
3400
4975
  return !!file && JSON.parse(file);
3401
4976
  }
3402
4977
  function hasDebug(flags) {
@@ -3851,16 +5426,16 @@ var getBoilerplateAndWriteFile = async (config, componentName, withCss, file, st
3851
5426
  var checkForOverwrite = async (files, config) => {
3852
5427
  const alreadyPresent = [];
3853
5428
  await Promise.all(
3854
- files.map(async ({ path }) => {
3855
- if (await config.sys.readFile(path) !== void 0) {
3856
- alreadyPresent.push(path);
5429
+ files.map(async ({ path: path2 }) => {
5430
+ if (await config.sys.readFile(path2) !== void 0) {
5431
+ alreadyPresent.push(path2);
3857
5432
  }
3858
5433
  })
3859
5434
  );
3860
5435
  if (alreadyPresent.length > 0) {
3861
5436
  config.logger.error(
3862
5437
  "Generating code would overwrite the following files:",
3863
- ...alreadyPresent.map((path) => " " + normalizePath(path))
5438
+ ...alreadyPresent.map((path2) => " " + normalizePath(path2))
3864
5439
  );
3865
5440
  await config.sys.exit(1);
3866
5441
  }
@@ -3907,7 +5482,7 @@ export class ${toPascalCase(tagName)} {
3907
5482
  }
3908
5483
  `;
3909
5484
  };
3910
- var getStyleUrlBoilerplate = (ext) => ext === "sass" ? `:host
5485
+ var getStyleUrlBoilerplate = (ext2) => ext2 === "sass" ? `:host
3911
5486
  display: block
3912
5487
  ` : `:host {
3913
5488
  display: block;