mark-deco-cli 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +650 -646
- package/dist/cli.cjs.map +1 -1
- package/package.json +6 -6
package/dist/cli.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*!
|
|
3
3
|
* name: mark-deco-cli
|
|
4
|
-
* version: 0.
|
|
4
|
+
* version: 0.8.0
|
|
5
5
|
* description: Command-line interface for mark-deco Markdown to HTML conversion processor
|
|
6
6
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
7
7
|
* license: MIT
|
|
8
8
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
9
|
-
* git.commit.hash:
|
|
9
|
+
* git.commit.hash: cc985acbf6dd451ba9668a6c148f9e041c1032c5
|
|
10
10
|
*/
|
|
11
11
|
"use strict";
|
|
12
12
|
const commander = require("commander");
|
|
@@ -21412,16 +21412,17 @@ var dump_1 = dump$1;
|
|
|
21412
21412
|
var dumper = {
|
|
21413
21413
|
dump: dump_1
|
|
21414
21414
|
};
|
|
21415
|
+
var JSON_SCHEMA = json;
|
|
21415
21416
|
var load = loader.load;
|
|
21416
21417
|
var dump = dumper.dump;
|
|
21417
21418
|
/*!
|
|
21418
21419
|
* name: mark-deco
|
|
21419
|
-
* version: 0.
|
|
21420
|
+
* version: 0.8.0
|
|
21420
21421
|
* description: Flexible Markdown to HTML conversion library
|
|
21421
21422
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
21422
21423
|
* license: MIT
|
|
21423
21424
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
21424
|
-
* git.commit.hash:
|
|
21425
|
+
* git.commit.hash: cc985acbf6dd451ba9668a6c148f9e041c1032c5
|
|
21425
21426
|
*/
|
|
21426
21427
|
const qd = (e) => {
|
|
21427
21428
|
try {
|
|
@@ -21586,8 +21587,8 @@ const qd = (e) => {
|
|
|
21586
21587
|
if (h) {
|
|
21587
21588
|
const m = h[0].match(/href=['"]([^'"]+)['"]/i);
|
|
21588
21589
|
if (m && m[1]) {
|
|
21589
|
-
const f = m[1],
|
|
21590
|
-
return u.info("getOEmbedUrl: Discovered oEmbed endpoint:",
|
|
21590
|
+
const f = m[1], T = $s(f), A2 = new URL(T, e).toString();
|
|
21591
|
+
return u.info("getOEmbedUrl: Discovered oEmbed endpoint:", A2), A2;
|
|
21591
21592
|
}
|
|
21592
21593
|
}
|
|
21593
21594
|
} catch (c) {
|
|
@@ -21610,11 +21611,11 @@ const qd = (e) => {
|
|
|
21610
21611
|
headers: h
|
|
21611
21612
|
}, f = Er(u);
|
|
21612
21613
|
m.signal = i ? Tr(i, f) : f;
|
|
21613
|
-
const
|
|
21614
|
-
if (
|
|
21615
|
-
const
|
|
21616
|
-
if (
|
|
21617
|
-
n = new URL(
|
|
21614
|
+
const T = await fetch(n, m);
|
|
21615
|
+
if (T.status >= 300 && T.status < 400) {
|
|
21616
|
+
const A2 = T.headers.get("location");
|
|
21617
|
+
if (A2) {
|
|
21618
|
+
n = new URL(A2, n).toString(), c++;
|
|
21618
21619
|
continue;
|
|
21619
21620
|
}
|
|
21620
21621
|
}
|
|
@@ -21654,13 +21655,13 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21654
21655
|
);
|
|
21655
21656
|
const m = await Ws(r, a), f = await zs(h, m, r);
|
|
21656
21657
|
i.info("fetchOEmbedData: oEmbed API URL:", f);
|
|
21657
|
-
const
|
|
21658
|
+
const T = await js(
|
|
21658
21659
|
c,
|
|
21659
21660
|
f,
|
|
21660
21661
|
n,
|
|
21661
21662
|
i
|
|
21662
21663
|
);
|
|
21663
|
-
return i.info("fetchOEmbedData: Parsed JSON data:",
|
|
21664
|
+
return i.info("fetchOEmbedData: Parsed JSON data:", T), T.web_page || (T.web_page = h), T;
|
|
21664
21665
|
} catch (h) {
|
|
21665
21666
|
throw vt$1(h) ? (typeof window < "u" ? i.debug(
|
|
21666
21667
|
"fetchOEmbedData: Browser CORS restrictions block oEmbed API access for URL:",
|
|
@@ -21729,20 +21730,20 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21729
21730
|
const i = e.title || "Untitled", n = e.author_name || "Unknown", c = e.url || "", h = e.width || 0, m = e.height || 0;
|
|
21730
21731
|
let f = "";
|
|
21731
21732
|
h > 0 && m > 0 && (f = ` width="${h}" height="${m}"`);
|
|
21732
|
-
const
|
|
21733
|
-
if (r.title !== void 0 &&
|
|
21733
|
+
const T = [];
|
|
21734
|
+
if (r.title !== void 0 && T.push({
|
|
21734
21735
|
order: r.title,
|
|
21735
21736
|
html: `<div class="oembed-title">${R(i)}</div>`
|
|
21736
|
-
}), r.author !== void 0 &&
|
|
21737
|
+
}), r.author !== void 0 && T.push({
|
|
21737
21738
|
order: r.author,
|
|
21738
21739
|
html: `<div class="oembed-author">by ${R(n)}</div>`
|
|
21739
|
-
}), r.provider !== void 0 &&
|
|
21740
|
+
}), r.provider !== void 0 && T.push({
|
|
21740
21741
|
order: r.provider,
|
|
21741
21742
|
html: `<div class="oembed-provider">${R(u)}</div>`
|
|
21742
|
-
}), r.description !== void 0 && e.author_name &&
|
|
21743
|
+
}), r.description !== void 0 && e.author_name && T.push({
|
|
21743
21744
|
order: r.description,
|
|
21744
21745
|
html: `<div class="oembed-description">${R(e.author_name)}</div>`
|
|
21745
|
-
}), r.thumbnail !== void 0 && e.thumbnail_url &&
|
|
21746
|
+
}), r.thumbnail !== void 0 && e.thumbnail_url && T.push({
|
|
21746
21747
|
order: r.thumbnail,
|
|
21747
21748
|
html: At(
|
|
21748
21749
|
R(e.thumbnail_url),
|
|
@@ -21751,7 +21752,7 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21751
21752
|
)
|
|
21752
21753
|
}), r.embeddedContent !== void 0 && c) {
|
|
21753
21754
|
const M2 = f ? f.trim() : "";
|
|
21754
|
-
|
|
21755
|
+
T.push({
|
|
21755
21756
|
order: r.embeddedContent,
|
|
21756
21757
|
html: ou(
|
|
21757
21758
|
R(c),
|
|
@@ -21763,7 +21764,7 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21763
21764
|
}
|
|
21764
21765
|
if (r.externalLink !== void 0) {
|
|
21765
21766
|
const M2 = a.useMetadataUrlLink && e.web_page || t;
|
|
21766
|
-
|
|
21767
|
+
T.push({
|
|
21767
21768
|
order: r.externalLink,
|
|
21768
21769
|
html: `<div class="oembed-external-link">
|
|
21769
21770
|
<a href="${R(M2)}" target="_blank" rel="noopener noreferrer">
|
|
@@ -21772,17 +21773,17 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21772
21773
|
</div>`
|
|
21773
21774
|
});
|
|
21774
21775
|
}
|
|
21775
|
-
const
|
|
21776
|
-
|
|
21776
|
+
const A2 = T.sort((M2, ee) => M2.order - ee.order), w = [], v = [];
|
|
21777
|
+
A2.forEach((M2) => {
|
|
21777
21778
|
M2.html.includes("oembed-title") || M2.html.includes("oembed-author") || M2.html.includes("oembed-provider") || M2.html.includes("oembed-description") ? w.push(M2.html) : v.push(M2.html);
|
|
21778
21779
|
});
|
|
21779
|
-
let
|
|
21780
|
-
w.length > 0 && (
|
|
21780
|
+
let S = "";
|
|
21781
|
+
w.length > 0 && (S = `<div class="oembed-header">${w.join("")}</div>`);
|
|
21781
21782
|
let U2 = "";
|
|
21782
21783
|
return v.length > 0 && (U2 = `<div class="oembed-content">
|
|
21783
21784
|
${v.join("")}
|
|
21784
21785
|
</div>`), `<div class="oembed-container oembed-photo">
|
|
21785
|
-
${
|
|
21786
|
+
${S}
|
|
21786
21787
|
${U2}
|
|
21787
21788
|
</div>`;
|
|
21788
21789
|
}, Js = (e, t, u, r, a) => {
|
|
@@ -21810,25 +21811,25 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21810
21811
|
order: r.embeddedContent,
|
|
21811
21812
|
html: h
|
|
21812
21813
|
}), r.externalLink !== void 0) {
|
|
21813
|
-
const
|
|
21814
|
+
const S = a.useMetadataUrlLink && e.web_page || t;
|
|
21814
21815
|
m.push({
|
|
21815
21816
|
order: r.externalLink,
|
|
21816
21817
|
html: `<div class="oembed-external-link">
|
|
21817
|
-
<a href="${R(
|
|
21818
|
+
<a href="${R(S)}" target="_blank" rel="noopener noreferrer">
|
|
21818
21819
|
Visit ${R(u)}
|
|
21819
21820
|
</a>
|
|
21820
21821
|
</div>`
|
|
21821
21822
|
});
|
|
21822
21823
|
}
|
|
21823
|
-
const f = m.sort((
|
|
21824
|
-
f.forEach((
|
|
21825
|
-
|
|
21824
|
+
const f = m.sort((S, U2) => S.order - U2.order), T = [], A2 = [];
|
|
21825
|
+
f.forEach((S) => {
|
|
21826
|
+
S.html.includes("oembed-title") || S.html.includes("oembed-author") || S.html.includes("oembed-provider") || S.html.includes("oembed-description") ? T.push(S.html) : A2.push(S.html);
|
|
21826
21827
|
});
|
|
21827
21828
|
let w = "";
|
|
21828
|
-
|
|
21829
|
+
T.length > 0 && (w = `<div class="oembed-header">${T.join("")}</div>`);
|
|
21829
21830
|
let v = "";
|
|
21830
|
-
return
|
|
21831
|
-
${
|
|
21831
|
+
return A2.length > 0 && (v = `<div class="oembed-content">
|
|
21832
|
+
${A2.join("")}
|
|
21832
21833
|
</div>`), `<div class="oembed-container oembed-video">
|
|
21833
21834
|
${w}
|
|
21834
21835
|
${v}
|
|
@@ -21866,15 +21867,15 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21866
21867
|
</a>`
|
|
21867
21868
|
});
|
|
21868
21869
|
}
|
|
21869
|
-
const m = h.sort((v,
|
|
21870
|
+
const m = h.sort((v, S) => v.order - S.order), f = [], T = [];
|
|
21870
21871
|
m.forEach((v) => {
|
|
21871
|
-
v.html.includes("oembed-title") || v.html.includes("oembed-author") || v.html.includes("oembed-provider") || v.html.includes("oembed-description") ? f.push(v.html) :
|
|
21872
|
+
v.html.includes("oembed-title") || v.html.includes("oembed-author") || v.html.includes("oembed-provider") || v.html.includes("oembed-description") ? f.push(v.html) : T.push(v.html);
|
|
21872
21873
|
});
|
|
21873
|
-
let
|
|
21874
|
-
f.length > 0 && (
|
|
21874
|
+
let A2 = "";
|
|
21875
|
+
f.length > 0 && (A2 = `<div class="oembed-header">${f.join("")}</div>`);
|
|
21875
21876
|
let w = "";
|
|
21876
|
-
return
|
|
21877
|
-
${
|
|
21877
|
+
return T.length > 0 && (w = `<div class="oembed-content">${T.join("")}</div>`), `<div class="oembed-container oembed-link">
|
|
21878
|
+
${A2}
|
|
21878
21879
|
${w}
|
|
21879
21880
|
</div>`;
|
|
21880
21881
|
}, ta = (e, t) => {
|
|
@@ -22101,7 +22102,7 @@ function Qt$1(e) {
|
|
|
22101
22102
|
function Te(e) {
|
|
22102
22103
|
return e.type === L.Root;
|
|
22103
22104
|
}
|
|
22104
|
-
function B(e) {
|
|
22105
|
+
function B$1(e) {
|
|
22105
22106
|
return Object.prototype.hasOwnProperty.call(e, "children");
|
|
22106
22107
|
}
|
|
22107
22108
|
function ze(e, t = false) {
|
|
@@ -22461,20 +22462,20 @@ function Ir(e, t) {
|
|
|
22461
22462
|
return xt$1(e, t);
|
|
22462
22463
|
}
|
|
22463
22464
|
function ya(e, t) {
|
|
22464
|
-
return B(e) ? e.children.map((u) => Ir(u, t)).join("") : "";
|
|
22465
|
+
return B$1(e) ? e.children.map((u) => Ir(u, t)).join("") : "";
|
|
22465
22466
|
}
|
|
22466
22467
|
function ot(e) {
|
|
22467
22468
|
return Array.isArray(e) ? e.map(ot).join("") : I(e) ? e.name === "br" ? `
|
|
22468
22469
|
` : ot(e.children) : wt$1(e) ? ot(e.children) : se(e) ? e.data : "";
|
|
22469
22470
|
}
|
|
22470
22471
|
function Le(e) {
|
|
22471
|
-
return Array.isArray(e) ? e.map(Le).join("") : B(e) && !Nt$1(e) ? Le(e.children) : se(e) ? e.data : "";
|
|
22472
|
+
return Array.isArray(e) ? e.map(Le).join("") : B$1(e) && !Nt$1(e) ? Le(e.children) : se(e) ? e.data : "";
|
|
22472
22473
|
}
|
|
22473
22474
|
function dt(e) {
|
|
22474
|
-
return Array.isArray(e) ? e.map(dt).join("") : B(e) && (e.type === L.Tag || wt$1(e)) ? dt(e.children) : se(e) ? e.data : "";
|
|
22475
|
+
return Array.isArray(e) ? e.map(dt).join("") : B$1(e) && (e.type === L.Tag || wt$1(e)) ? dt(e.children) : se(e) ? e.data : "";
|
|
22475
22476
|
}
|
|
22476
22477
|
function It$1(e) {
|
|
22477
|
-
return B(e) ? e.children : [];
|
|
22478
|
+
return B$1(e) ? e.children : [];
|
|
22478
22479
|
}
|
|
22479
22480
|
function Sr(e) {
|
|
22480
22481
|
return e.parent || null;
|
|
@@ -22579,7 +22580,7 @@ function Eu(e, t, u, r) {
|
|
|
22579
22580
|
const c = i[0][n[0]++];
|
|
22580
22581
|
if (e(c) && (a.push(c), --r <= 0))
|
|
22581
22582
|
return a;
|
|
22582
|
-
u && B(c) && c.children.length > 0 && (n.unshift(0), i.unshift(c.children));
|
|
22583
|
+
u && B$1(c) && c.children.length > 0 && (n.unshift(0), i.unshift(c.children));
|
|
22583
22584
|
}
|
|
22584
22585
|
}
|
|
22585
22586
|
function Ua(e, t) {
|
|
@@ -22591,7 +22592,7 @@ function Tu(e, t, u = true) {
|
|
|
22591
22592
|
const i = r[a];
|
|
22592
22593
|
if (I(i) && e(i))
|
|
22593
22594
|
return i;
|
|
22594
|
-
if (u && B(i) && i.children.length > 0) {
|
|
22595
|
+
if (u && B$1(i) && i.children.length > 0) {
|
|
22595
22596
|
const n = Tu(e, i.children, true);
|
|
22596
22597
|
if (n)
|
|
22597
22598
|
return n;
|
|
@@ -22600,7 +22601,7 @@ function Tu(e, t, u = true) {
|
|
|
22600
22601
|
return null;
|
|
22601
22602
|
}
|
|
22602
22603
|
function yr(e, t) {
|
|
22603
|
-
return (Array.isArray(t) ? t : [t]).some((u) => I(u) && e(u) || B(u) && yr(e, u.children));
|
|
22604
|
+
return (Array.isArray(t) ? t : [t]).some((u) => I(u) && e(u) || B$1(u) && yr(e, u.children));
|
|
22604
22605
|
}
|
|
22605
22606
|
function Fa(e, t) {
|
|
22606
22607
|
const u = [], r = [Array.isArray(t) ? t : [t]], a = [0];
|
|
@@ -22612,7 +22613,7 @@ function Fa(e, t) {
|
|
|
22612
22613
|
continue;
|
|
22613
22614
|
}
|
|
22614
22615
|
const i = r[0][a[0]++];
|
|
22615
|
-
I(i) && e(i) && u.push(i), B(i) && i.children.length > 0 && (a.unshift(0), r.unshift(i.children));
|
|
22616
|
+
I(i) && e(i) && u.push(i), B$1(i) && i.children.length > 0 && (a.unshift(0), r.unshift(i.children));
|
|
22616
22617
|
}
|
|
22617
22618
|
}
|
|
22618
22619
|
const ht = {
|
|
@@ -22683,10 +22684,10 @@ function Lr(e, t) {
|
|
|
22683
22684
|
const u = [], r = [];
|
|
22684
22685
|
if (e === t)
|
|
22685
22686
|
return 0;
|
|
22686
|
-
let a = B(e) ? e : e.parent;
|
|
22687
|
+
let a = B$1(e) ? e : e.parent;
|
|
22687
22688
|
for (; a; )
|
|
22688
22689
|
u.unshift(a), a = a.parent;
|
|
22689
|
-
for (a = B(t) ? t : t.parent; a; )
|
|
22690
|
+
for (a = B$1(t) ? t : t.parent; a; )
|
|
22690
22691
|
r.unshift(a), a = a.parent;
|
|
22691
22692
|
const i = Math.min(u.length, r.length);
|
|
22692
22693
|
let n = 0;
|
|
@@ -22717,10 +22718,10 @@ function za(e) {
|
|
|
22717
22718
|
Q(m, "id", "id", h), Q(m, "title", "title", h);
|
|
22718
22719
|
const f = (c = lt("link", h)) === null || c === void 0 ? void 0 : c.attribs.href;
|
|
22719
22720
|
f && (m.link = f);
|
|
22720
|
-
const
|
|
22721
|
-
|
|
22722
|
-
const
|
|
22723
|
-
return
|
|
22721
|
+
const T = fe("summary", h) || fe("content", h);
|
|
22722
|
+
T && (m.description = T);
|
|
22723
|
+
const A2 = fe("updated", h);
|
|
22724
|
+
return A2 && (m.pubDate = new Date(A2)), m;
|
|
22724
22725
|
})
|
|
22725
22726
|
};
|
|
22726
22727
|
Q(r, "id", "id", u), Q(r, "title", "title", u);
|
|
@@ -22810,7 +22811,7 @@ const St$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
22810
22811
|
getSiblings: Cr,
|
|
22811
22812
|
getText: ot,
|
|
22812
22813
|
hasAttrib: La,
|
|
22813
|
-
hasChildren: B,
|
|
22814
|
+
hasChildren: B$1,
|
|
22814
22815
|
innerText: dt,
|
|
22815
22816
|
isCDATA: wt$1,
|
|
22816
22817
|
isComment: Nt$1,
|
|
@@ -22830,7 +22831,7 @@ const St$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
22830
22831
|
}, Symbol.toStringTag, { value: "Module" })), Ja = {
|
|
22831
22832
|
_useHtmlParser2: false
|
|
22832
22833
|
};
|
|
22833
|
-
function Kt(e, t) {
|
|
22834
|
+
function Kt$1(e, t) {
|
|
22834
22835
|
if (!e)
|
|
22835
22836
|
return t ?? Ja;
|
|
22836
22837
|
const u = {
|
|
@@ -22849,7 +22850,7 @@ function ei(e, t) {
|
|
|
22849
22850
|
function ti(e, t) {
|
|
22850
22851
|
const u = ei(e) ? (t = e, void 0) : e, r = {
|
|
22851
22852
|
...this === null || this === void 0 ? void 0 : this._options,
|
|
22852
|
-
...Kt(t)
|
|
22853
|
+
...Kt$1(t)
|
|
22853
22854
|
};
|
|
22854
22855
|
return Dr(this, u, r);
|
|
22855
22856
|
}
|
|
@@ -22925,7 +22926,7 @@ function oi(e) {
|
|
|
22925
22926
|
function ci(e) {
|
|
22926
22927
|
return e.replace(/[A-Z]/g, "-$&").toLowerCase();
|
|
22927
22928
|
}
|
|
22928
|
-
function P(e, t) {
|
|
22929
|
+
function P$1(e, t) {
|
|
22929
22930
|
const u = e.length;
|
|
22930
22931
|
for (let r = 0; r < u; r++)
|
|
22931
22932
|
t(e[r], r);
|
|
@@ -23000,14 +23001,14 @@ var be;
|
|
|
23000
23001
|
(function(e) {
|
|
23001
23002
|
e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE";
|
|
23002
23003
|
})(be || (be = {}));
|
|
23003
|
-
function Zt
|
|
23004
|
+
function Zt(e) {
|
|
23004
23005
|
return e >= V.ZERO && e <= V.NINE;
|
|
23005
23006
|
}
|
|
23006
23007
|
function fi(e) {
|
|
23007
23008
|
return e >= V.UPPER_A && e <= V.UPPER_F || e >= V.LOWER_A && e <= V.LOWER_F;
|
|
23008
23009
|
}
|
|
23009
23010
|
function bi(e) {
|
|
23010
|
-
return e >= V.UPPER_A && e <= V.UPPER_Z || e >= V.LOWER_A && e <= V.LOWER_Z || Zt
|
|
23011
|
+
return e >= V.UPPER_A && e <= V.UPPER_Z || e >= V.LOWER_A && e <= V.LOWER_Z || Zt(e);
|
|
23011
23012
|
}
|
|
23012
23013
|
function Ei(e) {
|
|
23013
23014
|
return e === V.EQUALS || bi(e);
|
|
@@ -23084,7 +23085,7 @@ let Ti = class {
|
|
|
23084
23085
|
const r = u;
|
|
23085
23086
|
for (; u < t.length; ) {
|
|
23086
23087
|
const a = t.charCodeAt(u);
|
|
23087
|
-
if (Zt
|
|
23088
|
+
if (Zt(a) || fi(a))
|
|
23088
23089
|
u += 1;
|
|
23089
23090
|
else
|
|
23090
23091
|
return this.addToNumericResult(t, r, u, 16), this.emitNumericEntity(a, 3);
|
|
@@ -23104,7 +23105,7 @@ let Ti = class {
|
|
|
23104
23105
|
const r = u;
|
|
23105
23106
|
for (; u < t.length; ) {
|
|
23106
23107
|
const a = t.charCodeAt(u);
|
|
23107
|
-
if (Zt
|
|
23108
|
+
if (Zt(a))
|
|
23108
23109
|
u += 1;
|
|
23109
23110
|
else
|
|
23110
23111
|
return this.addToNumericResult(t, r, u, 10), this.emitNumericEntity(a, 2);
|
|
@@ -23742,17 +23743,17 @@ let xi = class {
|
|
|
23742
23743
|
onclosetag(t, u) {
|
|
23743
23744
|
var r, a, i, n, c, h, m, f;
|
|
23744
23745
|
this.endIndex = u;
|
|
23745
|
-
let
|
|
23746
|
-
if (this.lowerCaseTagNames && (
|
|
23747
|
-
this.htmlMode &&
|
|
23746
|
+
let T = this.getSlice(t, u);
|
|
23747
|
+
if (this.lowerCaseTagNames && (T = T.toLowerCase()), this.htmlMode && (ju.has(T) || Vu.has(T)) && this.foreignContext.shift(), this.isVoidElement(T))
|
|
23748
|
+
this.htmlMode && T === "br" && ((n = (i = this.cbs).onopentagname) === null || n === void 0 || n.call(i, "br"), (h = (c = this.cbs).onopentag) === null || h === void 0 || h.call(c, "br", {}, true), (f = (m = this.cbs).onclosetag) === null || f === void 0 || f.call(m, "br", false));
|
|
23748
23749
|
else {
|
|
23749
|
-
const
|
|
23750
|
-
if (
|
|
23751
|
-
for (let w = 0; w <=
|
|
23750
|
+
const A2 = this.stack.indexOf(T);
|
|
23751
|
+
if (A2 !== -1)
|
|
23752
|
+
for (let w = 0; w <= A2; w++) {
|
|
23752
23753
|
const v = this.stack.shift();
|
|
23753
|
-
(a = (r = this.cbs).onclosetag) === null || a === void 0 || a.call(r, v, w !==
|
|
23754
|
+
(a = (r = this.cbs).onclosetag) === null || a === void 0 || a.call(r, v, w !== A2);
|
|
23754
23755
|
}
|
|
23755
|
-
else this.htmlMode &&
|
|
23756
|
+
else this.htmlMode && T === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(true));
|
|
23756
23757
|
}
|
|
23757
23758
|
this.startIndex = u + 1;
|
|
23758
23759
|
}
|
|
@@ -23816,10 +23817,10 @@ let xi = class {
|
|
|
23816
23817
|
}
|
|
23817
23818
|
/** @internal */
|
|
23818
23819
|
oncdata(t, u, r) {
|
|
23819
|
-
var a, i, n, c, h, m, f,
|
|
23820
|
+
var a, i, n, c, h, m, f, T, A2, w;
|
|
23820
23821
|
this.endIndex = u;
|
|
23821
23822
|
const v = this.getSlice(t, u - r);
|
|
23822
|
-
!this.htmlMode || this.options.recognizeCDATA ? ((i = (a = this.cbs).oncdatastart) === null || i === void 0 || i.call(a), (c = (n = this.cbs).ontext) === null || c === void 0 || c.call(n, v), (m = (h = this.cbs).oncdataend) === null || m === void 0 || m.call(h)) : ((
|
|
23823
|
+
!this.htmlMode || this.options.recognizeCDATA ? ((i = (a = this.cbs).oncdatastart) === null || i === void 0 || i.call(a), (c = (n = this.cbs).ontext) === null || c === void 0 || c.call(n, v), (m = (h = this.cbs).oncdataend) === null || m === void 0 || m.call(h)) : ((T = (f = this.cbs).oncomment) === null || T === void 0 || T.call(f, `[CDATA[${v}]]`), (w = (A2 = this.cbs).oncommentend) === null || w === void 0 || w.call(A2)), this.startIndex = u + 1;
|
|
23823
23824
|
}
|
|
23824
23825
|
/** @internal */
|
|
23825
23826
|
onend() {
|
|
@@ -23947,11 +23948,11 @@ function Ci(e, t) {
|
|
|
23947
23948
|
if (typeof t == "function") {
|
|
23948
23949
|
if (typeof e != "string")
|
|
23949
23950
|
throw new Error("Bad combination of arguments.");
|
|
23950
|
-
return P(this, (u, r) => {
|
|
23951
|
+
return P$1(this, (u, r) => {
|
|
23951
23952
|
I(u) && Oe(u, e, t.call(u, r, u.attribs[e]));
|
|
23952
23953
|
});
|
|
23953
23954
|
}
|
|
23954
|
-
return P(this, (u) => {
|
|
23955
|
+
return P$1(this, (u) => {
|
|
23955
23956
|
if (I(u))
|
|
23956
23957
|
if (typeof e == "object")
|
|
23957
23958
|
for (const r of Object.keys(e)) {
|
|
@@ -24012,11 +24013,11 @@ function yi(e, t) {
|
|
|
24012
24013
|
if (typeof t == "function") {
|
|
24013
24014
|
if (typeof e == "object")
|
|
24014
24015
|
throw new TypeError("Bad combination of arguments.");
|
|
24015
|
-
return P(this, (r, a) => {
|
|
24016
|
+
return P$1(this, (r, a) => {
|
|
24016
24017
|
I(r) && Ft$1(r, e, t.call(r, a, $u(r, e, this.options.xmlMode)), this.options.xmlMode);
|
|
24017
24018
|
});
|
|
24018
24019
|
}
|
|
24019
|
-
return P(this, (r) => {
|
|
24020
|
+
return P$1(this, (r) => {
|
|
24020
24021
|
if (I(r))
|
|
24021
24022
|
if (typeof e == "object")
|
|
24022
24023
|
for (const a of Object.keys(e)) {
|
|
@@ -24071,7 +24072,7 @@ function Ri(e, t) {
|
|
|
24071
24072
|
if (!r || !I(r))
|
|
24072
24073
|
return;
|
|
24073
24074
|
const a = r;
|
|
24074
|
-
return (u = a.data) !== null && u !== void 0 || (a.data = {}), e == null ? Oi(a) : typeof e == "object" || t !== void 0 ? (P(this, (i) => {
|
|
24075
|
+
return (u = a.data) !== null && u !== void 0 || (a.data = {}), e == null ? Oi(a) : typeof e == "object" || t !== void 0 ? (P$1(this, (i) => {
|
|
24075
24076
|
I(i) && (typeof e == "object" ? Gu(i, e) : Gu(i, e, t));
|
|
24076
24077
|
}), this) : Li(a, e);
|
|
24077
24078
|
}
|
|
@@ -24109,7 +24110,7 @@ function pt(e) {
|
|
|
24109
24110
|
function ki(e) {
|
|
24110
24111
|
const t = pt(e);
|
|
24111
24112
|
for (const u of t)
|
|
24112
|
-
P(this, (r) => {
|
|
24113
|
+
P$1(this, (r) => {
|
|
24113
24114
|
I(r) && Mr(r, u);
|
|
24114
24115
|
});
|
|
24115
24116
|
return this;
|
|
@@ -24129,7 +24130,7 @@ function Pi(e) {
|
|
|
24129
24130
|
}
|
|
24130
24131
|
function Br(e) {
|
|
24131
24132
|
if (typeof e == "function")
|
|
24132
|
-
return P(this, (r, a) => {
|
|
24133
|
+
return P$1(this, (r, a) => {
|
|
24133
24134
|
if (I(r)) {
|
|
24134
24135
|
const i = r.attribs.class || "";
|
|
24135
24136
|
Br.call([r], e.call(r, a, i));
|
|
@@ -24157,11 +24158,11 @@ function Br(e) {
|
|
|
24157
24158
|
}
|
|
24158
24159
|
function Ur(e) {
|
|
24159
24160
|
if (typeof e == "function")
|
|
24160
|
-
return P(this, (a, i) => {
|
|
24161
|
+
return P$1(this, (a, i) => {
|
|
24161
24162
|
I(a) && Ur.call([a], e.call(a, i, a.attribs.class || ""));
|
|
24162
24163
|
});
|
|
24163
24164
|
const t = pt(e), u = t.length, r = arguments.length === 0;
|
|
24164
|
-
return P(this, (a) => {
|
|
24165
|
+
return P$1(this, (a) => {
|
|
24165
24166
|
if (I(a))
|
|
24166
24167
|
if (r)
|
|
24167
24168
|
a.attribs.class = "";
|
|
@@ -24178,7 +24179,7 @@ function Ur(e) {
|
|
|
24178
24179
|
}
|
|
24179
24180
|
function Fr(e, t) {
|
|
24180
24181
|
if (typeof e == "function")
|
|
24181
|
-
return P(this, (n, c) => {
|
|
24182
|
+
return P$1(this, (n, c) => {
|
|
24182
24183
|
I(n) && Fr.call([n], e.call(n, c, n.attribs.class || "", t), t);
|
|
24183
24184
|
});
|
|
24184
24185
|
if (!e || typeof e != "string")
|
|
@@ -24213,17 +24214,17 @@ var N;
|
|
|
24213
24214
|
(function(e) {
|
|
24214
24215
|
e.Attribute = "attribute", e.Pseudo = "pseudo", e.PseudoElement = "pseudo-element", e.Tag = "tag", e.Universal = "universal", e.Adjacent = "adjacent", e.Child = "child", e.Descendant = "descendant", e.Parent = "parent", e.Sibling = "sibling", e.ColumnCombinator = "column-combinator";
|
|
24215
24216
|
})(N || (N = {}));
|
|
24216
|
-
var H;
|
|
24217
|
+
var H$1;
|
|
24217
24218
|
(function(e) {
|
|
24218
24219
|
e.Any = "any", e.Element = "element", e.End = "end", e.Equals = "equals", e.Exists = "exists", e.Hyphen = "hyphen", e.Not = "not", e.Start = "start";
|
|
24219
|
-
})(H || (H = {}));
|
|
24220
|
+
})(H$1 || (H$1 = {}));
|
|
24220
24221
|
const Wu = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/, Bi = /\\([\da-f]{1,6}\s?|(\s)|.)/gi, Ui = /* @__PURE__ */ new Map([
|
|
24221
|
-
[126, H.Element],
|
|
24222
|
-
[94, H.Start],
|
|
24223
|
-
[36, H.End],
|
|
24224
|
-
[42, H.Any],
|
|
24225
|
-
[33, H.Not],
|
|
24226
|
-
[124, H.Hyphen]
|
|
24222
|
+
[126, H$1.Element],
|
|
24223
|
+
[94, H$1.Start],
|
|
24224
|
+
[36, H$1.End],
|
|
24225
|
+
[42, H$1.Any],
|
|
24226
|
+
[33, H$1.Not],
|
|
24227
|
+
[124, H$1.Hyphen]
|
|
24227
24228
|
]), Fi = /* @__PURE__ */ new Set([
|
|
24228
24229
|
"has",
|
|
24229
24230
|
"not",
|
|
@@ -24274,30 +24275,30 @@ function Ct$1(e) {
|
|
|
24274
24275
|
}
|
|
24275
24276
|
function Hr(e, t, u) {
|
|
24276
24277
|
let r = [];
|
|
24277
|
-
function a(
|
|
24278
|
-
const w = t.slice(u +
|
|
24278
|
+
function a(A2) {
|
|
24279
|
+
const w = t.slice(u + A2).match(Wu);
|
|
24279
24280
|
if (!w)
|
|
24280
24281
|
throw new Error(`Expected name, found ${t.slice(u)}`);
|
|
24281
24282
|
const [v] = w;
|
|
24282
|
-
return u +=
|
|
24283
|
+
return u += A2 + v.length, Be(v);
|
|
24283
24284
|
}
|
|
24284
|
-
function i(
|
|
24285
|
-
for (u +=
|
|
24285
|
+
function i(A2) {
|
|
24286
|
+
for (u += A2; u < t.length && zu(t.charCodeAt(u)); )
|
|
24286
24287
|
u++;
|
|
24287
24288
|
}
|
|
24288
24289
|
function n() {
|
|
24289
24290
|
u += 1;
|
|
24290
|
-
const
|
|
24291
|
+
const A2 = u;
|
|
24291
24292
|
let w = 1;
|
|
24292
24293
|
for (; w > 0 && u < t.length; u++)
|
|
24293
24294
|
t.charCodeAt(u) === 40 && !c(u) ? w++ : t.charCodeAt(u) === 41 && !c(u) && w--;
|
|
24294
24295
|
if (w)
|
|
24295
24296
|
throw new Error("Parenthesis not matched");
|
|
24296
|
-
return Be(t.slice(
|
|
24297
|
+
return Be(t.slice(A2, u - 1));
|
|
24297
24298
|
}
|
|
24298
|
-
function c(
|
|
24299
|
+
function c(A2) {
|
|
24299
24300
|
let w = 0;
|
|
24300
|
-
for (; t.charCodeAt(--
|
|
24301
|
+
for (; t.charCodeAt(--A2) === 92; )
|
|
24301
24302
|
w++;
|
|
24302
24303
|
return (w & 1) === 1;
|
|
24303
24304
|
}
|
|
@@ -24305,24 +24306,24 @@ function Hr(e, t, u) {
|
|
|
24305
24306
|
if (r.length > 0 && qe(r[r.length - 1]))
|
|
24306
24307
|
throw new Error("Did not expect successive traversals.");
|
|
24307
24308
|
}
|
|
24308
|
-
function m(
|
|
24309
|
+
function m(A2) {
|
|
24309
24310
|
if (r.length > 0 && r[r.length - 1].type === N.Descendant) {
|
|
24310
|
-
r[r.length - 1].type =
|
|
24311
|
+
r[r.length - 1].type = A2;
|
|
24311
24312
|
return;
|
|
24312
24313
|
}
|
|
24313
|
-
h(), r.push({ type:
|
|
24314
|
+
h(), r.push({ type: A2 });
|
|
24314
24315
|
}
|
|
24315
|
-
function f(
|
|
24316
|
+
function f(A2, w) {
|
|
24316
24317
|
r.push({
|
|
24317
24318
|
type: N.Attribute,
|
|
24318
|
-
name:
|
|
24319
|
+
name: A2,
|
|
24319
24320
|
action: w,
|
|
24320
24321
|
value: a(1),
|
|
24321
24322
|
namespace: null,
|
|
24322
24323
|
ignoreCase: "quirks"
|
|
24323
24324
|
});
|
|
24324
24325
|
}
|
|
24325
|
-
function
|
|
24326
|
+
function T() {
|
|
24326
24327
|
if (r.length && r[r.length - 1].type === N.Descendant && r.pop(), r.length === 0)
|
|
24327
24328
|
throw new Error("Empty sub-selector");
|
|
24328
24329
|
e.push(r);
|
|
@@ -24330,8 +24331,8 @@ function Hr(e, t, u) {
|
|
|
24330
24331
|
if (i(0), t.length === u)
|
|
24331
24332
|
return u;
|
|
24332
24333
|
e: for (; u < t.length; ) {
|
|
24333
|
-
const
|
|
24334
|
-
switch (
|
|
24334
|
+
const A2 = t.charCodeAt(u);
|
|
24335
|
+
switch (A2) {
|
|
24335
24336
|
// Whitespace
|
|
24336
24337
|
case 32:
|
|
24337
24338
|
case 9:
|
|
@@ -24360,26 +24361,26 @@ function Hr(e, t, u) {
|
|
|
24360
24361
|
}
|
|
24361
24362
|
// Special attribute selectors: .class, #id
|
|
24362
24363
|
case 46: {
|
|
24363
|
-
f("class", H.Element);
|
|
24364
|
+
f("class", H$1.Element);
|
|
24364
24365
|
break;
|
|
24365
24366
|
}
|
|
24366
24367
|
case 35: {
|
|
24367
|
-
f("id", H.Equals);
|
|
24368
|
+
f("id", H$1.Equals);
|
|
24368
24369
|
break;
|
|
24369
24370
|
}
|
|
24370
24371
|
case 91: {
|
|
24371
24372
|
i(1);
|
|
24372
24373
|
let w, v = null;
|
|
24373
24374
|
t.charCodeAt(u) === 124 ? w = a(1) : t.startsWith("*|", u) ? (v = "*", w = a(2)) : (w = a(0), t.charCodeAt(u) === 124 && t.charCodeAt(u + 1) !== 61 && (v = w, w = a(1))), i(0);
|
|
24374
|
-
let
|
|
24375
|
+
let S = H$1.Exists;
|
|
24375
24376
|
const U2 = Ui.get(t.charCodeAt(u));
|
|
24376
24377
|
if (U2) {
|
|
24377
|
-
if (
|
|
24378
|
+
if (S = U2, t.charCodeAt(u + 1) !== 61)
|
|
24378
24379
|
throw new Error("Expected `=`");
|
|
24379
24380
|
i(2);
|
|
24380
|
-
} else t.charCodeAt(u) === 61 && (
|
|
24381
|
+
} else t.charCodeAt(u) === 61 && (S = H$1.Equals, i(1));
|
|
24381
24382
|
let M2 = "", ee = null;
|
|
24382
|
-
if (
|
|
24383
|
+
if (S !== "exists") {
|
|
24383
24384
|
if (Ht$1(t.charCodeAt(u))) {
|
|
24384
24385
|
const ge = t.charCodeAt(u);
|
|
24385
24386
|
let ie = u + 1;
|
|
@@ -24404,7 +24405,7 @@ function Hr(e, t, u) {
|
|
|
24404
24405
|
const he = {
|
|
24405
24406
|
type: N.Attribute,
|
|
24406
24407
|
name: w,
|
|
24407
|
-
action:
|
|
24408
|
+
action: S,
|
|
24408
24409
|
value: M2,
|
|
24409
24410
|
namespace: v,
|
|
24410
24411
|
ignoreCase: ee
|
|
@@ -24432,8 +24433,8 @@ function Hr(e, t, u) {
|
|
|
24432
24433
|
u += 1;
|
|
24433
24434
|
} else {
|
|
24434
24435
|
if (v = n(), Hi.has(w)) {
|
|
24435
|
-
const
|
|
24436
|
-
|
|
24436
|
+
const S = v.charCodeAt(0);
|
|
24437
|
+
S === v.charCodeAt(v.length - 1) && Ht$1(S) && (v = v.slice(1, -1));
|
|
24437
24438
|
}
|
|
24438
24439
|
v = Be(v);
|
|
24439
24440
|
}
|
|
@@ -24441,21 +24442,21 @@ function Hr(e, t, u) {
|
|
|
24441
24442
|
break;
|
|
24442
24443
|
}
|
|
24443
24444
|
case 44: {
|
|
24444
|
-
|
|
24445
|
+
T(), r = [], i(1);
|
|
24445
24446
|
break;
|
|
24446
24447
|
}
|
|
24447
24448
|
default: {
|
|
24448
24449
|
if (t.startsWith("/*", u)) {
|
|
24449
|
-
const
|
|
24450
|
-
if (
|
|
24450
|
+
const S = t.indexOf("*/", u + 2);
|
|
24451
|
+
if (S < 0)
|
|
24451
24452
|
throw new Error("Comment was not terminated");
|
|
24452
|
-
u =
|
|
24453
|
+
u = S + 2, r.length === 0 && i(0);
|
|
24453
24454
|
break;
|
|
24454
24455
|
}
|
|
24455
24456
|
let w = null, v;
|
|
24456
|
-
if (
|
|
24457
|
+
if (A2 === 42)
|
|
24457
24458
|
u += 1, v = "*";
|
|
24458
|
-
else if (
|
|
24459
|
+
else if (A2 === 124) {
|
|
24459
24460
|
if (v = "", t.charCodeAt(u + 1) === 124) {
|
|
24460
24461
|
m(N.ColumnCombinator), i(2);
|
|
24461
24462
|
break;
|
|
@@ -24468,7 +24469,7 @@ function Hr(e, t, u) {
|
|
|
24468
24469
|
}
|
|
24469
24470
|
}
|
|
24470
24471
|
}
|
|
24471
|
-
return
|
|
24472
|
+
return T(), u;
|
|
24472
24473
|
}
|
|
24473
24474
|
function Yi(e) {
|
|
24474
24475
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -24495,12 +24496,12 @@ function Au(e) {
|
|
|
24495
24496
|
return !qr.has(e.type);
|
|
24496
24497
|
}
|
|
24497
24498
|
const Vi = /* @__PURE__ */ new Map([
|
|
24498
|
-
[H.Exists, 10],
|
|
24499
|
-
[H.Equals, 8],
|
|
24500
|
-
[H.Not, 7],
|
|
24501
|
-
[H.Start, 6],
|
|
24502
|
-
[H.End, 6],
|
|
24503
|
-
[H.Any, 5]
|
|
24499
|
+
[H$1.Exists, 10],
|
|
24500
|
+
[H$1.Equals, 8],
|
|
24501
|
+
[H$1.Not, 7],
|
|
24502
|
+
[H$1.Start, 6],
|
|
24503
|
+
[H$1.End, 6],
|
|
24504
|
+
[H$1.Any, 5]
|
|
24504
24505
|
]);
|
|
24505
24506
|
function $i(e) {
|
|
24506
24507
|
const t = e.map(Yr);
|
|
@@ -24516,7 +24517,7 @@ function $i(e) {
|
|
|
24516
24517
|
function Yr(e) {
|
|
24517
24518
|
var t, u;
|
|
24518
24519
|
let r = (t = qr.get(e.type)) !== null && t !== void 0 ? t : -1;
|
|
24519
|
-
return e.type === N.Attribute ? (r = (u = Vi.get(e.action)) !== null && u !== void 0 ? u : 4, e.action === H.Equals && e.name === "id" && (r = 9), e.ignoreCase && (r >>= 1)) : e.type === N.Pseudo && (e.data ? e.name === "has" || e.name === "contains" ? r = 0 : Array.isArray(e.data) ? (r = Math.min(...e.data.map((a) => Math.min(...a.map(Yr)))), r < 0 && (r = 0)) : r = 2 : r = 3), r;
|
|
24520
|
+
return e.type === N.Attribute ? (r = (u = Vi.get(e.action)) !== null && u !== void 0 ? u : 4, e.action === H$1.Equals && e.name === "id" && (r = 9), e.ignoreCase && (r >>= 1)) : e.type === N.Pseudo && (e.data ? e.name === "has" || e.name === "contains" ? r = 0 : Array.isArray(e.data) ? (r = Math.min(...e.data.map((a) => Math.min(...a.map(Yr)))), r < 0 && (r = 0)) : r = 2 : r = 3), r;
|
|
24520
24521
|
}
|
|
24521
24522
|
const Gi = /[-[\]{}()*+?.,\\^$|#\s]/g;
|
|
24522
24523
|
function Ku(e) {
|
|
@@ -24774,11 +24775,11 @@ const eu = {
|
|
|
24774
24775
|
const { equals: a } = u;
|
|
24775
24776
|
return !r || r.length === 0 ? eu.root(e, t, u) : r.length === 1 ? (i) => a(r[0], i) && e(i) : (i) => r.includes(i) && e(i);
|
|
24776
24777
|
},
|
|
24777
|
-
hover: Yt("isHovered"),
|
|
24778
|
-
visited: Yt("isVisited"),
|
|
24779
|
-
active: Yt("isActive")
|
|
24778
|
+
hover: Yt$1("isHovered"),
|
|
24779
|
+
visited: Yt$1("isVisited"),
|
|
24780
|
+
active: Yt$1("isActive")
|
|
24780
24781
|
};
|
|
24781
|
-
function Yt(e) {
|
|
24782
|
+
function Yt$1(e) {
|
|
24782
24783
|
return function(u, r, { adapter: a }) {
|
|
24783
24784
|
const i = a[e];
|
|
24784
24785
|
return typeof i != "function" ? C.falseFunc : function(c) {
|
|
@@ -24925,11 +24926,11 @@ const jt = (e, t, u, r, a) => {
|
|
|
24925
24926
|
const m = en(h, i);
|
|
24926
24927
|
if (c && h !== C.trueFunc) {
|
|
24927
24928
|
const { shouldTestNextSiblings: f = false } = h;
|
|
24928
|
-
return (
|
|
24929
|
-
if (!e(
|
|
24929
|
+
return (T) => {
|
|
24930
|
+
if (!e(T))
|
|
24930
24931
|
return false;
|
|
24931
|
-
c[0] =
|
|
24932
|
-
const
|
|
24932
|
+
c[0] = T;
|
|
24933
|
+
const A2 = i.getChildren(T), w = f ? [...A2, ...Vr(T, i)] : A2;
|
|
24933
24934
|
return i.existsOne(m, w);
|
|
24934
24935
|
};
|
|
24935
24936
|
}
|
|
@@ -24957,7 +24958,7 @@ function tn(e, t, u, r, a) {
|
|
|
24957
24958
|
return eu[n](e, c, u, r);
|
|
24958
24959
|
if (n in Zu) {
|
|
24959
24960
|
const f = Zu[n];
|
|
24960
|
-
return Ju(f, n, c, 2), (
|
|
24961
|
+
return Ju(f, n, c, 2), (T) => f(T, u, c) && e(T);
|
|
24961
24962
|
}
|
|
24962
24963
|
throw new Error(`Unknown pseudo-class :${n}`);
|
|
24963
24964
|
}
|
|
@@ -25032,10 +25033,10 @@ function un(e, t, u, r, a) {
|
|
|
25032
25033
|
return function(h) {
|
|
25033
25034
|
const m = i.getSiblings(h);
|
|
25034
25035
|
for (let f = 0; f < m.length; f++) {
|
|
25035
|
-
const
|
|
25036
|
-
if (n(h,
|
|
25036
|
+
const T = m[f];
|
|
25037
|
+
if (n(h, T))
|
|
25037
25038
|
break;
|
|
25038
|
-
if (i.isTag(
|
|
25039
|
+
if (i.isTag(T) && e(T))
|
|
25039
25040
|
return true;
|
|
25040
25041
|
}
|
|
25041
25042
|
return false;
|
|
@@ -25047,11 +25048,11 @@ function un(e, t, u, r, a) {
|
|
|
25047
25048
|
} : function(h) {
|
|
25048
25049
|
const m = i.getSiblings(h);
|
|
25049
25050
|
let f;
|
|
25050
|
-
for (let
|
|
25051
|
-
const
|
|
25052
|
-
if (n(h,
|
|
25051
|
+
for (let T = 0; T < m.length; T++) {
|
|
25052
|
+
const A2 = m[T];
|
|
25053
|
+
if (n(h, A2))
|
|
25053
25054
|
break;
|
|
25054
|
-
i.isTag(
|
|
25055
|
+
i.isTag(A2) && (f = A2);
|
|
25055
25056
|
}
|
|
25056
25057
|
return !!f && e(f);
|
|
25057
25058
|
};
|
|
@@ -25275,15 +25276,15 @@ function Et$1(e, t, u, r, a) {
|
|
|
25275
25276
|
const i = t.findIndex(bt$1), n = t.slice(0, i), c = t[i], h = t.length - 1 === i ? a : 1 / 0, m = fn(c.name, c.data, h);
|
|
25276
25277
|
if (m === 0)
|
|
25277
25278
|
return [];
|
|
25278
|
-
const
|
|
25279
|
-
let
|
|
25280
|
-
if (
|
|
25281
|
-
return
|
|
25279
|
+
const T = (n.length === 0 && !Array.isArray(e) ? It$1(e).filter(I) : n.length === 0 ? (Array.isArray(e) ? e : [e]).filter(I) : r || n.some(qe) ? uu(e, [n], u, m) : ru(e, [n], u)).slice(0, m);
|
|
25280
|
+
let A2 = _n(c.name, T, c.data, u);
|
|
25281
|
+
if (A2.length === 0 || t.length === i + 1)
|
|
25282
|
+
return A2;
|
|
25282
25283
|
const w = t.slice(i + 1), v = w.some(qe);
|
|
25283
25284
|
if (v) {
|
|
25284
25285
|
if (qe(w[0])) {
|
|
25285
|
-
const { type:
|
|
25286
|
-
(
|
|
25286
|
+
const { type: S } = w[0];
|
|
25287
|
+
(S === N.Sibling || S === N.Adjacent) && (A2 = zr(A2, St$1, true)), w.unshift(En);
|
|
25287
25288
|
}
|
|
25288
25289
|
u = {
|
|
25289
25290
|
...u,
|
|
@@ -25293,15 +25294,15 @@ function Et$1(e, t, u, r, a) {
|
|
|
25293
25294
|
* Add a custom root func, to make sure traversals don't match elements
|
|
25294
25295
|
* that aren't a part of the considered tree.
|
|
25295
25296
|
*/
|
|
25296
|
-
rootFunc: (
|
|
25297
|
+
rootFunc: (S) => A2.includes(S)
|
|
25297
25298
|
};
|
|
25298
25299
|
} else u.rootFunc && u.rootFunc !== ft.trueFunc && (u = { ...u, rootFunc: ft.trueFunc });
|
|
25299
|
-
return w.some(bt$1) ? Et$1(
|
|
25300
|
+
return w.some(bt$1) ? Et$1(A2, w, u, false, a) : v ? (
|
|
25300
25301
|
// Query existing elements to resolve traversal.
|
|
25301
|
-
uu(
|
|
25302
|
+
uu(A2, [w], u, a)
|
|
25302
25303
|
) : (
|
|
25303
25304
|
// If we don't have any more traversals, simply filter elements.
|
|
25304
|
-
ru(
|
|
25305
|
+
ru(A2, [w], u)
|
|
25305
25306
|
);
|
|
25306
25307
|
}
|
|
25307
25308
|
function uu(e, t, u, r) {
|
|
@@ -25374,7 +25375,7 @@ function Iu(e, ...t) {
|
|
|
25374
25375
|
let u = null;
|
|
25375
25376
|
const r = Nu((a, i) => {
|
|
25376
25377
|
const n = [];
|
|
25377
|
-
return P(i, (c) => {
|
|
25378
|
+
return P$1(i, (c) => {
|
|
25378
25379
|
for (let h; (h = a(c)) && !u?.(h, n.length); c = h)
|
|
25379
25380
|
n.push(h);
|
|
25380
25381
|
}), n;
|
|
@@ -25403,7 +25404,7 @@ function Sn(e) {
|
|
|
25403
25404
|
xmlMode: this.options.xmlMode,
|
|
25404
25405
|
root: (t = this._root) === null || t === void 0 ? void 0 : t[0]
|
|
25405
25406
|
}, a = typeof e == "string" ? (i) => Qr(i, e, r) : tt(e);
|
|
25406
|
-
return P(this, (i) => {
|
|
25407
|
+
return P$1(this, (i) => {
|
|
25407
25408
|
for (i && !Te(i) && !I(i) && (i = i.parent); i && I(i); ) {
|
|
25408
25409
|
if (a(i, 0)) {
|
|
25409
25410
|
u.includes(i) || u.push(i);
|
|
@@ -25425,7 +25426,7 @@ const Cn = xu((e) => fu(e)), yn = et((e) => {
|
|
|
25425
25426
|
return t;
|
|
25426
25427
|
}, Pe), Dn = Iu((e) => bu(e), Pe), kn = et((e) => Cr(e).filter((t) => I(t) && t !== e), ke), Pn = et((e) => It$1(e).filter(I), Pe);
|
|
25427
25428
|
function Mn() {
|
|
25428
|
-
const e = this.toArray().reduce((t, u) => B(u) ? t.concat(u.children) : t, []);
|
|
25429
|
+
const e = this.toArray().reduce((t, u) => B$1(u) ? t.concat(u.children) : t, []);
|
|
25429
25430
|
return this._make(e);
|
|
25430
25431
|
}
|
|
25431
25432
|
function Bn(e) {
|
|
@@ -25593,8 +25594,8 @@ function to(e, t) {
|
|
|
25593
25594
|
function ts(e) {
|
|
25594
25595
|
return function(...t) {
|
|
25595
25596
|
const u = this.length - 1;
|
|
25596
|
-
return P(this, (r, a) => {
|
|
25597
|
-
if (!B(r))
|
|
25597
|
+
return P$1(this, (r, a) => {
|
|
25598
|
+
if (!B$1(r))
|
|
25598
25599
|
return;
|
|
25599
25600
|
const i = typeof t[0] == "function" ? t[0].call(r, a, this._render(r.children)) : t, n = this._makeDomArray(i, a < u);
|
|
25600
25601
|
e(n, r.children, r);
|
|
@@ -25609,12 +25610,12 @@ function _e(e, t, u, r, a) {
|
|
|
25609
25610
|
...r
|
|
25610
25611
|
], h = t === 0 ? null : e[t - 1], m = t + u >= e.length ? null : e[t + u];
|
|
25611
25612
|
for (let f = 0; f < r.length; ++f) {
|
|
25612
|
-
const
|
|
25613
|
-
if (
|
|
25614
|
-
const v =
|
|
25615
|
-
v !== -1 && (
|
|
25613
|
+
const T = r[f], A2 = T.parent;
|
|
25614
|
+
if (A2) {
|
|
25615
|
+
const v = A2.children.indexOf(T);
|
|
25616
|
+
v !== -1 && (A2.children.splice(v, 1), a === A2 && t > v && c[0]--);
|
|
25616
25617
|
}
|
|
25617
|
-
|
|
25618
|
+
T.parent = a, T.prev && (T.prev.next = (i = T.next) !== null && i !== void 0 ? i : null), T.next && (T.next.prev = (n = T.prev) !== null && n !== void 0 ? n : null), T.prev = f === 0 ? h : r[f - 1], T.next = f === r.length - 1 ? m : r[f + 1];
|
|
25618
25619
|
}
|
|
25619
25620
|
return h && (h.next = r[0]), m && (m.prev = r[r.length - 1]), e.splice(...c);
|
|
25620
25621
|
}
|
|
@@ -25634,7 +25635,7 @@ function us(e) {
|
|
|
25634
25635
|
const u = this.length - 1, r = this.parents().last();
|
|
25635
25636
|
for (let a = 0; a < this.length; a++) {
|
|
25636
25637
|
const i = this[a], n = typeof t == "function" ? t.call(i, a, i) : typeof t == "string" && !Xt(t) ? r.find(t).clone() : t, [c] = this._makeDomArray(n, a < u);
|
|
25637
|
-
if (!c || !B(c))
|
|
25638
|
+
if (!c || !B$1(c))
|
|
25638
25639
|
continue;
|
|
25639
25640
|
let h = c, m = 0;
|
|
25640
25641
|
for (; m < h.children.length; ) {
|
|
@@ -25653,7 +25654,7 @@ const io = us((e, t, u) => {
|
|
|
25653
25654
|
const a = r.children, i = a.indexOf(e);
|
|
25654
25655
|
xe([e], t), _e(a, i, 0, u, r);
|
|
25655
25656
|
}), no = us((e, t, u) => {
|
|
25656
|
-
B(e) && (xe(e.children, t), xe(u, e));
|
|
25657
|
+
B$1(e) && (xe(e.children, t), xe(u, e));
|
|
25657
25658
|
});
|
|
25658
25659
|
function oo(e) {
|
|
25659
25660
|
return this.parent(e).not("body").each((t, u) => {
|
|
@@ -25678,8 +25679,8 @@ function co(e) {
|
|
|
25678
25679
|
}
|
|
25679
25680
|
function ho(...e) {
|
|
25680
25681
|
const t = this.length - 1;
|
|
25681
|
-
return P(this, (u, r) => {
|
|
25682
|
-
if (!B(u) || !u.parent)
|
|
25682
|
+
return P$1(this, (u, r) => {
|
|
25683
|
+
if (!B$1(u) || !u.parent)
|
|
25683
25684
|
return;
|
|
25684
25685
|
const a = u.parent.children, i = a.indexOf(u);
|
|
25685
25686
|
if (i === -1)
|
|
@@ -25702,8 +25703,8 @@ function lo(e) {
|
|
|
25702
25703
|
}
|
|
25703
25704
|
function mo(...e) {
|
|
25704
25705
|
const t = this.length - 1;
|
|
25705
|
-
return P(this, (u, r) => {
|
|
25706
|
-
if (!B(u) || !u.parent)
|
|
25706
|
+
return P$1(this, (u, r) => {
|
|
25707
|
+
if (!B$1(u) || !u.parent)
|
|
25707
25708
|
return;
|
|
25708
25709
|
const a = u.parent.children, i = a.indexOf(u);
|
|
25709
25710
|
if (i === -1)
|
|
@@ -25716,7 +25717,7 @@ function po(e) {
|
|
|
25716
25717
|
const t = this._make(e);
|
|
25717
25718
|
this.remove();
|
|
25718
25719
|
const u = [];
|
|
25719
|
-
return P(t, (r) => {
|
|
25720
|
+
return P$1(t, (r) => {
|
|
25720
25721
|
const a = this.clone().toArray(), { parent: i } = r;
|
|
25721
25722
|
if (!i)
|
|
25722
25723
|
return;
|
|
@@ -25726,12 +25727,12 @@ function po(e) {
|
|
|
25726
25727
|
}
|
|
25727
25728
|
function fo(e) {
|
|
25728
25729
|
const t = e ? this.filter(e) : this;
|
|
25729
|
-
return P(t, (u) => {
|
|
25730
|
+
return P$1(t, (u) => {
|
|
25730
25731
|
Ie(u), u.prev = u.next = u.parent = null;
|
|
25731
25732
|
}), this;
|
|
25732
25733
|
}
|
|
25733
25734
|
function bo(e) {
|
|
25734
|
-
return P(this, (t, u) => {
|
|
25735
|
+
return P$1(this, (t, u) => {
|
|
25735
25736
|
const { parent: r } = t;
|
|
25736
25737
|
if (!r)
|
|
25737
25738
|
return;
|
|
@@ -25742,8 +25743,8 @@ function bo(e) {
|
|
|
25742
25743
|
});
|
|
25743
25744
|
}
|
|
25744
25745
|
function Eo() {
|
|
25745
|
-
return P(this, (e) => {
|
|
25746
|
-
if (B(e)) {
|
|
25746
|
+
return P$1(this, (e) => {
|
|
25747
|
+
if (B$1(e)) {
|
|
25747
25748
|
for (const t of e.children)
|
|
25748
25749
|
t.next = t.prev = t.parent = null;
|
|
25749
25750
|
e.children.length = 0;
|
|
@@ -25753,10 +25754,10 @@ function Eo() {
|
|
|
25753
25754
|
function To(e) {
|
|
25754
25755
|
if (e === void 0) {
|
|
25755
25756
|
const t = this[0];
|
|
25756
|
-
return !t || !B(t) ? null : this._render(t.children);
|
|
25757
|
+
return !t || !B$1(t) ? null : this._render(t.children);
|
|
25757
25758
|
}
|
|
25758
|
-
return P(this, (t) => {
|
|
25759
|
-
if (!B(t))
|
|
25759
|
+
return P$1(this, (t) => {
|
|
25760
|
+
if (!B$1(t))
|
|
25760
25761
|
return;
|
|
25761
25762
|
for (const r of t.children)
|
|
25762
25763
|
r.next = r.prev = r.parent = null;
|
|
@@ -25768,8 +25769,8 @@ function _o() {
|
|
|
25768
25769
|
return this._render(this);
|
|
25769
25770
|
}
|
|
25770
25771
|
function go(e) {
|
|
25771
|
-
return e === void 0 ? Qe(this) : typeof e == "function" ? P(this, (t, u) => this._make(t).text(e.call(t, u, Qe([t])))) : P(this, (t) => {
|
|
25772
|
-
if (!B(t))
|
|
25772
|
+
return e === void 0 ? Qe(this) : typeof e == "function" ? P$1(this, (t, u) => this._make(t).text(e.call(t, u, Qe([t])))) : P$1(this, (t) => {
|
|
25773
|
+
if (!B$1(t))
|
|
25773
25774
|
return;
|
|
25774
25775
|
for (const r of t.children)
|
|
25775
25776
|
r.next = r.prev = r.parent = null;
|
|
@@ -25809,7 +25810,7 @@ const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
25809
25810
|
function wo(e, t) {
|
|
25810
25811
|
if (e != null && t != null || // When `prop` is a "plain" object
|
|
25811
25812
|
typeof e == "object" && !Array.isArray(e))
|
|
25812
|
-
return P(this, (u, r) => {
|
|
25813
|
+
return P$1(this, (u, r) => {
|
|
25813
25814
|
I(u) && rs(u, e, t, r);
|
|
25814
25815
|
});
|
|
25815
25816
|
if (this.length !== 0)
|
|
@@ -25942,23 +25943,23 @@ function ko(e, t) {
|
|
|
25942
25943
|
return function u(r, a, i = true) {
|
|
25943
25944
|
if (r == null)
|
|
25944
25945
|
throw new Error("cheerio.load() expects a string");
|
|
25945
|
-
const n = Kt(a), c = e(r, n, i, null);
|
|
25946
|
+
const n = Kt$1(a), c = e(r, n, i, null);
|
|
25946
25947
|
class h extends ut {
|
|
25947
|
-
_make(
|
|
25948
|
-
const w = m(
|
|
25948
|
+
_make(T, A2) {
|
|
25949
|
+
const w = m(T, A2);
|
|
25949
25950
|
return w.prevObject = this, w;
|
|
25950
25951
|
}
|
|
25951
|
-
_parse(
|
|
25952
|
-
return e(
|
|
25952
|
+
_parse(T, A2, w, v) {
|
|
25953
|
+
return e(T, A2, w, v);
|
|
25953
25954
|
}
|
|
25954
|
-
_render(
|
|
25955
|
-
return t(
|
|
25955
|
+
_render(T) {
|
|
25956
|
+
return t(T, this.options);
|
|
25956
25957
|
}
|
|
25957
25958
|
}
|
|
25958
|
-
function m(f,
|
|
25959
|
+
function m(f, T, A2 = c, w) {
|
|
25959
25960
|
if (f && de(f))
|
|
25960
25961
|
return f;
|
|
25961
|
-
const v = Kt(w, n),
|
|
25962
|
+
const v = Kt$1(w, n), S = typeof A2 == "string" ? [e(A2, v, false, null)] : "length" in A2 ? A2 : [A2], U2 = de(S) ? S : new h(S, null, v);
|
|
25962
25963
|
if (U2._root = U2, !f)
|
|
25963
25964
|
return new h(void 0, U2, v);
|
|
25964
25965
|
const M2 = typeof f == "string" && Xt(f) ? (
|
|
@@ -25976,20 +25977,20 @@ function ko(e, t) {
|
|
|
25976
25977
|
if (typeof f != "string")
|
|
25977
25978
|
throw new TypeError("Unexpected type of selector");
|
|
25978
25979
|
let he = f;
|
|
25979
|
-
const ae =
|
|
25980
|
+
const ae = T ? (
|
|
25980
25981
|
// If we don't have a context, maybe we have a root, from loading
|
|
25981
|
-
typeof
|
|
25982
|
+
typeof T == "string" ? Xt(T) ? (
|
|
25982
25983
|
// $('li', '<ul>...</ul>')
|
|
25983
|
-
new h([e(
|
|
25984
|
+
new h([e(T, v, false, null)], U2, v)
|
|
25984
25985
|
) : (
|
|
25985
25986
|
// $('li', 'ul')
|
|
25986
|
-
(he = `${
|
|
25987
|
-
) : de(
|
|
25987
|
+
(he = `${T} ${he}`, U2)
|
|
25988
|
+
) : de(T) ? (
|
|
25988
25989
|
// $('li', $)
|
|
25989
|
-
|
|
25990
|
+
T
|
|
25990
25991
|
) : (
|
|
25991
25992
|
// $('li', node), $('li', [nodes])
|
|
25992
|
-
new h(Array.isArray(
|
|
25993
|
+
new h(Array.isArray(T) ? T : [T], U2, v)
|
|
25993
25994
|
)
|
|
25994
25995
|
) : U2;
|
|
25995
25996
|
return ae ? ae.find(he) : ee;
|
|
@@ -26595,7 +26596,7 @@ const Ko = /* @__PURE__ */ new Map([
|
|
|
26595
26596
|
[p.WBR, s.WBR],
|
|
26596
26597
|
[p.XMP, s.XMP]
|
|
26597
26598
|
]);
|
|
26598
|
-
function yt
|
|
26599
|
+
function yt(e) {
|
|
26599
26600
|
var t;
|
|
26600
26601
|
return (t = Ko.get(e)) !== null && t !== void 0 ? t : s.UNKNOWN;
|
|
26601
26602
|
}
|
|
@@ -26887,7 +26888,7 @@ class rc {
|
|
|
26887
26888
|
}
|
|
26888
26889
|
emitCurrentTagToken() {
|
|
26889
26890
|
const t = this.currentToken;
|
|
26890
|
-
this.prepareToken(t), t.tagID = yt
|
|
26891
|
+
this.prepareToken(t), t.tagID = yt(t.tagName), t.type === O.START_TAG ? (this.lastStartTagName = t.tagName, this.handler.onStartTag(t)) : (t.attrs.length > 0 && this._err(b.endTagWithAttributes), t.selfClosing && this._err(b.endTagWithTrailingSolidus), this.handler.onEndTag(t)), this.preprocessor.dropParsedChunk();
|
|
26891
26892
|
}
|
|
26892
26893
|
emitCurrentComment(t) {
|
|
26893
26894
|
this.prepareToken(t), this.handler.onComment(t), this.preprocessor.dropParsedChunk();
|
|
@@ -28866,11 +28867,11 @@ class dc {
|
|
|
28866
28867
|
}
|
|
28867
28868
|
}
|
|
28868
28869
|
const Gt$1 = 3;
|
|
28869
|
-
var te
|
|
28870
|
+
var te;
|
|
28870
28871
|
(function(e) {
|
|
28871
28872
|
e[e.Marker = 0] = "Marker", e[e.Element = 1] = "Element";
|
|
28872
|
-
})(te
|
|
28873
|
-
const nr = { type: te
|
|
28873
|
+
})(te || (te = {}));
|
|
28874
|
+
const nr = { type: te.Marker };
|
|
28874
28875
|
class hc {
|
|
28875
28876
|
constructor(t) {
|
|
28876
28877
|
this.treeAdapter = t, this.entries = [], this.bookmark = null;
|
|
@@ -28882,7 +28883,7 @@ class hc {
|
|
|
28882
28883
|
const r = [], a = u.length, i = this.treeAdapter.getTagName(t), n = this.treeAdapter.getNamespaceURI(t);
|
|
28883
28884
|
for (let c = 0; c < this.entries.length; c++) {
|
|
28884
28885
|
const h = this.entries[c];
|
|
28885
|
-
if (h.type === te
|
|
28886
|
+
if (h.type === te.Marker)
|
|
28886
28887
|
break;
|
|
28887
28888
|
const { element: m } = h;
|
|
28888
28889
|
if (this.treeAdapter.getTagName(m) === i && this.treeAdapter.getNamespaceURI(m) === n) {
|
|
@@ -28911,7 +28912,7 @@ class hc {
|
|
|
28911
28912
|
}
|
|
28912
28913
|
pushElement(t, u) {
|
|
28913
28914
|
this._ensureNoahArkCondition(t), this.entries.unshift({
|
|
28914
|
-
type: te
|
|
28915
|
+
type: te.Element,
|
|
28915
28916
|
element: t,
|
|
28916
28917
|
token: u
|
|
28917
28918
|
});
|
|
@@ -28919,7 +28920,7 @@ class hc {
|
|
|
28919
28920
|
insertElementAfterBookmark(t, u) {
|
|
28920
28921
|
const r = this.entries.indexOf(this.bookmark);
|
|
28921
28922
|
this.entries.splice(r, 0, {
|
|
28922
|
-
type: te
|
|
28923
|
+
type: te.Element,
|
|
28923
28924
|
element: t,
|
|
28924
28925
|
token: u
|
|
28925
28926
|
});
|
|
@@ -28939,11 +28940,11 @@ class hc {
|
|
|
28939
28940
|
}
|
|
28940
28941
|
//Search
|
|
28941
28942
|
getElementEntryInScopeWithTagName(t) {
|
|
28942
|
-
const u = this.entries.find((r) => r.type === te
|
|
28943
|
-
return u && u.type === te
|
|
28943
|
+
const u = this.entries.find((r) => r.type === te.Marker || this.treeAdapter.getTagName(r.element) === t);
|
|
28944
|
+
return u && u.type === te.Element ? u : null;
|
|
28944
28945
|
}
|
|
28945
28946
|
getElementEntry(t) {
|
|
28946
|
-
return this.entries.find((u) => u.type === te
|
|
28947
|
+
return this.entries.find((u) => u.type === te.Element && u.element === t);
|
|
28947
28948
|
}
|
|
28948
28949
|
}
|
|
28949
28950
|
const oe = {
|
|
@@ -29378,7 +29379,7 @@ function Cu(e) {
|
|
|
29378
29379
|
}
|
|
29379
29380
|
function Ic(e) {
|
|
29380
29381
|
const t = wc.get(e.tagName);
|
|
29381
|
-
t != null && (e.tagName = t, e.tagID = yt
|
|
29382
|
+
t != null && (e.tagName = t, e.tagID = yt(e.tagName));
|
|
29382
29383
|
}
|
|
29383
29384
|
function Sc(e, t) {
|
|
29384
29385
|
return t === E.MATHML && (e === s.MI || e === s.MO || e === s.MN || e === s.MS || e === s.MTEXT);
|
|
@@ -29419,7 +29420,7 @@ class Es {
|
|
|
29419
29420
|
this.fragmentContext = r, this.scriptHandler = a, this.currentToken = null, this.stopped = false, this.insertionMode = l.INITIAL, this.originalInsertionMode = l.INITIAL, this.headElement = null, this.formElement = null, this.currentNotInHTML = false, this.tmplInsertionModeStack = [], this.pendingCharacterTokens = [], this.hasNonWhitespacePendingCharacterToken = false, this.framesetOk = true, this.skipNextNewLine = false, this.fosterParentingEnabled = false, this.options = {
|
|
29420
29421
|
...dr,
|
|
29421
29422
|
...t
|
|
29422
|
-
}, this.treeAdapter = this.options.treeAdapter, this.onParseError = this.options.onParseError, this.onParseError && (this.options.sourceCodeLocationInfo = true), this.document = u ?? this.treeAdapter.createDocument(), this.tokenizer = new rc(this.options, this), this.activeFormattingElements = new hc(this.treeAdapter), this.fragmentContextID = r ? yt
|
|
29423
|
+
}, this.treeAdapter = this.options.treeAdapter, this.onParseError = this.options.onParseError, this.onParseError && (this.options.sourceCodeLocationInfo = true), this.document = u ?? this.treeAdapter.createDocument(), this.tokenizer = new rc(this.options, this), this.activeFormattingElements = new hc(this.treeAdapter), this.fragmentContextID = r ? yt(this.treeAdapter.getTagName(r)) : s.UNKNOWN, this._setContextModes(r ?? this.document, this.fragmentContextID), this.openElements = new dc(this.document, this.treeAdapter, this);
|
|
29423
29424
|
}
|
|
29424
29425
|
// API
|
|
29425
29426
|
static parse(t, u) {
|
|
@@ -29679,7 +29680,7 @@ class Es {
|
|
|
29679
29680
|
_reconstructActiveFormattingElements() {
|
|
29680
29681
|
const t = this.activeFormattingElements.entries.length;
|
|
29681
29682
|
if (t) {
|
|
29682
|
-
const u = this.activeFormattingElements.entries.findIndex((a) => a.type === te
|
|
29683
|
+
const u = this.activeFormattingElements.entries.findIndex((a) => a.type === te.Marker || this.openElements.contains(a.element)), r = u === -1 ? t - 1 : u - 1;
|
|
29683
29684
|
for (let a = r; a >= 0; a--) {
|
|
29684
29685
|
const i = this.activeFormattingElements.entries[a];
|
|
29685
29686
|
this._insertElement(i.token, this.treeAdapter.getNamespaceURI(i.element)), i.element = this.openElements.current;
|
|
@@ -29867,7 +29868,7 @@ class Es {
|
|
|
29867
29868
|
break;
|
|
29868
29869
|
}
|
|
29869
29870
|
case l.IN_COLUMN_GROUP: {
|
|
29870
|
-
_t
|
|
29871
|
+
_t(this, t);
|
|
29871
29872
|
break;
|
|
29872
29873
|
}
|
|
29873
29874
|
case l.AFTER_BODY: {
|
|
@@ -29922,7 +29923,7 @@ class Es {
|
|
|
29922
29923
|
break;
|
|
29923
29924
|
}
|
|
29924
29925
|
case l.IN_COLUMN_GROUP: {
|
|
29925
|
-
_t
|
|
29926
|
+
_t(this, t);
|
|
29926
29927
|
break;
|
|
29927
29928
|
}
|
|
29928
29929
|
case l.AFTER_BODY: {
|
|
@@ -30032,7 +30033,7 @@ class Es {
|
|
|
30032
30033
|
break;
|
|
30033
30034
|
}
|
|
30034
30035
|
case l.IN_HEAD: {
|
|
30035
|
-
J
|
|
30036
|
+
J(this, t);
|
|
30036
30037
|
break;
|
|
30037
30038
|
}
|
|
30038
30039
|
case l.IN_HEAD_NO_SCRIPT: {
|
|
@@ -30342,7 +30343,7 @@ function Bc(e, t) {
|
|
|
30342
30343
|
return e.openElements.replace(t.element, r), t.element = r, r;
|
|
30343
30344
|
}
|
|
30344
30345
|
function Uc(e, t, u) {
|
|
30345
|
-
const r = e.treeAdapter.getTagName(t), a = yt
|
|
30346
|
+
const r = e.treeAdapter.getTagName(t), a = yt(r);
|
|
30346
30347
|
if (e._isElementCausesFosterParenting(a))
|
|
30347
30348
|
e._fosterParentElement(u);
|
|
30348
30349
|
else {
|
|
@@ -30429,7 +30430,7 @@ function Gc(e, t) {
|
|
|
30429
30430
|
function je(e, t) {
|
|
30430
30431
|
e._insertFakeElement(p.HEAD, s.HEAD), e.headElement = e.openElements.current, e.insertionMode = l.IN_HEAD, e._processToken(t);
|
|
30431
30432
|
}
|
|
30432
|
-
function J
|
|
30433
|
+
function J(e, t) {
|
|
30433
30434
|
switch (t.tagID) {
|
|
30434
30435
|
case s.HTML: {
|
|
30435
30436
|
G$1(e, t);
|
|
@@ -30511,7 +30512,7 @@ function zc(e, t) {
|
|
|
30511
30512
|
case s.META:
|
|
30512
30513
|
case s.NOFRAMES:
|
|
30513
30514
|
case s.STYLE: {
|
|
30514
|
-
J
|
|
30515
|
+
J(e, t);
|
|
30515
30516
|
break;
|
|
30516
30517
|
}
|
|
30517
30518
|
case s.NOSCRIPT: {
|
|
@@ -30564,7 +30565,7 @@ function Kc(e, t) {
|
|
|
30564
30565
|
case s.STYLE:
|
|
30565
30566
|
case s.TEMPLATE:
|
|
30566
30567
|
case s.TITLE: {
|
|
30567
|
-
e._err(t, b.abandonedHeadElementChild), e.openElements.push(e.headElement, s.HEAD), J
|
|
30568
|
+
e._err(t, b.abandonedHeadElementChild), e.openElements.push(e.headElement, s.HEAD), J(e, t), e.openElements.remove(e.headElement);
|
|
30568
30569
|
break;
|
|
30569
30570
|
}
|
|
30570
30571
|
case s.HEAD: {
|
|
@@ -30853,7 +30854,7 @@ function G$1(e, t) {
|
|
|
30853
30854
|
case s.BGSOUND:
|
|
30854
30855
|
case s.BASEFONT:
|
|
30855
30856
|
case s.TEMPLATE: {
|
|
30856
|
-
J
|
|
30857
|
+
J(e, t);
|
|
30857
30858
|
break;
|
|
30858
30859
|
}
|
|
30859
30860
|
case s.BODY: {
|
|
@@ -31160,7 +31161,7 @@ function Re(e, t) {
|
|
|
31160
31161
|
case s.STYLE:
|
|
31161
31162
|
case s.SCRIPT:
|
|
31162
31163
|
case s.TEMPLATE: {
|
|
31163
|
-
J
|
|
31164
|
+
J(e, t);
|
|
31164
31165
|
break;
|
|
31165
31166
|
}
|
|
31166
31167
|
case s.COL: {
|
|
@@ -31282,11 +31283,11 @@ function Lu(e, t) {
|
|
|
31282
31283
|
break;
|
|
31283
31284
|
}
|
|
31284
31285
|
case s.TEMPLATE: {
|
|
31285
|
-
J
|
|
31286
|
+
J(e, t);
|
|
31286
31287
|
break;
|
|
31287
31288
|
}
|
|
31288
31289
|
default:
|
|
31289
|
-
_t
|
|
31290
|
+
_t(e, t);
|
|
31290
31291
|
}
|
|
31291
31292
|
}
|
|
31292
31293
|
function z0(e, t) {
|
|
@@ -31302,10 +31303,10 @@ function z0(e, t) {
|
|
|
31302
31303
|
case s.COL:
|
|
31303
31304
|
break;
|
|
31304
31305
|
default:
|
|
31305
|
-
_t
|
|
31306
|
+
_t(e, t);
|
|
31306
31307
|
}
|
|
31307
31308
|
}
|
|
31308
|
-
function _t
|
|
31309
|
+
function _t(e, t) {
|
|
31309
31310
|
e.openElements.currentTagId === s.COLGROUP && (e.openElements.pop(), e.insertionMode = l.IN_TABLE, e._processToken(t));
|
|
31310
31311
|
}
|
|
31311
31312
|
function Rt(e, t) {
|
|
@@ -31464,7 +31465,7 @@ function Cs(e, t) {
|
|
|
31464
31465
|
}
|
|
31465
31466
|
case s.SCRIPT:
|
|
31466
31467
|
case s.TEMPLATE: {
|
|
31467
|
-
J
|
|
31468
|
+
J(e, t);
|
|
31468
31469
|
break;
|
|
31469
31470
|
}
|
|
31470
31471
|
}
|
|
@@ -31510,7 +31511,7 @@ function J0(e, t) {
|
|
|
31510
31511
|
case s.STYLE:
|
|
31511
31512
|
case s.TEMPLATE:
|
|
31512
31513
|
case s.TITLE: {
|
|
31513
|
-
J
|
|
31514
|
+
J(e, t);
|
|
31514
31515
|
break;
|
|
31515
31516
|
}
|
|
31516
31517
|
// Re-process the token in the appropriate mode
|
|
@@ -31577,7 +31578,7 @@ function ud(e, t) {
|
|
|
31577
31578
|
break;
|
|
31578
31579
|
}
|
|
31579
31580
|
case s.NOFRAMES: {
|
|
31580
|
-
J
|
|
31581
|
+
J(e, t);
|
|
31581
31582
|
break;
|
|
31582
31583
|
}
|
|
31583
31584
|
}
|
|
@@ -31592,7 +31593,7 @@ function sd(e, t) {
|
|
|
31592
31593
|
break;
|
|
31593
31594
|
}
|
|
31594
31595
|
case s.NOFRAMES: {
|
|
31595
|
-
J
|
|
31596
|
+
J(e, t);
|
|
31596
31597
|
break;
|
|
31597
31598
|
}
|
|
31598
31599
|
}
|
|
@@ -31613,7 +31614,7 @@ function nd(e, t) {
|
|
|
31613
31614
|
break;
|
|
31614
31615
|
}
|
|
31615
31616
|
case s.NOFRAMES: {
|
|
31616
|
-
J
|
|
31617
|
+
J(e, t);
|
|
31617
31618
|
break;
|
|
31618
31619
|
}
|
|
31619
31620
|
}
|
|
@@ -32176,20 +32177,20 @@ const Ld = (e) => {
|
|
|
32176
32177
|
if (r?.debug(
|
|
32177
32178
|
`extractField: Found ${h.length} elements for selector "${c}"`
|
|
32178
32179
|
), h.each((m, f) => {
|
|
32179
|
-
let
|
|
32180
|
+
let T;
|
|
32180
32181
|
switch (i) {
|
|
32181
32182
|
case "attr":
|
|
32182
|
-
|
|
32183
|
+
T = t(f).attr(e.attr || "href") || "";
|
|
32183
32184
|
break;
|
|
32184
32185
|
case "html":
|
|
32185
|
-
|
|
32186
|
+
T = t(f).html() || "";
|
|
32186
32187
|
break;
|
|
32187
32188
|
case "text":
|
|
32188
32189
|
default:
|
|
32189
|
-
|
|
32190
|
+
T = t(f).text().trim();
|
|
32190
32191
|
break;
|
|
32191
32192
|
}
|
|
32192
|
-
|
|
32193
|
+
T && n.push(T);
|
|
32193
32194
|
}), !e.multiple && n.length > 0)
|
|
32194
32195
|
break;
|
|
32195
32196
|
}
|
|
@@ -32434,20 +32435,20 @@ const Ld = (e) => {
|
|
|
32434
32435
|
}, a = u.displayFields || r, i = (y) => {
|
|
32435
32436
|
const W2 = e[y];
|
|
32436
32437
|
return typeof W2 == "string" ? W2 : void 0;
|
|
32437
|
-
}, n = fr(i("title") || "Untitled"), c = i("description") || "", h = i("image") || "", m = i("favicon"), f = u.useMetadataUrlLink && i("url") || t,
|
|
32438
|
+
}, n = fr(i("title") || "Untitled"), c = i("description") || "", h = i("image") || "", m = i("favicon"), f = u.useMetadataUrlLink && i("url") || t, T = i("siteName") || Bs(f), A2 = pr(n, 80), w = pr(fr(c), 160), v = [];
|
|
32438
32439
|
h && a.image !== void 0 && v.push({
|
|
32439
32440
|
order: a.image,
|
|
32440
32441
|
section: "image",
|
|
32441
32442
|
html: At(
|
|
32442
32443
|
j$1(h),
|
|
32443
|
-
j$1(
|
|
32444
|
+
j$1(A2),
|
|
32444
32445
|
"card-image",
|
|
32445
32446
|
void 0,
|
|
32446
32447
|
'loading="lazy"'
|
|
32447
32448
|
)
|
|
32448
32449
|
});
|
|
32449
|
-
let
|
|
32450
|
-
m && a.favicon !== void 0 && (
|
|
32450
|
+
let S = "";
|
|
32451
|
+
m && a.favicon !== void 0 && (S = ou(
|
|
32451
32452
|
j$1(m),
|
|
32452
32453
|
"",
|
|
32453
32454
|
void 0,
|
|
@@ -32458,14 +32459,14 @@ const Ld = (e) => {
|
|
|
32458
32459
|
order: a.title,
|
|
32459
32460
|
section: "header",
|
|
32460
32461
|
isHeader: true,
|
|
32461
|
-
html: `<div class="card-title">${j$1(
|
|
32462
|
+
html: `<div class="card-title">${j$1(A2)}</div>`
|
|
32462
32463
|
}), a.siteName !== void 0 && U2.push({
|
|
32463
32464
|
order: a.siteName,
|
|
32464
32465
|
section: "header",
|
|
32465
32466
|
isHeader: true,
|
|
32466
32467
|
html: `<div class="card-provider">
|
|
32467
|
-
${a.favicon !== void 0 ?
|
|
32468
|
-
<span>${j$1(
|
|
32468
|
+
${a.favicon !== void 0 ? S : ""}
|
|
32469
|
+
<span>${j$1(T)}</span>
|
|
32469
32470
|
</div>`
|
|
32470
32471
|
}), w && a.description !== void 0 && v.push({
|
|
32471
32472
|
order: a.description,
|
|
@@ -32562,26 +32563,26 @@ const Ld = (e) => {
|
|
|
32562
32563
|
};
|
|
32563
32564
|
/*!
|
|
32564
32565
|
* name: mark-deco
|
|
32565
|
-
* version: 0.
|
|
32566
|
+
* version: 0.8.0
|
|
32566
32567
|
* description: Flexible Markdown to HTML conversion library
|
|
32567
32568
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
32568
32569
|
* license: MIT
|
|
32569
32570
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
32570
|
-
* git.commit.hash:
|
|
32571
|
+
* git.commit.hash: cc985acbf6dd451ba9668a6c148f9e041c1032c5
|
|
32571
32572
|
*/
|
|
32572
|
-
function
|
|
32573
|
-
const t = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/,
|
|
32574
|
-
if (!
|
|
32573
|
+
function B(e) {
|
|
32574
|
+
const t = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/, n = e.match(t);
|
|
32575
|
+
if (!n)
|
|
32575
32576
|
return {
|
|
32576
32577
|
data: {},
|
|
32577
32578
|
content: e
|
|
32578
32579
|
};
|
|
32579
|
-
const o2 =
|
|
32580
|
+
const o2 = n[1] || "", r = e.slice(n[0].length);
|
|
32580
32581
|
try {
|
|
32581
|
-
const s2 = load(o2);
|
|
32582
|
+
const s2 = load(o2, { schema: JSON_SCHEMA });
|
|
32582
32583
|
return {
|
|
32583
32584
|
data: s2 && typeof s2 == "object" && !Array.isArray(s2) ? s2 : {},
|
|
32584
|
-
content:
|
|
32585
|
+
content: r
|
|
32585
32586
|
};
|
|
32586
32587
|
} catch (s2) {
|
|
32587
32588
|
const h = s2 instanceof Error ? s2.message : "Unknown YAML parsing error";
|
|
@@ -32597,175 +32598,175 @@ function gt(e) {
|
|
|
32597
32598
|
`;
|
|
32598
32599
|
}
|
|
32599
32600
|
function wt(e, t) {
|
|
32600
|
-
const
|
|
32601
|
+
const n = t ?? "";
|
|
32601
32602
|
return `${`---
|
|
32602
32603
|
${gt(e)}---
|
|
32603
|
-
`}${
|
|
32604
|
+
`}${n}`;
|
|
32604
32605
|
}
|
|
32605
|
-
const
|
|
32606
|
+
const P = () => {
|
|
32606
32607
|
}, vt = {
|
|
32607
|
-
debug:
|
|
32608
|
-
info:
|
|
32609
|
-
warn:
|
|
32610
|
-
error:
|
|
32611
|
-
},
|
|
32608
|
+
debug: P,
|
|
32609
|
+
info: P,
|
|
32610
|
+
warn: P,
|
|
32611
|
+
error: P
|
|
32612
|
+
}, Et = {
|
|
32612
32613
|
debug: console.debug,
|
|
32613
32614
|
info: console.info,
|
|
32614
32615
|
warn: console.warn,
|
|
32615
32616
|
error: console.error
|
|
32616
|
-
},
|
|
32617
|
-
const t = {},
|
|
32617
|
+
}, kt = () => vt, Kt = () => Et, H = (e) => {
|
|
32618
|
+
const t = {}, n = e.slice(1, -1).trim(), o2 = n.match(/\.([a-zA-Z0-9_-]+)/g);
|
|
32618
32619
|
if (o2) {
|
|
32619
|
-
const h = o2.map((
|
|
32620
|
+
const h = o2.map((m) => m.slice(1));
|
|
32620
32621
|
t.class = h.join(" ");
|
|
32621
32622
|
}
|
|
32622
|
-
const
|
|
32623
|
-
|
|
32624
|
-
const s2 =
|
|
32623
|
+
const r = n.match(/#([a-zA-Z0-9_-]+)/);
|
|
32624
|
+
r && r[1] && (t.id = r[1]);
|
|
32625
|
+
const s2 = n.match(/([a-zA-Z0-9_-]+)=["']?([^"'\s]*)["']?/g);
|
|
32625
32626
|
if (s2)
|
|
32626
32627
|
for (const h of s2) {
|
|
32627
|
-
const [
|
|
32628
|
-
|
|
32628
|
+
const [m, d2] = h.split("=");
|
|
32629
|
+
m && d2 && m !== "class" && m !== "id" && (t[m] = d2.replace(/["']/g, ""));
|
|
32629
32630
|
}
|
|
32630
32631
|
return t;
|
|
32631
32632
|
}, bt = (e) => {
|
|
32632
|
-
const t = e.lang ? ` class="language-${e.lang}"` : "",
|
|
32633
|
-
return `<pre><code${t}>${
|
|
32633
|
+
const t = e.lang ? ` class="language-${e.lang}"` : "", n = e.value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
32634
|
+
return `<pre><code${t}>${n}</code></pre>`;
|
|
32634
32635
|
}, F = (e, t) => {
|
|
32635
|
-
e.data || (e.data = {}), e.data.hProperties || (e.data.hProperties = {}), Object.entries(t).forEach(([
|
|
32636
|
-
if (
|
|
32637
|
-
const
|
|
32638
|
-
|
|
32636
|
+
e.data || (e.data = {}), e.data.hProperties || (e.data.hProperties = {}), Object.entries(t).forEach(([n, o2]) => {
|
|
32637
|
+
if (n === "class") {
|
|
32638
|
+
const r = e.data.hProperties.class;
|
|
32639
|
+
r ? typeof r == "string" && r.startsWith("language-") ? e.data.hProperties.class = `${r} ${o2}` : e.data.hProperties.class = `${r} ${o2}` : e.data.hProperties.class = o2;
|
|
32639
32640
|
} else
|
|
32640
|
-
e.data.hProperties[
|
|
32641
|
+
e.data.hProperties[n] = o2;
|
|
32641
32642
|
});
|
|
32642
32643
|
}, $t = () => (e) => {
|
|
32643
|
-
visit(e, (t,
|
|
32644
|
+
visit(e, (t, n, o2) => {
|
|
32644
32645
|
if (t.type === "heading" && t.children?.length > 0) {
|
|
32645
|
-
const
|
|
32646
|
-
if (
|
|
32647
|
-
const s2 =
|
|
32646
|
+
const r = t.children[t.children.length - 1];
|
|
32647
|
+
if (r?.type === "text" && r.value) {
|
|
32648
|
+
const s2 = r.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
|
|
32648
32649
|
if (s2) {
|
|
32649
|
-
const h = s2[1].trim(),
|
|
32650
|
-
|
|
32650
|
+
const h = s2[1].trim(), m = s2[2], d2 = H(m);
|
|
32651
|
+
r.value = h, F(t, d2);
|
|
32651
32652
|
}
|
|
32652
32653
|
}
|
|
32653
32654
|
}
|
|
32654
32655
|
if (t.type === "paragraph" && t.children?.length > 0) {
|
|
32655
|
-
const
|
|
32656
|
-
if (
|
|
32657
|
-
const s2 =
|
|
32656
|
+
const r = t.children[t.children.length - 1];
|
|
32657
|
+
if (r?.type === "text" && r.value) {
|
|
32658
|
+
const s2 = r.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
|
|
32658
32659
|
if (s2) {
|
|
32659
|
-
const h = s2[1].trim(),
|
|
32660
|
-
|
|
32660
|
+
const h = s2[1].trim(), m = s2[2], d2 = H(m);
|
|
32661
|
+
r.value = h, F(t, d2);
|
|
32661
32662
|
}
|
|
32662
32663
|
}
|
|
32663
32664
|
}
|
|
32664
|
-
if (t.type === "link" && o2 && typeof
|
|
32665
|
-
const
|
|
32666
|
-
if (
|
|
32667
|
-
const s2 =
|
|
32665
|
+
if (t.type === "link" && o2 && typeof n == "number") {
|
|
32666
|
+
const r = o2.children[n + 1];
|
|
32667
|
+
if (r?.type === "text" && r.value) {
|
|
32668
|
+
const s2 = r.value.match(/^\s*(\{[^}]+\})/);
|
|
32668
32669
|
if (s2) {
|
|
32669
|
-
const h = s2[1],
|
|
32670
|
-
F(t,
|
|
32670
|
+
const h = s2[1], m = H(h);
|
|
32671
|
+
F(t, m), r.value = r.value.replace(s2[0], "");
|
|
32671
32672
|
}
|
|
32672
32673
|
}
|
|
32673
32674
|
}
|
|
32674
|
-
if (t.type === "image" && o2 && typeof
|
|
32675
|
-
const
|
|
32676
|
-
if (
|
|
32677
|
-
const s2 =
|
|
32675
|
+
if (t.type === "image" && o2 && typeof n == "number") {
|
|
32676
|
+
const r = o2.children[n + 1];
|
|
32677
|
+
if (r?.type === "text" && r.value) {
|
|
32678
|
+
const s2 = r.value.match(/^\s*(\{[^}]+\})/);
|
|
32678
32679
|
if (s2) {
|
|
32679
|
-
const h = s2[1],
|
|
32680
|
-
F(t,
|
|
32680
|
+
const h = s2[1], m = H(h);
|
|
32681
|
+
F(t, m), r.value = r.value.replace(s2[0], "");
|
|
32681
32682
|
}
|
|
32682
32683
|
}
|
|
32683
32684
|
}
|
|
32684
32685
|
if (t.type === "listItem" && t.children?.length > 0) {
|
|
32685
|
-
const
|
|
32686
|
-
if (
|
|
32687
|
-
const s2 =
|
|
32686
|
+
const r = t.children[t.children.length - 1];
|
|
32687
|
+
if (r?.type === "paragraph" && r.children?.length > 0) {
|
|
32688
|
+
const s2 = r.children[r.children.length - 1];
|
|
32688
32689
|
if (s2?.type === "text" && s2.value) {
|
|
32689
32690
|
const h = s2.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
|
|
32690
32691
|
if (h) {
|
|
32691
|
-
const
|
|
32692
|
-
s2.value =
|
|
32692
|
+
const m = h[1].trim(), d2 = h[2], c = H(d2);
|
|
32693
|
+
s2.value = m, F(t, c);
|
|
32693
32694
|
}
|
|
32694
32695
|
}
|
|
32695
32696
|
}
|
|
32696
32697
|
}
|
|
32697
|
-
if (t.type === "list" && o2 && typeof
|
|
32698
|
-
const
|
|
32699
|
-
if (
|
|
32700
|
-
const s2 =
|
|
32698
|
+
if (t.type === "list" && o2 && typeof n == "number") {
|
|
32699
|
+
const r = o2.children[n + 1];
|
|
32700
|
+
if (r?.type === "paragraph" && r.children?.length === 1) {
|
|
32701
|
+
const s2 = r.children[0];
|
|
32701
32702
|
if (s2?.type === "text" && s2.value) {
|
|
32702
32703
|
const h = s2.value.match(/^\s*(\{[^}]+\})\s*$/);
|
|
32703
32704
|
if (h) {
|
|
32704
|
-
const
|
|
32705
|
-
F(t, d2), o2.children.splice(
|
|
32705
|
+
const m = h[1], d2 = H(m);
|
|
32706
|
+
F(t, d2), o2.children.splice(n + 1, 1);
|
|
32706
32707
|
}
|
|
32707
32708
|
}
|
|
32708
32709
|
}
|
|
32709
32710
|
}
|
|
32710
32711
|
if (t.type === "blockquote" && t.children?.length > 0) {
|
|
32711
|
-
const
|
|
32712
|
-
if (
|
|
32713
|
-
const s2 =
|
|
32712
|
+
const r = t.children[t.children.length - 1];
|
|
32713
|
+
if (r?.type === "paragraph" && r.children?.length > 0) {
|
|
32714
|
+
const s2 = r.children[r.children.length - 1];
|
|
32714
32715
|
if (s2?.type === "text" && s2.value) {
|
|
32715
32716
|
const h = s2.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
|
|
32716
32717
|
if (h) {
|
|
32717
|
-
const
|
|
32718
|
-
s2.value =
|
|
32718
|
+
const m = h[1].trim(), d2 = h[2], c = H(d2);
|
|
32719
|
+
s2.value = m, F(t, c);
|
|
32719
32720
|
}
|
|
32720
32721
|
}
|
|
32721
32722
|
}
|
|
32722
32723
|
}
|
|
32723
|
-
if (t.type === "blockquote" && o2 && typeof
|
|
32724
|
-
const
|
|
32725
|
-
if (
|
|
32726
|
-
const s2 =
|
|
32724
|
+
if (t.type === "blockquote" && o2 && typeof n == "number") {
|
|
32725
|
+
const r = o2.children[n + 1];
|
|
32726
|
+
if (r?.type === "paragraph" && r.children?.length === 1) {
|
|
32727
|
+
const s2 = r.children[0];
|
|
32727
32728
|
if (s2?.type === "text" && s2.value) {
|
|
32728
32729
|
const h = s2.value.match(/^\s*(\{[^}]+\})\s*$/);
|
|
32729
32730
|
if (h) {
|
|
32730
|
-
const
|
|
32731
|
-
F(t, d2), o2.children.splice(
|
|
32731
|
+
const m = h[1], d2 = H(m);
|
|
32732
|
+
F(t, d2), o2.children.splice(n + 1, 1);
|
|
32732
32733
|
}
|
|
32733
32734
|
}
|
|
32734
32735
|
}
|
|
32735
32736
|
}
|
|
32736
|
-
if (t.type === "inlineCode" && o2 && typeof
|
|
32737
|
-
const
|
|
32738
|
-
if (
|
|
32739
|
-
const s2 =
|
|
32737
|
+
if (t.type === "inlineCode" && o2 && typeof n == "number") {
|
|
32738
|
+
const r = o2.children[n + 1];
|
|
32739
|
+
if (r?.type === "text" && r.value) {
|
|
32740
|
+
const s2 = r.value.match(/^\s*(\{[^}]+\})/);
|
|
32740
32741
|
if (s2) {
|
|
32741
|
-
const h = s2[1],
|
|
32742
|
-
F(t,
|
|
32742
|
+
const h = s2[1], m = H(h);
|
|
32743
|
+
F(t, m), r.value = r.value.replace(s2[0], "");
|
|
32743
32744
|
}
|
|
32744
32745
|
}
|
|
32745
32746
|
}
|
|
32746
32747
|
if (t.type === "code" && t.meta) {
|
|
32747
|
-
const
|
|
32748
|
-
if (
|
|
32749
|
-
const s2 = `{${
|
|
32748
|
+
const r = t.meta.match(/\{([^}]+)\}/);
|
|
32749
|
+
if (r) {
|
|
32750
|
+
const s2 = `{${r[1]}}`, h = H(s2), m = {
|
|
32750
32751
|
type: "html",
|
|
32751
32752
|
value: `<div class="${h.class || ""}" ${Object.entries(
|
|
32752
32753
|
h
|
|
32753
|
-
).filter(([d2]) => d2 !== "class").map(([d2,
|
|
32754
|
+
).filter(([d2]) => d2 !== "class").map(([d2, c]) => `${d2}="${c}"`).join(" ")}>${bt(t)}</div>`
|
|
32754
32755
|
};
|
|
32755
|
-
o2 && typeof
|
|
32756
|
+
o2 && typeof n == "number" && (o2.children[n] = m), t.meta = t.meta.replace(r[0], "").trim() || null;
|
|
32756
32757
|
}
|
|
32757
32758
|
}
|
|
32758
32759
|
});
|
|
32759
32760
|
}, St = () => (e) => {
|
|
32760
32761
|
visit(e, "element", (t) => {
|
|
32761
32762
|
if (t.tagName === "img") {
|
|
32762
|
-
const
|
|
32763
|
+
const n = Ys();
|
|
32763
32764
|
t.properties || (t.properties = {});
|
|
32764
|
-
const o2 = t.properties.style || "",
|
|
32765
|
-
t.properties.style =
|
|
32765
|
+
const o2 = t.properties.style || "", r = o2 ? `${o2}; ${n}` : n;
|
|
32766
|
+
t.properties.style = r;
|
|
32766
32767
|
}
|
|
32767
32768
|
});
|
|
32768
|
-
}, { html: xt } = Y$1,
|
|
32769
|
+
}, { html: xt } = Y$1, Ht = {
|
|
32769
32770
|
indent_size: 2,
|
|
32770
32771
|
indent_char: " ",
|
|
32771
32772
|
max_preserve_newlines: 2,
|
|
@@ -32777,46 +32778,29 @@ const T = () => {
|
|
|
32777
32778
|
unformatted: ["code", "pre", "textarea"],
|
|
32778
32779
|
content_unformatted: ["pre", "code", "textarea"],
|
|
32779
32780
|
extra_liners: []
|
|
32780
|
-
}, Ht = (e) => {
|
|
32781
|
-
const t = (r) => {
|
|
32782
|
-
if (r instanceof Date)
|
|
32783
|
-
return new Date(r.getTime());
|
|
32784
|
-
if (Array.isArray(r))
|
|
32785
|
-
return r.map(t);
|
|
32786
|
-
if (r && typeof r == "object") {
|
|
32787
|
-
const o2 = {};
|
|
32788
|
-
for (const [n, s2] of Object.entries(
|
|
32789
|
-
r
|
|
32790
|
-
))
|
|
32791
|
-
o2[n] = t(s2);
|
|
32792
|
-
return o2;
|
|
32793
|
-
}
|
|
32794
|
-
return r;
|
|
32795
|
-
};
|
|
32796
|
-
return t(e ?? {});
|
|
32797
32781
|
}, M = (e) => {
|
|
32798
32782
|
if (e instanceof Date)
|
|
32799
32783
|
return e.toISOString();
|
|
32800
32784
|
if (Array.isArray(e))
|
|
32801
32785
|
return e.map(M);
|
|
32802
32786
|
if (e && typeof e == "object") {
|
|
32803
|
-
const t = Object.entries(e).filter(([, o2]) => o2 !== void 0).sort(([o2], [
|
|
32804
|
-
for (const [o2,
|
|
32805
|
-
|
|
32806
|
-
return
|
|
32787
|
+
const t = Object.entries(e).filter(([, o2]) => o2 !== void 0).sort(([o2], [r]) => o2 < r ? -1 : o2 > r ? 1 : 0), n = {};
|
|
32788
|
+
for (const [o2, r] of t)
|
|
32789
|
+
n[o2] = M(r);
|
|
32790
|
+
return n;
|
|
32807
32791
|
}
|
|
32808
32792
|
return e;
|
|
32809
|
-
},
|
|
32810
|
-
const t = [],
|
|
32793
|
+
}, A = (e) => JSON.stringify(M(e ?? {})), U = (e) => e.type === "text" || e.type === "inlineCode" ? e.value || "" : e.children && Array.isArray(e.children) ? e.children.map(U).join("") : "", Ft = (e, t) => `${e}-${t.join("-")}`, Ct = (e) => {
|
|
32794
|
+
const t = [], n = [];
|
|
32811
32795
|
for (const o2 of e) {
|
|
32812
|
-
const
|
|
32813
|
-
for (;
|
|
32814
|
-
|
|
32815
|
-
for (;
|
|
32816
|
-
|
|
32817
|
-
const s2 =
|
|
32818
|
-
|
|
32819
|
-
const h =
|
|
32796
|
+
const r = o2.level;
|
|
32797
|
+
for (; n.length > r; )
|
|
32798
|
+
n.pop();
|
|
32799
|
+
for (; n.length < r; )
|
|
32800
|
+
n.push(0);
|
|
32801
|
+
const s2 = r - 1;
|
|
32802
|
+
n[s2] = (n[s2] || 0) + 1;
|
|
32803
|
+
const h = n.slice(0, r);
|
|
32820
32804
|
t.push({
|
|
32821
32805
|
level: o2.level,
|
|
32822
32806
|
text: o2.text,
|
|
@@ -32824,242 +32808,262 @@ const T = () => {
|
|
|
32824
32808
|
});
|
|
32825
32809
|
}
|
|
32826
32810
|
return t;
|
|
32827
|
-
}, K = (e, t,
|
|
32811
|
+
}, K = (e, t, n) => {
|
|
32828
32812
|
const o2 = jd(t);
|
|
32829
|
-
return o2 !== void 0 ? `${e}-${o2}` :
|
|
32813
|
+
return o2 !== void 0 ? `${e}-${o2}` : n();
|
|
32830
32814
|
}, It = (e) => {
|
|
32831
|
-
const t = [],
|
|
32815
|
+
const t = [], n = [];
|
|
32832
32816
|
for (const o2 of e) {
|
|
32833
|
-
const
|
|
32817
|
+
const r = {
|
|
32834
32818
|
level: o2.level,
|
|
32835
32819
|
text: o2.text,
|
|
32836
32820
|
id: o2.id,
|
|
32837
32821
|
children: []
|
|
32838
32822
|
};
|
|
32839
|
-
for (;
|
|
32840
|
-
const s2 =
|
|
32823
|
+
for (; n.length > 0; ) {
|
|
32824
|
+
const s2 = n[n.length - 1];
|
|
32841
32825
|
if (s2 && s2.level >= o2.level)
|
|
32842
|
-
|
|
32826
|
+
n.pop();
|
|
32843
32827
|
else
|
|
32844
32828
|
break;
|
|
32845
32829
|
}
|
|
32846
|
-
if (
|
|
32847
|
-
t.push(
|
|
32830
|
+
if (n.length === 0)
|
|
32831
|
+
t.push(r);
|
|
32848
32832
|
else {
|
|
32849
|
-
const s2 =
|
|
32850
|
-
s2 && s2.children.push(
|
|
32833
|
+
const s2 = n[n.length - 1];
|
|
32834
|
+
s2 && s2.children.push(r);
|
|
32851
32835
|
}
|
|
32852
|
-
|
|
32836
|
+
n.push(r);
|
|
32853
32837
|
}
|
|
32854
32838
|
return t;
|
|
32855
|
-
},
|
|
32856
|
-
const { plugins: t = [], logger:
|
|
32839
|
+
}, Wt = (e) => {
|
|
32840
|
+
const { plugins: t = [], logger: n = kt(), fetcher: o2 } = e, r = /* @__PURE__ */ new Map();
|
|
32857
32841
|
for (const a of t) {
|
|
32858
|
-
if (
|
|
32842
|
+
if (r.has(a.name))
|
|
32859
32843
|
throw new Error(
|
|
32860
32844
|
`Plugin with name '${a.name}' is already registered`
|
|
32861
32845
|
);
|
|
32862
|
-
|
|
32863
|
-
}
|
|
32864
|
-
const s2 = async (a,
|
|
32865
|
-
const
|
|
32866
|
-
return
|
|
32867
|
-
}, h = (a,
|
|
32868
|
-
const
|
|
32869
|
-
logger:
|
|
32870
|
-
signal:
|
|
32846
|
+
r.set(a.name, a);
|
|
32847
|
+
}
|
|
32848
|
+
const s2 = async (a, f, u) => {
|
|
32849
|
+
const p2 = r.get(a);
|
|
32850
|
+
return p2 ? await p2.processBlock(f, u) : `<pre><code class="language-${a}">${R(f)}</code></pre>`;
|
|
32851
|
+
}, h = (a, f, u) => {
|
|
32852
|
+
const p2 = {
|
|
32853
|
+
logger: n,
|
|
32854
|
+
signal: f,
|
|
32871
32855
|
frontmatter: a,
|
|
32872
|
-
getUniqueId:
|
|
32856
|
+
getUniqueId: u,
|
|
32873
32857
|
fetcher: o2
|
|
32874
32858
|
};
|
|
32875
|
-
return () => async (
|
|
32876
|
-
const
|
|
32859
|
+
return () => async (y) => {
|
|
32860
|
+
const g2 = [];
|
|
32877
32861
|
visit(
|
|
32878
|
-
|
|
32862
|
+
y,
|
|
32879
32863
|
"code",
|
|
32880
|
-
(
|
|
32881
|
-
if (!
|
|
32864
|
+
(w, E2, k2) => {
|
|
32865
|
+
if (!w.lang || !r.has(w.lang))
|
|
32882
32866
|
return;
|
|
32883
|
-
const
|
|
32867
|
+
const b2 = (async () => {
|
|
32884
32868
|
const v = {
|
|
32885
32869
|
type: "html",
|
|
32886
32870
|
value: await s2(
|
|
32887
|
-
|
|
32888
|
-
|
|
32889
|
-
|
|
32871
|
+
w.lang,
|
|
32872
|
+
w.value,
|
|
32873
|
+
p2
|
|
32890
32874
|
)
|
|
32891
32875
|
};
|
|
32892
|
-
|
|
32876
|
+
k2 && typeof E2 == "number" && (k2.children[E2] = v);
|
|
32893
32877
|
})();
|
|
32894
|
-
|
|
32878
|
+
g2.push(b2);
|
|
32895
32879
|
}
|
|
32896
|
-
), await Promise.all(
|
|
32880
|
+
), await Promise.all(g2);
|
|
32897
32881
|
};
|
|
32898
|
-
},
|
|
32899
|
-
const
|
|
32900
|
-
visit(
|
|
32901
|
-
v.depth >= 1 && v.depth <= 6 &&
|
|
32882
|
+
}, m = (a, f, u = false, p2 = false, y = "") => () => (g2) => {
|
|
32883
|
+
const w = [], E2 = [];
|
|
32884
|
+
visit(g2, "heading", (v) => {
|
|
32885
|
+
v.depth >= 1 && v.depth <= 6 && E2.push(v);
|
|
32902
32886
|
});
|
|
32903
|
-
let
|
|
32904
|
-
if (
|
|
32905
|
-
const v =
|
|
32906
|
-
level:
|
|
32907
|
-
text: U(
|
|
32887
|
+
let k2 = [];
|
|
32888
|
+
if (u) {
|
|
32889
|
+
const v = E2.map((L2) => ({
|
|
32890
|
+
level: L2.depth,
|
|
32891
|
+
text: U(L2)
|
|
32908
32892
|
}));
|
|
32909
|
-
|
|
32910
|
-
}
|
|
32911
|
-
const
|
|
32912
|
-
|
|
32913
|
-
const
|
|
32914
|
-
let
|
|
32915
|
-
if (
|
|
32916
|
-
|
|
32917
|
-
else if (
|
|
32918
|
-
const
|
|
32919
|
-
|
|
32920
|
-
|
|
32921
|
-
() =>
|
|
32922
|
-
).replace(`${
|
|
32923
|
-
for (;
|
|
32924
|
-
const
|
|
32925
|
-
if (
|
|
32926
|
-
|
|
32893
|
+
k2 = Ct(v);
|
|
32894
|
+
}
|
|
32895
|
+
const b2 = [];
|
|
32896
|
+
E2.forEach((v, L2) => {
|
|
32897
|
+
const C2 = U(v), N2 = v.data?.hProperties?.id;
|
|
32898
|
+
let S;
|
|
32899
|
+
if (N2)
|
|
32900
|
+
S = N2;
|
|
32901
|
+
else if (u && p2) {
|
|
32902
|
+
const I2 = K(
|
|
32903
|
+
y,
|
|
32904
|
+
C2,
|
|
32905
|
+
() => f(C2)
|
|
32906
|
+
).replace(`${y}-`, "");
|
|
32907
|
+
for (; b2.length > 0; ) {
|
|
32908
|
+
const x2 = b2[b2.length - 1];
|
|
32909
|
+
if (x2 && x2.level >= v.depth)
|
|
32910
|
+
b2.pop();
|
|
32927
32911
|
else
|
|
32928
32912
|
break;
|
|
32929
32913
|
}
|
|
32930
|
-
const
|
|
32931
|
-
|
|
32914
|
+
const T = b2.map((x2) => x2.contentId);
|
|
32915
|
+
S = T.length > 0 ? `${y}-${T.join("-")}-${I2}` : `${y}-${I2}`, b2.push({
|
|
32932
32916
|
level: v.depth,
|
|
32933
|
-
contentId:
|
|
32917
|
+
contentId: I2
|
|
32934
32918
|
});
|
|
32935
|
-
} else if (
|
|
32936
|
-
const
|
|
32937
|
-
|
|
32938
|
-
|
|
32939
|
-
|
|
32940
|
-
) :
|
|
32919
|
+
} else if (u && L2 < k2.length) {
|
|
32920
|
+
const I2 = k2[L2];
|
|
32921
|
+
I2 ? S = Ft(
|
|
32922
|
+
y,
|
|
32923
|
+
I2.numbers
|
|
32924
|
+
) : S = f(C2);
|
|
32941
32925
|
} else
|
|
32942
|
-
|
|
32943
|
-
v.data || (v.data = {}), v.data.hProperties || (v.data.hProperties = {}),
|
|
32926
|
+
S = f(C2);
|
|
32927
|
+
v.data || (v.data = {}), v.data.hProperties || (v.data.hProperties = {}), N2 || (v.data.hProperties.id = S), w.push({
|
|
32944
32928
|
level: v.depth,
|
|
32945
|
-
text:
|
|
32946
|
-
id:
|
|
32929
|
+
text: C2,
|
|
32930
|
+
id: S
|
|
32947
32931
|
});
|
|
32948
32932
|
});
|
|
32949
|
-
const
|
|
32950
|
-
a.push(...
|
|
32933
|
+
const O2 = It(w);
|
|
32934
|
+
a.push(...O2);
|
|
32935
|
+
}, d2 = (a) => {
|
|
32936
|
+
throw n.error(
|
|
32937
|
+
`Failed to process markdown: ${a instanceof Error ? a.message : "Unknown error"}`
|
|
32938
|
+
), new Error(
|
|
32939
|
+
`Failed to process markdown: ${a instanceof Error ? a.message : "Unknown error"}`
|
|
32940
|
+
);
|
|
32941
|
+
}, c = async (a, f, u, p2, y, g2) => {
|
|
32942
|
+
const {
|
|
32943
|
+
signal: w,
|
|
32944
|
+
useContentStringHeaderId: E2 = false,
|
|
32945
|
+
useHierarchicalHeadingId: k2 = true,
|
|
32946
|
+
advancedOptions: b2
|
|
32947
|
+
} = u ?? {}, {
|
|
32948
|
+
allowDangerousHtml: O2 = true,
|
|
32949
|
+
htmlOptions: v = Ht,
|
|
32950
|
+
gfmOptions: L2 = {},
|
|
32951
|
+
remarkPlugins: C2 = [],
|
|
32952
|
+
rehypePlugins: N2 = []
|
|
32953
|
+
} = b2 || {}, S = [];
|
|
32954
|
+
let I2 = 0;
|
|
32955
|
+
const T = () => `${f}-${++I2}`;
|
|
32956
|
+
let _2 = unified().use(remarkParse);
|
|
32957
|
+
if (C2)
|
|
32958
|
+
for (const $2 of C2)
|
|
32959
|
+
Array.isArray($2) ? _2 = _2.use($2[0], $2[1]) : _2 = _2.use($2);
|
|
32960
|
+
let x2 = _2.use(remarkGfm, L2).use($t).use(
|
|
32961
|
+
m(
|
|
32962
|
+
S,
|
|
32963
|
+
E2 ? ($2) => K(f, $2, T) : T,
|
|
32964
|
+
k2,
|
|
32965
|
+
E2,
|
|
32966
|
+
f
|
|
32967
|
+
)
|
|
32968
|
+
).use(h(p2, w, T)).use(remarkRehype, { allowDangerousHtml: O2 }).use(St).use(rehypeStringify, { allowDangerousHtml: O2 });
|
|
32969
|
+
if (N2)
|
|
32970
|
+
for (const $2 of N2)
|
|
32971
|
+
Array.isArray($2) ? x2 = x2.use($2[0], $2[1]) : x2 = x2.use($2);
|
|
32972
|
+
const Z2 = await x2.process(y), X2 = String(Z2);
|
|
32973
|
+
return {
|
|
32974
|
+
html: xt(X2, v),
|
|
32975
|
+
frontmatter: p2,
|
|
32976
|
+
changed: g2,
|
|
32977
|
+
headingTree: S,
|
|
32978
|
+
composeMarkdown: () => g2 ? wt(p2, y) : a
|
|
32979
|
+
};
|
|
32951
32980
|
};
|
|
32952
32981
|
return {
|
|
32953
|
-
process: async (a,
|
|
32954
|
-
signal: i,
|
|
32955
|
-
useContentStringHeaderId: l2 = false,
|
|
32956
|
-
useHierarchicalHeadingId: f = true,
|
|
32957
|
-
advancedOptions: u,
|
|
32958
|
-
frontmatterTransform: m
|
|
32959
|
-
} = {}) => {
|
|
32960
|
-
const {
|
|
32961
|
-
allowDangerousHtml: y = true,
|
|
32962
|
-
htmlOptions: w = Ft,
|
|
32963
|
-
gfmOptions: g2 = {},
|
|
32964
|
-
remarkPlugins: E2 = [],
|
|
32965
|
-
rehypePlugins: v = []
|
|
32966
|
-
} = u || {};
|
|
32982
|
+
process: async (a, f, u = {}) => {
|
|
32967
32983
|
try {
|
|
32968
|
-
const
|
|
32969
|
-
|
|
32970
|
-
|
|
32971
|
-
|
|
32972
|
-
|
|
32973
|
-
|
|
32974
|
-
|
|
32975
|
-
|
|
32976
|
-
|
|
32977
|
-
|
|
32978
|
-
|
|
32979
|
-
|
|
32980
|
-
|
|
32981
|
-
|
|
32982
|
-
|
|
32983
|
-
|
|
32984
|
-
|
|
32985
|
-
|
|
32986
|
-
|
|
32987
|
-
|
|
32988
|
-
|
|
32989
|
-
|
|
32990
|
-
|
|
32991
|
-
|
|
32992
|
-
|
|
32993
|
-
|
|
32994
|
-
|
|
32995
|
-
|
|
32996
|
-
|
|
32997
|
-
Array.isArray(k2) ? N2 = N2.use(k2[0], k2[1]) : N2 = N2.use(k2);
|
|
32998
|
-
const Z2 = await N2.process(C2), X2 = String(Z2);
|
|
32999
|
-
return {
|
|
33000
|
-
html: xt(X2, w),
|
|
33001
|
-
frontmatter: $2,
|
|
33002
|
-
changed: O2,
|
|
33003
|
-
headingTree: P2,
|
|
33004
|
-
composeMarkdown: () => O2 ? wt($2, C2) : b2
|
|
33005
|
-
};
|
|
33006
|
-
} catch (b2) {
|
|
33007
|
-
throw r.error(
|
|
33008
|
-
`Failed to process markdown: ${b2 instanceof Error ? b2.message : "Unknown error"}`
|
|
33009
|
-
), new Error(
|
|
33010
|
-
`Failed to process markdown: ${b2 instanceof Error ? b2.message : "Unknown error"}`
|
|
32984
|
+
const { data: p2, content: y } = B(a);
|
|
32985
|
+
return await c(
|
|
32986
|
+
a,
|
|
32987
|
+
f,
|
|
32988
|
+
u,
|
|
32989
|
+
p2,
|
|
32990
|
+
y,
|
|
32991
|
+
false
|
|
32992
|
+
);
|
|
32993
|
+
} catch (p2) {
|
|
32994
|
+
return d2(p2);
|
|
32995
|
+
}
|
|
32996
|
+
},
|
|
32997
|
+
processWithFrontmatterTransform: async (a, f, u, p2 = {}) => {
|
|
32998
|
+
try {
|
|
32999
|
+
const { data: y, content: g2 } = B(a), w = A(y), k2 = u({
|
|
33000
|
+
originalFrontmatter: y,
|
|
33001
|
+
markdownContent: g2
|
|
33002
|
+
});
|
|
33003
|
+
if (k2 === void 0)
|
|
33004
|
+
return;
|
|
33005
|
+
const b2 = k2, O2 = A(k2 === y ? y : k2) !== w;
|
|
33006
|
+
return await c(
|
|
33007
|
+
a,
|
|
33008
|
+
f,
|
|
33009
|
+
p2,
|
|
33010
|
+
b2,
|
|
33011
|
+
g2,
|
|
33012
|
+
O2
|
|
33011
33013
|
);
|
|
33014
|
+
} catch (y) {
|
|
33015
|
+
return d2(y);
|
|
33012
33016
|
}
|
|
33013
33017
|
}
|
|
33014
33018
|
};
|
|
33015
|
-
},
|
|
33016
|
-
const { maxRedirects:
|
|
33019
|
+
}, Gt = (e, t = {}) => {
|
|
33020
|
+
const { maxRedirects: n = 5, timeoutEachRedirect: o2 = 1e4 } = t;
|
|
33017
33021
|
return {
|
|
33018
33022
|
name: "oembed",
|
|
33019
33023
|
processBlock: async (s2, h) => {
|
|
33020
|
-
const
|
|
33021
|
-
if (!qd(
|
|
33022
|
-
throw new Error(`Invalid URL: ${
|
|
33024
|
+
const m = s2.trim();
|
|
33025
|
+
if (!qd(m))
|
|
33026
|
+
throw new Error(`Invalid URL: ${m}`);
|
|
33023
33027
|
try {
|
|
33024
33028
|
const d2 = await Gd(
|
|
33025
|
-
|
|
33026
|
-
|
|
33029
|
+
m,
|
|
33030
|
+
n,
|
|
33027
33031
|
o2,
|
|
33028
33032
|
h,
|
|
33029
33033
|
e
|
|
33030
33034
|
);
|
|
33031
|
-
return Wd(d2,
|
|
33035
|
+
return Wd(d2, m, t);
|
|
33032
33036
|
} catch (d2) {
|
|
33033
|
-
h.logger.warn("oEmbed fetch failed for URL:",
|
|
33034
|
-
const
|
|
33035
|
-
return typeof window < "u" ? Xs(
|
|
33037
|
+
h.logger.warn("oEmbed fetch failed for URL:", m, d2);
|
|
33038
|
+
const c = Vd(d2);
|
|
33039
|
+
return typeof window < "u" ? Xs(m, c) : Xs(m, c);
|
|
33036
33040
|
}
|
|
33037
33041
|
}
|
|
33038
33042
|
};
|
|
33039
33043
|
}, Qt = (e = {}) => ({
|
|
33040
33044
|
name: "card",
|
|
33041
|
-
processBlock: async (
|
|
33042
|
-
const
|
|
33043
|
-
if (!Xd(
|
|
33044
|
-
throw new Error(`Invalid URL: ${
|
|
33045
|
+
processBlock: async (n, o2) => {
|
|
33046
|
+
const r = n.trim();
|
|
33047
|
+
if (!Xd(r))
|
|
33048
|
+
throw new Error(`Invalid URL: ${r}`);
|
|
33045
33049
|
try {
|
|
33046
|
-
const s2 = await Jd(
|
|
33047
|
-
return th(s2,
|
|
33050
|
+
const s2 = await Jd(r, e, o2);
|
|
33051
|
+
return th(s2, r, e);
|
|
33048
33052
|
} catch (s2) {
|
|
33049
|
-
o2.logger.warn("Card plugin fetch failed for URL:",
|
|
33053
|
+
o2.logger.warn("Card plugin fetch failed for URL:", r, s2);
|
|
33050
33054
|
const h = Vd(s2);
|
|
33051
|
-
return typeof window < "u" ? eh(
|
|
33055
|
+
return typeof window < "u" ? eh(r, h) : eh(r, h);
|
|
33052
33056
|
}
|
|
33053
33057
|
}
|
|
33054
|
-
}),
|
|
33055
|
-
const { className: t = "mermaid", includeId:
|
|
33058
|
+
}), Vt = (e = {}) => {
|
|
33059
|
+
const { className: t = "mermaid", includeId: n = true } = e;
|
|
33056
33060
|
return {
|
|
33057
33061
|
name: "mermaid",
|
|
33058
|
-
processBlock: async (
|
|
33059
|
-
const h =
|
|
33062
|
+
processBlock: async (r, s2) => {
|
|
33063
|
+
const h = r.trim();
|
|
33060
33064
|
if (!h) {
|
|
33061
33065
|
s2.logger.warn("Mermaid plugin received empty content");
|
|
33062
|
-
const
|
|
33066
|
+
const l2 = n ? ` id="${s2.getUniqueId()}"` : "";
|
|
33063
33067
|
return `<div class="${t}-wrapper">
|
|
33064
33068
|
<style>
|
|
33065
33069
|
.${t}-wrapper .${t} > svg {
|
|
@@ -33068,10 +33072,10 @@ const T = () => {
|
|
|
33068
33072
|
max-width: none !important;
|
|
33069
33073
|
}
|
|
33070
33074
|
</style>
|
|
33071
|
-
<div class="${t}"${
|
|
33075
|
+
<div class="${t}"${l2}><!-- Empty mermaid content --></div>
|
|
33072
33076
|
</div>`;
|
|
33073
33077
|
}
|
|
33074
|
-
const
|
|
33078
|
+
const m = n ? ` id="${s2.getUniqueId()}"` : "", d2 = h.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), c = `<div class="${t}-wrapper">
|
|
33075
33079
|
<style>
|
|
33076
33080
|
.${t}-wrapper .${t} > svg {
|
|
33077
33081
|
width: auto !important;
|
|
@@ -33079,13 +33083,13 @@ const T = () => {
|
|
|
33079
33083
|
max-width: none !important;
|
|
33080
33084
|
}
|
|
33081
33085
|
</style>
|
|
33082
|
-
<div class="${t}"${
|
|
33086
|
+
<div class="${t}"${m}>${d2}</div>
|
|
33083
33087
|
</div>`;
|
|
33084
33088
|
return s2.logger.debug("Mermaid plugin processed content:", {
|
|
33085
33089
|
contentLength: h.length,
|
|
33086
33090
|
className: t,
|
|
33087
|
-
includeId:
|
|
33088
|
-
}),
|
|
33091
|
+
includeId: n
|
|
33092
|
+
}), c;
|
|
33089
33093
|
}
|
|
33090
33094
|
};
|
|
33091
33095
|
};
|
|
@@ -33102,7 +33106,7 @@ const W = () => {
|
|
|
33102
33106
|
}, G = {
|
|
33103
33107
|
release: W,
|
|
33104
33108
|
[Symbol.dispose]: W
|
|
33105
|
-
},
|
|
33109
|
+
}, Ot = (e, t) => {
|
|
33106
33110
|
if (!e)
|
|
33107
33111
|
return G;
|
|
33108
33112
|
if (e.aborted) {
|
|
@@ -33113,10 +33117,10 @@ const W = () => {
|
|
|
33113
33117
|
}
|
|
33114
33118
|
return G;
|
|
33115
33119
|
}
|
|
33116
|
-
let
|
|
33117
|
-
|
|
33118
|
-
if (
|
|
33119
|
-
e.removeEventListener("abort",
|
|
33120
|
+
let n;
|
|
33121
|
+
n = () => {
|
|
33122
|
+
if (n) {
|
|
33123
|
+
e.removeEventListener("abort", n), n = void 0;
|
|
33120
33124
|
try {
|
|
33121
33125
|
t();
|
|
33122
33126
|
} catch (s2) {
|
|
@@ -33125,73 +33129,73 @@ const W = () => {
|
|
|
33125
33129
|
}
|
|
33126
33130
|
};
|
|
33127
33131
|
const o2 = () => {
|
|
33128
|
-
|
|
33132
|
+
n && (e.removeEventListener("abort", n), n = void 0);
|
|
33129
33133
|
};
|
|
33130
|
-
return e.addEventListener("abort",
|
|
33134
|
+
return e.addEventListener("abort", n, { once: true }), {
|
|
33131
33135
|
release: o2,
|
|
33132
33136
|
[Symbol.dispose]: o2
|
|
33133
33137
|
};
|
|
33134
|
-
},
|
|
33138
|
+
}, Lt = (e) => {
|
|
33135
33139
|
typeof setImmediate == "function" ? setImmediate(e) : setTimeout(e, 0);
|
|
33136
|
-
}, j = () => new Error("Lock acquisition was aborted"),
|
|
33140
|
+
}, j = () => new Error("Lock acquisition was aborted"), Nt = (e) => {
|
|
33137
33141
|
let t = true;
|
|
33138
|
-
const
|
|
33142
|
+
const n = () => {
|
|
33139
33143
|
t && (t = false, e());
|
|
33140
33144
|
};
|
|
33141
33145
|
return {
|
|
33142
33146
|
get isActive() {
|
|
33143
33147
|
return t;
|
|
33144
33148
|
},
|
|
33145
|
-
release:
|
|
33146
|
-
[Symbol.dispose]:
|
|
33149
|
+
release: n,
|
|
33150
|
+
[Symbol.dispose]: n
|
|
33147
33151
|
};
|
|
33148
33152
|
}, q = (e = 20) => {
|
|
33149
33153
|
let t = false;
|
|
33150
|
-
const
|
|
33154
|
+
const n = [];
|
|
33151
33155
|
let o2 = 0;
|
|
33152
|
-
const
|
|
33153
|
-
var
|
|
33154
|
-
if (t ||
|
|
33156
|
+
const r = () => {
|
|
33157
|
+
var l2;
|
|
33158
|
+
if (t || n.length === 0)
|
|
33155
33159
|
return;
|
|
33156
|
-
const i =
|
|
33157
|
-
if ((
|
|
33160
|
+
const i = n.shift();
|
|
33161
|
+
if ((l2 = i.signal) != null && l2.aborted) {
|
|
33158
33162
|
i.reject(j()), s2();
|
|
33159
33163
|
return;
|
|
33160
33164
|
}
|
|
33161
33165
|
t = true;
|
|
33162
|
-
const
|
|
33163
|
-
i.resolve(
|
|
33166
|
+
const a = Nt(h);
|
|
33167
|
+
i.resolve(a);
|
|
33164
33168
|
}, s2 = () => {
|
|
33165
|
-
o2++, o2 >= e ? (o2 = 0,
|
|
33169
|
+
o2++, o2 >= e ? (o2 = 0, Lt(r)) : r();
|
|
33166
33170
|
}, h = () => {
|
|
33167
33171
|
t && (t = false, s2());
|
|
33168
|
-
},
|
|
33169
|
-
const i =
|
|
33170
|
-
i !== -1 &&
|
|
33171
|
-
}, d2 = async (
|
|
33172
|
-
if (
|
|
33173
|
-
if (
|
|
33172
|
+
}, m = (l2) => {
|
|
33173
|
+
const i = n.indexOf(l2);
|
|
33174
|
+
i !== -1 && n.splice(i, 1);
|
|
33175
|
+
}, d2 = async (l2) => {
|
|
33176
|
+
if (l2) {
|
|
33177
|
+
if (l2.aborted)
|
|
33174
33178
|
throw j();
|
|
33175
|
-
return new Promise((i,
|
|
33179
|
+
return new Promise((i, a) => {
|
|
33176
33180
|
const f = {
|
|
33177
33181
|
resolve: void 0,
|
|
33178
33182
|
reject: void 0,
|
|
33179
|
-
signal:
|
|
33180
|
-
}, u =
|
|
33181
|
-
|
|
33183
|
+
signal: l2
|
|
33184
|
+
}, u = Ot(l2, () => {
|
|
33185
|
+
m(f), a(j());
|
|
33182
33186
|
});
|
|
33183
|
-
f.resolve = (
|
|
33184
|
-
u.release(), i(
|
|
33185
|
-
}, f.reject = (
|
|
33186
|
-
u.release(),
|
|
33187
|
-
},
|
|
33187
|
+
f.resolve = (p2) => {
|
|
33188
|
+
u.release(), i(p2);
|
|
33189
|
+
}, f.reject = (p2) => {
|
|
33190
|
+
u.release(), a(p2);
|
|
33191
|
+
}, n.push(f), r();
|
|
33188
33192
|
});
|
|
33189
33193
|
} else
|
|
33190
|
-
return new Promise((i,
|
|
33191
|
-
|
|
33194
|
+
return new Promise((i, a) => {
|
|
33195
|
+
n.push({
|
|
33192
33196
|
resolve: i,
|
|
33193
|
-
reject:
|
|
33194
|
-
}),
|
|
33197
|
+
reject: a
|
|
33198
|
+
}), r();
|
|
33195
33199
|
});
|
|
33196
33200
|
};
|
|
33197
33201
|
return {
|
|
@@ -33203,57 +33207,57 @@ const W = () => {
|
|
|
33203
33207
|
return t;
|
|
33204
33208
|
},
|
|
33205
33209
|
get pendingCount() {
|
|
33206
|
-
return
|
|
33210
|
+
return n.length;
|
|
33207
33211
|
}
|
|
33208
33212
|
};
|
|
33209
|
-
},
|
|
33210
|
-
const e = /* @__PURE__ */ new Map(), t = q(),
|
|
33211
|
-
const
|
|
33212
|
-
for (const [
|
|
33213
|
-
i.ttl !== void 0 && (i.ttl === 0 || d2 > i.timestamp + i.ttl) &&
|
|
33214
|
-
for (const
|
|
33215
|
-
e.delete(
|
|
33216
|
-
return
|
|
33213
|
+
}, Tt = () => {
|
|
33214
|
+
const e = /* @__PURE__ */ new Map(), t = q(), n = (d2 = Date.now()) => {
|
|
33215
|
+
const c = [];
|
|
33216
|
+
for (const [l2, i] of e.entries())
|
|
33217
|
+
i.ttl !== void 0 && (i.ttl === 0 || d2 > i.timestamp + i.ttl) && c.push(l2);
|
|
33218
|
+
for (const l2 of c)
|
|
33219
|
+
e.delete(l2);
|
|
33220
|
+
return c;
|
|
33217
33221
|
};
|
|
33218
33222
|
return {
|
|
33219
33223
|
get: async (d2) => {
|
|
33220
|
-
const
|
|
33221
|
-
if (!
|
|
33224
|
+
const c = e.get(d2);
|
|
33225
|
+
if (!c)
|
|
33222
33226
|
return null;
|
|
33223
|
-
if (
|
|
33227
|
+
if (c.ttl !== void 0 && (c.ttl === 0 || Date.now() > c.timestamp + c.ttl)) {
|
|
33224
33228
|
const i = await t.lock();
|
|
33225
33229
|
try {
|
|
33226
|
-
const
|
|
33227
|
-
if (
|
|
33230
|
+
const a = e.get(d2);
|
|
33231
|
+
if (a && a.ttl !== void 0) {
|
|
33228
33232
|
const f = Date.now();
|
|
33229
|
-
(
|
|
33233
|
+
(a.ttl === 0 || f > a.timestamp + a.ttl) && e.delete(d2);
|
|
33230
33234
|
}
|
|
33231
33235
|
return null;
|
|
33232
33236
|
} finally {
|
|
33233
33237
|
i.release();
|
|
33234
33238
|
}
|
|
33235
33239
|
}
|
|
33236
|
-
return
|
|
33240
|
+
return c.data;
|
|
33237
33241
|
},
|
|
33238
|
-
set: async (d2,
|
|
33242
|
+
set: async (d2, c, l2) => {
|
|
33239
33243
|
const i = {
|
|
33240
|
-
data:
|
|
33244
|
+
data: c,
|
|
33241
33245
|
timestamp: Date.now()
|
|
33242
33246
|
};
|
|
33243
|
-
|
|
33244
|
-
const
|
|
33247
|
+
l2 !== void 0 && (i.ttl = l2);
|
|
33248
|
+
const a = await t.lock();
|
|
33245
33249
|
try {
|
|
33246
33250
|
e.set(d2, i);
|
|
33247
33251
|
} finally {
|
|
33248
|
-
|
|
33252
|
+
a.release();
|
|
33249
33253
|
}
|
|
33250
33254
|
},
|
|
33251
33255
|
delete: async (d2) => {
|
|
33252
|
-
const
|
|
33256
|
+
const c = await t.lock();
|
|
33253
33257
|
try {
|
|
33254
33258
|
e.delete(d2);
|
|
33255
33259
|
} finally {
|
|
33256
|
-
|
|
33260
|
+
c.release();
|
|
33257
33261
|
}
|
|
33258
33262
|
},
|
|
33259
33263
|
clear: async () => {
|
|
@@ -33267,36 +33271,36 @@ const W = () => {
|
|
|
33267
33271
|
size: async () => {
|
|
33268
33272
|
if (Array.from(e.entries()).length === 0)
|
|
33269
33273
|
return 0;
|
|
33270
|
-
const
|
|
33274
|
+
const c = await t.lock();
|
|
33271
33275
|
try {
|
|
33272
|
-
return
|
|
33276
|
+
return n(), e.size;
|
|
33273
33277
|
} finally {
|
|
33274
|
-
|
|
33278
|
+
c.release();
|
|
33275
33279
|
}
|
|
33276
33280
|
}
|
|
33277
33281
|
};
|
|
33278
33282
|
};
|
|
33279
|
-
function D(e, t,
|
|
33280
|
-
return `fetch:${e}:${t}:${
|
|
33283
|
+
function D(e, t, n) {
|
|
33284
|
+
return `fetch:${e}:${t}:${n}`;
|
|
33281
33285
|
}
|
|
33282
|
-
const
|
|
33286
|
+
const Yt = (e, t = 6e4, n, o2) => {
|
|
33283
33287
|
const {
|
|
33284
|
-
cache:
|
|
33288
|
+
cache: r = true,
|
|
33285
33289
|
cacheTTL: s2 = 3600 * 1e3,
|
|
33286
33290
|
// 1 hour default
|
|
33287
33291
|
cacheFailures: h = true,
|
|
33288
|
-
failureCacheTTL:
|
|
33292
|
+
failureCacheTTL: m = 300 * 1e3
|
|
33289
33293
|
// 5 minutes default for failures
|
|
33290
|
-
} = {}, d2 =
|
|
33294
|
+
} = {}, d2 = r ? n || Tt() : void 0;
|
|
33291
33295
|
return {
|
|
33292
|
-
rawFetcher: async (
|
|
33293
|
-
if (
|
|
33294
|
-
const y = D(
|
|
33295
|
-
if (
|
|
33296
|
+
rawFetcher: async (l2, i, a, f) => {
|
|
33297
|
+
if (r && d2) {
|
|
33298
|
+
const y = D(l2, i, e), g2 = await d2.get(y);
|
|
33299
|
+
if (g2)
|
|
33296
33300
|
try {
|
|
33297
|
-
const
|
|
33298
|
-
if (
|
|
33299
|
-
return f?.info(`Cache HIT (success) for URL: ${
|
|
33301
|
+
const w = JSON.parse(g2);
|
|
33302
|
+
if (w.type === "success")
|
|
33303
|
+
return f?.info(`Cache HIT (success) for URL: ${l2}`), new Response(w.data, {
|
|
33300
33304
|
status: 200,
|
|
33301
33305
|
statusText: "OK",
|
|
33302
33306
|
headers: {
|
|
@@ -33304,73 +33308,73 @@ const te = (e, t = 6e4, r, o2) => {
|
|
|
33304
33308
|
"X-Cache": "HIT"
|
|
33305
33309
|
}
|
|
33306
33310
|
});
|
|
33307
|
-
if (
|
|
33308
|
-
throw f?.info(`Cache HIT (error) for URL: ${
|
|
33311
|
+
if (w.type === "error" && h)
|
|
33312
|
+
throw f?.info(`Cache HIT (error) for URL: ${l2}`), new Error("Cached error");
|
|
33309
33313
|
f?.debug(
|
|
33310
|
-
`Cache entry type ${
|
|
33314
|
+
`Cache entry type ${w.type} not eligible for use, cacheFailures: ${h}`
|
|
33311
33315
|
);
|
|
33312
|
-
} catch (
|
|
33316
|
+
} catch (w) {
|
|
33313
33317
|
if (f?.warn(
|
|
33314
|
-
`Failed to parse cached entry for URL ${
|
|
33315
|
-
|
|
33316
|
-
),
|
|
33318
|
+
`Failed to parse cached entry for URL ${l2}:`,
|
|
33319
|
+
w
|
|
33320
|
+
), w instanceof SyntaxError)
|
|
33317
33321
|
f?.debug("JSON parse error, continuing to network fetch");
|
|
33318
33322
|
else
|
|
33319
|
-
throw
|
|
33323
|
+
throw w;
|
|
33320
33324
|
}
|
|
33321
33325
|
else
|
|
33322
|
-
f?.info(`Cache MISS for URL: ${
|
|
33326
|
+
f?.info(`Cache MISS for URL: ${l2}`);
|
|
33323
33327
|
}
|
|
33324
|
-
let u,
|
|
33328
|
+
let u, p2 = null;
|
|
33325
33329
|
try {
|
|
33326
33330
|
u = await Yd(
|
|
33327
|
-
|
|
33331
|
+
l2,
|
|
33328
33332
|
i,
|
|
33329
33333
|
e,
|
|
33330
33334
|
t,
|
|
33331
|
-
|
|
33335
|
+
a,
|
|
33332
33336
|
f
|
|
33333
33337
|
);
|
|
33334
33338
|
} catch (y) {
|
|
33335
|
-
if (
|
|
33339
|
+
if (p2 = y, r && d2 && h)
|
|
33336
33340
|
try {
|
|
33337
|
-
const
|
|
33341
|
+
const g2 = D(l2, i, e), w = {
|
|
33338
33342
|
type: "error",
|
|
33339
33343
|
data: "",
|
|
33340
33344
|
error: {
|
|
33341
|
-
message:
|
|
33342
|
-
...
|
|
33345
|
+
message: p2.message,
|
|
33346
|
+
...p2.message.includes("HTTP error, status:") && {
|
|
33343
33347
|
status: parseInt(
|
|
33344
|
-
|
|
33348
|
+
p2.message.match(/status: (\d+)/)?.[1] || "0"
|
|
33345
33349
|
)
|
|
33346
33350
|
}
|
|
33347
33351
|
},
|
|
33348
33352
|
timestamp: Date.now()
|
|
33349
33353
|
};
|
|
33350
33354
|
await d2.set(
|
|
33351
|
-
|
|
33352
|
-
JSON.stringify(
|
|
33353
|
-
|
|
33354
|
-
), f?.debug(`Cached error for URL: ${
|
|
33355
|
-
} catch (
|
|
33356
|
-
f?.warn(`Failed to cache error for URL ${
|
|
33355
|
+
g2,
|
|
33356
|
+
JSON.stringify(w),
|
|
33357
|
+
m
|
|
33358
|
+
), f?.debug(`Cached error for URL: ${l2}`);
|
|
33359
|
+
} catch (g2) {
|
|
33360
|
+
f?.warn(`Failed to cache error for URL ${l2}:`, g2), console.warn("Failed to cache error:", g2);
|
|
33357
33361
|
}
|
|
33358
|
-
throw
|
|
33362
|
+
throw p2;
|
|
33359
33363
|
}
|
|
33360
|
-
if (
|
|
33364
|
+
if (r && d2 && u.ok)
|
|
33361
33365
|
try {
|
|
33362
|
-
const y = await u.clone().text(),
|
|
33366
|
+
const y = await u.clone().text(), g2 = D(l2, i, e), w = {
|
|
33363
33367
|
type: "success",
|
|
33364
33368
|
data: y,
|
|
33365
33369
|
timestamp: Date.now()
|
|
33366
33370
|
};
|
|
33367
33371
|
await d2.set(
|
|
33368
|
-
|
|
33369
|
-
JSON.stringify(
|
|
33372
|
+
g2,
|
|
33373
|
+
JSON.stringify(w),
|
|
33370
33374
|
s2
|
|
33371
|
-
), f?.debug(`Cached successful response for URL: ${
|
|
33375
|
+
), f?.debug(`Cached successful response for URL: ${l2}`);
|
|
33372
33376
|
} catch (y) {
|
|
33373
|
-
f?.warn(`Failed to cache response for URL ${
|
|
33377
|
+
f?.warn(`Failed to cache response for URL ${l2}:`, y), console.warn("Failed to cache response:", y);
|
|
33374
33378
|
}
|
|
33375
33379
|
return u;
|
|
33376
33380
|
},
|
|
@@ -33379,23 +33383,23 @@ const te = (e, t = 6e4, r, o2) => {
|
|
|
33379
33383
|
};
|
|
33380
33384
|
function setupProcessor(config) {
|
|
33381
33385
|
const plugins = [];
|
|
33382
|
-
const logger =
|
|
33383
|
-
const fetcher =
|
|
33386
|
+
const logger = Kt();
|
|
33387
|
+
const fetcher = Yt(
|
|
33384
33388
|
"mark-deco-cli/0.0.1",
|
|
33385
33389
|
5e3,
|
|
33386
|
-
|
|
33390
|
+
Tt()
|
|
33387
33391
|
);
|
|
33388
33392
|
const enabledPlugins = config.noPlugins ? [] : Array.isArray(config.plugins) ? config.plugins : ["oembed", "card", "mermaid"];
|
|
33389
33393
|
if (enabledPlugins.includes("oembed") && config.oembed?.enabled !== false) {
|
|
33390
|
-
plugins.push(
|
|
33394
|
+
plugins.push(Gt($d, {}));
|
|
33391
33395
|
}
|
|
33392
33396
|
if (enabledPlugins.includes("card") && config.card?.enabled !== false) {
|
|
33393
33397
|
plugins.push(Qt({}));
|
|
33394
33398
|
}
|
|
33395
33399
|
if (enabledPlugins.includes("mermaid") && config.mermaid?.enabled !== false) {
|
|
33396
|
-
plugins.push(
|
|
33400
|
+
plugins.push(Vt({}));
|
|
33397
33401
|
}
|
|
33398
|
-
return
|
|
33402
|
+
return Wt({
|
|
33399
33403
|
plugins,
|
|
33400
33404
|
logger,
|
|
33401
33405
|
fetcher
|