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 CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  /*!
3
3
  * name: mark-deco-cli
4
- * version: 0.6.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: 31101feb1c59948ce221ebae9272f943b80c977b
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.6.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: 31101feb1c59948ce221ebae9272f943b80c977b
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], T2 = $s(f), A = new URL(T2, e).toString();
21590
- return u.info("getOEmbedUrl: Discovered oEmbed endpoint:", A), A;
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 T2 = await fetch(n, m);
21614
- if (T2.status >= 300 && T2.status < 400) {
21615
- const A = T2.headers.get("location");
21616
- if (A) {
21617
- n = new URL(A, n).toString(), c++;
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 T2 = await js(
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:", T2), T2.web_page || (T2.web_page = h), T2;
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 T2 = [];
21733
- if (r.title !== void 0 && T2.push({
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 && T2.push({
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 && T2.push({
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 && T2.push({
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 && T2.push({
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
- T2.push({
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
- T2.push({
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 A = T2.sort((M2, ee) => M2.order - ee.order), w = [], v = [];
21776
- A.forEach((M2) => {
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 S2 = "";
21780
- w.length > 0 && (S2 = `<div class="oembed-header">${w.join("")}</div>`);
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
- ${S2}
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 S2 = a.useMetadataUrlLink && e.web_page || t;
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(S2)}" target="_blank" rel="noopener noreferrer">
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((S2, U2) => S2.order - U2.order), T2 = [], A = [];
21824
- f.forEach((S2) => {
21825
- S2.html.includes("oembed-title") || S2.html.includes("oembed-author") || S2.html.includes("oembed-provider") || S2.html.includes("oembed-description") ? T2.push(S2.html) : A.push(S2.html);
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
- T2.length > 0 && (w = `<div class="oembed-header">${T2.join("")}</div>`);
21829
+ T.length > 0 && (w = `<div class="oembed-header">${T.join("")}</div>`);
21829
21830
  let v = "";
21830
- return A.length > 0 && (v = `<div class="oembed-content">
21831
- ${A.join("")}
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, S2) => v.order - S2.order), f = [], T2 = [];
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) : T2.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 A = "";
21874
- f.length > 0 && (A = `<div class="oembed-header">${f.join("")}</div>`);
21874
+ let A2 = "";
21875
+ f.length > 0 && (A2 = `<div class="oembed-header">${f.join("")}</div>`);
21875
21876
  let w = "";
21876
- return T2.length > 0 && (w = `<div class="oembed-content">${T2.join("")}</div>`), `<div class="oembed-container oembed-link">
21877
- ${A}
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 T2 = fe("summary", h) || fe("content", h);
22721
- T2 && (m.description = T2);
22722
- const A = fe("updated", h);
22723
- return A && (m.pubDate = new Date(A)), m;
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$1(e) {
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$1(e);
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$1(a) || fi(a))
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$1(a))
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 T2 = this.getSlice(t, u);
23746
- if (this.lowerCaseTagNames && (T2 = T2.toLowerCase()), this.htmlMode && (ju.has(T2) || Vu.has(T2)) && this.foreignContext.shift(), this.isVoidElement(T2))
23747
- this.htmlMode && T2 === "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));
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 A = this.stack.indexOf(T2);
23750
- if (A !== -1)
23751
- for (let w = 0; w <= A; 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 !== A);
23754
+ (a = (r = this.cbs).onclosetag) === null || a === void 0 || a.call(r, v, w !== A2);
23754
23755
  }
23755
- else this.htmlMode && T2 === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(true));
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, T2, A, w;
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)) : ((T2 = (f = this.cbs).oncomment) === null || T2 === void 0 || T2.call(f, `[CDATA[${v}]]`), (w = (A = this.cbs).oncommentend) === null || w === void 0 || w.call(A)), this.startIndex = u + 1;
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(A) {
24278
- const w = t.slice(u + A).match(Wu);
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 += A + v.length, Be(v);
24283
+ return u += A2 + v.length, Be(v);
24283
24284
  }
24284
- function i(A) {
24285
- for (u += A; u < t.length && zu(t.charCodeAt(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 A = u;
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(A, u - 1));
24297
+ return Be(t.slice(A2, u - 1));
24297
24298
  }
24298
- function c(A) {
24299
+ function c(A2) {
24299
24300
  let w = 0;
24300
- for (; t.charCodeAt(--A) === 92; )
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(A) {
24309
+ function m(A2) {
24309
24310
  if (r.length > 0 && r[r.length - 1].type === N.Descendant) {
24310
- r[r.length - 1].type = A;
24311
+ r[r.length - 1].type = A2;
24311
24312
  return;
24312
24313
  }
24313
- h(), r.push({ type: A });
24314
+ h(), r.push({ type: A2 });
24314
24315
  }
24315
- function f(A, w) {
24316
+ function f(A2, w) {
24316
24317
  r.push({
24317
24318
  type: N.Attribute,
24318
- name: A,
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 T2() {
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 A = t.charCodeAt(u);
24334
- switch (A) {
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 S2 = H.Exists;
24375
+ let S = H$1.Exists;
24375
24376
  const U2 = Ui.get(t.charCodeAt(u));
24376
24377
  if (U2) {
24377
- if (S2 = U2, t.charCodeAt(u + 1) !== 61)
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 && (S2 = H.Equals, i(1));
24381
+ } else t.charCodeAt(u) === 61 && (S = H$1.Equals, i(1));
24381
24382
  let M2 = "", ee = null;
24382
- if (S2 !== "exists") {
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: S2,
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 S2 = v.charCodeAt(0);
24436
- S2 === v.charCodeAt(v.length - 1) && Ht$1(S2) && (v = v.slice(1, -1));
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
- T2(), r = [], i(1);
24445
+ T(), r = [], i(1);
24445
24446
  break;
24446
24447
  }
24447
24448
  default: {
24448
24449
  if (t.startsWith("/*", u)) {
24449
- const S2 = t.indexOf("*/", u + 2);
24450
- if (S2 < 0)
24450
+ const S = t.indexOf("*/", u + 2);
24451
+ if (S < 0)
24451
24452
  throw new Error("Comment was not terminated");
