@tricoteuses/assemblee 3.5.1 → 3.6.1

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 (42) hide show
  1. package/lib/{amendements-D2X2TneW.js → amendements-BYKlEcWb.js} +1 -1
  2. package/lib/{amendements-DSXfagiR.js → amendements-CvlD2dI4.js} +10 -12
  3. package/lib/cleaners.js +3 -3
  4. package/lib/derouleur.js +1 -1
  5. package/lib/eliasse-socket.d.ts +26 -34
  6. package/lib/eliasse-socket.js +79 -160
  7. package/lib/eliasse-sync.d.ts +67 -0
  8. package/lib/eliasse-sync.js +105 -0
  9. package/lib/eliasse-sync.test.d.ts +1 -0
  10. package/lib/eliasse.js +1 -1
  11. package/lib/git.js +1 -1
  12. package/lib/index.js +3 -6
  13. package/lib/{loaders-DYFDjudN.js → loaders-BNXs79lC.js} +2 -2
  14. package/lib/loaders.js +1 -1
  15. package/lib/parsers/dossier_annexes.d.ts +36 -0
  16. package/lib/parsers/dossier_annexes.test.d.ts +1 -0
  17. package/lib/parsers.js +425 -469
  18. package/lib/registries.d.ts +8 -8
  19. package/lib/schemas/clean/acteurs_et_organes.d.ts +37 -37
  20. package/lib/schemas/clean/amendements.d.ts +12 -12
  21. package/lib/schemas/clean/debats.d.ts +26 -26
  22. package/lib/schemas/clean/dossiers_legislatifs.d.ts +16 -16
  23. package/lib/schemas/clean/questions.d.ts +122 -122
  24. package/lib/schemas/clean/scrutins.d.ts +2 -2
  25. package/lib/schemas/enriched/acteurs_et_organes.d.ts +2 -2
  26. package/lib/schemas/enriched/amendements.d.ts +9 -9
  27. package/lib/schemas/enriched/dossiers_legislatifs.d.ts +12 -12
  28. package/lib/schemas/enriched/questions.d.ts +108 -108
  29. package/lib/schemas/enriched/scrutins.d.ts +2 -2
  30. package/lib/schemas/raw/acteurs_et_organes.d.ts +132 -132
  31. package/lib/schemas/raw/agendas.d.ts +97 -97
  32. package/lib/schemas/raw/amendements.d.ts +83 -83
  33. package/lib/schemas/raw/debats.d.ts +51 -51
  34. package/lib/schemas/raw/dossiers_legislatifs.d.ts +171 -171
  35. package/lib/schemas/raw/questions.d.ts +222 -222
  36. package/lib/schemas/raw/scrutins.d.ts +164 -164
  37. package/lib/scripts/retrieve_dossier_annexes.d.ts +110 -0
  38. package/lib/scripts/shared/utils.d.ts +9 -0
  39. package/lib/{scrutins-CGHd_VPY.js → scrutins-BUVxV-QV.js} +2 -2
  40. package/lib/zod_errors-qS8sQ67W.js +32 -0
  41. package/package.json +8 -1
  42. package/lib/zod_errors-DCnjCNGy.js +0 -34
package/lib/parsers.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _t as e, gt as t, ht as n, r, vt as i } from "./amendements-DSXfagiR.js";
2
- import { t as a } from "./amendements-D2X2TneW.js";
1
+ import { _t as e, gt as t, ht as n, r, vt as i } from "./amendements-CvlD2dI4.js";
2
+ import { t as a } from "./amendements-BYKlEcWb.js";
3
3
  import o from "node:assert";
4
4
  import s from "fs-extra";
5
5
  import c from "node:path";
@@ -20,17 +20,17 @@ var f = Object.create, p = Object.defineProperty, ee = Object.getOwnPropertyDesc
20
20
  enumerable: !(r = ee(t, s)) || r.enumerable
21
21
  });
22
22
  return e;
23
- }, te = (e, t, n) => (n = e == null ? {} : f(h(e)), y(t || !e || !e.__esModule ? p(n, "default", {
23
+ }, b = (e, t, n) => (n = e == null ? {} : f(h(e)), y(t || !e || !e.__esModule || !g.call(e, "default") ? p(n, "default", {
24
24
  value: e,
25
25
  enumerable: !0
26
- }) : n, e)), b;
26
+ }) : n, e)), x;
27
27
  (function(e) {
28
28
  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";
29
- })(b || (b = {}));
30
- function x(e) {
31
- return e.type === b.Tag || e.type === b.Script || e.type === b.Style;
29
+ })(x || (x = {}));
30
+ function S(e) {
31
+ return e.type === x.Tag || e.type === x.Script || e.type === x.Style;
32
32
  }
33
- var ne = b.Root, re = b.Text, ie = b.Directive, ae = b.Comment, oe = b.Script, se = b.Style, ce = b.Tag, le = b.CDATA, ue = b.Doctype, de = class {
33
+ var te = x.Root, ne = x.Text, re = x.Directive, ie = x.Comment, ae = x.Script, oe = x.Style, se = x.Tag, ce = x.CDATA, le = x.Doctype, ue = class {
34
34
  constructor() {
35
35
  this.parent = null, this.prev = null, this.next = null, this.startIndex = null, this.endIndex = null;
36
36
  }
@@ -53,9 +53,9 @@ var ne = b.Root, re = b.Text, ie = b.Directive, ae = b.Comment, oe = b.Script, s
53
53
  this.next = e;
54
54
  }
55
55
  cloneNode(e = !1) {
56
- return Te(this, e);
56
+ return we(this, e);
57
57
  }
58
- }, fe = class extends de {
58
+ }, de = class extends ue {
59
59
  constructor(e) {
60
60
  super(), this.data = e;
61
61
  }
@@ -65,28 +65,28 @@ var ne = b.Root, re = b.Text, ie = b.Directive, ae = b.Comment, oe = b.Script, s
65
65
  set nodeValue(e) {
66
66
  this.data = e;
67
67
  }
68
- }, pe = class extends fe {
68
+ }, fe = class extends de {
69
69
  constructor() {
70
- super(...arguments), this.type = b.Text;
70
+ super(...arguments), this.type = x.Text;
71
71
  }
72
72
  get nodeType() {
73
73
  return 3;
74
74
  }
75
- }, me = class extends fe {
75
+ }, pe = class extends de {
76
76
  constructor() {
77
- super(...arguments), this.type = b.Comment;
77
+ super(...arguments), this.type = x.Comment;
78
78
  }
79
79
  get nodeType() {
80
80
  return 8;
81
81
  }
82
- }, he = class extends fe {
82
+ }, me = class extends de {
83
83
  constructor(e, t) {
84
- super(t), this.name = e, this.type = b.Directive;
84
+ super(t), this.name = e, this.type = x.Directive;
85
85
  }
86
86
  get nodeType() {
87
87
  return 1;
88
88
  }
89
- }, ge = class extends de {
89
+ }, he = class extends ue {
90
90
  constructor(e) {
91
91
  super(), this.children = e;
92
92
  }
@@ -102,22 +102,22 @@ var ne = b.Root, re = b.Text, ie = b.Directive, ae = b.Comment, oe = b.Script, s
102
102
  set childNodes(e) {
103
103
  this.children = e;
104
104
  }
105
- }, _e = class extends ge {
105
+ }, ge = class extends he {
106
106
  constructor() {
107
- super(...arguments), this.type = b.CDATA;
107
+ super(...arguments), this.type = x.CDATA;
108
108
  }
109
109
  get nodeType() {
110
110
  return 4;
111
111
  }
112
- }, ve = class extends ge {
112
+ }, _e = class extends he {
113
113
  constructor() {
114
- super(...arguments), this.type = b.Root;
114
+ super(...arguments), this.type = x.Root;
115
115
  }
116
116
  get nodeType() {
117
117
  return 9;
118
118
  }
119
- }, ye = class extends ge {
120
- constructor(e, t, n = [], r = e === "script" ? b.Script : e === "style" ? b.Style : b.Tag) {
119
+ }, ve = class extends he {
120
+ constructor(e, t, n = [], r = e === "script" ? x.Script : e === "style" ? x.Style : x.Tag) {
121
121
  super(n), this.name = e, this.attribs = t, this.type = r;
122
122
  }
123
123
  get nodeType() {
@@ -138,66 +138,66 @@ var ne = b.Root, re = b.Text, ie = b.Directive, ae = b.Comment, oe = b.Script, s
138
138
  }));
139
139
  }
140
140
  };
