proto-autos-wc 0.1.125 → 0.1.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-CHtgcRuD.js → index-CZCzt3Q9.js} +1738 -106
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/proto-autos-wc.cjs.js +3 -3
- package/dist/cjs/proto-autos.cjs.entry.js +2 -381
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/esm/{index-CUeCNkv1.js → index-Djdza2ry.js} +1738 -106
- package/dist/esm/loader.js +3 -3
- package/dist/esm/proto-autos-wc.js +4 -4
- package/dist/esm/proto-autos.entry.js +2 -381
- package/dist/proto-autos-wc/p-Djdza2ry.js +2 -0
- package/dist/proto-autos-wc/{p-d8159ca8.entry.js → p-dcbe9181.entry.js} +1 -1
- package/dist/proto-autos-wc/proto-autos-wc.esm.js +1 -1
- package/dist/types/stencil-public-runtime.d.ts +14 -3
- package/package.json +2 -2
- package/dist/proto-autos-wc/p-CUeCNkv1.js +0 -2
|
@@ -1,17 +1,258 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const NAMESPACE = 'proto-autos-wc';
|
|
4
|
-
const BUILD = /* proto-autos-wc */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, deserializer: false, devTools: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propChangeCallback: false, propMutable: false, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, serializer: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: false, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false };
|
|
4
|
+
const BUILD = /* proto-autos-wc */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, deserializer: false, devTools: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propChangeCallback: false, propMutable: false, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, serializer: false, shadowDelegatesFocus: false, shadowDom: true, shadowSlotAssignmentManual: false, slot: false, slotChildNodesFix: false, slotRelocation: false, state: false, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false };
|
|
5
5
|
const Env = /* proto-autos-wc */ {};
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Platform v4.
|
|
8
|
+
Stencil Client Platform v4.40.1 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
|
+
var __create = Object.create;
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __typeError = (msg) => {
|
|
17
|
+
throw TypeError(msg);
|
|
18
|
+
};
|
|
19
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
21
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
22
|
+
};
|
|
11
23
|
var __export = (target, all) => {
|
|
12
24
|
for (var name in all)
|
|
13
25
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
26
|
};
|
|
27
|
+
var __copyProps = (to, from, except, desc) => {
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from))
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
+
}
|
|
33
|
+
return to;
|
|
34
|
+
};
|
|
35
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
36
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
37
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
38
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
39
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
40
|
+
__defProp(target, "default", { value: mod, enumerable: true }) ,
|
|
41
|
+
mod
|
|
42
|
+
));
|
|
43
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, 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"), 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
|
+
module.exports = balanced;
|
|
54
|
+
function balanced(a, b, str) {
|
|
55
|
+
if (a instanceof RegExp) a = maybeMatch(a, str);
|
|
56
|
+
if (b instanceof RegExp) b = maybeMatch(b, str);
|
|
57
|
+
var r = range(a, b, str);
|
|
58
|
+
return r && {
|
|
59
|
+
start: r[0],
|
|
60
|
+
end: r[1],
|
|
61
|
+
pre: str.slice(0, r[0]),
|
|
62
|
+
body: str.slice(r[0] + a.length, r[1]),
|
|
63
|
+
post: str.slice(r[1] + b.length)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function maybeMatch(reg, str) {
|
|
67
|
+
var m = str.match(reg);
|
|
68
|
+
return m ? m[0] : null;
|
|
69
|
+
}
|
|
70
|
+
balanced.range = range;
|
|
71
|
+
function range(a, b, str) {
|
|
72
|
+
var begs, beg, left, right, result;
|
|
73
|
+
var ai = str.indexOf(a);
|
|
74
|
+
var bi = str.indexOf(b, ai + 1);
|
|
75
|
+
var i2 = ai;
|
|
76
|
+
if (ai >= 0 && bi > 0) {
|
|
77
|
+
if (a === b) {
|
|
78
|
+
return [ai, bi];
|
|
79
|
+
}
|
|
80
|
+
begs = [];
|
|
81
|
+
left = str.length;
|
|
82
|
+
while (i2 >= 0 && !result) {
|
|
83
|
+
if (i2 == ai) {
|
|
84
|
+
begs.push(i2);
|
|
85
|
+
ai = str.indexOf(a, i2 + 1);
|
|
86
|
+
} else if (begs.length == 1) {
|
|
87
|
+
result = [begs.pop(), bi];
|
|
88
|
+
} else {
|
|
89
|
+
beg = begs.pop();
|
|
90
|
+
if (beg < left) {
|
|
91
|
+
left = beg;
|
|
92
|
+
right = bi;
|
|
93
|
+
}
|
|
94
|
+
bi = str.indexOf(b, i2 + 1);
|
|
95
|
+
}
|
|
96
|
+
i2 = ai < bi && ai >= 0 ? ai : bi;
|
|
97
|
+
}
|
|
98
|
+
if (begs.length) {
|
|
99
|
+
result = [left, right];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// node_modules/brace-expansion/index.js
|
|
108
|
+
var require_brace_expansion = __commonJS({
|
|
109
|
+
"node_modules/brace-expansion/index.js"(exports, module) {
|
|
110
|
+
var balanced = require_balanced_match();
|
|
111
|
+
module.exports = expandTop;
|
|
112
|
+
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
113
|
+
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
114
|
+
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
115
|
+
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
116
|
+
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
117
|
+
function numeric(str) {
|
|
118
|
+
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
119
|
+
}
|
|
120
|
+
function escapeBraces(str) {
|
|
121
|
+
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
122
|
+
}
|
|
123
|
+
function unescapeBraces(str) {
|
|
124
|
+
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
125
|
+
}
|
|
126
|
+
function parseCommaParts(str) {
|
|
127
|
+
if (!str)
|
|
128
|
+
return [""];
|
|
129
|
+
var parts = [];
|
|
130
|
+
var m = balanced("{", "}", str);
|
|
131
|
+
if (!m)
|
|
132
|
+
return str.split(",");
|
|
133
|
+
var pre = m.pre;
|
|
134
|
+
var body = m.body;
|
|
135
|
+
var post = m.post;
|
|
136
|
+
var p = pre.split(",");
|
|
137
|
+
p[p.length - 1] += "{" + body + "}";
|
|
138
|
+
var postParts = parseCommaParts(post);
|
|
139
|
+
if (post.length) {
|
|
140
|
+
p[p.length - 1] += postParts.shift();
|
|
141
|
+
p.push.apply(p, postParts);
|
|
142
|
+
}
|
|
143
|
+
parts.push.apply(parts, p);
|
|
144
|
+
return parts;
|
|
145
|
+
}
|
|
146
|
+
function expandTop(str) {
|
|
147
|
+
if (!str)
|
|
148
|
+
return [];
|
|
149
|
+
if (str.substr(0, 2) === "{}") {
|
|
150
|
+
str = "\\{\\}" + str.substr(2);
|
|
151
|
+
}
|
|
152
|
+
return expand2(escapeBraces(str), true).map(unescapeBraces);
|
|
153
|
+
}
|
|
154
|
+
function embrace(str) {
|
|
155
|
+
return "{" + str + "}";
|
|
156
|
+
}
|
|
157
|
+
function isPadded(el) {
|
|
158
|
+
return /^-?0\d/.test(el);
|
|
159
|
+
}
|
|
160
|
+
function lte(i2, y) {
|
|
161
|
+
return i2 <= y;
|
|
162
|
+
}
|
|
163
|
+
function gte(i2, y) {
|
|
164
|
+
return i2 >= y;
|
|
165
|
+
}
|
|
166
|
+
function expand2(str, isTop) {
|
|
167
|
+
var expansions = [];
|
|
168
|
+
var m = balanced("{", "}", str);
|
|
169
|
+
if (!m) return [str];
|
|
170
|
+
var pre = m.pre;
|
|
171
|
+
var post = m.post.length ? expand2(m.post, false) : [""];
|
|
172
|
+
if (/\$$/.test(m.pre)) {
|
|
173
|
+
for (var k = 0; k < post.length; k++) {
|
|
174
|
+
var expansion = pre + "{" + m.body + "}" + post[k];
|
|
175
|
+
expansions.push(expansion);
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
179
|
+
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
180
|
+
var isSequence = isNumericSequence || isAlphaSequence;
|
|
181
|
+
var isOptions = m.body.indexOf(",") >= 0;
|
|
182
|
+
if (!isSequence && !isOptions) {
|
|
183
|
+
if (m.post.match(/,(?!,).*\}/)) {
|
|
184
|
+
str = m.pre + "{" + m.body + escClose + m.post;
|
|
185
|
+
return expand2(str);
|
|
186
|
+
}
|
|
187
|
+
return [str];
|
|
188
|
+
}
|
|
189
|
+
var n;
|
|
190
|
+
if (isSequence) {
|
|
191
|
+
n = m.body.split(/\.\./);
|
|
192
|
+
} else {
|
|
193
|
+
n = parseCommaParts(m.body);
|
|
194
|
+
if (n.length === 1) {
|
|
195
|
+
n = expand2(n[0], false).map(embrace);
|
|
196
|
+
if (n.length === 1) {
|
|
197
|
+
return post.map(function(p) {
|
|
198
|
+
return m.pre + n[0] + p;
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
var N;
|
|
204
|
+
if (isSequence) {
|
|
205
|
+
var x = numeric(n[0]);
|
|
206
|
+
var y = numeric(n[1]);
|
|
207
|
+
var width = Math.max(n[0].length, n[1].length);
|
|
208
|
+
var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
|
|
209
|
+
var test = lte;
|
|
210
|
+
var reverse = y < x;
|
|
211
|
+
if (reverse) {
|
|
212
|
+
incr *= -1;
|
|
213
|
+
test = gte;
|
|
214
|
+
}
|
|
215
|
+
var pad = n.some(isPadded);
|
|
216
|
+
N = [];
|
|
217
|
+
for (var i2 = x; test(i2, y); i2 += incr) {
|
|
218
|
+
var c;
|
|
219
|
+
if (isAlphaSequence) {
|
|
220
|
+
c = String.fromCharCode(i2);
|
|
221
|
+
if (c === "\\")
|
|
222
|
+
c = "";
|
|
223
|
+
} else {
|
|
224
|
+
c = String(i2);
|
|
225
|
+
if (pad) {
|
|
226
|
+
var need = width - c.length;
|
|
227
|
+
if (need > 0) {
|
|
228
|
+
var z = new Array(need + 1).join("0");
|
|
229
|
+
if (i2 < 0)
|
|
230
|
+
c = "-" + z + c.slice(1);
|
|
231
|
+
else
|
|
232
|
+
c = z + c;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
N.push(c);
|
|
237
|
+
}
|
|
238
|
+
} else {
|
|
239
|
+
N = [];
|
|
240
|
+
for (var j = 0; j < n.length; j++) {
|
|
241
|
+
N.push.apply(N, expand2(n[j], false));
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
for (var j = 0; j < N.length; j++) {
|
|
245
|
+
for (var k = 0; k < post.length; k++) {
|
|
246
|
+
var expansion = pre + N[j] + post[k];
|
|
247
|
+
if (!isTop || isSequence || expansion)
|
|
248
|
+
expansions.push(expansion);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return expansions;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
});
|
|
15
256
|
var Build = {
|
|
16
257
|
isDev: BUILD.isDev ? true : false,
|
|
17
258
|
isBrowser: true,
|
|
@@ -239,6 +480,9 @@ var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
|
239
480
|
var promiseResolve = (v) => Promise.resolve(v);
|
|
240
481
|
var supportsConstructableStylesheets = BUILD.constructableCSS ? /* @__PURE__ */ (() => {
|
|
241
482
|
try {
|
|
483
|
+
if (!win.document.adoptedStyleSheets) {
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
242
486
|
new CSSStyleSheet();
|
|
243
487
|
return typeof new CSSStyleSheet().replaceSync === "function";
|
|
244
488
|
} catch (e) {
|
|
@@ -320,11 +564,11 @@ var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
|
|
|
320
564
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
321
565
|
|
|
322
566
|
// src/runtime/asset-path.ts
|
|
323
|
-
var getAssetPath = (
|
|
324
|
-
const assetUrl = new URL(
|
|
567
|
+
var getAssetPath = (path2) => {
|
|
568
|
+
const assetUrl = new URL(path2, plt.$resourcesUrl$);
|
|
325
569
|
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
326
570
|
};
|
|
327
|
-
var setAssetPath = (
|
|
571
|
+
var setAssetPath = (path2) => plt.$resourcesUrl$ = path2;
|
|
328
572
|
|
|
329
573
|
// src/utils/helpers.ts
|
|
330
574
|
var isDef = (v) => v != null && v !== void 0;
|
|
@@ -333,6 +577,1359 @@ var isComplexType = (o) => {
|
|
|
333
577
|
return o === "object" || o === "function";
|
|
334
578
|
};
|
|
335
579
|
|
|
580
|
+
// node_modules/minimatch/dist/esm/index.js
|
|
581
|
+
var import_brace_expansion = __toESM(require_brace_expansion());
|
|
582
|
+
|
|
583
|
+
// node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
584
|
+
var MAX_PATTERN_LENGTH = 1024 * 64;
|
|
585
|
+
var assertValidPattern = (pattern) => {
|
|
586
|
+
if (typeof pattern !== "string") {
|
|
587
|
+
throw new TypeError("invalid pattern");
|
|
588
|
+
}
|
|
589
|
+
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
590
|
+
throw new TypeError("pattern is too long");
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
// node_modules/minimatch/dist/esm/brace-expressions.js
|
|
595
|
+
var posixClasses = {
|
|
596
|
+
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
|
597
|
+
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
|
598
|
+
"[:ascii:]": ["\\x00-\\x7f", false],
|
|
599
|
+
"[:blank:]": ["\\p{Zs}\\t", true],
|
|
600
|
+
"[:cntrl:]": ["\\p{Cc}", true],
|
|
601
|
+
"[:digit:]": ["\\p{Nd}", true],
|
|
602
|
+
"[:graph:]": ["\\p{Z}\\p{C}", true, true],
|
|
603
|
+
"[:lower:]": ["\\p{Ll}", true],
|
|
604
|
+
"[:print:]": ["\\p{C}", true],
|
|
605
|
+
"[:punct:]": ["\\p{P}", true],
|
|
606
|
+
"[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
|
|
607
|
+
"[:upper:]": ["\\p{Lu}", true],
|
|
608
|
+
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
|
|
609
|
+
"[:xdigit:]": ["A-Fa-f0-9", false]
|
|
610
|
+
};
|
|
611
|
+
var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
|
|
612
|
+
var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
613
|
+
var rangesToString = (ranges) => ranges.join("");
|
|
614
|
+
var parseClass = (glob, position) => {
|
|
615
|
+
const pos = position;
|
|
616
|
+
if (glob.charAt(pos) !== "[") {
|
|
617
|
+
throw new Error("not in a brace expression");
|
|
618
|
+
}
|
|
619
|
+
const ranges = [];
|
|
620
|
+
const negs = [];
|
|
621
|
+
let i2 = pos + 1;
|
|
622
|
+
let sawStart = false;
|
|
623
|
+
let uflag = false;
|
|
624
|
+
let escaping = false;
|
|
625
|
+
let negate = false;
|
|
626
|
+
let endPos = pos;
|
|
627
|
+
let rangeStart = "";
|
|
628
|
+
WHILE: while (i2 < glob.length) {
|
|
629
|
+
const c = glob.charAt(i2);
|
|
630
|
+
if ((c === "!" || c === "^") && i2 === pos + 1) {
|
|
631
|
+
negate = true;
|
|
632
|
+
i2++;
|
|
633
|
+
continue;
|
|
634
|
+
}
|
|
635
|
+
if (c === "]" && sawStart && !escaping) {
|
|
636
|
+
endPos = i2 + 1;
|
|
637
|
+
break;
|
|
638
|
+
}
|
|
639
|
+
sawStart = true;
|
|
640
|
+
if (c === "\\") {
|
|
641
|
+
if (!escaping) {
|
|
642
|
+
escaping = true;
|
|
643
|
+
i2++;
|
|
644
|
+
continue;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
if (c === "[" && !escaping) {
|
|
648
|
+
for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
|
|
649
|
+
if (glob.startsWith(cls, i2)) {
|
|
650
|
+
if (rangeStart) {
|
|
651
|
+
return ["$.", false, glob.length - pos, true];
|
|
652
|
+
}
|
|
653
|
+
i2 += cls.length;
|
|
654
|
+
if (neg)
|
|
655
|
+
negs.push(unip);
|
|
656
|
+
else
|
|
657
|
+
ranges.push(unip);
|
|
658
|
+
uflag = uflag || u;
|
|
659
|
+
continue WHILE;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
escaping = false;
|
|
664
|
+
if (rangeStart) {
|
|
665
|
+
if (c > rangeStart) {
|
|
666
|
+
ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
|
|
667
|
+
} else if (c === rangeStart) {
|
|
668
|
+
ranges.push(braceEscape(c));
|
|
669
|
+
}
|
|
670
|
+
rangeStart = "";
|
|
671
|
+
i2++;
|
|
672
|
+
continue;
|
|
673
|
+
}
|
|
674
|
+
if (glob.startsWith("-]", i2 + 1)) {
|
|
675
|
+
ranges.push(braceEscape(c + "-"));
|
|
676
|
+
i2 += 2;
|
|
677
|
+
continue;
|
|
678
|
+
}
|
|
679
|
+
if (glob.startsWith("-", i2 + 1)) {
|
|
680
|
+
rangeStart = c;
|
|
681
|
+
i2 += 2;
|
|
682
|
+
continue;
|
|
683
|
+
}
|
|
684
|
+
ranges.push(braceEscape(c));
|
|
685
|
+
i2++;
|
|
686
|
+
}
|
|
687
|
+
if (endPos < i2) {
|
|
688
|
+
return ["", false, 0, false];
|
|
689
|
+
}
|
|
690
|
+
if (!ranges.length && !negs.length) {
|
|
691
|
+
return ["$.", false, glob.length - pos, true];
|
|
692
|
+
}
|
|
693
|
+
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
|
|
694
|
+
const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
|
|
695
|
+
return [regexpEscape(r), false, endPos - pos, false];
|
|
696
|
+
}
|
|
697
|
+
const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
|
|
698
|
+
const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
|
|
699
|
+
const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
|
|
700
|
+
return [comb, uflag, endPos - pos, true];
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
// node_modules/minimatch/dist/esm/unescape.js
|
|
704
|
+
var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
705
|
+
return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
// node_modules/minimatch/dist/esm/ast.js
|
|
709
|
+
var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
710
|
+
var isExtglobType = (c) => types.has(c);
|
|
711
|
+
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
712
|
+
var startNoDot = "(?!\\.)";
|
|
713
|
+
var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
|
714
|
+
var justDots = /* @__PURE__ */ new Set(["..", "."]);
|
|
715
|
+
var reSpecials = new Set("().*{}+?[]^$\\!");
|
|
716
|
+
var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
717
|
+
var qmark = "[^/]";
|
|
718
|
+
var star = qmark + "*?";
|
|
719
|
+
var starNoEmpty = qmark + "+?";
|
|
720
|
+
var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn;
|
|
721
|
+
var _AST = class _AST {
|
|
722
|
+
constructor(type, parent, options = {}) {
|
|
723
|
+
__privateAdd(this, _AST_instances);
|
|
724
|
+
__publicField(this, "type");
|
|
725
|
+
__privateAdd(this, _root);
|
|
726
|
+
__privateAdd(this, _hasMagic);
|
|
727
|
+
__privateAdd(this, _uflag, false);
|
|
728
|
+
__privateAdd(this, _parts, []);
|
|
729
|
+
__privateAdd(this, _parent);
|
|
730
|
+
__privateAdd(this, _parentIndex);
|
|
731
|
+
__privateAdd(this, _negs);
|
|
732
|
+
__privateAdd(this, _filledNegs, false);
|
|
733
|
+
__privateAdd(this, _options);
|
|
734
|
+
__privateAdd(this, _toString);
|
|
735
|
+
// set to true if it's an extglob with no children
|
|
736
|
+
// (which really means one child of '')
|
|
737
|
+
__privateAdd(this, _emptyExt, false);
|
|
738
|
+
this.type = type;
|
|
739
|
+
if (type)
|
|
740
|
+
__privateSet(this, _hasMagic, true);
|
|
741
|
+
__privateSet(this, _parent, parent);
|
|
742
|
+
__privateSet(this, _root, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _root) : this);
|
|
743
|
+
__privateSet(this, _options, __privateGet(this, _root) === this ? options : __privateGet(__privateGet(this, _root), _options));
|
|
744
|
+
__privateSet(this, _negs, __privateGet(this, _root) === this ? [] : __privateGet(__privateGet(this, _root), _negs));
|
|
745
|
+
if (type === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
|
|
746
|
+
__privateGet(this, _negs).push(this);
|
|
747
|
+
__privateSet(this, _parentIndex, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0);
|
|
748
|
+
}
|
|
749
|
+
get hasMagic() {
|
|
750
|
+
if (__privateGet(this, _hasMagic) !== void 0)
|
|
751
|
+
return __privateGet(this, _hasMagic);
|
|
752
|
+
for (const p of __privateGet(this, _parts)) {
|
|
753
|
+
if (typeof p === "string")
|
|
754
|
+
continue;
|
|
755
|
+
if (p.type || p.hasMagic)
|
|
756
|
+
return __privateSet(this, _hasMagic, true);
|
|
757
|
+
}
|
|
758
|
+
return __privateGet(this, _hasMagic);
|
|
759
|
+
}
|
|
760
|
+
// reconstructs the pattern
|
|
761
|
+
toString() {
|
|
762
|
+
if (__privateGet(this, _toString) !== void 0)
|
|
763
|
+
return __privateGet(this, _toString);
|
|
764
|
+
if (!this.type) {
|
|
765
|
+
return __privateSet(this, _toString, __privateGet(this, _parts).map((p) => String(p)).join(""));
|
|
766
|
+
} else {
|
|
767
|
+
return __privateSet(this, _toString, this.type + "(" + __privateGet(this, _parts).map((p) => String(p)).join("|") + ")");
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
push(...parts) {
|
|
771
|
+
for (const p of parts) {
|
|
772
|
+
if (p === "")
|
|
773
|
+
continue;
|
|
774
|
+
if (typeof p !== "string" && !(p instanceof _AST && __privateGet(p, _parent) === this)) {
|
|
775
|
+
throw new Error("invalid part: " + p);
|
|
776
|
+
}
|
|
777
|
+
__privateGet(this, _parts).push(p);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
toJSON() {
|
|
781
|
+
var _a;
|
|
782
|
+
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())];
|
|
783
|
+
if (this.isStart() && !this.type)
|
|
784
|
+
ret.unshift([]);
|
|
785
|
+
if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")) {
|
|
786
|
+
ret.push({});
|
|
787
|
+
}
|
|
788
|
+
return ret;
|
|
789
|
+
}
|
|
790
|
+
isStart() {
|
|
791
|
+
var _a;
|
|
792
|
+
if (__privateGet(this, _root) === this)
|
|
793
|
+
return true;
|
|
794
|
+
if (!((_a = __privateGet(this, _parent)) == null ? void 0 : _a.isStart()))
|
|
795
|
+
return false;
|
|
796
|
+
if (__privateGet(this, _parentIndex) === 0)
|
|
797
|
+
return true;
|
|
798
|
+
const p = __privateGet(this, _parent);
|
|
799
|
+
for (let i2 = 0; i2 < __privateGet(this, _parentIndex); i2++) {
|
|
800
|
+
const pp = __privateGet(p, _parts)[i2];
|
|
801
|
+
if (!(pp instanceof _AST && pp.type === "!")) {
|
|
802
|
+
return false;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
return true;
|
|
806
|
+
}
|
|
807
|
+
isEnd() {
|
|
808
|
+
var _a, _b, _c;
|
|
809
|
+
if (__privateGet(this, _root) === this)
|
|
810
|
+
return true;
|
|
811
|
+
if (((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")
|
|
812
|
+
return true;
|
|
813
|
+
if (!((_b = __privateGet(this, _parent)) == null ? void 0 : _b.isEnd()))
|
|
814
|
+
return false;
|
|
815
|
+
if (!this.type)
|
|
816
|
+
return (_c = __privateGet(this, _parent)) == null ? void 0 : _c.isEnd();
|
|
817
|
+
const pl = __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0;
|
|
818
|
+
return __privateGet(this, _parentIndex) === pl - 1;
|
|
819
|
+
}
|
|
820
|
+
copyIn(part) {
|
|
821
|
+
if (typeof part === "string")
|
|
822
|
+
this.push(part);
|
|
823
|
+
else
|
|
824
|
+
this.push(part.clone(this));
|
|
825
|
+
}
|
|
826
|
+
clone(parent) {
|
|
827
|
+
const c = new _AST(this.type, parent);
|
|
828
|
+
for (const p of __privateGet(this, _parts)) {
|
|
829
|
+
c.copyIn(p);
|
|
830
|
+
}
|
|
831
|
+
return c;
|
|
832
|
+
}
|
|
833
|
+
static fromGlob(pattern, options = {}) {
|
|
834
|
+
var _a;
|
|
835
|
+
const ast = new _AST(null, void 0, options);
|
|
836
|
+
__privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, pattern, ast, 0, options);
|
|
837
|
+
return ast;
|
|
838
|
+
}
|
|
839
|
+
// returns the regular expression if there's magic, or the unescaped
|
|
840
|
+
// string if not.
|
|
841
|
+
toMMPattern() {
|
|
842
|
+
if (this !== __privateGet(this, _root))
|
|
843
|
+
return __privateGet(this, _root).toMMPattern();
|
|
844
|
+
const glob = this.toString();
|
|
845
|
+
const [re, body, hasMagic, uflag] = this.toRegExpSource();
|
|
846
|
+
const anyMagic = hasMagic || __privateGet(this, _hasMagic) || __privateGet(this, _options).nocase && !__privateGet(this, _options).nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
|
|
847
|
+
if (!anyMagic) {
|
|
848
|
+
return body;
|
|
849
|
+
}
|
|
850
|
+
const flags = (__privateGet(this, _options).nocase ? "i" : "") + (uflag ? "u" : "");
|
|
851
|
+
return Object.assign(new RegExp(`^${re}$`, flags), {
|
|
852
|
+
_src: re,
|
|
853
|
+
_glob: glob
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
get options() {
|
|
857
|
+
return __privateGet(this, _options);
|
|
858
|
+
}
|
|
859
|
+
// returns the string match, the regexp source, whether there's magic
|
|
860
|
+
// in the regexp (so a regular expression is required) and whether or
|
|
861
|
+
// not the uflag is needed for the regular expression (for posix classes)
|
|
862
|
+
// TODO: instead of injecting the start/end at this point, just return
|
|
863
|
+
// the BODY of the regexp, along with the start/end portions suitable
|
|
864
|
+
// for binding the start/end in either a joined full-path makeRe context
|
|
865
|
+
// (where we bind to (^|/), or a standalone matchPart context (where
|
|
866
|
+
// we bind to ^, and not /). Otherwise slashes get duped!
|
|
867
|
+
//
|
|
868
|
+
// In part-matching mode, the start is:
|
|
869
|
+
// - if not isStart: nothing
|
|
870
|
+
// - if traversal possible, but not allowed: ^(?!\.\.?$)
|
|
871
|
+
// - if dots allowed or not possible: ^
|
|
872
|
+
// - if dots possible and not allowed: ^(?!\.)
|
|
873
|
+
// end is:
|
|
874
|
+
// - if not isEnd(): nothing
|
|
875
|
+
// - else: $
|
|
876
|
+
//
|
|
877
|
+
// In full-path matching mode, we put the slash at the START of the
|
|
878
|
+
// pattern, so start is:
|
|
879
|
+
// - if first pattern: same as part-matching mode
|
|
880
|
+
// - if not isStart(): nothing
|
|
881
|
+
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
|
|
882
|
+
// - if dots allowed or not possible: /
|
|
883
|
+
// - if dots possible and not allowed: /(?!\.)
|
|
884
|
+
// end is:
|
|
885
|
+
// - if last pattern, same as part-matching mode
|
|
886
|
+
// - else nothing
|
|
887
|
+
//
|
|
888
|
+
// Always put the (?:$|/) on negated tails, though, because that has to be
|
|
889
|
+
// there to bind the end of the negated pattern portion, and it's easier to
|
|
890
|
+
// just stick it in now rather than try to inject it later in the middle of
|
|
891
|
+
// the pattern.
|
|
892
|
+
//
|
|
893
|
+
// We can just always return the same end, and leave it up to the caller
|
|
894
|
+
// to know whether it's going to be used joined or in parts.
|
|
895
|
+
// And, if the start is adjusted slightly, can do the same there:
|
|
896
|
+
// - if not isStart: nothing
|
|
897
|
+
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
|
|
898
|
+
// - if dots allowed or not possible: (?:/|^)
|
|
899
|
+
// - if dots possible and not allowed: (?:/|^)(?!\.)
|
|
900
|
+
//
|
|
901
|
+
// But it's better to have a simpler binding without a conditional, for
|
|
902
|
+
// performance, so probably better to return both start options.
|
|
903
|
+
//
|
|
904
|
+
// Then the caller just ignores the end if it's not the first pattern,
|
|
905
|
+
// and the start always gets applied.
|
|
906
|
+
//
|
|
907
|
+
// But that's always going to be $ if it's the ending pattern, or nothing,
|
|
908
|
+
// so the caller can just attach $ at the end of the pattern when building.
|
|
909
|
+
//
|
|
910
|
+
// So the todo is:
|
|
911
|
+
// - better detect what kind of start is needed
|
|
912
|
+
// - return both flavors of starting pattern
|
|
913
|
+
// - attach $ at the end of the pattern when creating the actual RegExp
|
|
914
|
+
//
|
|
915
|
+
// Ah, but wait, no, that all only applies to the root when the first pattern
|
|
916
|
+
// is not an extglob. If the first pattern IS an extglob, then we need all
|
|
917
|
+
// that dot prevention biz to live in the extglob portions, because eg
|
|
918
|
+
// +(*|.x*) can match .xy but not .yx.
|
|
919
|
+
//
|
|
920
|
+
// So, return the two flavors if it's #root and the first child is not an
|
|
921
|
+
// AST, otherwise leave it to the child AST to handle it, and there,
|
|
922
|
+
// use the (?:^|/) style of start binding.
|
|
923
|
+
//
|
|
924
|
+
// Even simplified further:
|
|
925
|
+
// - Since the start for a join is eg /(?!\.) and the start for a part
|
|
926
|
+
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
|
927
|
+
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
|
928
|
+
toRegExpSource(allowDot) {
|
|
929
|
+
var _a;
|
|
930
|
+
const dot = allowDot != null ? allowDot : !!__privateGet(this, _options).dot;
|
|
931
|
+
if (__privateGet(this, _root) === this)
|
|
932
|
+
__privateMethod(this, _AST_instances, fillNegs_fn).call(this);
|
|
933
|
+
if (!this.type) {
|
|
934
|
+
const noEmpty = this.isStart() && this.isEnd();
|
|
935
|
+
const src = __privateGet(this, _parts).map((p) => {
|
|
936
|
+
var _a2;
|
|
937
|
+
const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(_a2 = _AST, _AST_static, parseGlob_fn).call(_a2, p, __privateGet(this, _hasMagic), noEmpty) : p.toRegExpSource(allowDot);
|
|
938
|
+
__privateSet(this, _hasMagic, __privateGet(this, _hasMagic) || hasMagic);
|
|
939
|
+
__privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
|
|
940
|
+
return re;
|
|
941
|
+
}).join("");
|
|
942
|
+
let start2 = "";
|
|
943
|
+
if (this.isStart()) {
|
|
944
|
+
if (typeof __privateGet(this, _parts)[0] === "string") {
|
|
945
|
+
const dotTravAllowed = __privateGet(this, _parts).length === 1 && justDots.has(__privateGet(this, _parts)[0]);
|
|
946
|
+
if (!dotTravAllowed) {
|
|
947
|
+
const aps = addPatternStart;
|
|
948
|
+
const needNoTrav = (
|
|
949
|
+
// dots are allowed, and the pattern starts with [ or .
|
|
950
|
+
dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
|
|
951
|
+
src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
|
|
952
|
+
src.startsWith("\\.\\.") && aps.has(src.charAt(4))
|
|
953
|
+
);
|
|
954
|
+
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
|
955
|
+
start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
let end = "";
|
|
960
|
+
if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!") {
|
|
961
|
+
end = "(?:$|\\/)";
|
|
962
|
+
}
|
|
963
|
+
const final2 = start2 + src + end;
|
|
964
|
+
return [
|
|
965
|
+
final2,
|
|
966
|
+
unescape(src),
|
|
967
|
+
__privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
|
|
968
|
+
__privateGet(this, _uflag)
|
|
969
|
+
];
|
|
970
|
+
}
|
|
971
|
+
const repeated = this.type === "*" || this.type === "+";
|
|
972
|
+
const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
|
|
973
|
+
let body = __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, dot);
|
|
974
|
+
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
|
975
|
+
const s = this.toString();
|
|
976
|
+
__privateSet(this, _parts, [s]);
|
|
977
|
+
this.type = null;
|
|
978
|
+
__privateSet(this, _hasMagic, void 0);
|
|
979
|
+
return [s, unescape(this.toString()), false, false];
|
|
980
|
+
}
|
|
981
|
+
let bodyDotAllowed = !repeated || allowDot || dot || false ? "" : __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, true);
|
|
982
|
+
if (bodyDotAllowed === body) {
|
|
983
|
+
bodyDotAllowed = "";
|
|
984
|
+
}
|
|
985
|
+
if (bodyDotAllowed) {
|
|
986
|
+
body = `(?:${body})(?:${bodyDotAllowed})*?`;
|
|
987
|
+
}
|
|
988
|
+
let final = "";
|
|
989
|
+
if (this.type === "!" && __privateGet(this, _emptyExt)) {
|
|
990
|
+
final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
|
|
991
|
+
} else {
|
|
992
|
+
const close = this.type === "!" ? (
|
|
993
|
+
// !() must match something,but !(x) can match ''
|
|
994
|
+
"))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
|
|
995
|
+
) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
|
|
996
|
+
final = start + body + close;
|
|
997
|
+
}
|
|
998
|
+
return [
|
|
999
|
+
final,
|
|
1000
|
+
unescape(body),
|
|
1001
|
+
__privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
|
|
1002
|
+
__privateGet(this, _uflag)
|
|
1003
|
+
];
|
|
1004
|
+
}
|
|
1005
|
+
};
|
|
1006
|
+
_root = new WeakMap();
|
|
1007
|
+
_hasMagic = new WeakMap();
|
|
1008
|
+
_uflag = new WeakMap();
|
|
1009
|
+
_parts = new WeakMap();
|
|
1010
|
+
_parent = new WeakMap();
|
|
1011
|
+
_parentIndex = new WeakMap();
|
|
1012
|
+
_negs = new WeakMap();
|
|
1013
|
+
_filledNegs = new WeakMap();
|
|
1014
|
+
_options = new WeakMap();
|
|
1015
|
+
_toString = new WeakMap();
|
|
1016
|
+
_emptyExt = new WeakMap();
|
|
1017
|
+
_AST_instances = new WeakSet();
|
|
1018
|
+
fillNegs_fn = function() {
|
|
1019
|
+
if (this !== __privateGet(this, _root))
|
|
1020
|
+
throw new Error("should only call on root");
|
|
1021
|
+
if (__privateGet(this, _filledNegs))
|
|
1022
|
+
return this;
|
|
1023
|
+
this.toString();
|
|
1024
|
+
__privateSet(this, _filledNegs, true);
|
|
1025
|
+
let n;
|
|
1026
|
+
while (n = __privateGet(this, _negs).pop()) {
|
|
1027
|
+
if (n.type !== "!")
|
|
1028
|
+
continue;
|
|
1029
|
+
let p = n;
|
|
1030
|
+
let pp = __privateGet(p, _parent);
|
|
1031
|
+
while (pp) {
|
|
1032
|
+
for (let i2 = __privateGet(p, _parentIndex) + 1; !pp.type && i2 < __privateGet(pp, _parts).length; i2++) {
|
|
1033
|
+
for (const part of __privateGet(n, _parts)) {
|
|
1034
|
+
if (typeof part === "string") {
|
|
1035
|
+
throw new Error("string part in extglob AST??");
|
|
1036
|
+
}
|
|
1037
|
+
part.copyIn(__privateGet(pp, _parts)[i2]);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
p = pp;
|
|
1041
|
+
pp = __privateGet(p, _parent);
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
return this;
|
|
1045
|
+
};
|
|
1046
|
+
_AST_static = new WeakSet();
|
|
1047
|
+
parseAST_fn = function(str, ast, pos, opt) {
|
|
1048
|
+
var _a, _b;
|
|
1049
|
+
let escaping = false;
|
|
1050
|
+
let inBrace = false;
|
|
1051
|
+
let braceStart = -1;
|
|
1052
|
+
let braceNeg = false;
|
|
1053
|
+
if (ast.type === null) {
|
|
1054
|
+
let i3 = pos;
|
|
1055
|
+
let acc2 = "";
|
|
1056
|
+
while (i3 < str.length) {
|
|
1057
|
+
const c = str.charAt(i3++);
|
|
1058
|
+
if (escaping || c === "\\") {
|
|
1059
|
+
escaping = !escaping;
|
|
1060
|
+
acc2 += c;
|
|
1061
|
+
continue;
|
|
1062
|
+
}
|
|
1063
|
+
if (inBrace) {
|
|
1064
|
+
if (i3 === braceStart + 1) {
|
|
1065
|
+
if (c === "^" || c === "!") {
|
|
1066
|
+
braceNeg = true;
|
|
1067
|
+
}
|
|
1068
|
+
} else if (c === "]" && !(i3 === braceStart + 2 && braceNeg)) {
|
|
1069
|
+
inBrace = false;
|
|
1070
|
+
}
|
|
1071
|
+
acc2 += c;
|
|
1072
|
+
continue;
|
|
1073
|
+
} else if (c === "[") {
|
|
1074
|
+
inBrace = true;
|
|
1075
|
+
braceStart = i3;
|
|
1076
|
+
braceNeg = false;
|
|
1077
|
+
acc2 += c;
|
|
1078
|
+
continue;
|
|
1079
|
+
}
|
|
1080
|
+
if (!opt.noext && isExtglobType(c) && str.charAt(i3) === "(") {
|
|
1081
|
+
ast.push(acc2);
|
|
1082
|
+
acc2 = "";
|
|
1083
|
+
const ext2 = new _AST(c, ast);
|
|
1084
|
+
i3 = __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, str, ext2, i3, opt);
|
|
1085
|
+
ast.push(ext2);
|
|
1086
|
+
continue;
|
|
1087
|
+
}
|
|
1088
|
+
acc2 += c;
|
|
1089
|
+
}
|
|
1090
|
+
ast.push(acc2);
|
|
1091
|
+
return i3;
|
|
1092
|
+
}
|
|
1093
|
+
let i2 = pos + 1;
|
|
1094
|
+
let part = new _AST(null, ast);
|
|
1095
|
+
const parts = [];
|
|
1096
|
+
let acc = "";
|
|
1097
|
+
while (i2 < str.length) {
|
|
1098
|
+
const c = str.charAt(i2++);
|
|
1099
|
+
if (escaping || c === "\\") {
|
|
1100
|
+
escaping = !escaping;
|
|
1101
|
+
acc += c;
|
|
1102
|
+
continue;
|
|
1103
|
+
}
|
|
1104
|
+
if (inBrace) {
|
|
1105
|
+
if (i2 === braceStart + 1) {
|
|
1106
|
+
if (c === "^" || c === "!") {
|
|
1107
|
+
braceNeg = true;
|
|
1108
|
+
}
|
|
1109
|
+
} else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
|
|
1110
|
+
inBrace = false;
|
|
1111
|
+
}
|
|
1112
|
+
acc += c;
|
|
1113
|
+
continue;
|
|
1114
|
+
} else if (c === "[") {
|
|
1115
|
+
inBrace = true;
|
|
1116
|
+
braceStart = i2;
|
|
1117
|
+
braceNeg = false;
|
|
1118
|
+
acc += c;
|
|
1119
|
+
continue;
|
|
1120
|
+
}
|
|
1121
|
+
if (isExtglobType(c) && str.charAt(i2) === "(") {
|
|
1122
|
+
part.push(acc);
|
|
1123
|
+
acc = "";
|
|
1124
|
+
const ext2 = new _AST(c, part);
|
|
1125
|
+
part.push(ext2);
|
|
1126
|
+
i2 = __privateMethod(_b = _AST, _AST_static, parseAST_fn).call(_b, str, ext2, i2, opt);
|
|
1127
|
+
continue;
|
|
1128
|
+
}
|
|
1129
|
+
if (c === "|") {
|
|
1130
|
+
part.push(acc);
|
|
1131
|
+
acc = "";
|
|
1132
|
+
parts.push(part);
|
|
1133
|
+
part = new _AST(null, ast);
|
|
1134
|
+
continue;
|
|
1135
|
+
}
|
|
1136
|
+
if (c === ")") {
|
|
1137
|
+
if (acc === "" && __privateGet(ast, _parts).length === 0) {
|
|
1138
|
+
__privateSet(ast, _emptyExt, true);
|
|
1139
|
+
}
|
|
1140
|
+
part.push(acc);
|
|
1141
|
+
acc = "";
|
|
1142
|
+
ast.push(...parts, part);
|
|
1143
|
+
return i2;
|
|
1144
|
+
}
|
|
1145
|
+
acc += c;
|
|
1146
|
+
}
|
|
1147
|
+
ast.type = null;
|
|
1148
|
+
__privateSet(ast, _hasMagic, void 0);
|
|
1149
|
+
__privateSet(ast, _parts, [str.substring(pos - 1)]);
|
|
1150
|
+
return i2;
|
|
1151
|
+
};
|
|
1152
|
+
partsToRegExp_fn = function(dot) {
|
|
1153
|
+
return __privateGet(this, _parts).map((p) => {
|
|
1154
|
+
if (typeof p === "string") {
|
|
1155
|
+
throw new Error("string type in extglob ast??");
|
|
1156
|
+
}
|
|
1157
|
+
const [re, _, _hasMagic2, uflag] = p.toRegExpSource(dot);
|
|
1158
|
+
__privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
|
|
1159
|
+
return re;
|
|
1160
|
+
}).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
|
|
1161
|
+
};
|
|
1162
|
+
parseGlob_fn = function(glob, hasMagic, noEmpty = false) {
|
|
1163
|
+
let escaping = false;
|
|
1164
|
+
let re = "";
|
|
1165
|
+
let uflag = false;
|
|
1166
|
+
for (let i2 = 0; i2 < glob.length; i2++) {
|
|
1167
|
+
const c = glob.charAt(i2);
|
|
1168
|
+
if (escaping) {
|
|
1169
|
+
escaping = false;
|
|
1170
|
+
re += (reSpecials.has(c) ? "\\" : "") + c;
|
|
1171
|
+
continue;
|
|
1172
|
+
}
|
|
1173
|
+
if (c === "\\") {
|
|
1174
|
+
if (i2 === glob.length - 1) {
|
|
1175
|
+
re += "\\\\";
|
|
1176
|
+
} else {
|
|
1177
|
+
escaping = true;
|
|
1178
|
+
}
|
|
1179
|
+
continue;
|
|
1180
|
+
}
|
|
1181
|
+
if (c === "[") {
|
|
1182
|
+
const [src, needUflag, consumed, magic] = parseClass(glob, i2);
|
|
1183
|
+
if (consumed) {
|
|
1184
|
+
re += src;
|
|
1185
|
+
uflag = uflag || needUflag;
|
|
1186
|
+
i2 += consumed - 1;
|
|
1187
|
+
hasMagic = hasMagic || magic;
|
|
1188
|
+
continue;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
if (c === "*") {
|
|
1192
|
+
if (noEmpty && glob === "*")
|
|
1193
|
+
re += starNoEmpty;
|
|
1194
|
+
else
|
|
1195
|
+
re += star;
|
|
1196
|
+
hasMagic = true;
|
|
1197
|
+
continue;
|
|
1198
|
+
}
|
|
1199
|
+
if (c === "?") {
|
|
1200
|
+
re += qmark;
|
|
1201
|
+
hasMagic = true;
|
|
1202
|
+
continue;
|
|
1203
|
+
}
|
|
1204
|
+
re += regExpEscape(c);
|
|
1205
|
+
}
|
|
1206
|
+
return [re, unescape(glob), !!hasMagic, uflag];
|
|
1207
|
+
};
|
|
1208
|
+
__privateAdd(_AST, _AST_static);
|
|
1209
|
+
var AST = _AST;
|
|
1210
|
+
|
|
1211
|
+
// node_modules/minimatch/dist/esm/escape.js
|
|
1212
|
+
var escape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
1213
|
+
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
|
1214
|
+
};
|
|
1215
|
+
|
|
1216
|
+
// node_modules/minimatch/dist/esm/index.js
|
|
1217
|
+
var minimatch = (p, pattern, options = {}) => {
|
|
1218
|
+
assertValidPattern(pattern);
|
|
1219
|
+
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
1220
|
+
return false;
|
|
1221
|
+
}
|
|
1222
|
+
return new Minimatch(pattern, options).match(p);
|
|
1223
|
+
};
|
|
1224
|
+
var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
|
|
1225
|
+
var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
|
|
1226
|
+
var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
|
|
1227
|
+
var starDotExtTestNocase = (ext2) => {
|
|
1228
|
+
ext2 = ext2.toLowerCase();
|
|
1229
|
+
return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
|
|
1230
|
+
};
|
|
1231
|
+
var starDotExtTestNocaseDot = (ext2) => {
|
|
1232
|
+
ext2 = ext2.toLowerCase();
|
|
1233
|
+
return (f) => f.toLowerCase().endsWith(ext2);
|
|
1234
|
+
};
|
|
1235
|
+
var starDotStarRE = /^\*+\.\*+$/;
|
|
1236
|
+
var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
|
|
1237
|
+
var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
|
|
1238
|
+
var dotStarRE = /^\.\*+$/;
|
|
1239
|
+
var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
|
|
1240
|
+
var starRE = /^\*+$/;
|
|
1241
|
+
var starTest = (f) => f.length !== 0 && !f.startsWith(".");
|
|
1242
|
+
var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
|
|
1243
|
+
var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
1244
|
+
var qmarksTestNocase = ([$0, ext2 = ""]) => {
|
|
1245
|
+
const noext = qmarksTestNoExt([$0]);
|
|
1246
|
+
if (!ext2)
|
|
1247
|
+
return noext;
|
|
1248
|
+
ext2 = ext2.toLowerCase();
|
|
1249
|
+
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
|
|
1250
|
+
};
|
|
1251
|
+
var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
|
|
1252
|
+
const noext = qmarksTestNoExtDot([$0]);
|
|
1253
|
+
if (!ext2)
|
|
1254
|
+
return noext;
|
|
1255
|
+
ext2 = ext2.toLowerCase();
|
|
1256
|
+
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
|
|
1257
|
+
};
|
|
1258
|
+
var qmarksTestDot = ([$0, ext2 = ""]) => {
|
|
1259
|
+
const noext = qmarksTestNoExtDot([$0]);
|
|
1260
|
+
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
|
|
1261
|
+
};
|
|
1262
|
+
var qmarksTest = ([$0, ext2 = ""]) => {
|
|
1263
|
+
const noext = qmarksTestNoExt([$0]);
|
|
1264
|
+
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
|
|
1265
|
+
};
|
|
1266
|
+
var qmarksTestNoExt = ([$0]) => {
|
|
1267
|
+
const len = $0.length;
|
|
1268
|
+
return (f) => f.length === len && !f.startsWith(".");
|
|
1269
|
+
};
|
|
1270
|
+
var qmarksTestNoExtDot = ([$0]) => {
|
|
1271
|
+
const len = $0.length;
|
|
1272
|
+
return (f) => f.length === len && f !== "." && f !== "..";
|
|
1273
|
+
};
|
|
1274
|
+
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
1275
|
+
var path = {
|
|
1276
|
+
win32: { sep: "\\" },
|
|
1277
|
+
posix: { sep: "/" }
|
|
1278
|
+
};
|
|
1279
|
+
var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
|
|
1280
|
+
minimatch.sep = sep;
|
|
1281
|
+
var GLOBSTAR = Symbol("globstar **");
|
|
1282
|
+
minimatch.GLOBSTAR = GLOBSTAR;
|
|
1283
|
+
var qmark2 = "[^/]";
|
|
1284
|
+
var star2 = qmark2 + "*?";
|
|
1285
|
+
var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
1286
|
+
var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
1287
|
+
var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
|
|
1288
|
+
minimatch.filter = filter;
|
|
1289
|
+
var ext = (a, b = {}) => Object.assign({}, a, b);
|
|
1290
|
+
var defaults = (def) => {
|
|
1291
|
+
if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
|
1292
|
+
return minimatch;
|
|
1293
|
+
}
|
|
1294
|
+
const orig = minimatch;
|
|
1295
|
+
const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
|
|
1296
|
+
return Object.assign(m, {
|
|
1297
|
+
Minimatch: class Minimatch extends orig.Minimatch {
|
|
1298
|
+
constructor(pattern, options = {}) {
|
|
1299
|
+
super(pattern, ext(def, options));
|
|
1300
|
+
}
|
|
1301
|
+
static defaults(options) {
|
|
1302
|
+
return orig.defaults(ext(def, options)).Minimatch;
|
|
1303
|
+
}
|
|
1304
|
+
},
|
|
1305
|
+
AST: class AST extends orig.AST {
|
|
1306
|
+
/* c8 ignore start */
|
|
1307
|
+
constructor(type, parent, options = {}) {
|
|
1308
|
+
super(type, parent, ext(def, options));
|
|
1309
|
+
}
|
|
1310
|
+
/* c8 ignore stop */
|
|
1311
|
+
static fromGlob(pattern, options = {}) {
|
|
1312
|
+
return orig.AST.fromGlob(pattern, ext(def, options));
|
|
1313
|
+
}
|
|
1314
|
+
},
|
|
1315
|
+
unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
|
|
1316
|
+
escape: (s, options = {}) => orig.escape(s, ext(def, options)),
|
|
1317
|
+
filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
|
|
1318
|
+
defaults: (options) => orig.defaults(ext(def, options)),
|
|
1319
|
+
makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
|
|
1320
|
+
braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
|
|
1321
|
+
match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
|
|
1322
|
+
sep: orig.sep,
|
|
1323
|
+
GLOBSTAR
|
|
1324
|
+
});
|
|
1325
|
+
};
|
|
1326
|
+
minimatch.defaults = defaults;
|
|
1327
|
+
var braceExpand = (pattern, options = {}) => {
|
|
1328
|
+
assertValidPattern(pattern);
|
|
1329
|
+
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
1330
|
+
return [pattern];
|
|
1331
|
+
}
|
|
1332
|
+
return (0, import_brace_expansion.default)(pattern);
|
|
1333
|
+
};
|
|
1334
|
+
minimatch.braceExpand = braceExpand;
|
|
1335
|
+
var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
|
|
1336
|
+
minimatch.makeRe = makeRe;
|
|
1337
|
+
var match = (list, pattern, options = {}) => {
|
|
1338
|
+
const mm = new Minimatch(pattern, options);
|
|
1339
|
+
list = list.filter((f) => mm.match(f));
|
|
1340
|
+
if (mm.options.nonull && !list.length) {
|
|
1341
|
+
list.push(pattern);
|
|
1342
|
+
}
|
|
1343
|
+
return list;
|
|
1344
|
+
};
|
|
1345
|
+
minimatch.match = match;
|
|
1346
|
+
var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
1347
|
+
var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
1348
|
+
var Minimatch = class {
|
|
1349
|
+
options;
|
|
1350
|
+
set;
|
|
1351
|
+
pattern;
|
|
1352
|
+
windowsPathsNoEscape;
|
|
1353
|
+
nonegate;
|
|
1354
|
+
negate;
|
|
1355
|
+
comment;
|
|
1356
|
+
empty;
|
|
1357
|
+
preserveMultipleSlashes;
|
|
1358
|
+
partial;
|
|
1359
|
+
globSet;
|
|
1360
|
+
globParts;
|
|
1361
|
+
nocase;
|
|
1362
|
+
isWindows;
|
|
1363
|
+
platform;
|
|
1364
|
+
windowsNoMagicRoot;
|
|
1365
|
+
regexp;
|
|
1366
|
+
constructor(pattern, options = {}) {
|
|
1367
|
+
assertValidPattern(pattern);
|
|
1368
|
+
options = options || {};
|
|
1369
|
+
this.options = options;
|
|
1370
|
+
this.pattern = pattern;
|
|
1371
|
+
this.platform = options.platform || defaultPlatform;
|
|
1372
|
+
this.isWindows = this.platform === "win32";
|
|
1373
|
+
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
|
1374
|
+
if (this.windowsPathsNoEscape) {
|
|
1375
|
+
this.pattern = this.pattern.replace(/\\/g, "/");
|
|
1376
|
+
}
|
|
1377
|
+
this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
|
|
1378
|
+
this.regexp = null;
|
|
1379
|
+
this.negate = false;
|
|
1380
|
+
this.nonegate = !!options.nonegate;
|
|
1381
|
+
this.comment = false;
|
|
1382
|
+
this.empty = false;
|
|
1383
|
+
this.partial = !!options.partial;
|
|
1384
|
+
this.nocase = !!this.options.nocase;
|
|
1385
|
+
this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
|
|
1386
|
+
this.globSet = [];
|
|
1387
|
+
this.globParts = [];
|
|
1388
|
+
this.set = [];
|
|
1389
|
+
this.make();
|
|
1390
|
+
}
|
|
1391
|
+
hasMagic() {
|
|
1392
|
+
if (this.options.magicalBraces && this.set.length > 1) {
|
|
1393
|
+
return true;
|
|
1394
|
+
}
|
|
1395
|
+
for (const pattern of this.set) {
|
|
1396
|
+
for (const part of pattern) {
|
|
1397
|
+
if (typeof part !== "string")
|
|
1398
|
+
return true;
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
return false;
|
|
1402
|
+
}
|
|
1403
|
+
debug(..._) {
|
|
1404
|
+
}
|
|
1405
|
+
make() {
|
|
1406
|
+
const pattern = this.pattern;
|
|
1407
|
+
const options = this.options;
|
|
1408
|
+
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
1409
|
+
this.comment = true;
|
|
1410
|
+
return;
|
|
1411
|
+
}
|
|
1412
|
+
if (!pattern) {
|
|
1413
|
+
this.empty = true;
|
|
1414
|
+
return;
|
|
1415
|
+
}
|
|
1416
|
+
this.parseNegate();
|
|
1417
|
+
this.globSet = [...new Set(this.braceExpand())];
|
|
1418
|
+
if (options.debug) {
|
|
1419
|
+
this.debug = (...args) => console.error(...args);
|
|
1420
|
+
}
|
|
1421
|
+
this.debug(this.pattern, this.globSet);
|
|
1422
|
+
const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
|
|
1423
|
+
this.globParts = this.preprocess(rawGlobParts);
|
|
1424
|
+
this.debug(this.pattern, this.globParts);
|
|
1425
|
+
let set = this.globParts.map((s, _, __) => {
|
|
1426
|
+
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
1427
|
+
const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
|
|
1428
|
+
const isDrive = /^[a-z]:/i.test(s[0]);
|
|
1429
|
+
if (isUNC) {
|
|
1430
|
+
return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
|
|
1431
|
+
} else if (isDrive) {
|
|
1432
|
+
return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
return s.map((ss) => this.parse(ss));
|
|
1436
|
+
});
|
|
1437
|
+
this.debug(this.pattern, set);
|
|
1438
|
+
this.set = set.filter((s) => s.indexOf(false) === -1);
|
|
1439
|
+
if (this.isWindows) {
|
|
1440
|
+
for (let i2 = 0; i2 < this.set.length; i2++) {
|
|
1441
|
+
const p = this.set[i2];
|
|
1442
|
+
if (p[0] === "" && p[1] === "" && this.globParts[i2][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
|
|
1443
|
+
p[2] = "?";
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
this.debug(this.pattern, this.set);
|
|
1448
|
+
}
|
|
1449
|
+
// various transforms to equivalent pattern sets that are
|
|
1450
|
+
// faster to process in a filesystem walk. The goal is to
|
|
1451
|
+
// eliminate what we can, and push all ** patterns as far
|
|
1452
|
+
// to the right as possible, even if it increases the number
|
|
1453
|
+
// of patterns that we have to process.
|
|
1454
|
+
preprocess(globParts) {
|
|
1455
|
+
if (this.options.noglobstar) {
|
|
1456
|
+
for (let i2 = 0; i2 < globParts.length; i2++) {
|
|
1457
|
+
for (let j = 0; j < globParts[i2].length; j++) {
|
|
1458
|
+
if (globParts[i2][j] === "**") {
|
|
1459
|
+
globParts[i2][j] = "*";
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
const { optimizationLevel = 1 } = this.options;
|
|
1465
|
+
if (optimizationLevel >= 2) {
|
|
1466
|
+
globParts = this.firstPhasePreProcess(globParts);
|
|
1467
|
+
globParts = this.secondPhasePreProcess(globParts);
|
|
1468
|
+
} else if (optimizationLevel >= 1) {
|
|
1469
|
+
globParts = this.levelOneOptimize(globParts);
|
|
1470
|
+
} else {
|
|
1471
|
+
globParts = this.adjascentGlobstarOptimize(globParts);
|
|
1472
|
+
}
|
|
1473
|
+
return globParts;
|
|
1474
|
+
}
|
|
1475
|
+
// just get rid of adjascent ** portions
|
|
1476
|
+
adjascentGlobstarOptimize(globParts) {
|
|
1477
|
+
return globParts.map((parts) => {
|
|
1478
|
+
let gs = -1;
|
|
1479
|
+
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
1480
|
+
let i2 = gs;
|
|
1481
|
+
while (parts[i2 + 1] === "**") {
|
|
1482
|
+
i2++;
|
|
1483
|
+
}
|
|
1484
|
+
if (i2 !== gs) {
|
|
1485
|
+
parts.splice(gs, i2 - gs);
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
return parts;
|
|
1489
|
+
});
|
|
1490
|
+
}
|
|
1491
|
+
// get rid of adjascent ** and resolve .. portions
|
|
1492
|
+
levelOneOptimize(globParts) {
|
|
1493
|
+
return globParts.map((parts) => {
|
|
1494
|
+
parts = parts.reduce((set, part) => {
|
|
1495
|
+
const prev = set[set.length - 1];
|
|
1496
|
+
if (part === "**" && prev === "**") {
|
|
1497
|
+
return set;
|
|
1498
|
+
}
|
|
1499
|
+
if (part === "..") {
|
|
1500
|
+
if (prev && prev !== ".." && prev !== "." && prev !== "**") {
|
|
1501
|
+
set.pop();
|
|
1502
|
+
return set;
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
set.push(part);
|
|
1506
|
+
return set;
|
|
1507
|
+
}, []);
|
|
1508
|
+
return parts.length === 0 ? [""] : parts;
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
levelTwoFileOptimize(parts) {
|
|
1512
|
+
if (!Array.isArray(parts)) {
|
|
1513
|
+
parts = this.slashSplit(parts);
|
|
1514
|
+
}
|
|
1515
|
+
let didSomething = false;
|
|
1516
|
+
do {
|
|
1517
|
+
didSomething = false;
|
|
1518
|
+
if (!this.preserveMultipleSlashes) {
|
|
1519
|
+
for (let i2 = 1; i2 < parts.length - 1; i2++) {
|
|
1520
|
+
const p = parts[i2];
|
|
1521
|
+
if (i2 === 1 && p === "" && parts[0] === "")
|
|
1522
|
+
continue;
|
|
1523
|
+
if (p === "." || p === "") {
|
|
1524
|
+
didSomething = true;
|
|
1525
|
+
parts.splice(i2, 1);
|
|
1526
|
+
i2--;
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
1530
|
+
didSomething = true;
|
|
1531
|
+
parts.pop();
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
let dd = 0;
|
|
1535
|
+
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
1536
|
+
const p = parts[dd - 1];
|
|
1537
|
+
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
1538
|
+
didSomething = true;
|
|
1539
|
+
parts.splice(dd - 1, 2);
|
|
1540
|
+
dd -= 2;
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
} while (didSomething);
|
|
1544
|
+
return parts.length === 0 ? [""] : parts;
|
|
1545
|
+
}
|
|
1546
|
+
// First phase: single-pattern processing
|
|
1547
|
+
// <pre> is 1 or more portions
|
|
1548
|
+
// <rest> is 1 or more portions
|
|
1549
|
+
// <p> is any portion other than ., .., '', or **
|
|
1550
|
+
// <e> is . or ''
|
|
1551
|
+
//
|
|
1552
|
+
// **/.. is *brutal* for filesystem walking performance, because
|
|
1553
|
+
// it effectively resets the recursive walk each time it occurs,
|
|
1554
|
+
// and ** cannot be reduced out by a .. pattern part like a regexp
|
|
1555
|
+
// or most strings (other than .., ., and '') can be.
|
|
1556
|
+
//
|
|
1557
|
+
// <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
|
|
1558
|
+
// <pre>/<e>/<rest> -> <pre>/<rest>
|
|
1559
|
+
// <pre>/<p>/../<rest> -> <pre>/<rest>
|
|
1560
|
+
// **/**/<rest> -> **/<rest>
|
|
1561
|
+
//
|
|
1562
|
+
// **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
|
|
1563
|
+
// this WOULD be allowed if ** did follow symlinks, or * didn't
|
|
1564
|
+
firstPhasePreProcess(globParts) {
|
|
1565
|
+
let didSomething = false;
|
|
1566
|
+
do {
|
|
1567
|
+
didSomething = false;
|
|
1568
|
+
for (let parts of globParts) {
|
|
1569
|
+
let gs = -1;
|
|
1570
|
+
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
1571
|
+
let gss = gs;
|
|
1572
|
+
while (parts[gss + 1] === "**") {
|
|
1573
|
+
gss++;
|
|
1574
|
+
}
|
|
1575
|
+
if (gss > gs) {
|
|
1576
|
+
parts.splice(gs + 1, gss - gs);
|
|
1577
|
+
}
|
|
1578
|
+
let next = parts[gs + 1];
|
|
1579
|
+
const p = parts[gs + 2];
|
|
1580
|
+
const p2 = parts[gs + 3];
|
|
1581
|
+
if (next !== "..")
|
|
1582
|
+
continue;
|
|
1583
|
+
if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
|
|
1584
|
+
continue;
|
|
1585
|
+
}
|
|
1586
|
+
didSomething = true;
|
|
1587
|
+
parts.splice(gs, 1);
|
|
1588
|
+
const other = parts.slice(0);
|
|
1589
|
+
other[gs] = "**";
|
|
1590
|
+
globParts.push(other);
|
|
1591
|
+
gs--;
|
|
1592
|
+
}
|
|
1593
|
+
if (!this.preserveMultipleSlashes) {
|
|
1594
|
+
for (let i2 = 1; i2 < parts.length - 1; i2++) {
|
|
1595
|
+
const p = parts[i2];
|
|
1596
|
+
if (i2 === 1 && p === "" && parts[0] === "")
|
|
1597
|
+
continue;
|
|
1598
|
+
if (p === "." || p === "") {
|
|
1599
|
+
didSomething = true;
|
|
1600
|
+
parts.splice(i2, 1);
|
|
1601
|
+
i2--;
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
1605
|
+
didSomething = true;
|
|
1606
|
+
parts.pop();
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
let dd = 0;
|
|
1610
|
+
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
1611
|
+
const p = parts[dd - 1];
|
|
1612
|
+
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
1613
|
+
didSomething = true;
|
|
1614
|
+
const needDot = dd === 1 && parts[dd + 1] === "**";
|
|
1615
|
+
const splin = needDot ? ["."] : [];
|
|
1616
|
+
parts.splice(dd - 1, 2, ...splin);
|
|
1617
|
+
if (parts.length === 0)
|
|
1618
|
+
parts.push("");
|
|
1619
|
+
dd -= 2;
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
} while (didSomething);
|
|
1624
|
+
return globParts;
|
|
1625
|
+
}
|
|
1626
|
+
// second phase: multi-pattern dedupes
|
|
1627
|
+
// {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
|
|
1628
|
+
// {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
|
|
1629
|
+
// {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
|
|
1630
|
+
//
|
|
1631
|
+
// {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
|
|
1632
|
+
// ^-- not valid because ** doens't follow symlinks
|
|
1633
|
+
secondPhasePreProcess(globParts) {
|
|
1634
|
+
for (let i2 = 0; i2 < globParts.length - 1; i2++) {
|
|
1635
|
+
for (let j = i2 + 1; j < globParts.length; j++) {
|
|
1636
|
+
const matched = this.partsMatch(globParts[i2], globParts[j], !this.preserveMultipleSlashes);
|
|
1637
|
+
if (!matched)
|
|
1638
|
+
continue;
|
|
1639
|
+
globParts[i2] = matched;
|
|
1640
|
+
globParts[j] = [];
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
return globParts.filter((gs) => gs.length);
|
|
1644
|
+
}
|
|
1645
|
+
partsMatch(a, b, emptyGSMatch = false) {
|
|
1646
|
+
let ai = 0;
|
|
1647
|
+
let bi = 0;
|
|
1648
|
+
let result = [];
|
|
1649
|
+
let which = "";
|
|
1650
|
+
while (ai < a.length && bi < b.length) {
|
|
1651
|
+
if (a[ai] === b[bi]) {
|
|
1652
|
+
result.push(which === "b" ? b[bi] : a[ai]);
|
|
1653
|
+
ai++;
|
|
1654
|
+
bi++;
|
|
1655
|
+
} else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
|
|
1656
|
+
result.push(a[ai]);
|
|
1657
|
+
ai++;
|
|
1658
|
+
} else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
|
|
1659
|
+
result.push(b[bi]);
|
|
1660
|
+
bi++;
|
|
1661
|
+
} else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
|
|
1662
|
+
if (which === "b")
|
|
1663
|
+
return false;
|
|
1664
|
+
which = "a";
|
|
1665
|
+
result.push(a[ai]);
|
|
1666
|
+
ai++;
|
|
1667
|
+
bi++;
|
|
1668
|
+
} else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
|
|
1669
|
+
if (which === "a")
|
|
1670
|
+
return false;
|
|
1671
|
+
which = "b";
|
|
1672
|
+
result.push(b[bi]);
|
|
1673
|
+
ai++;
|
|
1674
|
+
bi++;
|
|
1675
|
+
} else {
|
|
1676
|
+
return false;
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
return a.length === b.length && result;
|
|
1680
|
+
}
|
|
1681
|
+
parseNegate() {
|
|
1682
|
+
if (this.nonegate)
|
|
1683
|
+
return;
|
|
1684
|
+
const pattern = this.pattern;
|
|
1685
|
+
let negate = false;
|
|
1686
|
+
let negateOffset = 0;
|
|
1687
|
+
for (let i2 = 0; i2 < pattern.length && pattern.charAt(i2) === "!"; i2++) {
|
|
1688
|
+
negate = !negate;
|
|
1689
|
+
negateOffset++;
|
|
1690
|
+
}
|
|
1691
|
+
if (negateOffset)
|
|
1692
|
+
this.pattern = pattern.slice(negateOffset);
|
|
1693
|
+
this.negate = negate;
|
|
1694
|
+
}
|
|
1695
|
+
// set partial to true to test if, for example,
|
|
1696
|
+
// "/a/b" matches the start of "/*/b/*/d"
|
|
1697
|
+
// Partial means, if you run out of file before you run
|
|
1698
|
+
// out of pattern, then that's fine, as long as all
|
|
1699
|
+
// the parts match.
|
|
1700
|
+
matchOne(file, pattern, partial = false) {
|
|
1701
|
+
const options = this.options;
|
|
1702
|
+
if (this.isWindows) {
|
|
1703
|
+
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
|
1704
|
+
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
|
1705
|
+
const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
|
|
1706
|
+
const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
|
|
1707
|
+
const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
|
|
1708
|
+
const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
|
|
1709
|
+
if (typeof fdi === "number" && typeof pdi === "number") {
|
|
1710
|
+
const [fd, pd] = [file[fdi], pattern[pdi]];
|
|
1711
|
+
if (fd.toLowerCase() === pd.toLowerCase()) {
|
|
1712
|
+
pattern[pdi] = fd;
|
|
1713
|
+
if (pdi > fdi) {
|
|
1714
|
+
pattern = pattern.slice(pdi);
|
|
1715
|
+
} else if (fdi > pdi) {
|
|
1716
|
+
file = file.slice(fdi);
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
const { optimizationLevel = 1 } = this.options;
|
|
1722
|
+
if (optimizationLevel >= 2) {
|
|
1723
|
+
file = this.levelTwoFileOptimize(file);
|
|
1724
|
+
}
|
|
1725
|
+
this.debug("matchOne", this, { file, pattern });
|
|
1726
|
+
this.debug("matchOne", file.length, pattern.length);
|
|
1727
|
+
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
1728
|
+
this.debug("matchOne loop");
|
|
1729
|
+
var p = pattern[pi];
|
|
1730
|
+
var f = file[fi];
|
|
1731
|
+
this.debug(pattern, p, f);
|
|
1732
|
+
if (p === false) {
|
|
1733
|
+
return false;
|
|
1734
|
+
}
|
|
1735
|
+
if (p === GLOBSTAR) {
|
|
1736
|
+
this.debug("GLOBSTAR", [pattern, p, f]);
|
|
1737
|
+
var fr = fi;
|
|
1738
|
+
var pr = pi + 1;
|
|
1739
|
+
if (pr === pl) {
|
|
1740
|
+
this.debug("** at the end");
|
|
1741
|
+
for (; fi < fl; fi++) {
|
|
1742
|
+
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
|
1743
|
+
return false;
|
|
1744
|
+
}
|
|
1745
|
+
return true;
|
|
1746
|
+
}
|
|
1747
|
+
while (fr < fl) {
|
|
1748
|
+
var swallowee = file[fr];
|
|
1749
|
+
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
|
1750
|
+
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
1751
|
+
this.debug("globstar found match!", fr, fl, swallowee);
|
|
1752
|
+
return true;
|
|
1753
|
+
} else {
|
|
1754
|
+
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
|
1755
|
+
this.debug("dot detected!", file, fr, pattern, pr);
|
|
1756
|
+
break;
|
|
1757
|
+
}
|
|
1758
|
+
this.debug("globstar swallow a segment, and continue");
|
|
1759
|
+
fr++;
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
if (partial) {
|
|
1763
|
+
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
|
1764
|
+
if (fr === fl) {
|
|
1765
|
+
return true;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
return false;
|
|
1769
|
+
}
|
|
1770
|
+
let hit;
|
|
1771
|
+
if (typeof p === "string") {
|
|
1772
|
+
hit = f === p;
|
|
1773
|
+
this.debug("string match", p, f, hit);
|
|
1774
|
+
} else {
|
|
1775
|
+
hit = p.test(f);
|
|
1776
|
+
this.debug("pattern match", p, f, hit);
|
|
1777
|
+
}
|
|
1778
|
+
if (!hit)
|
|
1779
|
+
return false;
|
|
1780
|
+
}
|
|
1781
|
+
if (fi === fl && pi === pl) {
|
|
1782
|
+
return true;
|
|
1783
|
+
} else if (fi === fl) {
|
|
1784
|
+
return partial;
|
|
1785
|
+
} else if (pi === pl) {
|
|
1786
|
+
return fi === fl - 1 && file[fi] === "";
|
|
1787
|
+
} else {
|
|
1788
|
+
throw new Error("wtf?");
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
braceExpand() {
|
|
1792
|
+
return braceExpand(this.pattern, this.options);
|
|
1793
|
+
}
|
|
1794
|
+
parse(pattern) {
|
|
1795
|
+
assertValidPattern(pattern);
|
|
1796
|
+
const options = this.options;
|
|
1797
|
+
if (pattern === "**")
|
|
1798
|
+
return GLOBSTAR;
|
|
1799
|
+
if (pattern === "")
|
|
1800
|
+
return "";
|
|
1801
|
+
let m;
|
|
1802
|
+
let fastTest = null;
|
|
1803
|
+
if (m = pattern.match(starRE)) {
|
|
1804
|
+
fastTest = options.dot ? starTestDot : starTest;
|
|
1805
|
+
} else if (m = pattern.match(starDotExtRE)) {
|
|
1806
|
+
fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
|
|
1807
|
+
} else if (m = pattern.match(qmarksRE)) {
|
|
1808
|
+
fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
|
|
1809
|
+
} else if (m = pattern.match(starDotStarRE)) {
|
|
1810
|
+
fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
|
|
1811
|
+
} else if (m = pattern.match(dotStarRE)) {
|
|
1812
|
+
fastTest = dotStarTest;
|
|
1813
|
+
}
|
|
1814
|
+
const re = AST.fromGlob(pattern, this.options).toMMPattern();
|
|
1815
|
+
if (fastTest && typeof re === "object") {
|
|
1816
|
+
Reflect.defineProperty(re, "test", { value: fastTest });
|
|
1817
|
+
}
|
|
1818
|
+
return re;
|
|
1819
|
+
}
|
|
1820
|
+
makeRe() {
|
|
1821
|
+
if (this.regexp || this.regexp === false)
|
|
1822
|
+
return this.regexp;
|
|
1823
|
+
const set = this.set;
|
|
1824
|
+
if (!set.length) {
|
|
1825
|
+
this.regexp = false;
|
|
1826
|
+
return this.regexp;
|
|
1827
|
+
}
|
|
1828
|
+
const options = this.options;
|
|
1829
|
+
const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
|
|
1830
|
+
const flags = new Set(options.nocase ? ["i"] : []);
|
|
1831
|
+
let re = set.map((pattern) => {
|
|
1832
|
+
const pp = pattern.map((p) => {
|
|
1833
|
+
if (p instanceof RegExp) {
|
|
1834
|
+
for (const f of p.flags.split(""))
|
|
1835
|
+
flags.add(f);
|
|
1836
|
+
}
|
|
1837
|
+
return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
|
|
1838
|
+
});
|
|
1839
|
+
pp.forEach((p, i2) => {
|
|
1840
|
+
const next = pp[i2 + 1];
|
|
1841
|
+
const prev = pp[i2 - 1];
|
|
1842
|
+
if (p !== GLOBSTAR || prev === GLOBSTAR) {
|
|
1843
|
+
return;
|
|
1844
|
+
}
|
|
1845
|
+
if (prev === void 0) {
|
|
1846
|
+
if (next !== void 0 && next !== GLOBSTAR) {
|
|
1847
|
+
pp[i2 + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
|
|
1848
|
+
} else {
|
|
1849
|
+
pp[i2] = twoStar;
|
|
1850
|
+
}
|
|
1851
|
+
} else if (next === void 0) {
|
|
1852
|
+
pp[i2 - 1] = prev + "(?:\\/|" + twoStar + ")?";
|
|
1853
|
+
} else if (next !== GLOBSTAR) {
|
|
1854
|
+
pp[i2 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
|
|
1855
|
+
pp[i2 + 1] = GLOBSTAR;
|
|
1856
|
+
}
|
|
1857
|
+
});
|
|
1858
|
+
return pp.filter((p) => p !== GLOBSTAR).join("/");
|
|
1859
|
+
}).join("|");
|
|
1860
|
+
const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
1861
|
+
re = "^" + open + re + close + "$";
|
|
1862
|
+
if (this.negate)
|
|
1863
|
+
re = "^(?!" + re + ").+$";
|
|
1864
|
+
try {
|
|
1865
|
+
this.regexp = new RegExp(re, [...flags].join(""));
|
|
1866
|
+
} catch (ex) {
|
|
1867
|
+
this.regexp = false;
|
|
1868
|
+
}
|
|
1869
|
+
return this.regexp;
|
|
1870
|
+
}
|
|
1871
|
+
slashSplit(p) {
|
|
1872
|
+
if (this.preserveMultipleSlashes) {
|
|
1873
|
+
return p.split("/");
|
|
1874
|
+
} else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
|
|
1875
|
+
return ["", ...p.split(/\/+/)];
|
|
1876
|
+
} else {
|
|
1877
|
+
return p.split(/\/+/);
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
match(f, partial = this.partial) {
|
|
1881
|
+
this.debug("match", f, this.pattern);
|
|
1882
|
+
if (this.comment) {
|
|
1883
|
+
return false;
|
|
1884
|
+
}
|
|
1885
|
+
if (this.empty) {
|
|
1886
|
+
return f === "";
|
|
1887
|
+
}
|
|
1888
|
+
if (f === "/" && partial) {
|
|
1889
|
+
return true;
|
|
1890
|
+
}
|
|
1891
|
+
const options = this.options;
|
|
1892
|
+
if (this.isWindows) {
|
|
1893
|
+
f = f.split("\\").join("/");
|
|
1894
|
+
}
|
|
1895
|
+
const ff = this.slashSplit(f);
|
|
1896
|
+
this.debug(this.pattern, "split", ff);
|
|
1897
|
+
const set = this.set;
|
|
1898
|
+
this.debug(this.pattern, "set", set);
|
|
1899
|
+
let filename = ff[ff.length - 1];
|
|
1900
|
+
if (!filename) {
|
|
1901
|
+
for (let i2 = ff.length - 2; !filename && i2 >= 0; i2--) {
|
|
1902
|
+
filename = ff[i2];
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
for (let i2 = 0; i2 < set.length; i2++) {
|
|
1906
|
+
const pattern = set[i2];
|
|
1907
|
+
let file = ff;
|
|
1908
|
+
if (options.matchBase && pattern.length === 1) {
|
|
1909
|
+
file = [filename];
|
|
1910
|
+
}
|
|
1911
|
+
const hit = this.matchOne(file, pattern, partial);
|
|
1912
|
+
if (hit) {
|
|
1913
|
+
if (options.flipNegate) {
|
|
1914
|
+
return true;
|
|
1915
|
+
}
|
|
1916
|
+
return !this.negate;
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
if (options.flipNegate) {
|
|
1920
|
+
return false;
|
|
1921
|
+
}
|
|
1922
|
+
return this.negate;
|
|
1923
|
+
}
|
|
1924
|
+
static defaults(def) {
|
|
1925
|
+
return minimatch.defaults(def).Minimatch;
|
|
1926
|
+
}
|
|
1927
|
+
};
|
|
1928
|
+
minimatch.AST = AST;
|
|
1929
|
+
minimatch.Minimatch = Minimatch;
|
|
1930
|
+
minimatch.escape = escape;
|
|
1931
|
+
minimatch.unescape = unescape;
|
|
1932
|
+
|
|
336
1933
|
// src/utils/query-nonce-meta-tag-content.ts
|
|
337
1934
|
function queryNonceMetaTagContent(doc) {
|
|
338
1935
|
var _a, _b, _c;
|
|
@@ -505,10 +2102,17 @@ function createStyleSheetIfNeededAndSupported(styles2) {
|
|
|
505
2102
|
var globalStyleSheet;
|
|
506
2103
|
function createShadowRoot(cmpMeta) {
|
|
507
2104
|
var _a;
|
|
508
|
-
const
|
|
509
|
-
|
|
510
|
-
delegatesFocus
|
|
511
|
-
}
|
|
2105
|
+
const opts = { mode: "open" };
|
|
2106
|
+
if (BUILD.shadowDelegatesFocus) {
|
|
2107
|
+
opts.delegatesFocus = !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */);
|
|
2108
|
+
}
|
|
2109
|
+
if (BUILD.shadowSlotAssignmentManual) {
|
|
2110
|
+
const isManual = !!(cmpMeta.$flags$ & 1024 /* shadowSlotAssignmentManual */);
|
|
2111
|
+
if (isManual) {
|
|
2112
|
+
opts.slotAssignment = "manual";
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
const shadowRoot = this.attachShadow(opts);
|
|
512
2116
|
if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
|
|
513
2117
|
if (globalStyleSheet) {
|
|
514
2118
|
if (supportsMutableAdoptedStyleSheets) {
|
|
@@ -1135,7 +2739,7 @@ var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
|
1135
2739
|
styles.set(scopeId2, style);
|
|
1136
2740
|
};
|
|
1137
2741
|
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
1138
|
-
var _a;
|
|
2742
|
+
var _a, _b, _c;
|
|
1139
2743
|
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
1140
2744
|
const style = styles.get(scopeId2);
|
|
1141
2745
|
if (!BUILD.attachStyles || !win.document) {
|
|
@@ -1150,52 +2754,52 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1150
2754
|
if (!appliedStyles) {
|
|
1151
2755
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
1152
2756
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
1182
|
-
}
|
|
2757
|
+
const existingStyleElm = (BUILD.hydrateClientSide || BUILD.hotModuleReplacement) && styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
|
|
2758
|
+
if (existingStyleElm) {
|
|
2759
|
+
existingStyleElm.innerHTML = style;
|
|
2760
|
+
} else if (!appliedStyles.has(scopeId2)) {
|
|
2761
|
+
styleElm = win.document.createElement("style");
|
|
2762
|
+
styleElm.innerHTML = style;
|
|
2763
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
2764
|
+
if (nonce != null) {
|
|
2765
|
+
styleElm.setAttribute("nonce", nonce);
|
|
2766
|
+
}
|
|
2767
|
+
if ((BUILD.hydrateServerSide || BUILD.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */ || cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
2768
|
+
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
2769
|
+
}
|
|
2770
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
2771
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
2772
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
2773
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
2774
|
+
styleContainerNode.insertBefore(
|
|
2775
|
+
styleElm,
|
|
2776
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
2777
|
+
);
|
|
2778
|
+
} else if ("host" in styleContainerNode) {
|
|
2779
|
+
if (supportsConstructableStylesheets) {
|
|
2780
|
+
const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
|
|
2781
|
+
const stylesheet = new currentWindow.CSSStyleSheet();
|
|
2782
|
+
stylesheet.replaceSync(style);
|
|
2783
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
2784
|
+
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
|
|
1183
2785
|
} else {
|
|
1184
|
-
|
|
1185
|
-
if (existingStyleContainer) {
|
|
1186
|
-
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
1187
|
-
} else {
|
|
1188
|
-
styleContainerNode.prepend(styleElm);
|
|
1189
|
-
}
|
|
2786
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
1190
2787
|
}
|
|
1191
2788
|
} else {
|
|
1192
|
-
styleContainerNode.
|
|
2789
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
2790
|
+
if (existingStyleContainer) {
|
|
2791
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
2792
|
+
} else {
|
|
2793
|
+
styleContainerNode.prepend(styleElm);
|
|
2794
|
+
}
|
|
1193
2795
|
}
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
styleContainerNode.insertBefore(styleElm, null);
|
|
2796
|
+
} else {
|
|
2797
|
+
styleContainerNode.append(styleElm);
|
|
1197
2798
|
}
|
|
1198
2799
|
}
|
|
2800
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2801
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
2802
|
+
}
|
|
1199
2803
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
1200
2804
|
styleElm.innerHTML += SLOT_FB_CSS;
|
|
1201
2805
|
}
|
|
@@ -1203,11 +2807,28 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1203
2807
|
appliedStyles.add(scopeId2);
|
|
1204
2808
|
}
|
|
1205
2809
|
}
|
|
1206
|
-
} else if (BUILD.constructableCSS
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
2810
|
+
} else if (BUILD.constructableCSS) {
|
|
2811
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
2812
|
+
if (!appliedStyles) {
|
|
2813
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
2814
|
+
}
|
|
2815
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
2816
|
+
const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
|
|
2817
|
+
let stylesheet;
|
|
2818
|
+
if (style.constructor === currentWindow.CSSStyleSheet) {
|
|
2819
|
+
stylesheet = style;
|
|
2820
|
+
} else {
|
|
2821
|
+
stylesheet = new currentWindow.CSSStyleSheet();
|
|
2822
|
+
for (let i2 = 0; i2 < style.cssRules.length; i2++) {
|
|
2823
|
+
stylesheet.insertRule(style.cssRules[i2].cssText, i2);
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
2827
|
+
styleContainerNode.adoptedStyleSheets.push(stylesheet);
|
|
2828
|
+
} else {
|
|
2829
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
|
|
2830
|
+
}
|
|
2831
|
+
appliedStyles.add(scopeId2);
|
|
1211
2832
|
}
|
|
1212
2833
|
}
|
|
1213
2834
|
}
|
|
@@ -1384,7 +3005,7 @@ var validateInputProperties = (inputElm) => {
|
|
|
1384
3005
|
|
|
1385
3006
|
// src/runtime/client-hydrate.ts
|
|
1386
3007
|
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
1387
|
-
var _a, _b;
|
|
3008
|
+
var _a, _b, _c, _d;
|
|
1388
3009
|
const endHydrate = createTime("hydrateClient", tagName);
|
|
1389
3010
|
const shadowRoot = hostElm.shadowRoot;
|
|
1390
3011
|
const childRenderNodes = [];
|
|
@@ -1477,6 +3098,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1477
3098
|
let snGroupIdx;
|
|
1478
3099
|
let snGroupLen;
|
|
1479
3100
|
let slottedItem;
|
|
3101
|
+
let currentPos = 0;
|
|
1480
3102
|
for (snIndex; snIndex < snLen; snIndex++) {
|
|
1481
3103
|
slotGroup = slottedNodes[snIndex];
|
|
1482
3104
|
if (!slotGroup || !slotGroup.length) continue;
|
|
@@ -1490,7 +3112,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1490
3112
|
if (!hosts[slottedItem.hostId]) continue;
|
|
1491
3113
|
const hostEle = hosts[slottedItem.hostId];
|
|
1492
3114
|
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
1493
|
-
hostEle.
|
|
3115
|
+
hostEle.insertBefore(slottedItem.node, (_c = (_b = slotGroup[snGroupIdx - 1]) == null ? void 0 : _b.node) == null ? void 0 : _c.nextSibling);
|
|
1494
3116
|
}
|
|
1495
3117
|
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
1496
3118
|
if (!slottedItem.slot["s-cr"]) {
|
|
@@ -1501,14 +3123,15 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1501
3123
|
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1502
3124
|
}
|
|
1503
3125
|
}
|
|
1504
|
-
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1505
|
-
if (((
|
|
3126
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"] || currentPos);
|
|
3127
|
+
if (((_d = slottedItem.node.parentElement) == null ? void 0 : _d.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
|
|
1506
3128
|
slottedItem.node.removeAttribute("slot");
|
|
1507
3129
|
}
|
|
1508
3130
|
if (BUILD.experimentalSlotFixes) {
|
|
1509
3131
|
patchSlottedNode(slottedItem.node);
|
|
1510
3132
|
}
|
|
1511
3133
|
}
|
|
3134
|
+
currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
|
|
1512
3135
|
}
|
|
1513
3136
|
}
|
|
1514
3137
|
if (BUILD.scoped && scopeId2 && slotNodes.length) {
|
|
@@ -1530,7 +3153,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1530
3153
|
if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
|
|
1531
3154
|
if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
|
|
1532
3155
|
node.removeAttribute("hidden");
|
|
1533
|
-
} else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue
|
|
3156
|
+
} else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue) {
|
|
1534
3157
|
node.parentNode.removeChild(node);
|
|
1535
3158
|
}
|
|
1536
3159
|
}
|
|
@@ -1697,10 +3320,6 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1697
3320
|
vnode.$elm$ = node;
|
|
1698
3321
|
vnode.$index$ = "0";
|
|
1699
3322
|
parentVNode.$children$ = [vnode];
|
|
1700
|
-
} else {
|
|
1701
|
-
if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim() && !node["s-nr"]) {
|
|
1702
|
-
node.remove();
|
|
1703
|
-
}
|
|
1704
3323
|
}
|
|
1705
3324
|
return parentVNode;
|
|
1706
3325
|
};
|
|
@@ -2071,16 +3690,16 @@ var applyStrictSelectorScope = (selector, scopeSelector2, hostSelector) => {
|
|
|
2071
3690
|
let scopedSelector = "";
|
|
2072
3691
|
let startIndex = 0;
|
|
2073
3692
|
let res;
|
|
2074
|
-
const
|
|
3693
|
+
const sep2 = /( |>|\+|~(?!=))(?=(?:[^()]*\([^()]*\))*[^()]*$)\s*/g;
|
|
2075
3694
|
const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
|
|
2076
3695
|
let shouldScope = !hasHost;
|
|
2077
|
-
while ((res =
|
|
3696
|
+
while ((res = sep2.exec(selector)) !== null) {
|
|
2078
3697
|
const separator = res[1];
|
|
2079
3698
|
const part2 = selector.slice(startIndex, res.index).trim();
|
|
2080
3699
|
shouldScope = shouldScope || part2.indexOf(_polyfillHostNoCombinator) > -1;
|
|
2081
3700
|
const scopedPart = shouldScope ? _scopeSelectorPart(part2) : part2;
|
|
2082
3701
|
scopedSelector += `${scopedPart} ${separator} `;
|
|
2083
|
-
startIndex =
|
|
3702
|
+
startIndex = sep2.lastIndex;
|
|
2084
3703
|
}
|
|
2085
3704
|
const part = selector.substring(startIndex);
|
|
2086
3705
|
shouldScope = !part.match(_safePartRe) && (shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1);
|
|
@@ -2499,10 +4118,11 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2499
4118
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
2500
4119
|
}
|
|
2501
4120
|
if (newVNode2.$children$) {
|
|
4121
|
+
const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
|
|
2502
4122
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
2503
4123
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
2504
4124
|
if (childNode) {
|
|
2505
|
-
|
|
4125
|
+
appendTarget.appendChild(childNode);
|
|
2506
4126
|
}
|
|
2507
4127
|
}
|
|
2508
4128
|
}
|
|
@@ -2589,6 +4209,9 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
2589
4209
|
if (BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
2590
4210
|
containerElm = containerElm.shadowRoot;
|
|
2591
4211
|
}
|
|
4212
|
+
if (parentVNode.$tag$ === "template") {
|
|
4213
|
+
containerElm = containerElm.content;
|
|
4214
|
+
}
|
|
2592
4215
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
2593
4216
|
if (vnodes[startIdx]) {
|
|
2594
4217
|
childNode = createElm(null, parentVNode, startIdx);
|
|
@@ -2632,6 +4255,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2632
4255
|
let newEndVnode = newCh[newEndIdx];
|
|
2633
4256
|
let node;
|
|
2634
4257
|
let elmToMove;
|
|
4258
|
+
const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
|
|
2635
4259
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
2636
4260
|
if (oldStartVnode == null) {
|
|
2637
4261
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
@@ -2654,7 +4278,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2654
4278
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
2655
4279
|
}
|
|
2656
4280
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
2657
|
-
insertBefore(
|
|
4281
|
+
insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
2658
4282
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
2659
4283
|
newEndVnode = newCh[--newEndIdx];
|
|
2660
4284
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
@@ -2662,7 +4286,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2662
4286
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
2663
4287
|
}
|
|
2664
4288
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
2665
|
-
insertBefore(
|
|
4289
|
+
insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
2666
4290
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
2667
4291
|
newStartVnode = newCh[++newStartIdx];
|
|
2668
4292
|
} else {
|
|
@@ -2937,13 +4561,16 @@ render() {
|
|
|
2937
4561
|
for (const relocateData of relocateNodes) {
|
|
2938
4562
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
2939
4563
|
const slotRefNode = relocateData.$slotRefNode$;
|
|
4564
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && isInitialLoad) {
|
|
4565
|
+
nodeToRelocate["s-ih"] = (_a = nodeToRelocate.hidden) != null ? _a : false;
|
|
4566
|
+
}
|
|
2940
4567
|
if (slotRefNode) {
|
|
2941
4568
|
const parentNodeRef = slotRefNode.parentNode;
|
|
2942
4569
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
2943
4570
|
if (!BUILD.hydrateServerSide && (!BUILD.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
2944
|
-
let orgLocationNode = (
|
|
4571
|
+
let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
|
|
2945
4572
|
while (orgLocationNode) {
|
|
2946
|
-
let refNode = (
|
|
4573
|
+
let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
|
|
2947
4574
|
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
|
|
2948
4575
|
refNode = refNode.nextSibling;
|
|
2949
4576
|
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
@@ -2966,18 +4593,13 @@ render() {
|
|
|
2966
4593
|
}
|
|
2967
4594
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
2968
4595
|
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
2969
|
-
nodeToRelocate.hidden = (
|
|
4596
|
+
nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
|
|
2970
4597
|
}
|
|
2971
4598
|
}
|
|
2972
4599
|
}
|
|
2973
4600
|
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
|
|
2974
|
-
} else {
|
|
2975
|
-
|
|
2976
|
-
if (isInitialLoad) {
|
|
2977
|
-
nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
|
|
2978
|
-
}
|
|
2979
|
-
nodeToRelocate.hidden = true;
|
|
2980
|
-
}
|
|
4601
|
+
} else if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
4602
|
+
nodeToRelocate.hidden = true;
|
|
2981
4603
|
}
|
|
2982
4604
|
}
|
|
2983
4605
|
}
|
|
@@ -3331,7 +4953,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
3331
4953
|
if (BUILD.serializer && BUILD.reflect && cmpMeta.$attrsToReflect$) {
|
|
3332
4954
|
if (instance && cmpMeta.$serializers$ && cmpMeta.$serializers$[propName]) {
|
|
3333
4955
|
let attrVal = newVal;
|
|
3334
|
-
for (const
|
|
4956
|
+
for (const serializer of cmpMeta.$serializers$[propName]) {
|
|
4957
|
+
const [[methodName]] = Object.entries(serializer);
|
|
3335
4958
|
attrVal = instance[methodName](attrVal, propName);
|
|
3336
4959
|
}
|
|
3337
4960
|
hostRef.$serializerValues$.set(propName, attrVal);
|
|
@@ -3360,27 +4983,34 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
3360
4983
|
);
|
|
3361
4984
|
}
|
|
3362
4985
|
}
|
|
3363
|
-
if (
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
4986
|
+
if (BUILD.propChangeCallback && cmpMeta.$watchers$) {
|
|
4987
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
4988
|
+
if (watchMethods) {
|
|
4989
|
+
watchMethods.map((watcher) => {
|
|
4990
|
+
try {
|
|
4991
|
+
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
4992
|
+
if (flags & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */) {
|
|
4993
|
+
if (!instance) {
|
|
4994
|
+
hostRef.$fetchedCbList$.push(() => {
|
|
4995
|
+
hostRef.$lazyInstance$[watchMethodName](newVal, oldVal, propName);
|
|
4996
|
+
});
|
|
4997
|
+
} else {
|
|
4998
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
4999
|
+
}
|
|
3372
5000
|
}
|
|
3373
|
-
})
|
|
3374
|
-
|
|
3375
|
-
}
|
|
3376
|
-
if (BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
3377
|
-
if (instance.componentShouldUpdate) {
|
|
3378
|
-
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
3379
|
-
return;
|
|
5001
|
+
} catch (e) {
|
|
5002
|
+
consoleError(e, elm);
|
|
3380
5003
|
}
|
|
5004
|
+
});
|
|
5005
|
+
}
|
|
5006
|
+
}
|
|
5007
|
+
if (BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
5008
|
+
if (instance.componentShouldUpdate) {
|
|
5009
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
5010
|
+
return;
|
|
3381
5011
|
}
|
|
3382
|
-
scheduleUpdate(hostRef, false);
|
|
3383
5012
|
}
|
|
5013
|
+
scheduleUpdate(hostRef, false);
|
|
3384
5014
|
}
|
|
3385
5015
|
}
|
|
3386
5016
|
};
|
|
@@ -3563,7 +5193,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3563
5193
|
this[propName] = deserializeVal;
|
|
3564
5194
|
}
|
|
3565
5195
|
};
|
|
3566
|
-
for (const
|
|
5196
|
+
for (const deserializer of cmpMeta.$deserializers$[propName]) {
|
|
5197
|
+
const [[methodName]] = Object.entries(deserializer);
|
|
3567
5198
|
if (BUILD.lazyLoad) {
|
|
3568
5199
|
if (hostRef.$lazyInstance$) {
|
|
3569
5200
|
setVal(methodName, hostRef.$lazyInstance$);
|
|
@@ -3582,13 +5213,14 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3582
5213
|
return;
|
|
3583
5214
|
} else if (propName == null) {
|
|
3584
5215
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
3585
|
-
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) &&
|
|
5216
|
+
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && newValue !== oldValue) {
|
|
3586
5217
|
const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : this;
|
|
3587
5218
|
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
3588
5219
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
3589
|
-
entry == null ? void 0 : entry.forEach((
|
|
3590
|
-
|
|
3591
|
-
|
|
5220
|
+
entry == null ? void 0 : entry.forEach((watcher) => {
|
|
5221
|
+
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
5222
|
+
if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
|
|
5223
|
+
instance[watchMethodName].call(instance, newValue, oldValue, attrName);
|
|
3592
5224
|
}
|
|
3593
5225
|
});
|
|
3594
5226
|
}
|
|
@@ -3689,7 +5321,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
3689
5321
|
}
|
|
3690
5322
|
}
|
|
3691
5323
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
3692
|
-
if (!styles.has(scopeId2)) {
|
|
5324
|
+
if (!styles.has(scopeId2) || BUILD.hotModuleReplacement && hmrVersionId) {
|
|
3693
5325
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
3694
5326
|
if (BUILD.hydrateServerSide && BUILD.shadowDom) {
|
|
3695
5327
|
if (cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
|
|
@@ -3852,7 +5484,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
3852
5484
|
if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3853
5485
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
3854
5486
|
}
|
|
3855
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /*
|
|
5487
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
|
|
3856
5488
|
if (BUILD.experimentalSlotFixes) {
|
|
3857
5489
|
patchPseudoShadowDom(Cstr.prototype);
|
|
3858
5490
|
} else {
|
|
@@ -4081,7 +5713,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4081
5713
|
return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
|
|
4082
5714
|
}
|
|
4083
5715
|
};
|
|
4084
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /*
|
|
5716
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
|
|
4085
5717
|
if (BUILD.experimentalSlotFixes) {
|
|
4086
5718
|
patchPseudoShadowDom(HostElement.prototype);
|
|
4087
5719
|
} else {
|