akm-cli 0.10.261008-beta → 0.10.261009-beta
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/CHANGELOG.md +61 -0
- package/STABILITY.md +10 -4
- package/dist/api.d.ts +6 -0
- package/dist/api.js +12 -1
- package/dist/assets/prompts/consolidate-pair-check.md +2 -0
- package/dist/assets/prompts/consolidate-pair-same-age.md +1 -0
- package/dist/assets/prompts/consolidate-pair-terms.md +6 -0
- package/dist/assets/prompts/consolidate-pair.md +4 -12
- package/dist/commands/health.js +1 -2
- package/dist/commands/improve/consolidate/pair-pass.js +59 -31
- package/dist/commands/improve/extract.js +18 -12
- package/dist/commands/improve/memory/memory-belief.js +2 -2
- package/dist/commands/proposal/repository.js +44 -13
- package/dist/commands/read/curate.js +77 -18
- package/dist/commands/read/search-cli.js +25 -11
- package/dist/commands/read/search.js +3 -3
- package/dist/commands/read/show.js +47 -1
- package/dist/core/adapter/adapters/akm-adapter.js +1 -0
- package/dist/core/adapter/adapters/llm-wiki-adapter.js +3 -5
- package/dist/core/adapter/adapters/okf-adapter.js +3 -16
- package/dist/core/asset/markdown-link-targets.js +43 -0
- package/dist/indexer/passes/metadata.js +17 -0
- package/dist/indexer/scan/doc-to-entry.js +1 -0
- package/dist/indexer/search/db-search.js +16 -7
- package/dist/indexer/search/search-hit-enrichers.js +3 -3
- package/dist/output/shapes/curate.js +3 -1
- package/dist/output/shapes/helpers.js +6 -0
- package/dist/output/text/show-format.js +7 -0
- package/dist/scripts/akm-migrate-node.js +1802 -319
- package/dist/scripts/akm-migrate.js +1802 -319
- package/dist/storage/repositories/index-entries-repository.js +16 -0
- package/dist/storage/repositories/index-fts-repository.js +28 -6
- package/dist/storage/repositories/index-vec-repository.js +19 -3
- package/docs/architecture/0.10-process-rules.md +4 -4
- package/docs/architecture/architecture.md +4 -0
- package/docs/architecture/persisted-data-compat.md +1 -1
- package/docs/reference/api.md +19 -1
- package/docs/reference/cli.md +51 -2
- package/docs/reference/memory.md +7 -6
- package/package.json +2 -1
|
@@ -9320,11 +9320,11 @@ var require_DOMException = __commonJS((exports, module) => {
|
|
|
9320
9320
|
}
|
|
9321
9321
|
DOMException2.prototype.__proto__ = Error.prototype;
|
|
9322
9322
|
for (c in constants) {
|
|
9323
|
-
|
|
9324
|
-
Object.defineProperty(DOMException2, c,
|
|
9325
|
-
Object.defineProperty(DOMException2.prototype, c,
|
|
9323
|
+
v2 = { value: constants[c] };
|
|
9324
|
+
Object.defineProperty(DOMException2, c, v2);
|
|
9325
|
+
Object.defineProperty(DOMException2.prototype, c, v2);
|
|
9326
9326
|
}
|
|
9327
|
-
var
|
|
9327
|
+
var v2;
|
|
9328
9328
|
var c;
|
|
9329
9329
|
});
|
|
9330
9330
|
|
|
@@ -9426,9 +9426,9 @@ var require_utils = __commonJS((exports) => {
|
|
|
9426
9426
|
Object.defineProperty(c.prototype, n, { value: src[n], writable: isApiWritable });
|
|
9427
9427
|
}
|
|
9428
9428
|
};
|
|
9429
|
-
exports.merge = function(
|
|
9429
|
+
exports.merge = function(a3, b) {
|
|
9430
9430
|
for (var n in b) {
|
|
9431
|
-
|
|
9431
|
+
a3[n] = b[n];
|
|
9432
9432
|
}
|
|
9433
9433
|
};
|
|
9434
9434
|
exports.documentOrder = function(n, m) {
|
|
@@ -9509,10 +9509,10 @@ var require_EventTarget = __commonJS((exports, module) => {
|
|
|
9509
9509
|
if (typeof handler3 === "function") {
|
|
9510
9510
|
rv = handler3.call(event2.currentTarget, event2);
|
|
9511
9511
|
} else {
|
|
9512
|
-
var
|
|
9513
|
-
if (typeof
|
|
9512
|
+
var f2 = handler3.handleEvent;
|
|
9513
|
+
if (typeof f2 !== "function")
|
|
9514
9514
|
throw new TypeError("handleEvent property of " + "event handler object is" + "not a function.");
|
|
9515
|
-
rv =
|
|
9515
|
+
rv = f2.call(handler3, event2);
|
|
9516
9516
|
}
|
|
9517
9517
|
switch (event2.type) {
|
|
9518
9518
|
case "mouseover":
|
|
@@ -9638,41 +9638,41 @@ var require_EventTarget = __commonJS((exports, module) => {
|
|
|
9638
9638
|
var require_LinkedList = __commonJS((exports, module) => {
|
|
9639
9639
|
var utils = require_utils();
|
|
9640
9640
|
var LinkedList = module.exports = {
|
|
9641
|
-
valid: function(
|
|
9642
|
-
utils.assert(
|
|
9643
|
-
utils.assert(
|
|
9644
|
-
utils.assert(
|
|
9641
|
+
valid: function(a3) {
|
|
9642
|
+
utils.assert(a3, "list falsy");
|
|
9643
|
+
utils.assert(a3._previousSibling, "previous falsy");
|
|
9644
|
+
utils.assert(a3._nextSibling, "next falsy");
|
|
9645
9645
|
return true;
|
|
9646
9646
|
},
|
|
9647
|
-
insertBefore: function(
|
|
9648
|
-
utils.assert(LinkedList.valid(
|
|
9649
|
-
var a_first =
|
|
9647
|
+
insertBefore: function(a3, b) {
|
|
9648
|
+
utils.assert(LinkedList.valid(a3) && LinkedList.valid(b));
|
|
9649
|
+
var a_first = a3, a_last = a3._previousSibling;
|
|
9650
9650
|
var b_first = b, b_last = b._previousSibling;
|
|
9651
9651
|
a_first._previousSibling = b_last;
|
|
9652
9652
|
a_last._nextSibling = b_first;
|
|
9653
9653
|
b_last._nextSibling = a_first;
|
|
9654
9654
|
b_first._previousSibling = a_last;
|
|
9655
|
-
utils.assert(LinkedList.valid(
|
|
9655
|
+
utils.assert(LinkedList.valid(a3) && LinkedList.valid(b));
|
|
9656
9656
|
},
|
|
9657
|
-
replace: function(
|
|
9658
|
-
utils.assert(LinkedList.valid(
|
|
9657
|
+
replace: function(a3, b) {
|
|
9658
|
+
utils.assert(LinkedList.valid(a3) && (b === null || LinkedList.valid(b)));
|
|
9659
9659
|
if (b !== null) {
|
|
9660
|
-
LinkedList.insertBefore(b,
|
|
9660
|
+
LinkedList.insertBefore(b, a3);
|
|
9661
9661
|
}
|
|
9662
|
-
LinkedList.remove(
|
|
9663
|
-
utils.assert(LinkedList.valid(
|
|
9662
|
+
LinkedList.remove(a3);
|
|
9663
|
+
utils.assert(LinkedList.valid(a3) && (b === null || LinkedList.valid(b)));
|
|
9664
9664
|
},
|
|
9665
|
-
remove: function(
|
|
9666
|
-
utils.assert(LinkedList.valid(
|
|
9667
|
-
var prev =
|
|
9668
|
-
if (prev ===
|
|
9665
|
+
remove: function(a3) {
|
|
9666
|
+
utils.assert(LinkedList.valid(a3));
|
|
9667
|
+
var prev = a3._previousSibling;
|
|
9668
|
+
if (prev === a3) {
|
|
9669
9669
|
return;
|
|
9670
9670
|
}
|
|
9671
|
-
var next =
|
|
9671
|
+
var next = a3._nextSibling;
|
|
9672
9672
|
prev._nextSibling = next;
|
|
9673
9673
|
next._previousSibling = prev;
|
|
9674
|
-
|
|
9675
|
-
utils.assert(LinkedList.valid(
|
|
9674
|
+
a3._previousSibling = a3._nextSibling = a3;
|
|
9675
|
+
utils.assert(LinkedList.valid(a3));
|
|
9676
9676
|
}
|
|
9677
9677
|
};
|
|
9678
9678
|
});
|
|
@@ -9755,21 +9755,21 @@ var require_NodeUtils = __commonJS((exports, module) => {
|
|
|
9755
9755
|
}
|
|
9756
9756
|
});
|
|
9757
9757
|
}
|
|
9758
|
-
function attrname(
|
|
9759
|
-
var ns =
|
|
9758
|
+
function attrname(a3) {
|
|
9759
|
+
var ns = a3.namespaceURI;
|
|
9760
9760
|
if (!ns)
|
|
9761
|
-
return
|
|
9761
|
+
return a3.localName;
|
|
9762
9762
|
if (ns === NAMESPACE.XML)
|
|
9763
|
-
return "xml:" +
|
|
9763
|
+
return "xml:" + a3.localName;
|
|
9764
9764
|
if (ns === NAMESPACE.XLINK)
|
|
9765
|
-
return "xlink:" +
|
|
9765
|
+
return "xlink:" + a3.localName;
|
|
9766
9766
|
if (ns === NAMESPACE.XMLNS) {
|
|
9767
|
-
if (
|
|
9767
|
+
if (a3.localName === "xmlns")
|
|
9768
9768
|
return "xmlns";
|
|
9769
9769
|
else
|
|
9770
|
-
return "xmlns:" +
|
|
9770
|
+
return "xmlns:" + a3.localName;
|
|
9771
9771
|
}
|
|
9772
|
-
return
|
|
9772
|
+
return a3.name;
|
|
9773
9773
|
}
|
|
9774
9774
|
function escapeMatchingClosingTag(rawText, parentTag) {
|
|
9775
9775
|
const parentClosingTag = "</" + parentTag;
|
|
@@ -9801,11 +9801,11 @@ var require_NodeUtils = __commonJS((exports, module) => {
|
|
|
9801
9801
|
var html = ns === NAMESPACE.HTML;
|
|
9802
9802
|
var tagname = html || ns === NAMESPACE.SVG || ns === NAMESPACE.MATHML ? kid.localName : kid.tagName;
|
|
9803
9803
|
s += "<" + tagname;
|
|
9804
|
-
for (var
|
|
9805
|
-
var
|
|
9806
|
-
s += " " + attrname(
|
|
9807
|
-
if (
|
|
9808
|
-
s += '="' + escapeAttr(
|
|
9804
|
+
for (var j2 = 0, k = kid._numattrs;j2 < k; j2++) {
|
|
9805
|
+
var a3 = kid._attr(j2);
|
|
9806
|
+
s += " " + attrname(a3);
|
|
9807
|
+
if (a3.value !== undefined)
|
|
9808
|
+
s += '="' + escapeAttr(a3.value) + '"';
|
|
9809
9809
|
}
|
|
9810
9810
|
s += ">";
|
|
9811
9811
|
if (!(html && emptyElements[tagname])) {
|
|
@@ -9927,13 +9927,13 @@ var require_Node2 = __commonJS((exports, module) => {
|
|
|
9927
9927
|
get: function() {
|
|
9928
9928
|
return null;
|
|
9929
9929
|
},
|
|
9930
|
-
set: function(
|
|
9930
|
+
set: function(v2) {}
|
|
9931
9931
|
},
|
|
9932
9932
|
innerText: {
|
|
9933
9933
|
get: function() {
|
|
9934
9934
|
return null;
|
|
9935
9935
|
},
|
|
9936
|
-
set: function(
|
|
9936
|
+
set: function(v2) {}
|
|
9937
9937
|
},
|
|
9938
9938
|
_countChildrenOfType: { value: function(type) {
|
|
9939
9939
|
var sum = 0;
|
|
@@ -10417,11 +10417,11 @@ var require_Node2 = __commonJS((exports, module) => {
|
|
|
10417
10417
|
// node_modules/@mixmark-io/domino/lib/NodeList.es6.js
|
|
10418
10418
|
var require_NodeList_es6 = __commonJS((exports, module) => {
|
|
10419
10419
|
module.exports = class NodeList extends Array {
|
|
10420
|
-
constructor(
|
|
10421
|
-
super(
|
|
10422
|
-
if (
|
|
10423
|
-
for (var idx in
|
|
10424
|
-
this[idx] =
|
|
10420
|
+
constructor(a3) {
|
|
10421
|
+
super(a3 && a3.length || 0);
|
|
10422
|
+
if (a3) {
|
|
10423
|
+
for (var idx in a3) {
|
|
10424
|
+
this[idx] = a3[idx];
|
|
10425
10425
|
}
|
|
10426
10426
|
}
|
|
10427
10427
|
}
|
|
@@ -10436,11 +10436,11 @@ var require_NodeList_es5 = __commonJS((exports, module) => {
|
|
|
10436
10436
|
function item(i) {
|
|
10437
10437
|
return this[i] || null;
|
|
10438
10438
|
}
|
|
10439
|
-
function NodeList(
|
|
10440
|
-
if (!
|
|
10441
|
-
|
|
10442
|
-
|
|
10443
|
-
return
|
|
10439
|
+
function NodeList(a3) {
|
|
10440
|
+
if (!a3)
|
|
10441
|
+
a3 = [];
|
|
10442
|
+
a3.item = item;
|
|
10443
|
+
return a3;
|
|
10444
10444
|
}
|
|
10445
10445
|
module.exports = NodeList;
|
|
10446
10446
|
});
|
|
@@ -10592,18 +10592,18 @@ var require_attributes = __commonJS((exports) => {
|
|
|
10592
10592
|
}
|
|
10593
10593
|
return {
|
|
10594
10594
|
get: function() {
|
|
10595
|
-
var
|
|
10596
|
-
if (
|
|
10595
|
+
var v2 = this._getattr(attr.name);
|
|
10596
|
+
if (v2 === null)
|
|
10597
10597
|
return missingValueDefault;
|
|
10598
|
-
|
|
10599
|
-
if (
|
|
10600
|
-
return
|
|
10598
|
+
v2 = valid[v2.toLowerCase()];
|
|
10599
|
+
if (v2 !== undefined)
|
|
10600
|
+
return v2;
|
|
10601
10601
|
if (invalidValueDefault !== null)
|
|
10602
10602
|
return invalidValueDefault;
|
|
10603
|
-
return
|
|
10603
|
+
return v2;
|
|
10604
10604
|
},
|
|
10605
|
-
set: function(
|
|
10606
|
-
this._setattr(attr.name,
|
|
10605
|
+
set: function(v2) {
|
|
10606
|
+
this._setattr(attr.name, v2);
|
|
10607
10607
|
}
|
|
10608
10608
|
};
|
|
10609
10609
|
} else if (attr.type === Boolean) {
|
|
@@ -10611,8 +10611,8 @@ var require_attributes = __commonJS((exports) => {
|
|
|
10611
10611
|
get: function() {
|
|
10612
10612
|
return this.hasAttribute(attr.name);
|
|
10613
10613
|
},
|
|
10614
|
-
set: function(
|
|
10615
|
-
if (
|
|
10614
|
+
set: function(v2) {
|
|
10615
|
+
if (v2) {
|
|
10616
10616
|
this._setattr(attr.name, "");
|
|
10617
10617
|
} else {
|
|
10618
10618
|
this.removeAttribute(attr.name);
|
|
@@ -10626,11 +10626,11 @@ var require_attributes = __commonJS((exports) => {
|
|
|
10626
10626
|
get: function() {
|
|
10627
10627
|
return this._getattr(attr.name) || "";
|
|
10628
10628
|
},
|
|
10629
|
-
set: function(
|
|
10630
|
-
if (attr.treatNullAsEmptyString &&
|
|
10631
|
-
|
|
10629
|
+
set: function(v2) {
|
|
10630
|
+
if (attr.treatNullAsEmptyString && v2 === null) {
|
|
10631
|
+
v2 = "";
|
|
10632
10632
|
}
|
|
10633
|
-
this._setattr(attr.name,
|
|
10633
|
+
this._setattr(attr.name, v2);
|
|
10634
10634
|
}
|
|
10635
10635
|
};
|
|
10636
10636
|
} else if (typeof attr.type === "function") {
|
|
@@ -10638,23 +10638,23 @@ var require_attributes = __commonJS((exports) => {
|
|
|
10638
10638
|
}
|
|
10639
10639
|
throw new Error("Invalid attribute definition");
|
|
10640
10640
|
};
|
|
10641
|
-
function numberPropDesc(
|
|
10641
|
+
function numberPropDesc(a3) {
|
|
10642
10642
|
var def;
|
|
10643
|
-
if (typeof
|
|
10644
|
-
def =
|
|
10645
|
-
} else if (typeof
|
|
10643
|
+
if (typeof a3.default === "function") {
|
|
10644
|
+
def = a3.default;
|
|
10645
|
+
} else if (typeof a3.default === "number") {
|
|
10646
10646
|
def = function() {
|
|
10647
|
-
return
|
|
10647
|
+
return a3.default;
|
|
10648
10648
|
};
|
|
10649
10649
|
} else {
|
|
10650
10650
|
def = function() {
|
|
10651
|
-
utils.assert(false, typeof
|
|
10651
|
+
utils.assert(false, typeof a3.default);
|
|
10652
10652
|
};
|
|
10653
10653
|
}
|
|
10654
|
-
var unsigned_long =
|
|
10655
|
-
var signed_long =
|
|
10656
|
-
var unsigned_fallback =
|
|
10657
|
-
var { min, max, setmin } =
|
|
10654
|
+
var unsigned_long = a3.type === "unsigned long";
|
|
10655
|
+
var signed_long = a3.type === "long";
|
|
10656
|
+
var unsigned_fallback = a3.type === "limited unsigned long with fallback";
|
|
10657
|
+
var { min, max, setmin } = a3;
|
|
10658
10658
|
if (min === undefined) {
|
|
10659
10659
|
if (unsigned_long)
|
|
10660
10660
|
min = 0;
|
|
@@ -10669,34 +10669,34 @@ var require_attributes = __commonJS((exports) => {
|
|
|
10669
10669
|
}
|
|
10670
10670
|
return {
|
|
10671
10671
|
get: function() {
|
|
10672
|
-
var
|
|
10673
|
-
var n =
|
|
10674
|
-
if (
|
|
10672
|
+
var v2 = this._getattr(a3.name);
|
|
10673
|
+
var n = a3.float ? parseFloat(v2) : parseInt(v2, 10);
|
|
10674
|
+
if (v2 === null || !isFinite(n) || min !== undefined && n < min || max !== undefined && n > max) {
|
|
10675
10675
|
return def.call(this);
|
|
10676
10676
|
}
|
|
10677
10677
|
if (unsigned_long || signed_long || unsigned_fallback) {
|
|
10678
|
-
if (!/^[ \t\n\f\r]*[-+]?[0-9]/.test(
|
|
10678
|
+
if (!/^[ \t\n\f\r]*[-+]?[0-9]/.test(v2)) {
|
|
10679
10679
|
return def.call(this);
|
|
10680
10680
|
}
|
|
10681
10681
|
n = n | 0;
|
|
10682
10682
|
}
|
|
10683
10683
|
return n;
|
|
10684
10684
|
},
|
|
10685
|
-
set: function(
|
|
10686
|
-
if (!
|
|
10687
|
-
|
|
10685
|
+
set: function(v2) {
|
|
10686
|
+
if (!a3.float) {
|
|
10687
|
+
v2 = Math.floor(v2);
|
|
10688
10688
|
}
|
|
10689
|
-
if (setmin !== undefined &&
|
|
10690
|
-
utils.IndexSizeError(
|
|
10689
|
+
if (setmin !== undefined && v2 < setmin) {
|
|
10690
|
+
utils.IndexSizeError(a3.name + " set to " + v2);
|
|
10691
10691
|
}
|
|
10692
10692
|
if (unsigned_long) {
|
|
10693
|
-
|
|
10693
|
+
v2 = v2 < 0 || v2 > 2147483647 ? def.call(this) : v2 | 0;
|
|
10694
10694
|
} else if (unsigned_fallback) {
|
|
10695
|
-
|
|
10695
|
+
v2 = v2 < 1 || v2 > 2147483647 ? def.call(this) : v2 | 0;
|
|
10696
10696
|
} else if (signed_long) {
|
|
10697
|
-
|
|
10697
|
+
v2 = v2 < -2147483648 || v2 > 2147483647 ? def.call(this) : v2 | 0;
|
|
10698
10698
|
}
|
|
10699
|
-
this._setattr(
|
|
10699
|
+
this._setattr(a3.name, String(v2));
|
|
10700
10700
|
}
|
|
10701
10701
|
};
|
|
10702
10702
|
}
|
|
@@ -10871,8 +10871,8 @@ var require_DOMTokenList = __commonJS((exports, module) => {
|
|
|
10871
10871
|
get: function() {
|
|
10872
10872
|
return this._getString();
|
|
10873
10873
|
},
|
|
10874
|
-
set: function(
|
|
10875
|
-
this._setString(
|
|
10874
|
+
set: function(v2) {
|
|
10875
|
+
this._setString(v2);
|
|
10876
10876
|
this._update();
|
|
10877
10877
|
}
|
|
10878
10878
|
},
|
|
@@ -10944,11 +10944,11 @@ var require_select = __commonJS((exports, module) => {
|
|
|
10944
10944
|
throw new Error("window.location is not supported.");
|
|
10945
10945
|
} }
|
|
10946
10946
|
});
|
|
10947
|
-
var compareDocumentPosition = function(
|
|
10948
|
-
return
|
|
10947
|
+
var compareDocumentPosition = function(a3, b) {
|
|
10948
|
+
return a3.compareDocumentPosition(b);
|
|
10949
10949
|
};
|
|
10950
|
-
var order = function(
|
|
10951
|
-
return compareDocumentPosition(
|
|
10950
|
+
var order = function(a3, b) {
|
|
10951
|
+
return compareDocumentPosition(a3, b) & 2 ? 1 : -1;
|
|
10952
10952
|
};
|
|
10953
10953
|
var next = function(el) {
|
|
10954
10954
|
while ((el = el.nextSibling) && el.nodeType !== 1)
|
|
@@ -11355,14 +11355,14 @@ var require_select = __commonJS((exports, module) => {
|
|
|
11355
11355
|
return attr.indexOf(val) !== -1;
|
|
11356
11356
|
},
|
|
11357
11357
|
"~=": function(attr, val) {
|
|
11358
|
-
var i, s,
|
|
11358
|
+
var i, s, f2, l;
|
|
11359
11359
|
for (s = 0;; s = i + 1) {
|
|
11360
11360
|
i = attr.indexOf(val, s);
|
|
11361
11361
|
if (i === -1)
|
|
11362
11362
|
return false;
|
|
11363
|
-
|
|
11363
|
+
f2 = attr[i - 1];
|
|
11364
11364
|
l = attr[i + val.length];
|
|
11365
|
-
if ((!
|
|
11365
|
+
if ((!f2 || f2 === " ") && (!l || l === " "))
|
|
11366
11366
|
return true;
|
|
11367
11367
|
}
|
|
11368
11368
|
},
|
|
@@ -11700,8 +11700,8 @@ var require_ChildNode = __commonJS((exports, module) => {
|
|
|
11700
11700
|
if (parentNode === null) {
|
|
11701
11701
|
return;
|
|
11702
11702
|
}
|
|
11703
|
-
while (nextSibling && argArr.some(function(
|
|
11704
|
-
return
|
|
11703
|
+
while (nextSibling && argArr.some(function(v2) {
|
|
11704
|
+
return v2 === nextSibling;
|
|
11705
11705
|
}))
|
|
11706
11706
|
nextSibling = nextSibling.nextSibling;
|
|
11707
11707
|
var docFrag = createDocumentFragmentFromArguments(this.doc, argArr);
|
|
@@ -11713,8 +11713,8 @@ var require_ChildNode = __commonJS((exports, module) => {
|
|
|
11713
11713
|
if (parentNode === null) {
|
|
11714
11714
|
return;
|
|
11715
11715
|
}
|
|
11716
|
-
while (prevSibling && argArr.some(function(
|
|
11717
|
-
return
|
|
11716
|
+
while (prevSibling && argArr.some(function(v2) {
|
|
11717
|
+
return v2 === prevSibling;
|
|
11718
11718
|
}))
|
|
11719
11719
|
prevSibling = prevSibling.previousSibling;
|
|
11720
11720
|
var docFrag = createDocumentFragmentFromArguments(this.doc, argArr);
|
|
@@ -11755,8 +11755,8 @@ var require_ChildNode = __commonJS((exports, module) => {
|
|
|
11755
11755
|
if (parentNode === null) {
|
|
11756
11756
|
return;
|
|
11757
11757
|
}
|
|
11758
|
-
while (nextSibling && argArr.some(function(
|
|
11759
|
-
return
|
|
11758
|
+
while (nextSibling && argArr.some(function(v2) {
|
|
11759
|
+
return v2 === nextSibling;
|
|
11760
11760
|
}))
|
|
11761
11761
|
nextSibling = nextSibling.nextSibling;
|
|
11762
11762
|
var docFrag = createDocumentFragmentFromArguments(this.doc, argArr);
|
|
@@ -11864,12 +11864,12 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
11864
11864
|
this._attrsByLName = Object.create(null);
|
|
11865
11865
|
this._attrKeys = [];
|
|
11866
11866
|
}
|
|
11867
|
-
function recursiveGetText(node,
|
|
11867
|
+
function recursiveGetText(node, a3) {
|
|
11868
11868
|
if (node.nodeType === Node.TEXT_NODE) {
|
|
11869
|
-
|
|
11869
|
+
a3.push(node._data);
|
|
11870
11870
|
} else {
|
|
11871
11871
|
for (var i = 0, n = node.childNodes.length;i < n; i++)
|
|
11872
|
-
recursiveGetText(node.childNodes[i],
|
|
11872
|
+
recursiveGetText(node.childNodes[i], a3);
|
|
11873
11873
|
}
|
|
11874
11874
|
}
|
|
11875
11875
|
Element.prototype = Object.create(ContainerNode.prototype, {
|
|
@@ -11940,7 +11940,7 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
11940
11940
|
get: function() {
|
|
11941
11941
|
return NodeUtils.serializeOne(this, { nodeType: 0 });
|
|
11942
11942
|
},
|
|
11943
|
-
set: function(
|
|
11943
|
+
set: function(v2) {
|
|
11944
11944
|
var document = this.ownerDocument;
|
|
11945
11945
|
var parent = this.parentNode;
|
|
11946
11946
|
if (parent === null) {
|
|
@@ -11953,7 +11953,7 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
11953
11953
|
parent = parent.ownerDocument.createElement("body");
|
|
11954
11954
|
}
|
|
11955
11955
|
var parser2 = document.implementation.mozHTMLParser(document._address, parent);
|
|
11956
|
-
parser2.parse(
|
|
11956
|
+
parser2.parse(v2 === null ? "" : String(v2), true);
|
|
11957
11957
|
this.replaceWith(parser2._asDocumentFragment());
|
|
11958
11958
|
}
|
|
11959
11959
|
},
|
|
@@ -12110,8 +12110,8 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12110
12110
|
}
|
|
12111
12111
|
for (var i = 0, n = this._attrKeys.length;i < n; i++) {
|
|
12112
12112
|
var lname = this._attrKeys[i];
|
|
12113
|
-
var
|
|
12114
|
-
var b =
|
|
12113
|
+
var a3 = this._attrsByLName[lname];
|
|
12114
|
+
var b = a3.cloneNode();
|
|
12115
12115
|
b._setOwnerElement(e);
|
|
12116
12116
|
e._attrsByLName[lname] = b;
|
|
12117
12117
|
e._addQName(b);
|
|
@@ -12123,10 +12123,10 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12123
12123
|
if (this.localName !== that.localName || this.namespaceURI !== that.namespaceURI || this.prefix !== that.prefix || this._numattrs !== that._numattrs)
|
|
12124
12124
|
return false;
|
|
12125
12125
|
for (var i = 0, n = this._numattrs;i < n; i++) {
|
|
12126
|
-
var
|
|
12127
|
-
if (!that.hasAttributeNS(
|
|
12126
|
+
var a3 = this._attr(i);
|
|
12127
|
+
if (!that.hasAttributeNS(a3.namespaceURI, a3.localName))
|
|
12128
12128
|
return false;
|
|
12129
|
-
if (that.getAttributeNS(
|
|
12129
|
+
if (that.getAttributeNS(a3.namespaceURI, a3.localName) !== a3.value)
|
|
12130
12130
|
return false;
|
|
12131
12131
|
}
|
|
12132
12132
|
return true;
|
|
@@ -12136,9 +12136,9 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12136
12136
|
return this.prefix;
|
|
12137
12137
|
}
|
|
12138
12138
|
for (var i = 0, n = this._numattrs;i < n; i++) {
|
|
12139
|
-
var
|
|
12140
|
-
if (
|
|
12141
|
-
return
|
|
12139
|
+
var a3 = this._attr(i);
|
|
12140
|
+
if (a3.prefix === "xmlns" && a3.value === ns && originalElement.lookupNamespaceURI(a3.localName) === ns) {
|
|
12141
|
+
return a3.localName;
|
|
12142
12142
|
}
|
|
12143
12143
|
}
|
|
12144
12144
|
var parent = this.parentElement;
|
|
@@ -12151,10 +12151,10 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12151
12151
|
if (this.namespaceURI !== null && this.prefix === prefix)
|
|
12152
12152
|
return this.namespaceURI;
|
|
12153
12153
|
for (var i = 0, n = this._numattrs;i < n; i++) {
|
|
12154
|
-
var
|
|
12155
|
-
if (
|
|
12156
|
-
if (
|
|
12157
|
-
return
|
|
12154
|
+
var a3 = this._attr(i);
|
|
12155
|
+
if (a3.namespaceURI === NAMESPACE.XMLNS) {
|
|
12156
|
+
if (a3.prefix === "xmlns" && a3.localName === prefix || prefix === null && a3.prefix === null && a3.localName === "xmlns") {
|
|
12157
|
+
return a3.value || null;
|
|
12158
12158
|
}
|
|
12159
12159
|
}
|
|
12160
12160
|
}
|
|
@@ -12207,8 +12207,8 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12207
12207
|
utils.InvalidCharacterError();
|
|
12208
12208
|
if (/[A-Z]/.test(qname) && this.isHTML)
|
|
12209
12209
|
qname = utils.toASCIILowerCase(qname);
|
|
12210
|
-
var
|
|
12211
|
-
if (
|
|
12210
|
+
var a3 = this._attrsByQName[qname];
|
|
12211
|
+
if (a3 === undefined) {
|
|
12212
12212
|
if (force === undefined || force === true) {
|
|
12213
12213
|
this._setAttribute(qname, "");
|
|
12214
12214
|
return true;
|
|
@@ -12295,15 +12295,15 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12295
12295
|
if (!Array.isArray(oldAttrs)) {
|
|
12296
12296
|
oldAttrs = [oldAttrs];
|
|
12297
12297
|
}
|
|
12298
|
-
if (oldAttrs.some(function(
|
|
12299
|
-
return
|
|
12298
|
+
if (oldAttrs.some(function(a3) {
|
|
12299
|
+
return a3 === attr;
|
|
12300
12300
|
})) {
|
|
12301
12301
|
return attr;
|
|
12302
12302
|
} else if (attr.ownerElement !== null) {
|
|
12303
12303
|
throw new DOMException2(DOMException2.INUSE_ATTRIBUTE_ERR);
|
|
12304
12304
|
}
|
|
12305
|
-
oldAttrs.forEach(function(
|
|
12306
|
-
this.removeAttributeNode(
|
|
12305
|
+
oldAttrs.forEach(function(a3) {
|
|
12306
|
+
this.removeAttributeNode(a3);
|
|
12307
12307
|
}, this);
|
|
12308
12308
|
result = oldAttrs[0];
|
|
12309
12309
|
}
|
|
@@ -12483,13 +12483,13 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12483
12483
|
}
|
|
12484
12484
|
var dtlist = new DOMTokenList(function() {
|
|
12485
12485
|
return self.className || "";
|
|
12486
|
-
}, function(
|
|
12487
|
-
self.className =
|
|
12486
|
+
}, function(v2) {
|
|
12487
|
+
self.className = v2;
|
|
12488
12488
|
});
|
|
12489
12489
|
this._classList = dtlist;
|
|
12490
12490
|
return dtlist;
|
|
12491
|
-
}, set: function(
|
|
12492
|
-
this.className =
|
|
12491
|
+
}, set: function(v2) {
|
|
12492
|
+
this.className = v2;
|
|
12493
12493
|
} },
|
|
12494
12494
|
matches: { value: function(selector) {
|
|
12495
12495
|
return select.matches(this, selector);
|
|
@@ -12587,30 +12587,30 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12587
12587
|
get: function() {
|
|
12588
12588
|
return this.value;
|
|
12589
12589
|
},
|
|
12590
|
-
set: function(
|
|
12591
|
-
this.value =
|
|
12590
|
+
set: function(v2) {
|
|
12591
|
+
this.value = v2;
|
|
12592
12592
|
}
|
|
12593
12593
|
},
|
|
12594
12594
|
textContent: {
|
|
12595
12595
|
get: function() {
|
|
12596
12596
|
return this.value;
|
|
12597
12597
|
},
|
|
12598
|
-
set: function(
|
|
12599
|
-
if (
|
|
12600
|
-
|
|
12598
|
+
set: function(v2) {
|
|
12599
|
+
if (v2 === null || v2 === undefined) {
|
|
12600
|
+
v2 = "";
|
|
12601
12601
|
}
|
|
12602
|
-
this.value =
|
|
12602
|
+
this.value = v2;
|
|
12603
12603
|
}
|
|
12604
12604
|
},
|
|
12605
12605
|
innerText: {
|
|
12606
12606
|
get: function() {
|
|
12607
12607
|
return this.value;
|
|
12608
12608
|
},
|
|
12609
|
-
set: function(
|
|
12610
|
-
if (
|
|
12611
|
-
|
|
12609
|
+
set: function(v2) {
|
|
12610
|
+
if (v2 === null || v2 === undefined) {
|
|
12611
|
+
v2 = "";
|
|
12612
12612
|
}
|
|
12613
|
-
this.value =
|
|
12613
|
+
this.value = v2;
|
|
12614
12614
|
}
|
|
12615
12615
|
}
|
|
12616
12616
|
});
|
|
@@ -12849,15 +12849,15 @@ var require_Text = __commonJS((exports, module) => {
|
|
|
12849
12849
|
get: function() {
|
|
12850
12850
|
return this._data;
|
|
12851
12851
|
},
|
|
12852
|
-
set: function(
|
|
12853
|
-
if (
|
|
12854
|
-
|
|
12852
|
+
set: function(v2) {
|
|
12853
|
+
if (v2 === null || v2 === undefined) {
|
|
12854
|
+
v2 = "";
|
|
12855
12855
|
} else {
|
|
12856
|
-
|
|
12856
|
+
v2 = String(v2);
|
|
12857
12857
|
}
|
|
12858
|
-
if (
|
|
12858
|
+
if (v2 === this._data)
|
|
12859
12859
|
return;
|
|
12860
|
-
this._data =
|
|
12860
|
+
this._data = v2;
|
|
12861
12861
|
if (this.rooted)
|
|
12862
12862
|
this.ownerDocument.mutateValue(this);
|
|
12863
12863
|
if (this.parentNode && this.parentNode._textchangehook)
|
|
@@ -12871,8 +12871,8 @@ var require_Text = __commonJS((exports, module) => {
|
|
|
12871
12871
|
innerText: nodeValue,
|
|
12872
12872
|
data: {
|
|
12873
12873
|
get: nodeValue.get,
|
|
12874
|
-
set: function(
|
|
12875
|
-
nodeValue.set.call(this,
|
|
12874
|
+
set: function(v2) {
|
|
12875
|
+
nodeValue.set.call(this, v2 === null ? "" : String(v2));
|
|
12876
12876
|
}
|
|
12877
12877
|
},
|
|
12878
12878
|
splitText: { value: function splitText(offset) {
|
|
@@ -12917,13 +12917,13 @@ var require_Comment = __commonJS((exports, module) => {
|
|
|
12917
12917
|
get: function() {
|
|
12918
12918
|
return this._data;
|
|
12919
12919
|
},
|
|
12920
|
-
set: function(
|
|
12921
|
-
if (
|
|
12922
|
-
|
|
12920
|
+
set: function(v2) {
|
|
12921
|
+
if (v2 === null || v2 === undefined) {
|
|
12922
|
+
v2 = "";
|
|
12923
12923
|
} else {
|
|
12924
|
-
|
|
12924
|
+
v2 = String(v2);
|
|
12925
12925
|
}
|
|
12926
|
-
this._data =
|
|
12926
|
+
this._data = v2;
|
|
12927
12927
|
if (this.rooted)
|
|
12928
12928
|
this.ownerDocument.mutateValue(this);
|
|
12929
12929
|
}
|
|
@@ -12935,8 +12935,8 @@ var require_Comment = __commonJS((exports, module) => {
|
|
|
12935
12935
|
innerText: nodeValue,
|
|
12936
12936
|
data: {
|
|
12937
12937
|
get: nodeValue.get,
|
|
12938
|
-
set: function(
|
|
12939
|
-
nodeValue.set.call(this,
|
|
12938
|
+
set: function(v2) {
|
|
12939
|
+
nodeValue.set.call(this, v2 === null ? "" : String(v2));
|
|
12940
12940
|
}
|
|
12941
12941
|
},
|
|
12942
12942
|
clone: { value: function clone() {
|
|
@@ -13018,13 +13018,13 @@ var require_ProcessingInstruction = __commonJS((exports, module) => {
|
|
|
13018
13018
|
get: function() {
|
|
13019
13019
|
return this._data;
|
|
13020
13020
|
},
|
|
13021
|
-
set: function(
|
|
13022
|
-
if (
|
|
13023
|
-
|
|
13021
|
+
set: function(v2) {
|
|
13022
|
+
if (v2 === null || v2 === undefined) {
|
|
13023
|
+
v2 = "";
|
|
13024
13024
|
} else {
|
|
13025
|
-
|
|
13025
|
+
v2 = String(v2);
|
|
13026
13026
|
}
|
|
13027
|
-
this._data =
|
|
13027
|
+
this._data = v2;
|
|
13028
13028
|
if (this.rooted)
|
|
13029
13029
|
this.ownerDocument.mutateValue(this);
|
|
13030
13030
|
}
|
|
@@ -13038,8 +13038,8 @@ var require_ProcessingInstruction = __commonJS((exports, module) => {
|
|
|
13038
13038
|
innerText: nodeValue,
|
|
13039
13039
|
data: {
|
|
13040
13040
|
get: nodeValue.get,
|
|
13041
|
-
set: function(
|
|
13042
|
-
nodeValue.set.call(this,
|
|
13041
|
+
set: function(v2) {
|
|
13042
|
+
nodeValue.set.call(this, v2 === null ? "" : String(v2));
|
|
13043
13043
|
}
|
|
13044
13044
|
},
|
|
13045
13045
|
clone: { value: function clone() {
|
|
@@ -13242,11 +13242,11 @@ var require_TreeWalker = __commonJS((exports, module) => {
|
|
|
13242
13242
|
get: function currentNode() {
|
|
13243
13243
|
return this._currentNode;
|
|
13244
13244
|
},
|
|
13245
|
-
set: function setCurrentNode(
|
|
13246
|
-
if (!(
|
|
13245
|
+
set: function setCurrentNode(v2) {
|
|
13246
|
+
if (!(v2 instanceof Node)) {
|
|
13247
13247
|
throw new TypeError("Not a Node");
|
|
13248
13248
|
}
|
|
13249
|
-
this._currentNode =
|
|
13249
|
+
this._currentNode = v2;
|
|
13250
13250
|
}
|
|
13251
13251
|
},
|
|
13252
13252
|
_internalFilter: { value: function _internalFilter(node) {
|
|
@@ -13764,8 +13764,8 @@ var require_style_parser = __commonJS((exports) => {
|
|
|
13764
13764
|
}
|
|
13765
13765
|
exports.parse = parse;
|
|
13766
13766
|
function hyphenate(value) {
|
|
13767
|
-
return value.replace(/[a-z][A-Z]/g, (
|
|
13768
|
-
return
|
|
13767
|
+
return value.replace(/[a-z][A-Z]/g, (v2) => {
|
|
13768
|
+
return v2.charAt(0) + "-" + v2.charAt(1);
|
|
13769
13769
|
}).toLowerCase();
|
|
13770
13770
|
}
|
|
13771
13771
|
exports.hyphenate = hyphenate;
|
|
@@ -13964,14 +13964,14 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
13964
13964
|
else
|
|
13965
13965
|
return ":";
|
|
13966
13966
|
},
|
|
13967
|
-
set: function(
|
|
13967
|
+
set: function(v2) {
|
|
13968
13968
|
var output = this.href;
|
|
13969
13969
|
var url = new URL2(output);
|
|
13970
13970
|
if (url.isAbsolute()) {
|
|
13971
|
-
|
|
13972
|
-
|
|
13973
|
-
if (
|
|
13974
|
-
url.scheme =
|
|
13971
|
+
v2 = v2.replace(/:+$/, "");
|
|
13972
|
+
v2 = v2.replace(/[^-+\.a-zA-Z0-9]/g, URL2.percentEncode);
|
|
13973
|
+
if (v2.length > 0) {
|
|
13974
|
+
url.scheme = v2;
|
|
13975
13975
|
output = url.toString();
|
|
13976
13976
|
}
|
|
13977
13977
|
}
|
|
@@ -13986,13 +13986,13 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
13986
13986
|
else
|
|
13987
13987
|
return "";
|
|
13988
13988
|
},
|
|
13989
|
-
set: function(
|
|
13989
|
+
set: function(v2) {
|
|
13990
13990
|
var output = this.href;
|
|
13991
13991
|
var url = new URL2(output);
|
|
13992
13992
|
if (url.isAbsolute() && url.isAuthorityBased()) {
|
|
13993
|
-
|
|
13994
|
-
if (
|
|
13995
|
-
url.host =
|
|
13993
|
+
v2 = v2.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL2.percentEncode);
|
|
13994
|
+
if (v2.length > 0) {
|
|
13995
|
+
url.host = v2;
|
|
13996
13996
|
delete url.port;
|
|
13997
13997
|
output = url.toString();
|
|
13998
13998
|
}
|
|
@@ -14008,14 +14008,14 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14008
14008
|
else
|
|
14009
14009
|
return "";
|
|
14010
14010
|
},
|
|
14011
|
-
set: function(
|
|
14011
|
+
set: function(v2) {
|
|
14012
14012
|
var output = this.href;
|
|
14013
14013
|
var url = new URL2(output);
|
|
14014
14014
|
if (url.isAbsolute() && url.isAuthorityBased()) {
|
|
14015
|
-
|
|
14016
|
-
|
|
14017
|
-
if (
|
|
14018
|
-
url.host =
|
|
14015
|
+
v2 = v2.replace(/^\/+/, "");
|
|
14016
|
+
v2 = v2.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL2.percentEncode);
|
|
14017
|
+
if (v2.length > 0) {
|
|
14018
|
+
url.host = v2;
|
|
14019
14019
|
output = url.toString();
|
|
14020
14020
|
}
|
|
14021
14021
|
}
|
|
@@ -14030,17 +14030,17 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14030
14030
|
else
|
|
14031
14031
|
return "";
|
|
14032
14032
|
},
|
|
14033
|
-
set: function(
|
|
14033
|
+
set: function(v2) {
|
|
14034
14034
|
var output = this.href;
|
|
14035
14035
|
var url = new URL2(output);
|
|
14036
14036
|
if (url.isAbsolute() && url.isAuthorityBased()) {
|
|
14037
|
-
|
|
14038
|
-
|
|
14039
|
-
|
|
14040
|
-
if (
|
|
14041
|
-
|
|
14042
|
-
if (parseInt(
|
|
14043
|
-
url.port =
|
|
14037
|
+
v2 = "" + v2;
|
|
14038
|
+
v2 = v2.replace(/[^0-9].*$/, "");
|
|
14039
|
+
v2 = v2.replace(/^0+/, "");
|
|
14040
|
+
if (v2.length === 0)
|
|
14041
|
+
v2 = "0";
|
|
14042
|
+
if (parseInt(v2, 10) <= 65535) {
|
|
14043
|
+
url.port = v2;
|
|
14044
14044
|
output = url.toString();
|
|
14045
14045
|
}
|
|
14046
14046
|
}
|
|
@@ -14055,14 +14055,14 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14055
14055
|
else
|
|
14056
14056
|
return "";
|
|
14057
14057
|
},
|
|
14058
|
-
set: function(
|
|
14058
|
+
set: function(v2) {
|
|
14059
14059
|
var output = this.href;
|
|
14060
14060
|
var url = new URL2(output);
|
|
14061
14061
|
if (url.isAbsolute() && url.isHierarchical()) {
|
|
14062
|
-
if (
|
|
14063
|
-
|
|
14064
|
-
|
|
14065
|
-
url.path =
|
|
14062
|
+
if (v2.charAt(0) !== "/")
|
|
14063
|
+
v2 = "/" + v2;
|
|
14064
|
+
v2 = v2.replace(/[^-+\._~!$&'()*,;:=@\/a-zA-Z0-9]/g, URL2.percentEncode);
|
|
14065
|
+
url.path = v2;
|
|
14066
14066
|
output = url.toString();
|
|
14067
14067
|
}
|
|
14068
14068
|
this.href = output;
|
|
@@ -14076,14 +14076,14 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14076
14076
|
else
|
|
14077
14077
|
return "";
|
|
14078
14078
|
},
|
|
14079
|
-
set: function(
|
|
14079
|
+
set: function(v2) {
|
|
14080
14080
|
var output = this.href;
|
|
14081
14081
|
var url = new URL2(output);
|
|
14082
14082
|
if (url.isAbsolute() && url.isHierarchical()) {
|
|
14083
|
-
if (
|
|
14084
|
-
|
|
14085
|
-
|
|
14086
|
-
url.query =
|
|
14083
|
+
if (v2.charAt(0) === "?")
|
|
14084
|
+
v2 = v2.substring(1);
|
|
14085
|
+
v2 = v2.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL2.percentEncode);
|
|
14086
|
+
url.query = v2;
|
|
14087
14087
|
output = url.toString();
|
|
14088
14088
|
}
|
|
14089
14089
|
this.href = output;
|
|
@@ -14098,13 +14098,13 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14098
14098
|
return "#" + url.fragment;
|
|
14099
14099
|
}
|
|
14100
14100
|
},
|
|
14101
|
-
set: function(
|
|
14101
|
+
set: function(v2) {
|
|
14102
14102
|
var output = this.href;
|
|
14103
14103
|
var url = new URL2(output);
|
|
14104
|
-
if (
|
|
14105
|
-
|
|
14106
|
-
|
|
14107
|
-
url.fragment =
|
|
14104
|
+
if (v2.charAt(0) === "#")
|
|
14105
|
+
v2 = v2.substring(1);
|
|
14106
|
+
v2 = v2.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL2.percentEncode);
|
|
14107
|
+
url.fragment = v2;
|
|
14108
14108
|
output = url.toString();
|
|
14109
14109
|
this.href = output;
|
|
14110
14110
|
}
|
|
@@ -14114,12 +14114,12 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14114
14114
|
var url = this._url;
|
|
14115
14115
|
return url.username || "";
|
|
14116
14116
|
},
|
|
14117
|
-
set: function(
|
|
14117
|
+
set: function(v2) {
|
|
14118
14118
|
var output = this.href;
|
|
14119
14119
|
var url = new URL2(output);
|
|
14120
14120
|
if (url.isAbsolute()) {
|
|
14121
|
-
|
|
14122
|
-
url.username =
|
|
14121
|
+
v2 = v2.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\:]/g, URL2.percentEncode);
|
|
14122
|
+
url.username = v2;
|
|
14123
14123
|
output = url.toString();
|
|
14124
14124
|
}
|
|
14125
14125
|
this.href = output;
|
|
@@ -14130,15 +14130,15 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14130
14130
|
var url = this._url;
|
|
14131
14131
|
return url.password || "";
|
|
14132
14132
|
},
|
|
14133
|
-
set: function(
|
|
14133
|
+
set: function(v2) {
|
|
14134
14134
|
var output = this.href;
|
|
14135
14135
|
var url = new URL2(output);
|
|
14136
14136
|
if (url.isAbsolute()) {
|
|
14137
|
-
if (
|
|
14137
|
+
if (v2 === "") {
|
|
14138
14138
|
url.password = null;
|
|
14139
14139
|
} else {
|
|
14140
|
-
|
|
14141
|
-
url.password =
|
|
14140
|
+
v2 = v2.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\]/g, URL2.percentEncode);
|
|
14141
|
+
url.password = v2;
|
|
14142
14142
|
}
|
|
14143
14143
|
output = url.toString();
|
|
14144
14144
|
}
|
|
@@ -14234,8 +14234,8 @@ var require_defineElement = __commonJS((exports, module) => {
|
|
|
14234
14234
|
get: function() {
|
|
14235
14235
|
return this._getEventHandler(type);
|
|
14236
14236
|
},
|
|
14237
|
-
set: function(
|
|
14238
|
-
this._setEventHandler(type,
|
|
14237
|
+
set: function(v2) {
|
|
14238
|
+
this._setEventHandler(type, v2);
|
|
14239
14239
|
}
|
|
14240
14240
|
});
|
|
14241
14241
|
attributes.registerChangeHandler(c, "on" + type, EventHandlerChangeHandler);
|
|
@@ -14263,12 +14263,12 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
14263
14263
|
function URL2(attr) {
|
|
14264
14264
|
return {
|
|
14265
14265
|
get: function() {
|
|
14266
|
-
var
|
|
14267
|
-
if (
|
|
14266
|
+
var v2 = this._getattr(attr);
|
|
14267
|
+
if (v2 === null) {
|
|
14268
14268
|
return "";
|
|
14269
14269
|
}
|
|
14270
|
-
var url = this.doc._resolve(
|
|
14271
|
-
return url === null ?
|
|
14270
|
+
var url = this.doc._resolve(v2);
|
|
14271
|
+
return url === null ? v2 : url;
|
|
14272
14272
|
},
|
|
14273
14273
|
set: function(value) {
|
|
14274
14274
|
this._setattr(attr, value);
|
|
@@ -14278,11 +14278,11 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
14278
14278
|
function CORS(attr) {
|
|
14279
14279
|
return {
|
|
14280
14280
|
get: function() {
|
|
14281
|
-
var
|
|
14282
|
-
if (
|
|
14281
|
+
var v2 = this._getattr(attr);
|
|
14282
|
+
if (v2 === null) {
|
|
14283
14283
|
return null;
|
|
14284
14284
|
}
|
|
14285
|
-
if (
|
|
14285
|
+
if (v2.toLowerCase() === "use-credentials") {
|
|
14286
14286
|
return "use-credentials";
|
|
14287
14287
|
}
|
|
14288
14288
|
return "anonymous";
|
|
@@ -14321,17 +14321,17 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
14321
14321
|
},
|
|
14322
14322
|
props: {
|
|
14323
14323
|
dangerouslySetInnerHTML: {
|
|
14324
|
-
set: function(
|
|
14325
|
-
this._innerHTML =
|
|
14324
|
+
set: function(v2) {
|
|
14325
|
+
this._innerHTML = v2;
|
|
14326
14326
|
}
|
|
14327
14327
|
},
|
|
14328
14328
|
innerHTML: {
|
|
14329
14329
|
get: function() {
|
|
14330
14330
|
return this.serialize();
|
|
14331
14331
|
},
|
|
14332
|
-
set: function(
|
|
14332
|
+
set: function(v2) {
|
|
14333
14333
|
var parser2 = this.ownerDocument.implementation.mozHTMLParser(this.ownerDocument._address, this);
|
|
14334
|
-
parser2.parse(
|
|
14334
|
+
parser2.parse(v2 === null ? "" : String(v2), true);
|
|
14335
14335
|
var target = this instanceof htmlNameToImpl.template ? this.content : this;
|
|
14336
14336
|
while (target.hasChildNodes())
|
|
14337
14337
|
target.removeChild(target.firstChild);
|
|
@@ -14342,11 +14342,11 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
14342
14342
|
if (!this._style)
|
|
14343
14343
|
this._style = new CSSStyleDeclaration(this);
|
|
14344
14344
|
return this._style;
|
|
14345
|
-
}, set: function(
|
|
14346
|
-
if (
|
|
14347
|
-
|
|
14345
|
+
}, set: function(v2) {
|
|
14346
|
+
if (v2 === null || v2 === undefined) {
|
|
14347
|
+
v2 = "";
|
|
14348
14348
|
}
|
|
14349
|
-
this._setattr("style", String(
|
|
14349
|
+
this._setattr("style", String(v2));
|
|
14350
14350
|
} },
|
|
14351
14351
|
blur: { value: function() {} },
|
|
14352
14352
|
focus: { value: function() {} },
|
|
@@ -15074,16 +15074,16 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
15074
15074
|
get: function() {
|
|
15075
15075
|
return this._getattr("value") || this.text;
|
|
15076
15076
|
},
|
|
15077
|
-
set: function(
|
|
15078
|
-
this._setattr("value",
|
|
15077
|
+
set: function(v2) {
|
|
15078
|
+
this._setattr("value", v2);
|
|
15079
15079
|
}
|
|
15080
15080
|
},
|
|
15081
15081
|
text: {
|
|
15082
15082
|
get: function() {
|
|
15083
15083
|
return this.textContent.replace(/[ \t\n\f\r]+/g, " ").trim();
|
|
15084
15084
|
},
|
|
15085
|
-
set: function(
|
|
15086
|
-
this.textContent =
|
|
15085
|
+
set: function(v2) {
|
|
15086
|
+
this.textContent = v2;
|
|
15087
15087
|
}
|
|
15088
15088
|
}
|
|
15089
15089
|
},
|
|
@@ -15374,16 +15374,16 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
15374
15374
|
get: function() {
|
|
15375
15375
|
return this.textContent;
|
|
15376
15376
|
},
|
|
15377
|
-
set: function(
|
|
15378
|
-
this.textContent =
|
|
15377
|
+
set: function(v2) {
|
|
15378
|
+
this.textContent = v2;
|
|
15379
15379
|
}
|
|
15380
15380
|
},
|
|
15381
15381
|
value: {
|
|
15382
15382
|
get: function() {
|
|
15383
15383
|
return this.defaultValue;
|
|
15384
15384
|
},
|
|
15385
|
-
set: function(
|
|
15386
|
-
this.defaultValue =
|
|
15385
|
+
set: function(v2) {
|
|
15386
|
+
this.defaultValue = v2;
|
|
15387
15387
|
}
|
|
15388
15388
|
},
|
|
15389
15389
|
textLength: { get: function() {
|
|
@@ -15568,8 +15568,8 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
15568
15568
|
}
|
|
15569
15569
|
return this._label;
|
|
15570
15570
|
},
|
|
15571
|
-
set: function(
|
|
15572
|
-
this._setattr("label",
|
|
15571
|
+
set: function(v2) {
|
|
15572
|
+
this._setattr("label", v2);
|
|
15573
15573
|
}
|
|
15574
15574
|
}
|
|
15575
15575
|
},
|
|
@@ -15903,17 +15903,17 @@ var require_Document2 = __commonJS((exports, module) => {
|
|
|
15903
15903
|
mutationevents: "mutationevent",
|
|
15904
15904
|
uievents: "uievent"
|
|
15905
15905
|
};
|
|
15906
|
-
var mirrorAttr = function(
|
|
15906
|
+
var mirrorAttr = function(f2, name, defaultValue) {
|
|
15907
15907
|
return {
|
|
15908
15908
|
get: function() {
|
|
15909
|
-
var o =
|
|
15909
|
+
var o = f2.call(this);
|
|
15910
15910
|
if (o) {
|
|
15911
15911
|
return o[name];
|
|
15912
15912
|
}
|
|
15913
15913
|
return defaultValue;
|
|
15914
15914
|
},
|
|
15915
15915
|
set: function(value) {
|
|
15916
|
-
var o =
|
|
15916
|
+
var o = f2.call(this);
|
|
15917
15917
|
if (o) {
|
|
15918
15918
|
o[name] = value;
|
|
15919
15919
|
}
|
|
@@ -15998,8 +15998,8 @@ var require_Document2 = __commonJS((exports, module) => {
|
|
|
15998
15998
|
createAttributeNS: { value: function(namespace, qualifiedName) {
|
|
15999
15999
|
namespace = namespace === null || namespace === undefined || namespace === "" ? null : String(namespace);
|
|
16000
16000
|
qualifiedName = String(qualifiedName);
|
|
16001
|
-
var
|
|
16002
|
-
return new Element._Attr(null,
|
|
16001
|
+
var ve2 = validateAndExtract(namespace, qualifiedName);
|
|
16002
|
+
return new Element._Attr(null, ve2.localName, ve2.prefix, ve2.namespace, "");
|
|
16003
16003
|
} },
|
|
16004
16004
|
createElement: { value: function(localName) {
|
|
16005
16005
|
localName = String(localName);
|
|
@@ -16018,8 +16018,8 @@ var require_Document2 = __commonJS((exports, module) => {
|
|
|
16018
16018
|
createElementNS: { value: function(namespace, qualifiedName) {
|
|
16019
16019
|
namespace = namespace === null || namespace === undefined || namespace === "" ? null : String(namespace);
|
|
16020
16020
|
qualifiedName = String(qualifiedName);
|
|
16021
|
-
var
|
|
16022
|
-
return this._createElementNS(
|
|
16021
|
+
var ve2 = validateAndExtract(namespace, qualifiedName);
|
|
16022
|
+
return this._createElementNS(ve2.localName, ve2.namespace, ve2.prefix);
|
|
16023
16023
|
}, writable: isApiWritable },
|
|
16024
16024
|
_createElementNS: { value: function(localName, namespace, prefix) {
|
|
16025
16025
|
if (namespace === NAMESPACE.HTML) {
|
|
@@ -16459,8 +16459,8 @@ var require_Document2 = __commonJS((exports, module) => {
|
|
|
16459
16459
|
get: function() {
|
|
16460
16460
|
return this._getEventHandler(type);
|
|
16461
16461
|
},
|
|
16462
|
-
set: function(
|
|
16463
|
-
this._setEventHandler(type,
|
|
16462
|
+
set: function(v2) {
|
|
16463
|
+
this._setEventHandler(type, v2);
|
|
16464
16464
|
}
|
|
16465
16465
|
});
|
|
16466
16466
|
});
|
|
@@ -19550,15 +19550,15 @@ var require_HTMLParser = __commonJS((exports, module) => {
|
|
|
19550
19550
|
this.attrs.splice(idx, 1);
|
|
19551
19551
|
}
|
|
19552
19552
|
};
|
|
19553
|
-
HTMLParser.ActiveFormattingElements.prototype.replace = function(
|
|
19554
|
-
var idx = this.list.lastIndexOf(
|
|
19553
|
+
HTMLParser.ActiveFormattingElements.prototype.replace = function(a3, b, attrs) {
|
|
19554
|
+
var idx = this.list.lastIndexOf(a3);
|
|
19555
19555
|
if (idx !== -1) {
|
|
19556
19556
|
this.list[idx] = b;
|
|
19557
19557
|
this.attrs[idx] = attrs;
|
|
19558
19558
|
}
|
|
19559
19559
|
};
|
|
19560
|
-
HTMLParser.ActiveFormattingElements.prototype.insertAfter = function(
|
|
19561
|
-
var idx = this.list.lastIndexOf(
|
|
19560
|
+
HTMLParser.ActiveFormattingElements.prototype.insertAfter = function(a3, b) {
|
|
19561
|
+
var idx = this.list.lastIndexOf(a3);
|
|
19562
19562
|
if (idx !== -1) {
|
|
19563
19563
|
this.list.splice(idx, 0, b);
|
|
19564
19564
|
this.attrs.splice(idx, 0, b);
|
|
@@ -20140,8 +20140,8 @@ var require_HTMLParser = __commonJS((exports, module) => {
|
|
|
20140
20140
|
var tag = node.localName;
|
|
20141
20141
|
switch (tag) {
|
|
20142
20142
|
case "select":
|
|
20143
|
-
for (var
|
|
20144
|
-
var ancestor = stack.elements[--
|
|
20143
|
+
for (var j2 = i;j2 > 0; ) {
|
|
20144
|
+
var ancestor = stack.elements[--j2];
|
|
20145
20145
|
if (ancestor instanceof impl.HTMLTemplateElement) {
|
|
20146
20146
|
break;
|
|
20147
20147
|
} else if (ancestor instanceof impl.HTMLTableElement) {
|
|
@@ -24609,11 +24609,11 @@ var require_HTMLParser = __commonJS((exports, module) => {
|
|
|
24609
24609
|
case 2:
|
|
24610
24610
|
var attrs = Object.create(null);
|
|
24611
24611
|
for (var i2 = 0;i2 < arg3.length; i2++) {
|
|
24612
|
-
var
|
|
24613
|
-
if (
|
|
24614
|
-
attrs[
|
|
24612
|
+
var a3 = arg3[i2];
|
|
24613
|
+
if (a3.length === 1) {
|
|
24614
|
+
attrs[a3[0]] = "";
|
|
24615
24615
|
} else {
|
|
24616
|
-
attrs[
|
|
24616
|
+
attrs[a3[0]] = a3[1];
|
|
24617
24617
|
}
|
|
24618
24618
|
}
|
|
24619
24619
|
var token = ["StartTag", value, attrs];
|
|
@@ -24661,8 +24661,8 @@ var require_DOMImplementation = __commonJS((exports, module) => {
|
|
|
24661
24661
|
};
|
|
24662
24662
|
DOMImplementation.prototype = {
|
|
24663
24663
|
hasFeature: function hasFeature(feature, version) {
|
|
24664
|
-
var
|
|
24665
|
-
return
|
|
24664
|
+
var f2 = supportedFeatures[(feature || "").toLowerCase()];
|
|
24665
|
+
return f2 && f2[version || ""] || false;
|
|
24666
24666
|
},
|
|
24667
24667
|
createDocumentType: function createDocumentType(qualifiedName, publicId, systemId) {
|
|
24668
24668
|
if (!xml.isValidQName(qualifiedName))
|
|
@@ -24731,8 +24731,8 @@ var require_Location = __commonJS((exports, module) => {
|
|
|
24731
24731
|
get: function() {
|
|
24732
24732
|
return this._href;
|
|
24733
24733
|
},
|
|
24734
|
-
set: function(
|
|
24735
|
-
this.assign(
|
|
24734
|
+
set: function(v2) {
|
|
24735
|
+
this.assign(v2);
|
|
24736
24736
|
}
|
|
24737
24737
|
},
|
|
24738
24738
|
assign: { value: function(url) {
|
|
@@ -24853,8 +24853,8 @@ var require_Window = __commonJS((exports, module) => {
|
|
|
24853
24853
|
get: function() {
|
|
24854
24854
|
return this._getEventHandler("load");
|
|
24855
24855
|
},
|
|
24856
|
-
set: function(
|
|
24857
|
-
this._setEventHandler("load",
|
|
24856
|
+
set: function(v2) {
|
|
24857
|
+
this._setEventHandler("load", v2);
|
|
24858
24858
|
}
|
|
24859
24859
|
},
|
|
24860
24860
|
getComputedStyle: { value: function getComputedStyle(elt) {
|
|
@@ -28974,6 +28974,9 @@ function shapeShowOutput(result, detail, shape = "human") {
|
|
|
28974
28974
|
"steps",
|
|
28975
28975
|
"keys",
|
|
28976
28976
|
"links",
|
|
28977
|
+
"evidence",
|
|
28978
|
+
"evidenceSources",
|
|
28979
|
+
"provenance",
|
|
28977
28980
|
...FRAGMENT_PROVENANCE_FIELDS,
|
|
28978
28981
|
...FRAGMENT_CONTEXT_FIELDS
|
|
28979
28982
|
]);
|
|
@@ -29005,6 +29008,9 @@ function shapeShowOutput(result, detail, shape = "human") {
|
|
|
29005
29008
|
"activeRun",
|
|
29006
29009
|
"keys",
|
|
29007
29010
|
"links",
|
|
29011
|
+
"evidence",
|
|
29012
|
+
"evidenceSources",
|
|
29013
|
+
"provenance",
|
|
29008
29014
|
...FRAGMENT_PROVENANCE_FIELDS,
|
|
29009
29015
|
...FRAGMENT_CONTEXT_FIELDS,
|
|
29010
29016
|
"path",
|
|
@@ -29030,7 +29036,7 @@ function pickFields(source, fields) {
|
|
|
29030
29036
|
}
|
|
29031
29037
|
|
|
29032
29038
|
// src/output/shapes/curate.ts
|
|
29033
|
-
var BRIEF_FIELDS = ["source", "type", "name", "ref", "id", "supportRefs", "followUp", "reason"];
|
|
29039
|
+
var BRIEF_FIELDS = ["source", "type", "name", "ref", "id", "supportRefs", "beliefState", "followUp", "reason"];
|
|
29034
29040
|
var NORMAL_FIELDS = [
|
|
29035
29041
|
"source",
|
|
29036
29042
|
"type",
|
|
@@ -29046,6 +29052,7 @@ var NORMAL_FIELDS = [
|
|
|
29046
29052
|
"parameters",
|
|
29047
29053
|
"run",
|
|
29048
29054
|
"supportRefs",
|
|
29055
|
+
"beliefState",
|
|
29049
29056
|
"followUp",
|
|
29050
29057
|
"reason",
|
|
29051
29058
|
"score"
|
|
@@ -29061,6 +29068,7 @@ var AGENT_FIELDS = [
|
|
|
29061
29068
|
"id",
|
|
29062
29069
|
"description",
|
|
29063
29070
|
"supportRefs",
|
|
29071
|
+
"beliefState",
|
|
29064
29072
|
"followUp",
|
|
29065
29073
|
"reason",
|
|
29066
29074
|
"score"
|
|
@@ -31074,6 +31082,12 @@ function formatShowPlain(r, detail) {
|
|
|
31074
31082
|
}
|
|
31075
31083
|
if (r.description)
|
|
31076
31084
|
lines.push(`description: ${String(r.description)}`);
|
|
31085
|
+
if (r.evidence)
|
|
31086
|
+
lines.push(`evidence: ${String(r.evidence).replace(/\s+/g, " ")}`);
|
|
31087
|
+
if (Array.isArray(r.evidenceSources))
|
|
31088
|
+
lines.push(`evidenceSources: ${r.evidenceSources.join(", ")}`);
|
|
31089
|
+
if (r.evidence && r.provenance)
|
|
31090
|
+
lines.push(`provenance: ${JSON.stringify(r.provenance)}`);
|
|
31077
31091
|
if (r.workflowTitle)
|
|
31078
31092
|
lines.push(`workflowTitle: ${String(r.workflowTitle)}`);
|
|
31079
31093
|
if (r.agent)
|
|
@@ -41333,6 +41347,8 @@ function applyCuratedFrontmatter(entry, fmData) {
|
|
|
41333
41347
|
const evidenceSources = normalizeNonEmptyStringList(fmData.evidenceSources);
|
|
41334
41348
|
if (evidenceSources)
|
|
41335
41349
|
entry.evidenceSources = evidenceSources;
|
|
41350
|
+
if (typeof fmData.evidence === "string" && fmData.evidence.trim().length > 0)
|
|
41351
|
+
entry.evidence = fmData.evidence;
|
|
41336
41352
|
if (entry.type === "memory") {
|
|
41337
41353
|
const isDerivedByName = entry.name.toLowerCase().endsWith(".derived");
|
|
41338
41354
|
const isDerivedByFm = fmData.inferred === true;
|
|
@@ -46239,6 +46255,7 @@ var DOCUMENT_JSON_CARRIED_FIELDS = [
|
|
|
46239
46255
|
"wikiRole",
|
|
46240
46256
|
"sources",
|
|
46241
46257
|
"evidenceSources",
|
|
46258
|
+
"evidence",
|
|
46242
46259
|
"uses",
|
|
46243
46260
|
"provenance"
|
|
46244
46261
|
];
|
|
@@ -47151,6 +47168,1488 @@ var genericFilesAdapter = {
|
|
|
47151
47168
|
// src/core/adapter/adapters/llm-wiki-adapter.ts
|
|
47152
47169
|
import fs30 from "node:fs";
|
|
47153
47170
|
import path37 from "node:path";
|
|
47171
|
+
|
|
47172
|
+
// node_modules/marked/lib/marked.esm.js
|
|
47173
|
+
function B() {
|
|
47174
|
+
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
47175
|
+
}
|
|
47176
|
+
var y = B();
|
|
47177
|
+
function V(a) {
|
|
47178
|
+
y = a;
|
|
47179
|
+
}
|
|
47180
|
+
var M = { exec: () => null };
|
|
47181
|
+
function D(a) {
|
|
47182
|
+
let e = [];
|
|
47183
|
+
return (t) => {
|
|
47184
|
+
let n = Math.max(0, Math.min(3, t - 1)), i = e[n];
|
|
47185
|
+
return i || (i = a(n), e[n] = i), i;
|
|
47186
|
+
};
|
|
47187
|
+
}
|
|
47188
|
+
function h(a, e = "") {
|
|
47189
|
+
let t = typeof a == "string" ? a : a.source, n = { replace: (i, r) => {
|
|
47190
|
+
let o = typeof r == "string" ? r : r.source;
|
|
47191
|
+
return o = o.replace(x.caret, "$1"), t = t.replace(i, o), n;
|
|
47192
|
+
}, getRegex: () => new RegExp(t, e) };
|
|
47193
|
+
return n;
|
|
47194
|
+
}
|
|
47195
|
+
var ze = ((a = "") => {
|
|
47196
|
+
try {
|
|
47197
|
+
return !!new RegExp("(?<=1)(?<!1)" + a);
|
|
47198
|
+
} catch {
|
|
47199
|
+
return false;
|
|
47200
|
+
}
|
|
47201
|
+
})();
|
|
47202
|
+
var x = { codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, endingSpaceTabChar: /[ \t]$/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, leadingSpaceTab: /^[ \t]+/, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, numericCharacterReference: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/, numericCharacterReferenceOrAmpersand: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: D((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: D((a) => new RegExp(`^ {0,${a}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)), fencesBeginRegex: D((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: D((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: D((a) => new RegExp(`^ {0,${a}}(?:</?(?:${Q})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")), blockquoteBeginRegex: D((a) => new RegExp(`^ {0,${a}}>`)) };
|
|
47203
|
+
var Ee = /^(?:[ \t]*(?:\n|$))+/;
|
|
47204
|
+
var Me = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
|
|
47205
|
+
var Ce = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
|
|
47206
|
+
var N = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
47207
|
+
var Ie = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
47208
|
+
var Y = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
|
|
47209
|
+
var fe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
47210
|
+
var me = h(fe).replace(/bull/g, Y).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
|
|
47211
|
+
var Be = h(fe).replace(/bull/g, Y).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
|
|
47212
|
+
var ee = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
|
|
47213
|
+
var De = /^[^\n]+/;
|
|
47214
|
+
var te = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
|
|
47215
|
+
var qe = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", te).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
|
|
47216
|
+
var Ze = h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Y).getRegex();
|
|
47217
|
+
var Q = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
|
|
47218
|
+
var ne = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
|
|
47219
|
+
var ve = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))", "i").replace("comment", ne).replace("tag", Q).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
|
|
47220
|
+
var xe = (a) => h(ee).replace("hr", N).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", a).replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Q).getRegex();
|
|
47221
|
+
var He = xe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
|
|
47222
|
+
var Ge = xe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
|
|
47223
|
+
var Ne = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ge).getRegex();
|
|
47224
|
+
var re = { blockquote: Ne, code: Me, def: qe, fences: Ce, heading: Ie, hr: N, html: ve, lheading: me, list: Ze, newline: Ee, paragraph: He, table: M, text: De };
|
|
47225
|
+
var de = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", N).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3}\t)[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Q).getRegex();
|
|
47226
|
+
var Qe = { ...re, lheading: Be, table: de, paragraph: h(ee).replace("hr", N).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", de).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Q).getRegex() };
|
|
47227
|
+
var je = { ...re, html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", ne).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: M, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: h(ee).replace("hr", N).replace("heading", ` *#{1,6} *[^
|
|
47228
|
+
]`).replace("lheading", me).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
|
|
47229
|
+
var Fe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
|
|
47230
|
+
var Ue = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
|
|
47231
|
+
var be = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
|
|
47232
|
+
var Ke = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
|
47233
|
+
var S = /[\p{P}\p{S}]/u;
|
|
47234
|
+
var q = /[\s\p{P}\p{S}]/u;
|
|
47235
|
+
var j = /[^\s\p{P}\p{S}]/u;
|
|
47236
|
+
var Xe = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, q).getRegex();
|
|
47237
|
+
var We = /[\p{Pi}\p{Ps}"']/u;
|
|
47238
|
+
var Re = /(?!~)[\p{P}\p{S}]/u;
|
|
47239
|
+
var Ve = /(?!~)[\s\p{P}\p{S}]/u;
|
|
47240
|
+
var Je = /(?:[^\s\p{P}\p{S}]|~)/u;
|
|
47241
|
+
var Ye = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", ze ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
|
|
47242
|
+
var Te = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
|
|
47243
|
+
var et = h(Te, "u").replace(/punct/g, S).getRegex();
|
|
47244
|
+
var tt = h(Te, "u").replace(/punct/g, Re).getRegex();
|
|
47245
|
+
var nt = /^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/;
|
|
47246
|
+
var rt = h(nt, "u").replace(/openQuote/g, We).replace(/punct/g, S).getRegex();
|
|
47247
|
+
var Oe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
|
|
47248
|
+
var st = h(Oe, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
|
|
47249
|
+
var it = h(Oe, "gu").replace(/notPunctSpace/g, Je).replace(/punctSpace/g, Ve).replace(/punct/g, Re).getRegex();
|
|
47250
|
+
var ot = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)";
|
|
47251
|
+
var at = h(ot, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
|
|
47252
|
+
var lt = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
|
|
47253
|
+
var ut = "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)";
|
|
47254
|
+
var pt = h(ut, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
|
|
47255
|
+
var ct = h(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, S).getRegex();
|
|
47256
|
+
var ht = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
|
|
47257
|
+
var dt = h(ht, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
|
|
47258
|
+
var kt = h(/\\(punct)/, "gu").replace(/punct/g, S).getRegex();
|
|
47259
|
+
var gt = h(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, S).getRegex();
|
|
47260
|
+
var ft = h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
|
|
47261
|
+
var mt = h(ne).replace("(?:-->|$)", "-->").getRegex();
|
|
47262
|
+
var xt = h("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", mt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
|
|
47263
|
+
var we = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
|
|
47264
|
+
var K = h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", we).getRegex();
|
|
47265
|
+
var bt = h(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", K).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
|
|
47266
|
+
var Rt = h(/^!?\[(label)\]\[(ref)\]/).replace("label", K).replace("ref", te).getRegex();
|
|
47267
|
+
var Tt = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", te).getRegex();
|
|
47268
|
+
var ke = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
|
|
47269
|
+
var Ot = h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", we).getRegex();
|
|
47270
|
+
var wt = h("reflink|nolink(?!\\()", "g").replace("reflink", h(/^!?\[(label)\]\[(ref)\]/).replace("label", Ot).replace("ref", ke).getRegex()).replace("nolink", h(/^!?\[(ref)\](?:\[\])?/).replace("ref", ke).getRegex()).getRegex();
|
|
47271
|
+
var ge = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
|
|
47272
|
+
var Pt = /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/;
|
|
47273
|
+
var yt = h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, Pt).getRegex();
|
|
47274
|
+
var se = { _backpedal: M, anyPunctuation: kt, anyPunctuationOutsideCode: gt, autolink: ft, blockSkip: Ye, br: be, code: Ue, del: M, delLDelim: M, delRDelim: M, emStrongLDelim: et, emStrongRDelimAst: st, emStrongRDelimUnd: lt, escape: Fe, link: bt, nolink: Tt, punctuation: Xe, reflink: Rt, reflinkSearch: wt, tag: xt, text: Ke, url: M };
|
|
47275
|
+
var St = { ...se, emStrongLDelim: rt, emStrongRDelimAst: at, emStrongRDelimUnd: pt, link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", K).getRegex(), reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", K).getRegex() };
|
|
47276
|
+
var J = { ...se, emStrongRDelimAst: it, emStrongLDelim: tt, delLDelim: ct, delRDelim: dt, url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", yt).replace("protocol", ge).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", ge).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex() };
|
|
47277
|
+
var _t = { ...J, br: h(be).replace("{2,}", "*").getRegex(), text: h(J.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
|
|
47278
|
+
var F = { normal: re, gfm: Qe, pedantic: je };
|
|
47279
|
+
var Z = { normal: se, gfm: J, breaks: _t, pedantic: St };
|
|
47280
|
+
var $t = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
47281
|
+
var Pe = (a) => $t[a];
|
|
47282
|
+
function w(a, e) {
|
|
47283
|
+
if (e) {
|
|
47284
|
+
if (x.escapeTest.test(a))
|
|
47285
|
+
return a.replace(x.escapeReplace, Pe);
|
|
47286
|
+
} else if (x.escapeTestNoEncode.test(a))
|
|
47287
|
+
return a.replace(x.escapeReplaceNoEncode, Pe);
|
|
47288
|
+
return a;
|
|
47289
|
+
}
|
|
47290
|
+
function ye(a) {
|
|
47291
|
+
return x.numericCharacterReference.test(a) ? a.replace(x.numericCharacterReferenceOrAmpersand, (e, t, n) => {
|
|
47292
|
+
if (t === undefined && n === undefined)
|
|
47293
|
+
return "&";
|
|
47294
|
+
let i = t === undefined ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
47295
|
+
return i === 0 || i > 1114111 || i >= 55296 && i <= 57343 ? "�" : i === 38 ? "&" : String.fromCodePoint(i);
|
|
47296
|
+
}) : a;
|
|
47297
|
+
}
|
|
47298
|
+
function ie(a) {
|
|
47299
|
+
try {
|
|
47300
|
+
a = encodeURI(a).replace(x.percentDecode, "%");
|
|
47301
|
+
} catch {
|
|
47302
|
+
return null;
|
|
47303
|
+
}
|
|
47304
|
+
return a;
|
|
47305
|
+
}
|
|
47306
|
+
function oe(a, e) {
|
|
47307
|
+
let t = a.replace(x.findPipe, (r, o, s) => {
|
|
47308
|
+
let l = false, u = o;
|
|
47309
|
+
for (;--u >= 0 && s[u] === "\\"; )
|
|
47310
|
+
l = !l;
|
|
47311
|
+
return l ? "|" : " |";
|
|
47312
|
+
}), n = t.split(x.splitPipe), i = 0;
|
|
47313
|
+
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e)
|
|
47314
|
+
if (n.length > e)
|
|
47315
|
+
n.splice(e);
|
|
47316
|
+
else
|
|
47317
|
+
for (;n.length < e; )
|
|
47318
|
+
n.push("");
|
|
47319
|
+
for (;i < n.length; i++)
|
|
47320
|
+
n[i] = n[i].trim().replace(x.slashPipe, "|");
|
|
47321
|
+
return n;
|
|
47322
|
+
}
|
|
47323
|
+
function A(a, e, t) {
|
|
47324
|
+
let n = a.length;
|
|
47325
|
+
if (n === 0)
|
|
47326
|
+
return "";
|
|
47327
|
+
let i = 0;
|
|
47328
|
+
for (;i < n; ) {
|
|
47329
|
+
let r = a.charAt(n - i - 1);
|
|
47330
|
+
if (r === e && !t)
|
|
47331
|
+
i++;
|
|
47332
|
+
else if (r !== e && t)
|
|
47333
|
+
i++;
|
|
47334
|
+
else
|
|
47335
|
+
break;
|
|
47336
|
+
}
|
|
47337
|
+
return a.slice(0, n - i);
|
|
47338
|
+
}
|
|
47339
|
+
function ae(a) {
|
|
47340
|
+
let e = a.split(`
|
|
47341
|
+
`), t = e.length - 1;
|
|
47342
|
+
for (;t >= 0 && x.blankLine.test(e[t]); )
|
|
47343
|
+
t--;
|
|
47344
|
+
return e.length - t <= 2 ? a : e.slice(0, t + 1).join(`
|
|
47345
|
+
`);
|
|
47346
|
+
}
|
|
47347
|
+
function v(a) {
|
|
47348
|
+
return a.trim().toLowerCase().toUpperCase().toLowerCase();
|
|
47349
|
+
}
|
|
47350
|
+
function le(a, e) {
|
|
47351
|
+
if (a.indexOf(e[0]) === -1 && a.indexOf(e[1]) === -1)
|
|
47352
|
+
return -1;
|
|
47353
|
+
let t = 0;
|
|
47354
|
+
for (let n = 0;n < a.length; n++)
|
|
47355
|
+
if (a[n] === "\\")
|
|
47356
|
+
n++;
|
|
47357
|
+
else if (a[n] === e[0])
|
|
47358
|
+
t++;
|
|
47359
|
+
else if (a[n] === e[1] && (t--, t < 0))
|
|
47360
|
+
return n;
|
|
47361
|
+
return t > 0 ? -2 : -1;
|
|
47362
|
+
}
|
|
47363
|
+
function X(a, e = 0) {
|
|
47364
|
+
let t = e, n = "";
|
|
47365
|
+
for (let i of a)
|
|
47366
|
+
if (i === "\t") {
|
|
47367
|
+
let r = 4 - t % 4;
|
|
47368
|
+
n += " ".repeat(r), t += r;
|
|
47369
|
+
} else
|
|
47370
|
+
n += i, t++;
|
|
47371
|
+
return n;
|
|
47372
|
+
}
|
|
47373
|
+
function Se(a, e, t, n, i) {
|
|
47374
|
+
let r = e.href, o = e.title || null, s = a[1].replace(i.other.outputLinkReplace, "$1"), l = a[0].charAt(0) === "!", u = n.state.inLink, c = n.state.linkEmitted, p = n.state.inRawBlock;
|
|
47375
|
+
n.state.inLink = true, n.state.linkEmitted = false;
|
|
47376
|
+
let d = n.inlineTokens(s), g = n.state.linkEmitted;
|
|
47377
|
+
if (n.state.linkEmitted = c, n.state.inLink = u, !l) {
|
|
47378
|
+
if (g) {
|
|
47379
|
+
n.state.inRawBlock = p;
|
|
47380
|
+
return;
|
|
47381
|
+
}
|
|
47382
|
+
n.state.linkEmitted = true;
|
|
47383
|
+
}
|
|
47384
|
+
return { type: l ? "image" : "link", raw: t, href: r, title: o, text: s, tokens: d };
|
|
47385
|
+
}
|
|
47386
|
+
function Lt(a, e, t) {
|
|
47387
|
+
let n = a.match(t.other.indentCodeCompensation);
|
|
47388
|
+
if (n === null)
|
|
47389
|
+
return e;
|
|
47390
|
+
let i = n[1];
|
|
47391
|
+
return e.split(`
|
|
47392
|
+
`).map((r) => {
|
|
47393
|
+
let o = r.match(t.other.beginningSpace);
|
|
47394
|
+
if (o === null)
|
|
47395
|
+
return r;
|
|
47396
|
+
let [s] = o;
|
|
47397
|
+
return r.slice(Math.min(s.length, i.length));
|
|
47398
|
+
}).join(`
|
|
47399
|
+
`);
|
|
47400
|
+
}
|
|
47401
|
+
function _e(a, e, t, n) {
|
|
47402
|
+
if (!e.includes("<"))
|
|
47403
|
+
return false;
|
|
47404
|
+
for (let i = 0;i < e.length; i++) {
|
|
47405
|
+
if (e[i] === "\\") {
|
|
47406
|
+
i++;
|
|
47407
|
+
continue;
|
|
47408
|
+
}
|
|
47409
|
+
if (e[i] === "`") {
|
|
47410
|
+
let s = n.inline.code.exec(e.slice(i));
|
|
47411
|
+
if (s) {
|
|
47412
|
+
i += s[0].length - 1;
|
|
47413
|
+
continue;
|
|
47414
|
+
}
|
|
47415
|
+
}
|
|
47416
|
+
if (e[i] !== "<")
|
|
47417
|
+
continue;
|
|
47418
|
+
let r = a.slice(t + i), o = n.inline.tag.exec(r) || n.inline.autolink.exec(r);
|
|
47419
|
+
if (o) {
|
|
47420
|
+
if (o[0].length > e.length - i)
|
|
47421
|
+
return true;
|
|
47422
|
+
i += o[0].length - 1;
|
|
47423
|
+
}
|
|
47424
|
+
}
|
|
47425
|
+
return false;
|
|
47426
|
+
}
|
|
47427
|
+
var _ = class {
|
|
47428
|
+
options;
|
|
47429
|
+
rules;
|
|
47430
|
+
lexer;
|
|
47431
|
+
constructor(e) {
|
|
47432
|
+
this.options = e || y;
|
|
47433
|
+
}
|
|
47434
|
+
space(e) {
|
|
47435
|
+
let t = this.rules.block.newline.exec(e);
|
|
47436
|
+
if (t && t[0].length > 0)
|
|
47437
|
+
return { type: "space", raw: t[0] };
|
|
47438
|
+
}
|
|
47439
|
+
code(e) {
|
|
47440
|
+
let t = this.rules.block.code.exec(e);
|
|
47441
|
+
if (t) {
|
|
47442
|
+
let n = this.options.pedantic ? t[0] : ae(t[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
|
|
47443
|
+
return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
|
|
47444
|
+
}
|
|
47445
|
+
}
|
|
47446
|
+
fences(e) {
|
|
47447
|
+
let t = this.rules.block.fences.exec(e);
|
|
47448
|
+
if (t) {
|
|
47449
|
+
let n = t[0], i = Lt(n, t[3] || "", this.rules);
|
|
47450
|
+
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: i };
|
|
47451
|
+
}
|
|
47452
|
+
}
|
|
47453
|
+
heading(e) {
|
|
47454
|
+
let t = this.rules.block.heading.exec(e);
|
|
47455
|
+
if (t) {
|
|
47456
|
+
let n = t[2].trim();
|
|
47457
|
+
if (this.rules.other.endingHash.test(n)) {
|
|
47458
|
+
let i = A(n, "#");
|
|
47459
|
+
(this.options.pedantic || !i || this.rules.other.endingSpaceTabChar.test(i)) && (n = i.trim());
|
|
47460
|
+
}
|
|
47461
|
+
return { type: "heading", raw: A(t[0], `
|
|
47462
|
+
`), depth: t[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
47463
|
+
}
|
|
47464
|
+
}
|
|
47465
|
+
hr(e) {
|
|
47466
|
+
let t = this.rules.block.hr.exec(e);
|
|
47467
|
+
if (t)
|
|
47468
|
+
return { type: "hr", raw: A(t[0], `
|
|
47469
|
+
`) };
|
|
47470
|
+
}
|
|
47471
|
+
blockquote(e) {
|
|
47472
|
+
let t = this.rules.block.blockquote.exec(e);
|
|
47473
|
+
if (t) {
|
|
47474
|
+
let n = A(t[0], `
|
|
47475
|
+
`).split(`
|
|
47476
|
+
`), i = "", r = "", o = [];
|
|
47477
|
+
for (;n.length > 0; ) {
|
|
47478
|
+
let s = false, l = [], u;
|
|
47479
|
+
for (u = 0;u < n.length; u++)
|
|
47480
|
+
if (this.rules.other.blockquoteStart.test(n[u]))
|
|
47481
|
+
l.push(n[u]), s = true;
|
|
47482
|
+
else if (!s)
|
|
47483
|
+
l.push(n[u]);
|
|
47484
|
+
else
|
|
47485
|
+
break;
|
|
47486
|
+
n = n.slice(u);
|
|
47487
|
+
let c = l.join(`
|
|
47488
|
+
`), p = c.replace(this.rules.other.blockquoteSetextReplace, `
|
|
47489
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
47490
|
+
i = i ? `${i}
|
|
47491
|
+
${c}` : c, r = r ? `${r}
|
|
47492
|
+
${p}` : p;
|
|
47493
|
+
let d = this.lexer.state.top;
|
|
47494
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(p, o, true), this.lexer.state.top = d, n.length === 0)
|
|
47495
|
+
break;
|
|
47496
|
+
let g = o.at(-1);
|
|
47497
|
+
if (g?.type === "code" || g?.type === "heading" || g?.type === "hr" || g?.type === "html")
|
|
47498
|
+
break;
|
|
47499
|
+
if (g?.type === "blockquote") {
|
|
47500
|
+
let k = g, P = n.join(`
|
|
47501
|
+
`), R = k.raw + `
|
|
47502
|
+
` + P.replace(this.rules.other.blockquoteSetextReplace2, ""), m = this.blockquote(R);
|
|
47503
|
+
o[o.length - 1] = m;
|
|
47504
|
+
let E = R.substring(m.raw.length).replace(/^\n/, ""), b = E ? E.split(`
|
|
47505
|
+
`).length : 0, H = b ? n.slice(0, -b) : n;
|
|
47506
|
+
H.length > 0 && (i = `${i}
|
|
47507
|
+
${H.join(`
|
|
47508
|
+
`)}`), r = r.substring(0, r.length - k.text.length) + m.text;
|
|
47509
|
+
break;
|
|
47510
|
+
} else if (g?.type === "list") {
|
|
47511
|
+
let k = g, P = k.raw + `
|
|
47512
|
+
` + n.join(`
|
|
47513
|
+
`), R = this.list(P);
|
|
47514
|
+
o[o.length - 1] = R, i = i.substring(0, i.length - g.raw.length) + R.raw, r = r.substring(0, r.length - k.raw.length) + R.raw, n = P.substring(o.at(-1).raw.length).split(`
|
|
47515
|
+
`);
|
|
47516
|
+
continue;
|
|
47517
|
+
}
|
|
47518
|
+
}
|
|
47519
|
+
return { type: "blockquote", raw: i, tokens: o, text: r };
|
|
47520
|
+
}
|
|
47521
|
+
}
|
|
47522
|
+
list(e) {
|
|
47523
|
+
let t = this.rules.block.list.exec(e);
|
|
47524
|
+
if (t) {
|
|
47525
|
+
let n = e, i = () => n.length - e.length, r = t[1].trim(), o = r.length > 1, s = { type: "list", raw: "", ordered: o, start: o ? +r.slice(0, -1) : "", loose: false, items: [] };
|
|
47526
|
+
r = o ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = o ? r : "[*+-]");
|
|
47527
|
+
let l = this.rules.other.listItemRegex(r), u = false;
|
|
47528
|
+
for (;e; ) {
|
|
47529
|
+
let p = false, d = "";
|
|
47530
|
+
if (!(t = l.exec(e)) || this.rules.block.hr.test(e))
|
|
47531
|
+
break;
|
|
47532
|
+
let g = i();
|
|
47533
|
+
e = e.substring(t[0].length);
|
|
47534
|
+
let k = t[2].split(`
|
|
47535
|
+
`, 1)[0], P = t[1].length, R = this.options.pedantic ? X(k, P) : k.replace(this.rules.other.leadingSpaceTab, (W) => X(W, P)), m = e.split(`
|
|
47536
|
+
`, 1)[0], E = !R.trim(), b = 0;
|
|
47537
|
+
if (this.options.pedantic ? (b = 2, d = R.trimStart()) : E ? b = P + 1 : (b = R.search(this.rules.other.nonSpaceChar), b = b > 4 ? 1 : b, d = R.slice(b), b += P), E && this.rules.other.blankLine.test(m) && (e = e.substring(m.length + 1), p = true), !p) {
|
|
47538
|
+
let W = this.rules.other.nextBulletRegex(b), ue = this.rules.other.hrRegex(b), pe = this.rules.other.fencesBeginRegex(b), ce = this.rules.other.headingBeginRegex(b), $e = this.rules.other.htmlBeginRegex(b), Le = this.rules.other.blockquoteBeginRegex(b);
|
|
47539
|
+
for (;e; ) {
|
|
47540
|
+
let he = e.split(`
|
|
47541
|
+
`, 1)[0], G;
|
|
47542
|
+
if (m = he, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), G = m) : G = m.replace(this.rules.other.leadingSpaceTab, (Ae) => X(Ae)), pe.test(m) || ce.test(m) || $e.test(m) || Le.test(m) || W.test(m) || ue.test(m))
|
|
47543
|
+
break;
|
|
47544
|
+
if (G.search(this.rules.other.nonSpaceChar) >= b || !m.trim())
|
|
47545
|
+
d += `
|
|
47546
|
+
` + G.slice(b);
|
|
47547
|
+
else {
|
|
47548
|
+
if (E || R.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || pe.test(R) || ce.test(R) || ue.test(R))
|
|
47549
|
+
break;
|
|
47550
|
+
d += `
|
|
47551
|
+
` + m;
|
|
47552
|
+
}
|
|
47553
|
+
E = !m.trim(), e = e.substring(he.length + 1), R = G.slice(b);
|
|
47554
|
+
}
|
|
47555
|
+
}
|
|
47556
|
+
let H = n.slice(g, i());
|
|
47557
|
+
s.loose || (u ? s.loose = true : this.rules.other.doubleBlankLine.test(H) && (u = true)), s.items.push({ type: "list_item", raw: H, task: !!this.options.gfm && this.rules.other.listIsTask.test(d), loose: false, text: d, tokens: [] });
|
|
47558
|
+
}
|
|
47559
|
+
let c = s.items.at(-1);
|
|
47560
|
+
if (c)
|
|
47561
|
+
c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
|
|
47562
|
+
else
|
|
47563
|
+
return;
|
|
47564
|
+
s.raw = n.slice(0, i()).trimEnd();
|
|
47565
|
+
for (let p of s.items)
|
|
47566
|
+
if (this.lexer.state.top = false, p.tokens = this.lexer.blockTokens(p.text, []), !s.loose) {
|
|
47567
|
+
let d = p.tokens.filter((k) => k.type === "space"), g = d.length > 0 && d.some((k) => this.rules.other.anyLine.test(k.raw));
|
|
47568
|
+
s.loose = g;
|
|
47569
|
+
}
|
|
47570
|
+
for (let p of s.items) {
|
|
47571
|
+
let d = p.tokens[0];
|
|
47572
|
+
if (p.task && (d?.type === "text" || d?.type === "paragraph")) {
|
|
47573
|
+
p.text = p.text.replace(this.rules.other.listReplaceTask, ""), d.raw = d.raw.replace(this.rules.other.listReplaceTask, ""), d.text = d.text.replace(this.rules.other.listReplaceTask, "");
|
|
47574
|
+
for (let k = this.lexer.inlineQueue.length - 1;k >= 0; k--)
|
|
47575
|
+
if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)) {
|
|
47576
|
+
this.lexer.inlineQueue[k].src = this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask, "");
|
|
47577
|
+
break;
|
|
47578
|
+
}
|
|
47579
|
+
let g = this.rules.other.listTaskCheckbox.exec(p.raw);
|
|
47580
|
+
if (g) {
|
|
47581
|
+
let k = { type: "checkbox", raw: g[0] + " ", checked: g[0] !== "[ ]" };
|
|
47582
|
+
p.checked = k.checked, s.loose ? p.tokens[0] && ["paragraph", "text"].includes(p.tokens[0].type) && "tokens" in p.tokens[0] && p.tokens[0].tokens ? (p.tokens[0].raw = k.raw + p.tokens[0].raw, p.tokens[0].text = k.raw + p.tokens[0].text, p.tokens[0].tokens.unshift(k)) : p.tokens.unshift({ type: "paragraph", raw: k.raw, text: k.raw, tokens: [k] }) : p.tokens.unshift(k);
|
|
47583
|
+
}
|
|
47584
|
+
} else
|
|
47585
|
+
p.task && (p.task = false);
|
|
47586
|
+
}
|
|
47587
|
+
if (s.loose)
|
|
47588
|
+
for (let p of s.items) {
|
|
47589
|
+
p.loose = true;
|
|
47590
|
+
for (let d of p.tokens)
|
|
47591
|
+
d.type === "text" && (d.type = "paragraph");
|
|
47592
|
+
}
|
|
47593
|
+
return s;
|
|
47594
|
+
}
|
|
47595
|
+
}
|
|
47596
|
+
html(e) {
|
|
47597
|
+
let t = this.rules.block.html.exec(e);
|
|
47598
|
+
if (t) {
|
|
47599
|
+
let n = ae(t[0]);
|
|
47600
|
+
return { type: "html", block: true, raw: n, pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: n };
|
|
47601
|
+
}
|
|
47602
|
+
}
|
|
47603
|
+
def(e) {
|
|
47604
|
+
let t = this.rules.block.def.exec(e);
|
|
47605
|
+
if (t) {
|
|
47606
|
+
if (!this.rules.other.startAngleBracket.test(t[2]) && le(t[2], "()") !== -1)
|
|
47607
|
+
return;
|
|
47608
|
+
let n = v(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
|
|
47609
|
+
return { type: "def", tag: n, raw: A(t[0], `
|
|
47610
|
+
`), href: i, title: r };
|
|
47611
|
+
}
|
|
47612
|
+
}
|
|
47613
|
+
table(e) {
|
|
47614
|
+
let t = this.rules.block.table.exec(e);
|
|
47615
|
+
if (!t || !this.rules.other.tableDelimiter.test(t[2]))
|
|
47616
|
+
return;
|
|
47617
|
+
let n = oe(t[1]), i = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
47618
|
+
`) : [], o = { type: "table", raw: A(t[0], `
|
|
47619
|
+
`), header: [], align: [], rows: [] };
|
|
47620
|
+
if (n.length === i.length) {
|
|
47621
|
+
for (let s of i)
|
|
47622
|
+
this.rules.other.tableAlignRight.test(s) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(s) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(s) ? o.align.push("left") : o.align.push(null);
|
|
47623
|
+
for (let s = 0;s < n.length; s++)
|
|
47624
|
+
o.header.push({ text: n[s], tokens: this.lexer.inline(n[s]), header: true, align: o.align[s] });
|
|
47625
|
+
for (let s of r)
|
|
47626
|
+
o.rows.push(oe(s, o.header.length).map((l, u) => ({ text: l, tokens: this.lexer.inline(l), header: false, align: o.align[u] })));
|
|
47627
|
+
return o;
|
|
47628
|
+
}
|
|
47629
|
+
}
|
|
47630
|
+
lheading(e) {
|
|
47631
|
+
let t = this.rules.block.lheading.exec(e);
|
|
47632
|
+
if (t) {
|
|
47633
|
+
let n = t[1].trim();
|
|
47634
|
+
return { type: "heading", raw: A(t[0], `
|
|
47635
|
+
`), depth: t[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
|
|
47636
|
+
}
|
|
47637
|
+
}
|
|
47638
|
+
paragraph(e) {
|
|
47639
|
+
let t = this.rules.block.paragraph.exec(e);
|
|
47640
|
+
if (t) {
|
|
47641
|
+
let n = t[1].charAt(t[1].length - 1) === `
|
|
47642
|
+
` ? t[1].slice(0, -1) : t[1];
|
|
47643
|
+
return { type: "paragraph", raw: t[0], text: n, tokens: this.lexer.inline(n) };
|
|
47644
|
+
}
|
|
47645
|
+
}
|
|
47646
|
+
text(e) {
|
|
47647
|
+
let t = this.rules.block.text.exec(e);
|
|
47648
|
+
if (t)
|
|
47649
|
+
return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) };
|
|
47650
|
+
}
|
|
47651
|
+
escape(e) {
|
|
47652
|
+
let t = this.rules.inline.escape.exec(e);
|
|
47653
|
+
if (t)
|
|
47654
|
+
return { type: "escape", raw: t[0], text: t[1] };
|
|
47655
|
+
}
|
|
47656
|
+
tag(e) {
|
|
47657
|
+
let t = this.rules.inline.tag.exec(e);
|
|
47658
|
+
if (t)
|
|
47659
|
+
return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t[0] };
|
|
47660
|
+
}
|
|
47661
|
+
link(e) {
|
|
47662
|
+
if (this.lexer.state.linkParenPossible === false)
|
|
47663
|
+
return;
|
|
47664
|
+
let t = this.rules.inline.link.exec(e);
|
|
47665
|
+
if (t) {
|
|
47666
|
+
let n = t[0].charAt(0) === "!" ? 2 : 1;
|
|
47667
|
+
if (!this.options.pedantic && _e(e, t[1], n, this.rules))
|
|
47668
|
+
return;
|
|
47669
|
+
let i = t[2].trim();
|
|
47670
|
+
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(i)) {
|
|
47671
|
+
if (!this.rules.other.endAngleBracket.test(i))
|
|
47672
|
+
return;
|
|
47673
|
+
let s = A(i.slice(0, -1), "\\");
|
|
47674
|
+
if ((i.length - s.length) % 2 === 0)
|
|
47675
|
+
return;
|
|
47676
|
+
} else {
|
|
47677
|
+
let s = le(t[2], "()");
|
|
47678
|
+
if (s === -2)
|
|
47679
|
+
return;
|
|
47680
|
+
if (s > -1) {
|
|
47681
|
+
let u = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
|
|
47682
|
+
t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, u).trim(), t[3] = "";
|
|
47683
|
+
}
|
|
47684
|
+
}
|
|
47685
|
+
let r = t[2], o = "";
|
|
47686
|
+
if (this.options.pedantic) {
|
|
47687
|
+
let s = this.rules.other.pedanticHrefTitle.exec(r);
|
|
47688
|
+
s && (r = s[1], o = s[3]);
|
|
47689
|
+
} else
|
|
47690
|
+
o = t[3] ? t[3].slice(1, -1) : "";
|
|
47691
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(i) ? r = r.slice(1) : r = r.slice(1, -1)), Se(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: o && o.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
|
|
47692
|
+
}
|
|
47693
|
+
}
|
|
47694
|
+
reflink(e, t) {
|
|
47695
|
+
let n;
|
|
47696
|
+
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
47697
|
+
let i = n[0].charAt(0) === "!" ? 2 : 1;
|
|
47698
|
+
if (!this.options.pedantic && _e(e, n[1], i, this.rules))
|
|
47699
|
+
return;
|
|
47700
|
+
let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), o = t[v(r)];
|
|
47701
|
+
if (!o) {
|
|
47702
|
+
let s = n[0].charAt(0);
|
|
47703
|
+
return { type: "text", raw: s, text: s };
|
|
47704
|
+
}
|
|
47705
|
+
return Se(n, o, n[0], this.lexer, this.rules);
|
|
47706
|
+
}
|
|
47707
|
+
}
|
|
47708
|
+
emStrong(e, t, n = "") {
|
|
47709
|
+
let i = this.rules.inline.emStrongLDelim.exec(e);
|
|
47710
|
+
if (!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric))
|
|
47711
|
+
return;
|
|
47712
|
+
if (!(i[1] || i[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
47713
|
+
let o = [...i[0]].length - 1, s, l, u = o, c = 0, p = i[0][0], d = n === p, g = p === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
47714
|
+
for (g.lastIndex = 0, t = t.slice(-1 * e.length + o);(i = g.exec(t)) !== null; ) {
|
|
47715
|
+
if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s)
|
|
47716
|
+
continue;
|
|
47717
|
+
if (l = [...s].length, i[3] || i[4]) {
|
|
47718
|
+
u += l;
|
|
47719
|
+
continue;
|
|
47720
|
+
} else if (i[5] || i[6]) {
|
|
47721
|
+
if (o % 3 && !((o + l) % 3)) {
|
|
47722
|
+
c += l;
|
|
47723
|
+
continue;
|
|
47724
|
+
}
|
|
47725
|
+
if (d)
|
|
47726
|
+
break;
|
|
47727
|
+
}
|
|
47728
|
+
if (u -= l, u > 0)
|
|
47729
|
+
continue;
|
|
47730
|
+
l = Math.min(l, l + u + c);
|
|
47731
|
+
let k = [...i[0]][0].length, P = e.slice(0, o + i.index + k + l);
|
|
47732
|
+
if (Math.min(o, l) % 2) {
|
|
47733
|
+
let m = P.slice(1, -1);
|
|
47734
|
+
return { type: "em", raw: P, text: m, tokens: this.lexer.inlineTokens(m) };
|
|
47735
|
+
}
|
|
47736
|
+
let R = P.slice(2, -2);
|
|
47737
|
+
return { type: "strong", raw: P, text: R, tokens: this.lexer.inlineTokens(R) };
|
|
47738
|
+
}
|
|
47739
|
+
}
|
|
47740
|
+
}
|
|
47741
|
+
codespan(e) {
|
|
47742
|
+
let t = this.rules.inline.code.exec(e);
|
|
47743
|
+
if (t) {
|
|
47744
|
+
let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), i = this.rules.other.nonSpaceChar.test(n), r = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
|
|
47745
|
+
return i && r && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t[0], text: n };
|
|
47746
|
+
}
|
|
47747
|
+
}
|
|
47748
|
+
br(e) {
|
|
47749
|
+
let t = this.rules.inline.br.exec(e);
|
|
47750
|
+
if (t)
|
|
47751
|
+
return { type: "br", raw: t[0] };
|
|
47752
|
+
}
|
|
47753
|
+
del(e, t, n = "") {
|
|
47754
|
+
let i = this.rules.inline.delLDelim.exec(e);
|
|
47755
|
+
if (!i)
|
|
47756
|
+
return;
|
|
47757
|
+
if (!(i[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
47758
|
+
let o = [...i[0]].length - 1, s, l, u = o, c = this.rules.inline.delRDelim;
|
|
47759
|
+
for (c.lastIndex = 0, t = t.slice(-1 * e.length + o);(i = c.exec(t)) !== null; ) {
|
|
47760
|
+
if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s || (l = [...s].length, l !== o))
|
|
47761
|
+
continue;
|
|
47762
|
+
if (i[3] || i[4]) {
|
|
47763
|
+
u += l;
|
|
47764
|
+
continue;
|
|
47765
|
+
}
|
|
47766
|
+
if (u -= l, u > 0)
|
|
47767
|
+
continue;
|
|
47768
|
+
l = Math.min(l, l + u);
|
|
47769
|
+
let p = [...i[0]][0].length, d = e.slice(0, o + i.index + p + l), g = d.slice(o, -o);
|
|
47770
|
+
return { type: "del", raw: d, text: g, tokens: this.lexer.inlineTokens(g) };
|
|
47771
|
+
}
|
|
47772
|
+
}
|
|
47773
|
+
}
|
|
47774
|
+
autolink(e) {
|
|
47775
|
+
let t = this.rules.inline.autolink.exec(e);
|
|
47776
|
+
if (t) {
|
|
47777
|
+
let n, i;
|
|
47778
|
+
return t[2] === "@" ? (n = t[1], i = "mailto:" + n) : (n = t[1], i = n), { type: "link", raw: t[0], text: n, href: i, autolink: true, tokens: [{ type: "text", raw: n, text: n }] };
|
|
47779
|
+
}
|
|
47780
|
+
}
|
|
47781
|
+
url(e) {
|
|
47782
|
+
let t;
|
|
47783
|
+
if (t = this.rules.inline.url.exec(e)) {
|
|
47784
|
+
let n, i;
|
|
47785
|
+
if (t[2] === "@")
|
|
47786
|
+
n = t[0], i = "mailto:" + n;
|
|
47787
|
+
else {
|
|
47788
|
+
let r;
|
|
47789
|
+
do
|
|
47790
|
+
r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
|
|
47791
|
+
while (r !== t[0]);
|
|
47792
|
+
n = t[0], t[1] === "www." ? i = "http://" + t[0] : i = t[0];
|
|
47793
|
+
}
|
|
47794
|
+
return { type: "link", raw: t[0], text: n, href: i, autolink: true, tokens: [{ type: "text", raw: n, text: n }] };
|
|
47795
|
+
}
|
|
47796
|
+
}
|
|
47797
|
+
inlineText(e) {
|
|
47798
|
+
let t = this.rules.inline.text.exec(e);
|
|
47799
|
+
if (t) {
|
|
47800
|
+
let n = this.lexer.state.inRawBlock;
|
|
47801
|
+
return { type: "text", raw: t[0], text: n ? t[0] : ye(t[0]), escaped: n };
|
|
47802
|
+
}
|
|
47803
|
+
}
|
|
47804
|
+
};
|
|
47805
|
+
var T = class a {
|
|
47806
|
+
tokens;
|
|
47807
|
+
options;
|
|
47808
|
+
state;
|
|
47809
|
+
inlineQueue;
|
|
47810
|
+
tokenizer;
|
|
47811
|
+
constructor(e) {
|
|
47812
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || y, this.options.tokenizer = this.options.tokenizer || new _, this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, linkEmitted: false, linkParenPossible: true, top: true };
|
|
47813
|
+
let t = { other: x, block: F.normal, inline: Z.normal };
|
|
47814
|
+
this.options.pedantic ? (t.block = F.pedantic, t.inline = Z.pedantic) : this.options.gfm && (t.block = F.gfm, this.options.breaks ? t.inline = Z.breaks : t.inline = Z.gfm), this.tokenizer.rules = t;
|
|
47815
|
+
}
|
|
47816
|
+
static get rules() {
|
|
47817
|
+
return { block: F, inline: Z };
|
|
47818
|
+
}
|
|
47819
|
+
static lex(e, t) {
|
|
47820
|
+
return new a(t).lex(e);
|
|
47821
|
+
}
|
|
47822
|
+
static lexInline(e, t) {
|
|
47823
|
+
return new a(t).inlineTokens(e);
|
|
47824
|
+
}
|
|
47825
|
+
lex(e) {
|
|
47826
|
+
e = e.replace(x.carriageReturn, `
|
|
47827
|
+
`), this.blockTokens(e, this.tokens);
|
|
47828
|
+
for (let t = 0;t < this.inlineQueue.length; t++) {
|
|
47829
|
+
let n = this.inlineQueue[t];
|
|
47830
|
+
this.inlineTokens(n.src, n.tokens);
|
|
47831
|
+
}
|
|
47832
|
+
return this.inlineQueue = [], this.tokens;
|
|
47833
|
+
}
|
|
47834
|
+
blockTokens(e, t = [], n = false) {
|
|
47835
|
+
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(x.tabCharGlobal, " ").replace(x.spaceLine, ""));
|
|
47836
|
+
let i = 1 / 0;
|
|
47837
|
+
for (;e; ) {
|
|
47838
|
+
if (e.length < i)
|
|
47839
|
+
i = e.length;
|
|
47840
|
+
else {
|
|
47841
|
+
this.infiniteLoopError(e.charCodeAt(0));
|
|
47842
|
+
break;
|
|
47843
|
+
}
|
|
47844
|
+
let r;
|
|
47845
|
+
if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), true) : false))
|
|
47846
|
+
continue;
|
|
47847
|
+
if (r = this.tokenizer.space(e)) {
|
|
47848
|
+
e = e.substring(r.raw.length);
|
|
47849
|
+
let s = t.at(-1);
|
|
47850
|
+
r.raw.length === 1 && s !== undefined ? s.raw += `
|
|
47851
|
+
` : t.push(r);
|
|
47852
|
+
continue;
|
|
47853
|
+
}
|
|
47854
|
+
if (r = this.tokenizer.code(e)) {
|
|
47855
|
+
e = e.substring(r.raw.length);
|
|
47856
|
+
let s = t.at(-1);
|
|
47857
|
+
s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
|
|
47858
|
+
`) ? "" : `
|
|
47859
|
+
`) + r.raw, s.text += `
|
|
47860
|
+
` + r.text, this.inlineQueue.at(-1).src = s.text) : t.push(r);
|
|
47861
|
+
continue;
|
|
47862
|
+
}
|
|
47863
|
+
if (r = this.tokenizer.fences(e)) {
|
|
47864
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47865
|
+
continue;
|
|
47866
|
+
}
|
|
47867
|
+
if (r = this.tokenizer.heading(e)) {
|
|
47868
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47869
|
+
continue;
|
|
47870
|
+
}
|
|
47871
|
+
if (r = this.tokenizer.hr(e)) {
|
|
47872
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47873
|
+
continue;
|
|
47874
|
+
}
|
|
47875
|
+
if (r = this.tokenizer.blockquote(e)) {
|
|
47876
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47877
|
+
continue;
|
|
47878
|
+
}
|
|
47879
|
+
if (r = this.tokenizer.list(e)) {
|
|
47880
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47881
|
+
continue;
|
|
47882
|
+
}
|
|
47883
|
+
if (r = this.tokenizer.html(e)) {
|
|
47884
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47885
|
+
continue;
|
|
47886
|
+
}
|
|
47887
|
+
if (r = this.tokenizer.def(e)) {
|
|
47888
|
+
e = e.substring(r.raw.length);
|
|
47889
|
+
let s = t.at(-1);
|
|
47890
|
+
s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
|
|
47891
|
+
`) ? "" : `
|
|
47892
|
+
`) + r.raw, s.text += `
|
|
47893
|
+
` + r.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = { href: r.href, title: r.title }, t.push(r));
|
|
47894
|
+
continue;
|
|
47895
|
+
}
|
|
47896
|
+
if (r = this.tokenizer.table(e)) {
|
|
47897
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47898
|
+
continue;
|
|
47899
|
+
}
|
|
47900
|
+
if (r = this.tokenizer.lheading(e)) {
|
|
47901
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47902
|
+
continue;
|
|
47903
|
+
}
|
|
47904
|
+
let o = e;
|
|
47905
|
+
if (this.options.extensions?.startBlock) {
|
|
47906
|
+
let s = 1 / 0, l = e.slice(1), u;
|
|
47907
|
+
this.options.extensions.startBlock.forEach((c) => {
|
|
47908
|
+
u = c.call({ lexer: this }, l), typeof u == "number" && u >= 0 && (s = Math.min(s, u));
|
|
47909
|
+
}), s < 1 / 0 && s >= 0 && (o = e.substring(0, s + 1));
|
|
47910
|
+
}
|
|
47911
|
+
if (this.state.top && (r = this.tokenizer.paragraph(o))) {
|
|
47912
|
+
let s = t.at(-1);
|
|
47913
|
+
n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
|
|
47914
|
+
`) ? "" : `
|
|
47915
|
+
`) + r.raw, s.text += `
|
|
47916
|
+
` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r), n = o.length !== e.length, e = e.substring(r.raw.length);
|
|
47917
|
+
continue;
|
|
47918
|
+
}
|
|
47919
|
+
if (r = this.tokenizer.text(e)) {
|
|
47920
|
+
e = e.substring(r.raw.length);
|
|
47921
|
+
let s = t.at(-1);
|
|
47922
|
+
s?.type === "text" ? (s.raw += (s.raw.endsWith(`
|
|
47923
|
+
`) ? "" : `
|
|
47924
|
+
`) + r.raw, s.text += `
|
|
47925
|
+
` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r);
|
|
47926
|
+
continue;
|
|
47927
|
+
}
|
|
47928
|
+
if (e) {
|
|
47929
|
+
this.infiniteLoopError(e.charCodeAt(0));
|
|
47930
|
+
break;
|
|
47931
|
+
}
|
|
47932
|
+
}
|
|
47933
|
+
return this.state.top = true, t;
|
|
47934
|
+
}
|
|
47935
|
+
inline(e, t = []) {
|
|
47936
|
+
return this.inlineQueue.push({ src: e, tokens: t }), t;
|
|
47937
|
+
}
|
|
47938
|
+
linkInText(e) {
|
|
47939
|
+
if (!e.includes("["))
|
|
47940
|
+
return false;
|
|
47941
|
+
let t = this.tokenizer.rules.inline.link;
|
|
47942
|
+
for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))
|
|
47943
|
+
if (t.test(n[0]) && e.charAt(n.index - 1) !== "!")
|
|
47944
|
+
return true;
|
|
47945
|
+
for (let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
|
|
47946
|
+
let i = n[0], r = i.lastIndexOf("[");
|
|
47947
|
+
if (!(i.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, v(i.slice(r + 1, -1)))) && !(r > 1 && this.linkInText(i.slice(1, r - 1))))
|
|
47948
|
+
return true;
|
|
47949
|
+
}
|
|
47950
|
+
return false;
|
|
47951
|
+
}
|
|
47952
|
+
inlineTokens(e, t = []) {
|
|
47953
|
+
this.tokenizer.lexer = this;
|
|
47954
|
+
let n = this.state.linkParenPossible;
|
|
47955
|
+
this.state.linkParenPossible = n && e.includes(")");
|
|
47956
|
+
try {
|
|
47957
|
+
return this.#e(e, t);
|
|
47958
|
+
} finally {
|
|
47959
|
+
this.state.linkParenPossible = n;
|
|
47960
|
+
}
|
|
47961
|
+
}
|
|
47962
|
+
#e(e, t) {
|
|
47963
|
+
let n = e;
|
|
47964
|
+
if (this.tokens.links && e.includes("[")) {
|
|
47965
|
+
let s = this.tokenizer.rules.inline.reflinkSearch, l = (u) => {
|
|
47966
|
+
let c = u.lastIndexOf("[");
|
|
47967
|
+
if (!Object.hasOwn(this.tokens.links, v(u.slice(c + 1, -1))))
|
|
47968
|
+
return u;
|
|
47969
|
+
if (c > 1 && u.charAt(0) !== "!") {
|
|
47970
|
+
let p = u.slice(1, c - 1);
|
|
47971
|
+
if (this.linkInText(p))
|
|
47972
|
+
return "[" + p.replace(s, l) + "][" + "a".repeat(u.length - c - 2) + "]";
|
|
47973
|
+
}
|
|
47974
|
+
return "[" + "a".repeat(u.length - 2) + "]";
|
|
47975
|
+
};
|
|
47976
|
+
n = n.replace(s, l);
|
|
47977
|
+
}
|
|
47978
|
+
n = n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode, (s, l, u) => u ? "+".repeat(s.length) : l ? l + s.slice(l.length, -l.length).replace(/`/g, "+") + l : s), n = n.replace(this.tokenizer.rules.inline.blockSkip, (s, l, u) => {
|
|
47979
|
+
let c = u ? u.length : 0;
|
|
47980
|
+
return s.slice(0, c) + "[" + "a".repeat(s.length - c - 2) + "]";
|
|
47981
|
+
}), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
47982
|
+
let i = false, r = "", o = 1 / 0;
|
|
47983
|
+
for (;e; ) {
|
|
47984
|
+
if (e.length < o)
|
|
47985
|
+
o = e.length;
|
|
47986
|
+
else {
|
|
47987
|
+
this.infiniteLoopError(e.charCodeAt(0));
|
|
47988
|
+
break;
|
|
47989
|
+
}
|
|
47990
|
+
i || (r = ""), i = false;
|
|
47991
|
+
let s;
|
|
47992
|
+
if (this.options.extensions?.inline?.some((u) => (s = u.call({ lexer: this }, e, t)) ? (e = e.substring(s.raw.length), t.push(s), true) : false))
|
|
47993
|
+
continue;
|
|
47994
|
+
if (s = this.tokenizer.escape(e)) {
|
|
47995
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
47996
|
+
continue;
|
|
47997
|
+
}
|
|
47998
|
+
if (s = this.tokenizer.tag(e)) {
|
|
47999
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
48000
|
+
continue;
|
|
48001
|
+
}
|
|
48002
|
+
if (s = this.tokenizer.link(e)) {
|
|
48003
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
48004
|
+
continue;
|
|
48005
|
+
}
|
|
48006
|
+
if (s = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
48007
|
+
e = e.substring(s.raw.length);
|
|
48008
|
+
let u = t.at(-1);
|
|
48009
|
+
s.type === "text" && u?.type === "text" ? (u.raw += s.raw, u.text += s.text) : t.push(s);
|
|
48010
|
+
continue;
|
|
48011
|
+
}
|
|
48012
|
+
if (s = this.tokenizer.emStrong(e, n, r)) {
|
|
48013
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
48014
|
+
continue;
|
|
48015
|
+
}
|
|
48016
|
+
if (s = this.tokenizer.codespan(e)) {
|
|
48017
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
48018
|
+
continue;
|
|
48019
|
+
}
|
|
48020
|
+
if (s = this.tokenizer.br(e)) {
|
|
48021
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
48022
|
+
continue;
|
|
48023
|
+
}
|
|
48024
|
+
if (s = this.tokenizer.del(e, n, r)) {
|
|
48025
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
48026
|
+
continue;
|
|
48027
|
+
}
|
|
48028
|
+
if (s = this.tokenizer.autolink(e)) {
|
|
48029
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
48030
|
+
continue;
|
|
48031
|
+
}
|
|
48032
|
+
if (!this.state.inLink && (s = this.tokenizer.url(e))) {
|
|
48033
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
48034
|
+
continue;
|
|
48035
|
+
}
|
|
48036
|
+
let l = e;
|
|
48037
|
+
if (this.options.extensions?.startInline) {
|
|
48038
|
+
let u = 1 / 0, c = e.slice(1), p;
|
|
48039
|
+
this.options.extensions.startInline.forEach((d) => {
|
|
48040
|
+
p = d.call({ lexer: this }, c), typeof p == "number" && p >= 0 && (u = Math.min(u, p));
|
|
48041
|
+
}), u < 1 / 0 && u >= 0 && (l = e.substring(0, u + 1));
|
|
48042
|
+
}
|
|
48043
|
+
if (s = this.tokenizer.inlineText(l)) {
|
|
48044
|
+
e = e.substring(s.raw.length), s.raw.slice(-1) !== "_" && (r = s.raw.slice(-1)), i = true;
|
|
48045
|
+
let u = t.at(-1);
|
|
48046
|
+
u?.type === "text" ? (u.raw += s.raw, u.text += s.text) : t.push(s);
|
|
48047
|
+
continue;
|
|
48048
|
+
}
|
|
48049
|
+
if (e) {
|
|
48050
|
+
this.infiniteLoopError(e.charCodeAt(0));
|
|
48051
|
+
break;
|
|
48052
|
+
}
|
|
48053
|
+
}
|
|
48054
|
+
return t;
|
|
48055
|
+
}
|
|
48056
|
+
infiniteLoopError(e) {
|
|
48057
|
+
let t = "Infinite loop on byte: " + e;
|
|
48058
|
+
if (this.options.silent)
|
|
48059
|
+
console.error(t);
|
|
48060
|
+
else
|
|
48061
|
+
throw new Error(t);
|
|
48062
|
+
}
|
|
48063
|
+
};
|
|
48064
|
+
var $ = class {
|
|
48065
|
+
options;
|
|
48066
|
+
parser;
|
|
48067
|
+
constructor(e) {
|
|
48068
|
+
this.options = e || y;
|
|
48069
|
+
}
|
|
48070
|
+
space(e) {
|
|
48071
|
+
return "";
|
|
48072
|
+
}
|
|
48073
|
+
code({ text: e, lang: t, escaped: n }) {
|
|
48074
|
+
let i = (t || "").match(x.notSpaceStart)?.[0], r = e ? e.replace(x.endingNewline, "") + `
|
|
48075
|
+
` : "";
|
|
48076
|
+
return i ? '<pre><code class="language-' + w(i) + '">' + (n ? r : w(r, true)) + `</code></pre>
|
|
48077
|
+
` : "<pre><code>" + (n ? r : w(r, true)) + `</code></pre>
|
|
48078
|
+
`;
|
|
48079
|
+
}
|
|
48080
|
+
blockquote({ tokens: e }) {
|
|
48081
|
+
return `<blockquote>
|
|
48082
|
+
${this.parser.parse(e)}</blockquote>
|
|
48083
|
+
`;
|
|
48084
|
+
}
|
|
48085
|
+
html({ text: e }) {
|
|
48086
|
+
return e;
|
|
48087
|
+
}
|
|
48088
|
+
def(e) {
|
|
48089
|
+
return "";
|
|
48090
|
+
}
|
|
48091
|
+
heading({ tokens: e, depth: t }) {
|
|
48092
|
+
return `<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
48093
|
+
`;
|
|
48094
|
+
}
|
|
48095
|
+
hr(e) {
|
|
48096
|
+
return `<hr>
|
|
48097
|
+
`;
|
|
48098
|
+
}
|
|
48099
|
+
list(e) {
|
|
48100
|
+
let { ordered: t, start: n } = e, i = "";
|
|
48101
|
+
for (let s = 0;s < e.items.length; s++) {
|
|
48102
|
+
let l = e.items[s];
|
|
48103
|
+
i += this.listitem(l);
|
|
48104
|
+
}
|
|
48105
|
+
let r = t ? "ol" : "ul", o = t && n !== 1 ? ' start="' + n + '"' : "";
|
|
48106
|
+
return "<" + r + o + `>
|
|
48107
|
+
` + i + "</" + r + `>
|
|
48108
|
+
`;
|
|
48109
|
+
}
|
|
48110
|
+
listitem(e) {
|
|
48111
|
+
return `<li>${this.parser.parse(e.tokens)}</li>
|
|
48112
|
+
`;
|
|
48113
|
+
}
|
|
48114
|
+
checkbox({ checked: e }) {
|
|
48115
|
+
return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
|
|
48116
|
+
}
|
|
48117
|
+
paragraph({ tokens: e }) {
|
|
48118
|
+
return `<p>${this.parser.parseInline(e)}</p>
|
|
48119
|
+
`;
|
|
48120
|
+
}
|
|
48121
|
+
table(e) {
|
|
48122
|
+
let t = "", n = "";
|
|
48123
|
+
for (let r = 0;r < e.header.length; r++)
|
|
48124
|
+
n += this.tablecell(e.header[r]);
|
|
48125
|
+
t += this.tablerow({ text: n });
|
|
48126
|
+
let i = "";
|
|
48127
|
+
for (let r = 0;r < e.rows.length; r++) {
|
|
48128
|
+
let o = e.rows[r];
|
|
48129
|
+
n = "";
|
|
48130
|
+
for (let s = 0;s < o.length; s++)
|
|
48131
|
+
n += this.tablecell(o[s]);
|
|
48132
|
+
i += this.tablerow({ text: n });
|
|
48133
|
+
}
|
|
48134
|
+
return i && (i = `<tbody>${i}</tbody>`), `<table>
|
|
48135
|
+
<thead>
|
|
48136
|
+
` + t + `</thead>
|
|
48137
|
+
` + i + `</table>
|
|
48138
|
+
`;
|
|
48139
|
+
}
|
|
48140
|
+
tablerow({ text: e }) {
|
|
48141
|
+
return `<tr>
|
|
48142
|
+
${e}</tr>
|
|
48143
|
+
`;
|
|
48144
|
+
}
|
|
48145
|
+
tablecell(e) {
|
|
48146
|
+
let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
|
|
48147
|
+
return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
|
|
48148
|
+
`;
|
|
48149
|
+
}
|
|
48150
|
+
strong({ tokens: e }) {
|
|
48151
|
+
return `<strong>${this.parser.parseInline(e)}</strong>`;
|
|
48152
|
+
}
|
|
48153
|
+
em({ tokens: e }) {
|
|
48154
|
+
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
48155
|
+
}
|
|
48156
|
+
codespan({ text: e }) {
|
|
48157
|
+
return `<code>${w(e, true)}</code>`;
|
|
48158
|
+
}
|
|
48159
|
+
br(e) {
|
|
48160
|
+
return "<br>";
|
|
48161
|
+
}
|
|
48162
|
+
del({ tokens: e }) {
|
|
48163
|
+
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
48164
|
+
}
|
|
48165
|
+
link({ href: e, title: t, text: n, tokens: i, autolink: r }) {
|
|
48166
|
+
let o = r ? w(n, true) : this.parser.parseInline(i), s = ie(e);
|
|
48167
|
+
if (s === null)
|
|
48168
|
+
return o;
|
|
48169
|
+
e = w(s, r);
|
|
48170
|
+
let l = '<a href="' + e + '"';
|
|
48171
|
+
return t && (l += ' title="' + w(t) + '"'), l += ">" + o + "</a>", l;
|
|
48172
|
+
}
|
|
48173
|
+
image({ href: e, title: t, text: n, tokens: i }) {
|
|
48174
|
+
i && (n = this.parser.parseInline(i, this.parser.textRenderer));
|
|
48175
|
+
let r = ie(e);
|
|
48176
|
+
if (r === null)
|
|
48177
|
+
return w(n);
|
|
48178
|
+
e = r;
|
|
48179
|
+
let o = `<img src="${w(e)}" alt="${w(n)}"`;
|
|
48180
|
+
return t && (o += ` title="${w(t)}"`), o += ">", o;
|
|
48181
|
+
}
|
|
48182
|
+
text(e) {
|
|
48183
|
+
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : ("escaped" in e) && e.escaped ? e.text : w(e.text);
|
|
48184
|
+
}
|
|
48185
|
+
};
|
|
48186
|
+
var z = class {
|
|
48187
|
+
strong({ text: e }) {
|
|
48188
|
+
return e;
|
|
48189
|
+
}
|
|
48190
|
+
em({ text: e }) {
|
|
48191
|
+
return e;
|
|
48192
|
+
}
|
|
48193
|
+
codespan({ text: e }) {
|
|
48194
|
+
return e;
|
|
48195
|
+
}
|
|
48196
|
+
del({ text: e }) {
|
|
48197
|
+
return e;
|
|
48198
|
+
}
|
|
48199
|
+
html({ text: e }) {
|
|
48200
|
+
return e;
|
|
48201
|
+
}
|
|
48202
|
+
text({ text: e }) {
|
|
48203
|
+
return e;
|
|
48204
|
+
}
|
|
48205
|
+
link({ text: e }) {
|
|
48206
|
+
return "" + e;
|
|
48207
|
+
}
|
|
48208
|
+
image({ text: e }) {
|
|
48209
|
+
return "" + e;
|
|
48210
|
+
}
|
|
48211
|
+
br() {
|
|
48212
|
+
return "";
|
|
48213
|
+
}
|
|
48214
|
+
checkbox({ raw: e }) {
|
|
48215
|
+
return e;
|
|
48216
|
+
}
|
|
48217
|
+
};
|
|
48218
|
+
var O = class a2 {
|
|
48219
|
+
options;
|
|
48220
|
+
renderer;
|
|
48221
|
+
textRenderer;
|
|
48222
|
+
constructor(e) {
|
|
48223
|
+
this.options = e || y, this.options.renderer = this.options.renderer || new $, this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new z;
|
|
48224
|
+
}
|
|
48225
|
+
static parse(e, t) {
|
|
48226
|
+
return new a2(t).parse(e);
|
|
48227
|
+
}
|
|
48228
|
+
static parseInline(e, t) {
|
|
48229
|
+
return new a2(t).parseInline(e);
|
|
48230
|
+
}
|
|
48231
|
+
parse(e) {
|
|
48232
|
+
this.renderer.parser = this;
|
|
48233
|
+
let t = "";
|
|
48234
|
+
for (let n = 0;n < e.length; n++) {
|
|
48235
|
+
let i = e[n];
|
|
48236
|
+
if (this.options.extensions?.renderers?.[i.type]) {
|
|
48237
|
+
let o = i, s = this.options.extensions.renderers[o.type].call({ parser: this }, o);
|
|
48238
|
+
if (s !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "checkbox", "html", "def", "paragraph", "text"].includes(o.type)) {
|
|
48239
|
+
t += s || "";
|
|
48240
|
+
continue;
|
|
48241
|
+
}
|
|
48242
|
+
}
|
|
48243
|
+
let r = i;
|
|
48244
|
+
switch (r.type) {
|
|
48245
|
+
case "space": {
|
|
48246
|
+
t += this.renderer.space(r);
|
|
48247
|
+
break;
|
|
48248
|
+
}
|
|
48249
|
+
case "hr": {
|
|
48250
|
+
t += this.renderer.hr(r);
|
|
48251
|
+
break;
|
|
48252
|
+
}
|
|
48253
|
+
case "heading": {
|
|
48254
|
+
t += this.renderer.heading(r);
|
|
48255
|
+
break;
|
|
48256
|
+
}
|
|
48257
|
+
case "code": {
|
|
48258
|
+
t += this.renderer.code(r);
|
|
48259
|
+
break;
|
|
48260
|
+
}
|
|
48261
|
+
case "table": {
|
|
48262
|
+
t += this.renderer.table(r);
|
|
48263
|
+
break;
|
|
48264
|
+
}
|
|
48265
|
+
case "blockquote": {
|
|
48266
|
+
t += this.renderer.blockquote(r);
|
|
48267
|
+
break;
|
|
48268
|
+
}
|
|
48269
|
+
case "list": {
|
|
48270
|
+
t += this.renderer.list(r);
|
|
48271
|
+
break;
|
|
48272
|
+
}
|
|
48273
|
+
case "checkbox": {
|
|
48274
|
+
t += this.renderer.checkbox(r);
|
|
48275
|
+
break;
|
|
48276
|
+
}
|
|
48277
|
+
case "html": {
|
|
48278
|
+
t += this.renderer.html(r);
|
|
48279
|
+
break;
|
|
48280
|
+
}
|
|
48281
|
+
case "def": {
|
|
48282
|
+
t += this.renderer.def(r);
|
|
48283
|
+
break;
|
|
48284
|
+
}
|
|
48285
|
+
case "paragraph": {
|
|
48286
|
+
t += this.renderer.paragraph(r);
|
|
48287
|
+
break;
|
|
48288
|
+
}
|
|
48289
|
+
case "text": {
|
|
48290
|
+
t += this.renderer.text(r);
|
|
48291
|
+
break;
|
|
48292
|
+
}
|
|
48293
|
+
default: {
|
|
48294
|
+
let o = 'Token with "' + r.type + '" type was not found.';
|
|
48295
|
+
if (this.options.silent)
|
|
48296
|
+
return console.error(o), "";
|
|
48297
|
+
throw new Error(o);
|
|
48298
|
+
}
|
|
48299
|
+
}
|
|
48300
|
+
}
|
|
48301
|
+
return t;
|
|
48302
|
+
}
|
|
48303
|
+
parseInline(e, t = this.renderer) {
|
|
48304
|
+
this.renderer.parser = this;
|
|
48305
|
+
let n = "";
|
|
48306
|
+
for (let i = 0;i < e.length; i++) {
|
|
48307
|
+
let r = e[i];
|
|
48308
|
+
if (this.options.extensions?.renderers?.[r.type]) {
|
|
48309
|
+
let s = this.options.extensions.renderers[r.type].call({ parser: this }, r);
|
|
48310
|
+
if (s !== false || !["escape", "html", "link", "image", "checkbox", "strong", "em", "codespan", "br", "del", "text"].includes(r.type)) {
|
|
48311
|
+
n += s || "";
|
|
48312
|
+
continue;
|
|
48313
|
+
}
|
|
48314
|
+
}
|
|
48315
|
+
let o = r;
|
|
48316
|
+
switch (o.type) {
|
|
48317
|
+
case "escape": {
|
|
48318
|
+
n += t.text(o);
|
|
48319
|
+
break;
|
|
48320
|
+
}
|
|
48321
|
+
case "html": {
|
|
48322
|
+
n += t.html(o);
|
|
48323
|
+
break;
|
|
48324
|
+
}
|
|
48325
|
+
case "link": {
|
|
48326
|
+
n += t.link(o);
|
|
48327
|
+
break;
|
|
48328
|
+
}
|
|
48329
|
+
case "image": {
|
|
48330
|
+
n += t.image(o);
|
|
48331
|
+
break;
|
|
48332
|
+
}
|
|
48333
|
+
case "checkbox": {
|
|
48334
|
+
n += t.checkbox(o);
|
|
48335
|
+
break;
|
|
48336
|
+
}
|
|
48337
|
+
case "strong": {
|
|
48338
|
+
n += t.strong(o);
|
|
48339
|
+
break;
|
|
48340
|
+
}
|
|
48341
|
+
case "em": {
|
|
48342
|
+
n += t.em(o);
|
|
48343
|
+
break;
|
|
48344
|
+
}
|
|
48345
|
+
case "codespan": {
|
|
48346
|
+
n += t.codespan(o);
|
|
48347
|
+
break;
|
|
48348
|
+
}
|
|
48349
|
+
case "br": {
|
|
48350
|
+
n += t.br(o);
|
|
48351
|
+
break;
|
|
48352
|
+
}
|
|
48353
|
+
case "del": {
|
|
48354
|
+
n += t.del(o);
|
|
48355
|
+
break;
|
|
48356
|
+
}
|
|
48357
|
+
case "text": {
|
|
48358
|
+
n += t.text(o);
|
|
48359
|
+
break;
|
|
48360
|
+
}
|
|
48361
|
+
default: {
|
|
48362
|
+
let s = 'Token with "' + o.type + '" type was not found.';
|
|
48363
|
+
if (this.options.silent)
|
|
48364
|
+
return console.error(s), "";
|
|
48365
|
+
throw new Error(s);
|
|
48366
|
+
}
|
|
48367
|
+
}
|
|
48368
|
+
}
|
|
48369
|
+
return n;
|
|
48370
|
+
}
|
|
48371
|
+
};
|
|
48372
|
+
var L = class {
|
|
48373
|
+
options;
|
|
48374
|
+
block;
|
|
48375
|
+
constructor(e) {
|
|
48376
|
+
this.options = e || y;
|
|
48377
|
+
}
|
|
48378
|
+
static passThroughHooks = new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
|
|
48379
|
+
static passThroughHooksRespectAsync = new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
48380
|
+
preprocess(e) {
|
|
48381
|
+
return e;
|
|
48382
|
+
}
|
|
48383
|
+
postprocess(e) {
|
|
48384
|
+
return e;
|
|
48385
|
+
}
|
|
48386
|
+
processAllTokens(e) {
|
|
48387
|
+
return e;
|
|
48388
|
+
}
|
|
48389
|
+
emStrongMask(e) {
|
|
48390
|
+
return e;
|
|
48391
|
+
}
|
|
48392
|
+
provideLexer(e = this.block) {
|
|
48393
|
+
return e ? T.lex : T.lexInline;
|
|
48394
|
+
}
|
|
48395
|
+
provideParser(e = this.block) {
|
|
48396
|
+
return e ? O.parse : O.parseInline;
|
|
48397
|
+
}
|
|
48398
|
+
};
|
|
48399
|
+
function C(a3, e) {
|
|
48400
|
+
if (Array.isArray(e))
|
|
48401
|
+
for (let t = 0;t < e.length; t++)
|
|
48402
|
+
a3.push(e[t]);
|
|
48403
|
+
else
|
|
48404
|
+
a3.push(e);
|
|
48405
|
+
}
|
|
48406
|
+
var U = class {
|
|
48407
|
+
defaults = B();
|
|
48408
|
+
options = this.setOptions;
|
|
48409
|
+
parse = this.parseMarkdown(true);
|
|
48410
|
+
parseInline = this.parseMarkdown(false);
|
|
48411
|
+
Parser = O;
|
|
48412
|
+
Renderer = $;
|
|
48413
|
+
TextRenderer = z;
|
|
48414
|
+
Lexer = T;
|
|
48415
|
+
Tokenizer = _;
|
|
48416
|
+
Hooks = L;
|
|
48417
|
+
constructor(...e) {
|
|
48418
|
+
this.use(...e);
|
|
48419
|
+
}
|
|
48420
|
+
walkTokens(e, t) {
|
|
48421
|
+
let n = [];
|
|
48422
|
+
for (let i of e)
|
|
48423
|
+
switch (C(n, t.call(this, i)), i.type) {
|
|
48424
|
+
case "table": {
|
|
48425
|
+
let r = i;
|
|
48426
|
+
for (let o of r.header)
|
|
48427
|
+
C(n, this.walkTokens(o.tokens, t));
|
|
48428
|
+
for (let o of r.rows)
|
|
48429
|
+
for (let s of o)
|
|
48430
|
+
C(n, this.walkTokens(s.tokens, t));
|
|
48431
|
+
break;
|
|
48432
|
+
}
|
|
48433
|
+
case "list": {
|
|
48434
|
+
let r = i;
|
|
48435
|
+
C(n, this.walkTokens(r.items, t));
|
|
48436
|
+
break;
|
|
48437
|
+
}
|
|
48438
|
+
default: {
|
|
48439
|
+
let r = i;
|
|
48440
|
+
this.defaults.extensions?.childTokens?.[r.type] ? this.defaults.extensions.childTokens[r.type].forEach((o) => {
|
|
48441
|
+
let s = r[o].flat(1 / 0);
|
|
48442
|
+
C(n, this.walkTokens(s, t));
|
|
48443
|
+
}) : r.tokens && C(n, this.walkTokens(r.tokens, t));
|
|
48444
|
+
}
|
|
48445
|
+
}
|
|
48446
|
+
return n;
|
|
48447
|
+
}
|
|
48448
|
+
use(...e) {
|
|
48449
|
+
let t = this.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
48450
|
+
return e.forEach((n) => {
|
|
48451
|
+
let i = { ...n };
|
|
48452
|
+
if (i.async = this.defaults.async || i.async || false, n.extensions && (n.extensions.forEach((r) => {
|
|
48453
|
+
if (!r.name)
|
|
48454
|
+
throw new Error("extension name required");
|
|
48455
|
+
if ("renderer" in r) {
|
|
48456
|
+
let o = t.renderers[r.name];
|
|
48457
|
+
o ? t.renderers[r.name] = function(...s) {
|
|
48458
|
+
let l = r.renderer.apply(this, s);
|
|
48459
|
+
return l === false && (l = o.apply(this, s)), l;
|
|
48460
|
+
} : t.renderers[r.name] = r.renderer;
|
|
48461
|
+
}
|
|
48462
|
+
if ("tokenizer" in r) {
|
|
48463
|
+
if (!r.level || r.level !== "block" && r.level !== "inline")
|
|
48464
|
+
throw new Error("extension level must be 'block' or 'inline'");
|
|
48465
|
+
let o = t[r.level];
|
|
48466
|
+
o ? o.unshift(r.tokenizer) : t[r.level] = [r.tokenizer], r.start && (r.level === "block" ? t.startBlock ? t.startBlock.push(r.start) : t.startBlock = [r.start] : r.level === "inline" && (t.startInline ? t.startInline.push(r.start) : t.startInline = [r.start]));
|
|
48467
|
+
}
|
|
48468
|
+
"childTokens" in r && r.childTokens && (t.childTokens[r.name] = r.childTokens);
|
|
48469
|
+
}), i.extensions = t), n.renderer) {
|
|
48470
|
+
let r = this.defaults.renderer || new $(this.defaults);
|
|
48471
|
+
for (let o in n.renderer) {
|
|
48472
|
+
if (!(o in r))
|
|
48473
|
+
throw new Error(`renderer '${o}' does not exist`);
|
|
48474
|
+
if (["options", "parser"].includes(o))
|
|
48475
|
+
continue;
|
|
48476
|
+
let s = o, l = n.renderer[s], u = r[s];
|
|
48477
|
+
r[s] = (...c) => {
|
|
48478
|
+
let p = l.apply(r, c);
|
|
48479
|
+
return p === false && (p = u.apply(r, c)), p || "";
|
|
48480
|
+
};
|
|
48481
|
+
}
|
|
48482
|
+
i.renderer = r;
|
|
48483
|
+
}
|
|
48484
|
+
if (n.tokenizer) {
|
|
48485
|
+
let r = this.defaults.tokenizer || new _(this.defaults);
|
|
48486
|
+
for (let o in n.tokenizer) {
|
|
48487
|
+
if (!(o in r))
|
|
48488
|
+
throw new Error(`tokenizer '${o}' does not exist`);
|
|
48489
|
+
if (["options", "rules", "lexer"].includes(o))
|
|
48490
|
+
continue;
|
|
48491
|
+
let s = o, l = n.tokenizer[s], u = r[s];
|
|
48492
|
+
r[s] = (...c) => {
|
|
48493
|
+
let p = l.apply(r, c);
|
|
48494
|
+
return p === false && (p = u.apply(r, c)), p;
|
|
48495
|
+
};
|
|
48496
|
+
}
|
|
48497
|
+
i.tokenizer = r;
|
|
48498
|
+
}
|
|
48499
|
+
if (n.hooks) {
|
|
48500
|
+
let r = this.defaults.hooks || new L;
|
|
48501
|
+
for (let o in n.hooks) {
|
|
48502
|
+
if (!(o in r))
|
|
48503
|
+
throw new Error(`hook '${o}' does not exist`);
|
|
48504
|
+
if (["options", "block"].includes(o))
|
|
48505
|
+
continue;
|
|
48506
|
+
let s = o, l = n.hooks[s], u = r[s];
|
|
48507
|
+
L.passThroughHooks.has(o) ? r[s] = (c) => {
|
|
48508
|
+
if (this.defaults.async && L.passThroughHooksRespectAsync.has(o))
|
|
48509
|
+
return (async () => {
|
|
48510
|
+
let d = await l.call(r, c);
|
|
48511
|
+
return u.call(r, d);
|
|
48512
|
+
})();
|
|
48513
|
+
let p = l.call(r, c);
|
|
48514
|
+
return u.call(r, p);
|
|
48515
|
+
} : r[s] = (...c) => {
|
|
48516
|
+
if (this.defaults.async)
|
|
48517
|
+
return (async () => {
|
|
48518
|
+
let d = await l.apply(r, c);
|
|
48519
|
+
return d === false && (d = await u.apply(r, c)), d;
|
|
48520
|
+
})();
|
|
48521
|
+
let p = l.apply(r, c);
|
|
48522
|
+
return p === false && (p = u.apply(r, c)), p;
|
|
48523
|
+
};
|
|
48524
|
+
}
|
|
48525
|
+
i.hooks = r;
|
|
48526
|
+
}
|
|
48527
|
+
if (n.walkTokens) {
|
|
48528
|
+
let r = this.defaults.walkTokens, o = n.walkTokens;
|
|
48529
|
+
i.walkTokens = function(s) {
|
|
48530
|
+
let l = [];
|
|
48531
|
+
return l.push(o.call(this, s)), r && C(l, r.call(this, s)), l;
|
|
48532
|
+
};
|
|
48533
|
+
}
|
|
48534
|
+
this.defaults = { ...this.defaults, ...i };
|
|
48535
|
+
}), this;
|
|
48536
|
+
}
|
|
48537
|
+
setOptions(e) {
|
|
48538
|
+
return this.defaults = { ...this.defaults, ...e }, this;
|
|
48539
|
+
}
|
|
48540
|
+
lexer(e, t) {
|
|
48541
|
+
return T.lex(e, t ?? this.defaults);
|
|
48542
|
+
}
|
|
48543
|
+
parser(e, t) {
|
|
48544
|
+
return O.parse(e, t ?? this.defaults);
|
|
48545
|
+
}
|
|
48546
|
+
parseMarkdown(e) {
|
|
48547
|
+
return (n, i) => {
|
|
48548
|
+
let r = { ...i }, o = { ...this.defaults, ...r }, s = this.onError(!!o.silent, !!o.async);
|
|
48549
|
+
if (this.defaults.async === true && r.async === false)
|
|
48550
|
+
return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
48551
|
+
if (typeof n > "u" || n === null)
|
|
48552
|
+
return s(new Error("marked(): input parameter is undefined or null"));
|
|
48553
|
+
if (typeof n != "string")
|
|
48554
|
+
return s(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
48555
|
+
if (o.hooks && (o.hooks.options = o, o.hooks.block = e), o.async)
|
|
48556
|
+
return (async () => {
|
|
48557
|
+
let l = o.hooks ? await o.hooks.preprocess(n) : n, c = await (o.hooks ? await o.hooks.provideLexer(e) : e ? T.lex : T.lexInline)(l, o), p = o.hooks ? await o.hooks.processAllTokens(c) : c;
|
|
48558
|
+
o.walkTokens && await Promise.all(this.walkTokens(p, o.walkTokens));
|
|
48559
|
+
let g = await (o.hooks ? await o.hooks.provideParser(e) : e ? O.parse : O.parseInline)(p, o);
|
|
48560
|
+
return o.hooks ? await o.hooks.postprocess(g) : g;
|
|
48561
|
+
})().catch(s);
|
|
48562
|
+
try {
|
|
48563
|
+
o.hooks && (n = o.hooks.preprocess(n));
|
|
48564
|
+
let u = (o.hooks ? o.hooks.provideLexer(e) : e ? T.lex : T.lexInline)(n, o);
|
|
48565
|
+
o.hooks && (u = o.hooks.processAllTokens(u)), o.walkTokens && this.walkTokens(u, o.walkTokens);
|
|
48566
|
+
let p = (o.hooks ? o.hooks.provideParser(e) : e ? O.parse : O.parseInline)(u, o);
|
|
48567
|
+
return o.hooks && (p = o.hooks.postprocess(p)), p;
|
|
48568
|
+
} catch (l) {
|
|
48569
|
+
return s(l);
|
|
48570
|
+
}
|
|
48571
|
+
};
|
|
48572
|
+
}
|
|
48573
|
+
onError(e, t) {
|
|
48574
|
+
return (n) => {
|
|
48575
|
+
if (n.message += `
|
|
48576
|
+
Please report this to https://github.com/markedjs/marked.`, e) {
|
|
48577
|
+
let i = "<p>An error occurred:</p><pre>" + w(n.message + "", true) + "</pre>";
|
|
48578
|
+
return t ? Promise.resolve(i) : i;
|
|
48579
|
+
}
|
|
48580
|
+
if (t)
|
|
48581
|
+
return Promise.reject(n);
|
|
48582
|
+
throw n;
|
|
48583
|
+
};
|
|
48584
|
+
}
|
|
48585
|
+
};
|
|
48586
|
+
var I = new U;
|
|
48587
|
+
function f(a3, e) {
|
|
48588
|
+
return I.parse(a3, e);
|
|
48589
|
+
}
|
|
48590
|
+
f.options = f.setOptions = function(a3) {
|
|
48591
|
+
return I.setOptions(a3), f.defaults = I.defaults, V(f.defaults), f;
|
|
48592
|
+
};
|
|
48593
|
+
f.getDefaults = B;
|
|
48594
|
+
f.defaults = y;
|
|
48595
|
+
function At(...a3) {
|
|
48596
|
+
return I.use(...a3), f.defaults = I.defaults, V(f.defaults), f;
|
|
48597
|
+
}
|
|
48598
|
+
f.use = At;
|
|
48599
|
+
f.walkTokens = function(a3, e) {
|
|
48600
|
+
return I.walkTokens(a3, e);
|
|
48601
|
+
};
|
|
48602
|
+
f.parseInline = I.parseInline;
|
|
48603
|
+
f.Parser = O;
|
|
48604
|
+
f.parser = O.parse;
|
|
48605
|
+
f.Renderer = $;
|
|
48606
|
+
f.TextRenderer = z;
|
|
48607
|
+
f.Lexer = T;
|
|
48608
|
+
f.lexer = T.lex;
|
|
48609
|
+
f.Tokenizer = _;
|
|
48610
|
+
f.Hooks = L;
|
|
48611
|
+
f.parse = f;
|
|
48612
|
+
var Rn = f.options;
|
|
48613
|
+
var Tn = f.setOptions;
|
|
48614
|
+
var On = f.walkTokens;
|
|
48615
|
+
var wn = f.parseInline;
|
|
48616
|
+
var yn = O.parse;
|
|
48617
|
+
var Sn = T.lex;
|
|
48618
|
+
|
|
48619
|
+
// src/core/asset/markdown-link-targets.ts
|
|
48620
|
+
var markdown = new U({ gfm: true });
|
|
48621
|
+
function markdownLinkTargets(body, references) {
|
|
48622
|
+
const tokens = markdown.lexer(body);
|
|
48623
|
+
const definitions = new Map;
|
|
48624
|
+
if (references) {
|
|
48625
|
+
markdown.walkTokens(tokens, (token) => {
|
|
48626
|
+
if (token.type !== "def")
|
|
48627
|
+
return;
|
|
48628
|
+
const definition = /^\s*\[([^\]]+)\]:\s*(\S+)/.exec(token.raw);
|
|
48629
|
+
if (definition)
|
|
48630
|
+
definitions.set(definition[1].trim().toLowerCase(), definition[2]);
|
|
48631
|
+
});
|
|
48632
|
+
}
|
|
48633
|
+
const targets = [];
|
|
48634
|
+
markdown.walkTokens(tokens, (token) => {
|
|
48635
|
+
if (token.type !== "link" && token.type !== "image")
|
|
48636
|
+
return;
|
|
48637
|
+
const inline = /^!?\[[\s\S]*\]\(/.test(token.raw);
|
|
48638
|
+
if (inline) {
|
|
48639
|
+
const angled = /\]\(\s*<[^>]*>(?:\s+["'(][\s\S]*["')])?\s*\)$/.test(token.raw);
|
|
48640
|
+
if (!angled)
|
|
48641
|
+
targets.push(token.href);
|
|
48642
|
+
return;
|
|
48643
|
+
}
|
|
48644
|
+
const reference = references && token.type === "link" ? /^\[[\s\S]*\]\[([^\]]+)\]$/.exec(token.raw) : null;
|
|
48645
|
+
const target = reference ? definitions.get(reference[1].trim().toLowerCase()) : undefined;
|
|
48646
|
+
if (target)
|
|
48647
|
+
targets.push(target);
|
|
48648
|
+
});
|
|
48649
|
+
return targets;
|
|
48650
|
+
}
|
|
48651
|
+
|
|
48652
|
+
// src/core/adapter/adapters/llm-wiki-adapter.ts
|
|
47154
48653
|
var WIKI_COMPONENT_ID = "main";
|
|
47155
48654
|
var WIKI_SOURCE_TYPE = "wiki-source";
|
|
47156
48655
|
var DEFAULT_PAGE_KIND = "note";
|
|
@@ -47182,7 +48681,7 @@ function parseWikiFrontmatter(raw) {
|
|
|
47182
48681
|
out.pageKind = nonEmptyString2(data.pageKind);
|
|
47183
48682
|
out.wikiRole = nonEmptyString2(data.wikiRole);
|
|
47184
48683
|
if (Array.isArray(data.xrefs)) {
|
|
47185
|
-
out.xrefs = data.xrefs.filter((
|
|
48684
|
+
out.xrefs = data.xrefs.filter((x2) => typeof x2 === "string" && x2.trim().length > 0).map((x2) => x2.trim());
|
|
47186
48685
|
}
|
|
47187
48686
|
if (Array.isArray(data.sources)) {
|
|
47188
48687
|
out.sources = data.sources.filter((s) => typeof s === "string" && s.trim().length > 0).map((s) => s.trim());
|
|
@@ -47209,12 +48708,10 @@ function resolveXref(xref, bundleId) {
|
|
|
47209
48708
|
}
|
|
47210
48709
|
function resolveBodyLinks(body, fileRelPath) {
|
|
47211
48710
|
const dir = path37.posix.dirname(toPosix(fileRelPath));
|
|
47212
|
-
const linkRe = /\[[^\]]*\]\(([^)]+)\)/g;
|
|
47213
48711
|
const out = [];
|
|
47214
48712
|
const seen = new Set;
|
|
47215
|
-
|
|
47216
|
-
|
|
47217
|
-
let target = match[1].trim();
|
|
48713
|
+
for (const link of markdownLinkTargets(body, false)) {
|
|
48714
|
+
let target = link.trim();
|
|
47218
48715
|
const wsIdx = target.search(/\s/);
|
|
47219
48716
|
if (wsIdx >= 0)
|
|
47220
48717
|
target = target.slice(0, wsIdx);
|
|
@@ -47457,8 +48954,8 @@ function parseActorMapping(value) {
|
|
|
47457
48954
|
const by = nonEmptyString2(value.by);
|
|
47458
48955
|
if (by === undefined)
|
|
47459
48956
|
return;
|
|
47460
|
-
const
|
|
47461
|
-
return
|
|
48957
|
+
const at2 = nonEmptyString2(value.at);
|
|
48958
|
+
return at2 !== undefined ? { by, at: at2 } : { by };
|
|
47462
48959
|
}
|
|
47463
48960
|
function parseVerified(value) {
|
|
47464
48961
|
if (value === undefined || value === null)
|
|
@@ -47510,24 +49007,10 @@ function isReservedFileName2(name) {
|
|
|
47510
49007
|
}
|
|
47511
49008
|
function resolveOkfLinks(body, fileRelPath) {
|
|
47512
49009
|
const dir = path38.posix.dirname(toPosix(fileRelPath));
|
|
47513
|
-
const definitions = new Map;
|
|
47514
|
-
for (const match of body.matchAll(/^\s*\[([^\]]+)\]:\s*(\S+)/gm)) {
|
|
47515
|
-
definitions.set(match[1].trim().toLowerCase(), match[2]);
|
|
47516
|
-
}
|
|
47517
|
-
const candidates = [];
|
|
47518
|
-
for (const match of body.matchAll(/\[[^\]]*\]\(([^)]+)\)/g)) {
|
|
47519
|
-
candidates.push({ index: match.index, target: match[1] });
|
|
47520
|
-
}
|
|
47521
|
-
for (const match of body.matchAll(/(?<!!)\[[^\]]*\]\[([^\]]+)\]/g)) {
|
|
47522
|
-
const target = definitions.get(match[1].trim().toLowerCase());
|
|
47523
|
-
if (target)
|
|
47524
|
-
candidates.push({ index: match.index, target });
|
|
47525
|
-
}
|
|
47526
|
-
candidates.sort((a, b) => a.index - b.index);
|
|
47527
49010
|
const out = [];
|
|
47528
49011
|
const seen = new Set;
|
|
47529
|
-
for (const
|
|
47530
|
-
let target =
|
|
49012
|
+
for (const link of markdownLinkTargets(body, true)) {
|
|
49013
|
+
let target = link.trim();
|
|
47531
49014
|
const wsIdx = target.search(/\s/);
|
|
47532
49015
|
if (wsIdx >= 0)
|
|
47533
49016
|
target = target.slice(0, wsIdx);
|
|
@@ -47745,7 +49228,7 @@ function dirExists2(p) {
|
|
|
47745
49228
|
}
|
|
47746
49229
|
}
|
|
47747
49230
|
function opencodeLooksLikeRoot(root) {
|
|
47748
|
-
if (CONFIG_FILES.some((
|
|
49231
|
+
if (CONFIG_FILES.some((f2) => fileExists(path39.join(root, f2))))
|
|
47749
49232
|
return true;
|
|
47750
49233
|
if (!fileExists(path39.join(root, "AGENTS.md")))
|
|
47751
49234
|
return false;
|
|
@@ -47876,7 +49359,7 @@ var BUILTIN_ADAPTERS = Object.freeze([
|
|
|
47876
49359
|
genericFilesAdapter
|
|
47877
49360
|
]);
|
|
47878
49361
|
{
|
|
47879
|
-
const actualIds = BUILTIN_ADAPTERS.map((
|
|
49362
|
+
const actualIds = BUILTIN_ADAPTERS.map((a3) => a3.id);
|
|
47880
49363
|
const expectedIds = [...ADAPTER_ID_TABLE];
|
|
47881
49364
|
if (actualIds.length !== expectedIds.length || actualIds.some((id, i) => id !== expectedIds[i])) {
|
|
47882
49365
|
throw new Error(`adapter-ids.ts ADAPTER_ID_TABLE (${expectedIds.join(", ")}) does not match ` + `BUILTIN_ADAPTERS (${actualIds.join(", ")}) — update adapter-ids.ts to match.`);
|
|
@@ -47884,7 +49367,7 @@ var BUILTIN_ADAPTERS = Object.freeze([
|
|
|
47884
49367
|
}
|
|
47885
49368
|
|
|
47886
49369
|
// src/core/adapter/registry.ts
|
|
47887
|
-
var BY_ID = new Map(BUILTIN_ADAPTERS.map((
|
|
49370
|
+
var BY_ID = new Map(BUILTIN_ADAPTERS.map((a3) => [a3.id, a3]));
|
|
47888
49371
|
function getAdapters() {
|
|
47889
49372
|
return [...BUILTIN_ADAPTERS];
|
|
47890
49373
|
}
|
|
@@ -47918,7 +49401,7 @@ function extractIncludeList(pkg) {
|
|
|
47918
49401
|
const { include } = config;
|
|
47919
49402
|
if (!Array.isArray(include))
|
|
47920
49403
|
continue;
|
|
47921
|
-
const list = include.filter((
|
|
49404
|
+
const list = include.filter((v2) => typeof v2 === "string").map((v2) => v2.trim()).filter(Boolean);
|
|
47922
49405
|
if (list.length > 0)
|
|
47923
49406
|
return list;
|
|
47924
49407
|
}
|
|
@@ -48565,8 +50048,8 @@ var WINDOWS_RESERVED_DEVICE_NAMES = new Set([
|
|
|
48565
50048
|
"prn",
|
|
48566
50049
|
"aux",
|
|
48567
50050
|
"nul",
|
|
48568
|
-
...Array.from({ length: 9 }, (
|
|
48569
|
-
...Array.from({ length: 9 }, (
|
|
50051
|
+
...Array.from({ length: 9 }, (_2, i) => `com${i + 1}`),
|
|
50052
|
+
...Array.from({ length: 9 }, (_2, i) => `lpt${i + 1}`)
|
|
48570
50053
|
]);
|
|
48571
50054
|
var pendingGitPaths = new Map;
|
|
48572
50055
|
|
|
@@ -48872,8 +50355,8 @@ var isName = function(string) {
|
|
|
48872
50355
|
const match = regexName.exec(string);
|
|
48873
50356
|
return !(match === null || typeof match === "undefined");
|
|
48874
50357
|
};
|
|
48875
|
-
function isExist(
|
|
48876
|
-
return typeof
|
|
50358
|
+
function isExist(v2) {
|
|
50359
|
+
return typeof v2 !== "undefined";
|
|
48877
50360
|
}
|
|
48878
50361
|
var DANGEROUS_PROPERTY_NAMES = [
|
|
48879
50362
|
"hasOwnProperty",
|
|
@@ -49130,15 +50613,15 @@ function validateAttributeString(attrStr, options) {
|
|
|
49130
50613
|
return true;
|
|
49131
50614
|
}
|
|
49132
50615
|
function validateNumberAmpersand(xmlData, i) {
|
|
49133
|
-
let
|
|
50616
|
+
let re2 = /\d/;
|
|
49134
50617
|
if (xmlData[i] === "x") {
|
|
49135
50618
|
i++;
|
|
49136
|
-
|
|
50619
|
+
re2 = /[\da-fA-F]/;
|
|
49137
50620
|
}
|
|
49138
50621
|
for (;i < xmlData.length; i++) {
|
|
49139
50622
|
if (xmlData[i] === ";")
|
|
49140
50623
|
return i;
|
|
49141
|
-
if (!xmlData[i].match(
|
|
50624
|
+
if (!xmlData[i].match(re2))
|
|
49142
50625
|
break;
|
|
49143
50626
|
}
|
|
49144
50627
|
return -1;
|
|
@@ -49403,14 +50886,14 @@ class EntityDecoder {
|
|
|
49403
50886
|
i++;
|
|
49404
50887
|
continue;
|
|
49405
50888
|
}
|
|
49406
|
-
let
|
|
49407
|
-
while (
|
|
49408
|
-
|
|
49409
|
-
if (
|
|
50889
|
+
let j2 = i + 1;
|
|
50890
|
+
while (j2 < len && str2.charCodeAt(j2) !== 59 && j2 - i <= 32)
|
|
50891
|
+
j2++;
|
|
50892
|
+
if (j2 >= len || str2.charCodeAt(j2) !== 59) {
|
|
49410
50893
|
i++;
|
|
49411
50894
|
continue;
|
|
49412
50895
|
}
|
|
49413
|
-
const token = str2.slice(i + 1,
|
|
50896
|
+
const token = str2.slice(i + 1, j2);
|
|
49414
50897
|
if (token.length === 0) {
|
|
49415
50898
|
i++;
|
|
49416
50899
|
continue;
|
|
@@ -49445,7 +50928,7 @@ class EntityDecoder {
|
|
|
49445
50928
|
if (i > last)
|
|
49446
50929
|
chunks.push(str2.slice(last, i));
|
|
49447
50930
|
chunks.push(replacement);
|
|
49448
|
-
last =
|
|
50931
|
+
last = j2 + 1;
|
|
49449
50932
|
i = last;
|
|
49450
50933
|
if (checkLimits && this._tierCounts(tier)) {
|
|
49451
50934
|
if (limitExpansions) {
|
|
@@ -49982,8 +51465,8 @@ var skipWhitespace = (data, index) => {
|
|
|
49982
51465
|
return index;
|
|
49983
51466
|
};
|
|
49984
51467
|
function hasSeq(data, seq, i) {
|
|
49985
|
-
for (let
|
|
49986
|
-
if (seq[
|
|
51468
|
+
for (let j2 = 0;j2 < seq.length; j2++) {
|
|
51469
|
+
if (seq[j2] !== data[i + j2 + 1])
|
|
49987
51470
|
return false;
|
|
49988
51471
|
}
|
|
49989
51472
|
return true;
|
|
@@ -52549,7 +54032,7 @@ var listFormatters = [{ command: "list", handler: (r) => formatListPlain(r) }];
|
|
|
52549
54032
|
var flat = (s) => s.replace(/\s*\r?\n\s*/g, " ");
|
|
52550
54033
|
function renderTable2(table) {
|
|
52551
54034
|
const all = [table.headers, ...table.rows].map((r) => r.map(flat));
|
|
52552
|
-
const widths = table.headers.map((
|
|
54035
|
+
const widths = table.headers.map((_2, i) => Math.max(...all.map((r) => (r[i] ?? "").length)));
|
|
52553
54036
|
const line = (r) => ` ${r.map((c, i) => c.padEnd(widths[i] ?? 0)).join(" ")}`.trimEnd();
|
|
52554
54037
|
return [`${table.title}:`, ...all.map(line)];
|
|
52555
54038
|
}
|
|
@@ -52896,8 +54379,8 @@ function dirSizeBytes(target) {
|
|
|
52896
54379
|
return total;
|
|
52897
54380
|
}
|
|
52898
54381
|
function sizeOf(target) {
|
|
52899
|
-
const
|
|
52900
|
-
return
|
|
54382
|
+
const st2 = fs42.statSync(target);
|
|
54383
|
+
return st2.isDirectory() ? dirSizeBytes(target) : st2.size;
|
|
52901
54384
|
}
|
|
52902
54385
|
function hostResidue() {
|
|
52903
54386
|
const data = getDataDir();
|
|
@@ -53170,10 +54653,10 @@ function classifyTaskV3Uses(value) {
|
|
|
53170
54653
|
if (error2 instanceof UsageError && /agent ref|task ref/i.test(error2.message))
|
|
53171
54654
|
throw error2;
|
|
53172
54655
|
}
|
|
53173
|
-
const
|
|
53174
|
-
if (
|
|
53175
|
-
const locator = value.slice(0,
|
|
53176
|
-
const revision = value.slice(
|
|
54656
|
+
const at2 = value.lastIndexOf("@");
|
|
54657
|
+
if (at2 > 0 && at2 === value.indexOf("@")) {
|
|
54658
|
+
const locator = value.slice(0, at2);
|
|
54659
|
+
const revision = value.slice(at2 + 1);
|
|
53177
54660
|
const segments = locator.split("/");
|
|
53178
54661
|
const [owner, repository, ...actionPath] = segments;
|
|
53179
54662
|
if (owner && repository && GITHUB_OWNER.test(owner) && GITHUB_REPOSITORY.test(repository) && repository !== "." && repository !== ".." && actionPath.every((segment) => GITHUB_ACTION_PATH_SEGMENT.test(segment) && segment !== "." && segment !== "..") && validGithubRevision(revision)) {
|
|
@@ -54078,7 +55561,7 @@ function walkTasks(root, tasksDir, out) {
|
|
|
54078
55561
|
if (!contained2(physicalRoot, physicalDirectory)) {
|
|
54079
55562
|
throw migrationError(`${directory} resolves outside bundle ${root.bundleId}.`);
|
|
54080
55563
|
}
|
|
54081
|
-
for (const entry of fs43.readdirSync(directory, { withFileTypes: true }).sort((
|
|
55564
|
+
for (const entry of fs43.readdirSync(directory, { withFileTypes: true }).sort((a3, b) => a3.name.localeCompare(b.name))) {
|
|
54082
55565
|
const candidate = path51.join(directory, entry.name);
|
|
54083
55566
|
if (entry.isSymbolicLink())
|
|
54084
55567
|
throw migrationError(`task migration does not follow symbolic link ${candidate}.`);
|
|
@@ -54104,7 +55587,7 @@ function walkTasks(root, tasksDir, out) {
|
|
|
54104
55587
|
}
|
|
54105
55588
|
function inspectTaskFiles(roots) {
|
|
54106
55589
|
const files = [];
|
|
54107
|
-
for (const root of [...roots].sort((
|
|
55590
|
+
for (const root of [...roots].sort((a3, b) => a3.bundleId.localeCompare(b.bundleId))) {
|
|
54108
55591
|
const tasksDir = root.layout === "akm-task" ? root.root : path51.join(root.root, "tasks");
|
|
54109
55592
|
try {
|
|
54110
55593
|
const stat = fs43.lstatSync(tasksDir);
|
|
@@ -54119,7 +55602,7 @@ function inspectTaskFiles(roots) {
|
|
|
54119
55602
|
}
|
|
54120
55603
|
walkTasks(root, tasksDir, files);
|
|
54121
55604
|
}
|
|
54122
|
-
return files.sort((
|
|
55605
|
+
return files.sort((a3, b) => a3.filePath.localeCompare(b.filePath));
|
|
54123
55606
|
}
|
|
54124
55607
|
function planTaskFilesMigration(inputs) {
|
|
54125
55608
|
return taskToV4PlanFromOutcomes(inputs.map(planTaskToV4File));
|