seo 0.12.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
9
  var __getOwnPropNames = Object.getOwnPropertyNames;
10
10
  var __getProtoOf = Object.getPrototypeOf;
11
11
  var __hasOwnProp = Object.prototype.hasOwnProperty;
12
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
12
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
13
13
  var __exportAll = (all, no_symbols) => {
14
14
  let target = {};
15
15
  for (var name in all) __defProp(target, name, {
@@ -29,14 +29,14 @@ var __copyProps = (to, from, except, desc) => {
29
29
  }
30
30
  return to;
31
31
  };
32
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
32
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
33
33
  value: mod,
34
34
  enumerable: true
35
35
  }) : target, mod));
36
36
  var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
37
37
  //#endregion
38
38
  //#region package.json
39
- var version = "0.12.1";
39
+ var version = "0.13.0";
40
40
  //#endregion
41
41
  //#region node_modules/.pnpm/cheerio@1.2.0/node_modules/cheerio/dist/esm/options.js
42
42
  const defaultOpts$1 = { _useHtmlParser2: false };
@@ -2067,8 +2067,10 @@ function data(name, value) {
2067
2067
  if (name == null) return readAllData(dataEl);
2068
2068
  if (typeof name === "object" || value !== void 0) {
2069
2069
  domEach(this, (el) => {
2070
- if (isTag(el)) if (typeof name === "object") setData(el, name);
2071
- else setData(el, name, value);
2070
+ if (isTag(el)) {
2071
+ if (typeof name === "object") setData(el, name);
2072
+ else setData(el, name, value);
2073
+ }
2072
2074
  });
2073
2075
  return this;
2074
2076
  }
@@ -2594,19 +2596,21 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports) => {
2594
2596
  }
2595
2597
  var name_2 = getName(1).toLowerCase();
2596
2598
  var data = null;