141
- function S(e) {
142
- return x(e);
141
+ function C(e) {
142
+ return S(e);
143
+ }
144
+ function ye(e) {
145
+ return e.type === x.CDATA;
143
146
  }
144
147
  function be(e) {
145
- return e.type === b.CDATA;
148
+ return e.type === x.Text;
146
149
  }
147
150
  function xe(e) {
148
- return e.type === b.Text;
151
+ return e.type === x.Comment;
149
152
  }
150
153
  function Se(e) {
151
- return e.type === b.Comment;
154
+ return e.type === x.Directive;
152
155
  }
153
156
  function Ce(e) {
154
- return e.type === b.Directive;
157
+ return e.type === x.Root;
155
158
  }
156
- function we(e) {
157
- return e.type === b.Root;
158
- }
159
- function C(e) {
159
+ function w(e) {
160
160
  return Object.prototype.hasOwnProperty.call(e, "children");
161
161
  }
162
- function Te(e, t = !1) {
162
+ function we(e, t = !1) {
163
163
  let n;
164
- if (xe(e)) n = new pe(e.data);
165
- else if (Se(e)) n = new me(e.data);
166
- else if (S(e)) {
167
- let r = t ? Ee(e.children) : [], i = new ye(e.name, { ...e.attribs }, r);
164
+ if (be(e)) n = new fe(e.data);
165
+ else if (xe(e)) n = new pe(e.data);
166
+ else if (C(e)) {
167
+ let r = t ? Te(e.children) : [], i = new ve(e.name, { ...e.attribs }, r);
168
168
  r.forEach((e) => e.parent = i), e.namespace != null && (i.namespace = e.namespace), e["x-attribsNamespace"] && (i["x-attribsNamespace"] = { ...e["x-attribsNamespace"] }), e["x-attribsPrefix"] && (i["x-attribsPrefix"] = { ...e["x-attribsPrefix"] }), n = i;
169
- } else if (be(e)) {
170
- let r = t ? Ee(e.children) : [], i = new _e(r);
169
+ } else if (ye(e)) {
170
+ let r = t ? Te(e.children) : [], i = new ge(r);
171
171
  r.forEach((e) => e.parent = i), n = i;
172
- } else if (we(e)) {
173
- let r = t ? Ee(e.children) : [], i = new ve(r);
174
- r.forEach((e) => e.parent = i), e["x-mode"] && (i["x-mode"] = e["x-mode"]), n = i;
175
172
  } else if (Ce(e)) {
176
- let t = new he(e.name, e.data);
173
+ let r = t ? Te(e.children) : [], i = new _e(r);
174
+ r.forEach((e) => e.parent = i), e["x-mode"] && (i["x-mode"] = e["x-mode"]), n = i;
175
+ } else if (Se(e)) {
176
+ let t = new me(e.name, e.data);
177
177
  e["x-name"] != null && (t["x-name"] = e["x-name"], t["x-publicId"] = e["x-publicId"], t["x-systemId"] = e["x-systemId"]), n = t;
178
178
  } else throw Error(`Not implemented yet: ${e.type}`);
179
179
  return n.startIndex = e.startIndex, n.endIndex = e.endIndex, e.sourceCodeLocation != null && (n.sourceCodeLocation = e.sourceCodeLocation), n;
180
180
  }
181
- function Ee(e) {
182
- let t = e.map((e) => Te(e, !0));
181
+ function Te(e) {
182
+ let t = e.map((e) => we(e, !0));
183
183
  for (let e = 1; e < t.length; e++) t[e].prev = t[e - 1], t[e - 1].next = t[e];
184
184
  return t;
185
185
  }
186
186
  //#endregion
187
187
  //#region node_modules/domhandler/lib/esm/index.js
188
- var De = {
188
+ var Ee = {
189
189
  withStartIndices: !1,
190
190
  withEndIndices: !1,
191
191
  xmlMode: !1
192
- }, Oe = class {
192
+ }, De = class {
193
193
  constructor(e, t, n) {
194
- this.dom = [], this.root = new ve(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null, typeof t == "function" && (n = t, t = De), typeof e == "object" && (t = e, e = void 0), this.callback = e ?? null, this.options = t ?? De, this.elementCB = n ?? null;
194
+ this.dom = [], this.root = new _e(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null, typeof t == "function" && (n = t, t = Ee), typeof e == "object" && (t = e, e = void 0), this.callback = e ?? null, this.options = t ?? Ee, this.elementCB = n ?? null;
195
195
  }
196
196
  onparserinit(e) {
197
197
  this.parser = e;
198
198
  }
199
199
  onreset() {
200
- this.dom = [], this.root = new ve(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null;
200
+ this.dom = [], this.root = new _e(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null;
201
201
  }
202
202
  onend() {
203
203
  this.done || (this.done = !0, this.parser = null, this.handleCallback(null));
@@ -211,37 +211,37 @@ var De = {
211
211
  this.options.withEndIndices && (e.endIndex = this.parser.endIndex), this.elementCB && this.elementCB(e);
212
212
  }
213
213
  onopentag(e, t) {
214
- let n = new ye(e, t, void 0, this.options.xmlMode ? b.Tag : void 0);
214
+ let n = new ve(e, t, void 0, this.options.xmlMode ? x.Tag : void 0);
215
215
  this.addNode(n), this.tagStack.push(n);
216
216
  }
217
217
  ontext(e) {
218
218
  let { lastNode: t } = this;
219
- if (t && t.type === b.Text) t.data += e, this.options.withEndIndices && (t.endIndex = this.parser.endIndex);
219
+ if (t && t.type === x.Text) t.data += e, this.options.withEndIndices && (t.endIndex = this.parser.endIndex);
220
220
  else {
221
- let t = new pe(e);
221
+ let t = new fe(e);
222
222
  this.addNode(t), this.lastNode = t;
223
223
  }
224
224
  }
225
225
  oncomment(e) {
226
- if (this.lastNode && this.lastNode.type === b.Comment) {
226
+ if (this.lastNode && this.lastNode.type === x.Comment) {
227
227
  this.lastNode.data += e;
228
228
  return;
229
229
  }
230
- let t = new me(e);
230
+ let t = new pe(e);
231
231
  this.addNode(t), this.lastNode = t;
232
232
  }
233
233
  oncommentend() {
234
234
  this.lastNode = null;
235
235
  }
236
236
  oncdatastart() {
237
- let e = new pe(""), t = new _e([e]);
237
+ let e = new fe(""), t = new ge([e]);
238
238
  this.addNode(t), e.parent = t, this.lastNode = e;
239
239
  }
240
240
  oncdataend() {
241
241
  this.lastNode = null;
242
242
  }
243
243
  onprocessinginstruction(e, t) {
244
- let n = new he(e, t);
244
+ let n = new me(e, t);
245
245
  this.addNode(n);
246
246
  }
247
247
  handleCallback(e) {
@@ -252,38 +252,38 @@ var De = {
252
252
  let t = this.tagStack[this.tagStack.length - 1], n = t.children[t.children.length - 1];
253
253
  this.options.withStartIndices && (e.startIndex = this.parser.startIndex), this.options.withEndIndices && (e.endIndex = this.parser.endIndex), t.children.push(e), n && (e.prev = n, n.next = e), e.parent = t, this.lastNode = null;
254
254
  }
255
- }, ke = /["&'<>$\x80-\uFFFF]/g, Ae = /* @__PURE__ */ new Map([
255
+ }, Oe = /["&'<>$\x80-\uFFFF]/g, ke = /* @__PURE__ */ new Map([
256
256
  [34, "&quot;"],
257
257
  [38, "&amp;"],
258
258
  [39, "&apos;"],
259
259
  [60, "&lt;"],
260
260
  [62, "&gt;"]
261
- ]), je = String.prototype.codePointAt == null ? (e, t) => (e.charCodeAt(t) & 64512) == 55296 ? (e.charCodeAt(t) - 55296) * 1024 + e.charCodeAt(t + 1) - 56320 + 65536 : e.charCodeAt(t) : (e, t) => e.codePointAt(t);
262
- function Me(e) {
261
+ ]), Ae = String.prototype.codePointAt == null ? (e, t) => (e.charCodeAt(t) & 64512) == 55296 ? (e.charCodeAt(t) - 55296) * 1024 + e.charCodeAt(t + 1) - 56320 + 65536 : e.charCodeAt(t) : (e, t) => e.codePointAt(t);
262
+ function je(e) {
263
263
  let t = "", n = 0, r;
264
- for (; (r = ke.exec(e)) !== null;) {
265
- let i = r.index, a = e.charCodeAt(i), o = Ae.get(a);
266
- o === void 0 ? (t += `${e.substring(n, i)}&#x${je(e, i).toString(16)};`, n = ke.lastIndex += Number((a & 64512) == 55296)) : (t += e.substring(n, i) + o, n = i + 1);
264
+ for (; (r = Oe.exec(e)) !== null;) {
265
+ let i = r.index, a = e.charCodeAt(i), o = ke.get(a);
266
+ o === void 0 ? (t += `${e.substring(n, i)}&#x${Ae(e, i).toString(16)};`, n = Oe.lastIndex += Number((a & 64512) == 55296)) : (t += e.substring(n, i) + o, n = i + 1);
267
267
  }
268
268
  return t + e.substr(n);
269
269
  }
270
- function Ne(e, t) {
270
+ function Me(e, t) {
271
271
  return function(n) {
272
272
  let r, i = 0, a = "";
273
273
  for (; r = e.exec(n);) i !== r.index && (a += n.substring(i, r.index)), a += t.get(r[0].charCodeAt(0)), i = r.index + 1;
274
274
  return a + n.substring(i);
275
275
  };
276
276
  }
277
- var Pe = Ne(/["&\u00A0]/g, /* @__PURE__ */ new Map([
277
+ var Ne = Me(/["&\u00A0]/g, /* @__PURE__ */ new Map([
278
278
  [34, "&quot;"],
279
279
  [38, "&amp;"],
280
280
  [160, "&nbsp;"]
281
- ])), Fe = Ne(/[&<>\u00A0]/g, /* @__PURE__ */ new Map([
281
+ ])), Pe = Me(/[&<>\u00A0]/g, /* @__PURE__ */ new Map([
282
282
  [38, "&amp;"],
283
283
  [60, "&lt;"],
284
284
  [62, "&gt;"],
285
285
  [160, "&nbsp;"]
286
- ])), Ie = new Map((/* @__PURE__ */ "altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath".split(".")).map((e) => [e.toLowerCase(), e])), Le = new Map((/* @__PURE__ */ "definitionURL.attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan".split(".")).map((e) => [e.toLowerCase(), e])), Re = /* @__PURE__ */ new Set([
286
+ ])), Fe = new Map((/* @__PURE__ */ "altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath".split(".")).map((e) => [e.toLowerCase(), e])), Ie = new Map((/* @__PURE__ */ "definitionURL.attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan".split(".")).map((e) => [e.toLowerCase(), e])), Le = /* @__PURE__ */ new Set([
287
287
  "style",
288
288
  "script",
289
289
  "xmp",
@@ -293,18 +293,18 @@ var Pe = Ne(/["&\u00A0]/g, /* @__PURE__ */ new Map([
293
293
  "plaintext",
294
294
  "noscript"
295
295
  ]);
296
- function ze(e) {
296
+ function Re(e) {
297
297
  return e.replace(/"/g, "&quot;");
298
298
  }
299
- function Be(e, t) {
299
+ function ze(e, t) {
300
300
  if (!e) return;
301
- let n = (t.encodeEntities ?? t.decodeEntities) === !1 ? ze : t.xmlMode || t.encodeEntities !== "utf8" ? Me : Pe;
301
+ let n = (t.encodeEntities ?? t.decodeEntities) === !1 ? Re : t.xmlMode || t.encodeEntities !== "utf8" ? je : Ne;
302
302
  return Object.keys(e).map((r) => {
303
303
  let i = e[r] ?? "";
304
- return t.xmlMode === "foreign" && (r = Le.get(r) ?? r), !t.emptyAttrs && !t.xmlMode && i === "" ? r : `${r}="${n(i)}"`;
304
+ return t.xmlMode === "foreign" && (r = Ie.get(r) ?? r), !t.emptyAttrs && !t.xmlMode && i === "" ? r : `${r}="${n(i)}"`;
305
305
  }).join(" ");
306
306
  }
307
- var Ve = /* @__PURE__ */ new Set([
307
+ var Be = /* @__PURE__ */ new Set([
308
308
  "area",
309
309
  "base",
310
310
  "basefont",
@@ -325,25 +325,25 @@ var Ve = /* @__PURE__ */ new Set([
325
325
  "track",
326
326
  "wbr"
327
327
  ]);
328
- function He(e, t = {}) {
328
+ function Ve(e, t = {}) {
329
329
  let n = "length" in e ? e : [e], r = "";
330
- for (let e = 0; e < n.length; e++) r += Ue(n[e], t);
330
+ for (let e = 0; e < n.length; e++) r += He(n[e], t);
331
331
  return r;
332
332
  }
333
- function Ue(e, t) {
333
+ function He(e, t) {
334
334
  switch (e.type) {
335
- case ne: return He(e.children, t);
336
- case ue:
337
- case ie: return qe(e);
338
- case ae: return Xe(e);
339
- case le: return Ye(e);
335
+ case te: return Ve(e.children, t);
336
+ case le:
337
+ case re: return Ke(e);
338
+ case ie: return Ye(e);
339
+ case ce: return Je(e);
340
+ case ae:
340
341
  case oe:
341
- case se:
342
- case ce: return Ke(e, t);
343
- case re: return Je(e, t);
342
+ case se: return Ge(e, t);
343
+ case ne: return qe(e, t);
344
344
  }
345
345
  }
346
- var We = /* @__PURE__ */ new Set([
346
+ var Ue = /* @__PURE__ */ new Set([
347
347
  "mi",
348
348
  "mo",
349
349
  "mn",
@@ -353,93 +353,93 @@ var We = /* @__PURE__ */ new Set([
353
353
  "foreignObject",
354
354
  "desc",
355
355
  "title"
356
- ]), Ge = /* @__PURE__ */ new Set(["svg", "math"]);
357
- function Ke(e, t) {
358
- t.xmlMode === "foreign" && (e.name = Ie.get(e.name) ?? e.name, e.parent && We.has(e.parent.name) && (t = {
356
+ ]), We = /* @__PURE__ */ new Set(["svg", "math"]);
357
+ function Ge(e, t) {
358
+ t.xmlMode === "foreign" && (e.name = Fe.get(e.name) ?? e.name, e.parent && Ue.has(e.parent.name) && (t = {
359
359
  ...t,
360
360
  xmlMode: !1
361
- })), !t.xmlMode && Ge.has(e.name) && (t = {
361
+ })), !t.xmlMode && We.has(e.name) && (t = {
362
362
  ...t,
363
363
  xmlMode: "foreign"
364
364
  });
365
- let n = `<${e.name}`, r = Be(e.attribs, t);
366
- return r && (n += ` ${r}`), e.children.length === 0 && (t.xmlMode ? t.selfClosingTags !== !1 : t.selfClosingTags && Ve.has(e.name)) ? (t.xmlMode || (n += " "), n += "/>") : (n += ">", e.children.length > 0 && (n += He(e.children, t)), (t.xmlMode || !Ve.has(e.name)) && (n += `</${e.name}>`)), n;
365
+ let n = `<${e.name}`, r = ze(e.attribs, t);
366
+ return r && (n += ` ${r}`), e.children.length === 0 && (t.xmlMode ? t.selfClosingTags !== !1 : t.selfClosingTags && Be.has(e.name)) ? (t.xmlMode || (n += " "), n += "/>") : (n += ">", e.children.length > 0 && (n += Ve(e.children, t)), (t.xmlMode || !Be.has(e.name)) && (n += `</${e.name}>`)), n;
367
367
  }
368
- function qe(e) {
368
+ function Ke(e) {
369
369
  return `<${e.data}>`;
370
370
  }
371
- function Je(e, t) {
371
+ function qe(e, t) {
372
372
  let n = e.data || "";
373
- return (t.encodeEntities ?? t.decodeEntities) !== !1 && !(!t.xmlMode && e.parent && Re.has(e.parent.name)) && (n = t.xmlMode || t.encodeEntities !== "utf8" ? Me(n) : Fe(n)), n;
373
+ return (t.encodeEntities ?? t.decodeEntities) !== !1 && !(!t.xmlMode && e.parent && Le.has(e.parent.name)) && (n = t.xmlMode || t.encodeEntities !== "utf8" ? je(n) : Pe(n)), n;
374
374
  }
375
- function Ye(e) {
375
+ function Je(e) {
376
376
  return `<![CDATA[${e.children[0].data}]]>`;
377
377
  }
378
- function Xe(e) {
378
+ function Ye(e) {
379
379
  return `<!--${e.data}-->`;
380
380
  }
381
381
  //#endregion
382
382
  //#region node_modules/domutils/lib/esm/stringify.js
383
+ function Xe(e, t) {
384
+ return Ve(e, t);
385
+ }
383
386
  function Ze(e, t) {
384
- return He(e, t);
387
+ return w(e) ? e.children.map((e) => Xe(e, t)).join("") : "";
385
388
  }
386
- function Qe(e, t) {
387
- return C(e) ? e.children.map((e) => Ze(e, t)).join("") : "";
389
+ function Qe(e) {
390
+ return Array.isArray(e) ? e.map(Qe).join("") : C(e) ? e.name === "br" ? "\n" : Qe(e.children) : ye(e) ? Qe(e.children) : be(e) ? e.data : "";
388
391
  }
389
392
  function $e(e) {
390
- return Array.isArray(e) ? e.map($e).join("") : S(e) ? e.name === "br" ? "\n" : $e(e.children) : be(e) ? $e(e.children) : xe(e) ? e.data : "";
393
+ return Array.isArray(e) ? e.map($e).join("") : w(e) && !xe(e) ? $e(e.children) : be(e) ? e.data : "";
391
394
  }
392
395
  function et(e) {
393
- return Array.isArray(e) ? e.map(et).join("") : C(e) && !Se(e) ? et(e.children) : xe(e) ? e.data : "";
394
- }
395
- function tt(e) {
396
- return Array.isArray(e) ? e.map(tt).join("") : C(e) && (e.type === b.Tag || be(e)) ? tt(e.children) : xe(e) ? e.data : "";
396
+ return Array.isArray(e) ? e.map(et).join("") : w(e) && (e.type === x.Tag || ye(e)) ? et(e.children) : be(e) ? e.data : "";
397
397
  }
398
398
  //#endregion
399
399
  //#region node_modules/domutils/lib/esm/traversal.js
400
- function nt(e) {
401
- return C(e) ? e.children : [];
400
+ function tt(e) {
401
+ return w(e) ? e.children : [];
402
402
  }
403
- function rt(e) {
403
+ function nt(e) {
404
404
  return e.parent || null;
405
405
  }
406
- function it(e) {
407
- let t = rt(e);
408
- if (t != null) return nt(t);
406
+ function rt(e) {
407
+ let t = nt(e);
408
+ if (t != null) return tt(t);
409
409
  let n = [e], { prev: r, next: i } = e;
410
410
  for (; r != null;) n.unshift(r), {prev: r} = r;
411
411
  for (; i != null;) n.push(i), {next: i} = i;
412
412
  return n;
413
413
  }
414
- function at(e, t) {
414
+ function it(e, t) {
415
415
  return e.attribs?.[t];
416
416
  }
417
- function ot(e, t) {
417
+ function at(e, t) {
418
418
  return e.attribs != null && Object.prototype.hasOwnProperty.call(e.attribs, t) && e.attribs[t] != null;
419
419
  }
420
- function st(e) {
420
+ function ot(e) {
421
421
  return e.name;
422
422
  }
423
- function ct(e) {
423
+ function st(e) {
424
424
  let { next: t } = e;
425
- for (; t !== null && !S(t);) ({next: t} = t);
425
+ for (; t !== null && !C(t);) ({next: t} = t);
426
426
  return t;
427
427
  }
428
- function lt(e) {
428
+ function ct(e) {
429
429
  let { prev: t } = e;
430
- for (; t !== null && !S(t);) ({prev: t} = t);
430
+ for (; t !== null && !C(t);) ({prev: t} = t);
431
431
  return t;
432
432
  }
433
433
  //#endregion
434
434
  //#region node_modules/domutils/lib/esm/manipulation.js
435
- function ut(e) {
435
+ function lt(e) {
436
436
  if (e.prev && (e.prev.next = e.next), e.next && (e.next.prev = e.prev), e.parent) {
437
437
  let t = e.parent.children, n = t.lastIndexOf(e);
438
438
  n >= 0 && t.splice(n, 1);
439
439
  }
440
440
  e.next = null, e.prev = null, e.parent = null;
441
441
  }
442
- function dt(e, t) {
442
+ function ut(e, t) {
443
443
  let n = t.prev = e.prev;
444
444
  n && (n.next = t);
445
445
  let r = t.next = e.next;
@@ -450,14 +450,14 @@ function dt(e, t) {
450
450
  n[n.lastIndexOf(e)] = t, e.parent = null;
451
451
  }
452
452
  }
453
- function ft(e, t) {
454
- if (ut(t), t.next = null, t.parent = e, e.children.push(t) > 1) {
453
+ function dt(e, t) {
454
+ if (lt(t), t.next = null, t.parent = e, e.children.push(t) > 1) {
455
455
  let n = e.children[e.children.length - 2];
456
456
  n.next = t, t.prev = n;
457
457
  } else t.prev = null;
458
458
  }
459
- function pt(e, t) {
460
- ut(t);
459
+ function ft(e, t) {
460
+ lt(t);
461
461
  let { parent: n } = e, r = e.next;
462
462
  if (t.next = r, t.prev = e, e.next = t, t.parent = n, r) {
463
463
  if (r.prev = t, n) {
@@ -466,14 +466,14 @@ function pt(e, t) {
466
466
  }
467
467
  } else n && n.children.push(t);
468
468
  }
469
- function mt(e, t) {
470
- if (ut(t), t.parent = e, t.prev = null, e.children.unshift(t) !== 1) {
469
+ function pt(e, t) {
470
+ if (lt(t), t.parent = e, t.prev = null, e.children.unshift(t) !== 1) {
471
471
  let n = e.children[1];
472
472
  n.prev = t, t.next = n;
473
473
  } else t.next = null;
474
474
  }
475
- function ht(e, t) {
476
- ut(t);
475
+ function mt(e, t) {
476
+ lt(t);
477
477
  let { parent: n } = e;
478
478
  if (n) {
479
479
  let r = n.children;
@@ -483,10 +483,10 @@ function ht(e, t) {
483
483
  }
484
484
  //#endregion
485
485
  //#region node_modules/domutils/lib/esm/querying.js
486
- function gt(e, t, n = !0, r = Infinity) {
487
- return _t(e, Array.isArray(t) ? t : [t], n, r);
486
+ function ht(e, t, n = !0, r = Infinity) {
487
+ return gt(e, Array.isArray(t) ? t : [t], n, r);
488
488
  }
489
- function _t(e, t, n, r) {
489
+ function gt(e, t, n, r) {
490
490
  let i = [], a = [Array.isArray(t) ? t : [t]], o = [0];
491
491
  for (;;) {
492
492
  if (o[0] >= a[0].length) {
@@ -496,28 +496,28 @@ function _t(e, t, n, r) {
496
496
  }
497
497
  let t = a[0][o[0]++];
498
498
  if (e(t) && (i.push(t), --r <= 0)) return i;
499
- n && C(t) && t.children.length > 0 && (o.unshift(0), a.unshift(t.children));
499
+ n && w(t) && t.children.length > 0 && (o.unshift(0), a.unshift(t.children));
500
500
  }
501
501
  }
502
- function vt(e, t) {
502
+ function _t(e, t) {
503
503
  return t.find(e);
504
504
  }
505
- function yt(e, t, n = !0) {
505
+ function vt(e, t, n = !0) {
506
506
  let r = Array.isArray(t) ? t : [t];
507
507
  for (let t = 0; t < r.length; t++) {
508
508
  let i = r[t];
509
- if (S(i) && e(i)) return i;
510
- if (n && C(i) && i.children.length > 0) {
511
- let t = yt(e, i.children, !0);
509
+ if (C(i) && e(i)) return i;
510
+ if (n && w(i) && i.children.length > 0) {
511
+ let t = vt(e, i.children, !0);
512
512
  if (t) return t;
513
513
  }
514
514
  }
515
515
  return null;
516
516
  }
517
- function bt(e, t) {
518
- return (Array.isArray(t) ? t : [t]).some((t) => S(t) && e(t) || C(t) && bt(e, t.children));
517
+ function yt(e, t) {
518
+ return (Array.isArray(t) ? t : [t]).some((t) => C(t) && e(t) || w(t) && yt(e, t.children));
519
519
  }
520
- function xt(e, t) {
520
+ function bt(e, t) {
521
521
  let n = [], r = [Array.isArray(t) ? t : [t]], i = [0];
522
522
  for (;;) {
523
523
  if (i[0] >= r[0].length) {
@@ -526,58 +526,58 @@ function xt(e, t) {
526
526
  continue;
527
527
  }
528
528
  let t = r[0][i[0]++];
529
- S(t) && e(t) && n.push(t), C(t) && t.children.length > 0 && (i.unshift(0), r.unshift(t.children));
529
+ C(t) && e(t) && n.push(t), w(t) && t.children.length > 0 && (i.unshift(0), r.unshift(t.children));
530
530
  }
531
531
  }
532
532
  //#endregion
533
533
  //#region node_modules/domutils/lib/esm/legacy.js
534
- var St = {
534
+ var xt = {
535
535
  tag_name(e) {
536
- return typeof e == "function" ? (t) => S(t) && e(t.name) : e === "*" ? S : (t) => S(t) && t.name === e;
536
+ return typeof e == "function" ? (t) => C(t) && e(t.name) : e === "*" ? C : (t) => C(t) && t.name === e;
537
537
  },
538
538
  tag_type(e) {
539
539
  return typeof e == "function" ? (t) => e(t.type) : (t) => t.type === e;
540
540
  },
541
541
  tag_contains(e) {
542
- return typeof e == "function" ? (t) => xe(t) && e(t.data) : (t) => xe(t) && t.data === e;
542
+ return typeof e == "function" ? (t) => be(t) && e(t.data) : (t) => be(t) && t.data === e;
543
543
  }
544
544
  };
545
- function Ct(e, t) {
546
- return typeof t == "function" ? (n) => S(n) && t(n.attribs[e]) : (n) => S(n) && n.attribs[e] === t;
545
+ function St(e, t) {
546
+ return typeof t == "function" ? (n) => C(n) && t(n.attribs[e]) : (n) => C(n) && n.attribs[e] === t;
547
547
  }
548
- function wt(e, t) {
548
+ function Ct(e, t) {
549
549
  return (n) => e(n) || t(n);
550
550
  }
551
- function Tt(e) {
551
+ function wt(e) {
552
552
  let t = Object.keys(e).map((t) => {
553
553
  let n = e[t];
554
- return Object.prototype.hasOwnProperty.call(St, t) ? St[t](n) : Ct(t, n);
554
+ return Object.prototype.hasOwnProperty.call(xt, t) ? xt[t](n) : St(t, n);
555
555
  });
556
- return t.length === 0 ? null : t.reduce(wt);
556
+ return t.length === 0 ? null : t.reduce(Ct);
557
557
  }
558
- function Et(e, t) {
559
- let n = Tt(e);
560
- return n ? n(t) : !0;
558
+ function Tt(e, t) {
559
+ let n = wt(e);
560
+ return !n || n(t);
561
561
  }
562
- function Dt(e, t, n, r = Infinity) {
563
- let i = Tt(e);
564
- return i ? gt(i, t, n, r) : [];
562
+ function Et(e, t, n, r = Infinity) {
563
+ let i = wt(e);
564
+ return i ? ht(i, t, n, r) : [];
565
565
  }
566
- function Ot(e, t, n = !0) {
567
- return Array.isArray(t) || (t = [t]), yt(Ct("id", e), t, n);
566
+ function Dt(e, t, n = !0) {
567
+ return Array.isArray(t) || (t = [t]), vt(St("id", e), t, n);
568
+ }
569
+ function Ot(e, t, n = !0, r = Infinity) {
570
+ return ht(xt.tag_name(e), t, n, r);
568
571
  }
569
572
  function kt(e, t, n = !0, r = Infinity) {
570
- return gt(St.tag_name(e), t, n, r);
573
+ return ht(St("class", e), t, n, r);
571
574
  }
572
575
  function At(e, t, n = !0, r = Infinity) {
573
- return gt(Ct("class", e), t, n, r);
574
- }
575
- function jt(e, t, n = !0, r = Infinity) {
576
- return gt(St.tag_type(e), t, n, r);
576
+ return ht(xt.tag_type(e), t, n, r);
577
577
  }
578
578
  //#endregion
579
579
  //#region node_modules/domutils/lib/esm/helpers.js
580
- function Mt(e) {
580
+ function jt(e) {
581
581
  let t = e.length;
582
582
  for (; --t >= 0;) {
583
583
  let n = e[t];
@@ -592,26 +592,26 @@ function Mt(e) {
592
592
  }
593
593
  return e;
594
594
  }
595
- var w;
595
+ var Mt;
596
596
  (function(e) {
597
597
  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";
598
- })(w || (w = {}));
598
+ })(Mt || (Mt = {}));
599
599
  function Nt(e, t) {
600
600
  let n = [], r = [];
601
601
  if (e === t) return 0;
602
- let i = C(e) ? e : e.parent;
602
+ let i = w(e) ? e : e.parent;
603
603
  for (; i;) n.unshift(i), i = i.parent;
604
- for (i = C(t) ? t : t.parent; i;) r.unshift(i), i = i.parent;
604
+ for (i = w(t) ? t : t.parent; i;) r.unshift(i), i = i.parent;
605
605
  let a = Math.min(n.length, r.length), o = 0;
606
606
  for (; o < a && n[o] === r[o];) o++;
607
- if (o === 0) return w.DISCONNECTED;
607
+ if (o === 0) return Mt.DISCONNECTED;
608
608
  let s = n[o - 1], c = s.children, l = n[o], u = r[o];
609
- return c.indexOf(l) > c.indexOf(u) ? s === t ? w.FOLLOWING | w.CONTAINED_BY : w.FOLLOWING : s === e ? w.PRECEDING | w.CONTAINS : w.PRECEDING;
609
+ return c.indexOf(l) > c.indexOf(u) ? s === t ? Mt.FOLLOWING | Mt.CONTAINED_BY : Mt.FOLLOWING : s === e ? Mt.PRECEDING | Mt.CONTAINS : Mt.PRECEDING;
610
610
  }
611
611
  function Pt(e) {
612
612
  return e = e.filter((e, t, n) => !n.includes(e, t + 1)), e.sort((e, t) => {
613
613
  let n = Nt(e, t);
614
- return n & w.PRECEDING ? -1 : n & w.FOLLOWING ? 1 : 0;
614
+ return n & Mt.PRECEDING ? -1 : n & Mt.FOLLOWING ? 1 : 0;
615
615
  }), e;
616
616
  }
617
617
  //#endregion
@@ -623,7 +623,7 @@ function Ft(e) {
623
623
  function It(e) {
624
624
  let t = e.children, n = {
625
625
  type: "atom",
626
- items: kt("entry", t).map((e) => {
626
+ items: Ot("entry", t).map((e) => {
627
627
  let { children: t } = e, n = { media: Bt(t) };
628
628
  T(n, "id", "id", t), T(n, "title", "title", t);
629
629
  let r = Vt("link", t)?.attribs.href;
@@ -644,7 +644,7 @@ function Lt(e) {
644
644
  let t = Vt("channel", e.children)?.children ?? [], n = {
645
645
  type: e.name.substr(0, 3),
646
646
  id: "",
647
- items: kt("item", e.children).map((e) => {
647
+ items: Ot("item", e.children).map((e) => {
648
648
  let { children: t } = e, n = { media: Bt(t) };
649
649
  T(n, "id", "guid", t), T(n, "title", "title", t), T(n, "link", "link", t), T(n, "description", "description", t);
650
650
  let r = Ht("pubDate", t) || Ht("dc:date", t);
@@ -670,7 +670,7 @@ var Rt = [
670
670
  "width"
671
671
  ];
672
672
  function Bt(e) {
673
- return kt("media:content", e).map((e) => {
673
+ return Ot("media:content", e).map((e) => {
674
674
  let { attribs: t } = e, n = {
675
675
  medium: t.medium,
676
676
  isDefault: !!t.isDefault
@@ -681,10 +681,10 @@ function Bt(e) {
681
681
  });
682
682
  }
683
683
  function Vt(e, t) {
684
- return kt(e, t, !0, 1)[0];
684
+ return Ot(e, t, !0, 1)[0];
685
685
  }
686
686
  function Ht(e, t, n = !1) {
687
- return et(kt(e, t, n, 1)).trim();
687
+ return $e(Ot(e, t, n, 1)).trim();
688
688
  }
689
689
  function T(e, t, n, r, i = !1) {
690
690
  let a = Ht(n, r, i);
@@ -696,47 +696,47 @@ function Ut(e) {
696
696
  //#endregion
697
697
  //#region node_modules/domutils/lib/esm/index.js
698
698
  var Wt = /* @__PURE__ */ v({
699
- DocumentPosition: () => w,
700
- append: () => pt,
701
- appendChild: () => ft,
699
+ DocumentPosition: () => Mt,
700
+ append: () => ft,
701
+ appendChild: () => dt,
702
702
  compareDocumentPosition: () => Nt,
703
- existsOne: () => bt,
704
- filter: () => gt,
705
- find: () => _t,
706
- findAll: () => xt,
707
- findOne: () => yt,
708
- findOneChild: () => vt,
709
- getAttributeValue: () => at,
710
- getChildren: () => nt,
711
- getElementById: () => Ot,
712
- getElements: () => Dt,
713
- getElementsByClassName: () => At,
714
- getElementsByTagName: () => kt,
715
- getElementsByTagType: () => jt,
703
+ existsOne: () => yt,
704
+ filter: () => ht,
705
+ find: () => gt,
706
+ findAll: () => bt,
707
+ findOne: () => vt,
708
+ findOneChild: () => _t,
709
+ getAttributeValue: () => it,
710
+ getChildren: () => tt,
711
+ getElementById: () => Dt,
712
+ getElements: () => Et,
713
+ getElementsByClassName: () => kt,
714
+ getElementsByTagName: () => Ot,
715
+ getElementsByTagType: () => At,
716
716
  getFeed: () => Ft,
717
- getInnerHTML: () => Qe,
718
- getName: () => st,
719
- getOuterHTML: () => Ze,
720
- getParent: () => rt,
721
- getSiblings: () => it,
722
- getText: () => $e,
723
- hasAttrib: () => ot,
724
- hasChildren: () => C,
725
- innerText: () => tt,
726
- isCDATA: () => be,
727
- isComment: () => Se,
728
- isDocument: () => we,
729
- isTag: () => S,
730
- isText: () => xe,
731
- nextElementSibling: () => ct,
732
- prepend: () => ht,
733
- prependChild: () => mt,
734
- prevElementSibling: () => lt,
735
- removeElement: () => ut,
736
- removeSubsets: () => Mt,
737
- replaceElement: () => dt,
738
- testElement: () => Et,
739
- textContent: () => et,
717
+ getInnerHTML: () => Ze,
718
+ getName: () => ot,
719
+ getOuterHTML: () => Xe,
720
+ getParent: () => nt,
721
+ getSiblings: () => rt,
722
+ getText: () => Qe,
723
+ hasAttrib: () => at,
724
+ hasChildren: () => w,
725
+ innerText: () => et,
726
+ isCDATA: () => ye,
727
+ isComment: () => xe,
728
+ isDocument: () => Ce,
729
+ isTag: () => C,
730
+ isText: () => be,
731
+ nextElementSibling: () => st,
732
+ prepend: () => mt,
733
+ prependChild: () => pt,
734
+ prevElementSibling: () => ct,
735
+ removeElement: () => lt,
736
+ removeSubsets: () => jt,
737
+ replaceElement: () => ut,
738
+ testElement: () => Tt,
739
+ textContent: () => $e,
740
740
  uniqueSort: () => Pt
741
741
  }), Gt = { _useHtmlParser2: !1 };
742
742
  function Kt(e, t) {
@@ -782,10 +782,10 @@ function Zt(e) {
782
782
  }
783
783
  function Qt(e) {
784
784
  let t = e ?? (this ? this.root() : []), n = "";
785
- for (let e = 0; e < t.length; e++) n += et(t[e]);
785
+ for (let e = 0; e < t.length; e++) n += $e(t[e]);
786
786
  return n;
787
787
  }
788
- function $t(e, t, n = typeof t == "boolean" ? t : !1) {
788
+ function $t(e, t, n = typeof t == "boolean" && t) {
789
789
  if (!e || typeof e != "string") return null;
790
790
  typeof t == "boolean" && (n = t);
791
791
  let r = this.load(e, this._options, !1);
@@ -1189,7 +1189,7 @@ var M = {
1189
1189
  else if (e === A.Questionmark) this.state = j.InProcessingInstruction, this.sectionStart = this.index + 1;
1190
1190
  else if (this.isTagStartChar(e)) {
1191
1191
  let t = e | 32;
1192
- this.sectionStart = this.index, this.xmlMode ? this.state = j.InTagName : t === M.ScriptEnd[2] ? this.state = j.BeforeSpecialS : t === M.TitleEnd[2] || t === M.XmpEnd[2] ? this.state = j.BeforeSpecialT : this.state = j.InTagName;
1192
+ this.sectionStart = this.index, this.state = this.xmlMode ? j.InTagName : t === M.ScriptEnd[2] ? j.BeforeSpecialS : t === M.TitleEnd[2] || t === M.XmpEnd[2] ? j.BeforeSpecialT : j.InTagName;
1193
1193
  } else e === A.Slash ? this.state = j.BeforeClosingTagName : (this.state = j.Text, this.stateText(e));
1194
1194
  }
1195
1195
  stateInTagName(e) {
@@ -1363,9 +1363,7 @@ var M = {
1363
1363
  case j.InProcessingInstruction:
1364
1364
  this.stateInProcessingInstruction(e);
1365
1365
  break;
1366
- case j.InEntity:
1367
- this.stateInEntity();
1368
- break;
1366
+ case j.InEntity: this.stateInEntity();
1369
1367
  }
1370
1368
  this.index++;
1371
1369
  }
@@ -1645,7 +1643,7 @@ var M = {
1645
1643
  //#endregion
1646
1644
  //#region node_modules/htmlparser2/dist/esm/index.js
1647
1645
  function Bn(e, t) {
1648
- let n = new Oe(void 0, t);
1646
+ let n = new De(void 0, t);
1649
1647
  return new zn(n, t).end(e), n.root;
1650
1648
  }
1651
1649
  //#endregion
@@ -1662,7 +1660,7 @@ var Vn = /* @__PURE__ */ v({
1662
1660
  val: () => ir
1663
1661
  }), Hn = Object.hasOwn ?? ((e, t) => Object.prototype.hasOwnProperty.call(e, t)), Un = /\s+/, Wn = "data-", Gn = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, Kn = /^{[^]*}$|^\[[^]*]$/;
1664
1662
  function qn(e, t, n) {
1665
- if (!(!e || !S(e))) {
1663
+ if (!(!e || !C(e))) {
1666
1664
  if (e.attribs ?? (e.attribs = {}), !t) return e.attribs;
1667
1665
  if (Hn(e.attribs, t)) return !n && Gn.test(t) ? t : e.attribs[t];
1668
1666
  if (e.name === "option" && t === "value") return Qt(e.children);
@@ -1677,15 +1675,17 @@ function Yn(e, t) {
1677
1675
  if (typeof t == "function") {
1678
1676
  if (typeof e != "string") throw Error("Bad combination of arguments.");
1679
1677
  return E(this, (n, r) => {
1680
- S(n) && Jn(n, e, t.call(n, r, n.attribs[e]));
1678
+ C(n) && Jn(n, e, t.call(n, r, n.attribs[e]));
1681
1679
  });
1682
1680
  }
1683
1681
  return E(this, (n) => {
1684
- if (S(n)) if (typeof e == "object") for (let t of Object.keys(e)) {
1685
- let r = e[t];
1686
- Jn(n, t, r);
1682
+ if (C(n)) {
1683
+ if (typeof e == "object") for (let t of Object.keys(e)) {
1684
+ let r = e[t];
1685
+ Jn(n, t, r);
1686
+ }
1687
+ else Jn(n, e, t);
1687
1688
  }
1688
- else Jn(n, e, t);
1689
1689
  });
1690
1690
  }
1691
1691
  return arguments.length > 1 ? this : qn(this[0], e, this.options.xmlMode);
@@ -1707,33 +1707,35 @@ function Qn(e, t) {
1707
1707
  return e.length = t.length, e;
1708
1708
  }
1709
1709
  case "tagName":
1710
- case "nodeName": return S(t) ? t.name.toUpperCase() : void 0;
1710
+ case "nodeName": return C(t) ? t.name.toUpperCase() : void 0;
1711
1711
  case "href":
1712
1712
  case "src": {
1713
- if (!S(t)) return;
1713
+ if (!C(t)) return;
1714
1714
  let n = t.attribs?.[e];
1715
1715
  return typeof URL < "u" && (e === "href" && (t.tagName === "a" || t.tagName === "link") || e === "src" && (t.tagName === "img" || t.tagName === "iframe" || t.tagName === "audio" || t.tagName === "video" || t.tagName === "source")) && n !== void 0 && this.options.baseURI ? new URL(n, this.options.baseURI).href : n;
1716
1716
  }
1717
- case "innerText": return tt(t);
1718
- case "textContent": return et(t);
1719
- case "outerHTML": return t.type === ne ? this.html() : this.clone().wrap("<container />").parent().html();
1717
+ case "innerText": return et(t);
1718
+ case "textContent": return $e(t);
1719
+ case "outerHTML": return t.type === te ? this.html() : this.clone().wrap("<container />").parent().html();
1720
1720
  case "innerHTML": return this.html();
1721
- default: return S(t) ? Xn(t, e, this.options.xmlMode) : void 0;
1721
+ default: return C(t) ? Xn(t, e, this.options.xmlMode) : void 0;
1722
1722
  }
1723
1723
  }
1724
1724
  if (typeof e == "object" || t !== void 0) {
1725
1725
  if (typeof t == "function") {
1726
1726
  if (typeof e == "object") throw TypeError("Bad combination of arguments.");
1727
1727
  return E(this, (n, r) => {
1728
- S(n) && Zn(n, e, t.call(n, r, Xn(n, e, this.options.xmlMode)), this.options.xmlMode);
1728
+ C(n) && Zn(n, e, t.call(n, r, Xn(n, e, this.options.xmlMode)), this.options.xmlMode);
1729
1729
  });
1730
1730
  }
1731
1731
  return E(this, (n) => {
1732
- if (S(n)) if (typeof e == "object") for (let t of Object.keys(e)) {
1733
- let r = e[t];
1734
- Zn(n, t, r, this.options.xmlMode);
1732
+ if (C(n)) {
1733
+ if (typeof e == "object") for (let t of Object.keys(e)) {
1734
+ let r = e[t];
1735
+ Zn(n, t, r, this.options.xmlMode);
1736
+ }
1737
+ else Zn(n, e, t, this.options.xmlMode);
1735
1738
  }
1736
- else Zn(n, e, t, this.options.xmlMode);
1737
1739
  });
1738
1740
  }
1739
1741
  }
@@ -1766,15 +1768,15 @@ function nr(e) {
1766
1768
  }
1767
1769
  function rr(e, t) {
1768
1770
  let n = this[0];
1769
- if (!n || !S(n)) return;
1771
+ if (!n || !C(n)) return;
1770
1772
  let r = n;
1771
1773
  return r.data ?? (r.data = {}), e == null ? er(r) : typeof e == "object" || t !== void 0 ? (E(this, (n) => {
1772
- S(n) && (typeof e == "object" ? $n(n, e) : $n(n, e, t));
1774
+ C(n) && (typeof e == "object" ? $n(n, e) : $n(n, e, t));
1773
1775
  }), this) : tr(r, e);
1774
1776
  }
1775
1777
  function ir(e) {
1776
1778
  let t = arguments.length === 0, n = this[0];
1777
- if (!n || !S(n)) return t ? void 0 : this;
1779
+ if (!n || !C(n)) return t ? void 0 : this;
1778
1780
  switch (n.name) {
1779
1781
  case "textarea": return this.text(e);
1780
1782
  case "select": {
@@ -1802,13 +1804,13 @@ function or(e) {
1802
1804
  function sr(e) {
1803
1805
  let t = or(e);
1804
1806
  for (let e of t) E(this, (t) => {
1805
- S(t) && ar(t, e);
1807
+ C(t) && ar(t, e);
1806
1808
  });
1807
1809
  return this;
1808
1810
  }
1809
1811
  function cr(e) {
1810
1812
  return this.toArray().some((t) => {
1811
- let n = S(t) && t.attribs.class, r = -1;
1813
+ let n = C(t) && t.attribs.class, r = -1;
1812
1814
  if (n && e.length > 0) for (; (r = n.indexOf(e, r + 1)) > -1;) {
1813
1815
  let t = r + e.length;
1814
1816
  if ((r === 0 || Un.test(n[r - 1])) && (t === n.length || Un.test(n[t]))) return !0;
@@ -1818,7 +1820,7 @@ function cr(e) {
1818
1820
  }
1819
1821
  function lr(e) {
1820
1822
  if (typeof e == "function") return E(this, (t, n) => {
1821
- if (S(t)) {
1823
+ if (C(t)) {
1822
1824
  let r = t.attribs.class || "";
1823
1825
  lr.call([t], e.call(t, n, r));
1824
1826
  }
@@ -1827,7 +1829,7 @@ function lr(e) {
1827
1829
  let t = e.split(Un), n = this.length;
1828
1830
  for (let e = 0; e < n; e++) {
1829
1831
  let n = this[e];
1830
- if (!S(n)) continue;
1832
+ if (!C(n)) continue;
1831
1833
  let r = qn(n, "class", !1);
1832
1834
  if (r) {
1833
1835
  let e = ` ${r} `;
@@ -1842,30 +1844,32 @@ function lr(e) {
1842
1844
  }
1843
1845
  function ur(e) {
1844
1846
  if (typeof e == "function") return E(this, (t, n) => {
1845
- S(t) && ur.call([t], e.call(t, n, t.attribs.class || ""));
1847
+ C(t) && ur.call([t], e.call(t, n, t.attribs.class || ""));
1846
1848
  });
1847
1849
  let t = or(e), n = t.length, r = arguments.length === 0;
1848
1850
  return E(this, (e) => {
1849
- if (S(e)) if (r) e.attribs.class = "";
1850
- else {
1851
- let r = or(e.attribs.class), i = !1;
1852
- for (let e = 0; e < n; e++) {
1853
- let n = r.indexOf(t[e]);
1854
- n !== -1 && (r.splice(n, 1), i = !0, e--);
1851
+ if (C(e)) {
1852
+ if (r) e.attribs.class = "";
1853
+ else {
1854
+ let r = or(e.attribs.class), i = !1;
1855
+ for (let e = 0; e < n; e++) {
1856
+ let n = r.indexOf(t[e]);
1857
+ n !== -1 && (r.splice(n, 1), i = !0, e--);
1858
+ }
1859
+ i && (e.attribs.class = r.join(" "));
1855
1860
  }
1856
- i && (e.attribs.class = r.join(" "));
1857
1861
  }
1858
1862
  });
1859
1863
  }
1860
1864
  function dr(e, t) {
1861
1865
  if (typeof e == "function") return E(this, (n, r) => {
1862
- S(n) && dr.call([n], e.call(n, r, n.attribs.class || "", t), t);
1866
+ C(n) && dr.call([n], e.call(n, r, n.attribs.class || "", t), t);
1863
1867
  });
1864
1868
  if (!e || typeof e != "string") return this;
1865
1869
  let n = e.split(Un), r = n.length, i = typeof t == "boolean" ? t ? 1 : -1 : 0, a = this.length;
1866
1870
  for (let e = 0; e < a; e++) {
1867
1871
  let t = this[e];
1868
- if (!S(t)) continue;
1872
+ if (!C(t)) continue;
1869
1873
  let a = or(t.attribs.class);
1870
1874
  for (let e = 0; e < r; e++) {
1871
1875
  let t = a.indexOf(n[e]);
@@ -2057,16 +2061,18 @@ function Cr(e, t, n) {
2057
2061
  continue;
2058
2062
  }
2059
2063
  let e = i(1).toLowerCase(), a = null;
2060
- if (t.charCodeAt(n) === 40) if (hr.has(e)) {
2061
- if (br(t.charCodeAt(n + 1))) throw Error(`Pseudo-selector ${e} cannot be quoted`);
2062
- if (a = [], n = Cr(a, t, n + 1), t.charCodeAt(n) !== 41) throw Error(`Missing closing parenthesis in :${e} (${t})`);
2063
- n += 1;
2064
- } else {
2065
- if (a = o(), _r.has(e)) {
2066
- let e = a.charCodeAt(0);
2067
- e === a.charCodeAt(a.length - 1) && br(e) && (a = a.slice(1, -1));
2064
+ if (t.charCodeAt(n) === 40) {
2065
+ if (hr.has(e)) {
2066
+ if (br(t.charCodeAt(n + 1))) throw Error(`Pseudo-selector ${e} cannot be quoted`);
2067
+ if (a = [], n = Cr(a, t, n + 1), t.charCodeAt(n) !== 41) throw Error(`Missing closing parenthesis in :${e} (${t})`);
2068
+ n += 1;
2069
+ } else {
2070
+ if (a = o(), _r.has(e)) {
2071
+ let e = a.charCodeAt(0);
2072
+ e === a.charCodeAt(a.length - 1) && br(e) && (a = a.slice(1, -1));
2073
+ }
2074
+ a = yr(a);
2068
2075
  }
2069
- a = yr(a);
2070
2076
  }
2071
2077
  r.push({
2072
2078
  type: P.Pseudo,
@@ -2109,7 +2115,7 @@ function Cr(e, t, n) {
2109
2115
  }
2110
2116
  //#endregion
2111
2117
  //#region node_modules/css-select/lib/esm/sort.js
2112
- var I = /* @__PURE__ */ te((/* @__PURE__ */ _(((e, t) => {
2118
+ var I = /* @__PURE__ */ b((/* @__PURE__ */ _(((e, t) => {
2113
2119
  t.exports = {
2114
2120
  trueFunc: function() {
2115
2121
  return !0;
@@ -2580,8 +2586,10 @@ function ai(e, { adapter: t }, n) {
2580
2586
  return e === Kr || n && t.isTag(n);
2581
2587
  });
2582
2588
  for (let t of e) {
2583
- if (!(t.length > 0 && Tr(t[0]) && t[0].type !== P.Descendant)) if (r && !t.some(ti)) t.unshift(ni);
2584
- else continue;
2589
+ if (!(t.length > 0 && Tr(t[0]) && t[0].type !== P.Descendant)) {
2590
+ if (r && !t.some(ti)) t.unshift(ni);
2591
+ else continue;
2592
+ }
2585
2593
  t.unshift(ii);
2586
2594
  }
2587
2595
  }
@@ -2722,12 +2730,14 @@ function Di(e, t, n) {
2722
2730
  }
2723
2731
  for (let e = 0; e < i.length && a?.size !== t.length; e++) {
2724
2732
  let r = i[e];
2725
- if ((a ? t.filter((e) => S(e) && !a.has(e)) : t).length === 0) break;
2733
+ if ((a ? t.filter((e) => C(e) && !a.has(e)) : t).length === 0) break;
2726
2734
  let o = Oi(r, t, n);
2727
- if (o.length) if (a) o.forEach((e) => a.add(e));
2728
- else {
2729
- if (e === i.length - 1) return o;
2730
- a = new Set(o);
2735
+ if (o.length) {
2736
+ if (a) o.forEach((e) => a.add(e));
2737
+ else {
2738
+ if (e === i.length - 1) return o;
2739
+ a = new Set(o);
2740
+ }
2731
2741
  }
2732
2742
  }
2733
2743
  return a === void 0 ? [] : a.size === t.length ? t : t.filter((e) => a.has(e));
@@ -2751,7 +2761,7 @@ function ki(e, t, n = {}, r = Infinity) {
2751
2761
  function Ai(e, t, n, r, i) {
2752
2762
  let a = t.findIndex(_i), o = t.slice(0, a), s = t[a], c = t.length - 1 === a ? i : Infinity, l = vi(s.name, s.data, c);
2753
2763
  if (l === 0) return [];
2754
- let u = (o.length === 0 && !Array.isArray(e) ? nt(e).filter(S) : o.length === 0 ? (Array.isArray(e) ? e : [e]).filter(S) : r || o.some(gr) ? ji(e, [o], n, l) : Ni(e, [o], n)).slice(0, l), d = Ti(s.name, u, s.data, n);
2764
+ let u = (o.length === 0 && !Array.isArray(e) ? tt(e).filter(C) : o.length === 0 ? (Array.isArray(e) ? e : [e]).filter(C) : r || o.some(gr) ? ji(e, [o], n, l) : Ni(e, [o], n)).slice(0, l), d = Ti(s.name, u, s.data, n);
2755
2765
  if (d.length === 0 || t.length === a + 1) return d;
2756
2766
  let f = t.slice(a + 1), p = f.some(gr);
2757
2767
  if (p) {
@@ -2774,10 +2784,10 @@ function ji(e, t, n, r) {
2774
2784
  return Mi(e, pi(t, n, e), r);
2775
2785
  }
2776
2786
  function Mi(e, t, n = Infinity) {
2777
- return _t((e) => S(e) && t(e), mi(e, Wt, t.shouldTestNextSiblings), !0, n);
2787
+ return gt((e) => C(e) && t(e), mi(e, Wt, t.shouldTestNextSiblings), !0, n);
2778
2788
  }
2779
2789
  function Ni(e, t, n) {
2780
- let r = (Array.isArray(e) ? e : [e]).filter(S);
2790
+ let r = (Array.isArray(e) ? e : [e]).filter(C);
2781
2791
  if (r.length === 0) return r;
2782
2792
  let i = pi(t, n);
2783
2793
  return i === I.trueFunc ? r : r.filter(i);
@@ -2877,11 +2887,11 @@ function Vi(e, ...t) {
2877
2887
  function Hi(e) {
2878
2888
  return e.length > 1 ? Array.from(new Set(e)) : e;
2879
2889
  }
2880
- var Ui = Bi(({ parent: e }) => e && !we(e) ? e : null, Hi), Wi = zi((e) => {
2890
+ var Ui = Bi(({ parent: e }) => e && !Ce(e) ? e : null, Hi), Wi = zi((e) => {
2881
2891
  let t = [];
2882
- for (; e.parent && !we(e.parent);) t.push(e.parent), e = e.parent;
2892
+ for (; e.parent && !Ce(e.parent);) t.push(e.parent), e = e.parent;
2883
2893
  return t;
2884
- }, Pt, (e) => e.reverse()), Gi = Vi(({ parent: e }) => e && !we(e) ? e : null, Pt, (e) => e.reverse());
2894
+ }, Pt, (e) => e.reverse()), Gi = Vi(({ parent: e }) => e && !Ce(e) ? e : null, Pt, (e) => e.reverse());
2885
2895
  function Ki(e) {
2886
2896
  let t = [];
2887
2897
  if (!e) return this._make(t);
@@ -2890,7 +2900,7 @@ function Ki(e) {
2890
2900
  root: this._root?.[0]
2891
2901
  }, r = typeof e == "string" ? (t) => Ci(t, e, n) : ia(e);
2892
2902
  return E(this, (e) => {
2893
- for (e && !we(e) && !S(e) && (e = e.parent); e && S(e);) {
2903
+ for (e && !Ce(e) && !C(e) && (e = e.parent); e && C(e);) {
2894
2904
  if (r(e, 0)) {
2895
2905
  t.includes(e) || t.push(e);
2896
2906
  break;
@@ -2899,17 +2909,17 @@ function Ki(e) {
2899
2909
  }
2900
2910
  }), this._make(t);
2901
2911
  }
2902
- var qi = Bi((e) => ct(e)), Ji = zi((e) => {
2912
+ var qi = Bi((e) => st(e)), Ji = zi((e) => {
2903
2913
  let t = [];
2904
- for (; e.next;) e = e.next, S(e) && t.push(e);
2914
+ for (; e.next;) e = e.next, C(e) && t.push(e);
2905
2915
  return t;
2906
- }, Hi), Yi = Vi((e) => ct(e), Hi), Xi = Bi((e) => lt(e)), Zi = zi((e) => {
2916
+ }, Hi), Yi = Vi((e) => st(e), Hi), Xi = Bi((e) => ct(e)), Zi = zi((e) => {
2907
2917
  let t = [];
2908
- for (; e.prev;) e = e.prev, S(e) && t.push(e);
2918
+ for (; e.prev;) e = e.prev, C(e) && t.push(e);
2909
2919
  return t;
2910
- }, Hi), Qi = Vi((e) => lt(e), Hi), $i = zi((e) => it(e).filter((t) => S(t) && t !== e), Pt), ea = zi((e) => nt(e).filter(S), Hi);
2920
+ }, Hi), Qi = Vi((e) => ct(e), Hi), $i = zi((e) => rt(e).filter((t) => C(t) && t !== e), Pt), ea = zi((e) => tt(e).filter(C), Hi);
2911
2921
  function ta() {
2912
- let e = this.toArray().reduce((e, t) => C(t) ? e.concat(t.children) : e, []);
2922
+ let e = this.toArray().reduce((e, t) => w(t) ? e.concat(t.children) : e, []);
2913
2923
  return this._make(e);
2914
2924
  }
2915
2925
  function na(e) {
@@ -2941,7 +2951,7 @@ function oa(e, t, n, r) {
2941
2951
  }
2942
2952
  function sa(e) {
2943
2953
  let t = this.toArray();
2944
- return typeof e == "string" ? wi(t.filter(S), e, this.options) : e ? t.some(ia(e)) : !1;
2954
+ return typeof e == "string" ? wi(t.filter(C), e, this.options) : e ? t.some(ia(e)) : !1;
2945
2955
  }
2946
2956
  function ca(e) {
2947
2957
  let t = this.toArray();
@@ -2995,8 +3005,8 @@ function ba(e) {
2995
3005
  return function(t, n, r, i) {
2996
3006
  if (typeof Buffer < "u" && Buffer.isBuffer(t) && (t = t.toString()), typeof t == "string") return e(t, n, r, i);
2997
3007
  let a = t;
2998
- if (!Array.isArray(a) && we(a)) return a;
2999
- let o = new ve([]);
3008
+ if (!Array.isArray(a) && Ce(a)) return a;
3009
+ let o = new _e([]);
3000
3010
  return xa(a, o), o;
3001
3011
  };
3002
3012
  }
@@ -3005,7 +3015,7 @@ function xa(e, t) {
3005
3015
  t ? t.children = n : t = null;
3006
3016
  for (let e = 0; e < n.length; e++) {
3007
3017
  let r = n[e];
3008
- r.parent && r.parent.children !== n && ut(r), t ? (r.prev = n[e - 1] || null, r.next = n[e + 1] || null) : r.prev = r.next = null, r.parent = t;
3018
+ r.parent && r.parent.children !== n && lt(r), t ? (r.prev = n[e - 1] || null, r.next = n[e + 1] || null) : r.prev = r.next = null, r.parent = t;
3009
3019
  }
3010
3020
  return t;
3011
3021
  }
@@ -3044,7 +3054,7 @@ function Ca(e, t) {
3044
3054
  if (typeof i == "object") {
3045
3055
  if (i == null) continue;
3046
3056
  if (!("length" in i)) {
3047
- n.push(t ? Te(i, !0) : i);
3057
+ n.push(t ? we(i, !0) : i);
3048
3058
  continue;
3049
3059
  }
3050
3060
  }
@@ -3052,13 +3062,13 @@ function Ca(e, t) {
3052
3062
  }
3053
3063
  return n;
3054
3064
  }
3055
- return [t ? Te(e, !0) : e];
3065
+ return [t ? we(e, !0) : e];
3056
3066
  }
3057
3067
  function wa(e) {
3058
3068
  return function(...t) {
3059
3069
  let n = this.length - 1;
3060
3070
  return E(this, (r, i) => {
3061
- if (!C(r)) return;
3071
+ if (!w(r)) return;
3062
3072
  let a = typeof t[0] == "function" ? t[0].call(r, i, this._render(r.children)) : t;
3063
3073
  e(this._makeDomArray(a, i < n), r.children, r);
3064
3074
  });
@@ -3096,11 +3106,11 @@ function Aa(e) {
3096
3106
  let n = this.length - 1, r = this.parents().last();
3097
3107
  for (let i = 0; i < this.length; i++) {
3098
3108
  let a = this[i], o = typeof t == "function" ? t.call(a, i, a) : typeof t == "string" && !un(t) ? r.find(t).clone() : t, [s] = this._makeDomArray(o, i < n);
3099
- if (!s || !C(s)) continue;
3109
+ if (!s || !w(s)) continue;
3100
3110
  let c = s, l = 0;
3101
3111
  for (; l < c.children.length;) {
3102
3112
  let e = c.children[l];
3103
- S(e) ? (c = e, l = 0) : l++;
3113
+ C(e) ? (c = e, l = 0) : l++;
3104
3114
  }
3105
3115
  e(a, c, [s]);
3106
3116
  }
@@ -3113,7 +3123,7 @@ var ja = Aa((e, t, n) => {
3113
3123
  let i = r.children, a = i.indexOf(e);
3114
3124
  xa([e], t), Ta(i, a, 0, n, r);
3115
3125
  }), Ma = Aa((e, t, n) => {
3116
- C(e) && (xa(e.children, t), xa(n, e));
3126
+ w(e) && (xa(e.children, t), xa(n, e));
3117
3127
  });
3118
3128
  function Na(e) {
3119
3129
  return this.parent(e).not("body").each((e, t) => {
@@ -3124,11 +3134,11 @@ function Pa(e) {
3124
3134
  let t = this[0];
3125
3135
  if (t) {
3126
3136
  let n = this._make(typeof e == "function" ? e.call(t, 0, t) : e).insertBefore(t), r;
3127
- for (let e = 0; e < n.length; e++) n[e].type === ce && (r = n[e]);
3137
+ for (let e = 0; e < n.length; e++) n[e].type === se && (r = n[e]);
3128
3138
  let i = 0;
3129
3139
  for (; r && i < r.children.length;) {
3130
3140
  let e = r.children[i];
3131
- e.type === ce ? (r = e, i = 0) : i++;
3141
+ e.type === se ? (r = e, i = 0) : i++;
3132
3142
  }
3133
3143
  r && this._make(r).append(this);
3134
3144
  }
@@ -3137,7 +3147,7 @@ function Pa(e) {
3137
3147
  function Fa(...e) {
3138
3148
  let t = this.length - 1;
3139
3149
  return E(this, (n, r) => {
3140
- if (!C(n) || !n.parent) return;
3150
+ if (!w(n) || !n.parent) return;
3141
3151
  let i = n.parent.children, a = i.indexOf(n);
3142
3152
  /* istanbul ignore next */
3143
3153
  if (a === -1) return;
@@ -3159,7 +3169,7 @@ function Ia(e) {
3159
3169
  function La(...e) {
3160
3170
  let t = this.length - 1;
3161
3171
  return E(this, (n, r) => {
3162
- if (!C(n) || !n.parent) return;
3172
+ if (!w(n) || !n.parent) return;
3163
3173
  let i = n.parent.children, a = i.indexOf(n);
3164
3174
  /* istanbul ignore next */
3165
3175
  if (a === -1) return;
@@ -3180,7 +3190,7 @@ function Ra(e) {
3180
3190
  }
3181
3191
  function za(e) {
3182
3192
  return E(e ? this.filter(e) : this, (e) => {
3183
- ut(e), e.prev = e.next = e.parent = null;
3193
+ lt(e), e.prev = e.next = e.parent = null;
3184
3194
  }), this;
3185
3195
  }
3186
3196
  function Ba(e) {
@@ -3193,7 +3203,7 @@ function Ba(e) {
3193
3203
  }
3194
3204
  function Va() {
3195
3205
  return E(this, (e) => {
3196
- if (C(e)) {
3206
+ if (w(e)) {
3197
3207
  for (let t of e.children) t.next = t.prev = t.parent = null;
3198
3208
  e.children.length = 0;
3199
3209
  }
@@ -3202,10 +3212,10 @@ function Va() {
3202
3212
  function Ha(e) {
3203
3213
  if (e === void 0) {
3204
3214
  let e = this[0];
3205
- return !e || !C(e) ? null : this._render(e.children);
3215
+ return !e || !w(e) ? null : this._render(e.children);
3206
3216
  }
3207
3217
  return E(this, (t) => {
3208
- if (C(t)) {
3218
+ if (w(t)) {
3209
3219
  for (let e of t.children) e.next = e.prev = e.parent = null;
3210
3220
  xa(on(e) ? e.toArray() : this._parse(`${e}`, this.options, !1, t).children, t);
3211
3221
  }
@@ -3216,14 +3226,14 @@ function Ua() {
3216
3226
  }
3217
3227
  function Wa(e) {
3218
3228
  return e === void 0 ? Qt(this) : typeof e == "function" ? E(this, (t, n) => this._make(t).text(e.call(t, n, Qt([t])))) : E(this, (t) => {
3219
- if (C(t)) {
3229
+ if (w(t)) {
3220
3230
  for (let e of t.children) e.next = e.prev = e.parent = null;
3221
- xa(new pe(`${e}`), t);
3231
+ xa(new fe(`${e}`), t);
3222
3232
  }
3223
3233
  });
3224
3234
  }
3225
3235
  function Ga() {
3226
- let e = Array.prototype.map.call(this.get(), (e) => Te(e, !0)), t = new ve(e);
3236
+ let e = Array.prototype.map.call(this.get(), (e) => we(e, !0)), t = new _e(e);
3227
3237
  for (let n of e) n.parent = t;
3228
3238
  return this._make(e);
3229
3239
  }
@@ -3232,7 +3242,7 @@ function Ga() {
3232
3242
  var Ka = /* @__PURE__ */ v({ css: () => qa });
3233
3243
  function qa(e, t) {
3234
3244
  if (e != null && t != null || typeof e == "object" && !Array.isArray(e)) return E(this, (n, r) => {
3235
- S(n) && Ja(n, e, t, r);
3245
+ C(n) && Ja(n, e, t, r);
3236
3246
  });
3237
3247
  if (this.length !== 0) return Ya(this[0], e);
3238
3248
  }
@@ -3249,7 +3259,7 @@ function Ja(e, t, n, r) {
3249
3259
  }
3250
3260
  }
3251
3261
  function Ya(e, t) {
3252
- if (!e || !S(e)) return;
3262
+ if (!e || !C(e)) return;
3253
3263
  let n = Za(e.attribs.style);
3254
3264
  if (typeof t == "string") return n[t];
3255
3265
  if (Array.isArray(t)) {
@@ -3286,7 +3296,7 @@ function no() {
3286
3296
  function ro() {
3287
3297
  return this.map((e, t) => {
3288
3298
  let n = this._make(t);
3289
- return S(t) && t.name === "form" ? n.find($a).toArray() : n.filter($a).toArray();
3299
+ return C(t) && t.name === "form" ? n.find($a).toArray() : n.filter($a).toArray();
3290
3300
  }).filter("[name!=\"\"]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))").map((e, t) => {
3291
3301
  let n = this._make(t), r = n.attr("name"), i = n.val() ?? "";
3292
3302
  return Array.isArray(i) ? i.map((e) => ({
@@ -3371,7 +3381,7 @@ function co(e, t) {
3371
3381
  };
3372
3382
  }
3373
3383
  function lo(e) {
3374
- return !!e.name || e.type === ne || e.type === re || e.type === ae;
3384
+ return !!e.name || e.type === te || e.type === ne || e.type === ie;
3375
3385
  }
3376
3386
  //#endregion
3377
3387
  //#region node_modules/parse5/dist/common/unicode.js
@@ -4155,9 +4165,7 @@ var Jo = class {
4155
4165
  case B.NULL_CHARACTER:
4156
4166
  this.handler.onNullCharacter(this.currentCharacterToken);
4157
4167
  break;
4158
- case B.WHITESPACE_CHARACTER:
4159
- this.handler.onWhitespaceCharacter(this.currentCharacterToken);
4160
- break;
4168
+ case B.WHITESPACE_CHARACTER: this.handler.onWhitespaceCharacter(this.currentCharacterToken);
4161
4169
  }
4162
4170
  this.currentCharacterToken = null;
4163
4171
  }
@@ -4170,10 +4178,13 @@ var Jo = class {
4170
4178
  }), this.active = !1;
4171
4179
  }
4172
4180
  _appendCharToCurrentCharacterToken(e, t) {
4173
- if (this.currentCharacterToken) if (this.currentCharacterToken.type === e) {
4174
- this.currentCharacterToken.chars += t;
4175
- return;
4176
- } else this.currentLocation = this.getCurrentLocation(0), this._emitCurrentCharacterToken(this.currentLocation), this.preprocessor.dropParsedChunk();
4181
+ if (this.currentCharacterToken) {
4182
+ if (this.currentCharacterToken.type === e) {
4183
+ this.currentCharacterToken.chars += t;
4184
+ return;
4185
+ }
4186
+ this.currentLocation = this.getCurrentLocation(0), this._emitCurrentCharacterToken(this.currentLocation), this.preprocessor.dropParsedChunk();
4187
+ }
4177
4188
  this._createCharacterToken(e, t);
4178
4189
  }
4179
4190
  _emitCodePoint(e) {
@@ -5358,10 +5369,7 @@ var Jo = class {
5358
5369
  case L.NULL:
5359
5370
  this._err(z.unexpectedNullCharacter);
5360
5371
  break;
5361
- case L.EOF:
5362
- this.emitCurrentDoctype(t), this._emitEOFToken();
5363
- break;
5364
- default:
5372
+ case L.EOF: this.emitCurrentDoctype(t), this._emitEOFToken();
5365
5373
  }
5366
5374
  }
5367
5375
  _stateCdataSection(e) {
@@ -5391,10 +5399,12 @@ var Jo = class {
5391
5399
  }
5392
5400
  _stateCharacterReference() {
5393
5401
  let e = this.entityDecoder.write(this.preprocessor.html, this.preprocessor.pos);
5394
- if (e < 0) if (this.preprocessor.lastChunkWritten) e = this.entityDecoder.end();
5395
- else {
5396
- this.active = !1, this.preprocessor.pos = this.preprocessor.html.length - 1, this.consumedAfterSnapshot = 0, this.preprocessor.endOfChunkHit = !0;
5397
- return;
5402
+ if (e < 0) {
5403
+ if (this.preprocessor.lastChunkWritten) e = this.entityDecoder.end();
5404
+ else {
5405
+ this.active = !1, this.preprocessor.pos = this.preprocessor.html.length - 1, this.consumedAfterSnapshot = 0, this.preprocessor.endOfChunkHit = !0;
5406
+ return;
5407
+ }
5398
5408
  }
5399
5409
  e === 0 ? (this.preprocessor.pos = this.entityStartPos, this._flushCodePointConsumedAsCharacterReference(L.AMPERSAND), this.state = !this._isCharacterReferenceInAttribute() && Uo(this.preprocessor.peek(1)) ? J.AMBIGUOUS_AMPERSAND : this.returnState) : this.state = this.returnState;
5400
5410
  }
@@ -5567,9 +5577,7 @@ var Jo = class {
5567
5577
  case U.SVG:
5568
5578
  if (ts.has(r)) return !1;
5569
5579
  break;
5570
- case U.MATHML:
5571
- if (es.has(r)) return !1;
5572
- break;
5580
+ case U.MATHML: if (es.has(r)) return !1;
5573
5581
  }
5574
5582
  }
5575
5583
  return !0;
@@ -5594,9 +5602,7 @@ var Jo = class {
5594
5602
  case U.SVG:
5595
5603
  if (ts.has(t)) return !1;
5596
5604
  break;
5597
- case U.MATHML:
5598
- if (es.has(t)) return !1;
5599
- break;
5605
+ case U.MATHML: if (es.has(t)) return !1;
5600
5606
  }
5601
5607
  }
5602
5608
  return !0;
@@ -6148,10 +6154,7 @@ var Vs = {
6148
6154
  case K.SCRIPT:
6149
6155
  this.tokenizer.state = Y.SCRIPT_DATA;
6150
6156
  break;
6151
- case K.PLAINTEXT:
6152
- this.tokenizer.state = Y.PLAINTEXT;
6153
- break;
6154
- default:
6157
+ case K.PLAINTEXT: this.tokenizer.state = Y.PLAINTEXT;
6155
6158
  }
6156
6159
  }
6157
6160
  _setDocumentType(e) {
@@ -6258,9 +6261,7 @@ var Vs = {
6258
6261
  case B.EOF:
6259
6262
  this.onEof(e);
6260
6263
  break;
6261
- case B.WHITESPACE_CHARACTER:
6262
- this.onWhitespaceCharacter(e);
6263
- break;
6264
+ case B.WHITESPACE_CHARACTER: this.onWhitespaceCharacter(e);
6264
6265
  }
6265
6266
  }
6266
6267
  _isIntegrationPoint(e, t, n) {
@@ -6323,12 +6324,10 @@ var Vs = {
6323
6324
  return;
6324
6325
  }
6325
6326
  break;
6326
- case K.HEAD:
6327
- if (e > 0) {
6328
- this.insertionMode = X.IN_HEAD;
6329
- return;
6330
- }
6331
- break;
6327
+ case K.HEAD: if (e > 0) {
6328
+ this.insertionMode = X.IN_HEAD;
6329
+ return;
6330
+ }
6332
6331
  }
6333
6332
  this.insertionMode = X.IN_BODY;
6334
6333
  }
@@ -6369,7 +6368,6 @@ var Vs = {
6369
6368
  beforeElement: null
6370
6369
  };
6371
6370
  }
6372
- default:
6373
6371
  }
6374
6372
  }
6375
6373
  return {
@@ -6433,10 +6431,7 @@ var Vs = {
6433
6431
  case X.AFTER_BODY:
6434
6432
  Ql(this, e);
6435
6433
  break;
6436
- case X.AFTER_AFTER_BODY:
6437
- iu(this, e);
6438
- break;
6439
- default:
6434
+ case X.AFTER_AFTER_BODY: iu(this, e);
6440
6435
  }
6441
6436
  }
6442
6437
  onNullCharacter(e) {
@@ -6477,10 +6472,7 @@ var Vs = {
6477
6472
  case X.AFTER_BODY:
6478
6473
  Ql(this, e);
6479
6474
  break;
6480
- case X.AFTER_AFTER_BODY:
6481
- iu(this, e);
6482
- break;
6483
- default:
6475
+ case X.AFTER_AFTER_BODY: iu(this, e);
6484
6476
  }
6485
6477
  }
6486
6478
  onComment(e) {
@@ -6516,10 +6508,7 @@ var Vs = {
6516
6508
  $s(this, e);
6517
6509
  break;
6518
6510
  case X.AFTER_AFTER_BODY:
6519
- case X.AFTER_AFTER_FRAMESET:
6520
- ec(this, e);
6521
- break;
6522
- default:
6511
+ case X.AFTER_AFTER_FRAMESET: ec(this, e);
6523
6512
  }
6524
6513
  }
6525
6514
  onDoctype(e) {
@@ -6533,10 +6522,7 @@ var Vs = {
6533
6522
  case X.AFTER_HEAD:
6534
6523
  this._err(e, z.misplacedDoctype);
6535
6524
  break;
6536
- case X.IN_TABLE_TEXT:
6537
- Al(this, e);
6538
- break;
6539
- default:
6525
+ case X.IN_TABLE_TEXT: Al(this, e);
6540
6526
  }
6541
6527
  }
6542
6528
  onStartTag(e) {
@@ -6610,10 +6596,7 @@ var Vs = {
6610
6596
  case X.AFTER_AFTER_BODY:
6611
6597
  ru(this, e);
6612
6598
  break;
6613
- case X.AFTER_AFTER_FRAMESET:
6614
- au(this, e);
6615
- break;
6616
- default:
6599
+ case X.AFTER_AFTER_FRAMESET: au(this, e);
6617
6600
  }
6618
6601
  }
6619
6602
  onEndTag(e) {
@@ -6684,10 +6667,7 @@ var Vs = {
6684
6667
  case X.AFTER_FRAMESET:
6685
6668
  nu(this, e);
6686
6669
  break;
6687
- case X.AFTER_AFTER_BODY:
6688
- iu(this, e);
6689
- break;
6690
- default:
6670
+ case X.AFTER_AFTER_BODY: iu(this, e);
6691
6671
  }
6692
6672
  }
6693
6673
  onEof(e) {
@@ -6734,10 +6714,7 @@ var Vs = {
6734
6714
  case X.IN_FRAMESET:
6735
6715
  case X.AFTER_FRAMESET:
6736
6716
  case X.AFTER_AFTER_BODY:
6737
- case X.AFTER_AFTER_FRAMESET:
6738
- tc(this, e);
6739
- break;
6740
- default:
6717
+ case X.AFTER_AFTER_FRAMESET: tc(this, e);
6741
6718
  }
6742
6719
  }
6743
6720
  onWhitespaceCharacter(e) {
@@ -6775,10 +6752,7 @@ var Vs = {
6775
6752
  case X.IN_ROW:
6776
6753
  gl(this, e);
6777
6754
  break;
6778
- case X.IN_TABLE_TEXT:
6779
- Ol(this, e);
6780
- break;
6781
- default:
6755
+ case X.IN_TABLE_TEXT: Ol(this, e);
6782
6756
  }
6783
6757
  }
6784
6758
  };
@@ -7042,10 +7016,7 @@ function bc(e, t) {
7042
7016
  case B.END_TAG:
7043
7017
  fl(e, t);
7044
7018
  break;
7045
- case B.EOF:
7046
- pl(e, t);
7047
- break;
7048
- default:
7019
+ case B.EOF: pl(e, t);
7049
7020
  }
7050
7021
  }
7051
7022
  function xc(e, t) {
@@ -7492,9 +7463,7 @@ function gl(e, t) {
7492
7463
  case B.CHARACTER:
7493
7464
  kl(e, t);
7494
7465
  break;
7495
- case B.WHITESPACE_CHARACTER:
7496
- Ol(e, t);
7497
- break;
7466
+ case B.WHITESPACE_CHARACTER: Ol(e, t);
7498
7467
  }
7499
7468
  else Dl(e, t);
7500
7469
  }
@@ -7792,10 +7761,7 @@ function Ul(e, t) {
7792
7761
  e.openElements.hasInSelectScope(K.SELECT) && (e.openElements.popUntilTagNamePopped(K.SELECT), e._resetInsertionMode(), t.tagID !== K.SELECT && e._processStartTag(t));
7793
7762
  break;
7794
7763
  case K.SCRIPT:
7795
- case K.TEMPLATE:
7796
- uc(e, t);
7797
- break;
7798
- default:
7764
+ case K.TEMPLATE: uc(e, t);
7799
7765
  }
7800
7766
  }
7801
7767
  function Wl(e, t) {
@@ -7809,10 +7775,7 @@ function Wl(e, t) {
7809
7775
  case K.SELECT:
7810
7776
  e.openElements.hasInSelectScope(K.SELECT) && (e.openElements.popUntilTagNamePopped(K.SELECT), e._resetInsertionMode());
7811
7777
  break;
7812
- case K.TEMPLATE:
7813
- fc(e, t);
7814
- break;
7815
- default:
7778
+ case K.TEMPLATE: fc(e, t);
7816
7779
  }
7817
7780
  }
7818
7781
  function Gl(e, t) {
@@ -7889,10 +7852,7 @@ function $l(e, t) {
7889
7852
  case K.FRAME:
7890
7853
  e._appendElement(t, U.HTML), t.ackSelfClosing = !0;
7891
7854
  break;
7892
- case K.NOFRAMES:
7893
- uc(e, t);
7894
- break;
7895
- default:
7855
+ case K.NOFRAMES: uc(e, t);
7896
7856
  }
7897
7857
  }
7898
7858
  function eu(e, t) {
@@ -7903,10 +7863,7 @@ function tu(e, t) {
7903
7863
  case K.HTML:
7904
7864
  Z(e, t);
7905
7865
  break;
7906
- case K.NOFRAMES:
7907
- uc(e, t);
7908
- break;
7909
- default:
7866
+ case K.NOFRAMES: uc(e, t);
7910
7867
  }
7911
7868
  }
7912
7869
  function nu(e, t) {
@@ -7923,10 +7880,7 @@ function au(e, t) {
7923
7880
  case K.HTML:
7924
7881
  Z(e, t);
7925
7882
  break;
7926
- case K.NOFRAMES:
7927
- uc(e, t);
7928
- break;
7929
- default:
7883
+ case K.NOFRAMES: uc(e, t);
7930
7884
  }
7931
7885
  }
7932
7886
  function ou(e, t) {
@@ -8076,15 +8030,15 @@ function Ou(e, t, n) {
8076
8030
  return e && (r += e), t ? r += ` PUBLIC ${Du(t)}` : n && (r += " SYSTEM"), n && (r += ` ${Du(n)}`), r;
8077
8031
  }
8078
8032
  var ku = {
8079
- isCommentNode: Se,
8080
- isElementNode: S,
8081
- isTextNode: xe,
8033
+ isCommentNode: xe,
8034
+ isElementNode: C,
8035
+ isTextNode: be,
8082
8036
  createDocument() {
8083
- let e = new ve([]);
8037
+ let e = new _e([]);
8084
8038
  return e["x-mode"] = W.NO_QUIRKS, e;
8085
8039
  },
8086
8040
  createDocumentFragment() {
8087
- return new ve([]);
8041
+ return new _e([]);
8088
8042
  },
8089
8043
  createElement(e, t, n) {
8090
8044
  let r = Object.create(null), i = Object.create(null), a = Object.create(null);
@@ -8092,14 +8046,14 @@ var ku = {
8092
8046
  let t = n[e].name;
8093
8047
  r[t] = n[e].value, i[t] = n[e].namespace, a[t] = n[e].prefix;
8094
8048
  }
8095
- let o = new ye(e, r, []);
8049
+ let o = new ve(e, r, []);
8096
8050
  return o.namespace = t, o["x-attribsNamespace"] = i, o["x-attribsPrefix"] = a, o;
8097
8051
  },
8098
8052
  createCommentNode(e) {
8099
- return new me(e);
8053
+ return new pe(e);
8100
8054
  },
8101
8055
  createTextNode(e) {
8102
- return new pe(e);
8056
+ return new fe(e);
8103
8057
  },
8104
8058
  appendChild(e, t) {
8105
8059
  let n = e.children[e.children.length - 1];
@@ -8116,8 +8070,8 @@ var ku = {
8116
8070
  return e.children[0];
8117
8071
  },
8118
8072
  setDocumentType(e, t, n, r) {
8119
- let i = Ou(t, n, r), a = e.children.find((e) => Ce(e) && e.name === "!doctype");
8120
- a ? a.data = i ?? null : (a = new he("!doctype", i), ku.appendChild(e, a)), a["x-name"] = t, a["x-publicId"] = n, a["x-systemId"] = r;
8073
+ let i = Ou(t, n, r), a = e.children.find((e) => Se(e) && e.name === "!doctype");
8074
+ a ? a.data = i ?? null : (a = new me("!doctype", i), ku.appendChild(e, a)), a["x-name"] = t, a["x-publicId"] = n, a["x-systemId"] = r;
8121
8075
  },
8122
8076
  setDocumentMode(e, t) {
8123
8077
  e["x-mode"] = t;
@@ -8133,11 +8087,11 @@ var ku = {
8133
8087
  },
8134
8088
  insertText(e, t) {
8135
8089
  let n = e.children[e.children.length - 1];
8136
- n && xe(n) ? n.data += t : ku.appendChild(e, ku.createTextNode(t));
8090
+ n && be(n) ? n.data += t : ku.appendChild(e, ku.createTextNode(t));
8137
8091
  },
8138
8092
  insertTextBefore(e, t, n) {
8139
8093
  let r = e.children[e.children.indexOf(n) - 1];
8140
- r && xe(r) ? r.data += t : ku.insertBefore(e, ku.createTextNode(t), n);
8094
+ r && be(r) ? r.data += t : ku.insertBefore(e, ku.createTextNode(t), n);
8141
8095
  },
8142
8096
  adoptAttributes(e, t) {
8143
8097
  for (let n = 0; n < t.length; n++) {
@@ -8179,7 +8133,7 @@ var ku = {
8179
8133
  return e["x-systemId"] ?? "";
8180
8134
  },
8181
8135
  isDocumentTypeNode(e) {
8182
- return Ce(e) && e.name === "!doctype";
8136
+ return Se(e) && e.name === "!doctype";
8183
8137
  },
8184
8138
  setNodeSourceCodeLocation(e, t) {
8185
8139
  t && (e.startIndex = t.startOffset, e.endIndex = t.endOffset), e.sourceCodeLocation = t;
@@ -8204,7 +8158,7 @@ function Mu(e) {
8204
8158
  let t = "length" in e ? e : [e];
8205
8159
  for (let e = 0; e < t.length; e += 1) {
8206
8160
  let n = t[e];
8207
- we(n) && Array.prototype.splice.call(t, e, 1, ...n.children);
8161
+ Ce(n) && Array.prototype.splice.call(t, e, 1, ...n.children);
8208
8162
  }
8209
8163
  let n = "";
8210
8164
  for (let e = 0; e < t.length; e += 1) {
@@ -8213,7 +8167,7 @@ function Mu(e) {
8213
8167
  }
8214
8168
  return n;
8215
8169
  }
8216
- var Nu = co(ba((e, t, n, r) => t._useHtmlParser2 ? Bn(e, t) : Au(e, t, n, r)), (e, t) => t._useHtmlParser2 ? He(e, t) : Mu(e));
8170
+ var Nu = co(ba((e, t, n, r) => t._useHtmlParser2 ? Bn(e, t) : Au(e, t, n, r)), (e, t) => t._useHtmlParser2 ? Ve(e, t) : Mu(e));
8217
8171
  //#endregion
8218
8172
  //#region src/parsers/utils.ts
8219
8173
  function Pu(e, { removeEmptyElements: t = !1 } = {}) {
@@ -8353,22 +8307,24 @@ function Wu(e, t) {
8353
8307
  });
8354
8308
  continue;
8355
8309
  }
8356
- let te = Ru(y), [b, x] = Iu(te);
8357
- if (!f) if (b !== null && b >= 0 && x !== "Annexe") f = !0;
8358
- else continue;
8359
- if (!te || Bu(y) || b !== null && b < 0) {
8360
- b !== null && b < 0 && (ee = !0);
8310
+ let b = Ru(y), [x, S] = Iu(b);
8311
+ if (!f) {
8312
+ if (x !== null && x >= 0 && S !== "Annexe") f = !0;
8313
+ else continue;
8314
+ }
8315
+ if (!b || Bu(y) || x !== null && x < 0) {
8316
+ x !== null && x < 0 && (ee = !0);
8361
8317
  continue;
8362
8318
  }
8363
8319
  if (ee) {
8364
- if (b === null) continue;
8320
+ if (x === null) continue;
8365
8321
  ee = !1;
8366
8322
  }
8367
8323
  if (Hu(y)) {
8368
8324
  if (!m[e + 1]) break;
8369
8325
  continue;
8370
8326
  }
8371
- if (b === null) l.length === 0 || c && u.length === 0 ? l.push({
8327
+ if (x === null) l.length === 0 || c && u.length === 0 ? l.push({
8372
8328
  texte: y,
8373
8329
  html: v
8374
8330
  }) : u.push({
@@ -8376,14 +8332,14 @@ function Wu(e, t) {
8376
8332
  html: v
8377
8333
  }), c && l.length >= 2 && (c = !1);
8378
8334
  else {
8379
- if (x === "ExposeMotifs" && (p = !0), x !== "ExposeMotifs" && p && h.closest(".assnatSection2").length > 0) {
8335
+ if (S === "ExposeMotifs" && (p = !0), S !== "ExposeMotifs" && p && h.closest(".assnatSection2").length > 0) {
8380
8336
  u.push({
8381
8337
  texte: y,
8382
8338
  html: v
8383
8339
  });
8384
8340
  continue;
8385
8341
  }
8386
- for (o = b, l.length > 0 && i.push({
8342
+ for (o = x, l.length > 0 && i.push({
8387
8343
  id: `D_${Ru(l[0]?.texte ?? "")}`,
8388
8344
  type: s ?? "",
8389
8345
  niveau: o + 1,
@@ -8391,10 +8347,10 @@ function Wu(e, t) {
8391
8347
  titres: l,
8392
8348
  alineas: u
8393
8349
  }); a.length > 0 && o < a[a.length - 1];) a.pop();
8394
- (a.length === 0 || o > a[a.length - 1]) && a.push(o), s = x, l = [{
8350
+ (a.length === 0 || o > a[a.length - 1]) && a.push(o), s = S, l = [{
8395
8351
  texte: y,
8396
8352
  html: v
8397
- }], u = [], c = !te.match(/^ARTICLES?(_|$)/) && !te.match(/^EXPOSE_DES_MOTIFS$/);
8353
+ }], u = [], c = !b.match(/^ARTICLES?(_|$)/) && !b.match(/^EXPOSE_DES_MOTIFS$/);
8398
8354
  }
8399
8355
  }
8400
8356
  l.length > 0 && i.push({
@@ -8471,18 +8427,18 @@ async function* Yu(e, r, i, a, f, p = {}) {
8471
8427
  p.verbose && console.log(`Fetching amendements search page at ${r}…`);
8472
8428
  let m = await fetch(r);
8473
8429
  o(m.ok, `Retrieval of search page at ${r} failed with error: ${m.status} ${m.statusText}`);
8474
- let h = d(await m.text());
8475
- if (h.querySelector("div.no-result") !== null) break;
8476
- let g = h.querySelector("div.mirror-card-subtitle");
8477
- o.notStrictEqual(g, null);
8478
- let _ = parseInt(/\d+/.exec(g.text)[0]), v = h.querySelector("div.amendement-list--results-table");
8479
- o.notStrictEqual(v, null);
8480
- let y = v.querySelector("table");
8430
+ let h = await m.text(), g = d(h);
8431
+ if (g.querySelector("div.no-result") !== null) break;
8432
+ let _ = g.querySelector("div.mirror-card-subtitle");
8433
+ o.notStrictEqual(_, null);
8434
+ let v = parseInt(/\d+/.exec(_.text)[0]), y = g.querySelector("div.amendement-list--results-table");
8481
8435
  o.notStrictEqual(y, null);
8482
- let te = y.querySelector("tfoot > tr");
8483
- o.notStrictEqual(te, null);
8484
- let b = te.querySelectorAll("td, th").map((e) => e.text);
8485
- o(l(b, [
8436
+ let b = y.querySelector("table");
8437
+ o.notStrictEqual(b, null);
8438
+ let x = b.querySelector("tfoot > tr");
8439
+ o.notStrictEqual(x, null);
8440
+ let S = x.querySelectorAll("td, th").map((e) => e.text);
8441
+ o(l(S, [
8486
8442
  "",
8487
8443
  "n°",
8488
8444
  "Dossier législatif",
@@ -8494,10 +8450,10 @@ async function* Yu(e, r, i, a, f, p = {}) {
8494
8450
  "Examiné par",
8495
8451
  "Texte visé",
8496
8452
  "Date de dépôt"
8497
- ]), `Unexpected columns in ${JSON.stringify(b, null, 2)}`);
8498
- let x = y.querySelectorAll("tbody > tr");
8499
- o.notStrictEqual(x.length, 0);
8500
- for (let l of x) {
8453
+ ]), `Unexpected columns in ${JSON.stringify(S, null, 2)}`);
8454
+ let te = b.querySelectorAll("tbody > tr");
8455
+ o.notStrictEqual(te.length, 0);
8456
+ for (let l of te) {
8501
8457
  if (ee++, a != null || f != null) {
8502
8458
  let e = l.querySelectorAll("td");
8503
8459
  if (o.strictEqual(e.length, 11, `Unexpected number of columns in amendment row: ${l.outerHTML}`), a != null) {
@@ -8515,37 +8471,37 @@ async function* Yu(e, r, i, a, f, p = {}) {
8515
8471
  o.strictEqual(h[0], "", `Unexpected URL path for amendement: ${m}`), o.strictEqual(h[1], "dyn", `Unexpected URL path for amendement: ${m}`);
8516
8472
  let g = c.join(e, ...h.slice(2)) + ".html";
8517
8473
  await s.ensureDir(c.dirname(g));
8518
- let v = await s.pathExists(g) ? await s.readFile(g, "utf8") : null, y = l.outerHTML, te = `---\n${u.dump({
8519
- position: _ - ee,
8474
+ let _ = await s.pathExists(g) ? await s.readFile(g, "utf8") : null, y = l.outerHTML, b = `---\n${u.dump({
8475
+ position: v - ee,
8520
8476
  search: r.replace(/&page=[\d]+/, "")
8521
8477
  }, { sortKeys: !0 })}---\n\n${y}`;
8522
- if (te === v) {
8478
+ if (b === _) {
8523
8479
  if (i) break iterSearchPages;
8524
8480
  continue;
8525
8481
  }
8526
- if (v !== null && qu(v) === y) continue;
8527
- p.verbose && console.log(v === null ? `Adding amendement search cache: ${g}…` : `Updating amendement search cache: ${g}…`);
8528
- let b = new URL(m, "https://www.assemblee-nationale.fr/").toString(), x = await fetch(b);
8529
- if (x.status === 404) {
8530
- console.log(`Amendement HTML page not found at ${b}. Skipping.`);
8482
+ if (_ !== null && qu(_) === y) continue;
8483
+ p.verbose && console.log(_ === null ? `Adding amendement search cache: ${g}…` : `Updating amendement search cache: ${g}…`);
8484
+ let x = new URL(m, "https://www.assemblee-nationale.fr/").toString(), S = await fetch(x);
8485
+ if (S.status === 404) {
8486
+ console.log(`Amendement HTML page not found at ${x}. Skipping.`);
8531
8487
  continue;
8532
8488
  }
8533
- o(x.ok, `Retrieval of amendement HTML page at ${b} failed with error: ${x.status} ${x.statusText}`);
8534
- let ne = d(await x.text()).querySelectorAll("li.mirror-card-header--options--content--item");
8489
+ o(S.ok, `Retrieval of amendement HTML page at ${x} failed with error: ${S.status} ${S.statusText}`);
8490
+ let te = await S.text(), ne = d(te).querySelectorAll("li.mirror-card-header--options--content--item");
8535
8491
  o.notStrictEqual(ne.length, 0);
8536
8492
  let re = ne.find((e) => {
8537
8493
  let t = e.querySelector("a > span");
8538
8494
  return o.notStrictEqual(t, null, `No <span> in <a> found in ${e.toString()}`), t.text === "Version JSON";
8539
8495
  });
8540
- o.notStrictEqual(re, void 0, `No JSON version found for amendement at ${b}`);
8496
+ o.notStrictEqual(re, void 0, `No JSON version found for amendement at ${x}`);
8541
8497
  let ie = re.querySelector("a");
8542
8498
  o.notStrictEqual(ie, null, `No <a> found in ${re.toString()}`);
8543
8499
  let ae = ie.getAttribute("href");
8544
8500
  o.notStrictEqual(ae, void 0, `No URL found for JSON version of amendement: ${re.toString()}`);
8545
8501
  let oe = new URL(ae, "https://www.assemblee-nationale.fr/").toString(), se = await fetch(oe);
8546
- o(se.ok, `Retrieval of amendement JSON page at ${oe} failed with error: ${se.status} ${se.statusText}`), yield [m, await se.json()], await s.writeFile(g, te, "utf8");
8502
+ o(se.ok, `Retrieval of amendement JSON page at ${oe} failed with error: ${se.status} ${se.statusText}`), yield [m, await se.json()], await s.writeFile(g, b, "utf8");
8547
8503
  }
8548
- let ne = h.querySelector("div.an-pagination--item > i.an-icons-chevron-right ~ a");
8504
+ let ne = g.querySelector("div.an-pagination--item > i.an-icons-chevron-right ~ a");
8549
8505
  if (ne === null) break;
8550
8506
  let re = ne.getAttribute("href");
8551
8507
  o.notStrictEqual(re, void 0), r = new URL(re, "https://www.assemblee-nationale.fr/").toString();
@@ -8595,7 +8551,7 @@ function td(e) {
8595
8551
  };
8596
8552
  for (let e of s) {
8597
8553
  if (i === "done") break;
8598
- let s = t(e), g = Q(s.text()), _ = nd(s), v = _ !== null, y = _ !== null && _ >= 2 && _ <= 5, te = s.hasClass("assnatFPFexpogentitre1"), b = s.hasClass("assnatFPFexpogentexte"), x = s.hasClass("assnatFPFprojetloiartexte"), ne = s.hasClass("assnatFPFfinartexte"), re = s.is("table"), ie = s.is("img"), ae = s.find("img").length > 0;
8554
+ let s = t(e), g = Q(s.text()), _ = nd(s), v = _ !== null, y = _ !== null && _ >= 2 && _ <= 5, b = s.hasClass("assnatFPFexpogentitre1"), x = s.hasClass("assnatFPFexpogentexte"), S = s.hasClass("assnatFPFprojetloiartexte"), te = s.hasClass("assnatFPFfinartexte"), ne = s.is("table"), re = s.is("img"), ie = s.find("img").length > 0;
8599
8555
  if (!(v && g.length === 0)) {
8600
8556
  if (i === "generalExpose") {
8601
8557
  if (_ === 1) {
@@ -8607,7 +8563,7 @@ function td(e) {
8607
8563
  e.includes("exposé général des motifs") && (a ?? (a = Zu("D_EXPOSE", "Exposé des motifs", 1, 1)));
8608
8564
  }
8609
8565
  if (y && (a && n.push(a), a = null, i = "hierarchy"), a) {
8610
- if (ie) {
8566
+ if (re) {
8611
8567
  let e = ad(s);
8612
8568
  if (e) {
8613
8569
  var l;
@@ -8616,13 +8572,13 @@ function td(e) {
8616
8572
  } else if ((_ === 1 || _ === 6) && g.length > 0) {
8617
8573
  var u;
8618
8574
  (u = a).titres ?? (u.titres = []), a.titres.push($(s));
8619
- } else if (te || b) {
8620
- let e = ae ? rd(s) : $(s);
8575
+ } else if (b || x) {
8576
+ let e = ie ? rd(s) : $(s);
8621
8577
  if (e) {
8622
8578
  var d;
8623
8579
  (d = a).alineas ?? (d.alineas = []), a.alineas.push(e);
8624
8580
  }
8625
- } else if (re) {
8581
+ } else if (ne) {
8626
8582
  var f;
8627
8583
  (f = a).alineas ?? (f.alineas = []), a.alineas.push($u(s));
8628
8584
  }
@@ -8649,32 +8605,32 @@ function td(e) {
8649
8605
  o = Zu(`D_${Xu(g)}`, "Article", 5, e), o.titres = [$(s)], i = "articleBody";
8650
8606
  continue;
8651
8607
  }
8652
- if (x && i === "articleBody" && o) {
8608
+ if (S && i === "articleBody" && o) {
8653
8609
  var p;
8654
8610
  (p = o).alineas ?? (p.alineas = []), o.alineas.push($(s));
8655
8611
  continue;
8656
8612
  }
8657
- if (re && i === "articleBody" && o) {
8613
+ if (ne && i === "articleBody" && o) {
8658
8614
  var ee;
8659
8615
  (ee = o).alineas ?? (ee.alineas = []), o.alineas.push($u(s));
8660
8616
  continue;
8661
8617
  }
8662
- if (ne && o) {
8618
+ if (te && o) {
8663
8619
  i = "articleExpose";
8664
8620
  continue;
8665
8621
  }
8666
- if (te && i === "articleBody" && o) {
8622
+ if (b && i === "articleBody" && o) {
8667
8623
  i = "articleExpose";
8668
8624
  continue;
8669
8625
  }
8670
8626
  if (i === "articleExpose" && o) {
8671
- if (te) continue;
8672
- if (b) {
8627
+ if (b) continue;
8628
+ if (x) {
8673
8629
  var m;
8674
8630
  (m = o).exposeDesMotifs ?? (m.exposeDesMotifs = []), o.exposeDesMotifs.push($(s));
8675
8631
  continue;
8676
8632
  }
8677
- if (re) {
8633
+ if (ne) {
8678
8634
  var h;
8679
8635
  (h = o).exposeDesMotifs ?? (h.exposeDesMotifs = []), o.exposeDesMotifs.push($u(s));
8680
8636
  }