vde-open 0.1.16 → 0.1.18

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 (32) hide show
  1. package/README.md +20 -7
  2. package/THIRD_PARTY_NOTICES.md +159 -235
  3. package/dist/cli.js +929 -55
  4. package/dist/daemon.js +3 -4
  5. package/dist/{heap-C3qHm7SE.js → heap-wO8Issp7.js} +1 -2
  6. package/dist/{html-static-Ct_9qmNR.js → html-static-FxIbpM5b.js} +1630 -1216
  7. package/dist/{main-D-ZX3nEP.js → main-C6WuJzmz.js} +618 -320
  8. package/dist/{print-Bb6ArlQl.js → print-DNdOXOlQ.js} +281 -346
  9. package/dist/{render-CY_Mrhyl.js → render-CO37G_5o.js} +4 -7
  10. package/dist/rolldown-runtime-Bl4WtXjF.js +32 -0
  11. package/dist/{search-index-B0xpVDwG.js → search-index-CWn1X9n-.js} +160 -79
  12. package/dist/web/assets/apple-touch-icon-Be989aVe.png +0 -0
  13. package/dist/web/assets/favicon-Du9oTaDs.svg +1 -0
  14. package/dist/web/assets/main-cNlDXnWn.js +124 -0
  15. package/dist/web/assets/markdown.worker-iSTaa6gR.js +13 -0
  16. package/dist/web/assets/mobile-DlPHtOJc.js +1 -0
  17. package/dist/web/assets/rolldown-runtime-WkwZ5CU-.js +1 -0
  18. package/dist/web/assets/src-B8UfTgKw.js +40 -0
  19. package/dist/web/assets/src-DgGe2wbt.css +2 -0
  20. package/dist/web/index.html +6 -4
  21. package/dist/web/mobile.html +6 -4
  22. package/dist/workers/parse-worker.js +5 -6
  23. package/dist/workers/search-worker.js +3 -4
  24. package/docs/agent-usage.md +3 -0
  25. package/package.json +7 -6
  26. package/skills/vde-open/SKILL.md +9 -1
  27. package/dist/web/assets/main-DcvVu7FQ.js +0 -123
  28. package/dist/web/assets/markdown.worker-BhrAVXtB.js +0 -13
  29. package/dist/web/assets/mobile-HCpMXT2S.js +0 -1
  30. package/dist/web/assets/rolldown-runtime-CbXtAM7H.js +0 -1
  31. package/dist/web/assets/src--PpHwH7V.js +0 -41
  32. package/dist/web/assets/src-DinzSLDA.css +0 -2
