weml-monaco 0.3.2 → 0.4.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.
@@ -4,15 +4,23 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
8
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
9
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
10
  }) : x)(function(x) {
10
11
  if (typeof require !== "undefined") return require.apply(this, arguments);
11
12
  throw Error('Dynamic require of "' + x + '" is not supported');
12
13
  });
14
+ var __esm = (fn, res) => function __init() {
15
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
16
+ };
13
17
  var __commonJS = (cb, mod) => function __require2() {
14
18
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
19
  };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, { get: all[name], enumerable: true });
23
+ };
16
24
  var __copyProps = (to, from, except, desc) => {
17
25
  if (from && typeof from === "object" || typeof from === "function") {
18
26
  for (let key of __getOwnPropNames(from))
@@ -29,10 +37,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
37
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
38
  mod
31
39
  ));
40
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
41
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
32
42
 
33
43
  // ../node_modules/he/he.js
34
44
  var require_he = __commonJS({
35
45
  "../node_modules/he/he.js"(exports, module) {
46
+ "use strict";
36
47
  (function(root) {
37
48
  var freeExports = typeof exports == "object" && exports;
38
49
  var freeModule = typeof module == "object" && module && module.exports == freeExports && module;
@@ -288,7 +299,7 @@ var require_node = __commonJS({
288
299
  var he_1 = require_he();
289
300
  var Node7 = (
290
301
  /** @class */
291
- function() {
302
+ (function() {
292
303
  function Node8(parentNode, range) {
293
304
  if (parentNode === void 0) {
294
305
  parentNode = null;
@@ -331,7 +342,7 @@ var require_node = __commonJS({
331
342
  configurable: true
332
343
  });
333
344
  return Node8;
334
- }()
345
+ })()
335
346
  );
336
347
  exports.default = Node7;
337
348
  }
@@ -356,7 +367,7 @@ var require_type = __commonJS({
356
367
  var require_comment = __commonJS({
357
368
  "../node_modules/node-html-parser/dist/nodes/comment.js"(exports) {
358
369
  "use strict";
359
- var __extends = exports && exports.__extends || /* @__PURE__ */ function() {
370
+ var __extends = exports && exports.__extends || /* @__PURE__ */ (function() {
360
371
  var extendStatics = function(d, b) {
361
372
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
362
373
  d2.__proto__ = b2;
@@ -374,7 +385,7 @@ var require_comment = __commonJS({
374
385
  }
375
386
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
376
387
  };
377
- }();
388
+ })();
378
389
  var __importDefault = exports && exports.__importDefault || function(mod) {
379
390
  return mod && mod.__esModule ? mod : { "default": mod };
380
391
  };
@@ -383,7 +394,7 @@ var require_comment = __commonJS({
383
394
  var type_1 = __importDefault(require_type());
384
395
  var CommentNode = (
385
396
  /** @class */
386
- function(_super) {
397
+ (function(_super) {
387
398
  __extends(CommentNode2, _super);
388
399
  function CommentNode2(rawText, parentNode, range, rawTagName) {
389
400
  if (parentNode === void 0) {
@@ -416,7 +427,7 @@ var require_comment = __commonJS({
416
427
  return "<!--".concat(this.rawText, "-->");
417
428
  };
418
429
  return CommentNode2;
419
- }(node_1.default)
430
+ })(node_1.default)
420
431
  );
421
432
  exports.default = CommentNode;
422
433
  }
@@ -460,7 +471,7 @@ var require_lib = __commonJS({
460
471
  var require_node2 = __commonJS({
461
472
  "../node_modules/domhandler/lib/node.js"(exports) {
462
473
  "use strict";
463
- var __extends = exports && exports.__extends || /* @__PURE__ */ function() {
474
+ var __extends = exports && exports.__extends || /* @__PURE__ */ (function() {
464
475
  var extendStatics = function(d, b) {
465
476
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
466
477
  d2.__proto__ = b2;
@@ -478,7 +489,7 @@ var require_node2 = __commonJS({
478
489
  }
479
490
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
480
491
  };
481
- }();
492
+ })();
482
493
  var __assign = exports && exports.__assign || function() {
483
494
  __assign = Object.assign || function(t2) {
484
495
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -495,7 +506,7 @@ var require_node2 = __commonJS({
495
506
  var domelementtype_1 = require_lib();
496
507
  var Node7 = (
497
508
  /** @class */
498
- function() {
509
+ (function() {
499
510
  function Node8() {
500
511
  this.parent = null;
501
512
  this.prev = null;
@@ -553,12 +564,12 @@ var require_node2 = __commonJS({
553
564
  return cloneNode(this, recursive);
554
565
  };
555
566
  return Node8;
556
- }()
567
+ })()
557
568
  );
558
569
  exports.Node = Node7;
559
570
  var DataNode = (
560
571
  /** @class */
561
- function(_super) {
572
+ (function(_super) {
562
573
  __extends(DataNode2, _super);
563
574
  function DataNode2(data) {
564
575
  var _this = _super.call(this) || this;
@@ -580,12 +591,12 @@ var require_node2 = __commonJS({
580
591
  configurable: true
581
592
  });
582
593
  return DataNode2;
583
- }(Node7)
594
+ })(Node7)
584
595
  );
585
596
  exports.DataNode = DataNode;
586
597
  var Text = (
587
598
  /** @class */
588
- function(_super) {
599
+ (function(_super) {
589
600
  __extends(Text2, _super);
590
601
  function Text2() {
591
602
  var _this = _super !== null && _super.apply(this, arguments) || this;
@@ -600,12 +611,12 @@ var require_node2 = __commonJS({
600
611
  configurable: true
601
612
  });
602
613
  return Text2;
603
- }(DataNode)
614
+ })(DataNode)
604
615
  );
605
616
  exports.Text = Text;
606
617
  var Comment = (
607
618
  /** @class */
608
- function(_super) {
619
+ (function(_super) {
609
620
  __extends(Comment2, _super);
610
621
  function Comment2() {
611
622
  var _this = _super !== null && _super.apply(this, arguments) || this;
@@ -620,12 +631,12 @@ var require_node2 = __commonJS({
620
631
  configurable: true
621
632
  });
622
633
  return Comment2;
623
- }(DataNode)
634
+ })(DataNode)
624
635
  );
625
636
  exports.Comment = Comment;
626
637
  var ProcessingInstruction = (
627
638
  /** @class */
628
- function(_super) {
639
+ (function(_super) {
629
640
  __extends(ProcessingInstruction2, _super);
630
641
  function ProcessingInstruction2(name, data) {
631
642
  var _this = _super.call(this, data) || this;
@@ -641,12 +652,12 @@ var require_node2 = __commonJS({
641
652
  configurable: true
642
653
  });
643
654
  return ProcessingInstruction2;
644
- }(DataNode)
655
+ })(DataNode)
645
656
  );
646
657
  exports.ProcessingInstruction = ProcessingInstruction;
647
658
  var NodeWithChildren = (
648
659
  /** @class */
649
- function(_super) {
660
+ (function(_super) {
650
661
  __extends(NodeWithChildren2, _super);
651
662
  function NodeWithChildren2(children) {
652
663
  var _this = _super.call(this) || this;
@@ -686,12 +697,12 @@ var require_node2 = __commonJS({
686
697
  configurable: true
687
698
  });
688
699
  return NodeWithChildren2;
689
- }(Node7)
700
+ })(Node7)
690
701
  );
691
702
  exports.NodeWithChildren = NodeWithChildren;
692
703
  var CDATA = (
693
704
  /** @class */
694
- function(_super) {
705
+ (function(_super) {
695
706
  __extends(CDATA2, _super);
696
707
  function CDATA2() {
697
708
  var _this = _super !== null && _super.apply(this, arguments) || this;
@@ -706,12 +717,12 @@ var require_node2 = __commonJS({
706
717
  configurable: true
707
718
  });
708
719
  return CDATA2;
709
- }(NodeWithChildren)
720
+ })(NodeWithChildren)
710
721
  );
711
722
  exports.CDATA = CDATA;
712
723
  var Document = (
713
724
  /** @class */
714
- function(_super) {
725
+ (function(_super) {
715
726
  __extends(Document2, _super);
716
727
  function Document2() {
717
728
  var _this = _super !== null && _super.apply(this, arguments) || this;
@@ -726,12 +737,12 @@ var require_node2 = __commonJS({
726
737
  configurable: true
727
738
  });
728
739
  return Document2;
729
- }(NodeWithChildren)
740
+ })(NodeWithChildren)
730
741
  );
731
742
  exports.Document = Document;
732
743
  var Element = (
733
744
  /** @class */
734
- function(_super) {
745
+ (function(_super) {
735
746
  __extends(Element2, _super);
736
747
  function Element2(name, attribs, children, type) {
737
748
  if (children === void 0) {
@@ -785,7 +796,7 @@ var require_node2 = __commonJS({
785
796
  configurable: true
786
797
  });
787
798
  return Element2;
788
- }(NodeWithChildren)
799
+ })(NodeWithChildren)
789
800
  );
790
801
  exports.Element = Element;
791
802
  function isTag(node) {
@@ -894,7 +905,7 @@ var require_node2 = __commonJS({
894
905
  var require_lib2 = __commonJS({
895
906
  "../node_modules/domhandler/lib/index.js"(exports) {
896
907
  "use strict";
897
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
908
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
898
909
  if (k2 === void 0) k2 = k;
899
910
  var desc = Object.getOwnPropertyDescriptor(m, k);
900
911
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
@@ -903,10 +914,10 @@ var require_lib2 = __commonJS({
903
914
  } };
904
915
  }
905
916
  Object.defineProperty(o, k2, desc);
906
- } : function(o, m, k, k2) {
917
+ }) : (function(o, m, k, k2) {
907
918
  if (k2 === void 0) k2 = k;
908
919
  o[k2] = m[k];
909
- });
920
+ }));
910
921
  var __exportStar = exports && exports.__exportStar || function(m, exports2) {
911
922
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
912
923
  };
@@ -922,7 +933,7 @@ var require_lib2 = __commonJS({
922
933
  };
923
934
  var DomHandler = (
924
935
  /** @class */
925
- function() {
936
+ (function() {
926
937
  function DomHandler2(callback, options, elementCB) {
927
938
  this.dom = [];
928
939
  this.root = new node_js_1.Document(this.dom);
@@ -1042,7 +1053,7 @@ var require_lib2 = __commonJS({
1042
1053
  this.lastNode = null;
1043
1054
  };
1044
1055
  return DomHandler2;
1045
- }()
1056
+ })()
1046
1057
  );
1047
1058
  exports.DomHandler = DomHandler;
1048
1059
  exports.default = DomHandler;
@@ -1145,7 +1156,7 @@ var require_decode_codepoint = __commonJS({
1145
1156
  var require_decode = __commonJS({
1146
1157
  "../node_modules/entities/lib/decode.js"(exports) {
1147
1158
  "use strict";
1148
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
1159
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
1149
1160
  if (k2 === void 0) k2 = k;
1150
1161
  var desc = Object.getOwnPropertyDescriptor(m, k);
1151
1162
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
@@ -1154,13 +1165,13 @@ var require_decode = __commonJS({
1154
1165
  } };
1155
1166
  }
1156
1167
  Object.defineProperty(o, k2, desc);
1157
- } : function(o, m, k, k2) {
1168
+ }) : (function(o, m, k, k2) {
1158
1169
  if (k2 === void 0) k2 = k;
1159
1170
  o[k2] = m[k];
1160
- });
1161
- var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
1171
+ }));
1172
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
1162
1173
  Object.defineProperty(o, "default", { enumerable: true, value: v });
1163
- } : function(o, v) {
1174
+ }) : function(o, v) {
1164
1175
  o["default"] = v;
1165
1176
  });
1166
1177
  var __importStar = exports && exports.__importStar || function(mod) {
@@ -1240,7 +1251,7 @@ var require_decode = __commonJS({
1240
1251
  })(DecodingMode = exports.DecodingMode || (exports.DecodingMode = {}));
1241
1252
  var EntityDecoder = (
1242
1253
  /** @class */
1243
- function() {
1254
+ (function() {
1244
1255
  function EntityDecoder2(decodeTree, emitCodePoint, errors) {
1245
1256
  this.decodeTree = decodeTree;
1246
1257
  this.emitCodePoint = emitCodePoint;
@@ -1402,6 +1413,7 @@ var require_decode = __commonJS({
1402
1413
  case EntityDecoderState.NamedEntity: {
1403
1414
  return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
1404
1415
  }
1416
+ // Otherwise, emit a numeric entity if we have one.
1405
1417
  case EntityDecoderState.NumericDecimal: {
1406
1418
  return this.emitNumericEntity(0, 2);
1407
1419
  }
@@ -1418,7 +1430,7 @@ var require_decode = __commonJS({
1418
1430
  }
1419
1431
  };
1420
1432
  return EntityDecoder2;
1421
- }()
1433
+ })()
1422
1434
  );
1423
1435
  exports.EntityDecoder = EntityDecoder;
1424
1436
  function getDecoder(decodeTree) {
@@ -1900,7 +1912,7 @@ var require_lib4 = __commonJS({
1900
1912
  };
1901
1913
  return __assign.apply(this, arguments);
1902
1914
  };
1903
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
1915
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
1904
1916
  if (k2 === void 0) k2 = k;
1905
1917
  var desc = Object.getOwnPropertyDescriptor(m, k);
1906
1918
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
@@ -1909,13 +1921,13 @@ var require_lib4 = __commonJS({
1909
1921
  } };
1910
1922
  }
1911
1923
  Object.defineProperty(o, k2, desc);
1912
- } : function(o, m, k, k2) {
1924
+ }) : (function(o, m, k, k2) {
1913
1925
  if (k2 === void 0) k2 = k;
1914
1926
  o[k2] = m[k];
1915
- });
1916
- var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
1927
+ }));
1928
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
1917
1929
  Object.defineProperty(o, "default", { enumerable: true, value: v });
1918
- } : function(o, v) {
1930
+ }) : function(o, v) {
1919
1931
  o["default"] = v;
1920
1932
  });
1921
1933
  var __importStar = exports && exports.__importStar || function(mod) {
@@ -2000,6 +2012,7 @@ var require_lib4 = __commonJS({
2000
2012
  switch (node.type) {
2001
2013
  case ElementType.Root:
2002
2014
  return render(node.children, options);
2015
+ // @ts-expect-error We don't use `Doctype` yet
2003
2016
  case ElementType.Doctype:
2004
2017
  case ElementType.Directive:
2005
2018
  return renderDirective(node);
@@ -2760,7 +2773,7 @@ var require_feeds = __commonJS({
2760
2773
  var require_lib5 = __commonJS({
2761
2774
  "../node_modules/domutils/lib/index.js"(exports) {
2762
2775
  "use strict";
2763
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
2776
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
2764
2777
  if (k2 === void 0) k2 = k;
2765
2778
  var desc = Object.getOwnPropertyDescriptor(m, k);
2766
2779
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
@@ -2769,10 +2782,10 @@ var require_lib5 = __commonJS({
2769
2782
  } };
2770
2783
  }
2771
2784
  Object.defineProperty(o, k2, desc);
2772
- } : function(o, m, k, k2) {
2785
+ }) : (function(o, m, k, k2) {
2773
2786
  if (k2 === void 0) k2 = k;
2774
2787
  o[k2] = m[k];
2775
- });
2788
+ }));
2776
2789
  var __exportStar = exports && exports.__exportStar || function(m, exports2) {
2777
2790
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
2778
2791
  };
@@ -2810,6 +2823,7 @@ var require_lib5 = __commonJS({
2810
2823
  // ../node_modules/boolbase/index.js
2811
2824
  var require_boolbase = __commonJS({
2812
2825
  "../node_modules/boolbase/index.js"(exports, module) {
2826
+ "use strict";
2813
2827
  module.exports = {
2814
2828
  trueFunc: function trueFunc() {
2815
2829
  return true;
@@ -2821,13 +2835,11 @@ var require_boolbase = __commonJS({
2821
2835
  }
2822
2836
  });
2823
2837
 
2824
- // ../node_modules/css-what/lib/commonjs/types.js
2825
- var require_types = __commonJS({
2826
- "../node_modules/css-what/lib/commonjs/types.js"(exports) {
2838
+ // ../node_modules/css-what/lib/es/types.js
2839
+ var SelectorType, IgnoreCaseMode, AttributeAction;
2840
+ var init_types = __esm({
2841
+ "../node_modules/css-what/lib/es/types.js"() {
2827
2842
  "use strict";
2828
- Object.defineProperty(exports, "__esModule", { value: true });
2829
- exports.AttributeAction = exports.IgnoreCaseMode = exports.SelectorType = void 0;
2830
- var SelectorType;
2831
2843
  (function(SelectorType2) {
2832
2844
  SelectorType2["Attribute"] = "attribute";
2833
2845
  SelectorType2["Pseudo"] = "pseudo";
@@ -2840,14 +2852,13 @@ var require_types = __commonJS({
2840
2852
  SelectorType2["Parent"] = "parent";
2841
2853
  SelectorType2["Sibling"] = "sibling";
2842
2854
  SelectorType2["ColumnCombinator"] = "column-combinator";
2843
- })(SelectorType = exports.SelectorType || (exports.SelectorType = {}));
2844
- exports.IgnoreCaseMode = {
2855
+ })(SelectorType || (SelectorType = {}));
2856
+ IgnoreCaseMode = {
2845
2857
  Unknown: null,
2846
2858
  QuirksMode: "quirks",
2847
2859
  IgnoreCase: true,
2848
2860
  CaseSensitive: false
2849
2861
  };
2850
- var AttributeAction;
2851
2862
  (function(AttributeAction2) {
2852
2863
  AttributeAction2["Any"] = "any";
2853
2864
  AttributeAction2["Element"] = "element";
@@ -2857,387 +2868,452 @@ var require_types = __commonJS({
2857
2868
  AttributeAction2["Hyphen"] = "hyphen";
2858
2869
  AttributeAction2["Not"] = "not";
2859
2870
  AttributeAction2["Start"] = "start";
2860
- })(AttributeAction = exports.AttributeAction || (exports.AttributeAction = {}));
2871
+ })(AttributeAction || (AttributeAction = {}));
2861
2872
  }
2862
2873
  });
2863
2874
 
2864
- // ../node_modules/css-what/lib/commonjs/parse.js
2865
- var require_parse = __commonJS({
2866
- "../node_modules/css-what/lib/commonjs/parse.js"(exports) {
2867
- "use strict";
2868
- Object.defineProperty(exports, "__esModule", { value: true });
2869
- exports.parse = exports.isTraversal = void 0;
2870
- var types_1 = require_types();
2871
- var reName = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/;
2872
- var reEscape = /\\([\da-f]{1,6}\s?|(\s)|.)/gi;
2873
- var actionTypes = /* @__PURE__ */ new Map([
2874
- [126, types_1.AttributeAction.Element],
2875
- [94, types_1.AttributeAction.Start],
2876
- [36, types_1.AttributeAction.End],
2877
- [42, types_1.AttributeAction.Any],
2878
- [33, types_1.AttributeAction.Not],
2879
- [124, types_1.AttributeAction.Hyphen]
2880
- ]);
2881
- var unpackPseudos = /* @__PURE__ */ new Set([
2882
- "has",
2883
- "not",
2884
- "matches",
2885
- "is",
2886
- "where",
2887
- "host",
2888
- "host-context"
2889
- ]);
2890
- function isTraversal(selector) {
2891
- switch (selector.type) {
2892
- case types_1.SelectorType.Adjacent:
2893
- case types_1.SelectorType.Child:
2894
- case types_1.SelectorType.Descendant:
2895
- case types_1.SelectorType.Parent:
2896
- case types_1.SelectorType.Sibling:
2897
- case types_1.SelectorType.ColumnCombinator:
2898
- return true;
2899
- default:
2900
- return false;
2901
- }
2875
+ // ../node_modules/css-what/lib/es/parse.js
2876
+ function isTraversal(selector) {
2877
+ switch (selector.type) {
2878
+ case SelectorType.Adjacent:
2879
+ case SelectorType.Child:
2880
+ case SelectorType.Descendant:
2881
+ case SelectorType.Parent:
2882
+ case SelectorType.Sibling:
2883
+ case SelectorType.ColumnCombinator:
2884
+ return true;
2885
+ default:
2886
+ return false;
2887
+ }
2888
+ }
2889
+ function funescape(_, escaped, escapedWhitespace) {
2890
+ const high = parseInt(escaped, 16) - 65536;
2891
+ return high !== high || escapedWhitespace ? escaped : high < 0 ? (
2892
+ // BMP codepoint
2893
+ String.fromCharCode(high + 65536)
2894
+ ) : (
2895
+ // Supplemental Plane codepoint (surrogate pair)
2896
+ String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320)
2897
+ );
2898
+ }
2899
+ function unescapeCSS(str) {
2900
+ return str.replace(reEscape, funescape);
2901
+ }
2902
+ function isQuote(c) {
2903
+ return c === 39 || c === 34;
2904
+ }
2905
+ function isWhitespace(c) {
2906
+ return c === 32 || c === 9 || c === 10 || c === 12 || c === 13;
2907
+ }
2908
+ function parse(selector) {
2909
+ const subselects = [];
2910
+ const endIndex = parseSelector(subselects, `${selector}`, 0);
2911
+ if (endIndex < selector.length) {
2912
+ throw new Error(`Unmatched selector: ${selector.slice(endIndex)}`);
2913
+ }
2914
+ return subselects;
2915
+ }
2916
+ function parseSelector(subselects, selector, selectorIndex) {
2917
+ let tokens = [];
2918
+ function getName(offset) {
2919
+ const match = selector.slice(selectorIndex + offset).match(reName);
2920
+ if (!match) {
2921
+ throw new Error(`Expected name, found ${selector.slice(selectorIndex)}`);
2902
2922
  }
2903
- exports.isTraversal = isTraversal;
2904
- var stripQuotesFromPseudos = /* @__PURE__ */ new Set(["contains", "icontains"]);
2905
- function funescape(_, escaped, escapedWhitespace) {
2906
- var high = parseInt(escaped, 16) - 65536;
2907
- return high !== high || escapedWhitespace ? escaped : high < 0 ? (
2908
- // BMP codepoint
2909
- String.fromCharCode(high + 65536)
2910
- ) : (
2911
- // Supplemental Plane codepoint (surrogate pair)
2912
- String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320)
2913
- );
2923
+ const [name] = match;
2924
+ selectorIndex += offset + name.length;
2925
+ return unescapeCSS(name);
2926
+ }
2927
+ function stripWhitespace(offset) {
2928
+ selectorIndex += offset;
2929
+ while (selectorIndex < selector.length && isWhitespace(selector.charCodeAt(selectorIndex))) {
2930
+ selectorIndex++;
2914
2931
  }
2915
- function unescapeCSS(str) {
2916
- return str.replace(reEscape, funescape);
2932
+ }
2933
+ function readValueWithParenthesis() {
2934
+ selectorIndex += 1;
2935
+ const start = selectorIndex;
2936
+ let counter = 1;
2937
+ for (; counter > 0 && selectorIndex < selector.length; selectorIndex++) {
2938
+ if (selector.charCodeAt(selectorIndex) === 40 && !isEscaped(selectorIndex)) {
2939
+ counter++;
2940
+ } else if (selector.charCodeAt(selectorIndex) === 41 && !isEscaped(selectorIndex)) {
2941
+ counter--;
2942
+ }
2917
2943
  }
2918
- function isQuote2(c) {
2919
- return c === 39 || c === 34;
2944
+ if (counter) {
2945
+ throw new Error("Parenthesis not matched");
2920
2946
  }
2921
- function isWhitespace2(c) {
2922
- return c === 32 || c === 9 || c === 10 || c === 12 || c === 13;
2947
+ return unescapeCSS(selector.slice(start, selectorIndex - 1));
2948
+ }
2949
+ function isEscaped(pos) {
2950
+ let slashCount = 0;
2951
+ while (selector.charCodeAt(--pos) === 92)
2952
+ slashCount++;
2953
+ return (slashCount & 1) === 1;
2954
+ }
2955
+ function ensureNotTraversal() {
2956
+ if (tokens.length > 0 && isTraversal(tokens[tokens.length - 1])) {
2957
+ throw new Error("Did not expect successive traversals.");
2923
2958
  }
2924
- function parse(selector) {
2925
- var subselects = [];
2926
- var endIndex = parseSelector(subselects, "".concat(selector), 0);
2927
- if (endIndex < selector.length) {
2928
- throw new Error("Unmatched selector: ".concat(selector.slice(endIndex)));
2929
- }
2930
- return subselects;
2959
+ }
2960
+ function addTraversal(type) {
2961
+ if (tokens.length > 0 && tokens[tokens.length - 1].type === SelectorType.Descendant) {
2962
+ tokens[tokens.length - 1].type = type;
2963
+ return;
2931
2964
  }
2932
- exports.parse = parse;
2933
- function parseSelector(subselects, selector, selectorIndex) {
2934
- var tokens = [];
2935
- function getName(offset) {
2936
- var match = selector.slice(selectorIndex + offset).match(reName);
2937
- if (!match) {
2938
- throw new Error("Expected name, found ".concat(selector.slice(selectorIndex)));
2939
- }
2940
- var name = match[0];
2941
- selectorIndex += offset + name.length;
2942
- return unescapeCSS(name);
2965
+ ensureNotTraversal();
2966
+ tokens.push({ type });
2967
+ }
2968
+ function addSpecialAttribute(name, action) {
2969
+ tokens.push({
2970
+ type: SelectorType.Attribute,
2971
+ name,
2972
+ action,
2973
+ value: getName(1),
2974
+ namespace: null,
2975
+ ignoreCase: "quirks"
2976
+ });
2977
+ }
2978
+ function finalizeSubselector() {
2979
+ if (tokens.length && tokens[tokens.length - 1].type === SelectorType.Descendant) {
2980
+ tokens.pop();
2981
+ }
2982
+ if (tokens.length === 0) {
2983
+ throw new Error("Empty sub-selector");
2984
+ }
2985
+ subselects.push(tokens);
2986
+ }
2987
+ stripWhitespace(0);
2988
+ if (selector.length === selectorIndex) {
2989
+ return selectorIndex;
2990
+ }
2991
+ loop: while (selectorIndex < selector.length) {
2992
+ const firstChar = selector.charCodeAt(selectorIndex);
2993
+ switch (firstChar) {
2994
+ // Whitespace
2995
+ case 32:
2996
+ case 9:
2997
+ case 10:
2998
+ case 12:
2999
+ case 13: {
3000
+ if (tokens.length === 0 || tokens[0].type !== SelectorType.Descendant) {
3001
+ ensureNotTraversal();
3002
+ tokens.push({ type: SelectorType.Descendant });
3003
+ }
3004
+ stripWhitespace(1);
3005
+ break;
2943
3006
  }
2944
- function stripWhitespace(offset) {
2945
- selectorIndex += offset;
2946
- while (selectorIndex < selector.length && isWhitespace2(selector.charCodeAt(selectorIndex))) {
2947
- selectorIndex++;
2948
- }
3007
+ // Traversals
3008
+ case 62: {
3009
+ addTraversal(SelectorType.Child);
3010
+ stripWhitespace(1);
3011
+ break;
2949
3012
  }
2950
- function readValueWithParenthesis() {
2951
- selectorIndex += 1;
2952
- var start = selectorIndex;
2953
- var counter = 1;
2954
- for (; counter > 0 && selectorIndex < selector.length; selectorIndex++) {
2955
- if (selector.charCodeAt(selectorIndex) === 40 && !isEscaped(selectorIndex)) {
2956
- counter++;
2957
- } else if (selector.charCodeAt(selectorIndex) === 41 && !isEscaped(selectorIndex)) {
2958
- counter--;
2959
- }
2960
- }
2961
- if (counter) {
2962
- throw new Error("Parenthesis not matched");
2963
- }
2964
- return unescapeCSS(selector.slice(start, selectorIndex - 1));
3013
+ case 60: {
3014
+ addTraversal(SelectorType.Parent);
3015
+ stripWhitespace(1);
3016
+ break;
2965
3017
  }
2966
- function isEscaped(pos) {
2967
- var slashCount = 0;
2968
- while (selector.charCodeAt(--pos) === 92)
2969
- slashCount++;
2970
- return (slashCount & 1) === 1;
3018
+ case 126: {
3019
+ addTraversal(SelectorType.Sibling);
3020
+ stripWhitespace(1);
3021
+ break;
2971
3022
  }
2972
- function ensureNotTraversal() {
2973
- if (tokens.length > 0 && isTraversal(tokens[tokens.length - 1])) {
2974
- throw new Error("Did not expect successive traversals.");
2975
- }
3023
+ case 43: {
3024
+ addTraversal(SelectorType.Adjacent);
3025
+ stripWhitespace(1);
3026
+ break;
2976
3027
  }
2977
- function addTraversal(type) {
2978
- if (tokens.length > 0 && tokens[tokens.length - 1].type === types_1.SelectorType.Descendant) {
2979
- tokens[tokens.length - 1].type = type;
2980
- return;
2981
- }
2982
- ensureNotTraversal();
2983
- tokens.push({ type });
3028
+ // Special attribute selectors: .class, #id
3029
+ case 46: {
3030
+ addSpecialAttribute("class", AttributeAction.Element);
3031
+ break;
2984
3032
  }
2985
- function addSpecialAttribute(name, action2) {
2986
- tokens.push({
2987
- type: types_1.SelectorType.Attribute,
2988
- name,
2989
- action: action2,
2990
- value: getName(1),
2991
- namespace: null,
2992
- ignoreCase: "quirks"
2993
- });
3033
+ case 35: {
3034
+ addSpecialAttribute("id", AttributeAction.Equals);
3035
+ break;
2994
3036
  }
2995
- function finalizeSubselector() {
2996
- if (tokens.length && tokens[tokens.length - 1].type === types_1.SelectorType.Descendant) {
2997
- tokens.pop();
2998
- }
2999
- if (tokens.length === 0) {
3000
- throw new Error("Empty sub-selector");
3001
- }
3002
- subselects.push(tokens);
3003
- }
3004
- stripWhitespace(0);
3005
- if (selector.length === selectorIndex) {
3006
- return selectorIndex;
3007
- }
3008
- loop: while (selectorIndex < selector.length) {
3009
- var firstChar = selector.charCodeAt(selectorIndex);
3010
- switch (firstChar) {
3011
- case 32:
3012
- case 9:
3013
- case 10:
3014
- case 12:
3015
- case 13: {
3016
- if (tokens.length === 0 || tokens[0].type !== types_1.SelectorType.Descendant) {
3017
- ensureNotTraversal();
3018
- tokens.push({ type: types_1.SelectorType.Descendant });
3037
+ case 91: {
3038
+ stripWhitespace(1);
3039
+ let name;
3040
+ let namespace = null;
3041
+ if (selector.charCodeAt(selectorIndex) === 124) {
3042
+ name = getName(1);
3043
+ } else if (selector.startsWith("*|", selectorIndex)) {
3044
+ namespace = "*";
3045
+ name = getName(2);
3046
+ } else {
3047
+ name = getName(0);
3048
+ if (selector.charCodeAt(selectorIndex) === 124 && selector.charCodeAt(selectorIndex + 1) !== 61) {
3049
+ namespace = name;
3050
+ name = getName(1);
3051
+ }
3052
+ }
3053
+ stripWhitespace(0);
3054
+ let action = AttributeAction.Exists;
3055
+ const possibleAction = actionTypes.get(selector.charCodeAt(selectorIndex));
3056
+ if (possibleAction) {
3057
+ action = possibleAction;
3058
+ if (selector.charCodeAt(selectorIndex + 1) !== 61) {
3059
+ throw new Error("Expected `=`");
3060
+ }
3061
+ stripWhitespace(2);
3062
+ } else if (selector.charCodeAt(selectorIndex) === 61) {
3063
+ action = AttributeAction.Equals;
3064
+ stripWhitespace(1);
3065
+ }
3066
+ let value = "";
3067
+ let ignoreCase = null;
3068
+ if (action !== "exists") {
3069
+ if (isQuote(selector.charCodeAt(selectorIndex))) {
3070
+ const quote = selector.charCodeAt(selectorIndex);
3071
+ let sectionEnd = selectorIndex + 1;
3072
+ while (sectionEnd < selector.length && (selector.charCodeAt(sectionEnd) !== quote || isEscaped(sectionEnd))) {
3073
+ sectionEnd += 1;
3019
3074
  }
3020
- stripWhitespace(1);
3021
- break;
3022
- }
3023
- case 62: {
3024
- addTraversal(types_1.SelectorType.Child);
3025
- stripWhitespace(1);
3026
- break;
3027
- }
3028
- case 60: {
3029
- addTraversal(types_1.SelectorType.Parent);
3030
- stripWhitespace(1);
3031
- break;
3075
+ if (selector.charCodeAt(sectionEnd) !== quote) {
3076
+ throw new Error("Attribute value didn't end");
3077
+ }
3078
+ value = unescapeCSS(selector.slice(selectorIndex + 1, sectionEnd));
3079
+ selectorIndex = sectionEnd + 1;
3080
+ } else {
3081
+ const valueStart = selectorIndex;
3082
+ while (selectorIndex < selector.length && (!isWhitespace(selector.charCodeAt(selectorIndex)) && selector.charCodeAt(selectorIndex) !== 93 || isEscaped(selectorIndex))) {
3083
+ selectorIndex += 1;
3084
+ }
3085
+ value = unescapeCSS(selector.slice(valueStart, selectorIndex));
3032
3086
  }
3033
- case 126: {
3034
- addTraversal(types_1.SelectorType.Sibling);
3087
+ stripWhitespace(0);
3088
+ const forceIgnore = selector.charCodeAt(selectorIndex) | 32;
3089
+ if (forceIgnore === 115) {
3090
+ ignoreCase = false;
3035
3091
  stripWhitespace(1);
3036
- break;
3037
- }
3038
- case 43: {
3039
- addTraversal(types_1.SelectorType.Adjacent);
3092
+ } else if (forceIgnore === 105) {
3093
+ ignoreCase = true;
3040
3094
  stripWhitespace(1);
3041
- break;
3042
- }
3043
- case 46: {
3044
- addSpecialAttribute("class", types_1.AttributeAction.Element);
3045
- break;
3046
3095
  }
3047
- case 35: {
3048
- addSpecialAttribute("id", types_1.AttributeAction.Equals);
3049
- break;
3050
- }
3051
- case 91: {
3052
- stripWhitespace(1);
3053
- var name_1 = void 0;
3054
- var namespace = null;
3055
- if (selector.charCodeAt(selectorIndex) === 124) {
3056
- name_1 = getName(1);
3057
- } else if (selector.startsWith("*|", selectorIndex)) {
3058
- namespace = "*";
3059
- name_1 = getName(2);
3060
- } else {
3061
- name_1 = getName(0);
3062
- if (selector.charCodeAt(selectorIndex) === 124 && selector.charCodeAt(selectorIndex + 1) !== 61) {
3063
- namespace = name_1;
3064
- name_1 = getName(1);
3065
- }
3066
- }
3067
- stripWhitespace(0);
3068
- var action = types_1.AttributeAction.Exists;
3069
- var possibleAction = actionTypes.get(selector.charCodeAt(selectorIndex));
3070
- if (possibleAction) {
3071
- action = possibleAction;
3072
- if (selector.charCodeAt(selectorIndex + 1) !== 61) {
3073
- throw new Error("Expected `=`");
3074
- }
3075
- stripWhitespace(2);
3076
- } else if (selector.charCodeAt(selectorIndex) === 61) {
3077
- action = types_1.AttributeAction.Equals;
3078
- stripWhitespace(1);
3079
- }
3080
- var value = "";
3081
- var ignoreCase = null;
3082
- if (action !== "exists") {
3083
- if (isQuote2(selector.charCodeAt(selectorIndex))) {
3084
- var quote = selector.charCodeAt(selectorIndex);
3085
- var sectionEnd = selectorIndex + 1;
3086
- while (sectionEnd < selector.length && (selector.charCodeAt(sectionEnd) !== quote || isEscaped(sectionEnd))) {
3087
- sectionEnd += 1;
3088
- }
3089
- if (selector.charCodeAt(sectionEnd) !== quote) {
3090
- throw new Error("Attribute value didn't end");
3091
- }
3092
- value = unescapeCSS(selector.slice(selectorIndex + 1, sectionEnd));
3093
- selectorIndex = sectionEnd + 1;
3094
- } else {
3095
- var valueStart = selectorIndex;
3096
- while (selectorIndex < selector.length && (!isWhitespace2(selector.charCodeAt(selectorIndex)) && selector.charCodeAt(selectorIndex) !== 93 || isEscaped(selectorIndex))) {
3097
- selectorIndex += 1;
3098
- }
3099
- value = unescapeCSS(selector.slice(valueStart, selectorIndex));
3100
- }
3101
- stripWhitespace(0);
3102
- var forceIgnore = selector.charCodeAt(selectorIndex) | 32;
3103
- if (forceIgnore === 115) {
3104
- ignoreCase = false;
3105
- stripWhitespace(1);
3106
- } else if (forceIgnore === 105) {
3107
- ignoreCase = true;
3108
- stripWhitespace(1);
3109
- }
3096
+ }
3097
+ if (selector.charCodeAt(selectorIndex) !== 93) {
3098
+ throw new Error("Attribute selector didn't terminate");
3099
+ }
3100
+ selectorIndex += 1;
3101
+ const attributeSelector = {
3102
+ type: SelectorType.Attribute,
3103
+ name,
3104
+ action,
3105
+ value,
3106
+ namespace,
3107
+ ignoreCase
3108
+ };
3109
+ tokens.push(attributeSelector);
3110
+ break;
3111
+ }
3112
+ case 58: {
3113
+ if (selector.charCodeAt(selectorIndex + 1) === 58) {
3114
+ tokens.push({
3115
+ type: SelectorType.PseudoElement,
3116
+ name: getName(2).toLowerCase(),
3117
+ data: selector.charCodeAt(selectorIndex) === 40 ? readValueWithParenthesis() : null
3118
+ });
3119
+ continue;
3120
+ }
3121
+ const name = getName(1).toLowerCase();
3122
+ let data = null;
3123
+ if (selector.charCodeAt(selectorIndex) === 40) {
3124
+ if (unpackPseudos.has(name)) {
3125
+ if (isQuote(selector.charCodeAt(selectorIndex + 1))) {
3126
+ throw new Error(`Pseudo-selector ${name} cannot be quoted`);
3110
3127
  }
3111
- if (selector.charCodeAt(selectorIndex) !== 93) {
3112
- throw new Error("Attribute selector didn't terminate");
3128
+ data = [];
3129
+ selectorIndex = parseSelector(data, selector, selectorIndex + 1);
3130
+ if (selector.charCodeAt(selectorIndex) !== 41) {
3131
+ throw new Error(`Missing closing parenthesis in :${name} (${selector})`);
3113
3132
  }
3114
3133
  selectorIndex += 1;
3115
- var attributeSelector = {
3116
- type: types_1.SelectorType.Attribute,
3117
- name: name_1,
3118
- action,
3119
- value,
3120
- namespace,
3121
- ignoreCase
3122
- };
3123
- tokens.push(attributeSelector);
3124
- break;
3125
- }
3126
- case 58: {
3127
- if (selector.charCodeAt(selectorIndex + 1) === 58) {
3128
- tokens.push({
3129
- type: types_1.SelectorType.PseudoElement,
3130
- name: getName(2).toLowerCase(),
3131
- data: selector.charCodeAt(selectorIndex) === 40 ? readValueWithParenthesis() : null
3132
- });
3133
- continue;
3134
- }
3135
- var name_2 = getName(1).toLowerCase();
3136
- var data = null;
3137
- if (selector.charCodeAt(selectorIndex) === 40) {
3138
- if (unpackPseudos.has(name_2)) {
3139
- if (isQuote2(selector.charCodeAt(selectorIndex + 1))) {
3140
- throw new Error("Pseudo-selector ".concat(name_2, " cannot be quoted"));
3141
- }
3142
- data = [];
3143
- selectorIndex = parseSelector(data, selector, selectorIndex + 1);
3144
- if (selector.charCodeAt(selectorIndex) !== 41) {
3145
- throw new Error("Missing closing parenthesis in :".concat(name_2, " (").concat(selector, ")"));
3146
- }
3147
- selectorIndex += 1;
3148
- } else {
3149
- data = readValueWithParenthesis();
3150
- if (stripQuotesFromPseudos.has(name_2)) {
3151
- var quot = data.charCodeAt(0);
3152
- if (quot === data.charCodeAt(data.length - 1) && isQuote2(quot)) {
3153
- data = data.slice(1, -1);
3154
- }
3155
- }
3156
- data = unescapeCSS(data);
3134
+ } else {
3135
+ data = readValueWithParenthesis();
3136
+ if (stripQuotesFromPseudos.has(name)) {
3137
+ const quot = data.charCodeAt(0);
3138
+ if (quot === data.charCodeAt(data.length - 1) && isQuote(quot)) {
3139
+ data = data.slice(1, -1);
3157
3140
  }
3158
3141
  }
3159
- tokens.push({ type: types_1.SelectorType.Pseudo, name: name_2, data });
3160
- break;
3142
+ data = unescapeCSS(data);
3161
3143
  }
3162
- case 44: {
3163
- finalizeSubselector();
3164
- tokens = [];
3165
- stripWhitespace(1);
3144
+ }
3145
+ tokens.push({ type: SelectorType.Pseudo, name, data });
3146
+ break;
3147
+ }
3148
+ case 44: {
3149
+ finalizeSubselector();
3150
+ tokens = [];
3151
+ stripWhitespace(1);
3152
+ break;
3153
+ }
3154
+ default: {
3155
+ if (selector.startsWith("/*", selectorIndex)) {
3156
+ const endIndex = selector.indexOf("*/", selectorIndex + 2);
3157
+ if (endIndex < 0) {
3158
+ throw new Error("Comment was not terminated");
3159
+ }
3160
+ selectorIndex = endIndex + 2;
3161
+ if (tokens.length === 0) {
3162
+ stripWhitespace(0);
3163
+ }
3164
+ break;
3165
+ }
3166
+ let namespace = null;
3167
+ let name;
3168
+ if (firstChar === 42) {
3169
+ selectorIndex += 1;
3170
+ name = "*";
3171
+ } else if (firstChar === 124) {
3172
+ name = "";
3173
+ if (selector.charCodeAt(selectorIndex + 1) === 124) {
3174
+ addTraversal(SelectorType.ColumnCombinator);
3175
+ stripWhitespace(2);
3166
3176
  break;
3167
3177
  }
3168
- default: {
3169
- if (selector.startsWith("/*", selectorIndex)) {
3170
- var endIndex = selector.indexOf("*/", selectorIndex + 2);
3171
- if (endIndex < 0) {
3172
- throw new Error("Comment was not terminated");
3173
- }
3174
- selectorIndex = endIndex + 2;
3175
- if (tokens.length === 0) {
3176
- stripWhitespace(0);
3177
- }
3178
- break;
3179
- }
3180
- var namespace = null;
3181
- var name_3 = void 0;
3182
- if (firstChar === 42) {
3183
- selectorIndex += 1;
3184
- name_3 = "*";
3185
- } else if (firstChar === 124) {
3186
- name_3 = "";
3187
- if (selector.charCodeAt(selectorIndex + 1) === 124) {
3188
- addTraversal(types_1.SelectorType.ColumnCombinator);
3189
- stripWhitespace(2);
3190
- break;
3191
- }
3192
- } else if (reName.test(selector.slice(selectorIndex))) {
3193
- name_3 = getName(0);
3194
- } else {
3195
- break loop;
3196
- }
3197
- if (selector.charCodeAt(selectorIndex) === 124 && selector.charCodeAt(selectorIndex + 1) !== 124) {
3198
- namespace = name_3;
3199
- if (selector.charCodeAt(selectorIndex + 1) === 42) {
3200
- name_3 = "*";
3201
- selectorIndex += 2;
3202
- } else {
3203
- name_3 = getName(1);
3204
- }
3205
- }
3206
- tokens.push(name_3 === "*" ? { type: types_1.SelectorType.Universal, namespace } : { type: types_1.SelectorType.Tag, name: name_3, namespace });
3178
+ } else if (reName.test(selector.slice(selectorIndex))) {
3179
+ name = getName(0);
3180
+ } else {
3181
+ break loop;
3182
+ }
3183
+ if (selector.charCodeAt(selectorIndex) === 124 && selector.charCodeAt(selectorIndex + 1) !== 124) {
3184
+ namespace = name;
3185
+ if (selector.charCodeAt(selectorIndex + 1) === 42) {
3186
+ name = "*";
3187
+ selectorIndex += 2;
3188
+ } else {
3189
+ name = getName(1);
3207
3190
  }
3208
3191
  }
3192
+ tokens.push(name === "*" ? { type: SelectorType.Universal, namespace } : { type: SelectorType.Tag, name, namespace });
3209
3193
  }
3210
- finalizeSubselector();
3211
- return selectorIndex;
3212
3194
  }
3213
3195
  }
3196
+ finalizeSubselector();
3197
+ return selectorIndex;
3198
+ }
3199
+ var reName, reEscape, actionTypes, unpackPseudos, stripQuotesFromPseudos;
3200
+ var init_parse = __esm({
3201
+ "../node_modules/css-what/lib/es/parse.js"() {
3202
+ "use strict";
3203
+ init_types();
3204
+ reName = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/;
3205
+ reEscape = /\\([\da-f]{1,6}\s?|(\s)|.)/gi;
3206
+ actionTypes = /* @__PURE__ */ new Map([
3207
+ [126, AttributeAction.Element],
3208
+ [94, AttributeAction.Start],
3209
+ [36, AttributeAction.End],
3210
+ [42, AttributeAction.Any],
3211
+ [33, AttributeAction.Not],
3212
+ [124, AttributeAction.Hyphen]
3213
+ ]);
3214
+ unpackPseudos = /* @__PURE__ */ new Set([
3215
+ "has",
3216
+ "not",
3217
+ "matches",
3218
+ "is",
3219
+ "where",
3220
+ "host",
3221
+ "host-context"
3222
+ ]);
3223
+ stripQuotesFromPseudos = /* @__PURE__ */ new Set(["contains", "icontains"]);
3224
+ }
3214
3225
  });
3215
3226
 
3216
- // ../node_modules/css-what/lib/commonjs/stringify.js
3217
- var require_stringify2 = __commonJS({
3218
- "../node_modules/css-what/lib/commonjs/stringify.js"(exports) {
3227
+ // ../node_modules/css-what/lib/es/stringify.js
3228
+ function stringify(selector) {
3229
+ return selector.map((token) => token.map(stringifyToken).join("")).join(", ");
3230
+ }
3231
+ function stringifyToken(token, index, arr) {
3232
+ switch (token.type) {
3233
+ // Simple types
3234
+ case SelectorType.Child:
3235
+ return index === 0 ? "> " : " > ";
3236
+ case SelectorType.Parent:
3237
+ return index === 0 ? "< " : " < ";
3238
+ case SelectorType.Sibling:
3239
+ return index === 0 ? "~ " : " ~ ";
3240
+ case SelectorType.Adjacent:
3241
+ return index === 0 ? "+ " : " + ";
3242
+ case SelectorType.Descendant:
3243
+ return " ";
3244
+ case SelectorType.ColumnCombinator:
3245
+ return index === 0 ? "|| " : " || ";
3246
+ case SelectorType.Universal:
3247
+ return token.namespace === "*" && index + 1 < arr.length && "name" in arr[index + 1] ? "" : `${getNamespace(token.namespace)}*`;
3248
+ case SelectorType.Tag:
3249
+ return getNamespacedName(token);
3250
+ case SelectorType.PseudoElement:
3251
+ return `::${escapeName(token.name, charsToEscapeInName)}${token.data === null ? "" : `(${escapeName(token.data, charsToEscapeInPseudoValue)})`}`;
3252
+ case SelectorType.Pseudo:
3253
+ return `:${escapeName(token.name, charsToEscapeInName)}${token.data === null ? "" : `(${typeof token.data === "string" ? escapeName(token.data, charsToEscapeInPseudoValue) : stringify(token.data)})`}`;
3254
+ case SelectorType.Attribute: {
3255
+ if (token.name === "id" && token.action === AttributeAction.Equals && token.ignoreCase === "quirks" && !token.namespace) {
3256
+ return `#${escapeName(token.value, charsToEscapeInName)}`;
3257
+ }
3258
+ if (token.name === "class" && token.action === AttributeAction.Element && token.ignoreCase === "quirks" && !token.namespace) {
3259
+ return `.${escapeName(token.value, charsToEscapeInName)}`;
3260
+ }
3261
+ const name = getNamespacedName(token);
3262
+ if (token.action === AttributeAction.Exists) {
3263
+ return `[${name}]`;
3264
+ }
3265
+ return `[${name}${getActionValue(token.action)}="${escapeName(token.value, charsToEscapeInAttributeValue)}"${token.ignoreCase === null ? "" : token.ignoreCase ? " i" : " s"}]`;
3266
+ }
3267
+ }
3268
+ }
3269
+ function getActionValue(action) {
3270
+ switch (action) {
3271
+ case AttributeAction.Equals:
3272
+ return "";
3273
+ case AttributeAction.Element:
3274
+ return "~";
3275
+ case AttributeAction.Start:
3276
+ return "^";
3277
+ case AttributeAction.End:
3278
+ return "$";
3279
+ case AttributeAction.Any:
3280
+ return "*";
3281
+ case AttributeAction.Not:
3282
+ return "!";
3283
+ case AttributeAction.Hyphen:
3284
+ return "|";
3285
+ case AttributeAction.Exists:
3286
+ throw new Error("Shouldn't be here");
3287
+ }
3288
+ }
3289
+ function getNamespacedName(token) {
3290
+ return `${getNamespace(token.namespace)}${escapeName(token.name, charsToEscapeInName)}`;
3291
+ }
3292
+ function getNamespace(namespace) {
3293
+ return namespace !== null ? `${namespace === "*" ? "*" : escapeName(namespace, charsToEscapeInName)}|` : "";
3294
+ }
3295
+ function escapeName(str, charsToEscape) {
3296
+ let lastIdx = 0;
3297
+ let ret = "";
3298
+ for (let i = 0; i < str.length; i++) {
3299
+ if (charsToEscape.has(str.charCodeAt(i))) {
3300
+ ret += `${str.slice(lastIdx, i)}\\${str.charAt(i)}`;
3301
+ lastIdx = i + 1;
3302
+ }
3303
+ }
3304
+ return ret.length > 0 ? ret + str.slice(lastIdx) : str;
3305
+ }
3306
+ var attribValChars, pseudoValChars, charsToEscapeInAttributeValue, charsToEscapeInPseudoValue, charsToEscapeInName;
3307
+ var init_stringify = __esm({
3308
+ "../node_modules/css-what/lib/es/stringify.js"() {
3219
3309
  "use strict";
3220
- var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) {
3221
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3222
- if (ar || !(i in from)) {
3223
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
3224
- ar[i] = from[i];
3225
- }
3226
- }
3227
- return to.concat(ar || Array.prototype.slice.call(from));
3228
- };
3229
- Object.defineProperty(exports, "__esModule", { value: true });
3230
- exports.stringify = void 0;
3231
- var types_1 = require_types();
3232
- var attribValChars = ["\\", '"'];
3233
- var pseudoValChars = __spreadArray(__spreadArray([], attribValChars, true), ["(", ")"], false);
3234
- var charsToEscapeInAttributeValue = new Set(attribValChars.map(function(c) {
3235
- return c.charCodeAt(0);
3236
- }));
3237
- var charsToEscapeInPseudoValue = new Set(pseudoValChars.map(function(c) {
3238
- return c.charCodeAt(0);
3239
- }));
3240
- var charsToEscapeInName = new Set(__spreadArray(__spreadArray([], pseudoValChars, true), [
3310
+ init_types();
3311
+ attribValChars = ["\\", '"'];
3312
+ pseudoValChars = [...attribValChars, "(", ")"];
3313
+ charsToEscapeInAttributeValue = new Set(attribValChars.map((c) => c.charCodeAt(0)));
3314
+ charsToEscapeInPseudoValue = new Set(pseudoValChars.map((c) => c.charCodeAt(0)));
3315
+ charsToEscapeInName = new Set([
3316
+ ...pseudoValChars,
3241
3317
  "~",
3242
3318
  "^",
3243
3319
  "$",
@@ -3250,126 +3326,26 @@ var require_stringify2 = __commonJS({
3250
3326
  "]",
3251
3327
  " ",
3252
3328
  "."
3253
- ], false).map(function(c) {
3254
- return c.charCodeAt(0);
3255
- }));
3256
- function stringify(selector) {
3257
- return selector.map(function(token) {
3258
- return token.map(stringifyToken).join("");
3259
- }).join(", ");
3260
- }
3261
- exports.stringify = stringify;
3262
- function stringifyToken(token, index, arr) {
3263
- switch (token.type) {
3264
- case types_1.SelectorType.Child:
3265
- return index === 0 ? "> " : " > ";
3266
- case types_1.SelectorType.Parent:
3267
- return index === 0 ? "< " : " < ";
3268
- case types_1.SelectorType.Sibling:
3269
- return index === 0 ? "~ " : " ~ ";
3270
- case types_1.SelectorType.Adjacent:
3271
- return index === 0 ? "+ " : " + ";
3272
- case types_1.SelectorType.Descendant:
3273
- return " ";
3274
- case types_1.SelectorType.ColumnCombinator:
3275
- return index === 0 ? "|| " : " || ";
3276
- case types_1.SelectorType.Universal:
3277
- return token.namespace === "*" && index + 1 < arr.length && "name" in arr[index + 1] ? "" : "".concat(getNamespace(token.namespace), "*");
3278
- case types_1.SelectorType.Tag:
3279
- return getNamespacedName(token);
3280
- case types_1.SelectorType.PseudoElement:
3281
- return "::".concat(escapeName(token.name, charsToEscapeInName)).concat(token.data === null ? "" : "(".concat(escapeName(token.data, charsToEscapeInPseudoValue), ")"));
3282
- case types_1.SelectorType.Pseudo:
3283
- return ":".concat(escapeName(token.name, charsToEscapeInName)).concat(token.data === null ? "" : "(".concat(typeof token.data === "string" ? escapeName(token.data, charsToEscapeInPseudoValue) : stringify(token.data), ")"));
3284
- case types_1.SelectorType.Attribute: {
3285
- if (token.name === "id" && token.action === types_1.AttributeAction.Equals && token.ignoreCase === "quirks" && !token.namespace) {
3286
- return "#".concat(escapeName(token.value, charsToEscapeInName));
3287
- }
3288
- if (token.name === "class" && token.action === types_1.AttributeAction.Element && token.ignoreCase === "quirks" && !token.namespace) {
3289
- return ".".concat(escapeName(token.value, charsToEscapeInName));
3290
- }
3291
- var name_1 = getNamespacedName(token);
3292
- if (token.action === types_1.AttributeAction.Exists) {
3293
- return "[".concat(name_1, "]");
3294
- }
3295
- return "[".concat(name_1).concat(getActionValue(token.action), '="').concat(escapeName(token.value, charsToEscapeInAttributeValue), '"').concat(token.ignoreCase === null ? "" : token.ignoreCase ? " i" : " s", "]");
3296
- }
3297
- }
3298
- }
3299
- function getActionValue(action) {
3300
- switch (action) {
3301
- case types_1.AttributeAction.Equals:
3302
- return "";
3303
- case types_1.AttributeAction.Element:
3304
- return "~";
3305
- case types_1.AttributeAction.Start:
3306
- return "^";
3307
- case types_1.AttributeAction.End:
3308
- return "$";
3309
- case types_1.AttributeAction.Any:
3310
- return "*";
3311
- case types_1.AttributeAction.Not:
3312
- return "!";
3313
- case types_1.AttributeAction.Hyphen:
3314
- return "|";
3315
- case types_1.AttributeAction.Exists:
3316
- throw new Error("Shouldn't be here");
3317
- }
3318
- }
3319
- function getNamespacedName(token) {
3320
- return "".concat(getNamespace(token.namespace)).concat(escapeName(token.name, charsToEscapeInName));
3321
- }
3322
- function getNamespace(namespace) {
3323
- return namespace !== null ? "".concat(namespace === "*" ? "*" : escapeName(namespace, charsToEscapeInName), "|") : "";
3324
- }
3325
- function escapeName(str, charsToEscape) {
3326
- var lastIdx = 0;
3327
- var ret = "";
3328
- for (var i = 0; i < str.length; i++) {
3329
- if (charsToEscape.has(str.charCodeAt(i))) {
3330
- ret += "".concat(str.slice(lastIdx, i), "\\").concat(str.charAt(i));
3331
- lastIdx = i + 1;
3332
- }
3333
- }
3334
- return ret.length > 0 ? ret + str.slice(lastIdx) : str;
3335
- }
3329
+ ].map((c) => c.charCodeAt(0)));
3336
3330
  }
3337
3331
  });
3338
3332
 
3339
- // ../node_modules/css-what/lib/commonjs/index.js
3340
- var require_commonjs = __commonJS({
3341
- "../node_modules/css-what/lib/commonjs/index.js"(exports) {
3333
+ // ../node_modules/css-what/lib/es/index.js
3334
+ var es_exports = {};
3335
+ __export(es_exports, {
3336
+ AttributeAction: () => AttributeAction,
3337
+ IgnoreCaseMode: () => IgnoreCaseMode,
3338
+ SelectorType: () => SelectorType,
3339
+ isTraversal: () => isTraversal,
3340
+ parse: () => parse,
3341
+ stringify: () => stringify
3342
+ });
3343
+ var init_es = __esm({
3344
+ "../node_modules/css-what/lib/es/index.js"() {
3342
3345
  "use strict";
3343
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
3344
- if (k2 === void 0) k2 = k;
3345
- var desc = Object.getOwnPropertyDescriptor(m, k);
3346
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
3347
- desc = { enumerable: true, get: function() {
3348
- return m[k];
3349
- } };
3350
- }
3351
- Object.defineProperty(o, k2, desc);
3352
- } : function(o, m, k, k2) {
3353
- if (k2 === void 0) k2 = k;
3354
- o[k2] = m[k];
3355
- });
3356
- var __exportStar = exports && exports.__exportStar || function(m, exports2) {
3357
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
3358
- };
3359
- Object.defineProperty(exports, "__esModule", { value: true });
3360
- exports.stringify = exports.parse = exports.isTraversal = void 0;
3361
- __exportStar(require_types(), exports);
3362
- var parse_1 = require_parse();
3363
- Object.defineProperty(exports, "isTraversal", { enumerable: true, get: function() {
3364
- return parse_1.isTraversal;
3365
- } });
3366
- Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
3367
- return parse_1.parse;
3368
- } });
3369
- var stringify_1 = require_stringify2();
3370
- Object.defineProperty(exports, "stringify", { enumerable: true, get: function() {
3371
- return stringify_1.stringify;
3372
- } });
3346
+ init_types();
3347
+ init_parse();
3348
+ init_stringify();
3373
3349
  }
3374
3350
  });
3375
3351
 
@@ -3379,17 +3355,17 @@ var require_sort = __commonJS({
3379
3355
  "use strict";
3380
3356
  Object.defineProperty(exports, "__esModule", { value: true });
3381
3357
  exports.isTraversal = void 0;
3382
- var css_what_1 = require_commonjs();
3358
+ var css_what_1 = (init_es(), __toCommonJS(es_exports));
3383
3359
  var procedure = /* @__PURE__ */ new Map([
3384
3360
  [css_what_1.SelectorType.Universal, 50],
3385
3361
  [css_what_1.SelectorType.Tag, 30],
3386
3362
  [css_what_1.SelectorType.Attribute, 1],
3387
3363
  [css_what_1.SelectorType.Pseudo, 0]
3388
3364
  ]);
3389
- function isTraversal(token) {
3365
+ function isTraversal2(token) {
3390
3366
  return !procedure.has(token.type);
3391
3367
  }
3392
- exports.isTraversal = isTraversal;
3368
+ exports.isTraversal = isTraversal2;
3393
3369
  var attributes = /* @__PURE__ */ new Map([
3394
3370
  [css_what_1.AttributeAction.Exists, 10],
3395
3371
  [css_what_1.AttributeAction.Equals, 8],
@@ -3645,7 +3621,7 @@ var require_attributes = __commonJS({
3645
3621
  });
3646
3622
 
3647
3623
  // ../node_modules/nth-check/lib/parse.js
3648
- var require_parse2 = __commonJS({
3624
+ var require_parse = __commonJS({
3649
3625
  "../node_modules/nth-check/lib/parse.js"(exports) {
3650
3626
  "use strict";
3651
3627
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -3653,7 +3629,7 @@ var require_parse2 = __commonJS({
3653
3629
  var whitespace = /* @__PURE__ */ new Set([9, 10, 12, 13, 32]);
3654
3630
  var ZERO = "0".charCodeAt(0);
3655
3631
  var NINE = "9".charCodeAt(0);
3656
- function parse(formula) {
3632
+ function parse2(formula) {
3657
3633
  formula = formula.trim().toLowerCase();
3658
3634
  if (formula === "even") {
3659
3635
  return [2, 0];
@@ -3705,7 +3681,7 @@ var require_parse2 = __commonJS({
3705
3681
  }
3706
3682
  }
3707
3683
  }
3708
- exports.parse = parse;
3684
+ exports.parse = parse2;
3709
3685
  }
3710
3686
  });
3711
3687
 
@@ -3786,7 +3762,7 @@ var require_lib6 = __commonJS({
3786
3762
  "use strict";
3787
3763
  Object.defineProperty(exports, "__esModule", { value: true });
3788
3764
  exports.sequence = exports.generate = exports.compile = exports.parse = void 0;
3789
- var parse_js_1 = require_parse2();
3765
+ var parse_js_1 = require_parse();
3790
3766
  Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
3791
3767
  return parse_js_1.parse;
3792
3768
  } });
@@ -4197,7 +4173,7 @@ var require_pseudo_selectors = __commonJS({
4197
4173
  "use strict";
4198
4174
  Object.defineProperty(exports, "__esModule", { value: true });
4199
4175
  exports.compilePseudoSelector = exports.aliases = exports.pseudos = exports.filters = void 0;
4200
- var css_what_1 = require_commonjs();
4176
+ var css_what_1 = (init_es(), __toCommonJS(es_exports));
4201
4177
  var filters_js_1 = require_filters();
4202
4178
  Object.defineProperty(exports, "filters", { enumerable: true, get: function() {
4203
4179
  return filters_js_1.filters;
@@ -4259,7 +4235,7 @@ var require_general = __commonJS({
4259
4235
  exports.compileGeneralSelector = void 0;
4260
4236
  var attributes_js_1 = require_attributes();
4261
4237
  var index_js_1 = require_pseudo_selectors();
4262
- var css_what_1 = require_commonjs();
4238
+ var css_what_1 = (init_es(), __toCommonJS(es_exports));
4263
4239
  function getElementParent(node, adapter) {
4264
4240
  var parent = adapter.getParent(node);
4265
4241
  if (parent && adapter.isTag(parent)) {
@@ -4288,6 +4264,7 @@ var require_general = __commonJS({
4288
4264
  case css_what_1.SelectorType.Pseudo: {
4289
4265
  return (0, index_js_1.compilePseudoSelector)(next, selector, options, context, compileToken);
4290
4266
  }
4267
+ // Tags
4291
4268
  case css_what_1.SelectorType.Tag: {
4292
4269
  if (selector.namespace != null) {
4293
4270
  throw new Error("Namespaced tag names are not yet supported by css-select");
@@ -4300,6 +4277,7 @@ var require_general = __commonJS({
4300
4277
  return adapter.getName(elem) === name_1 && next(elem);
4301
4278
  };
4302
4279
  }
4280
+ // Traversal
4303
4281
  case css_what_1.SelectorType.Descendant: {
4304
4282
  if (options.cacheResults === false || typeof WeakSet === "undefined") {
4305
4283
  return function descendant(elem) {
@@ -4400,7 +4378,7 @@ var require_general = __commonJS({
4400
4378
  var require_compile2 = __commonJS({
4401
4379
  "../node_modules/css-select/lib/compile.js"(exports) {
4402
4380
  "use strict";
4403
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
4381
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
4404
4382
  if (k2 === void 0) k2 = k;
4405
4383
  var desc = Object.getOwnPropertyDescriptor(m, k);
4406
4384
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
@@ -4409,13 +4387,13 @@ var require_compile2 = __commonJS({
4409
4387
  } };
4410
4388
  }
4411
4389
  Object.defineProperty(o, k2, desc);
4412
- } : function(o, m, k, k2) {
4390
+ }) : (function(o, m, k, k2) {
4413
4391
  if (k2 === void 0) k2 = k;
4414
4392
  o[k2] = m[k];
4415
- });
4416
- var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
4393
+ }));
4394
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
4417
4395
  Object.defineProperty(o, "default", { enumerable: true, value: v });
4418
- } : function(o, v) {
4396
+ }) : function(o, v) {
4419
4397
  o["default"] = v;
4420
4398
  });
4421
4399
  var __importStar = exports && exports.__importStar || function(mod) {
@@ -4432,7 +4410,7 @@ var require_compile2 = __commonJS({
4432
4410
  };
4433
4411
  Object.defineProperty(exports, "__esModule", { value: true });
4434
4412
  exports.compileToken = exports.compileUnsafe = exports.compile = void 0;
4435
- var css_what_1 = require_commonjs();
4413
+ var css_what_1 = (init_es(), __toCommonJS(es_exports));
4436
4414
  var boolbase_1 = __importDefault(require_boolbase());
4437
4415
  var sort_js_1 = __importStar(require_sort());
4438
4416
  var general_js_1 = require_general();
@@ -4532,7 +4510,7 @@ var require_compile2 = __commonJS({
4532
4510
  var require_lib7 = __commonJS({
4533
4511
  "../node_modules/css-select/lib/index.js"(exports) {
4534
4512
  "use strict";
4535
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
4513
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
4536
4514
  if (k2 === void 0) k2 = k;
4537
4515
  var desc = Object.getOwnPropertyDescriptor(m, k);
4538
4516
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
@@ -4541,13 +4519,13 @@ var require_lib7 = __commonJS({
4541
4519
  } };
4542
4520
  }
4543
4521
  Object.defineProperty(o, k2, desc);
4544
- } : function(o, m, k, k2) {
4522
+ }) : (function(o, m, k, k2) {
4545
4523
  if (k2 === void 0) k2 = k;
4546
4524
  o[k2] = m[k];
4547
- });
4548
- var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
4525
+ }));
4526
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
4549
4527
  Object.defineProperty(o, "default", { enumerable: true, value: v });
4550
- } : function(o, v) {
4528
+ }) : function(o, v) {
4551
4529
  o["default"] = v;
4552
4530
  });
4553
4531
  var __importStar = exports && exports.__importStar || function(mod) {
@@ -4771,7 +4749,7 @@ var require_void_tag = __commonJS({
4771
4749
  Object.defineProperty(exports, "__esModule", { value: true });
4772
4750
  var VoidTag = (
4773
4751
  /** @class */
4774
- function() {
4752
+ (function() {
4775
4753
  function VoidTag2(addClosingSlash, tags) {
4776
4754
  if (addClosingSlash === void 0) {
4777
4755
  addClosingSlash = false;
@@ -4797,7 +4775,7 @@ var require_void_tag = __commonJS({
4797
4775
  return this.voidTags.has(tag);
4798
4776
  };
4799
4777
  return VoidTag2;
4800
- }()
4778
+ })()
4801
4779
  );
4802
4780
  exports.default = VoidTag;
4803
4781
  }
@@ -4807,7 +4785,7 @@ var require_void_tag = __commonJS({
4807
4785
  var require_text = __commonJS({
4808
4786
  "../node_modules/node-html-parser/dist/nodes/text.js"(exports) {
4809
4787
  "use strict";
4810
- var __extends = exports && exports.__extends || /* @__PURE__ */ function() {
4788
+ var __extends = exports && exports.__extends || /* @__PURE__ */ (function() {
4811
4789
  var extendStatics = function(d, b) {
4812
4790
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
4813
4791
  d2.__proto__ = b2;
@@ -4825,7 +4803,7 @@ var require_text = __commonJS({
4825
4803
  }
4826
4804
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4827
4805
  };
4828
- }();
4806
+ })();
4829
4807
  var __importDefault = exports && exports.__importDefault || function(mod) {
4830
4808
  return mod && mod.__esModule ? mod : { "default": mod };
4831
4809
  };
@@ -4835,7 +4813,7 @@ var require_text = __commonJS({
4835
4813
  var type_1 = __importDefault(require_type());
4836
4814
  var TextNode = (
4837
4815
  /** @class */
4838
- function(_super) {
4816
+ (function(_super) {
4839
4817
  __extends(TextNode2, _super);
4840
4818
  function TextNode2(rawText, parentNode, range) {
4841
4819
  if (parentNode === void 0) {
@@ -4917,7 +4895,7 @@ var require_text = __commonJS({
4917
4895
  return this.rawText;
4918
4896
  };
4919
4897
  return TextNode2;
4920
- }(node_1.default)
4898
+ })(node_1.default)
4921
4899
  );
4922
4900
  exports.default = TextNode;
4923
4901
  function trimText(text) {
@@ -4954,7 +4932,7 @@ var require_text = __commonJS({
4954
4932
  var require_html = __commonJS({
4955
4933
  "../node_modules/node-html-parser/dist/nodes/html.js"(exports) {
4956
4934
  "use strict";
4957
- var __extends = exports && exports.__extends || /* @__PURE__ */ function() {
4935
+ var __extends = exports && exports.__extends || /* @__PURE__ */ (function() {
4958
4936
  var extendStatics = function(d, b) {
4959
4937
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
4960
4938
  d2.__proto__ = b2;
@@ -4972,7 +4950,7 @@ var require_html = __commonJS({
4972
4950
  }
4973
4951
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4974
4952
  };
4975
- }();
4953
+ })();
4976
4954
  var __assign = exports && exports.__assign || function() {
4977
4955
  __assign = Object.assign || function(t2) {
4978
4956
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -5036,7 +5014,7 @@ var require_html = __commonJS({
5036
5014
  addToKBlockElement(Htags, Dtags, Ftags, tableTags, htmlTags);
5037
5015
  var DOMTokenList = (
5038
5016
  /** @class */
5039
- function() {
5017
+ (function() {
5040
5018
  function DOMTokenList2(valuesInit, afterUpdate) {
5041
5019
  if (valuesInit === void 0) {
5042
5020
  valuesInit = [];
@@ -5100,11 +5078,11 @@ var require_html = __commonJS({
5100
5078
  return Array.from(this._set.values()).join(" ");
5101
5079
  };
5102
5080
  return DOMTokenList2;
5103
- }()
5081
+ })()
5104
5082
  );
5105
5083
  var HTMLElement = (
5106
5084
  /** @class */
5107
- function(_super) {
5085
+ (function(_super) {
5108
5086
  __extends(HTMLElement2, _super);
5109
5087
  function HTMLElement2(tagName, keyAttrs, rawAttrs, parentNode, range, voidTag, _parseOptions) {
5110
5088
  if (rawAttrs === void 0) {
@@ -5293,7 +5271,7 @@ var require_html = __commonJS({
5293
5271
  }).join("");
5294
5272
  },
5295
5273
  set: function(content) {
5296
- var r = parse(content, this._parseOptions);
5274
+ var r = parse2(content, this._parseOptions);
5297
5275
  var nodes = r.childNodes.length ? r.childNodes : [new text_1.default(content, this)];
5298
5276
  resetParent(nodes, this);
5299
5277
  resetParent(this.childNodes, null);
@@ -5310,7 +5288,7 @@ var require_html = __commonJS({
5310
5288
  content = [content];
5311
5289
  } else if (typeof content == "string") {
5312
5290
  options = __assign(__assign({}, this._parseOptions), options);
5313
- var r = parse(content, options);
5291
+ var r = parse2(content, options);
5314
5292
  content = r.childNodes.length ? r.childNodes : [new text_1.default(r.innerHTML, this)];
5315
5293
  }
5316
5294
  resetParent(this.childNodes, null);
@@ -5329,7 +5307,7 @@ var require_html = __commonJS({
5329
5307
  if (node instanceof node_1.default) {
5330
5308
  return [node];
5331
5309
  } else if (typeof node == "string") {
5332
- var r = parse(node, _this._parseOptions);
5310
+ var r = parse2(node, _this._parseOptions);
5333
5311
  return r.childNodes.length ? r.childNodes : [new text_1.default(node, _this)];
5334
5312
  }
5335
5313
  return [];
@@ -5688,7 +5666,7 @@ var require_html = __commonJS({
5688
5666
  if (arguments.length < 2) {
5689
5667
  throw new Error("2 arguments required");
5690
5668
  }
5691
- var p = parse(html, this._parseOptions);
5669
+ var p = parse2(html, this._parseOptions);
5692
5670
  if (where === "afterend") {
5693
5671
  var idx = this.parentNode.childNodes.findIndex(function(child) {
5694
5672
  return child === _this;
@@ -5797,10 +5775,10 @@ var require_html = __commonJS({
5797
5775
  configurable: true
5798
5776
  });
5799
5777
  HTMLElement2.prototype.clone = function() {
5800
- return parse(this.toString(), this._parseOptions).firstChild;
5778
+ return parse2(this.toString(), this._parseOptions).firstChild;
5801
5779
  };
5802
5780
  return HTMLElement2;
5803
- }(node_1.default)
5781
+ })(node_1.default)
5804
5782
  );
5805
5783
  exports.default = HTMLElement;
5806
5784
  var kMarkupPattern = /<!--[\s\S]*?-->|<(\/?)([a-zA-Z][-.:0-9_a-zA-Z]*)((?:\s+[^>]*?(?:(?:'[^']*')|(?:"[^"]*"))?)*)\s*(\/?)>/g;
@@ -5985,7 +5963,7 @@ var require_html = __commonJS({
5985
5963
  return stack;
5986
5964
  }
5987
5965
  exports.base_parse = base_parse;
5988
- function parse(data, options) {
5966
+ function parse2(data, options) {
5989
5967
  if (options === void 0) {
5990
5968
  options = {};
5991
5969
  }
@@ -6019,7 +5997,7 @@ var require_html = __commonJS({
6019
5997
  }
6020
5998
  return root;
6021
5999
  }
6022
- exports.parse = parse;
6000
+ exports.parse = parse2;
6023
6001
  function resetParent(nodes, parent) {
6024
6002
  return nodes.map(function(node) {
6025
6003
  node.parentNode = parent;
@@ -6030,7 +6008,7 @@ var require_html = __commonJS({
6030
6008
  });
6031
6009
 
6032
6010
  // ../node_modules/node-html-parser/dist/parse.js
6033
- var require_parse3 = __commonJS({
6011
+ var require_parse2 = __commonJS({
6034
6012
  "../node_modules/node-html-parser/dist/parse.js"(exports) {
6035
6013
  "use strict";
6036
6014
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6078,24 +6056,24 @@ var require_dist = __commonJS({
6078
6056
  exports.TextNode = text_1.default;
6079
6057
  var type_1 = __importDefault(require_type());
6080
6058
  exports.NodeType = type_1.default;
6081
- var parse_1 = __importDefault(require_parse3());
6059
+ var parse_1 = __importDefault(require_parse2());
6082
6060
  var valid_1 = __importDefault(require_valid());
6083
6061
  exports.valid = valid_1.default;
6084
- function parse(data, options) {
6062
+ function parse2(data, options) {
6085
6063
  if (options === void 0) {
6086
6064
  options = {};
6087
6065
  }
6088
6066
  return (0, parse_1.default)(data, options);
6089
6067
  }
6090
- exports.default = parse;
6091
- exports.parse = parse;
6092
- parse.parse = parse_1.default;
6093
- parse.HTMLElement = html_1.default;
6094
- parse.CommentNode = comment_1.default;
6095
- parse.valid = valid_1.default;
6096
- parse.Node = node_1.default;
6097
- parse.TextNode = text_1.default;
6098
- parse.NodeType = type_1.default;
6068
+ exports.default = parse2;
6069
+ exports.parse = parse2;
6070
+ parse2.parse = parse_1.default;
6071
+ parse2.HTMLElement = html_1.default;
6072
+ parse2.CommentNode = comment_1.default;
6073
+ parse2.valid = valid_1.default;
6074
+ parse2.Node = node_1.default;
6075
+ parse2.TextNode = text_1.default;
6076
+ parse2.NodeType = type_1.default;
6099
6077
  }
6100
6078
  });
6101
6079
 
@@ -6103,7 +6081,7 @@ var require_dist = __commonJS({
6103
6081
  var require_wemlContentNormalizeV2 = __commonJS({
6104
6082
  "../wemlContentNormalizeV2.js"(exports, module) {
6105
6083
  "use strict";
6106
- var { parse, TextNode } = require_dist();
6084
+ var { parse: parse2, TextNode } = require_dist();
6107
6085
  var BLOCK_ELEMENTS = /* @__PURE__ */ new Set([
6108
6086
  "div",
6109
6087
  "w-para",
@@ -6171,7 +6149,7 @@ var require_wemlContentNormalizeV2 = __commonJS({
6171
6149
  ]);
6172
6150
  function formatWeml(input) {
6173
6151
  const { html, entities: entities2 } = protectEntities(input);
6174
- const doc = parse(normalizeVoidTagSyntax(html));
6152
+ const doc = parse2(normalizeVoidTagSyntax(html));
6175
6153
  const body = doc.querySelector("body");
6176
6154
  if (body) processBlockElement(body);
6177
6155
  return restoreEntities(serializeDocument(doc), entities2);
@@ -8707,6 +8685,7 @@ function createScanner(input, initialOffset = 0, initialState = ScannerState.Wit
8707
8685
  }
8708
8686
  state = ScannerState.WithinTag;
8709
8687
  return internalScan();
8688
+ // no advance yet - jump to WithinTag
8710
8689
  case ScannerState.BeforeAttributeValue:
8711
8690
  if (stream.skipWhitespace()) {
8712
8691
  return finishToken(offset, TokenType.Whitespace);
@@ -8742,6 +8721,7 @@ function createScanner(input, initialOffset = 0, initialState = ScannerState.Wit
8742
8721
  state = ScannerState.WithinTag;
8743
8722
  hasSpaceAfterTag = false;
8744
8723
  return internalScan();
8724
+ // no advance yet - jump to WithinTag
8745
8725
  case ScannerState.WithinScriptContent:
8746
8726
  let sciptState = 1;
8747
8727
  while (!stream.eos()) {
@@ -8773,6 +8753,7 @@ function createScanner(input, initialOffset = 0, initialState = ScannerState.Wit
8773
8753
  return finishToken(offset, TokenType.Script);
8774
8754
  }
8775
8755
  return internalScan();
8756
+ // no advance yet - jump to content
8776
8757
  case ScannerState.WithinStyleContent:
8777
8758
  stream.advanceUntilRegExp(/<\/style/i);
8778
8759
  state = ScannerState.WithinContent;
@@ -11898,7 +11879,7 @@ var HTMLCompletion = class {
11898
11879
  let range;
11899
11880
  let addQuotes;
11900
11881
  let valuePrefix;
11901
- if (offset > valueStart && offset <= valueEnd && isQuote(text[valueStart])) {
11882
+ if (offset > valueStart && offset <= valueEnd && isQuote2(text[valueStart])) {
11902
11883
  const valueContentStart = valueStart + 1;
11903
11884
  let valueContentEnd = valueEnd;
11904
11885
  if (valueEnd > valueStart && text[valueEnd - 1] === text[valueStart]) {
@@ -12191,7 +12172,7 @@ var HTMLCompletion = class {
12191
12172
  return this.supportsMarkdown;
12192
12173
  }
12193
12174
  };
12194
- function isQuote(s) {
12175
+ function isQuote2(s) {
12195
12176
  return /^["']*$/.test(s);
12196
12177
  }
12197
12178
  function isWhiteSpace(s) {
@@ -12478,7 +12459,7 @@ var legacy_beautify_css;
12478
12459
  ,
12479
12460
  /* 2 */
12480
12461
  /***/
12481
- function(module) {
12462
+ (function(module) {
12482
12463
  function OutputLine(parent) {
12483
12464
  this.__parent = parent;
12484
12465
  this.__character_count = 0;
@@ -12795,13 +12776,13 @@ var legacy_beautify_css;
12795
12776
  }
12796
12777
  };
12797
12778
  module.exports.Output = Output;
12798
- },
12779
+ }),
12799
12780
  ,
12800
12781
  ,
12801
12782
  ,
12802
12783
  /* 6 */
12803
12784
  /***/
12804
- function(module) {
12785
+ (function(module) {
12805
12786
  function Options(options, merge_child_field) {
12806
12787
  this.raw_options = _mergeOpts(options, merge_child_field);
12807
12788
  this.disabled = this._get_boolean("disabled");
@@ -12921,11 +12902,11 @@ var legacy_beautify_css;
12921
12902
  module.exports.Options = Options;
12922
12903
  module.exports.normalizeOpts = _normalizeOpts;
12923
12904
  module.exports.mergeOpts = _mergeOpts;
12924
- },
12905
+ }),
12925
12906
  ,
12926
12907
  /* 8 */
12927
12908
  /***/
12928
- function(module) {
12909
+ (function(module) {
12929
12910
  var regexp_has_sticky = RegExp.prototype.hasOwnProperty("sticky");
12930
12911
  function InputScanner(input_string) {
12931
12912
  this.__input = input_string || "";
@@ -13054,14 +13035,14 @@ var legacy_beautify_css;
13054
13035
  return start >= testVal.length && this.__input.substring(start - testVal.length, start).toLowerCase() === testVal;
13055
13036
  };
13056
13037
  module.exports.InputScanner = InputScanner;
13057
- },
13038
+ }),
13058
13039
  ,
13059
13040
  ,
13060
13041
  ,
13061
13042
  ,
13062
13043
  /* 13 */
13063
13044
  /***/
13064
- function(module) {
13045
+ (function(module) {
13065
13046
  function Directives(start_block_pattern, end_block_pattern) {
13066
13047
  start_block_pattern = typeof start_block_pattern === "string" ? start_block_pattern : start_block_pattern.source;
13067
13048
  end_block_pattern = typeof end_block_pattern === "string" ? end_block_pattern : end_block_pattern.source;
@@ -13086,11 +13067,11 @@ var legacy_beautify_css;
13086
13067
  return input.readUntilAfter(this.__directives_end_ignore_pattern);
13087
13068
  };
13088
13069
  module.exports.Directives = Directives;
13089
- },
13070
+ }),
13090
13071
  ,
13091
13072
  /* 15 */
13092
13073
  /***/
13093
- function(module, __unused_webpack_exports, __webpack_require__2) {
13074
+ (function(module, __unused_webpack_exports, __webpack_require__2) {
13094
13075
  var Beautifier = __webpack_require__2(16).Beautifier, Options = __webpack_require__2(17).Options;
13095
13076
  function css_beautify2(source_text, options) {
13096
13077
  var beautifier = new Beautifier(source_text, options);
@@ -13100,10 +13081,10 @@ var legacy_beautify_css;
13100
13081
  module.exports.defaultOptions = function() {
13101
13082
  return new Options();
13102
13083
  };
13103
- },
13084
+ }),
13104
13085
  /* 16 */
13105
13086
  /***/
13106
- function(module, __unused_webpack_exports, __webpack_require__2) {
13087
+ (function(module, __unused_webpack_exports, __webpack_require__2) {
13107
13088
  var Options = __webpack_require__2(17).Options;
13108
13089
  var Output = __webpack_require__2(2).Output;
13109
13090
  var InputScanner = __webpack_require__2(8).InputScanner;
@@ -13504,10 +13485,10 @@ var legacy_beautify_css;
13504
13485
  return sweetCode;
13505
13486
  };
13506
13487
  module.exports.Beautifier = Beautifier;
13507
- },
13488
+ }),
13508
13489
  /* 17 */
13509
13490
  /***/
13510
- function(module, __unused_webpack_exports, __webpack_require__2) {
13491
+ (function(module, __unused_webpack_exports, __webpack_require__2) {
13511
13492
  var BaseOptions = __webpack_require__2(6).Options;
13512
13493
  function Options(options) {
13513
13494
  BaseOptions.call(this, options, "css");
@@ -13527,7 +13508,7 @@ var legacy_beautify_css;
13527
13508
  }
13528
13509
  Options.prototype = new BaseOptions();
13529
13510
  module.exports.Options = Options;
13530
- }
13511
+ })
13531
13512
  /******/
13532
13513
  ];
13533
13514
  var __webpack_module_cache__ = {};
@@ -13562,7 +13543,7 @@ var legacy_beautify_html;
13562
13543
  ,
13563
13544
  /* 2 */
13564
13545
  /***/
13565
- function(module) {
13546
+ (function(module) {
13566
13547
  function OutputLine(parent) {
13567
13548
  this.__parent = parent;
13568
13549
  this.__character_count = 0;
@@ -13879,10 +13860,10 @@ var legacy_beautify_html;
13879
13860
  }
13880
13861
  };
13881
13862
  module.exports.Output = Output;
13882
- },
13863
+ }),
13883
13864
  /* 3 */
13884
13865
  /***/
13885
- function(module) {
13866
+ (function(module) {
13886
13867
  function Token(type, text, newlines, whitespace_before) {
13887
13868
  this.type = type;
13888
13869
  this.text = text;
@@ -13897,12 +13878,12 @@ var legacy_beautify_html;
13897
13878
  this.directives = null;
13898
13879
  }
13899
13880
  module.exports.Token = Token;
13900
- },
13881
+ }),
13901
13882
  ,
13902
13883
  ,
13903
13884
  /* 6 */
13904
13885
  /***/
13905
- function(module) {
13886
+ (function(module) {
13906
13887
  function Options(options, merge_child_field) {
13907
13888
  this.raw_options = _mergeOpts(options, merge_child_field);
13908
13889
  this.disabled = this._get_boolean("disabled");
@@ -14022,11 +14003,11 @@ var legacy_beautify_html;
14022
14003
  module.exports.Options = Options;
14023
14004
  module.exports.normalizeOpts = _normalizeOpts;
14024
14005
  module.exports.mergeOpts = _mergeOpts;
14025
- },
14006
+ }),
14026
14007
  ,
14027
14008
  /* 8 */
14028
14009
  /***/
14029
- function(module) {
14010
+ (function(module) {
14030
14011
  var regexp_has_sticky = RegExp.prototype.hasOwnProperty("sticky");
14031
14012
  function InputScanner(input_string) {
14032
14013
  this.__input = input_string || "";
@@ -14155,10 +14136,10 @@ var legacy_beautify_html;
14155
14136
  return start >= testVal.length && this.__input.substring(start - testVal.length, start).toLowerCase() === testVal;
14156
14137
  };
14157
14138
  module.exports.InputScanner = InputScanner;
14158
- },
14139
+ }),
14159
14140
  /* 9 */
14160
14141
  /***/
14161
- function(module, __unused_webpack_exports, __webpack_require__2) {
14142
+ (function(module, __unused_webpack_exports, __webpack_require__2) {
14162
14143
  var InputScanner = __webpack_require__2(8).InputScanner;
14163
14144
  var Token = __webpack_require__2(3).Token;
14164
14145
  var TokenStream = __webpack_require__2(10).TokenStream;
@@ -14248,10 +14229,10 @@ var legacy_beautify_html;
14248
14229
  };
14249
14230
  module.exports.Tokenizer = Tokenizer;
14250
14231
  module.exports.TOKEN = TOKEN;
14251
- },
14232
+ }),
14252
14233
  /* 10 */
14253
14234
  /***/
14254
- function(module) {
14235
+ (function(module) {
14255
14236
  function TokenStream(parent_token) {
14256
14237
  this.__tokens = [];
14257
14238
  this.__tokens_length = this.__tokens.length;
@@ -14292,10 +14273,10 @@ var legacy_beautify_html;
14292
14273
  this.__tokens_length += 1;
14293
14274
  };
14294
14275
  module.exports.TokenStream = TokenStream;
14295
- },
14276
+ }),
14296
14277
  /* 11 */
14297
14278
  /***/
14298
- function(module, __unused_webpack_exports, __webpack_require__2) {
14279
+ (function(module, __unused_webpack_exports, __webpack_require__2) {
14299
14280
  var Pattern = __webpack_require__2(12).Pattern;
14300
14281
  function WhitespacePattern(input_scanner, parent) {
14301
14282
  Pattern.call(this, input_scanner, parent);
@@ -14359,10 +14340,10 @@ var legacy_beautify_html;
14359
14340
  return result;
14360
14341
  };
14361
14342
  module.exports.WhitespacePattern = WhitespacePattern;
14362
- },
14343
+ }),
14363
14344
  /* 12 */
14364
14345
  /***/
14365
- function(module) {
14346
+ (function(module) {
14366
14347
  function Pattern(input_scanner, parent) {
14367
14348
  this._input = input_scanner;
14368
14349
  this._starting_pattern = null;
@@ -14418,10 +14399,10 @@ var legacy_beautify_html;
14418
14399
  Pattern.prototype._update = function() {
14419
14400
  };
14420
14401
  module.exports.Pattern = Pattern;
14421
- },
14402
+ }),
14422
14403
  /* 13 */
14423
14404
  /***/
14424
- function(module) {
14405
+ (function(module) {
14425
14406
  function Directives(start_block_pattern, end_block_pattern) {
14426
14407
  start_block_pattern = typeof start_block_pattern === "string" ? start_block_pattern : start_block_pattern.source;
14427
14408
  end_block_pattern = typeof end_block_pattern === "string" ? end_block_pattern : end_block_pattern.source;
@@ -14446,10 +14427,10 @@ var legacy_beautify_html;
14446
14427
  return input.readUntilAfter(this.__directives_end_ignore_pattern);
14447
14428
  };
14448
14429
  module.exports.Directives = Directives;
14449
- },
14430
+ }),
14450
14431
  /* 14 */
14451
14432
  /***/
14452
- function(module, __unused_webpack_exports, __webpack_require__2) {
14433
+ (function(module, __unused_webpack_exports, __webpack_require__2) {
14453
14434
  var Pattern = __webpack_require__2(12).Pattern;
14454
14435
  var template_names = {
14455
14436
  django: false,
@@ -14598,13 +14579,13 @@ var legacy_beautify_html;
14598
14579
  return resulting_string;
14599
14580
  };
14600
14581
  module.exports.TemplatablePattern = TemplatablePattern;
14601
- },
14582
+ }),
14602
14583
  ,
14603
14584
  ,
14604
14585
  ,
14605
14586
  /* 18 */
14606
14587
  /***/
14607
- function(module, __unused_webpack_exports, __webpack_require__2) {
14588
+ (function(module, __unused_webpack_exports, __webpack_require__2) {
14608
14589
  var Beautifier = __webpack_require__2(19).Beautifier, Options = __webpack_require__2(20).Options;
14609
14590
  function style_html(html_source, options, js_beautify2, css_beautify2) {
14610
14591
  var beautifier = new Beautifier(html_source, options, js_beautify2, css_beautify2);
@@ -14614,10 +14595,10 @@ var legacy_beautify_html;
14614
14595
  module.exports.defaultOptions = function() {
14615
14596
  return new Options();
14616
14597
  };
14617
- },
14598
+ }),
14618
14599
  /* 19 */
14619
14600
  /***/
14620
- function(module, __unused_webpack_exports, __webpack_require__2) {
14601
+ (function(module, __unused_webpack_exports, __webpack_require__2) {
14621
14602
  var Options = __webpack_require__2(20).Options;
14622
14603
  var Output = __webpack_require__2(2).Output;
14623
14604
  var Tokenizer = __webpack_require__2(21).Tokenizer;
@@ -15249,10 +15230,10 @@ var legacy_beautify_html;
15249
15230
  return result;
15250
15231
  };
15251
15232
  module.exports.Beautifier = Beautifier;
15252
- },
15233
+ }),
15253
15234
  /* 20 */
15254
15235
  /***/
15255
- function(module, __unused_webpack_exports, __webpack_require__2) {
15236
+ (function(module, __unused_webpack_exports, __webpack_require__2) {
15256
15237
  var BaseOptions = __webpack_require__2(6).Options;
15257
15238
  function Options(options) {
15258
15239
  BaseOptions.call(this, options, "html");
@@ -15372,10 +15353,10 @@ var legacy_beautify_html;
15372
15353
  }
15373
15354
  Options.prototype = new BaseOptions();
15374
15355
  module.exports.Options = Options;
15375
- },
15356
+ }),
15376
15357
  /* 21 */
15377
15358
  /***/
15378
- function(module, __unused_webpack_exports, __webpack_require__2) {
15359
+ (function(module, __unused_webpack_exports, __webpack_require__2) {
15379
15360
  var BaseTokenizer = __webpack_require__2(9).Tokenizer;
15380
15361
  var BASETOKEN = __webpack_require__2(9).TOKEN;
15381
15362
  var Directives = __webpack_require__2(13).Directives;
@@ -15664,7 +15645,7 @@ var legacy_beautify_html;
15664
15645
  };
15665
15646
  module.exports.Tokenizer = Tokenizer;
15666
15647
  module.exports.TOKEN = TOKEN;
15667
- }
15648
+ })
15668
15649
  /******/
15669
15650
  ];
15670
15651
  var __webpack_module_cache__ = {};
@@ -15701,7 +15682,7 @@ function format2(document2, range, options) {
15701
15682
  if (range) {
15702
15683
  let startOffset = document2.offsetAt(range.start);
15703
15684
  let extendedStart = startOffset;
15704
- while (extendedStart > 0 && isWhitespace(value, extendedStart - 1)) {
15685
+ while (extendedStart > 0 && isWhitespace2(value, extendedStart - 1)) {
15705
15686
  extendedStart--;
15706
15687
  }
15707
15688
  if (extendedStart === 0 || isEOL2(value, extendedStart - 1)) {
@@ -15713,7 +15694,7 @@ function format2(document2, range, options) {
15713
15694
  }
15714
15695
  let endOffset = document2.offsetAt(range.end);
15715
15696
  let extendedEnd = endOffset;
15716
- while (extendedEnd < value.length && isWhitespace(value, extendedEnd)) {
15697
+ while (extendedEnd < value.length && isWhitespace2(value, extendedEnd)) {
15717
15698
  extendedEnd++;
15718
15699
  }
15719
15700
  if (extendedEnd === value.length || isEOL2(value, extendedEnd)) {
@@ -15822,7 +15803,7 @@ function computeIndentLevel(content, offset, options) {
15822
15803
  function isEOL2(text, offset) {
15823
15804
  return "\r\n".indexOf(text.charAt(offset)) !== -1;
15824
15805
  }
15825
- function isWhitespace(text, offset) {
15806
+ function isWhitespace2(text, offset) {
15826
15807
  return " ".indexOf(text.charAt(offset)) !== -1;
15827
15808
  }
15828
15809
 
@@ -15951,10 +15932,10 @@ var LIB;
15951
15932
  return -1 === r3 || -1 === i2 || 0 === s2 || 1 === s2 && r3 === i2 - 1 && r3 === n3 + 1 ? "" : t4.slice(r3, i2);
15952
15933
  }, format: function(t4) {
15953
15934
  if (null === t4 || "object" != typeof t4) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t4);
15954
- return function(t5, e3) {
15935
+ return (function(t5, e3) {
15955
15936
  var r3 = e3.dir || e3.root, n3 = e3.base || (e3.name || "") + (e3.ext || "");
15956
15937
  return r3 ? r3 === e3.root ? r3 + n3 : r3 + "/" + n3 : n3;
15957
- }(0, t4);
15938
+ })(0, t4);
15958
15939
  }, parse: function(t4) {
15959
15940
  e2(t4);
15960
15941
  var r3 = { root: "", dir: "", base: "", ext: "", name: "" };
@@ -16000,18 +15981,15 @@ var LIB;
16000
15981
  }
16001
15982
  const c = "", f = "/", u = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
16002
15983
  class l {
16003
- static isUri(t3) {
16004
- return t3 instanceof l || !!t3 && "string" == typeof t3.authority && "string" == typeof t3.fragment && "string" == typeof t3.path && "string" == typeof t3.query && "string" == typeof t3.scheme && "string" == typeof t3.fsPath && "function" == typeof t3.with && "function" == typeof t3.toString;
16005
- }
16006
- scheme;
16007
- authority;
16008
- path;
16009
- query;
16010
- fragment;
16011
15984
  constructor(t3, e2, r2, n2, i2, o2 = false) {
16012
- "object" == typeof t3 ? (this.scheme = t3.scheme || c, this.authority = t3.authority || c, this.path = t3.path || c, this.query = t3.query || c, this.fragment = t3.fragment || c) : (this.scheme = /* @__PURE__ */ function(t4, e3) {
15985
+ __publicField(this, "scheme");
15986
+ __publicField(this, "authority");
15987
+ __publicField(this, "path");
15988
+ __publicField(this, "query");
15989
+ __publicField(this, "fragment");
15990
+ "object" == typeof t3 ? (this.scheme = t3.scheme || c, this.authority = t3.authority || c, this.path = t3.path || c, this.query = t3.query || c, this.fragment = t3.fragment || c) : (this.scheme = /* @__PURE__ */ (function(t4, e3) {
16013
15991
  return t4 || e3 ? t4 : "file";
16014
- }(t3, o2), this.authority = e2 || c, this.path = function(t4, e3) {
15992
+ })(t3, o2), this.authority = e2 || c, this.path = (function(t4, e3) {
16015
15993
  switch (t4) {
16016
15994
  case "https":
16017
15995
  case "http":
@@ -16019,7 +15997,10 @@ var LIB;
16019
15997
  e3 ? e3[0] !== f && (e3 = f + e3) : e3 = f;
16020
15998
  }
16021
15999
  return e3;
16022
- }(this.scheme, r2 || c), this.query = n2 || c, this.fragment = i2 || c, a(this, o2));
16000
+ })(this.scheme, r2 || c), this.query = n2 || c, this.fragment = i2 || c, a(this, o2));
16001
+ }
16002
+ static isUri(t3) {
16003
+ return t3 instanceof l || !!t3 && "string" == typeof t3.authority && "string" == typeof t3.fragment && "string" == typeof t3.path && "string" == typeof t3.query && "string" == typeof t3.scheme && "string" == typeof t3.fsPath && "function" == typeof t3.with && "function" == typeof t3.toString;
16023
16004
  }
16024
16005
  get fsPath() {
16025
16006
  return v(this, false);
@@ -16064,8 +16045,11 @@ var LIB;
16064
16045
  }
16065
16046
  const g = i ? 1 : void 0;
16066
16047
  class d extends l {
16067
- _formatted = null;
16068
- _fsPath = null;
16048
+ constructor() {
16049
+ super(...arguments);
16050
+ __publicField(this, "_formatted", null);
16051
+ __publicField(this, "_fsPath", null);
16052
+ }
16069
16053
  get fsPath() {
16070
16054
  return this._fsPath || (this._fsPath = v(this, false)), this._fsPath;
16071
16055
  }
@@ -16135,12 +16119,12 @@ var LIB;
16135
16119
  }
16136
16120
  const A = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
16137
16121
  function w(t3) {
16138
- return t3.match(A) ? t3.replace(A, (t4) => C(t4)) : t3;
16122
+ return t3.match(A) ? t3.replace(A, ((t4) => C(t4))) : t3;
16139
16123
  }
16140
16124
  var x = r(975);
16141
16125
  const P = x.posix || x, _ = "/";
16142
16126
  var I;
16143
- !function(t3) {
16127
+ !(function(t3) {
16144
16128
  t3.joinPath = function(t4, ...e2) {
16145
16129
  return t4.with({ path: P.join(t4.path, ...e2) });
16146
16130
  }, t3.resolvePath = function(t4, ...e2) {
@@ -16157,7 +16141,7 @@ var LIB;
16157
16141
  }, t3.extname = function(t4) {
16158
16142
  return P.extname(t4.path);
16159
16143
  };
16160
- }(I || (I = {})), LIB = n;
16144
+ })(I || (I = {})), LIB = n;
16161
16145
  })();
16162
16146
  var { URI: URI2, Utils } = LIB;
16163
16147
 
@@ -16590,6 +16574,7 @@ var HTMLFolding = class {
16590
16574
  if (!this.dataManager.isVoidElement(lastTagName, voidElements)) {
16591
16575
  break;
16592
16576
  }
16577
+ // fallthrough
16593
16578
  case TokenType.EndTagClose:
16594
16579
  case TokenType.StartTagSelfClose: {
16595
16580
  let i = stack.length - 1;
@@ -31745,4 +31730,4 @@ export {
31745
31730
  he/he.js:
31746
31731
  (*! https://mths.be/he v1.2.0 by @mathias | MIT license *)
31747
31732
  */
31748
- //# sourceMappingURL=weml-monaco.esm.js.map
31733
+ //# sourceMappingURL=index.mjs.map