@authhero/widget 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authhero-widget/authhero-widget.esm.js +1 -1
- package/dist/authhero-widget/index.esm.js +1 -1
- package/dist/authhero-widget/p-1107d60e.entry.js +1 -0
- package/dist/authhero-widget/p-5hZ8Vbm9.js +2 -0
- package/dist/authhero-widget/p-b2d3d319.entry.js +1 -0
- package/dist/cjs/authhero-node.cjs.entry.js +28 -15
- package/dist/cjs/authhero-widget.cjs.entry.js +107 -37
- package/dist/cjs/authhero-widget.cjs.js +3 -3
- package/dist/cjs/{index-I1frl4Am.js → index-vX5cgLV-.js} +1803 -166
- package/dist/cjs/index.cjs.js +5 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/authhero-node/authhero-node.css +62 -0
- package/dist/collection/components/authhero-node/authhero-node.js +28 -17
- package/dist/collection/components/authhero-widget/authhero-widget.css +29 -0
- package/dist/collection/components/authhero-widget/authhero-widget.js +111 -45
- package/dist/components/authhero-node.js +1 -1
- package/dist/components/authhero-widget.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-CWVARG2s.js +1 -0
- package/dist/components/p-EokuR0qI.js +1 -0
- package/dist/esm/authhero-node.entry.js +28 -15
- package/dist/esm/authhero-widget.entry.js +107 -37
- package/dist/esm/authhero-widget.js +4 -4
- package/dist/esm/{index-ARKBiJrR.js → index-5hZ8Vbm9.js} +1803 -166
- package/dist/esm/index.js +5 -3
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/authhero-node/authhero-node.d.ts +1 -0
- package/dist/types/components/authhero-widget/authhero-widget.d.ts +11 -12
- package/dist/types/components.d.ts +6 -27
- package/dist/types/stencil-public-runtime.d.ts +2 -54
- package/hydrate/index.js +20577 -20632
- package/hydrate/index.mjs +20577 -20632
- package/package.json +3 -3
- package/dist/authhero-widget/p-145b5ecd.entry.js +0 -1
- package/dist/authhero-widget/p-695138d6.entry.js +0 -1
- package/dist/authhero-widget/p-ARKBiJrR.js +0 -2
- package/dist/components/p-BMoS6Gag.js +0 -1
- package/dist/components/p-BbVVe_wV.js +0 -1
|
@@ -2,9 +2,254 @@ const NAMESPACE = 'authhero-widget';
|
|
|
2
2
|
const BUILD = /* authhero-widget */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.40.1 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
|
+
var __create = Object.create;
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
12
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
var __typeError = (msg) => {
|
|
14
|
+
throw TypeError(msg);
|
|
15
|
+
};
|
|
16
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
18
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
23
|
+
};
|
|
24
|
+
var __copyProps = (to, from, except, desc) => {
|
|
25
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
+
for (let key of __getOwnPropNames(from))
|
|
27
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
28
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
29
|
+
}
|
|
30
|
+
return to;
|
|
31
|
+
};
|
|
32
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
33
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
34
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
35
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
36
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
37
|
+
__defProp(target, "default", { value: mod, enumerable: true }) ,
|
|
38
|
+
mod
|
|
39
|
+
));
|
|
40
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
|
|
41
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
42
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
43
|
+
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);
|
|
44
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
45
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
7
46
|
|
|
47
|
+
// node_modules/balanced-match/index.js
|
|
48
|
+
var require_balanced_match = __commonJS({
|
|
49
|
+
"node_modules/balanced-match/index.js"(exports, module) {
|
|
50
|
+
module.exports = balanced;
|
|
51
|
+
function balanced(a, b, str) {
|
|
52
|
+
if (a instanceof RegExp) a = maybeMatch(a, str);
|
|
53
|
+
if (b instanceof RegExp) b = maybeMatch(b, str);
|
|
54
|
+
var r = range(a, b, str);
|
|
55
|
+
return r && {
|
|
56
|
+
start: r[0],
|
|
57
|
+
end: r[1],
|
|
58
|
+
pre: str.slice(0, r[0]),
|
|
59
|
+
body: str.slice(r[0] + a.length, r[1]),
|
|
60
|
+
post: str.slice(r[1] + b.length)
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function maybeMatch(reg, str) {
|
|
64
|
+
var m = str.match(reg);
|
|
65
|
+
return m ? m[0] : null;
|
|
66
|
+
}
|
|
67
|
+
balanced.range = range;
|
|
68
|
+
function range(a, b, str) {
|
|
69
|
+
var begs, beg, left, right, result;
|
|
70
|
+
var ai = str.indexOf(a);
|
|
71
|
+
var bi = str.indexOf(b, ai + 1);
|
|
72
|
+
var i2 = ai;
|
|
73
|
+
if (ai >= 0 && bi > 0) {
|
|
74
|
+
if (a === b) {
|
|
75
|
+
return [ai, bi];
|
|
76
|
+
}
|
|
77
|
+
begs = [];
|
|
78
|
+
left = str.length;
|
|
79
|
+
while (i2 >= 0 && !result) {
|
|
80
|
+
if (i2 == ai) {
|
|
81
|
+
begs.push(i2);
|
|
82
|
+
ai = str.indexOf(a, i2 + 1);
|
|
83
|
+
} else if (begs.length == 1) {
|
|
84
|
+
result = [begs.pop(), bi];
|
|
85
|
+
} else {
|
|
86
|
+
beg = begs.pop();
|
|
87
|
+
if (beg < left) {
|
|
88
|
+
left = beg;
|
|
89
|
+
right = bi;
|
|
90
|
+
}
|
|
91
|
+
bi = str.indexOf(b, i2 + 1);
|
|
92
|
+
}
|
|
93
|
+
i2 = ai < bi && ai >= 0 ? ai : bi;
|
|
94
|
+
}
|
|
95
|
+
if (begs.length) {
|
|
96
|
+
result = [left, right];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// node_modules/brace-expansion/index.js
|
|
105
|
+
var require_brace_expansion = __commonJS({
|
|
106
|
+
"node_modules/brace-expansion/index.js"(exports, module) {
|
|
107
|
+
var balanced = require_balanced_match();
|
|
108
|
+
module.exports = expandTop;
|
|
109
|
+
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
110
|
+
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
111
|
+
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
112
|
+
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
113
|
+
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
114
|
+
function numeric(str) {
|
|
115
|
+
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
116
|
+
}
|
|
117
|
+
function escapeBraces(str) {
|
|
118
|
+
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
119
|
+
}
|
|
120
|
+
function unescapeBraces(str) {
|
|
121
|
+
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
122
|
+
}
|
|
123
|
+
function parseCommaParts(str) {
|
|
124
|
+
if (!str)
|
|
125
|
+
return [""];
|
|
126
|
+
var parts = [];
|
|
127
|
+
var m = balanced("{", "}", str);
|
|
128
|
+
if (!m)
|
|
129
|
+
return str.split(",");
|
|
130
|
+
var pre = m.pre;
|
|
131
|
+
var body = m.body;
|
|
132
|
+
var post = m.post;
|
|
133
|
+
var p = pre.split(",");
|
|
134
|
+
p[p.length - 1] += "{" + body + "}";
|
|
135
|
+
var postParts = parseCommaParts(post);
|
|
136
|
+
if (post.length) {
|
|
137
|
+
p[p.length - 1] += postParts.shift();
|
|
138
|
+
p.push.apply(p, postParts);
|
|
139
|
+
}
|
|
140
|
+
parts.push.apply(parts, p);
|
|
141
|
+
return parts;
|
|
142
|
+
}
|
|
143
|
+
function expandTop(str) {
|
|
144
|
+
if (!str)
|
|
145
|
+
return [];
|
|
146
|
+
if (str.substr(0, 2) === "{}") {
|
|
147
|
+
str = "\\{\\}" + str.substr(2);
|
|
148
|
+
}
|
|
149
|
+
return expand2(escapeBraces(str), true).map(unescapeBraces);
|
|
150
|
+
}
|
|
151
|
+
function embrace(str) {
|
|
152
|
+
return "{" + str + "}";
|
|
153
|
+
}
|
|
154
|
+
function isPadded(el) {
|
|
155
|
+
return /^-?0\d/.test(el);
|
|
156
|
+
}
|
|
157
|
+
function lte(i2, y) {
|
|
158
|
+
return i2 <= y;
|
|
159
|
+
}
|
|
160
|
+
function gte(i2, y) {
|
|
161
|
+
return i2 >= y;
|
|
162
|
+
}
|
|
163
|
+
function expand2(str, isTop) {
|
|
164
|
+
var expansions = [];
|
|
165
|
+
var m = balanced("{", "}", str);
|
|
166
|
+
if (!m) return [str];
|
|
167
|
+
var pre = m.pre;
|
|
168
|
+
var post = m.post.length ? expand2(m.post, false) : [""];
|
|
169
|
+
if (/\$$/.test(m.pre)) {
|
|
170
|
+
for (var k = 0; k < post.length; k++) {
|
|
171
|
+
var expansion = pre + "{" + m.body + "}" + post[k];
|
|
172
|
+
expansions.push(expansion);
|
|
173
|
+
}
|
|
174
|
+
} else {
|
|
175
|
+
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
176
|
+
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
177
|
+
var isSequence = isNumericSequence || isAlphaSequence;
|
|
178
|
+
var isOptions = m.body.indexOf(",") >= 0;
|
|
179
|
+
if (!isSequence && !isOptions) {
|
|
180
|
+
if (m.post.match(/,(?!,).*\}/)) {
|
|
181
|
+
str = m.pre + "{" + m.body + escClose + m.post;
|
|
182
|
+
return expand2(str);
|
|
183
|
+
}
|
|
184
|
+
return [str];
|
|
185
|
+
}
|
|
186
|
+
var n;
|
|
187
|
+
if (isSequence) {
|
|
188
|
+
n = m.body.split(/\.\./);
|
|
189
|
+
} else {
|
|
190
|
+
n = parseCommaParts(m.body);
|
|
191
|
+
if (n.length === 1) {
|
|
192
|
+
n = expand2(n[0], false).map(embrace);
|
|
193
|
+
if (n.length === 1) {
|
|
194
|
+
return post.map(function(p) {
|
|
195
|
+
return m.pre + n[0] + p;
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
var N;
|
|
201
|
+
if (isSequence) {
|
|
202
|
+
var x = numeric(n[0]);
|
|
203
|
+
var y = numeric(n[1]);
|
|
204
|
+
var width = Math.max(n[0].length, n[1].length);
|
|
205
|
+
var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
|
|
206
|
+
var test = lte;
|
|
207
|
+
var reverse = y < x;
|
|
208
|
+
if (reverse) {
|
|
209
|
+
incr *= -1;
|
|
210
|
+
test = gte;
|
|
211
|
+
}
|
|
212
|
+
var pad = n.some(isPadded);
|
|
213
|
+
N = [];
|
|
214
|
+
for (var i2 = x; test(i2, y); i2 += incr) {
|
|
215
|
+
var c;
|
|
216
|
+
if (isAlphaSequence) {
|
|
217
|
+
c = String.fromCharCode(i2);
|
|
218
|
+
if (c === "\\")
|
|
219
|
+
c = "";
|
|
220
|
+
} else {
|
|
221
|
+
c = String(i2);
|
|
222
|
+
if (pad) {
|
|
223
|
+
var need = width - c.length;
|
|
224
|
+
if (need > 0) {
|
|
225
|
+
var z = new Array(need + 1).join("0");
|
|
226
|
+
if (i2 < 0)
|
|
227
|
+
c = "-" + z + c.slice(1);
|
|
228
|
+
else
|
|
229
|
+
c = z + c;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
N.push(c);
|
|
234
|
+
}
|
|
235
|
+
} else {
|
|
236
|
+
N = [];
|
|
237
|
+
for (var j = 0; j < n.length; j++) {
|
|
238
|
+
N.push.apply(N, expand2(n[j], false));
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
for (var j = 0; j < N.length; j++) {
|
|
242
|
+
for (var k = 0; k < post.length; k++) {
|
|
243
|
+
var expansion = pre + N[j] + post[k];
|
|
244
|
+
if (!isTop || isSequence || expansion)
|
|
245
|
+
expansions.push(expansion);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return expansions;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
});
|
|
8
253
|
|
|
9
254
|
// src/utils/constants.ts
|
|
10
255
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
@@ -208,6 +453,1526 @@ var flush = () => {
|
|
|
208
453
|
};
|
|
209
454
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
210
455
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
456
|
+
var isComplexType = (o) => {
|
|
457
|
+
o = typeof o;
|
|
458
|
+
return o === "object" || o === "function";
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
// node_modules/minimatch/dist/esm/index.js
|
|
462
|
+
var import_brace_expansion = __toESM(require_brace_expansion());
|
|
463
|
+
|
|
464
|
+
// node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
465
|
+
var MAX_PATTERN_LENGTH = 1024 * 64;
|
|
466
|
+
var assertValidPattern = (pattern) => {
|
|
467
|
+
if (typeof pattern !== "string") {
|
|
468
|
+
throw new TypeError("invalid pattern");
|
|
469
|
+
}
|
|
470
|
+
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
471
|
+
throw new TypeError("pattern is too long");
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
// node_modules/minimatch/dist/esm/brace-expressions.js
|
|
476
|
+
var posixClasses = {
|
|
477
|
+
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
|
478
|
+
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
|
479
|
+
"[:ascii:]": ["\\x00-\\x7f", false],
|
|
480
|
+
"[:blank:]": ["\\p{Zs}\\t", true],
|
|
481
|
+
"[:cntrl:]": ["\\p{Cc}", true],
|
|
482
|
+
"[:digit:]": ["\\p{Nd}", true],
|
|
483
|
+
"[:graph:]": ["\\p{Z}\\p{C}", true, true],
|
|
484
|
+
"[:lower:]": ["\\p{Ll}", true],
|
|
485
|
+
"[:print:]": ["\\p{C}", true],
|
|
486
|
+
"[:punct:]": ["\\p{P}", true],
|
|
487
|
+
"[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
|
|
488
|
+
"[:upper:]": ["\\p{Lu}", true],
|
|
489
|
+
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
|
|
490
|
+
"[:xdigit:]": ["A-Fa-f0-9", false]
|
|
491
|
+
};
|
|
492
|
+
var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
|
|
493
|
+
var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
494
|
+
var rangesToString = (ranges) => ranges.join("");
|
|
495
|
+
var parseClass = (glob, position) => {
|
|
496
|
+
const pos = position;
|
|
497
|
+
if (glob.charAt(pos) !== "[") {
|
|
498
|
+
throw new Error("not in a brace expression");
|
|
499
|
+
}
|
|
500
|
+
const ranges = [];
|
|
501
|
+
const negs = [];
|
|
502
|
+
let i2 = pos + 1;
|
|
503
|
+
let sawStart = false;
|
|
504
|
+
let uflag = false;
|
|
505
|
+
let escaping = false;
|
|
506
|
+
let negate = false;
|
|
507
|
+
let endPos = pos;
|
|
508
|
+
let rangeStart = "";
|
|
509
|
+
WHILE: while (i2 < glob.length) {
|
|
510
|
+
const c = glob.charAt(i2);
|
|
511
|
+
if ((c === "!" || c === "^") && i2 === pos + 1) {
|
|
512
|
+
negate = true;
|
|
513
|
+
i2++;
|
|
514
|
+
continue;
|
|
515
|
+
}
|
|
516
|
+
if (c === "]" && sawStart && !escaping) {
|
|
517
|
+
endPos = i2 + 1;
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
sawStart = true;
|
|
521
|
+
if (c === "\\") {
|
|
522
|
+
if (!escaping) {
|
|
523
|
+
escaping = true;
|
|
524
|
+
i2++;
|
|
525
|
+
continue;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
if (c === "[" && !escaping) {
|
|
529
|
+
for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
|
|
530
|
+
if (glob.startsWith(cls, i2)) {
|
|
531
|
+
if (rangeStart) {
|
|
532
|
+
return ["$.", false, glob.length - pos, true];
|
|
533
|
+
}
|
|
534
|
+
i2 += cls.length;
|
|
535
|
+
if (neg)
|
|
536
|
+
negs.push(unip);
|
|
537
|
+
else
|
|
538
|
+
ranges.push(unip);
|
|
539
|
+
uflag = uflag || u;
|
|
540
|
+
continue WHILE;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
escaping = false;
|
|
545
|
+
if (rangeStart) {
|
|
546
|
+
if (c > rangeStart) {
|
|
547
|
+
ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
|
|
548
|
+
} else if (c === rangeStart) {
|
|
549
|
+
ranges.push(braceEscape(c));
|
|
550
|
+
}
|
|
551
|
+
rangeStart = "";
|
|
552
|
+
i2++;
|
|
553
|
+
continue;
|
|
554
|
+
}
|
|
555
|
+
if (glob.startsWith("-]", i2 + 1)) {
|
|
556
|
+
ranges.push(braceEscape(c + "-"));
|
|
557
|
+
i2 += 2;
|
|
558
|
+
continue;
|
|
559
|
+
}
|
|
560
|
+
if (glob.startsWith("-", i2 + 1)) {
|
|
561
|
+
rangeStart = c;
|
|
562
|
+
i2 += 2;
|
|
563
|
+
continue;
|
|
564
|
+
}
|
|
565
|
+
ranges.push(braceEscape(c));
|
|
566
|
+
i2++;
|
|
567
|
+
}
|
|
568
|
+
if (endPos < i2) {
|
|
569
|
+
return ["", false, 0, false];
|
|
570
|
+
}
|
|
571
|
+
if (!ranges.length && !negs.length) {
|
|
572
|
+
return ["$.", false, glob.length - pos, true];
|
|
573
|
+
}
|
|
574
|
+
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
|
|
575
|
+
const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
|
|
576
|
+
return [regexpEscape(r), false, endPos - pos, false];
|
|
577
|
+
}
|
|
578
|
+
const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
|
|
579
|
+
const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
|
|
580
|
+
const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
|
|
581
|
+
return [comb, uflag, endPos - pos, true];
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
// node_modules/minimatch/dist/esm/unescape.js
|
|
585
|
+
var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
586
|
+
return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
// node_modules/minimatch/dist/esm/ast.js
|
|
590
|
+
var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
591
|
+
var isExtglobType = (c) => types.has(c);
|
|
592
|
+
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
593
|
+
var startNoDot = "(?!\\.)";
|
|
594
|
+
var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
|
595
|
+
var justDots = /* @__PURE__ */ new Set(["..", "."]);
|
|
596
|
+
var reSpecials = new Set("().*{}+?[]^$\\!");
|
|
597
|
+
var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
598
|
+
var qmark = "[^/]";
|
|
599
|
+
var star = qmark + "*?";
|
|
600
|
+
var starNoEmpty = qmark + "+?";
|
|
601
|
+
var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn;
|
|
602
|
+
var _AST = class _AST {
|
|
603
|
+
constructor(type, parent, options = {}) {
|
|
604
|
+
__privateAdd(this, _AST_instances);
|
|
605
|
+
__publicField(this, "type");
|
|
606
|
+
__privateAdd(this, _root);
|
|
607
|
+
__privateAdd(this, _hasMagic);
|
|
608
|
+
__privateAdd(this, _uflag, false);
|
|
609
|
+
__privateAdd(this, _parts, []);
|
|
610
|
+
__privateAdd(this, _parent);
|
|
611
|
+
__privateAdd(this, _parentIndex);
|
|
612
|
+
__privateAdd(this, _negs);
|
|
613
|
+
__privateAdd(this, _filledNegs, false);
|
|
614
|
+
__privateAdd(this, _options);
|
|
615
|
+
__privateAdd(this, _toString);
|
|
616
|
+
// set to true if it's an extglob with no children
|
|
617
|
+
// (which really means one child of '')
|
|
618
|
+
__privateAdd(this, _emptyExt, false);
|
|
619
|
+
this.type = type;
|
|
620
|
+
if (type)
|
|
621
|
+
__privateSet(this, _hasMagic, true);
|
|
622
|
+
__privateSet(this, _parent, parent);
|
|
623
|
+
__privateSet(this, _root, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _root) : this);
|
|
624
|
+
__privateSet(this, _options, __privateGet(this, _root) === this ? options : __privateGet(__privateGet(this, _root), _options));
|
|
625
|
+
__privateSet(this, _negs, __privateGet(this, _root) === this ? [] : __privateGet(__privateGet(this, _root), _negs));
|
|
626
|
+
if (type === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
|
|
627
|
+
__privateGet(this, _negs).push(this);
|
|
628
|
+
__privateSet(this, _parentIndex, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0);
|
|
629
|
+
}
|
|
630
|
+
get hasMagic() {
|
|
631
|
+
if (__privateGet(this, _hasMagic) !== void 0)
|
|
632
|
+
return __privateGet(this, _hasMagic);
|
|
633
|
+
for (const p of __privateGet(this, _parts)) {
|
|
634
|
+
if (typeof p === "string")
|
|
635
|
+
continue;
|
|
636
|
+
if (p.type || p.hasMagic)
|
|
637
|
+
return __privateSet(this, _hasMagic, true);
|
|
638
|
+
}
|
|
639
|
+
return __privateGet(this, _hasMagic);
|
|
640
|
+
}
|
|
641
|
+
// reconstructs the pattern
|
|
642
|
+
toString() {
|
|
643
|
+
if (__privateGet(this, _toString) !== void 0)
|
|
644
|
+
return __privateGet(this, _toString);
|
|
645
|
+
if (!this.type) {
|
|
646
|
+
return __privateSet(this, _toString, __privateGet(this, _parts).map((p) => String(p)).join(""));
|
|
647
|
+
} else {
|
|
648
|
+
return __privateSet(this, _toString, this.type + "(" + __privateGet(this, _parts).map((p) => String(p)).join("|") + ")");
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
push(...parts) {
|
|
652
|
+
for (const p of parts) {
|
|
653
|
+
if (p === "")
|
|
654
|
+
continue;
|
|
655
|
+
if (typeof p !== "string" && !(p instanceof _AST && __privateGet(p, _parent) === this)) {
|
|
656
|
+
throw new Error("invalid part: " + p);
|
|
657
|
+
}
|
|
658
|
+
__privateGet(this, _parts).push(p);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
toJSON() {
|
|
662
|
+
var _a;
|
|
663
|
+
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())];
|
|
664
|
+
if (this.isStart() && !this.type)
|
|
665
|
+
ret.unshift([]);
|
|
666
|
+
if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")) {
|
|
667
|
+
ret.push({});
|
|
668
|
+
}
|
|
669
|
+
return ret;
|
|
670
|
+
}
|
|
671
|
+
isStart() {
|
|
672
|
+
var _a;
|
|
673
|
+
if (__privateGet(this, _root) === this)
|
|
674
|
+
return true;
|
|
675
|
+
if (!((_a = __privateGet(this, _parent)) == null ? void 0 : _a.isStart()))
|
|
676
|
+
return false;
|
|
677
|
+
if (__privateGet(this, _parentIndex) === 0)
|
|
678
|
+
return true;
|
|
679
|
+
const p = __privateGet(this, _parent);
|
|
680
|
+
for (let i2 = 0; i2 < __privateGet(this, _parentIndex); i2++) {
|
|
681
|
+
const pp = __privateGet(p, _parts)[i2];
|
|
682
|
+
if (!(pp instanceof _AST && pp.type === "!")) {
|
|
683
|
+
return false;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
return true;
|
|
687
|
+
}
|
|
688
|
+
isEnd() {
|
|
689
|
+
var _a, _b, _c;
|
|
690
|
+
if (__privateGet(this, _root) === this)
|
|
691
|
+
return true;
|
|
692
|
+
if (((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")
|
|
693
|
+
return true;
|
|
694
|
+
if (!((_b = __privateGet(this, _parent)) == null ? void 0 : _b.isEnd()))
|
|
695
|
+
return false;
|
|
696
|
+
if (!this.type)
|
|
697
|
+
return (_c = __privateGet(this, _parent)) == null ? void 0 : _c.isEnd();
|
|
698
|
+
const pl = __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0;
|
|
699
|
+
return __privateGet(this, _parentIndex) === pl - 1;
|
|
700
|
+
}
|
|
701
|
+
copyIn(part) {
|
|
702
|
+
if (typeof part === "string")
|
|
703
|
+
this.push(part);
|
|
704
|
+
else
|
|
705
|
+
this.push(part.clone(this));
|
|
706
|
+
}
|
|
707
|
+
clone(parent) {
|
|
708
|
+
const c = new _AST(this.type, parent);
|
|
709
|
+
for (const p of __privateGet(this, _parts)) {
|
|
710
|
+
c.copyIn(p);
|
|
711
|
+
}
|
|
712
|
+
return c;
|
|
713
|
+
}
|
|
714
|
+
static fromGlob(pattern, options = {}) {
|
|
715
|
+
var _a;
|
|
716
|
+
const ast = new _AST(null, void 0, options);
|
|
717
|
+
__privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, pattern, ast, 0, options);
|
|
718
|
+
return ast;
|
|
719
|
+
}
|
|
720
|
+
// returns the regular expression if there's magic, or the unescaped
|
|
721
|
+
// string if not.
|
|
722
|
+
toMMPattern() {
|
|
723
|
+
if (this !== __privateGet(this, _root))
|
|
724
|
+
return __privateGet(this, _root).toMMPattern();
|
|
725
|
+
const glob = this.toString();
|
|
726
|
+
const [re, body, hasMagic, uflag] = this.toRegExpSource();
|
|
727
|
+
const anyMagic = hasMagic || __privateGet(this, _hasMagic) || __privateGet(this, _options).nocase && !__privateGet(this, _options).nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
|
|
728
|
+
if (!anyMagic) {
|
|
729
|
+
return body;
|
|
730
|
+
}
|
|
731
|
+
const flags = (__privateGet(this, _options).nocase ? "i" : "") + (uflag ? "u" : "");
|
|
732
|
+
return Object.assign(new RegExp(`^${re}$`, flags), {
|
|
733
|
+
_src: re,
|
|
734
|
+
_glob: glob
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
get options() {
|
|
738
|
+
return __privateGet(this, _options);
|
|
739
|
+
}
|
|
740
|
+
// returns the string match, the regexp source, whether there's magic
|
|
741
|
+
// in the regexp (so a regular expression is required) and whether or
|
|
742
|
+
// not the uflag is needed for the regular expression (for posix classes)
|
|
743
|
+
// TODO: instead of injecting the start/end at this point, just return
|
|
744
|
+
// the BODY of the regexp, along with the start/end portions suitable
|
|
745
|
+
// for binding the start/end in either a joined full-path makeRe context
|
|
746
|
+
// (where we bind to (^|/), or a standalone matchPart context (where
|
|
747
|
+
// we bind to ^, and not /). Otherwise slashes get duped!
|
|
748
|
+
//
|
|
749
|
+
// In part-matching mode, the start is:
|
|
750
|
+
// - if not isStart: nothing
|
|
751
|
+
// - if traversal possible, but not allowed: ^(?!\.\.?$)
|
|
752
|
+
// - if dots allowed or not possible: ^
|
|
753
|
+
// - if dots possible and not allowed: ^(?!\.)
|
|
754
|
+
// end is:
|
|
755
|
+
// - if not isEnd(): nothing
|
|
756
|
+
// - else: $
|
|
757
|
+
//
|
|
758
|
+
// In full-path matching mode, we put the slash at the START of the
|
|
759
|
+
// pattern, so start is:
|
|
760
|
+
// - if first pattern: same as part-matching mode
|
|
761
|
+
// - if not isStart(): nothing
|
|
762
|
+
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
|
|
763
|
+
// - if dots allowed or not possible: /
|
|
764
|
+
// - if dots possible and not allowed: /(?!\.)
|
|
765
|
+
// end is:
|
|
766
|
+
// - if last pattern, same as part-matching mode
|
|
767
|
+
// - else nothing
|
|
768
|
+
//
|
|
769
|
+
// Always put the (?:$|/) on negated tails, though, because that has to be
|
|
770
|
+
// there to bind the end of the negated pattern portion, and it's easier to
|
|
771
|
+
// just stick it in now rather than try to inject it later in the middle of
|
|
772
|
+
// the pattern.
|
|
773
|
+
//
|
|
774
|
+
// We can just always return the same end, and leave it up to the caller
|
|
775
|
+
// to know whether it's going to be used joined or in parts.
|
|
776
|
+
// And, if the start is adjusted slightly, can do the same there:
|
|
777
|
+
// - if not isStart: nothing
|
|
778
|
+
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
|
|
779
|
+
// - if dots allowed or not possible: (?:/|^)
|
|
780
|
+
// - if dots possible and not allowed: (?:/|^)(?!\.)
|
|
781
|
+
//
|
|
782
|
+
// But it's better to have a simpler binding without a conditional, for
|
|
783
|
+
// performance, so probably better to return both start options.
|
|
784
|
+
//
|
|
785
|
+
// Then the caller just ignores the end if it's not the first pattern,
|
|
786
|
+
// and the start always gets applied.
|
|
787
|
+
//
|
|
788
|
+
// But that's always going to be $ if it's the ending pattern, or nothing,
|
|
789
|
+
// so the caller can just attach $ at the end of the pattern when building.
|
|
790
|
+
//
|
|
791
|
+
// So the todo is:
|
|
792
|
+
// - better detect what kind of start is needed
|
|
793
|
+
// - return both flavors of starting pattern
|
|
794
|
+
// - attach $ at the end of the pattern when creating the actual RegExp
|
|
795
|
+
//
|
|
796
|
+
// Ah, but wait, no, that all only applies to the root when the first pattern
|
|
797
|
+
// is not an extglob. If the first pattern IS an extglob, then we need all
|
|
798
|
+
// that dot prevention biz to live in the extglob portions, because eg
|
|
799
|
+
// +(*|.x*) can match .xy but not .yx.
|
|
800
|
+
//
|
|
801
|
+
// So, return the two flavors if it's #root and the first child is not an
|
|
802
|
+
// AST, otherwise leave it to the child AST to handle it, and there,
|
|
803
|
+
// use the (?:^|/) style of start binding.
|
|
804
|
+
//
|
|
805
|
+
// Even simplified further:
|
|
806
|
+
// - Since the start for a join is eg /(?!\.) and the start for a part
|
|
807
|
+
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
|
808
|
+
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
|
809
|
+
toRegExpSource(allowDot) {
|
|
810
|
+
var _a;
|
|
811
|
+
const dot = allowDot != null ? allowDot : !!__privateGet(this, _options).dot;
|
|
812
|
+
if (__privateGet(this, _root) === this)
|
|
813
|
+
__privateMethod(this, _AST_instances, fillNegs_fn).call(this);
|
|
814
|
+
if (!this.type) {
|
|
815
|
+
const noEmpty = this.isStart() && this.isEnd();
|
|
816
|
+
const src = __privateGet(this, _parts).map((p) => {
|
|
817
|
+
var _a2;
|
|
818
|
+
const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(_a2 = _AST, _AST_static, parseGlob_fn).call(_a2, p, __privateGet(this, _hasMagic), noEmpty) : p.toRegExpSource(allowDot);
|
|
819
|
+
__privateSet(this, _hasMagic, __privateGet(this, _hasMagic) || hasMagic);
|
|
820
|
+
__privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
|
|
821
|
+
return re;
|
|
822
|
+
}).join("");
|
|
823
|
+
let start2 = "";
|
|
824
|
+
if (this.isStart()) {
|
|
825
|
+
if (typeof __privateGet(this, _parts)[0] === "string") {
|
|
826
|
+
const dotTravAllowed = __privateGet(this, _parts).length === 1 && justDots.has(__privateGet(this, _parts)[0]);
|
|
827
|
+
if (!dotTravAllowed) {
|
|
828
|
+
const aps = addPatternStart;
|
|
829
|
+
const needNoTrav = (
|
|
830
|
+
// dots are allowed, and the pattern starts with [ or .
|
|
831
|
+
dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
|
|
832
|
+
src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
|
|
833
|
+
src.startsWith("\\.\\.") && aps.has(src.charAt(4))
|
|
834
|
+
);
|
|
835
|
+
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
|
836
|
+
start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
let end = "";
|
|
841
|
+
if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!") {
|
|
842
|
+
end = "(?:$|\\/)";
|
|
843
|
+
}
|
|
844
|
+
const final2 = start2 + src + end;
|
|
845
|
+
return [
|
|
846
|
+
final2,
|
|
847
|
+
unescape(src),
|
|
848
|
+
__privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
|
|
849
|
+
__privateGet(this, _uflag)
|
|
850
|
+
];
|
|
851
|
+
}
|
|
852
|
+
const repeated = this.type === "*" || this.type === "+";
|
|
853
|
+
const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
|
|
854
|
+
let body = __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, dot);
|
|
855
|
+
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
|
856
|
+
const s = this.toString();
|
|
857
|
+
__privateSet(this, _parts, [s]);
|
|
858
|
+
this.type = null;
|
|
859
|
+
__privateSet(this, _hasMagic, void 0);
|
|
860
|
+
return [s, unescape(this.toString()), false, false];
|
|
861
|
+
}
|
|
862
|
+
let bodyDotAllowed = !repeated || allowDot || dot || false ? "" : __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, true);
|
|
863
|
+
if (bodyDotAllowed === body) {
|
|
864
|
+
bodyDotAllowed = "";
|
|
865
|
+
}
|
|
866
|
+
if (bodyDotAllowed) {
|
|
867
|
+
body = `(?:${body})(?:${bodyDotAllowed})*?`;
|
|
868
|
+
}
|
|
869
|
+
let final = "";
|
|
870
|
+
if (this.type === "!" && __privateGet(this, _emptyExt)) {
|
|
871
|
+
final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
|
|
872
|
+
} else {
|
|
873
|
+
const close = this.type === "!" ? (
|
|
874
|
+
// !() must match something,but !(x) can match ''
|
|
875
|
+
"))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
|
|
876
|
+
) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
|
|
877
|
+
final = start + body + close;
|
|
878
|
+
}
|
|
879
|
+
return [
|
|
880
|
+
final,
|
|
881
|
+
unescape(body),
|
|
882
|
+
__privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
|
|
883
|
+
__privateGet(this, _uflag)
|
|
884
|
+
];
|
|
885
|
+
}
|
|
886
|
+
};
|
|
887
|
+
_root = new WeakMap();
|
|
888
|
+
_hasMagic = new WeakMap();
|
|
889
|
+
_uflag = new WeakMap();
|
|
890
|
+
_parts = new WeakMap();
|
|
891
|
+
_parent = new WeakMap();
|
|
892
|
+
_parentIndex = new WeakMap();
|
|
893
|
+
_negs = new WeakMap();
|
|
894
|
+
_filledNegs = new WeakMap();
|
|
895
|
+
_options = new WeakMap();
|
|
896
|
+
_toString = new WeakMap();
|
|
897
|
+
_emptyExt = new WeakMap();
|
|
898
|
+
_AST_instances = new WeakSet();
|
|
899
|
+
fillNegs_fn = function() {
|
|
900
|
+
if (this !== __privateGet(this, _root))
|
|
901
|
+
throw new Error("should only call on root");
|
|
902
|
+
if (__privateGet(this, _filledNegs))
|
|
903
|
+
return this;
|
|
904
|
+
this.toString();
|
|
905
|
+
__privateSet(this, _filledNegs, true);
|
|
906
|
+
let n;
|
|
907
|
+
while (n = __privateGet(this, _negs).pop()) {
|
|
908
|
+
if (n.type !== "!")
|
|
909
|
+
continue;
|
|
910
|
+
let p = n;
|
|
911
|
+
let pp = __privateGet(p, _parent);
|
|
912
|
+
while (pp) {
|
|
913
|
+
for (let i2 = __privateGet(p, _parentIndex) + 1; !pp.type && i2 < __privateGet(pp, _parts).length; i2++) {
|
|
914
|
+
for (const part of __privateGet(n, _parts)) {
|
|
915
|
+
if (typeof part === "string") {
|
|
916
|
+
throw new Error("string part in extglob AST??");
|
|
917
|
+
}
|
|
918
|
+
part.copyIn(__privateGet(pp, _parts)[i2]);
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
p = pp;
|
|
922
|
+
pp = __privateGet(p, _parent);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
return this;
|
|
926
|
+
};
|
|
927
|
+
_AST_static = new WeakSet();
|
|
928
|
+
parseAST_fn = function(str, ast, pos, opt) {
|
|
929
|
+
var _a, _b;
|
|
930
|
+
let escaping = false;
|
|
931
|
+
let inBrace = false;
|
|
932
|
+
let braceStart = -1;
|
|
933
|
+
let braceNeg = false;
|
|
934
|
+
if (ast.type === null) {
|
|
935
|
+
let i3 = pos;
|
|
936
|
+
let acc2 = "";
|
|
937
|
+
while (i3 < str.length) {
|
|
938
|
+
const c = str.charAt(i3++);
|
|
939
|
+
if (escaping || c === "\\") {
|
|
940
|
+
escaping = !escaping;
|
|
941
|
+
acc2 += c;
|
|
942
|
+
continue;
|
|
943
|
+
}
|
|
944
|
+
if (inBrace) {
|
|
945
|
+
if (i3 === braceStart + 1) {
|
|
946
|
+
if (c === "^" || c === "!") {
|
|
947
|
+
braceNeg = true;
|
|
948
|
+
}
|
|
949
|
+
} else if (c === "]" && !(i3 === braceStart + 2 && braceNeg)) {
|
|
950
|
+
inBrace = false;
|
|
951
|
+
}
|
|
952
|
+
acc2 += c;
|
|
953
|
+
continue;
|
|
954
|
+
} else if (c === "[") {
|
|
955
|
+
inBrace = true;
|
|
956
|
+
braceStart = i3;
|
|
957
|
+
braceNeg = false;
|
|
958
|
+
acc2 += c;
|
|
959
|
+
continue;
|
|
960
|
+
}
|
|
961
|
+
if (!opt.noext && isExtglobType(c) && str.charAt(i3) === "(") {
|
|
962
|
+
ast.push(acc2);
|
|
963
|
+
acc2 = "";
|
|
964
|
+
const ext2 = new _AST(c, ast);
|
|
965
|
+
i3 = __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, str, ext2, i3, opt);
|
|
966
|
+
ast.push(ext2);
|
|
967
|
+
continue;
|
|
968
|
+
}
|
|
969
|
+
acc2 += c;
|
|
970
|
+
}
|
|
971
|
+
ast.push(acc2);
|
|
972
|
+
return i3;
|
|
973
|
+
}
|
|
974
|
+
let i2 = pos + 1;
|
|
975
|
+
let part = new _AST(null, ast);
|
|
976
|
+
const parts = [];
|
|
977
|
+
let acc = "";
|
|
978
|
+
while (i2 < str.length) {
|
|
979
|
+
const c = str.charAt(i2++);
|
|
980
|
+
if (escaping || c === "\\") {
|
|
981
|
+
escaping = !escaping;
|
|
982
|
+
acc += c;
|
|
983
|
+
continue;
|
|
984
|
+
}
|
|
985
|
+
if (inBrace) {
|
|
986
|
+
if (i2 === braceStart + 1) {
|
|
987
|
+
if (c === "^" || c === "!") {
|
|
988
|
+
braceNeg = true;
|
|
989
|
+
}
|
|
990
|
+
} else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
|
|
991
|
+
inBrace = false;
|
|
992
|
+
}
|
|
993
|
+
acc += c;
|
|
994
|
+
continue;
|
|
995
|
+
} else if (c === "[") {
|
|
996
|
+
inBrace = true;
|
|
997
|
+
braceStart = i2;
|
|
998
|
+
braceNeg = false;
|
|
999
|
+
acc += c;
|
|
1000
|
+
continue;
|
|
1001
|
+
}
|
|
1002
|
+
if (isExtglobType(c) && str.charAt(i2) === "(") {
|
|
1003
|
+
part.push(acc);
|
|
1004
|
+
acc = "";
|
|
1005
|
+
const ext2 = new _AST(c, part);
|
|
1006
|
+
part.push(ext2);
|
|
1007
|
+
i2 = __privateMethod(_b = _AST, _AST_static, parseAST_fn).call(_b, str, ext2, i2, opt);
|
|
1008
|
+
continue;
|
|
1009
|
+
}
|
|
1010
|
+
if (c === "|") {
|
|
1011
|
+
part.push(acc);
|
|
1012
|
+
acc = "";
|
|
1013
|
+
parts.push(part);
|
|
1014
|
+
part = new _AST(null, ast);
|
|
1015
|
+
continue;
|
|
1016
|
+
}
|
|
1017
|
+
if (c === ")") {
|
|
1018
|
+
if (acc === "" && __privateGet(ast, _parts).length === 0) {
|
|
1019
|
+
__privateSet(ast, _emptyExt, true);
|
|
1020
|
+
}
|
|
1021
|
+
part.push(acc);
|
|
1022
|
+
acc = "";
|
|
1023
|
+
ast.push(...parts, part);
|
|
1024
|
+
return i2;
|
|
1025
|
+
}
|
|
1026
|
+
acc += c;
|
|
1027
|
+
}
|
|
1028
|
+
ast.type = null;
|
|
1029
|
+
__privateSet(ast, _hasMagic, void 0);
|
|
1030
|
+
__privateSet(ast, _parts, [str.substring(pos - 1)]);
|
|
1031
|
+
return i2;
|
|
1032
|
+
};
|
|
1033
|
+
partsToRegExp_fn = function(dot) {
|
|
1034
|
+
return __privateGet(this, _parts).map((p) => {
|
|
1035
|
+
if (typeof p === "string") {
|
|
1036
|
+
throw new Error("string type in extglob ast??");
|
|
1037
|
+
}
|
|
1038
|
+
const [re, _, _hasMagic2, uflag] = p.toRegExpSource(dot);
|
|
1039
|
+
__privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
|
|
1040
|
+
return re;
|
|
1041
|
+
}).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
|
|
1042
|
+
};
|
|
1043
|
+
parseGlob_fn = function(glob, hasMagic, noEmpty = false) {
|
|
1044
|
+
let escaping = false;
|
|
1045
|
+
let re = "";
|
|
1046
|
+
let uflag = false;
|
|
1047
|
+
for (let i2 = 0; i2 < glob.length; i2++) {
|
|
1048
|
+
const c = glob.charAt(i2);
|
|
1049
|
+
if (escaping) {
|
|
1050
|
+
escaping = false;
|
|
1051
|
+
re += (reSpecials.has(c) ? "\\" : "") + c;
|
|
1052
|
+
continue;
|
|
1053
|
+
}
|
|
1054
|
+
if (c === "\\") {
|
|
1055
|
+
if (i2 === glob.length - 1) {
|
|
1056
|
+
re += "\\\\";
|
|
1057
|
+
} else {
|
|
1058
|
+
escaping = true;
|
|
1059
|
+
}
|
|
1060
|
+
continue;
|
|
1061
|
+
}
|
|
1062
|
+
if (c === "[") {
|
|
1063
|
+
const [src, needUflag, consumed, magic] = parseClass(glob, i2);
|
|
1064
|
+
if (consumed) {
|
|
1065
|
+
re += src;
|
|
1066
|
+
uflag = uflag || needUflag;
|
|
1067
|
+
i2 += consumed - 1;
|
|
1068
|
+
hasMagic = hasMagic || magic;
|
|
1069
|
+
continue;
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
if (c === "*") {
|
|
1073
|
+
if (noEmpty && glob === "*")
|
|
1074
|
+
re += starNoEmpty;
|
|
1075
|
+
else
|
|
1076
|
+
re += star;
|
|
1077
|
+
hasMagic = true;
|
|
1078
|
+
continue;
|
|
1079
|
+
}
|
|
1080
|
+
if (c === "?") {
|
|
1081
|
+
re += qmark;
|
|
1082
|
+
hasMagic = true;
|
|
1083
|
+
continue;
|
|
1084
|
+
}
|
|
1085
|
+
re += regExpEscape(c);
|
|
1086
|
+
}
|
|
1087
|
+
return [re, unescape(glob), !!hasMagic, uflag];
|
|
1088
|
+
};
|
|
1089
|
+
__privateAdd(_AST, _AST_static);
|
|
1090
|
+
var AST = _AST;
|
|
1091
|
+
|
|
1092
|
+
// node_modules/minimatch/dist/esm/escape.js
|
|
1093
|
+
var escape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
1094
|
+
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
|
1095
|
+
};
|
|
1096
|
+
|
|
1097
|
+
// node_modules/minimatch/dist/esm/index.js
|
|
1098
|
+
var minimatch = (p, pattern, options = {}) => {
|
|
1099
|
+
assertValidPattern(pattern);
|
|
1100
|
+
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
1101
|
+
return false;
|
|
1102
|
+
}
|
|
1103
|
+
return new Minimatch(pattern, options).match(p);
|
|
1104
|
+
};
|
|
1105
|
+
var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
|
|
1106
|
+
var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
|
|
1107
|
+
var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
|
|
1108
|
+
var starDotExtTestNocase = (ext2) => {
|
|
1109
|
+
ext2 = ext2.toLowerCase();
|
|
1110
|
+
return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
|
|
1111
|
+
};
|
|
1112
|
+
var starDotExtTestNocaseDot = (ext2) => {
|
|
1113
|
+
ext2 = ext2.toLowerCase();
|
|
1114
|
+
return (f) => f.toLowerCase().endsWith(ext2);
|
|
1115
|
+
};
|
|
1116
|
+
var starDotStarRE = /^\*+\.\*+$/;
|
|
1117
|
+
var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
|
|
1118
|
+
var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
|
|
1119
|
+
var dotStarRE = /^\.\*+$/;
|
|
1120
|
+
var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
|
|
1121
|
+
var starRE = /^\*+$/;
|
|
1122
|
+
var starTest = (f) => f.length !== 0 && !f.startsWith(".");
|
|
1123
|
+
var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
|
|
1124
|
+
var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
1125
|
+
var qmarksTestNocase = ([$0, ext2 = ""]) => {
|
|
1126
|
+
const noext = qmarksTestNoExt([$0]);
|
|
1127
|
+
if (!ext2)
|
|
1128
|
+
return noext;
|
|
1129
|
+
ext2 = ext2.toLowerCase();
|
|
1130
|
+
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
|
|
1131
|
+
};
|
|
1132
|
+
var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
|
|
1133
|
+
const noext = qmarksTestNoExtDot([$0]);
|
|
1134
|
+
if (!ext2)
|
|
1135
|
+
return noext;
|
|
1136
|
+
ext2 = ext2.toLowerCase();
|
|
1137
|
+
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
|
|
1138
|
+
};
|
|
1139
|
+
var qmarksTestDot = ([$0, ext2 = ""]) => {
|
|
1140
|
+
const noext = qmarksTestNoExtDot([$0]);
|
|
1141
|
+
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
|
|
1142
|
+
};
|
|
1143
|
+
var qmarksTest = ([$0, ext2 = ""]) => {
|
|
1144
|
+
const noext = qmarksTestNoExt([$0]);
|
|
1145
|
+
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
|
|
1146
|
+
};
|
|
1147
|
+
var qmarksTestNoExt = ([$0]) => {
|
|
1148
|
+
const len = $0.length;
|
|
1149
|
+
return (f) => f.length === len && !f.startsWith(".");
|
|
1150
|
+
};
|
|
1151
|
+
var qmarksTestNoExtDot = ([$0]) => {
|
|
1152
|
+
const len = $0.length;
|
|
1153
|
+
return (f) => f.length === len && f !== "." && f !== "..";
|
|
1154
|
+
};
|
|
1155
|
+
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
1156
|
+
var path = {
|
|
1157
|
+
win32: { sep: "\\" },
|
|
1158
|
+
posix: { sep: "/" }
|
|
1159
|
+
};
|
|
1160
|
+
var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
|
|
1161
|
+
minimatch.sep = sep;
|
|
1162
|
+
var GLOBSTAR = Symbol("globstar **");
|
|
1163
|
+
minimatch.GLOBSTAR = GLOBSTAR;
|
|
1164
|
+
var qmark2 = "[^/]";
|
|
1165
|
+
var star2 = qmark2 + "*?";
|
|
1166
|
+
var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
1167
|
+
var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
1168
|
+
var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
|
|
1169
|
+
minimatch.filter = filter;
|
|
1170
|
+
var ext = (a, b = {}) => Object.assign({}, a, b);
|
|
1171
|
+
var defaults = (def) => {
|
|
1172
|
+
if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
|
1173
|
+
return minimatch;
|
|
1174
|
+
}
|
|
1175
|
+
const orig = minimatch;
|
|
1176
|
+
const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
|
|
1177
|
+
return Object.assign(m, {
|
|
1178
|
+
Minimatch: class Minimatch extends orig.Minimatch {
|
|
1179
|
+
constructor(pattern, options = {}) {
|
|
1180
|
+
super(pattern, ext(def, options));
|
|
1181
|
+
}
|
|
1182
|
+
static defaults(options) {
|
|
1183
|
+
return orig.defaults(ext(def, options)).Minimatch;
|
|
1184
|
+
}
|
|
1185
|
+
},
|
|
1186
|
+
AST: class AST extends orig.AST {
|
|
1187
|
+
/* c8 ignore start */
|
|
1188
|
+
constructor(type, parent, options = {}) {
|
|
1189
|
+
super(type, parent, ext(def, options));
|
|
1190
|
+
}
|
|
1191
|
+
/* c8 ignore stop */
|
|
1192
|
+
static fromGlob(pattern, options = {}) {
|
|
1193
|
+
return orig.AST.fromGlob(pattern, ext(def, options));
|
|
1194
|
+
}
|
|
1195
|
+
},
|
|
1196
|
+
unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
|
|
1197
|
+
escape: (s, options = {}) => orig.escape(s, ext(def, options)),
|
|
1198
|
+
filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
|
|
1199
|
+
defaults: (options) => orig.defaults(ext(def, options)),
|
|
1200
|
+
makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
|
|
1201
|
+
braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
|
|
1202
|
+
match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
|
|
1203
|
+
sep: orig.sep,
|
|
1204
|
+
GLOBSTAR
|
|
1205
|
+
});
|
|
1206
|
+
};
|
|
1207
|
+
minimatch.defaults = defaults;
|
|
1208
|
+
var braceExpand = (pattern, options = {}) => {
|
|
1209
|
+
assertValidPattern(pattern);
|
|
1210
|
+
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
1211
|
+
return [pattern];
|
|
1212
|
+
}
|
|
1213
|
+
return (0, import_brace_expansion.default)(pattern);
|
|
1214
|
+
};
|
|
1215
|
+
minimatch.braceExpand = braceExpand;
|
|
1216
|
+
var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
|
|
1217
|
+
minimatch.makeRe = makeRe;
|
|
1218
|
+
var match = (list, pattern, options = {}) => {
|
|
1219
|
+
const mm = new Minimatch(pattern, options);
|
|
1220
|
+
list = list.filter((f) => mm.match(f));
|
|
1221
|
+
if (mm.options.nonull && !list.length) {
|
|
1222
|
+
list.push(pattern);
|
|
1223
|
+
}
|
|
1224
|
+
return list;
|
|
1225
|
+
};
|
|
1226
|
+
minimatch.match = match;
|
|
1227
|
+
var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
1228
|
+
var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
1229
|
+
var Minimatch = class {
|
|
1230
|
+
options;
|
|
1231
|
+
set;
|
|
1232
|
+
pattern;
|
|
1233
|
+
windowsPathsNoEscape;
|
|
1234
|
+
nonegate;
|
|
1235
|
+
negate;
|
|
1236
|
+
comment;
|
|
1237
|
+
empty;
|
|
1238
|
+
preserveMultipleSlashes;
|
|
1239
|
+
partial;
|
|
1240
|
+
globSet;
|
|
1241
|
+
globParts;
|
|
1242
|
+
nocase;
|
|
1243
|
+
isWindows;
|
|
1244
|
+
platform;
|
|
1245
|
+
windowsNoMagicRoot;
|
|
1246
|
+
regexp;
|
|
1247
|
+
constructor(pattern, options = {}) {
|
|
1248
|
+
assertValidPattern(pattern);
|
|
1249
|
+
options = options || {};
|
|
1250
|
+
this.options = options;
|
|
1251
|
+
this.pattern = pattern;
|
|
1252
|
+
this.platform = options.platform || defaultPlatform;
|
|
1253
|
+
this.isWindows = this.platform === "win32";
|
|
1254
|
+
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
|
1255
|
+
if (this.windowsPathsNoEscape) {
|
|
1256
|
+
this.pattern = this.pattern.replace(/\\/g, "/");
|
|
1257
|
+
}
|
|
1258
|
+
this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
|
|
1259
|
+
this.regexp = null;
|
|
1260
|
+
this.negate = false;
|
|
1261
|
+
this.nonegate = !!options.nonegate;
|
|
1262
|
+
this.comment = false;
|
|
1263
|
+
this.empty = false;
|
|
1264
|
+
this.partial = !!options.partial;
|
|
1265
|
+
this.nocase = !!this.options.nocase;
|
|
1266
|
+
this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
|
|
1267
|
+
this.globSet = [];
|
|
1268
|
+
this.globParts = [];
|
|
1269
|
+
this.set = [];
|
|
1270
|
+
this.make();
|
|
1271
|
+
}
|
|
1272
|
+
hasMagic() {
|
|
1273
|
+
if (this.options.magicalBraces && this.set.length > 1) {
|
|
1274
|
+
return true;
|
|
1275
|
+
}
|
|
1276
|
+
for (const pattern of this.set) {
|
|
1277
|
+
for (const part of pattern) {
|
|
1278
|
+
if (typeof part !== "string")
|
|
1279
|
+
return true;
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
return false;
|
|
1283
|
+
}
|
|
1284
|
+
debug(..._) {
|
|
1285
|
+
}
|
|
1286
|
+
make() {
|
|
1287
|
+
const pattern = this.pattern;
|
|
1288
|
+
const options = this.options;
|
|
1289
|
+
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
1290
|
+
this.comment = true;
|
|
1291
|
+
return;
|
|
1292
|
+
}
|
|
1293
|
+
if (!pattern) {
|
|
1294
|
+
this.empty = true;
|
|
1295
|
+
return;
|
|
1296
|
+
}
|
|
1297
|
+
this.parseNegate();
|
|
1298
|
+
this.globSet = [...new Set(this.braceExpand())];
|
|
1299
|
+
if (options.debug) {
|
|
1300
|
+
this.debug = (...args) => console.error(...args);
|
|
1301
|
+
}
|
|
1302
|
+
this.debug(this.pattern, this.globSet);
|
|
1303
|
+
const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
|
|
1304
|
+
this.globParts = this.preprocess(rawGlobParts);
|
|
1305
|
+
this.debug(this.pattern, this.globParts);
|
|
1306
|
+
let set = this.globParts.map((s, _, __) => {
|
|
1307
|
+
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
1308
|
+
const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
|
|
1309
|
+
const isDrive = /^[a-z]:/i.test(s[0]);
|
|
1310
|
+
if (isUNC) {
|
|
1311
|
+
return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
|
|
1312
|
+
} else if (isDrive) {
|
|
1313
|
+
return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
return s.map((ss) => this.parse(ss));
|
|
1317
|
+
});
|
|
1318
|
+
this.debug(this.pattern, set);
|
|
1319
|
+
this.set = set.filter((s) => s.indexOf(false) === -1);
|
|
1320
|
+
if (this.isWindows) {
|
|
1321
|
+
for (let i2 = 0; i2 < this.set.length; i2++) {
|
|
1322
|
+
const p = this.set[i2];
|
|
1323
|
+
if (p[0] === "" && p[1] === "" && this.globParts[i2][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
|
|
1324
|
+
p[2] = "?";
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
this.debug(this.pattern, this.set);
|
|
1329
|
+
}
|
|
1330
|
+
// various transforms to equivalent pattern sets that are
|
|
1331
|
+
// faster to process in a filesystem walk. The goal is to
|
|
1332
|
+
// eliminate what we can, and push all ** patterns as far
|
|
1333
|
+
// to the right as possible, even if it increases the number
|
|
1334
|
+
// of patterns that we have to process.
|
|
1335
|
+
preprocess(globParts) {
|
|
1336
|
+
if (this.options.noglobstar) {
|
|
1337
|
+
for (let i2 = 0; i2 < globParts.length; i2++) {
|
|
1338
|
+
for (let j = 0; j < globParts[i2].length; j++) {
|
|
1339
|
+
if (globParts[i2][j] === "**") {
|
|
1340
|
+
globParts[i2][j] = "*";
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
const { optimizationLevel = 1 } = this.options;
|
|
1346
|
+
if (optimizationLevel >= 2) {
|
|
1347
|
+
globParts = this.firstPhasePreProcess(globParts);
|
|
1348
|
+
globParts = this.secondPhasePreProcess(globParts);
|
|
1349
|
+
} else if (optimizationLevel >= 1) {
|
|
1350
|
+
globParts = this.levelOneOptimize(globParts);
|
|
1351
|
+
} else {
|
|
1352
|
+
globParts = this.adjascentGlobstarOptimize(globParts);
|
|
1353
|
+
}
|
|
1354
|
+
return globParts;
|
|
1355
|
+
}
|
|
1356
|
+
// just get rid of adjascent ** portions
|
|
1357
|
+
adjascentGlobstarOptimize(globParts) {
|
|
1358
|
+
return globParts.map((parts) => {
|
|
1359
|
+
let gs = -1;
|
|
1360
|
+
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
1361
|
+
let i2 = gs;
|
|
1362
|
+
while (parts[i2 + 1] === "**") {
|
|
1363
|
+
i2++;
|
|
1364
|
+
}
|
|
1365
|
+
if (i2 !== gs) {
|
|
1366
|
+
parts.splice(gs, i2 - gs);
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
return parts;
|
|
1370
|
+
});
|
|
1371
|
+
}
|
|
1372
|
+
// get rid of adjascent ** and resolve .. portions
|
|
1373
|
+
levelOneOptimize(globParts) {
|
|
1374
|
+
return globParts.map((parts) => {
|
|
1375
|
+
parts = parts.reduce((set, part) => {
|
|
1376
|
+
const prev = set[set.length - 1];
|
|
1377
|
+
if (part === "**" && prev === "**") {
|
|
1378
|
+
return set;
|
|
1379
|
+
}
|
|
1380
|
+
if (part === "..") {
|
|
1381
|
+
if (prev && prev !== ".." && prev !== "." && prev !== "**") {
|
|
1382
|
+
set.pop();
|
|
1383
|
+
return set;
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
set.push(part);
|
|
1387
|
+
return set;
|
|
1388
|
+
}, []);
|
|
1389
|
+
return parts.length === 0 ? [""] : parts;
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
levelTwoFileOptimize(parts) {
|
|
1393
|
+
if (!Array.isArray(parts)) {
|
|
1394
|
+
parts = this.slashSplit(parts);
|
|
1395
|
+
}
|
|
1396
|
+
let didSomething = false;
|
|
1397
|
+
do {
|
|
1398
|
+
didSomething = false;
|
|
1399
|
+
if (!this.preserveMultipleSlashes) {
|
|
1400
|
+
for (let i2 = 1; i2 < parts.length - 1; i2++) {
|
|
1401
|
+
const p = parts[i2];
|
|
1402
|
+
if (i2 === 1 && p === "" && parts[0] === "")
|
|
1403
|
+
continue;
|
|
1404
|
+
if (p === "." || p === "") {
|
|
1405
|
+
didSomething = true;
|
|
1406
|
+
parts.splice(i2, 1);
|
|
1407
|
+
i2--;
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
1411
|
+
didSomething = true;
|
|
1412
|
+
parts.pop();
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
let dd = 0;
|
|
1416
|
+
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
1417
|
+
const p = parts[dd - 1];
|
|
1418
|
+
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
1419
|
+
didSomething = true;
|
|
1420
|
+
parts.splice(dd - 1, 2);
|
|
1421
|
+
dd -= 2;
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
} while (didSomething);
|
|
1425
|
+
return parts.length === 0 ? [""] : parts;
|
|
1426
|
+
}
|
|
1427
|
+
// First phase: single-pattern processing
|
|
1428
|
+
// <pre> is 1 or more portions
|
|
1429
|
+
// <rest> is 1 or more portions
|
|
1430
|
+
// <p> is any portion other than ., .., '', or **
|
|
1431
|
+
// <e> is . or ''
|
|
1432
|
+
//
|
|
1433
|
+
// **/.. is *brutal* for filesystem walking performance, because
|
|
1434
|
+
// it effectively resets the recursive walk each time it occurs,
|
|
1435
|
+
// and ** cannot be reduced out by a .. pattern part like a regexp
|
|
1436
|
+
// or most strings (other than .., ., and '') can be.
|
|
1437
|
+
//
|
|
1438
|
+
// <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
|
|
1439
|
+
// <pre>/<e>/<rest> -> <pre>/<rest>
|
|
1440
|
+
// <pre>/<p>/../<rest> -> <pre>/<rest>
|
|
1441
|
+
// **/**/<rest> -> **/<rest>
|
|
1442
|
+
//
|
|
1443
|
+
// **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
|
|
1444
|
+
// this WOULD be allowed if ** did follow symlinks, or * didn't
|
|
1445
|
+
firstPhasePreProcess(globParts) {
|
|
1446
|
+
let didSomething = false;
|
|
1447
|
+
do {
|
|
1448
|
+
didSomething = false;
|
|
1449
|
+
for (let parts of globParts) {
|
|
1450
|
+
let gs = -1;
|
|
1451
|
+
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
1452
|
+
let gss = gs;
|
|
1453
|
+
while (parts[gss + 1] === "**") {
|
|
1454
|
+
gss++;
|
|
1455
|
+
}
|
|
1456
|
+
if (gss > gs) {
|
|
1457
|
+
parts.splice(gs + 1, gss - gs);
|
|
1458
|
+
}
|
|
1459
|
+
let next = parts[gs + 1];
|
|
1460
|
+
const p = parts[gs + 2];
|
|
1461
|
+
const p2 = parts[gs + 3];
|
|
1462
|
+
if (next !== "..")
|
|
1463
|
+
continue;
|
|
1464
|
+
if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
|
|
1465
|
+
continue;
|
|
1466
|
+
}
|
|
1467
|
+
didSomething = true;
|
|
1468
|
+
parts.splice(gs, 1);
|
|
1469
|
+
const other = parts.slice(0);
|
|
1470
|
+
other[gs] = "**";
|
|
1471
|
+
globParts.push(other);
|
|
1472
|
+
gs--;
|
|
1473
|
+
}
|
|
1474
|
+
if (!this.preserveMultipleSlashes) {
|
|
1475
|
+
for (let i2 = 1; i2 < parts.length - 1; i2++) {
|
|
1476
|
+
const p = parts[i2];
|
|
1477
|
+
if (i2 === 1 && p === "" && parts[0] === "")
|
|
1478
|
+
continue;
|
|
1479
|
+
if (p === "." || p === "") {
|
|
1480
|
+
didSomething = true;
|
|
1481
|
+
parts.splice(i2, 1);
|
|
1482
|
+
i2--;
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
1486
|
+
didSomething = true;
|
|
1487
|
+
parts.pop();
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
let dd = 0;
|
|
1491
|
+
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
1492
|
+
const p = parts[dd - 1];
|
|
1493
|
+
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
1494
|
+
didSomething = true;
|
|
1495
|
+
const needDot = dd === 1 && parts[dd + 1] === "**";
|
|
1496
|
+
const splin = needDot ? ["."] : [];
|
|
1497
|
+
parts.splice(dd - 1, 2, ...splin);
|
|
1498
|
+
if (parts.length === 0)
|
|
1499
|
+
parts.push("");
|
|
1500
|
+
dd -= 2;
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
} while (didSomething);
|
|
1505
|
+
return globParts;
|
|
1506
|
+
}
|
|
1507
|
+
// second phase: multi-pattern dedupes
|
|
1508
|
+
// {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
|
|
1509
|
+
// {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
|
|
1510
|
+
// {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
|
|
1511
|
+
//
|
|
1512
|
+
// {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
|
|
1513
|
+
// ^-- not valid because ** doens't follow symlinks
|
|
1514
|
+
secondPhasePreProcess(globParts) {
|
|
1515
|
+
for (let i2 = 0; i2 < globParts.length - 1; i2++) {
|
|
1516
|
+
for (let j = i2 + 1; j < globParts.length; j++) {
|
|
1517
|
+
const matched = this.partsMatch(globParts[i2], globParts[j], !this.preserveMultipleSlashes);
|
|
1518
|
+
if (!matched)
|
|
1519
|
+
continue;
|
|
1520
|
+
globParts[i2] = matched;
|
|
1521
|
+
globParts[j] = [];
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
return globParts.filter((gs) => gs.length);
|
|
1525
|
+
}
|
|
1526
|
+
partsMatch(a, b, emptyGSMatch = false) {
|
|
1527
|
+
let ai = 0;
|
|
1528
|
+
let bi = 0;
|
|
1529
|
+
let result = [];
|
|
1530
|
+
let which = "";
|
|
1531
|
+
while (ai < a.length && bi < b.length) {
|
|
1532
|
+
if (a[ai] === b[bi]) {
|
|
1533
|
+
result.push(which === "b" ? b[bi] : a[ai]);
|
|
1534
|
+
ai++;
|
|
1535
|
+
bi++;
|
|
1536
|
+
} else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
|
|
1537
|
+
result.push(a[ai]);
|
|
1538
|
+
ai++;
|
|
1539
|
+
} else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
|
|
1540
|
+
result.push(b[bi]);
|
|
1541
|
+
bi++;
|
|
1542
|
+
} else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
|
|
1543
|
+
if (which === "b")
|
|
1544
|
+
return false;
|
|
1545
|
+
which = "a";
|
|
1546
|
+
result.push(a[ai]);
|
|
1547
|
+
ai++;
|
|
1548
|
+
bi++;
|
|
1549
|
+
} else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
|
|
1550
|
+
if (which === "a")
|
|
1551
|
+
return false;
|
|
1552
|
+
which = "b";
|
|
1553
|
+
result.push(b[bi]);
|
|
1554
|
+
ai++;
|
|
1555
|
+
bi++;
|
|
1556
|
+
} else {
|
|
1557
|
+
return false;
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
return a.length === b.length && result;
|
|
1561
|
+
}
|
|
1562
|
+
parseNegate() {
|
|
1563
|
+
if (this.nonegate)
|
|
1564
|
+
return;
|
|
1565
|
+
const pattern = this.pattern;
|
|
1566
|
+
let negate = false;
|
|
1567
|
+
let negateOffset = 0;
|
|
1568
|
+
for (let i2 = 0; i2 < pattern.length && pattern.charAt(i2) === "!"; i2++) {
|
|
1569
|
+
negate = !negate;
|
|
1570
|
+
negateOffset++;
|
|
1571
|
+
}
|
|
1572
|
+
if (negateOffset)
|
|
1573
|
+
this.pattern = pattern.slice(negateOffset);
|
|
1574
|
+
this.negate = negate;
|
|
1575
|
+
}
|
|
1576
|
+
// set partial to true to test if, for example,
|
|
1577
|
+
// "/a/b" matches the start of "/*/b/*/d"
|
|
1578
|
+
// Partial means, if you run out of file before you run
|
|
1579
|
+
// out of pattern, then that's fine, as long as all
|
|
1580
|
+
// the parts match.
|
|
1581
|
+
matchOne(file, pattern, partial = false) {
|
|
1582
|
+
const options = this.options;
|
|
1583
|
+
if (this.isWindows) {
|
|
1584
|
+
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
|
1585
|
+
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
|
1586
|
+
const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
|
|
1587
|
+
const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
|
|
1588
|
+
const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
|
|
1589
|
+
const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
|
|
1590
|
+
if (typeof fdi === "number" && typeof pdi === "number") {
|
|
1591
|
+
const [fd, pd] = [file[fdi], pattern[pdi]];
|
|
1592
|
+
if (fd.toLowerCase() === pd.toLowerCase()) {
|
|
1593
|
+
pattern[pdi] = fd;
|
|
1594
|
+
if (pdi > fdi) {
|
|
1595
|
+
pattern = pattern.slice(pdi);
|
|
1596
|
+
} else if (fdi > pdi) {
|
|
1597
|
+
file = file.slice(fdi);
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
const { optimizationLevel = 1 } = this.options;
|
|
1603
|
+
if (optimizationLevel >= 2) {
|
|
1604
|
+
file = this.levelTwoFileOptimize(file);
|
|
1605
|
+
}
|
|
1606
|
+
this.debug("matchOne", this, { file, pattern });
|
|
1607
|
+
this.debug("matchOne", file.length, pattern.length);
|
|
1608
|
+
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
1609
|
+
this.debug("matchOne loop");
|
|
1610
|
+
var p = pattern[pi];
|
|
1611
|
+
var f = file[fi];
|
|
1612
|
+
this.debug(pattern, p, f);
|
|
1613
|
+
if (p === false) {
|
|
1614
|
+
return false;
|
|
1615
|
+
}
|
|
1616
|
+
if (p === GLOBSTAR) {
|
|
1617
|
+
this.debug("GLOBSTAR", [pattern, p, f]);
|
|
1618
|
+
var fr = fi;
|
|
1619
|
+
var pr = pi + 1;
|
|
1620
|
+
if (pr === pl) {
|
|
1621
|
+
this.debug("** at the end");
|
|
1622
|
+
for (; fi < fl; fi++) {
|
|
1623
|
+
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
|
1624
|
+
return false;
|
|
1625
|
+
}
|
|
1626
|
+
return true;
|
|
1627
|
+
}
|
|
1628
|
+
while (fr < fl) {
|
|
1629
|
+
var swallowee = file[fr];
|
|
1630
|
+
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
|
1631
|
+
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
1632
|
+
this.debug("globstar found match!", fr, fl, swallowee);
|
|
1633
|
+
return true;
|
|
1634
|
+
} else {
|
|
1635
|
+
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
|
1636
|
+
this.debug("dot detected!", file, fr, pattern, pr);
|
|
1637
|
+
break;
|
|
1638
|
+
}
|
|
1639
|
+
this.debug("globstar swallow a segment, and continue");
|
|
1640
|
+
fr++;
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
if (partial) {
|
|
1644
|
+
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
|
1645
|
+
if (fr === fl) {
|
|
1646
|
+
return true;
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
return false;
|
|
1650
|
+
}
|
|
1651
|
+
let hit;
|
|
1652
|
+
if (typeof p === "string") {
|
|
1653
|
+
hit = f === p;
|
|
1654
|
+
this.debug("string match", p, f, hit);
|
|
1655
|
+
} else {
|
|
1656
|
+
hit = p.test(f);
|
|
1657
|
+
this.debug("pattern match", p, f, hit);
|
|
1658
|
+
}
|
|
1659
|
+
if (!hit)
|
|
1660
|
+
return false;
|
|
1661
|
+
}
|
|
1662
|
+
if (fi === fl && pi === pl) {
|
|
1663
|
+
return true;
|
|
1664
|
+
} else if (fi === fl) {
|
|
1665
|
+
return partial;
|
|
1666
|
+
} else if (pi === pl) {
|
|
1667
|
+
return fi === fl - 1 && file[fi] === "";
|
|
1668
|
+
} else {
|
|
1669
|
+
throw new Error("wtf?");
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
braceExpand() {
|
|
1673
|
+
return braceExpand(this.pattern, this.options);
|
|
1674
|
+
}
|
|
1675
|
+
parse(pattern) {
|
|
1676
|
+
assertValidPattern(pattern);
|
|
1677
|
+
const options = this.options;
|
|
1678
|
+
if (pattern === "**")
|
|
1679
|
+
return GLOBSTAR;
|
|
1680
|
+
if (pattern === "")
|
|
1681
|
+
return "";
|
|
1682
|
+
let m;
|
|
1683
|
+
let fastTest = null;
|
|
1684
|
+
if (m = pattern.match(starRE)) {
|
|
1685
|
+
fastTest = options.dot ? starTestDot : starTest;
|
|
1686
|
+
} else if (m = pattern.match(starDotExtRE)) {
|
|
1687
|
+
fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
|
|
1688
|
+
} else if (m = pattern.match(qmarksRE)) {
|
|
1689
|
+
fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
|
|
1690
|
+
} else if (m = pattern.match(starDotStarRE)) {
|
|
1691
|
+
fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
|
|
1692
|
+
} else if (m = pattern.match(dotStarRE)) {
|
|
1693
|
+
fastTest = dotStarTest;
|
|
1694
|
+
}
|
|
1695
|
+
const re = AST.fromGlob(pattern, this.options).toMMPattern();
|
|
1696
|
+
if (fastTest && typeof re === "object") {
|
|
1697
|
+
Reflect.defineProperty(re, "test", { value: fastTest });
|
|
1698
|
+
}
|
|
1699
|
+
return re;
|
|
1700
|
+
}
|
|
1701
|
+
makeRe() {
|
|
1702
|
+
if (this.regexp || this.regexp === false)
|
|
1703
|
+
return this.regexp;
|
|
1704
|
+
const set = this.set;
|
|
1705
|
+
if (!set.length) {
|
|
1706
|
+
this.regexp = false;
|
|
1707
|
+
return this.regexp;
|
|
1708
|
+
}
|
|
1709
|
+
const options = this.options;
|
|
1710
|
+
const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
|
|
1711
|
+
const flags = new Set(options.nocase ? ["i"] : []);
|
|
1712
|
+
let re = set.map((pattern) => {
|
|
1713
|
+
const pp = pattern.map((p) => {
|
|
1714
|
+
if (p instanceof RegExp) {
|
|
1715
|
+
for (const f of p.flags.split(""))
|
|
1716
|
+
flags.add(f);
|
|
1717
|
+
}
|
|
1718
|
+
return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
|
|
1719
|
+
});
|
|
1720
|
+
pp.forEach((p, i2) => {
|
|
1721
|
+
const next = pp[i2 + 1];
|
|
1722
|
+
const prev = pp[i2 - 1];
|
|
1723
|
+
if (p !== GLOBSTAR || prev === GLOBSTAR) {
|
|
1724
|
+
return;
|
|
1725
|
+
}
|
|
1726
|
+
if (prev === void 0) {
|
|
1727
|
+
if (next !== void 0 && next !== GLOBSTAR) {
|
|
1728
|
+
pp[i2 + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
|
|
1729
|
+
} else {
|
|
1730
|
+
pp[i2] = twoStar;
|
|
1731
|
+
}
|
|
1732
|
+
} else if (next === void 0) {
|
|
1733
|
+
pp[i2 - 1] = prev + "(?:\\/|" + twoStar + ")?";
|
|
1734
|
+
} else if (next !== GLOBSTAR) {
|
|
1735
|
+
pp[i2 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
|
|
1736
|
+
pp[i2 + 1] = GLOBSTAR;
|
|
1737
|
+
}
|
|
1738
|
+
});
|
|
1739
|
+
return pp.filter((p) => p !== GLOBSTAR).join("/");
|
|
1740
|
+
}).join("|");
|
|
1741
|
+
const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
1742
|
+
re = "^" + open + re + close + "$";
|
|
1743
|
+
if (this.negate)
|
|
1744
|
+
re = "^(?!" + re + ").+$";
|
|
1745
|
+
try {
|
|
1746
|
+
this.regexp = new RegExp(re, [...flags].join(""));
|
|
1747
|
+
} catch (ex) {
|
|
1748
|
+
this.regexp = false;
|
|
1749
|
+
}
|
|
1750
|
+
return this.regexp;
|
|
1751
|
+
}
|
|
1752
|
+
slashSplit(p) {
|
|
1753
|
+
if (this.preserveMultipleSlashes) {
|
|
1754
|
+
return p.split("/");
|
|
1755
|
+
} else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
|
|
1756
|
+
return ["", ...p.split(/\/+/)];
|
|
1757
|
+
} else {
|
|
1758
|
+
return p.split(/\/+/);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
match(f, partial = this.partial) {
|
|
1762
|
+
this.debug("match", f, this.pattern);
|
|
1763
|
+
if (this.comment) {
|
|
1764
|
+
return false;
|
|
1765
|
+
}
|
|
1766
|
+
if (this.empty) {
|
|
1767
|
+
return f === "";
|
|
1768
|
+
}
|
|
1769
|
+
if (f === "/" && partial) {
|
|
1770
|
+
return true;
|
|
1771
|
+
}
|
|
1772
|
+
const options = this.options;
|
|
1773
|
+
if (this.isWindows) {
|
|
1774
|
+
f = f.split("\\").join("/");
|
|
1775
|
+
}
|
|
1776
|
+
const ff = this.slashSplit(f);
|
|
1777
|
+
this.debug(this.pattern, "split", ff);
|
|
1778
|
+
const set = this.set;
|
|
1779
|
+
this.debug(this.pattern, "set", set);
|
|
1780
|
+
let filename = ff[ff.length - 1];
|
|
1781
|
+
if (!filename) {
|
|
1782
|
+
for (let i2 = ff.length - 2; !filename && i2 >= 0; i2--) {
|
|
1783
|
+
filename = ff[i2];
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
for (let i2 = 0; i2 < set.length; i2++) {
|
|
1787
|
+
const pattern = set[i2];
|
|
1788
|
+
let file = ff;
|
|
1789
|
+
if (options.matchBase && pattern.length === 1) {
|
|
1790
|
+
file = [filename];
|
|
1791
|
+
}
|
|
1792
|
+
const hit = this.matchOne(file, pattern, partial);
|
|
1793
|
+
if (hit) {
|
|
1794
|
+
if (options.flipNegate) {
|
|
1795
|
+
return true;
|
|
1796
|
+
}
|
|
1797
|
+
return !this.negate;
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
if (options.flipNegate) {
|
|
1801
|
+
return false;
|
|
1802
|
+
}
|
|
1803
|
+
return this.negate;
|
|
1804
|
+
}
|
|
1805
|
+
static defaults(def) {
|
|
1806
|
+
return minimatch.defaults(def).Minimatch;
|
|
1807
|
+
}
|
|
1808
|
+
};
|
|
1809
|
+
minimatch.AST = AST;
|
|
1810
|
+
minimatch.Minimatch = Minimatch;
|
|
1811
|
+
minimatch.escape = escape;
|
|
1812
|
+
minimatch.unescape = unescape;
|
|
1813
|
+
|
|
1814
|
+
// src/utils/query-nonce-meta-tag-content.ts
|
|
1815
|
+
function queryNonceMetaTagContent(doc) {
|
|
1816
|
+
var _a, _b, _c;
|
|
1817
|
+
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
// src/utils/regular-expression.ts
|
|
1821
|
+
var escapeRegExpSpecialCharacters = (text) => {
|
|
1822
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1823
|
+
};
|
|
1824
|
+
|
|
1825
|
+
// src/utils/remote-value.ts
|
|
1826
|
+
var RemoteValue = class _RemoteValue {
|
|
1827
|
+
/**
|
|
1828
|
+
* Deserializes a LocalValue serialized object back to its original JavaScript representation
|
|
1829
|
+
*
|
|
1830
|
+
* @param serialized The serialized LocalValue object
|
|
1831
|
+
* @returns The original JavaScript value/object
|
|
1832
|
+
*/
|
|
1833
|
+
static fromLocalValue(serialized) {
|
|
1834
|
+
const type = serialized[TYPE_CONSTANT];
|
|
1835
|
+
const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
1836
|
+
switch (type) {
|
|
1837
|
+
case "string" /* String */:
|
|
1838
|
+
return value;
|
|
1839
|
+
case "boolean" /* Boolean */:
|
|
1840
|
+
return value;
|
|
1841
|
+
case "bigint" /* BigInt */:
|
|
1842
|
+
return BigInt(value);
|
|
1843
|
+
case "undefined" /* Undefined */:
|
|
1844
|
+
return void 0;
|
|
1845
|
+
case "null" /* Null */:
|
|
1846
|
+
return null;
|
|
1847
|
+
case "number" /* Number */:
|
|
1848
|
+
if (value === "NaN") return NaN;
|
|
1849
|
+
if (value === "-0") return -0;
|
|
1850
|
+
if (value === "Infinity") return Infinity;
|
|
1851
|
+
if (value === "-Infinity") return -Infinity;
|
|
1852
|
+
return value;
|
|
1853
|
+
case "array" /* Array */:
|
|
1854
|
+
return value.map((item) => _RemoteValue.fromLocalValue(item));
|
|
1855
|
+
case "date" /* Date */:
|
|
1856
|
+
return new Date(value);
|
|
1857
|
+
case "map" /* Map */:
|
|
1858
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
1859
|
+
for (const [key, val] of value) {
|
|
1860
|
+
const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
|
|
1861
|
+
const deserializedValue = _RemoteValue.fromLocalValue(val);
|
|
1862
|
+
map2.set(deserializedKey, deserializedValue);
|
|
1863
|
+
}
|
|
1864
|
+
return map2;
|
|
1865
|
+
case "object" /* Object */:
|
|
1866
|
+
const obj = {};
|
|
1867
|
+
for (const [key, val] of value) {
|
|
1868
|
+
obj[key] = _RemoteValue.fromLocalValue(val);
|
|
1869
|
+
}
|
|
1870
|
+
return obj;
|
|
1871
|
+
case "regexp" /* RegularExpression */:
|
|
1872
|
+
const { pattern, flags } = value;
|
|
1873
|
+
return new RegExp(pattern, flags);
|
|
1874
|
+
case "set" /* Set */:
|
|
1875
|
+
const set = /* @__PURE__ */ new Set();
|
|
1876
|
+
for (const item of value) {
|
|
1877
|
+
set.add(_RemoteValue.fromLocalValue(item));
|
|
1878
|
+
}
|
|
1879
|
+
return set;
|
|
1880
|
+
case "symbol" /* Symbol */:
|
|
1881
|
+
return Symbol(value);
|
|
1882
|
+
default:
|
|
1883
|
+
throw new Error(`Unsupported type: ${type}`);
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
/**
|
|
1887
|
+
* Utility method to deserialize multiple LocalValues at once
|
|
1888
|
+
*
|
|
1889
|
+
* @param serializedValues Array of serialized LocalValue objects
|
|
1890
|
+
* @returns Array of deserialized JavaScript values
|
|
1891
|
+
*/
|
|
1892
|
+
static fromLocalValueArray(serializedValues) {
|
|
1893
|
+
return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
|
|
1894
|
+
}
|
|
1895
|
+
/**
|
|
1896
|
+
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
1897
|
+
*
|
|
1898
|
+
* @param obj Object to verify
|
|
1899
|
+
* @returns boolean indicating if the object has LocalValue structure
|
|
1900
|
+
*/
|
|
1901
|
+
static isLocalValueObject(obj) {
|
|
1902
|
+
if (typeof obj !== "object" || obj === null) {
|
|
1903
|
+
return false;
|
|
1904
|
+
}
|
|
1905
|
+
if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
|
|
1906
|
+
return false;
|
|
1907
|
+
}
|
|
1908
|
+
const type = obj[TYPE_CONSTANT];
|
|
1909
|
+
const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
|
|
1910
|
+
if (!hasTypeProperty) {
|
|
1911
|
+
return false;
|
|
1912
|
+
}
|
|
1913
|
+
if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
|
|
1914
|
+
return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
1915
|
+
}
|
|
1916
|
+
return true;
|
|
1917
|
+
}
|
|
1918
|
+
};
|
|
1919
|
+
|
|
1920
|
+
// src/utils/result.ts
|
|
1921
|
+
var result_exports = {};
|
|
1922
|
+
__export(result_exports, {
|
|
1923
|
+
err: () => err,
|
|
1924
|
+
map: () => map,
|
|
1925
|
+
ok: () => ok,
|
|
1926
|
+
unwrap: () => unwrap,
|
|
1927
|
+
unwrapErr: () => unwrapErr
|
|
1928
|
+
});
|
|
1929
|
+
var ok = (value) => ({
|
|
1930
|
+
isOk: true,
|
|
1931
|
+
isErr: false,
|
|
1932
|
+
value
|
|
1933
|
+
});
|
|
1934
|
+
var err = (value) => ({
|
|
1935
|
+
isOk: false,
|
|
1936
|
+
isErr: true,
|
|
1937
|
+
value
|
|
1938
|
+
});
|
|
1939
|
+
function map(result, fn) {
|
|
1940
|
+
if (result.isOk) {
|
|
1941
|
+
const val = fn(result.value);
|
|
1942
|
+
if (val instanceof Promise) {
|
|
1943
|
+
return val.then((newVal) => ok(newVal));
|
|
1944
|
+
} else {
|
|
1945
|
+
return ok(val);
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
if (result.isErr) {
|
|
1949
|
+
const value = result.value;
|
|
1950
|
+
return err(value);
|
|
1951
|
+
}
|
|
1952
|
+
throw "should never get here";
|
|
1953
|
+
}
|
|
1954
|
+
var unwrap = (result) => {
|
|
1955
|
+
if (result.isOk) {
|
|
1956
|
+
return result.value;
|
|
1957
|
+
} else {
|
|
1958
|
+
throw result.value;
|
|
1959
|
+
}
|
|
1960
|
+
};
|
|
1961
|
+
var unwrapErr = (result) => {
|
|
1962
|
+
if (result.isErr) {
|
|
1963
|
+
return result.value;
|
|
1964
|
+
} else {
|
|
1965
|
+
throw result.value;
|
|
1966
|
+
}
|
|
1967
|
+
};
|
|
1968
|
+
|
|
1969
|
+
// src/utils/serialize.ts
|
|
1970
|
+
function deserializeProperty(value) {
|
|
1971
|
+
if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
|
|
1972
|
+
return value;
|
|
1973
|
+
}
|
|
1974
|
+
return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
|
|
1975
|
+
}
|
|
211
1976
|
|
|
212
1977
|
// src/utils/style.ts
|
|
213
1978
|
function createStyleSheetIfNeededAndSupported(styles2) {
|
|
@@ -319,14 +2084,6 @@ var uniqueTime = (key, measureText) => {
|
|
|
319
2084
|
};
|
|
320
2085
|
}
|
|
321
2086
|
};
|
|
322
|
-
|
|
323
|
-
// src/utils/query-nonce-meta-tag-content.ts
|
|
324
|
-
function queryNonceMetaTagContent(doc) {
|
|
325
|
-
var _a, _b, _c;
|
|
326
|
-
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
// src/runtime/styles.ts
|
|
330
2087
|
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
331
2088
|
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
332
2089
|
let style = styles.get(scopeId2);
|
|
@@ -360,10 +2117,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
360
2117
|
}
|
|
361
2118
|
const existingStyleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
|
|
362
2119
|
if (existingStyleElm) {
|
|
363
|
-
existingStyleElm.
|
|
2120
|
+
existingStyleElm.innerHTML = style;
|
|
364
2121
|
} else if (!appliedStyles.has(scopeId2)) {
|
|
365
2122
|
styleElm = win.document.createElement("style");
|
|
366
|
-
styleElm.
|
|
2123
|
+
styleElm.innerHTML = style;
|
|
367
2124
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
368
2125
|
if (nonce != null) {
|
|
369
2126
|
styleElm.setAttribute("nonce", nonce);
|
|
@@ -389,7 +2146,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
389
2146
|
} else {
|
|
390
2147
|
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
391
2148
|
if (existingStyleContainer) {
|
|
392
|
-
existingStyleContainer.
|
|
2149
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
393
2150
|
} else {
|
|
394
2151
|
styleContainerNode.prepend(styleElm);
|
|
395
2152
|
}
|
|
@@ -402,7 +2159,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
402
2159
|
styleContainerNode.insertBefore(styleElm, null);
|
|
403
2160
|
}
|
|
404
2161
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
405
|
-
styleElm.
|
|
2162
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
406
2163
|
}
|
|
407
2164
|
if (appliedStyles) {
|
|
408
2165
|
appliedStyles.add(scopeId2);
|
|
@@ -430,12 +2187,6 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
430
2187
|
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
|
|
431
2188
|
}
|
|
432
2189
|
appliedStyles.add(scopeId2);
|
|
433
|
-
if ("host" in styleContainerNode) {
|
|
434
|
-
const ssrStyleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
|
|
435
|
-
if (ssrStyleElm) {
|
|
436
|
-
writeTask(() => ssrStyleElm.remove());
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
2190
|
}
|
|
440
2191
|
}
|
|
441
2192
|
}
|
|
@@ -467,12 +2218,6 @@ var hydrateScopedToShadow = () => {
|
|
|
467
2218
|
registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
|
|
468
2219
|
}
|
|
469
2220
|
};
|
|
470
|
-
var isComplexType = (o) => {
|
|
471
|
-
o = typeof o;
|
|
472
|
-
return o === "object" || o === "function";
|
|
473
|
-
};
|
|
474
|
-
|
|
475
|
-
// src/runtime/vdom/h.ts
|
|
476
2221
|
var h = (nodeName, vnodeData, ...children) => {
|
|
477
2222
|
if (typeof nodeName === "string") {
|
|
478
2223
|
nodeName = transformTag(nodeName);
|
|
@@ -526,8 +2271,7 @@ var newVNode = (tag, text) => {
|
|
|
526
2271
|
const vnode = {
|
|
527
2272
|
$flags$: 0,
|
|
528
2273
|
$tag$: tag,
|
|
529
|
-
|
|
530
|
-
$text$: text != null ? text : null,
|
|
2274
|
+
$text$: text,
|
|
531
2275
|
$elm$: null,
|
|
532
2276
|
$children$: null
|
|
533
2277
|
};
|
|
@@ -588,7 +2332,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
588
2332
|
cmpMeta.$cmpMeta$);
|
|
589
2333
|
const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
|
|
590
2334
|
if (styleSheet) {
|
|
591
|
-
|
|
2335
|
+
hostElm.shadowRoot.append(styleSheet.cloneNode(true));
|
|
592
2336
|
}
|
|
593
2337
|
}
|
|
594
2338
|
}
|
|
@@ -658,7 +2402,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
658
2402
|
currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
|
|
659
2403
|
}
|
|
660
2404
|
}
|
|
661
|
-
if (shadowRoot
|
|
2405
|
+
if (shadowRoot) {
|
|
662
2406
|
let rnIdex = 0;
|
|
663
2407
|
const rnLen = shadowRootNodes.length;
|
|
664
2408
|
if (rnLen) {
|
|
@@ -929,111 +2673,18 @@ var findCorrespondingNode = (node, type) => {
|
|
|
929
2673
|
} while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
|
|
930
2674
|
return sibling;
|
|
931
2675
|
};
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
*/
|
|
941
|
-
static fromLocalValue(serialized) {
|
|
942
|
-
const type = serialized[TYPE_CONSTANT];
|
|
943
|
-
const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
944
|
-
switch (type) {
|
|
945
|
-
case "string" /* String */:
|
|
946
|
-
return value;
|
|
947
|
-
case "boolean" /* Boolean */:
|
|
948
|
-
return value;
|
|
949
|
-
case "bigint" /* BigInt */:
|
|
950
|
-
return BigInt(value);
|
|
951
|
-
case "undefined" /* Undefined */:
|
|
952
|
-
return void 0;
|
|
953
|
-
case "null" /* Null */:
|
|
954
|
-
return null;
|
|
955
|
-
case "number" /* Number */:
|
|
956
|
-
if (value === "NaN") return NaN;
|
|
957
|
-
if (value === "-0") return -0;
|
|
958
|
-
if (value === "Infinity") return Infinity;
|
|
959
|
-
if (value === "-Infinity") return -Infinity;
|
|
960
|
-
return value;
|
|
961
|
-
case "array" /* Array */:
|
|
962
|
-
return value.map((item) => _RemoteValue.fromLocalValue(item));
|
|
963
|
-
case "date" /* Date */:
|
|
964
|
-
return new Date(value);
|
|
965
|
-
case "map" /* Map */:
|
|
966
|
-
const map = /* @__PURE__ */ new Map();
|
|
967
|
-
for (const [key, val] of value) {
|
|
968
|
-
const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
|
|
969
|
-
const deserializedValue = _RemoteValue.fromLocalValue(val);
|
|
970
|
-
map.set(deserializedKey, deserializedValue);
|
|
971
|
-
}
|
|
972
|
-
return map;
|
|
973
|
-
case "object" /* Object */:
|
|
974
|
-
const obj = {};
|
|
975
|
-
for (const [key, val] of value) {
|
|
976
|
-
obj[key] = _RemoteValue.fromLocalValue(val);
|
|
977
|
-
}
|
|
978
|
-
return obj;
|
|
979
|
-
case "regexp" /* RegularExpression */:
|
|
980
|
-
const { pattern, flags } = value;
|
|
981
|
-
return new RegExp(pattern, flags);
|
|
982
|
-
case "set" /* Set */:
|
|
983
|
-
const set = /* @__PURE__ */ new Set();
|
|
984
|
-
for (const item of value) {
|
|
985
|
-
set.add(_RemoteValue.fromLocalValue(item));
|
|
986
|
-
}
|
|
987
|
-
return set;
|
|
988
|
-
case "symbol" /* Symbol */:
|
|
989
|
-
return Symbol(value);
|
|
990
|
-
default:
|
|
991
|
-
throw new Error(`Unsupported type: ${type}`);
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
/**
|
|
995
|
-
* Utility method to deserialize multiple LocalValues at once
|
|
996
|
-
*
|
|
997
|
-
* @param serializedValues Array of serialized LocalValue objects
|
|
998
|
-
* @returns Array of deserialized JavaScript values
|
|
999
|
-
*/
|
|
1000
|
-
static fromLocalValueArray(serializedValues) {
|
|
1001
|
-
return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
|
|
1002
|
-
}
|
|
1003
|
-
/**
|
|
1004
|
-
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
1005
|
-
*
|
|
1006
|
-
* @param obj Object to verify
|
|
1007
|
-
* @returns boolean indicating if the object has LocalValue structure
|
|
1008
|
-
*/
|
|
1009
|
-
static isLocalValueObject(obj) {
|
|
1010
|
-
if (typeof obj !== "object" || obj === null) {
|
|
1011
|
-
return false;
|
|
1012
|
-
}
|
|
1013
|
-
if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
|
|
1014
|
-
return false;
|
|
1015
|
-
}
|
|
1016
|
-
const type = obj[TYPE_CONSTANT];
|
|
1017
|
-
const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
|
|
1018
|
-
if (!hasTypeProperty) {
|
|
1019
|
-
return false;
|
|
1020
|
-
}
|
|
1021
|
-
if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
|
|
1022
|
-
return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
1023
|
-
}
|
|
1024
|
-
return true;
|
|
1025
|
-
}
|
|
2676
|
+
var createSupportsRuleRe = (selector) => {
|
|
2677
|
+
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
2678
|
+
return new RegExp(
|
|
2679
|
+
// First capture group: match any context before the selector that's not inside @supports selector()
|
|
2680
|
+
// Using negative lookahead to avoid matching inside @supports selector(...) condition
|
|
2681
|
+
`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
|
|
2682
|
+
"g"
|
|
2683
|
+
);
|
|
1026
2684
|
};
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
|
|
1031
|
-
return value;
|
|
1032
|
-
}
|
|
1033
|
-
return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
// src/runtime/parse-property-value.ts
|
|
2685
|
+
createSupportsRuleRe("::slotted");
|
|
2686
|
+
createSupportsRuleRe(":host");
|
|
2687
|
+
createSupportsRuleRe(":host-context");
|
|
1037
2688
|
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
1038
2689
|
if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
|
|
1039
2690
|
propValue = deserializeProperty(propValue);
|
|
@@ -1116,23 +2767,6 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
1116
2767
|
plt.ael(elm, memberName, newValue, capture);
|
|
1117
2768
|
}
|
|
1118
2769
|
}
|
|
1119
|
-
} else if (memberName[0] === "a" && memberName.startsWith("attr:")) {
|
|
1120
|
-
const attrName = memberName.slice(5);
|
|
1121
|
-
if (newValue == null || newValue === false) {
|
|
1122
|
-
if (newValue !== false || elm.getAttribute(attrName) === "") {
|
|
1123
|
-
elm.removeAttribute(attrName);
|
|
1124
|
-
}
|
|
1125
|
-
} else {
|
|
1126
|
-
elm.setAttribute(attrName, newValue === true ? "" : newValue);
|
|
1127
|
-
}
|
|
1128
|
-
return;
|
|
1129
|
-
} else if (memberName[0] === "p" && memberName.startsWith("prop:")) {
|
|
1130
|
-
const propName = memberName.slice(5);
|
|
1131
|
-
try {
|
|
1132
|
-
elm[propName] = newValue;
|
|
1133
|
-
} catch (e) {
|
|
1134
|
-
}
|
|
1135
|
-
return;
|
|
1136
2770
|
} else {
|
|
1137
2771
|
const isComplex = isComplexType(newValue);
|
|
1138
2772
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
@@ -1141,7 +2775,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
1141
2775
|
const n = newValue == null ? "" : newValue;
|
|
1142
2776
|
if (memberName === "list") {
|
|
1143
2777
|
isProp = false;
|
|
1144
|
-
} else if (oldValue == null || elm[memberName]
|
|
2778
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
|
1145
2779
|
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
1146
2780
|
elm[memberName] = n;
|
|
1147
2781
|
} else {
|
|
@@ -1229,14 +2863,16 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1229
2863
|
let i2 = 0;
|
|
1230
2864
|
let elm;
|
|
1231
2865
|
let childNode;
|
|
1232
|
-
if (newVNode2.$text$
|
|
2866
|
+
if (newVNode2.$text$ !== null) {
|
|
1233
2867
|
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
1234
2868
|
} else {
|
|
1235
2869
|
if (!isSvgMode) {
|
|
1236
2870
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
1237
2871
|
}
|
|
1238
2872
|
if (!win.document) {
|
|
1239
|
-
throw new Error(
|
|
2873
|
+
throw new Error(
|
|
2874
|
+
"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
|
|
2875
|
+
);
|
|
1240
2876
|
}
|
|
1241
2877
|
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
1242
2878
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
@@ -1401,7 +3037,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1401
3037
|
const newChildren = newVNode2.$children$;
|
|
1402
3038
|
const tag = newVNode2.$tag$;
|
|
1403
3039
|
const text = newVNode2.$text$;
|
|
1404
|
-
if (text
|
|
3040
|
+
if (text === null) {
|
|
1405
3041
|
{
|
|
1406
3042
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1407
3043
|
}
|
|
@@ -1430,10 +3066,8 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1430
3066
|
elm.data = text;
|
|
1431
3067
|
}
|
|
1432
3068
|
};
|
|
1433
|
-
var insertBefore = (parent, newNode, reference
|
|
1434
|
-
|
|
1435
|
-
return parent.__insertBefore(newNode, reference);
|
|
1436
|
-
} else {
|
|
3069
|
+
var insertBefore = (parent, newNode, reference) => {
|
|
3070
|
+
{
|
|
1437
3071
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1438
3072
|
}
|
|
1439
3073
|
};
|
|
@@ -1512,8 +3146,8 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1512
3146
|
endSchedule();
|
|
1513
3147
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1514
3148
|
};
|
|
1515
|
-
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((
|
|
1516
|
-
console.error(
|
|
3149
|
+
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
|
|
3150
|
+
console.error(err2);
|
|
1517
3151
|
fn();
|
|
1518
3152
|
}) : fn();
|
|
1519
3153
|
var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
|
|
@@ -1871,9 +3505,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1871
3505
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1872
3506
|
}
|
|
1873
3507
|
endNewInstance();
|
|
1874
|
-
|
|
1875
|
-
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1876
|
-
}
|
|
3508
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1877
3509
|
} else {
|
|
1878
3510
|
Cstr = elm.constructor;
|
|
1879
3511
|
const cmpTag = elm.localName;
|
|
@@ -2006,6 +3638,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2006
3638
|
{
|
|
2007
3639
|
hydrateScopedToShadow();
|
|
2008
3640
|
}
|
|
3641
|
+
let hasSlotRelocation = false;
|
|
2009
3642
|
lazyBundles.map((lazyBundle) => {
|
|
2010
3643
|
lazyBundle[1].map((compactMeta) => {
|
|
2011
3644
|
var _a2, _b, _c;
|
|
@@ -2015,6 +3648,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2015
3648
|
$members$: compactMeta[2],
|
|
2016
3649
|
$listeners$: compactMeta[3]
|
|
2017
3650
|
};
|
|
3651
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
3652
|
+
hasSlotRelocation = true;
|
|
3653
|
+
}
|
|
2018
3654
|
{
|
|
2019
3655
|
cmpMeta.$members$ = compactMeta[2];
|
|
2020
3656
|
}
|
|
@@ -2025,12 +3661,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2025
3661
|
}
|
|
2026
3662
|
const tagName = transformTag(cmpMeta.$tagName$);
|
|
2027
3663
|
const HostElement = class extends HTMLElement {
|
|
2028
|
-
["s-p"];
|
|
2029
|
-
["s-rc"];
|
|
2030
|
-
hasRegisteredEventListeners = false;
|
|
2031
3664
|
// StencilLazyHost
|
|
2032
3665
|
constructor(self) {
|
|
2033
3666
|
super(self);
|
|
3667
|
+
this.hasRegisteredEventListeners = false;
|
|
2034
3668
|
self = this;
|
|
2035
3669
|
registerHost(self, cmpMeta);
|
|
2036
3670
|
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
@@ -2098,6 +3732,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2098
3732
|
});
|
|
2099
3733
|
});
|
|
2100
3734
|
if (cmpTags.length > 0) {
|
|
3735
|
+
if (hasSlotRelocation) {
|
|
3736
|
+
dataStyles.textContent += SLOT_FB_CSS;
|
|
3737
|
+
}
|
|
2101
3738
|
{
|
|
2102
3739
|
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
2103
3740
|
}
|