@stencil/core 4.43.2 → 4.43.3
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/cli/index.cjs +379 -154
- package/cli/index.js +379 -154
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +2276 -2065
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +346 -137
- package/internal/app-data/package.json +1 -1
- package/internal/app-globals/package.json +1 -1
- package/internal/client/index.js +1 -1
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +423 -214
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +396 -189
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +1 -1
- package/internal/stencil-public-compiler.d.ts +61 -6
- package/internal/testing/index.js +410 -201
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +2 -4
- package/mock-doc/index.d.ts +1 -1
- package/mock-doc/index.js +2 -4
- package/mock-doc/package.json +1 -1
- package/package.json +2 -2
- package/screenshot/index.js +341 -132
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/glob.js +1 -1
- package/sys/node/index.js +44 -46
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +420 -211
- package/testing/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Hydrate Runner v4.43.
|
|
2
|
+
Stencil Hydrate Runner v4.43.3 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -1330,11 +1330,11 @@ var fromCodePoint = (
|
|
|
1330
1330
|
}
|
|
1331
1331
|
);
|
|
1332
1332
|
function replaceCodePoint(codePoint) {
|
|
1333
|
-
var
|
|
1333
|
+
var _a3;
|
|
1334
1334
|
if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {
|
|
1335
1335
|
return 65533;
|
|
1336
1336
|
}
|
|
1337
|
-
return (
|
|
1337
|
+
return (_a3 = decodeMap.get(codePoint)) !== null && _a3 !== void 0 ? _a3 : codePoint;
|
|
1338
1338
|
}
|
|
1339
1339
|
|
|
1340
1340
|
// node_modules/entities/lib/esm/decode.js
|
|
@@ -1531,9 +1531,9 @@ var EntityDecoder = class {
|
|
|
1531
1531
|
* @returns The number of characters that were consumed.
|
|
1532
1532
|
*/
|
|
1533
1533
|
emitNumericEntity(lastCp, expectedLength) {
|
|
1534
|
-
var
|
|
1534
|
+
var _a3;
|
|
1535
1535
|
if (this.consumed <= expectedLength) {
|
|
1536
|
-
(
|
|
1536
|
+
(_a3 = this.errors) === null || _a3 === void 0 ? void 0 : _a3.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
|
1537
1537
|
return 0;
|
|
1538
1538
|
}
|
|
1539
1539
|
if (lastCp === CharCodes.SEMI) {
|
|
@@ -1593,11 +1593,11 @@ var EntityDecoder = class {
|
|
|
1593
1593
|
* @returns The number of characters consumed.
|
|
1594
1594
|
*/
|
|
1595
1595
|
emitNotTerminatedNamedEntity() {
|
|
1596
|
-
var
|
|
1596
|
+
var _a3;
|
|
1597
1597
|
const { result, decodeTree } = this;
|
|
1598
1598
|
const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
|
|
1599
1599
|
this.emitNamedEntityData(result, valueLength, this.consumed);
|
|
1600
|
-
(
|
|
1600
|
+
(_a3 = this.errors) === null || _a3 === void 0 ? void 0 : _a3.missingSemicolonAfterCharacterReference();
|
|
1601
1601
|
return this.consumed;
|
|
1602
1602
|
}
|
|
1603
1603
|
/**
|
|
@@ -1625,7 +1625,7 @@ var EntityDecoder = class {
|
|
|
1625
1625
|
* @returns The number of characters consumed.
|
|
1626
1626
|
*/
|
|
1627
1627
|
end() {
|
|
1628
|
-
var
|
|
1628
|
+
var _a3;
|
|
1629
1629
|
switch (this.state) {
|
|
1630
1630
|
case EntityDecoderState.NamedEntity: {
|
|
1631
1631
|
return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
|
|
@@ -1638,7 +1638,7 @@ var EntityDecoder = class {
|
|
|
1638
1638
|
return this.emitNumericEntity(0, 3);
|
|
1639
1639
|
}
|
|
1640
1640
|
case EntityDecoderState.NumericStart: {
|
|
1641
|
-
(
|
|
1641
|
+
(_a3 = this.errors) === null || _a3 === void 0 ? void 0 : _a3.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
|
1642
1642
|
return 0;
|
|
1643
1643
|
}
|
|
1644
1644
|
case EntityDecoderState.EntityStart: {
|
|
@@ -2119,8 +2119,8 @@ var TAG_NAME_TO_ID = /* @__PURE__ */ new Map([
|
|
|
2119
2119
|
[TAG_NAMES.XMP, TAG_ID.XMP]
|
|
2120
2120
|
]);
|
|
2121
2121
|
function getTagID(tagName) {
|
|
2122
|
-
var
|
|
2123
|
-
return (
|
|
2122
|
+
var _a3;
|
|
2123
|
+
return (_a3 = TAG_NAME_TO_ID.get(tagName)) !== null && _a3 !== void 0 ? _a3 : TAG_ID.UNKNOWN;
|
|
2124
2124
|
}
|
|
2125
2125
|
var $ = TAG_ID;
|
|
2126
2126
|
var SPECIAL_ELEMENTS = {
|
|
@@ -2387,8 +2387,8 @@ var Tokenizer = class {
|
|
|
2387
2387
|
}
|
|
2388
2388
|
//Errors
|
|
2389
2389
|
_err(code, cpOffset = 0) {
|
|
2390
|
-
var
|
|
2391
|
-
(_b = (
|
|
2390
|
+
var _a3, _b;
|
|
2391
|
+
(_b = (_a3 = this.handler).onParseError) === null || _b === void 0 ? void 0 : _b.call(_a3, this.preprocessor.getError(code, cpOffset));
|
|
2392
2392
|
}
|
|
2393
2393
|
// NOTE: `offset` may never run across line boundaries.
|
|
2394
2394
|
getCurrentLocation(offset) {
|
|
@@ -2530,13 +2530,13 @@ var Tokenizer = class {
|
|
|
2530
2530
|
this.currentLocation = this.getCurrentLocation(0);
|
|
2531
2531
|
}
|
|
2532
2532
|
_leaveAttrName() {
|
|
2533
|
-
var
|
|
2533
|
+
var _a3;
|
|
2534
2534
|
var _b;
|
|
2535
2535
|
const token = this.currentToken;
|
|
2536
2536
|
if (getTokenAttr(token, this.currentAttr.name) === null) {
|
|
2537
2537
|
token.attrs.push(this.currentAttr);
|
|
2538
2538
|
if (token.location && this.currentLocation) {
|
|
2539
|
-
const attrLocations = (
|
|
2539
|
+
const attrLocations = (_a3 = (_b = token.location).attrs) !== null && _a3 !== void 0 ? _a3 : _b.attrs = /* @__PURE__ */ Object.create(null);
|
|
2540
2540
|
attrLocations[this.currentAttr.name] = this.currentLocation;
|
|
2541
2541
|
this._leaveAttrValue();
|
|
2542
2542
|
}
|
|
@@ -5884,10 +5884,10 @@ var Parser = class {
|
|
|
5884
5884
|
//Errors
|
|
5885
5885
|
/** @internal */
|
|
5886
5886
|
_err(token, code, beforeToken) {
|
|
5887
|
-
var
|
|
5887
|
+
var _a3;
|
|
5888
5888
|
if (!this.onParseError)
|
|
5889
5889
|
return;
|
|
5890
|
-
const loc = (
|
|
5890
|
+
const loc = (_a3 = token.location) !== null && _a3 !== void 0 ? _a3 : BASE_LOC;
|
|
5891
5891
|
const err2 = {
|
|
5892
5892
|
code,
|
|
5893
5893
|
startLine: loc.startLine,
|
|
@@ -5902,18 +5902,18 @@ var Parser = class {
|
|
|
5902
5902
|
//Stack events
|
|
5903
5903
|
/** @internal */
|
|
5904
5904
|
onItemPush(node, tid, isTop) {
|
|
5905
|
-
var
|
|
5906
|
-
(_b = (
|
|
5905
|
+
var _a3, _b;
|
|
5906
|
+
(_b = (_a3 = this.treeAdapter).onItemPush) === null || _b === void 0 ? void 0 : _b.call(_a3, node);
|
|
5907
5907
|
if (isTop && this.openElements.stackTop > 0)
|
|
5908
5908
|
this._setContextModes(node, tid);
|
|
5909
5909
|
}
|
|
5910
5910
|
/** @internal */
|
|
5911
5911
|
onItemPop(node, isTop) {
|
|
5912
|
-
var
|
|
5912
|
+
var _a3, _b;
|
|
5913
5913
|
if (this.options.sourceCodeLocationInfo) {
|
|
5914
5914
|
this._setEndLocation(node, this.currentToken);
|
|
5915
5915
|
}
|
|
5916
|
-
(_b = (
|
|
5916
|
+
(_b = (_a3 = this.treeAdapter).onItemPop) === null || _b === void 0 ? void 0 : _b.call(_a3, node, this.openElements.current);
|
|
5917
5917
|
if (isTop) {
|
|
5918
5918
|
let current;
|
|
5919
5919
|
let currentTagId;
|
|
@@ -7987,9 +7987,9 @@ function eofInBody(p, token) {
|
|
|
7987
7987
|
}
|
|
7988
7988
|
}
|
|
7989
7989
|
function endTagInText(p, token) {
|
|
7990
|
-
var
|
|
7990
|
+
var _a3;
|
|
7991
7991
|
if (token.tagID === TAG_ID.SCRIPT) {
|
|
7992
|
-
(
|
|
7992
|
+
(_a3 = p.scriptHandler) === null || _a3 === void 0 ? void 0 : _a3.call(p, p.openElements.current);
|
|
7993
7993
|
}
|
|
7994
7994
|
p.openElements.pop();
|
|
7995
7995
|
p.insertionMode = p.originalInsertionMode;
|
|
@@ -8651,7 +8651,7 @@ function startTagAfterBody(p, token) {
|
|
|
8651
8651
|
}
|
|
8652
8652
|
}
|
|
8653
8653
|
function endTagAfterBody(p, token) {
|
|
8654
|
-
var
|
|
8654
|
+
var _a3;
|
|
8655
8655
|
if (token.tagID === TAG_ID.HTML) {
|
|
8656
8656
|
if (!p.fragmentContext) {
|
|
8657
8657
|
p.insertionMode = InsertionMode.AFTER_AFTER_BODY;
|
|
@@ -8659,7 +8659,7 @@ function endTagAfterBody(p, token) {
|
|
|
8659
8659
|
if (p.options.sourceCodeLocationInfo && p.openElements.tagIDs[0] === TAG_ID.HTML) {
|
|
8660
8660
|
p._setEndLocation(p.openElements.items[0], token);
|
|
8661
8661
|
const bodyElement = p.openElements.items[1];
|
|
8662
|
-
if (bodyElement && !((
|
|
8662
|
+
if (bodyElement && !((_a3 = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a3 === void 0 ? void 0 : _a3.endTag)) {
|
|
8663
8663
|
p._setEndLocation(bodyElement, token);
|
|
8664
8664
|
}
|
|
8665
8665
|
}
|
|
@@ -10523,7 +10523,7 @@ function serializeNodeToHtml(elm, serializationOptions = {}) {
|
|
|
10523
10523
|
}
|
|
10524
10524
|
var shadowRootTag = "mock:shadow-root";
|
|
10525
10525
|
function* streamToHtml(node, opts, output) {
|
|
10526
|
-
var
|
|
10526
|
+
var _a3, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
10527
10527
|
const isShadowRoot = node.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */;
|
|
10528
10528
|
if (node.nodeType === 1 /* ELEMENT_NODE */ || isShadowRoot) {
|
|
10529
10529
|
const tagName = isShadowRoot ? shadowRootTag : getTagName(node);
|
|
@@ -10532,7 +10532,7 @@ function* streamToHtml(node, opts, output) {
|
|
|
10532
10532
|
}
|
|
10533
10533
|
const ignoreTag = opts.excludeTags != null && opts.excludeTags.includes(tagName);
|
|
10534
10534
|
if (ignoreTag === false) {
|
|
10535
|
-
const isWithinWhitespaceSensitiveNode = opts.newLines || ((
|
|
10535
|
+
const isWithinWhitespaceSensitiveNode = opts.newLines || ((_a3 = opts.indentSpaces) != null ? _a3 : 0) > 0 ? isWithinWhitespaceSensitive(node) : false;
|
|
10536
10536
|
if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
|
|
10537
10537
|
yield "\n";
|
|
10538
10538
|
output.currentLineWidth = 0;
|
|
@@ -11051,9 +11051,7 @@ var MockNode2 = class {
|
|
|
11051
11051
|
const firstChild = this.firstChild;
|
|
11052
11052
|
items.forEach((item) => {
|
|
11053
11053
|
const isNode = typeof item === "object" && item !== null && "nodeType" in item;
|
|
11054
|
-
|
|
11055
|
-
this.insertBefore(isNode ? item : this.ownerDocument.createTextNode(String(item)), firstChild);
|
|
11056
|
-
}
|
|
11054
|
+
this.insertBefore(isNode ? item : this.ownerDocument.createTextNode(String(item)), firstChild);
|
|
11057
11055
|
});
|
|
11058
11056
|
}
|
|
11059
11057
|
cloneNode(deep) {
|
|
@@ -11102,8 +11100,8 @@ var MockNode2 = class {
|
|
|
11102
11100
|
return null;
|
|
11103
11101
|
}
|
|
11104
11102
|
get nodeValue() {
|
|
11105
|
-
var
|
|
11106
|
-
return (
|
|
11103
|
+
var _a3;
|
|
11104
|
+
return (_a3 = this._nodeValue) != null ? _a3 : "";
|
|
11107
11105
|
}
|
|
11108
11106
|
set nodeValue(value) {
|
|
11109
11107
|
this._nodeValue = value;
|
|
@@ -11163,8 +11161,8 @@ var MockNode2 = class {
|
|
|
11163
11161
|
return null;
|
|
11164
11162
|
}
|
|
11165
11163
|
get textContent() {
|
|
11166
|
-
var
|
|
11167
|
-
return (
|
|
11164
|
+
var _a3;
|
|
11165
|
+
return (_a3 = this._nodeValue) != null ? _a3 : "";
|
|
11168
11166
|
}
|
|
11169
11167
|
set textContent(value) {
|
|
11170
11168
|
this._nodeValue = String(value);
|
|
@@ -11223,9 +11221,9 @@ var MockElement = class extends MockNode2 {
|
|
|
11223
11221
|
addEventListener(this, type, handler);
|
|
11224
11222
|
}
|
|
11225
11223
|
attachShadow(_opts) {
|
|
11226
|
-
var
|
|
11224
|
+
var _a3;
|
|
11227
11225
|
const shadowRoot = this.ownerDocument.createDocumentFragment();
|
|
11228
|
-
shadowRoot.delegatesFocus = (
|
|
11226
|
+
shadowRoot.delegatesFocus = (_a3 = _opts.delegatesFocus) != null ? _a3 : false;
|
|
11229
11227
|
this.shadowRoot = shadowRoot;
|
|
11230
11228
|
return shadowRoot;
|
|
11231
11229
|
}
|
|
@@ -11401,8 +11399,8 @@ var MockElement = class extends MockNode2 {
|
|
|
11401
11399
|
});
|
|
11402
11400
|
}
|
|
11403
11401
|
set innerHTML(html) {
|
|
11404
|
-
var
|
|
11405
|
-
if (NON_ESCAPABLE_CONTENT.has((
|
|
11402
|
+
var _a3;
|
|
11403
|
+
if (NON_ESCAPABLE_CONTENT.has((_a3 = this.nodeName) != null ? _a3 : "") === true) {
|
|
11406
11404
|
setTextContent(this, html);
|
|
11407
11405
|
} else {
|
|
11408
11406
|
for (let i = this.childNodes.length - 1; i >= 0; i--) {
|
|
@@ -11645,8 +11643,8 @@ var MockElement = class extends MockNode2 {
|
|
|
11645
11643
|
this.setAttributeNS(null, "tabindex", value);
|
|
11646
11644
|
}
|
|
11647
11645
|
get tagName() {
|
|
11648
|
-
var
|
|
11649
|
-
return (
|
|
11646
|
+
var _a3;
|
|
11647
|
+
return (_a3 = this.nodeName) != null ? _a3 : "";
|
|
11650
11648
|
}
|
|
11651
11649
|
set tagName(value) {
|
|
11652
11650
|
this.nodeName = value;
|
|
@@ -11868,11 +11866,11 @@ function getElementsByClassName(elm, classNames, foundElms) {
|
|
|
11868
11866
|
}
|
|
11869
11867
|
}
|
|
11870
11868
|
function getElementsByTagName(elm, tagName, foundElms) {
|
|
11871
|
-
var
|
|
11869
|
+
var _a3;
|
|
11872
11870
|
const children = elm.children;
|
|
11873
11871
|
for (let i = 0, ii = children.length; i < ii; i++) {
|
|
11874
11872
|
const childElm = children[i];
|
|
11875
|
-
if (tagName === "*" || ((
|
|
11873
|
+
if (tagName === "*" || ((_a3 = childElm.nodeName) != null ? _a3 : "").toLowerCase() === tagName) {
|
|
11876
11874
|
foundElms.push(childElm);
|
|
11877
11875
|
}
|
|
11878
11876
|
getElementsByTagName(childElm, tagName, foundElms);
|
|
@@ -11909,8 +11907,8 @@ var MockHTMLElement = class extends MockElement {
|
|
|
11909
11907
|
super(ownerDocument, typeof nodeName === "string" ? nodeName.toUpperCase() : null);
|
|
11910
11908
|
}
|
|
11911
11909
|
get tagName() {
|
|
11912
|
-
var
|
|
11913
|
-
return (
|
|
11910
|
+
var _a3;
|
|
11911
|
+
return (_a3 = this.nodeName) != null ? _a3 : "";
|
|
11914
11912
|
}
|
|
11915
11913
|
set tagName(value) {
|
|
11916
11914
|
this.nodeName = value;
|
|
@@ -12368,10 +12366,10 @@ var MockLabelElement = class extends MockHTMLElement {
|
|
|
12368
12366
|
this.setAttributeNS(null, "for", value);
|
|
12369
12367
|
}
|
|
12370
12368
|
get control() {
|
|
12371
|
-
var
|
|
12369
|
+
var _a3, _b;
|
|
12372
12370
|
const forAttr = this.htmlFor;
|
|
12373
12371
|
if (forAttr) {
|
|
12374
|
-
return (_b = (
|
|
12372
|
+
return (_b = (_a3 = this.ownerDocument) == null ? void 0 : _a3.getElementById(forAttr)) != null ? _b : null;
|
|
12375
12373
|
}
|
|
12376
12374
|
const labelableSelector = 'button, input:not([type="hidden"]), meter, output, progress, select, textarea';
|
|
12377
12375
|
return this.querySelector(labelableSelector);
|
|
@@ -15181,8 +15179,35 @@ var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
|
15181
15179
|
};
|
|
15182
15180
|
|
|
15183
15181
|
// node_modules/minimatch/dist/esm/ast.js
|
|
15182
|
+
var _a2;
|
|
15184
15183
|
var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
15185
15184
|
var isExtglobType = (c) => types.has(c);
|
|
15185
|
+
var isExtglobAST = (c) => isExtglobType(c.type);
|
|
15186
|
+
var adoptionMap = /* @__PURE__ */ new Map([
|
|
15187
|
+
["!", ["@"]],
|
|
15188
|
+
["?", ["?", "@"]],
|
|
15189
|
+
["@", ["@"]],
|
|
15190
|
+
["*", ["*", "+", "?", "@"]],
|
|
15191
|
+
["+", ["+", "@"]]
|
|
15192
|
+
]);
|
|
15193
|
+
var adoptionWithSpaceMap = /* @__PURE__ */ new Map([
|
|
15194
|
+
["!", ["?"]],
|
|
15195
|
+
["@", ["?"]],
|
|
15196
|
+
["+", ["?", "*"]]
|
|
15197
|
+
]);
|
|
15198
|
+
var adoptionAnyMap = /* @__PURE__ */ new Map([
|
|
15199
|
+
["!", ["?", "@"]],
|
|
15200
|
+
["?", ["?", "@"]],
|
|
15201
|
+
["@", ["?", "@"]],
|
|
15202
|
+
["*", ["*", "+", "?", "@"]],
|
|
15203
|
+
["+", ["+", "@", "?", "*"]]
|
|
15204
|
+
]);
|
|
15205
|
+
var usurpMap = /* @__PURE__ */ new Map([
|
|
15206
|
+
["!", /* @__PURE__ */ new Map([["!", "@"]])],
|
|
15207
|
+
["?", /* @__PURE__ */ new Map([["*", "*"], ["+", "*"]])],
|
|
15208
|
+
["@", /* @__PURE__ */ new Map([["!", "!"], ["?", "?"], ["@", "@"], ["*", "*"], ["+", "+"]])],
|
|
15209
|
+
["+", /* @__PURE__ */ new Map([["?", "*"], ["*", "*"]])]
|
|
15210
|
+
]);
|
|
15186
15211
|
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
15187
15212
|
var startNoDot = "(?!\\.)";
|
|
15188
15213
|
var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
|
@@ -15192,8 +15217,8 @@ var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
|
15192
15217
|
var qmark = "[^/]";
|
|
15193
15218
|
var star = qmark + "*?";
|
|
15194
15219
|
var starNoEmpty = qmark + "+?";
|
|
15195
|
-
var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn;
|
|
15196
|
-
var
|
|
15220
|
+
var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, canAdoptWithSpace_fn, canAdopt_fn, canAdoptType_fn, adoptWithSpace_fn, adopt_fn, canUsurpType_fn, canUsurp_fn, usurp_fn, flatten_fn, partsToRegExp_fn, parseGlob_fn;
|
|
15221
|
+
var AST = class {
|
|
15197
15222
|
constructor(type, parent, options = {}) {
|
|
15198
15223
|
__privateAdd(this, _AST_instances);
|
|
15199
15224
|
__publicField(this, "type");
|
|
@@ -15246,44 +15271,44 @@ var _AST = class _AST {
|
|
|
15246
15271
|
for (const p of parts) {
|
|
15247
15272
|
if (p === "")
|
|
15248
15273
|
continue;
|
|
15249
|
-
if (typeof p !== "string" && !(p instanceof
|
|
15274
|
+
if (typeof p !== "string" && !(p instanceof _a2 && __privateGet(p, _parent) === this)) {
|
|
15250
15275
|
throw new Error("invalid part: " + p);
|
|
15251
15276
|
}
|
|
15252
15277
|
__privateGet(this, _parts).push(p);
|
|
15253
15278
|
}
|
|
15254
15279
|
}
|
|
15255
15280
|
toJSON() {
|
|
15256
|
-
var
|
|
15281
|
+
var _a3;
|
|
15257
15282
|
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())];
|
|
15258
15283
|
if (this.isStart() && !this.type)
|
|
15259
15284
|
ret.unshift([]);
|
|
15260
|
-
if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && ((
|
|
15285
|
+
if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && ((_a3 = __privateGet(this, _parent)) == null ? void 0 : _a3.type) === "!")) {
|
|
15261
15286
|
ret.push({});
|
|
15262
15287
|
}
|
|
15263
15288
|
return ret;
|
|
15264
15289
|
}
|
|
15265
15290
|
isStart() {
|
|
15266
|
-
var
|
|
15291
|
+
var _a3;
|
|
15267
15292
|
if (__privateGet(this, _root) === this)
|
|
15268
15293
|
return true;
|
|
15269
|
-
if (!((
|
|
15294
|
+
if (!((_a3 = __privateGet(this, _parent)) == null ? void 0 : _a3.isStart()))
|
|
15270
15295
|
return false;
|
|
15271
15296
|
if (__privateGet(this, _parentIndex) === 0)
|
|
15272
15297
|
return true;
|
|
15273
15298
|
const p = __privateGet(this, _parent);
|
|
15274
15299
|
for (let i = 0; i < __privateGet(this, _parentIndex); i++) {
|
|
15275
15300
|
const pp = __privateGet(p, _parts)[i];
|
|
15276
|
-
if (!(pp instanceof
|
|
15301
|
+
if (!(pp instanceof _a2 && pp.type === "!")) {
|
|
15277
15302
|
return false;
|
|
15278
15303
|
}
|
|
15279
15304
|
}
|
|
15280
15305
|
return true;
|
|
15281
15306
|
}
|
|
15282
15307
|
isEnd() {
|
|
15283
|
-
var
|
|
15308
|
+
var _a3, _b, _c;
|
|
15284
15309
|
if (__privateGet(this, _root) === this)
|
|
15285
15310
|
return true;
|
|
15286
|
-
if (((
|
|
15311
|
+
if (((_a3 = __privateGet(this, _parent)) == null ? void 0 : _a3.type) === "!")
|
|
15287
15312
|
return true;
|
|
15288
15313
|
if (!((_b = __privateGet(this, _parent)) == null ? void 0 : _b.isEnd()))
|
|
15289
15314
|
return false;
|
|
@@ -15299,16 +15324,16 @@ var _AST = class _AST {
|
|
|
15299
15324
|
this.push(part.clone(this));
|
|
15300
15325
|
}
|
|
15301
15326
|
clone(parent) {
|
|
15302
|
-
const c = new
|
|
15327
|
+
const c = new _a2(this.type, parent);
|
|
15303
15328
|
for (const p of __privateGet(this, _parts)) {
|
|
15304
15329
|
c.copyIn(p);
|
|
15305
15330
|
}
|
|
15306
15331
|
return c;
|
|
15307
15332
|
}
|
|
15308
15333
|
static fromGlob(pattern, options = {}) {
|
|
15309
|
-
var
|
|
15310
|
-
const ast = new
|
|
15311
|
-
__privateMethod(
|
|
15334
|
+
var _a3;
|
|
15335
|
+
const ast = new _a2(null, void 0, options);
|
|
15336
|
+
__privateMethod(_a3 = _a2, _AST_static, parseAST_fn).call(_a3, pattern, ast, 0, options, 0);
|
|
15312
15337
|
return ast;
|
|
15313
15338
|
}
|
|
15314
15339
|
// returns the regular expression if there's magic, or the unescaped
|
|
@@ -15401,15 +15426,17 @@ var _AST = class _AST {
|
|
|
15401
15426
|
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
|
15402
15427
|
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
|
15403
15428
|
toRegExpSource(allowDot) {
|
|
15404
|
-
var
|
|
15429
|
+
var _a3;
|
|
15405
15430
|
const dot = allowDot != null ? allowDot : !!__privateGet(this, _options).dot;
|
|
15406
|
-
if (__privateGet(this, _root) === this)
|
|
15431
|
+
if (__privateGet(this, _root) === this) {
|
|
15432
|
+
__privateMethod(this, _AST_instances, flatten_fn).call(this);
|
|
15407
15433
|
__privateMethod(this, _AST_instances, fillNegs_fn).call(this);
|
|
15408
|
-
|
|
15434
|
+
}
|
|
15435
|
+
if (!isExtglobAST(this)) {
|
|
15409
15436
|
const noEmpty = this.isStart() && this.isEnd();
|
|
15410
15437
|
const src = __privateGet(this, _parts).map((p) => {
|
|
15411
|
-
var
|
|
15412
|
-
const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(
|
|
15438
|
+
var _a4;
|
|
15439
|
+
const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(_a4 = _a2, _AST_static, parseGlob_fn).call(_a4, p, __privateGet(this, _hasMagic), noEmpty) : p.toRegExpSource(allowDot);
|
|
15413
15440
|
__privateSet(this, _hasMagic, __privateGet(this, _hasMagic) || hasMagic);
|
|
15414
15441
|
__privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
|
|
15415
15442
|
return re;
|
|
@@ -15432,7 +15459,7 @@ var _AST = class _AST {
|
|
|
15432
15459
|
}
|
|
15433
15460
|
}
|
|
15434
15461
|
let end = "";
|
|
15435
|
-
if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && ((
|
|
15462
|
+
if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && ((_a3 = __privateGet(this, _parent)) == null ? void 0 : _a3.type) === "!") {
|
|
15436
15463
|
end = "(?:$|\\/)";
|
|
15437
15464
|
}
|
|
15438
15465
|
const final2 = start2 + src + end;
|
|
@@ -15448,9 +15475,10 @@ var _AST = class _AST {
|
|
|
15448
15475
|
let body = __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, dot);
|
|
15449
15476
|
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
|
15450
15477
|
const s = this.toString();
|
|
15451
|
-
|
|
15452
|
-
|
|
15453
|
-
|
|
15478
|
+
const me = this;
|
|
15479
|
+
__privateSet(me, _parts, [s]);
|
|
15480
|
+
me.type = null;
|
|
15481
|
+
__privateSet(me, _hasMagic, void 0);
|
|
15454
15482
|
return [s, unescape(this.toString()), false, false];
|
|
15455
15483
|
}
|
|
15456
15484
|
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, true);
|
|
@@ -15519,8 +15547,9 @@ fillNegs_fn = function() {
|
|
|
15519
15547
|
return this;
|
|
15520
15548
|
};
|
|
15521
15549
|
_AST_static = new WeakSet();
|
|
15522
|
-
parseAST_fn = function(str, ast, pos, opt) {
|
|
15523
|
-
var
|
|
15550
|
+
parseAST_fn = function(str, ast, pos, opt, extDepth) {
|
|
15551
|
+
var _a3, _b, _c, _d, _e;
|
|
15552
|
+
const maxDepth = (_a3 = opt.maxExtglobRecursion) != null ? _a3 : 2;
|
|
15524
15553
|
let escaping = false;
|
|
15525
15554
|
let inBrace = false;
|
|
15526
15555
|
let braceStart = -1;
|
|
@@ -15552,11 +15581,12 @@ parseAST_fn = function(str, ast, pos, opt) {
|
|
|
15552
15581
|
acc2 += c;
|
|
15553
15582
|
continue;
|
|
15554
15583
|
}
|
|
15555
|
-
|
|
15584
|
+
const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth;
|
|
15585
|
+
if (doRecurse) {
|
|
15556
15586
|
ast.push(acc2);
|
|
15557
15587
|
acc2 = "";
|
|
15558
|
-
const ext2 = new
|
|
15559
|
-
i2 = __privateMethod(
|
|
15588
|
+
const ext2 = new _a2(c, ast);
|
|
15589
|
+
i2 = __privateMethod(_b = _a2, _AST_static, parseAST_fn).call(_b, str, ext2, i2, opt, extDepth + 1);
|
|
15560
15590
|
ast.push(ext2);
|
|
15561
15591
|
continue;
|
|
15562
15592
|
}
|
|
@@ -15566,7 +15596,7 @@ parseAST_fn = function(str, ast, pos, opt) {
|
|
|
15566
15596
|
return i2;
|
|
15567
15597
|
}
|
|
15568
15598
|
let i = pos + 1;
|
|
15569
|
-
let part = new
|
|
15599
|
+
let part = new _a2(null, ast);
|
|
15570
15600
|
const parts = [];
|
|
15571
15601
|
let acc = "";
|
|
15572
15602
|
while (i < str.length) {
|
|
@@ -15593,19 +15623,22 @@ parseAST_fn = function(str, ast, pos, opt) {
|
|
|
15593
15623
|
acc += c;
|
|
15594
15624
|
continue;
|
|
15595
15625
|
}
|
|
15596
|
-
|
|
15626
|
+
const doRecurse = isExtglobType(c) && str.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
|
|
15627
|
+
(extDepth <= maxDepth || ast && __privateMethod(_c = ast, _AST_instances, canAdoptType_fn).call(_c, c));
|
|
15628
|
+
if (doRecurse) {
|
|
15629
|
+
const depthAdd = ast && __privateMethod(_d = ast, _AST_instances, canAdoptType_fn).call(_d, c) ? 0 : 1;
|
|
15597
15630
|
part.push(acc);
|
|
15598
15631
|
acc = "";
|
|
15599
|
-
const ext2 = new
|
|
15632
|
+
const ext2 = new _a2(c, part);
|
|
15600
15633
|
part.push(ext2);
|
|
15601
|
-
i = __privateMethod(
|
|
15634
|
+
i = __privateMethod(_e = _a2, _AST_static, parseAST_fn).call(_e, str, ext2, i, opt, extDepth + depthAdd);
|
|
15602
15635
|
continue;
|
|
15603
15636
|
}
|
|
15604
15637
|
if (c === "|") {
|
|
15605
15638
|
part.push(acc);
|
|
15606
15639
|
acc = "";
|
|
15607
15640
|
parts.push(part);
|
|
15608
|
-
part = new
|
|
15641
|
+
part = new _a2(null, ast);
|
|
15609
15642
|
continue;
|
|
15610
15643
|
}
|
|
15611
15644
|
if (c === ")") {
|
|
@@ -15624,6 +15657,100 @@ parseAST_fn = function(str, ast, pos, opt) {
|
|
|
15624
15657
|
__privateSet(ast, _parts, [str.substring(pos - 1)]);
|
|
15625
15658
|
return i;
|
|
15626
15659
|
};
|
|
15660
|
+
canAdoptWithSpace_fn = function(child) {
|
|
15661
|
+
return __privateMethod(this, _AST_instances, canAdopt_fn).call(this, child, adoptionWithSpaceMap);
|
|
15662
|
+
};
|
|
15663
|
+
canAdopt_fn = function(child, map2 = adoptionMap) {
|
|
15664
|
+
if (!child || typeof child !== "object" || child.type !== null || __privateGet(child, _parts).length !== 1 || this.type === null) {
|
|
15665
|
+
return false;
|
|
15666
|
+
}
|
|
15667
|
+
const gc = __privateGet(child, _parts)[0];
|
|
15668
|
+
if (!gc || typeof gc !== "object" || gc.type === null) {
|
|
15669
|
+
return false;
|
|
15670
|
+
}
|
|
15671
|
+
return __privateMethod(this, _AST_instances, canAdoptType_fn).call(this, gc.type, map2);
|
|
15672
|
+
};
|
|
15673
|
+
canAdoptType_fn = function(c, map2 = adoptionAnyMap) {
|
|
15674
|
+
var _a3;
|
|
15675
|
+
return !!((_a3 = map2.get(this.type)) == null ? void 0 : _a3.includes(c));
|
|
15676
|
+
};
|
|
15677
|
+
adoptWithSpace_fn = function(child, index) {
|
|
15678
|
+
const gc = __privateGet(child, _parts)[0];
|
|
15679
|
+
const blank = new _a2(null, gc, this.options);
|
|
15680
|
+
__privateGet(blank, _parts).push("");
|
|
15681
|
+
gc.push(blank);
|
|
15682
|
+
__privateMethod(this, _AST_instances, adopt_fn).call(this, child, index);
|
|
15683
|
+
};
|
|
15684
|
+
adopt_fn = function(child, index) {
|
|
15685
|
+
const gc = __privateGet(child, _parts)[0];
|
|
15686
|
+
__privateGet(this, _parts).splice(index, 1, ...__privateGet(gc, _parts));
|
|
15687
|
+
for (const p of __privateGet(gc, _parts)) {
|
|
15688
|
+
if (typeof p === "object")
|
|
15689
|
+
__privateSet(p, _parent, this);
|
|
15690
|
+
}
|
|
15691
|
+
__privateSet(this, _toString, void 0);
|
|
15692
|
+
};
|
|
15693
|
+
canUsurpType_fn = function(c) {
|
|
15694
|
+
const m = usurpMap.get(this.type);
|
|
15695
|
+
return !!(m == null ? void 0 : m.has(c));
|
|
15696
|
+
};
|
|
15697
|
+
canUsurp_fn = function(child) {
|
|
15698
|
+
if (!child || typeof child !== "object" || child.type !== null || __privateGet(child, _parts).length !== 1 || this.type === null || __privateGet(this, _parts).length !== 1) {
|
|
15699
|
+
return false;
|
|
15700
|
+
}
|
|
15701
|
+
const gc = __privateGet(child, _parts)[0];
|
|
15702
|
+
if (!gc || typeof gc !== "object" || gc.type === null) {
|
|
15703
|
+
return false;
|
|
15704
|
+
}
|
|
15705
|
+
return __privateMethod(this, _AST_instances, canUsurpType_fn).call(this, gc.type);
|
|
15706
|
+
};
|
|
15707
|
+
usurp_fn = function(child) {
|
|
15708
|
+
const m = usurpMap.get(this.type);
|
|
15709
|
+
const gc = __privateGet(child, _parts)[0];
|
|
15710
|
+
const nt = m == null ? void 0 : m.get(gc.type);
|
|
15711
|
+
if (!nt)
|
|
15712
|
+
return false;
|
|
15713
|
+
__privateSet(this, _parts, __privateGet(gc, _parts));
|
|
15714
|
+
for (const p of __privateGet(this, _parts)) {
|
|
15715
|
+
if (typeof p === "object")
|
|
15716
|
+
__privateSet(p, _parent, this);
|
|
15717
|
+
}
|
|
15718
|
+
this.type = nt;
|
|
15719
|
+
__privateSet(this, _toString, void 0);
|
|
15720
|
+
__privateSet(this, _emptyExt, false);
|
|
15721
|
+
};
|
|
15722
|
+
flatten_fn = function() {
|
|
15723
|
+
var _a3, _b;
|
|
15724
|
+
if (!isExtglobAST(this)) {
|
|
15725
|
+
for (const p of __privateGet(this, _parts)) {
|
|
15726
|
+
if (typeof p === "object")
|
|
15727
|
+
__privateMethod(_a3 = p, _AST_instances, flatten_fn).call(_a3);
|
|
15728
|
+
}
|
|
15729
|
+
} else {
|
|
15730
|
+
let iterations = 0;
|
|
15731
|
+
let done = false;
|
|
15732
|
+
do {
|
|
15733
|
+
done = true;
|
|
15734
|
+
for (let i = 0; i < __privateGet(this, _parts).length; i++) {
|
|
15735
|
+
const c = __privateGet(this, _parts)[i];
|
|
15736
|
+
if (typeof c === "object") {
|
|
15737
|
+
__privateMethod(_b = c, _AST_instances, flatten_fn).call(_b);
|
|
15738
|
+
if (__privateMethod(this, _AST_instances, canAdopt_fn).call(this, c)) {
|
|
15739
|
+
done = false;
|
|
15740
|
+
__privateMethod(this, _AST_instances, adopt_fn).call(this, c, i);
|
|
15741
|
+
} else if (__privateMethod(this, _AST_instances, canAdoptWithSpace_fn).call(this, c)) {
|
|
15742
|
+
done = false;
|
|
15743
|
+
__privateMethod(this, _AST_instances, adoptWithSpace_fn).call(this, c, i);
|
|
15744
|
+
} else if (__privateMethod(this, _AST_instances, canUsurp_fn).call(this, c)) {
|
|
15745
|
+
done = false;
|
|
15746
|
+
__privateMethod(this, _AST_instances, usurp_fn).call(this, c);
|
|
15747
|
+
}
|
|
15748
|
+
}
|
|
15749
|
+
}
|
|
15750
|
+
} while (!done && ++iterations < 10);
|
|
15751
|
+
}
|
|
15752
|
+
__privateSet(this, _toString, void 0);
|
|
15753
|
+
};
|
|
15627
15754
|
partsToRegExp_fn = function(dot) {
|
|
15628
15755
|
return __privateGet(this, _parts).map((p) => {
|
|
15629
15756
|
if (typeof p === "string") {
|
|
@@ -15638,11 +15765,13 @@ parseGlob_fn = function(glob, hasMagic, noEmpty = false) {
|
|
|
15638
15765
|
let escaping = false;
|
|
15639
15766
|
let re = "";
|
|
15640
15767
|
let uflag = false;
|
|
15768
|
+
let inStar = false;
|
|
15641
15769
|
for (let i = 0; i < glob.length; i++) {
|
|
15642
15770
|
const c = glob.charAt(i);
|
|
15643
15771
|
if (escaping) {
|
|
15644
15772
|
escaping = false;
|
|
15645
15773
|
re += (reSpecials.has(c) ? "\\" : "") + c;
|
|
15774
|
+
inStar = false;
|
|
15646
15775
|
continue;
|
|
15647
15776
|
}
|
|
15648
15777
|
if (c === "\\") {
|
|
@@ -15660,16 +15789,19 @@ parseGlob_fn = function(glob, hasMagic, noEmpty = false) {
|
|
|
15660
15789
|
uflag = uflag || needUflag;
|
|
15661
15790
|
i += consumed - 1;
|
|
15662
15791
|
hasMagic = hasMagic || magic;
|
|
15792
|
+
inStar = false;
|
|
15663
15793
|
continue;
|
|
15664
15794
|
}
|
|
15665
15795
|
}
|
|
15666
15796
|
if (c === "*") {
|
|
15667
|
-
if (
|
|
15668
|
-
|
|
15669
|
-
|
|
15670
|
-
|
|
15797
|
+
if (inStar)
|
|
15798
|
+
continue;
|
|
15799
|
+
inStar = true;
|
|
15800
|
+
re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
|
|
15671
15801
|
hasMagic = true;
|
|
15672
15802
|
continue;
|
|
15803
|
+
} else {
|
|
15804
|
+
inStar = false;
|
|
15673
15805
|
}
|
|
15674
15806
|
if (c === "?") {
|
|
15675
15807
|
re += qmark;
|
|
@@ -15680,8 +15812,8 @@ parseGlob_fn = function(glob, hasMagic, noEmpty = false) {
|
|
|
15680
15812
|
}
|
|
15681
15813
|
return [re, unescape(glob), !!hasMagic, uflag];
|
|
15682
15814
|
};
|
|
15683
|
-
__privateAdd(
|
|
15684
|
-
|
|
15815
|
+
__privateAdd(AST, _AST_static);
|
|
15816
|
+
_a2 = AST;
|
|
15685
15817
|
|
|
15686
15818
|
// node_modules/minimatch/dist/esm/escape.js
|
|
15687
15819
|
var escape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
@@ -15820,28 +15952,33 @@ var match = (list, pattern, options = {}) => {
|
|
|
15820
15952
|
minimatch.match = match;
|
|
15821
15953
|
var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
15822
15954
|
var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
15955
|
+
var _Minimatch_instances, matchGlobstar_fn, matchGlobStarBodySections_fn, matchOne_fn;
|
|
15823
15956
|
var Minimatch = class {
|
|
15824
|
-
options;
|
|
15825
|
-
set;
|
|
15826
|
-
pattern;
|
|
15827
|
-
windowsPathsNoEscape;
|
|
15828
|
-
nonegate;
|
|
15829
|
-
negate;
|
|
15830
|
-
comment;
|
|
15831
|
-
empty;
|
|
15832
|
-
preserveMultipleSlashes;
|
|
15833
|
-
partial;
|
|
15834
|
-
globSet;
|
|
15835
|
-
globParts;
|
|
15836
|
-
nocase;
|
|
15837
|
-
isWindows;
|
|
15838
|
-
platform;
|
|
15839
|
-
windowsNoMagicRoot;
|
|
15840
|
-
regexp;
|
|
15841
15957
|
constructor(pattern, options = {}) {
|
|
15958
|
+
__privateAdd(this, _Minimatch_instances);
|
|
15959
|
+
__publicField(this, "options");
|
|
15960
|
+
__publicField(this, "set");
|
|
15961
|
+
__publicField(this, "pattern");
|
|
15962
|
+
__publicField(this, "windowsPathsNoEscape");
|
|
15963
|
+
__publicField(this, "nonegate");
|
|
15964
|
+
__publicField(this, "negate");
|
|
15965
|
+
__publicField(this, "comment");
|
|
15966
|
+
__publicField(this, "empty");
|
|
15967
|
+
__publicField(this, "preserveMultipleSlashes");
|
|
15968
|
+
__publicField(this, "partial");
|
|
15969
|
+
__publicField(this, "globSet");
|
|
15970
|
+
__publicField(this, "globParts");
|
|
15971
|
+
__publicField(this, "nocase");
|
|
15972
|
+
__publicField(this, "isWindows");
|
|
15973
|
+
__publicField(this, "platform");
|
|
15974
|
+
__publicField(this, "windowsNoMagicRoot");
|
|
15975
|
+
__publicField(this, "maxGlobstarRecursion");
|
|
15976
|
+
__publicField(this, "regexp");
|
|
15977
|
+
var _a3;
|
|
15842
15978
|
assertValidPattern(pattern);
|
|
15843
15979
|
options = options || {};
|
|
15844
15980
|
this.options = options;
|
|
15981
|
+
this.maxGlobstarRecursion = (_a3 = options.maxGlobstarRecursion) != null ? _a3 : 200;
|
|
15845
15982
|
this.pattern = pattern;
|
|
15846
15983
|
this.platform = options.platform || defaultPlatform;
|
|
15847
15984
|
this.isWindows = this.platform === "win32";
|
|
@@ -16109,10 +16246,11 @@ var Minimatch = class {
|
|
|
16109
16246
|
for (let i = 0; i < globParts.length - 1; i++) {
|
|
16110
16247
|
for (let j = i + 1; j < globParts.length; j++) {
|
|
16111
16248
|
const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
|
|
16112
|
-
if (
|
|
16113
|
-
|
|
16114
|
-
|
|
16115
|
-
|
|
16249
|
+
if (matched) {
|
|
16250
|
+
globParts[i] = [];
|
|
16251
|
+
globParts[j] = matched;
|
|
16252
|
+
break;
|
|
16253
|
+
}
|
|
16116
16254
|
}
|
|
16117
16255
|
}
|
|
16118
16256
|
return globParts.filter((gs) => gs.length);
|
|
@@ -16173,7 +16311,8 @@ var Minimatch = class {
|
|
|
16173
16311
|
// out of pattern, then that's fine, as long as all
|
|
16174
16312
|
// the parts match.
|
|
16175
16313
|
matchOne(file, pattern, partial = false) {
|
|
16176
|
-
|
|
16314
|
+
let fileStartIndex = 0;
|
|
16315
|
+
let patternStartIndex = 0;
|
|
16177
16316
|
if (this.isWindows) {
|
|
16178
16317
|
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
|
16179
16318
|
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
|
@@ -16182,14 +16321,14 @@ var Minimatch = class {
|
|
|
16182
16321
|
const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
|
|
16183
16322
|
const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
|
|
16184
16323
|
if (typeof fdi === "number" && typeof pdi === "number") {
|
|
16185
|
-
const [fd, pd] = [
|
|
16324
|
+
const [fd, pd] = [
|
|
16325
|
+
file[fdi],
|
|
16326
|
+
pattern[pdi]
|
|
16327
|
+
];
|
|
16186
16328
|
if (fd.toLowerCase() === pd.toLowerCase()) {
|
|
16187
16329
|
pattern[pdi] = fd;
|
|
16188
|
-
|
|
16189
|
-
|
|
16190
|
-
} else if (fdi > pdi) {
|
|
16191
|
-
file = file.slice(fdi);
|
|
16192
|
-
}
|
|
16330
|
+
patternStartIndex = pdi;
|
|
16331
|
+
fileStartIndex = fdi;
|
|
16193
16332
|
}
|
|
16194
16333
|
}
|
|
16195
16334
|
}
|
|
@@ -16197,71 +16336,10 @@ var Minimatch = class {
|
|
|
16197
16336
|
if (optimizationLevel >= 2) {
|
|
16198
16337
|
file = this.levelTwoFileOptimize(file);
|
|
16199
16338
|
}
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
16203
|
-
this.debug("matchOne loop");
|
|
16204
|
-
var p = pattern[pi];
|
|
16205
|
-
var f = file[fi];
|
|
16206
|
-
this.debug(pattern, p, f);
|
|
16207
|
-
if (p === false) {
|
|
16208
|
-
return false;
|
|
16209
|
-
}
|
|
16210
|
-
if (p === GLOBSTAR) {
|
|
16211
|
-
this.debug("GLOBSTAR", [pattern, p, f]);
|
|
16212
|
-
var fr = fi;
|
|
16213
|
-
var pr = pi + 1;
|
|
16214
|
-
if (pr === pl) {
|
|
16215
|
-
this.debug("** at the end");
|
|
16216
|
-
for (; fi < fl; fi++) {
|
|
16217
|
-
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
|
16218
|
-
return false;
|
|
16219
|
-
}
|
|
16220
|
-
return true;
|
|
16221
|
-
}
|
|
16222
|
-
while (fr < fl) {
|
|
16223
|
-
var swallowee = file[fr];
|
|
16224
|
-
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
|
16225
|
-
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
16226
|
-
this.debug("globstar found match!", fr, fl, swallowee);
|
|
16227
|
-
return true;
|
|
16228
|
-
} else {
|
|
16229
|
-
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
|
16230
|
-
this.debug("dot detected!", file, fr, pattern, pr);
|
|
16231
|
-
break;
|
|
16232
|
-
}
|
|
16233
|
-
this.debug("globstar swallow a segment, and continue");
|
|
16234
|
-
fr++;
|
|
16235
|
-
}
|
|
16236
|
-
}
|
|
16237
|
-
if (partial) {
|
|
16238
|
-
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
|
16239
|
-
if (fr === fl) {
|
|
16240
|
-
return true;
|
|
16241
|
-
}
|
|
16242
|
-
}
|
|
16243
|
-
return false;
|
|
16244
|
-
}
|
|
16245
|
-
let hit;
|
|
16246
|
-
if (typeof p === "string") {
|
|
16247
|
-
hit = f === p;
|
|
16248
|
-
this.debug("string match", p, f, hit);
|
|
16249
|
-
} else {
|
|
16250
|
-
hit = p.test(f);
|
|
16251
|
-
this.debug("pattern match", p, f, hit);
|
|
16252
|
-
}
|
|
16253
|
-
if (!hit)
|
|
16254
|
-
return false;
|
|
16255
|
-
}
|
|
16256
|
-
if (fi === fl && pi === pl) {
|
|
16257
|
-
return true;
|
|
16258
|
-
} else if (fi === fl) {
|
|
16259
|
-
return partial;
|
|
16260
|
-
} else if (pi === pl) {
|
|
16261
|
-
return fi === fl - 1 && file[fi] === "";
|
|
16262
|
-
} else {
|
|
16263
|
-
throw new Error("wtf?");
|
|
16339
|
+
if (pattern.includes(GLOBSTAR)) {
|
|
16340
|
+
return __privateMethod(this, _Minimatch_instances, matchGlobstar_fn).call(this, file, pattern, partial, fileStartIndex, patternStartIndex);
|
|
16264
16341
|
}
|
|
16342
|
+
return __privateMethod(this, _Minimatch_instances, matchOne_fn).call(this, file, pattern, partial, fileStartIndex, patternStartIndex);
|
|
16265
16343
|
}
|
|
16266
16344
|
braceExpand() {
|
|
16267
16345
|
return braceExpand(this.pattern, this.options);
|
|
@@ -16400,6 +16478,135 @@ var Minimatch = class {
|
|
|
16400
16478
|
return minimatch.defaults(def).Minimatch;
|
|
16401
16479
|
}
|
|
16402
16480
|
};
|
|
16481
|
+
_Minimatch_instances = new WeakSet();
|
|
16482
|
+
matchGlobstar_fn = function(file, pattern, partial, fileIndex, patternIndex) {
|
|
16483
|
+
const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
|
|
16484
|
+
const lastgs = pattern.lastIndexOf(GLOBSTAR);
|
|
16485
|
+
const [head, body, tail] = partial ? [
|
|
16486
|
+
pattern.slice(patternIndex, firstgs),
|
|
16487
|
+
pattern.slice(firstgs + 1),
|
|
16488
|
+
[]
|
|
16489
|
+
] : [
|
|
16490
|
+
pattern.slice(patternIndex, firstgs),
|
|
16491
|
+
pattern.slice(firstgs + 1, lastgs),
|
|
16492
|
+
pattern.slice(lastgs + 1)
|
|
16493
|
+
];
|
|
16494
|
+
if (head.length) {
|
|
16495
|
+
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
|
16496
|
+
if (!__privateMethod(this, _Minimatch_instances, matchOne_fn).call(this, fileHead, head, partial, 0, 0))
|
|
16497
|
+
return false;
|
|
16498
|
+
fileIndex += head.length;
|
|
16499
|
+
}
|
|
16500
|
+
let fileTailMatch = 0;
|
|
16501
|
+
if (tail.length) {
|
|
16502
|
+
if (tail.length + fileIndex > file.length)
|
|
16503
|
+
return false;
|
|
16504
|
+
let tailStart = file.length - tail.length;
|
|
16505
|
+
if (__privateMethod(this, _Minimatch_instances, matchOne_fn).call(this, file, tail, partial, tailStart, 0)) {
|
|
16506
|
+
fileTailMatch = tail.length;
|
|
16507
|
+
} else {
|
|
16508
|
+
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
|
16509
|
+
return false;
|
|
16510
|
+
}
|
|
16511
|
+
tailStart--;
|
|
16512
|
+
if (!__privateMethod(this, _Minimatch_instances, matchOne_fn).call(this, file, tail, partial, tailStart, 0))
|
|
16513
|
+
return false;
|
|
16514
|
+
fileTailMatch = tail.length + 1;
|
|
16515
|
+
}
|
|
16516
|
+
}
|
|
16517
|
+
if (!body.length) {
|
|
16518
|
+
let sawSome = !!fileTailMatch;
|
|
16519
|
+
for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) {
|
|
16520
|
+
const f = String(file[i2]);
|
|
16521
|
+
sawSome = true;
|
|
16522
|
+
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
|
16523
|
+
return false;
|
|
16524
|
+
}
|
|
16525
|
+
}
|
|
16526
|
+
return partial || sawSome;
|
|
16527
|
+
}
|
|
16528
|
+
const bodySegments = [[[], 0]];
|
|
16529
|
+
let currentBody = bodySegments[0];
|
|
16530
|
+
let nonGsParts = 0;
|
|
16531
|
+
const nonGsPartsSums = [0];
|
|
16532
|
+
for (const b of body) {
|
|
16533
|
+
if (b === GLOBSTAR) {
|
|
16534
|
+
nonGsPartsSums.push(nonGsParts);
|
|
16535
|
+
currentBody = [[], 0];
|
|
16536
|
+
bodySegments.push(currentBody);
|
|
16537
|
+
} else {
|
|
16538
|
+
currentBody[0].push(b);
|
|
16539
|
+
nonGsParts++;
|
|
16540
|
+
}
|
|
16541
|
+
}
|
|
16542
|
+
let i = bodySegments.length - 1;
|
|
16543
|
+
const fileLength = file.length - fileTailMatch;
|
|
16544
|
+
for (const b of bodySegments) {
|
|
16545
|
+
b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
|
|
16546
|
+
}
|
|
16547
|
+
return !!__privateMethod(this, _Minimatch_instances, matchGlobStarBodySections_fn).call(this, file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
|
|
16548
|
+
};
|
|
16549
|
+
matchGlobStarBodySections_fn = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
|
16550
|
+
const bs = bodySegments[bodyIndex];
|
|
16551
|
+
if (!bs) {
|
|
16552
|
+
for (let i = fileIndex; i < file.length; i++) {
|
|
16553
|
+
sawTail = true;
|
|
16554
|
+
const f = file[i];
|
|
16555
|
+
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
|
16556
|
+
return false;
|
|
16557
|
+
}
|
|
16558
|
+
}
|
|
16559
|
+
return sawTail;
|
|
16560
|
+
}
|
|
16561
|
+
const [body, after] = bs;
|
|
16562
|
+
while (fileIndex <= after) {
|
|
16563
|
+
const m = __privateMethod(this, _Minimatch_instances, matchOne_fn).call(this, file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
|
|
16564
|
+
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
|
16565
|
+
const sub = __privateMethod(this, _Minimatch_instances, matchGlobStarBodySections_fn).call(this, file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
|
|
16566
|
+
if (sub !== false)
|
|
16567
|
+
return sub;
|
|
16568
|
+
}
|
|
16569
|
+
const f = file[fileIndex];
|
|
16570
|
+
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
|
16571
|
+
return false;
|
|
16572
|
+
}
|
|
16573
|
+
fileIndex++;
|
|
16574
|
+
}
|
|
16575
|
+
return partial || null;
|
|
16576
|
+
};
|
|
16577
|
+
matchOne_fn = function(file, pattern, partial, fileIndex, patternIndex) {
|
|
16578
|
+
let fi;
|
|
16579
|
+
let pi;
|
|
16580
|
+
let pl;
|
|
16581
|
+
let fl;
|
|
16582
|
+
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
16583
|
+
this.debug("matchOne loop");
|
|
16584
|
+
let p = pattern[pi];
|
|
16585
|
+
let f = file[fi];
|
|
16586
|
+
this.debug(pattern, p, f);
|
|
16587
|
+
if (p === false || p === GLOBSTAR)
|
|
16588
|
+
return false;
|
|
16589
|
+
let hit;
|
|
16590
|
+
if (typeof p === "string") {
|
|
16591
|
+
hit = f === p;
|
|
16592
|
+
this.debug("string match", p, f, hit);
|
|
16593
|
+
} else {
|
|
16594
|
+
hit = p.test(f);
|
|
16595
|
+
this.debug("pattern match", p, f, hit);
|
|
16596
|
+
}
|
|
16597
|
+
if (!hit)
|
|
16598
|
+
return false;
|
|
16599
|
+
}
|
|
16600
|
+
if (fi === fl && pi === pl) {
|
|
16601
|
+
return true;
|
|
16602
|
+
} else if (fi === fl) {
|
|
16603
|
+
return partial;
|
|
16604
|
+
} else if (pi === pl) {
|
|
16605
|
+
return fi === fl - 1 && file[fi] === "";
|
|
16606
|
+
} else {
|
|
16607
|
+
throw new Error("wtf?");
|
|
16608
|
+
}
|
|
16609
|
+
};
|
|
16403
16610
|
minimatch.AST = AST;
|
|
16404
16611
|
minimatch.Minimatch = Minimatch;
|
|
16405
16612
|
minimatch.escape = escape;
|
|
@@ -16470,7 +16677,7 @@ var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") ||
|
|
|
16470
16677
|
|
|
16471
16678
|
// src/compiler/html/canonical-link.ts
|
|
16472
16679
|
var updateCanonicalLink = (doc, href) => {
|
|
16473
|
-
var
|
|
16680
|
+
var _a3;
|
|
16474
16681
|
let canonicalLinkElm = doc.head.querySelector('link[rel="canonical"]');
|
|
16475
16682
|
if (typeof href === "string") {
|
|
16476
16683
|
if (canonicalLinkElm == null) {
|
|
@@ -16483,7 +16690,7 @@ var updateCanonicalLink = (doc, href) => {
|
|
|
16483
16690
|
if (canonicalLinkElm != null) {
|
|
16484
16691
|
const existingHref = canonicalLinkElm.getAttribute("href");
|
|
16485
16692
|
if (!existingHref) {
|
|
16486
|
-
(
|
|
16693
|
+
(_a3 = canonicalLinkElm.parentNode) == null ? void 0 : _a3.removeChild(canonicalLinkElm);
|
|
16487
16694
|
}
|
|
16488
16695
|
}
|
|
16489
16696
|
}
|
|
@@ -16995,7 +17202,7 @@ var serializeCss = (stylesheet, serializeOpts) => {
|
|
|
16995
17202
|
return out.join("");
|
|
16996
17203
|
};
|
|
16997
17204
|
var serializeCssVisitNode = (opts, node, index, len) => {
|
|
16998
|
-
var
|
|
17205
|
+
var _a3;
|
|
16999
17206
|
const nodeType = node.type;
|
|
17000
17207
|
if (nodeType === 4 /* Declaration */) {
|
|
17001
17208
|
return serializeCssDeclaration(node, index, len);
|
|
@@ -17004,7 +17211,7 @@ var serializeCssVisitNode = (opts, node, index, len) => {
|
|
|
17004
17211
|
return serializeCssRule(opts, node);
|
|
17005
17212
|
}
|
|
17006
17213
|
if (nodeType === 1 /* Comment */) {
|
|
17007
|
-
if (((
|
|
17214
|
+
if (((_a3 = node.comment) == null ? void 0 : _a3[0]) === "!") {
|
|
17008
17215
|
return `/*${node.comment}*/`;
|
|
17009
17216
|
} else {
|
|
17010
17217
|
return "";
|
|
@@ -17052,10 +17259,10 @@ var serializeCssVisitNode = (opts, node, index, len) => {
|
|
|
17052
17259
|
return "";
|
|
17053
17260
|
};
|
|
17054
17261
|
var serializeCssRule = (opts, node) => {
|
|
17055
|
-
var
|
|
17262
|
+
var _a3, _b;
|
|
17056
17263
|
const decls = node.declarations;
|
|
17057
17264
|
const usedSelectors = opts.usedSelectors;
|
|
17058
|
-
const selectors = (_b = (
|
|
17265
|
+
const selectors = (_b = (_a3 = node.selectors) == null ? void 0 : _a3.slice()) != null ? _b : [];
|
|
17059
17266
|
const hasDecls = decls != null && decls.length > 0;
|
|
17060
17267
|
const hasNestedRules = node.rules != null && node.rules.length > 0;
|
|
17061
17268
|
if (!hasDecls && !hasNestedRules) {
|
|
@@ -17159,8 +17366,8 @@ var serializeCssKeyframes = (opts, node) => {
|
|
|
17159
17366
|
return "@" + (node.vendor || "") + "keyframes " + node.name + "{" + keyframesCss + "}";
|
|
17160
17367
|
};
|
|
17161
17368
|
var serializeCssKeyframe = (opts, node) => {
|
|
17162
|
-
var
|
|
17163
|
-
return ((_b = (
|
|
17369
|
+
var _a3, _b;
|
|
17370
|
+
return ((_b = (_a3 = node.values) == null ? void 0 : _a3.join(",")) != null ? _b : "") + "{" + serializeCssMapVisit(opts, node.declarations) + "}";
|
|
17164
17371
|
};
|
|
17165
17372
|
var serializeCssFontFace = (opts, node) => {
|
|
17166
17373
|
const fontCss = serializeCssMapVisit(opts, node.declarations);
|
|
@@ -17184,8 +17391,8 @@ var serializeCssContainer = (opts, node) => {
|
|
|
17184
17391
|
return "@container " + removeMediaWhitespace(node.media) + "{" + containerCss + "}";
|
|
17185
17392
|
};
|
|
17186
17393
|
var serializeCssPage = (opts, node) => {
|
|
17187
|
-
var
|
|
17188
|
-
const sel = (_b = (
|
|
17394
|
+
var _a3, _b;
|
|
17395
|
+
const sel = (_b = (_a3 = node.selectors) == null ? void 0 : _a3.join(", ")) != null ? _b : "";
|
|
17189
17396
|
return "@page " + sel + "{" + serializeCssMapVisit(opts, node.declarations) + "}";
|
|
17190
17397
|
};
|
|
17191
17398
|
var serializeCssDocument = (opts, node) => {
|
|
@@ -17232,10 +17439,10 @@ var removeSelectorWhitespace = (selector) => {
|
|
|
17232
17439
|
return rtn;
|
|
17233
17440
|
};
|
|
17234
17441
|
var removeMediaWhitespace = (media) => {
|
|
17235
|
-
var
|
|
17442
|
+
var _a3;
|
|
17236
17443
|
let rtn = "";
|
|
17237
17444
|
let char = "";
|
|
17238
|
-
media = (
|
|
17445
|
+
media = (_a3 = media == null ? void 0 : media.trim()) != null ? _a3 : "";
|
|
17239
17446
|
for (let i = 0, l = media.length; i < l; i++) {
|
|
17240
17447
|
char = media[i];
|
|
17241
17448
|
if (CSS_WS_REG.test(char)) {
|