2597
- if (selector.charCodeAt(selectorIndex) === 40) if (unpackPseudos.has(name_2)) {
2598
- if (isQuote(selector.charCodeAt(selectorIndex + 1))) throw new Error("Pseudo-selector ".concat(name_2, " cannot be quoted"));
2599
- data = [];
2600
- selectorIndex = parseSelector(data, selector, selectorIndex + 1);
2601
- if (selector.charCodeAt(selectorIndex) !== 41) throw new Error("Missing closing parenthesis in :".concat(name_2, " (").concat(selector, ")"));
2602
- selectorIndex += 1;
2603
- } else {
2604
- data = readValueWithParenthesis();
2605
- if (stripQuotesFromPseudos.has(name_2)) {
2606
- var quot = data.charCodeAt(0);
2607
- if (quot === data.charCodeAt(data.length - 1) && isQuote(quot)) data = data.slice(1, -1);
2599
+ if (selector.charCodeAt(selectorIndex) === 40) {
2600
+ if (unpackPseudos.has(name_2)) {
2601
+ if (isQuote(selector.charCodeAt(selectorIndex + 1))) throw new Error("Pseudo-selector ".concat(name_2, " cannot be quoted"));
2602
+ data = [];
2603
+ selectorIndex = parseSelector(data, selector, selectorIndex + 1);
2604
+ if (selector.charCodeAt(selectorIndex) !== 41) throw new Error("Missing closing parenthesis in :".concat(name_2, " (").concat(selector, ")"));
2605
+ selectorIndex += 1;
2606
+ } else {
2607
+ data = readValueWithParenthesis();
2608
+ if (stripQuotesFromPseudos.has(name_2)) {
2609
+ var quot = data.charCodeAt(0);
2610
+ if (quot === data.charCodeAt(data.length - 1) && isQuote(quot)) data = data.slice(1, -1);
2611
+ }
2612
+ data = unescapeCSS(data);
2608
2613
  }
2609
- data = unescapeCSS(data);
2610
2614
  }
2611
2615
  tokens.push({
2612
2616
  type: types_1.SelectorType.Pseudo,
@@ -2664,8 +2668,8 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports) => {
2664
2668
  }));
2665
2669
  //#endregion
2666
2670
  //#region node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/commonjs/stringify.js
2667
- var require_stringify = /* @__PURE__ */ __commonJSMin(((exports) => {
2668
- var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) {
2671
+ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module, this$2) => {
2672
+ var __spreadArray = this$2 && this$2.__spreadArray || function(to, from, pack) {
2669
2673
  if (pack || arguments.length === 2) {
2670
2674
  for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
2671
2675
  if (!ar) ar = Array.prototype.slice.call(from, 0, i);
@@ -2762,8 +2766,8 @@ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports) => {
2762
2766
  }));
2763
2767
  //#endregion
2764
2768
  //#region node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/commonjs/index.js
2765
- var require_commonjs = /* @__PURE__ */ __commonJSMin(((exports) => {
2766
- var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
2769
+ var require_commonjs = /* @__PURE__ */ __commonJSMin(((exports, module, this$1) => {
2770
+ var __createBinding = this$1 && this$1.__createBinding || (Object.create ? (function(o, m, k, k2) {
2767
2771
  if (k2 === void 0) k2 = k;
2768
2772
  var desc = Object.getOwnPropertyDescriptor(m, k);
2769
2773
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
@@ -2777,8 +2781,8 @@ var require_commonjs = /* @__PURE__ */ __commonJSMin(((exports) => {
2777
2781
  if (k2 === void 0) k2 = k;
2778
2782
  o[k2] = m[k];
2779
2783
  }));
2780
- var __exportStar = exports && exports.__exportStar || function(m, exports$1) {
2781
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
2784
+ var __exportStar = this$1 && this$1.__exportStar || function(m, exports) {
2785
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2782
2786
  };
2783
2787
  Object.defineProperty(exports, "__esModule", { value: true });
2784
2788
  exports.stringify = exports.parse = exports.isTraversal = void 0;
@@ -2862,12 +2866,14 @@ function getProcedure(token) {
2862
2866
  proc = (_b = attributes.get(token.action)) !== null && _b !== void 0 ? _b : 4;
2863
2867
  if (token.action === import_commonjs.AttributeAction.Equals && token.name === "id") proc = 9;
2864
2868
  if (token.ignoreCase) proc >>= 1;
2865
- } else if (token.type === import_commonjs.SelectorType.Pseudo) if (!token.data) proc = 3;
2866
- else if (token.name === "has" || token.name === "contains") proc = 0;
2867
- else if (Array.isArray(token.data)) {
2868
- proc = Math.min(...token.data.map((d) => Math.min(...d.map(getProcedure))));
2869
- if (proc < 0) proc = 0;
2870
- } else proc = 2;
2869
+ } else if (token.type === import_commonjs.SelectorType.Pseudo) {
2870
+ if (!token.data) proc = 3;
2871
+ else if (token.name === "has" || token.name === "contains") proc = 0;
2872
+ else if (Array.isArray(token.data)) {
2873
+ proc = Math.min(...token.data.map((d) => Math.min(...d.map(getProcedure))));
2874
+ if (proc < 0) proc = 0;
2875
+ } else proc = 2;
2876
+ }
2871
2877
  return proc;
2872
2878
  }
2873
2879
  //#endregion
@@ -3731,10 +3737,12 @@ function filterParsed(selector, elements, options) {
3731
3737
  const filteredSelector = filteredSelectors[i];
3732
3738
  if ((found ? elements.filter((e) => isTag(e) && !found.has(e)) : elements).length === 0) break;
3733
3739
  const filtered = filterBySelector(filteredSelector, elements, options);
3734
- if (filtered.length) if (!found) {
3735
- if (i === filteredSelectors.length - 1) return filtered;
3736
- found = new Set(filtered);
3737
- } else filtered.forEach((el) => found.add(el));
3740
+ if (filtered.length) {
3741
+ if (!found) {
3742
+ if (i === filteredSelectors.length - 1) return filtered;
3743
+ found = new Set(filtered);
3744
+ } else filtered.forEach((el) => found.add(el));
3745
+ }
3738
3746
  }
3739
3747
  return typeof found !== "undefined" ? found.size === elements.length ? elements : elements.filter((el) => found.has(el)) : [];
3740
3748
  }
@@ -7290,9 +7298,7 @@ var Tokenizer = class {
7290
7298
  case TokenType.NULL_CHARACTER:
7291
7299
  this.handler.onNullCharacter(this.currentCharacterToken);
7292
7300
  break;
7293
- case TokenType.WHITESPACE_CHARACTER:
7294
- this.handler.onWhitespaceCharacter(this.currentCharacterToken);
7295
- break;
7301
+ case TokenType.WHITESPACE_CHARACTER: this.handler.onWhitespaceCharacter(this.currentCharacterToken);
7296
7302
  }
7297
7303
  this.currentCharacterToken = null;
7298
7304
  }
@@ -7312,13 +7318,15 @@ var Tokenizer = class {
7312
7318
  this.active = false;
7313
7319
  }
7314
7320
  _appendCharToCurrentCharacterToken(type, ch) {
7315
- if (this.currentCharacterToken) if (this.currentCharacterToken.type === type) {
7316
- this.currentCharacterToken.chars += ch;
7317
- return;
7318
- } else {
7319
- this.currentLocation = this.getCurrentLocation(0);
7320
- this._emitCurrentCharacterToken(this.currentLocation);
7321
- this.preprocessor.dropParsedChunk();
7321
+ if (this.currentCharacterToken) {
7322
+ if (this.currentCharacterToken.type === type) {
7323
+ this.currentCharacterToken.chars += ch;
7324
+ return;
7325
+ } else {
7326
+ this.currentLocation = this.getCurrentLocation(0);
7327
+ this._emitCurrentCharacterToken(this.currentLocation);
7328
+ this.preprocessor.dropParsedChunk();
7329
+ }
7322
7330
  }
7323
7331
  this._createCharacterToken(type, ch);
7324
7332
  }
@@ -8294,14 +8302,15 @@ var Tokenizer = class {
8294
8302
  } else if (this._consumeSequenceIfMatch(SEQUENCES.DOCTYPE, false)) {
8295
8303
  this.currentLocation = this.getCurrentLocation(SEQUENCES.DOCTYPE.length + 1);
8296
8304
  this.state = State$1.DOCTYPE;
8297
- } else if (this._consumeSequenceIfMatch(SEQUENCES.CDATA_START, true)) if (this.inForeignNode) this.state = State$1.CDATA_SECTION;
8298
- else {
8299
- this._err(ERR.cdataInHtmlContent);
8300
- this._createCommentToken(SEQUENCES.CDATA_START.length + 1);
8301
- this.currentToken.data = "[CDATA[";
8302
- this.state = State$1.BOGUS_COMMENT;
8303
- }
8304
- else if (!this._ensureHibernation()) {
8305
+ } else if (this._consumeSequenceIfMatch(SEQUENCES.CDATA_START, true)) {
8306
+ if (this.inForeignNode) this.state = State$1.CDATA_SECTION;
8307
+ else {
8308
+ this._err(ERR.cdataInHtmlContent);
8309
+ this._createCommentToken(SEQUENCES.CDATA_START.length + 1);
8310
+ this.currentToken.data = "[CDATA[";
8311
+ this.state = State$1.BOGUS_COMMENT;
8312
+ }
8313
+ } else if (!this._ensureHibernation()) {
8305
8314
  this._err(ERR.incorrectlyOpenedComment);
8306
8315
  this._createCommentToken(2);
8307
8316
  this.state = State$1.BOGUS_COMMENT;
@@ -8932,8 +8941,6 @@ var Tokenizer = class {
8932
8941
  case CODE_POINTS.EOF:
8933
8942
  this.emitCurrentDoctype(token);
8934
8943
  this._emitEOFToken();
8935
- break;
8936
- default:
8937
8944
  }
8938
8945
  }
8939
8946
  _stateCdataSection(cp) {
@@ -8972,13 +8979,15 @@ var Tokenizer = class {
8972
8979
  }
8973
8980
  _stateCharacterReference() {
8974
8981
  let length = this.entityDecoder.write(this.preprocessor.html, this.preprocessor.pos);
8975
- if (length < 0) if (this.preprocessor.lastChunkWritten) length = this.entityDecoder.end();
8976
- else {
8977
- this.active = false;
8978
- this.preprocessor.pos = this.preprocessor.html.length - 1;
8979
- this.consumedAfterSnapshot = 0;
8980
- this.preprocessor.endOfChunkHit = true;
8981
- return;
8982
+ if (length < 0) {
8983
+ if (this.preprocessor.lastChunkWritten) length = this.entityDecoder.end();
8984
+ else {
8985
+ this.active = false;
8986
+ this.preprocessor.pos = this.preprocessor.html.length - 1;
8987
+ this.consumedAfterSnapshot = 0;
8988
+ this.preprocessor.endOfChunkHit = true;
8989
+ return;
8990
+ }
8982
8991
  }
8983
8992
  if (length === 0) {
8984
8993
  this.preprocessor.pos = this.entityStartPos;
@@ -9174,13 +9183,15 @@ var OpenElementStack = class {
9174
9183
  }
9175
9184
  remove(element) {
9176
9185
  const idx = this._indexOf(element);
9177
- if (idx >= 0) if (idx === this.stackTop) this.pop();
9178
- else {
9179
- this.items.splice(idx, 1);
9180
- this.tagIDs.splice(idx, 1);
9181
- this.stackTop--;
9182
- this._updateCurrentElement();
9183
- this.handler.onItemPop(element, false);
9186
+ if (idx >= 0) {
9187
+ if (idx === this.stackTop) this.pop();
9188
+ else {
9189
+ this.items.splice(idx, 1);
9190
+ this.tagIDs.splice(idx, 1);
9191
+ this.stackTop--;
9192
+ this._updateCurrentElement();
9193
+ this.handler.onItemPop(element, false);
9194
+ }
9184
9195
  }
9185
9196
  }
9186
9197
  tryPeekProperlyNestedBodyElement() {
@@ -9207,9 +9218,7 @@ var OpenElementStack = class {
9207
9218
  case NS.SVG:
9208
9219
  if (SCOPING_ELEMENTS_SVG.has(tn)) return false;
9209
9220
  break;
9210
- case NS.MATHML:
9211
- if (SCOPING_ELEMENTS_MATHML.has(tn)) return false;
9212
- break;
9221
+ case NS.MATHML: if (SCOPING_ELEMENTS_MATHML.has(tn)) return false;
9213
9222
  }
9214
9223
  }
9215
9224
  return true;
@@ -9234,9 +9243,7 @@ var OpenElementStack = class {
9234
9243
  case NS.SVG:
9235
9244
  if (SCOPING_ELEMENTS_SVG.has(tn)) return false;
9236
9245
  break;
9237
- case NS.MATHML:
9238
- if (SCOPING_ELEMENTS_MATHML.has(tn)) return false;
9239
- break;
9246
+ case NS.MATHML: if (SCOPING_ELEMENTS_MATHML.has(tn)) return false;
9240
9247
  }
9241
9248
  }
9242
9249
  return true;
@@ -10107,10 +10114,7 @@ var Parser$1 = class {
10107
10114
  case TAG_ID.SCRIPT:
10108
10115
  this.tokenizer.state = TokenizerMode.SCRIPT_DATA;
10109
10116
  break;
10110
- case TAG_ID.PLAINTEXT:
10111
- this.tokenizer.state = TokenizerMode.PLAINTEXT;
10112
- break;
10113
- default:
10117
+ case TAG_ID.PLAINTEXT: this.tokenizer.state = TokenizerMode.PLAINTEXT;
10114
10118
  }
10115
10119
  }
10116
10120
  /** @protected */
@@ -10266,9 +10270,7 @@ var Parser$1 = class {
10266
10270
  case TokenType.EOF:
10267
10271
  this.onEof(token);
10268
10272
  break;
10269
- case TokenType.WHITESPACE_CHARACTER:
10270
- this.onWhitespaceCharacter(token);
10271
- break;
10273
+ case TokenType.WHITESPACE_CHARACTER: this.onWhitespaceCharacter(token);
10272
10274
  }
10273
10275
  }
10274
10276
  /** @protected */
@@ -10342,12 +10344,10 @@ var Parser$1 = class {
10342
10344
  return;
10343
10345
  }
10344
10346
  break;
10345
- case TAG_ID.HEAD:
10346
- if (i > 0) {
10347
- this.insertionMode = InsertionMode.IN_HEAD;
10348
- return;
10349
- }
10350
- break;
10347
+ case TAG_ID.HEAD: if (i > 0) {
10348
+ this.insertionMode = InsertionMode.IN_HEAD;
10349
+ return;
10350
+ }
10351
10351
  }
10352
10352
  this.insertionMode = InsertionMode.IN_BODY;
10353
10353
  }
@@ -10393,7 +10393,6 @@ var Parser$1 = class {
10393
10393
  beforeElement: null
10394
10394
  };
10395
10395
  }
10396
- default:
10397
10396
  }
10398
10397
  }
10399
10398
  return {
@@ -10409,7 +10408,8 @@ var Parser$1 = class {
10409
10408
  }
10410
10409
  /** @protected */
10411
10410
  _isSpecialElement(element, id) {
10412
- return SPECIAL_ELEMENTS[this.treeAdapter.getNamespaceURI(element)].has(id);
10411
+ const ns = this.treeAdapter.getNamespaceURI(element);
10412
+ return SPECIAL_ELEMENTS[ns].has(id);
10413
10413
  }
10414
10414
  /** @internal */
10415
10415
  onCharacter(token) {
@@ -10462,10 +10462,7 @@ var Parser$1 = class {
10462
10462
  case InsertionMode.AFTER_BODY:
10463
10463
  tokenAfterBody(this, token);
10464
10464
  break;
10465
- case InsertionMode.AFTER_AFTER_BODY:
10466
- tokenAfterAfterBody(this, token);
10467
- break;
10468
- default:
10465
+ case InsertionMode.AFTER_AFTER_BODY: tokenAfterAfterBody(this, token);
10469
10466
  }
10470
10467
  }
10471
10468
  /** @internal */
@@ -10508,10 +10505,7 @@ var Parser$1 = class {
10508
10505
  case InsertionMode.AFTER_BODY:
10509
10506
  tokenAfterBody(this, token);
10510
10507
  break;
10511
- case InsertionMode.AFTER_AFTER_BODY:
10512
- tokenAfterAfterBody(this, token);
10513
- break;
10514
- default:
10508
+ case InsertionMode.AFTER_AFTER_BODY: tokenAfterAfterBody(this, token);
10515
10509
  }
10516
10510
  }
10517
10511
  /** @internal */
@@ -10549,10 +10543,7 @@ var Parser$1 = class {
10549
10543
  appendCommentToRootHtmlElement(this, token);
10550
10544
  break;
10551
10545
  case InsertionMode.AFTER_AFTER_BODY:
10552
- case InsertionMode.AFTER_AFTER_FRAMESET:
10553
- appendCommentToDocument(this, token);
10554
- break;
10555
- default:
10546
+ case InsertionMode.AFTER_AFTER_FRAMESET: appendCommentToDocument(this, token);
10556
10547
  }
10557
10548
  }
10558
10549
  /** @internal */
@@ -10568,10 +10559,7 @@ var Parser$1 = class {
10568
10559
  case InsertionMode.AFTER_HEAD:
10569
10560
  this._err(token, ERR.misplacedDoctype);
10570
10561
  break;
10571
- case InsertionMode.IN_TABLE_TEXT:
10572
- tokenInTableText(this, token);
10573
- break;
10574
- default:
10562
+ case InsertionMode.IN_TABLE_TEXT: tokenInTableText(this, token);
10575
10563
  }
10576
10564
  }
10577
10565
  /** @internal */
@@ -10662,10 +10650,7 @@ var Parser$1 = class {
10662
10650
  case InsertionMode.AFTER_AFTER_BODY:
10663
10651
  startTagAfterAfterBody(this, token);
10664
10652
  break;
10665
- case InsertionMode.AFTER_AFTER_FRAMESET:
10666
- startTagAfterAfterFrameset(this, token);
10667
- break;
10668
- default:
10653
+ case InsertionMode.AFTER_AFTER_FRAMESET: startTagAfterAfterFrameset(this, token);
10669
10654
  }
10670
10655
  }
10671
10656
  /** @internal */
@@ -10741,10 +10726,7 @@ var Parser$1 = class {
10741
10726
  case InsertionMode.AFTER_FRAMESET:
10742
10727
  endTagAfterFrameset(this, token);
10743
10728
  break;
10744
- case InsertionMode.AFTER_AFTER_BODY:
10745
- tokenAfterAfterBody(this, token);
10746
- break;
10747
- default:
10729
+ case InsertionMode.AFTER_AFTER_BODY: tokenAfterAfterBody(this, token);
10748
10730
  }
10749
10731
  }
10750
10732
  /** @internal */
@@ -10792,10 +10774,7 @@ var Parser$1 = class {
10792
10774
  case InsertionMode.IN_FRAMESET:
10793
10775
  case InsertionMode.AFTER_FRAMESET:
10794
10776
  case InsertionMode.AFTER_AFTER_BODY:
10795
- case InsertionMode.AFTER_AFTER_FRAMESET:
10796
- stopParsing(this, token);
10797
- break;
10798
- default:
10777
+ case InsertionMode.AFTER_AFTER_FRAMESET: stopParsing(this, token);
10799
10778
  }
10800
10779
  }
10801
10780
  /** @internal */
@@ -10837,10 +10816,7 @@ var Parser$1 = class {
10837
10816
  case InsertionMode.IN_ROW:
10838
10817
  characterInTable(this, token);
10839
10818
  break;
10840
- case InsertionMode.IN_TABLE_TEXT:
10841
- whitespaceCharacterInTableText(this, token);
10842
- break;
10843
- default:
10819
+ case InsertionMode.IN_TABLE_TEXT: whitespaceCharacterInTableText(this, token);
10844
10820
  }
10845
10821
  }
10846
10822
  };
