html-minifier-next 3.2.0 → 3.2.2

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.
package/README.md CHANGED
@@ -28,7 +28,7 @@ Use `html-minifier-next --help` to check all available options:
28
28
 
29
29
  | Option | Description | Example |
30
30
  | --- | --- | --- |
31
- | `--input-dir <dir>` | Specify an input directory | `--input-dir=src` |
31
+ | `--input-dir <dir>` | Specify an input directory (best restricted with `--file-ext`) | `--input-dir=src` |
32
32
  | `--output-dir <dir>` | Specify an output directory | `--output-dir=dist` |
33
33
  | `--file-ext <extensions>` | Specify file extension(s) to process (overrides config file setting) | `--file-ext=html`, `--file-ext=html,htm,php`, `--file-ext="html, htm, php"` |
34
34
  | `-o <file>`, `--output <file>` | Specify output file (reads from file arguments or STDIN) | File to file: `html-minifier-next input.html -o output.html`<br>Pipe to file: `cat input.html \| html-minifier-next -o output.html`<br>File to STDOUT: `html-minifier-next input.html` |
@@ -111,9 +111,9 @@ Options can be used in config files (camelCase) or via CLI flags (kebab-case wit
111
111
  | --- | --- | --- |
112
112
  | `caseSensitive`<br>`--case-sensitive` | Treat attributes in case-sensitive manner (useful for custom HTML elements) | `false` |
113
113
  | `collapseBooleanAttributes`<br>`--collapse-boolean-attributes` | [Omit attribute values from boolean attributes](http://perfectionkills.com/experimenting-with-html-minifier#collapse_boolean_attributes) | `false` |
114
- | `collapseInlineTagWhitespace`<br>`--collapse-inline-tag-whitespace` | Don’t leave any spaces between `display: inline;` elements when collapsing—use with `collapseWhitespace=true` | `false` |
114
+ | `collapseInlineTagWhitespace`<br>`--collapse-inline-tag-whitespace` | Don’t leave any spaces between `display: inline;` elements when collapsing—use with `collapseWhitespace: true` | `false` |
115
115
  | `collapseWhitespace`<br>`--collapse-whitespace` | [Collapse whitespace that contributes to text nodes in a document tree](http://perfectionkills.com/experimenting-with-html-minifier#collapse_whitespace) | `false` |
116
- | `conservativeCollapse`<br>`--conservative-collapse` | Always collapse to 1 space (never remove it entirely)—use with `collapseWhitespace=true` | `false` |
116
+ | `conservativeCollapse`<br>`--conservative-collapse` | Always collapse to 1 space (never remove it entirely)—use with `collapseWhitespace: true` | `false` |
117
117
  | `continueOnParseError`<br>`--continue-on-parse-error` | [Handle parse errors](https://html.spec.whatwg.org/multipage/parsing.html#parse-errors) instead of aborting | `false` |
118
118
  | `customAttrAssign`<br>`--custom-attr-assign` | Arrays of regexes that allow to support custom attribute assign expressions (e.g., `<div flex?="{{mode != cover}}"></div>`) | `[]` |
119
119
  | `customAttrCollapse`<br>`--custom-attr-collapse` | Regex that specifies custom attribute to strip newlines from (e.g., `/ng-class/`) | |
@@ -133,7 +133,7 @@ Options can be used in config files (camelCase) or via CLI flags (kebab-case wit
133
133
  | `minifyJS`<br>`--minify-js` | Minify JavaScript in `script` elements and event attributes (uses [Terser](https://github.com/terser/terser)) | `false` (could be `true`, `Object`, `Function(text, inline)`) |
134
134
  | `minifyURLs`<br>`--minify-urls` | Minify URLs in various attributes (uses [relateurl](https://github.com/stevenvachon/relateurl)) | `false` (could be `String`, `Object`, `Function(text)`, `async Function(text)`) |
135
135
  | `noNewlinesBeforeTagClose`<br>`--no-newlines-before-tag-close` | Never add a newline before a tag that closes an element | `false` |
136
- | `preserveLineBreaks`<br>`--preserve-line-breaks` | Always collapse to 1 line break (never remove it entirely) when whitespace between tags includes a line break—use with `collapseWhitespace=true` | `false` |
136
+ | `preserveLineBreaks`<br>`--preserve-line-breaks` | Always collapse to 1 line break (never remove it entirely) when whitespace between tags includes a line break—use with `collapseWhitespace: true` | `false` |
137
137
  | `preventAttributesEscaping`<br>`--prevent-attributes-escaping` | Prevents the escaping of the values of attributes | `false` |
138
138
  | `processConditionalComments`<br>`--process-conditional-comments` | Process contents of conditional comments through minifier | `false` |
139
139
  | `processScripts`<br>`--process-scripts` | Array of strings corresponding to types of `script` elements to process through minifier (e.g., `text/ng-template`, `text/x-handlebars-template`, etc.) | `[]` |
@@ -154,7 +154,7 @@ Options can be used in config files (camelCase) or via CLI flags (kebab-case wit
154
154
 
155
155
  ### Sorting attributes and style classes
156
156
 
157
- Minifier options like `sortAttributes` and `sortClassName` won’t impact the plain‑text size of the output. However, they form long, repetitive character chains that should improve the compression ratio of gzip used for HTTP.
157
+ Minifier options like `sortAttributes` and `sortClassName` won’t impact the plain‑text size of the output. However, using these options for more consistent ordering improves the compression ratio for gzip and Brotli used over HTTP.
158
158
 
159
159
  ## Minification comparison
160
160
 
@@ -163,24 +163,24 @@ How does HTML Minifier Next compare to other solutions, like [minimize](https://
163
163
  | Site | Original Size (KB) | HTML Minifier Next | minimize | html­compressor.com | htmlnano | minify-html |
164
164
  | --- | --- | --- | --- | --- | --- | --- |
165
165
  | [A List Apart](https://alistapart.com/) | 62 | **53** | 58 | 56 | 54 | 55 |
166
- | [Amazon](https://www.amazon.com/) | 715 | **642** | 701 | n/a | n/a | n/a |
167
- | [Apple](https://www.apple.com/) | 184 | **143** | 170 | 167 | 161 | 166 |
168
- | [BBC](https://www.bbc.co.uk/) | 618 | **568** | 613 | n/a | 580 | 582 |
169
- | [CSS-Tricks](https://css-tricks.com/) | 161 | **121** | 148 | 145 | 126 | 144 |
166
+ | [Amazon](https://www.amazon.com/) | 206 | **195** | 203 | 200 | 196 | n/a |
167
+ | [Apple](https://www.apple.com/) | 183 | **143** | 169 | 167 | 160 | 166 |
168
+ | [BBC](https://www.bbc.co.uk/) | 689 | **633** | 683 | n/a | 646 | 648 |
169
+ | [CSS-Tricks](https://css-tricks.com/) | 163 | **121** | 149 | 146 | 127 | 145 |
170
170
  | [ECMAScript](https://tc39.es/ecma262/) | 7233 | **6338** | 6610 | n/a | 6557 | 6563 |
171
- | [EFF](https://www.eff.org/) | 57 | **48** | 51 | 51 | 51 | 49 |
172
- | [FAZ](https://www.faz.net/aktuell/) | 1876 | 1753 | 1790 | n/a | **1652** | n/a |
173
- | [Frontend Dogma](https://frontenddogma.com/) | 119 | **114** | 128 | 118 | 125 | 119 |
174
- | [Google](https://www.google.com/) | 18 | **17** | 18 | 18 | **17** | n/a |
175
- | [Ground News](https://ground.news/) | 1840 | **1591** | 1827 | n/a | 1689 | n/a |
171
+ | [EFF](https://www.eff.org/) | 57 | **48** | 52 | 52 | 51 | 50 |
172
+ | [FAZ](https://www.faz.net/aktuell/) | 1871 | 1747 | 1785 | n/a | **1647** | n/a |
173
+ | [Frontend Dogma](https://frontenddogma.com/) | 119 | **114** | 128 | 119 | 126 | 119 |
174
+ | [Google](https://www.google.com/) | 18 | **16** | 18 | 18 | 17 | n/a |
175
+ | [Ground News](https://ground.news/) | 3308 | **2946** | 3295 | n/a | 3042 | n/a |
176
176
  | [HTML](https://html.spec.whatwg.org/multipage/) | 149 | **147** | 155 | 148 | 153 | 149 |
177
- | [Leanpub](https://leanpub.com/) | 1567 | **1292** | 1561 | n/a | 1299 | n/a |
177
+ | [Leanpub](https://leanpub.com/) | 1279 | **1063** | 1274 | n/a | 1070 | n/a |
178
178
  | [Mastodon](https://mastodon.social/explore) | 35 | **26** | 34 | 34 | 30 | 33 |
179
- | [MDN](https://developer.mozilla.org/en-US/) | 104 | **62** | 67 | 68 | 64 | n/a |
180
- | [Middle East Eye](https://www.middleeasteye.net/) | 224 | **197** | 204 | 204 | 204 | 201 |
181
- | [SitePoint](https://www.sitepoint.com/) | 476 | **345** | 473 | n/a | 415 | 456 |
179
+ | [MDN](https://developer.mozilla.org/en-US/) | 107 | **61** | 67 | 67 | 63 | n/a |
180
+ | [Middle East Eye](https://www.middleeasteye.net/) | 224 | **197** | 204 | 205 | 204 | 202 |
181
+ | [SitePoint](https://www.sitepoint.com/) | 485 | **354** | 481 | n/a | 423 | 465 |
182
182
  | [United Nations](https://www.un.org/en/) | 151 | **114** | 130 | 123 | 121 | 124 |
183
- | [W3C](https://www.w3.org/) | 50 | **36** | 41 | 39 | 39 | 39 |
183
+ | [W3C](https://www.w3.org/) | 50 | **36** | 41 | 39 | 38 | 39 |
184
184
 
185
185
  ## Examples
186
186
 
@@ -192,7 +192,7 @@ How does HTML Minifier Next compare to other solutions, like [minimize](https://
192
192
  html-minifier-next --collapse-whitespace --remove-comments --minify-js true --input-dir=. --output-dir=example
193
193
  ```
194
194
 
195
- **Process specific file extensions:**
195
+ **Process specific files and directories:**
196
196
 
197
197
  ```bash
198
198
  # Process only HTML files
@@ -206,7 +206,7 @@ html-minifier-next --config-file=html-minifier.json --input-dir=src --output-dir
206
206
 
207
207
  # Process all files (default behavior)
208
208
  html-minifier-next --collapse-whitespace --input-dir=src --output-dir=dist
209
- # Note: When processing all files, non-HTML files will also be read as UTF‑8 and passed to the minifier
209
+ # When processing all files, non-HTML files will also be read as UTF‑8 and passed to the minifier
210
210
  # Consider restricting with `--file-ext` to avoid touching binaries (e.g., images, archives)
211
211
  ```
212
212
 
@@ -236,7 +236,7 @@ html-minifier-next --input-dir=src --output-dir=dist --verbose --collapse-whites
236
236
  # ---
237
237
  # Total: 3,334 → 2,546 bytes (-788, 23.6%)
238
238
 
239
- # Note: `--dry` automatically enables verbose output
239
+ # `--dry` automatically enables verbose output
240
240
  html-minifier-next --input-dir=src --output-dir=dist --dry --collapse-whitespace
241
241
  ```
242
242
 
@@ -331,7 +331,7 @@ npm install
331
331
  npm run benchmarks
332
332
  ```
333
333
 
334
- ## Local server
334
+ ### Local server
335
335
 
336
336
  ```shell
337
337
  npm run serve
@@ -68,7 +68,7 @@ let IS_REGEX_CAPTURING_BROKEN = false;
68
68
  const empty = new CaseInsensitiveSet(['area', 'base', 'basefont', 'br', 'col', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']);
69
69
 
70
70
  // Inline elements
71
- const inline = new CaseInsensitiveSet(['a', 'abbr', 'acronym', 'applet', 'b', 'basefont', 'bdo', 'big', 'br', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map', 'noscript', 'object', 'q', 's', 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'svg', 'textarea', 'tt', 'u', 'var']);
71
+ const inline = new CaseInsensitiveSet(['a', 'abbr', 'acronym', 'applet', 'b', 'basefont', 'bdo', 'big', 'br', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map', 'noscript', 'object', 'q', 's', 'samp', 'script', 'select', 'selectedcontent', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'svg', 'textarea', 'tt', 'u', 'var']);
72
72
 
73
73
  // Elements that you can, intentionally, leave open
74
74
  // (and which close themselves)
@@ -988,7 +988,7 @@ const topLevelTags = new Set(['html', 'head', 'body']);
988
988
  const compactTags = new Set(['html', 'body']);
989
989
  const looseTags = new Set(['head', 'colgroup', 'caption']);
990
990
  const trailingTags = new Set(['dt', 'thead']);
991
- const htmlTags = new Set(['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdi', 'bdo', 'bgsound', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'content', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'listing', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'multicol', 'nav', 'nobr', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'plaintext', 'pre', 'progress', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp']);
991
+ const htmlTags = new Set(['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdi', 'bdo', 'bgsound', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'content', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'listing', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'multicol', 'nav', 'nobr', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'plaintext', 'pre', 'progress', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'search', 'section', 'select', 'selectedcontent', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp']);
992
992
 
993
993
  function canRemoveParentTag(optionalStartTag, tag) {
994
994
  switch (optionalStartTag) {
@@ -60258,7 +60258,7 @@ let IS_REGEX_CAPTURING_BROKEN = false;
60258
60258
  const empty = new CaseInsensitiveSet(['area', 'base', 'basefont', 'br', 'col', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']);
60259
60259
 
60260
60260
  // Inline elements
60261
- const inline = new CaseInsensitiveSet(['a', 'abbr', 'acronym', 'applet', 'b', 'basefont', 'bdo', 'big', 'br', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map', 'noscript', 'object', 'q', 's', 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'svg', 'textarea', 'tt', 'u', 'var']);
60261
+ const inline = new CaseInsensitiveSet(['a', 'abbr', 'acronym', 'applet', 'b', 'basefont', 'bdo', 'big', 'br', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map', 'noscript', 'object', 'q', 's', 'samp', 'script', 'select', 'selectedcontent', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'svg', 'textarea', 'tt', 'u', 'var']);
60262
60262
 
60263
60263
  // Elements that you can, intentionally, leave open
60264
60264
  // (and which close themselves)
@@ -61178,7 +61178,7 @@ const topLevelTags = new Set(['html', 'head', 'body']);
61178
61178
  const compactTags = new Set(['html', 'body']);
61179
61179
  const looseTags = new Set(['head', 'colgroup', 'caption']);
61180
61180
  const trailingTags = new Set(['dt', 'thead']);
61181
- const htmlTags = new Set(['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdi', 'bdo', 'bgsound', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'content', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'listing', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'multicol', 'nav', 'nobr', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'plaintext', 'pre', 'progress', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp']);
61181
+ const htmlTags = new Set(['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdi', 'bdo', 'bgsound', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'content', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'listing', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'multicol', 'nav', 'nobr', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'plaintext', 'pre', 'progress', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'search', 'section', 'select', 'selectedcontent', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp']);
61182
61182
 
61183
61183
  function canRemoveParentTag(optionalStartTag, tag) {
61184
61184
  switch (optionalStartTag) {
@@ -60264,7 +60264,7 @@
60264
60264
  const empty = new CaseInsensitiveSet(['area', 'base', 'basefont', 'br', 'col', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']);
60265
60265
 
60266
60266
  // Inline elements
60267
- const inline = new CaseInsensitiveSet(['a', 'abbr', 'acronym', 'applet', 'b', 'basefont', 'bdo', 'big', 'br', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map', 'noscript', 'object', 'q', 's', 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'svg', 'textarea', 'tt', 'u', 'var']);
60267
+ const inline = new CaseInsensitiveSet(['a', 'abbr', 'acronym', 'applet', 'b', 'basefont', 'bdo', 'big', 'br', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map', 'noscript', 'object', 'q', 's', 'samp', 'script', 'select', 'selectedcontent', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'svg', 'textarea', 'tt', 'u', 'var']);
60268
60268
 
60269
60269
  // Elements that you can, intentionally, leave open
60270
60270
  // (and which close themselves)
@@ -61184,7 +61184,7 @@
61184
61184
  const compactTags = new Set(['html', 'body']);
61185
61185
  const looseTags = new Set(['head', 'colgroup', 'caption']);
61186
61186
  const trailingTags = new Set(['dt', 'thead']);
61187
- const htmlTags = new Set(['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdi', 'bdo', 'bgsound', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'content', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'listing', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'multicol', 'nav', 'nobr', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'plaintext', 'pre', 'progress', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp']);
61187
+ const htmlTags = new Set(['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdi', 'bdo', 'bgsound', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'content', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'listing', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'multicol', 'nav', 'nobr', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'plaintext', 'pre', 'progress', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'search', 'section', 'select', 'selectedcontent', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp']);
61188
61188
 
61189
61189
  function canRemoveParentTag(optionalStartTag, tag) {
61190
61190
  switch (optionalStartTag) {
@@ -6,4 +6,4 @@ var ps=2147483647,ds=/[^\x20-\x7E]/,hs=/[\x2E\u3002\uFF0E\uFF61]/g,As={overflow:
6
6
  * Modified by Juriy “kangax” Zaytsev
7
7
  * Original code by Erik Arvidsson, Mozilla Public License
8
8
  * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
9
- */class AE extends Set{has(e){return super.has(e.toLowerCase())}}const mE=/([^\s"'<>/=]+)/,gE=[/=/],_E=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^ \t\n\f\r"'`=<>]+)/.source],EE=function(){const e="A-Za-z\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u0131\\u0134-\\u013E\\u0141-\\u0148\\u014A-\\u017E\\u0180-\\u01C3\\u01CD-\\u01F0\\u01F4\\u01F5\\u01FA-\\u0217\\u0250-\\u02A8\\u02BB-\\u02C1\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03CE\\u03D0-\\u03D6\\u03DA\\u03DC\\u03DE\\u03E0\\u03E2-\\u03F3\\u0401-\\u040C\\u040E-\\u044F\\u0451-\\u045C\\u045E-\\u0481\\u0490-\\u04C4\\u04C7\\u04C8\\u04CB\\u04CC\\u04D0-\\u04EB\\u04EE-\\u04F5\\u04F8\\u04F9\\u0531-\\u0556\\u0559\\u0561-\\u0586\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u063A\\u0641-\\u064A\\u0671-\\u06B7\\u06BA-\\u06BE\\u06C0-\\u06CE\\u06D0-\\u06D3\\u06D5\\u06E5\\u06E6\\u0905-\\u0939\\u093D\\u0958-\\u0961\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8B\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AE0\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B36-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB5\\u0BB7-\\u0BB9\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D60\\u0D61\\u0E01-\\u0E2E\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E45\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD\\u0EAE\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0F40-\\u0F47\\u0F49-\\u0F69\\u10A0-\\u10C5\\u10D0-\\u10F6\\u1100\\u1102\\u1103\\u1105-\\u1107\\u1109\\u110B\\u110C\\u110E-\\u1112\\u113C\\u113E\\u1140\\u114C\\u114E\\u1150\\u1154\\u1155\\u1159\\u115F-\\u1161\\u1163\\u1165\\u1167\\u1169\\u116D\\u116E\\u1172\\u1173\\u1175\\u119E\\u11A8\\u11AB\\u11AE\\u11AF\\u11B7\\u11B8\\u11BA\\u11BC-\\u11C2\\u11EB\\u11F0\\u11F9\\u1E00-\\u1E9B\\u1EA0-\\u1EF9\\u1F00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2126\\u212A\\u212B\\u212E\\u2180-\\u2182\\u3007\\u3021-\\u3029\\u3041-\\u3094\\u30A1-\\u30FA\\u3105-\\u312C\\u4E00-\\u9FA5\\uAC00-\\uD7A3",t="["+e+"_]["+e+"0-9\\u0660-\\u0669\\u06F0-\\u06F9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE7-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\.\\-_\\u0300-\\u0345\\u0360\\u0361\\u0483-\\u0486\\u0591-\\u05A1\\u05A3-\\u05B9\\u05BB-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u064B-\\u0652\\u0670\\u06D6-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0901-\\u0903\\u093C\\u093E-\\u094D\\u0951-\\u0954\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A02\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A70\\u0A71\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B43\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B82\\u0B83\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C01-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C82\\u0C83\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D43\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86-\\u0F8B\\u0F90-\\u0F95\\u0F97\\u0F99-\\u0FAD\\u0FB1-\\u0FB7\\u0FB9\\u20D0-\\u20DC\\u20E1\\u302A-\\u302F\\u3099\\u309A\\xB7\\u02D0\\u02D1\\u0387\\u0640\\u0E46\\u0EC6\\u3005\\u3031-\\u3035\\u309D\\u309E\\u30FC-\\u30FE]*";return"((?:"+t+"\\:)?"+t+")"}(),vE=new RegExp("^<"+EE),bE=/^\s*(\/?)>/,yE=new RegExp("^<\\/"+EE+"[^>]*>"),SE=/^<!DOCTYPE\s?[^>]+>/i;let CE=!1;"x".replace(/x(.)?/g,function(e,t){CE=""===t});const DE=new AE(["area","base","basefont","br","col","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),wE=new AE(["a","abbr","acronym","applet","b","basefont","bdo","big","br","button","cite","code","del","dfn","em","font","i","iframe","img","input","ins","kbd","label","map","noscript","object","q","s","samp","script","select","small","span","strike","strong","sub","sup","svg","textarea","tt","u","var"]),RE=new AE(["colgroup","dd","dt","li","option","p","td","tfoot","th","thead","tr","source"]),TE=new AE(["checked","compact","declare","defer","disabled","ismap","multiple","nohref","noresize","noshade","nowrap","readonly","selected"]),OE=new AE(["script","style"]),IE=new AE(["address","article","aside","base","blockquote","body","caption","col","colgroup","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","legend","li","menuitem","meta","ol","optgroup","option","param","rp","rt","source","style","summary","tbody","td","tfoot","th","thead","title","tr","track","ul"]),kE={};function FE(e){let t=mE.source+"(?:\\s*("+function(e){return gE.concat(e.customAttrAssign||[]).map(function(e){return"(?:"+e.source+")"}).join("|")}(e)+")[ \\t\\n\\f\\r]*(?:"+_E.join("|")+"))?";if(e.customAttrSurround){const n=[];for(let r=e.customAttrSurround.length-1;r>=0;r--)n[r]="(?:("+e.customAttrSurround[r][0].source+")\\s*"+t+"\\s*("+e.customAttrSurround[r][1].source+"))";n.push("(?:"+t+")"),t="(?:"+n.join("|")+")"}return new RegExp("^\\s*"+t)}class xE{constructor(e,t){this.html=e,this.handler=t}async parse(){let e=this.html;const t=this.handler,n=[];let r;const i=FE(t);let o,a,s;for(;e;){if(o=e,r&&OE.has(r)){const n=r.toLowerCase(),i=kE[n]||(kE[n]=new RegExp("([\\s\\S]*?)</"+n+"[^>]*>","i"));e=await hE(e,i,async(e,r)=>("script"!==n&&"style"!==n&&"noscript"!==n&&(r=r.replace(/<!--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),t.chars&&await t.chars(r),"")),await p("</"+n+">",n)}else{let n,r=e.indexOf("<");if(0===r){if(/^<!--/.test(e)){const n=e.indexOf("--\x3e");if(n>=0){t.comment&&await t.comment(e.substring(4,n)),e=e.substring(n+3),a="";continue}}if(/^<!\[/.test(e)){const n=e.indexOf("]>");if(n>=0){t.comment&&await t.comment(e.substring(2,n+1),!0),e=e.substring(n+2),a="";continue}}const n=e.match(SE);if(n){t.doctype&&t.doctype(n[0]),e=e.substring(n[0].length),a="";continue}const i=e.match(yE);if(i){e=e.substring(i[0].length),await hE(i[0],yE,p),a="/"+i[1].toLowerCase();continue}const o=u(e);if(o){e=o.rest,await l(o),a=o.tagName.toLowerCase();continue}t.continueOnParseError&&(r=e.indexOf("<",1))}r>=0?(n=e.substring(0,r),e=e.substring(r)):(n=e,e="");let i=u(e);i?s=i.tagName:(i=e.match(yE),s=i?"/"+i[1]:""),t.chars&&await t.chars(n,a,s),a=""}if(e===o)throw new Error("Parse Error: "+e)}function u(e){const t=e.match(vE);if(t){const n={tagName:t[1],attrs:[]};let r,o;for(e=e.slice(t[0].length);!(r=e.match(bE))&&(o=e.match(i));)e=e.slice(o[0].length),n.attrs.push(o);if(r)return n.unarySlash=r[1],n.rest=e.slice(r[0].length),n}}async function c(e){const i=function(e){let t;const r=e.toLowerCase();for(t=n.length-1;t>=0;t--){const e=n[t].tag.toLowerCase();if(e===r)return t;if("table"===e)break}return-1}(e);return i>=0&&(await async function(e){for(let r=n.length-1;r>=e;r--)t.end&&await t.end(n[r].tag,n[r].attrs,!0);n.length=e,r=e&&n[e-1].tag}(i),!0)}async function l(e){const i=e.tagName;let o=e.unarySlash;if(t.html5&&("p"===r&&IE.has(i)?await p("",r):"tbody"===i?await c("thead"):"tfoot"===i?await c("tbody")||await c("thead"):"thead"===i&&(await c("tbody")||await c("tfoot")),"col"===i&&f("colgroup")<0&&(r="colgroup",n.push({tag:r,attrs:[]}),t.start&&await t.start(r,[],!1,""))),!t.html5&&!wE.has(i))for(;r&&wE.has(r);)await p("",r);RE.has(i)&&r===i&&await p("",i),"dt"!==i&&"dd"!==i||"dt"!==r&&"dd"!==r||await p("",r);const a=DE.has(i)||"html"===i&&"head"===r||!!o,s=e.attrs.map(function(e){let n,r,i,o,a,s;function u(t){return a=e[t],r=e[t+1],void 0!==r?'"':(r=e[t+2],void 0!==r?"'":(r=e[t+3],void 0===r&&TE.has(n)&&(r=n),""))}CE&&-1===e[0].indexOf('""')&&(""===e[3]&&delete e[3],""===e[4]&&delete e[4],""===e[5]&&delete e[5]);let c=1;if(t.customAttrSurround)for(let r=0,a=t.customAttrSurround.length;r<a;r++,c+=7)if(n=e[c+1],n){s=u(c+2),i=e[c],o=e[c+6];break}return!n&&(n=e[c])&&(s=u(c+1)),{name:n,value:r,customAssign:a||"=",customOpen:i||"",customClose:o||"",quote:s||""}});a||(n.push({tag:i,attrs:s}),r=i,o=""),t.start&&await t.start(i,s,a,o)}function f(e){let t;const r=e.toLowerCase();for(t=n.length-1;t>=0&&n[t].tag.toLowerCase()!==r;t--);return t}async function p(e,i){let o;if(o=i?f(i):0,o>=0){for(let r=n.length-1;r>=o;r--)t.end&&t.end(n[r].tag,n[r].attrs,r>o||!e);n.length=o,r=o&&n[o-1].tag}else"br"===i.toLowerCase()?t.start&&await t.start(i,[],!0,""):"p"===i.toLowerCase()&&(t.start&&await t.start(i,[],!1,"",!0),t.end&&t.end(i,[]))}t.partialMarkup||await p()}}class BE{sort(e,t=0){for(let n=0,r=this.keys.length;n<r;n++){const r=this.keys[n],i=r.slice(1);let o=e.indexOf(i,t);if(-1!==o){do{o!==t&&(e.splice(o,1),e.splice(t,0,i)),t++}while(-1!==(o=e.indexOf(i,t)));return this[r].sort(e,t)}}return e}}class ME{add(e){e.forEach(t=>{const n="$"+t;this[n]||(this[n]=[],this[n].processed=0),this[n].push(e)})}createSorter(){const e=new BE;return e.keys=Object.keys(this).sort((e,t)=>{const n=this[e].length,r=this[t].length;return n<r?1:n>r||e<t?-1:e>t?1:0}).filter(t=>{if(this[t].processed<this[t].length){const n=t.slice(1),r=new ME;return this[t].forEach(e=>{let t;for(;-1!==(t=e.indexOf(n));)e.splice(t,1);e.forEach(e=>{this["$"+e].processed++}),r.add(e.slice(0))}),e[t]=r.createSorter(),!0}return!1}),e}}const NE=e=>e&&e.replace(/^[ \n\r\t\f]+/,"").replace(/[ \n\r\t\f]+$/,"");function LE(e){return e&&e.replace(/[ \n\r\t\f\xA0]+/g,function(e){return"\t"===e?"\t":e.replace(/(^|\xA0+)[^\xA0]+/g,"$1 ")})}function PE(e,t,n,r,i){let o="",a="";return t.preserveLineBreaks&&(e=e.replace(/^[ \n\r\t\f]*?[\n\r][ \n\r\t\f]*/,function(){return o="\n",""}).replace(/[ \n\r\t\f]*?[\n\r][ \n\r\t\f]*$/,function(){return a="\n",""})),n&&(e=e.replace(/^[ \n\r\t\f\xA0]+/,function(e){const n=!o&&t.conservativeCollapse;return n&&"\t"===e?"\t":e.replace(/^[^\xA0]+/,"").replace(/(\xA0+)[^\xA0]+/g,"$1 ")||(n?" ":"")})),r&&(e=e.replace(/[ \n\r\t\f\xA0]+$/,function(e){const n=!a&&t.conservativeCollapse;return n&&"\t"===e?"\t":e.replace(/[^\xA0]+(\xA0+)/g," $1").replace(/[^\xA0]+$/,"")||(n?" ":"")})),i&&(e=LE(e)),o+e+a}const UE=["a","abbr","acronym","b","bdi","bdo","big","button","cite","code","del","dfn","em","font","i","img","input","ins","kbd","label","mark","math","meter","nobr","object","output","progress","q","rb","rp","rt","rtc","ruby","s","samp","select","small","span","strike","strong","sub","sup","svg","textarea","time","tt","u","var","wbr"],VE=new Set(["a","abbr","acronym","b","big","del","em","font","i","ins","kbd","mark","nobr","s","samp","small","span","strike","strong","sub","sup","time","tt","u","var"]),KE=new Set(["comment","img","input","wbr"]);function GE(e,t,n,r,i,o){let a=t&&!KE.has(t);a&&!r.collapseInlineTagWhitespace&&(a="/"===t.charAt(0)?!i.has(t.slice(1)):!o.has(t));let s=n&&!KE.has(n);return s&&!r.collapseInlineTagWhitespace&&(s="/"===n.charAt(0)?!o.has(n.slice(1)):!i.has(n)),PE(e,r,a,s,t&&n)}function HE(e,t){for(let n=e.length;n--;)if(e[n].name.toLowerCase()===t)return!0;return!1}const WE={autocorrect:"on",fetchpriority:"auto",loading:"eager",popovertargetaction:"toggle"},zE={area:{shape:"rect"},button:{type:"submit"},form:{enctype:"application/x-www-form-urlencoded",method:"get"},html:{dir:"ltr"},img:{decoding:"auto"},input:{colorspace:"limited-srgb",type:"text"},marquee:{behavior:"scroll",direction:"left"},style:{media:"all"},textarea:{wrap:"soft"},track:{kind:"subtitles"}};const YE=new Set(["text/javascript","text/ecmascript","text/jscript","application/javascript","application/x-javascript","application/ecmascript","module"]),XE=new Set(["module"]);function QE(e=""){return""===(e=NE(e.split(/;/,2)[0]).toLowerCase())||YE.has(e)}function jE(e=""){return""===(e=NE(e).toLowerCase())||"text/css"===e}function qE(e,t){if("style"!==e)return!1;for(let e=0,n=t.length;e<n;e++){if("type"===t[e].name.toLowerCase())return jE(t[e].value)}return!0}const ZE=new Set(["allowfullscreen","async","autofocus","autoplay","checked","compact","controls","declare","default","defaultchecked","defaultmuted","defaultselected","defer","disabled","enabled","formnovalidate","hidden","indeterminate","inert","ismap","itemscope","loop","multiple","muted","nohref","noresize","noshade","novalidate","nowrap","open","pauseonexit","readonly","required","reversed","scoped","seamless","selected","sortable","truespeed","typemustmatch","visible"]),JE=new Set(["true","false"]);function $E(e,t,n){if("link"!==e)return!1;const r=String(n).toLowerCase();for(let e=0;e<t.length;e++)if("rel"===t[e].name.toLowerCase()){if(String(t[e].value).toLowerCase().split(/\s+/).includes(r))return!0}return!1}const ev=new Set(["img","source"]);async function tv(e,t,n,r,i,o){if(function(e,t){const n=t.customEventAttributes;if(n){for(let t=n.length;t--;)if(n[t].test(e))return!0;return!1}return/^on[a-z]{3,}$/.test(e)}(t,r))return n=NE(n).replace(/^javascript:\s*/i,""),r.minifyJS(n,!0);if("class"===t)return n=NE(n),n=r.sortClassName?r.sortClassName(n):LE(n);if(function(e,t){return/^(?:a|area|link|base)$/.test(t)&&"href"===e||"img"===t&&/^(?:src|longdesc|usemap)$/.test(e)||"object"===t&&/^(?:classid|codebase|data|usemap)$/.test(e)||"q"===t&&"cite"===e||"blockquote"===t&&"cite"===e||("ins"===t||"del"===t)&&"cite"===e||"form"===t&&"action"===e||"input"===t&&("src"===e||"usemap"===e)||"head"===t&&"profile"===e||"script"===t&&("src"===e||"for"===e)}(t,e)){if(n=NE(n),$E(e,i,"canonical"))return n;try{const e=await r.minifyURLs(n);return"string"==typeof e?e:n}catch(e){return r.log&&r.log(e),n}}else{if(function(e,t){return/^(?:a|area|object|button)$/.test(t)&&"tabindex"===e||"input"===t&&("maxlength"===e||"tabindex"===e)||"select"===t&&("size"===e||"tabindex"===e)||"textarea"===t&&/^(?:rows|cols|tabindex)$/.test(e)||"colgroup"===t&&"span"===e||"col"===t&&"span"===e||("th"===t||"td"===t)&&("rowspan"===e||"colspan"===e)}(t,e))return NE(n);if("style"===t)return(n=NE(n))&&(/;$/.test(n)&&!/&#?[0-9a-zA-Z]+;$/.test(n)&&(n=n.replace(/\s*;$/,";")),n=await r.minifyCSS(n,"inline")),n;if(function(e,t){return"srcset"===e&&ev.has(t)}(t,e))n=(await Promise.all(NE(n).split(/\s+,\s*|\s*,\s+/).map(async function(e){let t=e,n="";const i=e.match(/\s+([1-9][0-9]*w|[0-9]+(?:\.[0-9]+)?x)$/);if(i){t=t.slice(0,-i[0].length);const e=+i[1].slice(0,-1),r=i[1].slice(-1);1===e&&"x"===r||(n=" "+e+r)}try{const e=await r.minifyURLs(t);return("string"==typeof e?e:t)+n}catch(e){return r.log&&r.log(e),t+n}}))).join(", ");else if(function(e,t){if("meta"!==e)return!1;for(let e=0,n=t.length;e<n;e++)if("name"===t[e].name&&"viewport"===t[e].value)return!0}(e,i)&&"content"===t)n=n.replace(/\s+/g,"").replace(/[0-9]+\.[0-9]+/g,function(e){return(+e).toString()});else{if(function(e,t){if("meta"!==e)return!1;for(let e=0,n=t.length;e<n;e++)if("http-equiv"===t[e].name.toLowerCase()&&"content-security-policy"===t[e].value.toLowerCase())return!0}(e,i)&&"content"===t.toLowerCase())return LE(n);if(r.customAttrCollapse&&r.customAttrCollapse.test(t))n=NE(n.replace(/ ?[\n\r]+ ?/g,"").replace(/\s{2,}/g,r.conservativeCollapse?" ":""));else if("script"===e&&"type"===t)n=NE(n.replace(/\s*;\s*/g,";"));else{if(function(e,t,n){return"media"===n&&($E(e,t,"stylesheet")||qE(e,t))}(e,i,t))return n=NE(n),r.minifyCSS(n,"media");if("iframe"===e&&"srcdoc"===t)return function(e){return Boolean(e.collapseWhitespace||e.removeComments||e.removeOptionalTags||e.minifyJS!==Rv||e.minifyCSS!==Tv||e.minifyURLs!==Rv)}(r)?o(n,r,!0):n}}}return n}function nv(e){return"/* clean-css ignore:start */"+e+"/* clean-css ignore:end */"}function rv(e,t){switch(t){case"inline":return"*{"+e+"}";case"media":return"@media "+e+"{a{top:0}}";default:return e}}const iv=new Set(["html","head","body","colgroup","tbody"]),ov=new Set(["html","head","body","li","dt","dd","p","rb","rt","rtc","rp","optgroup","option","colgroup","caption","thead","tbody","tfoot","tr","td","th"]),av=new Set(["meta","link","script","style","template","noscript"]),sv=new Set(["dt","dd"]),uv=new Set(["address","article","aside","blockquote","details","dialog","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","menu","nav","ol","p","pre","search","section","table","ul"]),cv=new Set(["a","audio","del","ins","map","noscript","video"]),lv=new Set(["rb","rt","rtc","rp"]),fv=new Set(["rb","rtc"]),pv=new Set(["option","optgroup"]),dv=new Set(["tbody","tfoot"]),hv=new Set(["thead","tbody","tfoot"]),Av=new Set(["td","th"]),mv=new Set(["html","head","body"]),gv=new Set(["html","body"]),_v=new Set(["head","colgroup","caption"]),Ev=new Set(["dt","thead"]),vv=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","menu","menuitem","meta","meter","multicol","nav","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]);const bv=new RegExp("^(?:class|id|style|title|lang|dir|on(?:focus|blur|change|click|dblclick|mouse(?:down|up|over|move|out)|key(?:press|down|up)))$");function yv(e,t){for(let n=t.length-1;n>=0;n--)if(t[n].name===e)return!0;return!1}function Sv(e){return!/^(?:script|style|pre|textarea)$/.test(e)}function Cv(e){return!/^(?:pre|textarea)$/.test(e)}async function Dv(e,t,n,r){const i=r.name(e.name);let o=e.value;if(r.decodeEntities&&o&&(o=Jl(o,Ql.Strict)),!(r.removeRedundantAttributes&&function(e,t,n,r){return n=n?NE(n.toLowerCase()):"","script"===e&&"language"===t&&"javascript"===n||"script"===e&&"charset"===t&&!HE(r,"src")||!("a"!==e||"name"!==t||!HE(r,"id"))||WE[t]===n||zE[e]?.[t]===n}(n,i,o,t)||r.removeScriptTypeAttributes&&"script"===n&&"type"===i&&QE(o)&&!function(e=""){return e=NE(e.split(/;/,2)[0]).toLowerCase(),XE.has(e)}(o)||r.removeStyleLinkTypeAttributes&&("style"===n||"link"===n)&&"type"===i&&jE(o)||(o&&(o=await tv(n,i,o,r,t,Fv)),r.removeEmptyAttributes&&function(e,t,n,r){return!(n&&!/^\s*$/.test(n))&&("function"==typeof r.removeEmptyAttributes?r.removeEmptyAttributes(t,e):"input"===e&&"value"===t||bv.test(t))}(n,i,o,r))))return r.decodeEntities&&o&&(o=o.replace(/&(#?[0-9a-zA-Z]+;)/g,"&amp;$1")),{attr:e,name:i,value:o}}function wv(e,t,n,r,i){const o=e.name;let a=e.value;const s=e.attr;let u,c,l=s.quote;if(void 0===a||n.removeAttributeQuotes&&!~a.indexOf(i)&&/^[^ \t\n\f\r"'`=<>]+$/.test(a))c=!r||t||/\/$/.test(a)?a+" ":a;else{if(!n.preventAttributesEscaping){if(void 0===n.quoteCharacter){l=(a.match(/'/g)||[]).length<(a.match(/"/g)||[]).length?"'":'"'}else l="'"===n.quoteCharacter?"'":'"';a='"'===l?a.replace(/"/g,"&#34;"):a.replace(/'/g,"&#39;")}c=l+a+l,r||n.removeTagWhitespace||(c+=" ")}return void 0===a||n.collapseBooleanAttributes&&function(e,t){return ZE.has(e)||"draggable"===e&&!JE.has(t)}(o.toLowerCase(),a.toLowerCase())?(u=o,r||(u+=" ")):u=o+s.customAssign+c,s.customOpen+u+s.customClose}function Rv(e){return e}function Tv(e){return Promise.resolve(e)}const Ov=e=>{const t={name:function(e){return e.toLowerCase()},canCollapseWhitespace:Sv,canTrimWhitespace:Cv,html5:!0,ignoreCustomComments:[/^!/,/^\s*#/],ignoreCustomFragments:[/<%[\s\S]*?%>/,/<\?[\s\S]*?\?>/],includeAutoGeneratedTags:!0,log:Rv,minifyCSS:Tv,minifyJS:Rv,minifyURLs:Rv};return Object.keys(e).forEach(function(n){const r=e[n];if("caseSensitive"===n)r&&(t.name=Rv);else if("log"===n)"function"==typeof r&&(t.log=r);else if("minifyCSS"===n&&"function"!=typeof r){if(!r)return;const e="object"==typeof r?r:{};t.minifyCSS=async function(n,r){const i=rv(n=await hE(n,/(url\s*\(\s*)(?:"([^"]*)"|'([^']*)'|([^\s)]+))(\s*\))/gi,async function(e,n,r,i,o,a){const s=null!=r?'"':null!=i?"'":"",u=r??i??o??"";try{const e=await t.minifyURLs(u);return n+s+("string"==typeof e?e:u)+s+a}catch(n){return t.log&&t.log(n),e}}),r);return new Promise(o=>{new Ll(e).minify(i,(e,i)=>{i.errors.length>0&&(i.errors.forEach(t.log),o(n));const a=function(e,t){let n;switch(t){case"inline":n=e.match(/^\*\{([\s\S]*)\}$/);break;case"media":n=e.match(/^@media ([\s\S]*?)\s*{[\s\S]*}$/)}return n?n[1]:e}(i.styles,r);o(a)})})}}else if("minifyJS"===n&&"function"!=typeof r){if(!r)return;const e="object"==typeof r?r:{};e.parse={...e.parse,bare_returns:!1},t.minifyJS=async function(n,r){const i=n.match(/^\s*<!--.*/),o=i?n.slice(i[0].length).replace(/\n\s*-->\s*$/,""):n;e.parse.bare_returns=r;try{const t=await async function(e,t){const n=dE(e,t);let r,i;do{i=n.next(await r),r=i.value}while(!i.done);return i.value}(o,e);return t.code.replace(/;$/,"")}catch(e){return t.log(e),n}}}else if("minifyURLs"===n&&"function"!=typeof r){if(!r)return;let e=r;"string"==typeof r?e={site:r}:"object"!=typeof r&&(e={}),t.minifyURLs=function(n){try{return Hf.relate(n,e)}catch(e){return t.log(e),n}}}else t[n]=r}),t};function Iv(e){let t;do{t=Math.random().toString(36).replace(/^0\.[0-9]*/,"")}while(~e.indexOf(t));return t}const kv=new Set(["script","style"]);async function Fv(e,t,n){if(t.maxInputLength&&e.length>t.maxInputLength)throw new Error(`Input length (${e.length}) exceeds maximum allowed length (${t.maxInputLength})`);t.collapseWhitespace&&(e=PE(e,t,!0,!0));const r=[];let i,o,a="",s="",u=[];const c=[],l=[];let f="",p="";const d=[],h=[];let A,m,g;const _=t.inlineCustomElements??[],E=(Array.isArray(_)?_:Array.from(_)).map(e=>t.name(e)),v=new Set([...VE,...E]),b=new Set([...UE,...E]);e=e.replace(/<!-- htmlmin:ignore -->([\s\S]*?)<!-- htmlmin:ignore -->/g,function(n,r){if(!A){A=Iv(e);const n=new RegExp("^"+A+"([0-9]+)$");t.ignoreCustomComments?t.ignoreCustomComments=t.ignoreCustomComments.slice():t.ignoreCustomComments=[],t.ignoreCustomComments.push(n)}const i="\x3c!--"+A+d.length+"--\x3e";return d.push(r),i});const y=t.ignoreCustomFragments.map(function(e){return e.source});if(y.length){for(let e=0;e<y.length;e++)if(/[*+]/.test(y[e])){t.log("Warning: Custom fragment contains unlimited quantifiers (* or +) which may cause ReDoS vulnerability");break}const n=t.customFragmentQuantifierLimit||200,r=`\\s{0,${n}}`,i=new RegExp(r+"(?:"+y.join("|")+"){1,"+n+"}"+r,"g");e=e.replace(i,function(n){var r;m||(m=Iv(e),g=new RegExp("(\\s*)"+m+"([0-9]+)"+m+"(\\s*)","g"),t.minifyCSS&&(t.minifyCSS=(r=t.minifyCSS,function(e,t){e=e.replace(g,function(e,t,n){const r=h[+n];return r[1]+m+n+m+r[2]});const n=[];return(new Ll).minify(rv(e,t)).warnings.forEach(function(t){const r=g.exec(t);if(r){const t=m+r[2]+m;e=e.replace(t,nv(t)),n.push(t)}}),r(e,t).then(e=>(n.forEach(function(t){e=e.replace(nv(t),t)}),e))})),t.minifyJS&&(t.minifyJS=function(e){return function(t,n){return e(t.replace(g,function(e,t,n){const r=h[+n];return r[1]+m+n+m+r[2]}),n)}}(t.minifyJS)));const i=m+h.length+m;return h.push(/^(\s*)[\s\S]*?(\s*)$/.exec(n)),"\t"+i+"\t"})}function S(e,n){return t.canTrimWhitespace(e,n,Cv)}function C(){let e=r.length-1;for(;e>0&&!/^<[^/!]/.test(r[e]);)e--;r.length=Math.max(0,e)}function D(){let e=r.length-1;for(;e>0&&!/^<\//.test(r[e]);)e--;r.length=Math.max(0,e)}function w(e,n){for(let i=null;e>=0&&S(i);e--){const o=r[e],a=o.match(/^<\/([\w:-]+)>$/);if(a)i=a[1];else if(/>$/.test(o)||(r[e]=GE(o,null,n,t,b,v)))break}}function R(e){let t=r.length-1;if(r.length>1){const e=r[r.length-1];/^(?:<!|$)/.test(e)&&-1===e.indexOf(A)&&t--}w(t,e)}(t.sortAttributes&&"function"!=typeof t.sortAttributes||t.sortClassName&&"function"!=typeof t.sortClassName)&&await async function(e,t,n,r){const i=t.sortAttributes&&Object.create(null),o=t.sortClassName&&new ME;function a(e){return e.map(function(e){return t.name(e.name)})}function s(e,t){return!t||-1===e.indexOf(t)}function u(e){return s(e,n)&&s(e,r)}const c=t.log;if(t.log=Rv,t.sortAttributes=!1,t.sortClassName=!1,await async function e(n){let r,s;const c=new xE(n,{start:function(e,n){i&&(i[e]||(i[e]=new ME),i[e].add(a(n).filter(u)));for(let i=0,a=n.length;i<a;i++){const a=n[i];o&&a.value&&"class"===t.name(a.name)?o.add(NE(a.value).split(/[ \t\n\f\r]+/).filter(u)):t.processScripts&&"type"===a.name.toLowerCase()&&(r=e,s=a.value)}},end:function(){r=""},chars:async function(n){t.processScripts&&kv.has(r)&&t.processScripts.indexOf(s)>-1&&await e(n)}});await c.parse()}(await Fv(e,t)),t.log=c,i){const e=Object.create(null);for(const t in i)e[t]=i[t].createSorter();t.sortAttributes=function(t,n){const r=e[t];if(r){const e=Object.create(null),t=a(n);t.forEach(function(t,r){(e[t]||(e[t]=[])).push(n[r])}),r.sort(t).forEach(function(t,r){n[r]=e[t].shift()})}}}if(o){const e=o.createSorter();t.sortClassName=function(t){return e.sort(t.split(/[ \n\f\r]+/)).join(" ")}}}(e,t,A,m);const T=new xE(e,{partialMarkup:n,continueOnParseError:t.continueOnParseError,customAttrAssign:t.customAttrAssign,customAttrSurround:t.customAttrSurround,html5:t.html5,start:async function(e,n,d,h,A){"svg"===e.toLowerCase()&&((t=Object.create(t)).caseSensitive=!0,t.keepClosingSlash=!0,t.name=Rv),e=t.name(e),s=e,i=e,v.has(e)||(a=""),o=!1,u=n;let g=t.removeOptionalTags;if(g){const t=vv.has(e);t&&function(e,t){switch(e){case"html":case"head":return!0;case"body":return!av.has(t);case"colgroup":return"col"===t;case"tbody":return"tr"===t}return!1}(f,e)&&C(),f="",t&&function(e,t){switch(e){case"html":case"head":case"body":case"colgroup":case"caption":return!0;case"li":case"optgroup":case"tr":return t===e;case"dt":case"dd":return sv.has(t);case"p":return uv.has(t);case"rb":case"rt":case"rp":return lv.has(t);case"rtc":return fv.has(t);case"option":return pv.has(t);case"thead":case"tbody":return dv.has(t);case"tfoot":return"tbody"===t;case"td":case"th":return Av.has(t)}return!1}(p,e)&&(D(),g=!function(e,t){switch(t){case"colgroup":return"colgroup"===e;case"tbody":return hv.has(e)}return!1}(p,e)),p=""}t.collapseWhitespace&&(c.length||R(e),d||(S(e,n)&&!c.length||c.push(e),function(e,n){return t.canCollapseWhitespace(e,n,Sv)}(e,n)&&!l.length||l.push(e)));const _="<"+e,E=h&&t.keepClosingSlash;r.push(_),t.sortAttributes&&t.sortAttributes(e,n);const b=[];for(let r=n.length,i=!0;--r>=0;){const o=await Dv(n[r],n,e,t);o&&(b.unshift(wv(o,E,t,i,m)),i=!1)}b.length>0?(r.push(" "),r.push.apply(r,b)):g&&iv.has(e)&&(f=e),r.push(r.pop()+(E?"/":"")+">"),A&&!t.includeAutoGeneratedTags&&(C(),f="")},end:function(e,n,u){"svg"===e.toLowerCase()&&(t=Object.getPrototypeOf(t)),e=t.name(e),t.collapseWhitespace&&(c.length?e===c[c.length-1]&&c.pop():R("/"+e),l.length&&e===l[l.length-1]&&l.pop());let d=!1;e===s&&(s="",d=!o),t.removeOptionalTags&&(d&&mv.has(f)&&C(),f="",!vv.has(e)||!p||Ev.has(p)||"p"===p&&cv.has(e)||D(),p=ov.has(e)?e:""),t.removeEmptyElements&&d&&function(e,t){switch(e){case"textarea":return!1;case"audio":case"script":case"video":if(yv("src",t))return!1;break;case"iframe":if(yv("src",t)||yv("srcdoc",t))return!1;break;case"object":if(yv("data",t))return!1;break;case"applet":if(yv("code",t))return!1}return!0}(e,n)?(C(),f="",p=""):(u&&!t.includeAutoGeneratedTags?p="":r.push("</"+e+">"),i="/"+e,b.has(e)?d&&(a+="|"):a="")},chars:async function(e,n,d){if(n=""===n?"comment":n,d=""===d?"comment":d,t.decodeEntities&&e&&!kv.has(s)&&(e=function(e,t=Ql.Legacy){return Jl(e,t)}(e)),t.collapseWhitespace){if(!c.length){if("comment"===n){const o=r[r.length-1];if(-1===o.indexOf(A)&&(o||(n=i),r.length>1&&(!o||!t.conservativeCollapse&&/ $/.test(a)))){const t=r.length-2;r[t]=r[t].replace(/\s+$/,function(t){return e=t+e,""})}}if(n)if("/nobr"===n||"wbr"===n){if(/^\s/.test(e)){let e=r.length-1;for(;e>0&&0!==r[e].lastIndexOf("<"+n);)e--;w(e-1,"br")}}else v.has("/"===n.charAt(0)?n.slice(1):n)&&(e=PE(e,t,/(?:^|\s)$/.test(a)));!(e=n||d?GE(e,n,d,t,b,v):PE(e,t,!0,!0))&&/\s$/.test(a)&&n&&"/"===n.charAt(0)&&w(r.length-1,d)}l.length||"html"===d||n&&d||(e=PE(e,t,!1,!1,!0))}t.processScripts&&kv.has(s)&&(e=await async function(e,t,n){for(let r=0,i=n.length;r<i;r++)if("type"===n[r].name.toLowerCase()&&t.processScripts.indexOf(n[r].value)>-1)return await Fv(e,t);return e}(e,t,u)),function(e,t){if("script"!==e)return!1;for(let e=0,n=t.length;e<n;e++)if("type"===t[e].name.toLowerCase())return QE(t[e].value);return!0}(s,u)&&(e=await t.minifyJS(e)),qE(s,u)&&(e=await t.minifyCSS(e)),t.removeOptionalTags&&e&&(("html"===f||"body"===f&&!/^\s/.test(e))&&C(),f="",(gv.has(p)||_v.has(p)&&!/^\s/.test(e))&&D(),/^\s+$/.test(e)&&t.collapseWhitespace&&!t.conservativeCollapse||(p="")),i=/^\s*$/.test(e)?n:"comment",t.decodeEntities&&e&&!kv.has(s)&&(e=e.replace(/&((?:Iacute|aacute|uacute|plusmn|Otilde|otilde|agrave|Agrave|Yacute|yacute|Oslash|oslash|atilde|Atilde|brvbar|ccedil|Ccedil|Ograve|curren|divide|eacute|Eacute|ograve|Oacute|egrave|Egrave|Ugrave|frac12|frac14|frac34|ugrave|oacute|iacute|Ntilde|ntilde|Uacute|middot|igrave|Igrave|iquest|Aacute|cedil|laquo|micro|iexcl|Icirc|icirc|acirc|Ucirc|Ecirc|ocirc|Ocirc|ecirc|ucirc|Aring|aring|AElig|aelig|acute|pound|raquo|Acirc|times|THORN|szlig|thorn|COPY|auml|ordf|ordm|Uuml|macr|uuml|Auml|ouml|Ouml|para|nbsp|euml|quot|QUOT|Euml|yuml|cent|sect|copy|sup1|sup2|sup3|iuml|Iuml|ETH|shy|reg|not|yen|amp|AMP|REG|uml|eth|deg|gt|GT|LT|lt)(?!;)|(?:#?[0-9a-zA-Z]+;))/g,"&amp$1").replace(/</g,"&lt;")),g&&t.collapseWhitespace&&c.length&&(e=e.replace(g,function(e,t,n){return h[+n][0]})),a+=e,e&&(o=!0),r.push(e)},comment:async function(e,n){const i=n?"<!":"\x3c!--",o=n?">":"--\x3e";e=function(e){return/^\[if\s[^\]]+]|\[endif]$/.test(e)}(e)?i+await async function(e,t){return t.processConditionalComments?await hE(e,/^(\[if\s[^\]]+]>)([\s\S]*?)(<!\[endif])$/,async function(e,n,r,i){return n+await Fv(r,t,!0)+i}):e}(e,t)+o:t.removeComments?function(e,t){for(let n=0,r=t.ignoreCustomComments.length;n<r;n++)if(t.ignoreCustomComments[n].test(e))return!0;return!1}(e,t)?"\x3c!--"+e+"--\x3e":"":i+e+o,t.removeOptionalTags&&e&&(f="",p=""),r.push(e)},doctype:function(e){r.push(t.useShortDoctype?"<!doctype"+(t.removeTagWhitespace?"":" ")+"html>":LE(e))}});return await T.parse(),t.removeOptionalTags&&(mv.has(f)&&C(),p&&!Ev.has(p)&&D()),t.collapseWhitespace&&R("br"),function(e,t,n,r){let i;const o=t.maxLineLength,a=t.noNewlinesBeforeTagClose;if(o){let t="";const s=[];for(;e.length;){const i=t.length,u=e[0].indexOf("\n"),c=Boolean(e[0].match(yE)),l=a&&c;u<0?t+=r(n(e.shift())):(t+=r(n(e[0].slice(0,u))),e[0]=e[0].slice(u+1)),i>0&&t.length>o&&!l?(s.push(t.slice(0,i)),t=t.slice(i)):u>=0&&(s.push(t),t="")}t&&s.push(t),i=s.join("\n")}else i=r(n(e.join("")));return t.collapseWhitespace?PE(i,t,!0,!0):i}(r,t,g?function(e){return e.replace(g,function(e,n,r,i){let o=h[+r][0];return t.collapseWhitespace?("\t"!==n&&(o=n+o),"\t"!==i&&(o+=i),PE(o,{preserveLineBreaks:t.preserveLineBreaks,conservativeCollapse:!t.trimCustomFragments},/^[ \n\r\t\f]/.test(o),/[ \n\r\t\f]$/.test(o))):o})}:Rv,A?function(e){return e.replace(new RegExp("\x3c!--"+A+"([0-9]+)--\x3e","g"),function(e,t){return d[+t]})}:Rv)}const xv=async function(e,t){const n=Date.now();t=Ov(t||{});const r=await Fv(e,t);return t.log("minified in: "+(Date.now()-n)+"ms"),r};var Bv={minify:xv};e.default=Bv,e.minify=xv,Object.defineProperty(e,"__esModule",{value:!0})});
9
+ */class AE extends Set{has(e){return super.has(e.toLowerCase())}}const mE=/([^\s"'<>/=]+)/,gE=[/=/],_E=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^ \t\n\f\r"'`=<>]+)/.source],EE=function(){const e="A-Za-z\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u0131\\u0134-\\u013E\\u0141-\\u0148\\u014A-\\u017E\\u0180-\\u01C3\\u01CD-\\u01F0\\u01F4\\u01F5\\u01FA-\\u0217\\u0250-\\u02A8\\u02BB-\\u02C1\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03CE\\u03D0-\\u03D6\\u03DA\\u03DC\\u03DE\\u03E0\\u03E2-\\u03F3\\u0401-\\u040C\\u040E-\\u044F\\u0451-\\u045C\\u045E-\\u0481\\u0490-\\u04C4\\u04C7\\u04C8\\u04CB\\u04CC\\u04D0-\\u04EB\\u04EE-\\u04F5\\u04F8\\u04F9\\u0531-\\u0556\\u0559\\u0561-\\u0586\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u063A\\u0641-\\u064A\\u0671-\\u06B7\\u06BA-\\u06BE\\u06C0-\\u06CE\\u06D0-\\u06D3\\u06D5\\u06E5\\u06E6\\u0905-\\u0939\\u093D\\u0958-\\u0961\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8B\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AE0\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B36-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB5\\u0BB7-\\u0BB9\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D60\\u0D61\\u0E01-\\u0E2E\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E45\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD\\u0EAE\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0F40-\\u0F47\\u0F49-\\u0F69\\u10A0-\\u10C5\\u10D0-\\u10F6\\u1100\\u1102\\u1103\\u1105-\\u1107\\u1109\\u110B\\u110C\\u110E-\\u1112\\u113C\\u113E\\u1140\\u114C\\u114E\\u1150\\u1154\\u1155\\u1159\\u115F-\\u1161\\u1163\\u1165\\u1167\\u1169\\u116D\\u116E\\u1172\\u1173\\u1175\\u119E\\u11A8\\u11AB\\u11AE\\u11AF\\u11B7\\u11B8\\u11BA\\u11BC-\\u11C2\\u11EB\\u11F0\\u11F9\\u1E00-\\u1E9B\\u1EA0-\\u1EF9\\u1F00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2126\\u212A\\u212B\\u212E\\u2180-\\u2182\\u3007\\u3021-\\u3029\\u3041-\\u3094\\u30A1-\\u30FA\\u3105-\\u312C\\u4E00-\\u9FA5\\uAC00-\\uD7A3",t="["+e+"_]["+e+"0-9\\u0660-\\u0669\\u06F0-\\u06F9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE7-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\.\\-_\\u0300-\\u0345\\u0360\\u0361\\u0483-\\u0486\\u0591-\\u05A1\\u05A3-\\u05B9\\u05BB-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u064B-\\u0652\\u0670\\u06D6-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0901-\\u0903\\u093C\\u093E-\\u094D\\u0951-\\u0954\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A02\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A70\\u0A71\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B43\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B82\\u0B83\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C01-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C82\\u0C83\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D43\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86-\\u0F8B\\u0F90-\\u0F95\\u0F97\\u0F99-\\u0FAD\\u0FB1-\\u0FB7\\u0FB9\\u20D0-\\u20DC\\u20E1\\u302A-\\u302F\\u3099\\u309A\\xB7\\u02D0\\u02D1\\u0387\\u0640\\u0E46\\u0EC6\\u3005\\u3031-\\u3035\\u309D\\u309E\\u30FC-\\u30FE]*";return"((?:"+t+"\\:)?"+t+")"}(),vE=new RegExp("^<"+EE),bE=/^\s*(\/?)>/,yE=new RegExp("^<\\/"+EE+"[^>]*>"),SE=/^<!DOCTYPE\s?[^>]+>/i;let CE=!1;"x".replace(/x(.)?/g,function(e,t){CE=""===t});const DE=new AE(["area","base","basefont","br","col","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),wE=new AE(["a","abbr","acronym","applet","b","basefont","bdo","big","br","button","cite","code","del","dfn","em","font","i","iframe","img","input","ins","kbd","label","map","noscript","object","q","s","samp","script","select","selectedcontent","small","span","strike","strong","sub","sup","svg","textarea","tt","u","var"]),RE=new AE(["colgroup","dd","dt","li","option","p","td","tfoot","th","thead","tr","source"]),TE=new AE(["checked","compact","declare","defer","disabled","ismap","multiple","nohref","noresize","noshade","nowrap","readonly","selected"]),OE=new AE(["script","style"]),IE=new AE(["address","article","aside","base","blockquote","body","caption","col","colgroup","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","legend","li","menuitem","meta","ol","optgroup","option","param","rp","rt","source","style","summary","tbody","td","tfoot","th","thead","title","tr","track","ul"]),kE={};function FE(e){let t=mE.source+"(?:\\s*("+function(e){return gE.concat(e.customAttrAssign||[]).map(function(e){return"(?:"+e.source+")"}).join("|")}(e)+")[ \\t\\n\\f\\r]*(?:"+_E.join("|")+"))?";if(e.customAttrSurround){const n=[];for(let r=e.customAttrSurround.length-1;r>=0;r--)n[r]="(?:("+e.customAttrSurround[r][0].source+")\\s*"+t+"\\s*("+e.customAttrSurround[r][1].source+"))";n.push("(?:"+t+")"),t="(?:"+n.join("|")+")"}return new RegExp("^\\s*"+t)}class xE{constructor(e,t){this.html=e,this.handler=t}async parse(){let e=this.html;const t=this.handler,n=[];let r;const i=FE(t);let o,a,s;for(;e;){if(o=e,r&&OE.has(r)){const n=r.toLowerCase(),i=kE[n]||(kE[n]=new RegExp("([\\s\\S]*?)</"+n+"[^>]*>","i"));e=await hE(e,i,async(e,r)=>("script"!==n&&"style"!==n&&"noscript"!==n&&(r=r.replace(/<!--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),t.chars&&await t.chars(r),"")),await p("</"+n+">",n)}else{let n,r=e.indexOf("<");if(0===r){if(/^<!--/.test(e)){const n=e.indexOf("--\x3e");if(n>=0){t.comment&&await t.comment(e.substring(4,n)),e=e.substring(n+3),a="";continue}}if(/^<!\[/.test(e)){const n=e.indexOf("]>");if(n>=0){t.comment&&await t.comment(e.substring(2,n+1),!0),e=e.substring(n+2),a="";continue}}const n=e.match(SE);if(n){t.doctype&&t.doctype(n[0]),e=e.substring(n[0].length),a="";continue}const i=e.match(yE);if(i){e=e.substring(i[0].length),await hE(i[0],yE,p),a="/"+i[1].toLowerCase();continue}const o=u(e);if(o){e=o.rest,await l(o),a=o.tagName.toLowerCase();continue}t.continueOnParseError&&(r=e.indexOf("<",1))}r>=0?(n=e.substring(0,r),e=e.substring(r)):(n=e,e="");let i=u(e);i?s=i.tagName:(i=e.match(yE),s=i?"/"+i[1]:""),t.chars&&await t.chars(n,a,s),a=""}if(e===o)throw new Error("Parse Error: "+e)}function u(e){const t=e.match(vE);if(t){const n={tagName:t[1],attrs:[]};let r,o;for(e=e.slice(t[0].length);!(r=e.match(bE))&&(o=e.match(i));)e=e.slice(o[0].length),n.attrs.push(o);if(r)return n.unarySlash=r[1],n.rest=e.slice(r[0].length),n}}async function c(e){const i=function(e){let t;const r=e.toLowerCase();for(t=n.length-1;t>=0;t--){const e=n[t].tag.toLowerCase();if(e===r)return t;if("table"===e)break}return-1}(e);return i>=0&&(await async function(e){for(let r=n.length-1;r>=e;r--)t.end&&await t.end(n[r].tag,n[r].attrs,!0);n.length=e,r=e&&n[e-1].tag}(i),!0)}async function l(e){const i=e.tagName;let o=e.unarySlash;if(t.html5&&("p"===r&&IE.has(i)?await p("",r):"tbody"===i?await c("thead"):"tfoot"===i?await c("tbody")||await c("thead"):"thead"===i&&(await c("tbody")||await c("tfoot")),"col"===i&&f("colgroup")<0&&(r="colgroup",n.push({tag:r,attrs:[]}),t.start&&await t.start(r,[],!1,""))),!t.html5&&!wE.has(i))for(;r&&wE.has(r);)await p("",r);RE.has(i)&&r===i&&await p("",i),"dt"!==i&&"dd"!==i||"dt"!==r&&"dd"!==r||await p("",r);const a=DE.has(i)||"html"===i&&"head"===r||!!o,s=e.attrs.map(function(e){let n,r,i,o,a,s;function u(t){return a=e[t],r=e[t+1],void 0!==r?'"':(r=e[t+2],void 0!==r?"'":(r=e[t+3],void 0===r&&TE.has(n)&&(r=n),""))}CE&&-1===e[0].indexOf('""')&&(""===e[3]&&delete e[3],""===e[4]&&delete e[4],""===e[5]&&delete e[5]);let c=1;if(t.customAttrSurround)for(let r=0,a=t.customAttrSurround.length;r<a;r++,c+=7)if(n=e[c+1],n){s=u(c+2),i=e[c],o=e[c+6];break}return!n&&(n=e[c])&&(s=u(c+1)),{name:n,value:r,customAssign:a||"=",customOpen:i||"",customClose:o||"",quote:s||""}});a||(n.push({tag:i,attrs:s}),r=i,o=""),t.start&&await t.start(i,s,a,o)}function f(e){let t;const r=e.toLowerCase();for(t=n.length-1;t>=0&&n[t].tag.toLowerCase()!==r;t--);return t}async function p(e,i){let o;if(o=i?f(i):0,o>=0){for(let r=n.length-1;r>=o;r--)t.end&&t.end(n[r].tag,n[r].attrs,r>o||!e);n.length=o,r=o&&n[o-1].tag}else"br"===i.toLowerCase()?t.start&&await t.start(i,[],!0,""):"p"===i.toLowerCase()&&(t.start&&await t.start(i,[],!1,"",!0),t.end&&t.end(i,[]))}t.partialMarkup||await p()}}class BE{sort(e,t=0){for(let n=0,r=this.keys.length;n<r;n++){const r=this.keys[n],i=r.slice(1);let o=e.indexOf(i,t);if(-1!==o){do{o!==t&&(e.splice(o,1),e.splice(t,0,i)),t++}while(-1!==(o=e.indexOf(i,t)));return this[r].sort(e,t)}}return e}}class ME{add(e){e.forEach(t=>{const n="$"+t;this[n]||(this[n]=[],this[n].processed=0),this[n].push(e)})}createSorter(){const e=new BE;return e.keys=Object.keys(this).sort((e,t)=>{const n=this[e].length,r=this[t].length;return n<r?1:n>r||e<t?-1:e>t?1:0}).filter(t=>{if(this[t].processed<this[t].length){const n=t.slice(1),r=new ME;return this[t].forEach(e=>{let t;for(;-1!==(t=e.indexOf(n));)e.splice(t,1);e.forEach(e=>{this["$"+e].processed++}),r.add(e.slice(0))}),e[t]=r.createSorter(),!0}return!1}),e}}const NE=e=>e&&e.replace(/^[ \n\r\t\f]+/,"").replace(/[ \n\r\t\f]+$/,"");function LE(e){return e&&e.replace(/[ \n\r\t\f\xA0]+/g,function(e){return"\t"===e?"\t":e.replace(/(^|\xA0+)[^\xA0]+/g,"$1 ")})}function PE(e,t,n,r,i){let o="",a="";return t.preserveLineBreaks&&(e=e.replace(/^[ \n\r\t\f]*?[\n\r][ \n\r\t\f]*/,function(){return o="\n",""}).replace(/[ \n\r\t\f]*?[\n\r][ \n\r\t\f]*$/,function(){return a="\n",""})),n&&(e=e.replace(/^[ \n\r\t\f\xA0]+/,function(e){const n=!o&&t.conservativeCollapse;return n&&"\t"===e?"\t":e.replace(/^[^\xA0]+/,"").replace(/(\xA0+)[^\xA0]+/g,"$1 ")||(n?" ":"")})),r&&(e=e.replace(/[ \n\r\t\f\xA0]+$/,function(e){const n=!a&&t.conservativeCollapse;return n&&"\t"===e?"\t":e.replace(/[^\xA0]+(\xA0+)/g," $1").replace(/[^\xA0]+$/,"")||(n?" ":"")})),i&&(e=LE(e)),o+e+a}const UE=["a","abbr","acronym","b","bdi","bdo","big","button","cite","code","del","dfn","em","font","i","img","input","ins","kbd","label","mark","math","meter","nobr","object","output","progress","q","rb","rp","rt","rtc","ruby","s","samp","select","small","span","strike","strong","sub","sup","svg","textarea","time","tt","u","var","wbr"],VE=new Set(["a","abbr","acronym","b","big","del","em","font","i","ins","kbd","mark","nobr","s","samp","small","span","strike","strong","sub","sup","time","tt","u","var"]),KE=new Set(["comment","img","input","wbr"]);function GE(e,t,n,r,i,o){let a=t&&!KE.has(t);a&&!r.collapseInlineTagWhitespace&&(a="/"===t.charAt(0)?!i.has(t.slice(1)):!o.has(t));let s=n&&!KE.has(n);return s&&!r.collapseInlineTagWhitespace&&(s="/"===n.charAt(0)?!o.has(n.slice(1)):!i.has(n)),PE(e,r,a,s,t&&n)}function HE(e,t){for(let n=e.length;n--;)if(e[n].name.toLowerCase()===t)return!0;return!1}const WE={autocorrect:"on",fetchpriority:"auto",loading:"eager",popovertargetaction:"toggle"},zE={area:{shape:"rect"},button:{type:"submit"},form:{enctype:"application/x-www-form-urlencoded",method:"get"},html:{dir:"ltr"},img:{decoding:"auto"},input:{colorspace:"limited-srgb",type:"text"},marquee:{behavior:"scroll",direction:"left"},style:{media:"all"},textarea:{wrap:"soft"},track:{kind:"subtitles"}};const YE=new Set(["text/javascript","text/ecmascript","text/jscript","application/javascript","application/x-javascript","application/ecmascript","module"]),XE=new Set(["module"]);function QE(e=""){return""===(e=NE(e.split(/;/,2)[0]).toLowerCase())||YE.has(e)}function jE(e=""){return""===(e=NE(e).toLowerCase())||"text/css"===e}function qE(e,t){if("style"!==e)return!1;for(let e=0,n=t.length;e<n;e++){if("type"===t[e].name.toLowerCase())return jE(t[e].value)}return!0}const ZE=new Set(["allowfullscreen","async","autofocus","autoplay","checked","compact","controls","declare","default","defaultchecked","defaultmuted","defaultselected","defer","disabled","enabled","formnovalidate","hidden","indeterminate","inert","ismap","itemscope","loop","multiple","muted","nohref","noresize","noshade","novalidate","nowrap","open","pauseonexit","readonly","required","reversed","scoped","seamless","selected","sortable","truespeed","typemustmatch","visible"]),JE=new Set(["true","false"]);function $E(e,t,n){if("link"!==e)return!1;const r=String(n).toLowerCase();for(let e=0;e<t.length;e++)if("rel"===t[e].name.toLowerCase()){if(String(t[e].value).toLowerCase().split(/\s+/).includes(r))return!0}return!1}const ev=new Set(["img","source"]);async function tv(e,t,n,r,i,o){if(function(e,t){const n=t.customEventAttributes;if(n){for(let t=n.length;t--;)if(n[t].test(e))return!0;return!1}return/^on[a-z]{3,}$/.test(e)}(t,r))return n=NE(n).replace(/^javascript:\s*/i,""),r.minifyJS(n,!0);if("class"===t)return n=NE(n),n=r.sortClassName?r.sortClassName(n):LE(n);if(function(e,t){return/^(?:a|area|link|base)$/.test(t)&&"href"===e||"img"===t&&/^(?:src|longdesc|usemap)$/.test(e)||"object"===t&&/^(?:classid|codebase|data|usemap)$/.test(e)||"q"===t&&"cite"===e||"blockquote"===t&&"cite"===e||("ins"===t||"del"===t)&&"cite"===e||"form"===t&&"action"===e||"input"===t&&("src"===e||"usemap"===e)||"head"===t&&"profile"===e||"script"===t&&("src"===e||"for"===e)}(t,e)){if(n=NE(n),$E(e,i,"canonical"))return n;try{const e=await r.minifyURLs(n);return"string"==typeof e?e:n}catch(e){return r.log&&r.log(e),n}}else{if(function(e,t){return/^(?:a|area|object|button)$/.test(t)&&"tabindex"===e||"input"===t&&("maxlength"===e||"tabindex"===e)||"select"===t&&("size"===e||"tabindex"===e)||"textarea"===t&&/^(?:rows|cols|tabindex)$/.test(e)||"colgroup"===t&&"span"===e||"col"===t&&"span"===e||("th"===t||"td"===t)&&("rowspan"===e||"colspan"===e)}(t,e))return NE(n);if("style"===t)return(n=NE(n))&&(/;$/.test(n)&&!/&#?[0-9a-zA-Z]+;$/.test(n)&&(n=n.replace(/\s*;$/,";")),n=await r.minifyCSS(n,"inline")),n;if(function(e,t){return"srcset"===e&&ev.has(t)}(t,e))n=(await Promise.all(NE(n).split(/\s+,\s*|\s*,\s+/).map(async function(e){let t=e,n="";const i=e.match(/\s+([1-9][0-9]*w|[0-9]+(?:\.[0-9]+)?x)$/);if(i){t=t.slice(0,-i[0].length);const e=+i[1].slice(0,-1),r=i[1].slice(-1);1===e&&"x"===r||(n=" "+e+r)}try{const e=await r.minifyURLs(t);return("string"==typeof e?e:t)+n}catch(e){return r.log&&r.log(e),t+n}}))).join(", ");else if(function(e,t){if("meta"!==e)return!1;for(let e=0,n=t.length;e<n;e++)if("name"===t[e].name&&"viewport"===t[e].value)return!0}(e,i)&&"content"===t)n=n.replace(/\s+/g,"").replace(/[0-9]+\.[0-9]+/g,function(e){return(+e).toString()});else{if(function(e,t){if("meta"!==e)return!1;for(let e=0,n=t.length;e<n;e++)if("http-equiv"===t[e].name.toLowerCase()&&"content-security-policy"===t[e].value.toLowerCase())return!0}(e,i)&&"content"===t.toLowerCase())return LE(n);if(r.customAttrCollapse&&r.customAttrCollapse.test(t))n=NE(n.replace(/ ?[\n\r]+ ?/g,"").replace(/\s{2,}/g,r.conservativeCollapse?" ":""));else if("script"===e&&"type"===t)n=NE(n.replace(/\s*;\s*/g,";"));else{if(function(e,t,n){return"media"===n&&($E(e,t,"stylesheet")||qE(e,t))}(e,i,t))return n=NE(n),r.minifyCSS(n,"media");if("iframe"===e&&"srcdoc"===t)return function(e){return Boolean(e.collapseWhitespace||e.removeComments||e.removeOptionalTags||e.minifyJS!==Rv||e.minifyCSS!==Tv||e.minifyURLs!==Rv)}(r)?o(n,r,!0):n}}}return n}function nv(e){return"/* clean-css ignore:start */"+e+"/* clean-css ignore:end */"}function rv(e,t){switch(t){case"inline":return"*{"+e+"}";case"media":return"@media "+e+"{a{top:0}}";default:return e}}const iv=new Set(["html","head","body","colgroup","tbody"]),ov=new Set(["html","head","body","li","dt","dd","p","rb","rt","rtc","rp","optgroup","option","colgroup","caption","thead","tbody","tfoot","tr","td","th"]),av=new Set(["meta","link","script","style","template","noscript"]),sv=new Set(["dt","dd"]),uv=new Set(["address","article","aside","blockquote","details","dialog","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","menu","nav","ol","p","pre","search","section","table","ul"]),cv=new Set(["a","audio","del","ins","map","noscript","video"]),lv=new Set(["rb","rt","rtc","rp"]),fv=new Set(["rb","rtc"]),pv=new Set(["option","optgroup"]),dv=new Set(["tbody","tfoot"]),hv=new Set(["thead","tbody","tfoot"]),Av=new Set(["td","th"]),mv=new Set(["html","head","body"]),gv=new Set(["html","body"]),_v=new Set(["head","colgroup","caption"]),Ev=new Set(["dt","thead"]),vv=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","menu","menuitem","meta","meter","multicol","nav","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","search","section","select","selectedcontent","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]);const bv=new RegExp("^(?:class|id|style|title|lang|dir|on(?:focus|blur|change|click|dblclick|mouse(?:down|up|over|move|out)|key(?:press|down|up)))$");function yv(e,t){for(let n=t.length-1;n>=0;n--)if(t[n].name===e)return!0;return!1}function Sv(e){return!/^(?:script|style|pre|textarea)$/.test(e)}function Cv(e){return!/^(?:pre|textarea)$/.test(e)}async function Dv(e,t,n,r){const i=r.name(e.name);let o=e.value;if(r.decodeEntities&&o&&(o=Jl(o,Ql.Strict)),!(r.removeRedundantAttributes&&function(e,t,n,r){return n=n?NE(n.toLowerCase()):"","script"===e&&"language"===t&&"javascript"===n||"script"===e&&"charset"===t&&!HE(r,"src")||!("a"!==e||"name"!==t||!HE(r,"id"))||WE[t]===n||zE[e]?.[t]===n}(n,i,o,t)||r.removeScriptTypeAttributes&&"script"===n&&"type"===i&&QE(o)&&!function(e=""){return e=NE(e.split(/;/,2)[0]).toLowerCase(),XE.has(e)}(o)||r.removeStyleLinkTypeAttributes&&("style"===n||"link"===n)&&"type"===i&&jE(o)||(o&&(o=await tv(n,i,o,r,t,Fv)),r.removeEmptyAttributes&&function(e,t,n,r){return!(n&&!/^\s*$/.test(n))&&("function"==typeof r.removeEmptyAttributes?r.removeEmptyAttributes(t,e):"input"===e&&"value"===t||bv.test(t))}(n,i,o,r))))return r.decodeEntities&&o&&(o=o.replace(/&(#?[0-9a-zA-Z]+;)/g,"&amp;$1")),{attr:e,name:i,value:o}}function wv(e,t,n,r,i){const o=e.name;let a=e.value;const s=e.attr;let u,c,l=s.quote;if(void 0===a||n.removeAttributeQuotes&&!~a.indexOf(i)&&/^[^ \t\n\f\r"'`=<>]+$/.test(a))c=!r||t||/\/$/.test(a)?a+" ":a;else{if(!n.preventAttributesEscaping){if(void 0===n.quoteCharacter){l=(a.match(/'/g)||[]).length<(a.match(/"/g)||[]).length?"'":'"'}else l="'"===n.quoteCharacter?"'":'"';a='"'===l?a.replace(/"/g,"&#34;"):a.replace(/'/g,"&#39;")}c=l+a+l,r||n.removeTagWhitespace||(c+=" ")}return void 0===a||n.collapseBooleanAttributes&&function(e,t){return ZE.has(e)||"draggable"===e&&!JE.has(t)}(o.toLowerCase(),a.toLowerCase())?(u=o,r||(u+=" ")):u=o+s.customAssign+c,s.customOpen+u+s.customClose}function Rv(e){return e}function Tv(e){return Promise.resolve(e)}const Ov=e=>{const t={name:function(e){return e.toLowerCase()},canCollapseWhitespace:Sv,canTrimWhitespace:Cv,html5:!0,ignoreCustomComments:[/^!/,/^\s*#/],ignoreCustomFragments:[/<%[\s\S]*?%>/,/<\?[\s\S]*?\?>/],includeAutoGeneratedTags:!0,log:Rv,minifyCSS:Tv,minifyJS:Rv,minifyURLs:Rv};return Object.keys(e).forEach(function(n){const r=e[n];if("caseSensitive"===n)r&&(t.name=Rv);else if("log"===n)"function"==typeof r&&(t.log=r);else if("minifyCSS"===n&&"function"!=typeof r){if(!r)return;const e="object"==typeof r?r:{};t.minifyCSS=async function(n,r){const i=rv(n=await hE(n,/(url\s*\(\s*)(?:"([^"]*)"|'([^']*)'|([^\s)]+))(\s*\))/gi,async function(e,n,r,i,o,a){const s=null!=r?'"':null!=i?"'":"",u=r??i??o??"";try{const e=await t.minifyURLs(u);return n+s+("string"==typeof e?e:u)+s+a}catch(n){return t.log&&t.log(n),e}}),r);return new Promise(o=>{new Ll(e).minify(i,(e,i)=>{i.errors.length>0&&(i.errors.forEach(t.log),o(n));const a=function(e,t){let n;switch(t){case"inline":n=e.match(/^\*\{([\s\S]*)\}$/);break;case"media":n=e.match(/^@media ([\s\S]*?)\s*{[\s\S]*}$/)}return n?n[1]:e}(i.styles,r);o(a)})})}}else if("minifyJS"===n&&"function"!=typeof r){if(!r)return;const e="object"==typeof r?r:{};e.parse={...e.parse,bare_returns:!1},t.minifyJS=async function(n,r){const i=n.match(/^\s*<!--.*/),o=i?n.slice(i[0].length).replace(/\n\s*-->\s*$/,""):n;e.parse.bare_returns=r;try{const t=await async function(e,t){const n=dE(e,t);let r,i;do{i=n.next(await r),r=i.value}while(!i.done);return i.value}(o,e);return t.code.replace(/;$/,"")}catch(e){return t.log(e),n}}}else if("minifyURLs"===n&&"function"!=typeof r){if(!r)return;let e=r;"string"==typeof r?e={site:r}:"object"!=typeof r&&(e={}),t.minifyURLs=function(n){try{return Hf.relate(n,e)}catch(e){return t.log(e),n}}}else t[n]=r}),t};function Iv(e){let t;do{t=Math.random().toString(36).replace(/^0\.[0-9]*/,"")}while(~e.indexOf(t));return t}const kv=new Set(["script","style"]);async function Fv(e,t,n){if(t.maxInputLength&&e.length>t.maxInputLength)throw new Error(`Input length (${e.length}) exceeds maximum allowed length (${t.maxInputLength})`);t.collapseWhitespace&&(e=PE(e,t,!0,!0));const r=[];let i,o,a="",s="",u=[];const c=[],l=[];let f="",p="";const d=[],h=[];let A,m,g;const _=t.inlineCustomElements??[],E=(Array.isArray(_)?_:Array.from(_)).map(e=>t.name(e)),v=new Set([...VE,...E]),b=new Set([...UE,...E]);e=e.replace(/<!-- htmlmin:ignore -->([\s\S]*?)<!-- htmlmin:ignore -->/g,function(n,r){if(!A){A=Iv(e);const n=new RegExp("^"+A+"([0-9]+)$");t.ignoreCustomComments?t.ignoreCustomComments=t.ignoreCustomComments.slice():t.ignoreCustomComments=[],t.ignoreCustomComments.push(n)}const i="\x3c!--"+A+d.length+"--\x3e";return d.push(r),i});const y=t.ignoreCustomFragments.map(function(e){return e.source});if(y.length){for(let e=0;e<y.length;e++)if(/[*+]/.test(y[e])){t.log("Warning: Custom fragment contains unlimited quantifiers (* or +) which may cause ReDoS vulnerability");break}const n=t.customFragmentQuantifierLimit||200,r=`\\s{0,${n}}`,i=new RegExp(r+"(?:"+y.join("|")+"){1,"+n+"}"+r,"g");e=e.replace(i,function(n){var r;m||(m=Iv(e),g=new RegExp("(\\s*)"+m+"([0-9]+)"+m+"(\\s*)","g"),t.minifyCSS&&(t.minifyCSS=(r=t.minifyCSS,function(e,t){e=e.replace(g,function(e,t,n){const r=h[+n];return r[1]+m+n+m+r[2]});const n=[];return(new Ll).minify(rv(e,t)).warnings.forEach(function(t){const r=g.exec(t);if(r){const t=m+r[2]+m;e=e.replace(t,nv(t)),n.push(t)}}),r(e,t).then(e=>(n.forEach(function(t){e=e.replace(nv(t),t)}),e))})),t.minifyJS&&(t.minifyJS=function(e){return function(t,n){return e(t.replace(g,function(e,t,n){const r=h[+n];return r[1]+m+n+m+r[2]}),n)}}(t.minifyJS)));const i=m+h.length+m;return h.push(/^(\s*)[\s\S]*?(\s*)$/.exec(n)),"\t"+i+"\t"})}function S(e,n){return t.canTrimWhitespace(e,n,Cv)}function C(){let e=r.length-1;for(;e>0&&!/^<[^/!]/.test(r[e]);)e--;r.length=Math.max(0,e)}function D(){let e=r.length-1;for(;e>0&&!/^<\//.test(r[e]);)e--;r.length=Math.max(0,e)}function w(e,n){for(let i=null;e>=0&&S(i);e--){const o=r[e],a=o.match(/^<\/([\w:-]+)>$/);if(a)i=a[1];else if(/>$/.test(o)||(r[e]=GE(o,null,n,t,b,v)))break}}function R(e){let t=r.length-1;if(r.length>1){const e=r[r.length-1];/^(?:<!|$)/.test(e)&&-1===e.indexOf(A)&&t--}w(t,e)}(t.sortAttributes&&"function"!=typeof t.sortAttributes||t.sortClassName&&"function"!=typeof t.sortClassName)&&await async function(e,t,n,r){const i=t.sortAttributes&&Object.create(null),o=t.sortClassName&&new ME;function a(e){return e.map(function(e){return t.name(e.name)})}function s(e,t){return!t||-1===e.indexOf(t)}function u(e){return s(e,n)&&s(e,r)}const c=t.log;if(t.log=Rv,t.sortAttributes=!1,t.sortClassName=!1,await async function e(n){let r,s;const c=new xE(n,{start:function(e,n){i&&(i[e]||(i[e]=new ME),i[e].add(a(n).filter(u)));for(let i=0,a=n.length;i<a;i++){const a=n[i];o&&a.value&&"class"===t.name(a.name)?o.add(NE(a.value).split(/[ \t\n\f\r]+/).filter(u)):t.processScripts&&"type"===a.name.toLowerCase()&&(r=e,s=a.value)}},end:function(){r=""},chars:async function(n){t.processScripts&&kv.has(r)&&t.processScripts.indexOf(s)>-1&&await e(n)}});await c.parse()}(await Fv(e,t)),t.log=c,i){const e=Object.create(null);for(const t in i)e[t]=i[t].createSorter();t.sortAttributes=function(t,n){const r=e[t];if(r){const e=Object.create(null),t=a(n);t.forEach(function(t,r){(e[t]||(e[t]=[])).push(n[r])}),r.sort(t).forEach(function(t,r){n[r]=e[t].shift()})}}}if(o){const e=o.createSorter();t.sortClassName=function(t){return e.sort(t.split(/[ \n\f\r]+/)).join(" ")}}}(e,t,A,m);const T=new xE(e,{partialMarkup:n,continueOnParseError:t.continueOnParseError,customAttrAssign:t.customAttrAssign,customAttrSurround:t.customAttrSurround,html5:t.html5,start:async function(e,n,d,h,A){"svg"===e.toLowerCase()&&((t=Object.create(t)).caseSensitive=!0,t.keepClosingSlash=!0,t.name=Rv),e=t.name(e),s=e,i=e,v.has(e)||(a=""),o=!1,u=n;let g=t.removeOptionalTags;if(g){const t=vv.has(e);t&&function(e,t){switch(e){case"html":case"head":return!0;case"body":return!av.has(t);case"colgroup":return"col"===t;case"tbody":return"tr"===t}return!1}(f,e)&&C(),f="",t&&function(e,t){switch(e){case"html":case"head":case"body":case"colgroup":case"caption":return!0;case"li":case"optgroup":case"tr":return t===e;case"dt":case"dd":return sv.has(t);case"p":return uv.has(t);case"rb":case"rt":case"rp":return lv.has(t);case"rtc":return fv.has(t);case"option":return pv.has(t);case"thead":case"tbody":return dv.has(t);case"tfoot":return"tbody"===t;case"td":case"th":return Av.has(t)}return!1}(p,e)&&(D(),g=!function(e,t){switch(t){case"colgroup":return"colgroup"===e;case"tbody":return hv.has(e)}return!1}(p,e)),p=""}t.collapseWhitespace&&(c.length||R(e),d||(S(e,n)&&!c.length||c.push(e),function(e,n){return t.canCollapseWhitespace(e,n,Sv)}(e,n)&&!l.length||l.push(e)));const _="<"+e,E=h&&t.keepClosingSlash;r.push(_),t.sortAttributes&&t.sortAttributes(e,n);const b=[];for(let r=n.length,i=!0;--r>=0;){const o=await Dv(n[r],n,e,t);o&&(b.unshift(wv(o,E,t,i,m)),i=!1)}b.length>0?(r.push(" "),r.push.apply(r,b)):g&&iv.has(e)&&(f=e),r.push(r.pop()+(E?"/":"")+">"),A&&!t.includeAutoGeneratedTags&&(C(),f="")},end:function(e,n,u){"svg"===e.toLowerCase()&&(t=Object.getPrototypeOf(t)),e=t.name(e),t.collapseWhitespace&&(c.length?e===c[c.length-1]&&c.pop():R("/"+e),l.length&&e===l[l.length-1]&&l.pop());let d=!1;e===s&&(s="",d=!o),t.removeOptionalTags&&(d&&mv.has(f)&&C(),f="",!vv.has(e)||!p||Ev.has(p)||"p"===p&&cv.has(e)||D(),p=ov.has(e)?e:""),t.removeEmptyElements&&d&&function(e,t){switch(e){case"textarea":return!1;case"audio":case"script":case"video":if(yv("src",t))return!1;break;case"iframe":if(yv("src",t)||yv("srcdoc",t))return!1;break;case"object":if(yv("data",t))return!1;break;case"applet":if(yv("code",t))return!1}return!0}(e,n)?(C(),f="",p=""):(u&&!t.includeAutoGeneratedTags?p="":r.push("</"+e+">"),i="/"+e,b.has(e)?d&&(a+="|"):a="")},chars:async function(e,n,d){if(n=""===n?"comment":n,d=""===d?"comment":d,t.decodeEntities&&e&&!kv.has(s)&&(e=function(e,t=Ql.Legacy){return Jl(e,t)}(e)),t.collapseWhitespace){if(!c.length){if("comment"===n){const o=r[r.length-1];if(-1===o.indexOf(A)&&(o||(n=i),r.length>1&&(!o||!t.conservativeCollapse&&/ $/.test(a)))){const t=r.length-2;r[t]=r[t].replace(/\s+$/,function(t){return e=t+e,""})}}if(n)if("/nobr"===n||"wbr"===n){if(/^\s/.test(e)){let e=r.length-1;for(;e>0&&0!==r[e].lastIndexOf("<"+n);)e--;w(e-1,"br")}}else v.has("/"===n.charAt(0)?n.slice(1):n)&&(e=PE(e,t,/(?:^|\s)$/.test(a)));!(e=n||d?GE(e,n,d,t,b,v):PE(e,t,!0,!0))&&/\s$/.test(a)&&n&&"/"===n.charAt(0)&&w(r.length-1,d)}l.length||"html"===d||n&&d||(e=PE(e,t,!1,!1,!0))}t.processScripts&&kv.has(s)&&(e=await async function(e,t,n){for(let r=0,i=n.length;r<i;r++)if("type"===n[r].name.toLowerCase()&&t.processScripts.indexOf(n[r].value)>-1)return await Fv(e,t);return e}(e,t,u)),function(e,t){if("script"!==e)return!1;for(let e=0,n=t.length;e<n;e++)if("type"===t[e].name.toLowerCase())return QE(t[e].value);return!0}(s,u)&&(e=await t.minifyJS(e)),qE(s,u)&&(e=await t.minifyCSS(e)),t.removeOptionalTags&&e&&(("html"===f||"body"===f&&!/^\s/.test(e))&&C(),f="",(gv.has(p)||_v.has(p)&&!/^\s/.test(e))&&D(),/^\s+$/.test(e)&&t.collapseWhitespace&&!t.conservativeCollapse||(p="")),i=/^\s*$/.test(e)?n:"comment",t.decodeEntities&&e&&!kv.has(s)&&(e=e.replace(/&((?:Iacute|aacute|uacute|plusmn|Otilde|otilde|agrave|Agrave|Yacute|yacute|Oslash|oslash|atilde|Atilde|brvbar|ccedil|Ccedil|Ograve|curren|divide|eacute|Eacute|ograve|Oacute|egrave|Egrave|Ugrave|frac12|frac14|frac34|ugrave|oacute|iacute|Ntilde|ntilde|Uacute|middot|igrave|Igrave|iquest|Aacute|cedil|laquo|micro|iexcl|Icirc|icirc|acirc|Ucirc|Ecirc|ocirc|Ocirc|ecirc|ucirc|Aring|aring|AElig|aelig|acute|pound|raquo|Acirc|times|THORN|szlig|thorn|COPY|auml|ordf|ordm|Uuml|macr|uuml|Auml|ouml|Ouml|para|nbsp|euml|quot|QUOT|Euml|yuml|cent|sect|copy|sup1|sup2|sup3|iuml|Iuml|ETH|shy|reg|not|yen|amp|AMP|REG|uml|eth|deg|gt|GT|LT|lt)(?!;)|(?:#?[0-9a-zA-Z]+;))/g,"&amp$1").replace(/</g,"&lt;")),g&&t.collapseWhitespace&&c.length&&(e=e.replace(g,function(e,t,n){return h[+n][0]})),a+=e,e&&(o=!0),r.push(e)},comment:async function(e,n){const i=n?"<!":"\x3c!--",o=n?">":"--\x3e";e=function(e){return/^\[if\s[^\]]+]|\[endif]$/.test(e)}(e)?i+await async function(e,t){return t.processConditionalComments?await hE(e,/^(\[if\s[^\]]+]>)([\s\S]*?)(<!\[endif])$/,async function(e,n,r,i){return n+await Fv(r,t,!0)+i}):e}(e,t)+o:t.removeComments?function(e,t){for(let n=0,r=t.ignoreCustomComments.length;n<r;n++)if(t.ignoreCustomComments[n].test(e))return!0;return!1}(e,t)?"\x3c!--"+e+"--\x3e":"":i+e+o,t.removeOptionalTags&&e&&(f="",p=""),r.push(e)},doctype:function(e){r.push(t.useShortDoctype?"<!doctype"+(t.removeTagWhitespace?"":" ")+"html>":LE(e))}});return await T.parse(),t.removeOptionalTags&&(mv.has(f)&&C(),p&&!Ev.has(p)&&D()),t.collapseWhitespace&&R("br"),function(e,t,n,r){let i;const o=t.maxLineLength,a=t.noNewlinesBeforeTagClose;if(o){let t="";const s=[];for(;e.length;){const i=t.length,u=e[0].indexOf("\n"),c=Boolean(e[0].match(yE)),l=a&&c;u<0?t+=r(n(e.shift())):(t+=r(n(e[0].slice(0,u))),e[0]=e[0].slice(u+1)),i>0&&t.length>o&&!l?(s.push(t.slice(0,i)),t=t.slice(i)):u>=0&&(s.push(t),t="")}t&&s.push(t),i=s.join("\n")}else i=r(n(e.join("")));return t.collapseWhitespace?PE(i,t,!0,!0):i}(r,t,g?function(e){return e.replace(g,function(e,n,r,i){let o=h[+r][0];return t.collapseWhitespace?("\t"!==n&&(o=n+o),"\t"!==i&&(o+=i),PE(o,{preserveLineBreaks:t.preserveLineBreaks,conservativeCollapse:!t.trimCustomFragments},/^[ \n\r\t\f]/.test(o),/[ \n\r\t\f]$/.test(o))):o})}:Rv,A?function(e){return e.replace(new RegExp("\x3c!--"+A+"([0-9]+)--\x3e","g"),function(e,t){return d[+t]})}:Rv)}const xv=async function(e,t){const n=Date.now();t=Ov(t||{});const r=await Fv(e,t);return t.log("minified in: "+(Date.now()-n)+"ms"),r};var Bv={minify:xv};e.default=Bv,e.minify=xv,Object.defineProperty(e,"__esModule",{value:!0})});
package/package.json CHANGED
@@ -78,5 +78,5 @@
78
78
  "test:watch": "node --test --watch tests/*.spec.js"
79
79
  },
80
80
  "type": "module",
81
- "version": "3.2.0"
81
+ "version": "3.2.2"
82
82
  }
@@ -458,7 +458,7 @@ const topLevelTags = new Set(['html', 'head', 'body']);
458
458
  const compactTags = new Set(['html', 'body']);
459
459
  const looseTags = new Set(['head', 'colgroup', 'caption']);
460
460
  const trailingTags = new Set(['dt', 'thead']);
461
- const htmlTags = new Set(['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdi', 'bdo', 'bgsound', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'content', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'listing', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'multicol', 'nav', 'nobr', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'plaintext', 'pre', 'progress', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp']);
461
+ const htmlTags = new Set(['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdi', 'bdo', 'bgsound', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'content', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'listing', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'multicol', 'nav', 'nobr', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'plaintext', 'pre', 'progress', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'search', 'section', 'select', 'selectedcontent', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp']);
462
462
 
463
463
  function canRemoveParentTag(optionalStartTag, tag) {
464
464
  switch (optionalStartTag) {
package/src/htmlparser.js CHANGED
@@ -58,7 +58,7 @@ let IS_REGEX_CAPTURING_BROKEN = false;
58
58
  const empty = new CaseInsensitiveSet(['area', 'base', 'basefont', 'br', 'col', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']);
59
59
 
60
60
  // Inline elements
61
- const inline = new CaseInsensitiveSet(['a', 'abbr', 'acronym', 'applet', 'b', 'basefont', 'bdo', 'big', 'br', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map', 'noscript', 'object', 'q', 's', 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'svg', 'textarea', 'tt', 'u', 'var']);
61
+ const inline = new CaseInsensitiveSet(['a', 'abbr', 'acronym', 'applet', 'b', 'basefont', 'bdo', 'big', 'br', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map', 'noscript', 'object', 'q', 's', 'samp', 'script', 'select', 'selectedcontent', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'svg', 'textarea', 'tt', 'u', 'var']);
62
62
 
63
63
  // Elements that you can, intentionally, leave open
64
64
  // (and which close themselves)