24452
- u = S2 + 2, r.length === 0 && i(0);
24453
+ u = S + 2, r.length === 0 && i(0);
24453
24454
  break;
24454
24455
  }
24455
24456
  let w = null, v;
24456
- if (A === 42)
24457
+ if (A2 === 42)
24457
24458
  u += 1, v = "*";
24458
- else if (A === 124) {
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 T2(), u;
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 (T2) => {
24929
- if (!e(T2))
24929
+ return (T) => {
24930
+ if (!e(T))
24930
24931
  return false;
24931
- c[0] = T2;
24932
- const A = i.getChildren(T2), w = f ? [...A, ...Vr(T2, i)] : A;
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), (T2) => f(T2, u, c) && e(T2);
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 T2 = m[f];
25036
- if (n(h, T2))
25036
+ const T = m[f];
25037
+ if (n(h, T))
25037
25038
  break;
25038
- if (i.isTag(T2) && e(T2))
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 T2 = 0; T2 < m.length; T2++) {
25051
- const A = m[T2];
25052
- if (n(h, A))
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(A) && (f = A);
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 T2 = (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);
25279
- let A = _n(c.name, T2, c.data, u);
25280
- if (A.length === 0 || t.length === i + 1)
25281
- return A;
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: S2 } = w[0];
25286
- (S2 === N.Sibling || S2 === N.Adjacent) && (A = zr(A, St$1, true)), w.unshift(En);
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: (S2) => A.includes(S2)
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(A, w, u, false, a) : v ? (
25300
+ return w.some(bt$1) ? Et$1(A2, w, u, false, a) : v ? (
25300
25301
  // Query existing elements to resolve traversal.
25301
- uu(A, [w], u, a)
25302
+ uu(A2, [w], u, a)
25302
25303
  ) : (
25303
25304
  // If we don't have any more traversals, simply filter elements.
25304
- ru(A, [w], u)
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 T2 = r[f], A = T2.parent;
25613
- if (A) {
25614
- const v = A.children.indexOf(T2);
25615
- v !== -1 && (A.children.splice(v, 1), a === A && t > v && c[0]--);
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
- T2.parent = a, T2.prev && (T2.prev.next = (i = T2.next) !== null && i !== void 0 ? i : null), T2.next && (T2.next.prev = (n = T2.prev) !== null && n !== void 0 ? n : null), T2.prev = f === 0 ? h : r[f - 1], T2.next = f === r.length - 1 ? m : r[f + 1];
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(T2, A) {
25948
- const w = m(T2, A);
25948
+ _make(T, A2) {
25949
+ const w = m(T, A2);
25949
25950
  return w.prevObject = this, w;
25950
25951
  }
25951
- _parse(T2, A, w, v) {
25952
- return e(T2, A, w, v);
25952
+ _parse(T, A2, w, v) {
25953
+ return e(T, A2, w, v);
25953
25954
  }
25954
- _render(T2) {
25955
- return t(T2, this.options);
25955
+ _render(T) {
25956
+ return t(T, this.options);
25956
25957
  }
25957
25958
  }
25958
- function m(f, T2, A = c, w) {
25959
+ function m(f, T, A2 = c, w) {
25959
25960
  if (f && de(f))
25960
25961
  return f;
25961
- const v = Kt(w, n), S2 = typeof A == "string" ? [e(A, v, false, null)] : "length" in A ? A : [A], U2 = de(S2) ? S2 : new h(S2, null, v);
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 = T2 ? (
25980
+ const ae = T ? (
25980
25981
  // If we don't have a context, maybe we have a root, from loading
25981
- typeof T2 == "string" ? Xt(T2) ? (
25982
+ typeof T == "string" ? Xt(T) ? (
25982
25983
  // $('li', '<ul>...</ul>')
25983
- new h([e(T2, v, false, null)], U2, v)
25984
+ new h([e(T, v, false, null)], U2, v)
25984
25985
  ) : (
25985
25986
  // $('li', 'ul')
25986
- (he = `${T2} ${he}`, U2)
25987
- ) : de(T2) ? (
25987
+ (he = `${T} ${he}`, U2)
25988
+ ) : de(T) ? (
25988
25989
  // $('li', $)
25989
- T2
25990
+ T
25990
25991
  ) : (
25991
25992
  // $('li', node), $('li', [nodes])
25992
- new h(Array.isArray(T2) ? T2 : [T2], U2, v)
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$1(e) {
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$1(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
+ 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$1;
28870
+ var te;
28870
28871
  (function(e) {
28871
28872
  e[e.Marker = 0] = "Marker", e[e.Element = 1] = "Element";
28872
- })(te$1 || (te$1 = {}));
28873
- const nr = { type: te$1.Marker };
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$1.Marker)
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$1.Element,
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$1.Element,
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$1.Marker || this.treeAdapter.getTagName(r.element) === t);
28943
- return u && u.type === te$1.Element ? u : null;
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$1.Element && u.element === t);
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$1(e.tagName));
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$1(this.treeAdapter.getTagName(r)) : s.UNKNOWN, this._setContextModes(r ?? this.document, this.fragmentContextID), this.openElements = new dc(this.document, this.treeAdapter, this);
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$1.Marker || this.openElements.contains(a.element)), r = u === -1 ? t - 1 : u - 1;
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$1(this, 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$1(this, 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$1(this, t);
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$1(r);
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$1(e, t) {
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$1(e, t);
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$1(e, t), e.openElements.remove(e.headElement);
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$1(e, t);
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$1(e, t);
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$1(e, t);
31286
+ J(e, t);
31286
31287
  break;
31287
31288
  }
31288
31289
  default:
31289
- _t$1(e, 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$1(e, t);
31306
+ _t(e, t);
31306
31307
  }
31307
31308
  }
31308
- function _t$1(e, 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$1(e, t);
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$1(e, t);
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$1(e, t);
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$1(e, t);
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$1(e, t);
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 T2;
32180
+ let T;
32180
32181
  switch (i) {
32181
32182
  case "attr":
32182
- T2 = t(f).attr(e.attr || "href") || "";
32183
+ T = t(f).attr(e.attr || "href") || "";
32183
32184
  break;
32184
32185
  case "html":
32185
- T2 = t(f).html() || "";
32186
+ T = t(f).html() || "";
32186
32187
  break;
32187
32188
  case "text":
32188
32189
  default:
32189
- T2 = t(f).text().trim();
32190
+ T = t(f).text().trim();
32190
32191
  break;
32191
32192
  }
32192
- T2 && n.push(T2);
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, T2 = i("siteName") || Bs(f), A = pr(n, 80), w = pr(fr(c), 160), v = [];
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(A),
32444
+ j$1(A2),
32444
32445
  "card-image",
32445
32446
  void 0,
32446
32447
  'loading="lazy"'
32447
32448
  )
32448
32449
  });
32449
- let S2 = "";
32450
- m && a.favicon !== void 0 && (S2 = ou(
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(A)}</div>`
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 ? S2 : ""}
32468
- <span>${j$1(T2)}</span>
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.6.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: 31101feb1c59948ce221ebae9272f943b80c977b
32571
+ * git.commit.hash: cc985acbf6dd451ba9668a6c148f9e041c1032c5
32571
32572
  */
32572
- function yt(e) {
32573
- const t = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/, r = e.match(t);
32574
- if (!r)
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 = r[1] || "", n = e.slice(r[0].length);
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: n
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 r = t ?? "";
32601
+ const n = t ?? "";
32601
32602
  return `${`---
32602
32603
  ${gt(e)}---
32603
- `}${r}`;
32604
+ `}${n}`;
32604
32605
  }
32605
- const T = () => {
32606
+ const P = () => {
32606
32607
  }, vt = {
32607
- debug: T,
32608
- info: T,
32609
- warn: T,
32610
- error: T
32611
- }, kt = {
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
- }, Et = () => vt, Wt = () => kt, S = (e) => {
32617
- const t = {}, r = e.slice(1, -1).trim(), o2 = r.match(/\.([a-zA-Z0-9_-]+)/g);
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((p2) => p2.slice(1));
32620
+ const h = o2.map((m) => m.slice(1));
32620
32621
  t.class = h.join(" ");
32621
32622
  }
32622
- const n = r.match(/#([a-zA-Z0-9_-]+)/);
32623
- n && n[1] && (t.id = n[1]);
32624
- const s2 = r.match(/([a-zA-Z0-9_-]+)=["']?([^"'\s]*)["']?/g);
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 [p2, d2] = h.split("=");
32628
- p2 && d2 && p2 !== "class" && p2 !== "id" && (t[p2] = d2.replace(/["']/g, ""));
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}"` : "", r = e.value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
32633
- return `<pre><code${t}>${r}</code></pre>`;
32633
+ const t = e.lang ? ` class="language-${e.lang}"` : "", n = e.value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
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(([r, o2]) => {
32636
- if (r === "class") {
32637
- const n = e.data.hProperties.class;
32638
- n ? typeof n == "string" && n.startsWith("language-") ? e.data.hProperties.class = `${n} ${o2}` : e.data.hProperties.class = `${n} ${o2}` : e.data.hProperties.class = o2;
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[r] = o2;
32641
+ e.data.hProperties[n] = o2;
32641
32642
  });
32642
32643
  }, $t = () => (e) => {
32643
- visit(e, (t, r, o2) => {
32644
+ visit(e, (t, n, o2) => {
32644
32645
  if (t.type === "heading" && t.children?.length > 0) {
32645
- const n = t.children[t.children.length - 1];
32646
- if (n?.type === "text" && n.value) {
32647
- const s2 = n.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
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(), p2 = s2[2], d2 = S(p2);
32650
- n.value = h, F(t, d2);
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 n = t.children[t.children.length - 1];
32656
- if (n?.type === "text" && n.value) {
32657
- const s2 = n.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
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(), p2 = s2[2], d2 = S(p2);
32660
- n.value = h, F(t, d2);
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 r == "number") {
32665
- const n = o2.children[r + 1];
32666
- if (n?.type === "text" && n.value) {
32667
- const s2 = n.value.match(/^\s*(\{[^}]+\})/);
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], p2 = S(h);
32670
- F(t, p2), n.value = n.value.replace(s2[0], "");
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 r == "number") {
32675
- const n = o2.children[r + 1];
32676
- if (n?.type === "text" && n.value) {
32677
- const s2 = n.value.match(/^\s*(\{[^}]+\})/);
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], p2 = S(h);
32680
- F(t, p2), n.value = n.value.replace(s2[0], "");
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 n = t.children[t.children.length - 1];
32686
- if (n?.type === "paragraph" && n.children?.length > 0) {
32687
- const s2 = n.children[n.children.length - 1];
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 p2 = h[1].trim(), d2 = h[2], a = S(d2);
32692
- s2.value = p2, F(t, a);
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 r == "number") {
32698
- const n = o2.children[r + 1];
32699
- if (n?.type === "paragraph" && n.children?.length === 1) {
32700
- const s2 = n.children[0];
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 p2 = h[1], d2 = S(p2);
32705
- F(t, d2), o2.children.splice(r + 1, 1);
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 n = t.children[t.children.length - 1];
32712
- if (n?.type === "paragraph" && n.children?.length > 0) {
32713
- const s2 = n.children[n.children.length - 1];
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 p2 = h[1].trim(), d2 = h[2], a = S(d2);
32718
- s2.value = p2, F(t, a);
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 r == "number") {
32724
- const n = o2.children[r + 1];
32725
- if (n?.type === "paragraph" && n.children?.length === 1) {
32726
- const s2 = n.children[0];
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 p2 = h[1], d2 = S(p2);
32731
- F(t, d2), o2.children.splice(r + 1, 1);
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 r == "number") {
32737
- const n = o2.children[r + 1];
32738
- if (n?.type === "text" && n.value) {
32739
- const s2 = n.value.match(/^\s*(\{[^}]+\})/);
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], p2 = S(h);
32742
- F(t, p2), n.value = n.value.replace(s2[0], "");
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 n = t.meta.match(/\{([^}]+)\}/);
32748
- if (n) {
32749
- const s2 = `{${n[1]}}`, h = S(s2), p2 = {
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, a]) => `${d2}="${a}"`).join(" ")}>${bt(t)}</div>`
32754
+ ).filter(([d2]) => d2 !== "class").map(([d2, c]) => `${d2}="${c}"`).join(" ")}>${bt(t)}</div>`
32754
32755
  };
32755
- o2 && typeof r == "number" && (o2.children[r] = p2), t.meta = t.meta.replace(n[0], "").trim() || null;
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 r = Ys();
32763
+ const n = Ys();
32763
32764
  t.properties || (t.properties = {});
32764
- const o2 = t.properties.style || "", n = o2 ? `${o2}; ${r}` : r;
32765
- t.properties.style = n;
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, Ft = {
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], [n]) => o2 < n ? -1 : o2 > n ? 1 : 0), r = {};
32804
- for (const [o2, n] of t)
32805
- r[o2] = M(n);
32806
- return r;
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
- }, J = (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("") : "", Ct = (e, t) => `${e}-${t.join("-")}`, Ot = (e) => {
32810
- const t = [], r = [];
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 n = o2.level;
32813
- for (; r.length > n; )
32814
- r.pop();
32815
- for (; r.length < n; )
32816
- r.push(0);
32817
- const s2 = n - 1;
32818
- r[s2] = (r[s2] || 0) + 1;
32819
- const h = r.slice(0, n);
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, r) => {
32811
+ }, K = (e, t, n) => {
32828
32812
  const o2 = jd(t);
32829
- return o2 !== void 0 ? `${e}-${o2}` : r();
32813
+ return o2 !== void 0 ? `${e}-${o2}` : n();
32830
32814
  }, It = (e) => {
32831
- const t = [], r = [];
32815
+ const t = [], n = [];
32832
32816
  for (const o2 of e) {
32833
- const n = {
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 (; r.length > 0; ) {
32840
- const s2 = r[r.length - 1];
32823
+ for (; n.length > 0; ) {
32824
+ const s2 = n[n.length - 1];
32841
32825
  if (s2 && s2.level >= o2.level)
32842
- r.pop();
32826
+ n.pop();
32843
32827
  else
32844
32828
  break;
32845
32829
  }
32846
- if (r.length === 0)
32847
- t.push(n);
32830
+ if (n.length === 0)
32831
+ t.push(r);
32848
32832
  else {
32849
- const s2 = r[r.length - 1];
32850
- s2 && s2.children.push(n);
32833
+ const s2 = n[n.length - 1];
32834
+ s2 && s2.children.push(r);
32851
32835
  }
32852
- r.push(n);
32836
+ n.push(r);
32853
32837
  }
32854
32838
  return t;
32855
- }, Gt = (e) => {
32856
- const { plugins: t = [], logger: r = Et(), fetcher: o2 } = e, n = /* @__PURE__ */ new Map();
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 (n.has(a.name))
32842
+ if (r.has(a.name))
32859
32843
  throw new Error(
32860
32844
  `Plugin with name '${a.name}' is already registered`
32861
32845
  );
32862
- n.set(a.name, a);
32863
- }
32864
- const s2 = async (a, c, i) => {
32865
- const l2 = n.get(a);
32866
- return l2 ? await l2.processBlock(c, i) : `<pre><code class="language-${a}">${R(c)}</code></pre>`;
32867
- }, h = (a, c, i) => {
32868
- const l2 = {
32869
- logger: r,
32870
- signal: c,
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: i,
32856
+ getUniqueId: u,
32873
32857
  fetcher: o2
32874
32858
  };
32875
- return () => async (f) => {
32876
- const u = [];
32859
+ return () => async (y) => {
32860
+ const g2 = [];
32877
32861
  visit(
32878
- f,
32862
+ y,
32879
32863
  "code",
32880
- (m, y, w) => {
32881
- if (!m.lang || !n.has(m.lang))
32864
+ (w, E2, k2) => {
32865
+ if (!w.lang || !r.has(w.lang))
32882
32866
  return;
32883
- const g2 = (async () => {
32867
+ const b2 = (async () => {
32884
32868
  const v = {
32885
32869
  type: "html",
32886
32870
  value: await s2(
32887
- m.lang,
32888
- m.value,
32889
- l2
32871
+ w.lang,
32872
+ w.value,
32873
+ p2
32890
32874
  )
32891
32875
  };
32892
- w && typeof y == "number" && (w.children[y] = v);
32876
+ k2 && typeof E2 == "number" && (k2.children[E2] = v);
32893
32877
  })();
32894
- u.push(g2);
32878
+ g2.push(b2);
32895
32879
  }
32896
- ), await Promise.all(u);
32880
+ ), await Promise.all(g2);
32897
32881
  };
32898
- }, p2 = (a, c, i = false, l2 = false, f = "") => () => (u) => {
32899
- const m = [], y = [];
32900
- visit(u, "heading", (v) => {
32901
- v.depth >= 1 && v.depth <= 6 && y.push(v);
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 w = [];
32904
- if (i) {
32905
- const v = y.map((b2) => ({
32906
- level: b2.depth,
32907
- text: U(b2)
32887
+ let k2 = [];
32888
+ if (u) {
32889
+ const v = E2.map((L2) => ({
32890
+ level: L2.depth,
32891
+ text: U(L2)
32908
32892
  }));
32909
- w = Ot(v);
32910
- }
32911
- const g2 = [];
32912
- y.forEach((v, b2) => {
32913
- const x2 = U(v), C2 = v.data?.hProperties?.id;
32914
- let $2;
32915
- if (C2)
32916
- $2 = C2;
32917
- else if (i && l2) {
32918
- const H2 = K(
32919
- f,
32920
- x2,
32921
- () => c(x2)
32922
- ).replace(`${f}-`, "");
32923
- for (; g2.length > 0; ) {
32924
- const I2 = g2[g2.length - 1];
32925
- if (I2 && I2.level >= v.depth)
32926
- g2.pop();
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 O2 = g2.map((I2) => I2.contentId);
32931
- $2 = O2.length > 0 ? `${f}-${O2.join("-")}-${H2}` : `${f}-${H2}`, g2.push({
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: H2
32917
+ contentId: I2
32934
32918
  });
32935
- } else if (i && b2 < w.length) {
32936
- const H2 = w[b2];
32937
- H2 ? $2 = Ct(
32938
- f,
32939
- H2.numbers
32940
- ) : $2 = c(x2);
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
- $2 = c(x2);
32943
- v.data || (v.data = {}), v.data.hProperties || (v.data.hProperties = {}), C2 || (v.data.hProperties.id = $2), m.push({
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: x2,
32946
- id: $2
32929
+ text: C2,
32930
+ id: S
32947
32931
  });
32948
32932
  });
32949
- const E2 = It(m);
32950
- a.push(...E2);
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, c, {
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 b2 = a, { data: x2, content: C2 } = yt(a);
32969
- let $2 = x2;
32970
- const H2 = J(x2);
32971
- let O2 = false;
32972
- if (m) {
32973
- const k2 = {
32974
- originalFrontmatter: Ht(x2),
32975
- markdownContent: C2
32976
- }, A = m(k2);
32977
- A !== void 0 && ($2 = A, O2 = J(A) !== H2);
32978
- }
32979
- const P2 = [];
32980
- let I2 = 0;
32981
- const R2 = () => `${c}-${++I2}`;
32982
- let L2 = unified().use(remarkParse);
32983
- if (E2)
32984
- for (const k2 of E2)
32985
- Array.isArray(k2) ? L2 = L2.use(k2[0], k2[1]) : L2 = L2.use(k2);
32986
- let N2 = L2.use(remarkGfm, g2).use($t).use(
32987
- p2(
32988
- P2,
32989
- l2 ? (k2) => K(c, k2, R2) : R2,
32990
- f,
32991
- l2,
32992
- c
32993
- )
32994
- ).use(h($2, i, R2)).use(remarkRehype, { allowDangerousHtml: y }).use(St).use(rehypeStringify, { allowDangerousHtml: y });
32995
- if (v)
32996
- for (const k2 of v)
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
- }, Vt = (e, t = {}) => {
33016
- const { maxRedirects: r = 5, timeoutEachRedirect: o2 = 1e4 } = t;
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 p2 = s2.trim();
33021
- if (!qd(p2))
33022
- throw new Error(`Invalid URL: ${p2}`);
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
- p2,
33026
- r,
33029
+ m,
33030
+ n,
33027
33031
  o2,
33028
33032
  h,
33029
33033
  e
33030
33034
  );
33031
- return Wd(d2, p2, t);
33035
+ return Wd(d2, m, t);
33032
33036
  } catch (d2) {
33033
- h.logger.warn("oEmbed fetch failed for URL:", p2, d2);
33034
- const a = Vd(d2);
33035
- return typeof window < "u" ? Xs(p2, a) : Xs(p2, a);
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 (r, o2) => {
33042
- const n = r.trim();
33043
- if (!Xd(n))
33044
- throw new Error(`Invalid URL: ${n}`);
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(n, e, o2);
33047
- return th(s2, n, e);
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:", n, s2);
33053
+ o2.logger.warn("Card plugin fetch failed for URL:", r, s2);
33050
33054
  const h = Vd(s2);
33051
- return typeof window < "u" ? eh(n, h) : eh(n, h);
33055
+ return typeof window < "u" ? eh(r, h) : eh(r, h);
33052
33056
  }
33053
33057
  }
33054
- }), Zt = (e = {}) => {
33055
- const { className: t = "mermaid", includeId: r = true } = e;
33058
+ }), Vt = (e = {}) => {
33059
+ const { className: t = "mermaid", includeId: n = true } = e;
33056
33060
  return {
33057
33061
  name: "mermaid",
33058
- processBlock: async (n, s2) => {
33059
- const h = n.trim();
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 c = r ? ` id="${s2.getUniqueId()}"` : "";
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}"${c}><!-- Empty mermaid content --></div>
33075
+ <div class="${t}"${l2}><!-- Empty mermaid content --></div>
33072
33076
  </div>`;
33073
33077
  }
33074
- const p2 = r ? ` id="${s2.getUniqueId()}"` : "", d2 = h.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), a = `<div class="${t}-wrapper">
33078
+ const m = n ? ` id="${s2.getUniqueId()}"` : "", d2 = h.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), 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}"${p2}>${d2}</div>
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: r
33088
- }), a;
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
- }, Lt = (e, t) => {
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 r;
33117
- r = () => {
33118
- if (r) {
33119
- e.removeEventListener("abort", r), r = void 0;
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
- r && (e.removeEventListener("abort", r), r = void 0);
33132
+ n && (e.removeEventListener("abort", n), n = void 0);
33129
33133
  };
33130
- return e.addEventListener("abort", r, { once: true }), {
33134
+ return e.addEventListener("abort", n, { once: true }), {
33131
33135
  release: o2,
33132
33136
  [Symbol.dispose]: o2
33133
33137
  };
33134
- }, Nt = (e) => {
33138
+ }, Lt = (e) => {
33135
33139
  typeof setImmediate == "function" ? setImmediate(e) : setTimeout(e, 0);
33136
- }, j = () => new Error("Lock acquisition was aborted"), Tt = (e) => {
33140
+ }, j = () => new Error("Lock acquisition was aborted"), Nt = (e) => {
33137
33141
  let t = true;
33138
- const r = () => {
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: r,
33146
- [Symbol.dispose]: r
33149
+ release: n,
33150
+ [Symbol.dispose]: n
33147
33151
  };
33148
33152
  }, q = (e = 20) => {
33149
33153
  let t = false;
33150
- const r = [];
33154
+ const n = [];
33151
33155
  let o2 = 0;
33152
- const n = () => {
33153
- var c;
33154
- if (t || r.length === 0)
33156
+ const r = () => {
33157
+ var l2;
33158
+ if (t || n.length === 0)
33155
33159
  return;
33156
- const i = r.shift();
33157
- if ((c = i.signal) != null && c.aborted) {
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 l2 = Tt(h);
33163
- i.resolve(l2);
33166
+ const a = Nt(h);
33167
+ i.resolve(a);
33164
33168
  }, s2 = () => {
33165
- o2++, o2 >= e ? (o2 = 0, Nt(n)) : n();
33169
+ o2++, o2 >= e ? (o2 = 0, Lt(r)) : r();
33166
33170
  }, h = () => {
33167
33171
  t && (t = false, s2());
33168
- }, p2 = (c) => {
33169
- const i = r.indexOf(c);
33170
- i !== -1 && r.splice(i, 1);
33171
- }, d2 = async (c) => {
33172
- if (c) {
33173
- if (c.aborted)
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, l2) => {
33179
+ return new Promise((i, a) => {
33176
33180
  const f = {
33177
33181
  resolve: void 0,
33178
33182
  reject: void 0,
33179
- signal: c
33180
- }, u = Lt(c, () => {
33181
- p2(f), l2(j());
33183
+ signal: l2
33184
+ }, u = Ot(l2, () => {
33185
+ m(f), a(j());
33182
33186
  });
33183
- f.resolve = (m) => {
33184
- u.release(), i(m);
33185
- }, f.reject = (m) => {
33186
- u.release(), l2(m);
33187
- }, r.push(f), n();
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, l2) => {
33191
- r.push({
33194
+ return new Promise((i, a) => {
33195
+ n.push({
33192
33196
  resolve: i,
33193
- reject: l2
33194
- }), n();
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 r.length;
33210
+ return n.length;
33207
33211
  }
33208
33212
  };
33209
- }, _t = () => {
33210
- const e = /* @__PURE__ */ new Map(), t = q(), r = (d2 = Date.now()) => {
33211
- const a = [];
33212
- for (const [c, i] of e.entries())
33213
- i.ttl !== void 0 && (i.ttl === 0 || d2 > i.timestamp + i.ttl) && a.push(c);
33214
- for (const c of a)
33215
- e.delete(c);
33216
- return a;
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 a = e.get(d2);
33221
- if (!a)
33224
+ const c = e.get(d2);
33225
+ if (!c)
33222
33226
  return null;
33223
- if (a.ttl !== void 0 && (a.ttl === 0 || Date.now() > a.timestamp + a.ttl)) {
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 l2 = e.get(d2);
33227
- if (l2 && l2.ttl !== void 0) {
33230
+ const a = e.get(d2);
33231
+ if (a && a.ttl !== void 0) {
33228
33232
  const f = Date.now();
33229
- (l2.ttl === 0 || f > l2.timestamp + l2.ttl) && e.delete(d2);
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 a.data;
33240
+ return c.data;
33237
33241
  },
33238
- set: async (d2, a, c) => {
33242
+ set: async (d2, c, l2) => {
33239
33243
  const i = {
33240
- data: a,
33244
+ data: c,
33241
33245
  timestamp: Date.now()
33242
33246
  };
33243
- c !== void 0 && (i.ttl = c);
33244
- const l2 = await t.lock();
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
- l2.release();
33252
+ a.release();
33249
33253
  }
33250
33254
  },
33251
33255
  delete: async (d2) => {
33252
- const a = await t.lock();
33256
+ const c = await t.lock();
33253
33257
  try {
33254
33258
  e.delete(d2);
33255
33259
  } finally {
33256
- a.release();
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 a = await t.lock();
33274
+ const c = await t.lock();
33271
33275
  try {
33272
- return r(), e.size;
33276
+ return n(), e.size;
33273
33277
  } finally {
33274
- a.release();
33278
+ c.release();
33275
33279
  }
33276
33280
  }
33277
33281
  };
33278
33282
  };
33279
- function D(e, t, r) {
33280
- return `fetch:${e}:${t}:${r}`;
33283
+ function D(e, t, n) {
33284
+ return `fetch:${e}:${t}:${n}`;
33281
33285
  }
33282
- const te = (e, t = 6e4, r, o2) => {
33286
+ const Yt = (e, t = 6e4, n, o2) => {
33283
33287
  const {
33284
- cache: n = true,
33288
+ cache: r = true,
33285
33289
  cacheTTL: s2 = 3600 * 1e3,
33286
33290
  // 1 hour default
33287
33291
  cacheFailures: h = true,
33288
- failureCacheTTL: p2 = 300 * 1e3
33292
+ failureCacheTTL: m = 300 * 1e3
33289
33293
  // 5 minutes default for failures
33290
- } = {}, d2 = n ? r || _t() : void 0;
33294
+ } = {}, d2 = r ? n || Tt() : void 0;
33291
33295
  return {
33292
- rawFetcher: async (c, i, l2, f) => {
33293
- if (n && d2) {
33294
- const y = D(c, i, e), w = await d2.get(y);
33295
- if (w)
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 g2 = JSON.parse(w);
33298
- if (g2.type === "success")
33299
- return f?.info(`Cache HIT (success) for URL: ${c}`), new Response(g2.data, {
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 (g2.type === "error" && h)
33308
- throw f?.info(`Cache HIT (error) for URL: ${c}`), new Error("Cached error");
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 ${g2.type} not eligible for use, cacheFailures: ${h}`
33314
+ `Cache entry type ${w.type} not eligible for use, cacheFailures: ${h}`
33311
33315
  );
33312
- } catch (g2) {
33316
+ } catch (w) {
33313
33317
  if (f?.warn(
33314
- `Failed to parse cached entry for URL ${c}:`,
33315
- g2
33316
- ), g2 instanceof SyntaxError)
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 g2;
33323
+ throw w;
33320
33324
  }
33321
33325
  else
33322
- f?.info(`Cache MISS for URL: ${c}`);
33326
+ f?.info(`Cache MISS for URL: ${l2}`);
33323
33327
  }
33324
- let u, m = null;
33328
+ let u, p2 = null;
33325
33329
  try {
33326
33330
  u = await Yd(
33327
- c,
33331
+ l2,
33328
33332
  i,
33329
33333
  e,
33330
33334
  t,
33331
- l2,
33335
+ a,
33332
33336
  f
33333
33337
  );
33334
33338
  } catch (y) {
33335
- if (m = y, n && d2 && h)
33339
+ if (p2 = y, r && d2 && h)
33336
33340
  try {
33337
- const w = D(c, i, e), g2 = {
33341
+ const g2 = D(l2, i, e), w = {
33338
33342
  type: "error",
33339
33343
  data: "",
33340
33344
  error: {
33341
- message: m.message,
33342
- ...m.message.includes("HTTP error, status:") && {
33345
+ message: p2.message,
33346
+ ...p2.message.includes("HTTP error, status:") && {
33343
33347
  status: parseInt(
33344
- m.message.match(/status: (\d+)/)?.[1] || "0"
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
- w,
33352
- JSON.stringify(g2),
33353
- p2
33354
- ), f?.debug(`Cached error for URL: ${c}`);
33355
- } catch (w) {
33356
- f?.warn(`Failed to cache error for URL ${c}:`, w), console.warn("Failed to cache error:", w);
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 m;
33362
+ throw p2;
33359
33363
  }
33360
- if (n && d2 && u.ok)
33364
+ if (r && d2 && u.ok)
33361
33365
  try {
33362
- const y = await u.clone().text(), w = D(c, i, e), g2 = {
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
- w,
33369
- JSON.stringify(g2),
33372
+ g2,
33373
+ JSON.stringify(w),
33370
33374
  s2
33371
- ), f?.debug(`Cached successful response for URL: ${c}`);
33375
+ ), f?.debug(`Cached successful response for URL: ${l2}`);
33372
33376
  } catch (y) {
33373
- f?.warn(`Failed to cache response for URL ${c}:`, y), console.warn("Failed to cache response:", y);
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 = Wt();
33383
- const fetcher = te(
33386
+ const logger = Kt();
33387
+ const fetcher = Yt(
33384
33388
  "mark-deco-cli/0.0.1",
33385
33389
  5e3,
33386
- _t()
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(Vt($d, {}));
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(Zt({}));
33400
+ plugins.push(Vt({}));
33397
33401
  }
33398
- return Gt({
33402
+ return Wt({
33399
33403
  plugins,
33400
33404
  logger,
33401
33405
  fetcher