@@ -11193,10 +11169,7 @@ function modeInBody(p, token) {
11193
11169
  case TokenType.END_TAG:
11194
11170
  endTagInBody(p, token);
11195
11171
  break;
11196
- case TokenType.EOF:
11197
- eofInBody(p, token);
11198
- break;
11199
- default:
11172
+ case TokenType.EOF: eofInBody(p, token);
11200
11173
  }
11201
11174
  }
11202
11175
  function whitespaceCharacterInBody(p, token) {
@@ -11781,9 +11754,7 @@ function characterInTable(p, token) {
11781
11754
  case TokenType.CHARACTER:
11782
11755
  characterInTableText(p, token);
11783
11756
  break;
11784
- case TokenType.WHITESPACE_CHARACTER:
11785
- whitespaceCharacterInTableText(p, token);
11786
- break;
11757
+ case TokenType.WHITESPACE_CHARACTER: whitespaceCharacterInTableText(p, token);
11787
11758
  }
11788
11759
  } else tokenInTable(p, token);
11789
11760
  }
@@ -12197,10 +12168,7 @@ function startTagInSelect(p, token) {
12197
12168
  }
12198
12169
  break;
12199
12170
  case TAG_ID.SCRIPT:
12200
- case TAG_ID.TEMPLATE:
12201
- startTagInHead(p, token);
12202
- break;
12203
- default:
12171
+ case TAG_ID.TEMPLATE: startTagInHead(p, token);
12204
12172
  }