@@ -1,36 +1,5 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
- var __exportAll = (all, no_symbols) => {
10
- let target = {};
11
- for (var name in all) __defProp(target, name, {
12
- get: all[name],
13
- enumerable: true
14
- });
15
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
16
- return target;
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
- key = keys[i];
21
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
22
- get: ((k) => from[k]).bind(null, key),
23
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
24
- });
25
- }
26
- return to;
27
- };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
29
- value: mod,
30
- enumerable: true
31
- }) : target, mod));
32
- //#endregion
33
- //#region ../../node_modules/.pnpm/@tanstack+markdown@1.0.0_react@19.3.0/node_modules/@tanstack/markdown/dist/utils.js
1
+ import { n as __exportAll, t as __commonJSMin } from "./rolldown-runtime-Bl4WtXjF.js";
2
+ // ../../node_modules/.pnpm/@tanstack+markdown@1.2.0_react@19.3.1/node_modules/@tanstack/markdown/dist/utils.js
34
3
  const htmlEscapes = {
35
4
  "&": "&amp;",
36
5
  "<": "&lt;",
@@ -102,8 +71,7 @@ function footnoteId(label) {
102
71
  function footnoteReferenceId(id, index = 1) {
103
72
  return index > 1 ? `${id}-${index}` : id;
104
73
  }
105
- //#endregion
106
- //#region ../../node_modules/.pnpm/@tanstack+markdown@1.0.0_react@19.3.0/node_modules/@tanstack/markdown/dist/inline.js
74
+ // ../../node_modules/.pnpm/@tanstack+markdown@1.2.0_react@19.3.1/node_modules/@tanstack/markdown/dist/inline.js
107
75
  function parseInline(value, options = {}) {
108
76
  const parsers = options.extensions?.flatMap((extension) => extension.inlineParser ? [extension.inlineParser] : []) ?? [];
109
77
  const marker = parsers.length ? new RegExp(inlineMarker.source + "|[" + parsers.map((parser) => parser.markers).join("").replace(/[\\\]\[\-^]/g, "\\$&") + "]", "g") : inlineMarker;
@@ -407,8 +375,7 @@ function canUseUnderscore(value, index, size, opening) {
407
375
  const outside = value[opening ? index - 1 : index + size];
408
376
  return inside !== void 0 && !/\s/.test(inside) && (outside === void 0 || /[^\p{L}\p{N}]/u.test(outside));
409
377
  }
410
- //#endregion
411
- //#region ../../node_modules/.pnpm/@tanstack+markdown@1.0.0_react@19.3.0/node_modules/@tanstack/markdown/dist/parser.js
378
+ // ../../node_modules/.pnpm/@tanstack+markdown@1.2.0_react@19.3.1/node_modules/@tanstack/markdown/dist/parser.js
412
379
  const maxBlockDepth = 64;
413
380
  function parseMarkdown(markdown, options = {}) {
414
381
  const normalized = normalizeInput(markdown);
@@ -558,7 +525,7 @@ function createBlockParser(inputLines, options, slugger, budget = { depth: 0 })
558
525
  const quoted = [];
559
526
  while (cursor < inputLines.length) {
560
527
  const line = current();
561
- const match = line.match(/^ {0,3}>\s?(.*)$/);
528
+ const match = line.match(/^ {0,3}>\s?(.*)$/s);
562
529
  if (!match) {
563
530
  if (!isBlank(line)) break;
564
531
  looseBlocks = true;
@@ -867,8 +834,7 @@ function cell(value, options) {
867
834
  children: parseInline(value, options)
868
835
  };
869
836
  }
870
- //#endregion
871
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/common/unicode.js
837
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/common/unicode.js
872
838
  const UNDEFINED_CODE_POINTS = /* @__PURE__ */ new Set([
873
839
  65534,
874
840
  65535,
@@ -900,8 +866,8 @@ const UNDEFINED_CODE_POINTS = /* @__PURE__ */ new Set([
900
866
  917503,
901
867
  983038,
902
868
  983039,
903
- 1048574,
904
- 1048575,
869
+ 0xffffe,
870
+ 0xfffff,
905
871
  1114110,
906
872
  1114111
907
873
  ]);
@@ -957,8 +923,7 @@ function isControlCodePoint(cp) {
957
923
  function isUndefinedCodePoint(cp) {
958
924
  return cp >= 64976 && cp <= 65007 || UNDEFINED_CODE_POINTS.has(cp);
959
925
  }
960
- //#endregion
961
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/common/error-codes.js
926
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/common/error-codes.js
962
927
  var ERR;
963
928
  (function(ERR) {
964
929
  ERR["controlCharacterInInputStream"] = "control-character-in-input-stream";
@@ -1022,8 +987,7 @@ var ERR;
1022
987
  ERR["nestedNoscriptInHead"] = "nested-noscript-in-head";
1023
988
  ERR["eofInElementThatCanContainOnlyText"] = "eof-in-element-that-can-contain-only-text";
1024
989
  })(ERR || (ERR = {}));
1025
- //#endregion
1026
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/tokenizer/preprocessor.js
990
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/tokenizer/preprocessor.js
1027
991
  const DEFAULT_BUFFER_WATERLINE = 65536;
1028
992
  var Preprocessor = class {
1029
993
  constructor(handler) {
@@ -1046,8 +1010,13 @@ var Preprocessor = class {
1046
1010
  get col() {
1047
1011
  return this.pos - this.lineStartPos + Number(this.lastGapPos !== this.pos);
1048
1012
  }
1013
+ /** The index in `html` at which the current code point starts (the high surrogate of a pair). */
1014
+ get codePointStart() {
1015
+ return this.pos - Number(this.lastGapPos === this.pos);
1016
+ }
1017
+ /** The offset of the current code point, before the second unit of a surrogate pair. */
1049
1018
  get offset() {
1050
- return this.droppedBufferSize + this.pos;
1019
+ return this.droppedBufferSize + this.codePointStart;
1051
1020
  }
1052
1021
  getError(code, cpOffset) {
1053
1022
  const { line, col, offset } = this;
@@ -1076,7 +1045,7 @@ var Preprocessor = class {
1076
1045
  _processSurrogate(cp) {
1077
1046
  if (this.pos !== this.html.length - 1) {
1078
1047
  const nextCp = this.html.charCodeAt(this.pos + 1);
1079
- if (isSurrogatePair(nextCp)) {
1048
+ if (!isSurrogatePair(cp) && isSurrogatePair(nextCp)) {
1080
1049
  this.pos++;
1081
1050
  this._addGap();
1082
1051
  return getSurrogatePairCodePoint(cp, nextCp);
@@ -1091,14 +1060,20 @@ var Preprocessor = class {
1091
1060
  willDropParsedChunk() {
1092
1061
  return this.pos > this.bufferWaterline;
1093
1062
  }
1094
- dropParsedChunk() {
1063
+ /**
1064
+ * Drop the parsed input, except for the current code point and the `keep` code units before it. The gap history is
1065
+ * reset, so the kept units must contain no preprocessing gap.
1066
+ */
1067
+ dropParsedChunk(keep = 0) {
1095
1068
  if (this.willDropParsedChunk()) {
1096
- this.html = this.html.substring(this.pos);
1097
- this.lineStartPos -= this.pos;
1098
- this.droppedBufferSize += this.pos;
1099
- this.pos = 0;
1069
+ const droppedSize = this.offset - this.droppedBufferSize - keep;
1070
+ this.html = this.html.substring(droppedSize);
1071
+ this.lineStartPos -= droppedSize;
1072
+ this.droppedBufferSize += droppedSize;
1073
+ this.pos -= droppedSize;
1100
1074
  this.lastGapPos = -2;
1101
1075
  this.gapStack.length = 0;
1076
+ if (this.pos > keep) this._addGap();
1102
1077
  }
1103
1078
  }
1104
1079
  write(chunk, isLastChunk) {
@@ -1173,8 +1148,7 @@ var Preprocessor = class {
1173
1148
  this.isEol = false;
1174
1149
  }
1175
1150
  };
1176
- //#endregion
1177
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/common/token.js
1151
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/common/token.js
1178
1152
  var TokenType;
1179
1153
  (function(TokenType) {
1180
1154
  TokenType[TokenType["CHARACTER"] = 0] = "CHARACTER";
@@ -1191,10 +1165,9 @@ function getTokenAttr(token, attrName) {
1191
1165
  for (let i = token.attrs.length - 1; i >= 0; i--) if (token.attrs[i].name === attrName) return token.attrs[i].value;
1192
1166
  return null;
1193
1167
  }
1194
- //#endregion
1195
- //#region ../../node_modules/.pnpm/entities@8.1.0/node_modules/entities/dist/decode-codepoint.js
1168
+ // ../../node_modules/.pnpm/entities@9.0.0/node_modules/entities/dist/decode-codepoint.js
1196
1169
  /**
1197
- * C1 Unicode control character reference replacements (code points 128–159).
1170
+ * C1 Unicode control character reference replacements (code points 128-159).
1198
1171
  * Index i gives the replacement for code point 128+i; 0 means "no replacement".
1199
1172
  */
1200
1173
  const c1 = [
@@ -1241,7 +1214,7 @@ function isInvalidCodePoint(codePoint) {
1241
1214
  /**
1242
1215
  * Replace the given code point with U+FFFD if it is NUL (0), a surrogate, or
1243
1216
  * outside the valid Unicode range. Code points in the C1 controls range
1244
- * (128–159) are remapped to their Windows-1252 equivalents, following the
1217
+ * (128-159) are remapped to their Windows-1252 equivalents, following the
1245
1218
  * HTML spec. All other code points are returned unchanged.
1246
1219
  * @param codePoint Unicode code point to convert.
1247
1220
  */
@@ -1250,255 +1223,137 @@ function replaceCodePoint(codePoint) {
1250
1223
  if (codePoint >= 128 && codePoint <= 159) return c1[codePoint - 128] || codePoint;
1251
1224
  return codePoint;
1252
1225
  }
1226
+ // ../../node_modules/.pnpm/entities@9.0.0/node_modules/entities/dist/generated/decode-data-html.js
1253
1227
  /**
1254
- * XML numeric character references are the referenced Unicode code point.
1255
- * Invalid values still become U+FFFD; the HTML Windows-1252 C1 remap is not
1256
- * applied.
1257
- * @see https://www.w3.org/TR/xml/#NT-CharRef
1258
- * @param codePoint Unicode code point to convert.
1228
+ * Serialized decode data; the format is documented in
1229
+ * `src/internal/decode-data-format.ts`. `[0]` is one-byte data (all char
1230
+ * codes <= 0xFF: header, front-coded name suffixes, per-name metadata,
1231
+ * cuckoo choice bits); `[1]` holds the replacement values.
1232
+ */
1233
+ const htmlDecodeData = ["Q=¨`p0AEligMPacutebrevecircyfrgravelphamacrndogonpfpplyFunctionringscrsigntildeumlBackslashrvwedcyecausernoullistafropfrevescrumpeqCHcyOPYacutepitalDifferentialDyleyscaronedilirconintdotedillanterDotfrhiircleDotMinusPlusTimeslockwiseContourIntegralseCurlyDoubleQuoteQuoteolonengruentinttourIntegralpfroductunterClockwiseContourIntegralrossscrupCapDDotrahdJcyScyZcyaggerrrshvcaronyeltafriacriticalAcuteDotubleAcuteGraveTildemondfferentialDopftDotEqualubleContourIntegralDotwnArrowLeftArrowRightArrowTeeongLeftArrowRightArrowRightArrowRightArrowTeeUpArrowDownArrowVerticalBarwnArrowBarUpArrowBreveLeftRightVectorTeeVectorVectorBarRightTeeVectorVectorBarTeeArrowarrowscrtrokENGTHacutecaronircydotfrgravelementmacrptySmallSquareVerySmallSquareogonpfpsilonqualTildeilibriumscrimtaumlxistsponentialEFcyfrilledSmallSquareVerySmallSquareopfrAlluriertrfscrGJcyTammadbrevecedilircydotfrgopfreaterEqualLessFullEqualGreaterLessSlantEqualTildescrtHARDcyacektcircfrilbertSpaceopfrizontalLinescrtrokumpDownHumpEqualIEcyJligOcyacutecircydotfrgravemacrginaryIpliesntegralrsectionvisibleCommaTimesogonpftascrtildeukcymlJcircyfropfscrercyukcyKHcyJcyappacedilyfropfscrLJcyTacutembdangplacetrfrrcaronedilyeftAngleBracketrrowBarRightArrowCeilingDoubleBracketwnTeeVectorVectorBarFloorRightArrowVectorTeeArrowVectorriangleBarEqualUpDownVectorTeeVectorVectorBarVectorBararrowrightarrowssEqualGreaterFullEqualGreaterLessSlantEqualTildefrleftarrowmidotongLeftArrowRightArrowRightArrowleftarrowrightarrowrightarrowpfwerLeftArrowRightArrowscrhtroktMapcyediumSpacellintrffrinusPlusopfscruNJcyacutecaronedilyegativeMediumSpaceThickSpacenSpaceVeryThinSpacestedGreaterGreaterLessLesswLinefroBreaknBreakingSpacepftCongruentupCapDoubleVerticalBarElementqualTildexistsGreaterEqualFullEqualGreaterLessSlantEqualTildeHumpDownHumpEqualLeftTriangleBarEqualssEqualGreaterLessSlantEqualTildeNestedGreaterGreaterLessLessPrecedesEqualSlantEqualReverseElementightTriangleBarEqualSquareSubsetEqualpersetEqualubsetEqualcceedsEqualSlantEqualTildepersetEqualTildeEqualFullEqualTildeVerticalBarscrtildeuOEligacutecircydblacfrgravemacregaicronopfpenCurlyDoubleQuoteQuoterscrlashtildemesumlverBarraceketParenthesisPartialDcyfrhiilusMinusoincareplanepfrecedesEqualSlantEqualTildeimeoductportionalscriQUOTfropfscrRBarrEGacutengrrtlcaronedilyeverseElementquilibriumUpEquilibriumfrhoightAngleBracketrrowBarLeftArrowCeilingDoubleBracketwnTeeVectorVectorBarFloorTeeArrowVectorriangleBarEqualUpDownVectorTeeVectorVectorBarVectorBararrowopfundImpliesrightarrowscrhuleDelayedSHCHcycyOFTcyacutecaronedilircyfrhortDownArrowLeftArrowRightArrowUpArrowigmamallCircleopfqrtuareIntersectionSubsetEqualpersetEqualUnionscrtarubsetEqualcceedsEqualSlantEqualTildehThatmpersetEqualsetTHORNRADESHcycyabucaronedilyfrhereforetaickSpacenSpaceildeEqualFullEqualTildeopfripleDotscrtrokUacuterrocirbrcyevecircydblacfrgravemacrnderBarraceketParenthesisionPlusogonpfpArrowBarDownArrowDownArrowEquilibriumTeeArrowarrowdownarrowperLeftArrowRightArrowsilonringscrtildeumlVDashbarcydashleerbarticalBarLineSeparatorTildeyThinSpacefropfscrvdashWcircedgefropfscrXfriopfscrYAcyIcyUcyacutecircyfropfscrumlZHcyacutecaronydoteroWidthSpacetafropfscraacutebrevecEdircuteyeligfrgravelefsymphphamacrlgpndanddslopevgelemsdaabcdefghrtvbdsphtzarrogonpfpEacireidosproxeqringscrtympeqtildeumlwconintintbNotackcongepsilonprimesimeqrveewedgebrktbrkcongydquoecausemptyvpsirnoutahweenfrigcapircupodotplustimessqcuptartriangledownupuplusveewedgekarowlacklozengesquaretriangledownleftrightnkk12434ocknequivotopfttomwtiexDLRlrHDUduULRlrVHLRhlrboxdLRlrhDUduminusplustimesuLRlrvHLRhlrprimerevevbarscremiimeolbhsubulletmpEeqcacutepandbrcupcapupdotsretoncapsronedilircupssmdotedilmptyvnterdotfrhcyeckmarkiirEceqlearrowleftrightdRSastcircdashefnintmidscirlubsuitoloneqmmatpfnlementxesngdotintpfrodysrrarrossscrubepetdotudarrlreprsclarrppbrcapcapupdotorsrarrmlyeqprecsuccveewedgerenvearrowleftrightveewedwconintintylctydArrHaraggerlethrrshvbkarowlaccaronydaggerrrotseqegltamptyvfishtrharlriamondsuitsegammasinvideontimesonxjcylcornropollarpfteqdotminusplussquareublebarwedgewnarrowdownarrowsharpoonleftrightrbkarowcornropscryoltroktdotrifuarrharwanglezcyigrarreDDototacutestercaronircolonydotefDotrgravesdotlinterslsdotmacrptysetvsp134ngspogonpfparsllussilonvqcircolonsimlantgtrlessualsestivDDvparslrDotarrscrdotimtahumlroxclistpectationonentialefallingdotseqcyemalefiligligligriligjliglatligtnsnofopfrallkvpartintrac123456823534584556878slownscrgElacutemmadpbrevecircydotelqqslantsccdotollesfrggimeljcylEajnEapproxeqqsimopfravescrimeltccirdotlParquestrapproxrrdoteqlessqlesslesssimvertneqqnEhArrairsplfmiltrdcyrcirwbarcirceartsuitlliprconfrksearowwarowoarrmthtokleftarrowrightarrowpfrbarscrlashtrokybullpheniacutecircyecyxclffrgraveiiintntnfinotajligmacrgelinepartthofpedncarefintieodottcalegersrcallarhkprodocygonpftaprodquestscrinEdotsvvtildeukcymljcircyfrmathopfscrercyukcykappavcedilyfrgreenhcyjcyopfscrlAarrrrtailBarrEgHaracuteemptyvgranmbdangdlepquorrbfsfshklpplsimtltailesbarrbrkracekkeslducaronedililubydcaquorrdharusharsheftarrowtailharpoondownupleftarrowsrightarrowsharpoonssquigarrowthreetimesgqqslantsccdotorgessapproxdoteqgtrqgtrgtrsimfishtloorrgEhardulblkjcylarrcornerhardtrimidotoustachenEapproxeqqsimoangrrbrkngleftarrowrightarrowmapstorightarrowoparrowleftrightparflustimeswastbarzengefparltrarrcornerhardmtrisaquocrhimegqbuortroktccirdothreeimeslarrquestrPariefurdsharuharvertneqqnEmDDotacrletesepstodownleftuprkercommaydasheasuredanglefrhoicrodastcirdotnusbdulcpdrnplusodelspfpscrtposultimapmapnGgtvLeftarrowrightarrowltvRightarrowVDashdashablacutengpEidosproxturalsbspumpecapronedilongdotupydasheArrarhkrowdotquivsearimxistsfrgEeqqslantssimtrhArrarrparisdvjcylArrEarrdreftarrowrightarrowqqslantsssimtriemidopftinEdotvabcnivabcparallelsltolintrcueeceqrArrarrcwightarrowtriesccueerhortmidparallelimeqmidparqsubepeubEeseteqqcceqpEeseteqqtglildelgrianglelefteqrightequmerospvDashHarrapdashgetinfinlArretrierArrtriesimwArrarhkrownearoSacutestcircydashblacivotsoldeligfcirrgonravethbarmintlarrcirrossinetmacregaicrondnusopfparerplusrarrderoffmigoforslopevscrlasholtildemesasumlvbarparallelsimltcyercntiodmilptenkfrhivmmatoneitchforkvlanckhkvusacirbcirdouemnsimtwomointintpfundrEapcueecapproxcurlyeqeqnapproxeqqsimsimimesnEapsimodfalarlinesurfptosimurelscriuncspqfrintopfprimescruaternionsintesteqotrAarrrrtailBarrHaraceutedicemptyvngdelequorrapbfscfshklpplsimtlwtailionalsbarrbrkracekkeslducaronedililubydcaldharquorshealinepartsctgfishtloorrhardulovightarrowtailharpoondownupleftarrowsharpoonsrightarrowssquigarrowthreetimesngsingdotseqlarrharmmoustachenmidoangrrbrkparflustimespargtpolintrarrsaquocrhqbuorthreeimesriefltriuluharxsacutebquocEaproncueedilircnEapsimpolintsimydotbeeArrarhkrowctmiswartminusnxtfrownharpchcyyortmidparallelyigmafvmdoteqgElEneplusrarrlarrmallsetminusshpeparslidletesoftcylbarpfpadesuitrqcapsupssubeseteqpesetequareffrarrscretmnmiletarftarfraightepsilonphinsubEdotedotmultnEeplusrarrseteqqneqqimubpccapproxcurlyeqeqnapproxeqqsimsimmngp123EdotsubedothsolublarrmultnEeplusseteqqneqqimubpwArrarhkrownwarzligtargetubrkcaronedilydotelrecfrhere4foretasymvickapproxsimnspkapsimornildemesbardntoeapbotcirforksaprimeradeiangledownlefteqqrighteqdoteminusplussbtimepeziumscryhcytrokwixtoheadleftarrowrightarrowuArrHaracuterrbrcyevecircydarrblacharfishtrgraveharlrblklcornerroptrimacrlogonpfparrowdownarrowharpoonleftrightlussihlonuparrowsrcornerropingtriscrtdotilderifuarrmlwanglevArrBarvDashangrtrepsilonkappanothingphiiroptorhosigmaubsetneqqpsetneqqthetariangleleftrightcydasheebareqlliprbartfrltrinsubpopfproprtriscrubnEepnEezigzagwcircedbargeqierpfropfpreathscrxcapircupdtrifrhArrarrilArrarrmapnisodotpflustimerArrarrscrqcupuplustriveewedgeyacuteycircyenfricyopfscrucymlzacutecaronydoteetrftafrhcyigrarropfscrwjnjC(D%D($(D'%$$ED($'$'$%$'%E$/D'$F%'D(D&#,%%&&$%$)%+%%$E$F$'$&$(#'D&$(%$&4%($(E'%&%($&$)%*$%$%$+)()')($:&5-($'($%*&&&/%%&)%@$'$F$%&&#%%)$&$&$&$(%%%&$(%$$%&%$E$2.&0,.(.(&'%.$F%$&&&(%6)&+*),---&*/1---)-.&)*+,).%*,&,*'('2+,+)1&'1,)2&'&*('($F%'#&D%D($(E&%$$&$ED($)$'%1(2$'%E$)$'((&+$&%%$%D&$(%-#&$E$3)2$F%'%+$&#'D$$'($$($(%&%$$&$E$$$F$./'*,***'*-*($F$$#)$'%$$'$%$.$&%/$&%'$.'(#'$'$&D(D'%$$&$%D($$%&&*%($%&('+%/,($'%E%%$&$($'E%#(%$$E$F$F%'$'#'$&$'$(%$$E$F$F#'D$$(%'%%%+%%$(%'%$$2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%'%'%'$&'$%0+&&%$%&$&&&$'&&'&%'$&'&'&&)%+$)&,$'%'%($%%')'*'%'*(&(&'&%$%%%$F$F$F$&$&&'&&$'&&'(%&'&'&%'$&'&&)%+$)&,$'%'%($$'%''$(%%'D'#)%$$&$(%'%$$&$($E$(('&%(&($%,(&&&%&&&E&$'E&($)%($%%$&%$&&&&&D'&%%$($'%)+'+'/%+$+(0%&&&$&(&'&%&'%)$F&$%&%'$'%1*-#'$&D(%%$'&&D'%$$'%'%&$(%DD($''$%&$()%&&%&$'E$$'%E$)%,%.,(%&%%'$'&%+$()%&&%&%&$F$'%'%%'$$'E%$)#'$&'$$'$(%+&(&*&&'$'(&$'%&('K/D(J/D&('..($%$'$%&&&%%'%'&$$E$'$G'D$F$'$'$F%G(D&F(D$)#($(&%($%'$E$F$$$$%'$F#'%&%%$'$E$'%&$$$'%&$&$&$'%E&&%'$'%&$F%'$(%&$&$(C)&$$'%$D%$E$&$F$F$&E%#)$(%$$&$(%%$E$&$)$F$F$%%%0@0000H8H40H000047P00P@001000@0B0HP@:H9T8P000LB8d@800@I0<110000QQ8400P10030005940@410020000Q02000@0200000@P0101@8000440400000000808000000000@00000000P`0000000040400@0004<000000000008000030000000000P020T400020@0@00000000000000000000000000P0000000400400000400220080000100000000000000000P000000000000P000000@00402000000000@00000000000000000000040000000000000", "Æ&ÁĂÂА𝔄ÀΑĀ⩓Ą𝔸⁡Å𝒜≔ÃÄ∖⫧⌆Б∵ℬΒ𝔅𝔹˘ℬ≎Ч©Ć⋒ⅅℭČÇĈ∰Ċ¸·ℭΧ⊙⊖⊕⊗∲”’∷⩴≡∯∮ℂ∐∳⨯𝒞⋓≍ⅅ⤑ЂЅЏ‡↡⫤ĎД∇Δ𝔇´˙˝`˜⋄ⅆ𝔻¨⃜≐∯¨⇓⇐⇔⫤⟸⟺⟹⇒⊨⇑⇕∥↓⤓⇵̑⥐⥞↽⥖⥟⇁⥗⊤↧⇓𝒟ĐŊÐÉĚÊЭĖ𝔈È∈Ē◻▫Ę𝔼Ε⩵≂⇌ℰ⩳ΗË∃ⅇФ𝔉◼▪𝔽∀ℱℱЃ>ΓϜĞĢĜГĠ𝔊⋙𝔾≥⋛≧⪢≷⩾≳𝒢≫Ъˇ^Ĥℌℋℍ─ℋĦ≎≏ЕIJЁÍÎИİℑÌℑĪⅈ⇒∬∫⋂⁣⁢Į𝕀ΙℐĨІÏĴЙ𝔍𝕁𝒥ЈЄХЌΚĶК𝔎𝕂𝒦Љ<ĹΛ⟪ℒ↞ĽĻЛ⟨←⇤⇆⌈⟦⥡⇃⥙⌊↔⥎⊣↤⥚⊲⧏⊴⥑⥠↿⥘↼⥒⇐⇔⋚≦≶⪡⩽≲𝔏⋘⇚Ŀ⟵⟷⟶⟸⟺⟹𝕃↙↘ℒ↰Ł≪⤅М ℳ𝔐∓𝕄ℳΜЊŃŇŅН​​​​≫≪\n𝔑⁠\xA0ℕ⫬≢≭∦∉≠≂̸∄≯≱≧̸≫̸≹⩾̸≵≎̸≏̸⋪⧏̸⋬≮≰≸≪̸⩽̸≴⪢̸⪡̸⊀⪯̸⋠∌⋫⧐̸⋭⊏̸⋢⊐̸⋣⊂⃒⊈⊁⪰̸⋡≿̸⊃⃒⊉≁≄≇≉∤𝒩ÑΝŒÓÔОŐ𝔒ÒŌΩΟ𝕆“‘⩔𝒪ØÕ⨷Ö‾⏞⎴⏜∂П𝔓ΦΠ±ℌℙ⪻≺⪯≼≾″∏∷∝𝒫Ψ\"𝔔ℚ𝒬⤐®Ŕ⟫↠⤖ŘŖРℜ∋⇋⥯ℜΡ⟩→⇥⇄⌉⟧⥝⇂⥕⌋⊢↦⥛⊳⧐⊵⥏⥜↾⥔⇀⥓⇒ℝ⥰⇛ℛ↱⧴ЩШЬŚ⪼ŠŞŜС𝔖↓←→↑Σ∘𝕊√□⊓⊏⊑⊐⊒⊔𝒮⋆⋐⋐⊆≻⪰≽≿∋∑⋑⊃⊇⋑Þ™ЋЦ ΤŤŢТ𝔗∴Θ   ∼≃≅≈𝕋⃛𝒯ŦÚ↟⥉ЎŬÛУŰ𝔘ÙŪ_⏟⎵⏝⋃⊎Ų𝕌↑⤒⇅↕⥮⊥↥⇑⇕↖↗ϒΥŮ𝒰ŨÜ⊫⫫В⊩⫦⋁‖‖∣|❘≀ 𝔙𝕍𝒱⊪Ŵ⋀𝔚𝕎𝒲𝔛Ξ𝕏𝒳ЯЇЮÝŶЫ𝔜𝕐𝒴ŸЖŹŽЗŻ​Ζℨℤ𝒵áă∾∾̳∿â´аæ⁡𝔞àℵℵαā⨿&∧⩕⩜⩘⩚∠⦤∠∡⦨⦩⦪⦫⦬⦭⦮⦯∟⊾⦝∢Å⍼ą𝕒≈⩰⩯≊≋'≈≊å𝒶*≈≍ãä∳⨑⫭≌϶‵∽⋍⊽⌅⌅⎵⎶≌б„∵∵⦰϶ℬβℶ≬𝔟⋂◯⋃⨀⨁⨂⨆★▽△⨄⋁⋀⤍⧫▪▴▾◂▸␣▒░▓█=⃥≡⃥⌐𝕓⊥⊥⋈╗╔╖╓═╦╩╤╧╝╚╜╙║╬╣╠╫╢╟⧉╕╒┐┌─╥╨┬┴⊟⊞⊠╛╘┘└│╪╡╞┼┤├‵˘¦𝒷⁏∽⋍\\⧅⟈••≎⪮≏≏ć∩⩄⩉⩋⩇⩀∩︀⁁ˇ⩍čçĉ⩌⩐ċ¸⦲¢·𝔠ч✓✓χ○⧃ˆ≗↺↻®Ⓢ⊛⊚⊝≗⨐⫯⧂♣♣:≔≔,@∁∘∁ℂ≅⩭∮𝕔∐©℗↵✗𝒸⫏⫑⫐⫒⋯⤸⤵⋞⋟↶⤽∪⩈⩆⩊⊍⩅∪︀↷⤼⋞⋟⋎⋏¤↶↷⋎⋏∲∱⌭⇓⥥†ℸ↓‐⊣⤏˝ďдⅆ‡⇊⩷°δ⦱⥿𝔡⇃⇂⋄⋄♦♦¨ϝ⋲÷÷⋇⋇ђ⌞⌍$𝕕˙≐≑∸∔⊡⌆↓⇊⇃⇂⤐⌟⌌𝒹ѕ⧶đ⋱▿▾⇵⥯⦦џ⟿⩷≑é⩮ě≖ê≕эėⅇ≒𝔢⪚è⪖⪘⪙⏧ℓ⪕⪗ē∅∅∅   ŋ ę𝕖⋕⧣⩱εεϵ≖≕≂⪖⪕=≟≡⩸⧥≓⥱ℯ≐≂ηðë€!∃ℰⅇ≒ф♀ffiffffl𝔣fifj♭fl▱ƒ𝕗∀⋔⫙⨍½⅓¼⅕⅙⅛⅔⅖¾⅗⅜⅘⅚⅝⅞⁄⌢𝒻≧⪌ǵγϝ⪆ğĝгġ≥⋛≥≧⩾⩾⪩⪀⪂⪄⋛︀⪔𝔤≫⋙ℷѓ≷⪒⪥⪤≩⪊⪊⪈⪈≩⋧𝕘`ℊ≳⪎⪐>⪧⩺⋗⦕⩼⪆⥸⋗⋛⪌≷≳≩︀≩︀⇔ ½ℋъ↔⥈↭ℏĥ♥♥…⊹𝔥⤥⤦⇿∻↩↪𝕙―𝒽ℏħ⁃‐í⁣îие¡⇔𝔦ìⅈ⨌∭⧜℩ijīℑℐℑı⊷Ƶ∈℅∞⧝ı∫⊺ℤ⊺⨗⨼ёį𝕚ι⨼¿𝒾∈⋹⋵⋴⋳∈⁢ĩіïĵй𝔧ȷ𝕛𝒿јєκϰķк𝔨ĸхќ𝕜𝓀⇚⇐⤛⤎≦⪋⥢ĺ⦴ℒλ⟨⦑⟨⪅«←⇤⤟⤝↩↫⤹⥳↢⪫⤙⪭⪭︀⤌❲{[⦋⦏⦍ľļ⌈{л⤶“„⥧⥋↲≤←↢↽↼⇇↔⇆⇋↭⋋⋚≤≦⩽⩽⪨⩿⪁⪃⋚︀⪓⪅⋖⋚⪋≶≲⥼⌊𝔩≶⪑↽↼⥪▄љ≪⇇⌞⥫◺ŀ⎰⎰≨⪉⪉⪇⪇≨⋦⟬⇽⟦⟵⟷⟼⟶↫↬⦅𝕝⨭⨴∗_◊◊⧫(⦓⇆⌟⇋⥭‎⊿‹𝓁↰≲⪍⪏[‘‚ł<⪦⩹⋖⋋⋉⥶⩻⦖◃⊴◂⥊⥦≨︀≨︀∺¯♂✠✠↦↦↧↤↥▮⨩м—∡𝔪℧µ∣*⫰·−⊟∸⨪⫛…∓⊧𝕞∓𝓂∾μ⊸⊸⋙̸≫⃒≫̸⇍⇎⋘̸≪⃒≪̸⇏⊯⊮∇ń∠⃒≉⩰̸≋̸ʼn≉♮♮ℕ\xA0≎̸≏̸⩃ňņ≇⩭̸⩂н–≠⇗⤤↗↗≐̸≢⤨≂̸∄∄𝔫≧̸≱≱≧̸⩾̸⩾̸≵≯≯⇎↮⫲∋⋼⋺∋њ⇍≦̸↚‥≰↚↮≰≦̸⩽̸⩽̸≮≴≮⋪⋬∤𝕟¬∉⋹̸⋵̸∉⋷⋶∌∌⋾⋽∦∦⫽⃥∂̸⨔⊀⋠⪯̸⊀⪯̸⇏↛⤳̸↝̸↛⋫⋭⊁⋡⪰̸𝓃∤∦≁≄≄∤∦⋢⋣⊄⫅̸⊈⊂⃒⊈⫅̸⊁⪰̸⊅⫆̸⊉⊃⃒⊉⫆̸≹ñ≸⋪⋬⋫⋭ν#№ ⊭⤄≍⃒⊬≥⃒>⃒⧞⤂≤⃒<⃒⊴⃒⤃⊵⃒∼⃒⇖⤣↖↖⤧Ⓢó⊛⊚ôо⊝ő⨸⊙⦼œ⦿𝔬˛ò⧁⦵Ω∮↺⦾⦻‾⧀ōωο⦶⊖𝕠⦷⦹⊕∨↻⩝ℴℴªº⊶⩖⩗⩛ℴø⊘õ⊗⨶ö⌽∥¶∥⫳⫽∂п%.‰⊥‱𝔭φϕℳ☎π⋔ϖℏℎℏ+⨣⊞⨢∔⨥⩲±⨦⨧±⨕𝕡£≺⪳⪷≼⪯≺⪷≼⪯⪹⪵⋨≾′ℙ⪵⪹⋨∏⌮⌒⌓∝∝≾⊰𝓅ψ 𝔮⨌𝕢⁗𝓆ℍ⨖?≟\"⇛⇒⤜⤏⥤∽̱ŕ√⦳⟩⦒⦥⟩»→⥵⇥⤠⤳⤞↪↬⥅⥴↣↝⤚∶ℚ⤍❳}]⦌⦎⦐řŗ⌉}р⤷⥩””↳ℜℛℜℝ▭®⥽⌋𝔯⇁⇀⥬ρϱ→↣⇁⇀⇄⇌⇉↝⋌˚≓⇄⇌‏⎱⎱⫮⟭⇾⟧⦆𝕣⨮⨵)⦔⨒⇉›𝓇↱]’’⋌⋊▹⊵▸⧎⥨℞ś‚≻⪴⪸š≽⪰şŝ⪶⪺⋩⨓≿с⋅⊡⩦⇘⤥↘↘§;⤩∖∖✶𝔰⌢♯щш∣∥­σςς∼⩪≃≃⪞⪠⪝⪟≆⨤⥲←∖⨳⧤∣⌣⪪⪬⪬︀ь/⧄⌿𝕤♠♠∥⊓⊓︀⊔⊔︀⊏⊑⊏⊑⊐⊒⊐⊒□□▪▪→𝓈∖⌣⋆☆★ϵϕ¯⊂⫅⪽⊆⫃⫁⫋⊊⪿⥹⊂⊆⫅⊊⫋⫇⫕⫓≻⪸≽⪰⪺⪶⋩≿∑♪⊃¹²³⫆⪾⫘⊇⫄⟉⫗⥻⫂⫌⊋⫀⊃⊇⫆⊋⫌⫈⫔⫖⇙⤦↙↙⤪ß⌖τ⎴ťţт⃛⌕𝔱∴∴θϑϑ≈∼ ≈∼þ˜×⊠⨱⨰∭⤨⊤⌶⫱𝕥⫚⤩‴™▵▿◃⊴≜▹⊵◬≜⨺⨹⧍⨻⏢𝓉цћŧ≬↞↠⇑⥣ú↑ўŭûу⇅ű⥮⥾𝔲ù↿↾▀⌜⌜⌏◸ū¨ų𝕦↑↕↿↾⊎υϒυ⇈⌝⌝⌎ů◹𝓊⋰ũ▵▴⇈ü⦧⇕⫨⫩⊨⦜ϵϰ∅ϕϖ∝↕ϱς⊊︀⫋︀⊋︀⫌︀ϑ⊲⊳в⊢∨⊻≚⋮||𝔳⊲⊂⃒⊃⃒𝕧∝⊳𝓋⫋︀⊊︀⫌︀⊋︀⦚ŵ⩟∧≙℘𝔴𝕨℘≀≀𝓌⋂◯⋃▽𝔵⟺⟷ξ⟸⟵⟼⋻⨀𝕩⨁⨂⟹⟶𝓍⨆⨄△⋁⋀ýяŷы¥𝔶ї𝕪𝓎юÿźžзżℨζ𝔷ж⇝𝕫𝓏‍‌"];
1234
+ /** Multiplier deriving the first candidate bucket from a key. */
1235
+ const BUCKET_HASH_1 = 0x9e3779b1;
1236
+ /** Multiplier deriving the second candidate bucket from a key. */
1237
+ const BUCKET_HASH_2 = 0x85ebca6b;
1238
+ /** Size of the (c0,c1) class table (10-bit index). */
1239
+ const PAIR_TABLE_SIZE = 1024;
1240
+ /**
1241
+ * Map an alphanumeric char code to 6 bits (1..62); 0 = not alphanumeric.
1242
+ * Used for the key's last-character field.
1259
1243
  */
1260
- function replaceCodePointXML(codePoint) {
1261
- return isInvalidCodePoint(codePoint) ? 65533 : codePoint;
1262
- }
1263
- //#endregion
1264
- //#region ../../node_modules/.pnpm/entities@8.1.0/node_modules/entities/dist/internal/decode-shared.js
1265
- const BASE91_INVERSE = /* #__PURE__ */ (() => {
1266
- const table = /* @__PURE__ */ new Uint8Array(127);
1267
- let code = 0;
1268
- for (let char = 33; char <= 126; char++) if (char !== 34 && char !== 36 && char !== 92) table[char] = code++;
1269
- return table;
1244
+ const CHAR_REMAP = (() => {
1245
+ const remap = /* @__PURE__ */ new Uint8Array(128);
1246
+ for (let code = 48; code <= 57; code++) remap[code] = code - 47;
1247
+ for (let code = 65; code <= 90; code++) remap[code] = code - 54;
1248
+ for (let code = 97; code <= 122; code++) remap[code] = code - 60;
1249
+ return remap;
1270
1250
  })();
1271
1251
  /**
1272
- * Decode a dictionary-encoded trie string back into its Uint16Array.
1273
- *
1274
- * Stream layout (consumed in this order):
1275
- * 1. dict1 atoms — `dict1AtomCount` uint16 values, delta+RLE encoded.
1276
- * 2. dict2 atoms — `atomCount - dict1AtomCount` values, delta+RLE.
1277
- * 3. dict2 ngrams — `ngramCount - (dictSize - dict1AtomCount)` entries,
1278
- * each a pair of slot codes that resolve to earlier slots.
1279
- * 4. dict1 ngrams — `dictSize - dict1AtomCount` entries, same shape.
1280
- * 5. data — slot codes, each expanding to one or more uint16 values.
1252
+ * The exact 32-bit key for a name occurring at `nameStart` with `length`
1253
+ * chars. Covers the first two and last two characters plus the length;
1254
+ * middle characters are verified separately against the names blob.
1281
1255
  *
1282
- * Codes use a 91-char base (printable ASCII minus `"`, `$`, `\`):
1283
- * - char1 < dictSize → 1-char code, slot = char1
1284
- * - char1 ≥ dictSize → 2-char code, slot = dictSize + (char1 - dictSize)*91 + char2
1285
- *
1286
- * Slot index → token kind:
1287
- * [0, A) dict1 atoms (1-char codes)
1288
- * [A, dictSize) dict1 ngrams (1-char codes)
1289
- * [dictSize, dictSize+D) dict2 atoms (2-char codes)
1290
- * [dictSize+D, end) dict2 ngrams (2-char codes)
1291
- *
1292
- * Both atom dicts decode before any ngram, and dict2 ngrams decode before
1293
- * dict1 ngrams. So every ngram entry references slots whose contents are
1294
- * already filled — no forward references to handle.
1295
- *
1296
- * This runs on library import. Flat typed arrays store each slot as either
1297
- * a plain value (`single`, covering every atom) or a range in a shared
1298
- * `pool` (ngrams).
1299
- * @param input Packed trie string.
1300
- * @param resultLength Expected number of uint16 values in the output.
1301
- * @param atomCount Total number of distinct uint16 values in the trie.
1302
- * @param dict1AtomCount Atoms in the 1-char range (`A` above).
1303
- * @param ngramCount Total number of ngram entries (dict1 + dict2).
1304
- * @param dictSize Number of 1-char code slots; the rest of `BASE - dictSize`
1305
- * first-byte values are 2-char codes.
1256
+ * The hot decoder inlines this computation; tests assert both stay in sync
1257
+ * by looking every entity up through the public API.
1258
+ * @param text Text containing the name.
1259
+ * @param nameStart Index of the name's first character.
1260
+ * @param length Length of the name.
1306
1261
  */
1307
- function decodeTrieDict(input, resultLength, atomCount, dict1AtomCount, ngramCount, dictSize) {
1308
- const base = 91;
1309
- const inputLength = input.length;
1310
- const twoCharBias = dictSize * 90;
1311
- let pos = 0;
1312
- /** Read one slot code at `pos` and return its slot index, advancing pos. */
1313
- const readSlotCode = () => {
1314
- const c1 = BASE91_INVERSE[input.charCodeAt(pos++)];
1315
- return c1 < dictSize ? c1 : c1 * base - twoCharBias + BASE91_INVERSE[input.charCodeAt(pos++)];
1316
- };
1317
- const dict2AtomCount = atomCount - dict1AtomCount;
1318
- const slotCount = atomCount + ngramCount;
1319
- const single = new Int32Array(slotCount);
1320
- single.fill(-1, dict1AtomCount, dictSize);
1321
- single.fill(-1, dictSize + dict2AtomCount, slotCount);
1322
- const start = new Int32Array(slotCount);
1323
- const length = new Int32Array(slotCount);
1324
- /**
1325
- * Decode `count` ascending uint16 values from a delta+RLE stream into
1326
- * `single[off..off+count)`.
1327
- *
1328
- * code < 89 → delta = code
1329
- * code == 89 → run-length: next char encodes runLength-2; emit `runLength` consecutive +1 values
1330
- * code == 90, next < 90 → escape: delta = 89 + next * BASE + after-next
1331
- * code == 90, next == 90 → double-escape: extra char for very large deltas
1332
- * @param count
1333
- * @param off
1334
- */
1335
- function decodeDelta(count, off) {
1336
- let previous = 0;
1337
- let slot = off;
1338
- const end = off + count;
1339
- while (slot < end) {
1340
- const code = BASE91_INVERSE[input.charCodeAt(pos++)];
1341
- if (code < 89) {
1342
- previous += code;
1343
- single[slot++] = previous;
1344
- } else if (code === 89) {
1345
- let runLength = BASE91_INVERSE[input.charCodeAt(pos++)] + 2;
1346
- while (runLength--) single[slot++] = ++previous;
1347
- } else {
1348
- const next = BASE91_INVERSE[input.charCodeAt(pos++)];
1349
- previous += 89 + (next < 90 ? next * base + BASE91_INVERSE[input.charCodeAt(pos++)] : BASE91_INVERSE[input.charCodeAt(pos++)] * 8281 + BASE91_INVERSE[input.charCodeAt(pos++)] * base + BASE91_INVERSE[input.charCodeAt(pos++)]);
1350
- single[slot++] = previous;
1351
- }
1352
- }
1353
- }
1354
- decodeDelta(dict1AtomCount, 0);
1355
- decodeDelta(dict2AtomCount, dictSize);
1356
- const references = new Int32Array(ngramCount * 2);
1357
- let poolSize = 0;
1358
- let ngramIndex = 0;
1359
- /**
1360
- * Read `count` ngram entries (each = 2 slot-code references) for the slots
1361
- * starting at `startSlot`, recording references and assigning pool ranges.
1362
- * @param count
1363
- * @param startSlot
1364
- */
1365
- function readNgramReferences(count, startSlot) {
1366
- for (let index = 0; index < count; index++) {
1367
- const slot = startSlot + index;
1368
- const a = readSlotCode();
1369
- const b = readSlotCode();
1370
- references[ngramIndex * 2] = a;
1371
- references[ngramIndex * 2 + 1] = b;
1372
- ngramIndex += 1;
1373
- start[slot] = poolSize;
1374
- const entryLength = (single[a] < 0 ? length[a] : 1) + (single[b] < 0 ? length[b] : 1);
1375
- length[slot] = entryLength;
1376
- poolSize += entryLength;
1377
- }
1378
- }
1379
- readNgramReferences(ngramCount - dictSize + dict1AtomCount, dictSize + dict2AtomCount);
1380
- readNgramReferences(dictSize - dict1AtomCount, dict1AtomCount);
1381
- const pool = new Uint16Array(poolSize);
1382
- let write = 0;
1383
- for (let index = 0; index < ngramIndex; index++) for (let half = 0; half < 2; half++) {
1384
- const source = references[index * 2 + half];
1385
- const value = single[source];
1386
- if (value < 0) {
1387
- let read = start[source];
1388
- const readEnd = read + length[source];
1389
- while (read < readEnd) pool[write++] = pool[read++];
1390
- } else pool[write++] = value;
1391
- }
1392
- const out = new Uint16Array(resultLength);
1393
- let outIndex = 0;
1394
- while (pos < inputLength) {
1395
- let slot = BASE91_INVERSE[input.charCodeAt(pos++)];
1396
- if (slot >= dictSize) slot = slot * base - twoCharBias + BASE91_INVERSE[input.charCodeAt(pos++)];
1397
- const value = single[slot];
1398
- if (value < 0) {
1399
- let read = start[slot];
1400
- const readEnd = read + length[slot];
1401
- while (read < readEnd) out[outIndex++] = pool[read++];
1402
- } else out[outIndex++] = value;
1403
- }
1404
- return out;
1405
- }
1406
- //#endregion
1407
- //#region ../../node_modules/.pnpm/entities@8.1.0/node_modules/entities/dist/generated/decode-data-html.js
1408
- /** Packed HTML decode trie data. */
1409
- const htmlDecodeTree = /* #__PURE__ */ decodeTrieDict("!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!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;hiM?C2F|XKsA>!a)-g<v{z;h[eb?C2F|]i[vrv{z;h]eb?C2F|^iZu.vix,hZq3ah!.(?C2F|QOu!5ShXM:2<BaY?C2F|P", 13494, 2713, 49, 25, 61);
1410
- //#endregion
1411
- //#region ../../node_modules/.pnpm/entities@8.1.0/node_modules/entities/dist/generated/decode-data-xml.js
1412
- /** Packed XML decode trie data. */
1413
- const xmlDecodeTree = /* #__PURE__ */ new Uint16Array([
1414
- 512,
1415
- 26465,
1416
- 29036,
1417
- 7,
1418
- 0,
1419
- 2,
1420
- 4,
1421
- 116,
1422
- 24638,
1423
- 116,
1424
- 24636,
1425
- 8693,
1426
- 29807,
1427
- 24610,
1428
- 621,
1429
- 1,
1430
- 0,
1431
- 0,
1432
- 3,
1433
- 112,
1434
- 24614,
1435
- 111,
1436
- 115,
1437
- 24615
1438
- ]);
1439
- //#endregion
1440
- //#region ../../node_modules/.pnpm/entities@8.1.0/node_modules/entities/dist/internal/bin-trie-flags.js
1262
+ function exactKey(text, nameStart, length) {
1263
+ return text.charCodeAt(nameStart) << 25 | text.charCodeAt(nameStart + 1) << 18 | text.charCodeAt(nameStart + length - 2) << 11 | CHAR_REMAP[text.charCodeAt(nameStart + length - 1)] << 5 | length;
1264
+ }
1441
1265
  /**
1442
- * Bit flags & masks for the binary trie encoding used for entity decoding.
1443
- *
1444
- * The trie is a flat `Uint16Array`. Every node starts with one header word:
1445
- *
1446
- * 15..14 VALUE_LENGTH Number of words the value occupies, +1.
1447
- * 0 = no value; 1 = value inline in bits 12..0;
1448
- * 2/3 = value in the 1/2 words after the header.
1449
- * 13 FLAG13 If VALUE_LENGTH > 0: semicolon required ("strict"
1450
- * entity; `;` is never stored as a branch).
1451
- * If VALUE_LENGTH == 0: this node is a compact run.
1452
- * 12..7 BRANCH_LENGTH Number of branches (or run length for runs).
1453
- * 6..0 JUMP_TABLE Jump-table offset / single-branch char / first
1454
- * run char (see below).
1455
- *
1456
- * Branch data follows the header and any value words. Its shape is selected
1457
- * by (JUMP_TABLE, BRANCH_LENGTH) in the header:
1458
- *
1459
- * Single branch JUMP_TABLE = the only child's char, BRANCH_LENGTH = 0.
1460
- * No branch words; the child node follows immediately.
1461
- * Jump table JUMP_TABLE = first covered char (> 0), BRANCH_LENGTH =
1462
- * table length. One word per covered char: 0 = no branch,
1463
- * otherwise the child's offset from the END of the table,
1464
- * +1 (so 0 stays the no-branch sentinel).
1465
- * Dictionary JUMP_TABLE = 0, BRANCH_LENGTH = number of branches.
1466
- * ceil(n/2) words of sorted keys packed two per word
1467
- * (low byte first), then n pointer words storing the
1468
- * child's offset from the END of the branch data.
1469
- * Compact run VALUE_LENGTH = 0, FLAG13 set. BRANCH_LENGTH = run
1470
- * length (3..63), JUMP_TABLE = first char; remaining run
1471
- * chars packed two per word after the header. The target
1472
- * node follows the packed words immediately.
1473
- *
1474
- * Pointers are end-relative (rather than relative to the pointer's own
1475
- * position) because that makes the common "child encoded right after the
1476
- * branch data" case a small constant, which compresses far better. Offsets
1477
- * to already-encoded (shared) nodes wrap via uint16 modulo arithmetic; the
1478
- * decoder masks navigation results with `& 0xff_ff` to match.
1266
+ * The 10-bit (c0,c1) class index used by the probe front end. The function
1267
+ * was chosen by exhaustive search over load-free mixers for minimal
1268
+ * candidate-set collisions on the real entity set.
1269
+ * @param c0 First char code of the candidate name.
1270
+ * @param c1 Second char code.
1271
+ */
1272
+ function pairIndex(c0, c1) {
1273
+ return (c0 * 3 << 3 ^ c1) & 1023;
1274
+ }
1275
+ /**
1276
+ * First candidate bucket for a key in a table of `buckets` buckets.
1277
+ * @param key Exact key.
1278
+ * @param buckets Bucket count.
1279
+ */
1280
+ function bucketOne(key, buckets) {
1281
+ return (Math.imul(key, BUCKET_HASH_1) >>> 16) * buckets >>> 16;
1282
+ }
1283
+ /**
1284
+ * Second candidate bucket for a key.
1285
+ * @param key Exact key.
1286
+ * @param buckets Bucket count.
1287
+ */
1288
+ function bucketTwo(key, buckets) {
1289
+ return (Math.imul(key, BUCKET_HASH_2) >>> 16) * buckets >>> 16;
1290
+ }
1291
+ /**
1292
+ * Build the lookup structures from a serialized dataset.
1293
+ * @param packed Serialized decode data, see `decode-data-format.ts`.
1479
1294
  */
1480
- var BinTrieFlags;
1481
- (function(BinTrieFlags) {
1482
- BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
1483
- BinTrieFlags[BinTrieFlags["FLAG13"] = 8192] = "FLAG13";
1484
- BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 8064] = "BRANCH_LENGTH";
1485
- BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE";
1486
- /** Bits 12..0: the inline value of a VALUE_LENGTH = 1 header word. */
1487
- BinTrieFlags[BinTrieFlags["VALUE_MASK"] = 8191] = "VALUE_MASK";
1488
- })(BinTrieFlags || (BinTrieFlags = {}));
1489
- //#endregion
1490
- //#region ../../node_modules/.pnpm/entities@8.1.0/node_modules/entities/dist/decode.js
1491
- var CharCodes;
1492
- (function(CharCodes) {
1493
- CharCodes[CharCodes["AMP"] = 38] = "AMP";
1494
- CharCodes[CharCodes["NUM"] = 35] = "NUM";
1495
- CharCodes[CharCodes["SEMI"] = 59] = "SEMI";
1496
- CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS";
1497
- CharCodes[CharCodes["ZERO"] = 48] = "ZERO";
1498
- CharCodes[CharCodes["NINE"] = 57] = "NINE";
1499
- CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A";
1500
- CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X";
1501
- })(CharCodes || (CharCodes = {}));
1295
+ function initDecodeData(packed) {
1296
+ const [data, values] = packed;
1297
+ const nameCount = data.charCodeAt(0) - 48 << 6 | data.charCodeAt(1) - 48;
1298
+ const suffixesLength = data.charCodeAt(2) - 48 << 6 | data.charCodeAt(3) - 48;
1299
+ const buckets = data.charCodeAt(4) - 48 << 6 | data.charCodeAt(5) - 48;
1300
+ const metaStart = 6 + suffixesLength;
1301
+ const choicesStart = metaStart + 2 * nameCount;
1302
+ const slotCount = 2 * buckets;
1303
+ const keys = new Int32Array(slotCount);
1304
+ const slotMidOff = new Uint16Array(slotCount);
1305
+ const slotValue = new Uint16Array(slotCount);
1306
+ const lengthBits = new Uint32Array(PAIR_TABLE_SIZE);
1307
+ const middleOffsets = /* @__PURE__ */ new Map();
1308
+ const middles = [];
1309
+ let name = "";
1310
+ let suffixOffset = 6;
1311
+ let valueOffset = 0;
1312
+ for (let index = 0; index < nameCount; index++) {
1313
+ const meta0 = data.charCodeAt(metaStart + 2 * index) - 35;
1314
+ const meta1 = data.charCodeAt(metaStart + 2 * index + 1) - 35;
1315
+ const prefixLength = meta0 & 31;
1316
+ const length = prefixLength + (meta1 & 31);
1317
+ const valueLength = (meta1 >> 5) + 1;
1318
+ name = name.slice(0, prefixLength) + data.slice(suffixOffset, suffixOffset + length - prefixLength);
1319
+ suffixOffset += length - prefixLength;
1320
+ const key = exactKey(name, 0, length);
1321
+ let slot = 2 * ((data.charCodeAt(choicesStart + Math.floor(index / 6)) - 48 & 1 << index % 6) === 0 ? bucketOne : bucketTwo)(key, buckets);
1322
+ if (keys[slot] !== 0) slot += 1;
1323
+ keys[slot] = key;
1324
+ if (length > 4) {
1325
+ const middle = name.slice(2, length - 2);
1326
+ const existing = middleOffsets.get(middle);
1327
+ if (existing === void 0) {
1328
+ middleOffsets.set(middle, middles.length);
1329
+ slotMidOff[slot] = middles.length;
1330
+ for (let middleIndex = 0; middleIndex < middle.length; middleIndex += 2) middles.push(middle.charCodeAt(middleIndex) | middle.charCodeAt(middleIndex + 1) << 16);
1331
+ } else slotMidOff[slot] = existing;
1332
+ }
1333
+ const pair = pairIndex(name.charCodeAt(0), name.charCodeAt(1));
1334
+ lengthBits[pair] |= length <= 16 ? 1 << length - 2 : 32768;
1335
+ if ((meta0 & 32) !== 0) lengthBits[pair] |= 1 << length - 2 + 16;
1336
+ slotValue[slot] = valueOffset << 2 | valueLength - 1 | (meta0 & 32) >> 4;
1337
+ valueOffset += valueLength;
1338
+ }
1339
+ return {
1340
+ keys,
1341
+ buckets,
1342
+ slotMidOff,
1343
+ slotValue,
1344
+ values,
1345
+ lengthBits,
1346
+ middles: new Uint32Array(middles)
1347
+ };
1348
+ }
1349
+ // ../../node_modules/.pnpm/entities@9.0.0/node_modules/entities/dist/decode.js
1350
+ const CHAR_NUM = 35;
1351
+ const CHAR_SEMI = 59;
1352
+ const CHAR_EQUALS = 61;
1353
+ const CHAR_ZERO = 48;
1354
+ const CHAR_LOWER_A = 97;
1355
+ const CHAR_LOWER_X = 120;
1356
+ const CHAR_UPPER_A = 65;
1502
1357
  /** Bit that needs to be set to convert an upper case ASCII character to lower case */
1503
1358
  const TO_LOWER_BIT = 32;
1504
1359
  /**
@@ -1507,13 +1362,10 @@ const TO_LOWER_BIT = 32;
1507
1362
  * @param code Code point to check.
1508
1363
  */
1509
1364
  function isNumber(code) {
1510
- return code - CharCodes.ZERO >>> 0 <= 9;
1365
+ return code - CHAR_ZERO >>> 0 <= 9;
1511
1366
  }
1512
- function isHexadecimalCharacter(code) {
1513
- return (code | TO_LOWER_BIT) - CharCodes.LOWER_A >>> 0 <= 5;
1514
- }
1515
- function isAlpha(code) {
1516
- return (code | TO_LOWER_BIT) - CharCodes.LOWER_A >>> 0 <= 25;
1367
+ function isAlphaNumeric(code) {
1368
+ return isNumber(code) || (code | TO_LOWER_BIT) - CHAR_LOWER_A >>> 0 <= 25;
1517
1369
  }
1518
1370
  /**
1519
1371
  * Checks if the given character is a valid end character for an entity in an attribute.
@@ -1523,16 +1375,8 @@ function isAlpha(code) {
1523
1375
  * @param code Code point to check.
1524
1376
  */
1525
1377
  function isEntityInAttributeInvalidEnd(code) {
1526
- return code === CharCodes.EQUALS || isAlpha(code) || isNumber(code);
1527
- }
1528
- var EntityDecoderState;
1529
- (function(EntityDecoderState) {
1530
- EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart";
1531
- EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart";
1532
- EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal";
1533
- EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex";
1534
- EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity";
1535
- })(EntityDecoderState || (EntityDecoderState = {}));
1378
+ return code === CHAR_EQUALS || isAlphaNumeric(code);
1379
+ }
1536
1380
  /**
1537
1381
  * Decoding mode for named entities.
1538
1382
  */
@@ -1545,81 +1389,146 @@ var DecodingMode;
1545
1389
  /** Entities in attributes have limitations on ending characters. */
1546
1390
  DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute";
1547
1391
  })(DecodingMode || (DecodingMode = {}));
1392
+ /** Decode data for HTML entities. */
1393
+ const htmlDecode = /* #__PURE__ */ initDecodeData(htmlDecodeData);
1394
+ const htmlKeys = /* #__PURE__ */ (() => htmlDecode.keys)();
1395
+ const htmlBuckets = /* #__PURE__ */ (() => htmlDecode.buckets)();
1396
+ const htmlSlotMidOff = /* #__PURE__ */ (() => htmlDecode.slotMidOff)();
1397
+ const htmlLengthBits = /* #__PURE__ */ (() => htmlDecode.lengthBits)();
1398
+ const htmlMiddles = /* #__PURE__ */ (() => htmlDecode.middles)();
1399
+ /** Hoisted for the specialized HTML cores; see `emitHtmlValue`. */
1400
+ const htmlSlotValue = /* #__PURE__ */ (() => htmlDecode.slotValue)();
1401
+ const htmlValues = /* #__PURE__ */ (() => htmlDecode.values)();
1402
+ /**
1403
+ * Find the slot matching `text[start..start+length)`, or -1. A match proves
1404
+ * every character of the span (exact key + middle comparison).
1405
+ * @param text Input text.
1406
+ * @param start Start of the span in `text`.
1407
+ * @param length Length of the span.
1408
+ */
1409
+ function findSlotHtml(text, start, length) {
1410
+ const c0 = text.charCodeAt(start);
1411
+ const c1 = text.charCodeAt(start + 1);
1412
+ const c2 = text.charCodeAt(start + length - 2);
1413
+ const c3 = text.charCodeAt(start + length - 1);
1414
+ if ((c0 | c1 | c2 | c3) > 127) return -1;
1415
+ const key = c0 << 25 | c1 << 18 | c2 << 11 | CHAR_REMAP[c3] << 5 | length;
1416
+ let slot = 2 * ((Math.imul(key, BUCKET_HASH_1) >>> 16) * htmlBuckets >>> 16);
1417
+ for (let attempt = 0;; attempt++) {
1418
+ if (htmlKeys[slot] === key && (length <= 4 || isMidMatchHtml(slot, text, start, length))) return slot;
1419
+ if (htmlKeys[slot + 1] === key && (length <= 4 || isMidMatchHtml(slot + 1, text, start, length))) return slot + 1;
1420
+ if (attempt === 1) return -1;
1421
+ slot = 2 * ((Math.imul(key, BUCKET_HASH_2) >>> 16) * htmlBuckets >>> 16);
1422
+ }
1423
+ }
1424
+ /**
1425
+ * Compare the middle characters (positions 2..length-3) of the candidate at
1426
+ * `slot` against the input. The key already proves the outer characters and
1427
+ * the length. Names of length at most four are accepted by the caller.
1428
+ * @param slot Slot of the candidate.
1429
+ * @param text Input text.
1430
+ * @param start Start of the span in `text`.
1431
+ * @param length Length of the span.
1432
+ */
1433
+ function isMidMatchHtml(slot, text, start, length) {
1434
+ let wordIndex = htmlSlotMidOff[slot];
1435
+ let index = start + 2;
1436
+ const end = start + length - 2;
1437
+ while (index + 1 < end) {
1438
+ if ((text.charCodeAt(index) | text.charCodeAt(index + 1) << 16) !== htmlMiddles[wordIndex++]) return false;
1439
+ index += 2;
1440
+ }
1441
+ return index === end || text.charCodeAt(index) === (htmlMiddles[wordIndex] & 65535);
1442
+ }
1443
+ /** ASCII digit values; 0xff marks characters outside the hexadecimal range. */
1444
+ const numericDigits = /* #__PURE__ */ (() => {
1445
+ const digits = (/* @__PURE__ */ new Uint8Array(128)).fill(255);
1446
+ for (let digit = 0; digit < 10; digit++) digits[CHAR_ZERO + digit] = digit;
1447
+ for (let digit = 0; digit < 6; digit++) {
1448
+ digits[CHAR_UPPER_A + digit] = digit + 10;
1449
+ digits[CHAR_LOWER_A + digit] = digit + 10;
1450
+ }
1451
+ return digits;
1452
+ })();
1453
+ /**
1454
+ * Find the longest legacy (semicolon-less) match for the name starting at
1455
+ * `start`, using the per-class legacy length bits. Returns
1456
+ * `slot << 3 | matchLength`, or -1 if there is no match. Only called after
1457
+ * the exact probes failed (the miss path).
1458
+ * @param input Input text.
1459
+ * @param start Start of the name.
1460
+ * @param maxLength Number of available run characters.
1461
+ */
1462
+ function findLegacySlot(input, start, maxLength) {
1463
+ let legacy = htmlLengthBits[pairIndex(input.charCodeAt(start), input.charCodeAt(start + 1))] >>> 16 & 31;
1464
+ while (legacy !== 0) {
1465
+ const top = 31 - Math.clz32(legacy);
1466
+ legacy ^= 1 << top;
1467
+ if (top + 2 > maxLength) continue;
1468
+ const slot = findSlotHtml(input, start, top + 2);
1469
+ if (slot >= 0 && (htmlSlotValue[slot] & 2) !== 0) return slot << 3 | top + 2;
1470
+ }
1471
+ return -1;
1472
+ }
1548
1473
  /**
1549
- * Token decoder with support of writing partial entities.
1474
+ * Match a class containing long names without probing all its shorter lengths.
1475
+ * The 32-character window bounds the scan even for invalid or unterminated runs.
1476
+ * Returns `(slot << 6) | consumed`, excluding the `&`, or -1 on a miss.
1477
+ * @param input Input containing the candidate name.
1478
+ * @param start Start of the name.
1479
+ * @param mode Decoding mode, including the rules for legacy matches.
1550
1480
  */
1551
- var EntityDecoder = class {
1552
- decodeTree;
1481
+ function findLongClassMatch(input, start, mode) {
1482
+ const length = input.slice(start, start + 32).indexOf(";");
1483
+ if (length - 2 >>> 0 <= 29) {
1484
+ const slot = findSlotHtml(input, start, length);
1485
+ if (slot >= 0) return slot << 6 | length + 1;
1486
+ }
1487
+ if (mode !== DecodingMode.Strict) {
1488
+ const packed = findLegacySlot(input, start, Math.min(31, input.length - start));
1489
+ if (packed >= 0) {
1490
+ const length = packed & 7;
1491
+ if (mode !== DecodingMode.Attribute || start + length >= input.length || !isEntityInAttributeInvalidEnd(input.charCodeAt(start + length))) return packed >> 3 << 6 | length;
1492
+ }
1493
+ }
1494
+ return -1;
1495
+ }
1496
+ const STATE_ENTITY_START = 0;
1497
+ const STATE_NUMERIC_START = 1;
1498
+ const STATE_NUMERIC_DECIMAL = 2;
1499
+ const STATE_NUMERIC_HEX = 3;
1500
+ const STATE_NAMED_ENTITY = 4;
1501
+ /**
1502
+ * Token decoder with support of writing partial entities; the shared base
1503
+ * of `HtmlEntityDecoder` and `XmlEntityDecoder`. Numeric entities are
1504
+ * identical in both document types and are handled here; named entities are
1505
+ * left to the subclasses.
1506
+ *
1507
+ * The decoder is driven by a tokenizer: after a `&`, write the following
1508
+ * input (possibly in chunks). `write` returns the number of characters
1509
+ * consumed once the entity is decided, or -1 while more input is needed.
1510
+ * Rejection may surface later than strictly possible (the decoder buffers
1511
+ * until a terminator or the name-length limit), but emitted code points,
1512
+ * consumed counts, and final return values are exact.
1513
+ */
1514
+ var EntityDecoderBase = class {
1553
1515
  emitCodePoint;
1554
1516
  errors;
1555
1517
  /** The current state of the decoder. */
1556
- state = EntityDecoderState.EntityStart;
1518
+ state = STATE_ENTITY_START;
1557
1519
  /** Characters that were consumed while parsing an entity. */
1558
1520
  consumed = 1;
1559
- /**
1560
- * The result of the entity.
1561
- *
1562
- * For named entities: the trie index of the best legacy match so far
1563
- * (0 = none). For numeric entities: the accumulated code point.
1564
- */
1521
+ /** Accumulated numeric code point, or a packed partial XML name. */
1565
1522
  result = 0;
1566
- /** The current index in the decode tree. */
1567
- treeIndex = 0;
1568
- /**
1569
- * Characters consumed since the last recorded legacy match, plus one.
1570
- * Invariant at the top of the `stateNamedEntity` loop: `excess` equals
1571
- * the number of unrecorded consumed characters + 1.
1572
- */
1573
- excess = 1;
1574
1523
  /** The mode in which the decoder is operating. */
1575
1524
  decodeMode = DecodingMode.Strict;
1576
- /** The number of characters that have been consumed in the current run. */
1577
- runConsumed = 0;
1578
- constructor(decodeTree, emitCodePoint, errors) {
1579
- this.decodeTree = decodeTree;
1525
+ /** Replacement rules for numeric character references. */
1526
+ replaceNumericCodePoint = replaceCodePoint;
1527
+ constructor(emitCodePoint, errors) {
1580
1528
  this.emitCodePoint = emitCodePoint;
1581
1529
  this.errors = errors;
1582
1530
  }
1583
1531
  /**
1584
- * Resets the instance to make it reusable.
1585
- * @param decodeMode Entity decoding mode to use.
1586
- */
1587
- startEntity(decodeMode) {
1588
- this.decodeMode = decodeMode;
1589
- this.state = EntityDecoderState.EntityStart;
1590
- this.result = 0;
1591
- this.treeIndex = 0;
1592
- this.excess = 1;
1593
- this.consumed = 1;
1594
- this.runConsumed = 0;
1595
- }
1596
- /**
1597
- * Write an entity to the decoder. This can be called multiple times with partial entities.
1598
- * If the entity is incomplete, the decoder will return -1.
1599
- *
1600
- * Mirrors the non-streaming `decodeWithTrie`, but with the ability to stop decoding if the
1601
- * entity is incomplete, and resume when the next string is written.
1602
- * @param input The string containing the entity (or a continuation of the entity).
1603
- * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
1604
- * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
1605
- */
1606
- write(input, offset) {
1607
- switch (this.state) {
1608
- case EntityDecoderState.EntityStart:
1609
- if (input.charCodeAt(offset) === CharCodes.NUM) {
1610
- this.state = EntityDecoderState.NumericStart;
1611
- this.consumed += 1;
1612
- return this.stateNumericStart(input, offset + 1);
1613
- }
1614
- this.state = EntityDecoderState.NamedEntity;
1615
- return this.stateNamedEntity(input, offset);
1616
- case EntityDecoderState.NumericStart: return this.stateNumericStart(input, offset);
1617
- case EntityDecoderState.NumericDecimal: return this.stateNumericDecimal(input, offset);
1618
- case EntityDecoderState.NumericHex: return this.stateNumericHex(input, offset);
1619
- default: return this.stateNamedEntity(input, offset);
1620
- }
1621
- }
1622
- /**
1623
1532
  * Switches between the numeric decimal and hexadecimal states.
1624
1533
  *
1625
1534
  * Equivalent to the `Numeric character reference state` in the HTML spec.
@@ -1629,40 +1538,37 @@ var EntityDecoder = class {
1629
1538
  */
1630
1539
  stateNumericStart(input, offset) {
1631
1540
  if (offset >= input.length) return -1;
1632
- if ((input.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
1633
- this.state = EntityDecoderState.NumericHex;
1541
+ if ((input.charCodeAt(offset) | TO_LOWER_BIT) === CHAR_LOWER_X) {
1542
+ this.state = STATE_NUMERIC_HEX;
1634
1543
  this.consumed += 1;
1635
1544
  return this.stateNumericHex(input, offset + 1);
1636
1545
  }
1637
- this.state = EntityDecoderState.NumericDecimal;
1546
+ this.state = STATE_NUMERIC_DECIMAL;
1638
1547
  return this.stateNumericDecimal(input, offset);
1639
1548
  }
1640
1549
  /**
1641
1550
  * Parses a hexadecimal numeric entity.
1642
1551
  *
1643
- * Equivalent to the `Hexademical character reference state` in the HTML
1644
- * spec. Digit parsing matches the hex loop in `parseNumericEntity`.
1645
- * The accumulated value is preserved for numeric validation callbacks.
1552
+ * Equivalent to the `Hexadecimal character reference state` in the HTML spec.
1646
1553
  * @param input The string containing the entity (or a continuation of the entity).
1647
1554
  * @param offset The current offset.
1648
1555
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
1649
1556
  */
1650
1557
  stateNumericHex(input, offset) {
1651
1558
  const inputLength = input.length;
1652
- let { result } = this;
1653
- let { consumed } = this;
1654
- while (offset < inputLength) {
1655
- const char = input.charCodeAt(offset);
1656
- if (isNumber(char) || isHexadecimalCharacter(char)) {
1657
- const digit = char <= CharCodes.NINE ? char - CharCodes.ZERO : (char | TO_LOWER_BIT) - CharCodes.LOWER_A + 10;
1658
- result = result * 16 + digit;
1659
- consumed += 1;
1660
- offset += 1;
1661
- } else {
1559
+ let { result, consumed } = this;
1560
+ let index = offset;
1561
+ while (index < inputLength) {
1562
+ const char = input.charCodeAt(index);
1563
+ const digit = numericDigits[char];
1564
+ if (digit <= 15) result = result * 16 + digit;
1565
+ else {
1662
1566
  this.result = result;
1663
1567
  this.consumed = consumed;
1664
1568
  return this.emitNumericEntity(char, 3);
1665
1569
  }
1570
+ consumed += 1;
1571
+ index += 1;
1666
1572
  }
1667
1573
  this.result = result;
1668
1574
  this.consumed = consumed;
@@ -1671,27 +1577,25 @@ var EntityDecoder = class {
1671
1577
  /**
1672
1578
  * Parses a decimal numeric entity.
1673
1579
  *
1674
- * Equivalent to the `Decimal character reference state` in the HTML
1675
- * spec. Digit parsing matches the decimal loop in `parseNumericEntity`.
1676
- * The accumulated value is preserved for numeric validation callbacks.
1580
+ * Equivalent to the `Decimal character reference state` in the HTML spec.
1677
1581
  * @param input The string containing the entity (or a continuation of the entity).
1678
1582
  * @param offset The current offset.
1679
1583
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
1680
1584
  */
1681
1585
  stateNumericDecimal(input, offset) {
1682
1586
  const inputLength = input.length;
1683
- let { result } = this;
1684
- let { consumed } = this;
1685
- while (offset < inputLength) {
1686
- const digit = input.charCodeAt(offset) - CharCodes.ZERO;
1587
+ let { result, consumed } = this;
1588
+ let index = offset;
1589
+ while (index < inputLength) {
1590
+ const digit = input.charCodeAt(index) - CHAR_ZERO;
1687
1591
  if (digit >>> 0 > 9) {
1688
1592
  this.result = result;
1689
1593
  this.consumed = consumed;
1690
- return this.emitNumericEntity(digit + CharCodes.ZERO, 2);
1594
+ return this.emitNumericEntity(digit + CHAR_ZERO, 2);
1691
1595
  }
1692
1596
  result = result * 10 + digit;
1693
1597
  consumed += 1;
1694
- offset += 1;
1598
+ index += 1;
1695
1599
  }
1696
1600
  this.result = result;
1697
1601
  this.consumed = consumed;
@@ -1700,7 +1604,7 @@ var EntityDecoder = class {
1700
1604
  /**
1701
1605
  * Validate and emit a numeric entity.
1702
1606
  *
1703
- * Implements the logic from the `Hexademical character reference start
1607
+ * Implements the logic from the `Hexadecimal character reference start
1704
1608
  * state` and `Numeric character reference end state` in the HTML spec.
1705
1609
  * @param lastCp The last code point of the entity. Used to see if the
1706
1610
  * entity was terminated with a semicolon.
@@ -1714,154 +1618,47 @@ var EntityDecoder = class {
1714
1618
  this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed);
1715
1619
  return 0;
1716
1620
  }
1717
- if (lastCp === CharCodes.SEMI) this.consumed += 1;
1621
+ if (lastCp === CHAR_SEMI) this.consumed += 1;
1718
1622
  else if (this.decodeMode === DecodingMode.Strict) return 0;
1719
- this.emitCodePoint((this.decodeTree === xmlDecodeTree ? replaceCodePointXML : replaceCodePoint)(this.result), this.consumed);
1623
+ this.emitCodePoint(this.replaceNumericCodePoint(this.result), this.consumed);
1720
1624
  if (this.errors) {
1721
- if (lastCp !== CharCodes.SEMI) this.errors.missingSemicolonAfterCharacterReference();
1625
+ if (lastCp !== CHAR_SEMI) this.errors.missingSemicolonAfterCharacterReference();
1722
1626
  this.errors.validateNumericCharacterReference(this.result);
1723
1627
  }
1724
1628
  return this.consumed;
1725
1629
  }
1726
1630
  /**
1727
- * Flush locally-tracked walk state back to the fields, then emit the
1728
- * recorded legacy match or reject (cold path — at most once per
1729
- * entity). Called after failed navigation (leaf node, branch miss, or
1730
- * compact-run mismatch). In attribute mode, reject if no legacy was
1731
- * recorded at the current node, if we descended past it, or if the
1732
- * pending input character is an invalid attribute terminator.
1733
- * @param consumed Locally-tracked consumed count.
1734
- * @param excess Locally-tracked excess count.
1735
- * @param char Pending input character (may be the mismatching char).
1736
- * @param valueLength Value length at the current trie node.
1631
+ * Resets the instance to make it reusable.
1632
+ * @param decodeMode Entity decoding mode to use.
1737
1633
  */
1738
- flushAndEmitLegacyOrReject(consumed, excess, char, valueLength) {
1739
- this.consumed = consumed;
1740
- this.excess = excess;
1741
- return this.result === 0 || this.decodeMode === DecodingMode.Attribute && (valueLength === 0 || excess > 1 || isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity();
1634
+ startEntity(decodeMode) {
1635
+ this.decodeMode = decodeMode;
1636
+ this.state = STATE_ENTITY_START;
1637
+ this.result = 0;
1638
+ this.consumed = 1;
1742
1639
  }
1743
1640
  /**
1744
- * Parses a named entity.
1745
- *
1746
- * Equivalent to the `Named character reference state` in the HTML spec.
1641
+ * Write an entity to the decoder. This can be called multiple times with partial entities.
1642
+ * If the entity is incomplete, the decoder will return -1.
1747
1643
  * @param input The string containing the entity (or a continuation of the entity).
1748
- * @param offset The current offset.
1644
+ * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
1749
1645
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
1750
1646
  */
1751
- stateNamedEntity(input, offset) {
1752
- const { decodeTree } = this;
1753
- const inputLength = input.length;
1754
- const isStrict = this.decodeMode === DecodingMode.Strict;
1755
- let { treeIndex } = this;
1756
- let { excess } = this;
1757
- let { consumed } = this;
1758
- let current = decodeTree[treeIndex];
1759
- while (offset < inputLength) {
1760
- while ((current & (BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13)) === 0 && (current & BinTrieFlags.JUMP_TABLE) !== 0) {
1761
- const char = input.charCodeAt(offset);
1762
- const jumpOffset = current & BinTrieFlags.JUMP_TABLE;
1763
- const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
1764
- if (branchCount === 0) {
1765
- if (char !== jumpOffset) return this.flushAndEmitLegacyOrReject(consumed, excess, char, 0);
1766
- treeIndex += 1;
1767
- } else {
1768
- const slot = char - jumpOffset;
1769
- if (slot >>> 0 >= branchCount) return this.flushAndEmitLegacyOrReject(consumed, excess, char, 0);
1770
- const stored = decodeTree[treeIndex + 1 + slot];
1771
- if (stored === 0) return this.flushAndEmitLegacyOrReject(consumed, excess, char, 0);
1772
- treeIndex = treeIndex + branchCount + stored & 65535;
1773
- }
1774
- current = decodeTree[treeIndex];
1775
- offset += 1;
1776
- excess += 1;
1777
- if (offset >= inputLength) break;
1778
- }
1779
- if (offset >= inputLength) break;
1780
- if ((current & (BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13)) === BinTrieFlags.FLAG13) {
1781
- const runLength = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
1782
- let { runConsumed } = this;
1783
- if (runConsumed === 0) {
1784
- const char = input.charCodeAt(offset);
1785
- if (char !== (current & BinTrieFlags.JUMP_TABLE)) return this.flushAndEmitLegacyOrReject(consumed, excess, char, 0);
1786
- offset += 1;
1787
- excess += 1;
1788
- runConsumed = 1;
1789
- }
1790
- while (runConsumed < runLength) {
1791
- if (offset >= inputLength) {
1792
- this.treeIndex = treeIndex;
1793
- this.excess = excess;
1794
- this.consumed = consumed;
1795
- this.runConsumed = runConsumed;
1796
- return -1;
1797
- }
1798
- const charIndexInPacked = runConsumed - 1;
1799
- const expectedChar = decodeTree[treeIndex + 1 + (charIndexInPacked >> 1)] >> ((charIndexInPacked & 1) << 3) & 255;
1800
- const char = input.charCodeAt(offset);
1801
- if (char !== expectedChar) {
1802
- this.runConsumed = 0;
1803
- return this.flushAndEmitLegacyOrReject(consumed, excess, char, 0);
1804
- }
1805
- offset += 1;
1806
- excess += 1;
1807
- runConsumed += 1;
1808
- }
1809
- this.runConsumed = 0;
1810
- treeIndex += 1 + (runLength >> 1);
1811
- current = decodeTree[treeIndex];
1812
- continue;
1813
- }
1814
- const valueLength = current >>> 14;
1815
- const char = input.charCodeAt(offset);
1816
- if (valueLength !== 0) {
1817
- if (!isStrict && (current & BinTrieFlags.FLAG13) === 0) {
1818
- this.result = treeIndex;
1819
- consumed += excess - 1;
1820
- excess = 1;
1647
+ write(input, offset) {
1648
+ switch (this.state) {
1649
+ case STATE_ENTITY_START:
1650
+ if (input.charCodeAt(offset) === CHAR_NUM) {
1651
+ this.state = STATE_NUMERIC_START;
1652
+ this.consumed += 1;
1653
+ return this.stateNumericStart(input, offset + 1);
1821
1654
  }
1822
- if (char === CharCodes.SEMI) return this.emitNamedEntityData(treeIndex, valueLength, consumed + excess);
1823
- if (valueLength === 1) return this.flushAndEmitLegacyOrReject(consumed, excess, char, valueLength);
1824
- }
1825
- const next = determineBranch(decodeTree, current, treeIndex + (valueLength || 1), char);
1826
- if (next < 0) return this.flushAndEmitLegacyOrReject(consumed, excess, char, valueLength);
1827
- treeIndex = next;
1828
- current = decodeTree[treeIndex];
1829
- offset += 1;
1830
- excess += 1;
1831
- }
1832
- if (!isStrict && current >>> 14 !== 0 && (current & BinTrieFlags.FLAG13) === 0) {
1833
- this.result = treeIndex;
1834
- consumed += excess - 1;
1835
- excess = 1;
1836
- }
1837
- this.treeIndex = treeIndex;
1838
- this.excess = excess;
1839
- this.consumed = consumed;
1840
- return -1;
1841
- }
1842
- /**
1843
- * Emit a named entity that was not terminated with a semicolon.
1844
- * @returns The number of characters consumed.
1845
- */
1846
- emitNotTerminatedNamedEntity() {
1847
- const { result, decodeTree } = this;
1848
- const valueLength = decodeTree[result] >>> 14;
1849
- this.emitNamedEntityData(result, valueLength, this.consumed);
1850
- this.errors?.missingSemicolonAfterCharacterReference();
1851
- return this.consumed;
1852
- }
1853
- /**
1854
- * Emit a named entity.
1855
- * @param result The index of the entity in the decode tree.
1856
- * @param valueLength Encoded value length (header plus any value words).
1857
- * @param consumed The number of characters consumed.
1858
- * @returns The number of characters consumed.
1859
- */
1860
- emitNamedEntityData(result, valueLength, consumed) {
1861
- const { decodeTree } = this;
1862
- this.emitCodePoint(valueLength === 1 ? decodeTree[result] & BinTrieFlags.VALUE_MASK : decodeTree[result + 1], consumed);
1863
- if (valueLength === 3) this.emitCodePoint(decodeTree[result + 2], consumed);
1864
- return consumed;
1655
+ this.state = STATE_NAMED_ENTITY;
1656
+ return this.stateNamedEntity(input, offset);
1657
+ case STATE_NUMERIC_START: return this.stateNumericStart(input, offset);
1658
+ case STATE_NUMERIC_DECIMAL: return this.stateNumericDecimal(input, offset);
1659
+ case STATE_NUMERIC_HEX: return this.stateNumericHex(input, offset);
1660
+ default: return this.stateNamedEntity(input, offset);
1661
+ }
1865
1662
  }
1866
1663
  /**
1867
1664
  * Signal to the parser that the end of the input was reached.
@@ -1871,10 +1668,10 @@ var EntityDecoder = class {
1871
1668
  */
1872
1669
  end() {
1873
1670
  switch (this.state) {
1874
- case EntityDecoderState.NamedEntity: return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
1875
- case EntityDecoderState.NumericDecimal: return this.emitNumericEntity(0, 2);
1876
- case EntityDecoderState.NumericHex: return this.emitNumericEntity(0, 3);
1877
- case EntityDecoderState.NumericStart:
1671
+ case STATE_NAMED_ENTITY: return this.endNamedEntity();
1672
+ case STATE_NUMERIC_DECIMAL: return this.emitNumericEntity(0, 2);
1673
+ case STATE_NUMERIC_HEX: return this.emitNumericEntity(0, 3);
1674
+ case STATE_NUMERIC_START:
1878
1675
  this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed);
1879
1676
  return 0;
1880
1677
  default: return 0;
@@ -1882,39 +1679,172 @@ var EntityDecoder = class {
1882
1679
  }
1883
1680
  };
1884
1681
  /**
1885
- * Determines the branch of the current node that is taken given the current
1886
- * character. This function is used to traverse the trie.
1682
+ * Streaming decoder for HTML entities.
1887
1683
  *
1888
- * See `BinTrieFlags` for the branch-data layouts handled here.
1889
- * @param decodeTree The trie.
1890
- * @param current The current node's header word.
1891
- * @param nodeIndex Index of the node's first branch-data word (the header
1892
- * plus any value words have been skipped by the caller).
1893
- * @param char The current character.
1894
- * @returns The index of the next node, or -1 if no branch is taken.
1684
+ * When the entity fits inside the current chunk (the common case), the
1685
+ * lookup runs directly on the chunk via the same length-probe scheme as the
1686
+ * synchronous decoder; chunk-boundary runs use a reusable character buffer.
1687
+ */
1688
+ var HtmlEntityDecoder = class extends EntityDecoderBase {
1689
+ /** Total name characters seen for the current named entity. */
1690
+ runLength = 0;
1691
+ /** Reused for ASCII alphanumerics; the 32nd character rules out an exact match. */
1692
+ nameBuffer = /* @__PURE__ */ new Uint8Array(32);
1693
+ /**
1694
+ * Emit the replacement for a matched slot. Values are at most two
1695
+ * UTF-16 code units; like previous versions, each unit is emitted as
1696
+ * its own callback (surrogate halves included).
1697
+ * @param slot The matched slot.
1698
+ */
1699
+ emitSlot(slot) {
1700
+ const packed = htmlSlotValue[slot];
1701
+ const off = packed >> 2;
1702
+ this.emitCodePoint(htmlValues.charCodeAt(off), this.consumed);
1703
+ if ((packed & 1) !== 0) this.emitCodePoint(htmlValues.charCodeAt(off + 1), this.consumed);
1704
+ }
1705
+ startEntity(decodeMode) {
1706
+ super.startEntity(decodeMode);
1707
+ this.runLength = 0;
1708
+ }
1709
+ stateNamedEntity(input, offset) {
1710
+ const inputLength = input.length;
1711
+ if (this.runLength === 0 && offset + 17 <= inputLength) {
1712
+ const pair = pairIndex(input.charCodeAt(offset), input.charCodeAt(offset + 1));
1713
+ const bits = htmlLengthBits[pair];
1714
+ if ((bits & 32768) !== 0 && offset + 32 <= inputLength) {
1715
+ const packed = findLongClassMatch(input, offset, this.decodeMode);
1716
+ if (packed >= 0) {
1717
+ const length = packed & 63;
1718
+ this.consumed = length + 1;
1719
+ this.emitSlot(packed >> 6);
1720
+ if (input.charCodeAt(offset + length - 1) !== CHAR_SEMI) this.errors?.missingSemicolonAfterCharacterReference();
1721
+ return this.consumed;
1722
+ }
1723
+ return 0;
1724
+ }
1725
+ let probed = bits & 32767;
1726
+ while (probed !== 0) {
1727
+ const low = probed & -probed;
1728
+ probed ^= low;
1729
+ const length = 33 - Math.clz32(low);
1730
+ if (input.charCodeAt(offset + length) === CHAR_SEMI) {
1731
+ const slot = findSlotHtml(input, offset, length);
1732
+ if (slot >= 0) {
1733
+ this.consumed = length + 2;
1734
+ this.emitSlot(slot);
1735
+ return this.consumed;
1736
+ }
1737
+ }
1738
+ }
1739
+ if ((bits & 32768) === 0) {
1740
+ if (this.decodeMode !== DecodingMode.Strict) {
1741
+ const packed = findLegacySlot(input, offset, 31);
1742
+ if (packed >= 0) {
1743
+ const matchLength = packed & 7;
1744
+ const next = input.charCodeAt(offset + matchLength);
1745
+ if (this.decodeMode === DecodingMode.Attribute && isEntityInAttributeInvalidEnd(next)) return 0;
1746
+ this.consumed = matchLength + 1;
1747
+ this.emitSlot(packed >> 3);
1748
+ this.errors?.missingSemicolonAfterCharacterReference();
1749
+ return this.consumed;
1750
+ }
1751
+ }
1752
+ return 0;
1753
+ }
1754
+ }
1755
+ let index = offset;
1756
+ let { runLength } = this;
1757
+ let terminator = -1;
1758
+ const scanEnd = Math.min(inputLength, offset + 32 - runLength);
1759
+ while (index < scanEnd) {
1760
+ const char = input.charCodeAt(index);
1761
+ if (!isAlphaNumeric(char)) {
1762
+ terminator = char;
1763
+ break;
1764
+ }
1765
+ this.nameBuffer[runLength++] = char;
1766
+ index++;
1767
+ }
1768
+ if (terminator < 0 && runLength < 32) {
1769
+ this.runLength = runLength;
1770
+ return -1;
1771
+ }
1772
+ if (terminator === CHAR_SEMI && runLength - 2 >>> 0 <= 29) {
1773
+ const slot = findBufferedHtmlSlot(this.nameBuffer, runLength);
1774
+ if (slot >= 0) {
1775
+ this.consumed = runLength + 2;
1776
+ this.emitSlot(slot);
1777
+ return this.consumed;
1778
+ }
1779
+ }
1780
+ if (this.decodeMode !== DecodingMode.Strict && runLength >= 2) {
1781
+ const packed = findBufferedLegacySlot(this.nameBuffer, runLength);
1782
+ if (packed >= 0) {
1783
+ const length = packed & 7;
1784
+ const next = length < runLength ? this.nameBuffer[length] : terminator;
1785
+ if (this.decodeMode === DecodingMode.Attribute && isEntityInAttributeInvalidEnd(next)) return 0;
1786
+ this.consumed = length + 1;
1787
+ this.emitSlot(packed >> 3);
1788
+ this.errors?.missingSemicolonAfterCharacterReference();
1789
+ return this.consumed;
1790
+ }
1791
+ }
1792
+ return 0;
1793
+ }
1794
+ endNamedEntity() {
1795
+ if (this.decodeMode === DecodingMode.Strict || this.runLength < 2) return 0;
1796
+ const packed = findBufferedLegacySlot(this.nameBuffer, this.runLength);
1797
+ if (packed < 0) return 0;
1798
+ if (this.decodeMode === DecodingMode.Attribute && (packed & 7) < this.runLength) return 0;
1799
+ this.consumed = (packed & 7) + 1;
1800
+ this.emitSlot(packed >> 3);
1801
+ this.errors?.missingSemicolonAfterCharacterReference();
1802
+ return this.consumed;
1803
+ }
1804
+ };
1805
+ /**
1806
+ * Find a buffered name. Its characters were already checked as ASCII
1807
+ * alphanumerics while scanning, so no outer-character range check is needed.
1808
+ * @param buffer Reusable character buffer.
1809
+ * @param length Number of characters to match.
1810
+ */
1811
+ function findBufferedHtmlSlot(buffer, length) {
1812
+ const key = buffer[0] << 25 | buffer[1] << 18 | buffer[length - 2] << 11 | CHAR_REMAP[buffer[length - 1]] << 5 | length;
1813
+ let slot = 2 * ((Math.imul(key, BUCKET_HASH_1) >>> 16) * htmlBuckets >>> 16);
1814
+ for (let attempt = 0;; attempt++) {
1815
+ if (htmlKeys[slot] === key && (length <= 4 || isBufferedMiddle(slot, buffer, length))) return slot;
1816
+ if (htmlKeys[slot + 1] === key && (length <= 4 || isBufferedMiddle(slot + 1, buffer, length))) return slot + 1;
1817
+ if (attempt === 1) return -1;
1818
+ slot = 2 * ((Math.imul(key, BUCKET_HASH_2) >>> 16) * htmlBuckets >>> 16);
1819
+ }
1820
+ }
1821
+ function isBufferedMiddle(slot, buffer, length) {
1822
+ let wordIndex = htmlSlotMidOff[slot];
1823
+ let index = 2;
1824
+ const end = length - 2;
1825
+ while (index + 1 < end) {
1826
+ if ((buffer[index] | buffer[index + 1] << 16) !== htmlMiddles[wordIndex++]) return false;
1827
+ index += 2;
1828
+ }
1829
+ return index === end || buffer[index] === (htmlMiddles[wordIndex] & 65535);
1830
+ }
1831
+ /**
1832
+ * Find the longest legacy name in the buffer, packed as `(slot << 3) | length`.
1833
+ * @param buffer Reusable character buffer.
1834
+ * @param length Number of buffered characters.
1895
1835
  */
1896
- function determineBranch(decodeTree, current, nodeIndex, char) {
1897
- const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
1898
- const jumpOffset = current & BinTrieFlags.JUMP_TABLE;
1899
- if (jumpOffset) {
1900
- if (branchCount === 0) return char === jumpOffset ? nodeIndex : -1;
1901
- const slot = char - jumpOffset;
1902
- if (slot >>> 0 >= branchCount) return -1;
1903
- const stored = decodeTree[nodeIndex + slot];
1904
- return stored === 0 ? -1 : nodeIndex + branchCount + stored - 1 & 65535;
1905
- }
1906
- if (branchCount === 0) return -1;
1907
- const packedKeySlots = branchCount + 1 >> 1;
1908
- const branchEnd = nodeIndex + packedKeySlots + branchCount;
1909
- for (let index = 0; index < branchCount; index++) {
1910
- const key = decodeTree[nodeIndex + (index >> 1)] >> ((index & 1) << 3) & 255;
1911
- if (key === char) return branchEnd + decodeTree[nodeIndex + packedKeySlots + index] & 65535;
1912
- if (key > char) return -1;
1836
+ function findBufferedLegacySlot(buffer, length) {
1837
+ let legacy = htmlLengthBits[pairIndex(buffer[0], buffer[1])] >>> 16 & 31;
1838
+ while (legacy !== 0) {
1839
+ const top = 31 - Math.clz32(legacy);
1840
+ legacy ^= 1 << top;
1841
+ if (top + 2 > length) continue;
1842
+ const slot = findBufferedHtmlSlot(buffer, top + 2);
1843
+ if (slot >= 0 && (htmlSlotValue[slot] & 2) !== 0) return slot << 3 | top + 2;
1913
1844
  }
1914
1845
  return -1;
1915
1846
  }
1916
- //#endregion
1917
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/common/html.js
1847
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/common/html.js
1918
1848
  /** All valid namespaces in HTML. */
1919
1849
  var NS;
1920
1850
  (function(NS) {
@@ -2436,7 +2366,7 @@ const SPECIAL_ELEMENTS = {
2436
2366
  [NS.XML]: /* @__PURE__ */ new Set(),
2437
2367
  [NS.XMLNS]: /* @__PURE__ */ new Set()
2438
2368
  };
2439
- const NUMBERED_HEADERS = /* @__PURE__ */ new Set([
2369
+ const NUMBERED_HEADERS$1 = /* @__PURE__ */ new Set([
2440
2370
  $.H1,
2441
2371
  $.H2,
2442
2372
  $.H3,
@@ -2456,8 +2386,8 @@ const UNESCAPED_TEXT = /* @__PURE__ */ new Set([
2456
2386
  function hasUnescapedText(tn, scriptingEnabled) {
2457
2387
  return UNESCAPED_TEXT.has(tn) || scriptingEnabled && tn === TAG_NAMES.NOSCRIPT;
2458
2388
  }
2459
- //#endregion
2460
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/tokenizer/index.js
2389
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/tokenizer/index.js
2390
+ const ATTR_NAME_SET_THRESHOLD = 64;
2461
2391
  var State;
2462
2392
  (function(State) {
2463
2393
  State[State["DATA"] = 0] = "DATA";
@@ -2561,7 +2491,7 @@ function toAsciiLower(cp) {
2561
2491
  return cp + 32;
2562
2492
  }
2563
2493
  function isWhitespace(cp) {
2564
- return cp === CODE_POINTS.SPACE || cp === CODE_POINTS.LINE_FEED || cp === CODE_POINTS.TABULATION || cp === CODE_POINTS.FORM_FEED;
2494
+ return cp === CODE_POINTS.SPACE || cp === CODE_POINTS.LINE_FEED || cp === CODE_POINTS.TABULATION || cp === CODE_POINTS.FORM_FEED || cp === CODE_POINTS.CARRIAGE_RETURN;
2565
2495
  }
2566
2496
  function isScriptDataDoubleEscapeSequenceEnd(cp) {
2567
2497
  return isWhitespace(cp) || cp === CODE_POINTS.SOLIDUS || cp === CODE_POINTS.GREATER_THAN_SIGN;
@@ -2600,11 +2530,21 @@ var Tokenizer = class {
2600
2530
  name: "",
2601
2531
  value: ""
2602
2532
  };
2533
+ this.currentAttrLocation = null;
2534
+ this.currentAttrNames = null;
2535
+ /**
2536
+ * `[start, end)` of `preprocessor.html` still to be appended to the attribute value, comment data or character
2537
+ * token being built (`_flushRun`): input that is used as is is appended as one slice, not a code point at a time.
2538
+ */
2539
+ this.runStart = 0;
2540
+ this.runEnd = 0;
2603
2541
  this.preprocessor = new Preprocessor(handler);
2604
2542
  this.currentLocation = this.getCurrentLocation(-1);
2605
- this.entityDecoder = new EntityDecoder(htmlDecodeTree, (cp, consumed) => {
2543
+ this.entityDecoder = new HtmlEntityDecoder((cp, consumed) => {
2606
2544
  this.preprocessor.pos = this.entityStartPos + consumed - 1;
2607
- this._flushCodePointConsumedAsCharacterReference(cp);
2545
+ if (!this._isCharacterReferenceInAttribute()) this._ensureCharacterToken(isWhitespace(cp) ? TokenType.WHITESPACE_CHARACTER : cp === CODE_POINTS.NULL ? TokenType.NULL_CHARACTER : TokenType.CHARACTER);
2546
+ this._extendRunWith(String.fromCodePoint(cp), 0);
2547
+ this.entityStartPos = this.preprocessor.pos - consumed + 1;
2608
2548
  }, handler.onParseError ? {
2609
2549
  missingSemicolonAfterCharacterReference: () => {
2610
2550
  this._err(ERR.missingSemicolonAfterCharacterReference, 1);
@@ -2643,6 +2583,76 @@ var Tokenizer = class {
2643
2583
  }
2644
2584
  this.inLoop = false;
2645
2585
  }
2586
+ /** Emit buffered character tokens without completing the current token or emitting EOF. */
2587
+ flushCharacters() {
2588
+ var _a;
2589
+ if (this.inLoop) throw new Error("Cannot flush characters from a tokenizer callback");
2590
+ const location = (_a = this.currentCharacterToken) === null || _a === void 0 ? void 0 : _a.location;
2591
+ let nextLocation = null;
2592
+ if (location) {
2593
+ nextLocation = this.getCharacterTokenEndLocation(location);
2594
+ this.currentLocation = nextLocation;
2595
+ }
2596
+ this.inLoop = true;
2597
+ try {
2598
+ this._emitCurrentCharacterToken(nextLocation);
2599
+ } finally {
2600
+ this.inLoop = false;
2601
+ }
2602
+ this._runParsingLoop();
2603
+ }
2604
+ getCharacterTokenEndLocation(location) {
2605
+ const endOffset = this.getCharacterTokenEndOffset();
2606
+ const html = this.preprocessor.html.slice(location.startOffset - this.preprocessor.droppedBufferSize, endOffset - this.preprocessor.droppedBufferSize);
2607
+ let line = location.startLine;
2608
+ let lastLineBreak = -1;
2609
+ for (let i = html.indexOf("\n"); i !== -1; i = html.indexOf("\n", i + 1)) {
2610
+ line++;
2611
+ lastLineBreak = i;
2612
+ }
2613
+ for (let i = html.indexOf("\r"); i !== -1; i = html.indexOf("\r", i + 1)) if (html.charCodeAt(i + 1) !== CODE_POINTS.LINE_FEED) {
2614
+ line++;
2615
+ lastLineBreak = Math.max(lastLineBreak, i);
2616
+ }
2617
+ return {
2618
+ startLine: line,
2619
+ startCol: lastLineBreak === -1 ? location.startCol + html.length : html.length - lastLineBreak,
2620
+ startOffset: endOffset,
2621
+ endLine: -1,
2622
+ endCol: -1,
2623
+ endOffset: -1
2624
+ };
2625
+ }
2626
+ getCharacterTokenEndOffset() {
2627
+ var _a;
2628
+ const end = this.preprocessor.droppedBufferSize + this.preprocessor.pos + 1;
2629
+ const tokenLocation = (_a = this.currentToken) === null || _a === void 0 ? void 0 : _a.location;
2630
+ switch (this.state) {
2631
+ case State.TAG_OPEN:
2632
+ case State.RCDATA_LESS_THAN_SIGN:
2633
+ case State.RAWTEXT_LESS_THAN_SIGN:
2634
+ case State.SCRIPT_DATA_LESS_THAN_SIGN:
2635
+ case State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:
2636
+ case State.CDATA_SECTION_BRACKET: return end - 1;
2637
+ case State.END_TAG_OPEN:
2638
+ case State.MARKUP_DECLARATION_OPEN:
2639
+ case State.RCDATA_END_TAG_OPEN:
2640
+ case State.RCDATA_END_TAG_NAME:
2641
+ case State.RAWTEXT_END_TAG_OPEN:
2642
+ case State.RAWTEXT_END_TAG_NAME:
2643
+ case State.SCRIPT_DATA_END_TAG_OPEN:
2644
+ case State.SCRIPT_DATA_END_TAG_NAME:
2645
+ case State.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:
2646
+ case State.SCRIPT_DATA_ESCAPED_END_TAG_NAME:
2647
+ case State.CDATA_SECTION_END: return end - 2;
2648
+ case State.CHARACTER_REFERENCE: return this._isCharacterReferenceInAttribute() && tokenLocation ? tokenLocation.startOffset : this.preprocessor.droppedBufferSize + this.entityStartPos;
2649
+ case State.DOCTYPE:
2650
+ case State.BEFORE_DOCTYPE_NAME: return this.currentLocation.startOffset;
2651
+ default:
2652
+ if (tokenLocation && (this.state === State.TAG_NAME || this.state >= State.BEFORE_ATTRIBUTE_NAME && this.state <= State.BOGUS_COMMENT || this.state >= State.COMMENT_START && this.state <= State.BOGUS_DOCTYPE)) return tokenLocation.startOffset;
2653
+ return end;
2654
+ }
2655
+ }
2646
2656
  pause() {
2647
2657
  this.paused = true;
2648
2658
  }
@@ -2664,6 +2674,18 @@ var Tokenizer = class {
2664
2674
  this.preprocessor.insertHtmlAtCurrentPos(chunk);
2665
2675
  this._runParsingLoop();
2666
2676
  }
2677
+ /** @internal Flush completed streaming text without splitting an unfinished token. */
2678
+ flushCurrentCharacterToken() {
2679
+ if (this.paused || this.active || !this.currentCharacterToken || this.currentToken || this.state === State.DOCTYPE || this.state === State.BEFORE_DOCTYPE_NAME || !this.preprocessor.willDropParsedChunk()) return;
2680
+ const pending = this.preprocessor.droppedBufferSize + this.preprocessor.pos + 1 - this.getCharacterTokenEndOffset();
2681
+ this.preprocessor.advance();
2682
+ this.currentLocation = this.getCurrentLocation(pending);
2683
+ this.preprocessor.retreat(1);
2684
+ this._emitCurrentCharacterToken(this.currentLocation);
2685
+ this._createCharacterToken(TokenType.CHARACTER);
2686
+ this.preprocessor.dropParsedChunk(Math.max(pending - 1, 0));
2687
+ this.entityStartPos = this.preprocessor.pos + 1 - pending;
2688
+ }
2667
2689
  _ensureHibernation() {
2668
2690
  if (this.preprocessor.endOfChunkHit) {
2669
2691
  this.preprocessor.retreat(this.consumedAfterSnapshot);
@@ -2689,6 +2711,7 @@ var Tokenizer = class {
2689
2711
  return false;
2690
2712
  }
2691
2713
  _createStartTagToken() {
2714
+ this._flushRun("");
2692
2715
  this.currentToken = {
2693
2716
  type: TokenType.START_TAG,
2694
2717
  tagName: "",
@@ -2700,6 +2723,7 @@ var Tokenizer = class {
2700
2723
  };
2701
2724
  }
2702
2725
  _createEndTagToken() {
2726
+ this._flushRun("");
2703
2727
  this.currentToken = {
2704
2728
  type: TokenType.END_TAG,
2705
2729
  tagName: "",
@@ -2711,6 +2735,7 @@ var Tokenizer = class {
2711
2735
  };
2712
2736
  }
2713
2737
  _createCommentToken(offset) {
2738
+ this._flushRun("");
2714
2739
  this.currentToken = {
2715
2740
  type: TokenType.COMMENT,
2716
2741
  data: "",
@@ -2718,6 +2743,7 @@ var Tokenizer = class {
2718
2743
  };
2719
2744
  }
2720
2745
  _createDoctypeToken(initialName) {
2746
+ this._flushRun("");
2721
2747
  this.currentToken = {
2722
2748
  type: TokenType.DOCTYPE,
2723
2749
  name: initialName,
@@ -2727,40 +2753,105 @@ var Tokenizer = class {
2727
2753
  location: this.currentLocation
2728
2754
  };
2729
2755
  }
2730
- _createCharacterToken(type, chars) {
2756
+ _createCharacterToken(type) {
2757
+ if (this.currentLocation) {
2758
+ const start = this.currentLocation.startOffset - this.preprocessor.droppedBufferSize;
2759
+ if (this.preprocessor.html[start] === "\n" && this.preprocessor.html[start - 1] === "\r") this.currentLocation.startOffset++;
2760
+ }
2731
2761
  this.currentCharacterToken = {
2732
2762
  type,
2733
- chars,
2763
+ chars: "",
2734
2764
  location: this.currentLocation
2735
2765
  };
2736
2766
  }
2737
2767
  _createAttr(attrNameFirstCh) {
2768
+ this._flushRun("");
2738
2769
  this.currentAttr = {
2739
2770
  name: attrNameFirstCh,
2740
2771
  value: ""
2741
2772
  };
2742
- this.currentLocation = this.getCurrentLocation(0);
2773
+ this.currentAttrLocation = this.getCurrentLocation(0);
2743
2774
  }
2744
2775
  _leaveAttrName() {
2745
2776
  var _a;
2746
2777
  var _b;
2747
2778
  const token = this.currentToken;
2748
- if (getTokenAttr(token, this.currentAttr.name) === null) {
2779
+ const { name } = this.currentAttr;
2780
+ const names = this.currentAttrNames;
2781
+ let duplicate;
2782
+ if (names === null) {
2783
+ duplicate = getTokenAttr(token, name) !== null;
2784
+ if (!duplicate && token.attrs.length === ATTR_NAME_SET_THRESHOLD) this.currentAttrNames = new Set(token.attrs.map((attr) => attr.name)).add(name);
2785
+ } else {
2786
+ duplicate = names.has(name);
2787
+ if (!duplicate) names.add(name);
2788
+ }
2789
+ if (duplicate) this._err(ERR.duplicateAttribute);
2790
+ else {
2749
2791
  token.attrs.push(this.currentAttr);
2750
- if (token.location && this.currentLocation) {
2792
+ if (token.location && this.currentAttrLocation) {
2751
2793
  const attrLocations = (_a = (_b = token.location).attrs) !== null && _a !== void 0 ? _a : _b.attrs = Object.create(null);
2752
- attrLocations[this.currentAttr.name] = this.currentLocation;
2794
+ attrLocations[this.currentAttr.name] = this.currentAttrLocation;
2753
2795
  this._leaveAttrValue();
2754
2796
  }
2755
- } else this._err(ERR.duplicateAttribute);
2797
+ }
2756
2798
  }
2757
2799
  _leaveAttrValue() {
2758
- if (this.currentLocation) {
2759
- this.currentLocation.endLine = this.preprocessor.line;
2760
- this.currentLocation.endCol = this.preprocessor.col;
2761
- this.currentLocation.endOffset = this.preprocessor.offset;
2800
+ if (this.currentAttrLocation) {
2801
+ this.currentAttrLocation.endLine = this.preprocessor.line;
2802
+ this.currentAttrLocation.endCol = this.preprocessor.col;
2803
+ this.currentAttrLocation.endOffset = this.preprocessor.offset;
2762
2804
  }
2763
2805
  }
2806
+ /**
2807
+ * Append the pending run and `text` to the attribute value, comment data or character token being built.
2808
+ * The run is a string of its own: V8 copies a slice of fewer than 13 characters but lets a longer one share
2809
+ * the input's buffer, which would keep that buffer alive for as long as any attribute value or text cut from
2810
+ * it is; a concatenation is flattened into a buffer of its own when it is sliced.
2811
+ */
2812
+ _flushRun(text) {
2813
+ if (this.runEnd === this.runStart && text.length === 0) return;
2814
+ const slice = this.preprocessor.html.slice(this.runStart, this.runEnd);
2815
+ const run = (slice.length < 13 ? slice : ` ${slice}`.slice(1)) + text;
2816
+ const token = this.currentToken;
2817
+ this.runStart = this.runEnd;
2818
+ if (token === null) this.currentCharacterToken.chars += run;
2819
+ else if (token.type === TokenType.COMMENT) token.data += run;
2820
+ else this.currentAttr.value += run;
2821
+ }
2822
+ /** Extend the pending run by the current input code point, read as `cp`, or flush it and start a new one. */
2823
+ _extendRun(cp) {
2824
+ const { preprocessor } = this;
2825
+ if (cp === CODE_POINTS.LINE_FEED && preprocessor.html.charCodeAt(preprocessor.pos) !== CODE_POINTS.LINE_FEED) {
2826
+ this._flushRun("\n");
2827
+ this.runStart = preprocessor.pos + 1;
2828
+ } else {
2829
+ const start = preprocessor.pos - Number(cp > 65535);
2830
+ if (start !== this.runEnd) {
2831
+ this._flushRun("");
2832
+ this.runStart = start;
2833
+ }
2834
+ }
2835
+ this.runEnd = preprocessor.pos + 1;
2836
+ }
2837
+ /**
2838
+ * Extend the pending run by `text`, the input that ends `cpOffset` code points after the current one, or flush
2839
+ * the run and append `text` where the input differs (a NUL replacement, a decoded reference, a dropped chunk).
2840
+ */
2841
+ _extendRunWith(text, cpOffset) {
2842
+ const { preprocessor } = this;
2843
+ const start = preprocessor.codePointStart + 1 + cpOffset - text.length;
2844
+ if (start >= 0 && preprocessor.html.startsWith(text, start)) {
2845
+ if (start !== this.runEnd) {
2846
+ this._flushRun("");
2847
+ this.runStart = start;
2848
+ }
2849
+ } else {
2850
+ this._flushRun(text);
2851
+ this.runStart = start + text.length;
2852
+ }
2853
+ this.runEnd = start + text.length;
2854
+ }
2764
2855
  prepareToken(ct) {
2765
2856
  this._emitCurrentCharacterToken(ct.location);
2766
2857
  this.currentToken = null;
@@ -2773,6 +2864,7 @@ var Tokenizer = class {
2773
2864
  }
2774
2865
  emitCurrentTagToken() {
2775
2866
  const ct = this.currentToken;
2867
+ this.currentAttrNames = null;
2776
2868
  this.prepareToken(ct);
2777
2869
  ct.tagID = getTagID(ct.tagName);
2778
2870
  if (ct.type === TokenType.START_TAG) {
@@ -2796,6 +2888,7 @@ var Tokenizer = class {
2796
2888
  this.preprocessor.dropParsedChunk();
2797
2889
  }
2798
2890
  _emitCurrentCharacterToken(nextLocation) {
2891
+ this._flushRun("");
2799
2892
  if (this.currentCharacterToken) {
2800
2893
  if (nextLocation && this.currentCharacterToken.location) {
2801
2894
  this.currentCharacterToken.location.endLine = nextLocation.startLine;
@@ -2815,38 +2908,44 @@ var Tokenizer = class {
2815
2908
  }
2816
2909
  }
2817
2910
  _emitEOFToken() {
2911
+ var _a, _b;
2818
2912
  const location = this.getCurrentLocation(0);
2819
2913
  if (location) {
2820
2914
  location.endLine = location.startLine;
2821
2915
  location.endCol = location.startCol;
2822
2916
  location.endOffset = location.startOffset;
2823
2917
  }
2824
- this._emitCurrentCharacterToken(location);
2918
+ this._emitCurrentCharacterToken((_b = (_a = this.currentToken) === null || _a === void 0 ? void 0 : _a.location) !== null && _b !== void 0 ? _b : location);
2825
2919
  this.handler.onEof({
2826
2920
  type: TokenType.EOF,
2827
2921
  location
2828
2922
  });
2829
2923
  this.active = false;
2830
2924
  }
2831
- _appendCharToCurrentCharacterToken(type, ch) {
2925
+ /** Make the current character token one of `type`, emitting the current one if it has another type. */
2926
+ _ensureCharacterToken(type) {
2832
2927
  if (this.currentCharacterToken) {
2833
- if (this.currentCharacterToken.type === type) {
2834
- this.currentCharacterToken.chars += ch;
2835
- return;
2836
- } else {
2837
- this.currentLocation = this.getCurrentLocation(0);
2838
- this._emitCurrentCharacterToken(this.currentLocation);
2839
- this.preprocessor.dropParsedChunk();
2840
- }
2928
+ if (this.currentCharacterToken.type === type) return;
2929
+ this.currentLocation = this.getCurrentLocation(0);
2930
+ this._emitCurrentCharacterToken(this.currentLocation);
2931
+ this.preprocessor.dropParsedChunk();
2841
2932
  }
2842
- this._createCharacterToken(type, ch);
2933
+ this._createCharacterToken(type);
2843
2934
  }
2935
+ /** Emit the current input code point, read as `cp`. */
2844
2936
  _emitCodePoint(cp) {
2845
2937
  const type = isWhitespace(cp) ? TokenType.WHITESPACE_CHARACTER : cp === CODE_POINTS.NULL ? TokenType.NULL_CHARACTER : TokenType.CHARACTER;
2846
- this._appendCharToCurrentCharacterToken(type, cp < 65536 ? String.fromCharCode(cp) : String.fromCodePoint(cp));
2847
- }
2848
- _emitChars(ch) {
2849
- this._appendCharToCurrentCharacterToken(TokenType.CHARACTER, ch);
2938
+ const token = this.currentCharacterToken;
2939
+ if (token === null || token.type !== type) this._ensureCharacterToken(type);
2940
+ this._extendRun(cp);
2941
+ }
2942
+ _emitChars(ch, cpOffset = 0) {
2943
+ if (this.options.sourceCodeLocationInfo && cpOffset !== 0 && this.currentCharacterToken && this.currentCharacterToken.type !== TokenType.CHARACTER) {
2944
+ this.currentLocation = this.getCurrentLocation(ch.length - 1 - cpOffset);
2945
+ this._emitCurrentCharacterToken(this.currentLocation);
2946
+ this._createCharacterToken(TokenType.CHARACTER);
2947
+ } else this._ensureCharacterToken(TokenType.CHARACTER);
2948
+ this._extendRunWith(ch, cpOffset);
2850
2949
  }
2851
2950
  _startCharacterReference() {
2852
2951
  this.returnState = this.state;
@@ -2858,7 +2957,7 @@ var Tokenizer = class {
2858
2957
  return this.returnState === State.ATTRIBUTE_VALUE_DOUBLE_QUOTED || this.returnState === State.ATTRIBUTE_VALUE_SINGLE_QUOTED || this.returnState === State.ATTRIBUTE_VALUE_UNQUOTED;
2859
2958
  }
2860
2959
  _flushCodePointConsumedAsCharacterReference(cp) {
2861
- if (this._isCharacterReferenceInAttribute()) this.currentAttr.value += String.fromCodePoint(cp);
2960
+ if (this._isCharacterReferenceInAttribute()) this._extendRun(cp);
2862
2961
  else this._emitCodePoint(cp);
2863
2962
  }
2864
2963
  _callState(cp) {
@@ -3183,12 +3282,12 @@ var Tokenizer = class {
3183
3282
  break;
3184
3283
  case CODE_POINTS.EOF:
3185
3284
  this._err(ERR.eofBeforeTagName);
3186
- this._emitChars("<");
3285
+ this._emitChars("<", -1);
3187
3286
  this._emitEOFToken();
3188
3287
  break;
3189
3288
  default:
3190
3289
  this._err(ERR.invalidFirstCharacterOfTagName);
3191
- this._emitChars("<");
3290
+ this._emitChars("<", -1);
3192
3291
  this.state = State.DATA;
3193
3292
  this._stateData(cp);
3194
3293
  }
@@ -3205,7 +3304,7 @@ var Tokenizer = class {
3205
3304
  break;
3206
3305
  case CODE_POINTS.EOF:
3207
3306
  this._err(ERR.eofBeforeTagName);
3208
- this._emitChars("</");
3307
+ this._emitChars("</", -1);
3209
3308
  this._emitEOFToken();
3210
3309
  break;
3211
3310
  default:
@@ -3245,7 +3344,7 @@ var Tokenizer = class {
3245
3344
  _stateRcdataLessThanSign(cp) {
3246
3345
  if (cp === CODE_POINTS.SOLIDUS) this.state = State.RCDATA_END_TAG_OPEN;
3247
3346
  else {
3248
- this._emitChars("<");
3347
+ this._emitChars("<", -1);
3249
3348
  this.state = State.RCDATA;
3250
3349
  this._stateRcdata(cp);
3251
3350
  }
@@ -3255,7 +3354,7 @@ var Tokenizer = class {
3255
3354
  this.state = State.RCDATA_END_TAG_NAME;
3256
3355
  this._stateRcdataEndTagName(cp);
3257
3356
  } else {
3258
- this._emitChars("</");
3357
+ this._emitChars("</", -1);
3259
3358
  this.state = State.RCDATA;
3260
3359
  this._stateRcdata(cp);
3261
3360
  }
@@ -3282,12 +3381,14 @@ var Tokenizer = class {
3282
3381
  this.emitCurrentTagToken();
3283
3382
  this.state = State.DATA;
3284
3383
  return false;
3285
- default: return !this._ensureHibernation();
3384
+ default:
3385
+ this.currentToken = null;
3386
+ return !this._ensureHibernation();
3286
3387
  }
3287
3388
  }
3288
3389
  _stateRcdataEndTagName(cp) {
3289
3390
  if (this.handleSpecialEndTag(cp)) {
3290
- this._emitChars("</");
3391
+ this._emitChars("</", -1);
3291
3392
  this.state = State.RCDATA;
3292
3393
  this._stateRcdata(cp);
3293
3394
  }
@@ -3295,7 +3396,7 @@ var Tokenizer = class {
3295
3396
  _stateRawtextLessThanSign(cp) {
3296
3397
  if (cp === CODE_POINTS.SOLIDUS) this.state = State.RAWTEXT_END_TAG_OPEN;
3297
3398
  else {
3298
- this._emitChars("<");
3399
+ this._emitChars("<", -1);
3299
3400
  this.state = State.RAWTEXT;
3300
3401
  this._stateRawtext(cp);
3301
3402
  }
@@ -3305,14 +3406,14 @@ var Tokenizer = class {
3305
3406
  this.state = State.RAWTEXT_END_TAG_NAME;
3306
3407
  this._stateRawtextEndTagName(cp);
3307
3408
  } else {
3308
- this._emitChars("</");
3409
+ this._emitChars("</", -1);
3309
3410
  this.state = State.RAWTEXT;
3310
3411
  this._stateRawtext(cp);
3311
3412
  }
3312
3413
  }
3313
3414
  _stateRawtextEndTagName(cp) {
3314
3415
  if (this.handleSpecialEndTag(cp)) {
3315
- this._emitChars("</");
3416
+ this._emitChars("</", -1);
3316
3417
  this.state = State.RAWTEXT;
3317
3418
  this._stateRawtext(cp);
3318
3419
  }
@@ -3327,7 +3428,7 @@ var Tokenizer = class {
3327
3428
  this._emitChars("<!");
3328
3429
  break;
3329
3430
  default:
3330
- this._emitChars("<");
3431
+ this._emitChars("<", -1);
3331
3432
  this.state = State.SCRIPT_DATA;
3332
3433
  this._stateScriptData(cp);
3333
3434
  }
@@ -3337,14 +3438,14 @@ var Tokenizer = class {
3337
3438
  this.state = State.SCRIPT_DATA_END_TAG_NAME;
3338
3439
  this._stateScriptDataEndTagName(cp);
3339
3440
  } else {
3340
- this._emitChars("</");
3441
+ this._emitChars("</", -1);
3341
3442
  this.state = State.SCRIPT_DATA;
3342
3443
  this._stateScriptData(cp);
3343
3444
  }
3344
3445
  }
3345
3446
  _stateScriptDataEndTagName(cp) {
3346
3447
  if (this.handleSpecialEndTag(cp)) {
3347
- this._emitChars("</");
3448
+ this._emitChars("</", -1);
3348
3449
  this.state = State.SCRIPT_DATA;
3349
3450
  this._stateScriptData(cp);
3350
3451
  }
@@ -3439,11 +3540,11 @@ var Tokenizer = class {
3439
3540
  _stateScriptDataEscapedLessThanSign(cp) {
3440
3541
  if (cp === CODE_POINTS.SOLIDUS) this.state = State.SCRIPT_DATA_ESCAPED_END_TAG_OPEN;
3441
3542
  else if (isAsciiLetter(cp)) {
3442
- this._emitChars("<");
3543
+ this._emitChars("<", -1);
3443
3544
  this.state = State.SCRIPT_DATA_DOUBLE_ESCAPE_START;
3444
3545
  this._stateScriptDataDoubleEscapeStart(cp);
3445
3546
  } else {
3446
- this._emitChars("<");
3547
+ this._emitChars("<", -1);
3447
3548
  this.state = State.SCRIPT_DATA_ESCAPED;
3448
3549
  this._stateScriptDataEscaped(cp);
3449
3550
  }
@@ -3453,14 +3554,14 @@ var Tokenizer = class {
3453
3554
  this.state = State.SCRIPT_DATA_ESCAPED_END_TAG_NAME;
3454
3555
  this._stateScriptDataEscapedEndTagName(cp);
3455
3556
  } else {
3456
- this._emitChars("</");
3557
+ this._emitChars("</", -1);
3457
3558
  this.state = State.SCRIPT_DATA_ESCAPED;
3458
3559
  this._stateScriptDataEscaped(cp);
3459
3560
  }
3460
3561
  }
3461
3562
  _stateScriptDataEscapedEndTagName(cp) {
3462
3563
  if (this.handleSpecialEndTag(cp)) {
3463
- this._emitChars("</");
3564
+ this._emitChars("</", -1);
3464
3565
  this.state = State.SCRIPT_DATA_ESCAPED;
3465
3566
  this._stateScriptDataEscaped(cp);
3466
3567
  }
@@ -3677,13 +3778,13 @@ var Tokenizer = class {
3677
3778
  break;
3678
3779
  case CODE_POINTS.NULL:
3679
3780
  this._err(ERR.unexpectedNullCharacter);
3680
- this.currentAttr.value += "�";
3781
+ this._extendRunWith("�", 0);
3681
3782
  break;
3682
3783
  case CODE_POINTS.EOF:
3683
3784
  this._err(ERR.eofInTag);
3684
3785
  this._emitEOFToken();
3685
3786
  break;
3686
- default: this.currentAttr.value += String.fromCodePoint(cp);
3787
+ default: this._extendRun(cp);
3687
3788
  }
3688
3789
  }
3689
3790
  _stateAttributeValueSingleQuoted(cp) {
@@ -3696,13 +3797,13 @@ var Tokenizer = class {
3696
3797
  break;
3697
3798
  case CODE_POINTS.NULL:
3698
3799
  this._err(ERR.unexpectedNullCharacter);
3699
- this.currentAttr.value += "�";
3800
+ this._extendRunWith("�", 0);
3700
3801
  break;
3701
3802
  case CODE_POINTS.EOF:
3702
3803
  this._err(ERR.eofInTag);
3703
3804
  this._emitEOFToken();
3704
3805
  break;
3705
- default: this.currentAttr.value += String.fromCodePoint(cp);
3806
+ default: this._extendRun(cp);
3706
3807
  }
3707
3808
  }
3708
3809
  _stateAttributeValueUnquoted(cp) {
@@ -3724,7 +3825,7 @@ var Tokenizer = class {
3724
3825
  break;
3725
3826
  case CODE_POINTS.NULL:
3726
3827
  this._err(ERR.unexpectedNullCharacter);
3727
- this.currentAttr.value += "�";
3828
+ this._extendRunWith("�", 0);
3728
3829
  break;
3729
3830
  case CODE_POINTS.QUOTATION_MARK:
3730
3831
  case CODE_POINTS.APOSTROPHE:
@@ -3732,13 +3833,13 @@ var Tokenizer = class {
3732
3833
  case CODE_POINTS.EQUALS_SIGN:
3733
3834
  case CODE_POINTS.GRAVE_ACCENT:
3734
3835
  this._err(ERR.unexpectedCharacterInUnquotedAttributeValue);
3735
- this.currentAttr.value += String.fromCodePoint(cp);
3836
+ this._extendRun(cp);
3736
3837
  break;
3737
3838
  case CODE_POINTS.EOF:
3738
3839
  this._err(ERR.eofInTag);
3739
3840
  this._emitEOFToken();
3740
3841
  break;
3741
- default: this.currentAttr.value += String.fromCodePoint(cp);
3842
+ default: this._extendRun(cp);
3742
3843
  }
3743
3844
  }
3744
3845
  _stateAfterAttributeValueQuoted(cp) {
@@ -3765,6 +3866,7 @@ var Tokenizer = class {
3765
3866
  break;
3766
3867
  default:
3767
3868
  this._err(ERR.missingWhitespaceBetweenAttributes);
3869
+ this._leaveAttrValue();
3768
3870
  this.state = State.BEFORE_ATTRIBUTE_NAME;
3769
3871
  this._stateBeforeAttributeName(cp);
3770
3872
  }
@@ -3801,9 +3903,9 @@ var Tokenizer = class {
3801
3903
  break;
3802
3904
  case CODE_POINTS.NULL:
3803
3905
  this._err(ERR.unexpectedNullCharacter);
3804
- token.data += "�";
3906
+ this._extendRunWith("�", 0);
3805
3907
  break;
3806
- default: token.data += String.fromCodePoint(cp);
3908
+ default: this._extendRun(cp);
3807
3909
  }
3808
3910
  }
3809
3911
  _stateMarkupDeclarationOpen(cp) {
@@ -3862,7 +3964,7 @@ var Tokenizer = class {
3862
3964
  this._emitEOFToken();
3863
3965
  break;
3864
3966
  default:
3865
- token.data += "-";
3967
+ this._extendRunWith("-", -1);
3866
3968
  this.state = State.COMMENT;
3867
3969
  this._stateComment(cp);
3868
3970
  }
@@ -3874,30 +3976,29 @@ var Tokenizer = class {
3874
3976
  this.state = State.COMMENT_END_DASH;
3875
3977
  break;
3876
3978
  case CODE_POINTS.LESS_THAN_SIGN:
3877
- token.data += "<";
3979
+ this._extendRunWith("<", 0);
3878
3980
  this.state = State.COMMENT_LESS_THAN_SIGN;
3879
3981
  break;
3880
3982
  case CODE_POINTS.NULL:
3881
3983
  this._err(ERR.unexpectedNullCharacter);
3882
- token.data += "�";
3984
+ this._extendRunWith("�", 0);
3883
3985
  break;
3884
3986
  case CODE_POINTS.EOF:
3885
3987
  this._err(ERR.eofInComment);
3886
3988
  this.emitCurrentComment(token);
3887
3989
  this._emitEOFToken();
3888
3990
  break;
3889
- default: token.data += String.fromCodePoint(cp);
3991
+ default: this._extendRun(cp);
3890
3992
  }
3891
3993
  }
3892
3994
  _stateCommentLessThanSign(cp) {
3893
- const token = this.currentToken;
3894
3995
  switch (cp) {
3895
3996
  case CODE_POINTS.EXCLAMATION_MARK:
3896
- token.data += "!";
3997
+ this._extendRunWith("!", 0);
3897
3998
  this.state = State.COMMENT_LESS_THAN_SIGN_BANG;
3898
3999
  break;
3899
4000
  case CODE_POINTS.LESS_THAN_SIGN:
3900
- token.data += "<";
4001
+ this._extendRunWith("<", 0);
3901
4002
  break;
3902
4003
  default:
3903
4004
  this.state = State.COMMENT;
@@ -3935,7 +4036,7 @@ var Tokenizer = class {
3935
4036
  this._emitEOFToken();
3936
4037
  break;
3937
4038
  default:
3938
- token.data += "-";
4039
+ this._extendRunWith("-", -1);
3939
4040
  this.state = State.COMMENT;
3940
4041
  this._stateComment(cp);
3941
4042
  }
@@ -3951,7 +4052,7 @@ var Tokenizer = class {
3951
4052
  this.state = State.COMMENT_END_BANG;
3952
4053
  break;
3953
4054
  case CODE_POINTS.HYPHEN_MINUS:
3954
- token.data += "-";
4055
+ this._extendRunWith("-", -2);
3955
4056
  break;
3956
4057
  case CODE_POINTS.EOF:
3957
4058
  this._err(ERR.eofInComment);
@@ -3959,7 +4060,7 @@ var Tokenizer = class {
3959
4060
  this._emitEOFToken();
3960
4061
  break;
3961
4062
  default:
3962
- token.data += "--";
4063
+ this._extendRunWith("--", -1);
3963
4064
  this.state = State.COMMENT;
3964
4065
  this._stateComment(cp);
3965
4066
  }
@@ -3968,7 +4069,7 @@ var Tokenizer = class {
3968
4069
  const token = this.currentToken;
3969
4070
  switch (cp) {
3970
4071
  case CODE_POINTS.HYPHEN_MINUS:
3971
- token.data += "--!";
4072
+ this._extendRunWith("--!", -1);
3972
4073
  this.state = State.COMMENT_END_DASH;
3973
4074
  break;
3974
4075
  case CODE_POINTS.GREATER_THAN_SIGN:
@@ -3982,7 +4083,7 @@ var Tokenizer = class {
3982
4083
  this._emitEOFToken();
3983
4084
  break;
3984
4085
  default:
3985
- token.data += "--!";
4086
+ this._extendRunWith("--!", -1);
3986
4087
  this.state = State.COMMENT;
3987
4088
  this._stateComment(cp);
3988
4089
  }
@@ -4469,7 +4570,7 @@ var Tokenizer = class {
4469
4570
  _stateCdataSectionBracket(cp) {
4470
4571
  if (cp === CODE_POINTS.RIGHT_SQUARE_BRACKET) this.state = State.CDATA_SECTION_END;
4471
4572
  else {
4472
- this._emitChars("]");
4573
+ this._emitChars("]", -1);
4473
4574
  this.state = State.CDATA_SECTION;
4474
4575
  this._stateCdataSection(cp);
4475
4576
  }
@@ -4480,10 +4581,10 @@ var Tokenizer = class {
4480
4581
  this.state = State.DATA;
4481
4582
  break;
4482
4583
  case CODE_POINTS.RIGHT_SQUARE_BRACKET:
4483
- this._emitChars("]");
4584
+ this._emitChars("]", -2);
4484
4585
  break;
4485
4586
  default:
4486
- this._emitChars("]]");
4587
+ this._emitChars("]]", -1);
4487
4588
  this.state = State.CDATA_SECTION;
4488
4589
  this._stateCdataSection(cp);
4489
4590
  }
@@ -4515,8 +4616,7 @@ var Tokenizer = class {
4515
4616
  }
4516
4617
  }
4517
4618
  };
4518
- //#endregion
4519
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/parser/open-element-stack.js
4619
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/parser/open-element-stack.js
4520
4620
  const IMPLICIT_END_TAG_REQUIRED = /* @__PURE__ */ new Set([
4521
4621
  TAG_ID.DD,
4522
4622
  TAG_ID.DT,
@@ -4540,54 +4640,112 @@ const IMPLICIT_END_TAG_REQUIRED_THOROUGHLY = /* @__PURE__ */ new Set([
4540
4640
  TAG_ID.THEAD,
4541
4641
  TAG_ID.TR
4542
4642
  ]);
4543
- const SCOPING_ELEMENTS_HTML = /* @__PURE__ */ new Set([
4544
- TAG_ID.APPLET,
4545
- TAG_ID.CAPTION,
4546
- TAG_ID.HTML,
4547
- TAG_ID.MARQUEE,
4548
- TAG_ID.OBJECT,
4549
- TAG_ID.TABLE,
4550
- TAG_ID.TD,
4551
- TAG_ID.TEMPLATE,
4552
- TAG_ID.TH
4553
- ]);
4554
- const SCOPING_ELEMENTS_HTML_LIST = /* @__PURE__ */ new Set([
4555
- ...SCOPING_ELEMENTS_HTML,
4556
- TAG_ID.OL,
4557
- TAG_ID.UL
4558
- ]);
4559
- const SCOPING_ELEMENTS_HTML_BUTTON = /* @__PURE__ */ new Set([...SCOPING_ELEMENTS_HTML, TAG_ID.BUTTON]);
4560
- const SCOPING_ELEMENTS_MATHML = /* @__PURE__ */ new Set([
4561
- TAG_ID.ANNOTATION_XML,
4562
- TAG_ID.MI,
4563
- TAG_ID.MN,
4564
- TAG_ID.MO,
4565
- TAG_ID.MS,
4566
- TAG_ID.MTEXT
4567
- ]);
4568
- const SCOPING_ELEMENTS_SVG = /* @__PURE__ */ new Set([
4569
- TAG_ID.DESC,
4570
- TAG_ID.FOREIGN_OBJECT,
4571
- TAG_ID.TITLE
4572
- ]);
4573
- const TABLE_ROW_CONTEXT = /* @__PURE__ */ new Set([
4643
+ /** A stack this deep starts to index its elements; a shallower one is cheaper to scan than to index. */
4644
+ const INDEX_DEPTH = 64;
4645
+ const SVG_KEYS = 256;
4646
+ const MATHML_KEYS = 512;
4647
+ const NAME_KEYS = 768;
4648
+ const NUMBERED_HEADERS = [
4649
+ TAG_ID.H1,
4650
+ TAG_ID.H2,
4651
+ TAG_ID.H3,
4652
+ TAG_ID.H4,
4653
+ TAG_ID.H5,
4654
+ TAG_ID.H6
4655
+ ];
4656
+ const TABLE_BODIES = [
4657
+ TAG_ID.TBODY,
4658
+ TAG_ID.TFOOT,
4659
+ TAG_ID.THEAD
4660
+ ];
4661
+ const TABLE_ROW_CONTEXT = [
4574
4662
  TAG_ID.TR,
4575
4663
  TAG_ID.TEMPLATE,
4576
4664
  TAG_ID.HTML
4577
- ]);
4578
- const TABLE_BODY_CONTEXT = /* @__PURE__ */ new Set([
4579
- TAG_ID.TBODY,
4580
- TAG_ID.TFOOT,
4581
- TAG_ID.THEAD,
4665
+ ];
4666
+ const TABLE_BODY_CONTEXT = [
4667
+ ...TABLE_BODIES,
4582
4668
  TAG_ID.TEMPLATE,
4583
4669
  TAG_ID.HTML
4584
- ]);
4585
- const TABLE_CONTEXT = /* @__PURE__ */ new Set([
4670
+ ];
4671
+ const TABLE_CONTEXT = [
4586
4672
  TAG_ID.TABLE,
4587
4673
  TAG_ID.TEMPLATE,
4588
4674
  TAG_ID.HTML
4589
- ]);
4590
- const TABLE_CELLS = /* @__PURE__ */ new Set([TAG_ID.TD, TAG_ID.TH]);
4675
+ ];
4676
+ const TABLE_CELLS = [TAG_ID.TD, TAG_ID.TH];
4677
+ const SPECIAL = 1;
4678
+ const LIST_ITEM_BOUNDARY = 2;
4679
+ const SCOPE = 4;
4680
+ const LIST_ITEM_SCOPE = 8;
4681
+ const BUTTON_SCOPE = 16;
4682
+ const TABLE_SCOPE = 32;
4683
+ const KEY_CLASSES = new Uint8Array(NAME_KEYS);
4684
+ for (const [ns, offset] of [
4685
+ [NS.HTML, 0],
4686
+ [NS.SVG, SVG_KEYS],
4687
+ [NS.MATHML, MATHML_KEYS]
4688
+ ]) for (const tn of SPECIAL_ELEMENTS[ns]) KEY_CLASSES[offset + tn] = ns === NS.HTML && (tn === TAG_ID.ADDRESS || tn === TAG_ID.DIV || tn === TAG_ID.P) ? SPECIAL : 3;
4689
+ for (const key of [
4690
+ TAG_ID.APPLET,
4691
+ TAG_ID.CAPTION,
4692
+ TAG_ID.HTML,
4693
+ TAG_ID.MARQUEE,
4694
+ TAG_ID.OBJECT,
4695
+ TAG_ID.TABLE,
4696
+ TAG_ID.TD,
4697
+ TAG_ID.TEMPLATE,
4698
+ TAG_ID.TH,
4699
+ SVG_KEYS + TAG_ID.DESC,
4700
+ SVG_KEYS + TAG_ID.FOREIGN_OBJECT,
4701
+ SVG_KEYS + TAG_ID.TITLE,
4702
+ MATHML_KEYS + TAG_ID.ANNOTATION_XML,
4703
+ MATHML_KEYS + TAG_ID.MI,
4704
+ MATHML_KEYS + TAG_ID.MN,
4705
+ MATHML_KEYS + TAG_ID.MO,
4706
+ MATHML_KEYS + TAG_ID.MS,
4707
+ MATHML_KEYS + TAG_ID.MTEXT
4708
+ ]) KEY_CLASSES[key] |= 28;
4709
+ KEY_CLASSES[TAG_ID.OL] |= LIST_ITEM_SCOPE;
4710
+ KEY_CLASSES[TAG_ID.UL] |= LIST_ITEM_SCOPE;
4711
+ KEY_CLASSES[TAG_ID.BUTTON] |= BUTTON_SCOPE;
4712
+ KEY_CLASSES[TAG_ID.TABLE] |= TABLE_SCOPE;
4713
+ KEY_CLASSES[TAG_ID.HTML] |= TABLE_SCOPE;
4714
+ const FORMATTING_TAGS = new Uint8Array(NAME_KEYS);
4715
+ for (const tn of [
4716
+ TAG_ID.A,
4717
+ TAG_ID.B,
4718
+ TAG_ID.BIG,
4719
+ TAG_ID.CODE,
4720
+ TAG_ID.EM,
4721
+ TAG_ID.FONT,
4722
+ TAG_ID.I,
4723
+ TAG_ID.NOBR,
4724
+ TAG_ID.S,
4725
+ TAG_ID.SMALL,
4726
+ TAG_ID.STRIKE,
4727
+ TAG_ID.STRONG,
4728
+ TAG_ID.TT,
4729
+ TAG_ID.U
4730
+ ]) FORMATTING_TAGS[tn] = 1;
4731
+ /** The key of an element with a tag ID in HTML, SVG or MathML, or -1 for an element keyed by its name. */
4732
+ function tagKey(ns, tagID) {
4733
+ if (tagID === TAG_ID.UNKNOWN) return -1;
4734
+ switch (ns) {
4735
+ case NS.HTML: return tagID;
4736
+ case NS.SVG: return SVG_KEYS + tagID;
4737
+ case NS.MATHML: return MATHML_KEYS + tagID;
4738
+ default: return -1;
4739
+ }
4740
+ }
4741
+ /**
4742
+ * The stack of open elements. Each element has a slot in `items` and `tagIDs`. Once the stack is `INDEX_DEPTH` deep, it
4743
+ * indexes its elements so that the searches the parser repeats per token take constant time: it chains the elements
4744
+ * with each key, so that the topmost one is found without a scan, and counts per slot the special elements and scope
4745
+ * boundaries at or below it, which tell whether one lies between two slots. Removing an element from the middle then
4746
+ * leaves its slot free instead of moving the elements above it; `slotBelow` and `slotAbove` step over free slots, and
4747
+ * `depth` counts the open elements.
4748
+ */
4591
4749
  var OpenElementStack = class {
4592
4750
  get currentTmplContentOrNode() {
4593
4751
  return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current;
@@ -4597,14 +4755,49 @@ var OpenElementStack = class {
4597
4755
  this.handler = handler;
4598
4756
  this.items = [];
4599
4757
  this.tagIDs = [];
4758
+ /** The slot of the current element. */
4600
4759
  this.stackTop = -1;
4760
+ /** The number of open elements. */
4761
+ this.depth = 0;
4601
4762
  this.tmplCount = 0;
4602
4763
  this.currentTagId = TAG_ID.UNKNOWN;
4764
+ this.indexed = false;
4765
+ /** The slot of the open element below, and above, each open element's slot; -1 for none. */
4766
+ this.below = [];
4767
+ this.above = [];
4768
+ this.keys = [];
4769
+ /** The slot of the next lower, and higher, open element with the same key; -1 for none. */
4770
+ this.keyPrev = [];
4771
+ this.keyNext = [];
4772
+ /** The slot of the topmost open element with each key, -1 for none. */
4773
+ this.keyTops = /* @__PURE__ */ new Int32Array(0);
4774
+ /** Per slot, the open special elements, list item boundaries and scope boundaries at or below it. */
4775
+ this.specials = [];
4776
+ this.listItemBoundaries = [];
4777
+ this.scopeBoundaries = [];
4778
+ /** Per slot, the slot of the topmost open HTML element at or below it, or -1. */
4779
+ this.htmlSlots = [];
4780
+ this.formattingSlots = /* @__PURE__ */ new Map();
4603
4781
  this.current = document;
4604
4782
  }
4783
+ /** The slot of an open element, or -1. */
4605
4784
  _indexOf(element) {
4785
+ if (this.indexed) {
4786
+ const idx = this.formattingSlots.get(element);
4787
+ if (idx !== void 0) return idx;
4788
+ if (FORMATTING_TAGS[getTagID(this.treeAdapter.getTagName(element))]) return -1;
4789
+ }
4606
4790
  return this.items.lastIndexOf(element, this.stackTop);
4607
4791
  }
4792
+ /** The slot of the open element below the one at `idx`, or -1. */
4793
+ slotBelow(idx) {
4794
+ return this.indexed ? this.below[idx] : idx - 1;
4795
+ }
4796
+ /** The slot of the open element above the one at `idx`, or -1. */
4797
+ slotAbove(idx) {
4798
+ if (this.indexed) return this.above[idx];
4799
+ return idx === this.stackTop ? -1 : idx + 1;
4800
+ }
4608
4801
  _isInTemplate() {
4609
4802
  return this.currentTagId === TAG_ID.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === NS.HTML;
4610
4803
  }
@@ -4612,48 +4805,243 @@ var OpenElementStack = class {
4612
4805
  this.current = this.items[this.stackTop];
4613
4806
  this.currentTagId = this.tagIDs[this.stackTop];
4614
4807
  }
4808
+ _nameKey(ns, tagName, create) {
4809
+ var _a, _b;
4810
+ const name = `${ns} ${tagName}`;
4811
+ let key = (_a = this.nameKeys) === null || _a === void 0 ? void 0 : _a.get(name);
4812
+ if (key === void 0 && create) {
4813
+ (_b = this.nameKeys) !== null && _b !== void 0 || (this.nameKeys = /* @__PURE__ */ new Map());
4814
+ key = NAME_KEYS + this.nameKeys.size;
4815
+ this.nameKeys.set(name, key);
4816
+ if (key === this.keyTops.length) {
4817
+ const keyTops = new Int32Array(2 * key).fill(-1);
4818
+ keyTops.set(this.keyTops);
4819
+ this.keyTops = keyTops;
4820
+ }
4821
+ }
4822
+ return key !== null && key !== void 0 ? key : -1;
4823
+ }
4824
+ /** Indexes the open elements once the stack is `INDEX_DEPTH` deep. */
4825
+ _indexAll() {
4826
+ this.indexed = true;
4827
+ this.keyTops = new Int32Array(NAME_KEYS).fill(-1);
4828
+ for (let i = 0; i <= this.stackTop; i++) this._index(i, i - 1);
4829
+ }
4830
+ /** Indexes the element at `slot`, above the open element at `belowIdx`. */
4831
+ _index(slot, belowIdx) {
4832
+ const element = this.items[slot];
4833
+ const tagID = this.tagIDs[slot];
4834
+ const ns = this.treeAdapter.getNamespaceURI(element);
4835
+ let key = tagKey(ns, tagID);
4836
+ if (key === -1) key = this._nameKey(ns, this.treeAdapter.getTagName(element), true);
4837
+ const keyPrev = this.keyTops[key];
4838
+ this.keys[slot] = key;
4839
+ this.keyPrev[slot] = keyPrev;
4840
+ this.keyNext[slot] = -1;
4841
+ if (keyPrev !== -1) this.keyNext[keyPrev] = slot;
4842
+ this.keyTops[key] = slot;
4843
+ this.above[slot] = -1;
4844
+ this._link(slot, belowIdx, ns === NS.HTML);
4845
+ if (FORMATTING_TAGS[tagID]) this.formattingSlots.set(element, slot);
4846
+ }
4847
+ /** Puts the indexed element at `slot` above the one at `belowIdx`, and counts the elements of each class. */
4848
+ _link(slot, belowIdx, isHtml) {
4849
+ const key = this.keys[slot];
4850
+ const classes = key < NAME_KEYS ? KEY_CLASSES[key] : 0;
4851
+ this.below[slot] = belowIdx;
4852
+ if (belowIdx === -1) {
4853
+ this.specials[slot] = classes & SPECIAL;
4854
+ this.listItemBoundaries[slot] = (classes & LIST_ITEM_BOUNDARY) >> 1;
4855
+ this.scopeBoundaries[slot] = (classes & SCOPE) >> 2;
4856
+ this.htmlSlots[slot] = isHtml ? slot : -1;
4857
+ } else {
4858
+ this.above[belowIdx] = slot;
4859
+ this.specials[slot] = this.specials[belowIdx] + (classes & SPECIAL);
4860
+ this.listItemBoundaries[slot] = this.listItemBoundaries[belowIdx] + ((classes & LIST_ITEM_BOUNDARY) >> 1);
4861
+ this.scopeBoundaries[slot] = this.scopeBoundaries[belowIdx] + ((classes & SCOPE) >> 2);
4862
+ this.htmlSlots[slot] = isHtml ? slot : this.htmlSlots[belowIdx];
4863
+ }
4864
+ }
4865
+ /** Takes the element at `slot` out of the index, except for the links between slots. */
4866
+ _unindex(slot) {
4867
+ const key = this.keys[slot];
4868
+ const keyPrev = this.keyPrev[slot];
4869
+ const keyNext = this.keyNext[slot];
4870
+ if (keyPrev !== -1) this.keyNext[keyPrev] = keyNext;
4871
+ if (keyNext === -1) this.keyTops[key] = keyPrev;
4872
+ else this.keyPrev[keyNext] = keyPrev;
4873
+ if (FORMATTING_TAGS[this.tagIDs[slot]]) this.formattingSlots.delete(this.items[slot]);
4874
+ }
4875
+ /** Moves the indexed element at `from` down to the free slot `to`, keeping its key chain in order. */
4876
+ _move(from, to) {
4877
+ const element = this.items[from];
4878
+ const key = this.keys[from];
4879
+ const keyPrev = this.keyPrev[from];
4880
+ const keyNext = this.keyNext[from];
4881
+ this.items[to] = element;
4882
+ this.tagIDs[to] = this.tagIDs[from];
4883
+ this.keys[to] = key;
4884
+ this.keyPrev[to] = keyPrev;
4885
+ this.keyNext[to] = keyNext;
4886
+ if (keyPrev !== -1) this.keyNext[keyPrev] = to;
4887
+ if (keyNext === -1) this.keyTops[key] = to;
4888
+ else this.keyPrev[keyNext] = to;
4889
+ if (FORMATTING_TAGS[this.tagIDs[to]]) this.formattingSlots.set(element, to);
4890
+ }
4891
+ /** The slot of the topmost open HTML element with this tag, or -1. */
4892
+ indexOfTopmost(tagID) {
4893
+ if (this.indexed) return this.keyTops[tagID];
4894
+ for (let i = this.stackTop; i >= 0; i--) if (this.tagIDs[i] === tagID && this.treeAdapter.getNamespaceURI(this.items[i]) === NS.HTML) return i;
4895
+ return -1;
4896
+ }
4897
+ /** The slot of the topmost open HTML element with any of these tags, or -1. */
4898
+ indexOfTopmostOf(tagIDs) {
4899
+ if (this.indexed) {
4900
+ let top = -1;
4901
+ for (const tagID of tagIDs) if (this.keyTops[tagID] > top) top = this.keyTops[tagID];
4902
+ return top;
4903
+ }
4904
+ for (let i = this.stackTop; i >= 0; i--) if (tagIDs.includes(this.tagIDs[i]) && this.treeAdapter.getNamespaceURI(this.items[i]) === NS.HTML) return i;
4905
+ return -1;
4906
+ }
4907
+ /** The slot of the topmost open element in this namespace with this tag name, or -1. */
4908
+ indexOfTopmostByName(ns, tagName) {
4909
+ if (this.indexed) {
4910
+ let key = tagKey(ns, getTagID(tagName));
4911
+ if (key === -1) key = this._nameKey(ns, tagName, false);
4912
+ return key === -1 ? -1 : this.keyTops[key];
4913
+ }
4914
+ for (let i = this.stackTop; i >= 0; i--) {
4915
+ const element = this.items[i];
4916
+ if (this.treeAdapter.getTagName(element) === tagName && this.treeAdapter.getNamespaceURI(element) === ns) return i;
4917
+ }
4918
+ return -1;
4919
+ }
4920
+ /** The slot of the topmost open HTML element, or -1. */
4921
+ indexOfTopmostHtmlElement() {
4922
+ if (this.indexed) return this.stackTop === -1 ? -1 : this.htmlSlots[this.stackTop];
4923
+ let i = this.stackTop;
4924
+ while (i >= 0 && this.treeAdapter.getNamespaceURI(this.items[i]) !== NS.HTML) i--;
4925
+ return i;
4926
+ }
4927
+ /** Whether an element of the classes is open above the slot `idx`, on a stack that is not indexed. */
4928
+ _hasAbove(idx, classes) {
4929
+ for (let i = this.stackTop; i > idx; i--) {
4930
+ const key = tagKey(this.treeAdapter.getNamespaceURI(this.items[i]), this.tagIDs[i]);
4931
+ if (key !== -1 && KEY_CLASSES[key] & classes) return true;
4932
+ }
4933
+ return false;
4934
+ }
4935
+ /** Whether a special element is open above the slot `idx`. */
4936
+ hasSpecialElementAbove(idx) {
4937
+ return this.indexed ? this.specials[this.stackTop] !== this.specials[idx] : this._hasAbove(idx, SPECIAL);
4938
+ }
4939
+ /** Whether a special element other than HTML `address`, `div` and `p` is open above the slot `idx`. */
4940
+ hasListItemBoundaryAbove(idx) {
4941
+ return this.indexed ? this.listItemBoundaries[this.stackTop] !== this.listItemBoundaries[idx] : this._hasAbove(idx, LIST_ITEM_BOUNDARY);
4942
+ }
4615
4943
  push(element, tagID) {
4944
+ const belowIdx = this.stackTop;
4616
4945
  this.stackTop++;
4946
+ this.depth++;
4617
4947
  this.items[this.stackTop] = element;
4618
4948
  this.current = element;
4619
4949
  this.tagIDs[this.stackTop] = tagID;
4620
4950
  this.currentTagId = tagID;
4951
+ if (this.indexed) this._index(this.stackTop, belowIdx);
4952
+ else if (this.depth === INDEX_DEPTH) this._indexAll();
4621
4953
  if (this._isInTemplate()) this.tmplCount++;
4622
4954
  this.handler.onItemPush(element, tagID, true);
4623
4955
  }
4624
- pop() {
4625
- const popped = this.current;
4956
+ /** Pops the current element without calling the handler. */
4957
+ _popCurrent() {
4626
4958
  if (this.tmplCount > 0 && this._isInTemplate()) this.tmplCount--;
4627
- this.stackTop--;
4959
+ if (this.indexed) {
4960
+ this._unindex(this.stackTop);
4961
+ this.stackTop = this.below[this.stackTop];
4962
+ if (this.stackTop !== -1) this.above[this.stackTop] = -1;
4963
+ } else this.stackTop--;
4964
+ this.depth--;
4628
4965
  this._updateCurrentElement();
4966
+ }
4967
+ pop() {
4968
+ const popped = this.current;
4969
+ this._popCurrent();
4629
4970
  this.handler.onItemPop(popped, true);
4630
4971
  }
4631
4972
  replace(oldElement, newElement) {
4632
4973
  const idx = this._indexOf(oldElement);
4633
4974
  this.items[idx] = newElement;
4975
+ if (this.indexed && FORMATTING_TAGS[this.tagIDs[idx]]) {
4976
+ this.formattingSlots.delete(oldElement);
4977
+ this.formattingSlots.set(newElement, idx);
4978
+ }
4634
4979
  if (idx === this.stackTop) this.current = newElement;
4635
4980
  }
4636
- insertAfter(referenceElement, newElement, newElementID) {
4637
- const insertionIdx = this._indexOf(referenceElement) + 1;
4638
- this.items.splice(insertionIdx, 0, newElement);
4639
- this.tagIDs.splice(insertionIdx, 0, newElementID);
4640
- this.stackTop++;
4641
- if (insertionIdx === this.stackTop) this._updateCurrentElement();
4642
- if (this.current && this.currentTagId !== void 0) this.handler.onItemPush(this.current, this.currentTagId, insertionIdx === this.stackTop);
4981
+ /**
4982
+ * The adoption agency's last stack step: removes the formatting element at `formattingIdx` and opens `element`
4983
+ * directly above the furthest block at `furthestBlockIdx`. On an indexed stack, only formatting elements the agency
4984
+ * kept are still open between them; the furthest block, with those directly below it, moves down by one slot, and
4985
+ * `element` takes the furthest block's slot. No open element above the furthest block moves, and as all these
4986
+ * elements are HTML elements and only the furthest block is special, the counts above it stay the same.
4987
+ */
4988
+ replaceFormattingElement(formattingIdx, furthestBlockIdx, element, tagID) {
4989
+ const formattingElement = this.items[formattingIdx];
4990
+ if (!this.indexed) {
4991
+ this.items.splice(formattingIdx, 1);
4992
+ this.tagIDs.splice(formattingIdx, 1);
4993
+ this.handler.onItemPop(formattingElement, false);
4994
+ this.items.splice(furthestBlockIdx, 0, element);
4995
+ this.tagIDs.splice(furthestBlockIdx, 0, tagID);
4996
+ if (furthestBlockIdx === this.stackTop) this._updateCurrentElement();
4997
+ if (this.current && this.currentTagId !== void 0) this.handler.onItemPush(this.current, this.currentTagId, furthestBlockIdx === this.stackTop);
4998
+ return;
4999
+ }
5000
+ const key = this.keys[formattingIdx];
5001
+ const belowIdx = this.below[formattingIdx];
5002
+ const aboveIdx = this.above[furthestBlockIdx];
5003
+ const kept = [];
5004
+ for (let i = this.above[formattingIdx]; i !== furthestBlockIdx; i = this.above[i]) kept.push(i);
5005
+ const keyNext = this.keyNext[formattingIdx];
5006
+ this._unindex(formattingIdx);
5007
+ this.items[formattingIdx] = void 0;
5008
+ this.handler.onItemPop(formattingElement, false);
5009
+ let free = furthestBlockIdx - 1;
5010
+ while (kept.length > 0 && kept[kept.length - 1] === free) {
5011
+ kept.pop();
5012
+ free--;
5013
+ }
5014
+ for (let i = free + 1; i <= furthestBlockIdx; i++) this._move(i, i - 1);
5015
+ const keyPrev = keyNext === -1 ? this.keyTops[key] : this.keyPrev[keyNext];
5016
+ this.items[furthestBlockIdx] = element;
5017
+ this.tagIDs[furthestBlockIdx] = tagID;
5018
+ this.keys[furthestBlockIdx] = key;
5019
+ this.keyPrev[furthestBlockIdx] = keyPrev;
5020
+ this.keyNext[furthestBlockIdx] = keyNext;
5021
+ if (keyPrev !== -1) this.keyNext[keyPrev] = furthestBlockIdx;
5022
+ if (keyNext === -1) this.keyTops[key] = furthestBlockIdx;
5023
+ else this.keyPrev[keyNext] = furthestBlockIdx;
5024
+ if (FORMATTING_TAGS[tagID]) this.formattingSlots.set(element, furthestBlockIdx);
5025
+ let prev = belowIdx;
5026
+ for (const i of kept) {
5027
+ this._link(i, prev, true);
5028
+ prev = i;
5029
+ }
5030
+ for (let i = free; i < furthestBlockIdx; i++) {
5031
+ this._link(i, prev, true);
5032
+ prev = i;
5033
+ }
5034
+ this._link(furthestBlockIdx, prev, true);
5035
+ if (aboveIdx === -1) this._updateCurrentElement();
5036
+ if (this.current && this.currentTagId !== void 0) this.handler.onItemPush(this.current, this.currentTagId, aboveIdx === -1);
4643
5037
  }
4644
5038
  popUntilTagNamePopped(tagName) {
4645
- let targetIdx = this.stackTop + 1;
4646
- do
4647
- targetIdx = this.tagIDs.lastIndexOf(tagName, targetIdx - 1);
4648
- while (targetIdx > 0 && this.treeAdapter.getNamespaceURI(this.items[targetIdx]) !== NS.HTML);
4649
- this.shortenToLength(Math.max(targetIdx, 0));
5039
+ this.shortenToLength(Math.max(this.indexOfTopmost(tagName), 0));
4650
5040
  }
4651
5041
  shortenToLength(idx) {
4652
5042
  while (this.stackTop >= idx) {
4653
5043
  const popped = this.current;
4654
- if (this.tmplCount > 0 && this._isInTemplate()) this.tmplCount -= 1;
4655
- this.stackTop--;
4656
- this._updateCurrentElement();
5044
+ this._popCurrent();
4657
5045
  this.handler.onItemPop(popped, this.stackTop < idx);
4658
5046
  }
4659
5047
  }
@@ -4661,49 +5049,59 @@ var OpenElementStack = class {
4661
5049
  const idx = this._indexOf(element);
4662
5050
  this.shortenToLength(Math.max(idx, 0));
4663
5051
  }
4664
- popUntilPopped(tagNames, targetNS) {
4665
- const idx = this._indexOfTagNames(tagNames, targetNS);
4666
- this.shortenToLength(Math.max(idx, 0));
4667
- }
4668
5052
  popUntilNumberedHeaderPopped() {
4669
- this.popUntilPopped(NUMBERED_HEADERS, NS.HTML);
5053
+ this.shortenToLength(Math.max(this.indexOfTopmostOf(NUMBERED_HEADERS), 0));
4670
5054
  }
4671
5055
  popUntilTableCellPopped() {
4672
- this.popUntilPopped(TABLE_CELLS, NS.HTML);
5056
+ this.shortenToLength(Math.max(this.indexOfTopmostOf(TABLE_CELLS), 0));
4673
5057
  }
4674
5058
  popAllUpToHtmlElement() {
4675
5059
  this.tmplCount = 0;
4676
5060
  this.shortenToLength(1);
4677
5061
  }
4678
- _indexOfTagNames(tagNames, namespace) {
4679
- for (let i = this.stackTop; i >= 0; i--) if (tagNames.has(this.tagIDs[i]) && this.treeAdapter.getNamespaceURI(this.items[i]) === namespace) return i;
4680
- return -1;
4681
- }
4682
- clearBackTo(tagNames, targetNS) {
4683
- const idx = this._indexOfTagNames(tagNames, targetNS);
4684
- this.shortenToLength(idx + 1);
4685
- }
4686
5062
  clearBackToTableContext() {
4687
- this.clearBackTo(TABLE_CONTEXT, NS.HTML);
5063
+ this.shortenToLength(this.indexOfTopmostOf(TABLE_CONTEXT) + 1);
4688
5064
  }
4689
5065
  clearBackToTableBodyContext() {
4690
- this.clearBackTo(TABLE_BODY_CONTEXT, NS.HTML);
5066
+ this.shortenToLength(this.indexOfTopmostOf(TABLE_BODY_CONTEXT) + 1);
4691
5067
  }
4692
5068
  clearBackToTableRowContext() {
4693
- this.clearBackTo(TABLE_ROW_CONTEXT, NS.HTML);
5069
+ this.shortenToLength(this.indexOfTopmostOf(TABLE_ROW_CONTEXT) + 1);
4694
5070
  }
4695
5071
  remove(element) {
4696
5072
  const idx = this._indexOf(element);
4697
- if (idx >= 0) {
4698
- if (idx === this.stackTop) this.pop();
4699
- else {
4700
- this.items.splice(idx, 1);
4701
- this.tagIDs.splice(idx, 1);
4702
- this.stackTop--;
4703
- this._updateCurrentElement();
4704
- this.handler.onItemPop(element, false);
4705
- }
5073
+ if (idx !== -1) this.removeAt(idx);
5074
+ }
5075
+ /** Removes the open element at the slot `idx`; on an indexed stack, the elements above it keep their slots. */
5076
+ removeAt(idx) {
5077
+ if (idx === this.stackTop) {
5078
+ this.pop();
5079
+ return;
5080
+ }
5081
+ const element = this.items[idx];
5082
+ this.depth--;
5083
+ if (this.indexed) {
5084
+ const classes = this.keys[idx] < NAME_KEYS ? KEY_CLASSES[this.keys[idx]] : 0;
5085
+ const belowIdx = this.below[idx];
5086
+ const aboveIdx = this.above[idx];
5087
+ this._unindex(idx);
5088
+ this.items[idx] = void 0;
5089
+ this.below[aboveIdx] = belowIdx;
5090
+ if (belowIdx !== -1) this.above[belowIdx] = aboveIdx;
5091
+ if (classes !== 0) for (let i = aboveIdx; i !== -1; i = this.above[i]) {
5092
+ this.specials[i] -= classes & SPECIAL;
5093
+ this.listItemBoundaries[i] -= (classes & LIST_ITEM_BOUNDARY) >> 1;
5094
+ this.scopeBoundaries[i] -= (classes & SCOPE) >> 2;
5095
+ }
5096
+ const html = belowIdx === -1 ? -1 : this.htmlSlots[belowIdx];
5097
+ for (let i = aboveIdx; i !== -1 && this.htmlSlots[i] === idx; i = this.above[i]) this.htmlSlots[i] = html;
5098
+ } else {
5099
+ this.items.splice(idx, 1);
5100
+ this.tagIDs.splice(idx, 1);
5101
+ this.stackTop--;
5102
+ this._updateCurrentElement();
4706
5103
  }
5104
+ this.handler.onItemPop(element, false);
4707
5105
  }
4708
5106
  tryPeekProperlyNestedBodyElement() {
4709
5107
  return this.stackTop >= 1 && this.tagIDs[1] === TAG_ID.BODY ? this.items[1] : null;
@@ -4712,79 +5110,67 @@ var OpenElementStack = class {
4712
5110
  return this._indexOf(element) > -1;
4713
5111
  }
4714
5112
  getCommonAncestor(element) {
4715
- const elementIdx = this._indexOf(element) - 1;
4716
- return elementIdx >= 0 ? this.items[elementIdx] : null;
5113
+ const idx = this._indexOf(element);
5114
+ const belowIdx = idx === -1 ? -1 : this.slotBelow(idx);
5115
+ return belowIdx === -1 ? null : this.items[belowIdx];
4717
5116
  }
4718
5117
  isRootHtmlElementCurrent() {
4719
5118
  return this.stackTop === 0 && this.tagIDs[0] === TAG_ID.HTML;
4720
5119
  }
4721
- hasInDynamicScope(tagName, htmlScope) {
5120
+ /**
5121
+ * On an indexed stack: whether no element of the `scope` class is open above the slot `target`. A target that is not
5122
+ * open is in scope only on a stack without such an element, as a scan from the top would end there.
5123
+ */
5124
+ _isInScope(target, scope) {
5125
+ let boundary = -1;
5126
+ switch (scope) {
5127
+ case LIST_ITEM_SCOPE:
5128
+ boundary = Math.max(this.keyTops[TAG_ID.OL], this.keyTops[TAG_ID.UL]);
5129
+ break;
5130
+ case BUTTON_SCOPE:
5131
+ boundary = this.keyTops[TAG_ID.BUTTON];
5132
+ break;
5133
+ case TABLE_SCOPE:
5134
+ boundary = Math.max(this.keyTops[TAG_ID.TABLE], this.keyTops[TAG_ID.HTML]);
5135
+ return target === -1 ? boundary === -1 : target >= boundary;
5136
+ }
5137
+ return target === -1 ? boundary === -1 && (this.stackTop === -1 || this.scopeBoundaries[this.stackTop] === 0) : target >= boundary && this.scopeBoundaries[this.stackTop] === this.scopeBoundaries[target];
5138
+ }
5139
+ /**
5140
+ * On a stack that is not indexed: whether an HTML element with the tag, or one of the tags, and if passed the element
5141
+ * itself, is open above every element of the `scope` class; true if neither is open.
5142
+ */
5143
+ _scanScope(tagID, tagIDs, scope, element) {
4722
5144
  for (let i = this.stackTop; i >= 0; i--) {
4723
- const tn = this.tagIDs[i];
4724
- switch (this.treeAdapter.getNamespaceURI(this.items[i])) {
4725
- case NS.HTML:
4726
- if (tn === tagName) return true;
4727
- if (htmlScope.has(tn)) return false;
4728
- break;
4729
- case NS.SVG:
4730
- if (SCOPING_ELEMENTS_SVG.has(tn)) return false;
4731
- break;
4732
- case NS.MATHML: if (SCOPING_ELEMENTS_MATHML.has(tn)) return false;
4733
- }
5145
+ const key = tagKey(this.treeAdapter.getNamespaceURI(this.items[i]), this.tagIDs[i]);
5146
+ if (key === -1) continue;
5147
+ if ((tagIDs ? tagIDs.includes(key) : key === tagID) && (!element || this.items[i] === element)) return true;
5148
+ if (KEY_CLASSES[key] & scope) return false;
4734
5149
  }
4735
5150
  return true;
4736
5151
  }
4737
- hasInScope(tagName) {
4738
- return this.hasInDynamicScope(tagName, SCOPING_ELEMENTS_HTML);
5152
+ /** If `element` is passed, only that element (which has to be a `tagName` element) is looked for. */
5153
+ hasInScope(tagName, element) {
5154
+ if (!this.indexed) return this._scanScope(tagName, null, SCOPE, element);
5155
+ return this._isInScope(element ? this._indexOf(element) : this.keyTops[tagName], SCOPE);
4739
5156
  }
4740
5157
  hasInListItemScope(tagName) {
4741
- return this.hasInDynamicScope(tagName, SCOPING_ELEMENTS_HTML_LIST);
5158
+ return this.indexed ? this._isInScope(this.keyTops[tagName], LIST_ITEM_SCOPE) : this._scanScope(tagName, null, LIST_ITEM_SCOPE);
4742
5159
  }
4743
5160
  hasInButtonScope(tagName) {
4744
- return this.hasInDynamicScope(tagName, SCOPING_ELEMENTS_HTML_BUTTON);
5161
+ return this.indexed ? this._isInScope(this.keyTops[tagName], BUTTON_SCOPE) : this._scanScope(tagName, null, BUTTON_SCOPE);
4745
5162
  }
4746
5163
  hasNumberedHeaderInScope() {
4747
- for (let i = this.stackTop; i >= 0; i--) {
4748
- const tn = this.tagIDs[i];
4749
- switch (this.treeAdapter.getNamespaceURI(this.items[i])) {
4750
- case NS.HTML:
4751
- if (NUMBERED_HEADERS.has(tn)) return true;
4752
- if (SCOPING_ELEMENTS_HTML.has(tn)) return false;
4753
- break;
4754
- case NS.SVG:
4755
- if (SCOPING_ELEMENTS_SVG.has(tn)) return false;
4756
- break;
4757
- case NS.MATHML: if (SCOPING_ELEMENTS_MATHML.has(tn)) return false;
4758
- }
4759
- }
4760
- return true;
5164
+ return this.indexed ? this._isInScope(this.indexOfTopmostOf(NUMBERED_HEADERS), SCOPE) : this._scanScope(TAG_ID.UNKNOWN, NUMBERED_HEADERS, SCOPE);
4761
5165
  }
4762
5166
  hasInTableScope(tagName) {
4763
- for (let i = this.stackTop; i >= 0; i--) {
4764
- if (this.treeAdapter.getNamespaceURI(this.items[i]) !== NS.HTML) continue;
4765
- switch (this.tagIDs[i]) {
4766
- case tagName: return true;
4767
- case TAG_ID.TABLE:
4768
- case TAG_ID.HTML: return false;
4769
- }
4770
- }
4771
- return true;
5167
+ return this.indexed ? this._isInScope(this.keyTops[tagName], TABLE_SCOPE) : this._scanScope(tagName, null, TABLE_SCOPE);
4772
5168
  }
4773
5169
  hasTableBodyContextInTableScope() {
4774
- for (let i = this.stackTop; i >= 0; i--) {
4775
- if (this.treeAdapter.getNamespaceURI(this.items[i]) !== NS.HTML) continue;
4776
- switch (this.tagIDs[i]) {
4777
- case TAG_ID.TBODY:
4778
- case TAG_ID.THEAD:
4779
- case TAG_ID.TFOOT: return true;
4780
- case TAG_ID.TABLE:
4781
- case TAG_ID.HTML: return false;
4782
- }
4783
- }
4784
- return true;
5170
+ return this.indexed ? this._isInScope(this.indexOfTopmostOf(TABLE_BODIES), TABLE_SCOPE) : this._scanScope(TAG_ID.UNKNOWN, TABLE_BODIES, TABLE_SCOPE);
4785
5171
  }
4786
5172
  hasInSelectScope(tagName) {
4787
- for (let i = this.stackTop; i >= 0; i--) {
5173
+ for (let i = this.stackTop; i >= 0; i = this.slotBelow(i)) {
4788
5174
  if (this.treeAdapter.getNamespaceURI(this.items[i]) !== NS.HTML) continue;
4789
5175
  switch (this.tagIDs[i]) {
4790
5176
  case tagName: return true;
@@ -4796,86 +5182,130 @@ var OpenElementStack = class {
4796
5182
  return true;
4797
5183
  }
4798
5184
  generateImpliedEndTags() {
4799
- while (this.currentTagId !== void 0 && IMPLICIT_END_TAG_REQUIRED.has(this.currentTagId)) this.pop();
5185
+ while (this.currentTagId !== void 0 && IMPLICIT_END_TAG_REQUIRED.has(this.currentTagId) && this.treeAdapter.getNamespaceURI(this.current) === NS.HTML) this.pop();
4800
5186
  }
4801
5187
  generateImpliedEndTagsThoroughly() {
4802
- while (this.currentTagId !== void 0 && IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId)) this.pop();
5188
+ while (this.currentTagId !== void 0 && IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId) && this.treeAdapter.getNamespaceURI(this.current) === NS.HTML) this.pop();
4803
5189
  }
4804
5190
  generateImpliedEndTagsWithExclusion(exclusionId) {
4805
- while (this.currentTagId !== void 0 && this.currentTagId !== exclusionId && IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId)) this.pop();
5191
+ while (this.currentTagId !== void 0 && this.currentTagId !== exclusionId && IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId) && this.treeAdapter.getNamespaceURI(this.current) === NS.HTML) this.pop();
4806
5192
  }
4807
5193
  };
4808
- //#endregion
4809
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/parser/formatting-element-list.js
5194
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/parser/formatting-element-list.js
4810
5195
  const NOAH_ARK_CAPACITY = 3;
4811
5196
  var EntryType;
4812
5197
  (function(EntryType) {
4813
5198
  EntryType[EntryType["Marker"] = 0] = "Marker";
4814
5199
  EntryType[EntryType["Element"] = 1] = "Element";
4815
5200
  })(EntryType || (EntryType = {}));
4816
- const MARKER = { type: EntryType.Marker };
4817
5201
  var FormattingElementList = class {
4818
- constructor(treeAdapter) {
4819
- this.treeAdapter = treeAdapter;
4820
- this.entries = [];
5202
+ constructor() {
5203
+ this.newest = null;
4821
5204
  this.bookmark = null;
4822
- }
4823
- _getNoahArkConditionCandidates(newElement, neAttrs) {
4824
- const candidates = [];
4825
- const neAttrsLength = neAttrs.length;
4826
- const neTagName = this.treeAdapter.getTagName(newElement);
4827
- const neNamespaceURI = this.treeAdapter.getNamespaceURI(newElement);
4828
- for (let i = 0; i < this.entries.length; i++) {
4829
- const entry = this.entries[i];
4830
- if (entry.type === EntryType.Marker) break;
4831
- const { element } = entry;
4832
- if (this.treeAdapter.getTagName(element) === neTagName && this.treeAdapter.getNamespaceURI(element) === neNamespaceURI) {
4833
- const elementAttrs = this.treeAdapter.getAttrList(element);
4834
- if (elementAttrs.length === neAttrsLength) candidates.push({
4835
- idx: i,
4836
- attrs: elementAttrs
4837
- });
4838
- }
4839
- }
4840
- return candidates;
4841
- }
4842
- _ensureNoahArkCondition(newElement) {
4843
- if (this.entries.length < NOAH_ARK_CAPACITY) return;
4844
- const neAttrs = this.treeAdapter.getAttrList(newElement);
4845
- const candidates = this._getNoahArkConditionCandidates(newElement, neAttrs);
4846
- if (candidates.length < NOAH_ARK_CAPACITY) return;
4847
- const neAttrsMap = new Map(neAttrs.map((neAttr) => [neAttr.name, neAttr.value]));
4848
- let validCandidates = 0;
4849
- for (let i = 0; i < candidates.length; i++) {
4850
- const candidate = candidates[i];
4851
- if (candidate.attrs.every((cAttr) => neAttrsMap.get(cAttr.name) === cAttr.value)) {
4852
- validCandidates += 1;
4853
- if (validCandidates >= NOAH_ARK_CAPACITY) this.entries.splice(candidate.idx, 1);
4854
- }
4855
- }
5205
+ /** The index of the entries after the last marker; null only while there are at most NOAH_ARK_CAPACITY of them. */
5206
+ this.index = null;
5207
+ /** The entries by element, except possibly those after the last marker while they are not indexed. */
5208
+ this.elementEntries = /* @__PURE__ */ new Map();
5209
+ }
5210
+ /** Returns the entry's ark, or null if the entries after the last marker are not indexed. */
5211
+ _insertElementEntry(element, token, older) {
5212
+ const newer = older === null ? null : older.newer;
5213
+ const entry = {
5214
+ type: EntryType.Element,
5215
+ element,
5216
+ token,
5217
+ older,
5218
+ newer,
5219
+ ark: null,
5220
+ olderSameTag: null,
5221
+ newerSameTag: null
5222
+ };
5223
+ if (newer === null) this.newest = entry;
5224
+ else newer.older = entry;
5225
+ if (older !== null) older.newer = entry;
5226
+ return this.index === null ? null : this._addToIndex(this.index, entry);
5227
+ }
5228
+ _addToIndex(index, entry) {
5229
+ const { tagName, attrs } = entry.token;
5230
+ const key = tagName + attrs.map(({ name, value }) => `\0${name}\0${value}`).sort().join("");
5231
+ let ark = index.arks.get(key);
5232
+ if (ark === void 0) {
5233
+ ark = {
5234
+ entries: [],
5235
+ key
5236
+ };
5237
+ index.arks.set(key, ark);
5238
+ }
5239
+ ark.entries.push(entry);
5240
+ entry.ark = ark;
5241
+ this.elementEntries.set(entry.element, entry);
5242
+ let head = index.tagNames.get(tagName);
5243
+ if (head === void 0) {
5244
+ head = { olderSameTag: null };
5245
+ index.tagNames.set(tagName, head);
5246
+ }
5247
+ entry.olderSameTag = head.olderSameTag;
5248
+ entry.newerSameTag = head;
5249
+ if (head.olderSameTag !== null) head.olderSameTag.newerSameTag = entry;
5250
+ head.olderSameTag = entry;
5251
+ return ark;
4856
5252
  }
4857
5253
  insertMarker() {
4858
- this.entries.unshift(MARKER);
5254
+ if (this.index === null) for (let entry = this.newest; entry !== null && entry.type === EntryType.Element; entry = entry.older) this.elementEntries.set(entry.element, entry);
5255
+ const marker = {
5256
+ type: EntryType.Marker,
5257
+ older: this.newest,
5258
+ newer: null,
5259
+ outerIndex: this.index
5260
+ };
5261
+ if (this.newest !== null) this.newest.newer = marker;
5262
+ this.newest = marker;
5263
+ this.index = null;
4859
5264
  }
4860
5265
  pushElement(element, token) {
4861
- this._ensureNoahArkCondition(element);
4862
- this.entries.unshift({
4863
- type: EntryType.Element,
4864
- element,
4865
- token
4866
- });
5266
+ if (this.index === null) {
5267
+ let oldest = null;
5268
+ let count = 0;
5269
+ for (let entry = this.newest; entry !== null && entry.type === EntryType.Element; entry = entry.older) {
5270
+ oldest = entry;
5271
+ count++;
5272
+ }
5273
+ if (count >= NOAH_ARK_CAPACITY) {
5274
+ this.index = {
5275
+ arks: /* @__PURE__ */ new Map(),
5276
+ tagNames: /* @__PURE__ */ new Map()
5277
+ };
5278
+ for (let entry = oldest; entry !== null && entry.type === EntryType.Element; entry = entry.newer) this._addToIndex(this.index, entry);
5279
+ }
5280
+ }
5281
+ const ark = this._insertElementEntry(element, token, this.newest);
5282
+ if (ark !== null && ark.entries.length > NOAH_ARK_CAPACITY) this.removeEntry(ark.entries[0]);
4867
5283
  }
4868
5284
  insertElementAfterBookmark(element, token) {
4869
- const bookmarkIdx = this.entries.indexOf(this.bookmark);
4870
- this.entries.splice(bookmarkIdx, 0, {
4871
- type: EntryType.Element,
4872
- element,
4873
- token
4874
- });
5285
+ const { bookmark } = this;
5286
+ this.bookmark = null;
5287
+ this._insertElementEntry(element, token, bookmark);
4875
5288
  }
4876
5289
  removeEntry(entry) {
4877
- const entryIndex = this.entries.indexOf(entry);
4878
- if (entryIndex !== -1) this.entries.splice(entryIndex, 1);
5290
+ var _a;
5291
+ if (entry.newer === null ? this.newest !== entry : entry.newer.older !== entry) return;
5292
+ this.elementEntries.delete(entry.element);
5293
+ if (entry.newer === null) this.newest = entry.older;
5294
+ else entry.newer.older = entry.older;
5295
+ if (entry.older !== null) entry.older.newer = entry.newer;
5296
+ if (entry.ark !== null) {
5297
+ const { entries, key } = entry.ark;
5298
+ entries.splice(entries.indexOf(entry), 1);
5299
+ if (entries.length === 0) (_a = this.index) === null || _a === void 0 || _a.arks.delete(key);
5300
+ }
5301
+ if (entry.newerSameTag !== null) {
5302
+ entry.newerSameTag.olderSameTag = entry.olderSameTag;
5303
+ if (entry.olderSameTag !== null) entry.olderSameTag.newerSameTag = entry.newerSameTag;
5304
+ }
5305
+ }
5306
+ replaceElement(entry, element) {
5307
+ if (this.elementEntries.delete(entry.element)) this.elementEntries.set(element, entry);
5308
+ entry.element = element;
4879
5309
  }
4880
5310
  /**
4881
5311
  * Clears the list of formatting elements up to the last marker.
@@ -4883,20 +5313,28 @@ var FormattingElementList = class {
4883
5313
  * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-list-of-active-formatting-elements-up-to-the-last-marker
4884
5314
  */
4885
5315
  clearToLastMarker() {
4886
- const markerIdx = this.entries.indexOf(MARKER);
4887
- if (markerIdx === -1) this.entries.length = 0;
4888
- else this.entries.splice(0, markerIdx + 1);
5316
+ let marker = this.newest;
5317
+ for (; marker !== null && marker.type === EntryType.Element; marker = marker.older) this.elementEntries.delete(marker.element);
5318
+ this.newest = marker === null ? null : marker.older;
5319
+ this.index = marker === null ? null : marker.outerIndex;
5320
+ if (this.newest !== null) this.newest.newer = null;
4889
5321
  }
4890
5322
  getElementEntryInScopeWithTagName(tagName) {
4891
- const entry = this.entries.find((entry) => entry.type === EntryType.Marker || this.treeAdapter.getTagName(entry.element) === tagName);
4892
- return entry && entry.type === EntryType.Element ? entry : null;
5323
+ var _a, _b;
5324
+ if (this.index !== null) return (_b = (_a = this.index.tagNames.get(tagName)) === null || _a === void 0 ? void 0 : _a.olderSameTag) !== null && _b !== void 0 ? _b : null;
5325
+ for (let entry = this.newest; entry !== null && entry.type === EntryType.Element; entry = entry.older) if (entry.token.tagName === tagName) return entry;
5326
+ return null;
4893
5327
  }
4894
5328
  getElementEntry(element) {
4895
- return this.entries.find((entry) => entry.type === EntryType.Element && entry.element === element);
5329
+ if (this.index === null) {
5330
+ for (let entry = this.newest; entry !== null && entry.type === EntryType.Element; entry = entry.older) if (entry.element === element) return entry;
5331
+ }
5332
+ return this.elementEntries.get(element);
4896
5333
  }
4897
5334
  };
4898
- //#endregion
4899
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/tree-adapters/default.js
5335
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/tree-adapters/default.js
5336
+ /** The position of each name in the attribute lists `adoptAttributes` merged into, kept for the next merge into that list. */
5337
+ const attrListIndexes = /* @__PURE__ */ new WeakMap();
4900
5338
  const defaultTreeAdapter = {
4901
5339
  createDocument() {
4902
5340
  return {
@@ -4940,8 +5378,9 @@ const defaultTreeAdapter = {
4940
5378
  newNode.parentNode = parentNode;
4941
5379
  },
4942
5380
  insertBefore(parentNode, newNode, referenceNode) {
4943
- const insertionIdx = parentNode.childNodes.indexOf(referenceNode);
4944
- parentNode.childNodes.splice(insertionIdx, 0, newNode);
5381
+ const { childNodes } = parentNode;
5382
+ const insertionIdx = childNodes[childNodes.length - 1] === referenceNode ? childNodes.length - 1 : childNodes.indexOf(referenceNode);
5383
+ childNodes.splice(insertionIdx, 0, newNode);
4945
5384
  newNode.parentNode = parentNode;
4946
5385
  },
4947
5386
  setTemplateContent(templateElement, contentElement) {
@@ -4975,8 +5414,9 @@ const defaultTreeAdapter = {
4975
5414
  },
4976
5415
  detachNode(node) {
4977
5416
  if (node.parentNode) {
4978
- const idx = node.parentNode.childNodes.indexOf(node);
4979
- node.parentNode.childNodes.splice(idx, 1);
5417
+ const { childNodes } = node.parentNode;
5418
+ const idx = childNodes[childNodes.length - 1] === node ? childNodes.length - 1 : childNodes.indexOf(node);
5419
+ childNodes.splice(idx, 1);
4980
5420
  node.parentNode = null;
4981
5421
  }
4982
5422
  },
@@ -4991,13 +5431,36 @@ const defaultTreeAdapter = {
4991
5431
  defaultTreeAdapter.appendChild(parentNode, defaultTreeAdapter.createTextNode(text));
4992
5432
  },
4993
5433
  insertTextBefore(parentNode, text, referenceNode) {
4994
- const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1];
5434
+ const { childNodes } = parentNode;
5435
+ const prevNode = childNodes[(childNodes[childNodes.length - 1] === referenceNode ? childNodes.length - 1 : childNodes.indexOf(referenceNode)) - 1];
4995
5436
  if (prevNode && defaultTreeAdapter.isTextNode(prevNode)) prevNode.value += text;
4996
5437
  else defaultTreeAdapter.insertBefore(parentNode, defaultTreeAdapter.createTextNode(text), referenceNode);
4997
5438
  },
5439
+ /**
5440
+ * Keeps the recipient's names between merges as a map from name to position. The map is rebuilt when the list changed
5441
+ * length or has a repeated name, or when a merged name it holds no longer names the entry at that position. A name that
5442
+ * other code gives an existing entry between two merges is missed otherwise, and merging it appends it a second time.
5443
+ */
4998
5444
  adoptAttributes(recipient, attrs) {
4999
- const recipientAttrsMap = new Set(recipient.attrs.map((attr) => attr.name));
5445
+ if (attrs.length === 0 || attrs === recipient.attrs) return;
5446
+ const cached = attrListIndexes.get(recipient.attrs);
5447
+ const isIndexed = (cached === null || cached === void 0 ? void 0 : cached.size) === recipient.attrs.length && attrs.every(({ name }) => {
5448
+ var _a;
5449
+ const index = cached.get(name);
5450
+ return index === void 0 || ((_a = recipient.attrs[index]) === null || _a === void 0 ? void 0 : _a.name) === name;
5451
+ });
5452
+ const recipientAttrsMap = isIndexed ? cached : /* @__PURE__ */ new Map();
5453
+ if (!isIndexed) {
5454
+ for (let i = 0; i < recipient.attrs.length; i++) {
5455
+ const attr = recipient.attrs[i];
5456
+ if (attr !== void 0) recipientAttrsMap.set(attr.name, i);
5457
+ }
5458
+ attrListIndexes.set(recipient.attrs, recipientAttrsMap);
5459
+ }
5460
+ const adoptedFrom = recipient.attrs.length;
5000
5461
  for (let j = 0; j < attrs.length; j++) if (!recipientAttrsMap.has(attrs[j].name)) recipient.attrs.push(attrs[j]);
5462
+ for (let j = adoptedFrom; j < recipient.attrs.length; j++) recipientAttrsMap.set(recipient.attrs[j].name, j);
5463
+ if (recipientAttrsMap.size !== recipient.attrs.length) attrListIndexes.delete(recipient.attrs);
5001
5464
  },
5002
5465
  getFirstChild(node) {
5003
5466
  return node.childNodes[0];
@@ -5057,8 +5520,7 @@ const defaultTreeAdapter = {
5057
5520
  };
5058
5521
  }
5059
5522
  };
5060
- //#endregion
5061
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/common/doctype.js
5523
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/common/doctype.js
5062
5524
  const VALID_DOCTYPE_NAME = "html";
5063
5525
  const VALID_SYSTEM_ID = "about:legacy-compat";
5064
5526
  const QUIRKS_MODE_SYSTEM_ID = "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd";
@@ -5156,8 +5618,7 @@ function getDocumentMode(token) {
5156
5618
  }
5157
5619
  return DOCUMENT_MODE.NO_QUIRKS;
5158
5620
  }
5159
- //#endregion
5160
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/common/foreign-content.js
5621
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/common/foreign-content.js
5161
5622
  const MIME_TYPES = {
5162
5623
  TEXT_HTML: "text/html",
5163
5624
  APPLICATION_XML: "application/xhtml+xml"
@@ -5413,9 +5874,26 @@ function isHtmlIntegrationPoint(tn, ns, attrs) {
5413
5874
  function isIntegrationPoint(tn, ns, attrs, foreignNS) {
5414
5875
  return (!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs) || (!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns);
5415
5876
  }
5416
- //#endregion
5417
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/parser/index.js
5877
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/parser/index.js
5878
+ const INSERTION_MODE_TAGS = [
5879
+ TAG_ID.TR,
5880
+ TAG_ID.TBODY,
5881
+ TAG_ID.THEAD,
5882
+ TAG_ID.TFOOT,
5883
+ TAG_ID.CAPTION,
5884
+ TAG_ID.COLGROUP,
5885
+ TAG_ID.TABLE,
5886
+ TAG_ID.FRAMESET,
5887
+ TAG_ID.SELECT,
5888
+ TAG_ID.TEMPLATE,
5889
+ TAG_ID.TD,
5890
+ TAG_ID.TH,
5891
+ TAG_ID.HEAD,
5892
+ TAG_ID.BODY,
5893
+ TAG_ID.HTML
5894
+ ];
5418
5895
  const HIDDEN_INPUT_TYPE = "hidden";
5896
+ const EMPTY_ATTRS = [];
5419
5897
  const AA_OUTER_LOOP_ITER = 8;
5420
5898
  const AA_INNER_LOOP_ITER = 3;
5421
5899
  var InsertionMode;
@@ -5482,8 +5960,7 @@ var Parser = class {
5482
5960
  /** Indicates that the current node is not an element in the HTML namespace */
5483
5961
  this.currentNotInHTML = false;
5484
5962
  /**
5485
- * The template insertion mode stack is maintained from the left.
5486
- * Ie. the topmost element will always have index 0.
5963
+ * The topmost template insertion mode is the last element.
5487
5964
  *
5488
5965
  * @internal
5489
5966
  */
@@ -5507,7 +5984,7 @@ var Parser = class {
5507
5984
  if (this.onParseError) this.options.sourceCodeLocationInfo = true;
5508
5985
  this.document = document !== null && document !== void 0 ? document : this.treeAdapter.createDocument();
5509
5986
  this.tokenizer = new Tokenizer(this.options, this);
5510
- this.activeFormattingElements = new FormattingElementList(this.treeAdapter);
5987
+ this.activeFormattingElements = new FormattingElementList();
5511
5988
  this.fragmentContextID = fragmentContext ? getTagID(this.treeAdapter.getTagName(fragmentContext)) : TAG_ID.UNKNOWN;
5512
5989
  this._setContextModes(fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : this.document, this.fragmentContextID);
5513
5990
  this.openElements = new OpenElementStack(this.document, this.treeAdapter, this);
@@ -5525,7 +6002,7 @@ var Parser = class {
5525
6002
  fragmentContext !== null && fragmentContext !== void 0 || (fragmentContext = opts.treeAdapter.createElement(TAG_NAMES.TEMPLATE, NS.HTML, []));
5526
6003
  const documentMock = opts.treeAdapter.createElement("documentmock", NS.HTML, []);
5527
6004
  const parser = new this(opts, documentMock, fragmentContext);
5528
- if (parser.fragmentContextID === TAG_ID.TEMPLATE) parser.tmplInsertionModeStack.unshift(InsertionMode.IN_TEMPLATE);
6005
+ if (parser.fragmentContextID === TAG_ID.TEMPLATE) parser.tmplInsertionModeStack.push(InsertionMode.IN_TEMPLATE);
5529
6006
  parser._initTokenizerForFragmentParsing();
5530
6007
  parser._insertFakeRootElement();
5531
6008
  parser._resetInsertionMode();
@@ -5562,9 +6039,10 @@ var Parser = class {
5562
6039
  }
5563
6040
  /** @internal */
5564
6041
  onItemPop(node, isTop) {
5565
- var _a, _b;
6042
+ var _a, _b, _c;
5566
6043
  if (this.options.sourceCodeLocationInfo) this._setEndLocation(node, this.currentToken);
5567
6044
  (_b = (_a = this.treeAdapter).onItemPop) === null || _b === void 0 || _b.call(_a, node, this.openElements.current);
6045
+ (_c = this.annotationXmlIntegrationPoints) === null || _c === void 0 || _c.delete(node);
5568
6046
  if (isTop) {
5569
6047
  let current;
5570
6048
  let currentTagId;
@@ -5600,7 +6078,7 @@ var Parser = class {
5600
6078
  _findFormInFragmentContext() {
5601
6079
  let node = this.fragmentContext;
5602
6080
  while (node) {
5603
- if (this.treeAdapter.getTagName(node) === TAG_NAMES.FORM) {
6081
+ if (this.treeAdapter.getTagName(node) === TAG_NAMES.FORM && this.treeAdapter.getNamespaceURI(node) === NS.HTML) {
5604
6082
  this.formElement = node;
5605
6083
  break;
5606
6084
  }
@@ -5640,7 +6118,7 @@ var Parser = class {
5640
6118
  }
5641
6119
  }
5642
6120
  /** @protected */
5643
- _attachElementToTree(element, location) {
6121
+ _attachElementToTree(element, location, insertionLocation) {
5644
6122
  if (this.options.sourceCodeLocationInfo) {
5645
6123
  const loc = location && {
5646
6124
  ...location,
@@ -5648,11 +6126,28 @@ var Parser = class {
5648
6126
  };
5649
6127
  this.treeAdapter.setNodeSourceCodeLocation(element, loc);
5650
6128
  }
5651
- if (this._shouldFosterParentOnInsertion()) this._fosterParentElement(element);
5652
- else {
5653
- const parent = this.openElements.currentTmplContentOrNode;
5654
- this.treeAdapter.appendChild(parent !== null && parent !== void 0 ? parent : this.document, element);
5655
- }
6129
+ if (insertionLocation.beforeElement) this.treeAdapter.insertBefore(insertionLocation.parent, element, insertionLocation.beforeElement);
6130
+ else this.treeAdapter.appendChild(insertionLocation.parent, element);
6131
+ }
6132
+ /** @protected */
6133
+ _getInsertionLocation() {
6134
+ var _a;
6135
+ if (this._shouldFosterParentOnInsertion()) return this._findFosterParentingLocation();
6136
+ return {
6137
+ parent: (_a = this.openElements.currentTmplContentOrNode) !== null && _a !== void 0 ? _a : this.document,
6138
+ beforeElement: null
6139
+ };
6140
+ }
6141
+ /** @protected */
6142
+ _createElement(tagName, namespaceURI, attrs, intendedParent) {
6143
+ var _a, _b;
6144
+ const element = this.treeAdapter.createElement(tagName, namespaceURI, attrs);
6145
+ (_b = (_a = this.treeAdapter).onElementCreated) === null || _b === void 0 || _b.call(_a, element, {
6146
+ intendedParent,
6147
+ formElement: this.formElement,
6148
+ isInTemplate: this.openElements.tmplCount > 0
6149
+ });
6150
+ return element;
5656
6151
  }
5657
6152
  /**
5658
6153
  * For self-closing tags. Add an element to the tree, but skip adding it
@@ -5660,35 +6155,39 @@ var Parser = class {
5660
6155
  */
5661
6156
  /** @protected */
5662
6157
  _appendElement(token, namespaceURI) {
5663
- const element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs);
5664
- this._attachElementToTree(element, token.location);
6158
+ const insertionLocation = this._getInsertionLocation();
6159
+ const element = this._createElement(token.tagName, namespaceURI, token.attrs, insertionLocation.parent);
6160
+ this._attachElementToTree(element, token.location, insertionLocation);
5665
6161
  }
5666
6162
  /** @protected */
5667
6163
  _insertElement(token, namespaceURI) {
5668
- const element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs);
5669
- this._attachElementToTree(element, token.location);
6164
+ const insertionLocation = this._getInsertionLocation();
6165
+ const element = this._createElement(token.tagName, namespaceURI, token.attrs, insertionLocation.parent);
6166
+ this._attachElementToTree(element, token.location, insertionLocation);
5670
6167
  this.openElements.push(element, token.tagID);
5671
6168
  }
5672
6169
  /** @protected */
5673
6170
  _insertFakeElement(tagName, tagID) {
5674
- const element = this.treeAdapter.createElement(tagName, NS.HTML, []);
5675
- this._attachElementToTree(element, null);
6171
+ const insertionLocation = this._getInsertionLocation();
6172
+ const element = this._createElement(tagName, NS.HTML, [], insertionLocation.parent);
6173
+ this._attachElementToTree(element, null, insertionLocation);
5676
6174
  this.openElements.push(element, tagID);
5677
6175
  }
5678
6176
  /** @protected */
5679
6177
  _insertTemplate(token) {
5680
- const tmpl = this.treeAdapter.createElement(token.tagName, NS.HTML, token.attrs);
6178
+ const insertionLocation = this._getInsertionLocation();
6179
+ const tmpl = this._createElement(token.tagName, NS.HTML, token.attrs, insertionLocation.parent);
5681
6180
  const content = this.treeAdapter.createDocumentFragment();
5682
6181
  this.treeAdapter.setTemplateContent(tmpl, content);
5683
- this._attachElementToTree(tmpl, token.location);
6182
+ this._attachElementToTree(tmpl, token.location, insertionLocation);
5684
6183
  this.openElements.push(tmpl, token.tagID);
5685
6184
  if (this.options.sourceCodeLocationInfo) this.treeAdapter.setNodeSourceCodeLocation(content, null);
5686
6185
  }
5687
6186
  /** @protected */
5688
6187
  _insertFakeRootElement() {
5689
- const element = this.treeAdapter.createElement(TAG_NAMES.HTML, NS.HTML, []);
6188
+ const element = this._createElement(TAG_NAMES.HTML, NS.HTML, [], this.document);
5690
6189
  if (this.options.sourceCodeLocationInfo) this.treeAdapter.setNodeSourceCodeLocation(element, null);
5691
- this.treeAdapter.appendChild(this.openElements.current, element);
6190
+ this.treeAdapter.appendChild(this.document, element);
5692
6191
  this.openElements.push(element, TAG_ID.HTML);
5693
6192
  }
5694
6193
  /** @protected */
@@ -5723,10 +6222,9 @@ var Parser = class {
5723
6222
  }
5724
6223
  /** @protected */
5725
6224
  _adoptNodes(donor, recipient) {
5726
- for (let child = this.treeAdapter.getFirstChild(donor); child; child = this.treeAdapter.getFirstChild(donor)) {
5727
- this.treeAdapter.detachNode(child);
5728
- this.treeAdapter.appendChild(recipient, child);
5729
- }
6225
+ const children = [...this.treeAdapter.getChildNodes(donor)];
6226
+ for (let i = children.length - 1; i >= 0; i--) this.treeAdapter.detachNode(children[i]);
6227
+ for (const child of children) this.treeAdapter.appendChild(recipient, child);
5730
6228
  }
5731
6229
  /** @protected */
5732
6230
  _setEndLocation(element, closingToken) {
@@ -5786,19 +6284,26 @@ var Parser = class {
5786
6284
  }
5787
6285
  /** @protected */
5788
6286
  _isIntegrationPoint(tid, element, foreignNS) {
5789
- return isIntegrationPoint(tid, this.treeAdapter.getNamespaceURI(element), this.treeAdapter.getAttrList(element), foreignNS);
6287
+ var _a;
6288
+ const ns = this.treeAdapter.getNamespaceURI(element);
6289
+ if (tid === TAG_ID.ANNOTATION_XML && ns === NS.MATHML && foreignNS !== NS.MATHML) {
6290
+ const verdicts = (_a = this.annotationXmlIntegrationPoints) !== null && _a !== void 0 ? _a : this.annotationXmlIntegrationPoints = /* @__PURE__ */ new Map();
6291
+ let isIntegrationPoint$1 = verdicts.get(element);
6292
+ if (isIntegrationPoint$1 === void 0) {
6293
+ isIntegrationPoint$1 = isIntegrationPoint(tid, ns, this.treeAdapter.getAttrList(element));
6294
+ verdicts.set(element, isIntegrationPoint$1);
6295
+ }
6296
+ return isIntegrationPoint$1;
6297
+ }
6298
+ return isIntegrationPoint(tid, ns, EMPTY_ATTRS, foreignNS);
5790
6299
  }
5791
6300
  /** @protected */
5792
6301
  _reconstructActiveFormattingElements() {
5793
- const listLength = this.activeFormattingElements.entries.length;
5794
- if (listLength) {
5795
- const endIndex = this.activeFormattingElements.entries.findIndex((entry) => entry.type === EntryType.Marker || this.openElements.contains(entry.element));
5796
- const unopenIdx = endIndex === -1 ? listLength - 1 : endIndex - 1;
5797
- for (let i = unopenIdx; i >= 0; i--) {
5798
- const entry = this.activeFormattingElements.entries[i];
5799
- this._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element));
5800
- entry.element = this.openElements.current;
5801
- }
6302
+ let oldest = null;
6303
+ for (let entry = this.activeFormattingElements.newest; entry !== null && entry.type === EntryType.Element && !this.openElements.contains(entry.element); entry = entry.older) oldest = entry;
6304
+ for (let entry = oldest; entry !== null && entry.type === EntryType.Element; entry = entry.newer) {
6305
+ this._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element));
6306
+ this.activeFormattingElements.replaceElement(entry, this.openElements.current);
5802
6307
  }
5803
6308
  }
5804
6309
  /** @protected */
@@ -5815,7 +6320,10 @@ var Parser = class {
5815
6320
  }
5816
6321
  /** @protected */
5817
6322
  _resetInsertionMode() {
5818
- for (let i = this.openElements.stackTop; i >= 0; i--) switch (i === 0 && this.fragmentContext ? this.fragmentContextID : this.openElements.tagIDs[i]) {
6323
+ const i = this.openElements.indexOfTopmostOf(INSERTION_MODE_TAGS);
6324
+ const tn = i === 0 && this.fragmentContext ? this.fragmentContextID : this.openElements.tagIDs[i];
6325
+ const node = i === 0 && this.fragmentContext ? this.fragmentContext : this.openElements.items[i];
6326
+ if (node !== void 0 && this.treeAdapter.getNamespaceURI(node) === NS.HTML) switch (tn) {
5819
6327
  case TAG_ID.TR:
5820
6328
  this.insertionMode = InsertionMode.IN_ROW;
5821
6329
  return;
@@ -5843,7 +6351,7 @@ var Parser = class {
5843
6351
  this._resetInsertionModeForSelect(i);
5844
6352
  return;
5845
6353
  case TAG_ID.TEMPLATE:
5846
- this.insertionMode = this.tmplInsertionModeStack[0];
6354
+ this.insertionMode = this.tmplInsertionModeStack[this.tmplInsertionModeStack.length - 1];
5847
6355
  return;
5848
6356
  case TAG_ID.HTML:
5849
6357
  this.insertionMode = this.headElement ? InsertionMode.AFTER_HEAD : InsertionMode.BEFORE_HEAD;
@@ -5864,10 +6372,9 @@ var Parser = class {
5864
6372
  }
5865
6373
  /** @protected */
5866
6374
  _resetInsertionModeForSelect(selectIdx) {
5867
- if (selectIdx > 0) for (let i = selectIdx - 1; i > 0; i--) {
5868
- const tn = this.openElements.tagIDs[i];
5869
- if (tn === TAG_ID.TEMPLATE) break;
5870
- else if (tn === TAG_ID.TABLE) {
6375
+ if (selectIdx > 0) {
6376
+ const tableIdx = this.openElements.indexOfTopmost(TAG_ID.TABLE);
6377
+ if (tableIdx > 0 && tableIdx > this.openElements.indexOfTopmost(TAG_ID.TEMPLATE)) {
5871
6378
  this.insertionMode = InsertionMode.IN_SELECT_IN_TABLE;
5872
6379
  return;
5873
6380
  }
@@ -5884,30 +6391,27 @@ var Parser = class {
5884
6391
  }
5885
6392
  /** @protected */
5886
6393
  _findFosterParentingLocation() {
5887
- for (let i = this.openElements.stackTop; i >= 0; i--) {
5888
- const openElement = this.openElements.items[i];
5889
- switch (this.openElements.tagIDs[i]) {
5890
- case TAG_ID.TEMPLATE:
5891
- if (this.treeAdapter.getNamespaceURI(openElement) === NS.HTML) return {
5892
- parent: this.treeAdapter.getTemplateContent(openElement),
5893
- beforeElement: null
5894
- };
5895
- break;
5896
- case TAG_ID.TABLE: {
5897
- const parent = this.treeAdapter.getParentNode(openElement);
5898
- if (parent) return {
5899
- parent,
5900
- beforeElement: openElement
5901
- };
5902
- return {
5903
- parent: this.openElements.items[i - 1],
5904
- beforeElement: null
5905
- };
5906
- }
5907
- }
6394
+ const { openElements } = this;
6395
+ const tableIdx = openElements.indexOfTopmost(TAG_ID.TABLE);
6396
+ const templateIdx = openElements.indexOfTopmost(TAG_ID.TEMPLATE);
6397
+ if (templateIdx > tableIdx) return {
6398
+ parent: this.treeAdapter.getTemplateContent(openElements.items[templateIdx]),
6399
+ beforeElement: null
6400
+ };
6401
+ if (tableIdx !== -1) {
6402
+ const table = openElements.items[tableIdx];
6403
+ const parent = this.treeAdapter.getParentNode(table);
6404
+ if (parent) return {
6405
+ parent,
6406
+ beforeElement: table
6407
+ };
6408
+ return {
6409
+ parent: openElements.items[openElements.slotBelow(tableIdx)],
6410
+ beforeElement: null
6411
+ };
5908
6412
  }
5909
6413
  return {
5910
- parent: this.openElements.items[0],
6414
+ parent: openElements.items[0],
5911
6415
  beforeElement: null
5912
6416
  };
5913
6417
  }
@@ -6337,36 +6841,33 @@ function aaObtainFormattingElementEntry(p, token) {
6337
6841
  if (!p.openElements.contains(formattingElementEntry.element)) {
6338
6842
  p.activeFormattingElements.removeEntry(formattingElementEntry);
6339
6843
  formattingElementEntry = null;
6340
- } else if (!p.openElements.hasInScope(token.tagID)) formattingElementEntry = null;
6844
+ } else if (!p.openElements.hasInScope(token.tagID, formattingElementEntry.element)) formattingElementEntry = null;
6341
6845
  } else genericEndTagInBody(p, token);
6342
6846
  return formattingElementEntry;
6343
6847
  }
6344
6848
  function aaObtainFurthestBlock(p, formattingElementEntry) {
6345
- let furthestBlock = null;
6346
- let idx = p.openElements.stackTop;
6347
- for (; idx >= 0; idx--) {
6348
- const element = p.openElements.items[idx];
6349
- if (element === formattingElementEntry.element) break;
6350
- if (p._isSpecialElement(element, p.openElements.tagIDs[idx])) furthestBlock = element;
6351
- }
6352
- if (!furthestBlock) {
6353
- p.openElements.shortenToLength(Math.max(idx, 0));
6354
- p.activeFormattingElements.removeEntry(formattingElementEntry);
6355
- }
6356
- return furthestBlock;
6849
+ const { openElements } = p;
6850
+ const formattingIdx = openElements._indexOf(formattingElementEntry.element);
6851
+ for (let idx = openElements.slotAbove(formattingIdx); idx !== -1; idx = openElements.slotAbove(idx)) if (p._isSpecialElement(openElements.items[idx], openElements.tagIDs[idx])) return idx;
6852
+ openElements.shortenToLength(formattingIdx);
6853
+ p.activeFormattingElements.removeEntry(formattingElementEntry);
6854
+ return -1;
6357
6855
  }
6358
- function aaInnerLoop(p, furthestBlock, formattingElement) {
6856
+ function aaInnerLoop(p, furthestBlockIdx, formattingElement) {
6857
+ const furthestBlock = p.openElements.items[furthestBlockIdx];
6359
6858
  let lastElement = furthestBlock;
6360
- let nextElement = p.openElements.getCommonAncestor(furthestBlock);
6361
- for (let i = 0, element = nextElement; element !== formattingElement; i++, element = nextElement) {
6362
- nextElement = p.openElements.getCommonAncestor(element);
6859
+ let nextIdx = p.openElements.slotBelow(furthestBlockIdx);
6860
+ const intendedParent = p.openElements.getCommonAncestor(formattingElement);
6861
+ for (let i = 0, idx = nextIdx; p.openElements.items[idx] !== formattingElement; i++, idx = nextIdx) {
6862
+ let element = p.openElements.items[idx];
6863
+ nextIdx = p.openElements.slotBelow(idx);
6363
6864
  const elementEntry = p.activeFormattingElements.getElementEntry(element);
6364
6865
  const counterOverflow = elementEntry && i >= AA_INNER_LOOP_ITER;
6365
6866
  if (!elementEntry || counterOverflow) {
6366
6867
  if (counterOverflow) p.activeFormattingElements.removeEntry(elementEntry);
6367
- p.openElements.remove(element);
6868
+ p.openElements.removeAt(idx);
6368
6869
  } else {
6369
- element = aaRecreateElementFromEntry(p, elementEntry);
6870
+ element = aaRecreateElementFromEntry(p, elementEntry, intendedParent);
6370
6871
  if (lastElement === furthestBlock) p.activeFormattingElements.bookmark = elementEntry;
6371
6872
  p.treeAdapter.detachNode(lastElement);
6372
6873
  p.treeAdapter.appendChild(element, lastElement);
@@ -6375,11 +6876,11 @@ function aaInnerLoop(p, furthestBlock, formattingElement) {
6375
6876
  }
6376
6877
  return lastElement;
6377
6878
  }
6378
- function aaRecreateElementFromEntry(p, elementEntry) {
6879
+ function aaRecreateElementFromEntry(p, elementEntry, intendedParent) {
6379
6880
  const ns = p.treeAdapter.getNamespaceURI(elementEntry.element);
6380
- const newElement = p.treeAdapter.createElement(elementEntry.token.tagName, ns, elementEntry.token.attrs);
6881
+ const newElement = p._createElement(elementEntry.token.tagName, ns, elementEntry.token.attrs, intendedParent);
6381
6882
  p.openElements.replace(elementEntry.element, newElement);
6382
- elementEntry.element = newElement;
6883
+ p.activeFormattingElements.replaceElement(elementEntry, newElement);
6383
6884
  return newElement;
6384
6885
  }
6385
6886
  function aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement) {
@@ -6394,22 +6895,30 @@ function aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement) {
6394
6895
  function aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry) {
6395
6896
  const ns = p.treeAdapter.getNamespaceURI(formattingElementEntry.element);
6396
6897
  const { token } = formattingElementEntry;
6397
- const newElement = p.treeAdapter.createElement(token.tagName, ns, token.attrs);
6898
+ const newElement = p._createElement(token.tagName, ns, token.attrs, furthestBlock);
6398
6899
  p._adoptNodes(furthestBlock, newElement);
6399
6900
  p.treeAdapter.appendChild(furthestBlock, newElement);
6400
6901
  p.activeFormattingElements.insertElementAfterBookmark(newElement, token);
6401
6902
  p.activeFormattingElements.removeEntry(formattingElementEntry);
6402
- p.openElements.remove(formattingElementEntry.element);
6403
- p.openElements.insertAfter(furthestBlock, newElement, token.tagID);
6903
+ const formattingIdx = p.openElements._indexOf(formattingElementEntry.element);
6904
+ let furthestBlockIdx = p.openElements.slotAbove(formattingIdx);
6905
+ while (p.openElements.items[furthestBlockIdx] !== furthestBlock) furthestBlockIdx = p.openElements.slotAbove(furthestBlockIdx);
6906
+ p.openElements.replaceFormattingElement(formattingIdx, furthestBlockIdx, newElement, token.tagID);
6404
6907
  }
6405
6908
  function callAdoptionAgency(p, token) {
6909
+ const { current, currentTagId } = p.openElements;
6910
+ if (currentTagId === token.tagID && p.treeAdapter.getNamespaceURI(current) === NS.HTML && !p.activeFormattingElements.getElementEntry(current)) {
6911
+ p.openElements.pop();
6912
+ return;
6913
+ }
6406
6914
  for (let i = 0; i < AA_OUTER_LOOP_ITER; i++) {
6407
6915
  const formattingElementEntry = aaObtainFormattingElementEntry(p, token);
6408
6916
  if (!formattingElementEntry) break;
6409
- const furthestBlock = aaObtainFurthestBlock(p, formattingElementEntry);
6410
- if (!furthestBlock) break;
6917
+ const furthestBlockIdx = aaObtainFurthestBlock(p, formattingElementEntry);
6918
+ if (furthestBlockIdx === -1) break;
6919
+ const furthestBlock = p.openElements.items[furthestBlockIdx];
6411
6920
  p.activeFormattingElements.bookmark = formattingElementEntry;
6412
- const lastElement = aaInnerLoop(p, furthestBlock, formattingElementEntry.element);
6921
+ const lastElement = aaInnerLoop(p, furthestBlockIdx, formattingElementEntry.element);
6413
6922
  const commonAncestor = p.openElements.getCommonAncestor(formattingElementEntry.element);
6414
6923
  p.treeAdapter.detachNode(lastElement);
6415
6924
  if (commonAncestor) aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement);
@@ -6429,7 +6938,7 @@ function stopParsing(p, token) {
6429
6938
  p.stopped = true;
6430
6939
  if (token.location) {
6431
6940
  const target = p.fragmentContext ? 0 : 2;
6432
- for (let i = p.openElements.stackTop; i >= target; i--) p._setEndLocation(p.openElements.items[i], token);
6941
+ for (let i = p.openElements.stackTop; i >= target; i = p.openElements.slotBelow(i)) p._setEndLocation(p.openElements.items[i], token);
6433
6942
  if (!p.fragmentContext && p.openElements.stackTop >= 0) {
6434
6943
  const htmlElement = p.openElements.items[0];
6435
6944
  const htmlLocation = p.treeAdapter.getNodeSourceCodeLocation(htmlElement);
@@ -6531,7 +7040,7 @@ function startTagInHead(p, token) {
6531
7040
  p.activeFormattingElements.insertMarker();
6532
7041
  p.framesetOk = false;
6533
7042
  p.insertionMode = InsertionMode.IN_TEMPLATE;
6534
- p.tmplInsertionModeStack.unshift(InsertionMode.IN_TEMPLATE);
7043
+ p.tmplInsertionModeStack.push(InsertionMode.IN_TEMPLATE);
6535
7044
  break;
6536
7045
  case TAG_ID.HEAD:
6537
7046
  p._err(token, ERR.misplacedStartTagForHeadElement);
@@ -6562,7 +7071,7 @@ function templateEndTagInHead(p, token) {
6562
7071
  if (p.openElements.currentTagId !== TAG_ID.TEMPLATE) p._err(token, ERR.closingOfElementWithOpenChildElements);
6563
7072
  p.openElements.popUntilTagNamePopped(TAG_ID.TEMPLATE);
6564
7073
  p.activeFormattingElements.clearToLastMarker();
6565
- p.tmplInsertionModeStack.shift();
7074
+ p.tmplInsertionModeStack.pop();
6566
7075
  p._resetInsertionMode();
6567
7076
  } else p._err(token, ERR.endTagWithoutMatchingOpenElement);
6568
7077
  }
@@ -6717,7 +7226,7 @@ function addressStartTagInBody(p, token) {
6717
7226
  }
6718
7227
  function numberedHeaderStartTagInBody(p, token) {
6719
7228
  if (p.openElements.hasInButtonScope(TAG_ID.P)) p._closePElement();
6720
- if (p.openElements.currentTagId !== void 0 && NUMBERED_HEADERS.has(p.openElements.currentTagId)) p.openElements.pop();
7229
+ if (p.openElements.currentTagId !== void 0 && NUMBERED_HEADERS$1.has(p.openElements.currentTagId)) p.openElements.pop();
6721
7230
  p._insertElement(token, NS.HTML);
6722
7231
  }
6723
7232
  function preStartTagInBody(p, token) {
@@ -6736,15 +7245,11 @@ function formStartTagInBody(p, token) {
6736
7245
  }
6737
7246
  function listItemStartTagInBody(p, token) {
6738
7247
  p.framesetOk = false;
6739
- const tn = token.tagID;
6740
- for (let i = p.openElements.stackTop; i >= 0; i--) {
6741
- const elementId = p.openElements.tagIDs[i];
6742
- if (tn === TAG_ID.LI && elementId === TAG_ID.LI || (tn === TAG_ID.DD || tn === TAG_ID.DT) && (elementId === TAG_ID.DD || elementId === TAG_ID.DT)) {
6743
- p.openElements.generateImpliedEndTagsWithExclusion(elementId);
6744
- p.openElements.popUntilTagNamePopped(elementId);
6745
- break;
6746
- }
6747
- if (elementId !== TAG_ID.ADDRESS && elementId !== TAG_ID.DIV && elementId !== TAG_ID.P && p._isSpecialElement(p.openElements.items[i], elementId)) break;
7248
+ const idx = token.tagID === TAG_ID.LI ? p.openElements.indexOfTopmost(TAG_ID.LI) : Math.max(p.openElements.indexOfTopmost(TAG_ID.DD), p.openElements.indexOfTopmost(TAG_ID.DT));
7249
+ if (idx !== -1 && !p.openElements.hasListItemBoundaryAbove(idx)) {
7250
+ const elementId = p.openElements.tagIDs[idx];
7251
+ p.openElements.generateImpliedEndTagsWithExclusion(elementId);
7252
+ p.openElements.popUntilTagNamePopped(elementId);
6748
7253
  }
6749
7254
  if (p.openElements.hasInButtonScope(TAG_ID.P)) p._closePElement();
6750
7255
  p._insertElement(token, NS.HTML);
@@ -7138,17 +7643,11 @@ function brEndTagInBody(p) {
7138
7643
  p.framesetOk = false;
7139
7644
  }
7140
7645
  function genericEndTagInBody(p, token) {
7141
- const tn = token.tagName;
7142
7646
  const tid = token.tagID;
7143
- for (let i = p.openElements.stackTop; i > 0; i--) {
7144
- const element = p.openElements.items[i];
7145
- const elementId = p.openElements.tagIDs[i];
7146
- if (tid === elementId && (tid !== TAG_ID.UNKNOWN || p.treeAdapter.getTagName(element) === tn)) {
7147
- p.openElements.generateImpliedEndTagsWithExclusion(tid);
7148
- if (p.openElements.stackTop >= i) p.openElements.shortenToLength(i);
7149
- break;
7150
- }
7151
- if (p._isSpecialElement(element, elementId)) break;
7647
+ const i = tid === TAG_ID.UNKNOWN ? p.openElements.indexOfTopmostByName(NS.HTML, token.tagName) : p.openElements.indexOfTopmost(tid);
7648
+ if (i > 0 && !p.openElements.hasSpecialElementAbove(i)) {
7649
+ p.openElements.generateImpliedEndTagsWithExclusion(tid);
7650
+ if (p.openElements.stackTop >= i) p.openElements.shortenToLength(i);
7152
7651
  }
7153
7652
  }
7154
7653
  function endTagInBody(p, token) {
@@ -7685,7 +8184,7 @@ function startTagInSelect(p, token) {
7685
8184
  function endTagInSelect(p, token) {
7686
8185
  switch (token.tagID) {
7687
8186
  case TAG_ID.OPTGROUP:
7688
- if (p.openElements.stackTop > 0 && p.openElements.currentTagId === TAG_ID.OPTION && p.openElements.tagIDs[p.openElements.stackTop - 1] === TAG_ID.OPTGROUP) p.openElements.pop();
8187
+ if (p.openElements.stackTop > 0 && p.openElements.currentTagId === TAG_ID.OPTION && p.openElements.tagIDs[p.openElements.slotBelow(p.openElements.stackTop)] === TAG_ID.OPTGROUP) p.openElements.pop();
7689
8188
  if (p.openElements.currentTagId === TAG_ID.OPTGROUP) p.openElements.pop();
7690
8189
  break;
7691
8190
  case TAG_ID.OPTION:
@@ -7737,28 +8236,28 @@ function startTagInTemplate(p, token) {
7737
8236
  case TAG_ID.TBODY:
7738
8237
  case TAG_ID.TFOOT:
7739
8238
  case TAG_ID.THEAD:
7740
- p.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE;
8239
+ p.tmplInsertionModeStack[p.tmplInsertionModeStack.length - 1] = InsertionMode.IN_TABLE;
7741
8240
  p.insertionMode = InsertionMode.IN_TABLE;
7742
8241
  startTagInTable(p, token);
7743
8242
  break;
7744
8243
  case TAG_ID.COL:
7745
- p.tmplInsertionModeStack[0] = InsertionMode.IN_COLUMN_GROUP;
8244
+ p.tmplInsertionModeStack[p.tmplInsertionModeStack.length - 1] = InsertionMode.IN_COLUMN_GROUP;
7746
8245
  p.insertionMode = InsertionMode.IN_COLUMN_GROUP;
7747
8246
  startTagInColumnGroup(p, token);
7748
8247
  break;
7749
8248
  case TAG_ID.TR:
7750
- p.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE_BODY;
8249
+ p.tmplInsertionModeStack[p.tmplInsertionModeStack.length - 1] = InsertionMode.IN_TABLE_BODY;
7751
8250
  p.insertionMode = InsertionMode.IN_TABLE_BODY;
7752
8251
  startTagInTableBody(p, token);
7753
8252
  break;
7754
8253
  case TAG_ID.TD:
7755
8254
  case TAG_ID.TH:
7756
- p.tmplInsertionModeStack[0] = InsertionMode.IN_ROW;
8255
+ p.tmplInsertionModeStack[p.tmplInsertionModeStack.length - 1] = InsertionMode.IN_ROW;
7757
8256
  p.insertionMode = InsertionMode.IN_ROW;
7758
8257
  startTagInRow(p, token);
7759
8258
  break;
7760
8259
  default:
7761
- p.tmplInsertionModeStack[0] = InsertionMode.IN_BODY;
8260
+ p.tmplInsertionModeStack[p.tmplInsertionModeStack.length - 1] = InsertionMode.IN_BODY;
7762
8261
  p.insertionMode = InsertionMode.IN_BODY;
7763
8262
  startTagInBody(p, token);
7764
8263
  }
@@ -7768,9 +8267,11 @@ function endTagInTemplate(p, token) {
7768
8267
  }
7769
8268
  function eofInTemplate(p, token) {
7770
8269
  if (p.openElements.tmplCount > 0) {
7771
- p.openElements.popUntilTagNamePopped(TAG_ID.TEMPLATE);
7772
- p.activeFormattingElements.clearToLastMarker();
7773
- p.tmplInsertionModeStack.shift();
8270
+ do {
8271
+ p.openElements.popUntilTagNamePopped(TAG_ID.TEMPLATE);
8272
+ p.activeFormattingElements.clearToLastMarker();
8273
+ p.tmplInsertionModeStack.pop();
8274
+ } while (p.openElements.tmplCount > 0);
7774
8275
  p._resetInsertionMode();
7775
8276
  p.onEof(token);
7776
8277
  } else stopParsing(p, token);
@@ -7877,22 +8378,17 @@ function endTagInForeignContent(p, token) {
7877
8378
  p._endTagOutsideForeignContent(token);
7878
8379
  return;
7879
8380
  }
7880
- for (let i = p.openElements.stackTop; i > 0; i--) {
7881
- const element = p.openElements.items[i];
7882
- if (p.treeAdapter.getNamespaceURI(element) === NS.HTML) {
7883
- p._endTagOutsideForeignContent(token);
7884
- break;
7885
- }
7886
- const tagName = p.treeAdapter.getTagName(element);
7887
- if (tagName.toLowerCase() === token.tagName) {
7888
- token.tagName = tagName;
7889
- p.openElements.shortenToLength(i);
7890
- break;
7891
- }
7892
- }
7893
- }
7894
- //#endregion
7895
- //#region ../../node_modules/.pnpm/entities@8.1.0/node_modules/entities/dist/escape.js
8381
+ if (p.openElements.stackTop === 0) return;
8382
+ const { tagName } = token;
8383
+ const adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP.get(tagName);
8384
+ const contextNs = p.fragmentContext ? p.treeAdapter.getNamespaceURI(p.fragmentContext) : NS.HTML;
8385
+ const i = Math.max(p.openElements.indexOfTopmostByName(NS.SVG, tagName), p.openElements.indexOfTopmostByName(NS.MATHML, tagName), adjustedTagName === void 0 ? -1 : p.openElements.indexOfTopmostByName(NS.SVG, adjustedTagName), contextNs === NS.HTML || contextNs === NS.SVG || contextNs === NS.MATHML ? -1 : p.openElements.indexOfTopmostByName(contextNs, tagName));
8386
+ if (i > p.openElements.indexOfTopmostHtmlElement()) {
8387
+ token.tagName = p.treeAdapter.getTagName(p.openElements.items[i]);
8388
+ p.openElements.shortenToLength(i);
8389
+ } else p._endTagOutsideForeignContent(token);
8390
+ }
8391
+ // ../../node_modules/.pnpm/entities@9.0.0/node_modules/entities/dist/escape.js
7896
8392
  /**
7897
8393
  * Get the named reference for an XML special character or U+00A0.
7898
8394
  * @param char Code unit matched by one of the escape regexes.
@@ -7921,7 +8417,7 @@ function escapeWithRegex(re, data) {
7921
8417
  } while (re.test(data));
7922
8418
  return out + data.substring(last);
7923
8419
  }
7924
- const attributeEscapeRegex = /["&\u{A0}]/gu;
8420
+ const attributeEscapeRegex = /["&<>\u{A0}]/gu;
7925
8421
  /**
7926
8422
  * Encodes all characters that have to be escaped in HTML attributes,
7927
8423
  * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
@@ -7939,8 +8435,7 @@ const textEscapeRegex = /[&<>\u{A0}]/gu;
7939
8435
  function escapeText(data) {
7940
8436
  return escapeWithRegex(textEscapeRegex, data);
7941
8437
  }
7942
- //#endregion
7943
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/serializer/index.js
8438
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/serializer/index.js
7944
8439
  const VOID_ELEMENTS = /* @__PURE__ */ new Set([
7945
8440
  TAG_NAMES.AREA,
7946
8441
  TAG_NAMES.BASE,
@@ -7991,30 +8486,46 @@ const defaultOpts = {
7991
8486
  * @param options Serialization options.
7992
8487
  */
7993
8488
  function serialize(node, options) {
8489
+ var _a;
7994
8490
  const opts = {
7995
8491
  ...defaultOpts,
7996
8492
  ...options
7997
8493
  };
7998
8494
  if (isVoidElement(node, opts)) return "";
7999
- return serializeChildNodes(node, opts);
8495
+ const { treeAdapter } = opts;
8496
+ const container = treeAdapter.isElementNode(node) && treeAdapter.getTagName(node) === TAG_NAMES.TEMPLATE && treeAdapter.getNamespaceURI(node) === NS.HTML ? treeAdapter.getTemplateContent(node) : node;
8497
+ return serializeNodes((_a = treeAdapter.getChildNodes(container)) !== null && _a !== void 0 ? _a : [], opts);
8000
8498
  }
8001
- function serializeChildNodes(parentNode, options) {
8499
+ function serializeNodes(nodes, options) {
8500
+ var _a;
8501
+ const { treeAdapter } = options;
8502
+ const stack = [];
8002
8503
  let html = "";
8003
- const container = options.treeAdapter.isElementNode(parentNode) && options.treeAdapter.getTagName(parentNode) === TAG_NAMES.TEMPLATE && options.treeAdapter.getNamespaceURI(parentNode) === NS.HTML ? options.treeAdapter.getTemplateContent(parentNode) : parentNode;
8004
- const childNodes = options.treeAdapter.getChildNodes(container);
8005
- if (childNodes) for (const currentNode of childNodes) html += serializeNode(currentNode, options);
8006
- return html;
8007
- }
8008
- function serializeNode(node, options) {
8009
- if (options.treeAdapter.isElementNode(node)) return serializeElement(node, options);
8010
- if (options.treeAdapter.isTextNode(node)) return serializeTextNode(node, options);
8011
- if (options.treeAdapter.isCommentNode(node)) return serializeCommentNode(node, options);
8012
- if (options.treeAdapter.isDocumentTypeNode(node)) return serializeDocumentTypeNode(node, options);
8013
- return "";
8014
- }
8015
- function serializeElement(node, options) {
8016
- const tn = options.treeAdapter.getTagName(node);
8017
- return `<${tn}${serializeAttributes(node, options)}>${isVoidElement(node, options) ? "" : `${serializeChildNodes(node, options)}</${tn}>`}`;
8504
+ let index = 0;
8505
+ for (;;) if (index < nodes.length) {
8506
+ const node = nodes[index++];
8507
+ if (treeAdapter.isElementNode(node)) {
8508
+ const tn = treeAdapter.getTagName(node);
8509
+ html += `<${tn}${serializeAttributes(node, options)}>`;
8510
+ const isHtml = treeAdapter.getNamespaceURI(node) === NS.HTML;
8511
+ if (!(isHtml && VOID_ELEMENTS.has(tn))) {
8512
+ stack.push({
8513
+ nodes,
8514
+ index,
8515
+ endTag: `</${tn}>`
8516
+ });
8517
+ nodes = (_a = treeAdapter.getChildNodes(isHtml && tn === TAG_NAMES.TEMPLATE ? treeAdapter.getTemplateContent(node) : node)) !== null && _a !== void 0 ? _a : [];
8518
+ index = 0;
8519
+ }
8520
+ } else if (treeAdapter.isTextNode(node)) html += serializeTextNode(node, options);
8521
+ else if (treeAdapter.isCommentNode(node)) html += serializeCommentNode(node, options);
8522
+ else if (treeAdapter.isDocumentTypeNode(node)) html += serializeDocumentTypeNode(node, options);
8523
+ } else {
8524
+ const parent = stack.pop();
8525
+ if (!parent) return html;
8526
+ html += parent.endTag;
8527
+ ({nodes, index} = parent);
8528
+ }
8018
8529
  }
8019
8530
  function serializeAttributes(node, { treeAdapter }) {
8020
8531
  let html = "";
@@ -8051,8 +8562,7 @@ function serializeCommentNode(node, { treeAdapter }) {
8051
8562
  function serializeDocumentTypeNode(node, { treeAdapter }) {
8052
8563
  return `<!DOCTYPE ${treeAdapter.getDocumentTypeNodeName(node)}>`;
8053
8564
  }
8054
- //#endregion
8055
- //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/index.js
8565
+ // ../../node_modules/.pnpm/parse5@8.1.1/node_modules/parse5/dist/index.js
8056
8566
  /**
8057
8567
  * Parses an HTML string.
8058
8568
  *
@@ -8083,8 +8593,7 @@ function parseFragment(fragmentContext, html, options) {
8083
8593
  parser.tokenizer.write(html, true);
8084
8594
  return parser.getFragment();
8085
8595
  }
8086
- //#endregion
8087
- //#region ../../packages/document/src/references.ts
8596
+ // ../../packages/document/src/references.ts
8088
8597
  const ASSET_TYPES = {
8089
8598
  png: {
8090
8599
  mime: "image/png",
@@ -8411,8 +8920,7 @@ function classifyLink(raw) {
8411
8920
  segments
8412
8921
  };
8413
8922
  }
8414
- //#endregion
8415
- //#region ../../packages/document/src/analysis.ts
8923
+ // ../../packages/document/src/analysis.ts
8416
8924
  const PARSER_LIMITS = {
8417
8925
  maxNodes: 1e5,
8418
8926
  maxDepth: 64
@@ -8751,8 +9259,7 @@ function analyzeDocument(source, format) {
8751
9259
  };
8752
9260
  return format === "markdown" ? analyzeMarkdown(source) : analyzeHtml(source);
8753
9261
  }
8754
- //#endregion
8755
- //#region ../../packages/document/src/html-link-relay.ts
9262
+ // ../../packages/document/src/html-link-relay.ts
8756
9263
  const HTML_LINK_ATTRIBUTE = "data-vde-document-link";
8757
9264
  const HTML_LINK_RELAY = `(() => {
8758
9265
  if (parent === window) return;
@@ -8775,8 +9282,7 @@ const HTML_LINK_RELAY = `(() => {
8775
9282
  }, true);
8776
9283
  parent.postMessage('vde-open:document-links', '*', [channel.port2]);
8777
9284
  })();`;
8778
- //#endregion
8779
- //#region ../../packages/document/src/rendering-rules.ts
9285
+ // ../../packages/document/src/rendering-rules.ts
8780
9286
  function renderedLinkOf(href) {
8781
9287
  if (href === void 0 || href === "") return "text";
8782
9288
  if (isSafeLink(href)) return href.startsWith("#") ? "fragment" : "external";
@@ -8786,8 +9292,7 @@ function localImagePath(src, documentLogicalPath) {
8786
9292
  const reference = classifyReference(src, dirnameOfLogicalPath(documentLogicalPath));
8787
9293
  return reference.kind === "local" ? reference.logicalPath : null;
8788
9294
  }
8789
- //#endregion
8790
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/char-code-definitions.js
9295
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/char-code-definitions.js
8791
9296
  const EOF = 0;
8792
9297
  function isDigit(code) {
8793
9298
  return code >= 48 && code <= 57;
@@ -8852,8 +9357,7 @@ for (let i = 0; i < CATEGORY.length; i++) CATEGORY[i] = isWhiteSpace(i) && 130 |
8852
9357
  function charCodeCategory(code) {
8853
9358
  return code < 128 ? CATEGORY[code] : 132;
8854
9359
  }
8855
- //#endregion
8856
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/utils.js
9360
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/utils.js
8857
9361
  function getCharCode(source, offset) {
8858
9362
  return offset < source.length ? source.charCodeAt(offset) : 0;
8859
9363
  }
@@ -8949,8 +9453,7 @@ function decodeEscaped(escaped) {
8949
9453
  if (code === 0 || code >= 55296 && code <= 57343 || code > 1114111) code = 65533;
8950
9454
  return String.fromCodePoint(code);
8951
9455
  }
8952
- //#endregion
8953
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/names.js
9456
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/names.js
8954
9457
  var names_default = [
8955
9458
  "EOF-token",
8956
9459
  "ident-token",
@@ -8979,15 +9482,13 @@ var names_default = [
8979
9482
  "}-token",
8980
9483
  "comment-token"
8981
9484
  ];
8982
- //#endregion
8983
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/adopt-buffer.js
9485
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/adopt-buffer.js
8984
9486
  const MIN_SIZE = 16384;
8985
9487
  function adoptBuffer(buffer = null, size) {
8986
9488
  if (buffer === null || buffer.length < size) return new Uint32Array(Math.max(size + 1024, MIN_SIZE));
8987
9489
  return buffer;
8988
9490
  }
8989
- //#endregion
8990
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/OffsetToLocation.js
9491
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/OffsetToLocation.js
8991
9492
  const N$1 = 10;
8992
9493
  const F = 12;
8993
9494
  const R = 13;
@@ -9058,9 +9559,8 @@ var OffsetToLocation = class {
9058
9559
  };
9059
9560
  }
9060
9561
  };
9061
- //#endregion
9062
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/TokenStream.js
9063
- const OFFSET_MASK = 16777215;
9562
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/TokenStream.js
9563
+ const OFFSET_MASK = 0xffffff;
9064
9564
  const TYPE_SHIFT = 24;
9065
9565
  const BLOCK_OPEN_TOKEN = 1;
9066
9566
  const BLOCK_CLOSE_TOKEN = 2;
@@ -9282,8 +9782,7 @@ var TokenStream = class {
9282
9782
  return tokens;
9283
9783
  }
9284
9784
  };
9285
- //#endregion
9286
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/index.js
9785
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/tokenizer/index.js
9287
9786
  function tokenize(source, onToken) {
9288
9787
  function getCharCode(offset) {
9289
9788
  return offset < sourceLength ? source.charCodeAt(offset) : 0;
@@ -9518,8 +10017,7 @@ function tokenize(source, onToken) {
9518
10017
  onToken(type, start, start = offset);
9519
10018
  }
9520
10019
  }
9521
- //#endregion
9522
- //#region ../../node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/base64.js
10020
+ // ../../node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/base64.js
9523
10021
  var require_base64 = /* @__PURE__ */ __commonJSMin(((exports) => {
9524
10022
  var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
9525
10023
  /**
@@ -9552,8 +10050,7 @@ var require_base64 = /* @__PURE__ */ __commonJSMin(((exports) => {
9552
10050
  return -1;
9553
10051
  };
9554
10052
  }));
9555
- //#endregion
9556
- //#region ../../node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/base64-vlq.js
10053
+ // ../../node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/base64-vlq.js
9557
10054
  var require_base64_vlq = /* @__PURE__ */ __commonJSMin(((exports) => {
9558
10055
  var base64 = require_base64();
9559
10056
  var VLQ_BASE_SHIFT = 5;
@@ -9617,8 +10114,7 @@ var require_base64_vlq = /* @__PURE__ */ __commonJSMin(((exports) => {
9617
10114
  aOutParam.rest = aIndex;
9618
10115
  };
9619
10116
  }));
9620
- //#endregion
9621
- //#region ../../node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/util.js
10117
+ // ../../node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/util.js
9622
10118
  var require_util = /* @__PURE__ */ __commonJSMin(((exports) => {
9623
10119
  /**
9624
10120
  * This is a helper function for getting values from parameter/options
@@ -9964,8 +10460,7 @@ var require_util = /* @__PURE__ */ __commonJSMin(((exports) => {
9964
10460
  }
9965
10461
  exports.computeSourceURL = computeSourceURL;
9966
10462
  }));
9967
- //#endregion
9968
- //#region ../../node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/array-set.js
10463
+ // ../../node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/array-set.js
9969
10464
  var require_array_set = /* @__PURE__ */ __commonJSMin(((exports) => {
9970
10465
  var util = require_util();
9971
10466
  var has = Object.prototype.hasOwnProperty;
@@ -10058,8 +10553,7 @@ var require_array_set = /* @__PURE__ */ __commonJSMin(((exports) => {
10058
10553
  };
10059
10554
  exports.ArraySet = ArraySet;
10060
10555
  }));
10061
- //#endregion
10062
- //#region ../../node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/mapping-list.js
10556
+ // ../../node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/mapping-list.js
10063
10557
  var require_mapping_list = /* @__PURE__ */ __commonJSMin(((exports) => {
10064
10558
  var util = require_util();
10065
10559
  /**
@@ -10127,8 +10621,7 @@ var require_mapping_list = /* @__PURE__ */ __commonJSMin(((exports) => {
10127
10621
  };
10128
10622
  exports.MappingList = MappingList;
10129
10623
  }));
10130
- //#endregion
10131
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/generator/sourceMap.js
10624
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/generator/sourceMap.js
10132
10625
  var import_source_map_generator = (/* @__PURE__ */ __commonJSMin(((exports) => {
10133
10626
  var base64VLQ = require_base64_vlq();
10134
10627
  var util = require_util();
@@ -10479,8 +10972,7 @@ function generateSourceMap(handlers) {
10479
10972
  };
10480
10973
  return handlers;
10481
10974
  }
10482
- //#endregion
10483
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/generator/token-before.js
10975
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/generator/token-before.js
10484
10976
  var token_before_exports = /* @__PURE__ */ __exportAll({
10485
10977
  safe: () => safe,
10486
10978
  spec: () => spec
@@ -10599,8 +11091,7 @@ function createMap(pairs) {
10599
11091
  }
10600
11092
  const spec = createMap(specPairs);
10601
11093
  const safe = createMap(safePairs);
10602
- //#endregion
10603
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/generator/create.js
11094
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/generator/create.js
10604
11095
  const REVERSESOLIDUS = 92;
10605
11096
  function processChildren(node, delimeter) {
10606
11097
  if (typeof delimeter === "function") {
@@ -10656,8 +11147,7 @@ function createGenerator(config) {
10656
11147
  return handlers.result();
10657
11148
  };
10658
11149
  }
10659
- //#endregion
10660
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/AnPlusB.js
11150
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/AnPlusB.js
10661
11151
  var AnPlusB_exports = /* @__PURE__ */ __exportAll({
10662
11152
  generate: () => generate$49,
10663
11153
  name: () => name$48,
@@ -10820,8 +11310,7 @@ function generate$49(node) {
10820
11310
  } else this.tokenize(a);
10821
11311
  } else this.tokenize(node.b);
10822
11312
  }
10823
- //#endregion
10824
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Atrule.js
11313
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Atrule.js
10825
11314
  var Atrule_exports = /* @__PURE__ */ __exportAll({
10826
11315
  generate: () => generate$48,
10827
11316
  name: () => name$47,
@@ -10886,8 +11375,7 @@ function generate$48(node) {
10886
11375
  if (node.block) this.node(node.block);
10887
11376
  else this.token(17, ";");
10888
11377
  }
10889
- //#endregion
10890
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
11378
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js
10891
11379
  var AtrulePrelude_exports = /* @__PURE__ */ __exportAll({
10892
11380
  generate: () => generate$47,
10893
11381
  name: () => name$46,
@@ -10915,8 +11403,7 @@ function parse$47(name) {
10915
11403
  function generate$47(node) {
10916
11404
  this.children(node);
10917
11405
  }
10918
- //#endregion
10919
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/AttributeSelector.js
11406
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/AttributeSelector.js
10920
11407
  var AttributeSelector_exports = /* @__PURE__ */ __exportAll({
10921
11408
  generate: () => generate$46,
10922
11409
  name: () => name$45,
@@ -11013,8 +11500,7 @@ function generate$46(node) {
11013
11500
  if (node.flags !== null) this.token(1, node.flags);
11014
11501
  this.token(9, "]");
11015
11502
  }
11016
- //#endregion
11017
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Block.js
11503
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Block.js
11018
11504
  var Block_exports = /* @__PURE__ */ __exportAll({
11019
11505
  generate: () => generate$45,
11020
11506
  name: () => name$44,
@@ -11076,8 +11562,7 @@ function generate$45(node) {
11076
11562
  });
11077
11563
  this.token(24, "}");
11078
11564
  }
11079
- //#endregion
11080
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Brackets.js
11565
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Brackets.js
11081
11566
  var Brackets_exports = /* @__PURE__ */ __exportAll({
11082
11567
  generate: () => generate$44,
11083
11568
  name: () => name$43,
@@ -11103,8 +11588,7 @@ function generate$44(node) {
11103
11588
  this.children(node);
11104
11589
  this.token(9, "]");
11105
11590
  }
11106
- //#endregion
11107
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/CDC.js
11591
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/CDC.js
11108
11592
  var CDC_exports = /* @__PURE__ */ __exportAll({
11109
11593
  generate: () => generate$43,
11110
11594
  name: () => "CDC",
@@ -11123,8 +11607,7 @@ function parse$43() {
11123
11607
  function generate$43() {
11124
11608
  this.token(15, "-->");
11125
11609
  }
11126
- //#endregion
11127
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/CDO.js
11610
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/CDO.js
11128
11611
  var CDO_exports = /* @__PURE__ */ __exportAll({
11129
11612
  generate: () => generate$42,
11130
11613
  name: () => "CDO",
@@ -11143,8 +11626,7 @@ function parse$42() {
11143
11626
  function generate$42() {
11144
11627
  this.token(14, "<!--");
11145
11628
  }
11146
- //#endregion
11147
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/ClassSelector.js
11629
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/ClassSelector.js
11148
11630
  var ClassSelector_exports = /* @__PURE__ */ __exportAll({
11149
11631
  generate: () => generate$41,
11150
11632
  name: () => name$40,
@@ -11166,8 +11648,7 @@ function generate$41(node) {
11166
11648
  this.token(9, ".");
11167
11649
  this.token(1, node.name);
11168
11650
  }
11169
- //#endregion
11170
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Combinator.js
11651
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Combinator.js
11171
11652
  var Combinator_exports = /* @__PURE__ */ __exportAll({
11172
11653
  generate: () => generate$40,
11173
11654
  name: () => name$39,
@@ -11212,8 +11693,7 @@ function parse$40() {
11212
11693
  function generate$40(node) {
11213
11694
  this.tokenize(node.name);
11214
11695
  }
11215
- //#endregion
11216
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Comment.js
11696
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Comment.js
11217
11697
  var Comment_exports = /* @__PURE__ */ __exportAll({
11218
11698
  generate: () => generate$39,
11219
11699
  name: () => name$38,
@@ -11238,8 +11718,7 @@ function parse$39() {
11238
11718
  function generate$39(node) {
11239
11719
  this.token(25, "/*" + node.value + "*/");
11240
11720
  }
11241
- //#endregion
11242
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Condition.js
11721
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Condition.js
11243
11722
  var Condition_exports = /* @__PURE__ */ __exportAll({
11244
11723
  generate: () => generate$38,
11245
11724
  name: () => name$37,
@@ -11321,15 +11800,13 @@ function generate$38(node) {
11321
11800
  } else this.node(child);
11322
11801
  });
11323
11802
  }
11324
- //#endregion
11325
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/utils/names.js
11803
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/utils/names.js
11326
11804
  const HYPHENMINUS$2 = 45;
11327
11805
  function isCustomProperty(str, offset) {
11328
11806
  offset = offset || 0;
11329
11807
  return str.length - offset >= 2 && str.charCodeAt(offset) === HYPHENMINUS$2 && str.charCodeAt(offset + 1) === HYPHENMINUS$2;
11330
11808
  }
11331
- //#endregion
11332
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Declaration.js
11809
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Declaration.js
11333
11810
  var Declaration_exports = /* @__PURE__ */ __exportAll({
11334
11811
  generate: () => generate$37,
11335
11812
  name: () => name$36,
@@ -11434,8 +11911,7 @@ function getImportant() {
11434
11911
  const important = this.consume(1);
11435
11912
  return important === "important" ? true : important;
11436
11913
  }
11437
- //#endregion
11438
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/DeclarationList.js
11914
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/DeclarationList.js
11439
11915
  var DeclarationList_exports = /* @__PURE__ */ __exportAll({
11440
11916
  generate: () => generate$36,
11441
11917
  name: () => name$35,
@@ -11477,8 +11953,7 @@ function generate$36(node) {
11477
11953
  if (prev.type === "Declaration") this.token(17, ";");
11478
11954
  });
11479
11955
  }
11480
- //#endregion
11481
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Dimension.js
11956
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Dimension.js
11482
11957
  var Dimension_exports = /* @__PURE__ */ __exportAll({
11483
11958
  generate: () => generate$35,
11484
11959
  name: () => name$34,
@@ -11503,8 +11978,7 @@ function parse$35() {
11503
11978
  function generate$35(node) {
11504
11979
  this.token(12, node.value + node.unit);
11505
11980
  }
11506
- //#endregion
11507
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Feature.js
11981
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Feature.js
11508
11982
  var Feature_exports = /* @__PURE__ */ __exportAll({
11509
11983
  generate: () => generate$34,
11510
11984
  name: () => name$33,
@@ -11579,8 +12053,7 @@ function generate$34(node) {
11579
12053
  }
11580
12054
  this.token(22, ")");
11581
12055
  }
11582
- //#endregion
11583
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/FeatureFunction.js
12056
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/FeatureFunction.js
11584
12057
  var FeatureFunction_exports = /* @__PURE__ */ __exportAll({
11585
12058
  generate: () => generate$33,
11586
12059
  name: () => name$32,
@@ -11623,8 +12096,7 @@ function generate$33(node) {
11623
12096
  this.node(node.value);
11624
12097
  this.token(22, ")");
11625
12098
  }
11626
- //#endregion
11627
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/FeatureRange.js
12099
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/FeatureRange.js
11628
12100
  var FeatureRange_exports = /* @__PURE__ */ __exportAll({
11629
12101
  generate: () => generate$32,
11630
12102
  name: () => name$31,
@@ -11732,8 +12204,7 @@ function generate$32(node) {
11732
12204
  }
11733
12205
  this.token(22, ")");
11734
12206
  }
11735
- //#endregion
11736
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Function.js
12207
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Function.js
11737
12208
  var Function_exports = /* @__PURE__ */ __exportAll({
11738
12209
  generate: () => generate$31,
11739
12210
  name: () => name$30,
@@ -11766,8 +12237,7 @@ function generate$31(node) {
11766
12237
  this.children(node);
11767
12238
  this.token(22, ")");
11768
12239
  }
11769
- //#endregion
11770
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/GeneralEnclosed.js
12240
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/GeneralEnclosed.js
11771
12241
  var GeneralEnclosed_exports = /* @__PURE__ */ __exportAll({
11772
12242
  generate: () => generate$30,
11773
12243
  name: () => name$29,
@@ -11806,8 +12276,7 @@ function generate$30(node) {
11806
12276
  this.children(node);
11807
12277
  this.token(22, ")");
11808
12278
  }
11809
- //#endregion
11810
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Hash.js
12279
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Hash.js
11811
12280
  var Hash_exports = /* @__PURE__ */ __exportAll({
11812
12281
  generate: () => generate$29,
11813
12282
  name: () => name$28,
@@ -11829,8 +12298,7 @@ function parse$29() {
11829
12298
  function generate$29(node) {
11830
12299
  this.token(4, "#" + node.value);
11831
12300
  }
11832
- //#endregion
11833
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Identifier.js
12301
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Identifier.js
11834
12302
  var Identifier_exports = /* @__PURE__ */ __exportAll({
11835
12303
  generate: () => generate$28,
11836
12304
  name: () => name$27,
@@ -11849,8 +12317,7 @@ function parse$28() {
11849
12317
  function generate$28(node) {
11850
12318
  this.token(1, node.name);
11851
12319
  }
11852
- //#endregion
11853
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/IdSelector.js
12320
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/IdSelector.js
11854
12321
  var IdSelector_exports = /* @__PURE__ */ __exportAll({
11855
12322
  generate: () => generate$27,
11856
12323
  name: () => name$26,
@@ -11871,8 +12338,7 @@ function parse$27() {
11871
12338
  function generate$27(node) {
11872
12339
  this.token(9, "#" + node.name);
11873
12340
  }
11874
- //#endregion
11875
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Layer.js
12341
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Layer.js
11876
12342
  var Layer_exports = /* @__PURE__ */ __exportAll({
11877
12343
  generate: () => generate$26,
11878
12344
  name: () => name$25,
@@ -11898,8 +12364,7 @@ function parse$26() {
11898
12364
  function generate$26(node) {
11899
12365
  this.tokenize(node.name);
11900
12366
  }
11901
- //#endregion
11902
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/LayerList.js
12367
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/LayerList.js
11903
12368
  var LayerList_exports = /* @__PURE__ */ __exportAll({
11904
12369
  generate: () => generate$25,
11905
12370
  name: () => name$24,
@@ -11927,8 +12392,7 @@ function parse$25() {
11927
12392
  function generate$25(node) {
11928
12393
  this.children(node, () => this.token(18, ","));
11929
12394
  }
11930
- //#endregion
11931
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/MediaQuery.js
12395
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/MediaQuery.js
11932
12396
  var MediaQuery_exports = /* @__PURE__ */ __exportAll({
11933
12397
  generate: () => generate$24,
11934
12398
  name: () => name$23,
@@ -11996,8 +12460,7 @@ function generate$24(node) {
11996
12460
  }
11997
12461
  } else if (node.condition) this.node(node.condition);
11998
12462
  }
11999
- //#endregion
12000
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/MediaQueryList.js
12463
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/MediaQueryList.js
12001
12464
  var MediaQueryList_exports = /* @__PURE__ */ __exportAll({
12002
12465
  generate: () => generate$23,
12003
12466
  name: () => name$22,
@@ -12023,8 +12486,7 @@ function parse$23() {
12023
12486
  function generate$23(node) {
12024
12487
  this.children(node, () => this.token(18, ","));
12025
12488
  }
12026
- //#endregion
12027
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/NestingSelector.js
12489
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/NestingSelector.js
12028
12490
  var NestingSelector_exports = /* @__PURE__ */ __exportAll({
12029
12491
  generate: () => generate$22,
12030
12492
  name: () => name$21,
@@ -12045,8 +12507,7 @@ function parse$22() {
12045
12507
  function generate$22() {
12046
12508
  this.token(9, "&");
12047
12509
  }
12048
- //#endregion
12049
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Nth.js
12510
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Nth.js
12050
12511
  var Nth_exports = /* @__PURE__ */ __exportAll({
12051
12512
  generate: () => generate$21,
12052
12513
  name: () => "Nth",
@@ -12086,8 +12547,7 @@ function generate$21(node) {
12086
12547
  this.node(node.selector);
12087
12548
  }
12088
12549
  }
12089
- //#endregion
12090
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Number.js
12550
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Number.js
12091
12551
  var Number_exports = /* @__PURE__ */ __exportAll({
12092
12552
  generate: () => generate$20,
12093
12553
  name: () => name$19,
@@ -12106,8 +12566,7 @@ function parse$20() {
12106
12566
  function generate$20(node) {
12107
12567
  this.token(10, node.value);
12108
12568
  }
12109
- //#endregion
12110
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Operator.js
12569
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Operator.js
12111
12570
  var Operator_exports = /* @__PURE__ */ __exportAll({
12112
12571
  generate: () => generate$19,
12113
12572
  name: () => name$18,
@@ -12128,8 +12587,7 @@ function parse$19() {
12128
12587
  function generate$19(node) {
12129
12588
  this.tokenize(node.value);
12130
12589
  }
12131
- //#endregion
12132
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Parentheses.js
12590
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Parentheses.js
12133
12591
  var Parentheses_exports = /* @__PURE__ */ __exportAll({
12134
12592
  generate: () => generate$18,
12135
12593
  name: () => name$17,
@@ -12155,8 +12613,7 @@ function generate$18(node) {
12155
12613
  this.children(node);
12156
12614
  this.token(22, ")");
12157
12615
  }
12158
- //#endregion
12159
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Percentage.js
12616
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Percentage.js
12160
12617
  var Percentage_exports = /* @__PURE__ */ __exportAll({
12161
12618
  generate: () => generate$17,
12162
12619
  name: () => name$16,
@@ -12175,8 +12632,7 @@ function parse$17() {
12175
12632
  function generate$17(node) {
12176
12633
  this.token(11, node.value + "%");
12177
12634
  }
12178
- //#endregion
12179
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/PseudoClassSelector.js
12635
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/PseudoClassSelector.js
12180
12636
  var PseudoClassSelector_exports = /* @__PURE__ */ __exportAll({
12181
12637
  generate: () => generate$16,
12182
12638
  name: () => name$15,
@@ -12226,8 +12682,7 @@ function generate$16(node) {
12226
12682
  this.token(22, ")");
12227
12683
  }
12228
12684
  }
12229
- //#endregion
12230
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/PseudoElementSelector.js
12685
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/PseudoElementSelector.js
12231
12686
  var PseudoElementSelector_exports = /* @__PURE__ */ __exportAll({
12232
12687
  generate: () => generate$15,
12233
12688
  name: () => name$14,
@@ -12279,8 +12734,7 @@ function generate$15(node) {
12279
12734
  this.token(22, ")");
12280
12735
  }
12281
12736
  }
12282
- //#endregion
12283
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Ratio.js
12737
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Ratio.js
12284
12738
  var Ratio_exports = /* @__PURE__ */ __exportAll({
12285
12739
  generate: () => generate$14,
12286
12740
  name: () => name$13,
@@ -12327,8 +12781,7 @@ function generate$14(node) {
12327
12781
  if (node.right) this.node(node.right);
12328
12782
  else this.node(10, 1);
12329
12783
  }
12330
- //#endregion
12331
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Raw.js
12784
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Raw.js
12332
12785
  var Raw_exports = /* @__PURE__ */ __exportAll({
12333
12786
  generate: () => generate$13,
12334
12787
  name: () => "Raw",
@@ -12357,8 +12810,7 @@ function parse$13(consumeUntil, excludeWhiteSpace) {
12357
12810
  function generate$13(node) {
12358
12811
  this.tokenize(node.value);
12359
12812
  }
12360
- //#endregion
12361
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Rule.js
12813
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Rule.js
12362
12814
  var Rule_exports = /* @__PURE__ */ __exportAll({
12363
12815
  generate: () => generate$12,
12364
12816
  name: () => name$11,
@@ -12399,8 +12851,7 @@ function generate$12(node) {
12399
12851
  this.node(node.prelude);
12400
12852
  this.node(node.block);
12401
12853
  }
12402
- //#endregion
12403
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Scope.js
12854
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Scope.js
12404
12855
  var Scope_exports = /* @__PURE__ */ __exportAll({
12405
12856
  generate: () => generate$11,
12406
12857
  name: () => name$10,
@@ -12462,8 +12913,7 @@ function generate$11(node) {
12462
12913
  this.token(22, ")");
12463
12914
  }
12464
12915
  }
12465
- //#endregion
12466
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Selector.js
12916
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Selector.js
12467
12917
  var Selector_exports = /* @__PURE__ */ __exportAll({
12468
12918
  generate: () => generate$10,
12469
12919
  name: () => name$9,
@@ -12492,8 +12942,7 @@ function parse$10() {
12492
12942
  function generate$10(node) {
12493
12943
  this.children(node);
12494
12944
  }
12495
- //#endregion
12496
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/SelectorList.js
12945
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/SelectorList.js
12497
12946
  var SelectorList_exports = /* @__PURE__ */ __exportAll({
12498
12947
  generate: () => generate$9,
12499
12948
  name: () => name$8,
@@ -12523,8 +12972,7 @@ function parse$9() {
12523
12972
  function generate$9(node) {
12524
12973
  this.children(node, () => this.token(18, ","));
12525
12974
  }
12526
- //#endregion
12527
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/utils/string.js
12975
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/utils/string.js
12528
12976
  const REVERSE_SOLIDUS$1 = 92;
12529
12977
  const QUOTATION_MARK$1 = 34;
12530
12978
  const APOSTROPHE$1 = 39;
@@ -12579,8 +13027,7 @@ function encode$1(str, apostrophe) {
12579
13027
  }
12580
13028
  return quote + encoded + quote;
12581
13029
  }
12582
- //#endregion
12583
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/String.js
13030
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/String.js
12584
13031
  var String_exports = /* @__PURE__ */ __exportAll({
12585
13032
  generate: () => generate$8,
12586
13033
  name: () => name$7,
@@ -12599,8 +13046,7 @@ function parse$8() {
12599
13046
  function generate$8(node) {
12600
13047
  this.token(5, encode$1(node.value));
12601
13048
  }
12602
- //#endregion
12603
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/StyleSheet.js
13049
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/StyleSheet.js
12604
13050
  var StyleSheet_exports = /* @__PURE__ */ __exportAll({
12605
13051
  generate: () => generate$7,
12606
13052
  name: () => name$6,
@@ -12660,8 +13106,7 @@ function parse$7() {
12660
13106
  function generate$7(node) {
12661
13107
  this.children(node);
12662
13108
  }
12663
- //#endregion
12664
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/SupportsDeclaration.js
13109
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/SupportsDeclaration.js
12665
13110
  var SupportsDeclaration_exports = /* @__PURE__ */ __exportAll({
12666
13111
  generate: () => generate$6,
12667
13112
  name: () => name$5,
@@ -12687,8 +13132,7 @@ function generate$6(node) {
12687
13132
  this.node(node.declaration);
12688
13133
  this.token(22, ")");
12689
13134
  }
12690
- //#endregion
12691
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/TypeSelector.js
13135
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/TypeSelector.js
12692
13136
  var TypeSelector_exports = /* @__PURE__ */ __exportAll({
12693
13137
  generate: () => generate$5,
12694
13138
  name: () => name$4,
@@ -12724,8 +13168,7 @@ function parse$5() {
12724
13168
  function generate$5(node) {
12725
13169
  this.tokenize(node.name);
12726
13170
  }
12727
- //#endregion
12728
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/UnicodeRange.js
13171
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/UnicodeRange.js
12729
13172
  var UnicodeRange_exports = /* @__PURE__ */ __exportAll({
12730
13173
  generate: () => generate$4,
12731
13174
  name: () => name$3,
@@ -12808,8 +13251,7 @@ function parse$4() {
12808
13251
  function generate$4(node) {
12809
13252
  this.tokenize(node.value);
12810
13253
  }
12811
- //#endregion
12812
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/utils/url.js
13254
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/utils/url.js
12813
13255
  const SPACE$1 = 32;
12814
13256
  const REVERSE_SOLIDUS = 92;
12815
13257
  const QUOTATION_MARK = 34;
@@ -12866,8 +13308,7 @@ function encode(str) {
12866
13308
  }
12867
13309
  return "url(" + encoded + ")";
12868
13310
  }
12869
- //#endregion
12870
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Url.js
13311
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Url.js
12871
13312
  var Url_exports = /* @__PURE__ */ __exportAll({
12872
13313
  generate: () => generate$3,
12873
13314
  name: () => "Url",
@@ -12901,8 +13342,7 @@ function parse$3() {
12901
13342
  function generate$3(node) {
12902
13343
  this.token(7, encode(node.value));
12903
13344
  }
12904
- //#endregion
12905
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Value.js
13345
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/Value.js
12906
13346
  var Value_exports = /* @__PURE__ */ __exportAll({
12907
13347
  generate: () => generate$2,
12908
13348
  name: () => name$1,
@@ -12923,8 +13363,7 @@ function parse$2() {
12923
13363
  function generate$2(node) {
12924
13364
  this.children(node);
12925
13365
  }
12926
- //#endregion
12927
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/WhiteSpace.js
13366
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/node/WhiteSpace.js
12928
13367
  var WhiteSpace_exports = /* @__PURE__ */ __exportAll({
12929
13368
  generate: () => generate$1,
12930
13369
  name: () => name,
@@ -12945,8 +13384,7 @@ function parse$1() {
12945
13384
  function generate$1(node) {
12946
13385
  this.token(13, node.value);
12947
13386
  }
12948
- //#endregion
12949
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/generator/index.js
13387
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/generator/index.js
12950
13388
  var generator_default = createGenerator({ node: /* @__PURE__ */ __exportAll({
12951
13389
  AnPlusB: () => generate$49,
12952
13390
  Atrule: () => generate$48,
@@ -12998,8 +13436,7 @@ var generator_default = createGenerator({ node: /* @__PURE__ */ __exportAll({
12998
13436
  Value: () => generate$2,
12999
13437
  WhiteSpace: () => generate$1
13000
13438
  }) });
13001
- //#endregion
13002
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/utils/List.js
13439
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/utils/List.js
13003
13440
  let releasedCursors = null;
13004
13441
  var List = class List {
13005
13442
  static createItem(data) {
@@ -13278,8 +13715,7 @@ var List = class List {
13278
13715
  this.remove(oldItem);
13279
13716
  }
13280
13717
  };
13281
- //#endregion
13282
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/utils/create-custom-error.js
13718
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/utils/create-custom-error.js
13283
13719
  function createCustomError(name, message) {
13284
13720
  const error = Object.create(SyntaxError.prototype);
13285
13721
  const errorStack = /* @__PURE__ */ new Error();
@@ -13291,8 +13727,7 @@ function createCustomError(name, message) {
13291
13727
  }
13292
13728
  });
13293
13729
  }
13294
- //#endregion
13295
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/parser/SyntaxError.js
13730
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/parser/SyntaxError.js
13296
13731
  const MAX_LINE_LENGTH = 100;
13297
13732
  const OFFSET_CORRECTION = 60;
13298
13733
  const TAB_REPLACEMENT = " ";
@@ -13346,8 +13781,7 @@ function SyntaxError$1(message, source, offset, line, column, baseLine = 1, base
13346
13781
  }
13347
13782
  });
13348
13783
  }
13349
- //#endregion
13350
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/parser/sequence.js
13784
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/parser/sequence.js
13351
13785
  function readSequence(recognizer) {
13352
13786
  const children = this.createList();
13353
13787
  let space = false;
@@ -13373,8 +13807,7 @@ function readSequence(recognizer) {
13373
13807
  if (space && recognizer.onWhiteSpace) recognizer.onWhiteSpace.call(this, null, children, context);
13374
13808
  return children;
13375
13809
  }
13376
- //#endregion
13377
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/parser/create.js
13810
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/parser/create.js
13378
13811
  const NOOP = () => {};
13379
13812
  const EXCLAMATIONMARK = 33;
13380
13813
  const NUMBERSIGN$2 = 35;
@@ -13636,8 +14069,7 @@ function createParser(config) {
13636
14069
  config: parser.config
13637
14070
  });
13638
14071
  }
13639
- //#endregion
13640
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/scope/default.js
14072
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/scope/default.js
13641
14073
  const NUMBERSIGN$1 = 35;
13642
14074
  const ASTERISK$1 = 42;
13643
14075
  const PLUSSIGN$1 = 43;
@@ -13666,11 +14098,9 @@ function defaultRecognizer(context) {
13666
14098
  }
13667
14099
  }
13668
14100
  }
13669
- //#endregion
13670
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/scope/atrulePrelude.js
14101
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/scope/atrulePrelude.js
13671
14102
  var atrulePrelude_default = { getNode: defaultRecognizer };
13672
- //#endregion
13673
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/scope/selector.js
14103
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/scope/selector.js
13674
14104
  const NUMBERSIGN = 35;
13675
14105
  const AMPERSAND = 38;
13676
14106
  const ASTERISK = 42;
@@ -13716,13 +14146,11 @@ var selector_default = {
13716
14146
  onWhiteSpace,
13717
14147
  getNode
13718
14148
  };
13719
- //#endregion
13720
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/function/expression.js
14149
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/function/expression.js
13721
14150
  function expression_default() {
13722
14151
  return this.createSingleNodeList(this.Raw(null, false));
13723
14152
  }
13724
- //#endregion
13725
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/function/var.js
14153
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/function/var.js
13726
14154
  function var_default() {
13727
14155
  const children = this.createList();
13728
14156
  this.skipSC();
@@ -13746,8 +14174,7 @@ function var_default() {
13746
14174
  }
13747
14175
  return children;
13748
14176
  }
13749
- //#endregion
13750
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/scope/value.js
14177
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/scope/value.js
13751
14178
  function isPlusMinusOperator(node) {
13752
14179
  return node !== null && node.type === "Operator" && (node.value[node.value.length - 1] === "-" || node.value[node.value.length - 1] === "+");
13753
14180
  }
@@ -13760,15 +14187,13 @@ var value_default = {
13760
14187
  "expression": expression_default,
13761
14188
  "var": var_default
13762
14189
  };
13763
- //#endregion
13764
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/scope/index.js
14190
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/scope/index.js
13765
14191
  var scope_exports = /* @__PURE__ */ __exportAll({
13766
14192
  AtrulePrelude: () => atrulePrelude_default,
13767
14193
  Selector: () => selector_default,
13768
14194
  Value: () => value_default
13769
14195
  });
13770
- //#endregion
13771
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/atrule/container.js
14196
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/atrule/container.js
13772
14197
  const nonContainerNameKeywords = /* @__PURE__ */ new Set([
13773
14198
  "none",
13774
14199
  "and",
@@ -13789,16 +14214,14 @@ var container_default = { parse: {
13789
14214
  return this.Block(nested);
13790
14215
  }
13791
14216
  } };
13792
- //#endregion
13793
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/atrule/font-face.js
14217
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/atrule/font-face.js
13794
14218
  var font_face_default = { parse: {
13795
14219
  prelude: null,
13796
14220
  block() {
13797
14221
  return this.Block(true);
13798
14222
  }
13799
14223
  } };
13800
- //#endregion
13801
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/atrule/import.js
14224
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/atrule/import.js
13802
14225
  function parseWithFallback(parse, fallback) {
13803
14226
  return this.parseWithFallback(() => {
13804
14227
  try {
@@ -13825,8 +14248,7 @@ const parseFunctions = {
13825
14248
  return children;
13826
14249
  }
13827
14250
  };
13828
- //#endregion
13829
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/atrule/index.js
14251
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/atrule/index.js
13830
14252
  var atrule_default = {
13831
14253
  container: container_default,
13832
14254
  "font-face": font_face_default,
@@ -13908,8 +14330,7 @@ var atrule_default = {
13908
14330
  }
13909
14331
  } }
13910
14332
  };
13911
- //#endregion
13912
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/pseudo/lang.js
14333
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/pseudo/lang.js
13913
14334
  function parseLanguageRangeList() {
13914
14335
  const children = this.createList();
13915
14336
  this.skipSC();
@@ -13931,8 +14352,7 @@ function parseLanguageRangeList() {
13931
14352
  }
13932
14353
  return children;
13933
14354
  }
13934
- //#endregion
13935
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/pseudo/index.js
14355
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/syntax/pseudo/index.js
13936
14356
  const selectorList = { parse() {
13937
14357
  return this.createSingleNodeList(this.SelectorList());
13938
14358
  } };
@@ -13946,8 +14366,7 @@ const langList = { parse: parseLanguageRangeList };
13946
14366
  const nth = { parse() {
13947
14367
  return this.createSingleNodeList(this.Nth());
13948
14368
  } };
13949
- //#endregion
13950
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/parser/index.js
14369
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/parser/index.js
13951
14370
  var parser_default = createParser({
13952
14371
  parseContext: {
13953
14372
  default: "StyleSheet",
@@ -14051,8 +14470,7 @@ var parser_default = createParser({
14051
14470
  WhiteSpace: () => parse$1
14052
14471
  })
14053
14472
  });
14054
- //#endregion
14055
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/walker/create.js
14473
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/walker/create.js
14056
14474
  const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
14057
14475
  const noop = function() {};
14058
14476
  function ensureFunction(value) {
@@ -14229,8 +14647,7 @@ function createWalker(config) {
14229
14647
  };
14230
14648
  return walk;
14231
14649
  }
14232
- //#endregion
14233
- //#region ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/walker/index.js
14650
+ // ../../node_modules/.pnpm/css-tree@3.2.1/node_modules/css-tree/lib/walker/index.js
14234
14651
  var walker_default = createWalker({ node: /* @__PURE__ */ __exportAll({
14235
14652
  AnPlusB: () => AnPlusB_exports,
14236
14653
  Atrule: () => Atrule_exports,
@@ -14282,8 +14699,7 @@ var walker_default = createWalker({ node: /* @__PURE__ */ __exportAll({
14282
14699
  Value: () => Value_exports,
14283
14700
  WhiteSpace: () => WhiteSpace_exports
14284
14701
  }) });
14285
- //#endregion
14286
- //#region ../../packages/document/src/css-transform.ts
14702
+ // ../../packages/document/src/css-transform.ts
14287
14703
  const parse = parser_default;
14288
14704
  const walk = walker_default;
14289
14705
  const generate = generator_default;
@@ -14406,8 +14822,7 @@ function scanCssReferences(source, kind) {
14406
14822
  });
14407
14823
  return references;
14408
14824
  }
14409
- //#endregion
14410
- //#region ../../packages/document/src/html-static.ts
14825
+ // ../../packages/document/src/html-static.ts
14411
14826
  const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
14412
14827
  const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
14413
14828
  const REMOVED_ELEMENTS = {
@@ -14688,7 +15103,7 @@ function rawTextOf(element) {
14688
15103
  function assertOutput(html, interactive, withLinkRelay) {
14689
15104
  const document = parse$50(html, { scriptingEnabled: false });
14690
15105
  const relay = withLinkRelay ? headOf(document).childNodes[0] : void 0;
14691
- if (withLinkRelay && (!relay || !isElement(relay) || relay.tagName !== "script" || relay.attrs.length !== 0 || rawTextOf(relay) !== HTML_LINK_RELAY)) throw new Error("unsafe output: document link relay");
15106
+ if (withLinkRelay && (!relay || !isElement(relay) || relay.tagName !== "script" || relay.attrs.length !== 0 || rawTextOf(relay) !== "(() => {\n if (parent === window) return;\n const channel = new MessageChannel();\n const send = channel.port1.postMessage.bind(channel.port1);\n const closest = Function.call.bind(Element.prototype.closest);\n const attribute = Function.call.bind(Element.prototype.getAttribute);\n const targetOf = Function.call.bind(Object.getOwnPropertyDescriptor(Event.prototype, 'target').get);\n const preventDefault = Function.call.bind(Event.prototype.preventDefault);\n const ElementType = Element;\n const Anchor = HTMLAnchorElement;\n const Area = HTMLAreaElement;\n window.addEventListener('click', (event) => {\n const target = targetOf(event);\n if (!(target instanceof ElementType)) return;\n const link = closest(target, 'a[href=\"#\"][data-vde-document-link], area[href=\"#\"][data-vde-document-link]');\n if (!(link instanceof Anchor || link instanceof Area)) return;\n preventDefault(event);\n if (event.isTrusted) send(attribute(link, 'data-vde-document-link'));\n }, true);\n parent.postMessage('vde-open:document-links', '*', [channel.port2]);\n})();")) throw new Error("unsafe output: document link relay");
14692
15107
  const stack = [document];
14693
15108
  while (stack.length > 0) {
14694
15109
  const node = stack.pop();
@@ -14872,5 +15287,4 @@ function scanHtmlReferences(source) {
14872
15287
  });
14873
15288
  return references;
14874
15289
  }
14875
- //#endregion
14876
- export { parseMarkdown as A, isValidLogicalPath as C, serialize as D, parseFragment as E, __toESM as F, escapeHtml as M, footnoteReferenceId as N, defaultTreeAdapter as O, __commonJSMin as P, hasHiddenSegment as S, parse$50 as T, assetTypeOf as _, scanCssReferences as a, dirnameOfLogicalPath as b, renderedLinkOf as c, ParseLimitError as d, analyzeDocument as f, parseMarkdownDocument as g, markdownUrlTransform as h, transformStaticHtml as i, escapeAttr as j, NS as k, HTML_LINK_RELAY as l, inlineText as m, resolveAssetUrl as n, transformCss as o, assertWithinLimits as p, scanHtmlReferences as r, localImagePath as s, DiagnosticLog as t, MARKDOWN_PARSE_OPTIONS as u, classifyLink as v, roleAllowed as w, encodeLogicalPath as x, classifyReference as y };
15290
+ export { parseMarkdown as A, isValidLogicalPath as C, serialize as D, parseFragment as E, escapeHtml as M, footnoteReferenceId as N, defaultTreeAdapter as O, hasHiddenSegment as S, parse$50 as T, assetTypeOf as _, scanCssReferences as a, dirnameOfLogicalPath as b, renderedLinkOf as c, ParseLimitError as d, analyzeDocument as f, parseMarkdownDocument as g, markdownUrlTransform as h, transformStaticHtml as i, escapeAttr as j, NS as k, HTML_LINK_RELAY as l, inlineText as m, resolveAssetUrl as n, transformCss as o, assertWithinLimits as p, scanHtmlReferences as r, localImagePath as s, DiagnosticLog as t, MARKDOWN_PARSE_OPTIONS as u, classifyLink as v, roleAllowed as w, encodeLogicalPath as x, classifyReference as y };