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
|
@@ -9319,11 +9319,11 @@ var require_DOMException = __commonJS((exports, module) => {
|
|
|
9319
9319
|
}
|
|
9320
9320
|
DOMException2.prototype.__proto__ = Error.prototype;
|
|
9321
9321
|
for (c in constants) {
|
|
9322
|
-
|
|
9323
|
-
Object.defineProperty(DOMException2, c,
|
|
9324
|
-
Object.defineProperty(DOMException2.prototype, c,
|
|
9322
|
+
v2 = { value: constants[c] };
|
|
9323
|
+
Object.defineProperty(DOMException2, c, v2);
|
|
9324
|
+
Object.defineProperty(DOMException2.prototype, c, v2);
|
|
9325
9325
|
}
|
|
9326
|
-
var
|
|
9326
|
+
var v2;
|
|
9327
9327
|
var c;
|
|
9328
9328
|
});
|
|
9329
9329
|
|
|
@@ -9425,9 +9425,9 @@ var require_utils = __commonJS((exports) => {
|
|
|
9425
9425
|
Object.defineProperty(c.prototype, n, { value: src[n], writable: isApiWritable });
|
|
9426
9426
|
}
|
|
9427
9427
|
};
|
|
9428
|
-
exports.merge = function(
|
|
9428
|
+
exports.merge = function(a3, b) {
|
|
9429
9429
|
for (var n in b) {
|
|
9430
|
-
|
|
9430
|
+
a3[n] = b[n];
|
|
9431
9431
|
}
|
|
9432
9432
|
};
|
|
9433
9433
|
exports.documentOrder = function(n, m) {
|
|
@@ -9508,10 +9508,10 @@ var require_EventTarget = __commonJS((exports, module) => {
|
|
|
9508
9508
|
if (typeof handler3 === "function") {
|
|
9509
9509
|
rv = handler3.call(event2.currentTarget, event2);
|
|
9510
9510
|
} else {
|
|
9511
|
-
var
|
|
9512
|
-
if (typeof
|
|
9511
|
+
var f2 = handler3.handleEvent;
|
|
9512
|
+
if (typeof f2 !== "function")
|
|
9513
9513
|
throw new TypeError("handleEvent property of " + "event handler object is" + "not a function.");
|
|
9514
|
-
rv =
|
|
9514
|
+
rv = f2.call(handler3, event2);
|
|
9515
9515
|
}
|
|
9516
9516
|
switch (event2.type) {
|
|
9517
9517
|
case "mouseover":
|
|
@@ -9637,41 +9637,41 @@ var require_EventTarget = __commonJS((exports, module) => {
|
|
|
9637
9637
|
var require_LinkedList = __commonJS((exports, module) => {
|
|
9638
9638
|
var utils = require_utils();
|
|
9639
9639
|
var LinkedList = module.exports = {
|
|
9640
|
-
valid: function(
|
|
9641
|
-
utils.assert(
|
|
9642
|
-
utils.assert(
|
|
9643
|
-
utils.assert(
|
|
9640
|
+
valid: function(a3) {
|
|
9641
|
+
utils.assert(a3, "list falsy");
|
|
9642
|
+
utils.assert(a3._previousSibling, "previous falsy");
|
|
9643
|
+
utils.assert(a3._nextSibling, "next falsy");
|
|
9644
9644
|
return true;
|
|
9645
9645
|
},
|
|
9646
|
-
insertBefore: function(
|
|
9647
|
-
utils.assert(LinkedList.valid(
|
|
9648
|
-
var a_first =
|
|
9646
|
+
insertBefore: function(a3, b) {
|
|
9647
|
+
utils.assert(LinkedList.valid(a3) && LinkedList.valid(b));
|
|
9648
|
+
var a_first = a3, a_last = a3._previousSibling;
|
|
9649
9649
|
var b_first = b, b_last = b._previousSibling;
|
|
9650
9650
|
a_first._previousSibling = b_last;
|
|
9651
9651
|
a_last._nextSibling = b_first;
|
|
9652
9652
|
b_last._nextSibling = a_first;
|
|
9653
9653
|
b_first._previousSibling = a_last;
|
|
9654
|
-
utils.assert(LinkedList.valid(
|
|
9654
|
+
utils.assert(LinkedList.valid(a3) && LinkedList.valid(b));
|
|
9655
9655
|
},
|
|
9656
|
-
replace: function(
|
|
9657
|
-
utils.assert(LinkedList.valid(
|
|
9656
|
+
replace: function(a3, b) {
|
|
9657
|
+
utils.assert(LinkedList.valid(a3) && (b === null || LinkedList.valid(b)));
|
|
9658
9658
|
if (b !== null) {
|
|
9659
|
-
LinkedList.insertBefore(b,
|
|
9659
|
+
LinkedList.insertBefore(b, a3);
|
|
9660
9660
|
}
|
|
9661
|
-
LinkedList.remove(
|
|
9662
|
-
utils.assert(LinkedList.valid(
|
|
9661
|
+
LinkedList.remove(a3);
|
|
9662
|
+
utils.assert(LinkedList.valid(a3) && (b === null || LinkedList.valid(b)));
|
|
9663
9663
|
},
|
|
9664
|
-
remove: function(
|
|
9665
|
-
utils.assert(LinkedList.valid(
|
|
9666
|
-
var prev =
|
|
9667
|
-
if (prev ===
|
|
9664
|
+
remove: function(a3) {
|
|
9665
|
+
utils.assert(LinkedList.valid(a3));
|
|
9666
|
+
var prev = a3._previousSibling;
|
|
9667
|
+
if (prev === a3) {
|
|
9668
9668
|
return;
|
|
9669
9669
|
}
|
|
9670
|
-
var next =
|
|
9670
|
+
var next = a3._nextSibling;
|
|
9671
9671
|
prev._nextSibling = next;
|
|
9672
9672
|
next._previousSibling = prev;
|
|
9673
|
-
|
|
9674
|
-
utils.assert(LinkedList.valid(
|
|
9673
|
+
a3._previousSibling = a3._nextSibling = a3;
|
|
9674
|
+
utils.assert(LinkedList.valid(a3));
|
|
9675
9675
|
}
|
|
9676
9676
|
};
|
|
9677
9677
|
});
|
|
@@ -9754,21 +9754,21 @@ var require_NodeUtils = __commonJS((exports, module) => {
|
|
|
9754
9754
|
}
|
|
9755
9755
|
});
|
|
9756
9756
|
}
|
|
9757
|
-
function attrname(
|
|
9758
|
-
var ns =
|
|
9757
|
+
function attrname(a3) {
|
|
9758
|
+
var ns = a3.namespaceURI;
|
|
9759
9759
|
if (!ns)
|
|
9760
|
-
return
|
|
9760
|
+
return a3.localName;
|
|
9761
9761
|
if (ns === NAMESPACE.XML)
|
|
9762
|
-
return "xml:" +
|
|
9762
|
+
return "xml:" + a3.localName;
|
|
9763
9763
|
if (ns === NAMESPACE.XLINK)
|
|
9764
|
-
return "xlink:" +
|
|
9764
|
+
return "xlink:" + a3.localName;
|
|
9765
9765
|
if (ns === NAMESPACE.XMLNS) {
|
|
9766
|
-
if (
|
|
9766
|
+
if (a3.localName === "xmlns")
|
|
9767
9767
|
return "xmlns";
|
|
9768
9768
|
else
|
|
9769
|
-
return "xmlns:" +
|
|
9769
|
+
return "xmlns:" + a3.localName;
|
|
9770
9770
|
}
|
|
9771
|
-
return
|
|
9771
|
+
return a3.name;
|
|
9772
9772
|
}
|
|
9773
9773
|
function escapeMatchingClosingTag(rawText, parentTag) {
|
|
9774
9774
|
const parentClosingTag = "</" + parentTag;
|
|
@@ -9800,11 +9800,11 @@ var require_NodeUtils = __commonJS((exports, module) => {
|
|
|
9800
9800
|
var html = ns === NAMESPACE.HTML;
|
|
9801
9801
|
var tagname = html || ns === NAMESPACE.SVG || ns === NAMESPACE.MATHML ? kid.localName : kid.tagName;
|
|
9802
9802
|
s += "<" + tagname;
|
|
9803
|
-
for (var
|
|
9804
|
-
var
|
|
9805
|
-
s += " " + attrname(
|
|
9806
|
-
if (
|
|
9807
|
-
s += '="' + escapeAttr(
|
|
9803
|
+
for (var j2 = 0, k = kid._numattrs;j2 < k; j2++) {
|
|
9804
|
+
var a3 = kid._attr(j2);
|
|
9805
|
+
s += " " + attrname(a3);
|
|
9806
|
+
if (a3.value !== undefined)
|
|
9807
|
+
s += '="' + escapeAttr(a3.value) + '"';
|
|
9808
9808
|
}
|
|
9809
9809
|
s += ">";
|
|
9810
9810
|
if (!(html && emptyElements[tagname])) {
|
|
@@ -9926,13 +9926,13 @@ var require_Node2 = __commonJS((exports, module) => {
|
|
|
9926
9926
|
get: function() {
|
|
9927
9927
|
return null;
|
|
9928
9928
|
},
|
|
9929
|
-
set: function(
|
|
9929
|
+
set: function(v2) {}
|
|
9930
9930
|
},
|
|
9931
9931
|
innerText: {
|
|
9932
9932
|
get: function() {
|
|
9933
9933
|
return null;
|
|
9934
9934
|
},
|
|
9935
|
-
set: function(
|
|
9935
|
+
set: function(v2) {}
|
|
9936
9936
|
},
|
|
9937
9937
|
_countChildrenOfType: { value: function(type) {
|
|
9938
9938
|
var sum = 0;
|
|
@@ -10416,11 +10416,11 @@ var require_Node2 = __commonJS((exports, module) => {
|
|
|
10416
10416
|
// node_modules/@mixmark-io/domino/lib/NodeList.es6.js
|
|
10417
10417
|
var require_NodeList_es6 = __commonJS((exports, module) => {
|
|
10418
10418
|
module.exports = class NodeList extends Array {
|
|
10419
|
-
constructor(
|
|
10420
|
-
super(
|
|
10421
|
-
if (
|
|
10422
|
-
for (var idx in
|
|
10423
|
-
this[idx] =
|
|
10419
|
+
constructor(a3) {
|
|
10420
|
+
super(a3 && a3.length || 0);
|
|
10421
|
+
if (a3) {
|
|
10422
|
+
for (var idx in a3) {
|
|
10423
|
+
this[idx] = a3[idx];
|
|
10424
10424
|
}
|
|
10425
10425
|
}
|
|
10426
10426
|
}
|
|
@@ -10435,11 +10435,11 @@ var require_NodeList_es5 = __commonJS((exports, module) => {
|
|
|
10435
10435
|
function item(i) {
|
|
10436
10436
|
return this[i] || null;
|
|
10437
10437
|
}
|
|
10438
|
-
function NodeList(
|
|
10439
|
-
if (!
|
|
10440
|
-
|
|
10441
|
-
|
|
10442
|
-
return
|
|
10438
|
+
function NodeList(a3) {
|
|
10439
|
+
if (!a3)
|
|
10440
|
+
a3 = [];
|
|
10441
|
+
a3.item = item;
|
|
10442
|
+
return a3;
|
|
10443
10443
|
}
|
|
10444
10444
|
module.exports = NodeList;
|
|
10445
10445
|
});
|
|
@@ -10591,18 +10591,18 @@ var require_attributes = __commonJS((exports) => {
|
|
|
10591
10591
|
}
|
|
10592
10592
|
return {
|
|
10593
10593
|
get: function() {
|
|
10594
|
-
var
|
|
10595
|
-
if (
|
|
10594
|
+
var v2 = this._getattr(attr.name);
|
|
10595
|
+
if (v2 === null)
|
|
10596
10596
|
return missingValueDefault;
|
|
10597
|
-
|
|
10598
|
-
if (
|
|
10599
|
-
return
|
|
10597
|
+
v2 = valid[v2.toLowerCase()];
|
|
10598
|
+
if (v2 !== undefined)
|
|
10599
|
+
return v2;
|
|
10600
10600
|
if (invalidValueDefault !== null)
|
|
10601
10601
|
return invalidValueDefault;
|
|
10602
|
-
return
|
|
10602
|
+
return v2;
|
|
10603
10603
|
},
|
|
10604
|
-
set: function(
|
|
10605
|
-
this._setattr(attr.name,
|
|
10604
|
+
set: function(v2) {
|
|
10605
|
+
this._setattr(attr.name, v2);
|
|
10606
10606
|
}
|
|
10607
10607
|
};
|
|
10608
10608
|
} else if (attr.type === Boolean) {
|
|
@@ -10610,8 +10610,8 @@ var require_attributes = __commonJS((exports) => {
|
|
|
10610
10610
|
get: function() {
|
|
10611
10611
|
return this.hasAttribute(attr.name);
|
|
10612
10612
|
},
|
|
10613
|
-
set: function(
|
|
10614
|
-
if (
|
|
10613
|
+
set: function(v2) {
|
|
10614
|
+
if (v2) {
|
|
10615
10615
|
this._setattr(attr.name, "");
|
|
10616
10616
|
} else {
|
|
10617
10617
|
this.removeAttribute(attr.name);
|
|
@@ -10625,11 +10625,11 @@ var require_attributes = __commonJS((exports) => {
|
|
|
10625
10625
|
get: function() {
|
|
10626
10626
|
return this._getattr(attr.name) || "";
|
|
10627
10627
|
},
|
|
10628
|
-
set: function(
|
|
10629
|
-
if (attr.treatNullAsEmptyString &&
|
|
10630
|
-
|
|
10628
|
+
set: function(v2) {
|
|
10629
|
+
if (attr.treatNullAsEmptyString && v2 === null) {
|
|
10630
|
+
v2 = "";
|
|
10631
10631
|
}
|
|
10632
|
-
this._setattr(attr.name,
|
|
10632
|
+
this._setattr(attr.name, v2);
|
|
10633
10633
|
}
|
|
10634
10634
|
};
|
|
10635
10635
|
} else if (typeof attr.type === "function") {
|
|
@@ -10637,23 +10637,23 @@ var require_attributes = __commonJS((exports) => {
|
|
|
10637
10637
|
}
|
|
10638
10638
|
throw new Error("Invalid attribute definition");
|
|
10639
10639
|
};
|
|
10640
|
-
function numberPropDesc(
|
|
10640
|
+
function numberPropDesc(a3) {
|
|
10641
10641
|
var def;
|
|
10642
|
-
if (typeof
|
|
10643
|
-
def =
|
|
10644
|
-
} else if (typeof
|
|
10642
|
+
if (typeof a3.default === "function") {
|
|
10643
|
+
def = a3.default;
|
|
10644
|
+
} else if (typeof a3.default === "number") {
|
|
10645
10645
|
def = function() {
|
|
10646
|
-
return
|
|
10646
|
+
return a3.default;
|
|
10647
10647
|
};
|
|
10648
10648
|
} else {
|
|
10649
10649
|
def = function() {
|
|
10650
|
-
utils.assert(false, typeof
|
|
10650
|
+
utils.assert(false, typeof a3.default);
|
|
10651
10651
|
};
|
|
10652
10652
|
}
|
|
10653
|
-
var unsigned_long =
|
|
10654
|
-
var signed_long =
|
|
10655
|
-
var unsigned_fallback =
|
|
10656
|
-
var { min, max, setmin } =
|
|
10653
|
+
var unsigned_long = a3.type === "unsigned long";
|
|
10654
|
+
var signed_long = a3.type === "long";
|
|
10655
|
+
var unsigned_fallback = a3.type === "limited unsigned long with fallback";
|
|
10656
|
+
var { min, max, setmin } = a3;
|
|
10657
10657
|
if (min === undefined) {
|
|
10658
10658
|
if (unsigned_long)
|
|
10659
10659
|
min = 0;
|
|
@@ -10668,34 +10668,34 @@ var require_attributes = __commonJS((exports) => {
|
|
|
10668
10668
|
}
|
|
10669
10669
|
return {
|
|
10670
10670
|
get: function() {
|
|
10671
|
-
var
|
|
10672
|
-
var n =
|
|
10673
|
-
if (
|
|
10671
|
+
var v2 = this._getattr(a3.name);
|
|
10672
|
+
var n = a3.float ? parseFloat(v2) : parseInt(v2, 10);
|
|
10673
|
+
if (v2 === null || !isFinite(n) || min !== undefined && n < min || max !== undefined && n > max) {
|
|
10674
10674
|
return def.call(this);
|
|
10675
10675
|
}
|
|
10676
10676
|
if (unsigned_long || signed_long || unsigned_fallback) {
|
|
10677
|
-
if (!/^[ \t\n\f\r]*[-+]?[0-9]/.test(
|
|
10677
|
+
if (!/^[ \t\n\f\r]*[-+]?[0-9]/.test(v2)) {
|
|
10678
10678
|
return def.call(this);
|
|
10679
10679
|
}
|
|
10680
10680
|
n = n | 0;
|
|
10681
10681
|
}
|
|
10682
10682
|
return n;
|
|
10683
10683
|
},
|
|
10684
|
-
set: function(
|
|
10685
|
-
if (!
|
|
10686
|
-
|
|
10684
|
+
set: function(v2) {
|
|
10685
|
+
if (!a3.float) {
|
|
10686
|
+
v2 = Math.floor(v2);
|
|
10687
10687
|
}
|
|
10688
|
-
if (setmin !== undefined &&
|
|
10689
|
-
utils.IndexSizeError(
|
|
10688
|
+
if (setmin !== undefined && v2 < setmin) {
|
|
10689
|
+
utils.IndexSizeError(a3.name + " set to " + v2);
|
|
10690
10690
|
}
|
|
10691
10691
|
if (unsigned_long) {
|
|
10692
|
-
|
|
10692
|
+
v2 = v2 < 0 || v2 > 2147483647 ? def.call(this) : v2 | 0;
|
|
10693
10693
|
} else if (unsigned_fallback) {
|
|
10694
|
-
|
|
10694
|
+
v2 = v2 < 1 || v2 > 2147483647 ? def.call(this) : v2 | 0;
|
|
10695
10695
|
} else if (signed_long) {
|
|
10696
|
-
|
|
10696
|
+
v2 = v2 < -2147483648 || v2 > 2147483647 ? def.call(this) : v2 | 0;
|
|
10697
10697
|
}
|
|
10698
|
-
this._setattr(
|
|
10698
|
+
this._setattr(a3.name, String(v2));
|
|
10699
10699
|
}
|
|
10700
10700
|
};
|
|
10701
10701
|
}
|
|
@@ -10870,8 +10870,8 @@ var require_DOMTokenList = __commonJS((exports, module) => {
|
|
|
10870
10870
|
get: function() {
|
|
10871
10871
|
return this._getString();
|
|
10872
10872
|
},
|
|
10873
|
-
set: function(
|
|
10874
|
-
this._setString(
|
|
10873
|
+
set: function(v2) {
|
|
10874
|
+
this._setString(v2);
|
|
10875
10875
|
this._update();
|
|
10876
10876
|
}
|
|
10877
10877
|
},
|
|
@@ -10943,11 +10943,11 @@ var require_select = __commonJS((exports, module) => {
|
|
|
10943
10943
|
throw new Error("window.location is not supported.");
|
|
10944
10944
|
} }
|
|
10945
10945
|
});
|
|
10946
|
-
var compareDocumentPosition = function(
|
|
10947
|
-
return
|
|
10946
|
+
var compareDocumentPosition = function(a3, b) {
|
|
10947
|
+
return a3.compareDocumentPosition(b);
|
|
10948
10948
|
};
|
|
10949
|
-
var order = function(
|
|
10950
|
-
return compareDocumentPosition(
|
|
10949
|
+
var order = function(a3, b) {
|
|
10950
|
+
return compareDocumentPosition(a3, b) & 2 ? 1 : -1;
|
|
10951
10951
|
};
|
|
10952
10952
|
var next = function(el) {
|
|
10953
10953
|
while ((el = el.nextSibling) && el.nodeType !== 1)
|
|
@@ -11354,14 +11354,14 @@ var require_select = __commonJS((exports, module) => {
|
|
|
11354
11354
|
return attr.indexOf(val) !== -1;
|
|
11355
11355
|
},
|
|
11356
11356
|
"~=": function(attr, val) {
|
|
11357
|
-
var i, s,
|
|
11357
|
+
var i, s, f2, l;
|
|
11358
11358
|
for (s = 0;; s = i + 1) {
|
|
11359
11359
|
i = attr.indexOf(val, s);
|
|
11360
11360
|
if (i === -1)
|
|
11361
11361
|
return false;
|
|
11362
|
-
|
|
11362
|
+
f2 = attr[i - 1];
|
|
11363
11363
|
l = attr[i + val.length];
|
|
11364
|
-
if ((!
|
|
11364
|
+
if ((!f2 || f2 === " ") && (!l || l === " "))
|
|
11365
11365
|
return true;
|
|
11366
11366
|
}
|
|
11367
11367
|
},
|
|
@@ -11699,8 +11699,8 @@ var require_ChildNode = __commonJS((exports, module) => {
|
|
|
11699
11699
|
if (parentNode === null) {
|
|
11700
11700
|
return;
|
|
11701
11701
|
}
|
|
11702
|
-
while (nextSibling && argArr.some(function(
|
|
11703
|
-
return
|
|
11702
|
+
while (nextSibling && argArr.some(function(v2) {
|
|
11703
|
+
return v2 === nextSibling;
|
|
11704
11704
|
}))
|
|
11705
11705
|
nextSibling = nextSibling.nextSibling;
|
|
11706
11706
|
var docFrag = createDocumentFragmentFromArguments(this.doc, argArr);
|
|
@@ -11712,8 +11712,8 @@ var require_ChildNode = __commonJS((exports, module) => {
|
|
|
11712
11712
|
if (parentNode === null) {
|
|
11713
11713
|
return;
|
|
11714
11714
|
}
|
|
11715
|
-
while (prevSibling && argArr.some(function(
|
|
11716
|
-
return
|
|
11715
|
+
while (prevSibling && argArr.some(function(v2) {
|
|
11716
|
+
return v2 === prevSibling;
|
|
11717
11717
|
}))
|
|
11718
11718
|
prevSibling = prevSibling.previousSibling;
|
|
11719
11719
|
var docFrag = createDocumentFragmentFromArguments(this.doc, argArr);
|
|
@@ -11754,8 +11754,8 @@ var require_ChildNode = __commonJS((exports, module) => {
|
|
|
11754
11754
|
if (parentNode === null) {
|
|
11755
11755
|
return;
|
|
11756
11756
|
}
|
|
11757
|
-
while (nextSibling && argArr.some(function(
|
|
11758
|
-
return
|
|
11757
|
+
while (nextSibling && argArr.some(function(v2) {
|
|
11758
|
+
return v2 === nextSibling;
|
|
11759
11759
|
}))
|
|
11760
11760
|
nextSibling = nextSibling.nextSibling;
|
|
11761
11761
|
var docFrag = createDocumentFragmentFromArguments(this.doc, argArr);
|
|
@@ -11863,12 +11863,12 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
11863
11863
|
this._attrsByLName = Object.create(null);
|
|
11864
11864
|
this._attrKeys = [];
|
|
11865
11865
|
}
|
|
11866
|
-
function recursiveGetText(node,
|
|
11866
|
+
function recursiveGetText(node, a3) {
|
|
11867
11867
|
if (node.nodeType === Node.TEXT_NODE) {
|
|
11868
|
-
|
|
11868
|
+
a3.push(node._data);
|
|
11869
11869
|
} else {
|
|
11870
11870
|
for (var i = 0, n = node.childNodes.length;i < n; i++)
|
|
11871
|
-
recursiveGetText(node.childNodes[i],
|
|
11871
|
+
recursiveGetText(node.childNodes[i], a3);
|
|
11872
11872
|
}
|
|
11873
11873
|
}
|
|
11874
11874
|
Element.prototype = Object.create(ContainerNode.prototype, {
|
|
@@ -11939,7 +11939,7 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
11939
11939
|
get: function() {
|
|
11940
11940
|
return NodeUtils.serializeOne(this, { nodeType: 0 });
|
|
11941
11941
|
},
|
|
11942
|
-
set: function(
|
|
11942
|
+
set: function(v2) {
|
|
11943
11943
|
var document = this.ownerDocument;
|
|
11944
11944
|
var parent = this.parentNode;
|
|
11945
11945
|
if (parent === null) {
|
|
@@ -11952,7 +11952,7 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
11952
11952
|
parent = parent.ownerDocument.createElement("body");
|
|
11953
11953
|
}
|
|
11954
11954
|
var parser2 = document.implementation.mozHTMLParser(document._address, parent);
|
|
11955
|
-
parser2.parse(
|
|
11955
|
+
parser2.parse(v2 === null ? "" : String(v2), true);
|
|
11956
11956
|
this.replaceWith(parser2._asDocumentFragment());
|
|
11957
11957
|
}
|
|
11958
11958
|
},
|
|
@@ -12109,8 +12109,8 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12109
12109
|
}
|
|
12110
12110
|
for (var i = 0, n = this._attrKeys.length;i < n; i++) {
|
|
12111
12111
|
var lname = this._attrKeys[i];
|
|
12112
|
-
var
|
|
12113
|
-
var b =
|
|
12112
|
+
var a3 = this._attrsByLName[lname];
|
|
12113
|
+
var b = a3.cloneNode();
|
|
12114
12114
|
b._setOwnerElement(e);
|
|
12115
12115
|
e._attrsByLName[lname] = b;
|
|
12116
12116
|
e._addQName(b);
|
|
@@ -12122,10 +12122,10 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12122
12122
|
if (this.localName !== that.localName || this.namespaceURI !== that.namespaceURI || this.prefix !== that.prefix || this._numattrs !== that._numattrs)
|
|
12123
12123
|
return false;
|
|
12124
12124
|
for (var i = 0, n = this._numattrs;i < n; i++) {
|
|
12125
|
-
var
|
|
12126
|
-
if (!that.hasAttributeNS(
|
|
12125
|
+
var a3 = this._attr(i);
|
|
12126
|
+
if (!that.hasAttributeNS(a3.namespaceURI, a3.localName))
|
|
12127
12127
|
return false;
|
|
12128
|
-
if (that.getAttributeNS(
|
|
12128
|
+
if (that.getAttributeNS(a3.namespaceURI, a3.localName) !== a3.value)
|
|
12129
12129
|
return false;
|
|
12130
12130
|
}
|
|
12131
12131
|
return true;
|
|
@@ -12135,9 +12135,9 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12135
12135
|
return this.prefix;
|
|
12136
12136
|
}
|
|
12137
12137
|
for (var i = 0, n = this._numattrs;i < n; i++) {
|
|
12138
|
-
var
|
|
12139
|
-
if (
|
|
12140
|
-
return
|
|
12138
|
+
var a3 = this._attr(i);
|
|
12139
|
+
if (a3.prefix === "xmlns" && a3.value === ns && originalElement.lookupNamespaceURI(a3.localName) === ns) {
|
|
12140
|
+
return a3.localName;
|
|
12141
12141
|
}
|
|
12142
12142
|
}
|
|
12143
12143
|
var parent = this.parentElement;
|
|
@@ -12150,10 +12150,10 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12150
12150
|
if (this.namespaceURI !== null && this.prefix === prefix)
|
|
12151
12151
|
return this.namespaceURI;
|
|
12152
12152
|
for (var i = 0, n = this._numattrs;i < n; i++) {
|
|
12153
|
-
var
|
|
12154
|
-
if (
|
|
12155
|
-
if (
|
|
12156
|
-
return
|
|
12153
|
+
var a3 = this._attr(i);
|
|
12154
|
+
if (a3.namespaceURI === NAMESPACE.XMLNS) {
|
|
12155
|
+
if (a3.prefix === "xmlns" && a3.localName === prefix || prefix === null && a3.prefix === null && a3.localName === "xmlns") {
|
|
12156
|
+
return a3.value || null;
|
|
12157
12157
|
}
|
|
12158
12158
|
}
|
|
12159
12159
|
}
|
|
@@ -12206,8 +12206,8 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12206
12206
|
utils.InvalidCharacterError();
|
|
12207
12207
|
if (/[A-Z]/.test(qname) && this.isHTML)
|
|
12208
12208
|
qname = utils.toASCIILowerCase(qname);
|
|
12209
|
-
var
|
|
12210
|
-
if (
|
|
12209
|
+
var a3 = this._attrsByQName[qname];
|
|
12210
|
+
if (a3 === undefined) {
|
|
12211
12211
|
if (force === undefined || force === true) {
|
|
12212
12212
|
this._setAttribute(qname, "");
|
|
12213
12213
|
return true;
|
|
@@ -12294,15 +12294,15 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12294
12294
|
if (!Array.isArray(oldAttrs)) {
|
|
12295
12295
|
oldAttrs = [oldAttrs];
|
|
12296
12296
|
}
|
|
12297
|
-
if (oldAttrs.some(function(
|
|
12298
|
-
return
|
|
12297
|
+
if (oldAttrs.some(function(a3) {
|
|
12298
|
+
return a3 === attr;
|
|
12299
12299
|
})) {
|
|
12300
12300
|
return attr;
|
|
12301
12301
|
} else if (attr.ownerElement !== null) {
|
|
12302
12302
|
throw new DOMException2(DOMException2.INUSE_ATTRIBUTE_ERR);
|
|
12303
12303
|
}
|
|
12304
|
-
oldAttrs.forEach(function(
|
|
12305
|
-
this.removeAttributeNode(
|
|
12304
|
+
oldAttrs.forEach(function(a3) {
|
|
12305
|
+
this.removeAttributeNode(a3);
|
|
12306
12306
|
}, this);
|
|
12307
12307
|
result = oldAttrs[0];
|
|
12308
12308
|
}
|
|
@@ -12482,13 +12482,13 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12482
12482
|
}
|
|
12483
12483
|
var dtlist = new DOMTokenList(function() {
|
|
12484
12484
|
return self.className || "";
|
|
12485
|
-
}, function(
|
|
12486
|
-
self.className =
|
|
12485
|
+
}, function(v2) {
|
|
12486
|
+
self.className = v2;
|
|
12487
12487
|
});
|
|
12488
12488
|
this._classList = dtlist;
|
|
12489
12489
|
return dtlist;
|
|
12490
|
-
}, set: function(
|
|
12491
|
-
this.className =
|
|
12490
|
+
}, set: function(v2) {
|
|
12491
|
+
this.className = v2;
|
|
12492
12492
|
} },
|
|
12493
12493
|
matches: { value: function(selector) {
|
|
12494
12494
|
return select.matches(this, selector);
|
|
@@ -12586,30 +12586,30 @@ var require_Element = __commonJS((exports, module) => {
|
|
|
12586
12586
|
get: function() {
|
|
12587
12587
|
return this.value;
|
|
12588
12588
|
},
|
|
12589
|
-
set: function(
|
|
12590
|
-
this.value =
|
|
12589
|
+
set: function(v2) {
|
|
12590
|
+
this.value = v2;
|
|
12591
12591
|
}
|
|
12592
12592
|
},
|
|
12593
12593
|
textContent: {
|
|
12594
12594
|
get: function() {
|
|
12595
12595
|
return this.value;
|
|
12596
12596
|
},
|
|
12597
|
-
set: function(
|
|
12598
|
-
if (
|
|
12599
|
-
|
|
12597
|
+
set: function(v2) {
|
|
12598
|
+
if (v2 === null || v2 === undefined) {
|
|
12599
|
+
v2 = "";
|
|
12600
12600
|
}
|
|
12601
|
-
this.value =
|
|
12601
|
+
this.value = v2;
|
|
12602
12602
|
}
|
|
12603
12603
|
},
|
|
12604
12604
|
innerText: {
|
|
12605
12605
|
get: function() {
|
|
12606
12606
|
return this.value;
|
|
12607
12607
|
},
|
|
12608
|
-
set: function(
|
|
12609
|
-
if (
|
|
12610
|
-
|
|
12608
|
+
set: function(v2) {
|
|
12609
|
+
if (v2 === null || v2 === undefined) {
|
|
12610
|
+
v2 = "";
|
|
12611
12611
|
}
|
|
12612
|
-
this.value =
|
|
12612
|
+
this.value = v2;
|
|
12613
12613
|
}
|
|
12614
12614
|
}
|
|
12615
12615
|
});
|
|
@@ -12848,15 +12848,15 @@ var require_Text = __commonJS((exports, module) => {
|
|
|
12848
12848
|
get: function() {
|
|
12849
12849
|
return this._data;
|
|
12850
12850
|
},
|
|
12851
|
-
set: function(
|
|
12852
|
-
if (
|
|
12853
|
-
|
|
12851
|
+
set: function(v2) {
|
|
12852
|
+
if (v2 === null || v2 === undefined) {
|
|
12853
|
+
v2 = "";
|
|
12854
12854
|
} else {
|
|
12855
|
-
|
|
12855
|
+
v2 = String(v2);
|
|
12856
12856
|
}
|
|
12857
|
-
if (
|
|
12857
|
+
if (v2 === this._data)
|
|
12858
12858
|
return;
|
|
12859
|
-
this._data =
|
|
12859
|
+
this._data = v2;
|
|
12860
12860
|
if (this.rooted)
|
|
12861
12861
|
this.ownerDocument.mutateValue(this);
|
|
12862
12862
|
if (this.parentNode && this.parentNode._textchangehook)
|
|
@@ -12870,8 +12870,8 @@ var require_Text = __commonJS((exports, module) => {
|
|
|
12870
12870
|
innerText: nodeValue,
|
|
12871
12871
|
data: {
|
|
12872
12872
|
get: nodeValue.get,
|
|
12873
|
-
set: function(
|
|
12874
|
-
nodeValue.set.call(this,
|
|
12873
|
+
set: function(v2) {
|
|
12874
|
+
nodeValue.set.call(this, v2 === null ? "" : String(v2));
|
|
12875
12875
|
}
|
|
12876
12876
|
},
|
|
12877
12877
|
splitText: { value: function splitText(offset) {
|
|
@@ -12916,13 +12916,13 @@ var require_Comment = __commonJS((exports, module) => {
|
|
|
12916
12916
|
get: function() {
|
|
12917
12917
|
return this._data;
|
|
12918
12918
|
},
|
|
12919
|
-
set: function(
|
|
12920
|
-
if (
|
|
12921
|
-
|
|
12919
|
+
set: function(v2) {
|
|
12920
|
+
if (v2 === null || v2 === undefined) {
|
|
12921
|
+
v2 = "";
|
|
12922
12922
|
} else {
|
|
12923
|
-
|
|
12923
|
+
v2 = String(v2);
|
|
12924
12924
|
}
|
|
12925
|
-
this._data =
|
|
12925
|
+
this._data = v2;
|
|
12926
12926
|
if (this.rooted)
|
|
12927
12927
|
this.ownerDocument.mutateValue(this);
|
|
12928
12928
|
}
|
|
@@ -12934,8 +12934,8 @@ var require_Comment = __commonJS((exports, module) => {
|
|
|
12934
12934
|
innerText: nodeValue,
|
|
12935
12935
|
data: {
|
|
12936
12936
|
get: nodeValue.get,
|
|
12937
|
-
set: function(
|
|
12938
|
-
nodeValue.set.call(this,
|
|
12937
|
+
set: function(v2) {
|
|
12938
|
+
nodeValue.set.call(this, v2 === null ? "" : String(v2));
|
|
12939
12939
|
}
|
|
12940
12940
|
},
|
|
12941
12941
|
clone: { value: function clone() {
|
|
@@ -13017,13 +13017,13 @@ var require_ProcessingInstruction = __commonJS((exports, module) => {
|
|
|
13017
13017
|
get: function() {
|
|
13018
13018
|
return this._data;
|
|
13019
13019
|
},
|
|
13020
|
-
set: function(
|
|
13021
|
-
if (
|
|
13022
|
-
|
|
13020
|
+
set: function(v2) {
|
|
13021
|
+
if (v2 === null || v2 === undefined) {
|
|
13022
|
+
v2 = "";
|
|
13023
13023
|
} else {
|
|
13024
|
-
|
|
13024
|
+
v2 = String(v2);
|
|
13025
13025
|
}
|
|
13026
|
-
this._data =
|
|
13026
|
+
this._data = v2;
|
|
13027
13027
|
if (this.rooted)
|
|
13028
13028
|
this.ownerDocument.mutateValue(this);
|
|
13029
13029
|
}
|
|
@@ -13037,8 +13037,8 @@ var require_ProcessingInstruction = __commonJS((exports, module) => {
|
|
|
13037
13037
|
innerText: nodeValue,
|
|
13038
13038
|
data: {
|
|
13039
13039
|
get: nodeValue.get,
|
|
13040
|
-
set: function(
|
|
13041
|
-
nodeValue.set.call(this,
|
|
13040
|
+
set: function(v2) {
|
|
13041
|
+
nodeValue.set.call(this, v2 === null ? "" : String(v2));
|
|
13042
13042
|
}
|
|
13043
13043
|
},
|
|
13044
13044
|
clone: { value: function clone() {
|
|
@@ -13241,11 +13241,11 @@ var require_TreeWalker = __commonJS((exports, module) => {
|
|
|
13241
13241
|
get: function currentNode() {
|
|
13242
13242
|
return this._currentNode;
|
|
13243
13243
|
},
|
|
13244
|
-
set: function setCurrentNode(
|
|
13245
|
-
if (!(
|
|
13244
|
+
set: function setCurrentNode(v2) {
|
|
13245
|
+
if (!(v2 instanceof Node)) {
|
|
13246
13246
|
throw new TypeError("Not a Node");
|
|
13247
13247
|
}
|
|
13248
|
-
this._currentNode =
|
|
13248
|
+
this._currentNode = v2;
|
|
13249
13249
|
}
|
|
13250
13250
|
},
|
|
13251
13251
|
_internalFilter: { value: function _internalFilter(node) {
|
|
@@ -13763,8 +13763,8 @@ var require_style_parser = __commonJS((exports) => {
|
|
|
13763
13763
|
}
|
|
13764
13764
|
exports.parse = parse;
|
|
13765
13765
|
function hyphenate(value) {
|
|
13766
|
-
return value.replace(/[a-z][A-Z]/g, (
|
|
13767
|
-
return
|
|
13766
|
+
return value.replace(/[a-z][A-Z]/g, (v2) => {
|
|
13767
|
+
return v2.charAt(0) + "-" + v2.charAt(1);
|
|
13768
13768
|
}).toLowerCase();
|
|
13769
13769
|
}
|
|
13770
13770
|
exports.hyphenate = hyphenate;
|
|
@@ -13963,14 +13963,14 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
13963
13963
|
else
|
|
13964
13964
|
return ":";
|
|
13965
13965
|
},
|
|
13966
|
-
set: function(
|
|
13966
|
+
set: function(v2) {
|
|
13967
13967
|
var output = this.href;
|
|
13968
13968
|
var url = new URL2(output);
|
|
13969
13969
|
if (url.isAbsolute()) {
|
|
13970
|
-
|
|
13971
|
-
|
|
13972
|
-
if (
|
|
13973
|
-
url.scheme =
|
|
13970
|
+
v2 = v2.replace(/:+$/, "");
|
|
13971
|
+
v2 = v2.replace(/[^-+\.a-zA-Z0-9]/g, URL2.percentEncode);
|
|
13972
|
+
if (v2.length > 0) {
|
|
13973
|
+
url.scheme = v2;
|
|
13974
13974
|
output = url.toString();
|
|
13975
13975
|
}
|
|
13976
13976
|
}
|
|
@@ -13985,13 +13985,13 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
13985
13985
|
else
|
|
13986
13986
|
return "";
|
|
13987
13987
|
},
|
|
13988
|
-
set: function(
|
|
13988
|
+
set: function(v2) {
|
|
13989
13989
|
var output = this.href;
|
|
13990
13990
|
var url = new URL2(output);
|
|
13991
13991
|
if (url.isAbsolute() && url.isAuthorityBased()) {
|
|
13992
|
-
|
|
13993
|
-
if (
|
|
13994
|
-
url.host =
|
|
13992
|
+
v2 = v2.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL2.percentEncode);
|
|
13993
|
+
if (v2.length > 0) {
|
|
13994
|
+
url.host = v2;
|
|
13995
13995
|
delete url.port;
|
|
13996
13996
|
output = url.toString();
|
|
13997
13997
|
}
|
|
@@ -14007,14 +14007,14 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14007
14007
|
else
|
|
14008
14008
|
return "";
|
|
14009
14009
|
},
|
|
14010
|
-
set: function(
|
|
14010
|
+
set: function(v2) {
|
|
14011
14011
|
var output = this.href;
|
|
14012
14012
|
var url = new URL2(output);
|
|
14013
14013
|
if (url.isAbsolute() && url.isAuthorityBased()) {
|
|
14014
|
-
|
|
14015
|
-
|
|
14016
|
-
if (
|
|
14017
|
-
url.host =
|
|
14014
|
+
v2 = v2.replace(/^\/+/, "");
|
|
14015
|
+
v2 = v2.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL2.percentEncode);
|
|
14016
|
+
if (v2.length > 0) {
|
|
14017
|
+
url.host = v2;
|
|
14018
14018
|
output = url.toString();
|
|
14019
14019
|
}
|
|
14020
14020
|
}
|
|
@@ -14029,17 +14029,17 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14029
14029
|
else
|
|
14030
14030
|
return "";
|
|
14031
14031
|
},
|
|
14032
|
-
set: function(
|
|
14032
|
+
set: function(v2) {
|
|
14033
14033
|
var output = this.href;
|
|
14034
14034
|
var url = new URL2(output);
|
|
14035
14035
|
if (url.isAbsolute() && url.isAuthorityBased()) {
|
|
14036
|
-
|
|
14037
|
-
|
|
14038
|
-
|
|
14039
|
-
if (
|
|
14040
|
-
|
|
14041
|
-
if (parseInt(
|
|
14042
|
-
url.port =
|
|
14036
|
+
v2 = "" + v2;
|
|
14037
|
+
v2 = v2.replace(/[^0-9].*$/, "");
|
|
14038
|
+
v2 = v2.replace(/^0+/, "");
|
|
14039
|
+
if (v2.length === 0)
|
|
14040
|
+
v2 = "0";
|
|
14041
|
+
if (parseInt(v2, 10) <= 65535) {
|
|
14042
|
+
url.port = v2;
|
|
14043
14043
|
output = url.toString();
|
|
14044
14044
|
}
|
|
14045
14045
|
}
|
|
@@ -14054,14 +14054,14 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14054
14054
|
else
|
|
14055
14055
|
return "";
|
|
14056
14056
|
},
|
|
14057
|
-
set: function(
|
|
14057
|
+
set: function(v2) {
|
|
14058
14058
|
var output = this.href;
|
|
14059
14059
|
var url = new URL2(output);
|
|
14060
14060
|
if (url.isAbsolute() && url.isHierarchical()) {
|
|
14061
|
-
if (
|
|
14062
|
-
|
|
14063
|
-
|
|
14064
|
-
url.path =
|
|
14061
|
+
if (v2.charAt(0) !== "/")
|
|
14062
|
+
v2 = "/" + v2;
|
|
14063
|
+
v2 = v2.replace(/[^-+\._~!$&'()*,;:=@\/a-zA-Z0-9]/g, URL2.percentEncode);
|
|
14064
|
+
url.path = v2;
|
|
14065
14065
|
output = url.toString();
|
|
14066
14066
|
}
|
|
14067
14067
|
this.href = output;
|
|
@@ -14075,14 +14075,14 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14075
14075
|
else
|
|
14076
14076
|
return "";
|
|
14077
14077
|
},
|
|
14078
|
-
set: function(
|
|
14078
|
+
set: function(v2) {
|
|
14079
14079
|
var output = this.href;
|
|
14080
14080
|
var url = new URL2(output);
|
|
14081
14081
|
if (url.isAbsolute() && url.isHierarchical()) {
|
|
14082
|
-
if (
|
|
14083
|
-
|
|
14084
|
-
|
|
14085
|
-
url.query =
|
|
14082
|
+
if (v2.charAt(0) === "?")
|
|
14083
|
+
v2 = v2.substring(1);
|
|
14084
|
+
v2 = v2.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL2.percentEncode);
|
|
14085
|
+
url.query = v2;
|
|
14086
14086
|
output = url.toString();
|
|
14087
14087
|
}
|
|
14088
14088
|
this.href = output;
|
|
@@ -14097,13 +14097,13 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14097
14097
|
return "#" + url.fragment;
|
|
14098
14098
|
}
|
|
14099
14099
|
},
|
|
14100
|
-
set: function(
|
|
14100
|
+
set: function(v2) {
|
|
14101
14101
|
var output = this.href;
|
|
14102
14102
|
var url = new URL2(output);
|
|
14103
|
-
if (
|
|
14104
|
-
|
|
14105
|
-
|
|
14106
|
-
url.fragment =
|
|
14103
|
+
if (v2.charAt(0) === "#")
|
|
14104
|
+
v2 = v2.substring(1);
|
|
14105
|
+
v2 = v2.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL2.percentEncode);
|
|
14106
|
+
url.fragment = v2;
|
|
14107
14107
|
output = url.toString();
|
|
14108
14108
|
this.href = output;
|
|
14109
14109
|
}
|
|
@@ -14113,12 +14113,12 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14113
14113
|
var url = this._url;
|
|
14114
14114
|
return url.username || "";
|
|
14115
14115
|
},
|
|
14116
|
-
set: function(
|
|
14116
|
+
set: function(v2) {
|
|
14117
14117
|
var output = this.href;
|
|
14118
14118
|
var url = new URL2(output);
|
|
14119
14119
|
if (url.isAbsolute()) {
|
|
14120
|
-
|
|
14121
|
-
url.username =
|
|
14120
|
+
v2 = v2.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\:]/g, URL2.percentEncode);
|
|
14121
|
+
url.username = v2;
|
|
14122
14122
|
output = url.toString();
|
|
14123
14123
|
}
|
|
14124
14124
|
this.href = output;
|
|
@@ -14129,15 +14129,15 @@ var require_URLUtils = __commonJS((exports, module) => {
|
|
|
14129
14129
|
var url = this._url;
|
|
14130
14130
|
return url.password || "";
|
|
14131
14131
|
},
|
|
14132
|
-
set: function(
|
|
14132
|
+
set: function(v2) {
|
|
14133
14133
|
var output = this.href;
|
|
14134
14134
|
var url = new URL2(output);
|
|
14135
14135
|
if (url.isAbsolute()) {
|
|
14136
|
-
if (
|
|
14136
|
+
if (v2 === "") {
|
|
14137
14137
|
url.password = null;
|
|
14138
14138
|
} else {
|
|
14139
|
-
|
|
14140
|
-
url.password =
|
|
14139
|
+
v2 = v2.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\]/g, URL2.percentEncode);
|
|
14140
|
+
url.password = v2;
|
|
14141
14141
|
}
|
|
14142
14142
|
output = url.toString();
|
|
14143
14143
|
}
|
|
@@ -14233,8 +14233,8 @@ var require_defineElement = __commonJS((exports, module) => {
|
|
|
14233
14233
|
get: function() {
|
|
14234
14234
|
return this._getEventHandler(type);
|
|
14235
14235
|
},
|
|
14236
|
-
set: function(
|
|
14237
|
-
this._setEventHandler(type,
|
|
14236
|
+
set: function(v2) {
|
|
14237
|
+
this._setEventHandler(type, v2);
|
|
14238
14238
|
}
|
|
14239
14239
|
});
|
|
14240
14240
|
attributes.registerChangeHandler(c, "on" + type, EventHandlerChangeHandler);
|
|
@@ -14262,12 +14262,12 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
14262
14262
|
function URL2(attr) {
|
|
14263
14263
|
return {
|
|
14264
14264
|
get: function() {
|
|
14265
|
-
var
|
|
14266
|
-
if (
|
|
14265
|
+
var v2 = this._getattr(attr);
|
|
14266
|
+
if (v2 === null) {
|
|
14267
14267
|
return "";
|
|
14268
14268
|
}
|
|
14269
|
-
var url = this.doc._resolve(
|
|
14270
|
-
return url === null ?
|
|
14269
|
+
var url = this.doc._resolve(v2);
|
|
14270
|
+
return url === null ? v2 : url;
|
|
14271
14271
|
},
|
|
14272
14272
|
set: function(value) {
|
|
14273
14273
|
this._setattr(attr, value);
|
|
@@ -14277,11 +14277,11 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
14277
14277
|
function CORS(attr) {
|
|
14278
14278
|
return {
|
|
14279
14279
|
get: function() {
|
|
14280
|
-
var
|
|
14281
|
-
if (
|
|
14280
|
+
var v2 = this._getattr(attr);
|
|
14281
|
+
if (v2 === null) {
|
|
14282
14282
|
return null;
|
|
14283
14283
|
}
|
|
14284
|
-
if (
|
|
14284
|
+
if (v2.toLowerCase() === "use-credentials") {
|
|
14285
14285
|
return "use-credentials";
|
|
14286
14286
|
}
|
|
14287
14287
|
return "anonymous";
|
|
@@ -14320,17 +14320,17 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
14320
14320
|
},
|
|
14321
14321
|
props: {
|
|
14322
14322
|
dangerouslySetInnerHTML: {
|
|
14323
|
-
set: function(
|
|
14324
|
-
this._innerHTML =
|
|
14323
|
+
set: function(v2) {
|
|
14324
|
+
this._innerHTML = v2;
|
|
14325
14325
|
}
|
|
14326
14326
|
},
|
|
14327
14327
|
innerHTML: {
|
|
14328
14328
|
get: function() {
|
|
14329
14329
|
return this.serialize();
|
|
14330
14330
|
},
|
|
14331
|
-
set: function(
|
|
14331
|
+
set: function(v2) {
|
|
14332
14332
|
var parser2 = this.ownerDocument.implementation.mozHTMLParser(this.ownerDocument._address, this);
|
|
14333
|
-
parser2.parse(
|
|
14333
|
+
parser2.parse(v2 === null ? "" : String(v2), true);
|
|
14334
14334
|
var target = this instanceof htmlNameToImpl.template ? this.content : this;
|
|
14335
14335
|
while (target.hasChildNodes())
|
|
14336
14336
|
target.removeChild(target.firstChild);
|
|
@@ -14341,11 +14341,11 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
14341
14341
|
if (!this._style)
|
|
14342
14342
|
this._style = new CSSStyleDeclaration(this);
|
|
14343
14343
|
return this._style;
|
|
14344
|
-
}, set: function(
|
|
14345
|
-
if (
|
|
14346
|
-
|
|
14344
|
+
}, set: function(v2) {
|
|
14345
|
+
if (v2 === null || v2 === undefined) {
|
|
14346
|
+
v2 = "";
|
|
14347
14347
|
}
|
|
14348
|
-
this._setattr("style", String(
|
|
14348
|
+
this._setattr("style", String(v2));
|
|
14349
14349
|
} },
|
|
14350
14350
|
blur: { value: function() {} },
|
|
14351
14351
|
focus: { value: function() {} },
|
|
@@ -15073,16 +15073,16 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
15073
15073
|
get: function() {
|
|
15074
15074
|
return this._getattr("value") || this.text;
|
|
15075
15075
|
},
|
|
15076
|
-
set: function(
|
|
15077
|
-
this._setattr("value",
|
|
15076
|
+
set: function(v2) {
|
|
15077
|
+
this._setattr("value", v2);
|
|
15078
15078
|
}
|
|
15079
15079
|
},
|
|
15080
15080
|
text: {
|
|
15081
15081
|
get: function() {
|
|
15082
15082
|
return this.textContent.replace(/[ \t\n\f\r]+/g, " ").trim();
|
|
15083
15083
|
},
|
|
15084
|
-
set: function(
|
|
15085
|
-
this.textContent =
|
|
15084
|
+
set: function(v2) {
|
|
15085
|
+
this.textContent = v2;
|
|
15086
15086
|
}
|
|
15087
15087
|
}
|
|
15088
15088
|
},
|
|
@@ -15373,16 +15373,16 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
15373
15373
|
get: function() {
|
|
15374
15374
|
return this.textContent;
|
|
15375
15375
|
},
|
|
15376
|
-
set: function(
|
|
15377
|
-
this.textContent =
|
|
15376
|
+
set: function(v2) {
|
|
15377
|
+
this.textContent = v2;
|
|
15378
15378
|
}
|
|
15379
15379
|
},
|
|
15380
15380
|
value: {
|
|
15381
15381
|
get: function() {
|
|
15382
15382
|
return this.defaultValue;
|
|
15383
15383
|
},
|
|
15384
|
-
set: function(
|
|
15385
|
-
this.defaultValue =
|
|
15384
|
+
set: function(v2) {
|
|
15385
|
+
this.defaultValue = v2;
|
|
15386
15386
|
}
|
|
15387
15387
|
},
|
|
15388
15388
|
textLength: { get: function() {
|
|
@@ -15567,8 +15567,8 @@ var require_htmlelts = __commonJS((exports) => {
|
|
|
15567
15567
|
}
|
|
15568
15568
|
return this._label;
|
|
15569
15569
|
},
|
|
15570
|
-
set: function(
|
|
15571
|
-
this._setattr("label",
|
|
15570
|
+
set: function(v2) {
|
|
15571
|
+
this._setattr("label", v2);
|
|
15572
15572
|
}
|
|
15573
15573
|
}
|
|
15574
15574
|
},
|
|
@@ -15902,17 +15902,17 @@ var require_Document2 = __commonJS((exports, module) => {
|
|
|
15902
15902
|
mutationevents: "mutationevent",
|
|
15903
15903
|
uievents: "uievent"
|
|
15904
15904
|
};
|
|
15905
|
-
var mirrorAttr = function(
|
|
15905
|
+
var mirrorAttr = function(f2, name, defaultValue) {
|
|
15906
15906
|
return {
|
|
15907
15907
|
get: function() {
|
|
15908
|
-
var o =
|
|
15908
|
+
var o = f2.call(this);
|
|
15909
15909
|
if (o) {
|
|
15910
15910
|
return o[name];
|
|
15911
15911
|
}
|
|
15912
15912
|
return defaultValue;
|
|
15913
15913
|
},
|
|
15914
15914
|
set: function(value) {
|
|
15915
|
-
var o =
|
|
15915
|
+
var o = f2.call(this);
|
|
15916
15916
|
if (o) {
|
|
15917
15917
|
o[name] = value;
|
|
15918
15918
|
}
|
|
@@ -15997,8 +15997,8 @@ var require_Document2 = __commonJS((exports, module) => {
|
|
|
15997
15997
|
createAttributeNS: { value: function(namespace, qualifiedName) {
|
|
15998
15998
|
namespace = namespace === null || namespace === undefined || namespace === "" ? null : String(namespace);
|
|
15999
15999
|
qualifiedName = String(qualifiedName);
|
|
16000
|
-
var
|
|
16001
|
-
return new Element._Attr(null,
|
|
16000
|
+
var ve2 = validateAndExtract(namespace, qualifiedName);
|
|
16001
|
+
return new Element._Attr(null, ve2.localName, ve2.prefix, ve2.namespace, "");
|
|
16002
16002
|
} },
|
|
16003
16003
|
createElement: { value: function(localName) {
|
|
16004
16004
|
localName = String(localName);
|
|
@@ -16017,8 +16017,8 @@ var require_Document2 = __commonJS((exports, module) => {
|
|
|
16017
16017
|
createElementNS: { value: function(namespace, qualifiedName) {
|
|
16018
16018
|
namespace = namespace === null || namespace === undefined || namespace === "" ? null : String(namespace);
|
|
16019
16019
|
qualifiedName = String(qualifiedName);
|
|
16020
|
-
var
|
|
16021
|
-
return this._createElementNS(
|
|
16020
|
+
var ve2 = validateAndExtract(namespace, qualifiedName);
|
|
16021
|
+
return this._createElementNS(ve2.localName, ve2.namespace, ve2.prefix);
|
|
16022
16022
|
}, writable: isApiWritable },
|
|
16023
16023
|
_createElementNS: { value: function(localName, namespace, prefix) {
|
|
16024
16024
|
if (namespace === NAMESPACE.HTML) {
|
|
@@ -16458,8 +16458,8 @@ var require_Document2 = __commonJS((exports, module) => {
|
|
|
16458
16458
|
get: function() {
|
|
16459
16459
|
return this._getEventHandler(type);
|
|
16460
16460
|
},
|
|
16461
|
-
set: function(
|
|
16462
|
-
this._setEventHandler(type,
|
|
16461
|
+
set: function(v2) {
|
|
16462
|
+
this._setEventHandler(type, v2);
|
|
16463
16463
|
}
|
|
16464
16464
|
});
|
|
16465
16465
|
});
|
|
@@ -19549,15 +19549,15 @@ var require_HTMLParser = __commonJS((exports, module) => {
|
|
|
19549
19549
|
this.attrs.splice(idx, 1);
|
|
19550
19550
|
}
|
|
19551
19551
|
};
|
|
19552
|
-
HTMLParser.ActiveFormattingElements.prototype.replace = function(
|
|
19553
|
-
var idx = this.list.lastIndexOf(
|
|
19552
|
+
HTMLParser.ActiveFormattingElements.prototype.replace = function(a3, b, attrs) {
|
|
19553
|
+
var idx = this.list.lastIndexOf(a3);
|
|
19554
19554
|
if (idx !== -1) {
|
|
19555
19555
|
this.list[idx] = b;
|
|
19556
19556
|
this.attrs[idx] = attrs;
|
|
19557
19557
|
}
|
|
19558
19558
|
};
|
|
19559
|
-
HTMLParser.ActiveFormattingElements.prototype.insertAfter = function(
|
|
19560
|
-
var idx = this.list.lastIndexOf(
|
|
19559
|
+
HTMLParser.ActiveFormattingElements.prototype.insertAfter = function(a3, b) {
|
|
19560
|
+
var idx = this.list.lastIndexOf(a3);
|
|
19561
19561
|
if (idx !== -1) {
|
|
19562
19562
|
this.list.splice(idx, 0, b);
|
|
19563
19563
|
this.attrs.splice(idx, 0, b);
|
|
@@ -20139,8 +20139,8 @@ var require_HTMLParser = __commonJS((exports, module) => {
|
|
|
20139
20139
|
var tag = node.localName;
|
|
20140
20140
|
switch (tag) {
|
|
20141
20141
|
case "select":
|
|
20142
|
-
for (var
|
|
20143
|
-
var ancestor = stack.elements[--
|
|
20142
|
+
for (var j2 = i;j2 > 0; ) {
|
|
20143
|
+
var ancestor = stack.elements[--j2];
|
|
20144
20144
|
if (ancestor instanceof impl.HTMLTemplateElement) {
|
|
20145
20145
|
break;
|
|
20146
20146
|
} else if (ancestor instanceof impl.HTMLTableElement) {
|
|
@@ -24608,11 +24608,11 @@ var require_HTMLParser = __commonJS((exports, module) => {
|
|
|
24608
24608
|
case 2:
|
|
24609
24609
|
var attrs = Object.create(null);
|
|
24610
24610
|
for (var i2 = 0;i2 < arg3.length; i2++) {
|
|
24611
|
-
var
|
|
24612
|
-
if (
|
|
24613
|
-
attrs[
|
|
24611
|
+
var a3 = arg3[i2];
|
|
24612
|
+
if (a3.length === 1) {
|
|
24613
|
+
attrs[a3[0]] = "";
|
|
24614
24614
|
} else {
|
|
24615
|
-
attrs[
|
|
24615
|
+
attrs[a3[0]] = a3[1];
|
|
24616
24616
|
}
|
|
24617
24617
|
}
|
|
24618
24618
|
var token = ["StartTag", value, attrs];
|
|
@@ -24660,8 +24660,8 @@ var require_DOMImplementation = __commonJS((exports, module) => {
|
|
|
24660
24660
|
};
|
|
24661
24661
|
DOMImplementation.prototype = {
|
|
24662
24662
|
hasFeature: function hasFeature(feature, version) {
|
|
24663
|
-
var
|
|
24664
|
-
return
|
|
24663
|
+
var f2 = supportedFeatures[(feature || "").toLowerCase()];
|
|
24664
|
+
return f2 && f2[version || ""] || false;
|
|
24665
24665
|
},
|
|
24666
24666
|
createDocumentType: function createDocumentType(qualifiedName, publicId, systemId) {
|
|
24667
24667
|
if (!xml.isValidQName(qualifiedName))
|
|
@@ -24730,8 +24730,8 @@ var require_Location = __commonJS((exports, module) => {
|
|
|
24730
24730
|
get: function() {
|
|
24731
24731
|
return this._href;
|
|
24732
24732
|
},
|
|
24733
|
-
set: function(
|
|
24734
|
-
this.assign(
|
|
24733
|
+
set: function(v2) {
|
|
24734
|
+
this.assign(v2);
|
|
24735
24735
|
}
|
|
24736
24736
|
},
|
|
24737
24737
|
assign: { value: function(url) {
|
|
@@ -24852,8 +24852,8 @@ var require_Window = __commonJS((exports, module) => {
|
|
|
24852
24852
|
get: function() {
|
|
24853
24853
|
return this._getEventHandler("load");
|
|
24854
24854
|
},
|
|
24855
|
-
set: function(
|
|
24856
|
-
this._setEventHandler("load",
|
|
24855
|
+
set: function(v2) {
|
|
24856
|
+
this._setEventHandler("load", v2);
|
|
24857
24857
|
}
|
|
24858
24858
|
},
|
|
24859
24859
|
getComputedStyle: { value: function getComputedStyle(elt) {
|
|
@@ -28302,6 +28302,9 @@ function shapeShowOutput(result, detail, shape = "human") {
|
|
|
28302
28302
|
"steps",
|
|
28303
28303
|
"keys",
|
|
28304
28304
|
"links",
|
|
28305
|
+
"evidence",
|
|
28306
|
+
"evidenceSources",
|
|
28307
|
+
"provenance",
|
|
28305
28308
|
...FRAGMENT_PROVENANCE_FIELDS,
|
|
28306
28309
|
...FRAGMENT_CONTEXT_FIELDS
|
|
28307
28310
|
]);
|
|
@@ -28333,6 +28336,9 @@ function shapeShowOutput(result, detail, shape = "human") {
|
|
|
28333
28336
|
"activeRun",
|
|
28334
28337
|
"keys",
|
|
28335
28338
|
"links",
|
|
28339
|
+
"evidence",
|
|
28340
|
+
"evidenceSources",
|
|
28341
|
+
"provenance",
|
|
28336
28342
|
...FRAGMENT_PROVENANCE_FIELDS,
|
|
28337
28343
|
...FRAGMENT_CONTEXT_FIELDS,
|
|
28338
28344
|
"path",
|
|
@@ -28358,7 +28364,7 @@ function pickFields(source, fields) {
|
|
|
28358
28364
|
}
|
|
28359
28365
|
|
|
28360
28366
|
// src/output/shapes/curate.ts
|
|
28361
|
-
var BRIEF_FIELDS = ["source", "type", "name", "ref", "id", "supportRefs", "followUp", "reason"];
|
|
28367
|
+
var BRIEF_FIELDS = ["source", "type", "name", "ref", "id", "supportRefs", "beliefState", "followUp", "reason"];
|
|
28362
28368
|
var NORMAL_FIELDS = [
|
|
28363
28369
|
"source",
|
|
28364
28370
|
"type",
|
|
@@ -28374,6 +28380,7 @@ var NORMAL_FIELDS = [
|
|
|
28374
28380
|
"parameters",
|
|
28375
28381
|
"run",
|
|
28376
28382
|
"supportRefs",
|
|
28383
|
+
"beliefState",
|
|
28377
28384
|
"followUp",
|
|
28378
28385
|
"reason",
|
|
28379
28386
|
"score"
|
|
@@ -28389,6 +28396,7 @@ var AGENT_FIELDS = [
|
|
|
28389
28396
|
"id",
|
|
28390
28397
|
"description",
|
|
28391
28398
|
"supportRefs",
|
|
28399
|
+
"beliefState",
|
|
28392
28400
|
"followUp",
|
|
28393
28401
|
"reason",
|
|
28394
28402
|
"score"
|
|
@@ -30402,6 +30410,12 @@ function formatShowPlain(r, detail) {
|
|
|
30402
30410
|
}
|
|
30403
30411
|
if (r.description)
|
|
30404
30412
|
lines.push(`description: ${String(r.description)}`);
|
|
30413
|
+
if (r.evidence)
|
|
30414
|
+
lines.push(`evidence: ${String(r.evidence).replace(/\s+/g, " ")}`);
|
|
30415
|
+
if (Array.isArray(r.evidenceSources))
|
|
30416
|
+
lines.push(`evidenceSources: ${r.evidenceSources.join(", ")}`);
|
|
30417
|
+
if (r.evidence && r.provenance)
|
|
30418
|
+
lines.push(`provenance: ${JSON.stringify(r.provenance)}`);
|
|
30405
30419
|
if (r.workflowTitle)
|
|
30406
30420
|
lines.push(`workflowTitle: ${String(r.workflowTitle)}`);
|
|
30407
30421
|
if (r.agent)
|
|
@@ -40661,6 +40675,8 @@ function applyCuratedFrontmatter(entry, fmData) {
|
|
|
40661
40675
|
const evidenceSources = normalizeNonEmptyStringList(fmData.evidenceSources);
|
|
40662
40676
|
if (evidenceSources)
|
|
40663
40677
|
entry.evidenceSources = evidenceSources;
|
|
40678
|
+
if (typeof fmData.evidence === "string" && fmData.evidence.trim().length > 0)
|
|
40679
|
+
entry.evidence = fmData.evidence;
|
|
40664
40680
|
if (entry.type === "memory") {
|
|
40665
40681
|
const isDerivedByName = entry.name.toLowerCase().endsWith(".derived");
|
|
40666
40682
|
const isDerivedByFm = fmData.inferred === true;
|
|
@@ -45567,6 +45583,7 @@ var DOCUMENT_JSON_CARRIED_FIELDS = [
|
|
|
45567
45583
|
"wikiRole",
|
|
45568
45584
|
"sources",
|
|
45569
45585
|
"evidenceSources",
|
|
45586
|
+
"evidence",
|
|
45570
45587
|
"uses",
|
|
45571
45588
|
"provenance"
|
|
45572
45589
|
];
|
|
@@ -46479,6 +46496,1488 @@ var genericFilesAdapter = {
|
|
|
46479
46496
|
// src/core/adapter/adapters/llm-wiki-adapter.ts
|
|
46480
46497
|
import fs30 from "fs";
|
|
46481
46498
|
import path37 from "path";
|
|
46499
|
+
|
|
46500
|
+
// node_modules/marked/lib/marked.esm.js
|
|
46501
|
+
function B() {
|
|
46502
|
+
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
46503
|
+
}
|
|
46504
|
+
var y = B();
|
|
46505
|
+
function V(a) {
|
|
46506
|
+
y = a;
|
|
46507
|
+
}
|
|
46508
|
+
var M = { exec: () => null };
|
|
46509
|
+
function D(a) {
|
|
46510
|
+
let e = [];
|
|
46511
|
+
return (t) => {
|
|
46512
|
+
let n = Math.max(0, Math.min(3, t - 1)), i = e[n];
|
|
46513
|
+
return i || (i = a(n), e[n] = i), i;
|
|
46514
|
+
};
|
|
46515
|
+
}
|
|
46516
|
+
function h(a, e = "") {
|
|
46517
|
+
let t = typeof a == "string" ? a : a.source, n = { replace: (i, r) => {
|
|
46518
|
+
let o = typeof r == "string" ? r : r.source;
|
|
46519
|
+
return o = o.replace(x.caret, "$1"), t = t.replace(i, o), n;
|
|
46520
|
+
}, getRegex: () => new RegExp(t, e) };
|
|
46521
|
+
return n;
|
|
46522
|
+
}
|
|
46523
|
+
var ze = ((a = "") => {
|
|
46524
|
+
try {
|
|
46525
|
+
return !!new RegExp("(?<=1)(?<!1)" + a);
|
|
46526
|
+
} catch {
|
|
46527
|
+
return false;
|
|
46528
|
+
}
|
|
46529
|
+
})();
|
|
46530
|
+
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}}>`)) };
|
|
46531
|
+
var Ee = /^(?:[ \t]*(?:\n|$))+/;
|
|
46532
|
+
var Me = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
|
|
46533
|
+
var Ce = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
|
|
46534
|
+
var N = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
46535
|
+
var Ie = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
46536
|
+
var Y = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
|
|
46537
|
+
var fe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
46538
|
+
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();
|
|
46539
|
+
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();
|
|
46540
|
+
var ee = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
|
|
46541
|
+
var De = /^[^\n]+/;
|
|
46542
|
+
var te = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
|
|
46543
|
+
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();
|
|
46544
|
+
var Ze = h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Y).getRegex();
|
|
46545
|
+
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";
|
|
46546
|
+
var ne = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
|
|
46547
|
+
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();
|
|
46548
|
+
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();
|
|
46549
|
+
var He = xe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
|
|
46550
|
+
var Ge = xe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
|
|
46551
|
+
var Ne = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ge).getRegex();
|
|
46552
|
+
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 };
|
|
46553
|
+
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();
|
|
46554
|
+
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() };
|
|
46555
|
+
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} *[^
|
|
46556
|
+
]`).replace("lheading", me).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
|
|
46557
|
+
var Fe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
|
|
46558
|
+
var Ue = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
|
|
46559
|
+
var be = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
|
|
46560
|
+
var Ke = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
|
46561
|
+
var S = /[\p{P}\p{S}]/u;
|
|
46562
|
+
var q = /[\s\p{P}\p{S}]/u;
|
|
46563
|
+
var j = /[^\s\p{P}\p{S}]/u;
|
|
46564
|
+
var Xe = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, q).getRegex();
|
|
46565
|
+
var We = /[\p{Pi}\p{Ps}"']/u;
|
|
46566
|
+
var Re = /(?!~)[\p{P}\p{S}]/u;
|
|
46567
|
+
var Ve = /(?!~)[\s\p{P}\p{S}]/u;
|
|
46568
|
+
var Je = /(?:[^\s\p{P}\p{S}]|~)/u;
|
|
46569
|
+
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();
|
|
46570
|
+
var Te = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
|
|
46571
|
+
var et = h(Te, "u").replace(/punct/g, S).getRegex();
|
|
46572
|
+
var tt = h(Te, "u").replace(/punct/g, Re).getRegex();
|
|
46573
|
+
var nt = /^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/;
|
|
46574
|
+
var rt = h(nt, "u").replace(/openQuote/g, We).replace(/punct/g, S).getRegex();
|
|
46575
|
+
var Oe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
|
|
46576
|
+
var st = h(Oe, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
|
|
46577
|
+
var it = h(Oe, "gu").replace(/notPunctSpace/g, Je).replace(/punctSpace/g, Ve).replace(/punct/g, Re).getRegex();
|
|
46578
|
+
var ot = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)";
|
|
46579
|
+
var at = h(ot, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
|
|
46580
|
+
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();
|
|
46581
|
+
var ut = "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)";
|
|
46582
|
+
var pt = h(ut, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
|
|
46583
|
+
var ct = h(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, S).getRegex();
|
|
46584
|
+
var ht = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
|
|
46585
|
+
var dt = h(ht, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
|
|
46586
|
+
var kt = h(/\\(punct)/, "gu").replace(/punct/g, S).getRegex();
|
|
46587
|
+
var gt = h(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, S).getRegex();
|
|
46588
|
+
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();
|
|
46589
|
+
var mt = h(ne).replace("(?:-->|$)", "-->").getRegex();
|
|
46590
|
+
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();
|
|
46591
|
+
var we = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
|
|
46592
|
+
var K = h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", we).getRegex();
|
|
46593
|
+
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();
|
|
46594
|
+
var Rt = h(/^!?\[(label)\]\[(ref)\]/).replace("label", K).replace("ref", te).getRegex();
|
|
46595
|
+
var Tt = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", te).getRegex();
|
|
46596
|
+
var ke = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
|
|
46597
|
+
var Ot = h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", we).getRegex();
|
|
46598
|
+
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();
|
|
46599
|
+
var ge = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
|
|
46600
|
+
var Pt = /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/;
|
|
46601
|
+
var yt = h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, Pt).getRegex();
|
|
46602
|
+
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 };
|
|
46603
|
+
var St = { ...se, emStrongLDelim: rt, emStrongRDelimAst: at, emStrongRDelimUnd: pt, link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", K).getRegex(), reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", K).getRegex() };
|
|
46604
|
+
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() };
|
|
46605
|
+
var _t = { ...J, br: h(be).replace("{2,}", "*").getRegex(), text: h(J.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
|
|
46606
|
+
var F = { normal: re, gfm: Qe, pedantic: je };
|
|
46607
|
+
var Z = { normal: se, gfm: J, breaks: _t, pedantic: St };
|
|
46608
|
+
var $t = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
46609
|
+
var Pe = (a) => $t[a];
|
|
46610
|
+
function w(a, e) {
|
|
46611
|
+
if (e) {
|
|
46612
|
+
if (x.escapeTest.test(a))
|
|
46613
|
+
return a.replace(x.escapeReplace, Pe);
|
|
46614
|
+
} else if (x.escapeTestNoEncode.test(a))
|
|
46615
|
+
return a.replace(x.escapeReplaceNoEncode, Pe);
|
|
46616
|
+
return a;
|
|
46617
|
+
}
|
|
46618
|
+
function ye(a) {
|
|
46619
|
+
return x.numericCharacterReference.test(a) ? a.replace(x.numericCharacterReferenceOrAmpersand, (e, t, n) => {
|
|
46620
|
+
if (t === undefined && n === undefined)
|
|
46621
|
+
return "&";
|
|
46622
|
+
let i = t === undefined ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
46623
|
+
return i === 0 || i > 1114111 || i >= 55296 && i <= 57343 ? "\uFFFD" : i === 38 ? "&" : String.fromCodePoint(i);
|
|
46624
|
+
}) : a;
|
|
46625
|
+
}
|
|
46626
|
+
function ie(a) {
|
|
46627
|
+
try {
|
|
46628
|
+
a = encodeURI(a).replace(x.percentDecode, "%");
|
|
46629
|
+
} catch {
|
|
46630
|
+
return null;
|
|
46631
|
+
}
|
|
46632
|
+
return a;
|
|
46633
|
+
}
|
|
46634
|
+
function oe(a, e) {
|
|
46635
|
+
let t = a.replace(x.findPipe, (r, o, s) => {
|
|
46636
|
+
let l = false, u = o;
|
|
46637
|
+
for (;--u >= 0 && s[u] === "\\"; )
|
|
46638
|
+
l = !l;
|
|
46639
|
+
return l ? "|" : " |";
|
|
46640
|
+
}), n = t.split(x.splitPipe), i = 0;
|
|
46641
|
+
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e)
|
|
46642
|
+
if (n.length > e)
|
|
46643
|
+
n.splice(e);
|
|
46644
|
+
else
|
|
46645
|
+
for (;n.length < e; )
|
|
46646
|
+
n.push("");
|
|
46647
|
+
for (;i < n.length; i++)
|
|
46648
|
+
n[i] = n[i].trim().replace(x.slashPipe, "|");
|
|
46649
|
+
return n;
|
|
46650
|
+
}
|
|
46651
|
+
function A(a, e, t) {
|
|
46652
|
+
let n = a.length;
|
|
46653
|
+
if (n === 0)
|
|
46654
|
+
return "";
|
|
46655
|
+
let i = 0;
|
|
46656
|
+
for (;i < n; ) {
|
|
46657
|
+
let r = a.charAt(n - i - 1);
|
|
46658
|
+
if (r === e && !t)
|
|
46659
|
+
i++;
|
|
46660
|
+
else if (r !== e && t)
|
|
46661
|
+
i++;
|
|
46662
|
+
else
|
|
46663
|
+
break;
|
|
46664
|
+
}
|
|
46665
|
+
return a.slice(0, n - i);
|
|
46666
|
+
}
|
|
46667
|
+
function ae(a) {
|
|
46668
|
+
let e = a.split(`
|
|
46669
|
+
`), t = e.length - 1;
|
|
46670
|
+
for (;t >= 0 && x.blankLine.test(e[t]); )
|
|
46671
|
+
t--;
|
|
46672
|
+
return e.length - t <= 2 ? a : e.slice(0, t + 1).join(`
|
|
46673
|
+
`);
|
|
46674
|
+
}
|
|
46675
|
+
function v(a) {
|
|
46676
|
+
return a.trim().toLowerCase().toUpperCase().toLowerCase();
|
|
46677
|
+
}
|
|
46678
|
+
function le(a, e) {
|
|
46679
|
+
if (a.indexOf(e[0]) === -1 && a.indexOf(e[1]) === -1)
|
|
46680
|
+
return -1;
|
|
46681
|
+
let t = 0;
|
|
46682
|
+
for (let n = 0;n < a.length; n++)
|
|
46683
|
+
if (a[n] === "\\")
|
|
46684
|
+
n++;
|
|
46685
|
+
else if (a[n] === e[0])
|
|
46686
|
+
t++;
|
|
46687
|
+
else if (a[n] === e[1] && (t--, t < 0))
|
|
46688
|
+
return n;
|
|
46689
|
+
return t > 0 ? -2 : -1;
|
|
46690
|
+
}
|
|
46691
|
+
function X(a, e = 0) {
|
|
46692
|
+
let t = e, n = "";
|
|
46693
|
+
for (let i of a)
|
|
46694
|
+
if (i === "\t") {
|
|
46695
|
+
let r = 4 - t % 4;
|
|
46696
|
+
n += " ".repeat(r), t += r;
|
|
46697
|
+
} else
|
|
46698
|
+
n += i, t++;
|
|
46699
|
+
return n;
|
|
46700
|
+
}
|
|
46701
|
+
function Se(a, e, t, n, i) {
|
|
46702
|
+
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;
|
|
46703
|
+
n.state.inLink = true, n.state.linkEmitted = false;
|
|
46704
|
+
let d = n.inlineTokens(s), g = n.state.linkEmitted;
|
|
46705
|
+
if (n.state.linkEmitted = c, n.state.inLink = u, !l) {
|
|
46706
|
+
if (g) {
|
|
46707
|
+
n.state.inRawBlock = p;
|
|
46708
|
+
return;
|
|
46709
|
+
}
|
|
46710
|
+
n.state.linkEmitted = true;
|
|
46711
|
+
}
|
|
46712
|
+
return { type: l ? "image" : "link", raw: t, href: r, title: o, text: s, tokens: d };
|
|
46713
|
+
}
|
|
46714
|
+
function Lt(a, e, t) {
|
|
46715
|
+
let n = a.match(t.other.indentCodeCompensation);
|
|
46716
|
+
if (n === null)
|
|
46717
|
+
return e;
|
|
46718
|
+
let i = n[1];
|
|
46719
|
+
return e.split(`
|
|
46720
|
+
`).map((r) => {
|
|
46721
|
+
let o = r.match(t.other.beginningSpace);
|
|
46722
|
+
if (o === null)
|
|
46723
|
+
return r;
|
|
46724
|
+
let [s] = o;
|
|
46725
|
+
return r.slice(Math.min(s.length, i.length));
|
|
46726
|
+
}).join(`
|
|
46727
|
+
`);
|
|
46728
|
+
}
|
|
46729
|
+
function _e(a, e, t, n) {
|
|
46730
|
+
if (!e.includes("<"))
|
|
46731
|
+
return false;
|
|
46732
|
+
for (let i = 0;i < e.length; i++) {
|
|
46733
|
+
if (e[i] === "\\") {
|
|
46734
|
+
i++;
|
|
46735
|
+
continue;
|
|
46736
|
+
}
|
|
46737
|
+
if (e[i] === "`") {
|
|
46738
|
+
let s = n.inline.code.exec(e.slice(i));
|
|
46739
|
+
if (s) {
|
|
46740
|
+
i += s[0].length - 1;
|
|
46741
|
+
continue;
|
|
46742
|
+
}
|
|
46743
|
+
}
|
|
46744
|
+
if (e[i] !== "<")
|
|
46745
|
+
continue;
|
|
46746
|
+
let r = a.slice(t + i), o = n.inline.tag.exec(r) || n.inline.autolink.exec(r);
|
|
46747
|
+
if (o) {
|
|
46748
|
+
if (o[0].length > e.length - i)
|
|
46749
|
+
return true;
|
|
46750
|
+
i += o[0].length - 1;
|
|
46751
|
+
}
|
|
46752
|
+
}
|
|
46753
|
+
return false;
|
|
46754
|
+
}
|
|
46755
|
+
var _ = class {
|
|
46756
|
+
options;
|
|
46757
|
+
rules;
|
|
46758
|
+
lexer;
|
|
46759
|
+
constructor(e) {
|
|
46760
|
+
this.options = e || y;
|
|
46761
|
+
}
|
|
46762
|
+
space(e) {
|
|
46763
|
+
let t = this.rules.block.newline.exec(e);
|
|
46764
|
+
if (t && t[0].length > 0)
|
|
46765
|
+
return { type: "space", raw: t[0] };
|
|
46766
|
+
}
|
|
46767
|
+
code(e) {
|
|
46768
|
+
let t = this.rules.block.code.exec(e);
|
|
46769
|
+
if (t) {
|
|
46770
|
+
let n = this.options.pedantic ? t[0] : ae(t[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
|
|
46771
|
+
return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
|
|
46772
|
+
}
|
|
46773
|
+
}
|
|
46774
|
+
fences(e) {
|
|
46775
|
+
let t = this.rules.block.fences.exec(e);
|
|
46776
|
+
if (t) {
|
|
46777
|
+
let n = t[0], i = Lt(n, t[3] || "", this.rules);
|
|
46778
|
+
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: i };
|
|
46779
|
+
}
|
|
46780
|
+
}
|
|
46781
|
+
heading(e) {
|
|
46782
|
+
let t = this.rules.block.heading.exec(e);
|
|
46783
|
+
if (t) {
|
|
46784
|
+
let n = t[2].trim();
|
|
46785
|
+
if (this.rules.other.endingHash.test(n)) {
|
|
46786
|
+
let i = A(n, "#");
|
|
46787
|
+
(this.options.pedantic || !i || this.rules.other.endingSpaceTabChar.test(i)) && (n = i.trim());
|
|
46788
|
+
}
|
|
46789
|
+
return { type: "heading", raw: A(t[0], `
|
|
46790
|
+
`), depth: t[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
46791
|
+
}
|
|
46792
|
+
}
|
|
46793
|
+
hr(e) {
|
|
46794
|
+
let t = this.rules.block.hr.exec(e);
|
|
46795
|
+
if (t)
|
|
46796
|
+
return { type: "hr", raw: A(t[0], `
|
|
46797
|
+
`) };
|
|
46798
|
+
}
|
|
46799
|
+
blockquote(e) {
|
|
46800
|
+
let t = this.rules.block.blockquote.exec(e);
|
|
46801
|
+
if (t) {
|
|
46802
|
+
let n = A(t[0], `
|
|
46803
|
+
`).split(`
|
|
46804
|
+
`), i = "", r = "", o = [];
|
|
46805
|
+
for (;n.length > 0; ) {
|
|
46806
|
+
let s = false, l = [], u;
|
|
46807
|
+
for (u = 0;u < n.length; u++)
|
|
46808
|
+
if (this.rules.other.blockquoteStart.test(n[u]))
|
|
46809
|
+
l.push(n[u]), s = true;
|
|
46810
|
+
else if (!s)
|
|
46811
|
+
l.push(n[u]);
|
|
46812
|
+
else
|
|
46813
|
+
break;
|
|
46814
|
+
n = n.slice(u);
|
|
46815
|
+
let c = l.join(`
|
|
46816
|
+
`), p = c.replace(this.rules.other.blockquoteSetextReplace, `
|
|
46817
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
46818
|
+
i = i ? `${i}
|
|
46819
|
+
${c}` : c, r = r ? `${r}
|
|
46820
|
+
${p}` : p;
|
|
46821
|
+
let d = this.lexer.state.top;
|
|
46822
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(p, o, true), this.lexer.state.top = d, n.length === 0)
|
|
46823
|
+
break;
|
|
46824
|
+
let g = o.at(-1);
|
|
46825
|
+
if (g?.type === "code" || g?.type === "heading" || g?.type === "hr" || g?.type === "html")
|
|
46826
|
+
break;
|
|
46827
|
+
if (g?.type === "blockquote") {
|
|
46828
|
+
let k = g, P = n.join(`
|
|
46829
|
+
`), R = k.raw + `
|
|
46830
|
+
` + P.replace(this.rules.other.blockquoteSetextReplace2, ""), m = this.blockquote(R);
|
|
46831
|
+
o[o.length - 1] = m;
|
|
46832
|
+
let E = R.substring(m.raw.length).replace(/^\n/, ""), b = E ? E.split(`
|
|
46833
|
+
`).length : 0, H = b ? n.slice(0, -b) : n;
|
|
46834
|
+
H.length > 0 && (i = `${i}
|
|
46835
|
+
${H.join(`
|
|
46836
|
+
`)}`), r = r.substring(0, r.length - k.text.length) + m.text;
|
|
46837
|
+
break;
|
|
46838
|
+
} else if (g?.type === "list") {
|
|
46839
|
+
let k = g, P = k.raw + `
|
|
46840
|
+
` + n.join(`
|
|
46841
|
+
`), R = this.list(P);
|
|
46842
|
+
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(`
|
|
46843
|
+
`);
|
|
46844
|
+
continue;
|
|
46845
|
+
}
|
|
46846
|
+
}
|
|
46847
|
+
return { type: "blockquote", raw: i, tokens: o, text: r };
|
|
46848
|
+
}
|
|
46849
|
+
}
|
|
46850
|
+
list(e) {
|
|
46851
|
+
let t = this.rules.block.list.exec(e);
|
|
46852
|
+
if (t) {
|
|
46853
|
+
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: [] };
|
|
46854
|
+
r = o ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = o ? r : "[*+-]");
|
|
46855
|
+
let l = this.rules.other.listItemRegex(r), u = false;
|
|
46856
|
+
for (;e; ) {
|
|
46857
|
+
let p = false, d = "";
|
|
46858
|
+
if (!(t = l.exec(e)) || this.rules.block.hr.test(e))
|
|
46859
|
+
break;
|
|
46860
|
+
let g = i();
|
|
46861
|
+
e = e.substring(t[0].length);
|
|
46862
|
+
let k = t[2].split(`
|
|
46863
|
+
`, 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(`
|
|
46864
|
+
`, 1)[0], E = !R.trim(), b = 0;
|
|
46865
|
+
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) {
|
|
46866
|
+
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);
|
|
46867
|
+
for (;e; ) {
|
|
46868
|
+
let he = e.split(`
|
|
46869
|
+
`, 1)[0], G;
|
|
46870
|
+
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))
|
|
46871
|
+
break;
|
|
46872
|
+
if (G.search(this.rules.other.nonSpaceChar) >= b || !m.trim())
|
|
46873
|
+
d += `
|
|
46874
|
+
` + G.slice(b);
|
|
46875
|
+
else {
|
|
46876
|
+
if (E || R.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || pe.test(R) || ce.test(R) || ue.test(R))
|
|
46877
|
+
break;
|
|
46878
|
+
d += `
|
|
46879
|
+
` + m;
|
|
46880
|
+
}
|
|
46881
|
+
E = !m.trim(), e = e.substring(he.length + 1), R = G.slice(b);
|
|
46882
|
+
}
|
|
46883
|
+
}
|
|
46884
|
+
let H = n.slice(g, i());
|
|
46885
|
+
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: [] });
|
|
46886
|
+
}
|
|
46887
|
+
let c = s.items.at(-1);
|
|
46888
|
+
if (c)
|
|
46889
|
+
c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
|
|
46890
|
+
else
|
|
46891
|
+
return;
|
|
46892
|
+
s.raw = n.slice(0, i()).trimEnd();
|
|
46893
|
+
for (let p of s.items)
|
|
46894
|
+
if (this.lexer.state.top = false, p.tokens = this.lexer.blockTokens(p.text, []), !s.loose) {
|
|
46895
|
+
let d = p.tokens.filter((k) => k.type === "space"), g = d.length > 0 && d.some((k) => this.rules.other.anyLine.test(k.raw));
|
|
46896
|
+
s.loose = g;
|
|
46897
|
+
}
|
|
46898
|
+
for (let p of s.items) {
|
|
46899
|
+
let d = p.tokens[0];
|
|
46900
|
+
if (p.task && (d?.type === "text" || d?.type === "paragraph")) {
|
|
46901
|
+
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, "");
|
|
46902
|
+
for (let k = this.lexer.inlineQueue.length - 1;k >= 0; k--)
|
|
46903
|
+
if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)) {
|
|
46904
|
+
this.lexer.inlineQueue[k].src = this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask, "");
|
|
46905
|
+
break;
|
|
46906
|
+
}
|
|
46907
|
+
let g = this.rules.other.listTaskCheckbox.exec(p.raw);
|
|
46908
|
+
if (g) {
|
|
46909
|
+
let k = { type: "checkbox", raw: g[0] + " ", checked: g[0] !== "[ ]" };
|
|
46910
|
+
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);
|
|
46911
|
+
}
|
|
46912
|
+
} else
|
|
46913
|
+
p.task && (p.task = false);
|
|
46914
|
+
}
|
|
46915
|
+
if (s.loose)
|
|
46916
|
+
for (let p of s.items) {
|
|
46917
|
+
p.loose = true;
|
|
46918
|
+
for (let d of p.tokens)
|
|
46919
|
+
d.type === "text" && (d.type = "paragraph");
|
|
46920
|
+
}
|
|
46921
|
+
return s;
|
|
46922
|
+
}
|
|
46923
|
+
}
|
|
46924
|
+
html(e) {
|
|
46925
|
+
let t = this.rules.block.html.exec(e);
|
|
46926
|
+
if (t) {
|
|
46927
|
+
let n = ae(t[0]);
|
|
46928
|
+
return { type: "html", block: true, raw: n, pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: n };
|
|
46929
|
+
}
|
|
46930
|
+
}
|
|
46931
|
+
def(e) {
|
|
46932
|
+
let t = this.rules.block.def.exec(e);
|
|
46933
|
+
if (t) {
|
|
46934
|
+
if (!this.rules.other.startAngleBracket.test(t[2]) && le(t[2], "()") !== -1)
|
|
46935
|
+
return;
|
|
46936
|
+
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];
|
|
46937
|
+
return { type: "def", tag: n, raw: A(t[0], `
|
|
46938
|
+
`), href: i, title: r };
|
|
46939
|
+
}
|
|
46940
|
+
}
|
|
46941
|
+
table(e) {
|
|
46942
|
+
let t = this.rules.block.table.exec(e);
|
|
46943
|
+
if (!t || !this.rules.other.tableDelimiter.test(t[2]))
|
|
46944
|
+
return;
|
|
46945
|
+
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(`
|
|
46946
|
+
`) : [], o = { type: "table", raw: A(t[0], `
|
|
46947
|
+
`), header: [], align: [], rows: [] };
|
|
46948
|
+
if (n.length === i.length) {
|
|
46949
|
+
for (let s of i)
|
|
46950
|
+
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);
|
|
46951
|
+
for (let s = 0;s < n.length; s++)
|
|
46952
|
+
o.header.push({ text: n[s], tokens: this.lexer.inline(n[s]), header: true, align: o.align[s] });
|
|
46953
|
+
for (let s of r)
|
|
46954
|
+
o.rows.push(oe(s, o.header.length).map((l, u) => ({ text: l, tokens: this.lexer.inline(l), header: false, align: o.align[u] })));
|
|
46955
|
+
return o;
|
|
46956
|
+
}
|
|
46957
|
+
}
|
|
46958
|
+
lheading(e) {
|
|
46959
|
+
let t = this.rules.block.lheading.exec(e);
|
|
46960
|
+
if (t) {
|
|
46961
|
+
let n = t[1].trim();
|
|
46962
|
+
return { type: "heading", raw: A(t[0], `
|
|
46963
|
+
`), depth: t[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
|
|
46964
|
+
}
|
|
46965
|
+
}
|
|
46966
|
+
paragraph(e) {
|
|
46967
|
+
let t = this.rules.block.paragraph.exec(e);
|
|
46968
|
+
if (t) {
|
|
46969
|
+
let n = t[1].charAt(t[1].length - 1) === `
|
|
46970
|
+
` ? t[1].slice(0, -1) : t[1];
|
|
46971
|
+
return { type: "paragraph", raw: t[0], text: n, tokens: this.lexer.inline(n) };
|
|
46972
|
+
}
|
|
46973
|
+
}
|
|
46974
|
+
text(e) {
|
|
46975
|
+
let t = this.rules.block.text.exec(e);
|
|
46976
|
+
if (t)
|
|
46977
|
+
return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) };
|
|
46978
|
+
}
|
|
46979
|
+
escape(e) {
|
|
46980
|
+
let t = this.rules.inline.escape.exec(e);
|
|
46981
|
+
if (t)
|
|
46982
|
+
return { type: "escape", raw: t[0], text: t[1] };
|
|
46983
|
+
}
|
|
46984
|
+
tag(e) {
|
|
46985
|
+
let t = this.rules.inline.tag.exec(e);
|
|
46986
|
+
if (t)
|
|
46987
|
+
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] };
|
|
46988
|
+
}
|
|
46989
|
+
link(e) {
|
|
46990
|
+
if (this.lexer.state.linkParenPossible === false)
|
|
46991
|
+
return;
|
|
46992
|
+
let t = this.rules.inline.link.exec(e);
|
|
46993
|
+
if (t) {
|
|
46994
|
+
let n = t[0].charAt(0) === "!" ? 2 : 1;
|
|
46995
|
+
if (!this.options.pedantic && _e(e, t[1], n, this.rules))
|
|
46996
|
+
return;
|
|
46997
|
+
let i = t[2].trim();
|
|
46998
|
+
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(i)) {
|
|
46999
|
+
if (!this.rules.other.endAngleBracket.test(i))
|
|
47000
|
+
return;
|
|
47001
|
+
let s = A(i.slice(0, -1), "\\");
|
|
47002
|
+
if ((i.length - s.length) % 2 === 0)
|
|
47003
|
+
return;
|
|
47004
|
+
} else {
|
|
47005
|
+
let s = le(t[2], "()");
|
|
47006
|
+
if (s === -2)
|
|
47007
|
+
return;
|
|
47008
|
+
if (s > -1) {
|
|
47009
|
+
let u = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
|
|
47010
|
+
t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, u).trim(), t[3] = "";
|
|
47011
|
+
}
|
|
47012
|
+
}
|
|
47013
|
+
let r = t[2], o = "";
|
|
47014
|
+
if (this.options.pedantic) {
|
|
47015
|
+
let s = this.rules.other.pedanticHrefTitle.exec(r);
|
|
47016
|
+
s && (r = s[1], o = s[3]);
|
|
47017
|
+
} else
|
|
47018
|
+
o = t[3] ? t[3].slice(1, -1) : "";
|
|
47019
|
+
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);
|
|
47020
|
+
}
|
|
47021
|
+
}
|
|
47022
|
+
reflink(e, t) {
|
|
47023
|
+
let n;
|
|
47024
|
+
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
47025
|
+
let i = n[0].charAt(0) === "!" ? 2 : 1;
|
|
47026
|
+
if (!this.options.pedantic && _e(e, n[1], i, this.rules))
|
|
47027
|
+
return;
|
|
47028
|
+
let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), o = t[v(r)];
|
|
47029
|
+
if (!o) {
|
|
47030
|
+
let s = n[0].charAt(0);
|
|
47031
|
+
return { type: "text", raw: s, text: s };
|
|
47032
|
+
}
|
|
47033
|
+
return Se(n, o, n[0], this.lexer, this.rules);
|
|
47034
|
+
}
|
|
47035
|
+
}
|
|
47036
|
+
emStrong(e, t, n = "") {
|
|
47037
|
+
let i = this.rules.inline.emStrongLDelim.exec(e);
|
|
47038
|
+
if (!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric))
|
|
47039
|
+
return;
|
|
47040
|
+
if (!(i[1] || i[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
47041
|
+
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;
|
|
47042
|
+
for (g.lastIndex = 0, t = t.slice(-1 * e.length + o);(i = g.exec(t)) !== null; ) {
|
|
47043
|
+
if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s)
|
|
47044
|
+
continue;
|
|
47045
|
+
if (l = [...s].length, i[3] || i[4]) {
|
|
47046
|
+
u += l;
|
|
47047
|
+
continue;
|
|
47048
|
+
} else if (i[5] || i[6]) {
|
|
47049
|
+
if (o % 3 && !((o + l) % 3)) {
|
|
47050
|
+
c += l;
|
|
47051
|
+
continue;
|
|
47052
|
+
}
|
|
47053
|
+
if (d)
|
|
47054
|
+
break;
|
|
47055
|
+
}
|
|
47056
|
+
if (u -= l, u > 0)
|
|
47057
|
+
continue;
|
|
47058
|
+
l = Math.min(l, l + u + c);
|
|
47059
|
+
let k = [...i[0]][0].length, P = e.slice(0, o + i.index + k + l);
|
|
47060
|
+
if (Math.min(o, l) % 2) {
|
|
47061
|
+
let m = P.slice(1, -1);
|
|
47062
|
+
return { type: "em", raw: P, text: m, tokens: this.lexer.inlineTokens(m) };
|
|
47063
|
+
}
|
|
47064
|
+
let R = P.slice(2, -2);
|
|
47065
|
+
return { type: "strong", raw: P, text: R, tokens: this.lexer.inlineTokens(R) };
|
|
47066
|
+
}
|
|
47067
|
+
}
|
|
47068
|
+
}
|
|
47069
|
+
codespan(e) {
|
|
47070
|
+
let t = this.rules.inline.code.exec(e);
|
|
47071
|
+
if (t) {
|
|
47072
|
+
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);
|
|
47073
|
+
return i && r && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t[0], text: n };
|
|
47074
|
+
}
|
|
47075
|
+
}
|
|
47076
|
+
br(e) {
|
|
47077
|
+
let t = this.rules.inline.br.exec(e);
|
|
47078
|
+
if (t)
|
|
47079
|
+
return { type: "br", raw: t[0] };
|
|
47080
|
+
}
|
|
47081
|
+
del(e, t, n = "") {
|
|
47082
|
+
let i = this.rules.inline.delLDelim.exec(e);
|
|
47083
|
+
if (!i)
|
|
47084
|
+
return;
|
|
47085
|
+
if (!(i[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
47086
|
+
let o = [...i[0]].length - 1, s, l, u = o, c = this.rules.inline.delRDelim;
|
|
47087
|
+
for (c.lastIndex = 0, t = t.slice(-1 * e.length + o);(i = c.exec(t)) !== null; ) {
|
|
47088
|
+
if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s || (l = [...s].length, l !== o))
|
|
47089
|
+
continue;
|
|
47090
|
+
if (i[3] || i[4]) {
|
|
47091
|
+
u += l;
|
|
47092
|
+
continue;
|
|
47093
|
+
}
|
|
47094
|
+
if (u -= l, u > 0)
|
|
47095
|
+
continue;
|
|
47096
|
+
l = Math.min(l, l + u);
|
|
47097
|
+
let p = [...i[0]][0].length, d = e.slice(0, o + i.index + p + l), g = d.slice(o, -o);
|
|
47098
|
+
return { type: "del", raw: d, text: g, tokens: this.lexer.inlineTokens(g) };
|
|
47099
|
+
}
|
|
47100
|
+
}
|
|
47101
|
+
}
|
|
47102
|
+
autolink(e) {
|
|
47103
|
+
let t = this.rules.inline.autolink.exec(e);
|
|
47104
|
+
if (t) {
|
|
47105
|
+
let n, i;
|
|
47106
|
+
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 }] };
|
|
47107
|
+
}
|
|
47108
|
+
}
|
|
47109
|
+
url(e) {
|
|
47110
|
+
let t;
|
|
47111
|
+
if (t = this.rules.inline.url.exec(e)) {
|
|
47112
|
+
let n, i;
|
|
47113
|
+
if (t[2] === "@")
|
|
47114
|
+
n = t[0], i = "mailto:" + n;
|
|
47115
|
+
else {
|
|
47116
|
+
let r;
|
|
47117
|
+
do
|
|
47118
|
+
r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
|
|
47119
|
+
while (r !== t[0]);
|
|
47120
|
+
n = t[0], t[1] === "www." ? i = "http://" + t[0] : i = t[0];
|
|
47121
|
+
}
|
|
47122
|
+
return { type: "link", raw: t[0], text: n, href: i, autolink: true, tokens: [{ type: "text", raw: n, text: n }] };
|
|
47123
|
+
}
|
|
47124
|
+
}
|
|
47125
|
+
inlineText(e) {
|
|
47126
|
+
let t = this.rules.inline.text.exec(e);
|
|
47127
|
+
if (t) {
|
|
47128
|
+
let n = this.lexer.state.inRawBlock;
|
|
47129
|
+
return { type: "text", raw: t[0], text: n ? t[0] : ye(t[0]), escaped: n };
|
|
47130
|
+
}
|
|
47131
|
+
}
|
|
47132
|
+
};
|
|
47133
|
+
var T = class a {
|
|
47134
|
+
tokens;
|
|
47135
|
+
options;
|
|
47136
|
+
state;
|
|
47137
|
+
inlineQueue;
|
|
47138
|
+
tokenizer;
|
|
47139
|
+
constructor(e) {
|
|
47140
|
+
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 };
|
|
47141
|
+
let t = { other: x, block: F.normal, inline: Z.normal };
|
|
47142
|
+
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;
|
|
47143
|
+
}
|
|
47144
|
+
static get rules() {
|
|
47145
|
+
return { block: F, inline: Z };
|
|
47146
|
+
}
|
|
47147
|
+
static lex(e, t) {
|
|
47148
|
+
return new a(t).lex(e);
|
|
47149
|
+
}
|
|
47150
|
+
static lexInline(e, t) {
|
|
47151
|
+
return new a(t).inlineTokens(e);
|
|
47152
|
+
}
|
|
47153
|
+
lex(e) {
|
|
47154
|
+
e = e.replace(x.carriageReturn, `
|
|
47155
|
+
`), this.blockTokens(e, this.tokens);
|
|
47156
|
+
for (let t = 0;t < this.inlineQueue.length; t++) {
|
|
47157
|
+
let n = this.inlineQueue[t];
|
|
47158
|
+
this.inlineTokens(n.src, n.tokens);
|
|
47159
|
+
}
|
|
47160
|
+
return this.inlineQueue = [], this.tokens;
|
|
47161
|
+
}
|
|
47162
|
+
blockTokens(e, t = [], n = false) {
|
|
47163
|
+
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(x.tabCharGlobal, " ").replace(x.spaceLine, ""));
|
|
47164
|
+
let i = 1 / 0;
|
|
47165
|
+
for (;e; ) {
|
|
47166
|
+
if (e.length < i)
|
|
47167
|
+
i = e.length;
|
|
47168
|
+
else {
|
|
47169
|
+
this.infiniteLoopError(e.charCodeAt(0));
|
|
47170
|
+
break;
|
|
47171
|
+
}
|
|
47172
|
+
let r;
|
|
47173
|
+
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))
|
|
47174
|
+
continue;
|
|
47175
|
+
if (r = this.tokenizer.space(e)) {
|
|
47176
|
+
e = e.substring(r.raw.length);
|
|
47177
|
+
let s = t.at(-1);
|
|
47178
|
+
r.raw.length === 1 && s !== undefined ? s.raw += `
|
|
47179
|
+
` : t.push(r);
|
|
47180
|
+
continue;
|
|
47181
|
+
}
|
|
47182
|
+
if (r = this.tokenizer.code(e)) {
|
|
47183
|
+
e = e.substring(r.raw.length);
|
|
47184
|
+
let s = t.at(-1);
|
|
47185
|
+
s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
|
|
47186
|
+
`) ? "" : `
|
|
47187
|
+
`) + r.raw, s.text += `
|
|
47188
|
+
` + r.text, this.inlineQueue.at(-1).src = s.text) : t.push(r);
|
|
47189
|
+
continue;
|
|
47190
|
+
}
|
|
47191
|
+
if (r = this.tokenizer.fences(e)) {
|
|
47192
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47193
|
+
continue;
|
|
47194
|
+
}
|
|
47195
|
+
if (r = this.tokenizer.heading(e)) {
|
|
47196
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47197
|
+
continue;
|
|
47198
|
+
}
|
|
47199
|
+
if (r = this.tokenizer.hr(e)) {
|
|
47200
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47201
|
+
continue;
|
|
47202
|
+
}
|
|
47203
|
+
if (r = this.tokenizer.blockquote(e)) {
|
|
47204
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47205
|
+
continue;
|
|
47206
|
+
}
|
|
47207
|
+
if (r = this.tokenizer.list(e)) {
|
|
47208
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47209
|
+
continue;
|
|
47210
|
+
}
|
|
47211
|
+
if (r = this.tokenizer.html(e)) {
|
|
47212
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47213
|
+
continue;
|
|
47214
|
+
}
|
|
47215
|
+
if (r = this.tokenizer.def(e)) {
|
|
47216
|
+
e = e.substring(r.raw.length);
|
|
47217
|
+
let s = t.at(-1);
|
|
47218
|
+
s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
|
|
47219
|
+
`) ? "" : `
|
|
47220
|
+
`) + r.raw, s.text += `
|
|
47221
|
+
` + 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));
|
|
47222
|
+
continue;
|
|
47223
|
+
}
|
|
47224
|
+
if (r = this.tokenizer.table(e)) {
|
|
47225
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47226
|
+
continue;
|
|
47227
|
+
}
|
|
47228
|
+
if (r = this.tokenizer.lheading(e)) {
|
|
47229
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
47230
|
+
continue;
|
|
47231
|
+
}
|
|
47232
|
+
let o = e;
|
|
47233
|
+
if (this.options.extensions?.startBlock) {
|
|
47234
|
+
let s = 1 / 0, l = e.slice(1), u;
|
|
47235
|
+
this.options.extensions.startBlock.forEach((c) => {
|
|
47236
|
+
u = c.call({ lexer: this }, l), typeof u == "number" && u >= 0 && (s = Math.min(s, u));
|
|
47237
|
+
}), s < 1 / 0 && s >= 0 && (o = e.substring(0, s + 1));
|
|
47238
|
+
}
|
|
47239
|
+
if (this.state.top && (r = this.tokenizer.paragraph(o))) {
|
|
47240
|
+
let s = t.at(-1);
|
|
47241
|
+
n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
|
|
47242
|
+
`) ? "" : `
|
|
47243
|
+
`) + r.raw, s.text += `
|
|
47244
|
+
` + 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);
|
|
47245
|
+
continue;
|
|
47246
|
+
}
|
|
47247
|
+
if (r = this.tokenizer.text(e)) {
|
|
47248
|
+
e = e.substring(r.raw.length);
|
|
47249
|
+
let s = t.at(-1);
|
|
47250
|
+
s?.type === "text" ? (s.raw += (s.raw.endsWith(`
|
|
47251
|
+
`) ? "" : `
|
|
47252
|
+
`) + r.raw, s.text += `
|
|
47253
|
+
` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r);
|
|
47254
|
+
continue;
|
|
47255
|
+
}
|
|
47256
|
+
if (e) {
|
|
47257
|
+
this.infiniteLoopError(e.charCodeAt(0));
|
|
47258
|
+
break;
|
|
47259
|
+
}
|
|
47260
|
+
}
|
|
47261
|
+
return this.state.top = true, t;
|
|
47262
|
+
}
|
|
47263
|
+
inline(e, t = []) {
|
|
47264
|
+
return this.inlineQueue.push({ src: e, tokens: t }), t;
|
|
47265
|
+
}
|
|
47266
|
+
linkInText(e) {
|
|
47267
|
+
if (!e.includes("["))
|
|
47268
|
+
return false;
|
|
47269
|
+
let t = this.tokenizer.rules.inline.link;
|
|
47270
|
+
for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))
|
|
47271
|
+
if (t.test(n[0]) && e.charAt(n.index - 1) !== "!")
|
|
47272
|
+
return true;
|
|
47273
|
+
for (let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
|
|
47274
|
+
let i = n[0], r = i.lastIndexOf("[");
|
|
47275
|
+
if (!(i.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, v(i.slice(r + 1, -1)))) && !(r > 1 && this.linkInText(i.slice(1, r - 1))))
|
|
47276
|
+
return true;
|
|
47277
|
+
}
|
|
47278
|
+
return false;
|
|
47279
|
+
}
|
|
47280
|
+
inlineTokens(e, t = []) {
|
|
47281
|
+
this.tokenizer.lexer = this;
|
|
47282
|
+
let n = this.state.linkParenPossible;
|
|
47283
|
+
this.state.linkParenPossible = n && e.includes(")");
|
|
47284
|
+
try {
|
|
47285
|
+
return this.#e(e, t);
|
|
47286
|
+
} finally {
|
|
47287
|
+
this.state.linkParenPossible = n;
|
|
47288
|
+
}
|
|
47289
|
+
}
|
|
47290
|
+
#e(e, t) {
|
|
47291
|
+
let n = e;
|
|
47292
|
+
if (this.tokens.links && e.includes("[")) {
|
|
47293
|
+
let s = this.tokenizer.rules.inline.reflinkSearch, l = (u) => {
|
|
47294
|
+
let c = u.lastIndexOf("[");
|
|
47295
|
+
if (!Object.hasOwn(this.tokens.links, v(u.slice(c + 1, -1))))
|
|
47296
|
+
return u;
|
|
47297
|
+
if (c > 1 && u.charAt(0) !== "!") {
|
|
47298
|
+
let p = u.slice(1, c - 1);
|
|
47299
|
+
if (this.linkInText(p))
|
|
47300
|
+
return "[" + p.replace(s, l) + "][" + "a".repeat(u.length - c - 2) + "]";
|
|
47301
|
+
}
|
|
47302
|
+
return "[" + "a".repeat(u.length - 2) + "]";
|
|
47303
|
+
};
|
|
47304
|
+
n = n.replace(s, l);
|
|
47305
|
+
}
|
|
47306
|
+
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) => {
|
|
47307
|
+
let c = u ? u.length : 0;
|
|
47308
|
+
return s.slice(0, c) + "[" + "a".repeat(s.length - c - 2) + "]";
|
|
47309
|
+
}), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
47310
|
+
let i = false, r = "", o = 1 / 0;
|
|
47311
|
+
for (;e; ) {
|
|
47312
|
+
if (e.length < o)
|
|
47313
|
+
o = e.length;
|
|
47314
|
+
else {
|
|
47315
|
+
this.infiniteLoopError(e.charCodeAt(0));
|
|
47316
|
+
break;
|
|
47317
|
+
}
|
|
47318
|
+
i || (r = ""), i = false;
|
|
47319
|
+
let s;
|
|
47320
|
+
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))
|
|
47321
|
+
continue;
|
|
47322
|
+
if (s = this.tokenizer.escape(e)) {
|
|
47323
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
47324
|
+
continue;
|
|
47325
|
+
}
|
|
47326
|
+
if (s = this.tokenizer.tag(e)) {
|
|
47327
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
47328
|
+
continue;
|
|
47329
|
+
}
|
|
47330
|
+
if (s = this.tokenizer.link(e)) {
|
|
47331
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
47332
|
+
continue;
|
|
47333
|
+
}
|
|
47334
|
+
if (s = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
47335
|
+
e = e.substring(s.raw.length);
|
|
47336
|
+
let u = t.at(-1);
|
|
47337
|
+
s.type === "text" && u?.type === "text" ? (u.raw += s.raw, u.text += s.text) : t.push(s);
|
|
47338
|
+
continue;
|
|
47339
|
+
}
|
|
47340
|
+
if (s = this.tokenizer.emStrong(e, n, r)) {
|
|
47341
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
47342
|
+
continue;
|
|
47343
|
+
}
|
|
47344
|
+
if (s = this.tokenizer.codespan(e)) {
|
|
47345
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
47346
|
+
continue;
|
|
47347
|
+
}
|
|
47348
|
+
if (s = this.tokenizer.br(e)) {
|
|
47349
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
47350
|
+
continue;
|
|
47351
|
+
}
|
|
47352
|
+
if (s = this.tokenizer.del(e, n, r)) {
|
|
47353
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
47354
|
+
continue;
|
|
47355
|
+
}
|
|
47356
|
+
if (s = this.tokenizer.autolink(e)) {
|
|
47357
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
47358
|
+
continue;
|
|
47359
|
+
}
|
|
47360
|
+
if (!this.state.inLink && (s = this.tokenizer.url(e))) {
|
|
47361
|
+
e = e.substring(s.raw.length), t.push(s);
|
|
47362
|
+
continue;
|
|
47363
|
+
}
|
|
47364
|
+
let l = e;
|
|
47365
|
+
if (this.options.extensions?.startInline) {
|
|
47366
|
+
let u = 1 / 0, c = e.slice(1), p;
|
|
47367
|
+
this.options.extensions.startInline.forEach((d) => {
|
|
47368
|
+
p = d.call({ lexer: this }, c), typeof p == "number" && p >= 0 && (u = Math.min(u, p));
|
|
47369
|
+
}), u < 1 / 0 && u >= 0 && (l = e.substring(0, u + 1));
|
|
47370
|
+
}
|
|
47371
|
+
if (s = this.tokenizer.inlineText(l)) {
|
|
47372
|
+
e = e.substring(s.raw.length), s.raw.slice(-1) !== "_" && (r = s.raw.slice(-1)), i = true;
|
|
47373
|
+
let u = t.at(-1);
|
|
47374
|
+
u?.type === "text" ? (u.raw += s.raw, u.text += s.text) : t.push(s);
|
|
47375
|
+
continue;
|
|
47376
|
+
}
|
|
47377
|
+
if (e) {
|
|
47378
|
+
this.infiniteLoopError(e.charCodeAt(0));
|
|
47379
|
+
break;
|
|
47380
|
+
}
|
|
47381
|
+
}
|
|
47382
|
+
return t;
|
|
47383
|
+
}
|
|
47384
|
+
infiniteLoopError(e) {
|
|
47385
|
+
let t = "Infinite loop on byte: " + e;
|
|
47386
|
+
if (this.options.silent)
|
|
47387
|
+
console.error(t);
|
|
47388
|
+
else
|
|
47389
|
+
throw new Error(t);
|
|
47390
|
+
}
|
|
47391
|
+
};
|
|
47392
|
+
var $ = class {
|
|
47393
|
+
options;
|
|
47394
|
+
parser;
|
|
47395
|
+
constructor(e) {
|
|
47396
|
+
this.options = e || y;
|
|
47397
|
+
}
|
|
47398
|
+
space(e) {
|
|
47399
|
+
return "";
|
|
47400
|
+
}
|
|
47401
|
+
code({ text: e, lang: t, escaped: n }) {
|
|
47402
|
+
let i = (t || "").match(x.notSpaceStart)?.[0], r = e ? e.replace(x.endingNewline, "") + `
|
|
47403
|
+
` : "";
|
|
47404
|
+
return i ? '<pre><code class="language-' + w(i) + '">' + (n ? r : w(r, true)) + `</code></pre>
|
|
47405
|
+
` : "<pre><code>" + (n ? r : w(r, true)) + `</code></pre>
|
|
47406
|
+
`;
|
|
47407
|
+
}
|
|
47408
|
+
blockquote({ tokens: e }) {
|
|
47409
|
+
return `<blockquote>
|
|
47410
|
+
${this.parser.parse(e)}</blockquote>
|
|
47411
|
+
`;
|
|
47412
|
+
}
|
|
47413
|
+
html({ text: e }) {
|
|
47414
|
+
return e;
|
|
47415
|
+
}
|
|
47416
|
+
def(e) {
|
|
47417
|
+
return "";
|
|
47418
|
+
}
|
|
47419
|
+
heading({ tokens: e, depth: t }) {
|
|
47420
|
+
return `<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
47421
|
+
`;
|
|
47422
|
+
}
|
|
47423
|
+
hr(e) {
|
|
47424
|
+
return `<hr>
|
|
47425
|
+
`;
|
|
47426
|
+
}
|
|
47427
|
+
list(e) {
|
|
47428
|
+
let { ordered: t, start: n } = e, i = "";
|
|
47429
|
+
for (let s = 0;s < e.items.length; s++) {
|
|
47430
|
+
let l = e.items[s];
|
|
47431
|
+
i += this.listitem(l);
|
|
47432
|
+
}
|
|
47433
|
+
let r = t ? "ol" : "ul", o = t && n !== 1 ? ' start="' + n + '"' : "";
|
|
47434
|
+
return "<" + r + o + `>
|
|
47435
|
+
` + i + "</" + r + `>
|
|
47436
|
+
`;
|
|
47437
|
+
}
|
|
47438
|
+
listitem(e) {
|
|
47439
|
+
return `<li>${this.parser.parse(e.tokens)}</li>
|
|
47440
|
+
`;
|
|
47441
|
+
}
|
|
47442
|
+
checkbox({ checked: e }) {
|
|
47443
|
+
return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
|
|
47444
|
+
}
|
|
47445
|
+
paragraph({ tokens: e }) {
|
|
47446
|
+
return `<p>${this.parser.parseInline(e)}</p>
|
|
47447
|
+
`;
|
|
47448
|
+
}
|
|
47449
|
+
table(e) {
|
|
47450
|
+
let t = "", n = "";
|
|
47451
|
+
for (let r = 0;r < e.header.length; r++)
|
|
47452
|
+
n += this.tablecell(e.header[r]);
|
|
47453
|
+
t += this.tablerow({ text: n });
|
|
47454
|
+
let i = "";
|
|
47455
|
+
for (let r = 0;r < e.rows.length; r++) {
|
|
47456
|
+
let o = e.rows[r];
|
|
47457
|
+
n = "";
|
|
47458
|
+
for (let s = 0;s < o.length; s++)
|
|
47459
|
+
n += this.tablecell(o[s]);
|
|
47460
|
+
i += this.tablerow({ text: n });
|
|
47461
|
+
}
|
|
47462
|
+
return i && (i = `<tbody>${i}</tbody>`), `<table>
|
|
47463
|
+
<thead>
|
|
47464
|
+
` + t + `</thead>
|
|
47465
|
+
` + i + `</table>
|
|
47466
|
+
`;
|
|
47467
|
+
}
|
|
47468
|
+
tablerow({ text: e }) {
|
|
47469
|
+
return `<tr>
|
|
47470
|
+
${e}</tr>
|
|
47471
|
+
`;
|
|
47472
|
+
}
|
|
47473
|
+
tablecell(e) {
|
|
47474
|
+
let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
|
|
47475
|
+
return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
|
|
47476
|
+
`;
|
|
47477
|
+
}
|
|
47478
|
+
strong({ tokens: e }) {
|
|
47479
|
+
return `<strong>${this.parser.parseInline(e)}</strong>`;
|
|
47480
|
+
}
|
|
47481
|
+
em({ tokens: e }) {
|
|
47482
|
+
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
47483
|
+
}
|
|
47484
|
+
codespan({ text: e }) {
|
|
47485
|
+
return `<code>${w(e, true)}</code>`;
|
|
47486
|
+
}
|
|
47487
|
+
br(e) {
|
|
47488
|
+
return "<br>";
|
|
47489
|
+
}
|
|
47490
|
+
del({ tokens: e }) {
|
|
47491
|
+
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
47492
|
+
}
|
|
47493
|
+
link({ href: e, title: t, text: n, tokens: i, autolink: r }) {
|
|
47494
|
+
let o = r ? w(n, true) : this.parser.parseInline(i), s = ie(e);
|
|
47495
|
+
if (s === null)
|
|
47496
|
+
return o;
|
|
47497
|
+
e = w(s, r);
|
|
47498
|
+
let l = '<a href="' + e + '"';
|
|
47499
|
+
return t && (l += ' title="' + w(t) + '"'), l += ">" + o + "</a>", l;
|
|
47500
|
+
}
|
|
47501
|
+
image({ href: e, title: t, text: n, tokens: i }) {
|
|
47502
|
+
i && (n = this.parser.parseInline(i, this.parser.textRenderer));
|
|
47503
|
+
let r = ie(e);
|
|
47504
|
+
if (r === null)
|
|
47505
|
+
return w(n);
|
|
47506
|
+
e = r;
|
|
47507
|
+
let o = `<img src="${w(e)}" alt="${w(n)}"`;
|
|
47508
|
+
return t && (o += ` title="${w(t)}"`), o += ">", o;
|
|
47509
|
+
}
|
|
47510
|
+
text(e) {
|
|
47511
|
+
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : ("escaped" in e) && e.escaped ? e.text : w(e.text);
|
|
47512
|
+
}
|
|
47513
|
+
};
|
|
47514
|
+
var z = class {
|
|
47515
|
+
strong({ text: e }) {
|
|
47516
|
+
return e;
|
|
47517
|
+
}
|
|
47518
|
+
em({ text: e }) {
|
|
47519
|
+
return e;
|
|
47520
|
+
}
|
|
47521
|
+
codespan({ text: e }) {
|
|
47522
|
+
return e;
|
|
47523
|
+
}
|
|
47524
|
+
del({ text: e }) {
|
|
47525
|
+
return e;
|
|
47526
|
+
}
|
|
47527
|
+
html({ text: e }) {
|
|
47528
|
+
return e;
|
|
47529
|
+
}
|
|
47530
|
+
text({ text: e }) {
|
|
47531
|
+
return e;
|
|
47532
|
+
}
|
|
47533
|
+
link({ text: e }) {
|
|
47534
|
+
return "" + e;
|
|
47535
|
+
}
|
|
47536
|
+
image({ text: e }) {
|
|
47537
|
+
return "" + e;
|
|
47538
|
+
}
|
|
47539
|
+
br() {
|
|
47540
|
+
return "";
|
|
47541
|
+
}
|
|
47542
|
+
checkbox({ raw: e }) {
|
|
47543
|
+
return e;
|
|
47544
|
+
}
|
|
47545
|
+
};
|
|
47546
|
+
var O = class a2 {
|
|
47547
|
+
options;
|
|
47548
|
+
renderer;
|
|
47549
|
+
textRenderer;
|
|
47550
|
+
constructor(e) {
|
|
47551
|
+
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;
|
|
47552
|
+
}
|
|
47553
|
+
static parse(e, t) {
|
|
47554
|
+
return new a2(t).parse(e);
|
|
47555
|
+
}
|
|
47556
|
+
static parseInline(e, t) {
|
|
47557
|
+
return new a2(t).parseInline(e);
|
|
47558
|
+
}
|
|
47559
|
+
parse(e) {
|
|
47560
|
+
this.renderer.parser = this;
|
|
47561
|
+
let t = "";
|
|
47562
|
+
for (let n = 0;n < e.length; n++) {
|
|
47563
|
+
let i = e[n];
|
|
47564
|
+
if (this.options.extensions?.renderers?.[i.type]) {
|
|
47565
|
+
let o = i, s = this.options.extensions.renderers[o.type].call({ parser: this }, o);
|
|
47566
|
+
if (s !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "checkbox", "html", "def", "paragraph", "text"].includes(o.type)) {
|
|
47567
|
+
t += s || "";
|
|
47568
|
+
continue;
|
|
47569
|
+
}
|
|
47570
|
+
}
|
|
47571
|
+
let r = i;
|
|
47572
|
+
switch (r.type) {
|
|
47573
|
+
case "space": {
|
|
47574
|
+
t += this.renderer.space(r);
|
|
47575
|
+
break;
|
|
47576
|
+
}
|
|
47577
|
+
case "hr": {
|
|
47578
|
+
t += this.renderer.hr(r);
|
|
47579
|
+
break;
|
|
47580
|
+
}
|
|
47581
|
+
case "heading": {
|
|
47582
|
+
t += this.renderer.heading(r);
|
|
47583
|
+
break;
|
|
47584
|
+
}
|
|
47585
|
+
case "code": {
|
|
47586
|
+
t += this.renderer.code(r);
|
|
47587
|
+
break;
|
|
47588
|
+
}
|
|
47589
|
+
case "table": {
|
|
47590
|
+
t += this.renderer.table(r);
|
|
47591
|
+
break;
|
|
47592
|
+
}
|
|
47593
|
+
case "blockquote": {
|
|
47594
|
+
t += this.renderer.blockquote(r);
|
|
47595
|
+
break;
|
|
47596
|
+
}
|
|
47597
|
+
case "list": {
|
|
47598
|
+
t += this.renderer.list(r);
|
|
47599
|
+
break;
|
|
47600
|
+
}
|
|
47601
|
+
case "checkbox": {
|
|
47602
|
+
t += this.renderer.checkbox(r);
|
|
47603
|
+
break;
|
|
47604
|
+
}
|
|
47605
|
+
case "html": {
|
|
47606
|
+
t += this.renderer.html(r);
|
|
47607
|
+
break;
|
|
47608
|
+
}
|
|
47609
|
+
case "def": {
|
|
47610
|
+
t += this.renderer.def(r);
|
|
47611
|
+
break;
|
|
47612
|
+
}
|
|
47613
|
+
case "paragraph": {
|
|
47614
|
+
t += this.renderer.paragraph(r);
|
|
47615
|
+
break;
|
|
47616
|
+
}
|
|
47617
|
+
case "text": {
|
|
47618
|
+
t += this.renderer.text(r);
|
|
47619
|
+
break;
|
|
47620
|
+
}
|
|
47621
|
+
default: {
|
|
47622
|
+
let o = 'Token with "' + r.type + '" type was not found.';
|
|
47623
|
+
if (this.options.silent)
|
|
47624
|
+
return console.error(o), "";
|
|
47625
|
+
throw new Error(o);
|
|
47626
|
+
}
|
|
47627
|
+
}
|
|
47628
|
+
}
|
|
47629
|
+
return t;
|
|
47630
|
+
}
|
|
47631
|
+
parseInline(e, t = this.renderer) {
|
|
47632
|
+
this.renderer.parser = this;
|
|
47633
|
+
let n = "";
|
|
47634
|
+
for (let i = 0;i < e.length; i++) {
|
|
47635
|
+
let r = e[i];
|
|
47636
|
+
if (this.options.extensions?.renderers?.[r.type]) {
|
|
47637
|
+
let s = this.options.extensions.renderers[r.type].call({ parser: this }, r);
|
|
47638
|
+
if (s !== false || !["escape", "html", "link", "image", "checkbox", "strong", "em", "codespan", "br", "del", "text"].includes(r.type)) {
|
|
47639
|
+
n += s || "";
|
|
47640
|
+
continue;
|
|
47641
|
+
}
|
|
47642
|
+
}
|
|
47643
|
+
let o = r;
|
|
47644
|
+
switch (o.type) {
|
|
47645
|
+
case "escape": {
|
|
47646
|
+
n += t.text(o);
|
|
47647
|
+
break;
|
|
47648
|
+
}
|
|
47649
|
+
case "html": {
|
|
47650
|
+
n += t.html(o);
|
|
47651
|
+
break;
|
|
47652
|
+
}
|
|
47653
|
+
case "link": {
|
|
47654
|
+
n += t.link(o);
|
|
47655
|
+
break;
|
|
47656
|
+
}
|
|
47657
|
+
case "image": {
|
|
47658
|
+
n += t.image(o);
|
|
47659
|
+
break;
|
|
47660
|
+
}
|
|
47661
|
+
case "checkbox": {
|
|
47662
|
+
n += t.checkbox(o);
|
|
47663
|
+
break;
|
|
47664
|
+
}
|
|
47665
|
+
case "strong": {
|
|
47666
|
+
n += t.strong(o);
|
|
47667
|
+
break;
|
|
47668
|
+
}
|
|
47669
|
+
case "em": {
|
|
47670
|
+
n += t.em(o);
|
|
47671
|
+
break;
|
|
47672
|
+
}
|
|
47673
|
+
case "codespan": {
|
|
47674
|
+
n += t.codespan(o);
|
|
47675
|
+
break;
|
|
47676
|
+
}
|
|
47677
|
+
case "br": {
|
|
47678
|
+
n += t.br(o);
|
|
47679
|
+
break;
|
|
47680
|
+
}
|
|
47681
|
+
case "del": {
|
|
47682
|
+
n += t.del(o);
|
|
47683
|
+
break;
|
|
47684
|
+
}
|
|
47685
|
+
case "text": {
|
|
47686
|
+
n += t.text(o);
|
|
47687
|
+
break;
|
|
47688
|
+
}
|
|
47689
|
+
default: {
|
|
47690
|
+
let s = 'Token with "' + o.type + '" type was not found.';
|
|
47691
|
+
if (this.options.silent)
|
|
47692
|
+
return console.error(s), "";
|
|
47693
|
+
throw new Error(s);
|
|
47694
|
+
}
|
|
47695
|
+
}
|
|
47696
|
+
}
|
|
47697
|
+
return n;
|
|
47698
|
+
}
|
|
47699
|
+
};
|
|
47700
|
+
var L = class {
|
|
47701
|
+
options;
|
|
47702
|
+
block;
|
|
47703
|
+
constructor(e) {
|
|
47704
|
+
this.options = e || y;
|
|
47705
|
+
}
|
|
47706
|
+
static passThroughHooks = new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
|
|
47707
|
+
static passThroughHooksRespectAsync = new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
47708
|
+
preprocess(e) {
|
|
47709
|
+
return e;
|
|
47710
|
+
}
|
|
47711
|
+
postprocess(e) {
|
|
47712
|
+
return e;
|
|
47713
|
+
}
|
|
47714
|
+
processAllTokens(e) {
|
|
47715
|
+
return e;
|
|
47716
|
+
}
|
|
47717
|
+
emStrongMask(e) {
|
|
47718
|
+
return e;
|
|
47719
|
+
}
|
|
47720
|
+
provideLexer(e = this.block) {
|
|
47721
|
+
return e ? T.lex : T.lexInline;
|
|
47722
|
+
}
|
|
47723
|
+
provideParser(e = this.block) {
|
|
47724
|
+
return e ? O.parse : O.parseInline;
|
|
47725
|
+
}
|
|
47726
|
+
};
|
|
47727
|
+
function C(a3, e) {
|
|
47728
|
+
if (Array.isArray(e))
|
|
47729
|
+
for (let t = 0;t < e.length; t++)
|
|
47730
|
+
a3.push(e[t]);
|
|
47731
|
+
else
|
|
47732
|
+
a3.push(e);
|
|
47733
|
+
}
|
|
47734
|
+
var U = class {
|
|
47735
|
+
defaults = B();
|
|
47736
|
+
options = this.setOptions;
|
|
47737
|
+
parse = this.parseMarkdown(true);
|
|
47738
|
+
parseInline = this.parseMarkdown(false);
|
|
47739
|
+
Parser = O;
|
|
47740
|
+
Renderer = $;
|
|
47741
|
+
TextRenderer = z;
|
|
47742
|
+
Lexer = T;
|
|
47743
|
+
Tokenizer = _;
|
|
47744
|
+
Hooks = L;
|
|
47745
|
+
constructor(...e) {
|
|
47746
|
+
this.use(...e);
|
|
47747
|
+
}
|
|
47748
|
+
walkTokens(e, t) {
|
|
47749
|
+
let n = [];
|
|
47750
|
+
for (let i of e)
|
|
47751
|
+
switch (C(n, t.call(this, i)), i.type) {
|
|
47752
|
+
case "table": {
|
|
47753
|
+
let r = i;
|
|
47754
|
+
for (let o of r.header)
|
|
47755
|
+
C(n, this.walkTokens(o.tokens, t));
|
|
47756
|
+
for (let o of r.rows)
|
|
47757
|
+
for (let s of o)
|
|
47758
|
+
C(n, this.walkTokens(s.tokens, t));
|
|
47759
|
+
break;
|
|
47760
|
+
}
|
|
47761
|
+
case "list": {
|
|
47762
|
+
let r = i;
|
|
47763
|
+
C(n, this.walkTokens(r.items, t));
|
|
47764
|
+
break;
|
|
47765
|
+
}
|
|
47766
|
+
default: {
|
|
47767
|
+
let r = i;
|
|
47768
|
+
this.defaults.extensions?.childTokens?.[r.type] ? this.defaults.extensions.childTokens[r.type].forEach((o) => {
|
|
47769
|
+
let s = r[o].flat(1 / 0);
|
|
47770
|
+
C(n, this.walkTokens(s, t));
|
|
47771
|
+
}) : r.tokens && C(n, this.walkTokens(r.tokens, t));
|
|
47772
|
+
}
|
|
47773
|
+
}
|
|
47774
|
+
return n;
|
|
47775
|
+
}
|
|
47776
|
+
use(...e) {
|
|
47777
|
+
let t = this.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
47778
|
+
return e.forEach((n) => {
|
|
47779
|
+
let i = { ...n };
|
|
47780
|
+
if (i.async = this.defaults.async || i.async || false, n.extensions && (n.extensions.forEach((r) => {
|
|
47781
|
+
if (!r.name)
|
|
47782
|
+
throw new Error("extension name required");
|
|
47783
|
+
if ("renderer" in r) {
|
|
47784
|
+
let o = t.renderers[r.name];
|
|
47785
|
+
o ? t.renderers[r.name] = function(...s) {
|
|
47786
|
+
let l = r.renderer.apply(this, s);
|
|
47787
|
+
return l === false && (l = o.apply(this, s)), l;
|
|
47788
|
+
} : t.renderers[r.name] = r.renderer;
|
|
47789
|
+
}
|
|
47790
|
+
if ("tokenizer" in r) {
|
|
47791
|
+
if (!r.level || r.level !== "block" && r.level !== "inline")
|
|
47792
|
+
throw new Error("extension level must be 'block' or 'inline'");
|
|
47793
|
+
let o = t[r.level];
|
|
47794
|
+
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]));
|
|
47795
|
+
}
|
|
47796
|
+
"childTokens" in r && r.childTokens && (t.childTokens[r.name] = r.childTokens);
|
|
47797
|
+
}), i.extensions = t), n.renderer) {
|
|
47798
|
+
let r = this.defaults.renderer || new $(this.defaults);
|
|
47799
|
+
for (let o in n.renderer) {
|
|
47800
|
+
if (!(o in r))
|
|
47801
|
+
throw new Error(`renderer '${o}' does not exist`);
|
|
47802
|
+
if (["options", "parser"].includes(o))
|
|
47803
|
+
continue;
|
|
47804
|
+
let s = o, l = n.renderer[s], u = r[s];
|
|
47805
|
+
r[s] = (...c) => {
|
|
47806
|
+
let p = l.apply(r, c);
|
|
47807
|
+
return p === false && (p = u.apply(r, c)), p || "";
|
|
47808
|
+
};
|
|
47809
|
+
}
|
|
47810
|
+
i.renderer = r;
|
|
47811
|
+
}
|
|
47812
|
+
if (n.tokenizer) {
|
|
47813
|
+
let r = this.defaults.tokenizer || new _(this.defaults);
|
|
47814
|
+
for (let o in n.tokenizer) {
|
|
47815
|
+
if (!(o in r))
|
|
47816
|
+
throw new Error(`tokenizer '${o}' does not exist`);
|
|
47817
|
+
if (["options", "rules", "lexer"].includes(o))
|
|
47818
|
+
continue;
|
|
47819
|
+
let s = o, l = n.tokenizer[s], u = r[s];
|
|
47820
|
+
r[s] = (...c) => {
|
|
47821
|
+
let p = l.apply(r, c);
|
|
47822
|
+
return p === false && (p = u.apply(r, c)), p;
|
|
47823
|
+
};
|
|
47824
|
+
}
|
|
47825
|
+
i.tokenizer = r;
|
|
47826
|
+
}
|
|
47827
|
+
if (n.hooks) {
|
|
47828
|
+
let r = this.defaults.hooks || new L;
|
|
47829
|
+
for (let o in n.hooks) {
|
|
47830
|
+
if (!(o in r))
|
|
47831
|
+
throw new Error(`hook '${o}' does not exist`);
|
|
47832
|
+
if (["options", "block"].includes(o))
|
|
47833
|
+
continue;
|
|
47834
|
+
let s = o, l = n.hooks[s], u = r[s];
|
|
47835
|
+
L.passThroughHooks.has(o) ? r[s] = (c) => {
|
|
47836
|
+
if (this.defaults.async && L.passThroughHooksRespectAsync.has(o))
|
|
47837
|
+
return (async () => {
|
|
47838
|
+
let d = await l.call(r, c);
|
|
47839
|
+
return u.call(r, d);
|
|
47840
|
+
})();
|
|
47841
|
+
let p = l.call(r, c);
|
|
47842
|
+
return u.call(r, p);
|
|
47843
|
+
} : r[s] = (...c) => {
|
|
47844
|
+
if (this.defaults.async)
|
|
47845
|
+
return (async () => {
|
|
47846
|
+
let d = await l.apply(r, c);
|
|
47847
|
+
return d === false && (d = await u.apply(r, c)), d;
|
|
47848
|
+
})();
|
|
47849
|
+
let p = l.apply(r, c);
|
|
47850
|
+
return p === false && (p = u.apply(r, c)), p;
|
|
47851
|
+
};
|
|
47852
|
+
}
|
|
47853
|
+
i.hooks = r;
|
|
47854
|
+
}
|
|
47855
|
+
if (n.walkTokens) {
|
|
47856
|
+
let r = this.defaults.walkTokens, o = n.walkTokens;
|
|
47857
|
+
i.walkTokens = function(s) {
|
|
47858
|
+
let l = [];
|
|
47859
|
+
return l.push(o.call(this, s)), r && C(l, r.call(this, s)), l;
|
|
47860
|
+
};
|
|
47861
|
+
}
|
|
47862
|
+
this.defaults = { ...this.defaults, ...i };
|
|
47863
|
+
}), this;
|
|
47864
|
+
}
|
|
47865
|
+
setOptions(e) {
|
|
47866
|
+
return this.defaults = { ...this.defaults, ...e }, this;
|
|
47867
|
+
}
|
|
47868
|
+
lexer(e, t) {
|
|
47869
|
+
return T.lex(e, t ?? this.defaults);
|
|
47870
|
+
}
|
|
47871
|
+
parser(e, t) {
|
|
47872
|
+
return O.parse(e, t ?? this.defaults);
|
|
47873
|
+
}
|
|
47874
|
+
parseMarkdown(e) {
|
|
47875
|
+
return (n, i) => {
|
|
47876
|
+
let r = { ...i }, o = { ...this.defaults, ...r }, s = this.onError(!!o.silent, !!o.async);
|
|
47877
|
+
if (this.defaults.async === true && r.async === false)
|
|
47878
|
+
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."));
|
|
47879
|
+
if (typeof n > "u" || n === null)
|
|
47880
|
+
return s(new Error("marked(): input parameter is undefined or null"));
|
|
47881
|
+
if (typeof n != "string")
|
|
47882
|
+
return s(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
47883
|
+
if (o.hooks && (o.hooks.options = o, o.hooks.block = e), o.async)
|
|
47884
|
+
return (async () => {
|
|
47885
|
+
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;
|
|
47886
|
+
o.walkTokens && await Promise.all(this.walkTokens(p, o.walkTokens));
|
|
47887
|
+
let g = await (o.hooks ? await o.hooks.provideParser(e) : e ? O.parse : O.parseInline)(p, o);
|
|
47888
|
+
return o.hooks ? await o.hooks.postprocess(g) : g;
|
|
47889
|
+
})().catch(s);
|
|
47890
|
+
try {
|
|
47891
|
+
o.hooks && (n = o.hooks.preprocess(n));
|
|
47892
|
+
let u = (o.hooks ? o.hooks.provideLexer(e) : e ? T.lex : T.lexInline)(n, o);
|
|
47893
|
+
o.hooks && (u = o.hooks.processAllTokens(u)), o.walkTokens && this.walkTokens(u, o.walkTokens);
|
|
47894
|
+
let p = (o.hooks ? o.hooks.provideParser(e) : e ? O.parse : O.parseInline)(u, o);
|
|
47895
|
+
return o.hooks && (p = o.hooks.postprocess(p)), p;
|
|
47896
|
+
} catch (l) {
|
|
47897
|
+
return s(l);
|
|
47898
|
+
}
|
|
47899
|
+
};
|
|
47900
|
+
}
|
|
47901
|
+
onError(e, t) {
|
|
47902
|
+
return (n) => {
|
|
47903
|
+
if (n.message += `
|
|
47904
|
+
Please report this to https://github.com/markedjs/marked.`, e) {
|
|
47905
|
+
let i = "<p>An error occurred:</p><pre>" + w(n.message + "", true) + "</pre>";
|
|
47906
|
+
return t ? Promise.resolve(i) : i;
|
|
47907
|
+
}
|
|
47908
|
+
if (t)
|
|
47909
|
+
return Promise.reject(n);
|
|
47910
|
+
throw n;
|
|
47911
|
+
};
|
|
47912
|
+
}
|
|
47913
|
+
};
|
|
47914
|
+
var I = new U;
|
|
47915
|
+
function f(a3, e) {
|
|
47916
|
+
return I.parse(a3, e);
|
|
47917
|
+
}
|
|
47918
|
+
f.options = f.setOptions = function(a3) {
|
|
47919
|
+
return I.setOptions(a3), f.defaults = I.defaults, V(f.defaults), f;
|
|
47920
|
+
};
|
|
47921
|
+
f.getDefaults = B;
|
|
47922
|
+
f.defaults = y;
|
|
47923
|
+
function At(...a3) {
|
|
47924
|
+
return I.use(...a3), f.defaults = I.defaults, V(f.defaults), f;
|
|
47925
|
+
}
|
|
47926
|
+
f.use = At;
|
|
47927
|
+
f.walkTokens = function(a3, e) {
|
|
47928
|
+
return I.walkTokens(a3, e);
|
|
47929
|
+
};
|
|
47930
|
+
f.parseInline = I.parseInline;
|
|
47931
|
+
f.Parser = O;
|
|
47932
|
+
f.parser = O.parse;
|
|
47933
|
+
f.Renderer = $;
|
|
47934
|
+
f.TextRenderer = z;
|
|
47935
|
+
f.Lexer = T;
|
|
47936
|
+
f.lexer = T.lex;
|
|
47937
|
+
f.Tokenizer = _;
|
|
47938
|
+
f.Hooks = L;
|
|
47939
|
+
f.parse = f;
|
|
47940
|
+
var Rn = f.options;
|
|
47941
|
+
var Tn = f.setOptions;
|
|
47942
|
+
var On = f.walkTokens;
|
|
47943
|
+
var wn = f.parseInline;
|
|
47944
|
+
var yn = O.parse;
|
|
47945
|
+
var Sn = T.lex;
|
|
47946
|
+
|
|
47947
|
+
// src/core/asset/markdown-link-targets.ts
|
|
47948
|
+
var markdown = new U({ gfm: true });
|
|
47949
|
+
function markdownLinkTargets(body, references) {
|
|
47950
|
+
const tokens = markdown.lexer(body);
|
|
47951
|
+
const definitions = new Map;
|
|
47952
|
+
if (references) {
|
|
47953
|
+
markdown.walkTokens(tokens, (token) => {
|
|
47954
|
+
if (token.type !== "def")
|
|
47955
|
+
return;
|
|
47956
|
+
const definition = /^\s*\[([^\]]+)\]:\s*(\S+)/.exec(token.raw);
|
|
47957
|
+
if (definition)
|
|
47958
|
+
definitions.set(definition[1].trim().toLowerCase(), definition[2]);
|
|
47959
|
+
});
|
|
47960
|
+
}
|
|
47961
|
+
const targets = [];
|
|
47962
|
+
markdown.walkTokens(tokens, (token) => {
|
|
47963
|
+
if (token.type !== "link" && token.type !== "image")
|
|
47964
|
+
return;
|
|
47965
|
+
const inline = /^!?\[[\s\S]*\]\(/.test(token.raw);
|
|
47966
|
+
if (inline) {
|
|
47967
|
+
const angled = /\]\(\s*<[^>]*>(?:\s+["'(][\s\S]*["')])?\s*\)$/.test(token.raw);
|
|
47968
|
+
if (!angled)
|
|
47969
|
+
targets.push(token.href);
|
|
47970
|
+
return;
|
|
47971
|
+
}
|
|
47972
|
+
const reference = references && token.type === "link" ? /^\[[\s\S]*\]\[([^\]]+)\]$/.exec(token.raw) : null;
|
|
47973
|
+
const target = reference ? definitions.get(reference[1].trim().toLowerCase()) : undefined;
|
|
47974
|
+
if (target)
|
|
47975
|
+
targets.push(target);
|
|
47976
|
+
});
|
|
47977
|
+
return targets;
|
|
47978
|
+
}
|
|
47979
|
+
|
|
47980
|
+
// src/core/adapter/adapters/llm-wiki-adapter.ts
|
|
46482
47981
|
var WIKI_COMPONENT_ID = "main";
|
|
46483
47982
|
var WIKI_SOURCE_TYPE = "wiki-source";
|
|
46484
47983
|
var DEFAULT_PAGE_KIND = "note";
|
|
@@ -46510,7 +48009,7 @@ function parseWikiFrontmatter(raw) {
|
|
|
46510
48009
|
out.pageKind = nonEmptyString2(data.pageKind);
|
|
46511
48010
|
out.wikiRole = nonEmptyString2(data.wikiRole);
|
|
46512
48011
|
if (Array.isArray(data.xrefs)) {
|
|
46513
|
-
out.xrefs = data.xrefs.filter((
|
|
48012
|
+
out.xrefs = data.xrefs.filter((x2) => typeof x2 === "string" && x2.trim().length > 0).map((x2) => x2.trim());
|
|
46514
48013
|
}
|
|
46515
48014
|
if (Array.isArray(data.sources)) {
|
|
46516
48015
|
out.sources = data.sources.filter((s) => typeof s === "string" && s.trim().length > 0).map((s) => s.trim());
|
|
@@ -46537,12 +48036,10 @@ function resolveXref(xref, bundleId) {
|
|
|
46537
48036
|
}
|
|
46538
48037
|
function resolveBodyLinks(body, fileRelPath) {
|
|
46539
48038
|
const dir = path37.posix.dirname(toPosix(fileRelPath));
|
|
46540
|
-
const linkRe = /\[[^\]]*\]\(([^)]+)\)/g;
|
|
46541
48039
|
const out = [];
|
|
46542
48040
|
const seen = new Set;
|
|
46543
|
-
|
|
46544
|
-
|
|
46545
|
-
let target = match[1].trim();
|
|
48041
|
+
for (const link of markdownLinkTargets(body, false)) {
|
|
48042
|
+
let target = link.trim();
|
|
46546
48043
|
const wsIdx = target.search(/\s/);
|
|
46547
48044
|
if (wsIdx >= 0)
|
|
46548
48045
|
target = target.slice(0, wsIdx);
|
|
@@ -46785,8 +48282,8 @@ function parseActorMapping(value) {
|
|
|
46785
48282
|
const by = nonEmptyString2(value.by);
|
|
46786
48283
|
if (by === undefined)
|
|
46787
48284
|
return;
|
|
46788
|
-
const
|
|
46789
|
-
return
|
|
48285
|
+
const at2 = nonEmptyString2(value.at);
|
|
48286
|
+
return at2 !== undefined ? { by, at: at2 } : { by };
|
|
46790
48287
|
}
|
|
46791
48288
|
function parseVerified(value) {
|
|
46792
48289
|
if (value === undefined || value === null)
|
|
@@ -46838,24 +48335,10 @@ function isReservedFileName2(name) {
|
|
|
46838
48335
|
}
|
|
46839
48336
|
function resolveOkfLinks(body, fileRelPath) {
|
|
46840
48337
|
const dir = path38.posix.dirname(toPosix(fileRelPath));
|
|
46841
|
-
const definitions = new Map;
|
|
46842
|
-
for (const match of body.matchAll(/^\s*\[([^\]]+)\]:\s*(\S+)/gm)) {
|
|
46843
|
-
definitions.set(match[1].trim().toLowerCase(), match[2]);
|
|
46844
|
-
}
|
|
46845
|
-
const candidates = [];
|
|
46846
|
-
for (const match of body.matchAll(/\[[^\]]*\]\(([^)]+)\)/g)) {
|
|
46847
|
-
candidates.push({ index: match.index, target: match[1] });
|
|
46848
|
-
}
|
|
46849
|
-
for (const match of body.matchAll(/(?<!!)\[[^\]]*\]\[([^\]]+)\]/g)) {
|
|
46850
|
-
const target = definitions.get(match[1].trim().toLowerCase());
|
|
46851
|
-
if (target)
|
|
46852
|
-
candidates.push({ index: match.index, target });
|
|
46853
|
-
}
|
|
46854
|
-
candidates.sort((a, b) => a.index - b.index);
|
|
46855
48338
|
const out = [];
|
|
46856
48339
|
const seen = new Set;
|
|
46857
|
-
for (const
|
|
46858
|
-
let target =
|
|
48340
|
+
for (const link of markdownLinkTargets(body, true)) {
|
|
48341
|
+
let target = link.trim();
|
|
46859
48342
|
const wsIdx = target.search(/\s/);
|
|
46860
48343
|
if (wsIdx >= 0)
|
|
46861
48344
|
target = target.slice(0, wsIdx);
|
|
@@ -47073,7 +48556,7 @@ function dirExists2(p) {
|
|
|
47073
48556
|
}
|
|
47074
48557
|
}
|
|
47075
48558
|
function opencodeLooksLikeRoot(root) {
|
|
47076
|
-
if (CONFIG_FILES.some((
|
|
48559
|
+
if (CONFIG_FILES.some((f2) => fileExists(path39.join(root, f2))))
|
|
47077
48560
|
return true;
|
|
47078
48561
|
if (!fileExists(path39.join(root, "AGENTS.md")))
|
|
47079
48562
|
return false;
|
|
@@ -47204,7 +48687,7 @@ var BUILTIN_ADAPTERS = Object.freeze([
|
|
|
47204
48687
|
genericFilesAdapter
|
|
47205
48688
|
]);
|
|
47206
48689
|
{
|
|
47207
|
-
const actualIds = BUILTIN_ADAPTERS.map((
|
|
48690
|
+
const actualIds = BUILTIN_ADAPTERS.map((a3) => a3.id);
|
|
47208
48691
|
const expectedIds = [...ADAPTER_ID_TABLE];
|
|
47209
48692
|
if (actualIds.length !== expectedIds.length || actualIds.some((id, i) => id !== expectedIds[i])) {
|
|
47210
48693
|
throw new Error(`adapter-ids.ts ADAPTER_ID_TABLE (${expectedIds.join(", ")}) does not match ` + `BUILTIN_ADAPTERS (${actualIds.join(", ")}) \u2014 update adapter-ids.ts to match.`);
|
|
@@ -47212,7 +48695,7 @@ var BUILTIN_ADAPTERS = Object.freeze([
|
|
|
47212
48695
|
}
|
|
47213
48696
|
|
|
47214
48697
|
// src/core/adapter/registry.ts
|
|
47215
|
-
var BY_ID = new Map(BUILTIN_ADAPTERS.map((
|
|
48698
|
+
var BY_ID = new Map(BUILTIN_ADAPTERS.map((a3) => [a3.id, a3]));
|
|
47216
48699
|
function getAdapters() {
|
|
47217
48700
|
return [...BUILTIN_ADAPTERS];
|
|
47218
48701
|
}
|
|
@@ -47246,7 +48729,7 @@ function extractIncludeList(pkg) {
|
|
|
47246
48729
|
const { include } = config;
|
|
47247
48730
|
if (!Array.isArray(include))
|
|
47248
48731
|
continue;
|
|
47249
|
-
const list = include.filter((
|
|
48732
|
+
const list = include.filter((v2) => typeof v2 === "string").map((v2) => v2.trim()).filter(Boolean);
|
|
47250
48733
|
if (list.length > 0)
|
|
47251
48734
|
return list;
|
|
47252
48735
|
}
|
|
@@ -47893,8 +49376,8 @@ var WINDOWS_RESERVED_DEVICE_NAMES = new Set([
|
|
|
47893
49376
|
"prn",
|
|
47894
49377
|
"aux",
|
|
47895
49378
|
"nul",
|
|
47896
|
-
...Array.from({ length: 9 }, (
|
|
47897
|
-
...Array.from({ length: 9 }, (
|
|
49379
|
+
...Array.from({ length: 9 }, (_2, i) => `com${i + 1}`),
|
|
49380
|
+
...Array.from({ length: 9 }, (_2, i) => `lpt${i + 1}`)
|
|
47898
49381
|
]);
|
|
47899
49382
|
var pendingGitPaths = new Map;
|
|
47900
49383
|
|
|
@@ -48867,8 +50350,8 @@ var isName = function(string) {
|
|
|
48867
50350
|
const match = regexName.exec(string);
|
|
48868
50351
|
return !(match === null || typeof match === "undefined");
|
|
48869
50352
|
};
|
|
48870
|
-
function isExist(
|
|
48871
|
-
return typeof
|
|
50353
|
+
function isExist(v2) {
|
|
50354
|
+
return typeof v2 !== "undefined";
|
|
48872
50355
|
}
|
|
48873
50356
|
var DANGEROUS_PROPERTY_NAMES = [
|
|
48874
50357
|
"hasOwnProperty",
|
|
@@ -49125,15 +50608,15 @@ function validateAttributeString(attrStr, options) {
|
|
|
49125
50608
|
return true;
|
|
49126
50609
|
}
|
|
49127
50610
|
function validateNumberAmpersand(xmlData, i) {
|
|
49128
|
-
let
|
|
50611
|
+
let re2 = /\d/;
|
|
49129
50612
|
if (xmlData[i] === "x") {
|
|
49130
50613
|
i++;
|
|
49131
|
-
|
|
50614
|
+
re2 = /[\da-fA-F]/;
|
|
49132
50615
|
}
|
|
49133
50616
|
for (;i < xmlData.length; i++) {
|
|
49134
50617
|
if (xmlData[i] === ";")
|
|
49135
50618
|
return i;
|
|
49136
|
-
if (!xmlData[i].match(
|
|
50619
|
+
if (!xmlData[i].match(re2))
|
|
49137
50620
|
break;
|
|
49138
50621
|
}
|
|
49139
50622
|
return -1;
|
|
@@ -49398,14 +50881,14 @@ class EntityDecoder {
|
|
|
49398
50881
|
i++;
|
|
49399
50882
|
continue;
|
|
49400
50883
|
}
|
|
49401
|
-
let
|
|
49402
|
-
while (
|
|
49403
|
-
|
|
49404
|
-
if (
|
|
50884
|
+
let j2 = i + 1;
|
|
50885
|
+
while (j2 < len && str2.charCodeAt(j2) !== 59 && j2 - i <= 32)
|
|
50886
|
+
j2++;
|
|
50887
|
+
if (j2 >= len || str2.charCodeAt(j2) !== 59) {
|
|
49405
50888
|
i++;
|
|
49406
50889
|
continue;
|
|
49407
50890
|
}
|
|
49408
|
-
const token = str2.slice(i + 1,
|
|
50891
|
+
const token = str2.slice(i + 1, j2);
|
|
49409
50892
|
if (token.length === 0) {
|
|
49410
50893
|
i++;
|
|
49411
50894
|
continue;
|
|
@@ -49440,7 +50923,7 @@ class EntityDecoder {
|
|
|
49440
50923
|
if (i > last)
|
|
49441
50924
|
chunks.push(str2.slice(last, i));
|
|
49442
50925
|
chunks.push(replacement);
|
|
49443
|
-
last =
|
|
50926
|
+
last = j2 + 1;
|
|
49444
50927
|
i = last;
|
|
49445
50928
|
if (checkLimits && this._tierCounts(tier)) {
|
|
49446
50929
|
if (limitExpansions) {
|
|
@@ -49977,8 +51460,8 @@ var skipWhitespace = (data, index) => {
|
|
|
49977
51460
|
return index;
|
|
49978
51461
|
};
|
|
49979
51462
|
function hasSeq(data, seq, i) {
|
|
49980
|
-
for (let
|
|
49981
|
-
if (seq[
|
|
51463
|
+
for (let j2 = 0;j2 < seq.length; j2++) {
|
|
51464
|
+
if (seq[j2] !== data[i + j2 + 1])
|
|
49982
51465
|
return false;
|
|
49983
51466
|
}
|
|
49984
51467
|
return true;
|
|
@@ -52544,7 +54027,7 @@ var listFormatters = [{ command: "list", handler: (r) => formatListPlain(r) }];
|
|
|
52544
54027
|
var flat = (s) => s.replace(/\s*\r?\n\s*/g, " ");
|
|
52545
54028
|
function renderTable2(table) {
|
|
52546
54029
|
const all = [table.headers, ...table.rows].map((r) => r.map(flat));
|
|
52547
|
-
const widths = table.headers.map((
|
|
54030
|
+
const widths = table.headers.map((_2, i) => Math.max(...all.map((r) => (r[i] ?? "").length)));
|
|
52548
54031
|
const line = (r) => ` ${r.map((c, i) => c.padEnd(widths[i] ?? 0)).join(" ")}`.trimEnd();
|
|
52549
54032
|
return [`${table.title}:`, ...all.map(line)];
|
|
52550
54033
|
}
|
|
@@ -52858,8 +54341,8 @@ function dirSizeBytes(target) {
|
|
|
52858
54341
|
return total;
|
|
52859
54342
|
}
|
|
52860
54343
|
function sizeOf(target) {
|
|
52861
|
-
const
|
|
52862
|
-
return
|
|
54344
|
+
const st2 = fs42.statSync(target);
|
|
54345
|
+
return st2.isDirectory() ? dirSizeBytes(target) : st2.size;
|
|
52863
54346
|
}
|
|
52864
54347
|
function hostResidue() {
|
|
52865
54348
|
const data = getDataDir();
|
|
@@ -53132,10 +54615,10 @@ function classifyTaskV3Uses(value) {
|
|
|
53132
54615
|
if (error2 instanceof UsageError && /agent ref|task ref/i.test(error2.message))
|
|
53133
54616
|
throw error2;
|
|
53134
54617
|
}
|
|
53135
|
-
const
|
|
53136
|
-
if (
|
|
53137
|
-
const locator = value.slice(0,
|
|
53138
|
-
const revision = value.slice(
|
|
54618
|
+
const at2 = value.lastIndexOf("@");
|
|
54619
|
+
if (at2 > 0 && at2 === value.indexOf("@")) {
|
|
54620
|
+
const locator = value.slice(0, at2);
|
|
54621
|
+
const revision = value.slice(at2 + 1);
|
|
53139
54622
|
const segments = locator.split("/");
|
|
53140
54623
|
const [owner, repository, ...actionPath] = segments;
|
|
53141
54624
|
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)) {
|
|
@@ -54040,7 +55523,7 @@ function walkTasks(root2, tasksDir, out) {
|
|
|
54040
55523
|
if (!contained2(physicalRoot, physicalDirectory)) {
|
|
54041
55524
|
throw migrationError(`${directory} resolves outside bundle ${root2.bundleId}.`);
|
|
54042
55525
|
}
|
|
54043
|
-
for (const entry of fs43.readdirSync(directory, { withFileTypes: true }).sort((
|
|
55526
|
+
for (const entry of fs43.readdirSync(directory, { withFileTypes: true }).sort((a3, b) => a3.name.localeCompare(b.name))) {
|
|
54044
55527
|
const candidate = path51.join(directory, entry.name);
|
|
54045
55528
|
if (entry.isSymbolicLink())
|
|
54046
55529
|
throw migrationError(`task migration does not follow symbolic link ${candidate}.`);
|
|
@@ -54066,7 +55549,7 @@ function walkTasks(root2, tasksDir, out) {
|
|
|
54066
55549
|
}
|
|
54067
55550
|
function inspectTaskFiles(roots) {
|
|
54068
55551
|
const files = [];
|
|
54069
|
-
for (const root2 of [...roots].sort((
|
|
55552
|
+
for (const root2 of [...roots].sort((a3, b) => a3.bundleId.localeCompare(b.bundleId))) {
|
|
54070
55553
|
const tasksDir = root2.layout === "akm-task" ? root2.root : path51.join(root2.root, "tasks");
|
|
54071
55554
|
try {
|
|
54072
55555
|
const stat = fs43.lstatSync(tasksDir);
|
|
@@ -54081,7 +55564,7 @@ function inspectTaskFiles(roots) {
|
|
|
54081
55564
|
}
|
|
54082
55565
|
walkTasks(root2, tasksDir, files);
|
|
54083
55566
|
}
|
|
54084
|
-
return files.sort((
|
|
55567
|
+
return files.sort((a3, b) => a3.filePath.localeCompare(b.filePath));
|
|
54085
55568
|
}
|
|
54086
55569
|
function planTaskFilesMigration(inputs) {
|
|
54087
55570
|
return taskToV4PlanFromOutcomes(inputs.map(planTaskToV4File));
|