mark-deco-cli 0.14.0 → 0.16.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.
Files changed (3) hide show
  1. package/dist/cli.cjs +1166 -1125
  2. package/dist/cli.cjs.map +1 -1
  3. package/package.json +10 -9
package/dist/cli.cjs CHANGED
@@ -2,12 +2,12 @@
2
2
  "use strict";
3
3
  /*!
4
4
  * name: mark-deco-cli
5
- * version: 0.14.0
5
+ * version: 0.16.0
6
6
  * description: Command-line interface for mark-deco Markdown to HTML conversion processor
7
7
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
8
8
  * license: MIT
9
9
  * repository.url: https://github.com/kekyo/mark-deco.git
10
- * git.commit.hash: 090ae78518ae17207fdb90e6fca59893315672fb
10
+ * git.commit.hash: 2349c97b2136b454168e4ae633590d11307952c5
11
11
  */
12
12
  const commander = require("commander");
13
13
  const promises = require("fs/promises");
@@ -4338,7 +4338,7 @@ function requireJs() {
4338
4338
  return js$1.exports;
4339
4339
  }
4340
4340
  var jsExports = requireJs();
4341
- const at$1 = /* @__PURE__ */ getDefaultExportFromCjs(jsExports);
4341
+ const he = /* @__PURE__ */ getDefaultExportFromCjs(jsExports);
4342
4342
  const htmlVoidElements = [
4343
4343
  "area",
4344
4344
  "base",
@@ -17462,7 +17462,7 @@ function requireExtend() {
17462
17462
  }
17463
17463
  return typeof key2 === "undefined" || hasOwn.call(obj, key2);
17464
17464
  };
17465
- var setProperty = function setProperty2(target, options2) {
17465
+ var setProperty2 = function setProperty3(target, options2) {
17466
17466
  if (defineProperty && options2.name === "__proto__") {
17467
17467
  defineProperty(target, options2.name, {
17468
17468
  enumerable: true,
@@ -17512,9 +17512,9 @@ function requireExtend() {
17512
17512
  } else {
17513
17513
  clone = src2 && isPlainObject2(src2) ? src2 : {};
17514
17514
  }
17515
- setProperty(target, { name, newValue: extend3(deep, clone, copy) });
17515
+ setProperty2(target, { name, newValue: extend3(deep, clone, copy) });
17516
17516
  } else if (typeof copy !== "undefined") {
17517
- setProperty(target, { name, newValue: copy });
17517
+ setProperty2(target, { name, newValue: copy });
17518
17518
  }
17519
17519
  }
17520
17520
  }
@@ -18862,7 +18862,7 @@ function isUint8Array(value) {
18862
18862
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
18863
18863
  );
18864
18864
  }
18865
- /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
18865
+ /*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
18866
18866
  function isNothing(subject) {
18867
18867
  return typeof subject === "undefined" || subject === null;
18868
18868
  }
@@ -19726,6 +19726,18 @@ function charFromCodepoint(c) {
19726
19726
  (c - 65536 & 1023) + 56320
19727
19727
  );
19728
19728
  }
19729
+ function setProperty(object, key2, value) {
19730
+ if (key2 === "__proto__") {
19731
+ Object.defineProperty(object, key2, {
19732
+ configurable: true,
19733
+ enumerable: true,
19734
+ writable: true,
19735
+ value
19736
+ });
19737
+ } else {
19738
+ object[key2] = value;
19739
+ }
19740
+ }
19729
19741
  var simpleEscapeCheck = new Array(256);
19730
19742
  var simpleEscapeMap = new Array(256);
19731
19743
  for (var i = 0; i < 256; i++) {
@@ -19844,7 +19856,7 @@ function mergeMappings(state, destination, source, overridableKeys) {
19844
19856
  for (index2 = 0, quantity = sourceKeys.length; index2 < quantity; index2 += 1) {
19845
19857
  key2 = sourceKeys[index2];
19846
19858
  if (!_hasOwnProperty$1.call(destination, key2)) {
19847
- destination[key2] = source[key2];
19859
+ setProperty(destination, key2, source[key2]);
19848
19860
  overridableKeys[key2] = true;
19849
19861
  }
19850
19862
  }
@@ -19884,16 +19896,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu
19884
19896
  state.position = startPos || state.position;
19885
19897
  throwError(state, "duplicated mapping key");
19886
19898
  }
19887
- if (keyNode === "__proto__") {
19888
- Object.defineProperty(_result, keyNode, {
19889
- configurable: true,
19890
- enumerable: true,
19891
- writable: true,
19892
- value: valueNode
19893
- });
19894
- } else {
19895
- _result[keyNode] = valueNode;
19896
- }
19899
+ setProperty(_result, keyNode, valueNode);
19897
19900
  delete overridableKeys[keyNode];
19898
19901
  }
19899
19902
  return _result;
@@ -21417,12 +21420,12 @@ var load = loader.load;
21417
21420
  var dump = dumper.dump;
21418
21421
  /*!
21419
21422
  * name: mark-deco
21420
- * version: 0.14.0
21423
+ * version: 0.16.0
21421
21424
  * description: Flexible Markdown to HTML conversion library
21422
21425
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
21423
21426
  * license: MIT
21424
21427
  * repository.url: https://github.com/kekyo/mark-deco.git
21425
- * git.commit.hash: 090ae78518ae17207fdb90e6fca59893315672fb
21428
+ * git.commit.hash: 2349c97b2136b454168e4ae633590d11307952c5
21426
21429
  */
21427
21430
  const qd = (e) => {
21428
21431
  try {
@@ -21430,7 +21433,7 @@ const qd = (e) => {
21430
21433
  } catch {
21431
21434
  return false;
21432
21435
  }
21433
- }, R = (e) => {
21436
+ }, R$1 = (e) => {
21434
21437
  const t = {
21435
21438
  "&": "&amp;",
21436
21439
  "<": "&lt;",
@@ -21460,7 +21463,7 @@ const qd = (e) => {
21460
21463
  }, Ys = () => "width: 100%; height: auto; display: block; object-fit: contain; object-position: center;", ou = (e, t, u, r) => {
21461
21464
  const a = Ys(), i = "", n = r ? ` ${r}` : "";
21462
21465
  return `<img src="${e}" alt="${t}"${i} style="${a}"${n} />`;
21463
- }, At$1 = (e, t, u, r, a) => {
21466
+ }, At = (e, t, u, r, a) => {
21464
21467
  const i = ou(e, t, r, a);
21465
21468
  return `<div class="${u}">
21466
21469
  ${i}
@@ -21587,8 +21590,8 @@ const qd = (e) => {
21587
21590
  if (h) {
21588
21591
  const m = h[0].match(/href=['"]([^'"]+)['"]/i);
21589
21592
  if (m && m[1]) {
21590
- const f = m[1], T = $s(f), A = new URL(T, e).toString();
21591
- return u.info("getOEmbedUrl: Discovered oEmbed endpoint:", A), A;
21593
+ const f = m[1], T = $s(f), A2 = new URL(T, e).toString();
21594
+ return u.info("getOEmbedUrl: Discovered oEmbed endpoint:", A2), A2;
21592
21595
  }
21593
21596
  }
21594
21597
  } catch (c) {
@@ -21613,9 +21616,9 @@ const qd = (e) => {
21613
21616
  m.signal = i ? Tr(i, f) : f;
21614
21617
  const T = await fetch(n, m);
21615
21618
  if (T.status >= 300 && T.status < 400) {
21616
- const A = T.headers.get("location");
21617
- if (A) {
21618
- n = new URL(A, n).toString(), c++;
21619
+ const A2 = T.headers.get("location");
21620
+ if (A2) {
21621
+ n = new URL(A2, n).toString(), c++;
21619
21622
  continue;
21620
21623
  }
21621
21624
  }
@@ -21679,11 +21682,11 @@ const Gd = async (e, t, u, r, a) => {
21679
21682
  return `<div class="oembed-container oembed-fallback">
21680
21683
  <div class="oembed-header">
21681
21684
  <div class="oembed-title">External Content</div>
21682
- <div class="oembed-provider">${R(r)}${a}</div>
21685
+ <div class="oembed-provider">${R$1(r)}${a}</div>
21683
21686
  </div>
21684
21687
  <div class="oembed-content">
21685
- <a href="${R(e)}" target="_blank" rel="noopener noreferrer">
21686
- View content on ${R(r)}
21688
+ <a href="${R$1(e)}" target="_blank" rel="noopener noreferrer">
21689
+ View content on ${R$1(r)}
21687
21690
  </a>
21688
21691
  </div>
21689
21692
  </div>`;
@@ -21733,21 +21736,21 @@ const Gd = async (e, t, u, r, a) => {
21733
21736
  const T = [];
21734
21737
  if (r.title !== void 0 && T.push({
21735
21738
  order: r.title,
21736
- html: `<div class="oembed-title">${R(i)}</div>`
21739
+ html: `<div class="oembed-title">${R$1(i)}</div>`
21737
21740
  }), r.author !== void 0 && T.push({
21738
21741
  order: r.author,
21739
- html: `<div class="oembed-author">by ${R(n)}</div>`
21742
+ html: `<div class="oembed-author">by ${R$1(n)}</div>`
21740
21743
  }), r.provider !== void 0 && T.push({
21741
21744
  order: r.provider,
21742
- html: `<div class="oembed-provider">${R(u)}</div>`
21745
+ html: `<div class="oembed-provider">${R$1(u)}</div>`
21743
21746
  }), r.description !== void 0 && e.author_name && T.push({
21744
21747
  order: r.description,
21745
- html: `<div class="oembed-description">${R(e.author_name)}</div>`
21748
+ html: `<div class="oembed-description">${R$1(e.author_name)}</div>`
21746
21749
  }), r.thumbnail !== void 0 && e.thumbnail_url && T.push({
21747
21750
  order: r.thumbnail,
21748
- html: At$1(
21749
- R(e.thumbnail_url),
21750
- R(i),
21751
+ html: At(
21752
+ R$1(e.thumbnail_url),
21753
+ R$1(i),
21751
21754
  "oembed-thumbnail"
21752
21755
  )
21753
21756
  }), r.embeddedContent !== void 0 && c) {
@@ -21755,8 +21758,8 @@ const Gd = async (e, t, u, r, a) => {
21755
21758
  T.push({
21756
21759
  order: r.embeddedContent,
21757
21760
  html: ou(
21758
- R(c),
21759
- R(i),
21761
+ R$1(c),
21762
+ R$1(i),
21760
21763
  void 0,
21761
21764
  M
21762
21765
  )
@@ -21767,14 +21770,14 @@ const Gd = async (e, t, u, r, a) => {
21767
21770
  T.push({
21768
21771
  order: r.externalLink,
21769
21772
  html: `<div class="oembed-external-link">
21770
- <a href="${R(M)}" target="_blank" rel="noopener noreferrer">
21771
- Visit ${R(u)}
21773
+ <a href="${R$1(M)}" target="_blank" rel="noopener noreferrer">
21774
+ Visit ${R$1(u)}
21772
21775
  </a>
21773
21776
  </div>`
21774
21777
  });
21775
21778
  }
21776
- const A = T.sort((M, ee) => M.order - ee.order), w = [], v = [];
21777
- A.forEach((M) => {
21779
+ const A2 = T.sort((M, ee2) => M.order - ee2.order), w = [], v = [];
21780
+ A2.forEach((M) => {
21778
21781
  M.html.includes("oembed-title") || M.html.includes("oembed-author") || M.html.includes("oembed-provider") || M.html.includes("oembed-description") ? w.push(M.html) : v.push(M.html);
21779
21782
  });
21780
21783
  let S = "";
@@ -21790,21 +21793,21 @@ const Gd = async (e, t, u, r, a) => {
21790
21793
  const i = e.title || "Untitled", n = e.author_name || "Unknown", c = e.html || "", h = ua(c) ? ta(c, e) : c, m = [];
21791
21794
  if (r.title !== void 0 && m.push({
21792
21795
  order: r.title,
21793
- html: `<div class="oembed-title">${R(i)}</div>`
21796
+ html: `<div class="oembed-title">${R$1(i)}</div>`
21794
21797
  }), r.author !== void 0 && m.push({
21795
21798
  order: r.author,
21796
- html: `<div class="oembed-author">by ${R(n)}</div>`
21799
+ html: `<div class="oembed-author">by ${R$1(n)}</div>`
21797
21800
  }), r.provider !== void 0 && m.push({
21798
21801
  order: r.provider,
21799
- html: `<div class="oembed-provider">${R(u)}</div>`
21802
+ html: `<div class="oembed-provider">${R$1(u)}</div>`
21800
21803
  }), r.description !== void 0 && e.author_name && m.push({
21801
21804
  order: r.description,
21802
- html: `<div class="oembed-description">${R(e.author_name)}</div>`
21805
+ html: `<div class="oembed-description">${R$1(e.author_name)}</div>`
21803
21806
  }), r.thumbnail !== void 0 && e.thumbnail_url && m.push({
21804
21807
  order: r.thumbnail,
21805
- html: At$1(
21806
- R(e.thumbnail_url),
21807
- R(i),
21808
+ html: At(
21809
+ R$1(e.thumbnail_url),
21810
+ R$1(i),
21808
21811
  "oembed-thumbnail"
21809
21812
  )
21810
21813
  }), r.embeddedContent !== void 0 && h && m.push({
@@ -21815,21 +21818,21 @@ const Gd = async (e, t, u, r, a) => {
21815
21818
  m.push({
21816
21819
  order: r.externalLink,
21817
21820
  html: `<div class="oembed-external-link">
21818
- <a href="${R(S)}" target="_blank" rel="noopener noreferrer">
21819
- Visit ${R(u)}
21821
+ <a href="${R$1(S)}" target="_blank" rel="noopener noreferrer">
21822
+ Visit ${R$1(u)}
21820
21823
  </a>
21821
21824
  </div>`
21822
21825
  });
21823
21826
  }
21824
- const f = m.sort((S, U2) => S.order - U2.order), T = [], A = [];
21827
+ const f = m.sort((S, U2) => S.order - U2.order), T = [], A2 = [];
21825
21828
  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) : A.push(S.html);
21829
+ 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);
21827
21830
  });
21828
21831
  let w = "";
21829
21832
  T.length > 0 && (w = `<div class="oembed-header">${T.join("")}</div>`);
21830
21833
  let v = "";
21831
- return A.length > 0 && (v = `<div class="oembed-content">
21832
- ${A.join("")}
21834
+ return A2.length > 0 && (v = `<div class="oembed-content">
21835
+ ${A2.join("")}
21833
21836
  </div>`), `<div class="oembed-container oembed-video">
21834
21837
  ${w}
21835
21838
  ${v}
@@ -21838,21 +21841,21 @@ const Gd = async (e, t, u, r, a) => {
21838
21841
  const i = e.title || "Link", n = e.author_name || "", c = e.thumbnail_url || "", h = [];
21839
21842
  if (r.title !== void 0 && h.push({
21840
21843
  order: r.title,
21841
- html: `<div class="oembed-title">${R(i)}</div>`
21844
+ html: `<div class="oembed-title">${R$1(i)}</div>`
21842
21845
  }), r.author !== void 0 && h.push({
21843
21846
  order: r.author,
21844
- html: `<div class="oembed-author">by ${R(e.author_name || "Unknown")}</div>`
21847
+ html: `<div class="oembed-author">by ${R$1(e.author_name || "Unknown")}</div>`
21845
21848
  }), r.provider !== void 0 && h.push({
21846
21849
  order: r.provider,
21847
- html: `<div class="oembed-provider">${R(u)}</div>`
21850
+ html: `<div class="oembed-provider">${R$1(u)}</div>`
21848
21851
  }), r.description !== void 0 && n && h.push({
21849
21852
  order: r.description,
21850
- html: `<div class="oembed-description">${R(n)}</div>`
21853
+ html: `<div class="oembed-description">${R$1(n)}</div>`
21851
21854
  }), r.thumbnail !== void 0 && c && h.push({
21852
21855
  order: r.thumbnail,
21853
- html: At$1(
21854
- R(c),
21855
- R(i),
21856
+ html: At(
21857
+ R$1(c),
21858
+ R$1(i),
21856
21859
  "oembed-thumbnail"
21857
21860
  )
21858
21861
  }), r.embeddedContent !== void 0 && e.html && h.push({
@@ -21862,8 +21865,8 @@ const Gd = async (e, t, u, r, a) => {
21862
21865
  const v = a.useMetadataUrlLink && e.web_page || t;
21863
21866
  h.push({
21864
21867
  order: r.externalLink,
21865
- html: `<a href="${R(v)}" target="_blank" rel="noopener noreferrer">
21866
- Visit ${R(u)}
21868
+ html: `<a href="${R$1(v)}" target="_blank" rel="noopener noreferrer">
21869
+ Visit ${R$1(u)}
21867
21870
  </a>`
21868
21871
  });
21869
21872
  }
@@ -21871,11 +21874,11 @@ const Gd = async (e, t, u, r, a) => {
21871
21874
  m.forEach((v) => {
21872
21875
  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);
21873
21876
  });
21874
- let A = "";
21875
- f.length > 0 && (A = `<div class="oembed-header">${f.join("")}</div>`);
21877
+ let A2 = "";
21878
+ f.length > 0 && (A2 = `<div class="oembed-header">${f.join("")}</div>`);
21876
21879
  let w = "";
21877
21880
  return T.length > 0 && (w = `<div class="oembed-content">${T.join("")}</div>`), `<div class="oembed-container oembed-link">
21878
- ${A}
21881
+ ${A2}
21879
21882
  ${w}
21880
21883
  </div>`;
21881
21884
  }, ta = (e, t) => {
@@ -21910,14 +21913,14 @@ const Gd = async (e, t, u, r, a) => {
21910
21913
  } else
21911
21914
  return `<div class="oembed-responsive-content">${e}</div>`;
21912
21915
  };
21913
- var L$1;
21916
+ var L;
21914
21917
  (function(e) {
21915
21918
  e.Root = "root", e.Text = "text", e.Directive = "directive", e.Comment = "comment", e.Script = "script", e.Style = "style", e.Tag = "tag", e.CDATA = "cdata", e.Doctype = "doctype";
21916
- })(L$1 || (L$1 = {}));
21919
+ })(L || (L = {}));
21917
21920
  function aa(e) {
21918
- return e.type === L$1.Tag || e.type === L$1.Script || e.type === L$1.Style;
21921
+ return e.type === L.Tag || e.type === L.Script || e.type === L.Style;
21919
21922
  }