12205
12173
  }
12206
12174
  function endTagInSelect(p, token) {
@@ -12218,10 +12186,7 @@ function endTagInSelect(p, token) {
12218
12186
  p._resetInsertionMode();
12219
12187
  }
12220
12188
  break;
12221
- case TAG_ID.TEMPLATE:
12222
- templateEndTagInHead(p, token);
12223
- break;
12224
- default:
12189
+ case TAG_ID.TEMPLATE: templateEndTagInHead(p, token);
12225
12190
  }
12226
12191
  }
12227
12192
  function startTagInSelectInTable(p, token) {
@@ -12330,10 +12295,7 @@ function startTagInFrameset(p, token) {
12330
12295
  p._appendElement(token, NS.HTML);
12331
12296
  token.ackSelfClosing = true;
12332
12297
  break;
12333
- case TAG_ID.NOFRAMES:
12334
- startTagInHead(p, token);
12335
- break;
12336
- default:
12298
+ case TAG_ID.NOFRAMES: startTagInHead(p, token);
12337
12299
  }
12338
12300
  }
12339
12301
  function endTagInFrameset(p, token) {
@@ -12347,10 +12309,7 @@ function startTagAfterFrameset(p, token) {
12347
12309
  case TAG_ID.HTML:
12348
12310
  startTagInBody(p, token);
12349
12311
  break;
12350
- case TAG_ID.NOFRAMES:
12351
- startTagInHead(p, token);
12352
- break;
12353
- default:
12312
+ case TAG_ID.NOFRAMES: startTagInHead(p, token);
12354
12313
  }
12355
12314
  }
