1import { a as zt } from "./sucrase_Vx5h13n5.js"; 2import { f as Tt, p as We, a as Ge, n as Ve, h as Ue, s as ke, t as Jt } from "./shiki_CE0IyDxo.js"; 3const Ke = /[#.]/g; 4function Zt(e, t) { 5 const u = e || "", s = {}; 6 let n = 0, o, E; 7 for (; n < u.length; ) { 8 Ke.lastIndex = n; 9 const l = Ke.exec(u), T = u.slice(n, l ? l.index : u.length); 10 T && (o ? o === "#" ? s.id = T : Array.isArray(s.className) ? s.className.push(T) : s.className = [T] : E = T, n += T.length), l && (o = l[0], n++); 11 } 12 return { 13 type: "element", 14 // @ts-expect-error: tag name is parsed. 15 tagName: E || t || "div", 16 properties: s, 17 children: [] 18 }; 19} 20function mt(e, t, u) { 21 const s = u ? uu(u) : void 0; 22 function n(o, E, ...l) { 23 let T; 24 if (o == null) { 25 T = { type: "root", children: [] }; 26 const m = ( 27 /** @type {Child} */ 28 E 29 ); 30 l.unshift(m); 31 } else { 32 T = Zt(o, t); 33 const m = T.tagName.toLowerCase(), _ = s ? s.get(m) : void 0; 34 if (T.tagName = _ || m, $t(E)) 35 l.unshift(E); 36 else 37 for (const [A, I] of Object.entries(E)) 38 eu(e, T.properties, A, I); 39 } 40 for (const m of l) 41 Oe(T.children, m); 42 return T.type === "element" && T.tagName === "template" && (T.content = { type: "root", children: T.children }, T.children = []), T; 43 } 44 return n; 45} 46function $t(e) { 47 if (e === null || typeof e != "object" || Array.isArray(e)) 48 return !0; 49 if (typeof e.type != "string") return !1; 50 const t = ( 51 /** @type {Record<string, unknown>} */ 52 e 53 ), u = Object.keys(e); 54 for (const s of u) { 55 const n = t[s]; 56 if (n && typeof n == "object") { 57 if (!Array.isArray(n)) return !0; 58 const o = ( 59 /** @type {ReadonlyArray<unknown>} */ 60 n 61 ); 62 for (const E of o) 63 if (typeof E != "number" && typeof E != "string") 64 return !0; 65 } 66 } 67 return !!("children" in e && Array.isArray(e.children)); 68} 69function eu(e, t, u, s) { 70 const n = Tt(e, u); 71 let o; 72 if (s != null) { 73 if (typeof s == "number") { 74 if (Number.isNaN(s)) return; 75 o = s; 76 } else typeof s == "boolean" ? o = s : typeof s == "string" ? n.spaceSeparated ? o = We(s) : n.commaSeparated ? o = Ge(s) : n.commaOrSpaceSeparated ? o = We(Ge(s).join(" ")) : o = Xe(n, n.property, s) : Array.isArray(s) ? o = [...s] : o = n.property === "style" ? tu(s) : String(s); 77 if (Array.isArray(o)) { 78 const E = []; 79 for (const l of o) 80 E.push( 81 /** @type {number | string} */ 82 Xe(n, n.property, l) 83 ); 84 o = E; 85 } 86 n.property === "className" && Array.isArray(t.className) && (o = t.className.concat( 87 /** @type {Array<number | string> | number | string} */ 88 o 89 )), t[n.property] = o; 90 } 91} 92function Oe(e, t) { 93 if (t != null) if (typeof t == "number" || typeof t == "string") 94 e.push({ type: "text", value: String(t) }); 95 else if (Array.isArray(t)) 96 for (const u of t) 97 Oe(e, u); 98 else if (typeof t == "object" && "type" in t) 99 t.type === "root" ? Oe(e, t.children) : e.push(t); 100 else 101 throw new Error("Expected node, nodes, or string, got `" + t + "`"); 102} 103function Xe(e, t, u) { 104 if (typeof u == "string") { 105 if (e.number && u && !Number.isNaN(Number(u))) 106 return Number(u); 107 if ((e.boolean || e.overloadedBoolean) && (u === "" || Ve(u) === Ve(t))) 108 return !0; 109 } 110 return u; 111} 112function tu(e) { 113 const t = []; 114 for (const [u, s] of Object.entries(e)) 115 t.push([u, s].join(": ")); 116 return t.join("; "); 117} 118function uu(e) { 119 const t = /* @__PURE__ */ new Map(); 120 for (const u of e) 121 t.set(u.toLowerCase(), u); 122 return t; 123} 124const au = [ 125 "altGlyph", 126 "altGlyphDef", 127 "altGlyphItem", 128 "animateColor", 129 "animateMotion", 130 "animateTransform", 131 "clipPath", 132 "feBlend", 133 "feColorMatrix", 134 "feComponentTransfer", 135 "feComposite", 136 "feConvolveMatrix", 137 "feDiffuseLighting", 138 "feDisplacementMap", 139 "feDistantLight", 140 "feDropShadow", 141 "feFlood", 142 "feFuncA", 143 "feFuncB", 144 "feFuncG", 145 "feFuncR", 146 "feGaussianBlur", 147 "feImage", 148 "feMerge", 149 "feMergeNode", 150 "feMorphology", 151 "feOffset", 152 "fePointLight", 153 "feSpecularLighting", 154 "feSpotLight", 155 "feTile", 156 "feTurbulence", 157 "foreignObject", 158 "glyphRef", 159 "linearGradient", 160 "radialGradient", 161 "solidColor", 162 "textArea", 163 "textPath" 164], su = mt(Ue, "div"), ru = mt(ke, "g", au); 165function nu(e) { 166 const t = String(e), u = []; 167 return { toOffset: n, toPoint: s }; 168 function s(o) { 169 if (typeof o == "number" && o > -1 && o <= t.length) { 170 let E = 0; 171 for (; ; ) { 172 let l = u[E]; 173 if (l === void 0) { 174 const T = je(t, u[E - 1]); 175 l = T === -1 ? t.length + 1 : T + 1, u[E] = l; 176 } 177 if (l > o) 178 return { 179 line: E + 1, 180 column: o - (E >
180 0 ? u[E - 1] : 0) + 1, 181 offset: o 182 }; 183 E++; 184 } 185 } 186 } 187 function n(o) { 188 if (o && typeof o.line == "number" && typeof o.column == "number" && !Number.isNaN(o.line) && !Number.isNaN(o.column)) { 189 for (; u.length < o.line; ) { 190 const l = u[u.length - 1], T = je(t, l), m = T === -1 ? t.length + 1 : T + 1; 191 if (l === m) break; 192 u.push(m); 193 } 194 const E = (o.line > 1 ? u[o.line - 2] : 0) + o.column - 1; 195 if (E < u[o.line - 1]) return E; 196 } 197 } 198} 199function je(e, t) { 200 const u = e.indexOf("\r", t), s = e.indexOf(` 201`, t); 202 return s === -1 ? u : u === -1 || u + 1 === s ? s : u < s ? u : s; 203} 204const iu = { 205 svg: "http://www.w3.org/2000/svg" 206}, bt = {}.hasOwnProperty, cu = Object.prototype; 207function ou(e, t) { 208 const u = t || {}; 209 return He( 210 { 211 file: u.file || void 0, 212 location: !1, 213 schema: u.space === "svg" ? ke : Ue, 214 verbose: u.verbose || !1 215 }, 216 e 217 ); 218} 219function He(e, t) { 220 let u; 221 switch (t.nodeName) { 222 case "#comment": { 223 const s = ( 224 /** @type {DefaultTreeAdapterMap['commentNode']} */ 225 t 226 ); 227 return u = { type: "comment", value: s.data }, ne(e, s, u), u; 228 } 229 case "#document": 230 case "#document-fragment": { 231 const s = ( 232 /** @type {DefaultTreeAdapterMap['document'] | DefaultTreeAdapterMap['documentFragment']} */ 233 t 234 ), n = "mode" in s ? s.mode === "quirks" || s.mode === "limited-quirks" : !1; 235 if (u = { 236 type: "root", 237 children: _t(e, t.childNodes), 238 data: { quirksMode: n } 239 }, e.file && e.location) { 240 const o = String(e.file), E = nu(o), l = E.toPoint(0), T = E.toPoint(o.length); 241 u.position = { start: l, end: T }; 242 } 243 return u; 244 } 245 case "#documentType": { 246 const s = ( 247 /** @type {DefaultTreeAdapterMap['documentType']} */ 248 t 249 ); 250 return u = { type: "doctype" }, ne(e, s, u), u; 251 } 252 case "#text": { 253 const s = ( 254 /** @type {DefaultTreeAdapterMap['textNode']} */ 255 t 256 ); 257 return u = { type: "text", value: s.value }, ne(e, s, u), u; 258 } 259 // Element. 260 default: 261 return u = du( 262 e, 263 /** @type {DefaultTreeAdapterMap['element']} */ 264 t 265 ), u; 266 } 267} 268function _t(e, t) { 269 let u = -1; 270 const s = []; 271 for (; ++u < t.length; ) { 272 const n = ( 273 /** @type {RootContent} */ 274 He(e, t[u]) 275 ); 276 s.push(n); 277 } 278 return s; 279} 280function du(e, t) { 281 const u = e.schema; 282 e.schema = t.namespaceURI === iu.svg ? ke : Ue; 283 let s = -1; 284 const n = {}; 285 for (; ++s < t.attrs.length; ) { 286 const l = t.attrs[s], T = (l.prefix ? l.prefix + ":" : "") + l.name; 287 bt.call(cu, T) || (n[T] = l.value); 288 } 289 const E = (e.schema.space === "svg" ? ru : su)(t.tagName, n, _t(e, t.childNodes)); 290 if (ne(e, t, E), E.tagName === "template") { 291 const l = ( 292 /** @type {DefaultTreeAdapterMap['template']} */ 293 t 294 ), T = l.sourceCodeLocation, m = T && T.startTag && W(T.startTag), _ = T && T.endTag && W(T.endTag), A = ( 295 /** @type {Root} */ 296 He(e, l.content) 297 ); 298 m && _ && e.file && (A.position = { start: m.end, end: _.start }), E.content = A; 299 } 300 return e.schema = u, E; 301} 302function ne(e, t, u) { 303 if ("sourceCodeLocation" in t && t.sourceCodeLocation && e.file) { 304 const s = Eu(e, u, t.sourceCodeLocation); 305 s && (e.location = !0, u.position = s); 306 } 307} 308function Eu(e, t, u) { 309 const s = W(u); 310 if (t.type === "element") { 311 const n = t.children[t.children.length - 1]; 312 if (s && !u.endTag && n && n.position && n.position.end && (s.end = Object.assign({}, n.position.end)), e.verbose) { 313 const o = {}; 314 let E; 315 if (u.attrs) 316 for (E in u.attrs) 317 bt.call(u.attrs, E) && (o[Tt(e.schema, E).property] = W( 318 u.attrs[E] 319 )); 320 u.startTag; 321 const l = W(u.startTag), T = u.endTag ? W(u.endTag) : void 0, m = { opening: l }; 322 T && (m.closing = T), m.properties = o, t.data = { position: m }; 323 } 324 } 325 return s; 326} 327function W(e) { 328 const t = ze({ 329 line: e.startLine, 330 column: e.startCol, 331 offset: e.startOffset 332 }), u = ze({ 333 line: e.endLine, 334 column: e.endCol, 335 offset: e.endOffset 336 }); 337 return t || u ? { start: t, end: u } : void 0; 338} 339function ze(e) { 340 return e.line && e.column ? e : void 0; 341} 342const fu = /* @__PURE__ */ new Set([ 343 65534, 344 65535, 345 131070, 346 131071, 347 196606, 348 196607, 349 262142, 350 262143, 351 327678, 352 327679, 353 393214, 354 393215, 355 458750, 356 458751, 357 524286, 358 524287, 359 589822, 360 589823, 361 655358, 362 655359, 363 720894, 364 720895, 365 786430, 366 786431, 367 851966, 368 851967, 369 917502, 370 917503, 371 983038, 372 983039, 373 1048574, 374 1048575, 375 1114110, 376 1114111 377]), N = "�"; 378var r; 379(function(e) { 380 e[e.EOF = -1] = "EOF", e[e.NULL = 0] = "NULL", e[e.TABULATION = 9] = "TABULATION", e[e.CARRIAGE_RETURN = 13] = "CARRIAGE_RETURN", e[e.LINE_FEED = 10] = "LINE_FEED", e[e.FORM_FEED = 12] = "FORM_FEED", e[e.SPACE = 32] = "SPACE", e[e.EXCLAMATION_MARK = 33] = "EXCLAMATION_MARK", e[e.QUOTATION_MARK = 34] = "QUOTATION_MARK", e[e.AMPERSAND = 38]
vendor: 4,333 bytes, lines 380-407
380= "AMPERSAND", e[e.APOSTROPHE = 39] = "APOSTROPHE", e[e.HYPHEN_MINUS = 45] = "HYPHEN_MINUS", e[e.SOLIDUS = 47] = "SOLIDUS", e[e.DIGIT_0 = 48] = "DIGIT_0", e[e.DIGIT_9 = 57] = "DIGIT_9", e[e.SEMICOLON = 59] = "SEMICOLON", e[e.LESS_THAN_SIGN = 60] = "LESS_THAN_SIGN", e[e.EQUALS_SIGN = 61] = "EQUALS_SIGN", e[e.GREATER_THAN_SIGN = 62] = "GREATER_THAN_SIGN", e[e.QUESTION_MARK = 63] = "QUESTION_MARK", e[e.LATIN_CAPITAL_A = 65] = "LATIN_CAPITAL_A", e[e.LATIN_CAPITAL_Z = 90] = "LATIN_CAPITAL_Z", e[e.RIGHT_SQUARE_BRACKET = 93] = "RIGHT_SQUARE_BRACKET", e[e.GRAVE_ACCENT = 96] = "GRAVE_ACCENT", e[e.LATIN_SMALL_A = 97] = "LATIN_SMALL_A", e[e.LATIN_SMALL_Z = 122] = "LATIN_SMALL_Z"; 381})(r || (r = {})); 382const D = { 383 DASH_DASH: "--", 384 CDATA_START: "[CDATA[", 385 DOCTYPE: "doctype", 386 SCRIPT: "script", 387 PUBLIC: "public", 388 SYSTEM: "system" 389}; 390function At(e) { 391 return e >= 55296 && e <= 57343; 392} 393function lu(e) { 394 return e >= 56320 && e <= 57343; 395} 396function hu(e, t) { 397 return (e - 55296) * 1024 + 9216 + t; 398} 399function pt(e) { 400 return e !== 32 && e !== 10 && e !== 13 && e !== 9 && e !== 12 && e >= 1 && e <= 31 || e >= 127 && e <= 159; 401} 402function It(e) { 403 return e >= 64976 && e <= 65007 || fu.has(e); 404} 405var f; 406(function(e) { 407 e.controlCharacterInInputStream = "control-character-in-input-stream", e.noncharacterInInputStream = "noncharacter-in-input-stream", e.surrogateInInputStream = "surrogate-in-input-stream", e.nonVoidHtmlElementStartTagWithTrailingSolidus = "non-void-html-element-start-tag-with-trailing-solidus", e.endTagWithAttributes = "end-tag-with-attributes", e.endTagWithTrailingSolidus = "end-tag-with-trailing-solidus", e.unexpectedSolidusInTag = "unexpected-solidus-in-tag", e.unexpectedNullCharacter = "unexpected-null-character", e.unexpectedQuestionMarkInsteadOfTagName = "unexpected-question-mark-instead-of-tag-name", e.invalidFirstCharacterOfTagName = "invalid-first-character-of-tag-name", e.unexpectedEqualsSignBeforeAttributeName = "unexpected-equals-sign-before-attribute-name", e.missingEndTagName = "missing-end-tag-name", e.unexpectedCharacterInAttributeName = "unexpected-character-in-attribute-name", e.unknownNamedCharacterReference = "unknown-named-character-reference", e.missingSemicolonAfterCharacterReference = "missing-semicolon-after-character-reference", e.unexpectedCharacterAfterDoctypeSystemIdentifier = "unexpected-character-after-doctype-system-identifier", e.unexpectedCharacterInUnquotedAttributeValue = "unexpected-character-in-unquoted-attribute-value", e.eofBeforeTagName = "eof-before-tag-name", e.eofInTag = "eof-in-tag", e.missingAttributeValue = "missing-attribute-value", e.missingWhitespaceBetweenAttributes = "missing-whitespace-between-attributes", e.missingWhitespaceAfterDoctypePublicKeyword = "missing-whitespace-after-doctype-public-keyword", e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers = "missing-whitespace-between-doctype-public-and-system-identifiers", e.missingWhitespaceAfterDoctypeSystemKeyword = "missing-whitespace-after-doctype-system-keyword", e.missingQuoteBeforeDoctypePublicIdentifier = "missing-quote-before-doctype-public-identifier", e.missingQuoteBeforeDoctypeSystemIdentifier = "missing-quote-before-doctype-system-identifier", e.missingDoctypePublicIdentifier = "missing-doctype-public-identifier", e.missingDoctypeSystemIdentifier = "missing-doctype-system-identifier", e.abruptDoctypePublicIdentifier = "abrupt-doctype-public-identifier", e.abruptDoctypeSystemIdentifier = "abrupt-doctype-system-identifier", e.cdataInHtmlContent = "cdata-in-html-content", e.incorrectlyOpenedComment = "incorrectly-opened-comment", e.eofInScriptHtmlCommentLikeText = "eof-in-script-html-comment-like-text", e.eofInDoctype = "eof-in-doctype", e.nestedComment = "nested-comment", e.abruptClosingOfEmptyComment = "abrupt-closing-of-empty-comment", e.eofInComment = "eof-in-comment", e.incorrectlyClosedComment = "incorrectly-closed-comment", e.eofInCdata = "eof-in-cdata", e.absenceOfDigitsInNumericCharacterReference = "absence-of-digits-in-numeric-character-reference", e.nullCharacterReference = "null-character-reference", e.surrogateCharacterReference = "surrogate-character-reference", e.characterReferenceOutsideUnicodeRange = "character-reference-outside-unicode-range", e.controlCharacterReference = "control-character-reference", e.nonch
vendor: 4,941 bytes, lines 407-494
407aracterCharacterReference = "noncharacter-character-reference", e.missingWhitespaceBeforeDoctypeName = "missing-whitespace-before-doctype-name", e.missingDoctypeName = "missing-doctype-name", e.invalidCharacterSequenceAfterDoctypeName = "invalid-character-sequence-after-doctype-name", e.duplicateAttribute = "duplicate-attribute", e.nonConformingDoctype = "non-conforming-doctype", e.missingDoctype = "missing-doctype", e.misplacedDoctype = "misplaced-doctype", e.endTagWithoutMatchingOpenElement = "end-tag-without-matching-open-element", e.closingOfElementWithOpenChildElements = "closing-of-element-with-open-child-elements", e.disallowedContentInNoscriptInHead = "disallowed-content-in-noscript-in-head", e.openElementsLeftAfterEof = "open-elements-left-after-eof", e.abandonedHeadElementChild = "abandoned-head-element-child", e.misplacedStartTagForHeadElement = "misplaced-start-tag-for-head-element", e.nestedNoscriptInHead = "nested-noscript-in-head", e.eofInElementThatCanContainOnlyText = "eof-in-element-that-can-contain-only-text"; 408})(f || (f = {})); 409const Tu = 65536; 410class mu { 411 constructor(t) { 412 this.handler = t, this.html = "", this.pos = -1, this.lastGapPos = -2, this.gapStack = [], this.skipNextNewLine = !1, this.lastChunkWritten = !1, this.endOfChunkHit = !1, this.bufferWaterline = Tu, this.isEol = !1, this.lineStartPos = 0, this.droppedBufferSize = 0, this.line = 1, this.lastErrOffset = -1; 413 } 414 /** The column on the current line. If we just saw a gap (eg. a surrogate pair), return the index before. */ 415 get col() { 416 return this.pos - this.lineStartPos + +(this.lastGapPos !== this.pos); 417 } 418 get offset() { 419 return this.droppedBufferSize + this.pos; 420 } 421 getError(t, u) { 422 const { line: s, col: n, offset: o } = this, E = n + u, l = o + u; 423 return { 424 code: t, 425 startLine: s, 426 endLine: s, 427 startCol: E, 428 endCol: E, 429 startOffset: l, 430 endOffset: l 431 }; 432 } 433 _err(t) { 434 this.handler.onParseError && this.lastErrOffset !== this.offset && (this.lastErrOffset = this.offset, this.handler.onParseError(this.getError(t, 0))); 435 } 436 _addGap() { 437 this.gapStack.push(this.lastGapPos), this.lastGapPos = this.pos; 438 } 439 _processSurrogate(t) { 440 if (this.pos !== this.html.length - 1) { 441 const u = this.html.charCodeAt(this.pos + 1); 442 if (lu(u)) 443 return this.pos++, this._addGap(), hu(t, u); 444 } else if (!this.lastChunkWritten) 445 return this.endOfChunkHit = !0, r.EOF; 446 return this._err(f.surrogateInInputStream), t; 447 } 448 willDropParsedChunk() { 449 return this.pos > this.bufferWaterline; 450 } 451 dropParsedChunk() { 452 this.willDropParsedChunk() && (this.html = this.html.substring(this.pos), this.lineStartPos -= this.pos, this.droppedBufferSize += this.pos, this.pos = 0, this.lastGapPos = -2, this.gapStack.length = 0); 453 } 454 write(t, u) { 455 this.html.length > 0 ? this.html += t : this.html = t, this.endOfChunkHit = !1, this.lastChunkWritten = u; 456 } 457 insertHtmlAtCurrentPos(t) { 458 this.html = this.html.substring(0, this.pos + 1) + t + this.html.substring(this.pos + 1), this.endOfChunkHit = !1; 459 } 460 startsWith(t, u) { 461 if (this.pos + t.length > this.html.length) 462 return this.endOfChunkHit = !this.lastChunkWritten, !1; 463 if (u) 464 return this.html.startsWith(t, this.pos); 465 for (let s = 0; s < t.length; s++) 466 if ((this.html.charCodeAt(this.pos + s) | 32) !== t.charCodeAt(s)) 467 return !1; 468 return !0; 469 } 470 peek(t) { 471 const u = this.pos + t; 472 if (u >= this.html.length) 473 return this.endOfChunkHit = !this.lastChunkWritten, r.EOF; 474 const s = this.html.charCodeAt(u); 475 return s === r.CARRIAGE_RETURN ? r.LINE_FEED : s; 476 } 477 advance() { 478 if (this.pos++, this.isEol && (this.isEol = !1, this.line++, this.lineStartPos = this.pos), this.pos >= this.html.length) 479 return this.endOfChunkHit = !this.lastChunkWritten, r.EOF; 480 let t = this.html.charCodeAt(this.pos); 481 return t === r.CARRIAGE_RETURN ? (this.isEol = !0, this.skipNextNewLine = !0, r.LINE_FEED) : t === r.LINE_FEED && (this.isEol = !0, this.skipNextNewLine) ? (this.line--, this.skipNextNewLine = !1, this._addGap(), this.advance()) : (this.skipNextNewLine = !1, At(t) && (t = this._processSurrogate(t)), this.handler.onParseError === null || t > 31 && t < 127 || t === r.LINE_FEED || t === r.CARRIAGE_RETURN || t > 159 && t < 64976 || this._checkForProblematicCharacters(t), t); 482 } 483 _checkForProblematicCharacters(t) { 484 pt(t) ? this._err(f.controlCharacterInInputStream) : It(t) && this._err(f.noncharacterInInputStream); 485 } 486 retreat(t) { 487 for (this.pos -= t; this.pos < this.lastGapPos; ) 488 this.lastGapPos = this.gapStack.pop(), this.pos--; 489 this.isEol = !1; 490 } 491} 492var p; 493(function(e) { 494 e[e.CHARACTER = 0] = "CHARACTER", e[e.NULL_CHARACTER = 1] = "NULL_CHARACTER", e[e.WHITESPACE_CHARACTER = 2] = "WHITESPACE_CHARACTER", e[e.START_TAG = 3] = "START_TAG", e[e.END_TAG = 4] = "
494END_TAG", e[e.COMMENT = 5] = "COMMENT", e[e.DOCTYPE = 6] = "DOCTYPE", e[e.EOF = 7] = "EOF", e[e.HIBERNATION = 8] = "HIBERNATION"; 495})(p || (p = {})); 496function Nt(e, t) { 497 for (let u = e.attrs.length - 1; u >= 0; u--) 498 if (e.attrs[u].name === t) 499 return e.attrs[u].value; 500 return null; 501} 502const bu
vendor: 16,205 bytes, lines 502-504
502 = /* @__PURE__ */ new Uint16Array( 503 // prettier-ignore 504 /* @__PURE__ */ 'áµ<ÃıÊÒÕ»×ÙµÛÞ¢ßà à©àªà¶¡à¹à¼à¼¦áá¨á¡ááááá¥\0\0\0\0\0\0á«áá¦á°á·á½¾â â°âââ»ââ ¤â¤â´â¹â¿ããºã¹ã¬ã£¾ã¨¨ã©±ã« 㬮à EMabcfglmnoprstu\\bfms�¦³¹ÃÃligè»ÃäPè»&ä¦cuteè»Ãäreve;äÄiyx}rcè»Ãä;är;ìðraveè»Ãäpha;äacr;äd;æ©Ägp¡on;äf;ìð¸plyFunction;æ¡ingè»Ã ä Äcs¾Ãr;ìðign;æildeè»Ãämlè»ÃäÐaceforsuåûþÄÄĢħĪÄcrêòkslash;æÅ¶Ã¶Ã¸;æ«§ed;æy;äÆcrtÄ ÄÄause;æµnoullis;æ¬a;är;ìð pf;ìð¹eve;äcòÄmpeq;æÜHOacdefhilorsuÅÅÅÆÆÆ¢ÆµÆ·ÆºÇÈɳɸɾcy;ä§PYè»Â©ä©ÆcpyÅŢźute;äÄ;iŧŨætalDifferentialD;æ leys;æÈaeioÆÆÆÆron;ädilè»Ãärc;änint;æ°ot;äÄdnƧÆilla;ä¸terDot;ä·Ã²Å¿i;ä§rcleÈDMPTÇÇÇÇot;æinus;ælus;æimes;æoÄcsǢǸkwiseContourIntegral;æ²eCurlyÄDQÈÈoubleQuote;æuote;æÈlnpuÈȨÉÉonÄ;eȥȦæ·;æ©´ÆgitȯȶȺruent;æ¡nt;æ¯ourIntegral;æ®ÄfrÉÉ;æoduct;ænterClockwiseContourIntegral;æ³oss;樯cr;ìðpÄ;CÊÊ æap;æÖDJSZacefiosÊ Ê¬Ê°Ê´Ê¸ËËˡ˦̳ÒÄ;oŹʥtrahd;æ¤cy;äcy;ä cy;äÆgrsÊ¿ËËger;æ¡r;æ¡hv;櫤ÄayËËron;ä;älÄ;tËËæa;är;ìðÄaf˫̧Äcm˰̢riticalÈADGTÌÌÌÌcute;ä´oÅ´ÌÌ;äbleAcute;ärave;ä ilde;äond;æferentialD;æ Ѱ̽\0\0\0ÍÍ\0Ð f;ìð»Æ;DEÍÍÍä¨ot;æqual;æbleÌCDLRUVͣͲÎÏϢϸontourIntegraìȹoɴ͹\0\0ͻ»ÍnArrow;æÄeoÎΤftÆARTÎÎΡrrow;æightArrow;æeÃ¥ËngÄLRΫÏeftÄARγιrrow;æ¸ightArrow;æºightArrow;æ¹ightÄATÏÏrrow;æee;æ¨pÉÏ©\0\0ϯrrow;æownArrow;æerticalBar;æ¥nÌABLRTaÐЪаÑѿͼrrowÆ;BUÐÐТæar;æ¤pArrow;æµreve;äeftËк\0Ñ\0ÑightVector;æ¥eeVector;æ¥ectorÄ;BÑÑæ½ar;æ¥ightÇѧ\0ѱeeVector;æ¥ectorÄ;BѺѻæar;æ¥eeÄ;AÒÒæ¤rrow;æ§ÄctÒÒr;ìðrok;äà NTacdfglmopqstuxÒ½ÓÓÓÓÓ¢Ó§Ó®ÓµÔ¡Ô¯Ô¶ÕÕÕ Õ¥G;ä Hè»Ãäcuteè»ÃäÆaiyÓÓÓron;ärcè»Ãä;äot;är;ìðraveè»Ãäement;æÄapÓºÓ¾cr;ätyÉÔ\0\0ÔmallSquare;æ»erySmallSquare;æ«ÄgpÔ¦Ôªon;äf;ìð¼silon;äuÄaiÔ¼ÕlÄ;TÕÕæ©µilde;ælibrium;æÄciÕÕr;æ°m;橳a;ämlè»ÃäÄipÕªÕ¯sts;æonentialE;æ ÊcfiosÖ ÖÖÖ²×y;ä¤r;ìðlledÉÖ\0\0Ö£mallSquare;æ¼erySmallSquare;æªÍ°Öº\0Ö¿\0\0×f;ìð½All;æriertrf;æ±cÃ²×ØJTabcdfgorst×¨×¬×¯×ºØØØØØØ£Ù¬Ù²cy;äè»>ä¾mmaÄ;d׷׸ä;äreve;äÆeiyØØØdil;ä¢rc;ä;äot;ä r;ìð;æpf;ìð¾eaterÌEFGLSTصÙÙÙÙÙ¦qualÄ;Lؾؿæ¥ess;æullEqual;æ§reater;檢ess;æ·lantEqual;橾ilde;æ³cr;ìð¢;æ«ÐAacfiosuÚ ÚÚÚÚÚªÚ¾ÛRDcy;äªÄctÚÚek;ä;äirc;ä¤r;ælbertSpace;æÇ°Ú¯\0Ú²f;æizontalLine;æÄctÛÛ Ã²Ú©rok;ä¦mpÅÛÛownHumðįqual;æÜEJOacdfgmnostuÛºÛ¾ÜÜÜÜÜܡܨÝݸÞÞÞcy;älig;ä²cy;äcuteè»ÃäÄiyÜÜrcè»Ãä;äot;ä°r;æraveè»ÃäÆ;apÜ Ü¯Ü¿ÄcgÜ´Ü·r;äªinaryI;æ lieóÏÇ´Ý\0Ý¢Ä;eÝÝæ¬ÄgrÝÝral;æ«section;æisibleÄCTݬݲomma;æ£imes;æ¢ÆgptÝ¿ÞÞon;ä®f;ìða;äcr;æilde;ä¨Ç«Þ\0Þcy;älè»ÃäÊcfosuÞ¬Þ·Þ¼ßßÄiyÞ±Þµrc;ä´;är;ìðpf;ìðÇ£ß\0ßr;ìð¥rcy;äkcy;äÎHJacfosߤߨ߽߬߱à à cy;ä¥cy;äppa;äÄeyß¶ß»dil;ä¶;är;ìðpf;ìðcr;ìð¦ÖJTaceflmostà ¥à ©à ¬à¡à¡£à¦³à¦¸à§à§à¨·à©cy;äè»<ä¼Êcmnprà ·à ¼à¡à¡à¡ute;ä¹bda;äg;æªlacetrf;ær;æÆaeyà¡à¡à¡¡ron;ä½dil;ä»;äÄfsࡨ॰tÔACDFRTUVarࡾࢩࢱࣦ࣠ࣼयà¥Î४Änrà¢à¢gleBracket;æ¨rowÆ;BRà¢à¢à¢æar;æ¤ightArrow;æeiling;æoǵࢷ\0à£bleBracket;æ¦nÇà£\0à£eeVector;楡ectorÄ;Bà£à£æar;æ¥loor;æightÄAV࣯ࣵrrow;æector;æ¥Äerà¤à¤eÆ;AVà¤à¤à¤æ£rrow;æ¤ector;æ¥iangleÆ;BEतथऩæ²ar;æ§qual;æ´pÆDTVषà¥à¥ownVector;æ¥eeVector;æ¥ ectorÄ;Bà¥à¥æ¿ar;æ¥ectorÄ;B॥०æ¼ar;æ¥ightáÎsÌEFGLSTॾà¦à¦à¦à¦¢à¦qualGreater;æullEqual;æ¦reater;æ¶ess;檡lantEqual;橽ilde;æ²r;ìðÄ;eঽাæftarrow;æidot;ä¿Ænpwà§à¨à¨gÈLRlrà§à§·à¨à¨eftÄAR০৬rrow;æµightArrow;æ·ightArrow;æ¶eftÄarγà¨ightáοightáÏf;ìðerÄLRਢਬeftArrow;æightArrow;æÆchtਾà©à©Ã²à¡;æ°rok;ä ;æªÐacefiosuà©à©à© ੷੼ઠàªàªp;æ¤ y;äÄdl੥੯iumSpace;ælintrf;æ³r;ìðnusPlus;æpf;ìðcò੶;äÒJacefostuણધàªà«à¬à¬à¶à¶à¶cy;äcute;ä Æaey઴હાron;ä dil;ä ;äÆgswà«à«°à¬ativeÆMTVà«à«à«¨ediumSpace;æhiÄcn૦à«Ã«à«eryThiîà«tedÄGL૸à¬reaterGreateòٳessLesóà©Line;är;ìðÈBnptଢନଷ଺reak;æ BreakingSpace;ä f;æÚ;CDEGHLNPRSTVàààªà¼à®¡à¯«à°à±à²à²¦à³àµ¡à¶ 櫬Äouàà¤ngruent;æ¢pCap;æoubleVerticalBar;æ¦Ælqxà®à®à®ement;æualÄ;Tà®à®æ ilde;ìâ̸ists;æreaterÎ;EFGLSTஶஷ஽à¯à¯à¯à¯¥æ¯qual;æ±ullEqual;ìâ§Ì¸reater;ìâ«Ì¸ess;æ¹lantEqual;ì⩾̸ilde;æµumpÅ௲௽ownHump;ìâ̸qual;ìâ̸eÄfsà°à°§tTriangleÆ;BEà°à°à°¡æªar;ìâ§Ì¸qual;æ¬sÌ;EGLSTవశ఼à±à±à±æ®qual;æ°reater;æ¸ess;ìâªÌ¸lantEqual;ì⩽̸ilde;æ´estedÄGL౨౹reaterGreater;ì⪢̸essLess;ì⪡̸recedesÆ;ESà²à²à²æqual;ì⪯̸lantEqual;æ ÄeiಫಹverseElement;æghtTriangleÆ;BEà³à³à³æ«ar;ìâ§Ì¸qual;æÄquà³à´uareSuÄbp೨೹setÄ;Eà³°à³³ìâ̸qual;æ¢ersetÄ;Eà´à´ìâ̸qual;æ£Æbcpà´à´¤àµsetÄ;Eà´à´ìââqual;æceedsÈ;ESTà´²à´³à´»àµæqual;ì⪰̸lantEqual;æ¡ilde;ìâ¿Ì¸ersetÄ;Eàµàµìââqual;æildeÈ;EFT൮൯൵ൿæqual;æullEqual;æilde;æerticalBar;æ¤cr;ìð©ildeè»Ãä;äÜEacdfgmoprstuvà¶½à·à·à·à·à· à·§à·¼à¸à¸ ยา฿à¹lig;ä cuteè»ÃäÄiyà·à·rcè»Ãä;äblac;ä r;ìðraveè»ÃäÆaei෮ෲ෶cr;ä ga;ä©cron;äpf;ìðenCurlyÄDQà¸à¸oubleQuote;æuote;æ;æ©Äclวฬr;ìðªashè»ÃäiŬื฼deè»Ãäes;樷mlè»ÃäerÄBPà¹à¹ Äarà¹à¹r;æ¾acÄekà¹à¹;æet;æ´arenthesis;æÒacfhilors๿àºàºàºàºàºàºàº°à»¼rtialD;æy;är;ìði;ä¦;ä usMinus;ä±ÄipຢàºncareplanÃ¥Úf;æÈ;eio຺ູ໠໤檻cedesÈ;ESTà»à»à»à»æºqual;檯lantEqual;æ¼ilde;æ¾me;æ³Ädp໩໮uct;æortionÄ;aȥ໹l;æÄcià¼à¼r;ìð«;ä¨ÈUfosà¼à¼à¼à¼OTè»"ä¢r;ìðpf;æcr;ìð¬ØBEacefhiorsu༾à½à½à½ ཱིྦྷྪà¾áá©á´á¾arr;æ¤Gè»Â®ä®Æcnrà½à½à½ute;ä g;æ«rÄ;tà½à½æ l;æ¤Æaeyཧཬཱron;ä dil;ä ;ä Ä;vླྀཹæerseÄEUà¾à¾Älqà¾à¾ement;æuilibrium;æpEquilibrium;楯r»ཹo;ä¡ghtÐACDFTUVaà¿à¿«à¿³á¢á¨ááÏÄnrà¿à¿gleBracket;æ©rowÆ;BLà¿à¿à¿¡æar;æ¥eftArrow;æeiling;æoǵ࿹\0á bleBracket;æ§nÇá\0áeeVector;æ¥ectorÄ;Bááæar;æ¥loor;æÄerááeÆ;AVáµá¶á¼æ¢rrow;æ¦ector;æ¥iangleÆ;BEáááæ³ar;æ§qual;æµpÆDTVá£á®á¸ownVector;æ¥eeVector;æ¥ectorÄ;Bááæ¾ar;æ¥ectorÄ;Bááæar;æ¥Äpuááf;ændImplies;楰ightarrow;æÄchá¹á¼r;æ;æ±leDelayed;æ§´ÚHOacfhimoqstuá¤á±á·á½ááá á á ¡á §áµá»á¿ÄCcá©á®Hcy;ä©y;ä¨FTcy;ä¬cute;ä Ê;aeiyáááááæª¼ron;ä dil;ä rc;ä ;ä¡r;ìðortÈDLRUáªá´á¾á ownArrow»ÐeftArrow»à¢ightArrow»à¿pArrow;ægma;ä£allCircle;æpf;ìðɲá \0\0á °t;æareÈ;ISUá »á ¼áá¯æ¡ntersection;æuÄbpáásetÄ;Eááæqual;æersetÄ;Eá¨á©æqual;ænion;æcr;ìð®ar;æÈbcmpááááÄ;sááæetÄ;Eááqual;æÄchá á eedsÈ;ESTáá®á´á¿æ»qual;檰lantEqual;æ½ilde;æ¿Tháà¾;æÆ;esááá£ærsetÄ;Eááæqual;æet»áÖHRSacfhiorsá¾ááááá±á¶ááááORNè»ÃäADE;æ¢ÄHcáácy;äy;ä¦Äbuáá;ä;䤯aeyá¥áªá¯ron;ä ¤dil;ä ¢;ä¢r;ìðÄeiá»áDzá\0áefore;æ´a;äÄcnáákSpace;ìââSpace;ældeÈ;EFTá«á¬á²á¼æ¼qual;æullEqual;æ ilde;æpf;ìðipleDot;æÄctáár;ìð¯rok;ä ¦à«¡á·ááá¦\0á¬á±\0\0\0\0\0á¸á½á·á \0á¿áááÄcrá»áuteè»ÃärÄ;oááæcir;æ¥rÇ£á\0áy;äve;ä ¬Äiyáá£rcè»Ãä;ä£blac;ä °r;ìðraveè»Ãäacr;ä ªÄdiáá©erÄBPááÄaráár;äacÄekáá;æet;æµarenthesis;æonÄ;Pá°á±ælus;æÄgpá»á¿on;ä ²f;ìðÐADETadpsáá®á¸áϨááá³rrowÆ;BDá á á¤ar;æ¤ownArrow;æ ownArrow;æquilibrium;楮eeÄ;Aááæ¥rrow;æ¥ownáϳerÄLRáá¨eftArrow;æightArrow;æiÄ;lá¹áºäon;ä¥ing;ä ®cr;ìð°ilde;ä ¨mlè»ÃäÒDbcdefosvá§á¬á°á³á¾á áááash;æ«ar;æ««y;äashÄ;lá»á¼æ©;櫦Äeráá ;æÆbtyáááºar;æÄ;iáácalÈBLSTá¡á¥áªá´ar;æ£ine;ä¼eparator;æilde;æThinSpace;ær;ìðpf;ìðcr;ìð±dash;æªÊcefosá§á¬á±á¶á¼irc;ä ´dge;ær;ìðpf;ìðcr;ìð²Èfiosáááár;ìð;äpf;ìðcr;ìð³ÒAIUacfosuá±áµá¹á½ááááá cy;ä¯cy;äcy;ä®cuteè»ÃäÄiyáárc;ä ¶;ä«r;ìðpf;ìðcr;ìð´ml;ä ¸ÐHacdefosáµá¹á¿áááá á¤cy;äcute;ä ¹Äayááron;ä ½;äot;ä »Ç²á\0áoWidtèà«a;är;æ¨pf;æ¤cr;ìðµà¯¡ááá\0á°á¶á¿\0\0\0\0ááá«áá\0ááá²á¹\0á¾cuteè»Ã¡ä¡reve;äÌ;Ediuyááá¡á£á¨áæ¾;ìâ¾Ì³;æ¿rcè»Ã¢ä¢teè»Â´Ì;ä°ligè»Ã¦ä¦Ä;r²áº;ìðraveè»Ã ä ÄepááÄfpáásym;æµÃ¨áha;ä±ÄapácÄclá¤á§r;äg;樿ɤá°\0\0áÊ;adsváºá»á¿ááæ§nd;æ©;æ©lope;æ©;æ©Î;elmrszááááá¿ááæ ;榤e»ásdÄ;aá¥á¦æ¡Ñ¡á°á²á´á¶á¸áºá¼á¾;榨;榩;榪;榫;榬;æ¦;榮;榯tÄ;vá áæbÄ;dááæ¾;æ¦Äptááh;æ¢Â»Â¹arr;æ¼Ägpá£á§on;ä f;ìðÎ;Eaeiopáá»á½áááá;æ©°cir;橯;æd;æs;ä§roxÄ;eááñáingè»Ã¥ä¥Æctyá¡á¦á¨r;ìð¶;äªmpÄ;eáá¯Ã±Êildeè»Ã£ä£mlè»Ã¤ä¤Äciááoninôɲnt;æ¨à Nabcdefiklnoprsuáá±á°á¼ááá¸á½á á¦á ¹á¡á᤽á¥á¥°ot;æ«Äcrá¶ákÈcepsáá ááong;æpsilon;ä¶rime;æµimÄ;eááæ½q;æÅ¶á¢á¦ee;æ½edÄ;gá¬áæ e»árkÄ;táá·brk;æ¶Äoyáá;ä±quo;æÊcmprtááá¡á¤á¨ausÄ;eÄÄptyv;榰séánoÃµÄÆahwá¯á±á³;ä²;æ¶een;æ¬r;ìðgÎcostuvwááá³ááááÆaiuáááÃ°Ý rc;æ¯pÂ»á±Ædptá¤á¨áot;æ¨lus;æ¨imes;æ¨É±á¹\0\0á¾cup;æ¨ar;æ riangleÄduááown;æ½p;æ³plus;æ¨eÃ¥áÃ¥áarow;æ¤Æakoáá ¦á µÄcná²á £kÆlstáºÖ«á ozenge;æ§«riangleÈ;dlrá á á á æ´own;æ¾eft;æight;æ¸k;æ£Æ±á «\0á ³Æ²á ¯\0á ±;æ;æ4;æck;æÄeoá ¾á¡Ä;qá¡á¡ì=â¥uiv;ìâ¡â¥t;æÈptwxá¡á¡á¡§á¡¬f;ìðÄ;táá¡£om»átie;æØDHUVbdhmptuvᢠá¢á¢ªá¢»á£á£á£¬á£¿á¤ á¤á¤á¤¡ÈLRlrá¢á¢á¢á¢;æ;æ;æ;æÊ;DUduᢡᢢᢤᢦᢨæ;æ¦;æ©;æ¤;æ§ÈLRlrᢳᢵᢷᢹ;æ;æ;æ;æÎ;HLRhlrá£á£á£á£á£á£á£æ;æ¬;æ£;æ ;æ«;æ¢;æox;æ§ÈLRlrᣤᣦᣨᣪ;æ;æ;æ;æÊ;DUduڽ᣷᣹᣻᣽;æ¥;æ¨;æ¬;æ´inus;ælus;æimes;æ ÈLRlrá¤á¤á¤á¤;æ;æ;æ;æÎ;HLRhlrᤰᤱᤳᤵᤷ᤻᤹æ;æª;æ¡;æ;æ¼;æ¤;æÄevÄ£á¥barè»Â¦ä¦Èceioá¥á¥á¥á¥ r;ìð·mi;æmÄ;eáálÆ;bhᥨᥩᥫä;æ§ sub;æÅ¬á¥´á¥¾lÄ;e᥹᥺æ¢t»᥺pÆ;Eeįᦠá¦;檮Ä;qÛÛೡᦧ\0᧨á¨á¨á¨²\0ᨷá©\0\0᪴\0\0á«\0\0ᬡᬮáá\0᯽\0á°Æcprá¦á¦²á§ute;äÌ;abcdsᦿá§á§á§á§á§æ©nd;æ©rcup;æ©Äauá§á§p;æ©p;æ©ot;æ©;ìâ©ï¸Äeo᧢᧥t;æÃ®ÚÈaeiuá§°á§»á¨á¨ ǰ᧵\0᧸s;æ©on;ädilè»Ã§ä§rc;äpsÄ;sá¨á¨æ©m;æ©ot;äÆdmná¨á¨ ᨦilè»Â¸Æptyv;榲tè¢;eá¨á¨®ä¢räƲr;ìð Æceiᨽá©á©y;äckÄ;má©á©æark»á©;ärÎ;Ecefmsá©á© ᩢᩫ᪤᪪᪮æ;æ§Æ;elᩩᩪá©äq;æeɡᩴ\0\0áªrrowÄlr᩼áªeft;æºight;æ»ÊRSacdáªáªáªáªáªÂ»à½;æst;æirc;æash;ænint;æ¨id;櫯cir;æ§ubsÄ;u᪻᪼æ£it»᪼ˬá«á«á«º\0á¬onÄ;eá«á«äºÄ;qÃÃÉá«\0\0á«¢aÄ;tá«á«ä¬;äÆ;fl᫨᫩᫫æÃ®á eÄmx᫱᫶ent»᫩eóÉǧ᫾\0á¬Ä;dá»á¬ot;æ©nÃ´ÉÆfryá¬á¬á¬;ìðoäÉè©;sÅá¬r;æÄaoᬥᬩrr;æµss;æÄcuᬲᬷr;ìð¸ÄbpᬼáÄ;eááæ«;æ«Ä;eááæ«;æ«dot;æ¯Îdelprvwá á¬á·á®á®¬á¯á¯¹arrÄlrá¨áª;椸;椵ɰá²\0\0áµr;æc;æarrÄ;pá¿á®æ¶;椽Ì;bcdosá®á®á®á®¡á®¥á®¨æªrcap;æ©Äauá®á®p;æ©p;æ©ot;ær;æ© ;ìâªï¸Èalrv᮵ᮿá¯á¯£rrÄ;mᮼᮽæ·;椼yÆevwá¯á¯á¯qɰá¯\0\0á¯reãá³uãáµee;æedge;æenè»Â¤ä¤earrowÄlrᯮ᯳eft»á®ight»ᮽeäá¯Äciá°á°oninôǷnt;æ±lcty;æà¦AHabcdefhijlorstuwz᰸᰻᰿á±á±©á±µá²á²á²¬á²·á³»á³¿á´áµ»á¶á¶«á¶»á·á·ròÎar;楥Èglrsá±á±á±á±ger;æ eth;æ¸Ã²á³hÄ;vá±á±æÂ»à¤Å«á±¡á±§arow;æ¤aãÌÄayᱮᱳron;ä;ä´Æ;ao̲ᱼá²ÄgrÊ¿á²r;ætseq;æ©·Æglmá²á²á²è»Â°ä°ta;ä´ptyv;榱ÄirᲣᲨsht;楿;ìð¡arÄlrᲳᲵ»à£Â»áÊaegsvá³Í¸á³á³á³ mÆ;oșá³á³ndÄ;șá³uit;æ¦amma;äin;æ²Æ;io᳧᳨᳸ä·deè÷;oá³§á³°ntimes;ænø᳷cy;äcɯá´\0\0á´rn;æop;æÊlptuwá´á´á´¢áµáµlar;ä¤f;ìðÊ;empsÌá´á´·á´½áµqÄ;dÍá´³ot;æinus;æ¸lus;æquare;æ¡blebarwedgåúnÆadhá®áµáµ§ownarrowóá²arpoonÄlrᵲᵶefôᲴighôᲶŢᵿᶠkaro÷à½É¯á¶\0\0á¶rn;æop;æÆcotá¶á¶£á¶¦Äryá¶á¶¡;ìð¹;äl;æ§¶rok;äÄdrá¶°á¶´ot;æ±iÄ;fá¶ºá æ¿Äahá·á·ròЩaòྦangle;榦Äciá·á·y;ägrarr;æ¿à¤Dacdefglmnopqrstuxá¸á¸á¸á¸¸Õ¸á¸¼á¹á¹¡á¹¾áº¥áº¯áº½á»¡á¼ªá¼·á½á½á½ÄDoá¸á´´oôá²Äcsá¸á¸uteè»Ã©ä©ter;æ©®ÈaioyḢḧḱḶron;ärÄ;cá¸á¸®æè»Ãªäªlon;æ;äot;äÄDrá¹á¹ ot;æ;ìð¢Æ;rsá¹á¹á¹æªaveè»Ã¨ä¨Ä;dá¹á¹æªot;æªÈ;ilsṪṫṲṴæªnters;æ§;æÄ;dṹṺæªot;æªÆapsẠáºáºcr;ätyÆ;sváºáºáºæ et»áºpÄ1;áºáº¤Ä³áº¡áº£;æ;æ æÄgsẪẬ;ä p;æÄgpẴẸon;äf;ìðÆalsá»á»á»rÄ;sá»á»æl;æ§£us;橱iÆ;lvá»á»á»äµon»á»;äµÈcsuvỪỳá¼á¼£Äioữḱrc»Ḯɩỹ\0\0á»»ÃÕantÄglá¼á¼tr»á¹ess»ṺÆaeiá¼á¼á¼ls;ä½st;ævÄ;DȵἠD;橸parsl;æ§¥ÄDaἯἳot;ærr;楱Æcdiá¼¾á½á»¸r;æ¯oôÍÄahá½á½;ä·è»Ã°ä°Ämrá½á½lè»Ã«ä«o;æ¬Æcipὡὤὧl;ä¡sôծÄeoὬὴctatioîÕnentialåչৡá¾\0á¾\0ᾡᾧ\0\0á¿á¿\0á¿\0ῦῪâ\0ââllingdotseñá¹y;ämale;æÆilrá¾á¾³á¿lig;èï¬É©á¾¹\0\0á¾½g;èï¬ig;èï¬;ìð£lig;èï¬lig;ìfjÆaltá¿á¿á¿¡t;æig;èï¬ns;æ±of;äǰ΅\0ῳf;ìðÄakÖ¿á¿·Ä;vῼ´æ;æ«artint;æ¨ÄaoââÄcsââαââ°â¸â â\0âβâ¢â¥â§âªâ¬\0â®è»Â½ä½;æ è»Â¼ä¼;æ ;æ ;æ Æ³â´\0â¶;æ ;æ Ê´â¾â\0\0âè»Â¾ä¾;æ ;æ 5;æ Æ¶â\0â;æ ;æ 8;æ l;æwn;æ¢cr;ìð»à¢Eabcdefgijlnorstvââââ¥â°â´â°âµâºâ¿âââ¸Ìâ¾â âÄ;lÙâ;æªÆcmpâââute;äµmaÄ;dâá³ä³;æªreve;äÄiyâªâ®rc;ä;ä³ot;ä¡È;lqsؾÙâ½âÆ;qsؾÙâlanô٥È;cdlÙ¥âââ¥c;檩otÄ;oââæªÄ;lâ¢â£æª;æªÄ;eâªâìâï¸s;æªr;ìð¤Ä;gÙ³Ømel;æ·cy;äÈ;EajÙâââ;æª;檥;檤ÈEaesâââ©â´;æ©pÄ;pâ£â¤æªrox»â¤Ä;qâ®â¯æªÄ;qâ®âim;æ§pf;ìðÄciâ â r;æmÆ;elÙ«â â ;æª;æªè>;cdlqr×®â ⠪⠮⠳⠹Äci⠥⠧;檧r;橺ot;æPar;æ¦uest;橼Êadelsââ ªâÙâǰâ\0âproøâr;楸qÄlqØ¿âlesóâiÃÙ«Äenâ£ârtneqq;ìâ©ï¸Ã âªÔAabcefkosyâââ±âµâºâââ¯â¨â½ròΠÈilmrâââârsðáf»â¤ilôکÄdrâ â¤cy;äÆ;cwࣴâ«â¯ir;æ¥;æar;æirc;䥯alrââârtsÄ;uââæ¥it»âlip;æ¦con;æ¹r;ìð¥sÄewâ£â©arow;椥arow;椦Êamoprâºâ¾âââ£rr;æ¿tht;æ»kÄlrââeftarrow;æ©ightarrow;æªf;ìðbar;æÆcltâ¯â´â¸r;ìð½asèâ´rok;ä§Äbpââull;æhen»á±à«¡â£\0âª\0â¸â â\0ââ³\0\0â¸â¢â§â¢â¿\0ââªâ´cuteè»ÃäÆ;iyݱâ°âµrcè»Ã®ä®;ä¸Äcxâ¼â¿y;äµclè»Â¡ä¡ÄfrÎâ;ìð¦raveè»Ã¬ä¬È;inoܾââ©â®Äinâ¢â¦nt;æ¨t;æfin;æ§ta;æ©lig;䳯aopâ¾ââÆcgtâ ââr;䫯elpÜââinÃ¥ÞarÃ´Ü h;ä±f;æ·ed;äµÊ;cfotÓ´â¬â±â½âare;æ inÄ;tâ¸â¹æie;æ§doôâÊ;celpÝââââ¡al;æºÄgrââeróá£Ã£âarhk;æ¨rod;樼Ècgptâ¯â²â¶â»y;äon;ä¯f;ìða;ä¹uestè»Â¿ä¿Äciââr;ìð¾nÊ;EdsvÓ´âââ¡Ó³;æ¹ot;æµÄ;vâ¦â§æ´;æ³Ä;iÝ·â®lde;ä©Ç«â¸\0â¼cy;älè»Ã¯ä¯Ìcfmosuââââ¡â§âµÄiyâârc;äµ;ä¹r;ìð§ath;ä·pf;ìðÇ£â¬\0â±r;ìð¿rcy;äkcy;äÐacfghjosâââ¢â§ââ±âµâ»ppaÄ;vââäº;ä°Äeyââ dil;ä·;äºr;ìð¨reen;ä¸cy;ä cy;äpf;ìðcr;ìðà®ABEHabcdefghjlmnoprstuvâ°ââââââ½âââââ¥â¹â½ââ²âââ¨âââ â Æartâ·âºâ¼ròà§Ã²Îail;æ¤arr;æ¤Ä;gà¦â;æªar;楢ॣâ¥\0âª\0â±\0\0\0\0\0âµâº\0âââ\0â¹ute;äºmptyv;榴raîà¡bda;ä»gÆ;dlà¢ââ;æ¦Ã¥à¢;æª uoè»Â«ä«rÐ;bfhlpstà¢ââ¦â©â«â®â±âµÄ;fà¢â£s;æ¤s;æ¤Ã«âp;æ«l;椹im;楳l;æ¢Æ;aeâ¿ââæª«il;æ¤Ä;sââæª;ìâªï¸Æabrââârr;æ¤rk;æ²Äakâ¢â¬cÄekâ¨âª;ä»;äÄesâ±â³;æ¦lÄduâ¹â»;æ¦;æ¦Èaeuyââââron;ä¾Ädiââil;ä¼Ã¬à¢°Ã¢â©;
vendor: 10,520 bytes, line 504
504ä»Ècqrsâ£â¦ââ½a;椶uoÄ;rà¸áÄduâ²â·har;楧shar;æ¥h;æ²Ê;fgqsââà¦â³â¿æ¤tÊahlrtââ¤â·ââ¨rrowÄ;tà¢â¡aéâ¶arpoonÄduâ¯â´own»Ñp»०eftarrows;æightÆahsââârrowÄ;sࣴࢧarpoonóà¾quigarro÷â°hreetimes;æÆ;qsâà¦âºlanôবÊ;cdgsবââââ¨c;檨otÄ;oââæ©¿Ä;rââæª;æªÄ;eâ¢â¥ìâï¸s;æªÊadegsâ³â¹â½ââpproøâot;æqÄgqââ
ôà¦gtòâôà¦iÃলÆilrâ࣡âsht;楼;ìð©Ä;Eà¦â£;æªÅ¡â©â¶rÄduâ²â®Ä;l॥â³;楪lk;æcy;äÊ;achtà©ââââròâorneòá´ard;楫ri;æºÄioââ¤dot;ä
ustÄ;aâ¬âæ°che»âÈEaesâ»â½ââ;æ¨pÄ;pââæªrox»âÄ;qââæªÄ;qââ»im;æ¦Ðabnoptwzâ©â´â·ââ¯âââÄnrâ®â±g;æ¬r;æ½rëà£gÆlmrâ¿ââeftÄar০âightá৲apsto;æ¼ightá৽parrowÄlrâ¥â©efôâight;æ¬Æaflâ¶â¹â½r;æ¦
;ìðus;æ¨imes;樴šââst;æÃ¡áÆ;efââá ænge»âarÄ;lâ¤â¥ä¨t;æ¦Êachmtâ³â¶â¼â
âròࢨorneòá¶arÄ;dà¾â;æ¥;æri;æ¿Ìachiqtââà©â¢â®â»quo;æ¹r;ìðmÆ;egলâªâ¬;æª;æªÄbuâªâ³oÄ;rà¸â¹;ærok;ä
è<;cdhilqrà «ââ¹ââ â¥âªâ°Äciââ;檦r;橹reÃ¥â²mes;æarr;楶uest;æ©»ÄPiâµâ¹ar;æ¦Æ;efâ à¤á ærÄduâ â shar;æ¥har;楦Äenâ â ¡rtneqq;ìâ¨ï¸Ã
â ÜDacdefhilnopsuâ¡â¡
â¢â¢â¢â¢ ⢥⢨â£â£¢â£¤àªâ£³â¤Dot;æºÈclprâ¡â¡â¡£â¡½rè»Â¯ä¯Äetâ¡â¡;æÄ;eâ¡â¡æ se»â¡Ä;sá»â¡¨toÈ;dluá»â¡³â¡·â¡»owîÒefôà¤Ã°áker;æ®Äoyâ¢â¢mma;権;ä¼ash;æasuredangle»á¦r;ìðªo;æ§Æcdn⢯⢴â£roè»ÂµäµÈ;acdá¤â¢½â£â£sôá§ir;æ«°otè»Â·ÆµusÆ;bdâ£á¤â£æÄ;uá´¼â£;横ţâ£â£¡p;æ«Ã²âðàªÄdp⣩⣮els;æ§f;ìðÄct⣸⣽r;ìðpos»áÆ;lmâ¤â¤â¤ä¼timap;æ¸à°GLRVabcdefghijlmoprstuvwâ¥â¥â¥¾â¦â¦â§â§©â¨â¨â©â©âªâªâª¤âª¨â¬â¬ââ¿â®®â°´â±§â±¼â³©Ägtâ¥â¥;ìâ̸Ä;vâ¥à¯ìâ«âÆeltâ¥â¥²â¥¶ftÄar⥡⥧rrow;æightarrow;æ;ìâ̸Ä;v⥻à±ìâªâightarrow;æÄDdâ¦â¦ash;æ¯ash;æ®Êbcnpt⦣⦧⦬⦱â§la»Ëute;ä
g;ìâ âÊ;Eiopà¶â¦¼â§â§
â§;ì⩰̸d;ìâ̸s;ä
roøà¶urÄ;aâ§â§æ®lÄ;sâ§à¬¸Ç³â§\0â§£pè»Â ଷmpÄ;e௹à°Êaeouyâ§´â§¾â¨â¨â¨Ç°â§¹\0â§»;æ©on;ä
dil;ä
ngÄ;dൾâ¨ot;ìâ©Ì¸p;æ©;ä½ash;æÎ;Aadqsxà®â¨©â¨â¨»â©â©
â©rr;ærÄhr⨳⨶k;椤Ä;oá²á°ot;ìâ̸uiöà£Äeiâ©â©ar;椨Ãà®istÄ;sà® à®r;ìð«ÈEestà¯
⩦⩹⩼Æ;qs஼â©à¯¡Æ;qs஼à¯
â©´lanô௢iÃ௪Ä;rà®¶âªÂ»à®·ÆAapâªâªâªrò⥱rr;æ®ar;櫲Æ;svà¾âªà¾Ä;d⪡⪢æ¼;æºcy;äÎAEadest⪷⪺⪾â«â«
⫶⫹rò⥦;ìâ¦Ì¸rr;ær;æ¥È;fqsà°»â«â«£â«¯tÄarâ«â«rro÷â«ightarroÃ·âªÆ;qs఻⪺⫪lanôà±Ä;sà±â«´Â»à°¶iÃà±Ä;rవ⫾iÄ;eà°à°¥iäà¶Äptâ¬â¬f;ìðè¬;inâ¬â¬â¬¶ä¬nÈ;Edvà®â¬¤â¬¨â¬®;ìâ¹Ì¸ot;ìâµÌ¸Ç¡à®â¬³â¬µ;æ·;æ¶iÄ;vಸ⬼ǡಸââ;æ¾;æ½Æaorââ£â©rÈ;astà»âââlleìà»l;ì⫽â¥;ìâ̸lint;æ¨Æ;ceà²â°â³uåಥÄ;cà²â¸Ä;eà²â½Ã±à²ÈAaitâ®â®â®â®§ròâ¦rrÆ;cwâ®â®â®æ;ì⤳̸;ìâ̸ghtarrow»â®riÄ;eà³à³Îchimpqu⮽â¯â¯â¬à¸â¯¤â¯¯È;cerà´²â¯à´·â¯uÃ¥àµ
;ìðortÉâ¬
\0\0â¯aráâmÄ;e൮â¯Ä;q൴൳suÄbp⯫â¯Ã¥à³¸Ã¥à´Æbcp⯶â°â°È;Ees⯿â°à´¢â°æ;ìâ«
̸etÄ;eà´â°qÄ;qà´£â°cÄ;eà´²â°Ã±à´¸È;EesⰢⰣàµâ°§æ
;ìâ«Ì¸etÄ;eàµâ°®qÄ;qൠⰣÈgilrⰽⰿâ±
â±Ã¬à¯ldeè»Ã±ä±Ã§à±iangleÄlrâ±â±eftÄ;eà°â±Ã±à°¦ightÄ;eà³â±¥Ã±à³Ä;mⱬâ±ä½Æ;esⱴⱵⱹä£ro;æp;æÒDHadgilrsâ²â²â²â²â²£â²°â²¶â³â³£ash;æarr;æ¤p;ìââash;æ¬ÄetⲨⲬ;ìâ¥â;ì>ânfin;æ§ÆAetâ²½â³â³
rr;æ¤;ìâ¤âÄ;râ³â³ì<âie;ìâ´âÄAtâ³â³rr;æ¤rie;ìâµâim;ìâ¼âÆAanâ³°â³´â´rr;ærÄhr⳺⳽k;椣Ä;oá§á¥ear;椧ááª\0\0\0\0\0\0\0\0\0\0\0\0\0â´\0â´¸âµâµ ⵥ⵲â¶á¬\0\0â¶â¶«\0â·â·\0â·â¸â¸«â¸¾â¹Äcsâ´±áªuteè»Ã³ä³Äiyâ´¼âµ
rÄ;cáªâµè»Ã´ä´;ä¾Êabios᪠âµâµÇâµlac;ä
v;樸old;榼lig;ä
Äcr⵩âµir;榿;ìð¬Í¯âµ¹\0\0âµ¼\0â¶n;äaveè»Ã²ä²;æ§Äbmâ¶à·´ar;榵Èacitâ¶â¶â¶¥â¶¨ròáªÄirâ¶â¶ r;榾oss;榻nÃ¥à¹;æ§Æaeiⶱⶵⶹcr;ä
ga;äÆcdnâ·â·
Çron;ä¿;榶pf;ìð Æaelâ·â·Çr;榷rp;榹Î;adiosvⷪⷫⷮâ¸â¸â¸â¸æ¨ròáªÈ;efmâ··â·¸â¸â¸
æ©rÄ;oⷾⷿæ´f»ⷿè»Âªäªè»Âºäºgof;æ¶r;æ©lope;æ©;æ©Æcloâ¸â¸¡â¸§Ã²â¸ashè»Ã¸ä¸l;æiŬⸯ⸴deè»ÃµäµesÄ;aÇ⸺s;樶mlè»Ã¶ä¶bar;æ½à«¡â¹\0â¹½\0âºâº\0⺢⺹\0\0â»àº\0â¼\0\0⼫⾼\0â¿rÈ;astÐâ¹§â¹²àº
è¶;lâ¹â¹®ä¶leìÐɩ⹸\0\0â¹»m;櫳;櫽y;ä¿rÊcimptâºâºâºá¡¥âºnt;ä¥od;ä®il;æ°enk;æ±r;ìðÆimo⺨⺰⺴Ä;vâºâº®ä;ämaô੶ne;æÆ;tv⺿â»â»ächfork»´;äÄauâ»â»nÄckâ»â»kÄ;hâ´â»;æÃ¶â´sÒ;abcdemst⻳⻴á¤â»¹â»½â¼â¼â¼â¼ä«cir;樣ir;樢Äouáµâ¼;樥;橲nè»Â±àºim;樦wo;樧Æipuâ¼â¼ â¼¥ntint;æ¨f;ìð¡ndè»Â£ä£Ô;Eaceinosuà»â¼¿â½â½â½â¾â¾â¾â½¾â¾¶;檳p;檷uÃ¥à»Ä;cà»â½Ì;acensà»â½â½â½¦â½¨â½¾pproøâ½urlyeñà»Ã±à»Æaes⽯⽶⽺pprox;檹qq;檵im;æ¨iÃà»meÄ;sâ¾àº®æ²ÆEas⽸â¾â½ºÃ°â½µÆdfp໬â¾â¾¯Æals⾠⾥⾪lar;æ®ine;æurf;æÄ;t໻⾴ï໻rel;æ°Äciâ¿â¿
r;ìð
;äncsp;æÌfiopsuâ¿â¢â¿â¿¥â¿«â¿±r;ìð®pf;ìð¢rime;æcr;ìðÆaeo⿸ããtÄei⿾ã
rnionóڰnt;æ¨stÄ;eããä¿Ã±á¼Ã´à¼àªABHabcdefhilmnoprstuxããããã ãã«ã
ã
¢ã
²ãããã¤ã©ãã®ã²ãã°ã·Æartãããròá³Ã²Ïail;æ¤aròᱥar;楤Îcdenqrtã¨ãµã¸ã¿ãããÄeuãã±;ìâ½Ì±te;ä
iãá
®mptyv;榳gÈ;delà¿ããã;æ¦;榥åà¿uoè»Â»ä»rÖ;abcfhlpstwà¿ã¬ã¯ã·ã¹ã¼ã¾ããããp;極Ä;fà¿ ã´s;æ¤ ;椳s;æ¤Ã«âðâ®l;æ¥
im;楴l;æ£;æÄaiããil;æ¤oÄ;nããæ¶alÃ³à¼Æabrã§ãªã®ròá¥rk;æ³Äakã³ã½cÄekã¹ã»;ä½;äÄesãã;æ¦lÄduãã;æ¦;æ¦Èaeuyããã§ã©ron;ä
Ädiã¡ã¥il;ä
ì࿲âãº;äÈclqsã´ã·ã½ã
a;椷dhar;楩uoÄ;rÈÈh;æ³Æacgã
ã
à½lÈ;ipsླྀã
ã
ánÃ¥á»arôྩt;æÆilrã
©á£ã
®sht;楽;ìð¯Äaoã
·ãrÄduã
½ã
¿Â»Ñ»Ä;láã;楬Ä;vããä;䱯gnsãã¹ã¼htÌahlrstã¤ã°ããã¤ã®rrowÄ;tà¿ãaéãarpoonÄduã»ã¿owîã
¾p»áeftÄahããrrowó࿪arpoonóÕightarrows;æquigarro÷ãhreetimes;æg;äingdotseñἲÆahmãããrò࿪aòÕ;æoustÄ;aããæ±che»ãmid;æ«®Èabptã²ã½ããÄnrã·ãºg;ær;æ¾rëáÆaflãããr;æ¦;ìð£us;樮imes;樵Äapãã§rÄ;gã£ã¤ä©t;æ¦olint;æ¨aròã£Èachqã»ãá¼ã
quo;æºr;ìðÄbuã»ãoÄ;rÈÈÆhirããã reÃ¥ã¸mes;æiÈ;eflãªáá ¡ã«æ¹tri;æ§luhar;楨;æàµ¡ãããã¬ã¸ã±\0ãºã¤\0\0ã¬ã°\0ã¨ãããã±ãã±\0ã\0\0ã³cute;ä
quïâºÔ;Eaceinpsyáã³ãµã¿ããããã¦ã©;檴ǰãº\0ã¼;檸on;ä
¡uÃ¥á¾Ä;dá³ãil;ä
rc;ä
ÆEasããã;檶p;檺im;æ©olint;æ¨iÃá;äotÆ;beã´áµãµæ
;橦ÎAacmstxãããããã£ãrr;ærÄhrããëâ¨Ä;oਸ਼਴tè»Â§ä§i;ä»war;椩mÄinã©Ã°nuóñt;æ¶rÄ;oã¶âìð°Èacoyãããã rp;æ¯Ähyããcy;ä;ärtÉã\0\0ãiäá¤araì⹯è»ÂäÄgmã¨ã´maÆ;fvã±ã²ã²ä;äÐ;deglnprá«ã
ããããã¡ã¦ot;橪Ä;qá±á°Ä;Eããæª;æª Ä;Eããæª;æªe;ælus;樤arr;楲aròá½Èaeitã¸ãããÄlsã½ãlsetméãªhp;樳parsl;槤Ädlá£ãe;æ£Ä;eããæªªÄ;sã¢ã£æª¬;ìâª¬ï¸Æflpã®ã³ãtcy;äÄ;bã¸ã¹ä¯Ä;aã¾ã¿æ§r;æ¿f;ìð¤aÄdrãÐesÄ;uããæ it»ãÆcsuã ã¹ãÄauã¥ã¯pÄ;sáã«;ìâï¸pÄ;sá´ãµ;ìâï¸uÄbpã¿ãÆ;esááãetÄ;eáãñáÆ;esá¨áãetÄ;eá¨ãÃ±á®Æ;afá
»ã¦Ö°rÅ¥ã«Ö±Â»á
¼aròá
Ècemtã¹ã¾ãã
r;ìðtmîñiìãaræá¾ÄarããrÄ;fãá¿æÄanããightÄepã£ãªpsiloîỠhé⺯s»â¡Êbcmnpã»ãáããÒ;Edemnprsãããããã£ã¬ã±ã¶æ;æ«
ot;檽Ä;dáãot;æ«ult;æ«ÄEeã¨ãª;æ«;ælus;檿arr;楹Æeiuã½ããtÆ;enãã
ãqÄ;qáãeqÄ;qã«ã¨m;æ«Äbpãã;æ«;æ«cÌ;acensáã¬ã²ã¹ã»ã¦pproøãºurlyeñá¾Ã±á³Æaesãããpproøãqñãg;æªÚ123;Edehlmnpsã©ã¬ã¯áã²ã´ãããããã¨ãè»Â¹ä¹è»Â²ä²è»Â³ä³;æ«Äosã¹ã¼t;檾ub;æ«Ä;dá¢ã
ot;æ«sÄouããl;æb;æ«arr;楻ult;æ«ÄEeã¤ã¦;æ«;ælus;æ«Æeiuã´ããtÆ;enáã¼ãqÄ;qá¢ã²eqÄ;qã§ã¤m;æ«Äbpãã;æ«;æ«ÆAanãã ãrr;ærÄhrã¦ã¨Ã«â®Ä;oਫ਩war;椪ligè»Ãä௡ããã áã³ã¹\0ã¾ã\0\0\0\0\0ãã\0ãã¬\0\0\0ãɲã\0\0ãget;æ;ärÃ«à¹Æaeyã¦ã«ã°ron;ä
¥dil;ä
£;älrec;ær;ìð±Èeikoãããµã¼Ç²ã\0ãeÄ4fááaÆ;svãããä¸ym;äÄcnã¢ã²kÄasã¨ã®pproøáim»á¬sðáÄasãºã®Ã°árnè»Ã¾ä¾Ç¬Ìãâ§esèÃ;bdãããäÄ;aá¤ãr;樱;樰Æepsã¡ã£ãáâ©È;bcfÒã¬ã°ã´ot;æ¶ir;櫱Ä;oã¹ã¼ìð¥rk;æ«Ã¡ã¢rime;æ´Æaipããã¤dÃ¥áÎadempstã¡ããããããngleÊ;dlqrã°ã±ã¶ããæµown»ᶻeftÄ;eâ ã¾Ã±à¤®;æightÄ;eãªãñáot;æ¬inus;樺lus;樹b;æ§ime;樻ezium;æ¢Æchtã²ã½ãÄryã·ã»;ìð;äcy;ärok;ä
§Äioããxôá·headÄlrãã eftarro÷à¡ightarrow»à½à¤AHabcdfghlmoprstuwãããã¤ã°ã¼ã ã 㠣㠴ã¡ã¡ã¡«ã¢©ã£ã£ã£ªã£¶ròÏar;楣Äcrãã¢uteè»ÃºäºÃ²á
rÇ£ãª\0ãy;äve;ä
Äiyãµãºrcè»Ã»ä»;äÆabhã ã ã ròálac;ä
±aòáÄirã ã sht;楾;ìð²raveè»Ã¹ä¹Å¡ã §ã ±rÄlr㠬㠮»à¥Â»álk;æÄctã ¹ã¡É¯ã ¿\0\0ã¡rnÄ;eã¡
ã¡ær»ã¡op;æri;æ¸Äalã¡ã¡cr;ä
«è»Â¨ÍÄgp㡢㡦on;ä
³f;ìð¦Ìadhlsuá
㡸㡽á²ã¢ã¢ ownáá³arpoonÄlrã¢ã¢efôã ighô㠯iÆ;hlã¢ã¢ã¢ä
»áºon»ã¢parrows;æÆcit㢰ã£ã£É¯ã¢¶\0\0ã£rnÄ;e㢼㢽ær»㢽op;æng;ä
¯ri;æ¹cr;ìðÆdirã£ã£ã£¢ot;æ°lde;ä
©iÄ;fã°ã£¨Â»á Äam㣯㣲rò㢨lè»Ã¼ä¼angle;榧ÞABDacdeflnoprszã¤ã¤ã¤©ã¤ã¦µã¦¸ã¦½ã§ã§¤ã§¨ã§³ã§¹ã§½ã¨ã¨ ròϷarÄ;v㤦㤧櫨;æ«©asèϡÄnr㤲㤷grt;æ¦Îeknprstã£ã¥ã¥ã¥ã¥ã¥¤ã¦appáâothinÃ§áºÆhirã«â»ã¥opô⾵Ä;há·ã¥¢Ã¯ãÄiu㥩ã¥gmáã³Äbp㥲ã¦setneqÄ;q㥽ã¦ìâï¸;ìâ«ï¸setneqÄ;qã¦ã¦ìâï¸;ìâ«ï¸Ährã¦ã¦etáãiangleÄlr㦪㦯eft»थight»áy;ä²ashÂ»á¶Æelrã§ã§ã§Æ;beâ·ªã§ã§ar;æ»q;ælip;æ®Äbtã§á¨aòá©r;ìð³tré㦮suÄbp㧯㧱»à´Â»àµpf;ìð§roð໻tré㦴Äcuã¨ã¨r;ìðÄbpã¨ã¨nÄEeã¦ã¨Â»ã¥¾nÄEeã¦ã¨Â»ã¦igzag;æ¦Îcefoprs㨶㨻ã©ã©ã©ã©¡ã©ªirc;ä
µÄdiã©ã©Äbgã©
ã©ar;æ©eÄ;qáºã©;æerp;ær;ìð´pf;ìð¨Ä;eá¹ã©¦atèá¹cr;ìðà«£áãª\0ãª\0ãªãª\0\0ãªãª¨ãª«ãª¯\0\0ã«ã«\0ã«áátréár;ìðµÄAaãªãªròÏrò৶;ä¾ÄAa㪡㪤ròθrò৫aðâis;æ»Ædptá¤ãªµãª¾Äfl㪺á©;ìð©imÃ¥á²ÄAaã«ã«ròÏròà¨Äcqã«á¸r;ìðÄptáã«réáÐacefiosu㫰㫽ã¬ã¬ã¬ã¬ã¬ã¬¡cÄuyã«¶ã«»teè»Ã½ä½;äÄiyã¬ã¬rc;ä
·;änè»Â¥ä¥r;ìð¶cy;äpf;ìðªcr;ìðÄcm㬦㬩y;älè»Ã¿ä¿Ôacdefhioswããããã¤ã©ãã´ãºã®cute;ä
ºÄayããron;ä
¾;ä·ot;ä
¼Äetãã¡træáa;ä¶r;ìð·cy;ä¶grarr;æpf;ìð«cr;ìðÄjnã®
ã®;æj;æ'.split("").map(
504(e) => e.charCodeAt(0)) 505), _u = /* @__PURE__ */ new Map([ 506 [0, 65533], 507 // C1 Unicode control character reference replacements 508 [128, 8364], 509 [130, 8218], 510 [131, 402], 511 [132, 8222], 512 [133, 8230], 513 [134, 8224], 514 [135, 8225], 515 [136, 710], 516 [137, 8240], 517 [138, 352], 518 [139, 8249], 519 [140, 338], 520 [142, 381], 521 [145, 8216], 522 [146, 8217], 523 [147, 8220], 524 [148, 8221], 525 [149, 8226], 526 [150, 8211], 527 [151, 8212], 528 [152, 732], 529 [153, 8482], 530 [154, 353], 531 [155, 8250], 532 [156, 339], 533 [158, 382], 534 [159, 376] 535]); 536function Au(e) { 537 var t; 538 return e >= 55296 && e <= 57343 || e > 1114111 ? 65533 : (t = _u.get(e)) !== null && t !== void 0 ? t : e; 539} 540var S; 541(function(e) { 542 e[e.NUM = 35] = "NUM", e[e.SEMI = 59] = "SEMI", e[e.EQUALS = 61] = "EQUALS", e[e.ZERO = 48] = "ZERO", e[e.NINE = 57] = "NINE", e[e.LOWER_A = 97] = "LOWER_A", e[e.LOWER_F = 102] = "LOWER_F", e[e.LOWER_X = 120] = "LOWER_X", e[e.LOWER_Z = 122] = "LOWER_Z", e[e.UPPER_A = 65] = "UPPER_A", e[e.UPPER_F = 70] = "UPPER_F", e[e.UPPER_Z = 90] = "UPPER_Z"; 543})(S || (S = {})); 544const pu = 32; 545var v; 546(function(e) { 547 e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE"; 548})(v || (v = {})); 549function Le(e) { 550 return e >= S.ZERO && e <= S.NINE; 551} 552function Iu(e) { 553 return e >= S.UPPER_A && e <= S.UPPER_F || e >= S.LOWER_A && e <= S.LOWER_F; 554} 555function Nu(e) { 556 return e >= S.UPPER_A && e <= S.UPPER_Z || e >= S.LOWER_A && e <= S.LOWER_Z || Le(e); 557} 558function Cu(e) { 559 return e === S.EQUALS || Nu(e); 560} 561var g; 562(function(e) { 563 e[e.EntityStart = 0] = "EntityStart", e[e.NumericStart = 1] = "NumericStart", e[e.NumericDecimal = 2] = "NumericDecimal", e[e.NumericHex = 3] = "NumericHex", e[e.NamedEntity = 4] = "NamedEntity"; 564})(g || (g = {})); 565var F; 566(function(e) { 567 e[e.Legacy = 0] = "Legacy", e[e.Strict = 1] = "Strict", e[e.Attribute = 2] = "Attribute"; 568})(F || (F = {})); 569class gu { 570 constructor(t, u, s) { 571 this.decodeTree = t, this.emitCodePoint = u, this.errors = s, this.state = g.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = F.Strict; 572 } 573 /** Resets the instance to make it reusable. */ 574 startEntity(t) { 575 this.decodeMode = t, this.state = g.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1; 576 } 577 /** 578 * Write an entity to the decoder. This can be called multiple times with partial entities. 579 * If the entity is incomplete, the decoder will return -1. 580 * 581 * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the 582 * entity is incomplete, and resume when the next string is written. 583 * 584 * @param input The string containing the entity (or a continuation of the entity). 585 * @param offset The offset at which the entity begins. Should be 0 if this is not the first call. 586 * @returns The number of characters that were consumed, or -1 if the entity is incomplete. 587 */ 588 write(t, u) { 589 switch (this.state) { 590 case g.EntityStart: 591 return t.charCodeAt(u) === S.NUM ? (this.state = g.NumericStart, this.consumed += 1, this.stateNumericStart(t, u + 1)) : (this.state = g.NamedEntity, this.stateNamedEntity(t, u)); 592 case g.NumericStart: 593 return this.stateNumericStart(t, u); 594 case g.NumericDecimal: 595 return this.stateNumericDecimal(t, u); 596 case g.NumericHex: 597 return this.stateNumericHex(t, u); 598 case g.NamedEntity: 599 return this.stateNamedEntity(t, u); 600 } 601 } 602 /** 603 * Switches between the numeric decimal and hexadecimal states. 604 * 605 * Equivalent to the `Numeric character reference state` in the HTML spec. 606 * 607 * @param input The string containing the entity (or a continuation of the entity). 608 * @param offset The current offset. 609 * @returns The number of characters that were consumed, or -1 if the entity is incomplete. 610 */ 611 stateNumericStart(t, u) { 612 return u >= t.length ? -1 : (t.charCodeAt(u) | pu) === S.LOWER_X ? (this.state = g.NumericHex, this.consumed += 1, this.stateNumericHex(t, u + 1)) : (this.state = g.NumericDecimal, this.stateNumericDecimal(t, u)); 613 } 614 addToNumericResult(t, u, s, n) { 615 if (u !== s) { 616 const o = s - u; 617 this.result = this.result * Math.pow(n, o) + Number.parseInt(t.substr(u, o), n), this.consumed += o; 618 } 619 } 620 /** 621 * Parses a hexadecimal numeric entity. 622 * 623 * Equivalent to the `Hexademical character reference state` in the HTML spec. 624 * 625 * @param input The string containing the entity (or a continuation of the entity). 626 * @param offset The current offset. 627 * @returns The number of characters that were consumed, or -1 if the entity is incomplete. 628 */ 629 stateNumericHex(t, u) { 630 const s = u; 631 for (; u < t.length; ) { 632 const n = t.charCodeAt(u); 633 if (Le(n) || Iu(n)) 634 u += 1; 635 else 636 return this.addToNumericResult(t, s, u, 16), this.emitNumericEntity(n, 3); 637 } 638 return this.addToNumericResult(t, s, u, 16), -1; 639 } 640 /** 641 * Parses a decimal numeric entity. 642 * 643 * Equivalent to the `Decimal character reference state` in the HTML spec. 644 * 645 * @param input The string containing the entity (or a continuation of the entity). 646 * @param offset The current offset. 647 * @returns The number of characters that were consumed, or -1 if the entity is incomplete. 648 */ 649 stateNumericDecimal(t, u) { 650 const s = u; 651 for (; u < t.length; ) { 652 const n = t.charCodeAt(u); 653 if (Le(n)) 654 u += 1; 655 else 656 return this.addToNumericResult(t, s, u, 10), this.emitNumericEntity(n, 2); 657 } 658 return this.addToNumericResult(t, s, u, 10), -1; 659 } 660 /** 661 * Validate and emit a numeric entity. 662 * 663 * Implements the logic from the `Hexademical character reference start 664 * state` and `Numeric character reference end state` in the HTML spec. 665 * 666 * @param lastCp The last code point of the entity. Used to see if the 667 * entity was terminated with a semicolon. 668 * @param expectedLength The minimum number of characters that should be 669 * consumed. Used to validate that at least one digit 670 * was consumed. 671 * @returns The number of characters that were consumed. 672 */ 673 emitNumericEntity(t, u) { 674 var s; 675 if (this.consumed <= u) 676 return (s = this.errors) === null || s === void 0 || s.absenceOfDigitsInNumericCharacterReference(this.consumed), 0; 677 if (t === S.SEMI) 678 this.consumed += 1; 679 else if (this.decodeMode === F.Strict) 680 return 0; 681 return this.emitCodePoint(Au(this.result), this.consumed), this.errors && (t !== S.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed; 682 } 683 /** 684 * Parses a named entity. 685 * 686 * Equivalent to the `Named character reference state` in the HTML spec. 687 * 688 * @param input The string containing the entity (or a continuation of the entity). 689 * @param offset The current offset. 690 * @returns The number of characters that were consumed, or -1 if the entity is incomplete. 691 */ 692 stateNamedEntity(t, u) { 693 const { decodeTree: s } = this; 694 let n = s[this.treeIndex], o = (n & v.VALUE_LENGTH) >> 14; 695 for (; u < t.length; u++, this.excess++) { 696 const E = t.charCodeAt(u); 697 if (this.treeIndex = Su(s, n, this.treeIndex + Math.max(1, o), E), this.treeIndex < 0) 698 return this.result === 0 || // If we are parsing an attribute 699 this.decodeMode === F.Attribute && // We shouldn't have consumed any characters after the entity, 700 (o === 0 || // And there should be no invalid characters. 701 Cu(E)) ? 0 : this.emitNotTerminatedNamedEntity(); 702 if (n = s[this.treeIndex], o = (n & v.VALUE_LENGTH) >> 14, o !== 0) { 703 if (E === S.SEMI) 704 return this.emitNamedEntityData(this.treeIndex, o, this.consumed + this.excess); 705 this.decodeMode !== F.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0); 706 } 707 } 708 return -1; 709 } 710 /** 711 * Emit a named entity that was not terminated with a semicolon. 712 * 713 * @returns The number of characters consumed. 714 */ 715 emitNotTerminatedNamedEntity() { 716 var t; 717 const { result: u, decodeTree: s } = this, n = (s[u] & v.VALUE_LENGTH) >> 14; 718 return this.emitNamedEntityData(u, n, this.consumed), (t = this.errors) === null || t === void 0 || t.missingSemicolonAfterCharacterReference(), this.consumed; 719 } 720 /** 721 * Emit a named entity. 722 * 723 * @param result The index of the entity in the decode tree. 724 * @param valueLength The number of bytes in the entity. 725 * @param consumed The number of characters consumed. 726 * 727 * @returns The number of characters consumed. 728 */ 729 emitNamedEntityData(t, u, s) { 730 const { decodeTree: n } = this; 731 return this.emitCodePoint(u === 1 ? n[t] & ~v.VALUE_LENGTH : n[t + 1], s), u === 3 && this.emitCodePoint(n[t + 2], s), s; 732 } 733 /** 734 * Signal to the parser that the end of the input was reached. 735 * 736 * Remaining data will be emitted and relevant errors will be produced. 737 * 738 * @returns The number of characters consumed. 739 */ 740 end() { 741 var t; 742 switch (this.state) { 743 case g.NamedEntity: 744 return this.result !== 0 && (this.decodeMode !== F.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0; 745 // Otherwise, emit a numeric entity if we have one. 746 case g.NumericDecimal: 747 return this.emitNumericEntity(0, 2); 748 case g.NumericHex: 749 return this.emitNumericEntity(0, 3); 750 case g.NumericStart: 751 return (t = this.errors) === null || t === void 0 || t.absenceOfDigitsInNumericCharacterReference(this.consumed), 0; 752 case g.EntityStart: 753 return 0; 754 } 755 } 756} 757function Su(e, t, u, s) { 758 const n = (t & v.BRANCH_LENGTH) >> 7, o = t & v.JUMP_TABLE; 759 if (n === 0) 760 return o !== 0 && s === o ? u : -1; 761 if (o) {
762 const T = s - o; 763 return T < 0 || T >= n ? -1 : e[u + T] - 1; 764 } 765 let E = u, l = E + n - 1; 766 for (; E <= l; ) { 767 const T = E + l >>> 1, m = e[T]; 768 if (m < s) 769 E = T + 1; 770 else if (m > s) 771 l = T - 1; 772 else 773 return e[T + n]; 774 } 775 return -1; 776} 777var h; 778(function(e) { 779 e.HTML = "http://www.w3.org/1999/xhtml", e.MATHML = "http://www.w3.org/1998/Math/MathML", e.SVG = "http://www.w3.org/2000/svg", e.XLINK = "http://www.w3.org/1999/xlink", e.XML = "http://www.w3.org/XML/1998/namespace", e.XMLNS = "http://www.w3.org/2000/xmlns/"; 780})(h || (h = {})); 781var Q; 782(function(e) { 783 e.TYPE = "type", e.ACTION = "action", e.ENCODING = "encoding", e.PROMPT = "prompt", e.NAME = "name", e.COLOR = "color", e.FACE = "face", e.SIZE = "size"; 784})(Q || (Q = {})); 785var M; 786(function(e) { 787 e.NO_QUIRKS = "no-quirks", e.QUIRKS = "quirks", e.LIMITED_QUIRKS = "limited-quirks"; 788})(M || (M = {})); 789var d; 790(function(e) { 791 e.A = "a", e.ADDRESS = "address", e.ANNOTATION_XML = "annotation-xml", e.APPLET = "applet", e.AREA = "area", e.ARTICLE = "article", e.ASIDE = "aside", e.B = "b", e.BASE = "base", e.BASEFONT = "basefont", e.BGSOUND = "bgsound", e.BIG = "big", e.BLOCKQUOTE = "blockquote", e.BODY = "body", e.BR = "br", e.BUTTON = "button", e.CAPTION = "caption", e.CENTER = "center", e.CODE = "code", e.COL = "col", e.COLGROUP = "colgroup", e.DD = "dd", e.DESC = "desc", e.DETAILS = "details", e.DIALOG = "dialog", e.DIR = "dir", e.DIV = "div", e.DL = "dl", e.DT = "dt", e.EM = "em", e.EMBED = "embed", e.FIELDSET = "fieldset", e.FIGCAPTION = "figcaption", e.FIGURE = "figure", e.FONT = "font", e.FOOTER = "footer", e.FOREIGN_OBJECT = "foreignObject", e.FORM = "form", e.FRAME = "frame", e.FRAMESET = "frameset", e.H1 = "h1", e.H2 = "h2", e.H3 = "h3", e.H4 = "h4", e.H5 = "h5", e.H6 = "h6", e.HEAD = "head", e.HEADER = "header", e.HGROUP = "hgroup", e.HR = "hr", e.HTML = "html", e.I = "i", e.IMG = "img", e.IMAGE = "image", e.INPUT = "input", e.IFRAME = "iframe", e.KEYGEN = "keygen", e.LABEL = "label", e.LI = "li", e.LINK = "link", e.LISTING = "listing", e.MAIN = "main", e.MALIGNMARK = "malignmark", e.MARQUEE = "marquee", e.MATH = "math", e.MENU = "menu", e.META = "meta", e.MGLYPH = "mglyph", e.MI = "mi", e.MO = "mo", e.MN = "mn", e.MS = "ms", e.MTEXT = "mtext", e.NAV = "nav", e.NOBR = "nobr", e.NOFRAMES = "noframes", e.NOEMBED = "noembed", e.NOSCRIPT = "noscript", e.OBJECT = "object", e.OL = "ol", e.OPTGROUP = "optgroup", e.OPTION = "option", e.P = "p", e.PARAM = "param", e.PLAINTEXT = "plaintext", e.PRE = "pre", e.RB = "rb", e.RP = "rp", e.RT = "rt", e.RTC = "rtc", e.RUBY = "ruby", e.S = "s", e.SCRIPT = "script", e.SEARCH = "search", e.SECTION = "section", e.SELECT = "select", e.SOURCE = "source", e.SMALL = "small", e.SPAN = "span", e.STRIKE = "strike", e.STRONG = "strong", e.STYLE = "style", e.SUB = "sub", e.SUMMARY = "summary", e.SUP = "sup", e.TABLE = "table", e.TBODY = "tbody", e.TEMPLATE = "template", e.TEXTAREA = "textarea", e.TFOOT = "tfoot", e.TD = "td", e.TH = "th", e.THEAD = "thead", e.TITLE = "title", e.TR = "tr", e.TRACK = "track", e.TT = "tt", e.U = "u", e.UL = "ul", e.SVG = "svg", e.VAR = "var", e.WBR = "wbr", e.XMP = "xmp"; 792})(d || (d = {})); 793var a; 794(function(e) { 795 e[e.UNKNOWN = 0] = "UNKNOWN", e[e.A = 1] = "A", e[e.ADDRESS = 2] = "ADDRESS", e[e.ANNOTATION_XML = 3] = "ANNOTATION_XML", e[e.APPLET = 4] = "APPLET", e[e.AREA = 5] = "AREA", e[e.ARTICLE = 6] = "ARTICLE", e[e.ASIDE = 7] = "ASIDE", e[e.B = 8] = "B", e[e.BASE = 9] = "BASE", e[e.BASEFONT = 10] = "BASEFONT", e[e.BGSOUND = 11] = "BGSOUND", e[e.BIG = 12] = "BIG", e[e.BLOCKQUOTE = 13] = "BLOCKQUOTE", e[e.BODY = 14] = "BODY", e[e.BR = 15] = "BR", e[e.BUTTON = 16] = "BUTTON", e[e.CAPTION = 17] = "CAPTION", e[e.CENTER = 18] = "CENTER", e[e.CODE = 19] = "CODE", e[e.COL = 20] = "COL", e[e.COLGROUP = 21] = "COLGROUP", e[e.DD = 22] = "DD", e[e.DESC = 23] = "DESC", e[e.DETAILS = 24] = "DETAILS", e[e.DIALOG = 25] = "DIALOG", e[e.DIR = 26] = "DIR", e[e.DIV = 27] = "DIV", e[e.DL = 28] = "DL", e[e.DT = 29] = "DT", e[e.EM = 30] = "EM", e[e.EMBED = 31] = "EMBED", e[e.FIELDSET = 32] = "FIELDSET", e[e.FIGCAPTION = 33] = "FIGCAPTION", e[e.FIGURE = 34] = "FIGURE", e[e.FONT = 35] = "FONT", e[e.FOOTER = 36] = "FOOTER", e[e.FOREIGN_OBJECT = 37] = "FOREIGN_OBJECT", e[e.FORM = 38]
795= "FORM", e[e.FRAME = 39] = "FRAME", e[e.FRAMESET = 40] = "FRAMESET", e[e.H1 = 41] = "H1", e[e.H2 = 42] = "H2", e[e.H3 = 43] = "H3", e[e.H4 = 44] = "H4", e[e.H5 = 45] = "H5", e[e.H6 = 46] = "H6", e[e.HEAD = 47] = "HEAD", e[e.HEADER = 48] = "HEADER", e[e.HGROUP = 49] = "HGROUP", e[e.HR = 50] = "HR", e[e.HTML = 51] = "HTML", e[e.I = 52] = "I", e[e.IMG = 53] = "IMG", e[e.IMAGE = 54] = "IMAGE", e[e.INPUT = 55] = "INPUT", e[e.IFRAME = 56] = "IFRAME", e[e.KEYGEN = 57] = "KEYGEN", e[e.LABEL = 58] = "LABEL", e[e.LI = 59] = "LI", e[e.LINK = 60] = "LINK", e[e.LISTING = 61] = "LISTING", e[e.MAIN = 62] = "MAIN", e[e.MALIGNMARK = 63] = "MALIGNMARK", e[e.MARQUEE = 64] = "MARQUEE", e[e.MATH = 65] = "MATH", e[e.MENU = 66] = "MENU", e[e.META = 67] = "META", e[e.MGLYPH = 68] = "MGLYPH", e[e.MI = 69] = "MI", e[e.MO = 70] = "MO", e[e.MN = 71] = "MN", e[e.MS = 72] = "MS", e[e.MTEXT = 73] = "MTEXT", e[e.NAV = 74] = "NAV", e[e.NOBR = 75] = "NOBR", e[e.NOFRAMES = 76] = "NOFRAMES", e[e.NOEMBED = 77] = "NOEMBED", e[e.NOSCRIPT = 78] = "NOSCRIPT", e[e.OBJECT = 79] = "OBJECT", e[e.OL = 80] = "OL", e[e.OPTGROUP = 81] = "OPTGROUP", e[e.OPTION = 82] = "OPTION", e[e.P = 83] = "P", e[e.PARAM = 84] = "PARAM", e[e.PLAINTEXT = 85] = "PLAINTEXT", e[e.PRE = 86] = "PRE", e[e.RB = 87] = "RB", e[e.RP = 88] = "RP", e[e.RT = 89] = "RT", e[e.RTC = 90] = "RTC", e[e.RUBY = 91] = "RUBY", e[e.S = 92] = "S", e[e.SCRIPT = 93] = "SCRIPT", e[e.SEARCH = 94] = "SEARCH", e[e.SECTION = 95] = "SECTION", e[e.SELECT = 96] = "SELECT", e[e.SOURCE = 97] = "SOURCE", e[e.SMALL = 98] = "SMALL", e[e.SPAN = 99] = "SPAN", e[e.STRIKE = 100] = "STRIKE", e[e.STRONG = 101] = "STRONG", e[e.STYLE = 102] = "STYLE", e[e.SUB = 103] = "SUB", e[e.SUMMARY = 104] = "SUMMARY", e[e.SUP = 105] = "SUP", e[e.TABLE = 106] = "TABLE", e[e.TBODY = 107] = "TBODY", e[e.TEMPLATE = 108] = "TEMPLATE", e[e.TEXTAREA = 109] = "TEXTAREA", e[e.TFOOT = 110] = "TFOOT", e[e.TD = 111] = "TD", e[e.TH = 112] = "TH", e[e.THEAD = 113] = "THEAD", e[e.TITLE = 114] = "TITLE", e[e.TR = 115] = "TR", e[e.TRACK = 116] = "TRACK", e[e.TT = 117] = "TT", e[e.U = 118] = "U", e[e.UL = 119] = "UL", e[e.SVG = 120] = "SVG", e[e.VAR = 121] = "VAR", e[e.WBR = 122] = "WBR", e[e.XMP = 123] = "XMP"; 796})(a || (a = {})); 797const Ou = /* @__PURE__ */ new Map([ 798 [d.A, a.A], 799 [d.ADDRESS, a.ADDRESS], 800 [d.ANNOTATION_XML, a.ANNOTATION_XML], 801 [d.APPLET, a.APPLET], 802 [d.AREA, a.AREA], 803 [d.ARTICLE, a.ARTICLE], 804 [d.ASIDE, a.ASIDE], 805 [d.B, a.B], 806 [d.BASE, a.BASE], 807 [d.BASEFONT, a.BASEFONT], 808 [d.BGSOUND, a.BGSOUND], 809 [d.BIG, a.BIG], 810 [d.BLOCKQUOTE, a.BLOCKQUOTE], 811 [d.BODY, a.BODY], 812 [d.BR, a.BR], 813 [d.BUTTON, a.BUTTON], 814 [d.CAPTION, a.CAPTION], 815 [d.CENTER, a.CENTER], 816 [d.CODE, a.CODE], 817 [d.COL, a.COL], 818 [d.COLGROUP, a.COLGROUP], 819 [d.DD, a.DD], 820 [d.DESC, a.DESC],
821 [d.DETAILS, a.DETAILS], 822 [d.DIALOG, a.DIALOG], 823 [d.DIR, a.DIR], 824 [d.DIV, a.DIV], 825 [d.DL, a.DL], 826 [d.DT, a.DT], 827 [d.EM, a.EM], 828 [d.EMBED, a.EMBED], 829 [d.FIELDSET, a.FIELDSET], 830 [d.FIGCAPTION, a.FIGCAPTION], 831 [d.FIGURE, a.FIGURE], 832 [d.FONT, a.FONT], 833 [d.FOOTER, a.FOOTER], 834 [d.FOREIGN_OBJECT, a.FOREIGN_OBJECT], 835 [d.FORM, a.FORM], 836 [d.FRAME, a.FRAME], 837 [d.FRAMESET, a.FRAMESET], 838 [d.H1, a.H1], 839 [d.H2, a.H2], 840 [d.H3, a.H3], 841 [d.H4, a.H4], 842 [d.H5, a.H5], 843 [d.H6, a.H6], 844 [d.HEAD, a.HEAD], 845 [d.HEADER, a.HEADER], 846 [d.HGROUP, a.HGROUP], 847 [d.HR, a.HR], 848 [d.HTML, a.HTML], 849 [d.I, a.I], 850 [d.IMG, a.IMG], 851 [d.IMAGE, a.IMAGE], 852 [d.INPUT, a.INPUT], 853 [d.IFRAME, a.IFRAME], 854 [d.KEYGEN, a.KEYGEN], 855 [d.LABEL, a.LABEL], 856 [d.LI, a.LI], 857 [d.LINK, a.LINK], 858 [d.LISTING, a.LISTING], 859 [d.MAIN, a.MAIN], 860 [d.MALIGNMARK, a.MALIGNMARK], 861 [d.MARQUEE, a.MARQUEE], 862 [d.MATH, a.MATH], 863 [d.MENU, a.MENU], 864 [d.META, a.META], 865 [d.MGLYPH, a.MGLYPH], 866 [d.MI, a.MI], 867 [d.MO, a.MO], 868 [d.MN, a.MN], 869 [d.MS, a.MS], 870 [d.MTEXT, a.MTEXT], 871 [d.NAV, a.NAV], 872 [d.NOBR, a.NOBR], 873 [d.NOFRAMES, a.NOFRAMES], 874 [d.NOEMBED, a.NOEMBED], 875 [d.NOSCRIPT, a.NOSCRIPT], 876 [d.OBJECT, a.OBJECT], 877 [d.OL, a.OL], 878 [d.OPTGROUP, a.OPTGROUP], 879 [d.OPTION, a.OPTION], 880 [d.P, a.P], 881 [d.PARAM, a.PARAM], 882 [d.PLAINTEXT, a.PLAINTEXT], 883 [d.PRE, a.PRE], 884 [d.RB, a.RB], 885 [d.RP, a.RP], 886 [d.RT, a.RT], 887 [d.RTC, a.RTC], 888 [d.RUBY, a.RUBY], 889 [d.S, a.S], 890 [d.SCRIPT, a.SCRIPT], 891 [d.SEARCH, a.SEARCH], 892 [d.SECTION, a.SECTION], 893 [d.SELECT, a.SELECT], 894 [d.SOURCE, a.SOURCE], 895 [d.SMALL, a.SMALL], 896 [d.SPAN, a.SPAN], 897 [d.STRIKE, a.STRIKE], 898 [d.STRONG, a.STRONG], 899 [d.STYLE, a.STYLE], 900 [d.SUB, a.SUB], 901 [d.SUMMARY, a.SUMMARY],
902 [d.SUP, a.SUP], 903 [d.TABLE, a.TABLE], 904 [d.TBODY, a.TBODY], 905 [d.TEMPLATE, a.TEMPLATE], 906 [d.TEXTAREA, a.TEXTAREA], 907 [d.TFOOT, a.TFOOT], 908 [d.TD, a.TD], 909 [d.TH, a.TH], 910 [d.THEAD, a.THEAD], 911 [d.TITLE, a.TITLE], 912 [d.TR, a.TR], 913 [d.TRACK, a.TRACK], 914 [d.TT, a.TT], 915 [d.U, a.U], 916 [d.UL, a.UL], 917 [d.SVG, a.SVG], 918 [d.VAR, a.VAR], 919 [d.WBR, a.WBR], 920 [d.XMP, a.XMP] 921]); 922function Ee(e) { 923 var t; 924 return (t = Ou.get(e)) !== null && t !== void 0 ? t : a.UNKNOWN; 925} 926const b = a, Lu = { 927 [h.HTML]: /* @__PURE__ */ new Set([ 928 b.ADDRESS, 929 b.APPLET, 930 b.AREA, 931 b.ARTICLE, 932 b.ASIDE, 933 b.BASE, 934 b.BASEFONT, 935 b.BGSOUND, 936 b.BLOCKQUOTE, 937 b.BODY, 938 b.BR, 939 b.BUTTON, 940 b.CAPTION, 941 b.CENTER, 942 b.COL, 943 b.COLGROUP, 944 b.DD, 945 b.DETAILS, 946 b.DIR, 947 b.DIV, 948 b.DL, 949 b.DT, 950 b.EMBED, 951 b.FIELDSET, 952 b.FIGCAPTION, 953 b.FIGURE, 954 b.FOOTER, 955 b.FORM, 956 b.FRAME, 957 b.FRAMESET, 958 b.H1, 959 b.H2, 960 b.H3, 961 b.H4, 962 b.H5, 963 b.H6, 964 b.HEAD, 965 b.HEADER, 966 b.HGROUP, 967 b.HR, 968 b.HTML, 969 b.IFRAME, 970 b.IMG, 971 b.INPUT, 972 b.LI, 973 b.LINK, 974 b.LISTING, 975 b.MAIN, 976 b.MARQUEE, 977 b.MENU, 978 b.META,
979 b.NAV, 980 b.NOEMBED, 981 b.NOFRAMES, 982 b.NOSCRIPT, 983 b.OBJECT, 984 b.OL, 985 b.P, 986 b.PARAM, 987 b.PLAINTEXT, 988 b.PRE, 989 b.SCRIPT, 990 b.SECTION, 991 b.SELECT, 992 b.SOURCE, 993 b.STYLE, 994 b.SUMMARY, 995 b.TABLE, 996 b.TBODY, 997 b.TD, 998 b.TEMPLATE, 999 b.TEXTAREA, 1000 b.TFOOT, 1001 b.TH, 1002 b.THEAD, 1003 b.TITLE, 1004 b.TR, 1005 b.TRACK, 1006 b.UL, 1007 b.WBR, 1008 b.XMP 1009 ]), 1010 [h.MATHML]: /* @__PURE__ */ new Set([b.MI, b.MO, b.MN, b.MS, b.MTEXT, b.ANNOTATION_XML]), 1011 [h.SVG]: /* @__PURE__ */ new Set([b.TITLE, b.FOREIGN_OBJECT, b.DESC]), 1012 [h.XLINK]: /* @__PURE__ */ new Set(), 1013 [h.XML]: /* @__PURE__ */ new Set(), 1014 [h.XMLNS]: /* @__PURE__ */ new Set() 1015}, Re = /* @__PURE__ */ new Set([b.H1, b.H2, b.H3, b.H4, b.H5, b.H6]); 1016d.STYLE, d.SCRIPT, d.XMP, d.IFRAME, d.NOEMBED, d.NOFRAMES, d.PLAINTEXT; 1017var i; 1018(function(e) { 1019 e[e.DATA = 0] = "DATA", e[e.RCDATA = 1] = "RCDATA", e[e.RAWTEXT = 2] = "RAWTEXT", e[e.SCRIPT_DATA = 3] = "SCRIPT_DATA", e[e.PLAINTEXT = 4] = "PLAINTEXT", e[e.TAG_OPEN = 5] = "TAG_OPEN", e[e.END_TAG_OPEN = 6] = "END_TAG_OPEN", e[e.TAG_NAME = 7] = "TAG_NAME", e[e.RCDATA_LESS_THAN_SIGN = 8] = "RCDATA_LESS_THAN_SIGN", e[e.RCDATA_END_TAG_OPEN = 9] = "RCDATA_END_TAG_OPEN", e[e.RCDATA_END_TAG_NAME = 10] = "RCDATA_END_TAG_NAME", e[e.RAWTEXT_LESS_THAN_SIGN = 11] = "RAWTEXT_LESS_THAN_SIGN", e[e.RAWTEXT_END_TAG_OPEN = 12] = "RAWTEXT_END_TAG_OPEN", e[e.RAWTEXT_END_TAG_NAME = 13] = "RAWTEXT_END_TAG_NAME", e[e.SCRIPT_DATA_LESS_THAN_SIGN = 14] = "SCRIPT_DATA_LESS_THAN_SIGN", e[e.SCRIPT_DATA_END_TAG_OPEN = 15] = "SCRIPT_DATA_END_TAG_OPEN", e[e.SCRIPT_DATA_END_TAG_NAME = 16] = "SCRIPT_DATA_END_TAG_NAME", e[e.SCRIPT_DATA_ESCAPE_START = 17] = "SCRIPT_DATA_ESCAPE_START", e[e.SCRIPT_DATA_ESCAPE_START_DASH = 18] = "SCRIPT_DATA_ESCAPE_START_DASH", e[e.SCRIPT_DATA_ESCAPED = 19] = "SCR
1019IPT_DATA_ESCAPED", e[e.SCRIPT_DATA_ESCAPED_DASH = 20] = "SCRIPT_DATA_ESCAPED_DASH", e[e.SCRIPT_DATA_ESCAPED_DASH_DASH = 21] = "SCRIPT_DATA_ESCAPED_DASH_DASH", e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN = 22] = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN", e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN = 23] = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN", e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME = 24] = "SCRIPT_DATA_ESCAPED_END_TAG_NAME", e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START = 25] = "SCRIPT_DATA_DOUBLE_ESCAPE_START", e[e.SCRIPT_DATA_DOUBLE_ESCAPED = 26] = "SCRIPT_DATA_DOUBLE_ESCAPED", e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH = 27] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH", e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH = 28] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH", e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN = 29] = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN", e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END = 30] = "SCRIPT_DATA_DOUBLE_ESCAPE_END", e[e.BEFORE_ATTRIBUTE_NAME = 31] = "BEFORE_ATTRIBUTE_NAME", e[e.ATTRIBUTE_NAME = 32] = "ATTRIBUTE_NAME", e[e.AFTER_ATTRIBUTE_NAME = 33] = "AFTER_ATTRIBUTE_NAME", e[e.BEFORE_ATTRIBUTE_VALUE = 34] = "BEFORE_ATTRIBUTE_VALUE", e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED = 35] = "ATTRIBUTE_VALUE_DOUBLE_QUOTED", e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED = 36] = "ATTRIBUTE_VALUE_SINGLE_QUOTED", e[e.ATTRIBUTE_VALUE_UNQUOTED = 37] = "ATTRIBUTE_VALUE_UNQUOTED", e[e.AFTER_ATTRIBUTE_VALUE_QUOTED = 38] = "AFTER_ATTRIBUTE_VALUE_QUOTED", e[e.SELF_CLOSING_START_TAG = 39] = "SELF_CLOSING_START_TAG", e[e.BOGUS_COMMENT = 40] = "BOGUS_COMMENT", e[e.MARKUP_DECLARATION_OPEN = 41] = "MARKUP_DECLARATION_OPEN", e[e.COMMENT_START = 42] = "COMMENT_START", e[e.COMMENT_START_DASH = 43] = "COMMENT_START_DASH", e[e.COMMENT = 44] = "COMMENT", e[e.COMMENT_LESS_THAN_SIGN = 45] = "COMMENT_LESS_THAN_SIGN", e[e.COMMENT_LESS_THAN_SIGN_BANG = 46] = "COMMENT_LESS_THAN_SIGN_BANG", e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH = 47] = "COMMENT_LESS_THAN_SIGN_BANG_DASH", e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH = 48] = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH", e[e.COMMENT_END_DASH = 49] = "COMMENT_END_DASH", e[e.COMMENT_END = 50] = "COMMENT_END", e[e.COMMENT_END_BANG = 51] = "COMMENT_END_BANG", e[e.DOCTYPE = 52] = "DOCTYPE", e[e.BEFORE_DOCTYPE_NAME = 53] = "BEFORE_DOCTYPE_NAME", e[e.DOCTYPE_NAME = 54] = "DOCTYPE_NAME", e[e.AFTER_DOCTYPE_NAME = 55] = "AFTER_DOCTYPE_NAME", e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD = 56] = "AFTER_DOCTYPE_PUBLIC_KEYWORD", e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER = 57] = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER", e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED = 58] = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED", e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED = 59] = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED", e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER = 60] = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER", e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS = 61] = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS", e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD = 62] = "AFTER_DOCTYPE_SYSTEM_KEYWORD", e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER = 63] = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER", e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED = 64] = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED", e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED = 65] = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED", e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER = 66] = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER", e[e.BOGUS_DOCTYPE = 67] = "BOGUS_DOCTYPE", e[e.CDATA_SECTION = 68] = "CDATA_SECTION", e[e.CDATA_SECTION_BRACKET = 69] = "CDATA_SECTION_BRACKET", e[e.CDATA_SECTION_END = 70] = "CDATA_SECTION_END", e[e.CHARACTER_REFERENCE = 71] = "CHARACTER_REFERENCE", e[e.AMBIGUOUS_AMPERSAND = 72] = "AMBIGUOUS_AMPERSAND"; 1020})(i || (i = {})); 1021const P = { 1022 DATA: i.DATA, 1023 RCDATA: i.RCDATA, 1024 RAWTEXT: i.RAWTEXT, 1025 SCRIPT_DATA: i.SCRIPT_DATA, 1026 PLAINTEXT: i.PLAINTEXT, 1027 CDATA_SECTION: i.CDATA_SECTION 1028}; 1029function Ru(e) { 1030 return e >= r.DIGIT_0 && e <= r.DIGIT_9; 1031} 1032function j(e) { 1033 return e >= r.LATIN_CAPITAL_A && e <= r.LATIN_CAPITAL_Z; 1034} 1035function Du(e) { 1036 return e >= r.LATIN_SMALL_A && e <= r.LATIN_SMALL_Z; 1037} 1038function w(e) { 1039 return Du(e) || j(e); 1040} 1041function Je(e) { 1042 return w(e) || Ru(e); 1043} 1044function se(e) { 1045 return e + 32; 1046} 1047function Ct(e) { 1048 return e === r.SPACE || e === r.LINE_FEED || e === r.TABULATION || e === r.FORM_FEED; 1049} 1050function Ze(e) { 1051 return Ct(e) || e === r.SOLIDUS || e === r.GREATER_THAN_SIGN; 1052} 1053function Pu(e) { 1054 return e === r.NULL ? f.nullCharacterReference : e > 1114111 ? f.characterReferenceOutsideUnicodeRange : At(e) ? f.surrogateCharacterReference : It(e) ? f.noncharacterCharacterReference : pt(e) || e === r.CARRIAGE_RETURN ? f.controlCharacterReference : null; 1055} 1056class xu {
vendor: 6,083 bytes, lines 1057-1215
1057 constructor(t, u) { 1058 this.options = t, this.handler = u, this.paused = !1, this.inLoop = !1, this.inForeignNode = !1, this.lastStartTagName = "", this.active = !1, this.state = i.DATA, this.returnState = i.DATA, this.entityStartPos = 0, this.consumedAfterSnapshot = -1, this.currentCharacterToken = null, this.currentToken = null, this.currentAttr = { name: "", value: "" }, this.preprocessor = new mu(u), this.currentLocation = this.getCurrentLocation(-1), this.entityDecoder = new gu(bu, (s, n) => { 1059 this.preprocessor.pos = this.entityStartPos + n - 1, this._flushCodePointConsumedAsCharacterReference(s); 1060 }, u.onParseError ? { 1061 missingSemicolonAfterCharacterReference: () => { 1062 this._err(f.missingSemicolonAfterCharacterReference, 1); 1063 }, 1064 absenceOfDigitsInNumericCharacterReference: (s) => { 1065 this._err(f.absenceOfDigitsInNumericCharacterReference, this.entityStartPos - this.preprocessor.pos + s); 1066 }, 1067 validateNumericCharacterReference: (s) => { 1068 const n = Pu(s); 1069 n && this._err(n, 1); 1070 } 1071 } : void 0); 1072 } 1073 //Errors 1074 _err(t, u = 0) { 1075 var s, n; 1076 (n = (s = this.handler).onParseError) === null || n === void 0 || n.call(s, this.preprocessor.getError(t, u)); 1077 } 1078 // NOTE: `offset` may never run across line boundaries. 1079 getCurrentLocation(t) { 1080 return this.options.sourceCodeLocationInfo ? { 1081 startLine: this.preprocessor.line, 1082 startCol: this.preprocessor.col - t, 1083 startOffset: this.preprocessor.offset - t, 1084 endLine: -1, 1085 endCol: -1, 1086 endOffset: -1 1087 } : null; 1088 } 1089 _runParsingLoop() { 1090 if (!this.inLoop) { 1091 for (this.inLoop = !0; this.active && !this.paused; ) { 1092 this.consumedAfterSnapshot = 0; 1093 const t = this._consume(); 1094 this._ensureHibernation() || this._callState(t); 1095 } 1096 this.inLoop = !1; 1097 } 1098 } 1099 //API 1100 pause() { 1101 this.paused = !0; 1102 } 1103 resume(t) { 1104 if (!this.paused) 1105 throw new Error("Parser was already resumed"); 1106 this.paused = !1, !this.inLoop && (this._runParsingLoop(), this.paused || t?.()); 1107 } 1108 write(t, u, s) { 1109 this.active = !0, this.preprocessor.write(t, u), this._runParsingLoop(), this.paused || s?.(); 1110 } 1111 insertHtmlAtCurrentPos(t) { 1112 this.active = !0, this.preprocessor.insertHtmlAtCurrentPos(t), this._runParsingLoop(); 1113 } 1114 //Hibernation 1115 _ensureHibernation() { 1116 return this.preprocessor.endOfChunkHit ? (this.preprocessor.retreat(this.consumedAfterSnapshot), this.consumedAfterSnapshot = 0, this.active = !1, !0) : !1; 1117 } 1118 //Consumption 1119 _consume() { 1120 return this.consumedAfterSnapshot++, this.preprocessor.advance(); 1121 } 1122 _advanceBy(t) { 1123 this.consumedAfterSnapshot += t; 1124 for (let u = 0; u < t; u++) 1125 this.preprocessor.advance(); 1126 } 1127 _consumeSequenceIfMatch(t, u) { 1128 return this.preprocessor.startsWith(t, u) ? (this._advanceBy(t.length - 1), !0) : !1; 1129 } 1130 //Token creation 1131 _createStartTagToken() { 1132 this.currentToken = { 1133 type: p.START_TAG, 1134 tagName: "", 1135 tagID: a.UNKNOWN, 1136 selfClosing: !1, 1137 ackSelfClosing: !1, 1138 attrs: [], 1139 location: this.getCurrentLocation(1) 1140 }; 1141 } 1142 _createEndTagToken() { 1143 this.currentToken = { 1144 type: p.END_TAG, 1145 tagName: "", 1146 tagID: a.UNKNOWN, 1147 selfClosing: !1, 1148 ackSelfClosing: !1, 1149 attrs: [], 1150 location: this.getCurrentLocation(2) 1151 }; 1152 } 1153 _createCommentToken(t) { 1154 this.currentToken = { 1155 type: p.COMMENT, 1156 data: "", 1157 location: this.getCurrentLocation(t) 1158 }; 1159 } 1160 _createDoctypeToken(t) { 1161 this.currentToken = { 1162 type: p.DOCTYPE, 1163 name: t, 1164 forceQuirks: !1, 1165 publicId: null, 1166 systemId: null, 1167 location: this.currentLocation 1168 }; 1169 } 1170 _createCharacterToken(t, u) { 1171 this.currentCharacterToken = { 1172 type: t, 1173 chars: u, 1174 location: this.currentLocation 1175 }; 1176 } 1177 //Tag attributes 1178 _createAttr(t) { 1179 this.currentAttr = { 1180 name: t, 1181 value: "" 1182 }, this.currentLocation = this.getCurrentLocation(0); 1183 } 1184 _leaveAttrName() { 1185 var t, u; 1186 const s = this.currentToken; 1187 if (Nt(s, this.currentAttr.name) === null) { 1188 if (s.attrs.push(this.currentAttr), s.location && this.currentLocation) { 1189 const n = (t = (u = s.location).attrs) !== null && t !== void 0 ? t : u.attrs = /* @__PURE__ */ Object.create(null); 1190 n[this.currentAttr.name] = this.currentLocation, this._leaveAttrValue(); 1191 } 1192 } else 1193 this._err(f.duplicateAttribute); 1194 } 1195 _leaveAttrValue() { 1196 this.currentLocation && (this.currentLocation.endLine = this.preprocessor.line, this.currentLocation.endCol = this.preprocessor.col, this.currentLocation.endOffset = this.preprocessor.offset); 1197 } 1198 //Token emission 1199 prepareToken(t) { 1200 this._emitCurrentCharacterToken(t.location), this.currentToken = null, t.location && (t.location.endLine = this.preprocessor.line, t.location.endCol = this.preprocessor.col + 1, t.location.endOffset = this.preprocessor.offset + 1), this.currentLocation = this.getCurrentLocation(-1); 1201 } 1202 emitCurrentTagToken() { 1203 const t = this.currentToken; 1204 this.prepareToken(t), t.tagID = Ee(t.tagName), t.type === p.START_TAG ? (this.lastStartTagName = t.tagName, this.handler.onStartTag(t)) : (t.attrs.length > 0 && this._err(f.endTagWithAttributes), t.selfClosing && this._err(f.endTagWithTrailingSolidus), this.handler.onEndTag(t)), this.preprocessor.dropParsedChunk(); 1205 } 1206 emitCurrentComment(t) { 1207 this.prepareToken(t), this.handler.onComment(t), this.preprocessor.dropParsedChunk(); 1208 } 1209 emitCurrentDoctype(t) { 1210 this.prepareToken(t), this.handler.onDoctype(t), this.preprocessor.dropParsedChunk(); 1211 } 1212 _emitCurrentCharacterToken(t) { 1213 if (this.currentCharacterToken) { 1214 switch (t && this.currentCharacterToken.location && (this.currentCharacterToken.location.endLine = t.startLine, this.currentCharacterToken.location.endCol = t.startCol, this.currentCharacterToken.location.endOffset = t.startOffset), this.currentCharacterToken.type) { 1215 case p.CHARACTER: {
1216 this.handler.onCharacter(this.currentCharacterToken); 1217 break; 1218 } 1219 case p.NULL_CHARACTER: { 1220 this.handler.onNullCharacter(this.currentCharacterToken); 1221 break; 1222 } 1223 case p.WHITESPACE_CHARACTER: { 1224 this.handler.onWhitespaceCharacter(this.currentCharacterToken); 1225 break; 1226 } 1227 } 1228 this.currentCharacterToken = null; 1229 } 1230 } 1231 _emitEOFToken() { 1232 const t = this.getCurrentLocation(0); 1233 t && (t.endLine = t.startLine, t.endCol = t.startCol, t.endOffset = t.startOffset), this._emitCurrentCharacterToken(t), this.handler.onEof({ type: p.EOF, location: t }), this.active = !1; 1234 } 1235 //Characters emission 1236 //OPTIMIZATION: The specification uses only one type of character token (one token per character). 1237 //This causes a huge memory overhead and a lot of unnecessary parser loops. parse5 uses 3 groups of characters. 1238 //If we have a sequence of characters that belong to the same group, the parser can process it 1239 //as a single solid character token. 1240 //So, there are 3 types of character tokens in parse5: 1241 //1)TokenType.NULL_CHARACTER - \u0000-character sequences (e.g. '\u0000\u0000\u0000') 1242 //2)TokenType.WHITESPACE_CHARACTER - any whitespace/new-line character sequences (e.g. '\n \r\t \f') 1243 //3)TokenType.CHARACTER - any character sequence which don't belong to groups 1 and 2 (e.g. 'abcdef1234@@#$%^') 1244 _appendCharToCurrentCharacterToken(t, u) { 1245 if (this.currentCharacterToken) 1246 if (this.currentCharacterToken.type === t) { 1247 this.currentCharacterToken.chars += u; 1248 return; 1249 } else 1250 this.currentLocation = this.getCurrentLocation(0), this._emitCurrentCharacterToken(this.currentLocation), this.preprocessor.dropParsedChunk(); 1251 this._createCharacterToken(t, u); 1252 } 1253 _emitCodePoint(t) { 1254 const u = Ct(t) ? p.WHITESPACE_CHARACTER : t === r.NULL ? p.NULL_CHARACTER : p.CHARACTER; 1255 this._appendCharToCurrentCharacterToken(u, String.fromCodePoint(t)); 1256 } 1257 //NOTE: used when we emit characters explicitly. 1258 //This is always for non-whitespace and non-null characters, which allows us to avoid additional checks. 1259 _emitChars(t) { 1260 this._appendCharToCurrentCharacterToken(p.CHARACTER, t); 1261 } 1262 // Character reference helpers 1263 _startCharacterReference() { 1264 this.returnState = this.state, this.state = i.CHARACTER_REFERENCE, this.entityStartPos = this.preprocessor.pos, this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute() ? F.Attribute : F.Legacy); 1265 } 1266 _isCharacterReferenceInAttribute() { 1267 return this.returnState === i.ATTRIBUTE_VALUE_DOUBLE_QUOTED || this.returnState === i.ATTRIBUTE_VALUE_SINGLE_QUOTED || this.returnState === i.ATTRIBUTE_VALUE_UNQUOTED; 1268 } 1269 _flushCodePointConsumedAsCharacterReference(t) { 1270 this._isCharacterReferenceInAttribute() ? this.currentAttr.value += String.fromCodePoint(t) : this._emitCodePoint(t); 1271 } 1272 // Calling states this way turns out to be much faster than any other approach. 1273 _callState(t) { 1274 switch (this.state) { 1275 case i.DATA: { 1276 this._stateData(t); 1277 break; 1278 } 1279 case i.RCDATA: { 1280 this._stateRcdata(t); 1281 break; 1282 } 1283 case i.RAWTEXT: { 1284 this._stateRawtext(t); 1285 break; 1286 } 1287 case i.SCRIPT_DATA: { 1288 this._stateScriptData(t); 1289 break; 1290 } 1291 case i.PLAINTEXT: { 1292 this._statePlaintext(t); 1293 break; 1294 } 1295 case i.TAG_OPEN: { 1296 this._stateTagOpen(t); 1297 break; 1298 } 1299 case i.END_TAG_OPEN: { 1300 this._stateEndTagOpen(t); 1301 break; 1302 } 1303 case i.TAG_NAME: { 1304 this._stateTagName(t); 1305 break; 1306 } 1307 case i.RCDATA_LESS_THAN_SIGN: { 1308 this._stateRcdataLessThanSign(t); 1309 break; 1310 } 1311 case i.RCDATA_END_TAG_OPEN: { 1312 this._stateRcdataEndTagOpen(t); 1313 break; 1314 } 1315 case i.RCDATA_END_TAG_NAME: { 1316 this._stateRcdataEndTagName(t); 1317 break; 1318 } 1319 case i.RAWTEXT_LESS_THAN_SIGN: { 1320 this._stateRawtextLessThanSign(t); 1321 break; 1322 } 1323 case i.RAWTEXT_END_TAG_OPEN: { 1324 this._stateRawtextEndTagOpen(t); 1325 break; 1326 } 1327 case i.RAWTEXT_END_TAG_NAME: { 1328 this._stateRawtextEndTagName(t); 1329 break; 1330 } 1331 case i.SCRIPT_DATA_LESS_THAN_SIGN: { 1332 this._stateScriptDataLessThanSign(t); 1333 break; 1334 } 1335 case i.SCRIPT_DATA_END_TAG_OPEN: { 1336 this._stateScriptDataEndTagOpen(t); 1337 break; 1338 } 1339 case i.SCRIPT_DATA_END_TAG_NAME: { 1340 this._stateScriptDataEndTagName(t); 1341 break; 1342 } 1343 case i.SCRIPT_DATA_ESCAPE_START: { 1344 this._stateScriptDataEscapeStart(t); 1345 break; 1346 } 1347 case i.SCRIPT_DATA_ESCAPE_START_DASH: { 1348 this._stateScriptDataEscapeStartDash(t); 1349 break; 1350 } 1351 case i.SCRIPT_DATA_ESCAPED: { 1352 this._stateScriptDataEscaped(t); 1353 break; 1354 } 1355 case i.SCRIPT_DATA_ESCAPED_DASH: { 1356 this._stateScriptDataEscapedDash(t); 1357 break; 1358 } 1359 case i.SCRIPT_DATA_ESCAPED_DASH_DASH: { 1360 this._stateScriptDataEscapedDashDash(t); 1361 break; 1362 } 1363 case i.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: { 1364 this._stateScriptDataEscapedLessThanSign(t); 1365 break; 1366 } 1367 case i.SCRIPT_DATA_ESCAPED_END_TAG_OPEN: { 1368 this._stateScriptDataEscapedEndTagOpen(t); 1369 break; 1370 } 1371 case i.SCRIPT_DATA_ESCAPED_END_TAG_NAME: { 1372 this._stateScriptDataEscapedEndTagName(t); 1373 break; 1374 } 1375 case i.SCRIPT_DATA_DOUBLE_ESCAPE_START: {
1376 this._stateScriptDataDoubleEscapeStart(t); 1377 break; 1378 } 1379 case i.SCRIPT_DATA_DOUBLE_ESCAPED: { 1380 this._stateScriptDataDoubleEscaped(t); 1381 break; 1382 } 1383 case i.SCRIPT_DATA_DOUBLE_ESCAPED_DASH: { 1384 this._stateScriptDataDoubleEscapedDash(t); 1385 break; 1386 } 1387 case i.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH: { 1388 this._stateScriptDataDoubleEscapedDashDash(t); 1389 break; 1390 } 1391 case i.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN: { 1392 this._stateScriptDataDoubleEscapedLessThanSign(t); 1393 break; 1394 } 1395 case i.SCRIPT_DATA_DOUBLE_ESCAPE_END: { 1396 this._stateScriptDataDoubleEscapeEnd(t); 1397 break; 1398 } 1399 case i.BEFORE_ATTRIBUTE_NAME: { 1400 this._stateBeforeAttributeName(t); 1401 break; 1402 } 1403 case i.ATTRIBUTE_NAME: { 1404 this._stateAttributeName(t); 1405 break; 1406 } 1407 case i.AFTER_ATTRIBUTE_NAME: { 1408 this._stateAfterAttributeName(t); 1409 break; 1410 } 1411 case i.BEFORE_ATTRIBUTE_VALUE: { 1412 this._stateBeforeAttributeValue(t); 1413 break; 1414 } 1415 case i.ATTRIBUTE_VALUE_DOUBLE_QUOTED: { 1416 this._stateAttributeValueDoubleQuoted(t); 1417 break; 1418 } 1419 case i.ATTRIBUTE_VALUE_SINGLE_QUOTED: { 1420 this._stateAttributeValueSingleQuoted(t); 1421 break; 1422 } 1423 case i.ATTRIBUTE_VALUE_UNQUOTED: { 1424 this._stateAttributeValueUnquoted(t); 1425 break; 1426 } 1427 case i.AFTER_ATTRIBUTE_VALUE_QUOTED: { 1428 this._stateAfterAttributeValueQuoted(t); 1429 break; 1430 } 1431 case i.SELF_CLOSING_START_TAG: { 1432 this._stateSelfClosingStartTag(t); 1433 break; 1434 } 1435 case i.BOGUS_COMMENT: { 1436 this._stateBogusComment(t); 1437 break; 1438 } 1439 case i.MARKUP_DECLARATION_OPEN: { 1440 this._stateMarkupDeclarationOpen(t); 1441 break; 1442 } 1443 case i.COMMENT_START: { 1444 this._stateCommentStart(t); 1445 break; 1446 } 1447 case i.COMMENT_START_DASH: { 1448 this._stateCommentStartDash(t); 1449 break; 1450 } 1451 case i.COMMENT: { 1452 this._stateComment(t); 1453 break; 1454 } 1455 case i.COMMENT_LESS_THAN_SIGN: { 1456 this._stateCommentLessThanSign(t); 1457 break; 1458 } 1459 case i.COMMENT_LESS_THAN_SIGN_BANG: { 1460 this._stateCommentLessThanSignBang(t); 1461 break; 1462 } 1463 case i.COMMENT_LESS_THAN_SIGN_BANG_DASH: { 1464 this._stateCommentLessThanSignBangDash(t); 1465 break; 1466 } 1467 case i.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH: { 1468 this._stateCommentLessThanSignBangDashDash(t); 1469 break; 1470 } 1471 case i.COMMENT_END_DASH: { 1472 this._stateCommentEndDash(t); 1473 break; 1474 } 1475 case i.COMMENT_END: { 1476 this._stateCommentEnd(t); 1477 break; 1478 } 1479 case i.COMMENT_END_BANG: { 1480 this._stateCommentEndBang(t); 1481 break; 1482 } 1483 case i.DOCTYPE: { 1484 this._stateDoctype(t); 1485 break; 1486 } 1487 case i.BEFORE_DOCTYPE_NAME: { 1488 this._stateBeforeDoctypeName(t); 1489 break; 1490 } 1491 case i.DOCTYPE_NAME: { 1492 this._stateDoctypeName(t); 1493 break; 1494 } 1495 case i.AFTER_DOCTYPE_NAME: { 1496 this._stateAfterDoctypeName(t); 1497 break; 1498 } 1499 case i.AFTER_DOCTYPE_PUBLIC_KEYWORD: { 1500 this._stateAfterDoctypePublicKeyword(t); 1501 break; 1502 } 1503 case i.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: { 1504 this._stateBeforeDoctypePublicIdentifier(t); 1505 break; 1506 } 1507 case i.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: { 1508 this._stateDoctypePublicIdentifierDoubleQuoted(t); 1509 break; 1510 } 1511 case i.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: { 1512 this._stateDoctypePublicIdentifierSingleQuoted(t); 1513 break; 1514 } 1515 case i.AFTER_DOCTYPE_PUBLIC_IDENTIFIER: { 1516 this._stateAfterDoctypePublicIdentifier(t); 1517 break; 1518 } 1519 case i.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: { 1520 this._stateBetweenDoctypePublicAndSystemIdentifiers(t); 1521 break; 1522 } 1523 case i.AFTER_DOCTYPE_SYSTEM_KEYWORD: { 1524 this._stateAfterDoctypeSystemKeyword(t); 1525 break; 1526 } 1527 case i.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: {
1528 this._stateBeforeDoctypeSystemIdentifier(t); 1529 break; 1530 } 1531 case i.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: { 1532 this._stateDoctypeSystemIdentifierDoubleQuoted(t); 1533 break; 1534 } 1535 case i.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: { 1536 this._stateDoctypeSystemIdentifierSingleQuoted(t); 1537 break; 1538 } 1539 case i.AFTER_DOCTYPE_SYSTEM_IDENTIFIER: { 1540 this._stateAfterDoctypeSystemIdentifier(t); 1541 break; 1542 } 1543 case i.BOGUS_DOCTYPE: { 1544 this._stateBogusDoctype(t); 1545 break; 1546 } 1547 case i.CDATA_SECTION: { 1548 this._stateCdataSection(t); 1549 break; 1550 } 1551 case i.CDATA_SECTION_BRACKET: { 1552 this._stateCdataSectionBracket(t); 1553 break; 1554 } 1555 case i.CDATA_SECTION_END: { 1556 this._stateCdataSectionEnd(t); 1557 break; 1558 } 1559 case i.CHARACTER_REFERENCE: { 1560 this._stateCharacterReference(); 1561 break; 1562 } 1563 case i.AMBIGUOUS_AMPERSAND: { 1564 this._stateAmbiguousAmpersand(t); 1565 break; 1566 } 1567 default: 1568 throw new Error("Unknown state"); 1569 } 1570 } 1571 // State machine 1572 // Data state 1573 //------------------------------------------------------------------ 1574 _stateData(t) { 1575 switch (t) { 1576 case r.LESS_THAN_SIGN: { 1577 this.state = i.TAG_OPEN; 1578 break; 1579 } 1580 case r.AMPERSAND: { 1581 this._startCharacterReference(); 1582 break; 1583 } 1584 case r.NULL: { 1585 this._err(f.unexpectedNullCharacter), this._emitCodePoint(t); 1586 break; 1587 } 1588 case r.EOF: { 1589 this._emitEOFToken(); 1590 break; 1591 } 1592 default: 1593 this._emitCodePoint(t); 1594 } 1595 } 1596 // RCDATA state 1597 //------------------------------------------------------------------ 1598 _stateRcdata(t) { 1599 switch (t) { 1600 case r.AMPERSAND: { 1601 this._startCharacterReference(); 1602 break; 1603 } 1604 case r.LESS_THAN_SIGN: { 1605 this.state = i.RCDATA_LESS_THAN_SIGN; 1606 break; 1607 } 1608 case r.NULL: { 1609 this._err(f.unexpectedNullCharacter), this._emitChars(N); 1610 break; 1611 } 1612 case r.EOF: { 1613 this._emitEOFToken(); 1614 break; 1615 } 1616 default: 1617 this._emitCodePoint(t); 1618 } 1619 } 1620 // RAWTEXT state 1621 //------------------------------------------------------------------ 1622 _stateRawtext(t) { 1623 switch (t) { 1624 case r.LESS_THAN_SIGN: { 1625 this.state = i.RAWTEXT_LESS_THAN_SIGN; 1626 break; 1627 } 1628 case r.NULL: { 1629 this._err(f.unexpectedNullCharacter), this._emitChars(N); 1630 break; 1631 } 1632 case r.EOF: { 1633 this._emitEOFToken(); 1634 break; 1635 } 1636 default: 1637 this._emitCodePoint(t); 1638 } 1639 } 1640 // Script data state 1641 //------------------------------------------------------------------ 1642 _stateScriptData(t) { 1643 switch (t) { 1644 case r.LESS_THAN_SIGN: { 1645 this.state = i.SCRIPT_DATA_LESS_THAN_SIGN; 1646 break; 1647 } 1648 case r.NULL: { 1649 this._err(f.unexpectedNullCharacter), this._emitChars(N); 1650 break; 1651 } 1652 case r.EOF: { 1653 this._emitEOFToken(); 1654 break; 1655 } 1656 default: 1657 this._emitCodePoint(t); 1658 } 1659 } 1660 // PLAINTEXT state 1661 //------------------------------------------------------------------ 1662 _statePlaintext(t) { 1663 switch (t) { 1664 case r.NULL: { 1665 this._err(f.unexpectedNullCharacter), this._emitChars(N); 1666 break; 1667 } 1668 case r.EOF: { 1669 this._emitEOFToken(); 1670 break; 1671 } 1672 default: 1673 this._emitCodePoint(t); 1674 } 1675 } 1676 // Tag open state 1677 //------------------------------------------------------------------ 1678 _stateTagOpen(t) { 1679 if (w(t)) 1680 this._createStartTagToken(), this.state = i.TAG_NAME, this._stateTagName(t); 1681 else 1682 switch (t) { 1683 case r.EXCLAMATION_MARK: { 1684 this.state = i.MARKUP_DECLARATION_OPEN; 1685 break; 1686 } 1687 case r.SOLIDUS: { 1688 this.state = i.END_TAG_OPEN; 1689 break; 1690 } 1691 case r.QUESTION_MARK: { 1692 this._err(f.unexpectedQuestionMarkInsteadOfTagName), this._createCommentToken(1), this.state = i.BOGUS_COMMENT, this._stateBogusComment(t); 1693 break; 1694 } 1695 case r.EOF: { 1696 this._err(f.eofBeforeTagName), this._emitChars("<"), this._emitEOFToken(); 1697 break; 1698 } 1699 default:
1700 this._err(f.invalidFirstCharacterOfTagName), this._emitChars("<"), this.state = i.DATA, this._stateData(t); 1701 } 1702 } 1703 // End tag open state 1704 //------------------------------------------------------------------ 1705 _stateEndTagOpen(t) { 1706 if (w(t)) 1707 this._createEndTagToken(), this.state = i.TAG_NAME, this._stateTagName(t); 1708 else 1709 switch (t) { 1710 case r.GREATER_THAN_SIGN: { 1711 this._err(f.missingEndTagName), this.state = i.DATA; 1712 break; 1713 } 1714 case r.EOF: { 1715 this._err(f.eofBeforeTagName), this._emitChars("</"), this._emitEOFToken(); 1716 break; 1717 } 1718 default: 1719 this._err(f.invalidFirstCharacterOfTagName), this._createCommentToken(2), this.state = i.BOGUS_COMMENT, this._stateBogusComment(t); 1720 } 1721 } 1722 // Tag name state 1723 //------------------------------------------------------------------ 1724 _stateTagName(t) { 1725 const u = this.currentToken; 1726 switch (t) { 1727 case r.SPACE: 1728 case r.LINE_FEED: 1729 case r.TABULATION: 1730 case r.FORM_FEED: { 1731 this.state = i.BEFORE_ATTRIBUTE_NAME; 1732 break; 1733 } 1734 case r.SOLIDUS: { 1735 this.state = i.SELF_CLOSING_START_TAG; 1736 break; 1737 } 1738 case r.GREATER_THAN_SIGN: { 1739 this.state = i.DATA, this.emitCurrentTagToken(); 1740 break; 1741 } 1742 case r.NULL: { 1743 this._err(f.unexpectedNullCharacter), u.tagName += N; 1744 break; 1745 } 1746 case r.EOF: { 1747 this._err(f.eofInTag), this._emitEOFToken(); 1748 break; 1749 } 1750 default: 1751 u.tagName += String.fromCodePoint(j(t) ? se(t) : t); 1752 } 1753 } 1754 // RCDATA less-than sign state 1755 //------------------------------------------------------------------ 1756 _stateRcdataLessThanSign(t) { 1757 t === r.SOLIDUS ? this.state = i.RCDATA_END_TAG_OPEN : (this._emitChars("<"), this.state = i.RCDATA, this._stateRcdata(t)); 1758 } 1759 // RCDATA end tag open state 1760 //------------------------------------------------------------------ 1761 _stateRcdataEndTagOpen(t) { 1762 w(t) ? (this.state = i.RCDATA_END_TAG_NAME, this._stateRcdataEndTagName(t)) : (this._emitChars("</"), this.state = i.RCDATA, this._stateRcdata(t)); 1763 } 1764 handleSpecialEndTag(t) { 1765 if (!this.preprocessor.startsWith(this.lastStartTagName, !1)) 1766 return !this._ensureHibernation(); 1767 this._createEndTagToken(); 1768 const u = this.currentToken; 1769 switch (u.tagName = this.lastStartTagName, this.preprocessor.peek(this.lastStartTagName.length)) { 1770 case r.SPACE: 1771 case r.LINE_FEED: 1772 case r.TABULATION: 1773 case r.FORM_FEED: 1774 return this._advanceBy(this.lastStartTagName.length), this.state = i.BEFORE_ATTRIBUTE_NAME, !1; 1775 case r.SOLIDUS: 1776 return this._advanceBy(this.lastStartTagName.length), this.state = i.SELF_CLOSING_START_TAG, !1; 1777 case r.GREATER_THAN_SIGN: 1778 return this._advanceBy(this.lastStartTagName.length), this.emitCurrentTagToken(), this.state = i.DATA, !1; 1779 default: 1780 return !this._ensureHibernation(); 1781 } 1782 } 1783 // RCDATA end tag name state 1784 //------------------------------------------------------------------ 1785 _stateRcdataEndTagName(t) { 1786 this.handleSpecialEndTag(t) && (this._emitChars("</"), this.state = i.RCDATA, this._stateRcdata(t)); 1787 } 1788 // RAWTEXT less-than sign state 1789 //------------------------------------------------------------------ 1790 _stateRawtextLessThanSign(t) { 1791 t === r.SOLIDUS ? this.state = i.RAWTEXT_END_TAG_OPEN : (this._emitChars("<"), this.state = i.RAWTEXT, this._stateRawtext(t)); 1792 } 1793 // RAWTEXT end tag open state 1794 //------------------------------------------------------------------ 1795 _stateRawtextEndTagOpen(t) { 1796 w(t) ? (this.state = i.RAWTEXT_END_TAG_NAME, this._stateRawtextEndTagName(t)) : (this._emitChars("</"), this.state = i.RAWTEXT, this._stateRawtext(t)); 1797 } 1798 // RAWTEXT end tag name state 1799 //------------------------------------------------------------------ 1800 _stateRawtextEndTagName(t) { 1801 this.handleSpecialEndTag(t) && (this._emitChars("</"), this.state = i.RAWTEXT, this._stateRawtext(t)); 1802 } 1803 // Script data less-than sign state 1804 //------------------------------------------------------------------ 1805 _stateScriptDataLessThanSign(t) { 1806 switch (t) { 1807 case r.SOLIDUS: { 1808 this.state = i.SCRIPT_DATA_END_TAG_OPEN; 1809 break; 1810 } 1811 case r.EXCLAMATION_MARK: { 1812 this.state = i.SCRIPT_DATA_ESCAPE_START, this._emitChars("<!"); 1813 break; 1814 } 1815 default: 1816 this._emitChars("<"), this.state = i.SCRIPT_DATA, this._stateScriptData(t); 1817 } 1818 } 1819 // Script data end tag open state 1820 //------------------------------------------------------------------ 1821 _stateScriptDataEndTagOpen(t) { 1822 w(t) ? (this.state = i.SCRIPT_DATA_END_TAG_NAME, this._stateScriptDataEndTagName(t)) : (this._emitChars("</"), this.state = i.SCRIPT_DATA, this._stateScriptData(t)); 1823 } 1824 // Script data end tag name state 1825 //------------------------------------------------------------------ 1826 _stateScriptDataEndTagName(t) { 1827 this.handleSpecialEndTag(t) && (this._emitChars("</"), this.state = i.SCRIPT_DATA, this._stateScriptData(t)); 1828 } 1829 // Script data escape start state 1830 //------------------------------------------------------------------ 1831 _stateScriptDataEscapeStart(t) { 1832 t === r.HYPHEN_MINUS ? (this.state = i.SCRIPT_DATA_ESCAPE_START_DASH, this._emitChars("-")) : (this.state = i.SCRIPT_DATA, this._stateScriptData(t)); 1833 } 1834 // Script data escape start dash state 1835 //------------------------------------------------------------------ 1836 _stateScriptDataEscapeStartDash(t) { 1837 t === r.HYPHEN_MINUS ? (this.state = i.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-")) : (this.state = i.SCRIPT_DATA, this._stateScriptData(t)); 1838 } 1839 // Script data escaped state 1840 //------------------------------------------------------------------ 1841 _stateScriptDataEscaped(t) { 1842 switch (t) { 1843 case r.HYPHEN_MINUS: { 1844 this.state = i.SCRIPT_DATA_ESCAPED_DASH, this._emitChars("-"); 1845 break; 1846 } 1847 case r.LESS_THAN_SIGN: { 1848 this.state = i.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN; 1849 break; 1850 } 1851 case r.NULL: { 1852 this._err(f.unexpectedNullCharacter), this._emitChars(N); 1853 break; 1854 } 1855 case r.EOF: { 1856 this._err(f.eofInScriptHtmlCommentLikeText), this._emitEOFToken(); 1857 break; 1858 } 1859 default: 1860 this._emitCodePoint(t); 1861 } 1862 } 1863 // Script data escaped dash state 1864 //------------------------------------------------------------------ 1865 _stateScriptDataEscapedDash(t) { 1866 switch (t) { 1867 case r.HYPHEN_MINUS: { 1868 this.state = i.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-"); 1869 break; 1870 } 1871 case r.LESS_THAN_SIGN: { 1872 this.state = i.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN; 1873 break; 1874 } 1875 case r.NULL: { 1876 this._err(f.unexpectedNullCharacter), this.state = i.SCRIPT_DATA_ESCAPED, this._emitChars(N); 1877 break; 1878 } 1879 case r.EOF: { 1880 this._err(f.eofInScriptHtmlCommentLikeText), this._emitEOFToken(); 1881 break; 1882 } 1883 default: 1884 this.state = i.SCRIPT_DATA_ESCAPED, this._emitCodePoint(t); 1885 } 1886 } 1887 // Script data escaped dash dash state 1888 //------------------------------------------------------------------ 1889 _stateScriptDataEscapedDashDash(t) { 1890 switch (t) { 1891 case r.HYPHEN_MINUS: { 1892 this._emitChars("-"); 1893 break; 1894 } 1895 case r.LESS_THAN_SIGN: { 1896 this.state = i.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN; 1897 break; 1898 } 1899 case r.GREATER_THAN_SIGN: { 1900 this.state = i.SCRIPT_DATA, this._emitChars(">"); 1901 break; 1902 } 1903 case r.NULL: { 1904 this._err(f.unexpectedNullCharacter), this.state = i.SCRIPT_DATA_ESCAPED, this._emitChars(N); 1905 break; 1906 } 1907 case r.EOF: { 1908 this._err(f.eofInScriptHtmlCommentLikeText), this._emitEOFToken(); 1909 break; 1910 } 1911 default: 1912 this.state = i.SCRIPT_DATA_ESCAPED, this._emitCodePoint(t); 1913 } 1914 } 1915 // Script data escaped less-than sign state 1916 //------------------------------------------------------------------ 1917 _stateScriptDataEscapedLessThanSign(t) { 1918 t === r.SOLIDUS ? this.state = i.SCRIPT_DATA_ESCAPED_END_TAG_OPEN : w(t) ? (this._emitChars("<"), this.state = i.SCRIPT_DATA_DOUBLE_ESCAPE_START, this._stateScriptDataDoubleEscape
1918Start(t)) : (this._emitChars("<"), this.state = i.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(t)); 1919 } 1920 // Script data escaped end tag open state 1921 //------------------------------------------------------------------ 1922 _stateScriptDataEscapedEndTagOpen(t) { 1923 w(t) ? (this.state = i.SCRIPT_DATA_ESCAPED_END_TAG_NAME, this._stateScriptDataEscapedEndTagName(t)) : (this._emitChars("</"), this.state = i.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(t)); 1924 } 1925 // Script data escaped end tag name state 1926 //------------------------------------------------------------------ 1927 _stateScriptDataEscapedEndTagName(t) { 1928 this.handleSpecialEndTag(t) && (this._emitChars("</"), this.state = i.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(t)); 1929 } 1930 // Script data double escape start state 1931 //------------------------------------------------------------------ 1932 _stateScriptDataDoubleEscapeStart(t) { 1933 if (this.preprocessor.startsWith(D.SCRIPT, !1) && Ze(this.preprocessor.peek(D.SCRIPT.length))) { 1934 this._emitCodePoint(t); 1935 for (let u = 0; u < D.SCRIPT.length; u++) 1936 this._emitCodePoint(this._consume()); 1937 this.state = i.SCRIPT_DATA_DOUBLE_ESCAPED; 1938 } else this._ensureHibernation() || (this.state = i.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(t)); 1939 } 1940 // Script data double escaped state 1941 //------------------------------------------------------------------ 1942 _stateScriptDataDoubleEscaped(t) { 1943 switch (t) { 1944 case r.HYPHEN_MINUS: { 1945 this.state = i.SCRIPT_DATA_DOUBLE_ESCAPED_DASH, this._emitChars("-"); 1946 break; 1947 } 1948 case r.LESS_THAN_SIGN: { 1949 this.state = i.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<"); 1950 break; 1951 } 1952 case r.NULL: { 1953 this._err(f.unexpectedNullCharacter), this._emitChars(N); 1954 break; 1955 } 1956 case r.EOF: { 1957 this._err(f.eofInScriptHtmlCommentLikeText), this._emitEOFToken(); 1958 break; 1959 } 1960 default: 1961 this._emitCodePoint(t); 1962 } 1963 } 1964 // Script data double escaped dash state 1965 //------------------------------------------------------------------ 1966 _stateScriptDataDoubleEscapedDash(t) { 1967 switch (t) { 1968 case r.HYPHEN_MINUS: { 1969 this.state = i.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH, this._emitChars("-"); 1970 break; 1971 } 1972 case r.LESS_THAN_SIGN: { 1973 this.state = i.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<"); 1974 break; 1975 } 1976 case r.NULL: { 1977 this._err(f.unexpectedNullCharacter), this.state = i.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(N); 1978 break; 1979 } 1980 case r.EOF: { 1981 this._err(f.eofInScriptHtmlCommentLikeText), this._emitEOFToken(); 1982 break; 1983 } 1984 default: 1985 this.state = i.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(t); 1986 } 1987 } 1988 // Script data double escaped dash dash state 1989 //------------------------------------------------------------------ 1990 _stateScriptDataDoubleEscapedDashDash(t) { 1991 switch (t) { 1992 case r.HYPHEN_MINUS: { 1993 this._emitChars("-"); 1994 break; 1995 } 1996 case r.LESS_THAN_SIGN: { 1997 this.state = i.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<"); 1998 break; 1999 } 2000 case r.GREATER_THAN_SIGN: { 2001 this.state = i.SCRIPT_DATA, this._emitChars(">"); 2002 break; 2003 } 2004 case r.NULL: { 2005 this._err(f.unexpectedNullCharacter), this.state = i.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(N); 2006 break; 2007 } 2008 case r.EOF: { 2009 this._err(f.eofInScriptHtmlCommentLikeText), this._emitEOFToken(); 2010 break; 2011 } 2012 default: 2013 this.state = i.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(t); 2014 } 2015 } 2016 // Script data double escaped less-than sign state 2017 //------------------------------------------------------------------ 2018 _stateScriptDataDoubleEscapedLessThanSign(t) { 2019 t === r.SOLIDUS ? (this.state = i.SCRIPT_DATA_DOUBLE_ESCAPE_END, this._emitChars("/")) : (this.state = i.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(t)); 2020 } 2021 // Script data double escape end state 2022 //------------------------------------------------------------------ 2023 _stateScriptDataDoubleEscapeEnd(t) { 2024 if (this.preprocessor.startsWith(D.SCRIPT, !1) && Ze(this.preprocessor.peek(D.SCRIPT.length))) { 2025 this._emitCodePoint(t); 2026 for (let u = 0; u < D.SCRIPT.length; u++) 2027 this._emitCodePoint(this._consume()); 2028 this.state = i.SCRIPT_DATA_ESCAPED; 2029 } else this._ensureHibernation() || (this.state = i.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(t)); 2030 } 2031 // Before attribute name state 2032 //------------------------------------------------------------------ 2033 _stateBeforeAttributeName(t) { 2034 switch (t) { 2035 case r.SPACE: 2036 case r.LINE_FEED: 2037 case r.TABULATION: 2038 case r.FORM_FEED: 2039 break; 2040 case r.SOLIDUS: 2041 case r.GREATER_THAN_SIGN: 2042 case r.EOF: { 2043 this.state = i.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(t); 2044 break; 2045 } 2046 case r.EQUALS_SIGN: { 2047 this._err(f.unexpectedEqualsSignBeforeAttributeName), this._createAttr("="), this.state = i.ATTRIBUTE_NAME; 2048 break; 2049 } 2050 default: 2051 this._createAttr(""), this.state = i.ATTRIBUTE_NAME, this._stateAttributeName(t); 2052 } 2053 } 2054 // Attribute name state 2055 //------------------------------------------------------------------ 2056 _stateAttributeName(t) { 2057 switch (t) { 2058 case r.SPACE: 2059 case r.LINE_FEED: 2060 case r.TABULATION: 2061 case r.FORM_FEED: 2062 case r.SOLIDUS: 2063 case r.GREATER_THAN_SIGN: 2064 case r.EOF: { 2065 this._leaveAttrName(), this.state = i.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(t); 2066 break; 2067 } 2068 case r.EQUALS_SIGN: { 2069 this._leaveAttrName(), this.state = i.BEFORE_ATTRIBUTE_VALUE; 2070 break; 2071 } 2072 case r.QUOTATION_MARK: 2073 case r.APOSTROPHE: 2074 case r.LESS_THAN_SIGN: { 2075 this._err(f.unexpectedCharacterInAttributeName), this.currentAttr.name += String.fromCodePoint(t); 2076 break; 2077 } 2078 case r.NULL: { 2079 this._err(f.unexpectedNullCharacter), this.currentAttr.name += N; 2080 break; 2081 } 2082 default: 2083 this.currentAttr.name += String.fromCodePoint(j(t) ? se(t) : t); 2084 } 2085 } 2086 // After attribute name state 2087 //------------------------------------------------------------------ 2088 _stateAfterAttributeName(t) { 2089 switch (t) { 2090 case r.SPACE: 2091 case r.LINE_FEED: 2092 case r.TABULATION: 2093 case r.FORM_FEED: 2094 break; 2095 case r.SOLIDUS: { 2096 this.state = i.SELF_CLOSING_START_TAG; 2097 break; 2098 } 2099 case r.EQUALS_SIGN: { 2100 this.state = i.BEFORE_ATTRIBUTE_VALUE; 2101 break; 2102 } 2103 case r.GREATER_THAN_SIGN: { 2104 this.state = i.DATA, this.emitCurrentTagToken(); 2105 break; 2106 } 2107 case r.EOF: { 2108 this._err(f.eofInTag), this._emitEOFToken(); 2109 break; 2110 } 2111 default: 2112 this._createAttr(""), this.state = i.ATTRIBUTE_NAME, this._stateAttributeName(t); 2113 } 2114 } 2115 // Before attribute value state 2116 //------------------------------------------------------------------ 2117 _stateBeforeAttributeValue(t) { 2118 switch (t) { 2119 case r.SPACE: 2120 case r.LINE_FEED: 2121 case r.TABULATION: 2122 case r.FORM_FEED: 2123 break; 2124 case r.QUOTATION_MARK: { 2125 this.state = i.ATTRIBUTE_VALUE_DOUBLE_QUOTED; 2126 break; 2127 } 2128 case r.APOSTROPHE: { 2129 this.state = i.ATTRIBUTE_VALUE_SINGLE_QUOTED; 2130 break; 2131 } 2132 case r.GREATER_THAN_SIGN: { 2133 this._err(f.missingAttributeValue), this.state = i.DATA, this.emitCurrentTagToken(); 2134 break; 2135 } 2136 default: 2137 this.state = i.ATTRIBUTE_VALUE_UNQUOTED, this._stateAttributeValueUnquoted(t); 2138 } 2139 } 2140 // Attribute value (double-quoted) state 2141 //------------------------------------------------------------------ 2142 _stateAttributeValueDoubleQuoted(t) { 2143 switch (t) { 2144 case r.QUOTATION_MARK: { 2145 this.state = i.AFTER_ATTRIBUTE_VALUE_QUOTED; 2146 break; 2147 } 2148 case r.AMPERSAND: { 2149 this._startCharacterReference(); 2150 break; 2151 } 2152 case r.NULL: { 2153 this._err(f.unexpectedNullCharacter), this.currentAttr.value += N; 2154 break; 2155 } 2156 case r.EOF: { 2157 this._err(f.eofInTag), this._emitEOFToken(); 2158 break; 2159 } 2160 default: 2161 this.currentAttr.value += String.fromCodePoint(t); 2162 } 2163 } 2164 // Attribute value (single-quoted) state 2165 //------------------------------------------------------------------ 2166 _stateAttributeValueSingleQuoted(t) { 2167 switch (t) { 2168 case r.APOSTROPHE: { 2169 this.state = i.AFTER_ATTRIBUTE_VALUE_QUOTED; 2170 break; 2171 } 2172 case r.AMPERSAND: { 2173 this._startCharacterReference(); 2174 break; 2175 } 2176 case r.NULL: { 2177 this._err(f.unexpectedNullCharacter), this.currentAttr.value += N; 2178 break; 2179 } 2180 case r.EOF: { 2181 this._err(f.eofInTag), this._emitEOFToken(); 2182 break; 2183 } 2184 default: 2185 this.currentAttr.value += String.fromCodePoint(t); 2186 } 2187 } 2188 // Attribute value (unquoted) state 2189 //------------------------------------------------------------------ 2190 _stateAttributeValueUnquoted(t) { 2191 switch (t) { 2192 case r.SPACE: 2193 case r.LINE_FEED: 2194 case r.TABULATION: 2195 case r.FORM_FEED: { 2196 this._leaveAttrValue(), this.state = i.BEFORE_ATTRIBUTE_NAME; 2197 break; 2198 } 2199 case r.AMPERSAND: { 2200 this._startCharacterReference(); 2201 break; 2202 } 2203 case r.GREATER_THAN_SIGN: { 2204 this._leaveAttrValue(), this.state = i.DATA, this.emitCurrentTagToken(); 2205 break; 2206 } 2207 case r.NULL: { 2208 this._err(f.unexpectedNullCharacter), this.currentAttr.value += N; 2209 break; 2210 } 2211 case r.QUOTATION_MARK: 2212 case r.APOSTROPHE: 2213 case r.LESS_THAN_SIGN: 2214 case r.EQUALS_SIGN: 2215 case r.GRAVE_ACCENT: { 2216 this._err(f.unexpectedCharacterInUnquotedAttributeValue), this.currentAttr.value += String.fromCodePoint(t); 2217 break; 2218 } 2219 case r.EOF: { 2220 this._err(f.eofInTag), this._emitEOFToken(); 2221 break; 2222 } 2223 default: 2224 this.currentAttr.value += String.fromCodePoint(t); 2225 } 2226 } 2227 // After attribute value (quoted) state 2228 //------------------------------------------------------------------ 2229 _stateAfterAttributeValueQuoted(t) { 2230 switch (t) { 2231 case r.SPACE: 2232 case r.LINE_FEED: 2233 case r.TABULATION: 2234 case r.FORM_FEED: { 2235 this._leaveAttrValue(), this.state = i.BEFORE_ATTRIBUTE_NAME; 2236 break; 2237 } 2238 case r.SOLIDUS: { 2239 this._leaveAttrValue(), this.state = i.SELF_CLOSING_START_TAG; 2240 break; 2241 } 2242 case r.GREATER_THAN_SIGN: { 2243 this._leaveAttrValue(), this.state = i.DATA, this.emitCurrentTagToken(); 2244 break; 2245 } 2246 case r.EOF: { 2247 this._err(f.eofInTag), this._emitEOFToken(); 2248 break; 2249 } 2250 default: 2251 this._err(f.missingWhitespaceBetweenAttributes), this.state = i.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(t); 2252 } 2253 } 2254 // Self-closing start tag state 2255 //------------------------------------------------------------------ 2256 _stateSelfClosingStartTag(t) { 2257 switch (t) { 2258 case r.GREATER_THAN_SIGN: { 2259 const u = this.currentToken; 2260 u.selfClosing = !0, this.state = i.DATA, this.emitCurrentTagToken(); 2261 break; 2262 } 2263 case r.EOF: { 2264 this._err(f.eofInTag), this._emitEOFToken(); 2265 break; 2266 } 2267 default: 2268 this._err(f.unexpectedSolidusInTag), this.state = i.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(t); 2269 } 2270 } 2271 // Bogus comment state 2272 //------------------------------------------------------------------ 2273 _stateBogusComment(t) { 2274 const u = this.currentToken; 2275 switch (t) { 2276 case r.GREATER_THAN_SIGN: { 2277 this.state = i.DATA, this.emitCurrentComment(u); 2278 break; 2279 } 2280 case r.EOF: { 2281 this.emitCurrentComment(u), this._emitEOFToken(); 2282 break; 2283 } 2284 case r.NULL: { 2285 this._err(f.unexpectedNullCharacter), u.data += N; 2286 break; 2287 } 2288 default: 2289 u.data += String.fromCodePoint(t); 2290 } 2291 } 2292 // Markup declaration open state 2293 //------------------------------------------------------------------ 2294 _stateMarkupDeclarationOpen(t) { 2295 this._consumeSequenceIfMatch(D.DASH_DASH, !0) ? (this._createCommentToken(D.DASH_DASH.length + 1), this.state = i.COMMENT_START) : this._consumeSequenceIfMatch(D.DOCTYPE, !1) ? (this.currentLocation = this.getCurrentLocation(D.DOCTYPE.length + 1), this.state = i.DOCTYPE) : this._consumeSequenceIfMatch(D.CDATA_START, !0) ? this.inForeignNode ? this.state = i.CDATA_SECTION : (this._err(f.cdataInHtmlContent), this._createCommentToken(D.CDATA_START.length + 1), this.currentToken.data = "[CDATA[", this.state = i.BOGUS_COMMENT) : this._ensureHibernation() || (this._err(f.incorrectlyOpenedComment), this._createCommentToken(2), this.state = i.BOGUS_COMMENT, this._stateBogusComment(t)); 2296 } 2297 // Comment start state 2298 //------------------------------------------------------------------ 2299 _stateCommentStart(t) { 2300 switch (t) { 2301 case r.HYPHEN_MINUS: { 2302 this.state = i.COMMENT_START_DASH; 2303 break; 2304 } 2305 case r.GREATER_THAN_SIGN: { 2306 this._err(f.abruptClosingOfEmptyComment), this.state = i.DATA; 2307 const u = this.currentToken; 2308 this.emitCurrentComment(u); 2309 break; 2310 } 2311 default: 2312 this.state = i.COMMENT, this._stateComment(t); 2313 } 2314 } 2315 // Comment start dash state 2316 //------------------------------------------------------------------ 2317 _stateCommentStartDash(t) { 2318 const u = this.currentToken; 2319 switch (t) { 2320 case r.HYPHEN_MINUS: { 2321 this.state = i.COMMENT_END; 2322 break; 2323 } 2324 case r.GREATER_THAN_SIGN: { 2325 this._err(f.abruptClosingOfEmptyComment), this.state = i.DATA, this.emitCurrentComment(u); 2326 break; 2327 } 2328 case r.EOF: { 2329 this._err(f.eofInComment), this.emitCurrentComment(u), this._emitEOFToken(); 2330 break; 2331 } 2332 default: 2333 u.data += "-", this.state = i.COMMENT, this._stateComment(t); 2334 } 2335 } 2336 // Comment state 2337 //------------------------------------------------------------------ 2338 _stateComment(t) { 2339 const u = this.currentToken; 2340 switch (t) { 2341 case r.HYPHEN_MINUS: { 2342 this.state = i.COMMENT_END_DASH; 2343 break; 2344 } 2345 case r.LESS_THAN_SIGN: { 2346 u.data += "<", this.state = i.COMMENT_LESS_THAN_SIGN; 2347 break; 2348 } 2349 case r.NULL: { 2350 this._err(f.unexpectedNullCharacter), u.data += N; 2351 break; 2352 } 2353 case r.EOF: { 2354 this._err(f.eofInComment), this.emitCurrentComment(u), this._emitEOFToken(); 2355 break; 2356 } 2357 default: 2358 u.data += String.fromCodePoint(t); 2359 } 2360 } 2361 // Comment less-than sign state 2362 //------------------------------------------------------------------ 2363 _stateCommentLessThanSign(t) { 2364 const u = this.currentToken; 2365 switch (t) { 2366 case r.EXCLAMATION_MARK: { 2367 u.data += "!", this.state = i.COMMENT_LESS_THAN_SIGN_BANG; 2368 break; 2369 } 2370 case r.LESS_THAN_SIGN: { 2371 u.data += "<"; 2372 break; 2373 } 2374 default: 2375 this.state = i.COMMENT, this._stateComment(t); 2376 } 2377 } 2378 // Comment less-than sign bang state 2379 //------------------------------------------------------------------ 2380 _stateCommentLessThanSignBang(t) { 2381 t === r.HYPHEN_MINUS ? this.state = i.COMMENT_LESS_THAN_SIGN_BANG_DASH : (this.state = i.COMMENT, this._stateComment(t)); 2382 } 2383 // Comment less-than sign bang dash state 2384 //------------------------------------------------------------------ 2385 _stateCommentLessThanSignBangDash(t) { 2386 t === r.HYPHEN_MINUS ? this.state = i.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH : (this.state = i.COMMENT_END_DASH, this._stateCommentEndDash(t)); 2387 } 2388 // Comment less-than sign bang dash dash state 2389 //------------------------------------------------------------------ 2390 _stateCommentLessThanSignBangDashDash(t) { 2391 t !== r.GREATER_THAN_SIGN && t !== r.EOF && this._err(f.nestedComment), this.state = i.COMMENT_END, this._stateCommentEnd(t); 2392 } 2393 // Comment end dash state 2394 //--------
2394---------------------------------------------------------- 2395 _stateCommentEndDash(t) { 2396 const u = this.currentToken; 2397 switch (t) { 2398 case r.HYPHEN_MINUS: { 2399 this.state = i.COMMENT_END; 2400 break; 2401 } 2402 case r.EOF: { 2403 this._err(f.eofInComment), this.emitCurrentComment(u), this._emitEOFToken(); 2404 break; 2405 } 2406 default: 2407 u.data += "-", this.state = i.COMMENT, this._stateComment(t); 2408 } 2409 } 2410 // Comment end state 2411 //------------------------------------------------------------------ 2412 _stateCommentEnd(t) { 2413 const u = this.currentToken; 2414 switch (t) { 2415 case r.GREATER_THAN_SIGN: { 2416 this.state = i.DATA, this.emitCurrentComment(u); 2417 break; 2418 } 2419 case r.EXCLAMATION_MARK: { 2420 this.state = i.COMMENT_END_BANG; 2421 break; 2422 } 2423 case r.HYPHEN_MINUS: { 2424 u.data += "-"; 2425 break; 2426 } 2427 case r.EOF: { 2428 this._err(f.eofInComment), this.emitCurrentComment(u), this._emitEOFToken(); 2429 break; 2430 } 2431 default: 2432 u.data += "--", this.state = i.COMMENT, this._stateComment(t); 2433 } 2434 } 2435 // Comment end bang state 2436 //------------------------------------------------------------------ 2437 _stateCommentEndBang(t) { 2438 const u = this.currentToken; 2439 switch (t) { 2440 case r.HYPHEN_MINUS: { 2441 u.data += "--!", this.state = i.COMMENT_END_DASH; 2442 break; 2443 } 2444 case r.GREATER_THAN_SIGN: { 2445 this._err(f.incorrectlyClosedComment), this.state = i.DATA, this.emitCurrentComment(u); 2446 break; 2447 } 2448 case r.EOF: { 2449 this._err(f.eofInComment), this.emitCurrentComment(u), this._emitEOFToken(); 2450 break; 2451 } 2452 default: 2453 u.data += "--!", this.state = i.COMMENT, this._stateComment(t); 2454 } 2455 } 2456 // DOCTYPE state 2457 //------------------------------------------------------------------ 2458 _stateDoctype(t) { 2459 switch (t) { 2460 case r.SPACE: 2461 case r.LINE_FEED: 2462 case r.TABULATION: 2463 case r.FORM_FEED: { 2464 this.state = i.BEFORE_DOCTYPE_NAME; 2465 break; 2466 } 2467 case r.GREATER_THAN_SIGN: { 2468 this.state = i.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(t); 2469 break; 2470 } 2471 case r.EOF: { 2472 this._err(f.eofInDoctype), this._createDoctypeToken(null); 2473 const u = this.currentToken; 2474 u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2475 break; 2476 } 2477 default: 2478 this._err(f.missingWhitespaceBeforeDoctypeName), this.state = i.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(t); 2479 } 2480 } 2481 // Before DOCTYPE name state 2482 //------------------------------------------------------------------ 2483 _stateBeforeDoctypeName(t) { 2484 if (j(t)) 2485 this._createDoctypeToken(String.fromCharCode(se(t))), this.state = i.DOCTYPE_NAME; 2486 else 2487 switch (t) { 2488 case r.SPACE: 2489 case r.LINE_FEED: 2490 case r.TABULATION: 2491 case r.FORM_FEED: 2492 break; 2493 case r.NULL: { 2494 this._err(f.unexpectedNullCharacter), this._createDoctypeToken(N), this.state = i.DOCTYPE_NAME; 2495 break; 2496 } 2497 case r.GREATER_THAN_SIGN: { 2498 this._err(f.missingDoctypeName), this._createDoctypeToken(null); 2499 const u = this.currentToken; 2500 u.forceQuirks = !0, this.emitCurrentDoctype(u), this.state = i.DATA; 2501 break; 2502 } 2503 case r.EOF: { 2504 this._err(f.eofInDoctype), this._createDoctypeToken(null); 2505 const u = this.currentToken; 2506 u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2507 break; 2508 } 2509 default: 2510 this._createDoctypeToken(String.fromCodePoint(t)), this.state = i.DOCTYPE_NAME; 2511 } 2512 } 2513 // DOCTYPE name state 2514 //------------------------------------------------------------------ 2515 _stateDoctypeName(t) { 2516 const u = this.currentToken; 2517 switch (t) { 2518 case r.SPACE: 2519 case r.LINE_FEED: 2520 case r.TABULATION: 2521 case r.FORM_FEED: { 2522 this.state = i.AFTER_DOCTYPE_NAME; 2523 break; 2524 } 2525 case r.GREATER_THAN_SIGN: { 2526 this.state = i.DATA, this.emitCurrentDoctype(u); 2527 break; 2528 } 2529 case r.NULL: { 2530 this._err(f.unexpectedNullCharacter), u.name += N; 2531 break; 2532 } 2533 case r.EOF: { 2534 this._err(f.eofInDoctype), u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2535 break; 2536 } 2537 default: 2538 u.name += String.fromCodePoint(j(t) ? se(t) : t); 2539 } 2540 } 2541 // After DOCTYPE name state 2542 //------------------------------------------------------------------ 2543 _stateAfterDoctypeName(t) { 2544 const u = this.currentToken; 2545 switch (t) { 2546 case r.SPACE: 2547 case r.LINE_FEED: 2548 case r.TABULATION: 2549 case r.FORM_FEED: 2550 break; 2551 case r.GREATER_THAN_SIGN: { 2552 this.state = i.DATA, this.emitCurrentDoctype(u); 2553 break; 2554 } 2555 case r.EOF: { 2556 this._err(f.eofInDoctype), u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2557 break; 2558 } 2559 default: 2560 this._consumeSequenceIfMatch(D.PUBLIC, !1) ? this.state = i.AFTER_DOCTYPE_PUBLIC_KEYWORD : this._consumeSequenceIfMatch(D.SYSTEM, !1) ? this.state = i.AFTER_DOCTYPE_SYSTEM_KEYWORD : this._ensureHibernation() || (this._err(f.invali
2560dCharacterSequenceAfterDoctypeName), u.forceQuirks = !0, this.state = i.BOGUS_DOCTYPE, this._stateBogusDoctype(t)); 2561 } 2562 } 2563 // After DOCTYPE public keyword state 2564 //------------------------------------------------------------------ 2565 _stateAfterDoctypePublicKeyword(t) { 2566 const u = this.currentToken; 2567 switch (t) { 2568 case r.SPACE: 2569 case r.LINE_FEED: 2570 case r.TABULATION: 2571 case r.FORM_FEED: { 2572 this.state = i.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER; 2573 break; 2574 } 2575 case r.QUOTATION_MARK: { 2576 this._err(f.missingWhitespaceAfterDoctypePublicKeyword), u.publicId = "", this.state = i.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED; 2577 break; 2578 } 2579 case r.APOSTROPHE: { 2580 this._err(f.missingWhitespaceAfterDoctypePublicKeyword), u.publicId = "", this.state = i.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED; 2581 break; 2582 } 2583 case r.GREATER_THAN_SIGN: { 2584 this._err(f.missingDoctypePublicIdentifier), u.forceQuirks = !0, this.state = i.DATA, this.emitCurrentDoctype(u); 2585 break; 2586 } 2587 case r.EOF: { 2588 this._err(f.eofInDoctype), u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2589 break; 2590 } 2591 default: 2592 this._err(f.missingQuoteBeforeDoctypePublicIdentifier), u.forceQuirks = !0, this.state = i.BOGUS_DOCTYPE, this._stateBogusDoctype(t); 2593 } 2594 } 2595 // Before DOCTYPE public identifier state 2596 //------------------------------------------------------------------ 2597 _stateBeforeDoctypePublicIdentifier(t) { 2598 const u = this.currentToken; 2599 switch (t) { 2600 case r.SPACE: 2601 case r.LINE_FEED: 2602 case r.TABULATION: 2603 case r.FORM_FEED: 2604 break; 2605 case r.QUOTATION_MARK: { 2606 u.publicId = "", this.state = i.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED; 2607 break; 2608 } 2609 case r.APOSTROPHE: { 2610 u.publicId = "", this.state = i.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED; 2611 break; 2612 } 2613 case r.GREATER_THAN_SIGN: { 2614 this._err(f.missingDoctypePublicIdentifier), u.forceQuirks = !0, this.state = i.DATA, this.emitCurrentDoctype(u); 2615 break; 2616 } 2617 case r.EOF: { 2618 this._err(f.eofInDoctype), u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2619 break; 2620 } 2621 default: 2622 this._err(f.missingQuoteBeforeDoctypePublicIdentifier), u.forceQuirks = !0, this.state = i.BOGUS_DOCTYPE, this._stateBogusDoctype(t); 2623 } 2624 } 2625 // DOCTYPE public identifier (double-quoted) state 2626 //------------------------------------------------------------------ 2627 _stateDoctypePublicIdentifierDoubleQuoted(t) { 2628 const u = this.currentToken; 2629 switch (t) { 2630 case r.QUOTATION_MARK: { 2631 this.state = i.AFTER_DOCTYPE_PUBLIC_IDENTIFIER; 2632 break; 2633 } 2634 case r.NULL: { 2635 this._err(f.unexpectedNullCharacter), u.publicId += N; 2636 break; 2637 } 2638 case r.GREATER_THAN_SIGN: { 2639 this._err(f.abruptDoctypePublicIdentifier), u.forceQuirks = !0, this.emitCurrentDoctype(u), this.state = i.DATA; 2640 break; 2641 } 2642 case r.EOF: { 2643 this._err(f.eofInDoctype), u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2644 break; 2645 } 2646 default: 2647 u.publicId += String.fromCodePoint(t); 2648 } 2649 } 2650 // DOCTYPE public identifier (single-quoted) state 2651 //------------------------------------------------------------------ 2652 _stateDoctypePublicIdentifierSingleQuoted(t) { 2653 const u = this.currentToken; 2654 switch (t) { 2655 case r.APOSTROPHE: { 2656 this.state = i.AFTER_DOCTYPE_PUBLIC_IDENTIFIER; 2657 break; 2658 } 2659 case r.NULL: { 2660 this._err(f.unexpectedNullCharacter), u.publicId += N; 2661 break; 2662 } 2663 case r.GREATER_THAN_SIGN: { 2664 this._err(f.abruptDoctypePublicIdentifier), u.forceQuirks = !0, this.emitCurrentDoctype(u), this.state = i.DATA; 2665 break; 2666 } 2667 case r.EOF: { 2668 this._err(f.eofInDoctype), u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2669 break; 2670 } 2671 default: 2672 u.publicId += String.fromCodePoint(t); 2673 } 2674 } 2675 // After DOCTYPE public identifier state 2676 //------------------------------------------------------------------ 2677 _stateAfterDoctypePublicIdentifier(t) { 2678 const u = this.currentToken; 2679 switch (t) { 2680 case r.SPACE: 2681 case r.LINE_FEED: 2682 case r.TABULATION: 2683 case r.FORM_FEED: { 2684 this.state = i.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS; 2685 break; 2686 } 2687 case r.GREATER_THAN_SIGN: { 2688 this.state = i.DATA, this.emitCurrentDoctype(u); 2689 break; 2690 } 2691 case r.QUOTATION_MARK: { 2692 this._err(f.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), u.systemId = "", this.state = i.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED; 2693 break; 2694 } 2695 case r.APOSTROPHE: { 2696 this._err(f.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), u.systemId = "", this.state = i.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED; 2697 break; 2698 } 2699 case r.EOF: { 2700 this._err(f.eofInDoctype), u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2701 break; 2702 } 2703 default:
2704 this._err(f.missingQuoteBeforeDoctypeSystemIdentifier), u.forceQuirks = !0, this.state = i.BOGUS_DOCTYPE, this._stateBogusDoctype(t); 2705 } 2706 } 2707 // Between DOCTYPE public and system identifiers state 2708 //------------------------------------------------------------------ 2709 _stateBetweenDoctypePublicAndSystemIdentifiers(t) { 2710 const u = this.currentToken; 2711 switch (t) { 2712 case r.SPACE: 2713 case r.LINE_FEED: 2714 case r.TABULATION: 2715 case r.FORM_FEED: 2716 break; 2717 case r.GREATER_THAN_SIGN: { 2718 this.emitCurrentDoctype(u), this.state = i.DATA; 2719 break; 2720 } 2721 case r.QUOTATION_MARK: { 2722 u.systemId = "", this.state = i.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED; 2723 break; 2724 } 2725 case r.APOSTROPHE: { 2726 u.systemId = "", this.state = i.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED; 2727 break; 2728 } 2729 case r.EOF: { 2730 this._err(f.eofInDoctype), u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2731 break; 2732 } 2733 default: 2734 this._err(f.missingQuoteBeforeDoctypeSystemIdentifier), u.forceQuirks = !0, this.state = i.BOGUS_DOCTYPE, this._stateBogusDoctype(t); 2735 } 2736 } 2737 // After DOCTYPE system keyword state 2738 //------------------------------------------------------------------ 2739 _stateAfterDoctypeSystemKeyword(t) { 2740 const u = this.currentToken; 2741 switch (t) { 2742 case r.SPACE: 2743 case r.LINE_FEED: 2744 case r.TABULATION: 2745 case r.FORM_FEED: { 2746 this.state = i.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER; 2747 break; 2748 } 2749 case r.QUOTATION_MARK: { 2750 this._err(f.missingWhitespaceAfterDoctypeSystemKeyword), u.systemId = "", this.state = i.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED; 2751 break; 2752 } 2753 case r.APOSTROPHE: { 2754 this._err(f.missingWhitespaceAfterDoctypeSystemKeyword), u.systemId = "", this.state = i.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED; 2755 break; 2756 } 2757 case r.GREATER_THAN_SIGN: { 2758 this._err(f.missingDoctypeSystemIdentifier), u.forceQuirks = !0, this.state = i.DATA, this.emitCurrentDoctype(u); 2759 break; 2760 } 2761 case r.EOF: { 2762 this._err(f.eofInDoctype), u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2763 break; 2764 } 2765 default: 2766 this._err(f.missingQuoteBeforeDoctypeSystemIdentifier), u.forceQuirks = !0, this.state = i.BOGUS_DOCTYPE, this._stateBogusDoctype(t); 2767 } 2768 } 2769 // Before DOCTYPE system identifier state 2770 //------------------------------------------------------------------ 2771 _stateBeforeDoctypeSystemIdentifier(t) { 2772 const u = this.currentToken; 2773 switch (t) { 2774 case r.SPACE: 2775 case r.LINE_FEED: 2776 case r.TABULATION: 2777 case r.FORM_FEED: 2778 break; 2779 case r.QUOTATION_MARK: { 2780 u.systemId = "", this.state = i.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED; 2781 break; 2782 } 2783 case r.APOSTROPHE: { 2784 u.systemId = "", this.state = i.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED; 2785 break; 2786 } 2787 case r.GREATER_THAN_SIGN: { 2788 this._err(f.missingDoctypeSystemIdentifier), u.forceQuirks = !0, this.state = i.DATA, this.emitCurrentDoctype(u); 2789 break; 2790 } 2791 case r.EOF: { 2792 this._err(f.eofInDoctype), u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2793 break; 2794 } 2795 default: 2796 this._err(f.missingQuoteBeforeDoctypeSystemIdentifier), u.forceQuirks = !0, this.state = i.BOGUS_DOCTYPE, this._stateBogusDoctype(t); 2797 } 2798 } 2799 // DOCTYPE system identifier (double-quoted) state 2800 //------------------------------------------------------------------ 2801 _stateDoctypeSystemIdentifierDoubleQuoted(t) { 2802 const u = this.currentToken; 2803 switch (t) { 2804 case r.QUOTATION_MARK: { 2805 this.state = i.AFTER_DOCTYPE_SYSTEM_IDENTIFIER; 2806 break; 2807 } 2808 case r.NULL: { 2809 this._err(f.unexpectedNullCharacter), u.systemId += N; 2810 break; 2811 } 2812 case r.GREATER_THAN_SIGN: { 2813 this._err(f.abruptDoctypeSystemIdentifier), u.forceQuirks = !0, this.emitCurrentDoctype(u), this.state = i.DATA; 2814 break; 2815 } 2816 case r.EOF: { 2817 this._err(f.eofInDoctype), u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2818 break; 2819 } 2820 default: 2821 u.systemId += String.fromCodePoint(t); 2822 } 2823 } 2824 // DOCTYPE system identifier (single-quoted) state 2825 //------------------------------------------------------------------
2826 _stateDoctypeSystemIdentifierSingleQuoted(t) { 2827 const u = this.currentToken; 2828 switch (t) { 2829 case r.APOSTROPHE: { 2830 this.state = i.AFTER_DOCTYPE_SYSTEM_IDENTIFIER; 2831 break; 2832 } 2833 case r.NULL: { 2834 this._err(f.unexpectedNullCharacter), u.systemId += N; 2835 break; 2836 } 2837 case r.GREATER_THAN_SIGN: { 2838 this._err(f.abruptDoctypeSystemIdentifier), u.forceQuirks = !0, this.emitCurrentDoctype(u), this.state = i.DATA; 2839 break; 2840 } 2841 case r.EOF: { 2842 this._err(f.eofInDoctype), u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2843 break; 2844 } 2845 default: 2846 u.systemId += String.fromCodePoint(t); 2847 } 2848 } 2849 // After DOCTYPE system identifier state 2850 //------------------------------------------------------------------ 2851 _stateAfterDoctypeSystemIdentifier(t) { 2852 const u = this.currentToken; 2853 switch (t) { 2854 case r.SPACE: 2855 case r.LINE_FEED: 2856 case r.TABULATION: 2857 case r.FORM_FEED: 2858 break; 2859 case r.GREATER_THAN_SIGN: { 2860 this.emitCurrentDoctype(u), this.state = i.DATA; 2861 break; 2862 } 2863 case r.EOF: { 2864 this._err(f.eofInDoctype), u.forceQuirks = !0, this.emitCurrentDoctype(u), this._emitEOFToken(); 2865 break; 2866 } 2867 default: 2868 this._err(f.unexpectedCharacterAfterDoctypeSystemIdentifier), this.state = i.BOGUS_DOCTYPE, this._stateBogusDoctype(t); 2869 } 2870 } 2871 // Bogus DOCTYPE state 2872 //------------------------------------------------------------------ 2873 _stateBogusDoctype(t) { 2874 const u = this.currentToken; 2875 switch (t) { 2876 case r.GREATER_THAN_SIGN: { 2877 this.emitCurrentDoctype(u), this.state = i.DATA; 2878 break; 2879 } 2880 case r.NULL: { 2881 this._err(f.unexpectedNullCharacter); 2882 break; 2883 } 2884 case r.EOF: { 2885 this.emitCurrentDoctype(u), this._emitEOFToken(); 2886 break; 2887 } 2888 } 2889 } 2890 // CDATA section state 2891 //------------------------------------------------------------------ 2892 _stateCdataSection(t) { 2893 switch (t) { 2894 case r.RIGHT_SQUARE_BRACKET: { 2895 this.state = i.CDATA_SECTION_BRACKET; 2896 break; 2897 } 2898 case r.EOF: { 2899 this._err(f.eofInCdata), this._emitEOFToken(); 2900 break; 2901 } 2902 default: 2903 this._emitCodePoint(t); 2904 } 2905 } 2906 // CDATA section bracket state 2907 //------------------------------------------------------------------ 2908 _stateCdataSectionBracket(t) { 2909 t === r.RIGHT_SQUARE_BRACKET ? this.state = i.CDATA_SECTION_END : (this._emitChars("]"), this.state = i.CDATA_SECTION, this._stateCdataSection(t)); 2910 } 2911 // CDATA section end state 2912 //------------------------------------------------------------------ 2913 _stateCdataSectionEnd(t) { 2914 switch (t) { 2915 case r.GREATER_THAN_SIGN: { 2916 this.state = i.DATA; 2917 break; 2918 } 2919 case r.RIGHT_SQUARE_BRACKET: { 2920 this._emitChars("]"); 2921 break; 2922 } 2923 default: 2924 this._emitChars("]]"), this.state = i.CDATA_SECTION, this._stateCdataSection(t); 2925 } 2926 } 2927 // Character reference state 2928 //------------------------------------------------------------------ 2929 _stateCharacterReference() { 2930 let t = this.entityDecoder.write(this.preprocessor.html, this.preprocessor.pos); 2931 if (t < 0) 2932 if (this.preprocessor.lastChunkWritten) 2933 t = this.entityDecoder.end(); 2934 else { 2935 this.active = !1, this.preprocessor.pos = this.preprocessor.html.length - 1, this.consumedAfterSnapshot = 0, this.preprocessor.endOfChunkHit = !0; 2936 return; 2937 } 2938 t === 0 ? (this.preprocessor.pos = this.entityStartPos, this._flushCodePointConsumedAsCharacterReference(r.AMPERSAND), this.state = !this._isCharacterReferenceInAttribute() && Je(this.preprocessor.peek(1)) ? i.AMBIGUOUS_AMPERSAND : this.returnState) : this.state = this.returnState; 2939 } 2940 // Ambiguos ampersand state 2941 //------------------------------------------------------------------ 2942 _stateAmbiguousAmpersand(t) { 2943 Je(t) ? this._flushCodePointConsumedAsCharacterReference(t) : (t === r.SEMICOLON && this._err(f.unknownNamedCharacterReference), this.state = this.returnState, this._callState(t)); 2944 } 2945} 2946const gt = /* @__PURE__ */ new Set([a.DD, a.DT, a.LI, a.OPTGROUP, a.OPTION, a.P, a.RB, a.RP, a.RT, a.RTC]), $e = /* @__PURE__ */ new Set([ 2947 ...gt, 2948 a.CAPTION, 2949 a.COLGROUP, 2950 a.TBODY, 2951 a.TD, 2952 a.TFOOT, 2953 a.TH, 2954 a.THEAD, 2955 a.TR 2956]), ce = /* @__PURE__ */ new Set([ 2957 a.APPLET, 2958 a.CAPTION, 2959 a.HTML, 2960 a.MARQUEE, 2961 a.OBJECT, 2962 a.TABLE, 2963 a.TD, 2964 a.TEMPLATE, 2965 a.TH 2966]), Mu = /* @__PURE__ */ new Set([...ce, a.OL, a.UL]), Bu = /* @__PURE__ */ new Set([...ce, a.BUTTON]), et = /* @__PURE__ */ new Set([a.ANNOTATION_XML, a.MI, a.MN, a.MO, a.MS, a.MTEXT]), tt = /* @__PURE__ */ new Set([a.DESC, a.FOREIGN_OBJECT, a.TITLE]), yu = /* @__PURE__ */ new Set([a.TR, a.TEMPLATE, a.HTML]), Uu = /* @__PURE__ */ new Set([a.TBODY, a.TFOOT, a.THEAD, a.TEMPLATE, a.HTML]), ku = /* @__PURE__ */ new Set([a.TABLE, a.TEMPLATE, a.HTML]), Hu = /* @__PURE__ */ new Set([a.TD, a.TH]); 2967class Fu { 2968 get currentTmplContentOrNode() { 2969 return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current; 2970 } 2971 constructor(t, u, s) { 2972 this.treeAdapter = u, this.handler = s, this.items = [], this.tagIDs = [], this.stackTop = -1, this.tmplCount = 0, this.currentTagId = a.UNKNOWN, this.current = t; 2973 } 2974 //Index of element 2975 _indexOf(t) { 2976 return this.items.lastIndexOf(t, this.stackTop); 2977 } 2978 //Update current element 2979 _isInTemplate() { 2980 return this.currentTagId === a.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === h.HTML; 2981 } 2982 _updateCurrentElement() { 2983 this.current = this.items[this.stackTop], this.currentTagId = this.tagIDs[this.stackTop]; 2984 } 2985 //Mutations 2986 push(t, u) { 2987 this.stackTop++, this.items[this.stackTop] = t, this.current = t, this.tagIDs[this.stackTop] = u, this.currentTagId = u, this._isInTemplate() && this.tmplCount++, this.handler.onItemPush(t, u, !0); 2988 } 2989 pop() { 2990 const t = this.current; 2991 this.tmplCount > 0 && this._isInTemplate() && this.tmplCount--, this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(t, !0); 2992 } 2993 replace(t, u) { 2994 const s = this._indexOf(t); 2995 this.items[s] = u, s === this.stackTop && (this.current = u); 2996 } 2997 insertAfter(t, u, s) { 2998 const n = this._indexOf(t) + 1; 2999 this.items.splice(n, 0, u), this.tagIDs.splice(n, 0, s), this.stackTop++, n === this.stackTop && this._updateCurrentElement(), this.current && this.currentTagId !== void 0 && this.handler.onItemPush(this.current, this.currentTagId, n === this.stackTop); 3000 } 3001 popUntilTagNamePopped(t) { 3002 let u = this.stackTop + 1; 3003 do 3004 u = this.tagIDs.lastIndexOf(t, u - 1); 3005 while (u > 0 && this.treeAdapter.getNamespaceURI(this.items[u]) !== h.HTML);
3006 this.shortenToLength(Math.max(u, 0)); 3007 } 3008 shortenToLength(t) { 3009 for (; this.stackTop >= t; ) { 3010 const u = this.current; 3011 this.tmplCount > 0 && this._isInTemplate() && (this.tmplCount -= 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(u, this.stackTop < t); 3012 } 3013 } 3014 popUntilElementPopped(t) { 3015 const u = this._indexOf(t); 3016 this.shortenToLength(Math.max(u, 0)); 3017 } 3018 popUntilPopped(t, u) { 3019 const s = this._indexOfTagNames(t, u); 3020 this.shortenToLength(Math.max(s, 0)); 3021 } 3022 popUntilNumberedHeaderPopped() { 3023 this.popUntilPopped(Re, h.HTML); 3024 } 3025 popUntilTableCellPopped() { 3026 this.popUntilPopped(Hu, h.HTML); 3027 } 3028 popAllUpToHtmlElement() { 3029 this.tmplCount = 0, this.shortenToLength(1); 3030 } 3031 _indexOfTagNames(t, u) { 3032 for (let s = this.stackTop; s >= 0; s--) 3033 if (t.has(this.tagIDs[s]) && this.treeAdapter.getNamespaceURI(this.items[s]) === u) 3034 return s; 3035 return -1; 3036 } 3037 clearBackTo(t, u) { 3038 const s = this._indexOfTagNames(t, u); 3039 this.shortenToLength(s + 1); 3040 } 3041 clearBackToTableContext() { 3042 this.clearBackTo(ku, h.HTML); 3043 } 3044 clearBackToTableBodyContext() { 3045 this.clearBackTo(Uu, h.HTML); 3046 } 3047 clearBackToTableRowContext() { 3048 this.clearBackTo(yu, h.HTML); 3049 } 3050 remove(t) { 3051 const u = this._indexOf(t); 3052 u >= 0 && (u === this.stackTop ? this.pop() : (this.items.splice(u, 1), this.tagIDs.splice(u, 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(t, !1))); 3053 } 3054 //Search 3055 tryPeekProperlyNestedBodyElement() { 3056 return this.stackTop >= 1 && this.tagIDs[1] === a.BODY ? this.items[1] : null; 3057 } 3058 contains(t) { 3059 return this._indexOf(t) > -1; 3060 } 3061 getCommonAncestor(t) { 3062 const u = this._indexOf(t) - 1; 3063 return u >= 0 ? this.items[u] : null; 3064 } 3065 isRootHtmlElementCurrent() { 3066 return this.stackTop === 0 && this.tagIDs[0] === a.HTML; 3067 } 3068 //Element in scope 3069 hasInDynamicScope(t, u) { 3070 for (let s = this.stackTop; s >= 0; s--) { 3071 const n = this.tagIDs[s]; 3072 switch (this.treeAdapter.getNamespaceURI(this.items[s])) { 3073 case h.HTML: { 3074 if (n === t) 3075 return !0; 3076 if (u.has(n)) 3077 return !1; 3078 break; 3079 } 3080 case h.SVG: { 3081 if (tt.has(n)) 3082 return !1; 3083 break; 3084 } 3085 case h.MATHML: { 3086 if (et.has(n)) 3087 return !1; 3088 break; 3089 } 3090 } 3091 } 3092 return !0; 3093 } 3094 hasInScope(t) { 3095 return this.hasInDynamicScope(t, ce); 3096 } 3097 hasInListItemScope(t) { 3098 return this.hasInDynamicScope(t, Mu); 3099 } 3100 hasInButtonScope(t) { 3101 return this.hasInDynamicScope(t, Bu); 3102 } 3103 hasNumberedHeaderInScope() { 3104 for (let t = this.stackTop; t >= 0; t--) { 3105 const u = this.tagIDs[t]; 3106 switch (this.treeAdapter.getNamespaceURI(this.items[t])) { 3107 case h.HTML: { 3108 if (Re.has(u)) 3109 return !0; 3110 if (ce.has(u)) 3111 return !1; 3112 break; 3113 } 3114 case h.SVG: { 3115 if (tt.has(u)) 3116 return !1; 3117 break; 3118 } 3119 case h.MATHML: { 3120 if (et.has(u)) 3121 return !1; 3122 break; 3123 } 3124 } 3125 } 3126 return !0; 3127 } 3128 hasInTableScope(t) { 3129 for (let u = this.stackTop; u >= 0; u--) 3130 if (this.treeAdapter.getNamespaceURI(this.items[u]) === h.HTML) 3131 switch (this.tagIDs[u]) { 3132 case t: 3133 return !0; 3134 case a.TABLE: 3135 case a.HTML: 3136 return !1; 3137 } 3138 return !0; 3139 } 3140 hasTableBodyContextInTableScope() { 3141 for (let t = this.stackTop; t >= 0; t--) 3142 if (this.treeAdapter.getNamespaceURI(this.items[t]) === h.HTML) 3143 switch (this.tagIDs[t]) { 3144 case a.TBODY: 3145 case a.THEAD: 3146 case a.TFOOT: 3147 return !0; 3148 case a.TABLE: 3149 case a.HTML: 3150 return !1; 3151 } 3152 return !0; 3153 } 3154 hasInSelectScope(t) { 3155 for (let u = this.stackTop; u >= 0; u--) 3156 if (this.treeAdapter.getNamespaceURI(this.items[u]) === h.HTML) 3157 switch (this.tagIDs[u]) { 3158 case t: 3159 return !0; 3160 case a.OPTION: 3161 case a.OPTGROUP: 3162 break; 3163 default: 3164 return !1; 3165 } 3166 return !0; 3167 } 3168 //Implied end tags 3169 generateImpliedEndTags() { 3170 for (; this.currentTagId !== void 0 && gt.has(this.currentTagId); ) 3171 this.pop(); 3172 } 3173 generateImpliedEndTagsThoroughly() { 3174 for (; this.currentTagId !== void 0 && $e.has(this.currentTagId); ) 3175 this.pop(); 3176 } 3177 generateImpliedEndTagsWithExclusion(t) { 3178 for (; this.currentTagId !== void 0 && this.currentTagId !== t && $e.has(this.currentTagId); ) 3179 this.pop(); 3180 } 3181} 3182const me = 3; 3183var H; 3184(function(e) { 3185 e[e.Marker = 0] = "Marker", e[e.Element = 1] = "Element"; 3186})(H || (H = {})); 3187const ut = { type: H.Marker }; 3188class wu { 3189 constructor(t) { 3190 this.treeAdapter = t, this.entries = [], this.bookmark = null; 3191 } 3192 //Noah Ark's condition 3193 //OPTIMIZATION: at first we try to find possible candidates for exclusion using 3194 //lightweight heuristics without thorough attributes check. 3195 _getNoahArkConditionCandidates(t, u) { 3196 const s = [], n = u.length, o = this.treeAdapter.getTagName(t), E = this.treeAdapter.getNamespaceURI(t); 3197 for (let l = 0; l < this.entries.length; l++) { 3198 const T = this.entries[l]; 3199 if (T.type === H.Marker) 3200 break; 3201 const { element: m } = T; 3202 if (this.treeAdapter.getTagName(m) === o && this.treeAdapter.getNamespaceURI(m) === E) { 3203 const _ = this.treeAdapter.getAttrList(m); 3204 _.length === n && s.push({ idx: l, attrs: _ }); 3205 } 3206 } 3207 return s; 3208 } 3209 _ensureNoahArkCondition(t) { 3210 if (this.entries.length < me) 3211 return; 3212 const u = this.treeAdapter.getAttrList(t), s = this._getNoahArkConditionCandidates(t, u); 3213 if (s.length < me) 3214 return; 3215 const n = new Map(u.map((E) => [E.name, E.value])); 3216 let o = 0; 3217 for (let E = 0; E < s.length; E++) { 3218 const l = s[E]; 3219 l.attrs.every((T) => n.get(T.name) === T.value) && (o += 1, o >= me && this.entries.splice(l.idx, 1)); 3220 } 3221 } 3222 //Mutations 3223 insertMarker() { 3224 this.entries.unshift(ut); 3225 } 3226 pushElement(t, u) { 3227 this._ensureNoahArkCondition(t), this.entries.unshift({ 3228 type: H.Element, 3229 element: t, 3230 token: u 3231 }); 3232 } 3233 insertElementAfterBookmark(t, u) { 3234 const s = this.entries.indexOf(this.bookmark); 3235 this.entries.splice(s, 0, { 3236 type: H.Element, 3237 element: t, 3238 token: u 3239 }); 3240 } 3241 removeEntry(t) { 3242 const u = this.entries.indexOf(t); 3243 u !== -1 && this.entries.splice(u, 1); 3244 } 3245 /** 3246 * Clears the list of formatting elements up to the last marker. 3247 * 3248 * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-list-of-active-formatting-elements-up-to-the-last-marker 3249 */ 3250 clearToLastMarker() { 3251 const t = this.entries.indexOf(ut); 3252 t === -1 ? this.entries.length = 0 : this.entries.splice(0, t + 1); 3253 } 3254 //Search 3255 getElementEntryInScopeWithTagName(t) { 3256 const u = this.entries.find((s) => s.type === H.Marker || this.treeAdapter.getTagName(s.element) === t); 3257 return u && u.type === H.Element ? u : null; 3258 } 3259 getElementEntry(t) { 3260 return this.entries.find((u) => u.type === H.Element && u.element === t); 3261 } 3262} 3263const Y = { 3264 //Node construction 3265 createDocument() { 3266 return { 3267 nodeName: "#document", 3268 mode: M.NO_QUIRKS, 3269 childNodes: [] 3270 }; 3271 }, 3272 createDocumentFragment() { 3273 return { 3274 nodeName: "#document-fragment", 3275 childNodes: [] 3276 }; 3277 }, 3278 createElement(e, t, u) { 3279 return { 3280 nodeName: e, 3281 tagName: e, 3282 attrs: u, 3283 namespaceURI: t, 3284 childNodes: [], 3285 parentNode: null 3286 }; 3287 }, 3288 createCommentNode(e) { 3289 return { 3290 nodeName: "#comment", 3291 data: e, 3292 parentNode: null 3293 }; 3294 }, 3295 createTextNode(e) { 3296 return { 3297 nodeName: "#text", 3298 value: e, 3299 parentNode: null 3300 }; 3301 }, 3302 //Tree mutation 3303 appendChild(e, t) { 3304 e.childNodes.push(t), t.parentNode = e; 3305 }, 3306 insertBefore(e, t, u) { 3307 const s = e.childNodes.indexOf(u); 3308 e.childNodes.splice(s, 0, t), t.parentNode = e; 3309 }, 3310 setTemplateContent(e, t) { 3311 e.content = t; 3312 }, 3313 getTemplateContent(e) { 3314 return e.content; 3315 }, 3316 setDocumentType(e, t, u, s) { 3317 const n = e.childNodes.find((o) => o.nodeName === "#documentType"); 3318 if (n) 3319 n.name = t, n.publicId = u, n.systemId = s; 3320 else { 3321 const o = { 3322 nodeName: "#documentType", 3323 name: t, 3324 publicId: u, 3325 systemId: s, 3326 parentNode: null 3327 }; 3328 Y.appendChild(e, o); 3329 } 3330 }, 3331 setDocumentMode(e, t) { 3332 e.mode = t; 3333 }, 3334 getDocumentMode(e) { 3335 return e.mode; 3336 }, 3337 detachNode(e) { 3338 if (e.parentNode) { 3339 const t = e.parentNode.childNodes.indexOf(e); 3340 e.parentNode.childNodes.splice(t, 1), e.parentNode = null; 3341 } 3342 }, 3343 insertText(e, t) { 3344 if (e.childNodes.length > 0) { 3345 const u = e.childNodes[e.childNodes.length - 1]; 3346 if (Y.isTextNode(u)) { 3347 u.value += t; 3348 return; 3349 } 3350 } 3351 Y.appendChild(e, Y.createTextNode(t)); 3352 }, 3353 insertTextBefore(e, t, u) { 3354 const s = e.childNodes[e.childNodes.indexOf(u) - 1];
3355 s && Y.isTextNode(s) ? s.value += t : Y.insertBefore(e, Y.createTextNode(t), u); 3356 }, 3357 adoptAttributes(e, t) { 3358 const u = new Set(e.attrs.map((s) => s.name)); 3359 for (let s = 0; s < t.length; s++) 3360 u.has(t[s].name) || e.attrs.push(t[s]); 3361 }, 3362 //Tree traversing 3363 getFirstChild(e) { 3364 return e.childNodes[0]; 3365 }, 3366 getChildNodes(e) { 3367 return e.childNodes; 3368 }, 3369 getParentNode(e) { 3370 return e.parentNode; 3371 }, 3372 getAttrList(e) { 3373 return e.attrs; 3374 }, 3375 //Node data 3376 getTagName(e) { 3377 return e.tagName; 3378 }, 3379 getNamespaceURI(e) { 3380 return e.namespaceURI; 3381 }, 3382 getTextNodeContent(e) { 3383 return e.value; 3384 }, 3385 getCommentNodeContent(e) { 3386 return e.data; 3387 }, 3388 getDocumentTypeNodeName(e) { 3389 return e.name; 3390 }, 3391 getDocumentTypeNodePublicId(e) { 3392 return e.publicId; 3393 }, 3394 getDocumentTypeNodeSystemId(e) { 3395 return e.systemId; 3396 }, 3397 //Node types 3398 isTextNode(e) { 3399 return e.nodeName === "#text"; 3400 }, 3401 isCommentNode(e) { 3402 return e.nodeName === "#comment"; 3403 }, 3404 isDocumentTypeNode(e) { 3405 return e.nodeName === "#documentType"; 3406 }, 3407 isElementNode(e) { 3408 return Object.prototype.hasOwnProperty.call(e, "tagName"); 3409 }, 3410 // Source code location 3411 setNodeSourceCodeLocation(e, t) { 3412 e.sourceCodeLocation = t; 3413 }, 3414 getNodeSourceCodeLocation(e) { 3415 return e.sourceCodeLocation; 3416 }, 3417 updateNodeSourceCodeLocation(e, t) { 3418 e.sourceCodeLocation = { ...e.sourceCodeLocation, ...t }; 3419 } 3420}, St = "html", Yu = "about:legacy-compat", vu = "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd", Ot = [ 3421 "+//silmaril//dtd html pro v0r11 19970101//", 3422 "-//as//dtd html 3.0 aswedit + extensions//", 3423 "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", 3424 "-//ietf//dtd html 2.0 level 1//", 3425 "-//ietf//dtd html 2.0 level 2//", 3426 "-//ietf//dtd html 2.0 strict level 1//", 3427 "-//ietf//dtd html 2.0 strict level 2//", 3428 "-//ietf//dtd html 2.0 strict//", 3429 "-//ietf//dtd html 2.0//", 3430 "-//ietf//dtd html 2.1e//", 3431 "-//ietf//dtd html 3.0//", 3432 "-//ietf//dtd html 3.2 final//", 3433 "-//ietf//dtd html 3.2//", 3434 "-//ietf//dtd html 3//", 3435 "-//ietf//dtd html level 0//", 3436 "-//ietf//dtd html level 1//", 3437 "-//ietf//dtd html level 2//", 3438 "-//ietf//dtd html level 3//", 3439 "-//ietf//dtd html strict level 0//", 3440 "-//ietf//dtd html strict level 1//", 3441 "-//ietf//dtd html strict level 2//", 3442 "-//ietf//dtd html strict level 3//", 3443 "-//ietf//dtd html strict//", 3444 "-//ietf//dtd html//", 3445 "-//metrius//dtd metrius presentational//", 3446 "-//microsoft//dtd internet explorer 2.0 html strict//", 3447 "-//microsoft//dtd internet explorer 2.0 html//", 3448 "-//microsoft//dtd internet explorer 2.0 tables//", 3449 "-//microsoft//dtd internet explorer 3.0 html strict//", 3450 "-//microsoft//dtd internet explorer 3.0 html//", 3451 "-//microsoft//dtd internet explorer 3.0 tables//", 3452 "-//netscape comm. corp.//dtd html//", 3453 "-//netscape comm. corp.//dtd strict html//", 3454 "-//o'reilly and associates//dtd html 2.0//", 3455 "-//o'reilly and associates//dtd html extended 1.0//", 3456 "-//o'reilly and associates//dtd html extended relaxed 1.0//", 3457 "-//sq//dtd html 2.0 hotmetal + extensions//", 3458 "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", 3459 "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", 3460 "-//spyglass//dtd html 2.0 extended//", 3461 "-//sun microsystems corp.//dtd hotjava html//", 3462 "-//sun microsystems corp.//dtd hotjava strict html//", 3463 "-//w3c//dtd html 3 1995-03-24//", 3464 "-//w3c//dtd html 3.2 draft//", 3465 "-//w3c//dtd html 3.2 final//", 3466 "-//w3c//dtd html 3.2//", 3467 "-//w3c//dtd html 3.2s draft//", 3468 "-//w3c//dtd html 4.0 frameset//", 3469 "-//w3c//dtd html 4.0 transitional//", 3470 "-//w3c//dtd html experimental 19960712//", 3471 "-//w3c//dtd html experimental 970421//", 3472 "-//w3c//dtd w3 html//", 3473 "-//w3o//dtd w3 html 3.0//", 3474 "-//webtechs//dtd mozilla html 2.0//", 3475 "-//webtechs//dtd mozilla html//" 3476], Qu = [ 3477 ...Ot, 3478 "-//w3c//dtd html 4.01 frameset//", 3479 "-//w3c//dtd html 4.01 transitional//" 3480], qu = /* @__PURE__ */ new Set([ 3481 "-//w3o//dtd w3 html strict 3.0//en//", 3482 "-/w3c/dtd html 4.0 transitional/en", 3483 "html" 3484]), Lt = ["-//w3c//dtd xhtml 1.0 frameset//", "-//w3c//dtd xhtml 1.0 transitional//"], Wu = [ 3485 ...Lt, 3486 "-//w3c//dtd html 4.01 frameset//", 3487 "-//w3c//dtd html 4.01 transitional//" 3488]; 3489function at(e, t) { 3490 return t.some((u) => e.startsWith(u)); 3491} 3492function Gu(e) { 3493 return e.name === St && e.publicId === null && (e.systemId === null || e.systemId === Yu); 3494} 3495function Vu(e) { 3496 if (e.name !== St) 3497 return M.QUIRKS; 3498 const { systemId: t } = e; 3499 if (t && t.toLowerCase() === vu) 3500 return M.QUIRKS; 3501 let { publicId: u } = e; 3502 if (u !== null) { 3503 if (u = u.toLowerCase(), qu.has(u)) 3504 return M.QUIRKS; 3505 let s = t === null ? Qu : Ot; 3506 if (at(u, s)) 3507 return M.QUIRKS; 3508 if (s = t === null ? Lt : Wu, at(u, s)) 3509 return M.LIMITED_QUIRKS; 3510 } 3511 return M.NO_QUIRKS; 3512} 3513const st = { 3514 TEXT_HTML: "text/html", 3515 APPLICATION_XML: "application/xhtml+xml" 3516}, Ku = "definitionurl", Xu = "definitionURL", ju = new Map([ 3517 "attributeName", 3518 "attributeType", 3519 "baseFrequency", 3520 "baseProfile", 3521 "calcMode", 3522 "clipPathUnits", 3523 "diffuseConstant", 3524 "edgeMode", 3525 "filterUnits", 3526 "glyphRef", 3527 "gradientTransform", 3528 "gradientUnits", 3529 "kernelMatrix", 3530 "kernelUnitLength", 3531 "keyPoints", 3532 "keySplines", 3533 "keyTimes", 3534 "lengthAdjust", 3535 "limitingConeAngle", 3536 "markerHeight", 3537 "markerUnits", 3538 "markerWidth", 3539 "maskContentUnits", 3540 "maskUnits", 3541 "numOctaves", 3542 "pathLength", 3543 "patternContentUnits", 3544 "patternTransform", 3545 "patternUnits", 3546 "pointsAtX", 3547 "pointsAtY", 3548 "pointsAtZ", 3549 "preserveAlpha", 3550 "preserveAspectRatio", 3551 "primitiveUnits", 3552 "refX", 3553 "refY", 3554 "repeatCount", 3555 "repeatDur", 3556 "requiredExtensions", 3557 "requiredFeatures", 3558 "specularConstant", 3559 "specularExponent", 3560 "spreadMethod", 3561 "startOffset", 3562 "stdDeviation", 3563 "stitchTiles", 3564 "surfaceScale", 3565 "systemLanguage", 3566 "tableValues", 3567 "targetX", 3568 "targetY", 3569 "textLength", 3570 "viewBox", 3571 "viewTarget", 3572 "xChannelSelector", 3573 "yChannelSelector", 3574 "zoomAndPan" 3575].map((e) => [e.toLowerCase(), e])), zu = /* @__PURE__ */ new Map([ 3576 ["xlink:actuate", { prefix: "xlink", name: "actuate", namespace: h.XLINK }], 3577 ["xlink:arcrole", { prefix: "xlink", name: "arcrole", namespace: h.XLINK }], 3578 ["xlink:href", { prefix: "xlink", name: "href", namespace: h.XLINK }], 3579 ["xlink:role", { prefix: "xlink", name: "role", namespace: h.XLINK }], 3580 ["xlink:show", { prefix: "xlink", name: "show", namespace: h.XLINK }], 3581 ["xlink:title", { prefix: "xlink", name: "title", namespace: h.XLINK }], 3582 ["xlink:type", { prefix: "xlink", name: "type", namespace: h.XLINK }], 3583 ["xml:lang", { prefix: "xml", name: "lang", namespace: h.XML }], 3584 ["xml:space", { prefix: "xml", name: "space", namespace: h.XML }], 3585 ["xmlns", { prefix: "", name: "xmlns", namespace: h.XMLNS }], 3586 ["xmlns:xlink", { prefix: "xmlns", name: "xlink", namespace: h.XMLNS }] 3587]), Ju = new Map([ 3588 "altGlyph", 3589 "altGlyphDef", 3590 "altGlyphItem", 3591 "animateColor", 3592 "animateMotion", 3593 "animateTransform", 3594 "clipPath", 3595 "feBlend", 3596 "feColorMatrix", 3597 "feComponentTransfer", 3598 "feComposite", 3599 "feConvolveMatrix", 3600 "feDiffuseLighting", 3601 "feDisplacementMap", 3602 "feDistantLight", 3603 "feFlood", 3604 "feFuncA", 3605 "feFuncB", 3606 "feFuncG", 3607 "feFuncR", 3608 "feGaussianBlur", 3609 "feImage", 3610 "feMerge", 3611 "feMergeNode", 3612 "feMorphology", 3613 "feOffset", 3614 "fePointLight", 3615 "feSpecularLighting", 3616 "feSpotLight", 3617 "feTile", 3618 "feTurbulence", 3619 "foreignObject", 3620 "glyphRef", 3621 "linearGradient", 3622 "radialGradient", 3623 "textPath" 3624].map((e) => [e.toLowerCase(), e])), Zu = /* @__PURE__ */ new Set([ 3625 a.B, 3626 a.BIG, 3627 a.BLOCKQUOTE, 3628 a.BODY, 3629 a.BR, 3630 a.CENTER, 3631 a.CODE, 3632 a.DD, 3633 a.DIV, 3634 a.DL, 3635 a.DT, 3636 a.EM, 3637 a.EMBED, 3638 a.H1,
3639 a.H2, 3640 a.H3, 3641 a.H4, 3642 a.H5, 3643 a.H6, 3644 a.HEAD, 3645 a.HR, 3646 a.I, 3647 a.IMG, 3648 a.LI, 3649 a.LISTING, 3650 a.MENU, 3651 a.META, 3652 a.NOBR, 3653 a.OL, 3654 a.P, 3655 a.PRE, 3656 a.RUBY, 3657 a.S, 3658 a.SMALL, 3659 a.SPAN, 3660 a.STRONG, 3661 a.STRIKE, 3662 a.SUB, 3663 a.SUP, 3664 a.TABLE, 3665 a.TT, 3666 a.U, 3667 a.UL, 3668 a.VAR 3669]); 3670function $u(e) { 3671 const t = e.tagID; 3672 return t === a.FONT && e.attrs.some(({ name: s }) => s === Q.COLOR || s === Q.SIZE || s === Q.FACE) || Zu.has(t); 3673} 3674function Rt(e) { 3675 for (let t = 0; t < e.attrs.length; t++) 3676 if (e.attrs[t].name === Ku) { 3677 e.attrs[t].name = Xu; 3678 break; 3679 } 3680} 3681function Dt(e) { 3682 for (let t = 0; t < e.attrs.length; t++) { 3683 const u = ju.get(e.attrs[t].name); 3684 u != null && (e.attrs[t].name = u); 3685 } 3686} 3687function Fe(e) { 3688 for (let t = 0; t < e.attrs.length; t++) { 3689 const u = zu.get(e.attrs[t].name); 3690 u && (e.attrs[t].prefix = u.prefix, e.attrs[t].name = u.name, e.attrs[t].namespace = u.namespace); 3691 } 3692} 3693function ea(e) { 3694 const t = Ju.get(e.tagName); 3695 t != null && (e.tagName = t, e.tagID = Ee(e.tagName)); 3696} 3697function ta(e, t) { 3698 return t === h.MATHML && (e === a.MI || e === a.MO || e === a.MN || e === a.MS || e === a.MTEXT); 3699} 3700function ua(e, t, u) { 3701 if (t === h.MATHML && e === a.ANNOTATION_XML) { 3702 for (let s = 0; s < u.length; s++) 3703 if (u[s].name === Q.ENCODING) { 3704 const n = u[s].value.toLowerCase(); 3705 return n === st.TEXT_HTML || n === st.APPLICATION_XML; 3706 } 3707 } 3708 return t === h.SVG && (e === a.FOREIGN_OBJECT || e === a.DESC || e === a.TITLE); 3709} 3710function aa(e, t, u, s) { 3711 return (!s || s === h.HTML) && ua(e, t, u) || (!s || s === h.MATHML) && ta(e, t); 3712} 3713const sa = "hidden", ra = 8, na = 3; 3714var c; 3715(function(e) { 3716 e[e.INITIAL = 0] = "INITIAL", e[e.BEFORE_HTML = 1] = "BEFORE_HTML", e[e.BEFORE_HEAD = 2] = "BEFORE_HEAD", e[e.IN_HEAD = 3] = "IN_HEAD", e[e.IN_HEAD_NO_SCRIPT = 4] = "IN_HEAD_NO_SCRIPT", e[e.AFTER_HEAD = 5] = "AFTER_HEAD", e[e.IN_BODY = 6] = "IN_BODY", e[e.TEXT = 7] = "TEXT", e[e.IN_TABLE = 8] = "IN_TABLE", e[e.IN_TABLE_TEXT = 9] = "IN_TABLE_TEXT", e[e.IN_CAPTION = 10] = "IN_CAPTION", e[e.IN_COLUMN_GROUP = 11] = "IN_COLUMN_GROUP", e[e.IN_TABLE_BODY = 12] = "IN_TABLE_BODY", e[e.IN_ROW = 13] = "IN_ROW", e[e.IN_CELL = 14] = "IN_CELL", e[e.IN_SELECT = 15] = "IN_SELECT", e[e.IN_SELECT_IN_TABLE = 16] = "IN_SELECT_IN_TABLE", e[e.IN_TEMPLATE = 17] = "IN_TEMPLATE", e[e.AFTER_BODY = 18] = "AFTER_BODY", e[e.IN_FRAMESET = 19] = "IN_FRAMESET", e[e.AFTER_FRAMESET = 20] = "AFTER_FRAMESET", e[e.AFTER_AFTER_BODY = 21] = "AFTER_AFTER_BODY", e[e.AFTER_AFTER_FRAMESET = 22] = "AFTER_AFTER_FRAMESET"; 3717})(c || (c = {})); 3718const ia = { 3719 startLine: -1, 3720 startCol: -1, 3721 startOffset: -1, 3722 endLine: -1, 3723 endCol: -1, 3724 endOffset: -1 3725}, Pt = /* @__PURE__ */ new Set([a.TABLE, a.TBODY, a.TFOOT, a.THEAD, a.TR]), rt = { 3726 scriptingEnabled: !0, 3727 sourceCodeLocationInfo: !1, 3728 treeAdapter: Y, 3729 onParseError: null 3730}; 3731class xt { 3732 constructor(t, u, s = null, n = null) { 3733 this.fragmentContext = s, this.scriptHandler = n, this.currentToken = null, this.stopped = !1, this.insertionMode = c.INITIAL, this.originalInsertionMode = c.INITIAL, this.headElement = null, this.formElement = null, this.currentNotInHTML = !1, this.tmplInsertionModeStack = [], this.pendingCharacterTokens = [], this.hasNonWhitespacePendingCharacterToken = !1, this.framesetOk = !0, this.skipNextNewLine = !1, this.fosterParentingEnabled = !1, this.options = { 3734 ...rt, 3735 ...t 3736 }, this.treeAdapter = this.options.treeAdapter, this.onParseError = this.options.onParseError, this.onParseError && (this.options.sourceCodeLocationInfo = !0), this.document = u ?? this.treeAdapter.createDocument(), this.tokenizer = new xu(this.options, this), this.activeFormattingElements = new wu(this.treeAdapter), this.fragmentContextID = s ? Ee(this.treeAdapter.getTagName(s)) : a.UNKNOWN, this._setContextModes(s ?? this.document, this.fragmentContextID), this.openElements = new Fu(this.document, this.treeAdapter, this); 3737 } 3738 // API 3739 static parse(t, u) { 3740 const s = new this(u); 3741 return s.tokenizer.write(t, !0), s.document; 3742 } 3743 static getFragmentParser(t, u) { 3744 const s = { 3745 ...rt, 3746 ...u 3747 }; 3748 t ?? (t = s.treeAdapter.createElement(d.TEMPLATE, h.HTML, [])); 3749 const n = s.treeAdapter.createElement("documentmock", h.HTML, []), o = new this(s, n, t); 3750 return o.fragmentContextID === a.TEMPLATE && o.tmplInsertionModeStack.unshift(c.IN_TEMPLATE), o._initTokenizerForFragmentParsing(), o._insertFakeRootElement(), o._resetInsertionMode(), o._findFormInFragmentContext(), o; 3751 } 3752 getFragment() { 3753 const t = this.treeAdapter.getFirstChild(this.document), u = this.treeAdapter.createDocumentFragment(); 3754 return this._adoptNodes(t, u), u; 3755 } 3756 //Errors 3757 /** @internal */ 3758 _err(t, u, s) { 3759 var n; 3760 if (!this.onParseError) 3761 return; 3762 const o = (n = t.location) !== null && n !== void 0 ? n : ia, E = { 3763 code: u, 3764 startLine: o.startLine, 3765 startCol: o.startCol, 3766 startOffset: o.startOffset, 3767 endLine: s ? o.startLine : o.endLine, 3768 endCol: s ? o.startCol : o.endCol, 3769 endOffset: s ? o.startOffset : o.endOffset 3770 }; 3771 this.onParseError(E); 3772 } 3773 //Stack events 3774 /** @internal */ 3775 onItemPush(t, u, s) { 3776 var n, o; 3777 (o = (n = this.treeAdapter).onItemPush) === null || o === void 0 || o.call(n, t), s && this.openElements.stackTop > 0 && this._setContextModes(t, u); 3778 } 3779 /** @internal */ 3780 onItemPop(t, u) { 3781 var s, n; 3782 if (this.options.sourceCodeLocationInfo && this._setEndLocation(t, this.currentToken), (n = (s = this.treeAdapter).onItemPop) === null || n === void 0 || n.call(s, t, this.openElements.current), u) { 3783 let o, E; 3784 this.openElements.stackTop === 0 && this.fragmentContext ? (o = this.fragmentContext, E = this.fragmentContextID) : { current: o, currentTagId: E } = this.openElements, this._setContextModes(o, E); 3785 } 3786 } 3787 _setContextModes(t, u) { 3788 const s = t === this.document || t && this.treeAdapter.getNamespaceURI(t) === h.HTML; 3789 this.currentNotInHTML = !s, this.tokenizer.inForeignNode = !s && t !== void 0 && u !== void 0 && !this._isIntegrationPoint(u, t); 3790 } 3791 /** @protected */ 3792 _switchToTextParsing(t, u) { 3793 this._insertElement(t, h.HTML), this.tokenizer.state = u, this.originalInsertionMode = this.insertionMode, this.insertionMode = c.TEXT; 3794 } 3795 switchToPlaintextParsing() { 3796 this.insertionMode = c.TEXT, this.originalInsertionMode = c.IN_BODY, this.tokenizer.state = P.PLAINTEXT; 3797 } 3798 //Fragment parsing 3799 /** @protected */ 3800 _getAdjustedCurrentElement() { 3801 return this.openElements.stackTop === 0 && this.fragmentContext ? this.fragmentContext : this.openElements.current; 3802 } 3803 /** @protected */ 3804 _findFormInFragmentContext() { 3805 let t = this.fragmentContext; 3806 for (; t; ) { 3807 if (this.treeAdapter.getTagName(t) === d.FORM) { 3808 this.formElement = t; 3809 break; 3810 } 3811 t = this.treeAdapter.getParentNode(t); 3812 } 3813 } 3814 _initTokenizerForFragmentParsing() { 3815 if (!(!this.fragmentContext || this.treeAdapter.getNamespaceURI(this.fragmentContext) !== h.HTML)) 3816 switch (this.fragmentContextID) { 3817 case a.TITLE: 3818 case a.TEXTAREA: { 3819 this.tokenizer.state = P.RCDATA; 3820 break; 3821 } 3822 case a.STYLE: 3823 case a.XMP: 3824 case a.IFRAME: 3825 case a.NOEMBED: 3826 case a.NOFRAMES: 3827 case a.NOSCRIPT: { 3828 this.tokenizer.state = P.RAWTEXT; 3829 break; 3830 } 3831 case a.SCRIPT: { 3832 this.tokenizer.state = P.SCRIPT_DATA; 3833 break; 3834 } 3835 case a.PLAINTEXT: { 3836 this.tokenizer.state = P.PLAINTEXT; 3837 break; 3838 } 3839 } 3840 } 3841 //Tree mutation 3842 /** @protected */ 3843 _setDocumentType(t) { 3844 const u = t.name || "", s = t.publicId || "", n = t.systemId || ""; 3845 if (this.treeAdapter.setDocumentType(this.document, u, s, n), t.location) { 3846 const E = this.treeAdapter.getChildNodes(this.document).find((l) => this.treeAdapter.isDocumentTypeNode(l)); 3847 E && this.treeAdapter.setNodeSourceCodeLocation(E, t.location); 3848 } 3849 } 3850 /** @protected */ 3851 _attachElementToTree(t, u) { 3852 if (this.options.sourceCodeLocationInfo) { 3853 const s = u && { 3854 ...u, 3855 startTag: u 3856 }; 3857 this.treeAdapter.setNodeSourceCodeLocation(t, s); 3858 } 3859 if (this._shouldFosterParentOnInsertion()) 3860 this._fosterParentElement(t); 3861 else { 3862 const s = this.openElements.currentTmplContentOrNode; 3863 this.treeAdapter.appendChild(s ?? this.document, t); 3864 } 3865 } 3866 /**
3867 * For self-closing tags. Add an element to the tree, but skip adding it 3868 * to the stack. 3869 */ 3870 /** @protected */ 3871 _appendElement(t, u) { 3872 const s = this.treeAdapter.createElement(t.tagName, u, t.attrs); 3873 this._attachElementToTree(s, t.location); 3874 } 3875 /** @protected */ 3876 _insertElement(t, u) { 3877 const s = this.treeAdapter.createElement(t.tagName, u, t.attrs); 3878 this._attachElementToTree(s, t.location), this.openElements.push(s, t.tagID); 3879 } 3880 /** @protected */ 3881 _insertFakeElement(t, u) { 3882 const s = this.treeAdapter.createElement(t, h.HTML, []); 3883 this._attachElementToTree(s, null), this.openElements.push(s, u); 3884 } 3885 /** @protected */ 3886 _insertTemplate(t) { 3887 const u = this.treeAdapter.createElement(t.tagName, h.HTML, t.attrs), s = this.treeAdapter.createDocumentFragment(); 3888 this.treeAdapter.setTemplateContent(u, s), this._attachElementToTree(u, t.location), this.openElements.push(u, t.tagID), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(s, null); 3889 } 3890 /** @protected */ 3891 _insertFakeRootElement() { 3892 const t = this.treeAdapter.createElement(d.HTML, h.HTML, []); 3893 this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(t, null), this.treeAdapter.appendChild(this.openElements.current, t), this.openElements.push(t, a.HTML); 3894 } 3895 /** @protected */ 3896 _appendCommentNode(t, u) { 3897 const s = this.treeAdapter.createCommentNode(t.data); 3898 this.treeAdapter.appendChild(u, s), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(s, t.location); 3899 } 3900 /** @protected */ 3901 _insertCharacters(t) { 3902 let u, s; 3903 if (this._shouldFosterParentOnInsertion() ? ({ parent: u, beforeElement: s } = this._findFosterParentingLocation(), s ? this.treeAdapter.insertTextBefore(u, t.chars, s) : this.treeAdapter.insertText(u, t.chars)) : (u = this.openElements.currentTmplContentOrNode, this.treeAdapter.insertText(u, t.chars)), !t.location) 3904 return; 3905 const n = this.treeAdapter.getChildNodes(u), o = s ? n.lastIndexOf(s) : n.length, E = n[o - 1]; 3906 if (this.treeAdapter.getNodeSourceCodeLocation(E)) { 3907 const { endLine: T, endCol: m, endOffset: _ } = t.location; 3908 this.treeAdapter.updateNodeSourceCodeLocation(E, { endLine: T, endCol: m, endOffset: _ }); 3909 } else this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(E, t.location); 3910 } 3911 /** @protected */ 3912 _adoptNodes(t, u) { 3913 for (let s = this.treeAdapter.getFirstChild(t); s; s = this.treeAdapter.getFirstChild(t)) 3914 this.treeAdapter.detachNode(s), this.treeAdapter.appendChild(u, s); 3915 } 3916 /** @protected */ 3917 _setEndLocation(t, u) { 3918 if (this.treeAdapter.getNodeSourceCodeLocation(t) && u.location) { 3919 const s = u.location, n = this.treeAdapter.getTagName(t), o = ( 3920 // NOTE: For cases like <p> <p> </p> - First 'p' closes without a closing 3921 // tag and for cases like <td> <p> </td> - 'p' closes without a closing tag. 3922 u.type === p.END_TAG && n === u.tagName ? { 3923 endTag: { ...s }, 3924 endLine: s.endLine, 3925 endCol: s.endCol, 3926 endOffset: s.endOffset 3927 } : { 3928 endLine: s.startLine, 3929 endCol: s.startCol, 3930 endOffset: s.startOffset 3931 } 3932 ); 3933 this.treeAdapter.updateNodeSourceCodeLocation(t, o); 3934 } 3935 } 3936 //Token processing 3937 shouldProcessStartTagTokenInForeignContent(t) { 3938 if (!this.currentNotInHTML) 3939 return !1; 3940 let u, s; 3941 return this.openElements.stackTop === 0 && this.fragmentContext ? (u = this.fragmentContext, s = this.fragmentContextID) : { current: u, currentTagId: s } = this.openElements, t.tagID === a.SVG && this.treeAdapter.getTagName(u) === d.ANNOTATION_XML && this.treeAdapter.getNamespaceURI(u) === h.MATHML ? !1 : ( 3942 // Check that `current` is not an integration point for HTML or MathML elements. 3943 this.tokenizer.inForeignNode || // If it _is_ an integration point, then we might have to check that it is not an HTML 3944 // integration point. 3945 (t.tagID === a.MGLYPH || t.tagID === a.MALIGNMARK) && s !== void 0 && !this._isIntegrationPoint(s, u, h.HTML) 3946 ); 3947 } 3948 /** @protected */ 3949 _processToken(t) { 3950 switch (t.type) { 3951 case p.CHARACTER: { 3952 this.onCharacter(t); 3953 break; 3954 } 3955 case p.NULL_CHARACTER: { 3956 this.onNullCharacter(t); 3957 break; 3958 } 3959 case p.COMMENT: { 3960 this.onComment(t); 3961 break; 3962 } 3963 case p.DOCTYPE: { 3964 this.onDoctype(t); 3965 break; 3966 } 3967 case p.START_TAG: { 3968 this._processStartTag(t); 3969 break; 3970 } 3971 case p.END_TAG: { 3972 this.onEndTag(t); 3973 break; 3974 } 3975 case p.EOF: { 3976 this.onEof(t); 3977 break; 3978 } 3979 case p.WHITESPACE_CHARACTER: { 3980 this.onWhitespaceCharacter(t); 3981 break; 3982 } 3983 } 3984 } 3985 //Integration points 3986 /** @protected */ 3987 _isIntegrationPoint(t, u, s) { 3988 const n = this.treeAdapter.getNamespaceURI(u), o = this.treeAdapter.getAttrList(u); 3989 return aa(t, n, o, s); 3990 } 3991 //Active formatting elements reconstruction 3992 /** @protected */ 3993 _reconstructActiveFormattingElements() { 3994 const t = this.activeFormattingElements.entries.length; 3995 if (t) { 3996 const u = this.activeFormattingElements.entries.findIndex((n) => n.type === H.Marker || this.openElements.contains(n.element)), s = u === -1 ? t - 1 : u - 1; 3997 for (let n = s; n >= 0; n--) { 3998 const o = this.activeFormattingElements.entries[n]; 3999 this._insertElement(o.token, this.treeAdapter.getNamespaceURI(o.element)), o.element = this.openElements.current; 4000 } 4001 } 4002 } 4003 //Close elements 4004 /** @protected */ 4005 _closeTableCell() { 4006 this.openElements.generateImpliedEndTags(), this.openElements.popUntilTableCellPopped(), this.activeFormattingElements.clearToLastMarker(), this.insertionMode = c.IN_ROW; 4007 } 4008 /** @protected */ 4009 _closePElement() { 4010 this.openElements.generateImpliedEndTagsWithExclusion(a.P), this.openElements.popUntilTagNamePopped(a.P); 4011 } 4012 //Insertion modes 4013 /** @protected */ 4014 _resetInsertionMode() { 4015 for (let t = this.openElements.stackTop; t >= 0; t--) 4016 switch (t === 0 && this.fragmentContext ? this.fragmentContextID : this.openElements.tagIDs[t]) { 4017 case a.TR: { 4018 this.insertionMode = c.IN_ROW; 4019 return; 4020 } 4021 case a.TBODY: 4022 case a.THEAD: 4023 case a.TFOOT: { 4024 this.insertionMode = c.IN_TABLE_BODY; 4025 return; 4026 } 4027 case a.CAPTION: { 4028 this.insertionMode = c.IN_CAPTION; 4029 return; 4030 } 4031 case a.COLGROUP: { 4032 this.insertionMode = c.IN_COLUMN_GROUP; 4033 return; 4034 } 4035 case a.TABLE: { 4036 this.insertionMode = c.IN_TABLE; 4037 return; 4038 } 4039 case a.BODY: { 4040 this.insertionMode = c.IN_BODY; 4041 return; 4042 } 4043 case a.FRAMESET: { 4044 this.insertionMode = c.IN_FRAMESET; 4045 return; 4046 } 4047 case a.SELECT: { 4048 this._resetInsertionModeForSelect(t); 4049 return; 4050 } 4051 case a.TEMPLATE: { 4052 this.insertionMode = this.tmplInsertionModeStack[0]; 4053 return; 4054 } 4055 case a.HTML: { 4056 this.insertionMode = this.headElement ? c.AFTER_HEAD : c.BEFORE_HEAD; 4057 return; 4058 } 4059 case a.TD: 4060 case a.TH: { 4061 if (t > 0) { 4062 this.insertionMode = c.IN_CELL; 4063 return; 4064 } 4065 break; 4066 } 4067 case a.HEAD: { 4068 if (t > 0) { 4069 this.insertionMode = c.IN_HEAD; 4070 return; 4071 } 4072 break; 4073 } 4074 } 4075 this.insertionMode = c.IN_BODY; 4076 } 4077 /** @protected */ 4078 _resetInsertionModeForSelect(t) { 4079 if (t > 0) 4080 for (let u = t - 1; u > 0; u--) { 4081 const s = this.openElements.tagIDs[u]; 4082 if (s === a.TEMPLATE) 4083 break; 4084 if (s === a.TABLE) { 4085 this.insertionMode = c.IN_SELECT_IN_TABLE; 4086 return; 4087 } 4088 } 4089 this.insertionMode = c.IN_SELECT; 4090 } 4091 //Foster parenting 4092 /** @protected */ 4093 _isElementCausesFosterParenting(t) { 4094 return Pt.has(t); 4095 } 4096 /** @protected */ 4097 _shouldFosterParentOnInsertion() { 4098 return this.fosterParentingEnabled && this.openElements.currentTagId !== void 0 && this._isElementCausesFosterParenting(this.openElements.currentTagId); 4099 } 4100 /** @protected */ 4101 _findFosterParentingLocation() { 4102 for (let t = this.openElements.stackTop; t >= 0; t--) { 4103 const u = this.openElements.items[t]; 4104 switch (this.openElements.tagIDs[t]) { 4105 case a.TEMPLATE: { 4106 if (this.treeAdapter.getNamespaceURI(u) === h.HTML) 4107 return { parent: this.treeAdapter.getTemplateContent(u), beforeElement: null }; 4108 break; 4109 } 4110 case a.TABLE: { 4111 const s = this.treeAdapter.getParentNode(u); 4112 return s ? { parent: s, beforeElement: u } : { parent: this.openElements.items[t - 1], beforeElement: null }; 4113 } 4114 } 4115 } 4116 return { parent: this.openElements.items[0], beforeElement: null }; 4117 } 4118 /** @protected */ 4119 _fosterParentElement(t) { 4120 const u = this._findFosterParentingLocation(); 4121 u.beforeElement ? this.treeAdapter.insertBefore(u.parent, t, u.beforeElement) : this.treeAdapter.appendChild(u.parent, t); 4122 } 4123 //Special elements 4124 /** @protected */
4125 _isSpecialElement(t, u) { 4126 const s = this.treeAdapter.getNamespaceURI(t); 4127 return Lu[s].has(u); 4128 } 4129 /** @internal */ 4130 onCharacter(t) { 4131 if (this.skipNextNewLine = !1, this.tokenizer.inForeignNode) { 4132 Hs(this, t); 4133 return; 4134 } 4135 switch (this.insertionMode) { 4136 case c.INITIAL: { 4137 K(this, t); 4138 break; 4139 } 4140 case c.BEFORE_HTML: { 4141 z(this, t); 4142 break; 4143 } 4144 case c.BEFORE_HEAD: { 4145 J(this, t); 4146 break; 4147 } 4148 case c.IN_HEAD: { 4149 Z(this, t); 4150 break; 4151 } 4152 case c.IN_HEAD_NO_SCRIPT: { 4153 $(this, t); 4154 break; 4155 } 4156 case c.AFTER_HEAD: { 4157 ee(this, t); 4158 break; 4159 } 4160 case c.IN_BODY: 4161 case c.IN_CAPTION: 4162 case c.IN_CELL: 4163 case c.IN_TEMPLATE: { 4164 Bt(this, t); 4165 break; 4166 } 4167 case c.TEXT: 4168 case c.IN_SELECT: 4169 case c.IN_SELECT_IN_TABLE: { 4170 this._insertCharacters(t); 4171 break; 4172 } 4173 case c.IN_TABLE: 4174 case c.IN_TABLE_BODY: 4175 case c.IN_ROW: { 4176 be(this, t); 4177 break; 4178 } 4179 case c.IN_TABLE_TEXT: { 4180 wt(this, t); 4181 break; 4182 } 4183 case c.IN_COLUMN_GROUP: { 4184 oe(this, t); 4185 break; 4186 } 4187 case c.AFTER_BODY: { 4188 de(this, t); 4189 break; 4190 } 4191 case c.AFTER_AFTER_BODY: { 4192 ie(this, t); 4193 break; 4194 } 4195 } 4196 } 4197 /** @internal */ 4198 onNullCharacter(t) { 4199 if (this.skipNextNewLine = !1, this.tokenizer.inForeignNode) { 4200 ks(this, t); 4201 return; 4202 } 4203 switch (this.insertionMode) { 4204 case c.INITIAL: { 4205 K(this, t); 4206 break; 4207 } 4208 case c.BEFORE_HTML: { 4209 z(this, t); 4210 break; 4211 } 4212 case c.BEFORE_HEAD: { 4213 J(this, t); 4214 break; 4215 } 4216 case c.IN_HEAD: { 4217 Z(this, t); 4218 break; 4219 } 4220 case c.IN_HEAD_NO_SCRIPT: { 4221 $(this, t); 4222 break; 4223 } 4224 case c.AFTER_HEAD: { 4225 ee(this, t); 4226 break; 4227 } 4228 case c.TEXT: { 4229 this._insertCharacters(t); 4230 break; 4231 } 4232 case c.IN_TABLE: 4233 case c.IN_TABLE_BODY: 4234 case c.IN_ROW: { 4235 be(this, t); 4236 break; 4237 } 4238 case c.IN_COLUMN_GROUP: { 4239 oe(this, t); 4240 break; 4241 } 4242 case c.AFTER_BODY: { 4243 de(this, t); 4244 break; 4245 } 4246 case c.AFTER_AFTER_BODY: { 4247 ie(this, t); 4248 break; 4249 } 4250 } 4251 } 4252 /** @internal */ 4253 onComment(t) { 4254 if (this.skipNextNewLine = !1, this.currentNotInHTML) { 4255 De(this, t); 4256 return; 4257 } 4258 switch (this.insertionMode) { 4259 case c.INITIAL: 4260 case c.BEFORE_HTML: 4261 case c.BEFORE_HEAD: 4262 case c.IN_HEAD: 4263 case c.IN_HEAD_NO_SCRIPT: 4264 case c.AFTER_HEAD: 4265 case c.IN_BODY: 4266 case c.IN_TABLE: 4267 case c.IN_CAPTION: 4268 case c.IN_COLUMN_GROUP: 4269 case c.IN_TABLE_BODY: 4270 case c.IN_ROW: 4271 case c.IN_CELL: 4272 case c.IN_SELECT: 4273 case c.IN_SELECT_IN_TABLE: 4274 case c.IN_TEMPLATE: 4275 case c.IN_FRAMESET: 4276 case c.AFTER_FRAMESET: { 4277 De(this, t); 4278 break; 4279 } 4280 case c.IN_TABLE_TEXT: { 4281 X(this, t); 4282 break; 4283 } 4284 case c.AFTER_BODY: { 4285 ha(this, t); 4286 break; 4287 } 4288 case c.AFTER_AFTER_BODY: 4289 case c.AFTER_AFTER_FRAMESET: { 4290 Ta(this, t); 4291 break; 4292 } 4293 } 4294 } 4295 /** @internal */ 4296 onDoctype(t) { 4297 switch (this.skipNextNewLine = !1, this.insertionMode) { 4298 case c.INITIAL: { 4299 ma(this, t); 4300 break; 4301 } 4302 case c.BEFORE_HEAD: 4303 case c.IN_HEAD: 4304 case c.IN_HEAD_NO_SCRIPT: 4305 case c.AFTER_HEAD: { 4306 this._err(t, f.misplacedDoctype); 4307 break; 4308 } 4309 case c.IN_TABLE_TEXT: { 4310 X(this, t); 4311 break; 4312 } 4313 } 4314 } 4315 /** @internal */ 4316 onStartTag(t) { 4317 this.skipNextNewLine = !1, this.currentToken = t, this._processStartTag(t), t.selfClosing && !t.ackSelfClosing && this._err(t, f.nonVoidHtmlElementStartTagWithTrailingSolidus); 4318 } 4319 /** 4320 * Processes a given start tag. 4321 * 4322 * `onStartTag` checks if a self-closing tag was recognized. When a token 4323 * is moved inbetween multiple insertion modes, this check for self-closing 4324 * could lead to false positives. To avoid this, `_processStartTag` is used 4325 * for nested calls. 4326 * 4327 * @param token The token to process. 4328 * @protected 4329 */ 4330 _processStartTag(t) { 4331 this.shouldProcessStartTagTokenInForeignContent(t) ? Fs(this, t) : this._startTagOutsideForeignContent(t); 4332 } 4333 /** @protected */ 4334 _startTagOutsideForeignContent(t) { 4335 switch (this.insertionMode) { 4336 case c.INITIAL: { 4337 K(this, t); 4338 break; 4339 } 4340 case c.BEFORE_HTML: { 4341 ba(this, t); 4342 break; 4343 } 4344 case c.BEFORE_HEAD: { 4345 Aa(this, t); 4346 break; 4347 } 4348 case c.IN_HEAD: { 4349 y(this, t); 4350 break; 4351 } 4352 case c.IN_HEAD_NO_SCRIPT: { 4353 Na(this, t); 4354 break; 4355 } 4356 case c.AFTER_HEAD: { 4357 ga(this, t); 4358 break; 4359 } 4360 case c.IN_BODY: { 4361 L(this, t); 4362 break; 4363 } 4364 case c.IN_TABLE: { 4365 G(this, t); 4366 break; 4367 } 4368 case c.IN_TABLE_TEXT: { 4369 X(this, t); 4370 break; 4371 } 4372 case c.IN_CAPTION: { 4373 ps(this, t); 4374 break; 4375 } 4376 case c.IN_COLUMN_GROUP: { 4377 ve(this, t); 4378 break; 4379 } 4380 case c.IN_TABLE_BODY: { 4381 he(this, t); 4382 break; 4383 } 4384 case c.IN_ROW: { 4385 Te(this, t); 4386 break; 4387 } 4388 case c.IN_CELL: { 4389 Cs(this, t); 4390 break; 4391 } 4392 case c.IN_SELECT: { 4393 Qt(this, t); 4394 break; 4395 } 4396 case c.IN_SELECT_IN_TABLE: { 4397 Ss(this, t); 4398 break; 4399 } 4400 case c.IN_TEMPLATE: { 4401 Ls(this, t); 4402 break; 4403 } 4404 case c.AFTER_BODY: { 4405 Ds(this, t); 4406 break; 4407 } 4408 case c.IN_FRAMESET: { 4409 Ps(this, t); 4410 break; 4411 } 4412 case c.AFTER_FRAMESET: { 4413 Ms(this, t); 4414 break; 4415 } 4416 case c.AFTER_AFTER_BODY: { 4417 ys(this, t); 4418 break; 4419 } 4420 case c.AFTER_AFTER_FRAMESET: { 4421 Us(this, t); 4422 break; 4423 } 4424 } 4425 } 4426 /** @internal */ 4427 onEndTag(t) { 4428 this.skipNextNewLine = !1, this.currentToken = t, this.currentNotInHTML ? ws(this, t) : this._endTagOutsideForeignContent(t); 4429 } 4430 /** @protected */ 4431 _endTagOutsideForeignContent(t) { 4432 switch (this.insertionMode) { 4433 case c.INITIAL: { 4434 K(this, t); 4435 break; 4436 } 4437 case c.BEFORE_HTML: { 4438 _a(this, t); 4439 break; 4440 } 4441 case c.BEFORE_HEAD: { 4442 pa(this, t); 4443 break; 4444 } 4445 case c.IN_HEAD: { 4446 Ia(this, t); 4447 break; 4448 } 4449 case c.IN_HEAD_NO_SCRIPT: { 4450 Ca(this, t); 4451 break; 4452 } 4453 case c.AFTER_HEAD: { 4454 Sa(this, t); 4455 break; 4456 } 4457 case c.IN_BODY: { 4458 le(this, t); 4459 break; 4460 } 4461 case c.TEXT: { 4462 ds(this, t); 4463 break; 4464 } 4465 case c.IN_TABLE: { 4466 te(this, t); 4467 break; 4468 } 4469 case c.IN_TABLE_TEXT: { 4470 X(this, t); 4471 break; 4472 } 4473 case c.IN_CAPTION: { 4474 Is(this, t); 4475 break; 4476 } 4477 case c.IN_COLUMN_GROUP: { 4478 Ns(this, t); 4479 break; 4480 } 4481 case c.IN_TABLE_BODY: { 4482 Pe(this, t); 4483 break; 4484 } 4485 case c.IN_ROW: { 4486 vt(this, t); 4487 break; 4488 } 4489 case c.IN_CELL: { 4490 gs(this, t); 4491 break; 4492 } 4493 case c.IN_SELECT: { 4494 qt(this, t); 4495 break; 4496 } 4497 case c.IN_SELECT_IN_TABLE: { 4498 Os(this, t); 4499 break; 4500 } 4501 case c.IN_TEMPLATE: { 4502 Rs(this, t); 4503 break; 4504 } 4505 case c.AFTER_BODY: { 4506 Gt(this, t); 4507 break; 4508 } 4509 case c.IN_FRAMESET: { 4510 xs(this, t); 4511 break; 4512 } 4513 case c.AFTER_FRAMESET: { 4514 Bs(this, t); 4515 break; 4516 } 4517 case c.AFTER_AFTER_BODY: { 4518 ie(this, t); 4519 break; 4520 } 4521 } 4522 } 4523 /** @internal */ 4524 onEof(t) { 4525 switch (this.insertionMode) { 4526 case c.INITIAL: { 4527 K(this, t); 4528 break; 4529 } 4530 case c.BEFORE_HTML: { 4531 z(this, t); 4532 break; 4533 } 4534 case c.BEFORE_HEAD: { 4535 J(this, t); 4536 break; 4537 } 4538 case c.IN_HEAD: { 4539 Z(this, t); 4540 break; 4541 } 4542 case c.IN_HEAD_NO_SCRIPT: { 4543 $(this, t); 4544 break; 4545 } 4546 case c.AFTER_HEAD: { 4547 ee(this, t); 4548 break; 4549 } 4550 case c.IN_BODY: 4551 case c.IN_TABLE: 4552 case c.IN_CAPTION: 4553 case c.IN_COLUMN_GROUP: 4554 case c.IN_TABLE_BODY: 4555 case c.IN_ROW: 4556 case c.IN_CELL: 4557 case c.IN_SELECT: 4558 case c.IN_SELECT_IN_TABLE: { 4559 Ht(this, t); 4560 break; 4561 } 4562 case c.TEXT: { 4563 Es(this, t); 4564 break; 4565 } 4566 case c.IN_TABLE_TEXT: { 4567 X(this, t); 4568 break; 4569 } 4570 case c.IN_TEMPLATE: { 4571 Wt(this, t); 4572 break; 4573 } 4574 case c.AFTER_BODY: 4575 case c.IN_FRAMESET: 4576 case c.AFTER_FRAMESET: 4577 case c.AFTER_AFTER_BODY: 4578 case c.AFTER_AFTER_FRAMESET: { 4579 Ye(this, t); 4580 break; 4581 } 4582 } 4583 } 4584 /** @internal */ 4585 onWhitespaceCharacter(t) { 4586 if (this.skipNextNewLine && (this.skipNextNewLine = !1, t.chars.charCo
4586deAt(0) === r.LINE_FEED)) { 4587 if (t.chars.length === 1) 4588 return; 4589 t.chars = t.chars.substr(1); 4590 } 4591 if (this.tokenizer.inForeignNode) { 4592 this._insertCharacters(t); 4593 return; 4594 } 4595 switch (this.insertionMode) { 4596 case c.IN_HEAD: 4597 case c.IN_HEAD_NO_SCRIPT: 4598 case c.AFTER_HEAD: 4599 case c.TEXT: 4600 case c.IN_COLUMN_GROUP: 4601 case c.IN_SELECT: 4602 case c.IN_SELECT_IN_TABLE: 4603 case c.IN_FRAMESET: 4604 case c.AFTER_FRAMESET: { 4605 this._insertCharacters(t); 4606 break; 4607 } 4608 case c.IN_BODY: 4609 case c.IN_CAPTION: 4610 case c.IN_CELL: 4611 case c.IN_TEMPLATE: 4612 case c.AFTER_BODY: 4613 case c.AFTER_AFTER_BODY: 4614 case c.AFTER_AFTER_FRAMESET: { 4615 Mt(this, t); 4616 break; 4617 } 4618 case c.IN_TABLE: 4619 case c.IN_TABLE_BODY: 4620 case c.IN_ROW: { 4621 be(this, t); 4622 break; 4623 } 4624 case c.IN_TABLE_TEXT: { 4625 Ft(this, t); 4626 break; 4627 } 4628 } 4629 } 4630} 4631function ca(e, t) { 4632 let u = e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName); 4633 return u ? e.openElements.contains(u.element) ? e.openElements.hasInScope(t.tagID) || (u = null) : (e.activeFormattingElements.removeEntry(u), u = null) : kt(e, t), u; 4634} 4635function oa(e, t) { 4636 let u = null, s = e.openElements.stackTop; 4637 for (; s >= 0; s--) { 4638 const n = e.openElements.items[s]; 4639 if (n === t.element) 4640 break; 4641 e._isSpecialElement(n, e.openElements.tagIDs[s]) && (u = n); 4642 } 4643 return u || (e.openElements.shortenToLength(Math.max(s, 0)), e.activeFormattingElements.removeEntry(t)), u; 4644} 4645function da(e, t, u) { 4646 let s = t, n = e.openElements.getCommonAncestor(t); 4647 for (let o = 0, E = n; E !== u; o++, E = n) { 4648 n = e.openElements.getCommonAncestor(E); 4649 const l = e.activeFormattingElements.getElementEntry(E), T = l && o >= na; 4650 !l || T ? (T && e.activeFormattingElements.removeEntry(l), e.openElements.remove(E)) : (E = Ea(e, l), s === t && (e.activeFormattingElements.bookmark = l), e.treeAdapter.detachNode(s), e.treeAdapter.appendChild(E, s), s = E); 4651 } 4652 return s; 4653} 4654function Ea(e, t) { 4655 const u = e.treeAdapter.getNamespaceURI(t.element), s = e.treeAdapter.createElement(t.token.tagName, u, t.token.attrs); 4656 return e.openElements.replace(t.element, s), t.element = s, s; 4657} 4658function fa(e, t, u) { 4659 const s = e.treeAdapter.getTagName(t), n = Ee(s); 4660 if (e._isElementCausesFosterParenting(n)) 4661 e._fosterParentElement(u); 4662 else { 4663 const o = e.treeAdapter.getNamespaceURI(t); 4664 n === a.TEMPLATE && o === h.HTML && (t = e.treeAdapter.getTemplateContent(t)), e.treeAdapter.appendChild(t, u); 4665 } 4666} 4667function la(e, t, u) { 4668 const s = e.treeAdapter.getNamespaceURI(u.element), { token: n } = u, o = e.treeAdapter.createElement(n.tagName, s, n.attrs); 4669 e._adoptNodes(t, o), e.treeAdapter.appendChild(t, o), e.activeFormattingElements.insertElementAfterBookmark(o, n), e.activeFormattingElements.removeEntry(u), e.openElements.remove(u.element), e.openElements.insertAfter(t, o, n.tagID); 4670} 4671function we(e, t) { 4672 for (let u = 0; u < ra; u++) { 4673 const s = ca(e, t); 4674 if (!s) 4675 break; 4676 const n = oa(e, s); 4677 if (!n) 4678 break; 4679 e.activeFormattingElements.bookmark = s; 4680 const o = da(e, n, s.element), E = e.openElements.getCommonAncestor(s.element); 4681 e.treeAdapter.detachNode(o), E && fa(e, E, o), la(e, n, s); 4682 } 4683} 4684function De(e, t) { 4685 e._appendCommentNode(t, e.openElements.currentTmplContentOrNode); 4686} 4687function ha(e, t) { 4688 e._appendCommentNode(t, e.openElements.items[0]); 4689} 4690function Ta(e, t) { 4691 e._appendCommentNode(t, e.document); 4692} 4693function Ye(e, t) { 4694 if (e.stopped = !0, t.location) { 4695 const u = e.fragmentContext ? 0 : 2; 4696 for (let s = e.openElements.stackTop; s >= u; s--) 4697 e._setEndLocation(e.openElements.items[s], t); 4698 if (!e.fragmentContext && e.openElements.stackTop >= 0) { 4699 const s = e.openElements.items[0], n = e.treeAdapter.getNodeSourceCodeLocation(s); 4700 if (n && !n.endTag && (e._setEndLocation(s, t), e.openElements.stackTop >= 1)) { 4701 const o = e.openElements.items[1], E = e.treeAdapter.getNodeSourceCodeLocation(o); 4702 E && !E.endTag && e._setEndLocation(o, t); 4703 } 4704 } 4705 } 4706} 4707function ma(e, t) { 4708 e._setDocumentType(t); 4709 const u = t.forceQuirks ? M.QUIRKS : Vu(t); 4710 Gu(t) || e._err(t, f.nonConformingDoctype), e.treeAdapter.setDocumentMode(e.document, u), e.insertionMode = c.BEFORE_HTML; 4711} 4712function K(e, t) { 4713 e._err(t, f.missingDoctype, !0), e.treeAdapter.setDocumentMode(e.document, M.QUIRKS), e.insertionMode = c.BEFORE_HTML, e._processToken(t); 4714} 4715function ba(e, t) { 4716 t.tagID === a.HTML ? (e._insertElement(t, h.HTML), e.insertionMode = c.BEFORE_HEAD) : z(e, t); 4717} 4718function _a(e, t) { 4719 const u = t.tagID; 4720 (u === a.HTML || u === a.HEAD || u === a.BODY || u === a.BR) && z(e, t); 4721} 4722function z(e, t) { 4723 e._insertFakeRootElement(), e.insertionMode = c.BEFORE_HEAD, e._processToken(t); 4724} 4725function Aa(e, t) { 4726 switch (t.tagID) { 4727 case a.HTML: { 4728 L(e, t); 4729 break; 4730 } 4731 case a.HEAD: { 4732 e._insertElement(t, h.HTML), e.headElement = e.openElements.current, e.insertionMode = c.IN_HEAD; 4733 break; 4734 } 4735 default: 4736 J(e, t); 4737 } 4738} 4739function pa(e, t) { 4740 const u = t.tagID; 4741 u === a.HEAD || u === a.BODY || u === a.HTML || u === a.BR ? J(e, t) : e._err(t, f.endTagWithoutMatchingOpenElement); 4742} 4743function J(e, t) { 4744 e._insertFakeElement(d.HEAD, a.HEAD), e.headElement = e.openElements.current, e.insertionMode = c.IN_HEAD, e._processToken(t); 4745} 4746function y(e, t) { 4747 switch (t.tagID) { 4748 case a.HTML: { 4749 L(e, t); 4750 break; 4751 } 4752 case a.BASE: 4753 case a.BASEFONT: 4754 case a.BGSOUND: 4755 case a.LINK: 4756 case a.META: { 4757 e._appendElement(t, h.HTML), t.ackSelfClosing = !0; 4758 break; 4759 } 4760 case a.TITLE: { 4761 e._switchToTextParsing(t, P.RCDATA); 4762 break; 4763 } 4764 case a.NOSCRIPT: { 4765 e.options.scriptingEnabled ? e._switchToTextParsing(t, P.RAWTEXT) : (e._insertElement(t, h.HTML), e.insertionMode = c.IN_HEAD_NO_SCRIPT); 4766 break; 4767 } 4768 case a.NOFRAMES: 4769 case a.STYLE: { 4770 e._switchToTextParsing(t, P.RAWTEXT); 4771 break; 4772 } 4773 case a.SCRIPT: { 4774 e._switchToTextParsing(t, P.SCRIPT_DATA); 4775 break; 4776 } 4777 case a.TEMPLATE: { 4778 e._insertTemplate(t), e.activeFormattingElements.insertMarker(), e.framesetOk = !1, e.insertionMode = c.IN_TEMPLATE, e.tmplInsertionModeStack.unshift(c.IN_TEMPLATE); 4779 break; 4780 } 4781 case a.HEAD: { 4782 e._err(t, f.misplacedStartTagForHeadElement); 4783 break; 4784 } 4785 default: 4786 Z(e, t); 4787 } 4788} 4789function Ia(e, t) { 4790 switch (t.tagID) { 4791 case a.HEAD: { 4792 e.openElements.pop(), e.insertionMode = c.AFTER_HEAD; 4793 break; 4794 } 4795 case a.BODY: 4796 case a.BR: 4797 case a.HTML: { 4798 Z(e, t); 4799 break; 4800 } 4801 case a.TEMPLATE: { 4802 q(e, t); 4803 break; 4804 } 4805 default: 4806 e._err(t, f.endTagWithoutMatchingOpenElement); 4807 } 4808} 4809function q(e, t) { 4810 e.openElements.tmplCount >
4810 0 ? (e.openElements.generateImpliedEndTagsThoroughly(), e.openElements.currentTagId !== a.TEMPLATE && e._err(t, f.closingOfElementWithOpenChildElements), e.openElements.popUntilTagNamePopped(a.TEMPLATE), e.activeFormattingElements.clearToLastMarker(), e.tmplInsertionModeStack.shift(), e._resetInsertionMode()) : e._err(t, f.endTagWithoutMatchingOpenElement); 4811} 4812function Z(e, t) { 4813 e.openElements.pop(), e.insertionMode = c.AFTER_HEAD, e._processToken(t); 4814} 4815function Na(e, t) { 4816 switch (t.tagID) { 4817 case a.HTML: { 4818 L(e, t); 4819 break; 4820 } 4821 case a.BASEFONT: 4822 case a.BGSOUND: 4823 case a.HEAD: 4824 case a.LINK: 4825 case a.META: 4826 case a.NOFRAMES: 4827 case a.STYLE: { 4828 y(e, t); 4829 break; 4830 } 4831 case a.NOSCRIPT: { 4832 e._err(t, f.nestedNoscriptInHead); 4833 break; 4834 } 4835 default: 4836 $(e, t); 4837 } 4838} 4839function Ca(e, t) { 4840 switch (t.tagID) { 4841 case a.NOSCRIPT: { 4842 e.openElements.pop(), e.insertionMode = c.IN_HEAD; 4843 break; 4844 } 4845 case a.BR: { 4846 $(e, t); 4847 break; 4848 } 4849 default: 4850 e._err(t, f.endTagWithoutMatchingOpenElement); 4851 } 4852} 4853function $(e, t) { 4854 const u = t.type === p.EOF ? f.openElementsLeftAfterEof : f.disallowedContentInNoscriptInHead; 4855 e._err(t, u), e.openElements.pop(), e.insertionMode = c.IN_HEAD, e._processToken(t); 4856} 4857function ga(e, t) { 4858 switch (t.tagID) { 4859 case a.HTML: { 4860 L(e, t); 4861 break; 4862 } 4863 case a.BODY: { 4864 e._insertElement(t, h.HTML), e.framesetOk = !1, e.insertionMode = c.IN_BODY; 4865 break; 4866 } 4867 case a.FRAMESET: { 4868 e._insertElement(t, h.HTML), e.insertionMode = c.IN_FRAMESET; 4869 break; 4870 } 4871 case a.BASE: 4872 case a.BASEFONT: 4873 case a.BGSOUND: 4874 case a.LINK: 4875 case a.META: 4876 case a.NOFRAMES: 4877 case a.SCRIPT: 4878 case a.STYLE: 4879 case a.TEMPLATE: 4880 case a.TITLE: { 4881 e._err(t, f.abandonedHeadElementChild), e.openElements.push(e.headElement, a.HEAD), y(e, t), e.openElements.remove(e.headElement); 4882 break; 4883 } 4884 case a.HEAD: { 4885 e._err(t, f.misplacedStartTagForHeadElement); 4886 break; 4887 } 4888 default: 4889 ee(e, t); 4890 } 4891} 4892function Sa(e, t) { 4893 switch (t.tagID) { 4894 case a.BODY: 4895 case a.HTML: 4896 case a.BR: { 4897 ee(e, t); 4898 break; 4899 } 4900 case a.TEMPLATE: { 4901 q(e, t); 4902 break; 4903 } 4904 default: 4905 e._err(t, f.endTagWithoutMatchingOpenElement); 4906 } 4907} 4908function ee(e, t) { 4909 e._insertFakeElement(d.BODY, a.BODY), e.insertionMode = c.IN_BODY, fe(e, t); 4910} 4911function fe(e, t) { 4912 switch (t.type) { 4913 case p.CHARACTER: { 4914 Bt(e, t); 4915 break; 4916 } 4917 case p.WHITESPACE_CHARACTER: { 4918 Mt(e, t); 4919 break; 4920 } 4921 case p.COMMENT: { 4922 De(e, t); 4923 break; 4924 } 4925 case p.START_TAG: { 4926 L(e, t); 4927 break; 4928 } 4929 case p.END_TAG: { 4930 le(e, t); 4931 break; 4932 } 4933 case p.EOF: { 4934 Ht(e, t); 4935 break; 4936 } 4937 } 4938} 4939function Mt(e, t) { 4940 e._reconstructActiveFormattingElements(), e._insertCharacters(t); 4941} 4942function Bt(e, t) { 4943 e._reconstructActiveFormattingElements(), e._insertCharacters(t), e.framesetOk = !1; 4944} 4945function Oa(e, t) { 4946 e.openElements.tmplCount === 0 && e.treeAdapter.adoptAttributes(e.openElements.items[0], t.attrs); 4947} 4948function La(e, t) { 4949 const u = e.openElements.tryPeekProperlyNestedBodyElement(); 4950 u && e.openElements.tmplCount === 0 && (e.framesetOk = !1, e.treeAdapter.adoptAttributes(u, t.attrs)); 4951} 4952function Ra(e, t) { 4953 const u = e.openElements.tryPeekProperlyNestedBodyElement(); 4954 e.framesetOk && u && (e.treeAdapter.detachNode(u), e.openElements.popAllUpToHtmlElement(), e._insertElement(t, h.HTML), e.insertionMode = c.IN_FRAMESET); 4955} 4956function Da(e, t) { 4957 e.openElements.hasInButtonScope(a.P) && e._closePElement(), e._insertElement(t, h.HTML); 4958} 4959function Pa(e, t) { 4960 e.openElements.hasInButtonScope(a.P) && e._closePElement(), e.openElements.currentTagId !== void 0 && Re.has(e.openElements.currentTagId) && e.openElements.pop(), e._insertElement(t, h.HTML); 4961} 4962function xa(e, t) { 4963 e.openElements.hasInButtonScope(a.P) && e._closePElement(), e._insertElement(t, h.HTML), e.skipNextNewLine = !0, e.framesetOk = !1; 4964} 4965function Ma(e, t) { 4966 const u = e.openElements.tmplCount > 0; 4967 (!e.formElement || u) && (e.openElements.hasInButtonScope(a.P) && e._closePElement(), e._insertElement(t, h.HTML), u || (e.formElement = e.openElements.current)); 4968} 4969function Ba(e, t) { 4970 e.framesetOk = !1; 4971 const u = t.tagID; 4972 for (let s = e.openElements.stackTop; s >= 0; s--) { 4973 const n = e.openElements.tagIDs[s]; 4974 if (u === a.LI && n === a.LI || (u === a.DD || u === a.DT) && (n === a.DD || n === a.DT)) { 4975 e.openElements.generateImpliedEndTagsWithExclusion(n), e.o
vendor: 7,875 bytes, lines 4975-5278
4975penElements.popUntilTagNamePopped(n); 4976 break; 4977 } 4978 if (n !== a.ADDRESS && n !== a.DIV && n !== a.P && e._isSpecialElement(e.openElements.items[s], n)) 4979 break; 4980 } 4981 e.openElements.hasInButtonScope(a.P) && e._closePElement(), e._insertElement(t, h.HTML); 4982} 4983function ya(e, t) { 4984 e.openElements.hasInButtonScope(a.P) && e._closePElement(), e._insertElement(t, h.HTML), e.tokenizer.state = P.PLAINTEXT; 4985} 4986function Ua(e, t) { 4987 e.openElements.hasInScope(a.BUTTON) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(a.BUTTON)), e._reconstructActiveFormattingElements(), e._insertElement(t, h.HTML), e.framesetOk = !1; 4988} 4989function ka(e, t) { 4990 const u = e.activeFormattingElements.getElementEntryInScopeWithTagName(d.A); 4991 u && (we(e, t), e.openElements.remove(u.element), e.activeFormattingElements.removeEntry(u)), e._reconstructActiveFormattingElements(), e._insertElement(t, h.HTML), e.activeFormattingElements.pushElement(e.openElements.current, t); 4992} 4993function Ha(e, t) { 4994 e._reconstructActiveFormattingElements(), e._insertElement(t, h.HTML), e.activeFormattingElements.pushElement(e.openElements.current, t); 4995} 4996function Fa(e, t) { 4997 e._reconstructActiveFormattingElements(), e.openElements.hasInScope(a.NOBR) && (we(e, t), e._reconstructActiveFormattingElements()), e._insertElement(t, h.HTML), e.activeFormattingElements.pushElement(e.openElements.current, t); 4998} 4999function wa(e, t) { 5000 e._reconstructActiveFormattingElements(), e._insertElement(t, h.HTML), e.activeFormattingElements.insertMarker(), e.framesetOk = !1; 5001} 5002function Ya(e, t) { 5003 e.treeAdapter.getDocumentMode(e.document) !== M.QUIRKS && e.openElements.hasInButtonScope(a.P) && e._closePElement(), e._insertElement(t, h.HTML), e.framesetOk = !1, e.insertionMode = c.IN_TABLE; 5004} 5005function yt(e, t) { 5006 e._reconstructActiveFormattingElements(), e._appendElement(t, h.HTML), e.framesetOk = !1, t.ackSelfClosing = !0; 5007} 5008function Ut(e) { 5009 const t = Nt(e, Q.TYPE); 5010 return t != null && t.toLowerCase() === sa; 5011} 5012function va(e, t) { 5013 e._reconstructActiveFormattingElements(), e._appendElement(t, h.HTML), Ut(t) || (e.framesetOk = !1), t.ackSelfClosing = !0; 5014} 5015function Qa(e, t) { 5016 e._appendElement(t, h.HTML), t.ackSelfClosing = !0; 5017} 5018function qa(e, t) { 5019 e.openElements.hasInButtonScope(a.P) && e._closePElement(), e._appendElement(t, h.HTML), e.framesetOk = !1, t.ackSelfClosing = !0; 5020} 5021function Wa(e, t) { 5022 t.tagName = d.IMG, t.tagID = a.IMG, yt(e, t); 5023} 5024function Ga(e, t) { 5025 e._insertElement(t, h.HTML), e.skipNextNewLine = !0, e.tokenizer.state = P.RCDATA, e.originalInsertionMode = e.insertionMode, e.framesetOk = !1, e.insertionMode = c.TEXT; 5026} 5027function Va(e, t) { 5028 e.openElements.hasInButtonScope(a.P) && e._closePElement(), e._reconstructActiveFormattingElements(), e.framesetOk = !1, e._switchToTextParsing(t, P.RAWTEXT); 5029} 5030function Ka(e, t) { 5031 e.framesetOk = !1, e._switchToTextParsing(t, P.RAWTEXT); 5032} 5033function nt(e, t) { 5034 e._switchToTextParsing(t, P.RAWTEXT); 5035} 5036function Xa(e, t) { 5037 e._reconstructActiveFormattingElements(), e._insertElement(t, h.HTML), e.framesetOk = !1, e.insertionMode = e.insertionMode === c.IN_TABLE || e.insertionMode === c.IN_CAPTION || e.insertionMode === c.IN_TABLE_BODY || e.insertionMode === c.IN_ROW || e.insertionMode === c.IN_CELL ? c.IN_SELECT_IN_TABLE : c.IN_SELECT; 5038} 5039function ja(e, t) { 5040 e.openElements.currentTagId === a.OPTION && e.openElements.pop(), e._reconstructActiveFormattingElements(), e._insertElement(t, h.HTML); 5041} 5042function za(e, t) { 5043 e.openElements.hasInScope(a.RUBY) && e.openElements.generateImpliedEndTags(), e._insertElement(t, h.HTML); 5044} 5045function Ja(e, t) { 5046 e.openElements.hasInScope(a.RUBY) && e.openElements.generateImpliedEndTagsWithExclusion(a.RTC), e._insertElement(t, h.HTML); 5047} 5048function Za(e, t) { 5049 e._reconstructActiveFormattingElements(), Rt(t), Fe(t), t.selfClosing ? e._appendElement(t, h.MATHML) : e._insertElement(t, h.MATHML), t.ackSelfClosing = !0; 5050} 5051function $a(e, t) { 5052 e._reconstructActiveFormattingElements(), Dt(t), Fe(t), t.selfClosing ? e._appendElement(t, h.SVG) : e._insertElement(t, h.SVG), t.ackSelfClosing = !0; 5053} 5054function it(e, t) { 5055 e._reconstructActiveFormattingElements(), e._insertElement(t, h.HTML); 5056} 5057function L(e, t) { 5058 switch (t.tagID) { 5059 case a.I: 5060 case a.S: 5061 case a.B: 5062 case a.U: 5063 case a.EM: 5064 case a.TT: 5065 case a.BIG: 5066 case a.CODE: 5067 case a.FONT: 5068 case a.SMALL: 5069 case a.STRIKE: 5070 case a.STRONG: { 5071 Ha(e, t); 5072 break; 5073 } 5074 case a.A: { 5075 ka(e, t); 5076 break; 5077 } 5078 case a.H1: 5079 case a.H2: 5080 case a.H3: 5081 case a.H4: 5082 case a.H5: 5083 case a.H6: { 5084 Pa(e, t); 5085 break; 5086 } 5087 case a.P: 5088 case a.DL: 5089 case a.OL: 5090 case a.UL: 5091 case a.DIV: 5092 case a.DIR: 5093 case a.NAV: 5094 case a.MAIN: 5095 case a.MENU: 5096 case a.ASIDE: 5097 case a.CENTER: 5098 case a.FIGURE: 5099 case a.FOOTER: 5100 case a.HEADER: 5101 case a.HGROUP: 5102 case a.DIALOG: 5103 case a.DETAILS: 5104 case a.ADDRESS: 5105 case a.ARTICLE: 5106 case a.SEARCH: 5107 case a.SECTION: 5108 case a.SUMMARY: 5109 case a.FIELDSET: 5110 case a.BLOCKQUOTE: 5111 case a.FIGCAPTION: { 5112 Da(e, t); 5113 break; 5114 } 5115 case a.LI: 5116 case a.DD: 5117 case a.DT: { 5118 Ba(e, t); 5119 break; 5120 } 5121 case a.BR: 5122 case a.IMG: 5123 case a.WBR: 5124 case a.AREA: 5125 case a.EMBED: 5126 case a.KEYGEN: { 5127 yt(e, t); 5128 break; 5129 } 5130 case a.HR: { 5131 qa(e, t); 5132 break; 5133 } 5134 case a.RB: 5135 case a.RTC: { 5136 za(e, t); 5137 break; 5138 } 5139 case a.RT: 5140 case a.RP: { 5141 Ja(e, t); 5142 break; 5143 } 5144 case a.PRE: 5145 case a.LISTING: { 5146 xa(e, t); 5147 break; 5148 } 5149 case a.XMP: { 5150 Va(e, t); 5151 break; 5152 } 5153 case a.SVG: { 5154 $a(e, t); 5155 break; 5156 } 5157 case a.HTML: { 5158 Oa(e, t); 5159 break; 5160 } 5161 case a.BASE: 5162 case a.LINK: 5163 case a.META: 5164 case a.STYLE: 5165 case a.TITLE: 5166 case a.SCRIPT: 5167 case a.BGSOUND: 5168 case a.BASEFONT: 5169 case a.TEMPLATE: { 5170 y(e, t); 5171 break; 5172 } 5173 case a.BODY: { 5174 La(e, t); 5175 break; 5176 } 5177 case a.FORM: { 5178 Ma(e, t); 5179 break; 5180 } 5181 case a.NOBR: { 5182 Fa(e, t); 5183 break; 5184 } 5185 case a.MATH: { 5186 Za(e, t); 5187 break; 5188 } 5189 case a.TABLE: { 5190 Ya(e, t); 5191 break; 5192 } 5193 case a.INPUT: { 5194 va(e, t); 5195 break; 5196 } 5197 case a.PARAM: 5198 case a.TRACK: 5199 case a.SOURCE: { 5200 Qa(e, t); 5201 break; 5202 } 5203 case a.IMAGE: { 5204 Wa(e, t); 5205 break; 5206 } 5207 case a.BUTTON: { 5208 Ua(e, t); 5209 break; 5210 } 5211 case a.APPLET: 5212 case a.OBJECT: 5213 case a.MARQUEE: { 5214 wa(e, t); 5215 break; 5216 } 5217 case a.IFRAME: { 5218 Ka(e, t); 5219 break; 5220 } 5221 case a.SELECT: { 5222 Xa(e, t); 5223 break; 5224 } 5225 case a.OPTION: 5226 case a.OPTGROUP: { 5227 ja(e, t); 5228 break; 5229 } 5230 case a.NOEMBED: 5231 case a.NOFRAMES: { 5232 nt(e, t); 5233 break; 5234 } 5235 case a.FRAMESET: { 5236 Ra(e, t); 5237 break; 5238 } 5239 case a.TEXTAREA: { 5240 Ga(e, t); 5241 break; 5242 } 5243 case a.NOSCRIPT: { 5244 e.options.scriptingEnabled ? nt(e, t) : it(e, t); 5245 break; 5246 } 5247 case a.PLAINTEXT: { 5248 ya(e, t); 5249 break; 5250 } 5251 case a.COL: 5252 case a.TH: 5253 case a.TD: 5254 case a.TR: 5255 case a.HEAD: 5256 case a.FRAME: 5257 case a.TBODY: 5258 case a.TFOOT: 5259 case a.THEAD: 5260 case a.CAPTION: 5261 case a.COLGROUP: 5262 break; 5263 default: 5264 it(e, t); 5265 } 5266} 5267function es(e, t) { 5268 if (e.openElements.hasInScope(a.BODY) && (e.insertionMode = c.AFTER_BODY, e.options.sourceCodeLocationInfo)) { 5269 const u = e.openElements.tryPeekProperlyNestedBodyElement(); 5270 u && e._setEndLocation(u, t); 5271 } 5272} 5273function ts(e, t) { 5274 e.openElements.hasInScope(a.BODY) && (e.insertionMode = c.AFTER_BODY, Gt(e, t)); 5275} 5276function us(e, t) { 5277 const u = t.tagID; 5278 e.openElements.hasInScope(u) && (e.openElements.generateImpliedEndTags(), e.o
5278penElements.popUntilTagNamePopped(u)); 5279} 5280function as(e) { 5281 const t = e.openElements.tmplCount > 0, { formElement: u } = e; 5282 t || (e.formElement = null), (u || t) && e.openElements.hasInScope(a.FORM) && (e.openElements.generateImpliedEndTags(), t ? e.openElements.popUntilTagNamePopped(a.FORM) : u && e.openElements.remove(u)); 5283} 5284function ss(e) { 5285 e.openElements.hasInButtonScope(a.P) || e._insertFakeElement(d.P, a.P), e._closePElement(); 5286} 5287function rs(e) { 5288 e.openElements.hasInListItemScope(a.LI) && (e.openElements.generateImpliedEndTagsWithExclusion(a.LI), e.openElements.popUntilTagNamePopped(a.LI)); 5289} 5290function ns(e, t) { 5291 const u = t.tagID; 5292 e.openElements.hasInScope(u) && (e.openElements.generateImpliedEndTagsWithExclusion(u), e.openElements.popUntilTagNamePopped(u)); 5293} 5294function is(e) { 5295 e.openElements.hasNumberedHeaderInScope() && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilNumberedHeaderPopped()); 5296} 5297function cs(e, t) { 5298 const u = t.tagID; 5299 e.openElements.hasInScope(u) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(u), e.activeFormattingElements.clearToLastMarker()); 5300} 5301function os(e) { 5302 e._reconstructActiveFormattingElements(), e._insertFakeElement(d.BR, a.BR), e.openElements.pop(), e.framesetOk = !1; 5303} 5304function kt(e, t) { 5305 const u = t.tagName, s = t.tagID; 5306 for (let n = e.openElements.stackTop; n > 0; n--) { 5307 const o = e.openElements.items[n], E = e.openElements.tagIDs[n]; 5308 if (s === E && (s !== a.UNKNOWN || e.treeAdapter.getTagName(o) === u)) { 5309 e.openElements.generateImpliedEndTagsWithExclusion(s), e.openElements.stackTop >= n && e.openElements.shortenToLength(n); 5310 break; 5311 } 5312 if (e._isSpecialElement(o, E)) 5313 break; 5314 } 5315} 5316function le(e, t) { 5317 switch (t.tagID) { 5318 case a.A: 5319 case a.B: 5320 case a.I: 5321 case a.S: 5322 case a.U: 5323 case a.EM: 5324 case a.TT: 5325 case a.BIG: 5326 case a.CODE: 5327 case a.FONT: 5328 case a.NOBR: 5329 case a.SMALL: 5330 case a.STRIKE: 5331 case a.STRONG: { 5332 we(e, t); 5333 break; 5334 } 5335 case a.P: { 5336 ss(e); 5337 break; 5338 } 5339 case a.DL: 5340 case a.UL: 5341 case a.OL: 5342 case a.DIR: 5343 case a.DIV: 5344 case a.NAV: 5345 case a.PRE: 5346 case a.MAIN: 5347 case a.MENU: 5348 case a.ASIDE: 5349 case a.BUTTON: 5350 case a.CENTER: 5351 case a.FIGURE: 5352 case a.FOOTER: 5353 case a.HEADER: 5354 case a.HGROUP: 5355 case a.DIALOG: 5356 case a.ADDRESS: 5357 case a.ARTICLE: 5358 case a.DETAILS: 5359 case a.SEARCH: 5360 case a.SECTION: 5361 case a.SUMMARY: 5362 case a.LISTING: 5363 case a.FIELDSET: 5364 case a.BLOCKQUOTE: 5365 case a.FIGCAPTION: { 5366 us(e, t); 5367 break; 5368 } 5369 case a.LI: { 5370 rs(e); 5371 break; 5372 } 5373 case a.DD: 5374 case a.DT: { 5375 ns(e, t); 5376 break; 5377 } 5378 case a.H1: 5379 case a.H2: 5380 case a.H3: 5381 case a.H4: 5382 case a.H5: 5383 case a.H6: { 5384 is(e); 5385 break; 5386 } 5387 case a.BR: { 5388 os(e); 5389 break; 5390 } 5391 case a.BODY: { 5392 es(e, t); 5393 break; 5394 } 5395 case a.HTML: { 5396 ts(e, t); 5397 break; 5398 } 5399 case a.FORM: { 5400 as(e); 5401 break; 5402 } 5403 case a.APPLET: 5404 case a.OBJECT: 5405 case a.MARQUEE: { 5406 cs(e, t); 5407 break; 5408 } 5409 case a.TEMPLATE: { 5410 q(e, t); 5411 break; 5412 } 5413 default: 5414 kt(e, t); 5415 } 5416} 5417function Ht(e, t) { 5418 e.tmplInsertionModeStack.length > 0 ? Wt(e, t) : Ye(e, t); 5419} 5420function ds(e, t) { 5421 var u; 5422 t.tagID === a.SCRIPT && ((u = e.scriptHandler) === null || u === void 0 || u.call(e, e.openElements.current)), e.openElements.pop(), e.insertionMode = e.originalInsertionMode; 5423} 5424function Es(e, t) { 5425 e._err(t, f.eofInElementThatCanContainOnlyText), e.openElements.pop(), e.insertionMode = e.originalInsertionMode, e.onEof(t); 5426} 5427function be(e, t) { 5428 if (e.openElements.currentTagId !== void 0 && Pt.has(e.openElements.currentTagId)) 5429 switch (e.pendingCharacterTokens.length = 0, e.hasNonWhitespacePendingCharacterToken = !1, e.originalInsertionMode = e.insertionMode, e.insertionMode = c.IN_TABLE_TEXT, t.type) { 5430 case p.CHARACTER: { 5431 wt(e, t); 5432 break; 5433 } 5434 case p.WHITESPACE_CHARACTER: { 5435 Ft(e, t); 5436 break; 5437 } 5438 } 5439 else 5440 ue(e, t); 5441} 5442function fs(e, t) { 5443 e.openElements.clearBackToTableContext(), e.activeFormattingElements.insertMarker(), e._insertElement(t, h.HTML), e.insertionMode = c.IN_CAPTION; 5444} 5445function ls(e, t) { 5446 e.openElements.clearBackToTableContext(), e._insertElement(t, h.HTML), e.insertionMode = c.IN_COLUMN_GROUP; 5447} 5448function hs(e, t) { 5449 e.openElements.clearBackToTableContext(), e._insertFakeElement(d.COLGROUP, a.COLGROUP), e.insertionMode = c.IN_COLUMN_GROUP, ve(e, t); 5450} 5451function Ts(e, t) { 5452 e.openElements.clearBackToTableContext(), e._insertElement(t, h.HTML), e.insertionMode = c.IN_TABLE_BODY; 5453} 5454function ms(e, t) { 5455 e.openElements.clearBackToTableContext(), e._insertFakeElement(d.TBODY, a.TBODY), e.insertionMode = c.IN_TABLE_BODY, he(e, t); 5456} 5457function bs(e, t) { 5458 e.openElements.hasInTableScope(a.TABLE) && (e.openElements.popUntilTagNamePopped(a.TABLE), e._resetInsertionMode(), e._processStartTag(t)); 5459} 5460function _s(e, t) { 5461 Ut(t) ? e._appendElement(t, h.HTML) : ue(e, t), t.ackSelfClosing = !0; 5462} 5463function As(e, t) { 5464 !e.formElement && e.openElements.tmplCount === 0 && (e._insertElement(t, h.HTML), e.formElement = e.openElements.current, e.openElements.pop()); 5465} 5466function G(e, t) { 5467 switch (t.tagID) { 5468 case a.TD: 5469 case a.TH: 5470 case a.TR: { 5471 ms(e, t); 5472 break; 5473 } 5474 case a.STYLE: 5475 case a.SCRIPT: 5476 case a.TEMPLATE: { 5477 y(e, t); 5478 break; 5479 } 5480 case a.COL: { 5481 hs(e, t); 5482 break; 5483 } 5484 case a.FORM: { 5485 As(e, t); 5486 break; 5487 } 5488 case a.TABLE: { 5489 bs(e, t); 5490 break; 5491 } 5492 case a.TBODY: 5493 case a.TFOOT: 5494 case a.THEAD: { 5495 Ts(e, t); 5496 break; 5497 } 5498 case a.INPUT: { 5499 _s(e, t); 5500 break; 5501 } 5502 case a.CAPTION: { 5503 fs(e, t); 5504 break; 5505 } 5506 case a.COLGROUP: { 5507 ls(e, t); 5508 break; 5509 } 5510 default: 5511 ue(e, t); 5512 } 5513} 5514function te(e, t) { 5515 switch (t.tagID) { 5516 case a.TABLE: { 5517 e.openElements.hasInTableScope(a.TABLE) && (e.openElements.popUntilTagNamePopped(a.TABLE), e._resetInsertionMode()); 5518 break; 5519 } 5520 case a.TEMPLATE: { 5521 q(e, t); 5522 break; 5523 } 5524 case a.BODY: 5525 case a.CAPTION: 5526 case a.COL: 5527 case a.COLGROUP: 5528 case a.HTML: 5529 case a.TBODY: 5530 case a.TD: 5531 case a.TFOOT: 5532 case a.TH: 5533 case a.THEAD: 5534 case a.TR: 5535 break; 5536 default: 5537 ue(e, t); 5538 } 5539} 5540function ue(e, t) { 5541 const u = e.fosterParentingEnabled; 5542 e.fosterParentingEnabled = !0, fe(e, t), e.fosterParentingEnabled = u; 5543} 5544function Ft(e, t) { 5545 e.pendingCharacterTokens.push(t); 5546} 5547function wt(e, t) { 5548 e.pendingCharacterTokens.push(t), e.hasNonWhitespacePendingCharacterToken = !0; 5549} 5550function X(e, t) { 5551 let u = 0; 5552 if (e.hasNonWhitespacePendingCharacterToken) 5553 for (; u < e.pendingCharacterTokens.length; u++) 5554 ue(e, e.pendingCharacterTokens[u]); 5555 else 5556 for (; u < e.pendingCharacterTokens.length; u++) 5557 e._insertCharacters(e.pendingCharacterTokens[u]); 5558 e.insertionMode = e.originalInsertionMode, e._processToken(t); 5559} 5560const Yt = /* @__PURE__ */ new Set([a.CAPTION, a.COL, a.COLGROUP, a.TBODY, a.TD, a.TFOOT, a.TH, a.THEAD, a.TR]); 5561function ps(e, t) { 5562 const u = t.tagID; 5563 Yt.has(u) ? e.openElements.hasInTableScope(a.CAPTION) && (e.openElements.generateImpliedEndTags(), e.o
5563penElements.popUntilTagNamePopped(a.CAPTION), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = c.IN_TABLE, G(e, t)) : L(e, t); 5564} 5565function Is(e, t) { 5566 const u = t.tagID; 5567 switch (u) { 5568 case a.CAPTION: 5569 case a.TABLE: { 5570 e.openElements.hasInTableScope(a.CAPTION) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(a.CAPTION), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = c.IN_TABLE, u === a.TABLE && te(e, t)); 5571 break; 5572 } 5573 case a.BODY: 5574 case a.COL: 5575 case a.COLGROUP: 5576 case a.HTML: 5577 case a.TBODY: 5578 case a.TD: 5579 case a.TFOOT: 5580 case a.TH: 5581 case a.THEAD: 5582 case a.TR: 5583 break; 5584 default: 5585 le(e, t); 5586 } 5587} 5588function ve(e, t) { 5589 switch (t.tagID) { 5590 case a.HTML: { 5591 L(e, t); 5592 break; 5593 } 5594 case a.COL: { 5595 e._appendElement(t, h.HTML), t.ackSelfClosing = !0; 5596 break; 5597 } 5598 case a.TEMPLATE: { 5599 y(e, t); 5600 break; 5601 } 5602 default: 5603 oe(e, t); 5604 } 5605} 5606function Ns(e, t) { 5607 switch (t.tagID) { 5608 case a.COLGROUP: { 5609 e.openElements.currentTagId === a.COLGROUP && (e.openElements.pop(), e.insertionMode = c.IN_TABLE); 5610 break; 5611 } 5612 case a.TEMPLATE: { 5613 q(e, t); 5614 break; 5615 } 5616 case a.COL: 5617 break; 5618 default: 5619 oe(e, t); 5620 } 5621} 5622function oe(e, t) { 5623 e.openElements.currentTagId === a.COLGROUP && (e.openElements.pop(), e.insertionMode = c.IN_TABLE, e._processToken(t)); 5624} 5625function he(e, t) { 5626 switch (t.tagID) { 5627 case a.TR: { 5628 e.openElements.clearBackToTableBodyContext(), e._insertElement(t, h.HTML), e.insertionMode = c.IN_ROW; 5629 break; 5630 } 5631 case a.TH: 5632 case a.TD: { 5633 e.openElements.clearBackToTableBodyContext(), e._insertFakeElement(d.TR, a.TR), e.insertionMode = c.IN_ROW, Te(e, t); 5634 break; 5635 } 5636 case a.CAPTION: 5637 case a.COL: 5638 case a.COLGROUP: 5639 case a.TBODY: 5640 case a.TFOOT: 5641 case a.THEAD: { 5642 e.openElements.hasTableBodyContextInTableScope() && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = c.IN_TABLE, G(e, t)); 5643 break; 5644 } 5645 default: 5646 G(e, t); 5647 } 5648} 5649function Pe(e, t) { 5650 const u = t.tagID; 5651 switch (t.tagID) { 5652 case a.TBODY: 5653 case a.TFOOT: 5654 case a.THEAD: { 5655 e.openElements.hasInTableScope(u) && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = c.IN_TABLE); 5656 break; 5657 } 5658 case a.TABLE: { 5659 e.openElements.hasTableBodyContextInTableScope() && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = c.IN_TABLE, te(e, t)); 5660 break; 5661 } 5662 case a.BODY: 5663 case a.CAPTION: 5664 case a.COL: 5665 case a.COLGROUP: 5666 case a.HTML: 5667 case a.TD: 5668 case a.TH: 5669 case a.TR: 5670 break; 5671 default: 5672 te(e, t); 5673 } 5674} 5675function Te(e, t) { 5676 switch (t.tagID) { 5677 case a.TH: 5678 case a.TD: { 5679 e.openElements.clearBackToTableRowContext(), e._insertElement(t, h.HTML), e.insertionMode = c.IN_CELL, e.activeFormattingElements.insertMarker(); 5680 break; 5681 } 5682 case a.CAPTION: 5683 case a.COL: 5684 case a.COLGROUP: 5685 case a.TBODY: 5686 case a.TFOOT: 5687 case a.THEAD: 5688 case a.TR: { 5689 e.openElements.hasInTableScope(a.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = c.IN_TABLE_BODY, he(e, t)); 5690 break; 5691 } 5692 default: 5693 G(e, t); 5694 } 5695} 5696function vt(e, t) { 5697 switch (t.tagID) { 5698 case a.TR: { 5699 e.openElements.hasInTableScope(a.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = c.IN_TABLE_BODY); 5700 break; 5701 } 5702 case a.TABLE: { 5703 e.openElements.hasInTableScope(a.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = c.IN_TABLE_BODY, Pe(e, t)); 5704 break; 5705 } 5706 case a.TBODY: 5707 case a.TFOOT: 5708 case a.THEAD: { 5709 (e.openElements.hasInTableScope(t.tagID) || e.openElements.hasInTableScope(a.TR)) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = c.IN_TABLE_BODY, Pe(e, t)); 5710 break; 5711 } 5712 case a.BODY: 5713 case a.CAPTION: 5714 case a.COL: 5715 case a.COLGROUP: 5716 case a.HTML: 5717 case a.TD: 5718 case a.TH: 5719 break; 5720 default: 5721 te(e, t); 5722 } 5723} 5724function Cs(e, t) { 5725 const u = t.tagID;
5726 Yt.has(u) ? (e.openElements.hasInTableScope(a.TD) || e.openElements.hasInTableScope(a.TH)) && (e._closeTableCell(), Te(e, t)) : L(e, t); 5727} 5728function gs(e, t) { 5729 const u = t.tagID; 5730 switch (u) { 5731 case a.TD: 5732 case a.TH: { 5733 e.openElements.hasInTableScope(u) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(u), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = c.IN_ROW); 5734 break; 5735 } 5736 case a.TABLE: 5737 case a.TBODY: 5738 case a.TFOOT: 5739 case a.THEAD: 5740 case a.TR: { 5741 e.openElements.hasInTableScope(u) && (e._closeTableCell(), vt(e, t)); 5742 break; 5743 } 5744 case a.BODY: 5745 case a.CAPTION: 5746 case a.COL: 5747 case a.COLGROUP: 5748 case a.HTML: 5749 break; 5750 default: 5751 le(e, t); 5752 } 5753} 5754function Qt(e, t) { 5755 switch (t.tagID) { 5756 case a.HTML: { 5757 L(e, t); 5758 break; 5759 } 5760 case a.OPTION: { 5761 e.openElements.currentTagId === a.OPTION && e.openElements.pop(), e._insertElement(t, h.HTML); 5762 break; 5763 } 5764 case a.OPTGROUP: { 5765 e.openElements.currentTagId === a.OPTION && e.openElements.pop(), e.openElements.currentTagId === a.OPTGROUP && e.openElements.pop(), e._insertElement(t, h.HTML); 5766 break; 5767 } 5768 case a.HR: { 5769 e.openElements.currentTagId === a.OPTION && e.openElements.pop(), e.openElements.currentTagId === a.OPTGROUP && e.openElements.pop(), e._appendElement(t, h.HTML), t.ackSelfClosing = !0; 5770 break; 5771 } 5772 case a.INPUT: 5773 case a.KEYGEN: 5774 case a.TEXTAREA: 5775 case a.SELECT: { 5776 e.openElements.hasInSelectScope(a.SELECT) && (e.openElements.popUntilTagNamePopped(a.SELECT), e._resetInsertionMode(), t.tagID !== a.SELECT && e._processStartTag(t)); 5777 break; 5778 } 5779 case a.SCRIPT: 5780 case a.TEMPLATE: { 5781 y(e, t); 5782 break; 5783 } 5784 } 5785} 5786function qt(e, t) { 5787 switch (t.tagID) { 5788 case a.OPTGROUP: { 5789 e.openElements.stackTop > 0 && e.openElements.currentTagId === a.OPTION && e.openElements.tagIDs[e.openElements.stackTop - 1] === a.OPTGROUP && e.openElements.pop(), e.openElements.currentTagId === a.OPTGROUP && e.openElements.pop(); 5790 break; 5791 } 5792 case a.OPTION: { 5793 e.openElements.currentTagId === a.OPTION && e.openElements.pop(); 5794 break; 5795 } 5796 case a.SELECT: { 5797 e.openElements.hasInSelectScope(a.SELECT) && (e.openElements.popUntilTagNamePopped(a.SELECT), e._resetInsertionMode()); 5798 break; 5799 } 5800 case a.TEMPLATE: { 5801 q(e, t); 5802 break; 5803 } 5804 } 5805} 5806function Ss(e, t) { 5807 const u = t.tagID; 5808 u === a.CAPTION || u === a.TABLE || u === a.TBODY || u === a.TFOOT || u === a.THEAD || u === a.TR || u === a.TD || u === a.TH ? (e.openElements.popUntilTagNamePopped(a.SELECT), e._resetInsertionMode(), e._processStartTag(t)) : Qt(e, t); 5809} 5810function Os(e, t) { 5811 const u = t.tagID; 5812 u === a.CAPTION || u === a.TABLE || u === a.TBODY || u === a.TFOOT || u === a.THEAD || u === a.TR || u === a.TD || u === a.TH ? e.openElements.hasInTableScope(u) && (e.openElements.popUntilTagNamePopped(a.SELECT), e._resetInsertionMode(), e.onEndTag(t)) : qt(e, t); 5813} 5814function Ls(e, t) { 5815 switch (t.tagID) { 5816 // First, handle tags that can start without a mode change 5817 case a.BASE: 5818 case a.BASEFONT: 5819 case a.BGSOUND: 5820 case a.LINK: 5821 case a.META: 5822 case a.NOFRAMES: 5823 case a.SCRIPT: 5824 case a.STYLE: 5825 case a.TEMPLATE: 5826 case a.TITLE: { 5827 y(e, t); 5828 break; 5829 } 5830 // Re-process the token in the appropriate mode 5831 case a.CAPTION: 5832 case a.COLGROUP: 5833 case a.TBODY: 5834 case a.TFOOT: 5835 case a.THEAD: { 5836 e.tmplInsertionModeStack[0] = c.IN_TABLE, e.insertionMode = c.IN_TABLE, G(e, t); 5837 break; 5838 } 5839 case a.COL: { 5840 e.tmplInsertionModeStack[0] = c.IN_COLUMN_GROUP, e.insertionMode = c.IN_COLUMN_GROUP, ve(e, t); 5841 break; 5842 } 5843 case a.TR: { 5844 e.tmplInsertionModeStack[0] = c.IN_TABLE_BODY, e.insertionMode = c.IN_TABLE_BODY, he(e, t); 5845 break; 5846 } 5847 case a.TD: 5848 case a.TH: { 5849 e.tmplInsertionModeStack[0] = c.IN_ROW, e.insertionMode = c.IN_ROW, Te(e, t); 5850 break; 5851 } 5852 default: 5853 e.tmplInsertionModeStack[0] = c.IN_BODY, e.insertionMode = c.IN_BODY, L(e, t); 5854 } 5855} 5856function Rs(e, t) { 5857 t.tagID === a.TEMPLATE && q(e, t); 5858} 5859function Wt(e, t) { 5860 e.openElements.tmplCount > 0 ? (e.openElements.popUntilTagNamePopped(a.TEMPLATE), e.activeFormattingElements.clearToLastMarker(), e.tmplInsertionModeStack.shift(), e._resetInsertionMode(), e.onEof(t)) : Ye(e, t); 5861} 5862function Ds(e, t) { 5863 t.tagID === a.HTML ? L(e, t) : de(e, t); 5864} 5865function Gt(e, t) { 5866 var u; 5867 if (t.tagID === a.HTML) { 5868 if (e.fragmentContext || (e.insertionMode = c.AFTER_AFTER_BODY), e.options.sourceCodeLocationInfo && e.openElements.tagIDs[0] === a.HTML) { 5869 e._setEndLocation(e.openElements.items[0], t); 5870 const s = e.openElements.items[1]; 5871 s && !(!((u = e.treeAdapter.getNodeSourceCodeLocation(s)) === null || u === void 0) && u.endTag) && e._setEndLocation(s, t); 5872 } 5873 } else 5874 de(e, t); 5875} 5876function de(e, t) { 5877 e.insertionMode = c.IN_BODY, fe(e, t); 5878} 5879function Ps(e, t) { 5880 switch (t.tagID) { 5881 case a.HTML: { 5882 L(e, t); 5883 break; 5884 } 5885 case a.FRAMESET: { 5886 e._insertElement(t, h.HTML); 5887 break; 5888 } 5889 case a.FRAME: { 5890 e._appendElement(t, h.HTML), t.ackSelfClosing = !0; 5891 break; 5892 } 5893 case a.NOFRAMES: { 5894 y(e, t); 5895 break; 5896 } 5897 } 5898} 5899function xs(e, t) { 5900 t.tagID === a.FRAMESET && !e.openElements.isRootHtmlElementCurrent() && (e.openElements.pop(), !e.fragmentContext && e.openElements.currentTagId !== a.FRAMESET && (e.insertionMode = c.AFTER_FRAMESET)); 5901} 5902function Ms(e, t) { 5903 switch (t.tagID) { 5904 case a.HTML: { 5905 L(e, t); 5906 break; 5907 } 5908 case a.NOFRAMES: { 5909 y(e, t); 5910 break; 5911 } 5912 } 5913} 5914function Bs(e, t) { 5915 t.tagID === a.HTML && (e.insertionMode = c.AFTER_AFTER_FRAMESET); 5916} 5917function ys(e, t) { 5918 t.tagID === a.HTML ? L(e, t) : ie(e, t); 5919} 5920function ie(e, t) { 5921 e.insertionMode = c.IN_BODY, fe(e, t); 5922} 5923function Us(e, t) { 5924 switch (t.tagID) { 5925 case a.HTML: { 5926 L(e, t); 5927 break; 5928 } 5929 case a.NOFRAMES: { 5930 y(e, t); 5931 break; 5932 } 5933 } 5934} 5935function ks(e, t) { 5936 t.chars = N, e._insertCharacters(t); 5937} 5938function Hs(e, t) { 5939 e._insertCharacters(t), e.framesetOk = !1; 5940} 5941function Vt(e) { 5942 for (; e.treeAdapter.getNamespaceURI(e.openElements.current) !== h.HTML && e.openElements.currentTagId !== void 0 && !e._isIntegrationPoint(e.openElements.currentTagId, e.openElements.current); ) 5943 e.openElements.pop(); 5944} 5945function Fs(e, t) { 5946 if ($u(t)) 5947 Vt(e), e._startTagOutsideForeignContent(t); 5948 else { 5949 const u = e._getAdjustedCurrentElement(), s = e.treeAdapter.getNamespaceURI(u); 5950 s === h.MATHML ? Rt(t) : s === h.SVG && (ea(t), Dt(t)), Fe(t), t.selfClosing ? e._appendElement(t, s) : e._insertElement(t, s), t.ackSelfClosing = !0; 5951 } 5952} 5953function ws(e, t) { 5954 if (t.tagID === a.P || t.tagID === a.BR) { 5955 Vt(e), e._endTagOutsideForeignContent(t); 5956 return; 5957 } 5958 for (let u = e.openElements.stackTop; u > 0; u--) { 5959 const s = e.openElements.items[u]; 5960 if (e.treeAdapter.getNamespaceURI(s) === h.HTML) { 5961 e._endTagOutsideForeignContent(t); 5962 break; 5963 } 5964 const n = e.treeAdapter.getTagName(s); 5965 if (n.toLowerCase() === t.tagName) {
vendor: 10,214 bytes, lines 5966-6278
5966 t.tagName = n, e.openElements.shortenToLength(u); 5967 break; 5968 } 5969 } 5970} 5971d.AREA, d.BASE, d.BASEFONT, d.BGSOUND, d.BR, d.COL, d.EMBED, d.FRAME, d.HR, d.IMG, d.INPUT, d.KEYGEN, d.LINK, d.META, d.PARAM, d.SOURCE, d.TRACK, d.WBR; 5972function Ys(e, t) { 5973 return xt.parse(e, t); 5974} 5975function vs(e, t, u) { 5976 typeof e == "string" && (u = t, t = e, e = null); 5977 const s = xt.getFragmentParser(e, u); 5978 return s.tokenizer.write(t, !0), s.getFragment(); 5979} 5980function Qs(e) { 5981 return !e || typeof e != "object" ? "" : "position" in e || "type" in e ? ct(e.position) : "start" in e || "end" in e ? ct(e) : "line" in e || "column" in e ? xe(e) : ""; 5982} 5983function xe(e) { 5984 return ot(e && e.line) + ":" + ot(e && e.column); 5985} 5986function ct(e) { 5987 return xe(e && e.start) + "-" + xe(e && e.end); 5988} 5989function ot(e) { 5990 return e && typeof e == "number" ? e : 1; 5991} 5992class R extends Error { 5993 /** 5994 * Create a message for `reason`. 5995 * 5996 * > 𪦠**Note**: also has obsolete signatures. 5997 * 5998 * @overload 5999 * @param {string} reason 6000 * @param {Options | null | undefined} [options] 6001 * @returns 6002 * 6003 * @overload 6004 * @param {string} reason 6005 * @param {Node | NodeLike | null | undefined} parent 6006 * @param {string | null | undefined} [origin] 6007 * @returns 6008 * 6009 * @overload 6010 * @param {string} reason 6011 * @param {Point | Position | null | undefined} place 6012 * @param {string | null | undefined} [origin] 6013 * @returns 6014 * 6015 * @overload 6016 * @param {string} reason 6017 * @param {string | null | undefined} [origin] 6018 * @returns 6019 * 6020 * @overload 6021 * @param {Error | VFileMessage} cause 6022 * @param {Node | NodeLike | null | undefined} parent 6023 * @param {string | null | undefined} [origin] 6024 * @returns 6025 * 6026 * @overload 6027 * @param {Error | VFileMessage} cause 6028 * @param {Point | Position | null | undefined} place 6029 * @param {string | null | undefined} [origin] 6030 * @returns 6031 * 6032 * @overload 6033 * @param {Error | VFileMessage} cause 6034 * @param {string | null | undefined} [origin] 6035 * @returns 6036 * 6037 * @param {Error | VFileMessage | string} causeOrReason 6038 * Reason for message, should use markdown. 6039 * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace] 6040 * Configuration (optional). 6041 * @param {string | null | undefined} [origin] 6042 * Place in code where the message originates (example: 6043 * `'my-package:my-rule'` or `'my-rule'`). 6044 * @returns 6045 * Instance of `VFileMessage`. 6046 */ 6047 // eslint-disable-next-line complexity 6048 constructor(t, u, s) { 6049 super(), typeof u == "string" && (s = u, u = void 0); 6050 let n = "", o = {}, E = !1; 6051 if (u && ("line" in u && "column" in u ? o = { place: u } : "start" in u && "end" in u ? o = { place: u } : "type" in u ? o = { 6052 ancestors: [u], 6053 place: u.position 6054 } : o = { ...u }), typeof t == "string" ? n = t : !o.cause && t && (E = !0, n = t.message, o.cause = t), !o.ruleId && !o.source && typeof s == "string") { 6055 const T = s.indexOf(":"); 6056 T === -1 ? o.ruleId = s : (o.source = s.slice(0, T), o.ruleId = s.slice(T + 1)); 6057 } 6058 if (!o.place && o.ancestors && o.ancestors) { 6059 const T = o.ancestors[o.ancestors.length - 1]; 6060 T && (o.place = T.position); 6061 } 6062 const l = o.place && "start" in o.place ? o.place.start : o.place; 6063 this.ancestors = o.ancestors || void 0, this.cause = o.cause || void 0, this.column = l ? l.column : void 0, this.fatal = void 0, this.file = "", this.message = n, this.line = l ? l.line : void 0, this.name = Qs(o.place) || "1:1", this.place = o.place || void 0, this.reason = this.message, this.ruleId = o.ruleId || void 0, this.source = o.source || void 0, this.stack = E && o.cause && typeof o.cause.stack == "string" ? o.cause.stack : "", this.actual = void 0, this.expected = void 0, this.note = void 0, this.url = void 0; 6064 } 6065} 6066R.prototype.file = ""; 6067R.prototype.name = ""; 6068R.prototype.reason = ""; 6069R.prototype.message = ""; 6070R.prototype.stack = ""; 6071R.prototype.column = void 0; 6072R.prototype.line = void 0; 6073R.prototype.ancestors = void 0; 6074R.prototype.cause = void 0; 6075R.prototype.fatal = void 0; 6076R.prototype.place = void 0; 6077R.prototype.ruleId = void 0; 6078R.prototype.source = void 0; 6079const k = { basename: qs, dirname: Ws, extname: Gs, join: Vs, sep: "/" }; 6080function qs(e, t) { 6081 if (t !== void 0 && typeof t != "string") 6082 throw new TypeError('"ext" argument must be a string'); 6083 ae(e); 6084 let u = 0, s = -1, n = e.length, o; 6085 if (t === void 0 || t.length === 0 || t.length > e.length) { 6086 for (; n--; ) 6087 if (e.codePointAt(n) === 47) { 6088 if (o) { 6089 u = n + 1; 6090 break; 6091 } 6092 } else s < 0 && (o = !0, s = n + 1); 6093 return s < 0 ? "" : e.slice(u, s); 6094 } 6095 if (t === e) 6096 return ""; 6097 let E = -1, l = t.length - 1; 6098 for (; n--; ) 6099 if (e.codePointAt(n) === 47) { 6100 if (o) { 6101 u = n + 1; 6102 break; 6103 } 6104 } else 6105 E < 0 && (o = !0, E = n + 1), l > -1 && (e.codePointAt(n) === t.codePointAt(l--) ? l < 0 && (s = n) : (l = -1, s = E)); 6106 return u === s ? s = E : s < 0 && (s = e.length), e.slice(u, s); 6107} 6108function Ws(e) { 6109 if (ae(e), e.length === 0) 6110 return "."; 6111 let t = -1, u = e.length, s; 6112 for (; --u; ) 6113 if (e.codePointAt(u) === 47) { 6114 if (s) { 6115 t = u; 6116 break; 6117 } 6118 } else s || (s = !0); 6119 return t < 0 ? e.codePointAt(0) === 47 ? "/" : "." : t === 1 && e.codePointAt(0) === 47 ? "//" : e.slice(0, t); 6120} 6121function Gs(e) { 6122 ae(e); 6123 let t = e.length, u = -1, s = 0, n = -1, o = 0, E; 6124 for (; t--; ) { 6125 const l = e.codePointAt(t); 6126 if (l === 47) { 6127 if (E) { 6128 s = t + 1; 6129 break; 6130 } 6131 continue; 6132 } 6133 u < 0 && (E = !0, u = t + 1), l === 46 ? n < 0 ? n = t : o !== 1 && (o = 1) : n > -1 && (o = -1); 6134 } 6135 return n < 0 || u < 0 || // We saw a non-dot character immediately before the dot. 6136 o === 0 || // The (right-most) trimmed path component is exactly `..`. 6137 o === 1 && n === u - 1 && n === s + 1 ? "" : e.slice(n, u); 6138} 6139function Vs(...e) { 6140 let t = -1, u; 6141 for (; ++t < e.length; ) 6142 ae(e[t]), e[t] && (u = u === void 0 ? e[t] : u + "/" + e[t]); 6143 return u === void 0 ? "." : Ks(u); 6144} 6145function Ks(e) { 6146 ae(e); 6147 const t = e.codePointAt(0) === 47; 6148 let u = Xs(e, !t); 6149 return u.length === 0 && !t && (u = "."), u.length > 0 && e.codePointAt(e.length - 1) === 47 && (u += "/"), t ? "/" + u : u; 6150} 6151function Xs(e, t) { 6152 let u = "", s = 0, n = -1, o = 0, E = -1, l, T; 6153 for (; ++E <= e.length; ) { 6154 if (E < e.length) 6155 l = e.codePointAt(E); 6156 else { 6157 if (l === 47) 6158 break; 6159 l = 47; 6160 } 6161 if (l === 47) { 6162 if (!(n === E - 1 || o === 1)) if (n !== E - 1 && o === 2) { 6163 if (u.length < 2 || s !== 2 || u.codePointAt(u.length - 1) !== 46 || u.codePointAt(u.length - 2) !== 46) { 6164 if (u.length > 2) { 6165 if (T = u.lastIndexOf("/"), T !== u.length - 1) { 6166 T < 0 ? (u = "", s = 0) : (u = u.slice(0, T), s = u.length - 1 - u.lastIndexOf("/")), n = E, o = 0; 6167 continue; 6168 } 6169 } else if (u.length > 0) { 6170 u = "", s = 0, n = E, o = 0; 6171 continue; 6172 } 6173 } 6174 t && (u = u.length > 0 ? u + "/.." : "..", s = 2); 6175 } else 6176 u.length > 0 ? u += "/" + e.slice(n + 1, E) : u = e.slice(n + 1, E), s = E - n - 1; 6177 n = E, o = 0; 6178 } else l === 46 && o > -1 ? o++ : o = -1; 6179 } 6180 return u; 6181} 6182function ae(e) { 6183 if (typeof e != "string") 6184 throw new TypeError( 6185 "Path must be a string. Received " + JSON.stringify(e) 6186 ); 6187} 6188const js = { cwd: zs }; 6189function zs() { 6190 return "/"; 6191} 6192function Me(e) { 6193 return !!(e !== null && typeof e == "object" && "href" in e && e.href && "protocol" in e && e.protocol && // @ts-expect-error: indexing is fine. 6194 e.auth === void 0); 6195} 6196function Js(e) { 6197 if (typeof e == "string") 6198 e = new URL(e); 6199 else if (!Me(e)) { 6200 const t = new TypeError( 6201 'The "path" argument must be of type string or an instance of URL. Received `' + e + "`" 6202 ); 6203 throw t.code = "ERR_INVALID_ARG_TYPE", t; 6204 } 6205 if (e.protocol !== "file:") { 6206 const t = new TypeError("The URL must be of scheme file"); 6207 throw t.code = "ERR_INVALID_URL_SCHEME", t; 6208 } 6209 return Zs(e); 6210} 6211function Zs(e) { 6212 if (e.hostname !== "") { 6213 const s = new TypeError( 6214 'File URL host must be "localhost" or empty on darwin' 6215 ); 6216 throw s.code = "ERR_INVALID_FILE_URL_HOST", s; 6217 } 6218 const t = e.pathname; 6219 let u = -1; 6220 for (; ++u < t.length; ) 6221 if (t.codePointAt(u) === 37 && t.codePointAt(u + 1) === 50) { 6222 const s = t.codePointAt(u + 2); 6223 if (s === 70 || s === 102) { 6224 const n = new TypeError( 6225 "File URL path must not include encoded / characters" 6226 ); 6227 throw n.code = "ERR_INVALID_FILE_URL_PATH", n; 6228 } 6229 } 6230 return decodeURIComponent(t); 6231} 6232const _e = ( 6233 /** @type {const} */ 6234 [ 6235 "history", 6236 "path", 6237 "basename", 6238 "stem", 6239 "extname", 6240 "dirname" 6241 ] 6242); 6243class Be { 6244 /** 6245 * Create a new virtual file. 6246 * 6247 * `options` is treated as: 6248 * 6249 * * `string` or `Uint8Array` â `{value: options}` 6250 * * `URL` â `{path: options}` 6251 * * `VFile` â shallow copies its data over to the new file 6252 * * `object` â all fields are shallow copied over to the new file 6253 * 6254 * Path related fields are set in the following order (least specific to 6255 * most specific): `history`, `path`, `basename`, `stem`, `extname`, 6256 * `dirname`. 6257 * 6258 * You cannot set `dirname` or `extname` without setting either `history`, 6259 * `path`, `basename`, or `stem` too. 6260 * 6261 * @param {Compatible | null | undefined} [value] 6262 * File value. 6263 * @returns 6264 * New instance. 6265 */ 6266 constructor(t) { 6267 let u; 6268 t ? Me(t) ? u = { path: t } : typeof t == "string" || $s(t) ? u = { value: t } : u = t : u = {}, this.cwd = "cwd" in u ? "" : js.cwd(), this.data = {}, this.history = [], this.messages = [], this.value, this.map, this.result, this.stored; 6269 let s = -1; 6270 for (; ++s < _e.length; ) { 6271 const o = _e[s]; 6272 o in u && u[o] !== void 0 && u[o] !== null && (this[o] = o === "history" ? [...u[o]] : u[o]); 6273 } 6274 let n; 6275 for (n in u) 6276 _e.includes(n) || (this[n] = u[n]); 6277 } 6278 /**
vendor: 11,408 bytes, lines 6279-6647
6279 * Get the basename (including extname) (example: `'index.min.js'`). 6280 * 6281 * @returns {string | undefined} 6282 * Basename. 6283 */ 6284 get basename() { 6285 return typeof this.path == "string" ? k.basename(this.path) : void 0; 6286 } 6287 /** 6288 * Set basename (including extname) (`'index.min.js'`). 6289 * 6290 * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` 6291 * on windows). 6292 * Cannot be nullified (use `file.path = file.dirname` instead). 6293 * 6294 * @param {string} basename 6295 * Basename. 6296 * @returns {undefined} 6297 * Nothing. 6298 */ 6299 set basename(t) { 6300 pe(t, "basename"), Ae(t, "basename"), this.path = k.join(this.dirname || "", t); 6301 } 6302 /** 6303 * Get the parent path (example: `'~'`). 6304 * 6305 * @returns {string | undefined} 6306 * Dirname. 6307 */ 6308 get dirname() { 6309 return typeof this.path == "string" ? k.dirname(this.path) : void 0; 6310 } 6311 /** 6312 * Set the parent path (example: `'~'`). 6313 * 6314 * Cannot be set if thereâs no `path` yet. 6315 * 6316 * @param {string | undefined} dirname 6317 * Dirname. 6318 * @returns {undefined} 6319 * Nothing. 6320 */ 6321 set dirname(t) { 6322 dt(this.basename, "dirname"), this.path = k.join(t || "", this.basename); 6323 } 6324 /** 6325 * Get the extname (including dot) (example: `'.js'`). 6326 * 6327 * @returns {string | undefined} 6328 * Extname. 6329 */ 6330 get extname() { 6331 return typeof this.path == "string" ? k.extname(this.path) : void 0; 6332 } 6333 /** 6334 * Set the extname (including dot) (example: `'.js'`). 6335 * 6336 * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` 6337 * on windows). 6338 * Cannot be set if thereâs no `path` yet. 6339 * 6340 * @param {string | undefined} extname 6341 * Extname. 6342 * @returns {undefined} 6343 * Nothing. 6344 */ 6345 set extname(t) { 6346 if (Ae(t, "extname"), dt(this.dirname, "extname"), t) { 6347 if (t.codePointAt(0) !== 46) 6348 throw new Error("`extname` must start with `.`"); 6349 if (t.includes(".", 1)) 6350 throw new Error("`extname` cannot contain multiple dots"); 6351 } 6352 this.path = k.join(this.dirname, this.stem + (t || "")); 6353 } 6354 /** 6355 * Get the full path (example: `'~/index.min.js'`). 6356 * 6357 * @returns {string} 6358 * Path. 6359 */ 6360 get path() { 6361 return this.history[this.history.length - 1]; 6362 } 6363 /** 6364 * Set the full path (example: `'~/index.min.js'`). 6365 * 6366 * Cannot be nullified. 6367 * You can set a file URL (a `URL` object with a `file:` protocol) which will 6368 * be turned into a path with `url.fileURLToPath`. 6369 * 6370 * @param {URL | string} path 6371 * Path. 6372 * @returns {undefined} 6373 * Nothing. 6374 */ 6375 set path(t) { 6376 Me(t) && (t = Js(t)), pe(t, "path"), this.path !== t && this.history.push(t); 6377 } 6378 /** 6379 * Get the stem (basename w/o extname) (example: `'index.min'`). 6380 * 6381 * @returns {string | undefined} 6382 * Stem. 6383 */ 6384 get stem() { 6385 return typeof this.path == "string" ? k.basename(this.path, this.extname) : void 0; 6386 } 6387 /** 6388 * Set the stem (basename w/o extname) (example: `'index.min'`). 6389 * 6390 * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` 6391 * on windows). 6392 * Cannot be nullified (use `file.path = file.dirname` instead). 6393 * 6394 * @param {string} stem 6395 * Stem. 6396 * @returns {undefined} 6397 * Nothing. 6398 */ 6399 set stem(t) { 6400 pe(t, "stem"), Ae(t, "stem"), this.path = k.join(this.dirname || "", t + (this.extname || "")); 6401 } 6402 // Normal prototypal methods. 6403 /** 6404 * Create a fatal message for `reason` associated with the file. 6405 * 6406 * The `fatal` field of the message is set to `true` (error; file not usable) 6407 * and the `file` field is set to the current file path. 6408 * The message is added to the `messages` field on `file`. 6409 * 6410 * > 𪦠**Note**: also has obsolete signatures. 6411 * 6412 * @overload 6413 * @param {string} reason 6414 * @param {MessageOptions | null | undefined} [options] 6415 * @returns {never} 6416 * 6417 * @overload 6418 * @param {string} reason 6419 * @param {Node | NodeLike | null | undefined} parent 6420 * @param {string | null | undefined} [origin] 6421 * @returns {never} 6422 * 6423 * @overload 6424 * @param {string} reason 6425 * @param {Point | Position | null | undefined} place 6426 * @param {string | null | undefined} [origin] 6427 * @returns {never} 6428 * 6429 * @overload 6430 * @param {string} reason 6431 * @param {string | null | undefined} [origin] 6432 * @returns {never} 6433 * 6434 * @overload 6435 * @param {Error | VFileMessage} cause 6436 * @param {Node | NodeLike | null | undefined} parent 6437 * @param {string | null | undefined} [origin] 6438 * @returns {never} 6439 * 6440 * @overload 6441 * @param {Error | VFileMessage} cause 6442 * @param {Point | Position | null | undefined} place 6443 * @param {string | null | undefined} [origin] 6444 * @returns {never} 6445 * 6446 * @overload 6447 * @param {Error | VFileMessage} cause 6448 * @param {string | null | undefined} [origin] 6449 * @returns {never} 6450 * 6451 * @param {Error | VFileMessage | string} causeOrReason 6452 * Reason for message, should use markdown. 6453 * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] 6454 * Configuration (optional). 6455 * @param {string | null | undefined} [origin] 6456 * Place in code where the message originates (example: 6457 * `'my-package:my-rule'` or `'my-rule'`). 6458 * @returns {never} 6459 * Never. 6460 * @throws {VFileMessage} 6461 * Message. 6462 */ 6463 fail(t, u, s) { 6464 const n = this.message(t, u, s); 6465 throw n.fatal = !0, n; 6466 } 6467 /** 6468 * Create an info message for `reason` associated with the file. 6469 * 6470 * The `fatal` field of the message is set to `undefined` (info; change 6471 * likely not needed) and the `file` field is set to the current file path. 6472 * The message is added to the `messages` field on `file`. 6473 * 6474 * > 𪦠**Note**: also has obsolete signatures. 6475 * 6476 * @overload 6477 * @param {string} reason 6478 * @param {MessageOptions | null | undefined} [options] 6479 * @returns {VFileMessage} 6480 * 6481 * @overload 6482 * @param {string} reason 6483 * @param {Node | NodeLike | null | undefined} parent 6484 * @param {string | null | undefined} [origin] 6485 * @returns {VFileMessage} 6486 * 6487 * @overload 6488 * @param {string} reason 6489 * @param {Point | Position | null | undefined} place 6490 * @param {string | null | undefined} [origin] 6491 * @returns {VFileMessage} 6492 * 6493 * @overload 6494 * @param {string} reason 6495 * @param {string | null | undefined} [origin] 6496 * @returns {VFileMessage} 6497 * 6498 * @overload 6499 * @param {Error | VFileMessage} cause 6500 * @param {Node | NodeLike | null | undefined} parent 6501 * @param {string | null | undefined} [origin] 6502 * @returns {VFileMessage} 6503 * 6504 * @overload 6505 * @param {Error | VFileMessage} cause 6506 * @param {Point | Position | null | undefined} place 6507 * @param {string | null | undefined} [origin] 6508 * @returns {VFileMessage} 6509 * 6510 * @overload 6511 * @param {Error | VFileMessage} cause 6512 * @param {string | null | undefined} [origin] 6513 * @returns {VFileMessage} 6514 * 6515 * @param {Error | VFileMessage | string} causeOrReason 6516 * Reason for message, should use markdown. 6517 * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] 6518 * Configuration (optional). 6519 * @param {string | null | undefined} [origin] 6520 * Place in code where the message originates (example: 6521 * `'my-package:my-rule'` or `'my-rule'`). 6522 * @returns {VFileMessage} 6523 * Message. 6524 */ 6525 info(t, u, s) { 6526 const n = this.message(t, u, s); 6527 return n.fatal = void 0, n; 6528 } 6529 /** 6530 * Create a message for `reason` associated with the file. 6531 * 6532 * The `fatal` field of the message is set to `false` (warning; change may be 6533 * needed) and the `file` field is set to the current file path. 6534 * The message is added to the `messages` field on `file`. 6535 * 6536 * > 𪦠**Note**: also has obsolete signatures. 6537 * 6538 * @overload 6539 * @param {string} reason 6540 * @param {MessageOptions | null | undefined} [options] 6541 * @returns {VFileMessage} 6542 * 6543 * @overload 6544 * @param {string} reason 6545 * @param {Node | NodeLike | null | undefined} parent 6546 * @param {string | null | undefined} [origin] 6547 * @returns {VFileMessage} 6548 * 6549 * @overload 6550 * @param {string} reason 6551 * @param {Point | Position | null | undefined} place 6552 * @param {string | null | undefined} [origin] 6553 * @returns {VFileMessage} 6554 * 6555 * @overload 6556 * @param {string} reason 6557 * @param {string | null | undefined} [origin] 6558 * @returns {VFileMessage} 6559 * 6560 * @overload 6561 * @param {Error | VFileMessage} cause 6562 * @param {Node | NodeLike | null | undefined} parent 6563 * @param {string | null | undefined} [origin] 6564 * @returns {VFileMessage} 6565 * 6566 * @overload 6567 * @param {Error | VFileMessage} cause 6568 * @param {Point | Position | null | undefined} place 6569 * @param {string | null | undefined} [origin] 6570 * @returns {VFileMessage} 6571 * 6572 * @overload 6573 * @param {Error | VFileMessage} cause 6574 * @param {string | null | undefined} [origin] 6575 * @returns {VFileMessage} 6576 * 6577 * @param {Error | VFileMessage | string} causeOrReason 6578 * Reason for message, should use markdown. 6579 * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] 6580 * Configuration (optional). 6581 * @param {string | null | undefined} [origin] 6582 * Place in code where the message originates (example: 6583 * `'my-package:my-rule'` or `'my-rule'`). 6584 * @returns {VFileMessage} 6585 * Message. 6586 */ 6587 message(t, u, s) { 6588 const n = new R( 6589 // @ts-expect-error: the overloads are fine. 6590 t, 6591 u, 6592 s 6593 ); 6594 return this.path && (n.name = this.path + ":" + n.name, n.file = this.path), n.fatal = !1, this.messages.push(n), n; 6595 } 6596 /** 6597 * Serialize the file. 6598 * 6599 * > **Note**: which encodings are supported depends on the engine. 6600 * > For info on Node.js, see: 6601 * > <https://nodejs.org/api/util.html#whatwg-supported-encodings>. 6602 * 6603 * @param {string | null | undefined} [encoding='utf8'] 6604 * Character encoding to understand `value` as when itâs a `Uint8Array` 6605 * (default: `'utf-8'`). 6606 * @returns {string} 6607 * Serialized file. 6608 */ 6609 toString(t) { 6610 return this.value === void 0 ? "" : typeof this.value == "string" ? this.value : new TextDecoder(t || void 0).decode(this.value); 6611 } 6612} 6613function Ae(e, t) { 6614 if (e && e.includes(k.sep)) 6615 throw new Error( 6616 "`" + t + "` cannot be a path: did not expect `" + k.sep + "`" 6617 ); 6618} 6619function pe(e, t) { 6620 if (!e) 6621 throw new Error("`" + t + "` cannot be empty"); 6622} 6623function dt(e, t) { 6624 if (!e) 6625 throw new Error("Setting `" + t + "` requires `path` to be set too"); 6626} 6627function $s(e) { 6628 return !!(e && typeof e == "object" && "byteLength" in e && "byteOffset" in e); 6629} 6630const er = { 6631 /** @type {ErrorInfo} */ 6632 abandonedHeadElementChild: { 6633 reason: "Unexpected metadata element after head", 6634 description: "Unexpected element after head. Expected the element before `</head>`", 6635 url: !1 6636 }, 6637 /** @type {ErrorInfo} */ 6638 abruptClosingOfEmptyComment: { 6639 reason: "Unexpected abruptly closed empty comment", 6640 description: "Unexpected `>` or `->`. Expected `-->` to close comments" 6641 }, 6642 /** @type {ErrorInfo} */ 6643 abruptDoctypePublicIdentifier: { 6644 reason: "Unexpected abruptly closed public identifier", 6645 description: "Unexpected `>`. Expected a closing `\"` or `'` after the public identifier" 6646 }, 6647 /** @type {ErrorInfo} */
6648 abruptDoctypeSystemIdentifier: { 6649 reason: "Unexpected abruptly closed system identifier", 6650 description: "Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier" 6651 }, 6652 /** @type {ErrorInfo} */ 6653 absenceOfDigitsInNumericCharacterReference: { 6654 reason: "Unexpected non-digit at start of numeric character reference", 6655 description: "Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references" 6656 }, 6657 /** @type {ErrorInfo} */ 6658 cdataInHtmlContent: { 6659 reason: "Unexpected CDATA section in HTML", 6660 description: "Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead" 6661 }, 6662 /** @type {ErrorInfo} */ 6663 characterReferenceOutsideUnicodeRange: { 6664 reason: "Unexpected too big numeric character reference", 6665 description: "Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)" 6666 }, 6667 /** @type {ErrorInfo} */ 6668 closingOfElementWithOpenChildElements: { 6669 reason: "Unexpected closing tag with open child elements", 6670 description: "Unexpectedly closing tag. Expected other tags to be closed first", 6671 url: !1 6672 }, 6673 /** @type {ErrorInfo} */ 6674 controlCharacterInInputStream: { 6675 reason: "Unexpected control character", 6676 description: "Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace" 6677 }, 6678 /** @type {ErrorInfo} */ 6679 controlCharacterReference: { 6680 reason: "Unexpected control character reference", 6681 description: "Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace" 6682 }, 6683 /** @type {ErrorInfo} */ 6684 disallowedContentInNoscriptInHead: { 6685 reason: "Disallowed content inside `<noscript>` in `<head>`", 6686 description: "Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`", 6687 url: !1 6688 }, 6689 /** @type {ErrorInfo} */ 6690 duplicateAttribute: { 6691 reason: "Unexpected duplicate attribute", 6692 description: "Unexpectedly double attribute. Expected attributes to occur only once" 6693 }, 6694 /** @type {ErrorInfo} */ 6695 endTagWithAttributes: { 6696 reason: "Unexpected attribute on closing tag", 6697 description: "Unexpected attribute. Expected `>` instead" 6698 }, 6699 /** @type {ErrorInfo} */ 6700 endTagWithTrailingSolidus: { 6701 reason: "Unexpected slash at end of closing tag", 6702 description: "Unexpected `%c-1`. Expected `>` instead" 6703 }, 6704 /** @type {ErrorInfo} */ 6705 endTagWithoutMatchingOpenElement: { 6706 reason: "Unexpected unopened end tag", 6707 description: "Unexpected end tag. Expected no end tag or another end tag", 6708 url: !1 6709 }, 6710 /** @type {ErrorInfo} */ 6711 eofBeforeTagName: { 6712 reason: "Unexpected end of file", 6713 description: "Unexpected end of file. Expected tag name instead" 6714 }, 6715 /** @type {ErrorInfo} */ 6716 eofInCdata: { 6717 reason: "Unexpected end of file in CDATA", 6718 description: "Unexpected end of file. Expected `]]>` to close the CDATA" 6719 }, 6720 /** @type {ErrorInfo} */ 6721 eofInComment: { 6722 reason: "Unexpected end of file in comment", 6723 description: "Unexpected end of file. Expected `-->` to close the comment" 6724 }, 6725 /** @type {ErrorInfo} */ 6726 eofInDoctype: { 6727 reason: "Unexpected end of file in doctype", 6728 description: "Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)" 6729 }, 6730 /** @type {ErrorInfo} */ 6731 eofInElementThatCanContainOnlyText: { 6732 reason: "Unexpected end of file in element that can only contain text", 6733 description: "Unexpected end of file. Expected text or a closing tag", 6734 url: !1 6735 }, 6736 /** @type {ErrorInfo} */ 6737 eofInScriptHtmlCommentLikeText: { 6738 reason: "Unexpected end of file in comment inside script", 6739 description: "Unexpected end of file. Expected `-->` to close the comment" 6740 }, 6741 /** @type {ErrorInfo} */ 6742 eofInTag: { 6743 reason: "Unexpected end of file in tag", 6744 description: "Unexpected end of file. Expected `>` to close the tag" 6745 }, 6746 /** @type {ErrorInfo} */ 6747 incorrectlyClosedComment: { 6748 reason: "Incorrectly closed comment", 6749 description: "Unexpected `%c-1`. Expected `-->` to close the comment" 6750 }, 6751 /** @type {ErrorInfo} */ 6752 incorrectlyOpenedComment: { 6753 reason: "Incorrectly opened comment", 6754 description: "Unexpected `%c`. Expected `<!--` to open the comment" 6755 }, 6756 /** @type {ErrorInfo} */ 6757 invalidCharacterSequenceAfterDoctypeName: { 6758 reason: "Invalid sequence after doctype name", 6759 description: "Unexpected sequence at `%c`. Expected `public` or `system`" 6760 }, 6761 /** @type {ErrorInfo} */ 6762 invalidFirstCharacterOfTagName: { 6763 reason: "Invalid first character in tag name", 6764 description: "Unexpected `%c`. Expected an ASCII letter instead" 6765 }, 6766 /** @type {ErrorInfo} */ 6767 misplacedDoctype: { 6768 reason: "Misplaced doctype", 6769 description: "Unexpected doctype. Expected doctype before head", 6770 url: !1 6771 }, 6772 /** @type {ErrorInfo} */ 6773 misplacedStartTagForHeadElement: { 6774 reason: "Misplaced `<head>` start tag", 6775 description: "Unexpected start tag `<head>`. Expected `<head>` directly after doctype", 6776 url: !1 6777 }, 6778 /** @type {ErrorInfo} */ 6779 missingAttributeValue: { 6780 reason: "Missing attribute value", 6781 description: "Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead" 6782 }, 6783 /** @type {ErrorInfo} */ 6784 missingDoctype: { 6785 reason: "Missing doctype before other content", 6786 description: "Expected a `<!doctype html>` before anything else", 6787 url: !1 6788 }, 6789 /** @type {ErrorInfo} */ 6790 missingDoctypeName: { 6791 reason: "Missing doctype name", 6792 description: "Unexpected doctype end at `%c`. Expected `html` instead" 6793 }, 6794 /** @type {ErrorInfo} */ 6795 missingDoctypePublicIdentifier: { 6796 reason: "Missing public identifier in doctype", 6797 description: "Unexpected `%c`. Expected identifier for `public` instead" 6798 }, 6799 /** @type {ErrorInfo} */
6800 missingDoctypeSystemIdentifier: { 6801 reason: "Missing system identifier in doctype", 6802 description: 'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)' 6803 }, 6804 /** @type {ErrorInfo} */ 6805 missingEndTagName: { 6806 reason: "Missing name in end tag", 6807 description: "Unexpected `%c`. Expected an ASCII letter instead" 6808 }, 6809 /** @type {ErrorInfo} */ 6810 missingQuoteBeforeDoctypePublicIdentifier: { 6811 reason: "Missing quote before public identifier in doctype", 6812 description: "Unexpected `%c`. Expected `\"` or `'` instead" 6813 }, 6814 /** @type {ErrorInfo} */ 6815 missingQuoteBeforeDoctypeSystemIdentifier: { 6816 reason: "Missing quote before system identifier in doctype", 6817 description: "Unexpected `%c`. Expected `\"` or `'` instead" 6818 }, 6819 /** @type {ErrorInfo} */ 6820 missingSemicolonAfterCharacterReference: { 6821 reason: "Missing semicolon after character reference", 6822 description: "Unexpected `%c`. Expected `;` instead" 6823 }, 6824 /** @type {ErrorInfo} */ 6825 missingWhitespaceAfterDoctypePublicKeyword: { 6826 reason: "Missing whitespace after public identifier in doctype", 6827 description: "Unexpected `%c`. Expected ASCII whitespace instead" 6828 }, 6829 /** @type {ErrorInfo} */ 6830 missingWhitespaceAfterDoctypeSystemKeyword: { 6831 reason: "Missing whitespace after system identifier in doctype", 6832 description: "Unexpected `%c`. Expected ASCII whitespace instead" 6833 }, 6834 /** @type {ErrorInfo} */ 6835 missingWhitespaceBeforeDoctypeName: { 6836 reason: "Missing whitespace before doctype name", 6837 description: "Unexpected `%c`. Expected ASCII whitespace instead" 6838 }, 6839 /** @type {ErrorInfo} */ 6840 missingWhitespaceBetweenAttributes: { 6841 reason: "Missing whitespace between attributes", 6842 description: "Unexpected `%c`. Expected ASCII whitespace instead" 6843 }, 6844 /** @type {ErrorInfo} */ 6845 missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers: { 6846 reason: "Missing whitespace between public and system identifiers in doctype", 6847 description: "Unexpected `%c`. Expected ASCII whitespace instead" 6848 }, 6849 /** @type {ErrorInfo} */ 6850 nestedComment: { 6851 reason: "Unexpected nested comment", 6852 description: "Unexpected `<!--`. Expected `-->`" 6853 }, 6854 /** @type {ErrorInfo} */ 6855 nestedNoscriptInHead: { 6856 reason: "Unexpected nested `<noscript>` in `<head>`", 6857 description: "Unexpected `<noscript>`. Expected a closing tag or a meta element", 6858 url: !1 6859 }, 6860 /** @type {ErrorInfo} */ 6861 nonConformingDoctype: { 6862 reason: "Unexpected non-conforming doctype declaration", 6863 description: 'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`', 6864 url: !1 6865 }, 6866 /** @type {ErrorInfo} */ 6867 nonVoidHtmlElementStartTagWithTrailingSolidus: { 6868 reason: "Unexpected trailing slash on start tag of non-void element", 6869 description: "Unexpected `/`. Expected `>` instead" 6870 }, 6871 /** @type {ErrorInfo} */ 6872 noncharacterCharacterReference: { 6873 reason: "Unexpected noncharacter code point referenced by character reference", 6874 description: "Unexpected code point. Do not use noncharacters in HTML" 6875 }, 6876 /** @type {ErrorInfo} */ 6877 noncharacterInInputStream: { 6878 reason: "Unexpected noncharacter character", 6879 description: "Unexpected code point `%x`. Do not use noncharacters in HTML" 6880 }, 6881 /** @type {ErrorInfo} */ 6882 nullCharacterReference: { 6883 reason: "Unexpected NULL character referenced by character reference", 6884 description: "Unexpected code point. Do not use NULL characters in HTML" 6885 }, 6886 /** @type {ErrorInfo} */ 6887 openElementsLeftAfterEof: { 6888 reason: "Unexpected end of file", 6889 description: "Unexpected end of file. Expected closing tag instead", 6890 url: !1 6891 }, 6892 /** @type {ErrorInfo} */ 6893 surrogateCharacterReference: { 6894 reason: "Unexpected surrogate character referenced by character reference", 6895 description: "Unexpected code point. Do not use lone surrogate characters in HTML" 6896 }, 6897 /** @type {ErrorInfo} */ 6898 surrogateInInputStream: { 6899 reason: "Unexpected surrogate character", 6900 description: "Unexpected code point `%x`. Do not use lone surrogate characters in HTML" 6901 }, 6902 /** @type {ErrorInfo} */ 6903 unexpectedCharacterAfterDoctypeSystemIdentifier: { 6904 reason: "Invalid character after system identifier in doctype", 6905 description: "Unexpected character at `%c`. Expected `>`" 6906 }, 6907 /** @type {ErrorInfo} */ 6908 unexpectedCharacterInAttributeName: { 6909 reason: "Unexpected character in attribute name", 6910 description: "Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter" 6911 }, 6912 /** @type {ErrorInfo} */ 6913 unexpectedCharacterInUnquotedAttributeValue: { 6914 reason: "Unexpected character in unquoted attribute value", 6915 description: "Unexpected `%c`. Quote the attribute value to include it" 6916 }, 6917 /** @type {ErrorInfo} */ 6918 unexpectedEqualsSignBeforeAttributeName: { 6919 reason: "Unexpected equals sign before attribute name", 6920 description: "Unexpected `%c`. Add an attribute name before it" 6921 }, 6922 /** @type {ErrorInfo} */ 6923 unexpectedNullCharacter: { 6924 reason: "Unexpected NULL character", 6925 description: "Unexpected code point `%x`. Do not use NULL characters in HTML" 6926 }, 6927 /** @type {ErrorInfo} */ 6928 unexpectedQuestionMarkInsteadOfTagName: { 6929 reason: "Unexpected question mark instead of tag name", 6930 description: "Unexpected `%c`. Expected an ASCII letter instead" 6931 }, 6932 /** @type {ErrorInfo} */ 6933 unexpectedSolidusInTag: { 6934 reason: "Unexpected slash in tag", 6935 description: "Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value" 6936 }, 6937 /** @type {ErrorInfo} */ 6938 unknownNamedCharacterReference: { 6939 reason: "Unexpected unknown named character reference", 6940 description: "Unexpected character reference. Expected known named character references" 6941 } 6942}, tr = "https://html.spec.whatwg.org/multipage/parsing.html#parse-error-", ur = /-[a-z]/g, ar = /%c(?:([-+])(\d+))?/g, sr = /%x/g, rr = { 2: !0, 1: !1, 0: null }, nr = {}; 6943function ir(e, t) { 6944 const u = t || nr, s = u.onerror, n = e instanceof Be ? e : new Be(e), o = u.fragment ? vs : Ys, E = String(n), l = o(E, { 6945 sourceCodeLocationInfo: !0, 6946 // Note `parse5` types currently do not allow `undefined`. 6947 onParseError: u.onerror ? T : null, 6948 scriptingEnabled: !1 6949 }); 6950 return ( 6951 /** @type {Root} */ 6952 ou(l, { 6953 file: n, 6954 space: u.space,
6955 verbose: u.verbose 6956 }) 6957 ); 6958 function T(m) { 6959 const _ = m.code, A = cr(_), I = u[A], O = I ?? !0, x = typeof O == "number" ? O : O ? 1 : 0; 6960 if (x) { 6961 const U = er[A], B = new R(C(U.reason), { 6962 place: { 6963 start: { 6964 line: m.startLine, 6965 column: m.startCol, 6966 offset: m.startOffset 6967 }, 6968 end: { 6969 line: m.endLine, 6970 column: m.endCol, 6971 offset: m.endOffset 6972 } 6973 }, 6974 ruleId: _, 6975 source: "hast-util-from-html" 6976 }); 6977 n.path && (B.file = n.path, B.name = n.path + ":" + B.name), B.fatal = rr[x], B.note = C(U.description), B.url = U.url === !1 ? void 0 : tr + _, s(B); 6978 } 6979 function C(U) { 6980 return U.replace(ar, B).replace(sr, V); 6981 function B(gr, Kt, qe) { 6982 const Xt = (qe ? Number.parseInt(qe, 10) : 0) * (Kt === "-" ? -1 : 1), jt = E.charAt(m.startOffset + Xt); 6983 return dr(jt); 6984 } 6985 function V() { 6986 return Er(E.charCodeAt(m.startOffset)); 6987 } 6988 } 6989 } 6990} 6991function cr(e) { 6992 return ( 6993 /** @type {ErrorCode} */ 6994 e.replace(ur, or) 6995 ); 6996} 6997function or(e) { 6998 return e.charAt(1).toUpperCase(); 6999} 7000function dr(e) { 7001 return e === "`" ? "` ` `" : e; 7002} 7003function Er(e) { 7004 return "0x" + e.toString(16).toUpperCase(); 7005} 7006function fr(e) { 7007 const t = this, { emitParseErrors: u, ...s } = { ...t.data("settings"), ...e }; 7008 t.parser = n; 7009 function n(o, E) { 7010 return ir(o, { 7011 ...s, 7012 onerror: u ? function(l) { 7013 E.path && (l.name = E.path + ":" + l.name, l.file = E.path), E.messages.push(l); 7014 } : void 0 7015 }); 7016 } 7017} 7018function lr(e) { 7019 const t = this, u = { ...t.data("settings"), ...e }; 7020 t.compiler = s; 7021 function s(n) { 7022 return Jt(n, u); 7023 } 7024} 7025function Et(e) { 7026 if (e) 7027 throw e; 7028} 7029var Ie, ft; 7030function hr() { 7031 if (ft) return Ie; 7032 ft = 1; 7033 var e = Object.prototype.hasOwnProperty, t = Object.prototype.toString, u = Object.defineProperty, s = Object.getOwnPropertyDescriptor, n = function(m) { 7034 return typeof Array.isArray == "function" ? Array.isArray(m) : t.call(m) === "[object Array]"; 7035 }, o = function(m) { 7036 if (!m || t.call(m) !== "[object Object]") 7037 return !1; 7038 var _ = e.call(m, "constructor"), A = m.constructor && m.constructor.prototype && e.call(m.constructor.prototype, "isPrototypeOf"); 7039 if (m.constructor && !_ && !A) 7040 return !1; 7041 var I; 7042 for (I in m) 7043 ; 7044 return typeof I > "u" || e.call(m, I); 7045 }, E = function(m, _) { 7046 u && _.name === "__proto__" ? u(m, _.name, { 7047 enumerable: !0, 7048 configurable: !0, 7049 value: _.newValue, 7050 writable: !0 7051 }) : m[_.name] = _.newValue; 7052 }, l = function(m, _) { 7053 if (_ === "__proto__") 7054 if (e.call(m, _)) { 7055 if (s) 7056 return s(m, _).value; 7057 } else return; 7058 return m[_]; 7059 }; 7060 return Ie = function T() { 7061 var m, _, A, I, O, x, C = arguments[0], U = 1, B = arguments.length, V = !1; 7062 for (typeof C == "boolean" && (V = C, C = arguments[1] || {}, U = 2), (C == null || typeof C != "object" && typeof C != "function") && (C = {}); U < B; ++U) 7063 if (m = arguments[U], m != null) 7064 for (_ in m) 7065 A = l(C, _), I = l(m, _), C !== I && (V && I && (o(I) || (O = n(I))) ? (O ? (O = !1, x = A && n(A) ? A : []) : x = A && o(A) ? A : {}, E(C, { name: _, newValue: T(V, x, I) })) : typeof I < "u" && E(C, { name: _, newValue: I })); 7066 return C; 7067 }, Ie; 7068} 7069var Tr = hr(); 7070const Ne = /* @__PURE__ */ zt(Tr); 7071function ye(e) { 7072 if (typeof e != "object" || e === null) 7073 return !1; 7074 const t = Object.getPrototypeOf(e); 7075 return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e); 7076} 7077function mr() { 7078 const e = [], t = { run: u, use: s }; 7079 return t; 7080 function u(...n) { 7081 let o = -1; 7082 const E = n.pop(); 7083 if (typeof E != "function") 7084 throw new TypeError("Expected function as last argument, not " + E); 7085 l(null, ...n); 7086 function l(T, ...m) { 7087 const _ = e[++o]; 7088 let A = -1; 7089 if (T) { 7090 E(T); 7091 return; 7092 } 7093 for (; ++A < n.length; ) 7094 (m[A] === null || m[A] === void 0) && (m[A] = n[A]); 7095 n = m, _ ? br(_, l)(...m) : E(null, ...m); 7096 } 7097 } 7098 function s(n) { 7099 if (typeof n != "function") 7100 throw new TypeError( 7101 "Expected `middelware` to be a function, not " + n 7102 ); 7103 return e.push(n), t;
vendor: 10,091 bytes, lines 7104-7409
7104 } 7105} 7106function br(e, t) { 7107 let u; 7108 return s; 7109 function s(...E) { 7110 const l = e.length > E.length; 7111 let T; 7112 l && E.push(n); 7113 try { 7114 T = e.apply(this, E); 7115 } catch (m) { 7116 const _ = ( 7117 /** @type {Error} */ 7118 m 7119 ); 7120 if (l && u) 7121 throw _; 7122 return n(_); 7123 } 7124 l || (T && T.then && typeof T.then == "function" ? T.then(o, n) : T instanceof Error ? n(T) : o(T)); 7125 } 7126 function n(E, ...l) { 7127 u || (u = !0, t(E, ...l)); 7128 } 7129 function o(E) { 7130 n(null, E); 7131 } 7132} 7133const _r = ( 7134 /** 7135 * @type {new <Parameters extends Array<unknown>, Result>(property: string | symbol) => (...parameters: Parameters) => Result} 7136 */ 7137 /** @type {unknown} */ 7138 /** 7139 * @this {Function} 7140 * @param {string | symbol} property 7141 * @returns {(...parameters: Array<unknown>) => unknown} 7142 */ 7143 (function(e) { 7144 const s = ( 7145 /** @type {Record<string | symbol, Function>} */ 7146 // Prototypes do exist. 7147 // type-coverage:ignore-next-line 7148 this.constructor.prototype 7149 ), n = s[e], o = function() { 7150 return n.apply(o, arguments); 7151 }; 7152 return Object.setPrototypeOf(o, s), o; 7153 }) 7154), Ar = {}.hasOwnProperty; 7155class Qe extends _r { 7156 /** 7157 * Create a processor. 7158 */ 7159 constructor() { 7160 super("copy"), this.Compiler = void 0, this.Parser = void 0, this.attachers = [], this.compiler = void 0, this.freezeIndex = -1, this.frozen = void 0, this.namespace = {}, this.parser = void 0, this.transformers = mr(); 7161 } 7162 /** 7163 * Copy a processor. 7164 * 7165 * @deprecated 7166 * This is a private internal method and should not be used. 7167 * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>} 7168 * New *unfrozen* processor ({@linkcode Processor}) that is 7169 * configured to work the same as its ancestor. 7170 * When the descendant processor is configured in the future it does not 7171 * affect the ancestral processor. 7172 */ 7173 copy() { 7174 const t = ( 7175 /** @type {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>} */ 7176 new Qe() 7177 ); 7178 let u = -1; 7179 for (; ++u < this.attachers.length; ) { 7180 const s = this.attachers[u]; 7181 t.use(...s); 7182 } 7183 return t.data(Ne(!0, {}, this.namespace)), t; 7184 } 7185 /** 7186 * Configure the processor with info available to all plugins. 7187 * Information is stored in an object. 7188 * 7189 * Typically, options can be given to a specific plugin, but sometimes it 7190 * makes sense to have information shared with several plugins. 7191 * For example, a list of HTML elements that are self-closing, which is 7192 * needed during all phases. 7193 * 7194 * > **Note**: setting information cannot occur on *frozen* processors. 7195 * > Call the processor first to create a new unfrozen processor. 7196 * 7197 * > **Note**: to register custom data in TypeScript, augment the 7198 * > {@linkcode Data} interface. 7199 * 7200 * @example 7201 * This example show how to get and set info: 7202 * 7203 * ```js 7204 * import {unified} from 'unified' 7205 * 7206 * const processor = unified().data('alpha', 'bravo') 7207 * 7208 * processor.data('alpha') // => 'bravo' 7209 * 7210 * processor.data() // => {alpha: 'bravo'} 7211 * 7212 * processor.data({charlie: 'delta'}) 7213 * 7214 * processor.data() // => {charlie: 'delta'} 7215 * ``` 7216 * 7217 * @template {keyof Data} Key 7218 * 7219 * @overload 7220 * @returns {Data} 7221 * 7222 * @overload 7223 * @param {Data} dataset 7224 * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>} 7225 * 7226 * @overload 7227 * @param {Key} key 7228 * @returns {Data[Key]} 7229 * 7230 * @overload 7231 * @param {Key} key 7232 * @param {Data[Key]} value 7233 * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>} 7234 * 7235 * @param {Data | Key} [key] 7236 * Key to get or set, or entire dataset to set, or nothing to get the 7237 * entire dataset (optional). 7238 * @param {Data[Key]} [value] 7239 * Value to set (optional). 7240 * @returns {unknown} 7241 * The current processor when setting, the value at `key` when getting, or 7242 * the entire dataset when getting without key. 7243 */ 7244 data(t, u) { 7245 return typeof t == "string" ? arguments.length === 2 ? (Se("data", this.frozen), this.namespace[t] = u, this) : Ar.call(this.namespace, t) && this.namespace[t] || void 0 : t ? (Se("data", this.frozen), this.namespace = t, this) : this.namespace; 7246 } 7247 /** 7248 * Freeze a processor. 7249 * 7250 * Frozen processors are meant to be extended and not to be configured 7251 * directly. 7252 * 7253 * When a processor is frozen it cannot be unfrozen. 7254 * New processors working the same way can be created by calling the 7255 * processor. 7256 * 7257 * Itâs possible to freeze processors explicitly by calling `.freeze()`. 7258 * Processors freeze automatically when `.parse()`, `.run()`, `.runSync()`, 7259 * `.stringify()`, `.process()`, or `.processSync()` are called. 7260 * 7261 * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>} 7262 * The current processor. 7263 */ 7264 freeze() { 7265 if (this.frozen) 7266 return this; 7267 const t = ( 7268 /** @type {Processor} */ 7269 /** @type {unknown} */ 7270 this 7271 ); 7272 for (; ++this.freezeIndex < this.attachers.length; ) { 7273 const [u, ...s] = this.attachers[this.freezeIndex]; 7274 if (s[0] === !1) 7275 continue; 7276 s[0] === !0 && (s[0] = void 0); 7277 const n = u.call(t, ...s); 7278 typeof n == "function" && this.transformers.use(n); 7279 } 7280 return this.frozen = !0, this.freezeIndex = Number.POSITIVE_INFINITY, this; 7281 } 7282 /** 7283 * Parse text to a syntax tree. 7284 * 7285 * > **Note**: `parse` freezes the processor if not already *frozen*. 7286 * 7287 * > **Note**: `parse` performs the parse phase, not the run phase or other 7288 * > phases. 7289 * 7290 * @param {Compatible | undefined} [file] 7291 * file to parse (optional); typically `string` or `VFile`; any value 7292 * accepted as `x` in `new VFile(x)`. 7293 * @returns {ParseTree extends undefined ? Node : ParseTree} 7294 * Syntax tree representing `file`. 7295 */ 7296 parse(t) { 7297 this.freeze(); 7298 const u = re(t), s = this.parser || this.Parser; 7299 return Ce("parse", s), s(String(u), u); 7300 } 7301 /** 7302 * Process the given file as configured on the processor. 7303 * 7304 * > **Note**: `process` freezes the processor if not already *frozen*. 7305 * 7306 * > **Note**: `process` performs the parse, run, and stringify phases. 7307 * 7308 * @overload 7309 * @param {Compatible | undefined} file 7310 * @param {ProcessCallback<VFileWithOutput<CompileResult>>} done 7311 * @returns {undefined} 7312 * 7313 * @overload 7314 * @param {Compatible | undefined} [file] 7315 * @returns {Promise<VFileWithOutput<CompileResult>>} 7316 * 7317 * @param {Compatible | undefined} [file] 7318 * File (optional); typically `string` or `VFile`]; any value accepted as 7319 * `x` in `new VFile(x)`. 7320 * @param {ProcessCallback<VFileWithOutput<CompileResult>> | undefined} [done] 7321 * Callback (optional). 7322 * @returns {Promise<VFile> | undefined} 7323 * Nothing if `done` is given. 7324 * Otherwise a promise, rejected with a fatal error or resolved with the 7325 * processed file. 7326 * 7327 * The parsed, transformed, and compiled value is available at 7328 * `file.value` (see note). 7329 * 7330 * > **Note**: unified typically compiles by serializing: most 7331 * > compilers return `string` (or `Uint8Array`). 7332 * > Some compilers, such as the one configured with 7333 * > [`rehype-react`][rehype-react], return other values (in this case, a 7334 * > React tree). 7335 * > If youâre using a compiler that doesnât serialize, expect different 7336 * > result values. 7337 * > 7338 * > To register custom results in TypeScript, add them to 7339 * > {@linkcode CompileResultMap}. 7340 * 7341 * [rehype-react]: https://github.com/rehypejs/rehype-react 7342 */ 7343 process(t, u) { 7344 const s = this; 7345 return this.freeze(), Ce("process", this.parser || this.Parser), ge("process", this.compiler || this.Compiler), u ? n(void 0, u) : new Promise(n); 7346 function n(o, E) { 7347 const l = re(t), T = ( 7348 /** @type {HeadTree extends undefined ? Node : HeadTree} */ 7349 /** @type {unknown} */ 7350 s.parse(l) 7351 ); 7352 s.run(T, l, function(_, A, I) { 7353 if (_ || !A || !I) 7354 return m(_); 7355 const O = ( 7356 /** @type {CompileTree extends undefined ? Node : CompileTree} */ 7357 /** @type {unknown} */ 7358 A 7359 ), x = s.stringify(O, I); 7360 Nr(x) ? I.value = x : I.result = x, m( 7361 _, 7362 /** @type {VFileWithOutput<CompileResult>} */ 7363 I 7364 ); 7365 }); 7366 function m(_, A) { 7367 _ || !A ? E(_) : o ? o(A) : u(void 0, A); 7368 } 7369 } 7370 } 7371 /** 7372 * Process the given file as configured on the processor. 7373 * 7374 * An error is thrown if asynchronous transforms are configured. 7375 * 7376 * > **Note**: `processSync` freezes the processor if not already *frozen*. 7377 * 7378 * > **Note**: `processSync` performs the parse, run, and stringify phases. 7379 * 7380 * @param {Compatible | undefined} [file] 7381 * File (optional); typically `string` or `VFile`; any value accepted as 7382 * `x` in `new VFile(x)`. 7383 * @returns {VFileWithOutput<CompileResult>} 7384 * The processed file. 7385 * 7386 * The parsed, transformed, and compiled value is available at 7387 * `file.value` (see note). 7388 * 7389 * > **Note**: unified typically compiles by serializing: most 7390 * > compilers return `string` (or `Uint8Array`). 7391 * > Some compilers, such as the one configured with 7392 * > [`rehype-react`][rehype-react], return other values (in this case, a 7393 * > React tree). 7394 * > If youâre using a compiler that doesnât serialize, expect different 7395 * > result values. 7396 * > 7397 * > To register custom results in TypeScript, add them to 7398 * > {@linkcode CompileResultMap}. 7399 * 7400 * [rehype-react]: https://github.com/rehypejs/rehype-react 7401 */ 7402 processSync(t) { 7403 let u = !1, s; 7404 return this.freeze(), Ce("processSync", this.parser || this.Parser), ge("processSync", this.compiler || this.Compiler), this.process(t, n), ht("processSync", "process", u), s; 7405 function n(o, E) { 7406 u = !0, Et(o), s = E; 7407 } 7408 } 7409 /**
7410 * Run *transformers* on a syntax tree. 7411 * 7412 * > **Note**: `run` freezes the processor if not already *frozen*. 7413 * 7414 * > **Note**: `run` performs the run phase, not other phases. 7415 * 7416 * @overload 7417 * @param {HeadTree extends undefined ? Node : HeadTree} tree 7418 * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} done 7419 * @returns {undefined} 7420 * 7421 * @overload 7422 * @param {HeadTree extends undefined ? Node : HeadTree} tree 7423 * @param {Compatible | undefined} file 7424 * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} done 7425 * @returns {undefined} 7426 * 7427 * @overload 7428 * @param {HeadTree extends undefined ? Node : HeadTree} tree 7429 * @param {Compatible | undefined} [file] 7430 * @returns {Promise<TailTree extends undefined ? Node : TailTree>} 7431 * 7432 * @param {HeadTree extends undefined ? Node : HeadTree} tree 7433 * Tree to transform and inspect. 7434 * @param {( 7435 * RunCallback<TailTree extends undefined ? Node : TailTree> | 7436 * Compatible 7437 * )} [file] 7438 * File associated with `node` (optional); any value accepted as `x` in 7439 * `new VFile(x)`. 7440 * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} [done] 7441 * Callback (optional). 7442 * @returns {Promise<TailTree extends undefined ? Node : TailTree> | undefined} 7443 * Nothing if `done` is given. 7444 * Otherwise, a promise rejected with a fatal error or resolved with the 7445 * transformed tree. 7446 */ 7447 run(t, u, s) { 7448 lt(t), this.freeze(); 7449 const n = this.transformers; 7450 return !s && typeof u == "function" && (s = u, u = void 0), s ? o(void 0, s) : new Promise(o); 7451 function o(E, l) { 7452 const T = re(u); 7453 n.run(t, T, m); 7454 function m(_, A, I) { 7455 const O = ( 7456 /** @type {TailTree extends undefined ? Node : TailTree} */ 7457 A || t 7458 ); 7459 _ ? l(_) : E ? E(O) : s(void 0, O, I); 7460 } 7461 } 7462 } 7463 /** 7464 * Run *transformers* on a syntax tree. 7465 * 7466 * An error is thrown if asynchronous transforms are configured. 7467 * 7468 * > **Note**: `runSync` freezes the processor if not already *frozen*. 7469 * 7470 * > **Note**: `runSync` performs the run phase, not other phases. 7471 * 7472 * @param {HeadTree extends undefined ? Node : HeadTree} tree 7473 * Tree to transform and inspect. 7474 * @param {Compatible | undefined} [file] 7475 * File associated with `node` (optional); any value accepted as `x` in 7476 * `new VFile(x)`. 7477 * @returns {TailTree extends undefined ? Node : TailTree} 7478 * Transformed tree. 7479 */ 7480 runSync(t, u) { 7481 let s = !1, n; 7482 return this.run(t, u, o), ht("runSync", "run", s), n; 7483 function o(E, l) { 7484 Et(E), n = l, s = !0; 7485 } 7486 } 7487 /** 7488 * Compile a syntax tree. 7489 * 7490 * > **Note**: `stringify` freezes the processor if not already *frozen*. 7491 * 7492 * > **Note**: `stringify` performs the stringify phase, not the run phase 7493 * > or other phases. 7494 * 7495 * @param {CompileTree extends undefined ? Node : CompileTree} tree 7496 * Tree to compile. 7497 * @param {Compatible | undefined} [file] 7498 * File associated with `node` (optional); any value accepted as `x` in 7499 * `new VFile(x)`. 7500 * @returns {CompileResult extends undefined ? Value : CompileResult} 7501 * Textual representation of the tree (see note). 7502 * 7503 * > **Note**: unified typically compiles by serializing: most compilers 7504 * > return `string` (or `Uint8Array`). 7505 * > Some compilers, such as the one configured with 7506 * > [`rehype-react`][rehype-react], return other values (in this case, a 7507 * > React tree). 7508 * > If youâre using a compiler that doesnât serialize, expect different 7509 * > result values. 7510 * > 7511 * > To register custom results in TypeScript, add them to 7512 * > {@linkcode CompileResultMap}. 7513 * 7514 * [rehype-react]: https://github.com/rehypejs/rehype-react 7515 */ 7516 stringify(t, u) { 7517 this.freeze(); 7518 const s = re(u), n = this.compiler || this.Compiler; 7519 return ge("stringify", n), lt(t), n(t, s); 7520 } 7521 /** 7522 * Configure the processor to use a plugin, a list of usable values, or a 7523 * preset. 7524 * 7525 * If the processor is already using a plugin, the previous plugin 7526 * configuration is changed based on the options that are passed in. 7527 * In other words, the plugin is not added a second time. 7528 * 7529 * > **Note**: `use` cannot be called on *frozen* processors. 7530 * > Call the processor first to create a new unfrozen processor. 7531 * 7532 * @example 7533 * There are many ways to pass plugins to `.use()`. 7534 * This example gives an overview: 7535 * 7536 * ```js 7537 * import {unified} from 'unified' 7538 * 7539 * unified() 7540 * // Plugin with options: 7541 * .use(pluginA, {x: true, y: true}) 7542 * // Passing the same plugin again merges configuration (to `{x: true, y: false, z: true}`): 7543 * .use(pluginA, {y: false, z: true}) 7544 * // Plugins: 7545 * .use([pluginB, pluginC]) 7546 * // Two plugins, the second with options: 7547 * .use([pluginD, [pluginE, {}]]) 7548 * // Preset with plugins and settings: 7549 * .use({plugins: [pluginF, [pluginG, {}]], settings: {position: false}}) 7550 * // Settings only: 7551 * .use({settings: {position: false}}) 7552 * ``` 7553 * 7554 * @template {Array<unknown>} [Parameters=[]]
7555 * @template {Node | string | undefined} [Input=undefined] 7556 * @template [Output=Input] 7557 * 7558 * @overload 7559 * @param {Preset | null | undefined} [preset] 7560 * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>} 7561 * 7562 * @overload 7563 * @param {PluggableList} list 7564 * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>} 7565 * 7566 * @overload 7567 * @param {Plugin<Parameters, Input, Output>} plugin 7568 * @param {...(Parameters | [boolean])} parameters 7569 * @returns {UsePlugin<ParseTree, HeadTree, TailTree, CompileTree, CompileResult, Input, Output>} 7570 * 7571 * @param {PluggableList | Plugin | Preset | null | undefined} value 7572 * Usable value. 7573 * @param {...unknown} parameters 7574 * Parameters, when a plugin is given as a usable value. 7575 * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>} 7576 * Current processor. 7577 */ 7578 use(t, ...u) { 7579 const s = this.attachers, n = this.namespace; 7580 if (Se("use", this.frozen), t != null) if (typeof t == "function") 7581 T(t, u); 7582 else if (typeof t == "object") 7583 Array.isArray(t) ? l(t) : E(t); 7584 else 7585 throw new TypeError("Expected usable value, not `" + t + "`"); 7586 return this; 7587 function o(m) { 7588 if (typeof m == "function") 7589 T(m, []); 7590 else if (typeof m == "object") 7591 if (Array.isArray(m)) { 7592 const [_, ...A] = ( 7593 /** @type {PluginTuple<Array<unknown>>} */ 7594 m 7595 ); 7596 T(_, A); 7597 } else 7598 E(m); 7599 else 7600 throw new TypeError("Expected usable value, not `" + m + "`"); 7601 } 7602 function E(m) { 7603 if (!("plugins" in m) && !("settings" in m)) 7604 throw new Error( 7605 "Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither" 7606 ); 7607 l(m.plugins), m.settings && (n.settings = Ne(!0, n.settings, m.settings)); 7608 } 7609 function l(m) { 7610 let _ = -1; 7611 if (m != null) if (Array.isArray(m)) 7612 for (; ++_ < m.length; ) { 7613 const A = m[_]; 7614 o(A); 7615 } 7616 else 7617 throw new TypeError("Expected a list of plugins, not `" + m + "`"); 7618 } 7619 function T(m, _) { 7620 let A = -1, I = -1; 7621 for (; ++A < s.length; ) 7622 if (s[A][0] === m) { 7623 I = A; 7624 break; 7625 } 7626 if (I === -1) 7627 s.push([m, ..._]); 7628 else if (_.length > 0) { 7629 let [O, ...x] = _; 7630 const C = s[I][1]; 7631 ye(C) && ye(O) && (O = Ne(!0, C, O)), s[I] = [m, O, ...x]; 7632 } 7633 } 7634 } 7635} 7636const pr = new Qe().freeze(); 7637function Ce(e, t) { 7638 if (typeof t != "function") 7639 throw new TypeError("Cannot `" + e + "` without `parser`"); 7640} 7641function ge(e, t) { 7642 if (typeof t != "function") 7643 throw new TypeError("Cannot `" + e + "` without `compiler`"); 7644} 7645function Se(e, t) { 7646 if (t) 7647 throw new Error( 7648 "Cannot call `" + e + "` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`." 7649 ); 7650} 7651function lt(e) { 7652 if (!ye(e) || typeof e.type != "string") 7653 throw new TypeError("Expected node, got `" + e + "`"); 7654} 7655function ht(e, t, u) { 7656 if (!u) 7657 throw new Error( 7658 "`" + e + "` finished async. Use `" + t + "` instead" 7659 ); 7660} 7661function re(e) { 7662 return Ir(e) ? e : new Be(e); 7663} 7664function Ir(e) { 7665 return !!(e && typeof e == "object" && "message" in e && "messages" in e); 7666} 7667function Nr(e) { 7668 return typeof e == "string" || Cr(e); 7669} 7670function Cr(e) { 7671 return !!(e && typeof e == "object" && "byteLength" in e && "byteOffset" in e); 7672} 7673const Lr = pr().use(fr).use(lr).freeze(); 7674export { 7675 Lr as r 7676}; 7677//# sourceMappingURL=rehype_CFsT5uBQ.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.