21920
- const cu = L$1.Root, gr = L$1.Text, ia = L$1.Directive, Ar = L$1.Comment, na = L$1.Script, oa = L$1.Style, zt = L$1.Tag, ca = L$1.CDATA, da = L$1.Doctype;
21923
+ const cu = L.Root, gr = L.Text, ia = L.Directive, Ar = L.Comment, na = L.Script, oa = L.Style, zt = L.Tag, ca = L.CDATA, da = L.Doctype;
21921
21924
  class vr {
21922
21925
  constructor() {
21923
21926
  this.parent = null, this.prev = null, this.next = null, this.startIndex = null, this.endIndex = null;
@@ -21983,7 +21986,7 @@ class du extends vr {
21983
21986
  }
21984
21987
  class We extends du {
21985
21988
  constructor() {
21986
- super(...arguments), this.type = L$1.Text;
21989
+ super(...arguments), this.type = L.Text;
21987
21990
  }
21988
21991
  get nodeType() {
21989
21992
  return 3;
@@ -21991,7 +21994,7 @@ class We extends du {
21991
21994
  }
21992
21995
  class hu extends du {
21993
21996
  constructor() {
21994
- super(...arguments), this.type = L$1.Comment;
21997
+ super(...arguments), this.type = L.Comment;
21995
21998
  }
21996
21999
  get nodeType() {
21997
22000
  return 8;
@@ -21999,7 +22002,7 @@ class hu extends du {
21999
22002
  }
22000
22003
  class lu extends du {
22001
22004
  constructor(t, u) {
22002
- super(u), this.name = t, this.type = L$1.Directive;
22005
+ super(u), this.name = t, this.type = L.Directive;
22003
22006
  }
22004
22007
  get nodeType() {
22005
22008
  return 1;
@@ -22035,27 +22038,27 @@ class mu extends vr {
22035
22038
  }
22036
22039
  class wr extends mu {
22037
22040
  constructor() {
22038
- super(...arguments), this.type = L$1.CDATA;
22041
+ super(...arguments), this.type = L.CDATA;
22039
22042
  }
22040
22043
  get nodeType() {
22041
22044
  return 4;
22042
22045
  }
22043
22046
  }
22044
- class Ne extends mu {
22047
+ let Ne$1 = class Ne extends mu {
22045
22048
  constructor() {
22046
- super(...arguments), this.type = L$1.Root;
22049
+ super(...arguments), this.type = L.Root;
22047
22050
  }
22048
22051
  get nodeType() {
22049
22052
  return 9;
22050
22053
  }
22051
- }
22054
+ };
22052
22055
  class pu extends mu {
22053
22056
  /**
22054
22057
  * @param name Name of the tag, eg. `div`, `span`.
22055
22058
  * @param attribs Object mapping attribute names to attribute values.
22056
22059
  * @param children Children of the node.
22057
22060
  */
22058
- constructor(t, u, r = [], a = t === "script" ? L$1.Script : t === "style" ? L$1.Style : L$1.Tag) {
22061
+ constructor(t, u, r = [], a = t === "script" ? L.Script : t === "style" ? L.Style : L.Tag) {
22059
22062
  super(r), this.name = t, this.attribs = u, this.type = a;
22060
22063
  }
22061
22064
  get nodeType() {
@@ -22088,28 +22091,28 @@ function I(e) {
22088
22091
  return aa(e);
22089
22092
  }
22090
22093
  function wt(e) {
22091
- return e.type === L$1.CDATA;
22094
+ return e.type === L.CDATA;
22092
22095
  }
22093
- function se(e) {
22094
- return e.type === L$1.Text;
22096
+ function se$1(e) {
22097
+ return e.type === L.Text;
22095
22098
  }
22096
- function Nt$1(e) {
22097
- return e.type === L$1.Comment;
22099
+ function Nt(e) {
22100
+ return e.type === L.Comment;
22098
22101
  }
22099
- function Qt$1(e) {
22100
- return e.type === L$1.Directive;
22102
+ function Qt(e) {
22103
+ return e.type === L.Directive;
22101
22104
  }
22102
- function Te(e) {
22103
- return e.type === L$1.Root;
22105
+ function Te$1(e) {
22106
+ return e.type === L.Root;
22104
22107
  }
22105
22108
  function B$1(e) {
22106
22109
  return Object.prototype.hasOwnProperty.call(e, "children");
22107
22110
  }
22108
22111
  function ze(e, t = false) {
22109
22112
  let u;
22110
- if (se(e))
22113
+ if (se$1(e))
22111
22114
  u = new We(e.data);
22112
- else if (Nt$1(e))
22115
+ else if (Nt(e))
22113
22116
  u = new hu(e.data);
22114
22117
  else if (I(e)) {
22115
22118
  const r = t ? Mt(e.children) : [], a = new pu(e.name, { ...e.attribs }, r);
@@ -22117,10 +22120,10 @@ function ze(e, t = false) {
22117
22120
  } else if (wt(e)) {
22118
22121
  const r = t ? Mt(e.children) : [], a = new wr(r);
22119
22122
  r.forEach((i) => i.parent = a), u = a;
22120
- } else if (Te(e)) {
22121
- const r = t ? Mt(e.children) : [], a = new Ne(r);
22123
+ } else if (Te$1(e)) {
22124
+ const r = t ? Mt(e.children) : [], a = new Ne$1(r);
22122
22125
  r.forEach((i) => i.parent = a), e["x-mode"] && (a["x-mode"] = e["x-mode"]), u = a;
22123
- } else if (Qt$1(e)) {
22126
+ } else if (Qt(e)) {
22124
22127
  const r = new lu(e.name, e.data);
22125
22128
  e["x-name"] != null && (r["x-name"] = e["x-name"], r["x-publicId"] = e["x-publicId"], r["x-systemId"] = e["x-systemId"]), u = r;
22126
22129
  } else
@@ -22145,14 +22148,14 @@ class ha {
22145
22148
  * @param elementCB Callback whenever a tag is closed.
22146
22149
  */
22147
22150
  constructor(t, u, r) {
22148
- this.dom = [], this.root = new Ne(this.dom), this.done = false, this.tagStack = [this.root], this.lastNode = null, this.parser = null, typeof u == "function" && (r = u, u = Pu), typeof t == "object" && (u = t, t = void 0), this.callback = t ?? null, this.options = u ?? Pu, this.elementCB = r ?? null;
22151
+ this.dom = [], this.root = new Ne$1(this.dom), this.done = false, this.tagStack = [this.root], this.lastNode = null, this.parser = null, typeof u == "function" && (r = u, u = Pu), typeof t == "object" && (u = t, t = void 0), this.callback = t ?? null, this.options = u ?? Pu, this.elementCB = r ?? null;
22149
22152
  }
22150
22153
  onparserinit(t) {
22151
22154
  this.parser = t;
22152
22155
  }
22153
22156
  // Resets the handler back to starting state
22154
22157
  onreset() {
22155
- this.dom = [], this.root = new Ne(this.dom), this.done = false, this.tagStack = [this.root], this.lastNode = null, this.parser = null;
22158
+ this.dom = [], this.root = new Ne$1(this.dom), this.done = false, this.tagStack = [this.root], this.lastNode = null, this.parser = null;
22156
22159
  }
22157
22160
  // Signals the handler that parsing is done
22158
22161
  onend() {
@@ -22167,12 +22170,12 @@ class ha {
22167
22170
  this.options.withEndIndices && (t.endIndex = this.parser.endIndex), this.elementCB && this.elementCB(t);
22168
22171
  }
22169
22172
  onopentag(t, u) {
22170
- const r = this.options.xmlMode ? L$1.Tag : void 0, a = new pu(t, u, void 0, r);
22173
+ const r = this.options.xmlMode ? L.Tag : void 0, a = new pu(t, u, void 0, r);
22171
22174
  this.addNode(a), this.tagStack.push(a);
22172
22175
  }
22173
22176
  ontext(t) {
22174
22177
  const { lastNode: u } = this;
22175
- if (u && u.type === L$1.Text)
22178
+ if (u && u.type === L.Text)
22176
22179
  u.data += t, this.options.withEndIndices && (u.endIndex = this.parser.endIndex);
22177
22180
  else {
22178
22181
  const r = new We(t);
@@ -22180,7 +22183,7 @@ class ha {
22180
22183
  }
22181
22184
  }
22182
22185
  oncomment(t) {
22183
- if (this.lastNode && this.lastNode.type === L$1.Comment) {
22186
+ if (this.lastNode && this.lastNode.type === L.Comment) {
22184
22187
  this.lastNode.data += t;
22185
22188
  return;
22186
22189
  }
@@ -22393,7 +22396,7 @@ const Bu = /* @__PURE__ */ new Set([
22393
22396
  "track",
22394
22397
  "wbr"
22395
22398
  ]);
22396
- function xt$1(e, t = {}) {
22399
+ function xt(e, t = {}) {
22397
22400
  const u = "length" in e ? e : [e];
22398
22401
  let r = "";
22399
22402
  for (let a = 0; a < u.length; a++)
@@ -22403,7 +22406,7 @@ function xt$1(e, t = {}) {
22403
22406
  function Aa(e, t) {
22404
22407
  switch (e.type) {
22405
22408
  case cu:
22406
- return xt$1(e.children, t);
22409
+ return xt(e.children, t);
22407
22410
  // @ts-expect-error We don't use `Doctype` yet
22408
22411
  case da:
22409
22412
  case ia:
@@ -22442,7 +22445,7 @@ function Na(e, t) {
22442
22445
  ) : (
22443
22446
  // User explicitly asked for self-closing tags, even in HTML mode
22444
22447
  t.selfClosingTags && Bu.has(e.name)
22445
- )) ? (t.xmlMode || (r += " "), r += "/>") : (r += ">", e.children.length > 0 && (r += xt$1(e.children, t)), (t.xmlMode || !Bu.has(e.name)) && (r += `</${e.name}>`)), r;
22448
+ )) ? (t.xmlMode || (r += " "), r += "/>") : (r += ">", e.children.length > 0 && (r += xt(e.children, t)), (t.xmlMode || !Bu.has(e.name)) && (r += `</${e.name}>`)), r;
22446
22449
  }
22447
22450
  function xa(e) {
22448
22451
  return `<${e.data}>`;
@@ -22459,22 +22462,22 @@ function Ca(e) {
22459
22462
  return `<!--${e.data}-->`;
22460
22463
  }
22461
22464
  function Ir(e, t) {
22462
- return xt$1(e, t);
22465
+ return xt(e, t);
22463
22466
  }
22464
22467
  function ya(e, t) {
22465
22468
  return B$1(e) ? e.children.map((u) => Ir(u, t)).join("") : "";
22466
22469
  }
22467
- function ot(e) {
22468
- return Array.isArray(e) ? e.map(ot).join("") : I(e) ? e.name === "br" ? `
22469
- ` : ot(e.children) : wt(e) ? ot(e.children) : se(e) ? e.data : "";
22470
+ function ot$1(e) {
22471
+ return Array.isArray(e) ? e.map(ot$1).join("") : I(e) ? e.name === "br" ? `
22472
+ ` : ot$1(e.children) : wt(e) ? ot$1(e.children) : se$1(e) ? e.data : "";
22470
22473
  }
22471
- function Le(e) {
22472
- return Array.isArray(e) ? e.map(Le).join("") : B$1(e) && !Nt$1(e) ? Le(e.children) : se(e) ? e.data : "";
22474
+ function Le$1(e) {
22475
+ return Array.isArray(e) ? e.map(Le$1).join("") : B$1(e) && !Nt(e) ? Le$1(e.children) : se$1(e) ? e.data : "";
22473
22476
  }
22474
22477
  function dt(e) {
22475
- return Array.isArray(e) ? e.map(dt).join("") : B$1(e) && (e.type === L$1.Tag || wt(e)) ? dt(e.children) : se(e) ? e.data : "";
22478
+ return Array.isArray(e) ? e.map(dt).join("") : B$1(e) && (e.type === L.Tag || wt(e)) ? dt(e.children) : se$1(e) ? e.data : "";
22476
22479
  }
22477
- function It$1(e) {
22480
+ function It(e) {
22478
22481
  return B$1(e) ? e.children : [];
22479
22482
  }
22480
22483
  function Sr(e) {
@@ -22483,7 +22486,7 @@ function Sr(e) {
22483
22486
  function Cr(e) {
22484
22487
  const t = Sr(e);
22485
22488
  if (t != null)
22486
- return It$1(t);
22489
+ return It(t);
22487
22490
  const u = [e];
22488
22491
  let { prev: r, next: a } = e;
22489
22492
  for (; r != null; )
@@ -22514,7 +22517,7 @@ function bu(e) {
22514
22517
  ({ prev: t } = t);
22515
22518
  return t;
22516
22519
  }
22517
- function Ie(e) {
22520
+ function Ie$1(e) {
22518
22521
  if (e.prev && (e.prev.next = e.next), e.next && (e.next.prev = e.prev), e.parent) {
22519
22522
  const t = e.parent.children, u = t.lastIndexOf(e);
22520
22523
  u >= 0 && t.splice(u, 1);
@@ -22533,14 +22536,14 @@ function Da(e, t) {
22533
22536
  }
22534
22537
  }
22535
22538
  function ka(e, t) {
22536
- if (Ie(t), t.next = null, t.parent = e, e.children.push(t) > 1) {
22539
+ if (Ie$1(t), t.next = null, t.parent = e, e.children.push(t) > 1) {
22537
22540
  const u = e.children[e.children.length - 2];
22538
22541
  u.next = t, t.prev = u;
22539
22542
  } else
22540
22543
  t.prev = null;
22541
22544
  }
22542
22545
  function Pa(e, t) {
22543
- Ie(t);
22546
+ Ie$1(t);
22544
22547
  const { parent: u } = e, r = e.next;
22545
22548
  if (t.next = r, t.prev = e, e.next = t, t.parent = u, r) {
22546
22549
  if (r.prev = t, u) {
@@ -22550,14 +22553,14 @@ function Pa(e, t) {
22550
22553
  } else u && u.children.push(t);
22551
22554
  }
22552
22555
  function Ma(e, t) {
22553
- if (Ie(t), t.parent = e, t.prev = null, e.children.unshift(t) !== 1) {
22556
+ if (Ie$1(t), t.parent = e, t.prev = null, e.children.unshift(t) !== 1) {
22554
22557
  const u = e.children[1];
22555
22558
  u.prev = t, t.next = u;
22556
22559
  } else
22557
22560
  t.next = null;
22558
22561
  }
22559
22562
  function Ba(e, t) {
22560
- Ie(t);
22563
+ Ie$1(t);
22561
22564
  const { parent: u } = e;
22562
22565
  if (u) {
22563
22566
  const r = u.children;
@@ -22624,7 +22627,7 @@ const ht = {
22624
22627
  return typeof e == "function" ? (t) => e(t.type) : (t) => t.type === e;
22625
22628
  },
22626
22629
  tag_contains(e) {
22627
- return typeof e == "function" ? (t) => se(t) && e(t.data) : (t) => se(t) && t.data === e;
22630
+ return typeof e == "function" ? (t) => se$1(t) && e(t.data) : (t) => se$1(t) && t.data === e;
22628
22631
  }
22629
22632
  };
22630
22633
  function _u(e, t) {
@@ -22676,10 +22679,10 @@ function Ga(e) {
22676
22679
  }
22677
22680
  return e;
22678
22681
  }
22679
- var Z$1;
22682
+ var Z;
22680
22683
  (function(e) {
22681
22684
  e[e.DISCONNECTED = 1] = "DISCONNECTED", e[e.PRECEDING = 2] = "PRECEDING", e[e.FOLLOWING = 4] = "FOLLOWING", e[e.CONTAINS = 8] = "CONTAINS", e[e.CONTAINED_BY = 16] = "CONTAINED_BY";
22682
- })(Z$1 || (Z$1 = {}));
22685
+ })(Z || (Z = {}));
22683
22686
  function Lr(e, t) {
22684
22687
  const u = [], r = [];
22685
22688
  if (e === t)
@@ -22694,14 +22697,14 @@ function Lr(e, t) {
22694
22697
  for (; n < i && u[n] === r[n]; )
22695
22698
  n++;
22696
22699
  if (n === 0)
22697
- return Z$1.DISCONNECTED;
22700
+ return Z.DISCONNECTED;
22698
22701
  const c = u[n - 1], h = c.children, m = u[n], f = r[n];
22699
- return h.indexOf(m) > h.indexOf(f) ? c === t ? Z$1.FOLLOWING | Z$1.CONTAINED_BY : Z$1.FOLLOWING : c === e ? Z$1.PRECEDING | Z$1.CONTAINS : Z$1.PRECEDING;
22702
+ return h.indexOf(m) > h.indexOf(f) ? c === t ? Z.FOLLOWING | Z.CONTAINED_BY : Z.FOLLOWING : c === e ? Z.PRECEDING | Z.CONTAINS : Z.PRECEDING;
22700
22703
  }
22701
22704
  function ke(e) {
22702
22705
  return e = e.filter((t, u, r) => !r.includes(t, u + 1)), e.sort((t, u) => {
22703
22706
  const r = Lr(t, u);
22704
- return r & Z$1.PRECEDING ? -1 : r & Z$1.FOLLOWING ? 1 : 0;
22707
+ return r & Z.PRECEDING ? -1 : r & Z.FOLLOWING ? 1 : 0;
22705
22708
  }), e;
22706
22709
  }
22707
22710
  function Wa(e) {
@@ -22720,8 +22723,8 @@ function za(e) {
22720
22723
  f && (m.link = f);
22721
22724
  const T = fe("summary", h) || fe("content", h);
22722
22725
  T && (m.description = T);
22723
- const A = fe("updated", h);
22724
- return A && (m.pubDate = new Date(A)), m;
22726
+ const A2 = fe("updated", h);
22727
+ return A2 && (m.pubDate = new Date(A2)), m;
22725
22728
  })
22726
22729
  };
22727
22730
  Q$1(r, "id", "id", u), Q$1(r, "title", "title", u);
@@ -22773,7 +22776,7 @@ function lt(e, t) {
22773
22776
  return De(e, t, true, 1)[0];
22774
22777
  }
22775
22778
  function fe(e, t, u = false) {
22776
- return Le(De(e, t, u, 1)).trim();
22779
+ return Le$1(De(e, t, u, 1)).trim();
22777
22780
  }
22778
22781
  function Q$1(e, t, u, r, a = false) {
22779
22782
  const i = fe(u, r, a);
@@ -22782,10 +22785,10 @@ function Q$1(e, t, u, r, a = false) {
22782
22785
  function Za(e) {
22783
22786
  return e === "rss" || e === "feed" || e === "rdf:RDF";
22784
22787
  }
22785
- const St$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
22788
+ const St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
22786
22789
  __proto__: null,
22787
22790
  get DocumentPosition() {
22788
- return Z$1;
22791
+ return Z;
22789
22792
  },
22790
22793
  append: Pa,
22791
22794
  appendChild: ka,
@@ -22797,7 +22800,7 @@ const St$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
22797
22800
  findOne: Tu,
22798
22801
  findOneChild: Ua,
22799
22802
  getAttributeValue: Oa,
22800
- getChildren: It$1,
22803
+ getChildren: It,
22801
22804
  getElementById: ja,
22802
22805
  getElements: Ya,
22803
22806
  getElementsByClassName: Va,
@@ -22809,24 +22812,24 @@ const St$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
22809
22812
  getOuterHTML: Ir,
22810
22813
  getParent: Sr,
22811
22814
  getSiblings: Cr,
22812
- getText: ot,
22815
+ getText: ot$1,
22813
22816
  hasAttrib: La,
22814
22817
  hasChildren: B$1,
22815
22818
  innerText: dt,
22816
22819
  isCDATA: wt,
22817
- isComment: Nt$1,
22818
- isDocument: Te,
22820
+ isComment: Nt,
22821
+ isDocument: Te$1,
22819
22822
  isTag: I,
22820
- isText: se,
22823
+ isText: se$1,
22821
22824
  nextElementSibling: fu,
22822
22825
  prepend: Ba,
22823
22826
  prependChild: Ma,
22824
22827
  prevElementSibling: bu,
22825
- removeElement: Ie,
22828
+ removeElement: Ie$1,
22826
22829
  removeSubsets: Ga,
22827
22830
  replaceElement: Da,
22828
22831
  testElement: qa,
22829
- textContent: Le,
22832
+ textContent: Le$1,
22830
22833
  uniqueSort: ke
22831
22834
  }, Symbol.toStringTag, { value: "Module" })), Ja = {
22832
22835
  _useHtmlParser2: false
@@ -22862,7 +22865,7 @@ function Qe(e) {
22862
22865
  const t = e ?? (this ? this.root() : []);
22863
22866
  let u = "";
22864
22867
  for (let r = 0; r < t.length; r++)
22865
- u += Le(t[r]);
22868
+ u += Le$1(t[r]);
22866
22869
  return u;
22867
22870
  }
22868
22871
  function ri(e, t, u = typeof t == "boolean" ? t : false) {
@@ -22936,7 +22939,7 @@ var ve;
22936
22939
  (function(e) {
22937
22940
  e[e.LowerA = 97] = "LowerA", e[e.LowerZ = 122] = "LowerZ", e[e.UpperA = 65] = "UpperA", e[e.UpperZ = 90] = "UpperZ", e[e.Exclamation = 33] = "Exclamation";
22938
22941
  })(ve || (ve = {}));
22939
- function Xt$1(e) {
22942
+ function Xt(e) {
22940
22943
  const t = e.indexOf("<");
22941
22944
  if (t === -1 || t > e.length - 3)
22942
22945
  return false;
@@ -22992,42 +22995,42 @@ function mi(e) {
22992
22995
  var t;
22993
22996
  return e >= 55296 && e <= 57343 || e > 1114111 ? 65533 : (t = li.get(e)) !== null && t !== void 0 ? t : e;
22994
22997
  }
22995
- var V$1;
22998
+ var V;
22996
22999
  (function(e) {
22997
23000
  e[e.NUM = 35] = "NUM", e[e.SEMI = 59] = "SEMI", e[e.EQUALS = 61] = "EQUALS", e[e.ZERO = 48] = "ZERO", e[e.NINE = 57] = "NINE", e[e.LOWER_A = 97] = "LOWER_A", e[e.LOWER_F = 102] = "LOWER_F", e[e.LOWER_X = 120] = "LOWER_X", e[e.LOWER_Z = 122] = "LOWER_Z", e[e.UPPER_A = 65] = "UPPER_A", e[e.UPPER_F = 70] = "UPPER_F", e[e.UPPER_Z = 90] = "UPPER_Z";
22998
- })(V$1 || (V$1 = {}));
23001
+ })(V || (V = {}));
22999
23002
  const pi = 32;
23000
23003
  var be;
23001
23004
  (function(e) {
23002
23005
  e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE";
23003
23006
  })(be || (be = {}));
23004
- function Zt$1(e) {
23005
- return e >= V$1.ZERO && e <= V$1.NINE;
23007
+ function Zt(e) {
23008
+ return e >= V.ZERO && e <= V.NINE;
23006
23009
  }
23007
23010
  function fi(e) {
23008
- return e >= V$1.UPPER_A && e <= V$1.UPPER_F || e >= V$1.LOWER_A && e <= V$1.LOWER_F;
23011
+ return e >= V.UPPER_A && e <= V.UPPER_F || e >= V.LOWER_A && e <= V.LOWER_F;
23009
23012
  }
23010
23013
  function bi(e) {
23011
- return e >= V$1.UPPER_A && e <= V$1.UPPER_Z || e >= V$1.LOWER_A && e <= V$1.LOWER_Z || Zt$1(e);
23014
+ return e >= V.UPPER_A && e <= V.UPPER_Z || e >= V.LOWER_A && e <= V.LOWER_Z || Zt(e);
23012
23015
  }
23013
23016
  function Ei(e) {
23014
- return e === V$1.EQUALS || bi(e);
23017
+ return e === V.EQUALS || bi(e);
23015
23018
  }
23016
- var q$1;
23019
+ var q;
23017
23020
  (function(e) {
23018
23021
  e[e.EntityStart = 0] = "EntityStart", e[e.NumericStart = 1] = "NumericStart", e[e.NumericDecimal = 2] = "NumericDecimal", e[e.NumericHex = 3] = "NumericHex", e[e.NamedEntity = 4] = "NamedEntity";
23019
- })(q$1 || (q$1 = {}));
23022
+ })(q || (q = {}));
23020
23023
  var ue;
23021
23024
  (function(e) {
23022
23025
  e[e.Legacy = 0] = "Legacy", e[e.Strict = 1] = "Strict", e[e.Attribute = 2] = "Attribute";
23023
23026
  })(ue || (ue = {}));
23024
23027
  let Ti = class {
23025
23028
  constructor(t, u, r) {
23026
- this.decodeTree = t, this.emitCodePoint = u, this.errors = r, this.state = q$1.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = ue.Strict;
23029
+ this.decodeTree = t, this.emitCodePoint = u, this.errors = r, this.state = q.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = ue.Strict;
23027
23030
  }
23028
23031
  /** Resets the instance to make it reusable. */
23029
23032
  startEntity(t) {
23030
- this.decodeMode = t, this.state = q$1.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
23033
+ this.decodeMode = t, this.state = q.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
23031
23034
  }
23032
23035
  /**
23033
23036
  * Write an entity to the decoder. This can be called multiple times with partial entities.
@@ -23042,15 +23045,15 @@ let Ti = class {
23042
23045
  */
23043
23046
  write(t, u) {
23044
23047
  switch (this.state) {
23045
- case q$1.EntityStart:
23046
- return t.charCodeAt(u) === V$1.NUM ? (this.state = q$1.NumericStart, this.consumed += 1, this.stateNumericStart(t, u + 1)) : (this.state = q$1.NamedEntity, this.stateNamedEntity(t, u));
23047
- case q$1.NumericStart:
23048
+ case q.EntityStart:
23049
+ return t.charCodeAt(u) === V.NUM ? (this.state = q.NumericStart, this.consumed += 1, this.stateNumericStart(t, u + 1)) : (this.state = q.NamedEntity, this.stateNamedEntity(t, u));
23050
+ case q.NumericStart:
23048
23051
  return this.stateNumericStart(t, u);
23049
- case q$1.NumericDecimal:
23052
+ case q.NumericDecimal:
23050
23053
  return this.stateNumericDecimal(t, u);
23051
- case q$1.NumericHex:
23054
+ case q.NumericHex:
23052
23055
  return this.stateNumericHex(t, u);
23053
- case q$1.NamedEntity:
23056
+ case q.NamedEntity:
23054
23057
  return this.stateNamedEntity(t, u);
23055
23058
  }
23056
23059
  }
@@ -23064,7 +23067,7 @@ let Ti = class {
23064
23067
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
23065
23068
  */
23066
23069
  stateNumericStart(t, u) {
23067
- return u >= t.length ? -1 : (t.charCodeAt(u) | pi) === V$1.LOWER_X ? (this.state = q$1.NumericHex, this.consumed += 1, this.stateNumericHex(t, u + 1)) : (this.state = q$1.NumericDecimal, this.stateNumericDecimal(t, u));
23070
+ return u >= t.length ? -1 : (t.charCodeAt(u) | pi) === V.LOWER_X ? (this.state = q.NumericHex, this.consumed += 1, this.stateNumericHex(t, u + 1)) : (this.state = q.NumericDecimal, this.stateNumericDecimal(t, u));
23068
23071
  }
23069
23072
  addToNumericResult(t, u, r, a) {
23070
23073
  if (u !== r) {
@@ -23085,7 +23088,7 @@ let Ti = class {
23085
23088
  const r = u;
23086
23089
  for (; u < t.length; ) {
23087
23090
  const a = t.charCodeAt(u);
23088
- if (Zt$1(a) || fi(a))
23091
+ if (Zt(a) || fi(a))
23089
23092
  u += 1;
23090
23093
  else
23091
23094
  return this.addToNumericResult(t, r, u, 16), this.emitNumericEntity(a, 3);
@@ -23105,7 +23108,7 @@ let Ti = class {
23105
23108
  const r = u;
23106
23109
  for (; u < t.length; ) {
23107
23110
  const a = t.charCodeAt(u);
23108
- if (Zt$1(a))
23111
+ if (Zt(a))
23109
23112
  u += 1;
23110
23113
  else
23111
23114
  return this.addToNumericResult(t, r, u, 10), this.emitNumericEntity(a, 2);
@@ -23129,11 +23132,11 @@ let Ti = class {
23129
23132
  var r;
23130
23133
  if (this.consumed <= u)
23131
23134
  return (r = this.errors) === null || r === void 0 || r.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
23132
- if (t === V$1.SEMI)
23135
+ if (t === V.SEMI)
23133
23136
  this.consumed += 1;
23134
23137
  else if (this.decodeMode === ue.Strict)
23135
23138
  return 0;
23136
- return this.emitCodePoint(mi(this.result), this.consumed), this.errors && (t !== V$1.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
23139
+ return this.emitCodePoint(mi(this.result), this.consumed), this.errors && (t !== V.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
23137
23140
  }
23138
23141
  /**
23139
23142
  * Parses a named entity.
@@ -23155,7 +23158,7 @@ let Ti = class {
23155
23158
  (i === 0 || // And there should be no invalid characters.
23156
23159
  Ei(n)) ? 0 : this.emitNotTerminatedNamedEntity();
23157
23160
  if (a = r[this.treeIndex], i = (a & be.VALUE_LENGTH) >> 14, i !== 0) {
23158
- if (n === V$1.SEMI)
23161
+ if (n === V.SEMI)
23159
23162
  return this.emitNamedEntityData(this.treeIndex, i, this.consumed + this.excess);
23160
23163
  this.decodeMode !== ue.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
23161
23164
  }
@@ -23195,16 +23198,16 @@ let Ti = class {
23195
23198
  end() {
23196
23199
  var t;
23197
23200
  switch (this.state) {
23198
- case q$1.NamedEntity:
23201
+ case q.NamedEntity:
23199
23202
  return this.result !== 0 && (this.decodeMode !== ue.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
23200
23203
  // Otherwise, emit a numeric entity if we have one.
23201
- case q$1.NumericDecimal:
23204
+ case q.NumericDecimal:
23202
23205
  return this.emitNumericEntity(0, 2);
23203
- case q$1.NumericHex:
23206
+ case q.NumericHex:
23204
23207
  return this.emitNumericEntity(0, 3);
23205
- case q$1.NumericStart:
23208
+ case q.NumericStart:
23206
23209
  return (t = this.errors) === null || t === void 0 || t.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
23207
- case q$1.EntityStart:
23210
+ case q.EntityStart:
23208
23211
  return 0;
23209
23212
  }
23210
23213
  }
@@ -23233,15 +23236,15 @@ var x;
23233
23236
  (function(e) {
23234
23237
  e[e.Tab = 9] = "Tab", e[e.NewLine = 10] = "NewLine", e[e.FormFeed = 12] = "FormFeed", e[e.CarriageReturn = 13] = "CarriageReturn", e[e.Space = 32] = "Space", e[e.ExclamationMark = 33] = "ExclamationMark", e[e.Number = 35] = "Number", e[e.Amp = 38] = "Amp", e[e.SingleQuote = 39] = "SingleQuote", e[e.DoubleQuote = 34] = "DoubleQuote", e[e.Dash = 45] = "Dash", e[e.Slash = 47] = "Slash", e[e.Zero = 48] = "Zero", e[e.Nine = 57] = "Nine", e[e.Semi = 59] = "Semi", e[e.Lt = 60] = "Lt", e[e.Eq = 61] = "Eq", e[e.Gt = 62] = "Gt", e[e.Questionmark = 63] = "Questionmark", e[e.UpperA = 65] = "UpperA", e[e.LowerA = 97] = "LowerA", e[e.UpperF = 70] = "UpperF", e[e.LowerF = 102] = "LowerF", e[e.UpperZ = 90] = "UpperZ", e[e.LowerZ = 122] = "LowerZ", e[e.LowerX = 120] = "LowerX", e[e.OpeningSquareBracket = 91] = "OpeningSquareBracket";
23235
23238
  })(x || (x = {}));
23236
- var _$1;
23239
+ var _;
23237
23240
  (function(e) {
23238
23241
  e[e.Text = 1] = "Text", e[e.BeforeTagName = 2] = "BeforeTagName", e[e.InTagName = 3] = "InTagName", e[e.InSelfClosingTag = 4] = "InSelfClosingTag", e[e.BeforeClosingTagName = 5] = "BeforeClosingTagName", e[e.InClosingTagName = 6] = "InClosingTagName", e[e.AfterClosingTagName = 7] = "AfterClosingTagName", e[e.BeforeAttributeName = 8] = "BeforeAttributeName", e[e.InAttributeName = 9] = "InAttributeName", e[e.AfterAttributeName = 10] = "AfterAttributeName", e[e.BeforeAttributeValue = 11] = "BeforeAttributeValue", e[e.InAttributeValueDq = 12] = "InAttributeValueDq", e[e.InAttributeValueSq = 13] = "InAttributeValueSq", e[e.InAttributeValueNq = 14] = "InAttributeValueNq", e[e.BeforeDeclaration = 15] = "BeforeDeclaration", e[e.InDeclaration = 16] = "InDeclaration", e[e.InProcessingInstruction = 17] = "InProcessingInstruction", e[e.BeforeComment = 18] = "BeforeComment", e[e.CDATASequence = 19] = "CDATASequence", e[e.InSpecialComment = 20] = "InSpecialComment", e[e.InCommentLike = 21] = "InCommentLike", e[e.BeforeSpecialS = 22] = "BeforeSpecialS", e[e.BeforeSpecialT = 23] = "BeforeSpecialT", e[e.SpecialStartSequence = 24] = "SpecialStartSequence", e[e.InSpecialTag = 25] = "InSpecialTag", e[e.InEntity = 26] = "InEntity";
23239
- })(_$1 || (_$1 = {}));
23240
- function ne(e) {
23242
+ })(_ || (_ = {}));
23243
+ function ne$1(e) {
23241
23244
  return e === x.Space || e === x.NewLine || e === x.Tab || e === x.FormFeed || e === x.CarriageReturn;
23242
23245
  }
23243
23246
  function st(e) {
23244
- return e === x.Slash || e === x.Gt || ne(e);
23247
+ return e === x.Slash || e === x.Gt || ne$1(e);
23245
23248
  }
23246
23249
  function gi(e) {
23247
23250
  return e >= x.LowerA && e <= x.LowerZ || e >= x.UpperA && e <= x.UpperZ;
@@ -23281,10 +23284,10 @@ const F = {
23281
23284
  };
23282
23285
  let Ai = class {
23283
23286
  constructor({ xmlMode: t = false, decodeEntities: u = true }, r) {
23284
- this.cbs = r, this.state = _$1.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.entityStart = 0, this.baseState = _$1.Text, this.isSpecial = false, this.running = true, this.offset = 0, this.currentSequence = void 0, this.sequenceIndex = 0, this.xmlMode = t, this.decodeEntities = u, this.entityDecoder = new Ti(t ? hi : di, (a, i) => this.emitCodePoint(a, i));
23287
+ this.cbs = r, this.state = _.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.entityStart = 0, this.baseState = _.Text, this.isSpecial = false, this.running = true, this.offset = 0, this.currentSequence = void 0, this.sequenceIndex = 0, this.xmlMode = t, this.decodeEntities = u, this.entityDecoder = new Ti(t ? hi : di, (a, i) => this.emitCodePoint(a, i));
23285
23288
  }
23286
23289
  reset() {
23287
- this.state = _$1.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = _$1.Text, this.currentSequence = void 0, this.running = true, this.offset = 0;
23290
+ this.state = _.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = _.Text, this.currentSequence = void 0, this.running = true, this.offset = 0;
23288
23291
  }
23289
23292
  write(t) {
23290
23293
  this.offset += this.buffer.length, this.buffer = t, this.parse();
@@ -23299,7 +23302,7 @@ let Ai = class {
23299
23302
  this.running = true, this.index < this.buffer.length + this.offset && this.parse();
23300
23303
  }
23301
23304
  stateText(t) {
23302
- t === x.Lt || !this.decodeEntities && this.fastForwardTo(x.Lt) ? (this.index > this.sectionStart && this.cbs.ontext(this.sectionStart, this.index), this.state = _$1.BeforeTagName, this.sectionStart = this.index) : this.decodeEntities && t === x.Amp && this.startEntity();
23305
+ t === x.Lt || !this.decodeEntities && this.fastForwardTo(x.Lt) ? (this.index > this.sectionStart && this.cbs.ontext(this.sectionStart, this.index), this.state = _.BeforeTagName, this.sectionStart = this.index) : this.decodeEntities && t === x.Amp && this.startEntity();
23303
23306
  }
23304
23307
  stateSpecialStartSequence(t) {
23305
23308
  const u = this.sequenceIndex === this.currentSequence.length;
@@ -23315,12 +23318,12 @@ let Ai = class {
23315
23318
  this.sequenceIndex++;
23316
23319
  return;
23317
23320
  }
23318
- this.sequenceIndex = 0, this.state = _$1.InTagName, this.stateInTagName(t);
23321
+ this.sequenceIndex = 0, this.state = _.InTagName, this.stateInTagName(t);
23319
23322
  }
23320
23323
  /** Look for an end tag. For <title> tags, also decode entities. */
23321
23324
  stateInSpecialTag(t) {
23322
23325
  if (this.sequenceIndex === this.currentSequence.length) {
23323
- if (t === x.Gt || ne(t)) {
23326
+ if (t === x.Gt || ne$1(t)) {
23324
23327
  const u = this.index - this.currentSequence.length;
23325
23328
  if (this.sectionStart < u) {
23326
23329
  const r = this.index;
@@ -23334,7 +23337,7 @@ let Ai = class {
23334
23337
  (t | 32) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : this.sequenceIndex === 0 ? this.currentSequence === F.TitleEnd ? this.decodeEntities && t === x.Amp && this.startEntity() : this.fastForwardTo(x.Lt) && (this.sequenceIndex = 1) : this.sequenceIndex = +(t === x.Lt);
23335
23338
  }
23336
23339
  stateCDATASequence(t) {
23337
- t === F.Cdata[this.sequenceIndex] ? ++this.sequenceIndex === F.Cdata.length && (this.state = _$1.InCommentLike, this.currentSequence = F.CdataEnd, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : (this.sequenceIndex = 0, this.state = _$1.InDeclaration, this.stateInDeclaration(t));
23340
+ t === F.Cdata[this.sequenceIndex] ? ++this.sequenceIndex === F.Cdata.length && (this.state = _.InCommentLike, this.currentSequence = F.CdataEnd, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : (this.sequenceIndex = 0, this.state = _.InDeclaration, this.stateInDeclaration(t));
23338
23341
  }
23339
23342
  /**
23340
23343
  * When we wait for one specific character, we can speed things up
@@ -23357,7 +23360,7 @@ let Ai = class {
23357
23360
  * - All characters but the start character of the sequence can be skipped.
23358
23361
  */
23359
23362
  stateInCommentLike(t) {
23360
- t === this.currentSequence[this.sequenceIndex] ? ++this.sequenceIndex === this.currentSequence.length && (this.currentSequence === F.CdataEnd ? this.cbs.oncdata(this.sectionStart, this.index, 2) : this.cbs.oncomment(this.sectionStart, this.index, 2), this.sequenceIndex = 0, this.sectionStart = this.index + 1, this.state = _$1.Text) : this.sequenceIndex === 0 ? this.fastForwardTo(this.currentSequence[0]) && (this.sequenceIndex = 1) : t !== this.currentSequence[this.sequenceIndex - 1] && (this.sequenceIndex = 0);
23363
+ t === this.currentSequence[this.sequenceIndex] ? ++this.sequenceIndex === this.currentSequence.length && (this.currentSequence === F.CdataEnd ? this.cbs.oncdata(this.sectionStart, this.index, 2) : this.cbs.oncomment(this.sectionStart, this.index, 2), this.sequenceIndex = 0, this.sectionStart = this.index + 1, this.state = _.Text) : this.sequenceIndex === 0 ? this.fastForwardTo(this.currentSequence[0]) && (this.sequenceIndex = 1) : t !== this.currentSequence[this.sequenceIndex - 1] && (this.sequenceIndex = 0);
23361
23364
  }
23362
23365
  /**
23363
23366
  * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.
@@ -23369,47 +23372,47 @@ let Ai = class {
23369
23372
  return this.xmlMode ? !st(t) : gi(t);
23370
23373
  }
23371
23374
  startSpecial(t, u) {
23372
- this.isSpecial = true, this.currentSequence = t, this.sequenceIndex = u, this.state = _$1.SpecialStartSequence;
23375
+ this.isSpecial = true, this.currentSequence = t, this.sequenceIndex = u, this.state = _.SpecialStartSequence;
23373
23376
  }
23374
23377
  stateBeforeTagName(t) {
23375
23378
  if (t === x.ExclamationMark)
23376
- this.state = _$1.BeforeDeclaration, this.sectionStart = this.index + 1;
23379
+ this.state = _.BeforeDeclaration, this.sectionStart = this.index + 1;
23377
23380
  else if (t === x.Questionmark)
23378
- this.state = _$1.InProcessingInstruction, this.sectionStart = this.index + 1;
23381
+ this.state = _.InProcessingInstruction, this.sectionStart = this.index + 1;
23379
23382
  else if (this.isTagStartChar(t)) {
23380
23383
  const u = t | 32;
23381
- this.sectionStart = this.index, this.xmlMode ? this.state = _$1.InTagName : u === F.ScriptEnd[2] ? this.state = _$1.BeforeSpecialS : u === F.TitleEnd[2] || u === F.XmpEnd[2] ? this.state = _$1.BeforeSpecialT : this.state = _$1.InTagName;
23382
- } else t === x.Slash ? this.state = _$1.BeforeClosingTagName : (this.state = _$1.Text, this.stateText(t));
23384
+ this.sectionStart = this.index, this.xmlMode ? this.state = _.InTagName : u === F.ScriptEnd[2] ? this.state = _.BeforeSpecialS : u === F.TitleEnd[2] || u === F.XmpEnd[2] ? this.state = _.BeforeSpecialT : this.state = _.InTagName;
23385
+ } else t === x.Slash ? this.state = _.BeforeClosingTagName : (this.state = _.Text, this.stateText(t));
23383
23386
  }
23384
23387
  stateInTagName(t) {
23385
- st(t) && (this.cbs.onopentagname(this.sectionStart, this.index), this.sectionStart = -1, this.state = _$1.BeforeAttributeName, this.stateBeforeAttributeName(t));
23388
+ st(t) && (this.cbs.onopentagname(this.sectionStart, this.index), this.sectionStart = -1, this.state = _.BeforeAttributeName, this.stateBeforeAttributeName(t));
23386
23389
  }
23387
23390
  stateBeforeClosingTagName(t) {
23388
- ne(t) || (t === x.Gt ? this.state = _$1.Text : (this.state = this.isTagStartChar(t) ? _$1.InClosingTagName : _$1.InSpecialComment, this.sectionStart = this.index));
23391
+ ne$1(t) || (t === x.Gt ? this.state = _.Text : (this.state = this.isTagStartChar(t) ? _.InClosingTagName : _.InSpecialComment, this.sectionStart = this.index));
23389
23392
  }
23390
23393
  stateInClosingTagName(t) {
23391
- (t === x.Gt || ne(t)) && (this.cbs.onclosetag(this.sectionStart, this.index), this.sectionStart = -1, this.state = _$1.AfterClosingTagName, this.stateAfterClosingTagName(t));
23394
+ (t === x.Gt || ne$1(t)) && (this.cbs.onclosetag(this.sectionStart, this.index), this.sectionStart = -1, this.state = _.AfterClosingTagName, this.stateAfterClosingTagName(t));
23392
23395
  }
23393
23396
  stateAfterClosingTagName(t) {
23394
- (t === x.Gt || this.fastForwardTo(x.Gt)) && (this.state = _$1.Text, this.sectionStart = this.index + 1);
23397
+ (t === x.Gt || this.fastForwardTo(x.Gt)) && (this.state = _.Text, this.sectionStart = this.index + 1);
23395
23398
  }
23396
23399
  stateBeforeAttributeName(t) {
23397
- t === x.Gt ? (this.cbs.onopentagend(this.index), this.isSpecial ? (this.state = _$1.InSpecialTag, this.sequenceIndex = 0) : this.state = _$1.Text, this.sectionStart = this.index + 1) : t === x.Slash ? this.state = _$1.InSelfClosingTag : ne(t) || (this.state = _$1.InAttributeName, this.sectionStart = this.index);
23400
+ t === x.Gt ? (this.cbs.onopentagend(this.index), this.isSpecial ? (this.state = _.InSpecialTag, this.sequenceIndex = 0) : this.state = _.Text, this.sectionStart = this.index + 1) : t === x.Slash ? this.state = _.InSelfClosingTag : ne$1(t) || (this.state = _.InAttributeName, this.sectionStart = this.index);
23398
23401
  }
23399
23402
  stateInSelfClosingTag(t) {
23400
- t === x.Gt ? (this.cbs.onselfclosingtag(this.index), this.state = _$1.Text, this.sectionStart = this.index + 1, this.isSpecial = false) : ne(t) || (this.state = _$1.BeforeAttributeName, this.stateBeforeAttributeName(t));
23403
+ t === x.Gt ? (this.cbs.onselfclosingtag(this.index), this.state = _.Text, this.sectionStart = this.index + 1, this.isSpecial = false) : ne$1(t) || (this.state = _.BeforeAttributeName, this.stateBeforeAttributeName(t));
23401
23404
  }
23402
23405
  stateInAttributeName(t) {
23403
- (t === x.Eq || st(t)) && (this.cbs.onattribname(this.sectionStart, this.index), this.sectionStart = this.index, this.state = _$1.AfterAttributeName, this.stateAfterAttributeName(t));
23406
+ (t === x.Eq || st(t)) && (this.cbs.onattribname(this.sectionStart, this.index), this.sectionStart = this.index, this.state = _.AfterAttributeName, this.stateAfterAttributeName(t));
23404
23407
  }
23405
23408
  stateAfterAttributeName(t) {
23406
- t === x.Eq ? this.state = _$1.BeforeAttributeValue : t === x.Slash || t === x.Gt ? (this.cbs.onattribend(re$1.NoValue, this.sectionStart), this.sectionStart = -1, this.state = _$1.BeforeAttributeName, this.stateBeforeAttributeName(t)) : ne(t) || (this.cbs.onattribend(re$1.NoValue, this.sectionStart), this.state = _$1.InAttributeName, this.sectionStart = this.index);
23409
+ t === x.Eq ? this.state = _.BeforeAttributeValue : t === x.Slash || t === x.Gt ? (this.cbs.onattribend(re$1.NoValue, this.sectionStart), this.sectionStart = -1, this.state = _.BeforeAttributeName, this.stateBeforeAttributeName(t)) : ne$1(t) || (this.cbs.onattribend(re$1.NoValue, this.sectionStart), this.state = _.InAttributeName, this.sectionStart = this.index);
23407
23410
  }
23408
23411
  stateBeforeAttributeValue(t) {
23409
- t === x.DoubleQuote ? (this.state = _$1.InAttributeValueDq, this.sectionStart = this.index + 1) : t === x.SingleQuote ? (this.state = _$1.InAttributeValueSq, this.sectionStart = this.index + 1) : ne(t) || (this.sectionStart = this.index, this.state = _$1.InAttributeValueNq, this.stateInAttributeValueNoQuotes(t));
23412
+ t === x.DoubleQuote ? (this.state = _.InAttributeValueDq, this.sectionStart = this.index + 1) : t === x.SingleQuote ? (this.state = _.InAttributeValueSq, this.sectionStart = this.index + 1) : ne$1(t) || (this.sectionStart = this.index, this.state = _.InAttributeValueNq, this.stateInAttributeValueNoQuotes(t));
23410
23413
  }
23411
23414
  handleInAttributeValue(t, u) {
23412
- t === u || !this.decodeEntities && this.fastForwardTo(u) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(u === x.DoubleQuote ? re$1.Double : re$1.Single, this.index + 1), this.state = _$1.BeforeAttributeName) : this.decodeEntities && t === x.Amp && this.startEntity();
23415
+ t === u || !this.decodeEntities && this.fastForwardTo(u) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(u === x.DoubleQuote ? re$1.Double : re$1.Single, this.index + 1), this.state = _.BeforeAttributeName) : this.decodeEntities && t === x.Amp && this.startEntity();
23413
23416
  }
23414
23417
  stateInAttributeValueDoubleQuotes(t) {
23415
23418
  this.handleInAttributeValue(t, x.DoubleQuote);
@@ -23418,26 +23421,26 @@ let Ai = class {
23418
23421
  this.handleInAttributeValue(t, x.SingleQuote);
23419
23422
  }
23420
23423
  stateInAttributeValueNoQuotes(t) {
23421
- ne(t) || t === x.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(re$1.Unquoted, this.index), this.state = _$1.BeforeAttributeName, this.stateBeforeAttributeName(t)) : this.decodeEntities && t === x.Amp && this.startEntity();
23424
+ ne$1(t) || t === x.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(re$1.Unquoted, this.index), this.state = _.BeforeAttributeName, this.stateBeforeAttributeName(t)) : this.decodeEntities && t === x.Amp && this.startEntity();
23422
23425
  }
23423
23426
  stateBeforeDeclaration(t) {
23424
- t === x.OpeningSquareBracket ? (this.state = _$1.CDATASequence, this.sequenceIndex = 0) : this.state = t === x.Dash ? _$1.BeforeComment : _$1.InDeclaration;
23427
+ t === x.OpeningSquareBracket ? (this.state = _.CDATASequence, this.sequenceIndex = 0) : this.state = t === x.Dash ? _.BeforeComment : _.InDeclaration;
23425
23428
  }
23426
23429
  stateInDeclaration(t) {
23427
- (t === x.Gt || this.fastForwardTo(x.Gt)) && (this.cbs.ondeclaration(this.sectionStart, this.index), this.state = _$1.Text, this.sectionStart = this.index + 1);
23430
+ (t === x.Gt || this.fastForwardTo(x.Gt)) && (this.cbs.ondeclaration(this.sectionStart, this.index), this.state = _.Text, this.sectionStart = this.index + 1);
23428
23431
  }
23429
23432
  stateInProcessingInstruction(t) {
23430
- (t === x.Gt || this.fastForwardTo(x.Gt)) && (this.cbs.onprocessinginstruction(this.sectionStart, this.index), this.state = _$1.Text, this.sectionStart = this.index + 1);
23433
+ (t === x.Gt || this.fastForwardTo(x.Gt)) && (this.cbs.onprocessinginstruction(this.sectionStart, this.index), this.state = _.Text, this.sectionStart = this.index + 1);
23431
23434
  }
23432
23435
  stateBeforeComment(t) {
23433
- t === x.Dash ? (this.state = _$1.InCommentLike, this.currentSequence = F.CommentEnd, this.sequenceIndex = 2, this.sectionStart = this.index + 1) : this.state = _$1.InDeclaration;
23436
+ t === x.Dash ? (this.state = _.InCommentLike, this.currentSequence = F.CommentEnd, this.sequenceIndex = 2, this.sectionStart = this.index + 1) : this.state = _.InDeclaration;
23434
23437
  }
23435
23438
  stateInSpecialComment(t) {
23436
- (t === x.Gt || this.fastForwardTo(x.Gt)) && (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = _$1.Text, this.sectionStart = this.index + 1);
23439
+ (t === x.Gt || this.fastForwardTo(x.Gt)) && (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = _.Text, this.sectionStart = this.index + 1);
23437
23440
  }
23438
23441
  stateBeforeSpecialS(t) {
23439
23442
  const u = t | 32;
23440
- u === F.ScriptEnd[3] ? this.startSpecial(F.ScriptEnd, 4) : u === F.StyleEnd[3] ? this.startSpecial(F.StyleEnd, 4) : (this.state = _$1.InTagName, this.stateInTagName(t));
23443
+ u === F.ScriptEnd[3] ? this.startSpecial(F.ScriptEnd, 4) : u === F.StyleEnd[3] ? this.startSpecial(F.StyleEnd, 4) : (this.state = _.InTagName, this.stateInTagName(t));
23441
23444
  }
23442
23445
  stateBeforeSpecialT(t) {
23443
23446
  switch (t | 32) {
@@ -23454,11 +23457,11 @@ let Ai = class {
23454
23457
  break;
23455
23458
  }
23456
23459
  default:
23457
- this.state = _$1.InTagName, this.stateInTagName(t);
23460
+ this.state = _.InTagName, this.stateInTagName(t);
23458
23461
  }
23459
23462
  }
23460
23463
  startEntity() {
23461
- this.baseState = this.state, this.state = _$1.InEntity, this.entityStart = this.index, this.entityDecoder.startEntity(this.xmlMode ? ue.Strict : this.baseState === _$1.Text || this.baseState === _$1.InSpecialTag ? ue.Legacy : ue.Attribute);
23464
+ this.baseState = this.state, this.state = _.InEntity, this.entityStart = this.index, this.entityDecoder.startEntity(this.xmlMode ? ue.Strict : this.baseState === _.Text || this.baseState === _.InSpecialTag ? ue.Legacy : ue.Attribute);
23462
23465
  }
23463
23466
  stateInEntity() {
23464
23467
  const t = this.entityDecoder.write(this.buffer, this.index - this.offset);
@@ -23468,7 +23471,7 @@ let Ai = class {
23468
23471
  * Remove data that has already been consumed from the buffer.
23469
23472
  */
23470
23473
  cleanup() {
23471
- this.running && this.sectionStart !== this.index && (this.state === _$1.Text || this.state === _$1.InSpecialTag && this.sequenceIndex === 0 ? (this.cbs.ontext(this.sectionStart, this.index), this.sectionStart = this.index) : (this.state === _$1.InAttributeValueDq || this.state === _$1.InAttributeValueSq || this.state === _$1.InAttributeValueNq) && (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = this.index));
23474
+ this.running && this.sectionStart !== this.index && (this.state === _.Text || this.state === _.InSpecialTag && this.sequenceIndex === 0 ? (this.cbs.ontext(this.sectionStart, this.index), this.sectionStart = this.index) : (this.state === _.InAttributeValueDq || this.state === _.InAttributeValueSq || this.state === _.InAttributeValueNq) && (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = this.index));
23472
23475
  }
23473
23476
  shouldContinue() {
23474
23477
  return this.index < this.buffer.length + this.offset && this.running;
@@ -23482,107 +23485,107 @@ let Ai = class {
23482
23485
  for (; this.shouldContinue(); ) {
23483
23486
  const t = this.buffer.charCodeAt(this.index - this.offset);
23484
23487
  switch (this.state) {
23485
- case _$1.Text: {
23488
+ case _.Text: {
23486
23489
  this.stateText(t);
23487
23490
  break;
23488
23491
  }
23489
- case _$1.SpecialStartSequence: {
23492
+ case _.SpecialStartSequence: {
23490
23493
  this.stateSpecialStartSequence(t);
23491
23494
  break;
23492
23495
  }
23493
- case _$1.InSpecialTag: {
23496
+ case _.InSpecialTag: {
23494
23497
  this.stateInSpecialTag(t);
23495
23498
  break;
23496
23499
  }
23497
- case _$1.CDATASequence: {
23500
+ case _.CDATASequence: {
23498
23501
  this.stateCDATASequence(t);
23499
23502
  break;
23500
23503
  }
23501
- case _$1.InAttributeValueDq: {
23504
+ case _.InAttributeValueDq: {
23502
23505
  this.stateInAttributeValueDoubleQuotes(t);
23503
23506
  break;
23504
23507
  }
23505
- case _$1.InAttributeName: {
23508
+ case _.InAttributeName: {
23506
23509
  this.stateInAttributeName(t);
23507
23510
  break;
23508
23511
  }
23509
- case _$1.InCommentLike: {
23512
+ case _.InCommentLike: {
23510
23513
  this.stateInCommentLike(t);
23511
23514
  break;
23512
23515
  }
23513
- case _$1.InSpecialComment: {
23516
+ case _.InSpecialComment: {
23514
23517
  this.stateInSpecialComment(t);
23515
23518
  break;
23516
23519
  }
23517
- case _$1.BeforeAttributeName: {
23520
+ case _.BeforeAttributeName: {
23518
23521
  this.stateBeforeAttributeName(t);
23519
23522
  break;
23520
23523
  }
23521
- case _$1.InTagName: {
23524
+ case _.InTagName: {
23522
23525
  this.stateInTagName(t);
23523
23526
  break;
23524
23527
  }
23525
- case _$1.InClosingTagName: {
23528
+ case _.InClosingTagName: {
23526
23529
  this.stateInClosingTagName(t);
23527
23530
  break;
23528
23531
  }
23529
- case _$1.BeforeTagName: {
23532
+ case _.BeforeTagName: {
23530
23533
  this.stateBeforeTagName(t);
23531
23534
  break;
23532
23535
  }
23533
- case _$1.AfterAttributeName: {
23536
+ case _.AfterAttributeName: {
23534
23537
  this.stateAfterAttributeName(t);
23535
23538
  break;
23536
23539
  }
23537
- case _$1.InAttributeValueSq: {
23540
+ case _.InAttributeValueSq: {
23538
23541
  this.stateInAttributeValueSingleQuotes(t);
23539
23542
  break;
23540
23543
  }
23541
- case _$1.BeforeAttributeValue: {
23544
+ case _.BeforeAttributeValue: {
23542
23545
  this.stateBeforeAttributeValue(t);
23543
23546
  break;
23544
23547
  }
23545
- case _$1.BeforeClosingTagName: {
23548
+ case _.BeforeClosingTagName: {
23546
23549
  this.stateBeforeClosingTagName(t);
23547
23550
  break;
23548
23551
  }
23549
- case _$1.AfterClosingTagName: {
23552
+ case _.AfterClosingTagName: {
23550
23553
  this.stateAfterClosingTagName(t);
23551
23554
  break;
23552
23555
  }
23553
- case _$1.BeforeSpecialS: {
23556
+ case _.BeforeSpecialS: {
23554
23557
  this.stateBeforeSpecialS(t);
23555
23558
  break;
23556
23559
  }
23557
- case _$1.BeforeSpecialT: {
23560
+ case _.BeforeSpecialT: {
23558
23561
  this.stateBeforeSpecialT(t);
23559
23562
  break;
23560
23563
  }
23561
- case _$1.InAttributeValueNq: {
23564
+ case _.InAttributeValueNq: {
23562
23565
  this.stateInAttributeValueNoQuotes(t);
23563
23566
  break;
23564
23567
  }
23565
- case _$1.InSelfClosingTag: {
23568
+ case _.InSelfClosingTag: {
23566
23569
  this.stateInSelfClosingTag(t);
23567
23570
  break;
23568
23571
  }
23569
- case _$1.InDeclaration: {
23572
+ case _.InDeclaration: {
23570
23573
  this.stateInDeclaration(t);
23571
23574
  break;
23572
23575
  }
23573
- case _$1.BeforeDeclaration: {
23576
+ case _.BeforeDeclaration: {
23574
23577
  this.stateBeforeDeclaration(t);
23575
23578
  break;
23576
23579
  }
23577
- case _$1.BeforeComment: {
23580
+ case _.BeforeComment: {
23578
23581
  this.stateBeforeComment(t);
23579
23582
  break;
23580
23583
  }
23581
- case _$1.InProcessingInstruction: {
23584
+ case _.InProcessingInstruction: {
23582
23585
  this.stateInProcessingInstruction(t);
23583
23586
  break;
23584
23587
  }
23585
- case _$1.InEntity: {
23588
+ case _.InEntity: {
23586
23589
  this.stateInEntity();
23587
23590
  break;
23588
23591
  }
@@ -23592,15 +23595,15 @@ let Ai = class {
23592
23595
  this.cleanup();
23593
23596
  }
23594
23597
  finish() {
23595
- this.state === _$1.InEntity && (this.entityDecoder.end(), this.state = this.baseState), this.handleTrailingData(), this.cbs.onend();
23598
+ this.state === _.InEntity && (this.entityDecoder.end(), this.state = this.baseState), this.handleTrailingData(), this.cbs.onend();
23596
23599
  }
23597
23600
  /** Handle any trailing data. */
23598
23601
  handleTrailingData() {
23599
23602
  const t = this.buffer.length + this.offset;
23600
- this.sectionStart >= t || (this.state === _$1.InCommentLike ? this.currentSequence === F.CdataEnd ? this.cbs.oncdata(this.sectionStart, t, 0) : this.cbs.oncomment(this.sectionStart, t, 0) : this.state === _$1.InTagName || this.state === _$1.BeforeAttributeName || this.state === _$1.BeforeAttributeValue || this.state === _$1.AfterAttributeName || this.state === _$1.InAttributeName || this.state === _$1.InAttributeValueSq || this.state === _$1.InAttributeValueDq || this.state === _$1.InAttributeValueNq || this.state === _$1.InClosingTagName || this.cbs.ontext(this.sectionStart, t));
23603
+ this.sectionStart >= t || (this.state === _.InCommentLike ? this.currentSequence === F.CdataEnd ? this.cbs.oncdata(this.sectionStart, t, 0) : this.cbs.oncomment(this.sectionStart, t, 0) : this.state === _.InTagName || this.state === _.BeforeAttributeName || this.state === _.BeforeAttributeValue || this.state === _.AfterAttributeName || this.state === _.InAttributeName || this.state === _.InAttributeValueSq || this.state === _.InAttributeValueDq || this.state === _.InAttributeValueNq || this.state === _.InClosingTagName || this.cbs.ontext(this.sectionStart, t));
23601
23604
  }
23602
23605
  emitCodePoint(t, u) {
23603
- this.baseState !== _$1.Text && this.baseState !== _$1.InSpecialTag ? (this.sectionStart < this.entityStart && this.cbs.onattribdata(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + u, this.index = this.sectionStart - 1, this.cbs.onattribentity(t)) : (this.sectionStart < this.entityStart && this.cbs.ontext(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + u, this.index = this.sectionStart - 1, this.cbs.ontextentity(t, this.sectionStart));
23606
+ this.baseState !== _.Text && this.baseState !== _.InSpecialTag ? (this.sectionStart < this.entityStart && this.cbs.onattribdata(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + u, this.index = this.sectionStart - 1, this.cbs.onattribentity(t)) : (this.sectionStart < this.entityStart && this.cbs.ontext(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + u, this.index = this.sectionStart - 1, this.cbs.ontextentity(t, this.sectionStart));
23604
23607
  }
23605
23608
  };
23606
23609
  const ye = /* @__PURE__ */ new Set([
@@ -23747,11 +23750,11 @@ let xi = class {
23747
23750
  if (this.lowerCaseTagNames && (T = T.toLowerCase()), this.htmlMode && (ju.has(T) || Vu.has(T)) && this.foreignContext.shift(), this.isVoidElement(T))
23748
23751
  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));
23749
23752
  else {
23750
- const A = this.stack.indexOf(T);
23751
- if (A !== -1)
23752
- for (let w = 0; w <= A; w++) {
23753
+ const A2 = this.stack.indexOf(T);
23754
+ if (A2 !== -1)
23755
+ for (let w = 0; w <= A2; w++) {
23753
23756
  const v = this.stack.shift();
23754
- (a = (r = this.cbs).onclosetag) === null || a === void 0 || a.call(r, v, w !== A);
23757
+ (a = (r = this.cbs).onclosetag) === null || a === void 0 || a.call(r, v, w !== A2);
23755
23758
  }
23756
23759
  else this.htmlMode && T === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(true));
23757
23760
  }
@@ -23817,10 +23820,10 @@ let xi = class {
23817
23820
  }
23818
23821
  /** @internal */
23819
23822
  oncdata(t, u, r) {
23820
- var a, i, n, c, h, m, f, T, A, w;
23823
+ var a, i, n, c, h, m, f, T, A2, w;
23821
23824
  this.endIndex = u;
23822
23825
  const v = this.getSlice(t, u - r);
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 = (A = this.cbs).oncommentend) === null || w === void 0 || w.call(A)), this.startIndex = u + 1;
23826
+ !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;
23824
23827
  }
23825
23828
  /** @internal */
23826
23829
  onend() {
@@ -23940,7 +23943,7 @@ function mt(e, t, u) {
23940
23943
  return "on";
23941
23944
  }
23942
23945
  }
23943
- function Oe(e, t, u) {
23946
+ function Oe$1(e, t, u) {
23944
23947
  u === null ? Mr(e, t) : e.attribs[t] = `${u}`;
23945
23948
  }
23946
23949
  function Ci(e, t) {
@@ -23949,7 +23952,7 @@ function Ci(e, t) {
23949
23952
  if (typeof e != "string")
23950
23953
  throw new Error("Bad combination of arguments.");
23951
23954
  return P(this, (u, r) => {
23952
- I(u) && Oe(u, e, t.call(u, r, u.attribs[e]));
23955
+ I(u) && Oe$1(u, e, t.call(u, r, u.attribs[e]));
23953
23956
  });
23954
23957
  }
23955
23958
  return P(this, (u) => {
@@ -23957,10 +23960,10 @@ function Ci(e, t) {
23957
23960
  if (typeof e == "object")
23958
23961
  for (const r of Object.keys(e)) {
23959
23962
  const a = e[r];
23960
- Oe(u, r, a);
23963
+ Oe$1(u, r, a);
23961
23964
  }
23962
23965
  else
23963
- Oe(u, e, t);
23966
+ Oe$1(u, e, t);
23964
23967
  });
23965
23968
  }
23966
23969
  return arguments.length > 1 ? this : mt(this[0], e, this.options.xmlMode);
@@ -23971,8 +23974,8 @@ function $u(e, t, u) {
23971
23974
  e[t]
23972
23975
  ) : !u && gu.test(t) ? mt(e, t, false) !== void 0 : mt(e, t, u);
23973
23976
  }
23974
- function Ft$1(e, t, u, r) {
23975
- t in e ? e[t] = u : Oe(e, t, !r && gu.test(t) ? u ? "" : null : `${u}`);
23977
+ function Ft(e, t, u, r) {
23978
+ t in e ? e[t] = u : Oe$1(e, t, !r && gu.test(t) ? u ? "" : null : `${u}`);
23976
23979
  }
23977
23980
  function yi(e, t) {
23978
23981
  var u;
@@ -24000,7 +24003,7 @@ function yi(e, t) {
24000
24003
  case "innerText":
24001
24004
  return dt(r);
24002
24005
  case "textContent":
24003
- return Le(r);
24006
+ return Le$1(r);
24004
24007
  case "outerHTML":
24005
24008
  return r.type === cu ? this.html() : this.clone().wrap("<container />").parent().html();
24006
24009
  case "innerHTML":
@@ -24014,7 +24017,7 @@ function yi(e, t) {
24014
24017
  if (typeof e == "object")
24015
24018
  throw new TypeError("Bad combination of arguments.");
24016
24019
  return P(this, (r, a) => {
24017
- I(r) && Ft$1(r, e, t.call(r, a, $u(r, e, this.options.xmlMode)), this.options.xmlMode);
24020
+ I(r) && Ft(r, e, t.call(r, a, $u(r, e, this.options.xmlMode)), this.options.xmlMode);
24018
24021
  });
24019
24022
  }
24020
24023
  return P(this, (r) => {
@@ -24022,10 +24025,10 @@ function yi(e, t) {
24022
24025
  if (typeof e == "object")
24023
24026
  for (const a of Object.keys(e)) {
24024
24027
  const i = e[a];
24025
- Ft$1(r, a, i, this.options.xmlMode);
24028
+ Ft(r, a, i, this.options.xmlMode);
24026
24029
  }
24027
24030
  else
24028
- Ft$1(r, e, t, this.options.xmlMode);
24031
+ Ft(r, e, t, this.options.xmlMode);
24029
24032
  });
24030
24033
  }
24031
24034
  }
@@ -24150,9 +24153,9 @@ function Br(e) {
24150
24153
  const h = `${c} `;
24151
24154
  n.includes(` ${h}`) || (n += h);
24152
24155
  }
24153
- Oe(a, "class", n.trim());
24156
+ Oe$1(a, "class", n.trim());
24154
24157
  } else
24155
- Oe(a, "class", t.join(" ").trim());
24158
+ Oe$1(a, "class", t.join(" ").trim());
24156
24159
  }
24157
24160
  return this;
24158
24161
  }
@@ -24210,10 +24213,10 @@ const Mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
24210
24213
  toggleClass: Fr,
24211
24214
  val: Di
24212
24215
  }, Symbol.toStringTag, { value: "Module" }));
24213
- var N$1;
24216
+ var N;
24214
24217
  (function(e) {
24215
24218
  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";
24216
- })(N$1 || (N$1 = {}));
24219
+ })(N || (N = {}));
24217
24220
  var H;
24218
24221
  (function(e) {
24219
24222
  e.Any = "any", e.Element = "element", e.End = "end", e.Equals = "equals", e.Exists = "exists", e.Hyphen = "hyphen", e.Not = "not", e.Start = "start";
@@ -24234,14 +24237,14 @@ const Wu = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/, Bi = /\\(
24234
24237
  "host",
24235
24238
  "host-context"
24236
24239
  ]);
24237
- function qe(e) {
24240
+ function qe$1(e) {
24238
24241
  switch (e.type) {
24239
- case N$1.Adjacent:
24240
- case N$1.Child:
24241
- case N$1.Descendant:
24242
- case N$1.Parent:
24243
- case N$1.Sibling:
24244
- case N$1.ColumnCombinator:
24242
+ case N.Adjacent:
24243
+ case N.Child:
24244
+ case N.Descendant:
24245
+ case N.Parent:
24246
+ case N.Sibling:
24247
+ case N.ColumnCombinator:
24245
24248
  return true;
24246
24249
  default:
24247
24250
  return false;
@@ -24258,16 +24261,16 @@ function qi(e, t, u) {
24258
24261
  String.fromCharCode(r >> 10 | 55296, r & 1023 | 56320)
24259
24262
  );
24260
24263
  }
24261
- function Be(e) {
24264
+ function Be$1(e) {
24262
24265
  return e.replace(Bi, qi);
24263
24266
  }
24264
- function Ht$1(e) {
24267
+ function Ht(e) {
24265
24268
  return e === 39 || e === 34;
24266
24269
  }
24267
24270
  function zu(e) {
24268
24271
  return e === 32 || e === 9 || e === 10 || e === 12 || e === 13;
24269
24272
  }
24270
- function Ct$1(e) {
24273
+ function Ct(e) {
24271
24274
  const t = [], u = Hr(t, `${e}`, 0);
24272
24275
  if (u < e.length)
24273
24276
  throw new Error(`Unmatched selector: ${e.slice(u)}`);
@@ -24275,48 +24278,48 @@ function Ct$1(e) {
24275
24278
  }
24276
24279
  function Hr(e, t, u) {
24277
24280
  let r = [];
24278
- function a(A) {
24279
- const w = t.slice(u + A).match(Wu);
24281
+ function a(A2) {
24282
+ const w = t.slice(u + A2).match(Wu);
24280
24283
  if (!w)
24281
24284
  throw new Error(`Expected name, found ${t.slice(u)}`);
24282
24285
  const [v] = w;
24283
- return u += A + v.length, Be(v);
24286
+ return u += A2 + v.length, Be$1(v);
24284
24287
  }
24285
- function i(A) {
24286
- for (u += A; u < t.length && zu(t.charCodeAt(u)); )
24288
+ function i(A2) {
24289
+ for (u += A2; u < t.length && zu(t.charCodeAt(u)); )
24287
24290
  u++;
24288
24291
  }
24289
24292
  function n() {
24290
24293
  u += 1;
24291
- const A = u;
24294
+ const A2 = u;
24292
24295
  let w = 1;
24293
24296
  for (; w > 0 && u < t.length; u++)
24294
24297
  t.charCodeAt(u) === 40 && !c(u) ? w++ : t.charCodeAt(u) === 41 && !c(u) && w--;
24295
24298
  if (w)
24296
24299
  throw new Error("Parenthesis not matched");
24297
- return Be(t.slice(A, u - 1));
24300
+ return Be$1(t.slice(A2, u - 1));
24298
24301
  }
24299
- function c(A) {
24302
+ function c(A2) {
24300
24303
  let w = 0;
24301
- for (; t.charCodeAt(--A) === 92; )
24304
+ for (; t.charCodeAt(--A2) === 92; )
24302
24305
  w++;
24303
24306
  return (w & 1) === 1;
24304
24307
  }
24305
24308
  function h() {
24306
- if (r.length > 0 && qe(r[r.length - 1]))
24309
+ if (r.length > 0 && qe$1(r[r.length - 1]))
24307
24310
  throw new Error("Did not expect successive traversals.");
24308
24311
  }
24309
- function m(A) {
24310
- if (r.length > 0 && r[r.length - 1].type === N$1.Descendant) {
24311
- r[r.length - 1].type = A;
24312
+ function m(A2) {
24313
+ if (r.length > 0 && r[r.length - 1].type === N.Descendant) {
24314
+ r[r.length - 1].type = A2;
24312
24315
  return;
24313
24316
  }
24314
- h(), r.push({ type: A });
24317
+ h(), r.push({ type: A2 });
24315
24318
  }
24316
- function f(A, w) {
24319
+ function f(A2, w) {
24317
24320
  r.push({
24318
- type: N$1.Attribute,
24319
- name: A,
24321
+ type: N.Attribute,
24322
+ name: A2,
24320
24323
  action: w,
24321
24324
  value: a(1),
24322
24325
  namespace: null,
@@ -24324,39 +24327,39 @@ function Hr(e, t, u) {
24324
24327
  });
24325
24328
  }
24326
24329
  function T() {
24327
- if (r.length && r[r.length - 1].type === N$1.Descendant && r.pop(), r.length === 0)
24330
+ if (r.length && r[r.length - 1].type === N.Descendant && r.pop(), r.length === 0)
24328
24331
  throw new Error("Empty sub-selector");
24329
24332
  e.push(r);
24330
24333
  }
24331
24334
  if (i(0), t.length === u)
24332
24335
  return u;
24333
24336
  e: for (; u < t.length; ) {
24334
- const A = t.charCodeAt(u);
24335
- switch (A) {
24337
+ const A2 = t.charCodeAt(u);
24338
+ switch (A2) {
24336
24339
  // Whitespace
24337
24340
  case 32:
24338
24341
  case 9:
24339
24342
  case 10:
24340
24343
  case 12:
24341
24344
  case 13: {
24342
- (r.length === 0 || r[0].type !== N$1.Descendant) && (h(), r.push({ type: N$1.Descendant })), i(1);
24345
+ (r.length === 0 || r[0].type !== N.Descendant) && (h(), r.push({ type: N.Descendant })), i(1);
24343
24346
  break;
24344
24347
  }
24345
24348
  // Traversals
24346
24349
  case 62: {
24347
- m(N$1.Child), i(1);
24350
+ m(N.Child), i(1);
24348
24351
  break;
24349
24352
  }
24350
24353
  case 60: {
24351
- m(N$1.Parent), i(1);
24354
+ m(N.Parent), i(1);
24352
24355
  break;
24353
24356
  }
24354
24357
  case 126: {
24355
- m(N$1.Sibling), i(1);
24358
+ m(N.Sibling), i(1);
24356
24359
  break;
24357
24360
  }
24358
24361
  case 43: {
24359
- m(N$1.Adjacent), i(1);
24362
+ m(N.Adjacent), i(1);
24360
24363
  break;
24361
24364
  }
24362
24365
  // Special attribute selectors: .class, #id
@@ -24379,44 +24382,44 @@ function Hr(e, t, u) {
24379
24382
  throw new Error("Expected `=`");
24380
24383
  i(2);
24381
24384
  } else t.charCodeAt(u) === 61 && (S = H.Equals, i(1));
24382
- let M = "", ee = null;
24385
+ let M = "", ee2 = null;
24383
24386
  if (S !== "exists") {
24384
- if (Ht$1(t.charCodeAt(u))) {
24387
+ if (Ht(t.charCodeAt(u))) {
24385
24388
  const ge = t.charCodeAt(u);
24386
24389
  let ie = u + 1;
24387
24390
  for (; ie < t.length && (t.charCodeAt(ie) !== ge || c(ie)); )
24388
24391
  ie += 1;
24389
24392
  if (t.charCodeAt(ie) !== ge)
24390
24393
  throw new Error("Attribute value didn't end");
24391
- M = Be(t.slice(u + 1, ie)), u = ie + 1;
24394
+ M = Be$1(t.slice(u + 1, ie)), u = ie + 1;
24392
24395
  } else {
24393
24396
  const ge = u;
24394
24397
  for (; u < t.length && (!zu(t.charCodeAt(u)) && t.charCodeAt(u) !== 93 || c(u)); )
24395
24398
  u += 1;
24396
- M = Be(t.slice(ge, u));
24399
+ M = Be$1(t.slice(ge, u));
24397
24400
  }
24398
24401
  i(0);
24399
24402
  const ae = t.charCodeAt(u) | 32;
24400
- ae === 115 ? (ee = false, i(1)) : ae === 105 && (ee = true, i(1));
24403
+ ae === 115 ? (ee2 = false, i(1)) : ae === 105 && (ee2 = true, i(1));
24401
24404
  }
24402
24405
  if (t.charCodeAt(u) !== 93)
24403
24406
  throw new Error("Attribute selector didn't terminate");
24404
24407
  u += 1;
24405
- const he = {
24406
- type: N$1.Attribute,
24408
+ const he2 = {
24409
+ type: N.Attribute,
24407
24410
  name: w,
24408
24411
  action: S,
24409
24412
  value: M,
24410
24413
  namespace: v,
24411
- ignoreCase: ee
24414
+ ignoreCase: ee2
24412
24415
  };
24413
- r.push(he);
24416
+ r.push(he2);
24414
24417
  break;
24415
24418
  }
24416
24419
  case 58: {
24417
24420
  if (t.charCodeAt(u + 1) === 58) {
24418
24421
  r.push({
24419
- type: N$1.PseudoElement,
24422
+ type: N.PseudoElement,
24420
24423
  name: a(2).toLowerCase(),
24421
24424
  data: t.charCodeAt(u) === 40 ? n() : null
24422
24425
  });
@@ -24426,7 +24429,7 @@ function Hr(e, t, u) {
24426
24429
  let v = null;
24427
24430
  if (t.charCodeAt(u) === 40)
24428
24431
  if (Fi.has(w)) {
24429
- if (Ht$1(t.charCodeAt(u + 1)))
24432
+ if (Ht(t.charCodeAt(u + 1)))
24430
24433
  throw new Error(`Pseudo-selector ${w} cannot be quoted`);
24431
24434
  if (v = [], u = Hr(v, t, u + 1), t.charCodeAt(u) !== 41)
24432
24435
  throw new Error(`Missing closing parenthesis in :${w} (${t})`);
@@ -24434,11 +24437,11 @@ function Hr(e, t, u) {
24434
24437
  } else {
24435
24438
  if (v = n(), Hi.has(w)) {
24436
24439
  const S = v.charCodeAt(0);
24437
- S === v.charCodeAt(v.length - 1) && Ht$1(S) && (v = v.slice(1, -1));
24440
+ S === v.charCodeAt(v.length - 1) && Ht(S) && (v = v.slice(1, -1));
24438
24441
  }
24439
- v = Be(v);
24442
+ v = Be$1(v);
24440
24443
  }
24441
- r.push({ type: N$1.Pseudo, name: w, data: v });
24444
+ r.push({ type: N.Pseudo, name: w, data: v });
24442
24445
  break;
24443
24446
  }
24444
24447
  case 44: {
@@ -24454,18 +24457,18 @@ function Hr(e, t, u) {
24454
24457
  break;
24455
24458
  }
24456
24459
  let w = null, v;
24457
- if (A === 42)
24460
+ if (A2 === 42)
24458
24461
  u += 1, v = "*";
24459
- else if (A === 124) {
24462
+ else if (A2 === 124) {
24460
24463
  if (v = "", t.charCodeAt(u + 1) === 124) {
24461
- m(N$1.ColumnCombinator), i(2);
24464
+ m(N.ColumnCombinator), i(2);
24462
24465
  break;
24463
24466
  }
24464
24467
  } else if (Wu.test(t.slice(u)))
24465
24468
  v = a(0);
24466
24469
  else
24467
24470
  break e;
24468
- t.charCodeAt(u) === 124 && t.charCodeAt(u + 1) !== 124 && (w = v, t.charCodeAt(u + 1) === 42 ? (v = "*", u += 2) : v = a(1)), r.push(v === "*" ? { type: N$1.Universal, namespace: w } : { type: N$1.Tag, name: v, namespace: w });
24471
+ t.charCodeAt(u) === 124 && t.charCodeAt(u + 1) !== 124 && (w = v, t.charCodeAt(u + 1) === 42 ? (v = "*", u += 2) : v = a(1)), r.push(v === "*" ? { type: N.Universal, namespace: w } : { type: N.Tag, name: v, namespace: w });
24469
24472
  }
24470
24473
  }
24471
24474
  }
@@ -24487,10 +24490,10 @@ function ji() {
24487
24490
  }
24488
24491
  var ft = ji();
24489
24492
  const C = /* @__PURE__ */ Yi(ft), qr = /* @__PURE__ */ new Map([
24490
- [N$1.Universal, 50],
24491
- [N$1.Tag, 30],
24492
- [N$1.Attribute, 1],
24493
- [N$1.Pseudo, 0]
24493
+ [N.Universal, 50],
24494
+ [N.Tag, 30],
24495
+ [N.Attribute, 1],
24496
+ [N.Pseudo, 0]
24494
24497
  ]);
24495
24498
  function Au(e) {
24496
24499
  return !qr.has(e.type);
@@ -24517,7 +24520,7 @@ function $i(e) {
24517
24520
  function Yr(e) {
24518
24521
  var t, u;
24519
24522
  let r = (t = qr.get(e.type)) !== null && t !== void 0 ? t : -1;
24520
- return e.type === N$1.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$1.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;
24523
+ 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;
24521
24524
  }
24522
24525
  const Gi = /[-[\]{}()*+?.,\\^$|#\s]/g;
24523
24526
  function Ku(e) {
@@ -24571,14 +24574,14 @@ const Wi = /* @__PURE__ */ new Set([
24571
24574
  "valuetype",
24572
24575
  "vlink"
24573
24576
  ]);
24574
- function Ae(e, t) {
24577
+ function Ae$1(e, t) {
24575
24578
  return typeof e.ignoreCase == "boolean" ? e.ignoreCase : e.ignoreCase === "quirks" ? !!t.quirksMode : !t.xmlMode && Wi.has(e.name);
24576
24579
  }
24577
24580
  const zi = {
24578
24581
  equals(e, t, u) {
24579
24582
  const { adapter: r } = u, { name: a } = t;
24580
24583
  let { value: i } = t;
24581
- return Ae(t, u) ? (i = i.toLowerCase(), (n) => {
24584
+ return Ae$1(t, u) ? (i = i.toLowerCase(), (n) => {
24582
24585
  const c = r.getAttributeValue(n, a);
24583
24586
  return c != null && c.length === i.length && c.toLowerCase() === i && e(n);
24584
24587
  }) : (n) => r.getAttributeValue(n, a) === i && e(n);
@@ -24587,7 +24590,7 @@ const zi = {
24587
24590
  const { adapter: r } = u, { name: a } = t;
24588
24591
  let { value: i } = t;
24589
24592
  const n = i.length;
24590
- return Ae(t, u) ? (i = i.toLowerCase(), function(h) {
24593
+ return Ae$1(t, u) ? (i = i.toLowerCase(), function(h) {
24591
24594
  const m = r.getAttributeValue(h, a);
24592
24595
  return m != null && (m.length === n || m.charAt(n) === "-") && m.substr(0, n).toLowerCase() === i && e(h);
24593
24596
  }) : function(h) {
@@ -24599,7 +24602,7 @@ const zi = {
24599
24602
  const { adapter: r } = u, { name: a, value: i } = t;
24600
24603
  if (/\s/.test(i))
24601
24604
  return C.falseFunc;
24602
- const n = new RegExp(`(?:^|\\s)${Ku(i)}(?:$|\\s)`, Ae(t, u) ? "i" : "");
24605
+ const n = new RegExp(`(?:^|\\s)${Ku(i)}(?:$|\\s)`, Ae$1(t, u) ? "i" : "");
24603
24606
  return function(h) {
24604
24607
  const m = r.getAttributeValue(h, a);
24605
24608
  return m != null && m.length >= i.length && n.test(m) && e(h);
@@ -24612,7 +24615,7 @@ const zi = {
24612
24615
  const { adapter: r } = u, { name: a } = t;
24613
24616
  let { value: i } = t;
24614
24617
  const n = i.length;
24615
- return n === 0 ? C.falseFunc : Ae(t, u) ? (i = i.toLowerCase(), (c) => {
24618
+ return n === 0 ? C.falseFunc : Ae$1(t, u) ? (i = i.toLowerCase(), (c) => {
24616
24619
  const h = r.getAttributeValue(c, a);
24617
24620
  return h != null && h.length >= n && h.substr(0, n).toLowerCase() === i && e(c);
24618
24621
  }) : (c) => {
@@ -24624,7 +24627,7 @@ const zi = {
24624
24627
  const { adapter: r } = u, { name: a } = t;
24625
24628
  let { value: i } = t;
24626
24629
  const n = -i.length;
24627
- return n === 0 ? C.falseFunc : Ae(t, u) ? (i = i.toLowerCase(), (c) => {
24630
+ return n === 0 ? C.falseFunc : Ae$1(t, u) ? (i = i.toLowerCase(), (c) => {
24628
24631
  var h;
24629
24632
  return ((h = r.getAttributeValue(c, a)) === null || h === void 0 ? void 0 : h.substr(n).toLowerCase()) === i && e(c);
24630
24633
  }) : (c) => {
@@ -24636,7 +24639,7 @@ const zi = {
24636
24639
  const { adapter: r } = u, { name: a, value: i } = t;
24637
24640
  if (i === "")
24638
24641
  return C.falseFunc;
24639
- if (Ae(t, u)) {
24642
+ if (Ae$1(t, u)) {
24640
24643
  const n = new RegExp(Ku(i), "i");
24641
24644
  return function(h) {
24642
24645
  const m = r.getAttributeValue(h, a);
@@ -24651,7 +24654,7 @@ const zi = {
24651
24654
  not(e, t, u) {
24652
24655
  const { adapter: r } = u, { name: a } = t;
24653
24656
  let { value: i } = t;
24654
- return i === "" ? (n) => !!r.getAttributeValue(n, a) && e(n) : Ae(t, u) ? (i = i.toLowerCase(), (n) => {
24657
+ return i === "" ? (n) => !!r.getAttributeValue(n, a) && e(n) : Ae$1(t, u) ? (i = i.toLowerCase(), (n) => {
24655
24658
  const c = r.getAttributeValue(n, a);
24656
24659
  return (c == null || c.length !== i.length || c.toLowerCase() !== i) && e(n);
24657
24660
  }) : (n) => r.getAttributeValue(n, a) !== i && e(n);
@@ -24775,11 +24778,11 @@ const eu = {
24775
24778
  const { equals: a } = u;
24776
24779
  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);
24777
24780
  },
24778
- hover: Yt$1("isHovered"),
24779
- visited: Yt$1("isVisited"),
24780
- active: Yt$1("isActive")
24781
+ hover: Yt("isHovered"),
24782
+ visited: Yt("isVisited"),
24783
+ active: Yt("isActive")
24781
24784
  };
24782
- function Yt$1(e) {
24785
+ function Yt(e) {
24783
24786
  return function(u, r, { adapter: a }) {
24784
24787
  const i = a[e];
24785
24788
  return typeof i != "function" ? C.falseFunc : function(c) {
@@ -24900,16 +24903,16 @@ function tu(e) {
24900
24903
  equals: e.equals
24901
24904
  };
24902
24905
  }
24903
- const jt$1 = (e, t, u, r, a) => {
24906
+ const jt = (e, t, u, r, a) => {
24904
24907
  const i = a(t, tu(u), r);
24905
24908
  return i === C.trueFunc ? e : i === C.falseFunc ? C.falseFunc : (n) => i(n) && e(n);
24906
- }, Vt$1 = {
24907
- is: jt$1,
24909
+ }, Vt = {
24910
+ is: jt,
24908
24911
  /**
24909
24912
  * `:matches` and `:where` are aliases for `:is`.
24910
24913
  */
24911
- matches: jt$1,
24912
- where: jt$1,
24914
+ matches: jt,
24915
+ where: jt,
24913
24916
  not(e, t, u, r, a) {
24914
24917
  const i = a(t, tu(u), r);
24915
24918
  return i === C.falseFunc ? e : i === C.trueFunc ? C.falseFunc : (n) => !i(n) && e(n);
@@ -24930,7 +24933,7 @@ const jt$1 = (e, t, u, r, a) => {
24930
24933
  if (!e(T))
24931
24934
  return false;
24932
24935
  c[0] = T;
24933
- const A = i.getChildren(T), w = f ? [...A, ...Vr(T, i)] : A;
24936
+ const A2 = i.getChildren(T), w = f ? [...A2, ...Vr(T, i)] : A2;
24934
24937
  return i.existsOne(m, w);
24935
24938
  };
24936
24939
  }
@@ -24941,16 +24944,16 @@ function tn(e, t, u, r, a) {
24941
24944
  var i;
24942
24945
  const { name: n, data: c } = t;
24943
24946
  if (Array.isArray(c)) {
24944
- if (!(n in Vt$1))
24947
+ if (!(n in Vt))
24945
24948
  throw new Error(`Unknown pseudo-class :${n}(${c})`);
24946
- return Vt$1[n](e, c, u, r, a);
24949
+ return Vt[n](e, c, u, r, a);
24947
24950
  }
24948
24951
  const h = (i = u.pseudos) === null || i === void 0 ? void 0 : i[n], m = typeof h == "string" ? h : Ji[n];
24949
24952
  if (typeof m == "string") {
24950
24953
  if (c != null)
24951
24954
  throw new Error(`Pseudo ${n} doesn't have any arguments`);
24952
- const f = Ct$1(m);
24953
- return Vt$1.is(e, f, u, r, a);
24955
+ const f = Ct(m);
24956
+ return Vt.is(e, f, u, r, a);
24954
24957
  }
24955
24958
  if (typeof h == "function")
24956
24959
  return Ju(h, n, c, 1), (f) => h(f, c) && e(f);
@@ -24962,26 +24965,26 @@ function tn(e, t, u, r, a) {
24962
24965
  }
24963
24966
  throw new Error(`Unknown pseudo-class :${n}`);
24964
24967
  }
24965
- function $t$1(e, t) {
24968
+ function $t(e, t) {
24966
24969
  const u = t.getParent(e);
24967
24970
  return u && t.isTag(u) ? u : null;
24968
24971
  }
24969
24972
  function un(e, t, u, r, a) {
24970
24973
  const { adapter: i, equals: n } = u;
24971
24974
  switch (t.type) {
24972
- case N$1.PseudoElement:
24975
+ case N.PseudoElement:
24973
24976
  throw new Error("Pseudo-elements are not supported by css-select");
24974
- case N$1.ColumnCombinator:
24977
+ case N.ColumnCombinator:
24975
24978
  throw new Error("Column combinators are not yet supported by css-select");
24976
- case N$1.Attribute: {
24979
+ case N.Attribute: {
24977
24980
  if (t.namespace != null)
24978
24981
  throw new Error("Namespaced attributes are not yet supported by css-select");
24979
24982
  return (!u.xmlMode || u.lowerCaseAttributeNames) && (t.name = t.name.toLowerCase()), zi[t.action](e, t, u);
24980
24983
  }
24981
- case N$1.Pseudo:
24984
+ case N.Pseudo:
24982
24985
  return tn(e, t, u, r, a);
24983
24986
  // Tags
24984
- case N$1.Tag: {
24987
+ case N.Tag: {
24985
24988
  if (t.namespace != null)
24986
24989
  throw new Error("Namespaced tag names are not yet supported by css-select");
24987
24990
  let { name: c } = t;
@@ -24990,11 +24993,11 @@ function un(e, t, u, r, a) {
24990
24993
  };
24991
24994
  }
24992
24995
  // Traversal
24993
- case N$1.Descendant: {
24996
+ case N.Descendant: {
24994
24997
  if (u.cacheResults === false || typeof WeakSet > "u")
24995
24998
  return function(m) {
24996
24999
  let f = m;
24997
- for (; f = $t$1(f, i); )
25000
+ for (; f = $t(f, i); )
24998
25001
  if (e(f))
24999
25002
  return true;
25000
25003
  return false;
@@ -25002,7 +25005,7 @@ function un(e, t, u, r, a) {
25002
25005
  const c = /* @__PURE__ */ new WeakSet();
25003
25006
  return function(m) {
25004
25007
  let f = m;
25005
- for (; f = $t$1(f, i); )
25008
+ for (; f = $t(f, i); )
25006
25009
  if (!c.has(f)) {
25007
25010
  if (i.isTag(f) && e(f))
25008
25011
  return true;
@@ -25017,19 +25020,19 @@ function un(e, t, u, r, a) {
25017
25020
  do
25018
25021
  if (e(m))
25019
25022
  return true;
25020
- while (m = $t$1(m, i));
25023
+ while (m = $t(m, i));
25021
25024
  return false;
25022
25025
  };
25023
- case N$1.Parent:
25026
+ case N.Parent:
25024
25027
  return function(h) {
25025
25028
  return i.getChildren(h).some((m) => i.isTag(m) && e(m));
25026
25029
  };
25027
- case N$1.Child:
25030
+ case N.Child:
25028
25031
  return function(h) {
25029
25032
  const m = i.getParent(h);
25030
25033
  return m != null && i.isTag(m) && e(m);
25031
25034
  };
25032
- case N$1.Sibling:
25035
+ case N.Sibling:
25033
25036
  return function(h) {
25034
25037
  const m = i.getSiblings(h);
25035
25038
  for (let f = 0; f < m.length; f++) {
@@ -25041,7 +25044,7 @@ function un(e, t, u, r, a) {
25041
25044
  }
25042
25045
  return false;
25043
25046
  };
25044
- case N$1.Adjacent:
25047
+ case N.Adjacent:
25045
25048
  return i.prevElementSibling ? function(h) {
25046
25049
  const m = i.prevElementSibling(h);
25047
25050
  return m != null && e(m);
@@ -25049,14 +25052,14 @@ function un(e, t, u, r, a) {
25049
25052
  const m = i.getSiblings(h);
25050
25053
  let f;
25051
25054
  for (let T = 0; T < m.length; T++) {
25052
- const A = m[T];
25053
- if (n(h, A))
25055
+ const A2 = m[T];
25056
+ if (n(h, A2))
25054
25057
  break;
25055
- i.isTag(A) && (f = A);
25058
+ i.isTag(A2) && (f = A2);
25056
25059
  }
25057
25060
  return !!f && e(f);
25058
25061
  };
25059
- case N$1.Universal: {
25062
+ case N.Universal: {
25060
25063
  if (t.namespace != null && t.namespace !== "*")
25061
25064
  throw new Error("Namespaced universal selectors are not yet supported by css-select");
25062
25065
  return e;
@@ -25064,12 +25067,12 @@ function un(e, t, u, r, a) {
25064
25067
  }
25065
25068
  }
25066
25069
  function $r(e) {
25067
- return e.type === N$1.Pseudo && (e.name === "scope" || Array.isArray(e.data) && e.data.some((t) => t.some($r)));
25070
+ return e.type === N.Pseudo && (e.name === "scope" || Array.isArray(e.data) && e.data.some((t) => t.some($r)));
25068
25071
  }
25069
- const rn = { type: N$1.Descendant }, sn = {
25072
+ const rn = { type: N.Descendant }, sn = {
25070
25073
  type: "_flexibleDescendant"
25071
25074
  }, an = {
25072
- type: N$1.Pseudo,
25075
+ type: N.Pseudo,
25073
25076
  name: "scope",
25074
25077
  data: null
25075
25078
  };
@@ -25079,7 +25082,7 @@ function nn(e, { adapter: t }, u) {
25079
25082
  return a === jr || i && t.isTag(i);
25080
25083
  });
25081
25084
  for (const a of e) {
25082
- if (!(a.length > 0 && Au(a[0]) && a[0].type !== N$1.Descendant)) if (r && !a.some($r))
25085
+ if (!(a.length > 0 && Au(a[0]) && a[0].type !== N.Descendant)) if (r && !a.some($r))
25083
25086
  a.unshift(rn);
25084
25087
  else
25085
25088
  continue;
@@ -25098,7 +25101,7 @@ function Gr(e, t, u) {
25098
25101
  const c = e.map((h) => {
25099
25102
  if (h.length >= 2) {
25100
25103
  const [m, f] = h;
25101
- m.type !== N$1.Pseudo || m.name !== "scope" || (a && f.type === N$1.Descendant ? h[1] = sn : (f.type === N$1.Adjacent || f.type === N$1.Sibling) && (n = true));
25104
+ m.type !== N.Pseudo || m.name !== "scope" || (a && f.type === N.Descendant ? h[1] = sn : (f.type === N.Adjacent || f.type === N.Sibling) && (n = true));
25102
25105
  }
25103
25106
  return on(h, t, i);
25104
25107
  }).reduce(cn, C.falseFunc);
@@ -25114,13 +25117,13 @@ function cn(e, t) {
25114
25117
  };
25115
25118
  }
25116
25119
  const Wr = (e, t) => e === t, dn = {
25117
- adapter: St$1,
25120
+ adapter: St,
25118
25121
  equals: Wr
25119
25122
  };
25120
25123
  function hn(e) {
25121
25124
  var t, u, r, a;
25122
25125
  const i = e ?? dn;
25123
- return (t = i.adapter) !== null && t !== void 0 || (i.adapter = St$1), (u = i.equals) !== null && u !== void 0 || (i.equals = (a = (r = i.adapter) === null || r === void 0 ? void 0 : r.equals) !== null && a !== void 0 ? a : Wr), i;
25126
+ return (t = i.adapter) !== null && t !== void 0 || (i.adapter = St), (u = i.equals) !== null && u !== void 0 || (i.equals = (a = (r = i.adapter) === null || r === void 0 ? void 0 : r.equals) !== null && a !== void 0 ? a : Wr), i;
25124
25127
  }
25125
25128
  function ln(e) {
25126
25129
  return function(u, r, a) {
@@ -25186,10 +25189,10 @@ function wu(e) {
25186
25189
  return [u, t];
25187
25190
  }
25188
25191
  const En = {
25189
- type: N$1.Universal,
25192
+ type: N.Universal,
25190
25193
  namespace: null
25191
25194
  }, Tn = {
25192
- type: N$1.Pseudo,
25195
+ type: N.Pseudo,
25193
25196
  name: "scope",
25194
25197
  data: null
25195
25198
  };
@@ -25199,7 +25202,7 @@ function Qr(e, t, u = {}) {
25199
25202
  function Kr(e, t, u = {}) {
25200
25203
  if (typeof t == "function")
25201
25204
  return e.some(t);
25202
- const [r, a] = wu(Ct$1(t));
25205
+ const [r, a] = wu(Ct(t));
25203
25206
  return r.length > 0 && e.some(vu(r, u)) || a.some((i) => Jr(i, e, u).length > 0);
25204
25207
  }
25205
25208
  function _n(e, t, u, r) {
@@ -25226,7 +25229,7 @@ function _n(e, t, u, r) {
25226
25229
  }
25227
25230
  }
25228
25231
  function Xr(e, t, u = {}) {
25229
- return Zr(Ct$1(e), t, u);
25232
+ return Zr(Ct(e), t, u);
25230
25233
  }
25231
25234
  function Zr(e, t, u) {
25232
25235
  if (t.length === 0)
@@ -25260,7 +25263,7 @@ function Zr(e, t, u) {
25260
25263
  }
25261
25264
  function Jr(e, t, u) {
25262
25265
  var r;
25263
- if (e.some(qe)) {
25266
+ if (e.some(qe$1)) {
25264
25267
  const a = (r = u.root) !== null && r !== void 0 ? r : bn(t[0]), i = { ...u, context: t, relativeSelector: false };
25265
25268
  return e.push(Tn), Et(a, e, i, true, t.length);
25266
25269
  }
@@ -25269,22 +25272,22 @@ function Jr(e, t, u) {
25269
25272
  function gn(e, t, u = {}, r = 1 / 0) {
25270
25273
  if (typeof e == "function")
25271
25274
  return es(t, e);
25272
- const [a, i] = wu(Ct$1(e)), n = i.map((c) => Et(t, c, u, true, r));
25275
+ const [a, i] = wu(Ct(e)), n = i.map((c) => Et(t, c, u, true, r));
25273
25276
  return a.length && n.push(uu(t, a, u, r)), n.length === 0 ? [] : n.length === 1 ? n[0] : ke(n.reduce((c, h) => [...c, ...h]));
25274
25277
  }
25275
25278
  function Et(e, t, u, r, a) {
25276
25279
  const i = t.findIndex(bt), n = t.slice(0, i), c = t[i], h = t.length - 1 === i ? a : 1 / 0, m = fn(c.name, c.data, h);
25277
25280
  if (m === 0)
25278
25281
  return [];
25279
- const T = (n.length === 0 && !Array.isArray(e) ? It$1(e).filter(I) : n.length === 0 ? (Array.isArray(e) ? e : [e]).filter(I) : r || n.some(qe) ? uu(e, [n], u, m) : ru(e, [n], u)).slice(0, m);
25280
- let A = _n(c.name, T, c.data, u);
25281
- if (A.length === 0 || t.length === i + 1)
25282
- return A;
25283
- const w = t.slice(i + 1), v = w.some(qe);
25282
+ const T = (n.length === 0 && !Array.isArray(e) ? It(e).filter(I) : n.length === 0 ? (Array.isArray(e) ? e : [e]).filter(I) : r || n.some(qe$1) ? uu(e, [n], u, m) : ru(e, [n], u)).slice(0, m);
25283
+ let A2 = _n(c.name, T, c.data, u);
25284
+ if (A2.length === 0 || t.length === i + 1)
25285
+ return A2;
25286
+ const w = t.slice(i + 1), v = w.some(qe$1);
25284
25287
  if (v) {
25285
- if (qe(w[0])) {
25288
+ if (qe$1(w[0])) {
25286
25289
  const { type: S } = w[0];
25287
- (S === N$1.Sibling || S === N$1.Adjacent) && (A = zr(A, St$1, true)), w.unshift(En);
25290
+ (S === N.Sibling || S === N.Adjacent) && (A2 = zr(A2, St, true)), w.unshift(En);
25288
25291
  }
25289
25292
  u = {
25290
25293
  ...u,
@@ -25294,15 +25297,15 @@ function Et(e, t, u, r, a) {
25294
25297
  * Add a custom root func, to make sure traversals don't match elements
25295
25298
  * that aren't a part of the considered tree.
25296
25299
  */
25297
- rootFunc: (S) => A.includes(S)
25300
+ rootFunc: (S) => A2.includes(S)
25298
25301
  };
25299
25302
  } else u.rootFunc && u.rootFunc !== ft.trueFunc && (u = { ...u, rootFunc: ft.trueFunc });
25300
- return w.some(bt) ? Et(A, w, u, false, a) : v ? (
25303
+ return w.some(bt) ? Et(A2, w, u, false, a) : v ? (
25301
25304
  // Query existing elements to resolve traversal.
25302
- uu(A, [w], u, a)
25305
+ uu(A2, [w], u, a)
25303
25306
  ) : (
25304
25307
  // If we don't have any more traversals, simply filter elements.
25305
- ru(A, [w], u)
25308
+ ru(A2, [w], u)
25306
25309
  );
25307
25310
  }
25308
25311
  function uu(e, t, u, r) {
@@ -25310,7 +25313,7 @@ function uu(e, t, u, r) {
25310
25313
  return es(e, a, r);
25311
25314
  }
25312
25315
  function es(e, t, u = 1 / 0) {
25313
- const r = zr(e, St$1, t.shouldTestNextSiblings);
25316
+ const r = zr(e, St, t.shouldTestNextSiblings);
25314
25317
  return Eu((a) => I(a) && t(a), r, true, u);
25315
25318
  }
25316
25319
  function ru(e, t, u) {
@@ -25356,7 +25359,7 @@ function Nu(e) {
25356
25359
  };
25357
25360
  };
25358
25361
  }
25359
- const et = Nu((e, t) => {
25362
+ const et$1 = Nu((e, t) => {
25360
25363
  let u = [];
25361
25364
  for (let r = 0; r < t.length; r++) {
25362
25365
  const a = e(t[r]);
@@ -25386,15 +25389,15 @@ function Iu(e, ...t) {
25386
25389
  return u = null, n;
25387
25390
  };
25388
25391
  }
25389
- function Pe(e) {
25392
+ function Pe$1(e) {
25390
25393
  return e.length > 1 ? Array.from(new Set(e)) : e;
25391
25394
  }
25392
- const Nn = xu(({ parent: e }) => e && !Te(e) ? e : null, Pe), xn = et((e) => {
25395
+ const Nn = xu(({ parent: e }) => e && !Te$1(e) ? e : null, Pe$1), xn = et$1((e) => {
25393
25396
  const t = [];
25394
- for (; e.parent && !Te(e.parent); )
25397
+ for (; e.parent && !Te$1(e.parent); )
25395
25398
  t.push(e.parent), e = e.parent;
25396
25399
  return t;
25397
- }, ke, (e) => e.reverse()), In = Iu(({ parent: e }) => e && !Te(e) ? e : null, ke, (e) => e.reverse());
25400
+ }, ke, (e) => e.reverse()), In = Iu(({ parent: e }) => e && !Te$1(e) ? e : null, ke, (e) => e.reverse());
25398
25401
  function Sn(e) {
25399
25402
  var t;
25400
25403
  const u = [];
@@ -25405,7 +25408,7 @@ function Sn(e) {
25405
25408
  root: (t = this._root) === null || t === void 0 ? void 0 : t[0]
25406
25409
  }, a = typeof e == "string" ? (i) => Qr(i, e, r) : tt$1(e);
25407
25410
  return P(this, (i) => {
25408
- for (i && !Te(i) && !I(i) && (i = i.parent); i && I(i); ) {
25411
+ for (i && !Te$1(i) && !I(i) && (i = i.parent); i && I(i); ) {
25409
25412
  if (a(i, 0)) {
25410
25413
  u.includes(i) || u.push(i);
25411
25414
  break;
@@ -25414,17 +25417,17 @@ function Sn(e) {
25414
25417
  }
25415
25418
  }), this._make(u);
25416
25419
  }
25417
- const Cn = xu((e) => fu(e)), yn = et((e) => {
25420
+ const Cn = xu((e) => fu(e)), yn = et$1((e) => {
25418
25421
  const t = [];
25419
25422
  for (; e.next; )
25420
25423
  e = e.next, I(e) && t.push(e);
25421
25424
  return t;
25422
- }, Pe), On = Iu((e) => fu(e), Pe), Ln = xu((e) => bu(e)), Rn = et((e) => {
25425
+ }, Pe$1), On = Iu((e) => fu(e), Pe$1), Ln = xu((e) => bu(e)), Rn = et$1((e) => {
25423
25426
  const t = [];
25424
25427
  for (; e.prev; )
25425
25428
  e = e.prev, I(e) && t.push(e);
25426
25429
  return t;
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);
25430
+ }, Pe$1), Dn = Iu((e) => bu(e), Pe$1), kn = et$1((e) => Cr(e).filter((t) => I(t) && t !== e), ke), Pn = et$1((e) => It(e).filter(I), Pe$1);
25428
25431
  function Mn() {
25429
25432
  const e = this.toArray().reduce((t, u) => B$1(u) ? t.concat(u.children) : t, []);
25430
25433
  return this._make(e);
@@ -25551,9 +25554,9 @@ function eo(e) {
25551
25554
  if (typeof Buffer < "u" && Buffer.isBuffer(u) && (u = u.toString()), typeof u == "string")
25552
25555
  return e(u, r, a, i);
25553
25556
  const n = u;
25554
- if (!Array.isArray(n) && Te(n))
25557
+ if (!Array.isArray(n) && Te$1(n))
25555
25558
  return n;
25556
- const c = new Ne([]);
25559
+ const c = new Ne$1([]);
25557
25560
  return xe(n, c), c;
25558
25561
  };
25559
25562
  }
@@ -25562,7 +25565,7 @@ function xe(e, t) {
25562
25565
  t ? t.children = u : t = null;
25563
25566
  for (let r = 0; r < u.length; r++) {
25564
25567
  const a = u[r];
25565
- a.parent && a.parent.children !== u && Ie(a), t ? (a.prev = u[r - 1] || null, a.next = u[r + 1] || null) : a.prev = a.next = null, a.parent = t;
25568
+ a.parent && a.parent.children !== u && Ie$1(a), t ? (a.prev = u[r - 1] || null, a.next = u[r + 1] || null) : a.prev = a.next = null, a.parent = t;
25566
25569
  }
25567
25570
  return t;
25568
25571
  }
@@ -25602,7 +25605,7 @@ function ts(e) {
25602
25605
  });
25603
25606
  };
25604
25607
  }
25605
- function _e(e, t, u, r, a) {
25608
+ function _e$1(e, t, u, r, a) {
25606
25609
  var i, n;
25607
25610
  const c = [
25608
25611
  t,
@@ -25610,10 +25613,10 @@ function _e(e, t, u, r, a) {
25610
25613
  ...r
25611
25614
  ], h = t === 0 ? null : e[t - 1], m = t + u >= e.length ? null : e[t + u];
25612
25615
  for (let f = 0; f < r.length; ++f) {
25613
- const T = r[f], A = T.parent;
25614
- if (A) {
25615
- const v = A.children.indexOf(T);
25616
- v !== -1 && (A.children.splice(v, 1), a === A && t > v && c[0]--);
25616
+ const T = r[f], A2 = T.parent;
25617
+ if (A2) {
25618
+ const v = A2.children.indexOf(T);
25619
+ v !== -1 && (A2.children.splice(v, 1), a === A2 && t > v && c[0]--);
25617
25620
  }
25618
25621
  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];
25619
25622
  }
@@ -25626,15 +25629,15 @@ function ro(e) {
25626
25629
  return (de(e) ? e : this._make(e)).prepend(this), this;
25627
25630
  }
25628
25631
  const so = ts((e, t, u) => {
25629
- _e(t, t.length, 0, e, u);
25632
+ _e$1(t, t.length, 0, e, u);
25630
25633
  }), ao = ts((e, t, u) => {
25631
- _e(t, 0, 0, e, u);
25634
+ _e$1(t, 0, 0, e, u);
25632
25635
  });
25633
25636
  function us(e) {
25634
25637
  return function(t) {
25635
25638
  const u = this.length - 1, r = this.parents().last();
25636
25639
  for (let a = 0; a < this.length; a++) {
25637
- const i = this[a], n = typeof t == "function" ? t.call(i, a, i) : typeof t == "string" && !Xt$1(t) ? r.find(t).clone() : t, [c] = this._makeDomArray(n, a < u);
25640
+ 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);
25638
25641
  if (!c || !B$1(c))
25639
25642
  continue;
25640
25643
  let h = c, m = 0;
@@ -25652,7 +25655,7 @@ const io = us((e, t, u) => {
25652
25655
  if (!r)
25653
25656
  return;
25654
25657
  const a = r.children, i = a.indexOf(e);
25655
- xe([e], t), _e(a, i, 0, u, r);
25658
+ xe([e], t), _e$1(a, i, 0, u, r);
25656
25659
  }), no = us((e, t, u) => {
25657
25660
  B$1(e) && (xe(e.children, t), xe(u, e));
25658
25661
  });
@@ -25686,7 +25689,7 @@ function ho(...e) {
25686
25689
  if (i === -1)
25687
25690
  return;
25688
25691
  const n = typeof e[0] == "function" ? e[0].call(u, r, this._render(u.children)) : e, c = this._makeDomArray(n, r < t);
25689
- _e(a, i + 1, 0, c, u.parent);
25692
+ _e$1(a, i + 1, 0, c, u.parent);
25690
25693
  });
25691
25694
  }
25692
25695
  function lo(e) {
@@ -25697,7 +25700,7 @@ function lo(e) {
25697
25700
  if (!a)
25698
25701
  continue;
25699
25702
  const i = a.children, n = i.indexOf(u);
25700
- n !== -1 && (_e(i, n + 1, 0, r, a), t.push(...r));
25703
+ n !== -1 && (_e$1(i, n + 1, 0, r, a), t.push(...r));
25701
25704
  }
25702
25705
  return this._make(t);
25703
25706
  }
@@ -25710,7 +25713,7 @@ function mo(...e) {
25710
25713
  if (i === -1)
25711
25714
  return;
25712
25715
  const n = typeof e[0] == "function" ? e[0].call(u, r, this._render(u.children)) : e, c = this._makeDomArray(n, r < t);
25713
- _e(a, i, 0, c, u.parent);
25716
+ _e$1(a, i, 0, c, u.parent);
25714
25717
  });
25715
25718
  }
25716
25719
  function po(e) {
@@ -25722,13 +25725,13 @@ function po(e) {
25722
25725
  if (!i)
25723
25726
  return;
25724
25727
  const n = i.children, c = n.indexOf(r);
25725
- c !== -1 && (_e(n, c, 0, a, i), u.push(...a));
25728
+ c !== -1 && (_e$1(n, c, 0, a, i), u.push(...a));
25726
25729
  }), this._make(u);
25727
25730
  }
25728
25731
  function fo(e) {
25729
25732
  const t = e ? this.filter(e) : this;
25730
25733
  return P(t, (u) => {
25731
- Ie(u), u.prev = u.next = u.parent = null;
25734
+ Ie$1(u), u.prev = u.next = u.parent = null;
25732
25735
  }), this;
25733
25736
  }
25734
25737
  function bo(e) {
@@ -25739,7 +25742,7 @@ function bo(e) {
25739
25742
  const a = r.children, i = typeof e == "function" ? e.call(t, u, t) : e, n = this._makeDomArray(i);
25740
25743
  xe(n, null);
25741
25744
  const c = a.indexOf(t);
25742
- _e(a, c, 1, n, r), n.includes(t) || (t.parent = t.prev = t.next = null);
25745
+ _e$1(a, c, 1, n, r), n.includes(t) || (t.parent = t.prev = t.next = null);
25743
25746
  });
25744
25747
  }
25745
25748
  function Eo() {
@@ -25779,7 +25782,7 @@ function go(e) {
25779
25782
  });
25780
25783
  }
25781
25784
  function Ao() {
25782
- const e = Array.prototype.map.call(this.get(), (u) => ze(u, true)), t = new Ne(e);
25785
+ const e = Array.prototype.map.call(this.get(), (u) => ze(u, true)), t = new Ne$1(e);
25783
25786
  for (const u of e)
25784
25787
  u.parent = t;
25785
25788
  return this._make(e);
@@ -25945,24 +25948,24 @@ function ko(e, t) {
25945
25948
  throw new Error("cheerio.load() expects a string");
25946
25949
  const n = Kt(a), c = e(r, n, i, null);
25947
25950
  class h extends ut {
25948
- _make(T, A) {
25949
- const w = m(T, A);
25951
+ _make(T, A2) {
25952
+ const w = m(T, A2);
25950
25953
  return w.prevObject = this, w;
25951
25954
  }
25952
- _parse(T, A, w, v) {
25953
- return e(T, A, w, v);
25955
+ _parse(T, A2, w, v) {
25956
+ return e(T, A2, w, v);
25954
25957
  }
25955
25958
  _render(T) {
25956
25959
  return t(T, this.options);
25957
25960
  }
25958
25961
  }
25959
- function m(f, T, A = c, w) {
25962
+ function m(f, T, A2 = c, w) {
25960
25963
  if (f && de(f))
25961
25964
  return f;
25962
- const v = Kt(w, n), S = typeof A == "string" ? [e(A, v, false, null)] : "length" in A ? A : [A], U2 = de(S) ? S : new h(S, null, v);
25965
+ const v = Kt(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);
25963
25966
  if (U2._root = U2, !f)
25964
25967
  return new h(void 0, U2, v);
25965
- const M = typeof f == "string" && Xt$1(f) ? (
25968
+ const M = typeof f == "string" && Xt(f) ? (
25966
25969
  // $(<html>)
25967
25970
  e(f, v, false, null).children
25968
25971
  ) : Po(f) ? (
@@ -25971,20 +25974,20 @@ function ko(e, t) {
25971
25974
  ) : Array.isArray(f) ? (
25972
25975
  // $([dom])
25973
25976
  f
25974
- ) : void 0, ee = new h(M, U2, v);
25977
+ ) : void 0, ee2 = new h(M, U2, v);
25975
25978
  if (M)
25976
- return ee;
25979
+ return ee2;
25977
25980
  if (typeof f != "string")
25978
25981
  throw new TypeError("Unexpected type of selector");
25979
- let he = f;
25982
+ let he2 = f;
25980
25983
  const ae = T ? (
25981
25984
  // If we don't have a context, maybe we have a root, from loading
25982
- typeof T == "string" ? Xt$1(T) ? (
25985
+ typeof T == "string" ? Xt(T) ? (
25983
25986
  // $('li', '<ul>...</ul>')
25984
25987
  new h([e(T, v, false, null)], U2, v)
25985
25988
  ) : (
25986
25989
  // $('li', 'ul')
25987
- (he = `${T} ${he}`, U2)
25990
+ (he2 = `${T} ${he2}`, U2)
25988
25991
  ) : de(T) ? (
25989
25992
  // $('li', $)
25990
25993
  T
@@ -25993,7 +25996,7 @@ function ko(e, t) {
25993
25996
  new h(Array.isArray(T) ? T : [T], U2, v)
25994
25997
  )
25995
25998
  ) : U2;
25996
- return ae ? ae.find(he) : ee;
25999
+ return ae ? ae.find(he2) : ee2;
25997
26000
  }
25998
26001
  return Object.assign(m, ni, {
25999
26002
  load: u,
@@ -26705,7 +26708,7 @@ var d;
26705
26708
  (function(e) {
26706
26709
  e[e.DATA = 0] = "DATA", e[e.RCDATA = 1] = "RCDATA", e[e.RAWTEXT = 2] = "RAWTEXT", e[e.SCRIPT_DATA = 3] = "SCRIPT_DATA", e[e.PLAINTEXT = 4] = "PLAINTEXT", e[e.TAG_OPEN = 5] = "TAG_OPEN", e[e.END_TAG_OPEN = 6] = "END_TAG_OPEN", e[e.TAG_NAME = 7] = "TAG_NAME", e[e.RCDATA_LESS_THAN_SIGN = 8] = "RCDATA_LESS_THAN_SIGN", e[e.RCDATA_END_TAG_OPEN = 9] = "RCDATA_END_TAG_OPEN", e[e.RCDATA_END_TAG_NAME = 10] = "RCDATA_END_TAG_NAME", e[e.RAWTEXT_LESS_THAN_SIGN = 11] = "RAWTEXT_LESS_THAN_SIGN", e[e.RAWTEXT_END_TAG_OPEN = 12] = "RAWTEXT_END_TAG_OPEN", e[e.RAWTEXT_END_TAG_NAME = 13] = "RAWTEXT_END_TAG_NAME", e[e.SCRIPT_DATA_LESS_THAN_SIGN = 14] = "SCRIPT_DATA_LESS_THAN_SIGN", e[e.SCRIPT_DATA_END_TAG_OPEN = 15] = "SCRIPT_DATA_END_TAG_OPEN", e[e.SCRIPT_DATA_END_TAG_NAME = 16] = "SCRIPT_DATA_END_TAG_NAME", e[e.SCRIPT_DATA_ESCAPE_START = 17] = "SCRIPT_DATA_ESCAPE_START", e[e.SCRIPT_DATA_ESCAPE_START_DASH = 18] = "SCRIPT_DATA_ESCAPE_START_DASH", e[e.SCRIPT_DATA_ESCAPED = 19] = "SCRIPT_DATA_ESCAPED", e[e.SCRIPT_DATA_ESCAPED_DASH = 20] = "SCRIPT_DATA_ESCAPED_DASH", e[e.SCRIPT_DATA_ESCAPED_DASH_DASH = 21] = "SCRIPT_DATA_ESCAPED_DASH_DASH", e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN = 22] = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN", e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN = 23] = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN", e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME = 24] = "SCRIPT_DATA_ESCAPED_END_TAG_NAME", e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START = 25] = "SCRIPT_DATA_DOUBLE_ESCAPE_START", e[e.SCRIPT_DATA_DOUBLE_ESCAPED = 26] = "SCRIPT_DATA_DOUBLE_ESCAPED", e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH = 27] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH", e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH = 28] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH", e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN = 29] = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN", e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END = 30] = "SCRIPT_DATA_DOUBLE_ESCAPE_END", e[e.BEFORE_ATTRIBUTE_NAME = 31] = "BEFORE_ATTRIBUTE_NAME", e[e.ATTRIBUTE_NAME = 32] = "ATTRIBUTE_NAME", e[e.AFTER_ATTRIBUTE_NAME = 33] = "AFTER_ATTRIBUTE_NAME", e[e.BEFORE_ATTRIBUTE_VALUE = 34] = "BEFORE_ATTRIBUTE_VALUE", e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED = 35] = "ATTRIBUTE_VALUE_DOUBLE_QUOTED", e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED = 36] = "ATTRIBUTE_VALUE_SINGLE_QUOTED", e[e.ATTRIBUTE_VALUE_UNQUOTED = 37] = "ATTRIBUTE_VALUE_UNQUOTED", e[e.AFTER_ATTRIBUTE_VALUE_QUOTED = 38] = "AFTER_ATTRIBUTE_VALUE_QUOTED", e[e.SELF_CLOSING_START_TAG = 39] = "SELF_CLOSING_START_TAG", e[e.BOGUS_COMMENT = 40] = "BOGUS_COMMENT", e[e.MARKUP_DECLARATION_OPEN = 41] = "MARKUP_DECLARATION_OPEN", e[e.COMMENT_START = 42] = "COMMENT_START", e[e.COMMENT_START_DASH = 43] = "COMMENT_START_DASH", e[e.COMMENT = 44] = "COMMENT", e[e.COMMENT_LESS_THAN_SIGN = 45] = "COMMENT_LESS_THAN_SIGN", e[e.COMMENT_LESS_THAN_SIGN_BANG = 46] = "COMMENT_LESS_THAN_SIGN_BANG", e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH = 47] = "COMMENT_LESS_THAN_SIGN_BANG_DASH", e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH = 48] = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH", e[e.COMMENT_END_DASH = 49] = "COMMENT_END_DASH", e[e.COMMENT_END = 50] = "COMMENT_END", e[e.COMMENT_END_BANG = 51] = "COMMENT_END_BANG", e[e.DOCTYPE = 52] = "DOCTYPE", e[e.BEFORE_DOCTYPE_NAME = 53] = "BEFORE_DOCTYPE_NAME", e[e.DOCTYPE_NAME = 54] = "DOCTYPE_NAME", e[e.AFTER_DOCTYPE_NAME = 55] = "AFTER_DOCTYPE_NAME", e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD = 56] = "AFTER_DOCTYPE_PUBLIC_KEYWORD", e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER = 57] = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER", e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED = 58] = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED", e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED = 59] = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED", e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER = 60] = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER", e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS = 61] = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS", e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD = 62] = "AFTER_DOCTYPE_SYSTEM_KEYWORD", e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER = 63] = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER", e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED = 64] = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED", e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED = 65] = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED", e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER = 66] = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER", e[e.BOGUS_DOCTYPE = 67] = "BOGUS_DOCTYPE", e[e.CDATA_SECTION = 68] = "CDATA_SECTION", e[e.CDATA_SECTION_BRACKET = 69] = "CDATA_SECTION_BRACKET", e[e.CDATA_SECTION_END = 70] = "CDATA_SECTION_END", e[e.CHARACTER_REFERENCE = 71] = "CHARACTER_REFERENCE", e[e.AMBIGUOUS_AMPERSAND = 72] = "AMBIGUOUS_AMPERSAND";
26707
26710
  })(d || (d = {}));
26708
- const K = {
26711
+ const K$1 = {
26709
26712
  DATA: d.DATA,
26710
26713
  RCDATA: d.RCDATA,
26711
26714
  RAWTEXT: d.RAWTEXT,
@@ -26716,19 +26719,19 @@ const K = {
26716
26719
  function ec(e) {
26717
26720
  return e >= o.DIGIT_0 && e <= o.DIGIT_9;
26718
26721
  }
26719
- function He(e) {
26722
+ function He$1(e) {
26720
26723
  return e >= o.LATIN_CAPITAL_A && e <= o.LATIN_CAPITAL_Z;
26721
26724
  }
26722
26725
  function tc(e) {
26723
26726
  return e >= o.LATIN_SMALL_A && e <= o.LATIN_SMALL_Z;
26724
26727
  }
26725
26728
  function me(e) {
26726
- return tc(e) || He(e);
26729
+ return tc(e) || He$1(e);
26727
26730
  }
26728
26731
  function ur(e) {
26729
26732
  return me(e) || ec(e);
26730
26733
  }
26731
- function nt(e) {
26734
+ function nt$1(e) {
26732
26735
  return e + 32;
26733
26736
  }
26734
26737
  function cs(e) {
@@ -27435,7 +27438,7 @@ class rc {
27435
27438
  break;
27436
27439
  }
27437
27440
  default:
27438
- u.tagName += String.fromCodePoint(He(t) ? nt(t) : t);
27441
+ u.tagName += String.fromCodePoint(He$1(t) ? nt$1(t) : t);
27439
27442
  }
27440
27443
  }
27441
27444
  // RCDATA less-than sign state
@@ -27767,7 +27770,7 @@ class rc {
27767
27770
  break;
27768
27771
  }
27769
27772
  default:
27770
- this.currentAttr.name += String.fromCodePoint(He(t) ? nt(t) : t);
27773
+ this.currentAttr.name += String.fromCodePoint(He$1(t) ? nt$1(t) : t);
27771
27774
  }
27772
27775
  }
27773
27776
  // After attribute name state
@@ -28168,8 +28171,8 @@ class rc {
28168
28171
  // Before DOCTYPE name state
28169
28172
  //------------------------------------------------------------------
28170
28173
  _stateBeforeDoctypeName(t) {
28171
- if (He(t))
28172
- this._createDoctypeToken(String.fromCharCode(nt(t))), this.state = d.DOCTYPE_NAME;
28174
+ if (He$1(t))
28175
+ this._createDoctypeToken(String.fromCharCode(nt$1(t))), this.state = d.DOCTYPE_NAME;
28173
28176
  else
28174
28177
  switch (t) {
28175
28178
  case o.SPACE:
@@ -28222,7 +28225,7 @@ class rc {
28222
28225
  break;
28223
28226
  }
28224
28227
  default:
28225
- u.name += String.fromCodePoint(He(t) ? nt(t) : t);
28228
+ u.name += String.fromCodePoint(He$1(t) ? nt$1(t) : t);
28226
28229
  }
28227
28230
  }
28228
28231
  // After DOCTYPE name state
@@ -28640,7 +28643,7 @@ const ds = /* @__PURE__ */ new Set([s.DD, s.DT, s.LI, s.OPTGROUP, s.OPTION, s.P,
28640
28643
  s.TH,
28641
28644
  s.THEAD,
28642
28645
  s.TR
28643
- ]), Tt$1 = /* @__PURE__ */ new Set([
28646
+ ]), Tt = /* @__PURE__ */ new Set([
28644
28647
  s.APPLET,
28645
28648
  s.CAPTION,
28646
28649
  s.HTML,
@@ -28650,7 +28653,7 @@ const ds = /* @__PURE__ */ new Set([s.DD, s.DT, s.LI, s.OPTGROUP, s.OPTION, s.P,
28650
28653
  s.TD,
28651
28654
  s.TEMPLATE,
28652
28655
  s.TH
28653
- ]), sc = /* @__PURE__ */ new Set([...Tt$1, s.OL, s.UL]), ac = /* @__PURE__ */ new Set([...Tt$1, s.BUTTON]), ar = /* @__PURE__ */ new Set([s.ANNOTATION_XML, s.MI, s.MN, s.MO, s.MS, s.MTEXT]), ir = /* @__PURE__ */ new Set([s.DESC, s.FOREIGN_OBJECT, s.TITLE]), ic = /* @__PURE__ */ new Set([s.TR, s.TEMPLATE, s.HTML]), nc = /* @__PURE__ */ new Set([s.TBODY, s.TFOOT, s.THEAD, s.TEMPLATE, s.HTML]), oc = /* @__PURE__ */ new Set([s.TABLE, s.TEMPLATE, s.HTML]), cc = /* @__PURE__ */ new Set([s.TD, s.TH]);
28656
+ ]), sc = /* @__PURE__ */ new Set([...Tt, s.OL, s.UL]), ac = /* @__PURE__ */ new Set([...Tt, s.BUTTON]), ar = /* @__PURE__ */ new Set([s.ANNOTATION_XML, s.MI, s.MN, s.MO, s.MS, s.MTEXT]), ir = /* @__PURE__ */ new Set([s.DESC, s.FOREIGN_OBJECT, s.TITLE]), ic = /* @__PURE__ */ new Set([s.TR, s.TEMPLATE, s.HTML]), nc = /* @__PURE__ */ new Set([s.TBODY, s.TFOOT, s.THEAD, s.TEMPLATE, s.HTML]), oc = /* @__PURE__ */ new Set([s.TABLE, s.TEMPLATE, s.HTML]), cc = /* @__PURE__ */ new Set([s.TD, s.TH]);
28654
28657
  class dc {
28655
28658
  get currentTmplContentOrNode() {
28656
28659
  return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current;
@@ -28779,7 +28782,7 @@ class dc {
28779
28782
  return true;
28780
28783
  }
28781
28784
  hasInScope(t) {
28782
- return this.hasInDynamicScope(t, Tt$1);
28785
+ return this.hasInDynamicScope(t, Tt);
28783
28786
  }
28784
28787
  hasInListItemScope(t) {
28785
28788
  return this.hasInDynamicScope(t, sc);
@@ -28794,7 +28797,7 @@ class dc {
28794
28797
  case E.HTML: {
28795
28798
  if (au.has(u))
28796
28799
  return true;
28797
- if (Tt$1.has(u))
28800
+ if (Tt.has(u))
28798
28801
  return false;
28799
28802
  break;
28800
28803
  }
@@ -28867,11 +28870,11 @@ class dc {
28867
28870
  }
28868
28871
  }
28869
28872
  const Gt = 3;
28870
- var te;
28873
+ var te$1;
28871
28874
  (function(e) {
28872
28875
  e[e.Marker = 0] = "Marker", e[e.Element = 1] = "Element";
28873
- })(te || (te = {}));
28874
- const nr = { type: te.Marker };
28876
+ })(te$1 || (te$1 = {}));
28877
+ const nr = { type: te$1.Marker };
28875
28878
  class hc {
28876
28879
  constructor(t) {
28877
28880
  this.treeAdapter = t, this.entries = [], this.bookmark = null;
@@ -28883,7 +28886,7 @@ class hc {
28883
28886
  const r = [], a = u.length, i = this.treeAdapter.getTagName(t), n = this.treeAdapter.getNamespaceURI(t);
28884
28887
  for (let c = 0; c < this.entries.length; c++) {
28885
28888
  const h = this.entries[c];
28886
- if (h.type === te.Marker)
28889
+ if (h.type === te$1.Marker)
28887
28890
  break;
28888
28891
  const { element: m } = h;
28889
28892
  if (this.treeAdapter.getTagName(m) === i && this.treeAdapter.getNamespaceURI(m) === n) {
@@ -28912,7 +28915,7 @@ class hc {
28912
28915
  }
28913
28916
  pushElement(t, u) {
28914
28917
  this._ensureNoahArkCondition(t), this.entries.unshift({
28915
- type: te.Element,
28918
+ type: te$1.Element,
28916
28919
  element: t,
28917
28920
  token: u
28918
28921
  });
@@ -28920,7 +28923,7 @@ class hc {
28920
28923
  insertElementAfterBookmark(t, u) {
28921
28924
  const r = this.entries.indexOf(this.bookmark);
28922
28925
  this.entries.splice(r, 0, {
28923
- type: te.Element,
28926
+ type: te$1.Element,
28924
28927
  element: t,
28925
28928
  token: u
28926
28929
  });
@@ -28940,11 +28943,11 @@ class hc {
28940
28943
  }
28941
28944
  //Search
28942
28945
  getElementEntryInScopeWithTagName(t) {
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;
28946
+ const u = this.entries.find((r) => r.type === te$1.Marker || this.treeAdapter.getTagName(r.element) === t);
28947
+ return u && u.type === te$1.Element ? u : null;
28945
28948
  }
28946
28949
  getElementEntry(t) {
28947
- return this.entries.find((u) => u.type === te.Element && u.element === t);
28950
+ return this.entries.find((u) => u.type === te$1.Element && u.element === t);
28948
28951
  }
28949
28952
  }
28950
28953
  const oe = {
@@ -29480,7 +29483,7 @@ class Es {
29480
29483
  this._insertElement(t, E.HTML), this.tokenizer.state = u, this.originalInsertionMode = this.insertionMode, this.insertionMode = l.TEXT;
29481
29484
  }
29482
29485
  switchToPlaintextParsing() {
29483
- this.insertionMode = l.TEXT, this.originalInsertionMode = l.IN_BODY, this.tokenizer.state = K.PLAINTEXT;
29486
+ this.insertionMode = l.TEXT, this.originalInsertionMode = l.IN_BODY, this.tokenizer.state = K$1.PLAINTEXT;
29484
29487
  }
29485
29488
  //Fragment parsing
29486
29489
  /** @protected */
@@ -29503,7 +29506,7 @@ class Es {
29503
29506
  switch (this.fragmentContextID) {
29504
29507
  case s.TITLE:
29505
29508
  case s.TEXTAREA: {
29506
- this.tokenizer.state = K.RCDATA;
29509
+ this.tokenizer.state = K$1.RCDATA;
29507
29510
  break;
29508
29511
  }
29509
29512
  case s.STYLE:
@@ -29512,15 +29515,15 @@ class Es {
29512
29515
  case s.NOEMBED:
29513
29516
  case s.NOFRAMES:
29514
29517
  case s.NOSCRIPT: {
29515
- this.tokenizer.state = K.RAWTEXT;
29518
+ this.tokenizer.state = K$1.RAWTEXT;
29516
29519
  break;
29517
29520
  }
29518
29521
  case s.SCRIPT: {
29519
- this.tokenizer.state = K.SCRIPT_DATA;
29522
+ this.tokenizer.state = K$1.SCRIPT_DATA;
29520
29523
  break;
29521
29524
  }
29522
29525
  case s.PLAINTEXT: {
29523
- this.tokenizer.state = K.PLAINTEXT;
29526
+ this.tokenizer.state = K$1.PLAINTEXT;
29524
29527
  break;
29525
29528
  }
29526
29529
  }
@@ -29680,7 +29683,7 @@ class Es {
29680
29683
  _reconstructActiveFormattingElements() {
29681
29684
  const t = this.activeFormattingElements.entries.length;
29682
29685
  if (t) {
29683
- const u = this.activeFormattingElements.entries.findIndex((a) => a.type === te.Marker || this.openElements.contains(a.element)), r = u === -1 ? t - 1 : u - 1;
29686
+ const u = this.activeFormattingElements.entries.findIndex((a) => a.type === te$1.Marker || this.openElements.contains(a.element)), r = u === -1 ? t - 1 : u - 1;
29684
29687
  for (let a = r; a >= 0; a--) {
29685
29688
  const i = this.activeFormattingElements.entries[a];
29686
29689
  this._insertElement(i.token, this.treeAdapter.getNamespaceURI(i.element)), i.element = this.openElements.current;
@@ -29821,15 +29824,15 @@ class Es {
29821
29824
  }
29822
29825
  switch (this.insertionMode) {
29823
29826
  case l.INITIAL: {
29824
- Ue(this, t);
29827
+ Ue$1(this, t);
29825
29828
  break;
29826
29829
  }
29827
29830
  case l.BEFORE_HTML: {
29828
- Ye(this, t);
29831
+ Ye$1(this, t);
29829
29832
  break;
29830
29833
  }
29831
29834
  case l.BEFORE_HEAD: {
29832
- je(this, t);
29835
+ je$1(this, t);
29833
29836
  break;
29834
29837
  }
29835
29838
  case l.IN_HEAD: {
@@ -29868,7 +29871,7 @@ class Es {
29868
29871
  break;
29869
29872
  }
29870
29873
  case l.IN_COLUMN_GROUP: {
29871
- _t$1(this, t);
29874
+ _t(this, t);
29872
29875
  break;
29873
29876
  }
29874
29877
  case l.AFTER_BODY: {
@@ -29889,15 +29892,15 @@ class Es {
29889
29892
  }
29890
29893
  switch (this.insertionMode) {
29891
29894
  case l.INITIAL: {
29892
- Ue(this, t);
29895
+ Ue$1(this, t);
29893
29896
  break;
29894
29897
  }
29895
29898
  case l.BEFORE_HTML: {
29896
- Ye(this, t);
29899
+ Ye$1(this, t);
29897
29900
  break;
29898
29901
  }
29899
29902
  case l.BEFORE_HEAD: {
29900
- je(this, t);
29903
+ je$1(this, t);
29901
29904
  break;
29902
29905
  }
29903
29906
  case l.IN_HEAD: {
@@ -29923,7 +29926,7 @@ class Es {
29923
29926
  break;
29924
29927
  }
29925
29928
  case l.IN_COLUMN_GROUP: {
29926
- _t$1(this, t);
29929
+ _t(this, t);
29927
29930
  break;
29928
29931
  }
29929
29932
  case l.AFTER_BODY: {
@@ -29965,7 +29968,7 @@ class Es {
29965
29968
  break;
29966
29969
  }
29967
29970
  case l.IN_TABLE_TEXT: {
29968
- Fe(this, t);
29971
+ Fe$1(this, t);
29969
29972
  break;
29970
29973
  }
29971
29974
  case l.AFTER_BODY: {
@@ -29994,7 +29997,7 @@ class Es {
29994
29997
  break;
29995
29998
  }
29996
29999
  case l.IN_TABLE_TEXT: {
29997
- Fe(this, t);
30000
+ Fe$1(this, t);
29998
30001
  break;
29999
30002
  }
30000
30003
  }
@@ -30021,7 +30024,7 @@ class Es {
30021
30024
  _startTagOutsideForeignContent(t) {
30022
30025
  switch (this.insertionMode) {
30023
30026
  case l.INITIAL: {
30024
- Ue(this, t);
30027
+ Ue$1(this, t);
30025
30028
  break;
30026
30029
  }
30027
30030
  case l.BEFORE_HTML: {
@@ -30033,7 +30036,7 @@ class Es {
30033
30036
  break;
30034
30037
  }
30035
30038
  case l.IN_HEAD: {
30036
- J(this, t);
30039
+ J$1(this, t);
30037
30040
  break;
30038
30041
  }
30039
30042
  case l.IN_HEAD_NO_SCRIPT: {
@@ -30049,11 +30052,11 @@ class Es {
30049
30052
  break;
30050
30053
  }
30051
30054
  case l.IN_TABLE: {
30052
- Re(this, t);
30055
+ Re$1(this, t);
30053
30056
  break;
30054
30057
  }
30055
30058
  case l.IN_TABLE_TEXT: {
30056
- Fe(this, t);
30059
+ Fe$1(this, t);
30057
30060
  break;
30058
30061
  }
30059
30062
  case l.IN_CAPTION: {
@@ -30065,7 +30068,7 @@ class Es {
30065
30068
  break;
30066
30069
  }
30067
30070
  case l.IN_TABLE_BODY: {
30068
- Rt$1(this, t);
30071
+ Rt(this, t);
30069
30072
  break;
30070
30073
  }
30071
30074
  case l.IN_ROW: {
@@ -30118,7 +30121,7 @@ class Es {
30118
30121
  _endTagOutsideForeignContent(t) {
30119
30122
  switch (this.insertionMode) {
30120
30123
  case l.INITIAL: {
30121
- Ue(this, t);
30124
+ Ue$1(this, t);
30122
30125
  break;
30123
30126
  }
30124
30127
  case l.BEFORE_HTML: {
@@ -30142,7 +30145,7 @@ class Es {
30142
30145
  break;
30143
30146
  }
30144
30147
  case l.IN_BODY: {
30145
- Lt$1(this, t);
30148
+ Lt(this, t);
30146
30149
  break;
30147
30150
  }
30148
30151
  case l.TEXT: {
@@ -30154,7 +30157,7 @@ class Es {
30154
30157
  break;
30155
30158
  }
30156
30159
  case l.IN_TABLE_TEXT: {
30157
- Fe(this, t);
30160
+ Fe$1(this, t);
30158
30161
  break;
30159
30162
  }
30160
30163
  case l.IN_CAPTION: {
@@ -30211,15 +30214,15 @@ class Es {
30211
30214
  onEof(t) {
30212
30215
  switch (this.insertionMode) {
30213
30216
  case l.INITIAL: {
30214
- Ue(this, t);
30217
+ Ue$1(this, t);
30215
30218
  break;
30216
30219
  }
30217
30220
  case l.BEFORE_HTML: {
30218
- Ye(this, t);
30221
+ Ye$1(this, t);
30219
30222
  break;
30220
30223
  }
30221
30224
  case l.BEFORE_HEAD: {
30222
- je(this, t);
30225
+ je$1(this, t);
30223
30226
  break;
30224
30227
  }
30225
30228
  case l.IN_HEAD: {
@@ -30251,7 +30254,7 @@ class Es {
30251
30254
  break;
30252
30255
  }
30253
30256
  case l.IN_TABLE_TEXT: {
30254
- Fe(this, t);
30257
+ Fe$1(this, t);
30255
30258
  break;
30256
30259
  }
30257
30260
  case l.IN_TEMPLATE: {
@@ -30396,17 +30399,17 @@ function Yc(e, t) {
30396
30399
  const u = t.forceQuirks ? X$1.QUIRKS : Tc(t);
30397
30400
  Ec(t) || e._err(t, b.nonConformingDoctype), e.treeAdapter.setDocumentMode(e.document, u), e.insertionMode = l.BEFORE_HTML;
30398
30401
  }
30399
- function Ue(e, t) {
30402
+ function Ue$1(e, t) {
30400
30403
  e._err(t, b.missingDoctype, true), e.treeAdapter.setDocumentMode(e.document, X$1.QUIRKS), e.insertionMode = l.BEFORE_HTML, e._processToken(t);
30401
30404
  }
30402
30405
  function jc(e, t) {
30403
- t.tagID === s.HTML ? (e._insertElement(t, E.HTML), e.insertionMode = l.BEFORE_HEAD) : Ye(e, t);
30406
+ t.tagID === s.HTML ? (e._insertElement(t, E.HTML), e.insertionMode = l.BEFORE_HEAD) : Ye$1(e, t);
30404
30407
  }
30405
30408
  function Vc(e, t) {
30406
30409
  const u = t.tagID;
30407
- (u === s.HTML || u === s.HEAD || u === s.BODY || u === s.BR) && Ye(e, t);
30410
+ (u === s.HTML || u === s.HEAD || u === s.BODY || u === s.BR) && Ye$1(e, t);
30408
30411
  }
30409
- function Ye(e, t) {
30412
+ function Ye$1(e, t) {
30410
30413
  e._insertFakeRootElement(), e.insertionMode = l.BEFORE_HEAD, e._processToken(t);
30411
30414
  }
30412
30415
  function $c(e, t) {
@@ -30420,17 +30423,17 @@ function $c(e, t) {
30420
30423
  break;
30421
30424
  }
30422
30425
  default:
30423
- je(e, t);
30426
+ je$1(e, t);
30424
30427
  }
30425
30428
  }
30426
30429
  function Gc(e, t) {
30427
30430
  const u = t.tagID;
30428
- u === s.HEAD || u === s.BODY || u === s.HTML || u === s.BR ? je(e, t) : e._err(t, b.endTagWithoutMatchingOpenElement);
30431
+ u === s.HEAD || u === s.BODY || u === s.HTML || u === s.BR ? je$1(e, t) : e._err(t, b.endTagWithoutMatchingOpenElement);
30429
30432
  }
30430
- function je(e, t) {
30433
+ function je$1(e, t) {
30431
30434
  e._insertFakeElement(p.HEAD, s.HEAD), e.headElement = e.openElements.current, e.insertionMode = l.IN_HEAD, e._processToken(t);
30432
30435
  }
30433
- function J(e, t) {
30436
+ function J$1(e, t) {
30434
30437
  switch (t.tagID) {
30435
30438
  case s.HTML: {
30436
30439
  G$1(e, t);
@@ -30445,20 +30448,20 @@ function J(e, t) {
30445
30448
  break;
30446
30449
  }
30447
30450
  case s.TITLE: {
30448
- e._switchToTextParsing(t, K.RCDATA);
30451
+ e._switchToTextParsing(t, K$1.RCDATA);
30449
30452
  break;
30450
30453
  }
30451
30454
  case s.NOSCRIPT: {
30452
- e.options.scriptingEnabled ? e._switchToTextParsing(t, K.RAWTEXT) : (e._insertElement(t, E.HTML), e.insertionMode = l.IN_HEAD_NO_SCRIPT);
30455
+ e.options.scriptingEnabled ? e._switchToTextParsing(t, K$1.RAWTEXT) : (e._insertElement(t, E.HTML), e.insertionMode = l.IN_HEAD_NO_SCRIPT);
30453
30456
  break;
30454
30457
  }
30455
30458
  case s.NOFRAMES:
30456
30459
  case s.STYLE: {
30457
- e._switchToTextParsing(t, K.RAWTEXT);
30460
+ e._switchToTextParsing(t, K$1.RAWTEXT);
30458
30461
  break;
30459
30462
  }
30460
30463
  case s.SCRIPT: {
30461
- e._switchToTextParsing(t, K.SCRIPT_DATA);
30464
+ e._switchToTextParsing(t, K$1.SCRIPT_DATA);
30462
30465
  break;
30463
30466
  }
30464
30467
  case s.TEMPLATE: {
@@ -30512,7 +30515,7 @@ function zc(e, t) {
30512
30515
  case s.META:
30513
30516
  case s.NOFRAMES:
30514
30517
  case s.STYLE: {
30515
- J(e, t);
30518
+ J$1(e, t);
30516
30519
  break;
30517
30520
  }
30518
30521
  case s.NOSCRIPT: {
@@ -30565,7 +30568,7 @@ function Kc(e, t) {
30565
30568
  case s.STYLE:
30566
30569
  case s.TEMPLATE:
30567
30570
  case s.TITLE: {
30568
- e._err(t, b.abandonedHeadElementChild), e.openElements.push(e.headElement, s.HEAD), J(e, t), e.openElements.remove(e.headElement);
30571
+ e._err(t, b.abandonedHeadElementChild), e.openElements.push(e.headElement, s.HEAD), J$1(e, t), e.openElements.remove(e.headElement);
30569
30572
  break;
30570
30573
  }
30571
30574
  case s.HEAD: {
@@ -30593,9 +30596,9 @@ function Xc(e, t) {
30593
30596
  }
30594
30597
  }
30595
30598
  function Ge(e, t) {
30596
- e._insertFakeElement(p.BODY, s.BODY), e.insertionMode = l.IN_BODY, Ot$1(e, t);
30599
+ e._insertFakeElement(p.BODY, s.BODY), e.insertionMode = l.IN_BODY, Ot(e, t);
30597
30600
  }
30598
- function Ot$1(e, t) {
30601
+ function Ot(e, t) {
30599
30602
  switch (t.type) {
30600
30603
  case O.CHARACTER: {
30601
30604
  _s(e, t);
@@ -30614,7 +30617,7 @@ function Ot$1(e, t) {
30614
30617
  break;
30615
30618
  }
30616
30619
  case O.END_TAG: {
30617
- Lt$1(e, t);
30620
+ Lt(e, t);
30618
30621
  break;
30619
30622
  }
30620
30623
  case O.EOF: {
@@ -30668,7 +30671,7 @@ function a0(e, t) {
30668
30671
  e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._insertElement(t, E.HTML);
30669
30672
  }
30670
30673
  function i0(e, t) {
30671
- e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._insertElement(t, E.HTML), e.tokenizer.state = K.PLAINTEXT;
30674
+ e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._insertElement(t, E.HTML), e.tokenizer.state = K$1.PLAINTEXT;
30672
30675
  }
30673
30676
  function n0(e, t) {
30674
30677
  e.openElements.hasInScope(s.BUTTON) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(s.BUTTON)), e._reconstructActiveFormattingElements(), e._insertElement(t, E.HTML), e.framesetOk = false;
@@ -30709,16 +30712,16 @@ function b0(e, t) {
30709
30712
  t.tagName = p.IMG, t.tagID = s.IMG, gs(e, t);
30710
30713
  }
30711
30714
  function E0(e, t) {
30712
- e._insertElement(t, E.HTML), e.skipNextNewLine = true, e.tokenizer.state = K.RCDATA, e.originalInsertionMode = e.insertionMode, e.framesetOk = false, e.insertionMode = l.TEXT;
30715
+ e._insertElement(t, E.HTML), e.skipNextNewLine = true, e.tokenizer.state = K$1.RCDATA, e.originalInsertionMode = e.insertionMode, e.framesetOk = false, e.insertionMode = l.TEXT;
30713
30716
  }
30714
30717
  function T0(e, t) {
30715
- e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._reconstructActiveFormattingElements(), e.framesetOk = false, e._switchToTextParsing(t, K.RAWTEXT);
30718
+ e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._reconstructActiveFormattingElements(), e.framesetOk = false, e._switchToTextParsing(t, K$1.RAWTEXT);
30716
30719
  }
30717
30720
  function _0(e, t) {
30718
- e.framesetOk = false, e._switchToTextParsing(t, K.RAWTEXT);
30721
+ e.framesetOk = false, e._switchToTextParsing(t, K$1.RAWTEXT);
30719
30722
  }
30720
30723
  function hr(e, t) {
30721
- e._switchToTextParsing(t, K.RAWTEXT);
30724
+ e._switchToTextParsing(t, K$1.RAWTEXT);
30722
30725
  }
30723
30726
  function g0(e, t) {
30724
30727
  e._reconstructActiveFormattingElements(), e._insertElement(t, E.HTML), e.framesetOk = false, e.insertionMode = e.insertionMode === l.IN_TABLE || e.insertionMode === l.IN_CAPTION || e.insertionMode === l.IN_TABLE_BODY || e.insertionMode === l.IN_ROW || e.insertionMode === l.IN_CELL ? l.IN_SELECT_IN_TABLE : l.IN_SELECT;
@@ -30854,7 +30857,7 @@ function G$1(e, t) {
30854
30857
  case s.BGSOUND:
30855
30858
  case s.BASEFONT:
30856
30859
  case s.TEMPLATE: {
30857
- J(e, t);
30860
+ J$1(e, t);
30858
30861
  break;
30859
30862
  }
30860
30863
  case s.BODY: {
@@ -31000,7 +31003,7 @@ function vs(e, t) {
31000
31003
  break;
31001
31004
  }
31002
31005
  }
31003
- function Lt$1(e, t) {
31006
+ function Lt(e, t) {
31004
31007
  switch (t.tagID) {
31005
31008
  case s.A:
31006
31009
  case s.B:
@@ -31124,7 +31127,7 @@ function Wt(e, t) {
31124
31127
  }
31125
31128
  }
31126
31129
  else
31127
- rt(e, t);
31130
+ rt$1(e, t);
31128
31131
  }
31129
31132
  function U0(e, t) {
31130
31133
  e.openElements.clearBackToTableContext(), e.activeFormattingElements.insertMarker(), e._insertElement(t, E.HTML), e.insertionMode = l.IN_CAPTION;
@@ -31139,18 +31142,18 @@ function q0(e, t) {
31139
31142
  e.openElements.clearBackToTableContext(), e._insertElement(t, E.HTML), e.insertionMode = l.IN_TABLE_BODY;
31140
31143
  }
31141
31144
  function Y0(e, t) {
31142
- e.openElements.clearBackToTableContext(), e._insertFakeElement(p.TBODY, s.TBODY), e.insertionMode = l.IN_TABLE_BODY, Rt$1(e, t);
31145
+ e.openElements.clearBackToTableContext(), e._insertFakeElement(p.TBODY, s.TBODY), e.insertionMode = l.IN_TABLE_BODY, Rt(e, t);
31143
31146
  }
31144
31147
  function j0(e, t) {
31145
31148
  e.openElements.hasInTableScope(s.TABLE) && (e.openElements.popUntilTagNamePopped(s.TABLE), e._resetInsertionMode(), e._processStartTag(t));
31146
31149
  }
31147
31150
  function V0(e, t) {
31148
- As(t) ? e._appendElement(t, E.HTML) : rt(e, t), t.ackSelfClosing = true;
31151
+ As(t) ? e._appendElement(t, E.HTML) : rt$1(e, t), t.ackSelfClosing = true;
31149
31152
  }
31150
31153
  function $0(e, t) {
31151
31154
  !e.formElement && e.openElements.tmplCount === 0 && (e._insertElement(t, E.HTML), e.formElement = e.openElements.current, e.openElements.pop());
31152
31155
  }
31153
- function Re(e, t) {
31156
+ function Re$1(e, t) {
31154
31157
  switch (t.tagID) {
31155
31158
  case s.TD:
31156
31159
  case s.TH:
@@ -31161,7 +31164,7 @@ function Re(e, t) {
31161
31164
  case s.STYLE:
31162
31165
  case s.SCRIPT:
31163
31166
  case s.TEMPLATE: {
31164
- J(e, t);
31167
+ J$1(e, t);
31165
31168
  break;
31166
31169
  }
31167
31170
  case s.COL: {
@@ -31195,7 +31198,7 @@ function Re(e, t) {
31195
31198
  break;
31196
31199
  }
31197
31200
  default:
31198
- rt(e, t);
31201
+ rt$1(e, t);
31199
31202
  }
31200
31203
  }
31201
31204
  function Ze(e, t) {
@@ -31221,12 +31224,12 @@ function Ze(e, t) {
31221
31224
  case s.TR:
31222
31225
  break;
31223
31226
  default:
31224
- rt(e, t);
31227
+ rt$1(e, t);
31225
31228
  }
31226
31229
  }
31227
- function rt(e, t) {
31230
+ function rt$1(e, t) {
31228
31231
  const u = e.fosterParentingEnabled;
31229
- e.fosterParentingEnabled = true, Ot$1(e, t), e.fosterParentingEnabled = u;
31232
+ e.fosterParentingEnabled = true, Ot(e, t), e.fosterParentingEnabled = u;
31230
31233
  }
31231
31234
  function Ns(e, t) {
31232
31235
  e.pendingCharacterTokens.push(t);
@@ -31234,11 +31237,11 @@ function Ns(e, t) {
31234
31237
  function xs(e, t) {
31235
31238
  e.pendingCharacterTokens.push(t), e.hasNonWhitespacePendingCharacterToken = true;
31236
31239
  }
31237
- function Fe(e, t) {
31240
+ function Fe$1(e, t) {
31238
31241
  let u = 0;
31239
31242
  if (e.hasNonWhitespacePendingCharacterToken)
31240
31243
  for (; u < e.pendingCharacterTokens.length; u++)
31241
- rt(e, e.pendingCharacterTokens[u]);
31244
+ rt$1(e, e.pendingCharacterTokens[u]);
31242
31245
  else
31243
31246
  for (; u < e.pendingCharacterTokens.length; u++)
31244
31247
  e._insertCharacters(e.pendingCharacterTokens[u]);
@@ -31247,7 +31250,7 @@ function Fe(e, t) {
31247
31250
  const Is = /* @__PURE__ */ new Set([s.CAPTION, s.COL, s.COLGROUP, s.TBODY, s.TD, s.TFOOT, s.TH, s.THEAD, s.TR]);
31248
31251
  function G0(e, t) {
31249
31252
  const u = t.tagID;
31250
- Is.has(u) ? e.openElements.hasInTableScope(s.CAPTION) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(s.CAPTION), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = l.IN_TABLE, Re(e, t)) : G$1(e, t);
31253
+ Is.has(u) ? e.openElements.hasInTableScope(s.CAPTION) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(s.CAPTION), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = l.IN_TABLE, Re$1(e, t)) : G$1(e, t);
31251
31254
  }
31252
31255
  function W0(e, t) {
31253
31256
  const u = t.tagID;
@@ -31269,7 +31272,7 @@ function W0(e, t) {
31269
31272
  case s.TR:
31270
31273
  break;
31271
31274
  default:
31272
- Lt$1(e, t);
31275
+ Lt(e, t);
31273
31276
  }
31274
31277
  }
31275
31278
  function Lu(e, t) {
@@ -31283,11 +31286,11 @@ function Lu(e, t) {
31283
31286
  break;
31284
31287
  }
31285
31288
  case s.TEMPLATE: {
31286
- J(e, t);
31289
+ J$1(e, t);
31287
31290
  break;
31288
31291
  }
31289
31292
  default:
31290
- _t$1(e, t);
31293
+ _t(e, t);
31291
31294
  }
31292
31295
  }
31293
31296
  function z0(e, t) {
@@ -31303,13 +31306,13 @@ function z0(e, t) {
31303
31306
  case s.COL:
31304
31307
  break;
31305
31308
  default:
31306
- _t$1(e, t);
31309
+ _t(e, t);
31307
31310
  }
31308
31311
  }
31309
- function _t$1(e, t) {
31312
+ function _t(e, t) {
31310
31313
  e.openElements.currentTagId === s.COLGROUP && (e.openElements.pop(), e.insertionMode = l.IN_TABLE, e._processToken(t));
31311
31314
  }
31312
- function Rt$1(e, t) {
31315
+ function Rt(e, t) {
31313
31316
  switch (t.tagID) {
31314
31317
  case s.TR: {
31315
31318
  e.openElements.clearBackToTableBodyContext(), e._insertElement(t, E.HTML), e.insertionMode = l.IN_ROW;
@@ -31326,11 +31329,11 @@ function Rt$1(e, t) {
31326
31329
  case s.TBODY:
31327
31330
  case s.TFOOT:
31328
31331
  case s.THEAD: {
31329
- e.openElements.hasTableBodyContextInTableScope() && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = l.IN_TABLE, Re(e, t));
31332
+ e.openElements.hasTableBodyContextInTableScope() && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = l.IN_TABLE, Re$1(e, t));
31330
31333
  break;
31331
31334
  }
31332
31335
  default:
31333
- Re(e, t);
31336
+ Re$1(e, t);
31334
31337
  }
31335
31338
  }
31336
31339
  function nu(e, t) {
@@ -31373,11 +31376,11 @@ function Dt(e, t) {
31373
31376
  case s.TFOOT:
31374
31377
  case s.THEAD:
31375
31378
  case s.TR: {
31376
- e.openElements.hasInTableScope(s.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = l.IN_TABLE_BODY, Rt$1(e, t));
31379
+ e.openElements.hasInTableScope(s.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = l.IN_TABLE_BODY, Rt(e, t));
31377
31380
  break;
31378
31381
  }
31379
31382
  default:
31380
- Re(e, t);
31383
+ Re$1(e, t);
31381
31384
  }
31382
31385
  }
31383
31386
  function Ss(e, t) {
@@ -31435,7 +31438,7 @@ function K0(e, t) {
31435
31438
  case s.HTML:
31436
31439
  break;
31437
31440
  default:
31438
- Lt$1(e, t);
31441
+ Lt(e, t);
31439
31442
  }
31440
31443
  }
31441
31444
  function Cs(e, t) {
@@ -31465,7 +31468,7 @@ function Cs(e, t) {
31465
31468
  }
31466
31469
  case s.SCRIPT:
31467
31470
  case s.TEMPLATE: {
31468
- J(e, t);
31471
+ J$1(e, t);
31469
31472
  break;
31470
31473
  }
31471
31474
  }
@@ -31511,7 +31514,7 @@ function J0(e, t) {
31511
31514
  case s.STYLE:
31512
31515
  case s.TEMPLATE:
31513
31516
  case s.TITLE: {
31514
- J(e, t);
31517
+ J$1(e, t);
31515
31518
  break;
31516
31519
  }
31517
31520
  // Re-process the token in the appropriate mode
@@ -31520,7 +31523,7 @@ function J0(e, t) {
31520
31523
  case s.TBODY:
31521
31524
  case s.TFOOT:
31522
31525
  case s.THEAD: {
31523
- e.tmplInsertionModeStack[0] = l.IN_TABLE, e.insertionMode = l.IN_TABLE, Re(e, t);
31526
+ e.tmplInsertionModeStack[0] = l.IN_TABLE, e.insertionMode = l.IN_TABLE, Re$1(e, t);
31524
31527
  break;
31525
31528
  }
31526
31529
  case s.COL: {
@@ -31528,7 +31531,7 @@ function J0(e, t) {
31528
31531
  break;
31529
31532
  }
31530
31533
  case s.TR: {
31531
- e.tmplInsertionModeStack[0] = l.IN_TABLE_BODY, e.insertionMode = l.IN_TABLE_BODY, Rt$1(e, t);
31534
+ e.tmplInsertionModeStack[0] = l.IN_TABLE_BODY, e.insertionMode = l.IN_TABLE_BODY, Rt(e, t);
31532
31535
  break;
31533
31536
  }
31534
31537
  case s.TD:
@@ -31561,7 +31564,7 @@ function Ls(e, t) {
31561
31564
  gt(e, t);
31562
31565
  }
31563
31566
  function gt(e, t) {
31564
- e.insertionMode = l.IN_BODY, Ot$1(e, t);
31567
+ e.insertionMode = l.IN_BODY, Ot(e, t);
31565
31568
  }
31566
31569
  function ud(e, t) {
31567
31570
  switch (t.tagID) {
@@ -31578,7 +31581,7 @@ function ud(e, t) {
31578
31581
  break;
31579
31582
  }
31580
31583
  case s.NOFRAMES: {
31581
- J(e, t);
31584
+ J$1(e, t);
31582
31585
  break;
31583
31586
  }
31584
31587
  }
@@ -31593,7 +31596,7 @@ function sd(e, t) {
31593
31596
  break;
31594
31597
  }
31595
31598
  case s.NOFRAMES: {
31596
- J(e, t);
31599
+ J$1(e, t);
31597
31600
  break;
31598
31601
  }
31599
31602
  }
@@ -31605,7 +31608,7 @@ function id(e, t) {
31605
31608
  t.tagID === s.HTML ? G$1(e, t) : ct(e, t);
31606
31609
  }
31607
31610
  function ct(e, t) {
31608
- e.insertionMode = l.IN_BODY, Ot$1(e, t);
31611
+ e.insertionMode = l.IN_BODY, Ot(e, t);
31609
31612
  }
31610
31613
  function nd(e, t) {
31611
31614
  switch (t.tagID) {
@@ -31614,7 +31617,7 @@ function nd(e, t) {
31614
31617
  break;
31615
31618
  }
31616
31619
  case s.NOFRAMES: {
31617
- J(e, t);
31620
+ J$1(e, t);
31618
31621
  break;
31619
31622
  }
31620
31623
  }
@@ -31769,16 +31772,16 @@ function Id(e, t, u) {
31769
31772
  }
31770
31773
  const pe = {
31771
31774
  // Re-exports from domhandler
31772
- isCommentNode: Nt$1,
31775
+ isCommentNode: Nt,
31773
31776
  isElementNode: I,
31774
- isTextNode: se,
31777
+ isTextNode: se$1,
31775
31778
  //Node construction
31776
31779
  createDocument() {
31777
- const e = new Ne([]);
31780
+ const e = new Ne$1([]);
31778
31781
  return e["x-mode"] = X$1.NO_QUIRKS, e;
31779
31782
  },
31780
31783
  createDocumentFragment() {
31781
- return new Ne([]);
31784
+ return new Ne$1([]);
31782
31785
  },
31783
31786
  createElement(e, t, u) {
31784
31787
  const r = /* @__PURE__ */ Object.create(null), a = /* @__PURE__ */ Object.create(null), i = /* @__PURE__ */ Object.create(null);
@@ -31812,7 +31815,7 @@ const pe = {
31812
31815
  },
31813
31816
  setDocumentType(e, t, u, r) {
31814
31817
  const a = Id(t, u, r);
31815
- let i = e.children.find((n) => Qt$1(n) && n.name === "!doctype");
31818
+ let i = e.children.find((n) => Qt(n) && n.name === "!doctype");
31816
31819
  i ? i.data = a ?? null : (i = new lu("!doctype", a), pe.appendChild(e, i)), i["x-name"] = t, i["x-publicId"] = u, i["x-systemId"] = r;
31817
31820
  },
31818
31821
  setDocumentMode(e, t) {
@@ -31829,11 +31832,11 @@ const pe = {
31829
31832
  },
31830
31833
  insertText(e, t) {
31831
31834
  const u = e.children[e.children.length - 1];
31832
- u && se(u) ? u.data += t : pe.appendChild(e, pe.createTextNode(t));
31835
+ u && se$1(u) ? u.data += t : pe.appendChild(e, pe.createTextNode(t));
31833
31836
  },
31834
31837
  insertTextBefore(e, t, u) {
31835
31838
  const r = e.children[e.children.indexOf(u) - 1];
31836
- r && se(r) ? r.data += t : pe.insertBefore(e, pe.createTextNode(t), u);
31839
+ r && se$1(r) ? r.data += t : pe.insertBefore(e, pe.createTextNode(t), u);
31837
31840
  },
31838
31841
  adoptAttributes(e, t) {
31839
31842
  for (let u = 0; u < t.length; u++) {
@@ -31881,7 +31884,7 @@ const pe = {
31881
31884
  },
31882
31885
  //Node types
31883
31886
  isDocumentTypeNode(e) {
31884
- return Qt$1(e) && e.name === "!doctype";
31887
+ return Qt(e) && e.name === "!doctype";
31885
31888
  },
31886
31889
  // Source code location
31887
31890
  setNodeSourceCodeLocation(e, t) {
@@ -31906,7 +31909,7 @@ function yd(e) {
31906
31909
  const t = "length" in e ? e : [e];
31907
31910
  for (let r = 0; r < t.length; r += 1) {
31908
31911
  const a = t[r];
31909
- Te(a) && Array.prototype.splice.call(t, r, 1, ...a.children);
31912
+ Te$1(a) && Array.prototype.splice.call(t, r, 1, ...a.children);
31910
31913
  }
31911
31914
  let u = "";
31912
31915
  for (let r = 0; r < t.length; r += 1) {
@@ -31915,7 +31918,7 @@ function yd(e) {
31915
31918
  }
31916
31919
  return u;
31917
31920
  }
31918
- const Od = eo((e, t, u, r) => t._useHtmlParser2 ? Ii(e, t) : Sd(e, t, u, r)), Ps = ko(Od, (e, t) => t._useHtmlParser2 ? xt$1(e, t) : yd(e)), Ms = [
31921
+ const Od = eo((e, t, u, r) => t._useHtmlParser2 ? Ii(e, t) : Sd(e, t, u, r)), Ps = ko(Od, (e, t) => t._useHtmlParser2 ? xt(e, t) : yd(e)), Ms = [
31919
31922
  {
31920
31923
  // Match any URL as fallback
31921
31924
  pattern: "^https?://",
@@ -32435,13 +32438,13 @@ const Ld = (e) => {
32435
32438
  }, a = u.displayFields || r, i = (y) => {
32436
32439
  const W2 = e[y];
32437
32440
  return typeof W2 == "string" ? W2 : void 0;
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), A = pr(n, 80), w = pr(fr(c), 160), v = [];
32441
+ }, 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 = [];
32439
32442
  h && a.image !== void 0 && v.push({
32440
32443
  order: a.image,
32441
32444
  section: "image",
32442
- html: At$1(
32445
+ html: At(
32443
32446
  j(h),
32444
- j(A),
32447
+ j(A2),
32445
32448
  "card-image",
32446
32449
  void 0,
32447
32450
  'loading="lazy"'
@@ -32459,7 +32462,7 @@ const Ld = (e) => {
32459
32462
  order: a.title,
32460
32463
  section: "header",
32461
32464
  isHeader: true,
32462
- html: `<div class="card-title">${j(A)}</div>`
32465
+ html: `<div class="card-title">${j(A2)}</div>`
32463
32466
  }), a.siteName !== void 0 && U2.push({
32464
32467
  order: a.siteName,
32465
32468
  section: "header",
@@ -32485,24 +32488,24 @@ const Ld = (e) => {
32485
32488
  "favicon"
32486
32489
  ].includes(y))
32487
32490
  continue;
32488
- const Ce = a[y];
32489
- if (Ce !== void 0) {
32490
- let Me = "";
32491
+ const Ce2 = a[y];
32492
+ if (Ce2 !== void 0) {
32493
+ let Me2 = "";
32491
32494
  if (Array.isArray(W2)) {
32492
- const Pt2 = W2.slice(0, 3).map((Hs) => `<li>${j(String(Hs))}</li>`).join("");
32493
- Me = `<div class="card-field card-${y}">
32495
+ const Pt = W2.slice(0, 3).map((Hs) => `<li>${j(String(Hs))}</li>`).join("");
32496
+ Me2 = `<div class="card-field card-${y}">
32494
32497
  <div class="field-label">${j(y)}:</div>
32495
- <ul class="field-list">${Pt2}</ul>
32498
+ <ul class="field-list">${Pt}</ul>
32496
32499
  </div>`;
32497
32500
  } else
32498
- Me = `<div class="card-field card-${y}">
32501
+ Me2 = `<div class="card-field card-${y}">
32499
32502
  <span class="field-label">${j(y)}:</span>
32500
32503
  <span class="field-value">${j(String(W2))}</span>
32501
32504
  </div>`;
32502
32505
  v.push({
32503
- order: Ce,
32506
+ order: Ce2,
32504
32507
  section: "enhanced",
32505
- html: Me
32508
+ html: Me2
32506
32509
  });
32507
32510
  }
32508
32511
  }
@@ -32518,40 +32521,40 @@ const Ld = (e) => {
32518
32521
  "locale",
32519
32522
  "favicon"
32520
32523
  ].includes(y) || a[y] === void 0 && M.push(y);
32521
- let ee = 1e3;
32524
+ let ee2 = 1e3;
32522
32525
  for (const y of M) {
32523
32526
  const W2 = e[y];
32524
- let Ce = "";
32527
+ let Ce2 = "";
32525
32528
  if (Array.isArray(W2)) {
32526
- const Me = W2.slice(0, 3).map((Pt2) => `<li>${j(String(Pt2))}</li>`).join("");
32527
- Ce = `<div class="card-field card-${y}">
32529
+ const Me2 = W2.slice(0, 3).map((Pt) => `<li>${j(String(Pt))}</li>`).join("");
32530
+ Ce2 = `<div class="card-field card-${y}">
32528
32531
  <div class="field-label">${j(y)}:</div>
32529
- <ul class="field-list">${Me}</ul>
32532
+ <ul class="field-list">${Me2}</ul>
32530
32533
  </div>`;
32531
32534
  } else
32532
- Ce = `<div class="card-field card-${y}">
32535
+ Ce2 = `<div class="card-field card-${y}">
32533
32536
  <span class="field-label">${j(y)}:</span>
32534
32537
  <span class="field-value">${j(String(W2))}</span>
32535
32538
  </div>`;
32536
32539
  v.push({
32537
- order: ee++,
32540
+ order: ee2++,
32538
32541
  section: "enhanced",
32539
- html: Ce
32542
+ html: Ce2
32540
32543
  });
32541
32544
  }
32542
- const he = U2.sort((y, W2) => y.order - W2.order);
32545
+ const he2 = U2.sort((y, W2) => y.order - W2.order);
32543
32546
  let ae = "";
32544
- he.length > 0 && (ae = `<div class="card-header">
32545
- ${he.map((y) => y.html).join("")}
32547
+ he2.length > 0 && (ae = `<div class="card-header">
32548
+ ${he2.map((y) => y.html).join("")}
32546
32549
  </div>`);
32547
32550
  const ge = v.filter((y) => !y.isHeader).sort((y, W2) => y.order - W2.order), ie = ge.filter((y) => y.section === "image"), Ru = ge.filter(
32548
32551
  (y) => y.section === "body" || y.section === "enhanced"
32549
32552
  ), Du = ie.map((y) => y.html).join("");
32550
- let kt2 = "";
32551
- Ru.length > 0 && (kt2 = Ru.map((y) => y.html).join(""));
32552
- const ku = ae || kt2 ? `<div class="card-body">
32553
+ let kt = "";
32554
+ Ru.length > 0 && (kt = Ru.map((y) => y.html).join(""));
32555
+ const ku = ae || kt ? `<div class="card-body">
32553
32556
  ${ae}
32554
- ${kt2}
32557
+ ${kt}
32555
32558
  </div>` : "", Us = i("siteName")?.toLowerCase().includes("amazon") ? "card-container card-amazon" : "card-container", Fs = a.url !== void 0 ? `<a href="${j(f)}" target="_blank" rel="noopener noreferrer" class="card-link">
32556
32559
  ${Du}
32557
32560
  ${ku}
@@ -32563,273 +32566,283 @@ const Ld = (e) => {
32563
32566
  };
32564
32567
  /*!
32565
32568
  * name: mark-deco
32566
- * version: 0.14.0
32569
+ * version: 0.16.0
32567
32570
  * description: Flexible Markdown to HTML conversion library
32568
32571
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
32569
32572
  * license: MIT
32570
32573
  * repository.url: https://github.com/kekyo/mark-deco.git
32571
- * git.commit.hash: 090ae78518ae17207fdb90e6fca59893315672fb
32574
+ * git.commit.hash: 2349c97b2136b454168e4ae633590d11307952c5
32572
32575
  */
32573
- function G(e) {
32574
- const t = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/, n = e.match(t);
32576
+ function X(t) {
32577
+ const e = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/, n = t.match(e);
32575
32578
  if (!n)
32576
32579
  return {
32577
32580
  data: {},
32578
- content: e
32581
+ content: t
32579
32582
  };
32580
- const a = n[1] || "", r = e.slice(n[0].length);
32583
+ const o2 = n[1] || "", r = t.slice(n[0].length);
32581
32584
  try {
32582
- const s2 = load(a, { schema: JSON_SCHEMA });
32585
+ const a = load(o2, { schema: JSON_SCHEMA });
32583
32586
  return {
32584
- data: s2 && typeof s2 == "object" && !Array.isArray(s2) ? s2 : {},
32587
+ data: a && typeof a == "object" && !Array.isArray(a) ? a : {},
32585
32588
  content: r
32586
32589
  };
32587
- } catch (s2) {
32588
- const d2 = s2 instanceof Error ? s2.message : "Unknown YAML parsing error";
32589
- throw new Error(`Failed to parse frontmatter YAML: ${d2}`);
32590
+ } catch (a) {
32591
+ const f = a instanceof Error ? a.message : "Unknown YAML parsing error";
32592
+ throw new Error(`Failed to parse frontmatter YAML: ${f}`);
32590
32593
  }
32591
32594
  }
32592
- function kt(e) {
32593
- if (!e || Object.keys(e).length === 0)
32595
+ function He(t) {
32596
+ if (!t || Object.keys(t).length === 0)
32594
32597
  return "";
32595
- const t = dump(e, { lineWidth: 0 });
32596
- return typeof t != "string" || t.length === 0 ? "" : t.endsWith(`
32597
- `) ? t : `${t}
32598
+ const e = dump(t, { lineWidth: 0 });
32599
+ return typeof e != "string" || e.length === 0 ? "" : e.endsWith(`
32600
+ `) ? e : `${e}
32598
32601
  `;
32599
32602
  }
32600
- function Q(e, t) {
32601
- const n = t ?? "";
32603
+ function Y(t, e) {
32604
+ const n = e ?? "";
32602
32605
  return `${`---
32603
- ${kt(e)}---
32606
+ ${He(t)}---
32604
32607
  `}${n}`;
32605
32608
  }
32606
- const _ = () => {
32607
- }, St = {
32608
- debug: _,
32609
- info: _,
32610
- warn: _,
32611
- error: _
32612
- }, $t = {
32609
+ const U = () => {
32610
+ }, Te = {
32611
+ debug: U,
32612
+ info: U,
32613
+ warn: U,
32614
+ error: U
32615
+ }, Le = {
32613
32616
  debug: console.debug,
32614
32617
  info: console.info,
32615
32618
  warn: console.warn,
32616
32619
  error: console.error
32617
- }, xt = () => St, Qt = () => $t, N = (e) => {
32618
- const t = {}, n = e.slice(1, -1).trim(), a = n.match(/\.([a-zA-Z0-9_-]+)/g);
32619
- if (a) {
32620
- const d2 = a.map((p2) => p2.slice(1));
32621
- t.class = d2.join(" ");
32620
+ }, Oe = () => Te, Ye = () => Le, R = (t) => {
32621
+ const e = {}, n = t.slice(1, -1).trim(), o2 = n.match(/\.([a-zA-Z0-9_-]+)/g);
32622
+ if (o2) {
32623
+ const f = o2.map((m) => m.slice(1));
32624
+ e.class = f.join(" ");
32622
32625
  }
32623
32626
  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);
32626
- if (s2)
32627
- for (const d2 of s2) {
32628
- const [p2, u] = d2.split("=");
32629
- p2 && u && p2 !== "class" && p2 !== "id" && (t[p2] = u.replace(/["']/g, ""));
32627
+ r && r[1] && (e.id = r[1]);
32628
+ const a = n.match(/([a-zA-Z0-9_-]+)=["']?([^"'\s]*)["']?/g);
32629
+ if (a)
32630
+ for (const f of a) {
32631
+ const [m, u] = f.split("=");
32632
+ m && u && m !== "class" && m !== "id" && (e[m] = u.replace(/["']/g, ""));
32630
32633
  }
32631
- return t;
32632
- }, Tt = (e) => {
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>`;
32635
- }, L = (e, t) => {
32636
- e.data || (e.data = {}), e.data.hProperties || (e.data.hProperties = {}), Object.entries(t).forEach(([n, a]) => {
32634
+ return e;
32635
+ }, Fe = (t) => {
32636
+ const e = t.lang ? ` class="language-${t.lang}"` : "", n = t.value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
32637
+ return `<pre><code${e}>${n}</code></pre>`;
32638
+ }, A = (t, e) => {
32639
+ t.data || (t.data = {}), t.data.hProperties || (t.data.hProperties = {}), Object.entries(e).forEach(([n, o2]) => {
32637
32640
  if (n === "class") {
32638
- const r = e.data.hProperties.class;
32639
- r ? typeof r == "string" && r.startsWith("language-") ? e.data.hProperties.class = `${r} ${a}` : e.data.hProperties.class = `${r} ${a}` : e.data.hProperties.class = a;
32641
+ const r = t.data.hProperties.class;
32642
+ r ? typeof r == "string" && r.startsWith("language-") ? t.data.hProperties.class = `${r} ${o2}` : t.data.hProperties.class = `${r} ${o2}` : t.data.hProperties.class = o2;
32640
32643
  } else
32641
- e.data.hProperties[n] = a;
32644
+ t.data.hProperties[n] = o2;
32642
32645
  });
32643
- }, Ht = () => (e) => {
32644
- visit(e, (t, n, a) => {
32645
- if (t.type === "heading" && t.children?.length > 0) {
32646
- const r = t.children[t.children.length - 1];
32646
+ }, Ce = () => (t) => {
32647
+ visit(t, (e, n, o2) => {
32648
+ if (e.type === "heading" && e.children?.length > 0) {
32649
+ const r = e.children[e.children.length - 1];
32647
32650
  if (r?.type === "text" && r.value) {
32648
- const s2 = r.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32649
- if (s2) {
32650
- const d2 = s2[1].trim(), p2 = s2[2], u = N(p2);
32651
- r.value = d2, L(t, u);
32651
+ const a = r.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32652
+ if (a) {
32653
+ const f = a[1].trim(), m = a[2], u = R(m);
32654
+ r.value = f, A(e, u);
32652
32655
  }
32653
32656
  }
32654
32657
  }
32655
- if (t.type === "paragraph" && t.children?.length > 0) {
32656
- const r = t.children[t.children.length - 1];
32658
+ if (e.type === "paragraph" && e.children?.length > 0) {
32659
+ const r = e.children[e.children.length - 1];
32657
32660
  if (r?.type === "text" && r.value) {
32658
- const s2 = r.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32659
- if (s2) {
32660
- const d2 = s2[1].trim(), p2 = s2[2], u = N(p2);
32661
- r.value = d2, L(t, u);
32661
+ const a = r.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32662
+ if (a) {
32663
+ const f = a[1].trim(), m = a[2], u = R(m);
32664
+ r.value = f, A(e, u);
32662
32665
  }
32663
32666
  }
32664
32667
  }
32665
- if (t.type === "link" && a && typeof n == "number") {
32666
- const r = a.children[n + 1];
32668
+ if (e.type === "link" && o2 && typeof n == "number") {
32669
+ const r = o2.children[n + 1];
32667
32670
  if (r?.type === "text" && r.value) {
32668
- const s2 = r.value.match(/^\s*(\{[^}]+\})/);
32669
- if (s2) {
32670
- const d2 = s2[1], p2 = N(d2);
32671
- L(t, p2), r.value = r.value.replace(s2[0], "");
32671
+ const a = r.value.match(/^\s*(\{[^}]+\})/);
32672
+ if (a) {
32673
+ const f = a[1], m = R(f);
32674
+ A(e, m), r.value = r.value.replace(a[0], "");
32672
32675
  }
32673
32676
  }
32674
32677
  }
32675
- if (t.type === "image" && a && typeof n == "number") {
32676
- const r = a.children[n + 1];
32678
+ if (e.type === "image" && o2 && typeof n == "number") {
32679
+ const r = o2.children[n + 1];
32677
32680
  if (r?.type === "text" && r.value) {
32678
- const s2 = r.value.match(/^\s*(\{[^}]+\})/);
32679
- if (s2) {
32680
- const d2 = s2[1], p2 = N(d2);
32681
- L(t, p2), r.value = r.value.replace(s2[0], "");
32681
+ const a = r.value.match(/^\s*(\{[^}]+\})/);
32682
+ if (a) {
32683
+ const f = a[1], m = R(f);
32684
+ A(e, m), r.value = r.value.replace(a[0], "");
32682
32685
  }
32683
32686
  }
32684
32687
  }
32685
- if (t.type === "listItem" && t.children?.length > 0) {
32686
- const r = t.children[t.children.length - 1];
32688
+ if (e.type === "listItem" && e.children?.length > 0) {
32689
+ const r = e.children[e.children.length - 1];
32687
32690
  if (r?.type === "paragraph" && r.children?.length > 0) {
32688
- const s2 = r.children[r.children.length - 1];
32689
- if (s2?.type === "text" && s2.value) {
32690
- const d2 = s2.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32691
- if (d2) {
32692
- const p2 = d2[1].trim(), u = d2[2], i = N(u);
32693
- s2.value = p2, L(t, i);
32691
+ const a = r.children[r.children.length - 1];
32692
+ if (a?.type === "text" && a.value) {
32693
+ const f = a.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32694
+ if (f) {
32695
+ const m = f[1].trim(), u = f[2], c = R(u);
32696
+ a.value = m, A(e, c);
32694
32697
  }
32695
32698
  }
32696
32699
  }
32697
32700
  }
32698
- if (t.type === "list" && a && typeof n == "number") {
32699
- const r = a.children[n + 1];
32701
+ if (e.type === "list" && o2 && typeof n == "number") {
32702
+ const r = o2.children[n + 1];
32700
32703
  if (r?.type === "paragraph" && r.children?.length === 1) {
32701
- const s2 = r.children[0];
32702
- if (s2?.type === "text" && s2.value) {
32703
- const d2 = s2.value.match(/^\s*(\{[^}]+\})\s*$/);
32704
- if (d2) {
32705
- const p2 = d2[1], u = N(p2);
32706
- L(t, u), a.children.splice(n + 1, 1);
32704
+ const a = r.children[0];
32705
+ if (a?.type === "text" && a.value) {
32706
+ const f = a.value.match(/^\s*(\{[^}]+\})\s*$/);
32707
+ if (f) {
32708
+ const m = f[1], u = R(m);
32709
+ A(e, u), o2.children.splice(n + 1, 1);
32707
32710
  }
32708
32711
  }
32709
32712
  }
32710
32713
  }
32711
- if (t.type === "blockquote" && t.children?.length > 0) {
32712
- const r = t.children[t.children.length - 1];
32714
+ if (e.type === "blockquote" && e.children?.length > 0) {
32715
+ const r = e.children[e.children.length - 1];
32713
32716
  if (r?.type === "paragraph" && r.children?.length > 0) {
32714
- const s2 = r.children[r.children.length - 1];
32715
- if (s2?.type === "text" && s2.value) {
32716
- const d2 = s2.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32717
- if (d2) {
32718
- const p2 = d2[1].trim(), u = d2[2], i = N(u);
32719
- s2.value = p2, L(t, i);
32717
+ const a = r.children[r.children.length - 1];
32718
+ if (a?.type === "text" && a.value) {
32719
+ const f = a.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32720
+ if (f) {
32721
+ const m = f[1].trim(), u = f[2], c = R(u);
32722
+ a.value = m, A(e, c);
32720
32723
  }
32721
32724
  }
32722
32725
  }
32723
32726
  }
32724
- if (t.type === "blockquote" && a && typeof n == "number") {
32725
- const r = a.children[n + 1];
32727
+ if (e.type === "blockquote" && o2 && typeof n == "number") {
32728
+ const r = o2.children[n + 1];
32726
32729
  if (r?.type === "paragraph" && r.children?.length === 1) {
32727
- const s2 = r.children[0];
32728
- if (s2?.type === "text" && s2.value) {
32729
- const d2 = s2.value.match(/^\s*(\{[^}]+\})\s*$/);
32730
- if (d2) {
32731
- const p2 = d2[1], u = N(p2);
32732
- L(t, u), a.children.splice(n + 1, 1);
32730
+ const a = r.children[0];
32731
+ if (a?.type === "text" && a.value) {
32732
+ const f = a.value.match(/^\s*(\{[^}]+\})\s*$/);
32733
+ if (f) {
32734
+ const m = f[1], u = R(m);
32735
+ A(e, u), o2.children.splice(n + 1, 1);
32733
32736
  }
32734
32737
  }
32735
32738
  }
32736
32739
  }
32737
- if (t.type === "inlineCode" && a && typeof n == "number") {
32738
- const r = a.children[n + 1];
32740
+ if (e.type === "inlineCode" && o2 && typeof n == "number") {
32741
+ const r = o2.children[n + 1];
32739
32742
  if (r?.type === "text" && r.value) {
32740
- const s2 = r.value.match(/^\s*(\{[^}]+\})/);
32741
- if (s2) {
32742
- const d2 = s2[1], p2 = N(d2);
32743
- L(t, p2), r.value = r.value.replace(s2[0], "");
32743
+ const a = r.value.match(/^\s*(\{[^}]+\})/);
32744
+ if (a) {
32745
+ const f = a[1], m = R(f);
32746
+ A(e, m), r.value = r.value.replace(a[0], "");
32744
32747
  }
32745
32748
  }
32746
32749
  }
32747
- if (t.type === "code" && t.meta) {
32748
- const r = t.meta.match(/\{([^}]+)\}/);
32750
+ if (e.type === "code" && e.meta) {
32751
+ const r = e.meta.match(/\{([^}]+)\}/);
32749
32752
  if (r) {
32750
- const s2 = `{${r[1]}}`, d2 = N(s2), p2 = {
32753
+ const a = `{${r[1]}}`, f = R(a), m = {
32751
32754
  type: "html",
32752
- value: `<div class="${d2.class || ""}" ${Object.entries(
32753
- d2
32754
- ).filter(([u]) => u !== "class").map(([u, i]) => `${u}="${i}"`).join(" ")}>${Tt(t)}</div>`
32755
+ value: `<div class="${f.class || ""}" ${Object.entries(
32756
+ f
32757
+ ).filter(([u]) => u !== "class").map(([u, c]) => `${u}="${c}"`).join(" ")}>${Fe(e)}</div>`
32755
32758
  };
32756
- a && typeof n == "number" && (a.children[n] = p2), t.meta = t.meta.replace(r[0], "").trim() || null;
32759
+ o2 && typeof n == "number" && (o2.children[n] = m), e.meta = e.meta.replace(r[0], "").trim() || null;
32757
32760
  }
32758
32761
  }
32759
32762
  });
32760
- }, Ct = () => (e) => {
32761
- visit(e, "element", (t) => {
32762
- if (t.tagName === "img") {
32763
+ }, Re = () => (t) => {
32764
+ visit(t, "element", (e) => {
32765
+ if (e.tagName === "img") {
32763
32766
  const n = Ys();
32764
- t.properties || (t.properties = {});
32765
- const a = t.properties.style || "", r = a ? `${a}; ${n}` : n;
32766
- t.properties.style = r;
32767
+ e.properties || (e.properties = {});
32768
+ const o2 = e.properties.style || "", r = o2 ? `${o2}; ${n}` : n;
32769
+ e.properties.style = r;
32767
32770
  }
32768
32771
  });
32769
- }, U = (e) => e ? "value" in e && typeof e.value == "string" ? e.value : "children" in e && Array.isArray(e.children) ? e.children.map((t) => U(t)).join("") : "" : "", Ft = (e) => {
32772
+ }, D = (t) => t ? "value" in t && typeof t.value == "string" ? t.value : "children" in t && Array.isArray(t.children) ? t.children.map((e) => D(e)).join("") : "" : "", G = (t) => {
32773
+ if (!Number.isFinite(t))
32774
+ return 1;
32775
+ const e = Math.trunc(t);
32776
+ return Math.min(6, Math.max(1, e));
32777
+ }, B = (t) => G(t ?? 1), Ie = (t) => {
32770
32778
  const {
32771
- frontmatter: t,
32779
+ frontmatter: e,
32772
32780
  hasTitle: n,
32773
- transform: a,
32781
+ transform: o2,
32774
32782
  allowTitleWrite: r,
32775
- onHeadingApplied: s2
32776
- } = e, d2 = a === "extractAndRemove";
32777
- return (p2) => {
32778
- if (!t || !p2.children || p2.children.length === 0)
32783
+ headingBaseLevel: a,
32784
+ onHeadingApplied: f
32785
+ } = t, m = o2 === "extractAndRemove", u = B(a), c = u - 1;
32786
+ return (l2) => {
32787
+ if (!e || !l2.children || l2.children.length === 0)
32779
32788
  return;
32780
- let u = 0;
32781
- for (; u < p2.children.length; u++) {
32782
- const i = p2.children[u];
32783
- if (i.type === "heading" && i.depth === 1) {
32784
- const h = i, l2 = p2.children[u + 1], o2 = l2 && l2.position ? l2.position.start?.offset : void 0, f = U(h).trim();
32785
- d2 && p2.children.splice(u, 1);
32786
- let c = false;
32787
- !n && r && f.length > 0 && (t.title = f, c = true), s2 && s2({
32788
- headingText: f,
32789
- position: h.position,
32790
- nextNodeStartOffset: o2,
32791
- titleWritten: c,
32792
- headingRemoved: d2
32789
+ let h = 0;
32790
+ for (; h < l2.children.length; h++) {
32791
+ const s2 = l2.children[h];
32792
+ if (s2.type === "heading") {
32793
+ const i = s2;
32794
+ if (G(i.depth + c) !== u)
32795
+ break;
32796
+ const p2 = l2.children[h + 1], g2 = p2 && p2.position ? p2.position.start?.offset : void 0, y = D(i).trim();
32797
+ m && l2.children.splice(h, 1);
32798
+ let w = false;
32799
+ !n && r && y.length > 0 && (e.title = y, w = true), f && f({
32800
+ headingText: y,
32801
+ position: i.position,
32802
+ nextNodeStartOffset: g2,
32803
+ titleWritten: w,
32804
+ headingRemoved: m
32793
32805
  });
32794
32806
  break;
32795
32807
  }
32796
- if (!(i.type === "thematicBreak" || i.type === "html" && typeof i.value == "string" && i.value.trim() === "") && !(i.type === "paragraph" && i.children?.length === 0))
32808
+ if (!(s2.type === "thematicBreak" || s2.type === "html" && typeof s2.value == "string" && s2.value.trim() === "") && !(s2.type === "paragraph" && s2.children?.length === 0))
32797
32809
  break;
32798
32810
  }
32799
32811
  };
32800
- }, V = (e, t, n) => {
32801
- const { transform: a, allowTitleWrite: r } = n;
32802
- if (a === "none")
32812
+ }, ee = (t, e, n) => {
32813
+ const { transform: o2, allowTitleWrite: r, headingBaseLevel: a } = n;
32814
+ if (o2 === "none")
32803
32815
  return {
32804
- content: e,
32816
+ content: t,
32805
32817
  headingRemoved: false,
32806
32818
  titleWritten: false
32807
32819
  };
32808
- const s2 = t != null && Object.prototype.hasOwnProperty.call(t, "title") && t.title !== void 0 && t.title !== null;
32809
- let d2 = false, p2 = false, u, i;
32810
- const h = unified().use(remarkParse).use(Ft, {
32811
- frontmatter: t,
32812
- hasTitle: s2,
32813
- transform: a,
32820
+ const f = e != null && Object.prototype.hasOwnProperty.call(e, "title") && e.title !== void 0 && e.title !== null;
32821
+ let m = false, u = false, c, l2;
32822
+ const h = unified().use(remarkParse).use(Ie, {
32823
+ frontmatter: e,
32824
+ hasTitle: f,
32825
+ transform: o2,
32814
32826
  allowTitleWrite: r,
32815
- onHeadingApplied: (o2) => {
32816
- if (d2 = o2.headingRemoved, p2 = o2.titleWritten, !o2.headingRemoved)
32827
+ headingBaseLevel: a,
32828
+ onHeadingApplied: (i) => {
32829
+ if (m = i.headingRemoved, u = i.titleWritten, !i.headingRemoved)
32817
32830
  return;
32818
- const f = o2.position?.start?.offset ?? 0;
32819
- let c = o2.position?.end?.offset ?? f;
32820
- typeof o2.nextNodeStartOffset == "number" && o2.nextNodeStartOffset >= c ? c = o2.nextNodeStartOffset : c = e.length, u = f, i = c;
32831
+ const d2 = i.position?.start?.offset ?? 0;
32832
+ let p2 = i.position?.end?.offset ?? d2;
32833
+ typeof i.nextNodeStartOffset == "number" && i.nextNodeStartOffset >= p2 ? p2 = i.nextNodeStartOffset : p2 = t.length, c = d2, l2 = p2;
32821
32834
  }
32822
- }), l2 = h.parse(e);
32823
- return h.runSync(l2), d2 && u !== void 0 && i !== void 0 ? {
32824
- content: e.slice(0, u) + e.slice(i),
32835
+ }), s2 = h.parse(t);
32836
+ return h.runSync(s2), m && c !== void 0 && l2 !== void 0 ? {
32837
+ content: t.slice(0, c) + t.slice(l2),
32825
32838
  headingRemoved: true,
32826
- titleWritten: p2
32839
+ titleWritten: u
32827
32840
  } : {
32828
- content: e,
32841
+ content: t,
32829
32842
  headingRemoved: false,
32830
32843
  titleWritten: false
32831
32844
  };
32832
- }, { html: Ot } = at$1, Rt = {
32845
+ }, { html: Ne2 } = he, Ae = {
32833
32846
  indent_size: 2,
32834
32847
  indent_char: " ",
32835
32848
  max_preserve_newlines: 2,
@@ -32841,357 +32854,378 @@ const _ = () => {
32841
32854
  unformatted: ["code", "pre", "textarea"],
32842
32855
  content_unformatted: ["pre", "code", "textarea"],
32843
32856
  extra_liners: []
32844
- }, z = (e) => {
32845
- if (e instanceof Date)
32846
- return e.toISOString();
32847
- if (Array.isArray(e))
32848
- return e.map(z);
32849
- if (e && typeof e == "object") {
32850
- const t = Object.entries(e).filter(([, a]) => a !== void 0).sort(([a], [r]) => a < r ? -1 : a > r ? 1 : 0), n = {};
32851
- for (const [a, r] of t)
32852
- n[a] = z(r);
32857
+ }, K = (t) => {
32858
+ if (t instanceof Date)
32859
+ return t.toISOString();
32860
+ if (Array.isArray(t))
32861
+ return t.map(K);
32862
+ if (t && typeof t == "object") {
32863
+ const e = Object.entries(t).filter(([, o2]) => o2 !== void 0).sort(([o2], [r]) => o2 < r ? -1 : o2 > r ? 1 : 0), n = {};
32864
+ for (const [o2, r] of e)
32865
+ n[o2] = K(r);
32853
32866
  return n;
32854
32867
  }
32855
- return e;
32856
- }, q = (e) => JSON.stringify(z(e ?? {})), It = (e, t) => `${e}-${t.join("-")}`, Nt = (e) => {
32857
- const t = [], n = [];
32858
- for (const a of e) {
32859
- const r = a.level;
32860
- for (; n.length > r; )
32861
- n.pop();
32862
- for (; n.length < r; )
32863
- n.push(0);
32864
- const s2 = r - 1;
32865
- n[s2] = (n[s2] || 0) + 1;
32866
- const d2 = n.slice(0, r);
32867
- t.push({
32868
+ return t;
32869
+ }, W = (t) => JSON.stringify(K(t ?? {})), Pe = (t, e) => `${t}-${e.join("-")}`, _e = (t, e) => {
32870
+ const n = [], o2 = [], r = B(e);
32871
+ for (const a of t) {
32872
+ const f = Math.max(1, a.level - r + 1);
32873
+ for (; o2.length > f; )
32874
+ o2.pop();
32875
+ for (; o2.length < f; )
32876
+ o2.push(0);
32877
+ const m = f - 1;
32878
+ o2[m] = (o2[m] || 0) + 1;
32879
+ const u = o2.slice(0, f);
32880
+ n.push({
32868
32881
  level: a.level,
32869
32882
  text: a.text,
32870
- numbers: d2
32883
+ numbers: u
32871
32884
  });
32872
32885
  }
32873
- return t;
32874
- }, Z = (e, t, n) => {
32875
- const a = jd(t);
32876
- return a !== void 0 ? `${e}-${a}` : n();
32877
- }, Lt = (e) => {
32878
- const t = [], n = [];
32879
- for (const a of e) {
32886
+ return n;
32887
+ }, te = (t, e, n) => {
32888
+ const o2 = jd(e);
32889
+ return o2 !== void 0 ? `${t}-${o2}` : n();
32890
+ }, je = (t) => {
32891
+ const e = [], n = [];
32892
+ for (const o2 of t) {
32880
32893
  const r = {
32881
- level: a.level,
32882
- text: a.text,
32883
- id: a.id,
32894
+ level: o2.level,
32895
+ text: o2.text,
32896
+ id: o2.id,
32884
32897
  children: []
32885
32898
  };
32886
32899
  for (; n.length > 0; ) {
32887
- const s2 = n[n.length - 1];
32888
- if (s2 && s2.level >= a.level)
32900
+ const a = n[n.length - 1];
32901
+ if (a && a.level >= o2.level)
32889
32902
  n.pop();
32890
32903
  else
32891
32904
  break;
32892
32905
  }
32893
32906
  if (n.length === 0)
32894
- t.push(r);
32907
+ e.push(r);
32895
32908
  else {
32896
- const s2 = n[n.length - 1];
32897
- s2 && s2.children.push(r);
32909
+ const a = n[n.length - 1];
32910
+ a && a.children.push(r);
32898
32911
  }
32899
32912
  n.push(r);
32900
32913
  }
32901
- return t;
32902
- }, Vt = (e) => {
32903
- const { plugins: t = [], logger: n = xt(), fetcher: a } = e, r = /* @__PURE__ */ new Map();
32904
- for (const o2 of t) {
32905
- if (r.has(o2.name))
32914
+ return e;
32915
+ }, et = (t) => {
32916
+ const { plugins: e = [], logger: n = Oe(), fetcher: o2 } = t, r = /* @__PURE__ */ new Map();
32917
+ for (const s2 of e) {
32918
+ if (r.has(s2.name))
32906
32919
  throw new Error(
32907
- `Plugin with name '${o2.name}' is already registered`
32920
+ `Plugin with name '${s2.name}' is already registered`
32908
32921
  );
32909
- r.set(o2.name, o2);
32922
+ r.set(s2.name, s2);
32910
32923
  }
32911
- const s2 = async (o2, f, c) => {
32912
- const m = r.get(o2);
32913
- return m ? await m.processBlock(f, c) : `<pre><code class="language-${o2}">${R(f)}</code></pre>`;
32914
- }, d2 = (o2, f, c) => {
32915
- const m = {
32924
+ const a = async (s2, i, d2) => {
32925
+ const p2 = r.get(s2);
32926
+ return p2 ? await p2.processBlock(i, d2) : `<pre><code class="language-${s2}">${R$1(i)}</code></pre>`;
32927
+ }, f = (s2, i, d2) => {
32928
+ const p2 = {
32916
32929
  logger: n,
32917
- signal: f,
32918
- frontmatter: o2,
32919
- getUniqueId: c,
32920
- fetcher: a
32930
+ signal: i,
32931
+ frontmatter: s2,
32932
+ getUniqueId: d2,
32933
+ fetcher: o2
32921
32934
  };
32922
- return () => async (y) => {
32923
- const w = [];
32935
+ return () => async (g2) => {
32936
+ const y = [];
32924
32937
  visit(
32925
- y,
32938
+ g2,
32926
32939
  "code",
32927
- (g2, v, b2) => {
32928
- if (!g2.lang || !r.has(g2.lang))
32940
+ (w, b2, k2) => {
32941
+ if (!w.lang || !r.has(w.lang))
32929
32942
  return;
32930
- const k2 = (async () => {
32931
- const E2 = {
32943
+ const F2 = (async () => {
32944
+ const L2 = {
32932
32945
  type: "html",
32933
- value: await s2(
32934
- g2.lang,
32935
- g2.value,
32936
- m
32946
+ value: await a(
32947
+ w.lang,
32948
+ w.value,
32949
+ p2
32937
32950
  )
32938
32951
  };
32939
- b2 && typeof v == "number" && (b2.children[v] = E2);
32952
+ k2 && typeof b2 == "number" && (k2.children[b2] = L2);
32940
32953
  })();
32941
- w.push(k2);
32954
+ y.push(F2);
32942
32955
  }
32943
- ), await Promise.all(w);
32956
+ ), await Promise.all(y);
32944
32957
  };
32945
- }, p2 = (o2, f, c = false, m = false, y = "") => () => (w) => {
32946
- const g2 = [], v = [];
32947
- visit(w, "heading", (E2) => {
32948
- E2.depth >= 1 && E2.depth <= 6 && v.push(E2);
32958
+ }, m = (s2, i, d2 = false, p2 = false, g2 = "", y = 1) => () => (w) => {
32959
+ const b2 = [], k2 = B(y), F2 = k2 - 1, P2 = (v) => G(v + F2), L2 = [];
32960
+ visit(w, "heading", (v) => {
32961
+ if (v.depth >= 1 && v.depth <= 6) {
32962
+ const H2 = P2(v.depth);
32963
+ v.data || (v.data = {}), v.data.hName = `h${H2}`, L2.push({ node: v, level: H2 });
32964
+ }
32949
32965
  });
32950
- let b2 = [];
32951
- if (c) {
32952
- const E2 = v.map((R2) => ({
32953
- level: R2.depth,
32954
- text: U(R2)
32966
+ let S = [];
32967
+ if (d2) {
32968
+ const v = L2.map(({ node: H2, level: I2 }) => ({
32969
+ level: I2,
32970
+ text: D(H2)
32955
32971
  }));
32956
- b2 = Nt(E2);
32957
- }
32958
- const k2 = [];
32959
- v.forEach((E2, R2) => {
32960
- const S = U(E2), C2 = E2.data?.hProperties?.id;
32961
- let F2;
32962
- if (C2)
32963
- F2 = C2;
32964
- else if (c && m) {
32965
- const I2 = Z(
32966
- y,
32967
- S,
32968
- () => f(S)
32969
- ).replace(`${y}-`, "");
32970
- for (; k2.length > 0; ) {
32971
- const O2 = k2[k2.length - 1];
32972
- if (O2 && O2.level >= E2.depth)
32973
- k2.pop();
32972
+ S = _e(
32973
+ v,
32974
+ k2
32975
+ );
32976
+ }
32977
+ const O2 = [];
32978
+ L2.forEach(({ node: v, level: H2 }, I2) => {
32979
+ const N2 = D(v), $2 = v.data?.hProperties?.id;
32980
+ let E2;
32981
+ if ($2)
32982
+ E2 = $2;
32983
+ else if (d2 && p2) {
32984
+ const x2 = te(
32985
+ g2,
32986
+ N2,
32987
+ () => i(N2)
32988
+ ).replace(`${g2}-`, "");
32989
+ for (; O2.length > 0; ) {
32990
+ const C2 = O2[O2.length - 1];
32991
+ if (C2 && C2.level >= H2)
32992
+ O2.pop();
32974
32993
  else
32975
32994
  break;
32976
32995
  }
32977
- const $2 = k2.map((O2) => O2.contentId);
32978
- F2 = $2.length > 0 ? `${y}-${$2.join("-")}-${I2}` : `${y}-${I2}`, k2.push({
32979
- level: E2.depth,
32980
- contentId: I2
32996
+ const j2 = O2.map((C2) => C2.contentId);
32997
+ E2 = j2.length > 0 ? `${g2}-${j2.join("-")}-${x2}` : `${g2}-${x2}`, O2.push({
32998
+ level: H2,
32999
+ contentId: x2
32981
33000
  });
32982
- } else if (c && R2 < b2.length) {
32983
- const I2 = b2[R2];
32984
- I2 ? F2 = It(
32985
- y,
32986
- I2.numbers
32987
- ) : F2 = f(S);
33001
+ } else if (d2 && I2 < S.length) {
33002
+ const x2 = S[I2];
33003
+ x2 ? E2 = Pe(
33004
+ g2,
33005
+ x2.numbers
33006
+ ) : E2 = i(N2);
32988
33007
  } else
32989
- F2 = f(S);
32990
- E2.data || (E2.data = {}), E2.data.hProperties || (E2.data.hProperties = {}), C2 || (E2.data.hProperties.id = F2), g2.push({
32991
- level: E2.depth,
32992
- text: S,
32993
- id: F2
33008
+ E2 = i(N2);
33009
+ v.data || (v.data = {}), v.data.hProperties || (v.data.hProperties = {}), $2 || (v.data.hProperties.id = E2), b2.push({
33010
+ level: H2,
33011
+ text: N2,
33012
+ id: E2
32994
33013
  });
32995
33014
  });
32996
- const H2 = Lt(g2);
32997
- o2.push(...H2);
32998
- }, u = (o2) => {
33015
+ const _2 = je(b2);
33016
+ s2.push(..._2);
33017
+ }, u = (s2) => {
32999
33018
  throw n.error(
33000
- `Failed to process markdown: ${o2 instanceof Error ? o2.message : "Unknown error"}`
33019
+ `Failed to process markdown: ${s2 instanceof Error ? s2.message : "Unknown error"}`
33001
33020
  ), new Error(
33002
- `Failed to process markdown: ${o2 instanceof Error ? o2.message : "Unknown error"}`
33021
+ `Failed to process markdown: ${s2 instanceof Error ? s2.message : "Unknown error"}`
33003
33022
  );
33004
- }, i = async (o2, f, c, m, y, w) => {
33023
+ }, c = async (s2, i, d2, p2, g2, y) => {
33005
33024
  const {
33006
- signal: g2,
33007
- useContentStringHeaderId: v = false,
33008
- useHierarchicalHeadingId: b2 = true,
33009
- advancedOptions: k2
33010
- } = c ?? {}, {
33011
- allowDangerousHtml: H2 = true,
33012
- htmlOptions: E2 = Rt,
33013
- gfmOptions: R2 = {},
33014
- remarkPlugins: S = [],
33015
- rehypePlugins: C2 = []
33016
- } = k2 || {}, F2 = [];
33017
- let I2 = 0;
33018
- const $2 = () => `${f}-${++I2}`;
33019
- let x2 = unified().use(remarkParse);
33020
- if (S)
33021
- for (const T of S)
33022
- Array.isArray(T) ? x2 = x2.use(T[0], T[1]) : x2 = x2.use(T);
33023
- let O2 = x2.use(remarkGfm, R2).use(Ht).use(
33024
- p2(
33025
- F2,
33026
- v ? (T) => Z(f, T, $2) : $2,
33025
+ signal: w,
33026
+ useContentStringHeaderId: b2 = false,
33027
+ useHierarchicalHeadingId: k2 = true,
33028
+ headingBaseLevel: F2,
33029
+ advancedOptions: P2
33030
+ } = d2 ?? {}, L2 = B(F2), {
33031
+ allowDangerousHtml: S = true,
33032
+ htmlOptions: O2 = Ae,
33033
+ gfmOptions: _2 = {},
33034
+ remarkPlugins: v = [],
33035
+ rehypePlugins: H2 = []
33036
+ } = P2 || {}, I2 = [];
33037
+ let N2 = 0;
33038
+ const $2 = () => `${i}-${++N2}`;
33039
+ let E2 = unified().use(remarkParse);
33040
+ if (v)
33041
+ for (const T of v)
33042
+ Array.isArray(T) ? E2 = E2.use(T[0], T[1]) : E2 = E2.use(T);
33043
+ let x2 = E2.use(remarkGfm, _2).use(Ce).use(
33044
+ m(
33045
+ I2,
33046
+ b2 ? (T) => te(i, T, $2) : $2,
33047
+ k2,
33027
33048
  b2,
33028
- v,
33029
- f
33049
+ i,
33050
+ L2
33030
33051
  )
33031
- ).use(d2(m, g2, $2)).use(remarkRehype, { allowDangerousHtml: H2 }).use(Ct).use(rehypeStringify, { allowDangerousHtml: H2 });
33032
- if (C2)
33033
- for (const T of C2)
33034
- Array.isArray(T) ? O2 = O2.use(T[0], T[1]) : O2 = O2.use(T);
33035
- const P2 = await O2.process(y), M = String(P2);
33052
+ ).use(f(p2, w, $2)).use(remarkRehype, { allowDangerousHtml: S }).use(Re).use(rehypeStringify, { allowDangerousHtml: S });
33053
+ if (H2)
33054
+ for (const T of H2)
33055
+ Array.isArray(T) ? x2 = x2.use(T[0], T[1]) : x2 = x2.use(T);
33056
+ const j2 = await x2.process(g2), M = String(j2);
33036
33057
  return {
33037
- html: Ot(M, E2),
33038
- frontmatter: m,
33039
- changed: w,
33040
- headingTree: F2,
33041
- composeMarkdown: () => w ? Q(m, y) : o2,
33042
- uniqueIdPrefix: f
33058
+ html: Ne2(M, O2),
33059
+ frontmatter: p2,
33060
+ changed: y,
33061
+ headingTree: I2,
33062
+ composeMarkdown: () => y ? Y(p2, g2) : s2,
33063
+ uniqueIdPrefix: i
33043
33064
  };
33044
33065
  };
33045
33066
  return {
33046
- process: async (o2, f, c = {}) => {
33067
+ process: async (s2, i, d2 = {}) => {
33047
33068
  try {
33048
- const { data: m, content: y } = G(o2), w = c.h1TitleTransform ?? "extractAndRemove";
33049
- let g2 = y, v = false, b2 = false;
33069
+ const { data: p2, content: g2 } = X(s2), y = B(
33070
+ d2.headingBaseLevel
33071
+ ), w = d2.headerTitleTransform ?? "extractAndRemove";
33072
+ let b2 = g2, k2 = false, F2 = false;
33050
33073
  if (w !== "none") {
33051
- const H2 = V(g2, m, {
33074
+ const S = ee(b2, p2, {
33052
33075
  allowTitleWrite: true,
33053
- transform: w
33076
+ transform: w,
33077
+ headingBaseLevel: y
33054
33078
  });
33055
- g2 = H2.content, v = H2.headingRemoved, b2 = H2.titleWritten;
33079
+ b2 = S.content, k2 = S.headingRemoved, F2 = S.titleWritten;
33056
33080
  }
33057
- return await i(
33058
- o2,
33059
- f,
33060
- c,
33061
- m,
33062
- g2,
33063
- v || b2
33081
+ const P2 = k2 || F2, L2 = {
33082
+ ...d2,
33083
+ headingBaseLevel: y
33084
+ };
33085
+ return await c(
33086
+ s2,
33087
+ i,
33088
+ L2,
33089
+ p2,
33090
+ b2,
33091
+ P2
33064
33092
  );
33065
- } catch (m) {
33066
- return u(m);
33093
+ } catch (p2) {
33094
+ return u(p2);
33067
33095
  }
33068
33096
  },
33069
- processWithFrontmatterTransform: async (o2, f, c) => {
33097
+ processWithFrontmatterTransform: async (s2, i, d2) => {
33070
33098
  try {
33071
- const { data: m, content: y } = G(o2), w = q(m), g2 = {
33072
- originalFrontmatter: m,
33073
- markdownContent: y,
33074
- uniqueIdPrefix: f
33075
- }, v = await c.preTransform(g2);
33076
- if (v === void 0)
33099
+ const { data: p2, content: g2 } = X(s2), y = W(p2), w = {
33100
+ originalFrontmatter: p2,
33101
+ markdownContent: g2,
33102
+ uniqueIdPrefix: i
33103
+ }, b2 = await d2.preTransform(w);
33104
+ if (b2 === void 0)
33077
33105
  return;
33078
33106
  const {
33079
- frontmatter: b2,
33080
- uniqueIdPrefix: k2,
33081
- h1TitleTransform: H2
33082
- } = v, E2 = k2 ?? f, R2 = H2 ?? "extractAndRemove";
33083
- let S = y, C2 = false;
33084
- if (R2 !== "none") {
33085
- const A = V(S, b2, {
33107
+ frontmatter: k2,
33108
+ uniqueIdPrefix: F2,
33109
+ headerTitleTransform: P2
33110
+ } = b2, L2 = F2 ?? i, S = B(
33111
+ d2.headingBaseLevel
33112
+ ), O2 = P2 ?? "extractAndRemove";
33113
+ let _2 = g2, v = false;
33114
+ if (O2 !== "none") {
33115
+ const C2 = ee(_2, k2, {
33086
33116
  allowTitleWrite: true,
33087
- transform: R2
33117
+ transform: O2,
33118
+ headingBaseLevel: S
33088
33119
  });
33089
- S = A.content, C2 = A.headingRemoved || C2;
33090
- }
33091
- const I2 = q(b2) !== w || C2, $2 = await i(
33092
- o2,
33093
- E2,
33094
- c,
33095
- b2,
33096
- S,
33120
+ _2 = C2.content, v = C2.headingRemoved || v;
33121
+ }
33122
+ const I2 = W(k2) !== y || v, N2 = {
33123
+ ...d2,
33124
+ headingBaseLevel: S
33125
+ }, $2 = await c(
33126
+ s2,
33127
+ L2,
33128
+ N2,
33129
+ k2,
33130
+ _2,
33097
33131
  I2
33098
33132
  );
33099
- let x2 = $2.frontmatter;
33100
- if (c.postTransform) {
33101
- const A = {
33102
- frontmatter: x2,
33133
+ let E2 = $2.frontmatter;
33134
+ if (d2.postTransform) {
33135
+ const C2 = {
33136
+ frontmatter: E2,
33103
33137
  headingTree: $2.headingTree
33104
33138
  };
33105
- x2 = await c.postTransform(A);
33139
+ E2 = await d2.postTransform(C2);
33106
33140
  }
33107
- const P2 = q(x2) !== w || C2, M = () => P2 ? Q(x2, S) : o2;
33141
+ const j2 = W(E2) !== y || v, M = () => j2 ? Y(E2, _2) : s2;
33108
33142
  return {
33109
33143
  html: $2.html,
33110
- frontmatter: x2,
33111
- changed: P2,
33144
+ frontmatter: E2,
33145
+ changed: j2,
33112
33146
  headingTree: $2.headingTree,
33113
33147
  composeMarkdown: M,
33114
33148
  uniqueIdPrefix: $2.uniqueIdPrefix
33115
33149
  };
33116
- } catch (m) {
33117
- return u(m);
33150
+ } catch (p2) {
33151
+ return u(p2);
33118
33152
  }
33119
33153
  }
33120
33154
  };
33121
- }, Zt = (e, t = {}) => {
33122
- const { maxRedirects: n = 5, timeoutEachRedirect: a = 1e4 } = t;
33155
+ }, tt = (t, e = {}) => {
33156
+ const { maxRedirects: n = 5, timeoutEachRedirect: o2 = 1e4 } = e;
33123
33157
  return {
33124
33158
  name: "oembed",
33125
- processBlock: async (s2, d2) => {
33126
- const p2 = s2.trim();
33127
- if (!qd(p2))
33128
- throw new Error(`Invalid URL: ${p2}`);
33159
+ processBlock: async (a, f) => {
33160
+ const m = a.trim();
33161
+ if (!qd(m))
33162
+ throw new Error(`Invalid URL: ${m}`);
33129
33163
  try {
33130
33164
  const u = await Gd(
33131
- p2,
33165
+ m,
33132
33166
  n,
33133
- a,
33134
- d2,
33135
- e
33167
+ o2,
33168
+ f,
33169
+ t
33136
33170
  );
33137
- return Wd(u, p2, t);
33171
+ return Wd(u, m, e);
33138
33172
  } catch (u) {
33139
- d2.logger.warn("oEmbed fetch failed for URL:", p2, u);
33140
- const i = Vd(u);
33141
- return typeof window < "u" ? Xs(p2, i) : Xs(p2, i);
33173
+ f.logger.warn("oEmbed fetch failed for URL:", m, u);
33174
+ const c = Vd(u);
33175
+ return typeof window < "u" ? Xs(m, c) : Xs(m, c);
33142
33176
  }
33143
33177
  }
33144
33178
  };
33145
- }, Xt = (e = {}) => ({
33179
+ }, rt = (t = {}) => ({
33146
33180
  name: "card",
33147
- processBlock: async (n, a) => {
33181
+ processBlock: async (n, o2) => {
33148
33182
  const r = n.trim();
33149
33183
  if (!Xd(r))
33150
33184
  throw new Error(`Invalid URL: ${r}`);
33151
33185
  try {
33152
- const s2 = await Jd(r, e, a);
33153
- return th(s2, r, e);
33154
- } catch (s2) {
33155
- a.logger.warn("Card plugin fetch failed for URL:", r, s2);
33156
- const d2 = Vd(s2);
33157
- return typeof window < "u" ? eh(r, d2) : eh(r, d2);
33186
+ const a = await Jd(r, t, o2);
33187
+ return th(a, r, t);
33188
+ } catch (a) {
33189
+ o2.logger.warn("Card plugin fetch failed for URL:", r, a);
33190
+ const f = Vd(a);
33191
+ return typeof window < "u" ? eh(r, f) : eh(r, f);
33158
33192
  }
33159
33193
  }
33160
- }), Yt = (e = {}) => {
33161
- const { className: t = "mermaid", includeId: n = true } = e;
33194
+ }), nt = (t = {}) => {
33195
+ const { className: e = "mermaid", includeId: n = true } = t;
33162
33196
  return {
33163
33197
  name: "mermaid",
33164
- processBlock: async (r, s2) => {
33165
- const d2 = r.trim();
33166
- if (!d2) {
33167
- s2.logger.warn("Mermaid plugin received empty content");
33168
- const h = n ? ` id="${s2.getUniqueId()}"` : "";
33169
- return `<div class="${t}-wrapper">
33198
+ processBlock: async (r, a) => {
33199
+ const f = r.trim();
33200
+ if (!f) {
33201
+ a.logger.warn("Mermaid plugin received empty content");
33202
+ const l2 = n ? ` id="${a.getUniqueId()}"` : "";
33203
+ return `<div class="${e}-wrapper">
33170
33204
  <style>
33171
- .${t}-wrapper .${t} > svg {
33205
+ .${e}-wrapper .${e} > svg {
33172
33206
  width: auto !important;
33173
33207
  height: auto !important;
33174
33208
  max-width: none !important;
33175
33209
  }
33176
33210
  </style>
33177
- <div class="${t}"${h}><!-- Empty mermaid content --></div>
33211
+ <div class="${e}"${l2}><!-- Empty mermaid content --></div>
33178
33212
  </div>`;
33179
33213
  }
33180
- const p2 = n ? ` id="${s2.getUniqueId()}"` : "", u = d2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), i = `<div class="${t}-wrapper">
33214
+ const m = n ? ` id="${a.getUniqueId()}"` : "", u = f.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), c = `<div class="${e}-wrapper">
33181
33215
  <style>
33182
- .${t}-wrapper .${t} > svg {
33216
+ .${e}-wrapper .${e} > svg {
33183
33217
  width: auto !important;
33184
33218
  height: auto !important;
33185
33219
  max-width: none !important;
33186
33220
  }
33187
33221
  </style>
33188
- <div class="${t}"${p2}>${u}</div>
33222
+ <div class="${e}"${m}>${u}</div>
33189
33223
  </div>`;
33190
- return s2.logger.debug("Mermaid plugin processed content:", {
33191
- contentLength: d2.length,
33192
- className: t,
33224
+ return a.logger.debug("Mermaid plugin processed content:", {
33225
+ contentLength: f.length,
33226
+ className: e,
33193
33227
  includeId: n
33194
- }), i;
33228
+ }), c;
33195
33229
  }
33196
33230
  };
33197
33231
  };
@@ -33204,100 +33238,100 @@ const _ = () => {
33204
33238
  * repository.url: https://github.com/kekyo/async-primitives.git
33205
33239
  * git.commit.hash: cd35465b7e9b9945049186e7eaeecc0bfba65766
33206
33240
  */
33207
- const X = () => {
33208
- }, Y = {
33209
- release: X,
33210
- [Symbol.dispose]: X
33211
- }, tt = (e) => e instanceof Error ? e : typeof e == "string" ? new Error(e) : new Error("Operation aborted"), At = (e, t) => {
33212
- if (!e)
33213
- return Y;
33214
- if (e.aborted) {
33241
+ const re = () => {
33242
+ }, ne = {
33243
+ release: re,
33244
+ [Symbol.dispose]: re
33245
+ }, se = (t) => t instanceof Error ? t : typeof t == "string" ? new Error(t) : new Error("Operation aborted"), Be = (t, e) => {
33246
+ if (!t)
33247
+ return ne;
33248
+ if (t.aborted) {
33215
33249
  try {
33216
- t(tt(e.reason));
33217
- } catch (s2) {
33218
- console.warn("AbortHook callback error: ", s2);
33250
+ e(se(t.reason));
33251
+ } catch (a) {
33252
+ console.warn("AbortHook callback error: ", a);
33219
33253
  }
33220
- return Y;
33254
+ return ne;
33221
33255
  }
33222
33256
  let n;
33223
33257
  n = () => {
33224
33258
  if (n) {
33225
- const s2 = e.reason;
33226
- e.removeEventListener("abort", n), n = void 0;
33259
+ const a = t.reason;
33260
+ t.removeEventListener("abort", n), n = void 0;
33227
33261
  try {
33228
- t(tt(s2));
33229
- } catch (d2) {
33230
- console.warn("AbortHook callback error: ", d2);
33262
+ e(se(a));
33263
+ } catch (f) {
33264
+ console.warn("AbortHook callback error: ", f);
33231
33265
  }
33232
33266
  }
33233
33267
  };
33234
- const a = () => {
33235
- n && (e.removeEventListener("abort", n), n = void 0);
33268
+ const o2 = () => {
33269
+ n && (t.removeEventListener("abort", n), n = void 0);
33236
33270
  };
33237
- return e.addEventListener("abort", n, { once: true }), {
33238
- release: a,
33239
- [Symbol.dispose]: a
33271
+ return t.addEventListener("abort", n, { once: true }), {
33272
+ release: o2,
33273
+ [Symbol.dispose]: o2
33240
33274
  };
33241
- }, Pt = (e) => {
33242
- typeof setImmediate == "function" ? setImmediate(e) : setTimeout(e, 0);
33243
- }, D = () => new Error("Lock acquisition was aborted"), _t = (e) => {
33244
- let t = true;
33275
+ }, Me = (t) => {
33276
+ typeof setImmediate == "function" ? setImmediate(t) : setTimeout(t, 0);
33277
+ }, z = () => new Error("Lock acquisition was aborted"), Ue = (t) => {
33278
+ let e = true;
33245
33279
  const n = () => {
33246
- t && (t = false, e());
33280
+ e && (e = false, t());
33247
33281
  };
33248
33282
  return {
33249
33283
  get isActive() {
33250
- return t;
33284
+ return e;
33251
33285
  },
33252
33286
  release: n,
33253
33287
  [Symbol.dispose]: n
33254
33288
  };
33255
- }, B = (e = 20) => {
33256
- let t = false;
33289
+ }, Q = (t = 20) => {
33290
+ let e = false;
33257
33291
  const n = [];
33258
- let a = 0;
33292
+ let o2 = 0;
33259
33293
  const r = () => {
33260
- var h;
33261
- if (t || n.length === 0)
33294
+ var l2;
33295
+ if (e || n.length === 0)
33262
33296
  return;
33263
- const l2 = n.shift();
33264
- if ((h = l2.signal) != null && h.aborted) {
33265
- l2.reject(D()), s2();
33297
+ const h = n.shift();
33298
+ if ((l2 = h.signal) != null && l2.aborted) {
33299
+ h.reject(z()), a();
33266
33300
  return;
33267
33301
  }
33268
- t = true;
33269
- const o2 = _t(d2);
33270
- l2.resolve(o2);
33271
- }, s2 = () => {
33272
- a++, a >= e ? (a = 0, Pt(r)) : r();
33273
- }, d2 = () => {
33274
- t && (t = false, s2());
33275
- }, p2 = (h) => {
33276
- const l2 = n.indexOf(h);
33277
- l2 !== -1 && n.splice(l2, 1);
33278
- }, u = async (h) => {
33279
- if (h) {
33280
- if (h.aborted)
33281
- throw D();
33282
- return new Promise((l2, o2) => {
33283
- const f = {
33302
+ e = true;
33303
+ const s2 = Ue(f);
33304
+ h.resolve(s2);
33305
+ }, a = () => {
33306
+ o2++, o2 >= t ? (o2 = 0, Me(r)) : r();
33307
+ }, f = () => {
33308
+ e && (e = false, a());
33309
+ }, m = (l2) => {
33310
+ const h = n.indexOf(l2);
33311
+ h !== -1 && n.splice(h, 1);
33312
+ }, u = async (l2) => {
33313
+ if (l2) {
33314
+ if (l2.aborted)
33315
+ throw z();
33316
+ return new Promise((h, s2) => {
33317
+ const i = {
33284
33318
  resolve: void 0,
33285
33319
  reject: void 0,
33286
- signal: h
33287
- }, c = At(h, () => {
33288
- p2(f), o2(D());
33320
+ signal: l2
33321
+ }, d2 = Be(l2, () => {
33322
+ m(i), s2(z());
33289
33323
  });
33290
- f.resolve = (m) => {
33291
- c.release(), l2(m);
33292
- }, f.reject = (m) => {
33293
- c.release(), o2(m);
33294
- }, n.push(f), r();
33324
+ i.resolve = (p2) => {
33325
+ d2.release(), h(p2);
33326
+ }, i.reject = (p2) => {
33327
+ d2.release(), s2(p2);
33328
+ }, n.push(i), r();
33295
33329
  });
33296
33330
  } else
33297
- return new Promise((l2, o2) => {
33331
+ return new Promise((h, s2) => {
33298
33332
  n.push({
33299
- resolve: l2,
33300
- reject: o2
33333
+ resolve: h,
33334
+ reject: s2
33301
33335
  }), r();
33302
33336
  });
33303
33337
  };
@@ -33307,202 +33341,202 @@ const X = () => {
33307
33341
  wait: u
33308
33342
  },
33309
33343
  get isLocked() {
33310
- return t;
33344
+ return e;
33311
33345
  },
33312
33346
  get pendingCount() {
33313
33347
  return n.length;
33314
33348
  }
33315
33349
  };
33316
- }, jt = () => {
33317
- const e = /* @__PURE__ */ new Map(), t = B(), n = (u = Date.now()) => {
33318
- const i = [];
33319
- for (const [h, l2] of e.entries())
33320
- l2.ttl !== void 0 && (l2.ttl === 0 || u > l2.timestamp + l2.ttl) && i.push(h);
33321
- for (const h of i)
33322
- e.delete(h);
33323
- return i;
33350
+ }, qe = () => {
33351
+ const t = /* @__PURE__ */ new Map(), e = Q(), n = (u = Date.now()) => {
33352
+ const c = [];
33353
+ for (const [l2, h] of t.entries())
33354
+ h.ttl !== void 0 && (h.ttl === 0 || u > h.timestamp + h.ttl) && c.push(l2);
33355
+ for (const l2 of c)
33356
+ t.delete(l2);
33357
+ return c;
33324
33358
  };
33325
33359
  return {
33326
33360
  get: async (u) => {
33327
- const i = e.get(u);
33328
- if (!i)
33361
+ const c = t.get(u);
33362
+ if (!c)
33329
33363
  return null;
33330
- if (i.ttl !== void 0 && (i.ttl === 0 || Date.now() > i.timestamp + i.ttl)) {
33331
- const l2 = await t.lock();
33364
+ if (c.ttl !== void 0 && (c.ttl === 0 || Date.now() > c.timestamp + c.ttl)) {
33365
+ const h = await e.lock();
33332
33366
  try {
33333
- const o2 = e.get(u);
33334
- if (o2 && o2.ttl !== void 0) {
33335
- const f = Date.now();
33336
- (o2.ttl === 0 || f > o2.timestamp + o2.ttl) && e.delete(u);
33367
+ const s2 = t.get(u);
33368
+ if (s2 && s2.ttl !== void 0) {
33369
+ const i = Date.now();
33370
+ (s2.ttl === 0 || i > s2.timestamp + s2.ttl) && t.delete(u);
33337
33371
  }
33338
33372
  return null;
33339
33373
  } finally {
33340
- l2.release();
33374
+ h.release();
33341
33375
  }
33342
33376
  }
33343
- return i.data;
33377
+ return c.data;
33344
33378
  },
33345
- set: async (u, i, h) => {
33346
- const l2 = {
33347
- data: i,
33379
+ set: async (u, c, l2) => {
33380
+ const h = {
33381
+ data: c,
33348
33382
  timestamp: Date.now()
33349
33383
  };
33350
- h !== void 0 && (l2.ttl = h);
33351
- const o2 = await t.lock();
33384
+ l2 !== void 0 && (h.ttl = l2);
33385
+ const s2 = await e.lock();
33352
33386
  try {
33353
- e.set(u, l2);
33387
+ t.set(u, h);
33354
33388
  } finally {
33355
- o2.release();
33389
+ s2.release();
33356
33390
  }
33357
33391
  },
33358
33392
  delete: async (u) => {
33359
- const i = await t.lock();
33393
+ const c = await e.lock();
33360
33394
  try {
33361
- e.delete(u);
33395
+ t.delete(u);
33362
33396
  } finally {
33363
- i.release();
33397
+ c.release();
33364
33398
  }
33365
33399
  },
33366
33400
  clear: async () => {
33367
- const u = await t.lock();
33401
+ const u = await e.lock();
33368
33402
  try {
33369
- e.clear();
33403
+ t.clear();
33370
33404
  } finally {
33371
33405
  u.release();
33372
33406
  }
33373
33407
  },
33374
33408
  size: async () => {
33375
- if (Array.from(e.entries()).length === 0)
33409
+ if (Array.from(t.entries()).length === 0)
33376
33410
  return 0;
33377
- const i = await t.lock();
33411
+ const c = await e.lock();
33378
33412
  try {
33379
- return n(), e.size;
33413
+ return n(), t.size;
33380
33414
  } finally {
33381
- i.release();
33415
+ c.release();
33382
33416
  }
33383
33417
  }
33384
33418
  };
33385
33419
  };
33386
- function W(e, t, n) {
33387
- return `fetch:${e}:${t}:${n}`;
33420
+ function J(t, e, n) {
33421
+ return `fetch:${t}:${e}:${n}`;
33388
33422
  }
33389
- const re = (e, t = 6e4, n, a) => {
33423
+ const ot = (t, e = 6e4, n, o2) => {
33390
33424
  const {
33391
33425
  cache: r = true,
33392
- cacheTTL: s2 = 3600 * 1e3,
33426
+ cacheTTL: a = 3600 * 1e3,
33393
33427
  // 1 hour default
33394
- cacheFailures: d2 = true,
33395
- failureCacheTTL: p2 = 300 * 1e3
33428
+ cacheFailures: f = true,
33429
+ failureCacheTTL: m = 300 * 1e3
33396
33430
  // 5 minutes default for failures
33397
- } = {}, u = r ? n || jt() : void 0;
33431
+ } = {}, u = r ? n || qe() : void 0;
33398
33432
  return {
33399
- rawFetcher: async (h, l2, o2, f) => {
33433
+ rawFetcher: async (l2, h, s2, i) => {
33400
33434
  if (r && u) {
33401
- const y = W(h, l2, e), w = await u.get(y);
33402
- if (w)
33435
+ const g2 = J(l2, h, t), y = await u.get(g2);
33436
+ if (y)
33403
33437
  try {
33404
- const g2 = JSON.parse(w);
33405
- if (g2.type === "success")
33406
- return f?.info(`Cache HIT (success) for URL: ${h}`), new Response(g2.data, {
33438
+ const w = JSON.parse(y);
33439
+ if (w.type === "success")
33440
+ return i?.info(`Cache HIT (success) for URL: ${l2}`), new Response(w.data, {
33407
33441
  status: 200,
33408
33442
  statusText: "OK",
33409
33443
  headers: {
33410
- "Content-Type": l2,
33444
+ "Content-Type": h,
33411
33445
  "X-Cache": "HIT"
33412
33446
  }
33413
33447
  });
33414
- if (g2.type === "error" && d2)
33415
- throw f?.info(`Cache HIT (error) for URL: ${h}`), new Error("Cached error");
33416
- f?.debug(
33417
- `Cache entry type ${g2.type} not eligible for use, cacheFailures: ${d2}`
33448
+ if (w.type === "error" && f)
33449
+ throw i?.info(`Cache HIT (error) for URL: ${l2}`), new Error("Cached error");
33450
+ i?.debug(
33451
+ `Cache entry type ${w.type} not eligible for use, cacheFailures: ${f}`
33418
33452
  );
33419
- } catch (g2) {
33420
- if (f?.warn(
33421
- `Failed to parse cached entry for URL ${h}:`,
33422
- g2
33423
- ), g2 instanceof SyntaxError)
33424
- f?.debug("JSON parse error, continuing to network fetch");
33453
+ } catch (w) {
33454
+ if (i?.warn(
33455
+ `Failed to parse cached entry for URL ${l2}:`,
33456
+ w
33457
+ ), w instanceof SyntaxError)
33458
+ i?.debug("JSON parse error, continuing to network fetch");
33425
33459
  else
33426
- throw g2;
33460
+ throw w;
33427
33461
  }
33428
33462
  else
33429
- f?.info(`Cache MISS for URL: ${h}`);
33463
+ i?.info(`Cache MISS for URL: ${l2}`);
33430
33464
  }
33431
- let c, m = null;
33465
+ let d2, p2 = null;
33432
33466
  try {
33433
- c = await Yd(
33434
- h,
33467
+ d2 = await Yd(
33435
33468
  l2,
33436
- e,
33469
+ h,
33437
33470
  t,
33438
- o2,
33439
- f
33471
+ e,
33472
+ s2,
33473
+ i
33440
33474
  );
33441
- } catch (y) {
33442
- if (m = y, r && u && d2)
33475
+ } catch (g2) {
33476
+ if (p2 = g2, r && u && f)
33443
33477
  try {
33444
- const w = W(h, l2, e), g2 = {
33478
+ const y = J(l2, h, t), w = {
33445
33479
  type: "error",
33446
33480
  data: "",
33447
33481
  error: {
33448
- message: m.message,
33449
- ...m.message.includes("HTTP error, status:") && {
33482
+ message: p2.message,
33483
+ ...p2.message.includes("HTTP error, status:") && {
33450
33484
  status: parseInt(
33451
- m.message.match(/status: (\d+)/)?.[1] || "0"
33485
+ p2.message.match(/status: (\d+)/)?.[1] || "0"
33452
33486
  )
33453
33487
  }
33454
33488
  },
33455
33489
  timestamp: Date.now()
33456
33490
  };
33457
33491
  await u.set(
33458
- w,
33459
- JSON.stringify(g2),
33460
- p2
33461
- ), f?.debug(`Cached error for URL: ${h}`);
33462
- } catch (w) {
33463
- f?.warn(`Failed to cache error for URL ${h}:`, w), console.warn("Failed to cache error:", w);
33492
+ y,
33493
+ JSON.stringify(w),
33494
+ m
33495
+ ), i?.debug(`Cached error for URL: ${l2}`);
33496
+ } catch (y) {
33497
+ i?.warn(`Failed to cache error for URL ${l2}:`, y), console.warn("Failed to cache error:", y);
33464
33498
  }
33465
- throw m;
33499
+ throw p2;
33466
33500
  }
33467
- if (r && u && c.ok)
33501
+ if (r && u && d2.ok)
33468
33502
  try {
33469
- const y = await c.clone().text(), w = W(h, l2, e), g2 = {
33503
+ const g2 = await d2.clone().text(), y = J(l2, h, t), w = {
33470
33504
  type: "success",
33471
- data: y,
33505
+ data: g2,
33472
33506
  timestamp: Date.now()
33473
33507
  };
33474
33508
  await u.set(
33475
- w,
33476
- JSON.stringify(g2),
33477
- s2
33478
- ), f?.debug(`Cached successful response for URL: ${h}`);
33479
- } catch (y) {
33480
- f?.warn(`Failed to cache response for URL ${h}:`, y), console.warn("Failed to cache response:", y);
33481
- }
33482
- return c;
33509
+ y,
33510
+ JSON.stringify(w),
33511
+ a
33512
+ ), i?.debug(`Cached successful response for URL: ${l2}`);
33513
+ } catch (g2) {
33514
+ i?.warn(`Failed to cache response for URL ${l2}:`, g2), console.warn("Failed to cache response:", g2);
33515
+ }
33516
+ return d2;
33483
33517
  },
33484
- userAgent: e
33518
+ userAgent: t
33485
33519
  };
33486
33520
  };
33487
33521
  function setupProcessor(config) {
33488
33522
  const plugins = [];
33489
- const logger = Qt();
33490
- const fetcher = re(
33523
+ const logger = Ye();
33524
+ const fetcher = ot(
33491
33525
  "mark-deco-cli/0.0.1",
33492
33526
  5e3,
33493
- jt()
33527
+ qe()
33494
33528
  );
33495
33529
  const enabledPlugins = config.noPlugins ? [] : Array.isArray(config.plugins) ? config.plugins : ["oembed", "card", "mermaid"];
33496
33530
  if (enabledPlugins.includes("oembed") && config.oembed?.enabled !== false) {
33497
- plugins.push(Zt($d, {}));
33531
+ plugins.push(tt($d, {}));
33498
33532
  }
33499
33533
  if (enabledPlugins.includes("card") && config.card?.enabled !== false) {
33500
- plugins.push(Xt({}));
33534
+ plugins.push(rt({}));
33501
33535
  }
33502
33536
  if (enabledPlugins.includes("mermaid") && config.mermaid?.enabled !== false) {
33503
- plugins.push(Yt({}));
33537
+ plugins.push(nt({}));
33504
33538
  }
33505
- return Vt({
33539
+ return et({
33506
33540
  plugins,
33507
33541
  logger,
33508
33542
  fetcher
@@ -33539,8 +33573,13 @@ async function main() {
33539
33573
  ).default(false)
33540
33574
  ).addOption(
33541
33575
  new commander.Option(
33542
- "--h1-title-transform <mode>",
33543
- "Control how the first H1 heading is applied to frontmatter.title (extract, extractAndRemove, none)"
33576
+ "--heading-base-level <level>",
33577
+ "Base heading level for markdown headings"
33578
+ ).argParser((value) => Number.parseInt(value, 10)).default(1)
33579
+ ).addOption(
33580
+ new commander.Option(
33581
+ "--header-title-transform <mode>",
33582
+ "Control how the first base-level heading is applied to frontmatter.title (extract, extractAndRemove, none)"
33544
33583
  ).choices(["extract", "extractAndRemove", "none"])
33545
33584
  ).addOption(
33546
33585
  new commander.Option(
@@ -33559,14 +33598,16 @@ async function main() {
33559
33598
  const mergedOptions = { ...config, ...options2 };
33560
33599
  const markdown = await readInput(options2.input);
33561
33600
  const processor = setupProcessor(mergedOptions);
33562
- const h1TitleTransform = options2.h1TitleTransform ?? config.h1TitleTransform ?? "extractAndRemove";
33601
+ const headerTitleTransform = options2.headerTitleTransform ?? config.headerTitleTransform ?? "extractAndRemove";
33602
+ const headingBaseLevel = options2.headingBaseLevel ?? config.headingBaseLevel ?? 1;
33563
33603
  const result = await processor.process(
33564
33604
  markdown,
33565
33605
  options2.uniqueIdPrefix || "section",
33566
33606
  {
33567
33607
  useHierarchicalHeadingId: options2.hierarchicalHeadingId ?? true,
33568
33608
  useContentStringHeaderId: options2.contentBasedHeadingId ?? false,
33569
- h1TitleTransform
33609
+ headingBaseLevel,
33610
+ headerTitleTransform
33570
33611
  }
33571
33612
  );
33572
33613
  await writeOutput(result.html, options2.output);