12356
12315
  function endTagAfterFrameset(p, token) {
@@ -12369,10 +12328,7 @@ function startTagAfterAfterFrameset(p, token) {
12369
12328
  case TAG_ID.HTML:
12370
12329
  startTagInBody(p, token);
12371
12330
  break;
12372
- case TAG_ID.NOFRAMES:
12373
- startTagInHead(p, token);
12374
- break;
12375
- default:
12331
+ case TAG_ID.NOFRAMES: startTagInHead(p, token);
12376
12332
  }
12377
12333
  }
12378
12334
  function nullCharacterInForeignContent(p, token) {
@@ -13045,9 +13001,11 @@ var require_internal = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13045
13001
  acc = acc << 6 | curByte & 63;
13046
13002
  contBytes--;
13047
13003
  accBytes++;
13048
- if (contBytes === 0) if (accBytes === 2 && acc < 128 && acc > 0) res += this.defaultCharUnicode;
13049
- else if (accBytes === 3 && acc < 2048) res += this.defaultCharUnicode;
13050
- else res += String.fromCharCode(acc);
13004
+ if (contBytes === 0) {
13005
+ if (accBytes === 2 && acc < 128 && acc > 0) res += this.defaultCharUnicode;
13006
+ else if (accBytes === 3 && acc < 2048) res += this.defaultCharUnicode;
13007
+ else res += String.fromCharCode(acc);
13008
+ }
13051
13009
  } else res += this.defaultCharUnicode;
13052
13010
  }
13053
13011
  this.acc = acc;
@@ -13096,15 +13054,17 @@ var require_utf32 = /* @__PURE__ */ __commonJSMin(((exports) => {
13096
13054
  var code = src.readUInt16LE(i);
13097
13055
  var isHighSurrogate = 55296 <= code && code < 56320;
13098
13056
  var isLowSurrogate = 56320 <= code && code < 57344;
13099
- if (this.highSurrogate) if (isHighSurrogate || !isLowSurrogate) {
13100
- write32.call(dst, this.highSurrogate, offset);
13101
- offset += 4;
13102
- } else {
13103
- var codepoint = (this.highSurrogate - 55296 << 10 | code - 56320) + 65536;
13104
- write32.call(dst, codepoint, offset);
13105
- offset += 4;
13106
- this.highSurrogate = 0;
13107
- continue;
13057
+ if (this.highSurrogate) {
13058
+ if (isHighSurrogate || !isLowSurrogate) {
13059
+ write32.call(dst, this.highSurrogate, offset);
13060
+ offset += 4;
13061
+ } else {
13062
+ var codepoint = (this.highSurrogate - 55296 << 10 | code - 56320) + 65536;
13063
+ write32.call(dst, codepoint, offset);
13064
+ offset += 4;
13065
+ this.highSurrogate = 0;
13066
+ continue;
13067
+ }
13108
13068
  }
13109
13069
  if (isHighSurrogate) this.highSurrogate = code;
13110
13070
  else {
@@ -14377,18 +14337,20 @@ var require_dbcs_codec = /* @__PURE__ */ __commonJSMin(((exports) => {
14377
14337
  var uCode = nextChar;
14378
14338
  nextChar = -1;
14379
14339
  }
14380
- if (55296 <= uCode && uCode < 57344) if (uCode < 56320) if (leadSurrogate === -1) {
14381
- leadSurrogate = uCode;
14382
- continue;
14383
- } else {
14384
- leadSurrogate = uCode;
14385
- uCode = UNASSIGNED;
14386
- }
14387
- else if (leadSurrogate !== -1) {
14388
- uCode = 65536 + (leadSurrogate - 55296) * 1024 + (uCode - 56320);
14389
- leadSurrogate = -1;
14390
- } else uCode = UNASSIGNED;
14391
- else if (leadSurrogate !== -1) {
14340
+ if (55296 <= uCode && uCode < 57344) {
14341
+ if (uCode < 56320) {
14342
+ if (leadSurrogate === -1) {
14343
+ leadSurrogate = uCode;
14344
+ continue;
14345
+ } else {
14346
+ leadSurrogate = uCode;
14347
+ uCode = UNASSIGNED;
14348
+ }
14349
+ } else if (leadSurrogate !== -1) {
14350
+ uCode = 65536 + (leadSurrogate - 55296) * 1024 + (uCode - 56320);
14351
+ leadSurrogate = -1;
14352
+ } else uCode = UNASSIGNED;
14353
+ } else if (leadSurrogate !== -1) {
14392
14354
  nextChar = uCode;
14393
14355
  uCode = UNASSIGNED;
14394
14356
  leadSurrogate = -1;
@@ -14455,10 +14417,12 @@ var require_dbcs_codec = /* @__PURE__ */ __commonJSMin(((exports) => {
14455
14417
  var newBuf = Buffer.alloc(10), j = 0;
14456
14418
  if (this.seqObj) {
14457
14419
  var dbcsCode = this.seqObj[DEF_CHAR];
14458
- if (dbcsCode !== void 0) if (dbcsCode < 256) newBuf[j++] = dbcsCode;
14459
- else {
14460
- newBuf[j++] = dbcsCode >> 8;
14461
- newBuf[j++] = dbcsCode & 255;
14420
+ if (dbcsCode !== void 0) {
14421
+ if (dbcsCode < 256) newBuf[j++] = dbcsCode;
14422
+ else {
14423
+ newBuf[j++] = dbcsCode >> 8;
14424
+ newBuf[j++] = dbcsCode & 255;
14425
+ }
14462
14426
  }
14463
14427
  this.seqObj = void 0;
14464
14428
  }
@@ -22143,4 +22107,4 @@ var require_serializer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
22143
22107
  //#endregion
22144
22108
  export { __toESM as i, version as n, __commonJSMin as r, load as t };
22145
22109
 
22146
- //# sourceMappingURL=esm-Cyusbw2J.js.map
22110
+ //# sourceMappingURL=esm-BfNQ2FiC.js.map