html-crush 6.2.0 → 6.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/CHANGELOG.md +7 -1
- package/dist/html-crush.esm.js +11 -11
- package/dist/html-crush.umd.js +11 -11
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.2.2 (2026-08-22)
|
|
7
|
+
|
|
8
|
+
### Performance Improvements
|
|
9
|
+
|
|
10
|
+
- optimise package hot paths and JSON editing ([f3112bd](https://github.com/codsen/codsen/commit/f3112bd7fc0d7c9bc09312d3744c950691d72ca5))
|
|
11
|
+
|
|
6
12
|
## 6.2.0 (2026-08-19)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
@@ -11,7 +17,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
17
|
- isolate range state per crush call ([dec5331](https://github.com/codsen/codsen/commit/dec53312c4e55e6519398bd48246d92610a21b06))
|
|
12
18
|
- make validation diagnostics safe ([7b01074](https://github.com/codsen/codsen/commit/7b0107476f12734aeb8e82852ba980b187280110))
|
|
13
19
|
- protect every Jinja expression, not only the first ([741d3f5](https://github.com/codsen/codsen/commit/741d3f50c2727b46c124ae26cad048932fa2a180))
|
|
14
|
-
- resolve review findings
|
|
20
|
+
- resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
|
|
15
21
|
- retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
|
|
16
22
|
|
|
17
23
|
### Features
|
package/dist/html-crush.esm.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name html-crush
|
|
3
3
|
* @fileoverview Minify email templates
|
|
4
|
-
* @version 6.2.
|
|
4
|
+
* @version 6.2.2
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/html-crush/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{formatDiagnosticValue as
|
|
11
|
-
${
|
|
12
|
-
${
|
|
10
|
+
import{formatDiagnosticValue as X,isLetter as F,isPlainObject as ge,isStr as O,isWhitespaceChar as S}from"codsen-utils";import{rApply as ce}from"ranges-apply";import{Ranges as be}from"ranges-push";import{left as K,right as L}from"string-left-right";import{matchLeft as he,matchRight as fe,matchRightIncl as Ee}from"string-match-left-right";import{expander as q}from"string-range-expander";var te="6.2.2";var Ae=te;function ie(n){return n>96&&n<123||n>64&&n<91||n>47&&n<58||n===95}function k(n){return n!==void 0&&ie(n.charCodeAt(0))}var Te={lineLengthLimit:500,removeIndentations:!0,removeLineBreaks:!1,removeHTMLComments:!1,removeCSSComments:!0,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,breakToTheLeftOf:["</td","<html","</html","<head","</head","<meta","<link","<table","<script","</script","<!DOCTYPE","<style","</style","<title","<body","@media","</body","<!--[if","<!--<![endif","<![endif]"],mindTheInlineTags:["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]};function ye(n,T){let z=Date.now();if(!O(n))throw n===void 0?new Error("html-crush/crush(): [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush/crush(): [THROW_ID_02] the first input argument must be string! It was given as "${typeof n}", equal to:
|
|
11
|
+
${X(n,4)}`);if(T&&!ge(T))throw new Error(`html-crush/crush(): [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ${typeof T}, equal to ${X(T,4)}`);if(T&&Array.isArray(T.breakToTheLeftOf)&&T.breakToTheLeftOf.length){for(let r=0,e=T.breakToTheLeftOf.length;r<e;r++)if(!O(T.breakToTheLeftOf[r]))throw new TypeError(`html-crush/crush(): [THROW_ID_04] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ${r} is of a type "${typeof T.breakToTheLeftOf[r]}" and is equal to:
|
|
12
|
+
${X(T.breakToTheLeftOf[r],4)}`)}let s=new be({limitToBeAddedWhitespace:!0}),l={...Te,...T};typeof l.removeHTMLComments=="boolean"&&(l.removeHTMLComments=l.removeHTMLComments?1:0);let M="";Array.isArray(l.breakToTheLeftOf)&&l.breakToTheLeftOf.length&&(M=[...new Set(l.breakToTheLeftOf.map(r=>r[0]))].join(""));let y={removeHTMLComments:!1,removeCSSComments:!1},G=Array.isArray(l.mindTheInlineTags)?l.mindTheInlineTags:[],R=new Set(G),$e=!!G.length&&G.every(r=>O(r)&&!!r.length&&![...r].some(e=>!k(e))),x=new Map,Q=Array.isArray(l.breakToTheLeftOf)&&!!l.breakToTheLeftOf.length&&l.breakToTheLeftOf.every(O)&&!(l.breakToTheLeftOf.length===1&&!l.breakToTheLeftOf[0].trim());if(Q)for(let r of l.breakToTheLeftOf){if(!r.length)continue;let e=x.get(r[0]);e?e.push(r):x.set(r[0],[r])}function Z(r){if(!Q)return!!Ee(n,r,l.breakToTheLeftOf);let e=x.get(n[r]);if(e===void 0)return!1;for(let E=0,o=e.length;E<o;E++)if(n.startsWith(e[E],r))return!0;return!1}function v(r,e){if(!$e)return!!fe(n,r,l.mindTheInlineTags,{...e?{trimCharsBeforeMatching:"/"}:{},cb:h=>!h||!k(h)});let E=r+1;if(e)for(;n[E]==="/";)E++;let o=E;for(;o<b&&ie(n.charCodeAt(o));)o++;return o>E&&R.has(n.slice(E,o))}let V=null,i=null,C=!1,m=0,U=0,g=!1,N=!1,c=null,d=null,P=null,B=null,u,t=null,$=null,a=null,p=null,A=null,_=null,w=">};",H="<",se="!",ue=">",re="<",ee="{},:;<>~+",j=ee,Y=ee,I=!0,b=n.length,J=0;for(;J<b&&S(n[J]);)J++;let me=Math.floor(b/2),ne=.01,le;l.reportProgressFunc&&(le=Math.floor(l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*ne-l.reportProgressFuncFrom));let D,W=0,f=`
|
|
13
13
|
`;if(n.includes(`\r
|
|
14
|
-
`)?
|
|
15
|
-
`:n.includes("\r")&&(
|
|
16
|
-
`||n[o]==="\r"
|
|
14
|
+
`)?f=`\r
|
|
15
|
+
`:n.includes("\r")&&(f="\r"),b){for(let e=0;e<b;e++){if(l.reportProgressFunc&&(b>1e3&&b<2e3?e===me&&l.reportProgressFunc(Math.floor((l.reportProgressFuncTo-l.reportProgressFuncFrom)/2)):b>=2e3&&(D=l.reportProgressFuncFrom+Math.floor(e/b*(le||1)),D!==W&&(W=D,l.reportProgressFunc(D)))),U++,!u&&g&&n[e]==="}"&&n[e-1]==="}"&&(m+1>=l.lineLengthLimit?(s.push(e,e,f),m=0):(t=e,$=e,a=" ")),u&&typeof u=="number"&&e>=u&&(u=void 0),B!==null&&n[e]==="<"&&n.startsWith("</script",e)&&!F(n[e+8])){if((l.removeIndentations||l.removeLineBreaks)&&e>0&&n[~-e]&&S(n[~-e])){for(let o=e;o--;)if(n[o]===`
|
|
16
|
+
`||n[o]==="\r"||!S(n[o])){o+1<e&&s.push(o+1,e);break}}B=null,u=!1,e+=8;continue}if(!u&&!g&&n[e]==="<"&&n.startsWith("<script",e)&&!F(n[e+7])){B=e,u=!0;let o="";(l.removeLineBreaks||l.removeIndentations)&&i!==null&&(i>0&&(o=f),s.push(i,e,o)),i=null,V=null}if(A!==null&&p===null&&!k(n[e])){p=n.slice(A,e);let o=L(n,~-e),h=L(n,e);if(typeof o=="number"&&n[o]===">"&&S(n[e])&&h)s.push(e,h);else if(o&&n[o]==="/"&&n[L(n,o)]===">"){S(n[e])&&h&&s.push(e,h);let oe=L(n,o+1);n[o+1]!==">"&&oe&&s.push(o+1,oe)}}if(!u&&!g&&!c&&n[~-e]==="<"&&A===null)if(k(n[e]))A=e;else{let o=L(n,~-e),h=L(n,o);n[o]==="/"&&k(n[h]||"")&&(A=h)}if(!u&&(g||c)&&d!==null&&n[e]==="*"&&n[e+1]==="/"&&([t,$]=q({str:n,from:d,to:e+2,ifLeftSideIncludesThisThenCropTightly:j||"",ifRightSideIncludesThisThenCropTightly:Y||""}),d=null,t!=null?s.push(t,$):(m+=1,e+=1),u=e+2),!u&&(g||c)&&d===null&&n[e]==="/"&&n[e+1]==="*"&&(y.removeCSSComments||(y.removeCSSComments=!0),l.removeCSSComments&&(d=e)),N&&n.startsWith("![endif",e+1)&&(N=!1),!u&&!g&&!c&&P!==null){let o;n.startsWith("-->",e)?o=3:n[e]===">"&&n[e-1]==="]"&&(o=1),o&&([t,$]=q({str:n,from:P,to:e+o}),P=null,t!=null?l.lineLengthLimit&&U-($-t)>=l.lineLengthLimit?(s.push(t,$,f),U=-o):(s.push(t,$),U-=$-t):(m+=o-1,e+=o-1),u=e+o)}if(!u&&!g&&!c&&n[e]==="<"&&(n.startsWith("<!--",e)||l.removeHTMLComments===2&&n.startsWith("<![endif",e))&&P===null&&(n.startsWith("[if",e+4)?(N||(N=!0),l.removeHTMLComments===2&&(P=e)):l.removeHTMLComments&&(!N||l.removeHTMLComments===2)&&(P=e),y.removeHTMLComments||(y.removeHTMLComments=!0)),!u&&g&&d===null&&n[e]==="<"&&n.startsWith("</style",e)&&!F(n[e+7])?g=!1:!u&&!g&&d===null&&n[e]==="<"&&n.startsWith("<style",e)&&!F(n[e+6])&&(g=!0,(l.removeLineBreaks||l.removeIndentations)&&l.breakToTheLeftOf.includes("<style")&&n.startsWith(' type="text/css">',e+6)&&n[e+24]&&s.push(e+23,e+23,f)),!u&&!c&&`"'`.includes(n[e])&&n.endsWith("style=",e)&&(c=e),!u&&S(n[e]))i===null&&(i=e);else if(!u&&!((g||c)&&d!==null)){if(i!==null){if(l.removeLineBreaks&&(m+=1),I)I=!1,(l.removeIndentations||l.removeLineBreaks)&&s.push(0,e);else if(l.removeIndentations&&!l.removeLineBreaks&&(!C&&V!==null&&e>V?s.push(V+1,e):i+1<e&&(n.endsWith("]>",i)||n.endsWith("-->",i)||n.startsWith("<![",e)||n.startsWith("<!--<![",e)?s.push(i,e):n[i]===" "?s.push(i+1,e):n[~-e]===" "?s.push(i,~-e):s.push(i,e," "))),l.removeLineBreaks||c){if(M.includes(n[e])&&Z(e)){!(`\r
|
|
17
17
|
`.includes(n[~-e])&&i===~-e)&&!(n[~-e]===`
|
|
18
|
-
`&&n[e-2]==="\r"&&i===e-2)&&s.push(i,e,
|
|
18
|
+
`&&n[e-2]==="\r"&&i===e-2)&&s.push(i,e,f),t=null,$=null,a=null,i=null,m=1;continue}let o=" ";if(!(n[e]==="<"&&v(e,!1))){if(n[~-i]&&ue.includes(n[~-i])&&re.includes(n[e])||(g||c)&&d===null&&(j.includes(n[~-i])||Y.includes(n[e]))||n[e]==="!"&&n.startsWith("!important",e)&&!N||c&&(n[~-i]==="'"||n[~-i]==='"')||n[~-i]==="}"&&n.startsWith("</style",e)||n[e]===">"&&(`'"`.includes(n[K(n,e)])||n[L(n,e)]==="<")||n[e]==="/"&&n[L(n,e)]===">"){o="";let h=n[e]==="/"&&n[e+1]===">"?L(n,e):null;h&&h>e+1&&(s.push(e+1,h),m-=h-e+1)}}g&&n[e]==="}"&&i&&n[i-1]==="}"&&(o=" "),o?.length&&(m+=1),l.lineLengthLimit?m>=l.lineLengthLimit||!n[e+1]||n[e]===">"||n[e]==="/"&&n[e+1]===">"?((m>l.lineLengthLimit||m===l.lineLengthLimit&&n[e+1]?.trim()&&!w.includes(n[e])&&!H.includes(n[e+1]))&&(o=f,m=1),(m>l.lineLengthLimit||!(o===" "&&e===i+1))&&(s.push(i,e,o),V=null),t=null,$=null,a=null):(t===null||i<t)&&(t=i,$=e,a=o):e===i+1&&o===" "||s.push(i,e,o)}i=null,C||(C=!0)}else I&&(I=!1),l.removeLineBreaks&&(m+=1);C||(C=!0)}if(!u&&!I&&e!==0&&l.removeLineBreaks&&(l.lineLengthLimit||M)&&!(n[e]==="<"&&n.startsWith("</a",e))){if(M&&Z(e)&&J<e&&(n[e]!=="<"||!n.startsWith("<![endif]",e)||!he(n,e,"<!--"))){s.push(e,e,f),t=null,$=null,a=null,m=1;continue}else if(l.lineLengthLimit&&m<=l.lineLengthLimit){if(!n[e+1]||H.includes(n[e])&&!se.includes(n[e])||w.includes(n[e])||S(n[e])){if(t!==null&&$!==null&&(t!==$||a?.length)){let o=a;!S(n[e])&&n[e+1]?.trim()&&m+(a?a.length:0)>l.lineLengthLimit&&(o=f),(m+(o?o.length:0)>l.lineLengthLimit||!(o===" "&&$===t+1&&n[t]===" "))&&(n[~-t]==="}"&&n[$]==="{"||(s.push(t,$,o),V=null))}!S(n[e])&&(H.includes(n[e])||n[~-e]&&w.includes(n[~-e]))&&O(_)&&(!p||!R.has(p))&&!(n[e]==="<"&&v(e,!1))&&!(n[e]==="<"&&v(e,!0))?(t=e,$=e,a=null):d===null&&t!==null&&(c||!l.mindTheInlineTags||!Array.isArray(l.mindTheInlineTags)||Array.isArray(l.mindTheInlineTags.length)&&!l.mindTheInlineTags.length||!O(p)||Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&O(p)&&!R.has(p))&&!(n[e]==="<"&&v(e,!0))&&(t=null,$=null,a=null)}}else if(l.lineLengthLimit)if(H.includes(n[e])&&!(n[e]==="<"&&v(e,!0)))if(t!==null&&$!==null&&(t!==$||a?.length)){let o=a?.length?a.length:0;m-($-t-o)-1>l.lineLengthLimit||(s.push(t,$,a),m-($-t-o)-1===l.lineLengthLimit&&(s.push(e,e,f),m=0),t=null,$=null,a=null)}else s.push(e,e,f),m=0;else n[e+1]&&w.includes(n[e])&&O(p)&&Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&!R.has(p)?t!==null&&$!==null&&(t!==$||a?.length)||(s.push(e+1,e+1,f),m=0):S(n[e])||n[e+1]||t!==null&&$!==null&&(t!==$||a?.length)&&s.push(t,$,f)}if(!u&&!I&&l.removeLineBreaks&&l.lineLengthLimit&&m>=l.lineLengthLimit&&t!==null&&$!==null&&!w.includes(n[e])&&!H.includes(n[e])&&!"/".includes(n[e])&&!(m===l.lineLengthLimit&&n[e+1]&&!n[e+1].trim())){let o=f;n[e+1]&&!n[e+1].trim()&&m===l.lineLengthLimit&&(o=a),o===f&&!n[~-t].trim()&&K(n,t)&&(t=K(n,t)+1),s.push(t,$,o),m=e-$,n[e].length&&(m+=1),t=null,$=null,a=null}if((!u&&n[e]===`
|
|
19
19
|
`||n[e]==="\r"&&(!n[e+1]||n[e+1]&&n[e+1]!==`
|
|
20
|
-
`))&&(
|
|
21
|
-
`&&s.push(i,e)),n[e+1]||(g&&
|
|
20
|
+
`))&&(V=e,C&&(C=!1),!l.removeLineBreaks&&i!==null&&i<e&&n[e+1]&&n[e+1]!=="\r"&&n[e+1]!==`
|
|
21
|
+
`&&s.push(i,e)),n[e+1]||(g&&d!==null?s.push([...q({str:n,from:d,to:e,ifLeftSideIncludesThisThenCropTightly:j||"",ifRightSideIncludesThisThenCropTightly:Y||""})]):i&&n[e]!==`
|
|
22
22
|
`&&n[e]!=="\r"?s.push(i,e+1):i&&(n[e]==="\r"&&n[e+1]===`
|
|
23
23
|
`||n[e]===`
|
|
24
|
-
`&&n[e-1]!=="\r")&&s.push(i,e)),!u&&c&&c<e&&n[c]===n[e]&&(c=null),!u&&!g&&n.startsWith("<pre",e)&&!
|
|
24
|
+
`&&n[e-1]!=="\r")&&s.push(i,e)),!u&&c&&c<e&&n[c]===n[e]&&(c=null),!u&&!g&&n[e]==="<"&&n.startsWith("<pre",e)&&!F(n[e+4])){let o=n.indexOf("</pre",e+5);o>0&&(u=o)}if(!u&&!g&&n[e]==="<"&&n.startsWith("<code",e)&&!F(n[e+5])){let o=n.indexOf("</code",e+5);o>0&&(u=o)}if(!u&&n[e]==="<"&&n.startsWith("<![CDATA[",e)){let o=n.indexOf("]]>",e+9);o>0&&(u=o)}if(!u&&!g&&!c&&A!==null&&n[e]===">"&&(n[L(n,e)]==="<"&&(_=p),A=null,p=null),n[e]==="<"&&_!==null&&(_=null),!u&&g&&n[e]==="{"&&n[e+1]==="{"){let o=n.indexOf("}}",e+2);o!==-1&&(u=o+2)}let E=!0}let r=s.current();if(r){let e=l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*ne,E=ce(n,r,h=>{l.reportProgressFunc&&b>=2e3&&(D=Math.floor(e+(l.reportProgressFuncTo-e)*(h/100)),D!==W&&(W=D,l.reportProgressFunc(D)))}),o=E.length;return{log:{timeTakenInMilliseconds:Date.now()-z,originalLength:b,cleanedLength:o,bytesSaved:Math.max(b-o,0),percentageReducedOfOriginal:b?Math.round(Math.max(b-o,0)*100/b):0},ranges:r,applicableOpts:y,result:E}}}return{log:{timeTakenInMilliseconds:Date.now()-z,originalLength:b,cleanedLength:b,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:y,ranges:null,result:n}}export{ye as crush,Te as defaults,Ae as version};
|
package/dist/html-crush.umd.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name html-crush
|
|
3
3
|
* @fileoverview Minify email templates
|
|
4
|
-
* @version 6.2.
|
|
4
|
+
* @version 6.2.2
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/html-crush/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var htmlCrush=(()=>{var Y=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames,he=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable;var re=(e,r,l)=>r in e?Y(e,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[r]=l,L=(e,r)=>{for(var l in r||(r={}))me.call(r,l)&&re(e,l,r[l]);if(he)for(var l of he(r))Ne.call(r,l)&&re(e,l,r[l]);return e};var Ve=(e,r)=>{for(var l in r)Y(e,l,{get:r[l],enumerable:!0})},Me=(e,r,l,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Re(r))!me.call(e,o)&&o!==l&&Y(e,o,{get:()=>r[o],enumerable:!(n=ve(r,o))||n.enumerable});return e};var Pe=e=>Me(Y({},"__esModule",{value:!0}),e);var J=(e,r,l)=>re(e,typeof r!="symbol"?r+"":r,l);var et={};Ve(et,{crush:()=>Ze,defaults:()=>Oe,version:()=>Xe});function xe(){let e=[],r=0,l=!1;return{append(n){return l?!1:r+n.length>1999?(e.push("\u2026"),r+=1,l=!0,!1):(e.push(n),r+=n.length,!0)},result(){return e.join("")},stopped(){return l}}}function _e(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function z(e,r){if(e.append('"')){for(let l=0;l<r.length&&!e.stopped();l+=1){let n=r.charCodeAt(l);n===34?e.append('\\"'):n===92?e.append("\\\\"):n===8?e.append("\\b"):n===9?e.append("\\t"):n===10?e.append("\\n"):n===12?e.append("\\f"):n===13?e.append("\\r"):n<32||n===8232||n===8233||n>=55296&&n<=57343?e.append(_e(n)):e.append(r[l])}e.append('"')}}function He(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function $e(e,r){e.append("Symbol(");let l=String(r);l.length>8&&z(e,l.slice(7,-1)),e.append(")")}function ce(e,r){typeof r=="symbol"?$e(e,r):z(e,String(r))}function T(e,r=0){let l=xe(),n=r===4?4:0,o=new WeakSet,i=0;function f(u){n&&l.append(" ".repeat(u*n))}function g(u,d){u&&l.append(","),n&&(l.append("\n"),f(d+1))}function a(u,d,O){n&&d&&(l.append("\n"),f(O)),l.append(u)}function s(u,d){Object.prototype.hasOwnProperty.call(u,"value")?p(u.value,d):l.append(He(u))}function c(u,d){let O;try{O=Reflect.getOwnPropertyDescriptor(u,"length")}catch(m){l.append("[Uninspectable]");return}let S=O==null?void 0:O.value;if(!Number.isSafeInteger(S)||S<0){l.append("[Uninspectable]");return}l.append("[");let b=!1;for(let m=0;m<S&&!l.stopped();m+=1){if(g(b,d),b=!0,i>=50){l.append("[MaxEntries]");break}i+=1;let $;try{$=Reflect.getOwnPropertyDescriptor(u,String(m))}catch(y){l.append("[Uninspectable]");continue}$!=null&&$.enumerable?s($,d+1):l.append("[Empty]")}a("]",b,d)}function w(u,d){let O;try{O=Reflect.ownKeys(u)}catch(b){l.append("[Uninspectable]");return}l.append("{");let S=!1;for(let b of O){if(l.stopped())break;if(i>=50){g(S,d),S=!0,z(l,"\u2026"),l.append(n?": ":":"),l.append("[MaxEntries]");break}i+=1;let m;try{m=Reflect.getOwnPropertyDescriptor(u,b)}catch($){g(S,d),S=!0,ce(l,b),l.append(n?": ":":"),l.append("[Uninspectable]");continue}m!=null&&m.enumerable&&(g(S,d),S=!0,ce(l,b),l.append(n?": ":":"),s(m,d+1))}a("}",S,d)}function E(u,d){if(o.has(u)){l.append("[Circular]");return}if(d>=5){l.append("[MaxDepth]");return}let O;try{O=Array.isArray(u)}catch(S){l.append("[Uninspectable]");return}o.add(u);try{O?c(u,d):w(u,d)}finally{o.delete(u)}}function p(u,d){u===null?l.append("null"):typeof u=="string"?z(l,u):typeof u=="number"?l.append(Object.is(u,-0)?"-0":String(u)):typeof u=="boolean"?l.append(u?"true":"false"):typeof u>"u"?l.append("undefined"):typeof u=="bigint"?l.append("".concat(u,"n")):typeof u=="symbol"?$e(l,u):typeof u=="function"?l.append("[Function]"):E(u,d)}try{return p(e,0),l.result()}catch(u){return"[Uninspectable]"}}var nt=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),Fe=Object.prototype.hasOwnProperty;function H(e){if(!D(e)||e.length!==1)return!1;let r=e.charCodeAt(0);return r<128?r>64&&r<91||r>96&&r<123:e.toUpperCase()!==e.toLowerCase()}function M(e){if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function D(e){return typeof e=="string"}function pe(e){return Number.isFinite(e)}function V(e){return Number.isSafeInteger(e)&&e>=0}function P(e){return e!=null}function de(e,r){return M(e)&&D(r)&&Fe.call(e,r)}var We={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function W(e,r){if(!Array.isArray(e)||!e.length)return e;let l=L(L({},We),r),n,o;if(l.strictlyTwoElementsInRangeArrays&&!e.every((g,a)=>!Array.isArray(g)||g.length!==2?(n=a,o=g.length,!1):!0))throw new TypeError("ranges-sort/rSort(): [THROW_ID_01] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ".concat(n,"th range (").concat(T(e[n],4),") has not two but ").concat(o," elements!"));if(!e.every((g,a)=>!Array.isArray(g)||!Number.isInteger(g[0])||g[0]<0||!Number.isInteger(g[1])||g[1]<0?(n=a,!1):!0))throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ".concat(n,"th range (").concat(T(e[n],4),") does not consist of only natural numbers!"));let i=e.length**2,f=0;return Array.from(e).sort((g,a)=>(l.progressFn&&(f+=1,l.progressFn(Math.floor(f*100/i))),g[0]===a[0]?g[1]<a[1]?-1:g[1]>a[1]?1:0:g[0]<a[0]?-1:1))}var ke={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function ie(e,r){function l(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;if(r&&!l(r))throw new TypeError("ranges-merge/rMerge(): [THROW_ID_01] the second input argument must be a plain object. It was given as:\n".concat(T(r,4)," (type ").concat(typeof r,")"));let n=L(L({},ke),r);if(n.progressFn&&l(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_02] opts.progressFn must be a function! It was given of a type: "'.concat(typeof n.progressFn,'", equal to ').concat(T(n.progressFn,4)));if(![1,2,"1","2"].includes(n.mergeType))throw new TypeError('ranges-merge/rMerge(): [THROW_ID_03] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof n.mergeType,'", equal to ').concat(T(n.mergeType,4)));if(typeof n.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof n.joinRangesThatTouchEdges,'", equal to ').concat(T(n.joinRangesThatTouchEdges,4)));let o=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),i,f,g;n.progressFn?i=W(o,{progressFn:s=>{g=Math.floor(s/5),g!==f&&(f=g,n.progressFn(g))}}):i=W(o);let a=i.length-1;for(let s=a;s>0;s--)n.progressFn&&(g=Math.floor((1-s/a)*78)+21,g!==f&&g>f&&(f=g,n.progressFn(g))),(i[s][0]<=i[s-1][0]||!n.joinRangesThatTouchEdges&&i[s][0]<i[s-1][1]||n.joinRangesThatTouchEdges&&i[s][0]<=i[s-1][1])&&(i[s-1][0]=Math.min(i[s][0],i[s-1][0]),i[s-1][1]=Math.max(i[s][1],i[s-1][1]),i[s][2]!==void 0&&(i[s-1][0]>=i[s][0]||i[s-1][1]<=i[s][1])&&i[s-1][2]!==null&&(i[s][2]===null&&i[s-1][2]!==null?i[s-1][2]=null:i[s-1][2]!=null?+n.mergeType==2&&i[s-1][0]===i[s][0]?i[s-1][2]=i[s][2]:i[s-1][2]+=i[s][2]:i[s-1][2]=i[s][2]),i.splice(s,1),s=i.length);return i.length?i:null}function K(e){if(typeof e=="number")return Number.isInteger(e)&&e>=0;if(typeof e!="string"||!e.trim())return!1;let r=Number(e);return Number.isInteger(r)&&r>=0}function be(e,r,l){let n=0,o=0;if(e===void 0&&r===void 0&&l===void 0)throw new Error("ranges-apply/rApply(): [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply/rApply(): [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(T(e,4)));if(r!=null&&!Array.isArray(r))throw new TypeError("ranges-apply/rApply(): [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof r,", equal to: ").concat(T(r,4)));if(l&&typeof l!="function")throw new TypeError("ranges-apply/rApply(): [THROW_ID_04] the third input argument must be a function (or falsy)! Currently it's: ".concat(typeof l,", equal to: ").concat(T(l,4)));if(!(r!=null&&r.some(Boolean)))return e;let i;Array.isArray(r)&&!Array.isArray(r[0])&&K(r[0])&&K(r[1])?i=[Array.from(r)]:i=Array.from(r);let f=i.length,g=0;i.forEach((c,w)=>{if(c){if(l&&(n=Math.floor(g/f*10),n!==o&&(o=n,l(n))),!Array.isArray(c))throw new TypeError("ranges-apply/rApply(): [THROW_ID_05] ranges array, second input arg., has ".concat(w,"th element not an array: ").concat(T(c,4),", which is ").concat(typeof c));if(!K(c[0]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_06] ranges array, second input arg. has ".concat(w,"th element, array ").concat(T(c),". Its first element is not a non-negative integer or string index, but ").concat(typeof c[0],", equal to: ").concat(T(c[0],4),"."));if(typeof c[0]=="string"&&(i[w]=[...c],i[w][0]=Number(c[0])),!K(c[1]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_07] ranges array, second input arg. has ".concat(w,"th element, array ").concat(T(c),". Its second element is not a non-negative integer or string index, but ").concat(typeof c[1],", equal to: ").concat(T(c[1],4),"."));typeof c[1]=="string"&&(i[w]===c&&(i[w]=[...c]),i[w][1]=Number(c[1])),g+=1}});let a=l?ie(i,{progressFn:c=>{n=10+Math.floor(c/10),n!==o&&(o=n,l(n))}}):ie(i),s=(a==null?void 0:a.length)||0;if(a&&s>0){let c=e.slice(a[s-1][1]);e=a.reduce((w,E,p,u)=>{l&&(n=20+Math.floor(p/s*80),n!==o&&(o=n,l(n)));let d=p===0?0:u[p-1][1],O=u[p][0];return"".concat(w).concat(e.slice(d,O)).concat(u[p][2]||"")},""),e+=c}return e}function Q(e,r=1){let l="\xA0";function n(i){return Array.from(i).reverse().join("")}function o(i,f,g){let a=g?"\n":"\r",s=g?"\r":"\n";if(!i)return i;let c=0,w=0,E="";for(let p=0,u=i.length;p<u;p++)(i[p]===a||i[p]===s&&i[p-1]!==a)&&w++,"\r\n".includes(i[p])||i[p]===l?(c=0,i[p]===l?E+=i[p]:i[p]===a?w<=f&&(E+=i[p],i[p+1]===s&&(E+=i[p+1],p++)):i[p]===s&&(i==null?void 0:i[p-1])!==a&&w<=f&&(E+=i[p])):(c++,!i[p+1]&&!w&&(E+=" "));return E}if(typeof e=="string"&&e.length){let i=1;typeof+r=="number"&&Number.isInteger(+r)&&+r>=0&&(i=+r);let f="",g="";if(!e.trim())f=e;else if(!e[0].trim()){for(let a=0,s=e.length;a<s;a++)if(e[a].trim()){f=e.slice(0,a);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===l)){for(let a=e.length;a--;)if(e[a].trim()){g=e.slice(a+1);break}}return"".concat(o(f,i,!1)).concat(e.trim()).concat(n(o(n(g),i,!0)))}return e}var Be={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Ue(e,r){function l(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;if(r&&!l(r))throw new TypeError("ranges-push/rMerge(): [THROW_ID_10] the second input argument must be a plain object. It was given as:\n".concat(T(r,4)," (type ").concat(typeof r,")"));let n=L(L({},Be),r);if(n.progressFn&&l(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new TypeError('ranges-push/rMerge(): [THROW_ID_11] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof n.progressFn,'", equal to ').concat(T(n.progressFn,4)));if(![1,2,"1","2"].includes(n.mergeType))throw new TypeError('ranges-push/rMerge(): [THROW_ID_12] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof n.mergeType,'", equal to ').concat(T(n.mergeType,4)));if(typeof n.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-push/rMerge(): [THROW_ID_13] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof n.joinRangesThatTouchEdges,'", equal to ').concat(T(n.joinRangesThatTouchEdges,4)));let o=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),i,f,g;n.progressFn?i=W(o,{progressFn:s=>{g=Math.floor(s/5),g!==f&&(f=g,n.progressFn!=null&&n.progressFn(g))}}):i=W(o);let a=i.length-1;for(let s=a;s>0;s--)n.progressFn&&(g=Math.floor((1-s/a)*78)+21,g!==f&&g>f&&(f=g,n.progressFn(g))),(i[s][0]<=i[s-1][0]||!n.joinRangesThatTouchEdges&&i[s][0]<i[s-1][1]||n.joinRangesThatTouchEdges&&i[s][0]<=i[s-1][1])&&(i[s-1][0]=Math.min(i[s][0],i[s-1][0]),i[s-1][1]=Math.max(i[s][1],i[s-1][1]),i[s][2]!==void 0&&(i[s-1][0]>=i[s][0]||i[s-1][1]<=i[s][1])&&i[s-1][2]!==null&&(i[s][2]===null&&i[s-1][2]!==null?i[s-1][2]=null:i[s-1][2]!=null?+n.mergeType==2&&i[s-1][0]===i[s][0]?i[s-1][2]=i[s][2]:i[s-1][2]+=i[s][2]:i[s-1][2]=i[s][2]),i.splice(s,1),s=i.length);return i.length?i:null}var je={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1};function Te(e){return e[2]===void 0&&e[0]===e[1]}function Je(e){let r=-1;for(let l=0,n=e.length;l<n;l++){let o=e[l];if(Array.isArray(o)){if(o[0]<r)return!1;r=o[0]}}return!0}var ye=class{constructor(e){J(this,"ranges");J(this,"opts");J(this,"sorted");if(e!=null&&!M(e))throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_01] The options argument must be a plain object. It was given as ".concat(T(e,4)," (type ").concat(typeof e,")."));let r=L(L({},je),e);if(r.mergeType&&r.mergeType!==1&&r.mergeType!==2)if(D(r.mergeType)&&r.mergeType.trim()==="1")r.mergeType=1;else if(D(r.mergeType)&&r.mergeType.trim()==="2")r.mergeType=2;else throw new Error('ranges-push/Ranges/constructor(): [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof r.mergeType,'", equal to ').concat(T(r.mergeType,4)));this.opts=r,this.ranges=[],this.sorted=!0}add(e,r,l){var i;if(e==null&&r==null)return;if(P(e)&&!P(r)){if(Array.isArray(e)){if(e.length){if(e.some(f=>Array.isArray(f))){e.forEach(f=>{Array.isArray(f)&&this.add(...f)});return}e.length&&V(+e[0])&&V(+e[1])&&this.add(...e)}return}throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_03] the first input argument, "from" is set ('.concat(T(e),') but second-one, "to" is not (').concat(T(r),")"))}else if(!P(e)&&P(r))throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_04] the second input argument, "to" is set ('.concat(T(r),') but first-one, "from" is not (').concat(T(e),")"));let n=+e,o=+r;if(V(n)&&V(o)){if(P(l)&&!D(l)&&!pe(l))throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_05] The third argument, the value to add, was given not as string but ".concat(typeof l,", equal to:\n").concat(T(l,4)));if(P(this.ranges)&&Array.isArray(this.last())&&n===this.last()[1]){if(this.last()[1]=o,this.last()[2],this.last()[2]!==null&&P(l)){let f=this.last()[2]&&this.last()[2].length&&(!((i=this.opts)!=null&&i.mergeType)||this.opts.mergeType===1)?"".concat(this.last()[2]).concat(l):l;this.opts.limitToBeAddedWhitespace&&(f=Q(f,this.opts.limitLinebreaksCount)),D(f)&&!f.length||(this.last()[2]=f)}}else{this.ranges||(this.ranges=[]);let f=this.last();f&&n<f[0]&&(this.sorted=!1);let g=l!==void 0&&!(D(l)&&!l.length)?[n,o,l&&this.opts.limitToBeAddedWhitespace?Q(l,this.opts.limitLinebreaksCount):l]:[n,o];this.ranges.push(g)}}else throw V(n)?new TypeError('ranges-push/Ranges/add(): [THROW_ID_07] "to" value, the second input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof r,'" equal to: ').concat(T(r,4))):new TypeError('ranges-push/Ranges/add(): [THROW_ID_06] "from" value, the first input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof e,'" equal to: ').concat(T(e,4)))}push(e,r,l){this.add(e,r,l)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=Ue(this.ranges,{mergeType:this.opts.mergeType}),this.sorted=!0,this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>P(e[2])?[e[0],e[1],Q(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}firstCovers(e){if(!V(e))throw new TypeError("ranges-push/Ranges/firstCovers(): [THROW_ID_08] the input argument must be a natural number or zero! It was given as ".concat(T(e,4)," (type ").concat(typeof e,")"));if(!Array.isArray(this.ranges)||!this.ranges.length)return!1;let r=null;if(this.sorted){for(let n=0,o=this.ranges.length;n<o;n++){let i=this.ranges[n];if(!(!Array.isArray(i)||Te(i))){if(r===null){if(i[0]!==0)return!1;r=i[1]}else{if(i[0]>r)break;i[1]>r&&(r=i[1])}if(r>=e)return!0}}return r!==null&&r>=e}let l=!0;for(;l;){l=!1;for(let n=0,o=this.ranges.length;n<o;n++){let i=this.ranges[n];if(!(!Array.isArray(i)||Te(i))){if(i[0]<0)return!1;(r===null?i[0]===0:i[0]<=r&&i[1]>r)&&(r=i[1],l=!0)}}}return r!==null&&r>=e}wipe(){this.ranges=[],this.sorted=!0}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&V(e[0][0]))this.ranges=Array.from(e),this.sorted=Je(this.ranges);else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_09] Single range was given but we expected array of arrays! The first element, ".concat(T(e[0],4)," should be an array and its first element should be an integer, a string index."));else this.ranges=[],this.sorted=!0}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var k="\xA0";function Ge({str:e,idx:r=0,stopAtNewlines:l=!1,stopAtRawNbsp:n=!1}){if(typeof e!="string"||!e.length||((!r||typeof r!="number")&&(r=0),!e[r+1]))return null;if(e[r+1]&&(e[r+1].trim()||l&&"\n\r".includes(e[r+1])||n&&e[r+1]===k))return r+1;if(e[r+2]&&(e[r+2].trim()||l&&"\n\r".includes(e[r+2])||n&&e[r+2]===k))return r+2;for(let o=r+1,i=e.length;o<i;o++)if(e[o].trim()||l&&"\n\r".includes(e[o])||n&&e[o]===k)return o;return null}function A(e,r=0){return Ge({str:e,idx:r,stopAtNewlines:!1,stopAtRawNbsp:!1})}function qe({str:e,idx:r,stopAtNewlines:l,stopAtRawNbsp:n}){if(typeof e!="string"||!e.length||((!r||typeof r!="number")&&(r=0),r<1))return null;if(e[~-r]&&(e[~-r].trim()||l&&"\n\r".includes(e[~-r])||n&&e[~-r]===k))return~-r;if(e[r-2]&&(e[r-2].trim()||l&&"\n\r".includes(e[r-2])||n&&e[r-2]===k))return r-2;for(let o=r;o--;)if(e[o]&&(e[o].trim()||l&&"\n\r".includes(e[o])||n&&e[o]===k))return o;return null}function X(e,r=0){return qe({str:e,idx:r,stopAtNewlines:!1,stopAtRawNbsp:!1})}function Ee(e){return typeof e!="string"?e:e.length?[e]:[]}var Se={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},Ye=e=>e+1;function ze(e,r,l,n,o=!1,i=Ye){var m;let f=typeof l=="function"?l():l;if(+r<0&&o&&f==="EOL")return f;let g=L(L({},Se),n);if(r>=e.length&&!o)return!1;let a=o?1:l.length,s=0,c=!1,w=!1,E=!1,p=g.maxMismatches,u=r,d=!1,O=!1,S=!1;function b(){return s===1&&p<g.maxMismatches-1}for(;e[u];){let $=i(u);if(g.trimBeforeMatching&&e[u].trim()===""){if(!e[$]&&o&&l==="EOL")return!0;u=i(u);continue}if(g&&!g.i&&((m=g==null?void 0:g.trimCharsBeforeMatching)!=null&&m.includes(e[u]))||g!=null&&g.i&&g.trimCharsBeforeMatching&&g.trimCharsBeforeMatching.map(C=>C.toLowerCase()).includes(e[u].toLowerCase())){if(o&&l==="EOL"&&!e[$])return!0;u=i(u);continue}let y=$>u?l[l.length-a]:l[a-1];if(!g.i&&e[u]===y||g.i&&y!==void 0&&e[u].toLowerCase()===y.toLowerCase()){if(d||(d=!0),E||(E=!0),a===l.length){if(O=!0,p!==g.maxMismatches)return!1}else a===1&&(S=!0);if(a-=1,s++,b())return!1;if(!a)return s!==l.length||p===g.maxMismatches||!c?u:!1}else if(!c&&!s&&(c=!0),g.maxMismatches&&p&&u){p-=1;for(let C=0;C<=p;C++){let v=$>u?l[l.length-a+1+C]:l[a-2-C],x=e[i(u)];if(v&&(!g.i&&e[u]===v||g.i&&e[u].toLowerCase()===v.toLowerCase())&&(!g.firstMustMatch||a!==l.length)){if(s++,b())return!1;a-=2,d=!0;break}else if(x&&v&&(!g.i&&x===v||g.i&&x.toLowerCase()===v.toLowerCase())&&(!g.firstMustMatch||a!==l.length)){if(!s&&!g.hungry)return!1;a-=1,d=!0;break}else if(v===void 0&&p>=0&&d&&(!g.firstMustMatch||O)&&(!g.lastMustMatch||S))return u}d||(w=u)}else return u===0&&a===1&&!g.lastMustMatch&&E?0:!1;if(w!==!1&&w!==u&&(w=!1),a<1)return u;u=i(u)}if(a>0)return o&&f==="EOL"?!0:g&&g.maxMismatches>=a&&E?w||0:!1}function oe(e,r,l,n,o){var c,w,E;if(M(o)&&de(o,"trimBeforeMatching")&&o&&typeof o.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_01] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(o.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let i=L(L({},Se),o);if(typeof i.trimCharsBeforeMatching=="string"&&(i.trimCharsBeforeMatching=Ee(i.trimCharsBeforeMatching)),i.trimCharsBeforeMatching=i.trimCharsBeforeMatching.map(p=>D(p)?p:String(p)),!D(r)||!r.length)return!1;if(!Number.isInteger(l)||l<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_02] the second argument should be a natural number. Currently it's of a type: ").concat(typeof l,", equal to:\n").concat(T(l,4)));let f,g;if(D(n))f=[n];else if(Array.isArray(n))f=n;else if(!n)f=n;else if(typeof n=="function")f=[],f.push(n);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof n,", equal to:\n").concat(T(n,4)));if(o&&!M(o))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_04] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof o,'", and equal to:\n').concat(T(o,4)));let a=0,s="";if((c=i==null?void 0:i.trimCharsBeforeMatching)!=null&&c.some((p,u)=>p.length>1?(a=u,s=p,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(a," is longer than 1 character, ").concat(s.length," (equals to ").concat(s,"). Please split it into separate characters and put into array as separate elements."));if(!f||!Array.isArray(f)||Array.isArray(f)&&!f.length||Array.isArray(f)&&f.length===1&&D(f[0])&&!f[0].trim()){if(typeof i.cb=="function"){let u,d=l;if((e==="matchLeftIncl"||e==="matchRight")&&(d+=1),e[5]==="L")for(let m=d;m--;){let $=r[m];if((!i.trimBeforeMatching||i.trimBeforeMatching&&($!=null&&$.trim()))&&(!((w=i.trimCharsBeforeMatching)!=null&&w.length)||$!==void 0&&!i.trimCharsBeforeMatching.includes($))){u=m;break}}else if(e.startsWith("matchRight"))for(let m=d;m<r.length;m++){let $=r[m];if((!i.trimBeforeMatching||i.trimBeforeMatching&&$.trim())&&(!((E=i.trimCharsBeforeMatching)!=null&&E.length)||!i.trimCharsBeforeMatching.includes($))){u=m;break}}if(u===void 0)return!1;let O=r[u],S=u+1,b="";return S&&S>0&&(b=r.slice(0,S)),e[5]==="L"||u&&u>0&&(b=r.slice(u)),i.cb(O,b,u)}let p="";throw o||(p=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_06] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat(p))}for(let p=0,u=f.length;p<u;p++){g=typeof f[p]=="function";let d=f[p],O,S,b="",m=l;e==="matchRight"?m+=1:e==="matchLeft"&&(m-=1);let $=ze(r,m,d,i,g,y=>e[5]==="L"?y-1:y+1);if($&&g&&typeof d=="function"&&d()==="EOL")return d()&&(!i.cb||i.cb(O,b,S))?d():!1;if(Number.isInteger($)&&(S=e.startsWith("matchLeft")?$-1:$+1,e[5]==="L"?b=r.slice(0,$):b=r.slice(S)),S<0&&(S=void 0),r[S]&&(O=r[S]),Number.isInteger($)&&(!i.cb||i.cb(O,b,S)))return d}return!1}function we(e,r,l,n){return oe("matchLeft",e,r,l,n)}function le(e,r,l,n){return oe("matchRightIncl",e,r,l,n)}function B(e,r,l,n){return oe("matchRight",e,r,l,n)}var Ke={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function Z(e){var g,a;let r=/^[0-9a-zA-Z]+$/;function l(s){return D(s)&&!s.trim()}if(M(e)){if(!Object.keys(e).length)throw new Error('string-range-expander/expander(): [THROW_ID_02] Input must be a plain object but it\'s been given as a plain object without any keys. However, "from" and "to" settings are obligatory!')}else{let s;throw e===void 0?s="but it is missing completely.":e===null?s="but it was given as null.":s="but it was given as ".concat(typeof e,", equal to:\n").concat(T(e,4),"."),new Error("string-range-expander/expander(): [THROW_ID_01] Input must be a plain object ".concat(s))}if(!V(e.from))throw new Error("string-range-expander/expander(): [THROW_ID_03] The input's \"from\" value resolvedOpts.from, is not a number! It's been given as ".concat(typeof e.from,", equal to ").concat(T(e.from)));if(!V(e.to))throw new Error("string-range-expander/expander(): [THROW_ID_04] The input's \"to\" value resolvedOpts.to, is not a number! It's been given as ".concat(typeof e.to,", equal to ").concat(T(e.to)));if(e!=null&&e.str&&!e.str[e.from]&&e.from!==e.to)throw new Error('string-range-expander/expander(): [THROW_ID_05] The given input string resolvedOpts.str ("'.concat(e.str,'") must contain the character at index "from" ("').concat(e.from,'")'));if(e!=null&&e.str&&!e.str[e.to-1])throw new Error('string-range-expander/expander(): [THROW_ID_06] The given input string, resolvedOpts.str ("'.concat(e.str,'") must contain the character at index before "to" ("').concat(e.to-1,'")'));if(e.from>e.to)throw new Error('string-range-expander/expander(): [THROW_ID_07] The given "from" index, "'.concat(e.from,'" is greater than "to" index, "').concat(e.to,"\". That's wrong!"));if(e.extendToOneSide===null||D(e.extendToOneSide)&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right"||!D(e.extendToOneSide)&&e.extendToOneSide!==void 0&&e.extendToOneSide)throw new Error('string-range-expander/expander(): [THROW_ID_08] The options value "extendToOneSide" is not recognisable! It\'s set to: "'.concat(e.extendToOneSide,'" (').concat(typeof e.extendToOneSide,'). It has to be either Boolean "false" or one of strings: "left" or "right"'));if(e!=null&&e.ifLeftSideIncludesThisThenCropTightly&&!D(e.ifLeftSideIncludesThisThenCropTightly))throw new Error('string-range-expander/expander(): [THROW_ID_09] The option "ifLeftSideIncludesThisThenCropTightly", is not a string! It\'s been given as '.concat(typeof e.ifLeftSideIncludesThisThenCropTightly,", equal to ").concat(T(e.ifLeftSideIncludesThisThenCropTightly)));if(e!=null&&e.ifLeftSideIncludesThisCropItToo&&!D(e.ifLeftSideIncludesThisCropItToo))throw new Error('string-range-expander/expander(): [THROW_ID_10] The option "ifLeftSideIncludesThisCropItToo", is not a string! It\'s been given as '.concat(typeof e.ifLeftSideIncludesThisCropItToo,", equal to ").concat(T(e.ifLeftSideIncludesThisCropItToo)));if(e!=null&&e.ifRightSideIncludesThisThenCropTightly&&!D(e.ifRightSideIncludesThisThenCropTightly))throw new Error('string-range-expander/expander(): [THROW_ID_11] The option "ifRightSideIncludesThisThenCropTightly", is not a string! It\'s been given as '.concat(typeof e.ifRightSideIncludesThisThenCropTightly,", equal to ").concat(T(e.ifRightSideIncludesThisThenCropTightly)));if(e!=null&&e.ifRightSideIncludesThisCropItToo&&!D(e.ifRightSideIncludesThisCropItToo))throw new Error('string-range-expander/expander(): [THROW_ID_12] The option "ifRightSideIncludesThisCropItToo", is not a string! It\'s been given as '.concat(typeof e.ifRightSideIncludesThisCropItToo,", equal to ").concat(T(e.ifRightSideIncludesThisCropItToo)));let n=L(L({},Ke),e),o=n.str,i=n.from,f=n.to;if(n.extendToOneSide!=="right"&&(l(o[i-1])&&(l(o[i-2])||n.ifLeftSideIncludesThisCropItToo.includes(o[i-2]))||o[i-1]&&n.ifLeftSideIncludesThisCropItToo.includes(o[i-1])||n.wipeAllWhitespaceOnLeft&&l(o[i-1]))){for(let s=i;s--;)if(!n.ifLeftSideIncludesThisCropItToo.includes(o[s])){if(o[s].trim()){n.wipeAllWhitespaceOnLeft||n.ifLeftSideIncludesThisCropItToo.includes(o[s+1])?i=s+1:i=s+2;break}else if(s===0){n.wipeAllWhitespaceOnLeft?i=0:i=1;break}}}if(n.extendToOneSide!=="left"&&(l(o[f])&&(n.wipeAllWhitespaceOnRight||l(o[f+1]))||n.ifRightSideIncludesThisCropItToo.includes(o[f]))){for(let s=f,c=o.length;s<c;s++)if(!n.ifRightSideIncludesThisCropItToo.includes(o[s])){if(o[s].trim()){n.wipeAllWhitespaceOnRight||n.ifRightSideIncludesThisCropItToo.includes(o[s-1])?f=s:f=s-1;break}else if(s===o.length-1){n.wipeAllWhitespaceOnRight?f=o.length:f=o.length-1;break}}}return(n.extendToOneSide!=="right"&&D(n.ifLeftSideIncludesThisThenCropTightly)&&n.ifLeftSideIncludesThisThenCropTightly&&(o[i-2]&&n.ifLeftSideIncludesThisThenCropTightly.includes(o[i-2])||o[i-1]&&n.ifLeftSideIncludesThisThenCropTightly.includes(o[i-1]))||n.extendToOneSide!=="left"&&D(n.ifRightSideIncludesThisThenCropTightly)&&n.ifRightSideIncludesThisThenCropTightly&&(o[f+1]&&n.ifRightSideIncludesThisThenCropTightly.includes(o[f+1])||o[f]&&n.ifRightSideIncludesThisThenCropTightly.includes(o[f])))&&(n.extendToOneSide!=="right"&&l(o[i-1])&&!n.wipeAllWhitespaceOnLeft&&(i-=1),n.extendToOneSide!=="left"&&l(o[f])&&!n.wipeAllWhitespaceOnRight&&(f+=1)),n.addSingleSpaceToPreventAccidentalConcatenation&&((g=o[i-1])!=null&&g.trim())&&((a=o[f])!=null&&a.trim())&&(!n.ifLeftSideIncludesThisThenCropTightly&&!n.ifRightSideIncludesThisThenCropTightly||!((!n.ifLeftSideIncludesThisThenCropTightly||n.ifLeftSideIncludesThisThenCropTightly.includes(o[i-1]))&&(!n.ifRightSideIncludesThisThenCropTightly||o[f]&&n.ifRightSideIncludesThisThenCropTightly.includes(o[f]))))&&(r.test(o[i-1])||r.test(o[f]))?[i,f," "]:[i,f]}var De="6.2.0";var Xe=De,Oe={lineLengthLimit:500,removeIndentations:!0,removeLineBreaks:!1,removeHTMLComments:!1,removeCSSComments:!0,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,breakToTheLeftOf:["</td","<html","</html","<head","</head","<meta","<link","<table","<script","<\/script","<!DOCTYPE","<style","</style","<title","<body","@media","</body","<!--[if","<!--<![endif","<![endif]"],mindTheInlineTags:["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]};function Ze(e,r){var ge,fe;let l=Date.now();if(!D(e))throw e===void 0?new Error("html-crush/crush(): [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error('html-crush/crush(): [THROW_ID_02] the first input argument must be string! It was given as "'.concat(typeof e,'", equal to:\n').concat(T(e,4)));if(r&&!M(r))throw new Error("html-crush/crush(): [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ".concat(typeof r,", equal to ").concat(T(r,4)));if(r&&Array.isArray(r.breakToTheLeftOf)&&r.breakToTheLeftOf.length){for(let N=0,t=r.breakToTheLeftOf.length;N<t;N++)if(!D(r.breakToTheLeftOf[N]))throw new TypeError("html-crush/crush(): [THROW_ID_04] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ".concat(N,' is of a type "').concat(typeof r.breakToTheLeftOf[N],'" and is equal to:\n').concat(T(r.breakToTheLeftOf[N],4)))}let n=new ye({limitToBeAddedWhitespace:!0}),o=L(L({},Oe),r);typeof o.removeHTMLComments=="boolean"&&(o.removeHTMLComments=o.removeHTMLComments?1:0);let i="";Array.isArray(o.breakToTheLeftOf)&&o.breakToTheLeftOf.length&&(i=[...new Set(o.breakToTheLeftOf.map(N=>N[0]))].join(""));let f={removeHTMLComments:!1,removeCSSComments:!1},g=null,a=null,s=!1,c=0,w=0,E=!1,p=!1,u=null,d=null,O=null,S=null,b,m=null,$=null,y=null,C=null,v=null,x=null,U=">};",j="<",Le="!",Ae=">",Ce="<",se="{},:;<>~+",ee=se,te=se,F=!0,R=e.length,Ie=Math.floor(R/2),ae=.01,ue;o.reportProgressFunc&&(ue=Math.floor(o.reportProgressFuncTo-(o.reportProgressFuncTo-o.reportProgressFuncFrom)*ae-o.reportProgressFuncFrom));let _,G=0,I="\n";if(e.includes("\r\n")?I="\r\n":e.includes("\r")&&(I="\r"),R){for(let t=0;t<R;t++){if(o.reportProgressFunc&&(R>1e3&&R<2e3?t===Ie&&o.reportProgressFunc(Math.floor((o.reportProgressFuncTo-o.reportProgressFuncFrom)/2)):R>=2e3&&(_=o.reportProgressFuncFrom+Math.floor(t/R*(ue||1)),_!==G&&(G=_,o.reportProgressFunc(_)))),w++,!b&&E&&e[t]==="}"&&e[t-1]==="}"&&(c+1>=o.lineLengthLimit?(n.push(t,t,I),c=0):(m=t,$=t,y=" ")),b&&typeof b=="number"&&t>=b&&(b=void 0),S!==null&&e.startsWith("<\/script",t)&&!H(e[t+8])){if((o.removeIndentations||o.removeLineBreaks)&&t>0&&e[~-t]&&!e[~-t].trim()){for(let h=t;h--;)if(e[h]==="\n"||e[h]==="\r"||e[h].trim()){h+1<t&&n.push(h+1,t);break}}S=null,b=!1,t+=8;continue}if(!b&&!E&&e.startsWith("<script",t)&&!H(e[t+7])){S=t,b=!0;let h="";(o.removeLineBreaks||o.removeIndentations)&&a!==null&&(a>0&&(h=I),n.push(a,t,h)),a=null,g=null}if(v!==null&&C===null&&!/\w/.test(e[t])){C=e.slice(v,t);let h=A(e,~-t);typeof h=="number"&&e[h]===">"&&!e[t].trim()&&A(e,t)?n.push(t,A(e,t)):h&&e[h]==="/"&&e[A(e,h)]===">"&&(!e[t].trim()&&A(e,t)&&n.push(t,A(e,t)),e[h+1]!==">"&&A(e,h+1)&&n.push(h+1,A(e,h+1)))}if(!b&&!E&&!u&&e[~-t]==="<"&&v===null&&(/\w/.test(e[t])?v=t:e[A(e,~-t)]==="/"&&/\w/.test(e[A(e,A(e,~-t))]||"")&&(v=A(e,A(e,~-t)))),!b&&(E||u)&&d!==null&&e[t]==="*"&&e[t+1]==="/"&&([m,$]=Z({str:e,from:d,to:t+2,ifLeftSideIncludesThisThenCropTightly:ee||"",ifRightSideIncludesThisThenCropTightly:te||""}),d=null,m!=null?n.push(m,$):(c+=1,t+=1),b=t+2),!b&&(E||u)&&d===null&&e[t]==="/"&&e[t+1]==="*"&&(f.removeCSSComments||(f.removeCSSComments=!0),o.removeCSSComments&&(d=t)),p&&e.startsWith("![endif",t+1)&&(p=!1),!b&&!E&&!u&&O!==null){let h;e.startsWith("-->",t)?h=3:e[t]===">"&&e[t-1]==="]"&&(h=1),h&&([m,$]=Z({str:e,from:O,to:t+h}),O=null,m!=null?o.lineLengthLimit&&w-($-m)>=o.lineLengthLimit?(n.push(m,$,I),w=-h):(n.push(m,$),w-=$-m):(c+=h-1,t+=h-1),b=t+h)}if(!b&&!E&&!u&&(e.startsWith("<!--",t)||o.removeHTMLComments===2&&e.startsWith("<![endif",t))&&O===null&&(e.startsWith("[if",t+4)?(p||(p=!0),o.removeHTMLComments===2&&(O=t)):o.removeHTMLComments&&(!p||o.removeHTMLComments===2)&&(O=t),f.removeHTMLComments||(f.removeHTMLComments=!0)),!b&&E&&d===null&&e.startsWith("</style",t)&&!H(e[t+7])?E=!1:!b&&!E&&d===null&&e.startsWith("<style",t)&&!H(e[t+6])&&(E=!0,(o.removeLineBreaks||o.removeIndentations)&&o.breakToTheLeftOf.includes("<style")&&e.startsWith(' type="text/css">',t+6)&&e[t+24]&&n.push(t+23,t+23,I)),!b&&!u&&"\"'".includes(e[t])&&e.endsWith("style=",t)&&(u=t),!b&&!e[t].trim())a===null&&(a=t);else if(!b&&!((E||u)&&d!==null)){if(a!==null){if(o.removeLineBreaks&&(c+=1),F)F=!1,(o.removeIndentations||o.removeLineBreaks)&&n.push(0,t);else if(o.removeIndentations&&!o.removeLineBreaks&&(!s&&g!==null&&t>g?n.push(g+1,t):a+1<t&&(e.endsWith("]>",a)||e.endsWith("-->",a)||e.startsWith("<![",t)||e.startsWith("<!--<![",t)?n.push(a,t):e[a]===" "?n.push(a+1,t):e[~-t]===" "?n.push(a,~-t):n.push(a,t," "))),o.removeLineBreaks||u){if(i.includes(e[t])&&le(e,t,o.breakToTheLeftOf)){!("\r\n".includes(e[~-t])&&a===~-t)&&!(e[~-t]==="\n"&&e[t-2]==="\r"&&a===t-2)&&n.push(a,t,I),m=null,$=null,y=null,a=null,c=1;continue}let h=" ";e[t]==="<"&&B(e,t,o.mindTheInlineTags,{cb:q=>!q||!/\w/.test(q)})||(e[~-a]&&Ae.includes(e[~-a])&&Ce.includes(e[t])||(E||u)&&d===null&&(ee.includes(e[~-a])||te.includes(e[t]))||e.startsWith("!important",t)&&!p||u&&(e[~-a]==="'"||e[~-a]==='"')||e[~-a]==="}"&&e.startsWith("</style",t)||e[t]===">"&&("'\"".includes(e[X(e,t)])||e[A(e,t)]==="<")||e[t]==="/"&&e[A(e,t)]===">")&&(h="",e[t]==="/"&&e[t+1]===">"&&A(e,t)&&A(e,t)>t+1&&(n.push(t+1,A(e,t)),c-=A(e,t)-t+1)),E&&e[t]==="}"&&a&&e[a-1]==="}"&&(h=" "),h!=null&&h.length&&(c+=1),o.lineLengthLimit?c>=o.lineLengthLimit||!e[t+1]||e[t]===">"||e[t]==="/"&&e[t+1]===">"?((c>o.lineLengthLimit||c===o.lineLengthLimit&&((ge=e[t+1])!=null&&ge.trim())&&!U.includes(e[t])&&!j.includes(e[t+1]))&&(h=I,c=1),(c>o.lineLengthLimit||!(h===" "&&t===a+1))&&(n.push(a,t,h),g=null),m=null,$=null,y=null):(m===null||a<m)&&(m=a,$=t,y=h):t===a+1&&h===" "||n.push(a,t,h)}a=null,s||(s=!0)}else F&&(F=!1),o.removeLineBreaks&&(c+=1);s||(s=!0)}if(!b&&!F&&t!==0&&o.removeLineBreaks&&(o.lineLengthLimit||i)&&!e.startsWith("</a",t)){if(i&&le(e,t,o.breakToTheLeftOf)&&e.slice(0,t).trim()&&(!e.startsWith("<![endif]",t)||!we(e,t,"<!--"))){n.push(t,t,I),m=null,$=null,y=null,c=1;continue}else if(o.lineLengthLimit&&c<=o.lineLengthLimit){if(!e[t+1]||j.includes(e[t])&&!Le.includes(e[t])||U.includes(e[t])||!e[t].trim()){if(m!==null&&$!==null&&(m!==$||y!=null&&y.length)){let h=y;e[t].trim()&&((fe=e[t+1])!=null&&fe.trim())&&c+(y?y.length:0)>o.lineLengthLimit&&(h=I),(c+(h?h.length:0)>o.lineLengthLimit||!(h===" "&&$===m+1&&e[m]===" "))&&(e[~-m]==="}"&&e[$]==="{"||(n.push(m,$,h),g=null))}e[t].trim()&&(j.includes(e[t])||e[~-t]&&U.includes(e[~-t]))&&D(x)&&(!C||!o.mindTheInlineTags.includes(C))&&!(e[t]==="<"&&B(e,t,o.mindTheInlineTags,{cb:h=>!h||!/\w/.test(h)}))&&!(e[t]==="<"&&B(e,t,o.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:h=>!h||!/\w/.test(h)}))?(m=t,$=t,y=null):d===null&&m!==null&&(u||!o.mindTheInlineTags||!Array.isArray(o.mindTheInlineTags)||Array.isArray(o.mindTheInlineTags.length)&&!o.mindTheInlineTags.length||!D(C)||Array.isArray(o.mindTheInlineTags)&&o.mindTheInlineTags.length&&D(C)&&!o.mindTheInlineTags.includes(C))&&!(e[t]==="<"&&B(e,t,o.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:h=>!h||!/\w/.test(h)}))&&(m=null,$=null,y=null)}}else if(o.lineLengthLimit)if(j.includes(e[t])&&!(e[t]==="<"&&B(e,t,o.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:h=>!h||!/\w/.test(h)})))if(m!==null&&$!==null&&(m!==$||y!=null&&y.length)){let h=y!=null&&y.length?y.length:0;c-($-m-h)-1>o.lineLengthLimit||(n.push(m,$,y),c-($-m-h)-1===o.lineLengthLimit&&(n.push(t,t,I),c=0),m=null,$=null,y=null)}else n.push(t,t,I),c=0;else e[t+1]&&U.includes(e[t])&&D(C)&&Array.isArray(o.mindTheInlineTags)&&o.mindTheInlineTags.length&&!o.mindTheInlineTags.includes(C)?m!==null&&$!==null&&(m!==$||y!=null&&y.length)||(n.push(t+1,t+1,I),c=0):e[t].trim()&&(e[t+1]||m!==null&&$!==null&&(m!==$||y!=null&&y.length)&&n.push(m,$,I))}if(!b&&!F&&o.removeLineBreaks&&o.lineLengthLimit&&c>=o.lineLengthLimit&&m!==null&&$!==null&&!U.includes(e[t])&&!j.includes(e[t])&&!"/".includes(e[t])&&!(c===o.lineLengthLimit&&e[t+1]&&!e[t+1].trim())){let h=I;e[t+1]&&!e[t+1].trim()&&c===o.lineLengthLimit&&(h=y),h===I&&!e[~-m].trim()&&X(e,m)&&(m=X(e,m)+1),n.push(m,$,h),c=t-$,e[t].length&&(c+=1),m=null,$=null,y=null}if((!b&&e[t]==="\n"||e[t]==="\r"&&(!e[t+1]||e[t+1]&&e[t+1]!=="\n"))&&(g=t,s&&(s=!1),!o.removeLineBreaks&&a!==null&&a<t&&e[t+1]&&e[t+1]!=="\r"&&e[t+1]!=="\n"&&n.push(a,t)),e[t+1]||(E&&d!==null?n.push([...Z({str:e,from:d,to:t,ifLeftSideIncludesThisThenCropTightly:ee||"",ifRightSideIncludesThisThenCropTightly:te||""})]):a&&e[t]!=="\n"&&e[t]!=="\r"?n.push(a,t+1):a&&(e[t]==="\r"&&e[t+1]==="\n"||e[t]==="\n"&&e[t-1]!=="\r")&&n.push(a,t)),!b&&u&&u<t&&e[u]===e[t]&&(u=null),!b&&!E&&e.startsWith("<pre",t)&&!H(e[t+4])){let h=e.indexOf("</pre",t+5);h>0&&(b=h)}if(!b&&!E&&e.startsWith("<code",t)&&!H(e[t+5])){let h=e.indexOf("</code",t+5);h>0&&(b=h)}if(!b&&e.startsWith("<![CDATA[",t)){let h=e.indexOf("]]>",t+9);h>0&&(b=h)}if(!b&&!E&&!u&&v!==null&&e[t]===">"&&(e[A(e,t)]==="<"&&(x=C),v=null,C=null),e[t]==="<"&&x!==null&&(x=null),!b&&E&&e[t]==="{"&&e[t+1]==="{"){let h=e.indexOf("}}",t+2);h!==-1&&(b=h+2)}let ne=!0}let N=n.current();if(N){let t=o.reportProgressFuncTo-(o.reportProgressFuncTo-o.reportProgressFuncFrom)*ae,ne=be(e,N,q=>{o.reportProgressFunc&&R>=2e3&&(_=Math.floor(t+(o.reportProgressFuncTo-t)*(q/100)),_!==G&&(G=_,o.reportProgressFunc(_)))}),h=ne.length;return{log:{timeTakenInMilliseconds:Date.now()-l,originalLength:R,cleanedLength:h,bytesSaved:Math.max(R-h,0),percentageReducedOfOriginal:R?Math.round(Math.max(R-h,0)*100/R):0},ranges:N,applicableOpts:f,result:ne}}}return{log:{timeTakenInMilliseconds:Date.now()-l,originalLength:R,cleanedLength:R,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:f,ranges:null,result:e}}return Pe(et);})();
|
|
10
|
+
"use strict";var htmlCrush=(()=>{var re=Object.defineProperty,Je=Object.defineProperties,Ge=Object.getOwnPropertyDescriptor,qe=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertyNames,Se=Object.getOwnPropertySymbols;var Oe=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable;var he=(e,r,o)=>r in e?re(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,R=(e,r)=>{for(var o in r||(r={}))Oe.call(r,o)&&he(e,o,r[o]);if(Se)for(var o of Se(r))ze.call(r,o)&&he(e,o,r[o]);return e},we=(e,r)=>Je(e,qe(r));var Ke=(e,r)=>{for(var o in r)re(e,o,{get:r[o],enumerable:!0})},Qe=(e,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Ye(r))!Oe.call(e,i)&&i!==o&&re(e,i,{get:()=>r[i],enumerable:!(n=Ge(r,i))||n.enumerable});return e};var Xe=e=>Qe(re({},"__esModule",{value:!0}),e);var X=(e,r,o)=>he(e,typeof r!="symbol"?r+"":r,o);var pt={};Ke(pt,{crush:()=>$t,defaults:()=>ke,version:()=>mt});function Ze(){let e=[],r=0,o=!1;return{append(n){return o?!1:r+n.length>1999?(e.push("\u2026"),r+=1,o=!0,!1):(e.push(n),r+=n.length,!0)},result(){return e.join("")},stopped(){return o}}}function et(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function ie(e,r){if(e.append('"')){for(let o=0;o<r.length&&!e.stopped();o+=1){let n=r.charCodeAt(o);n===34?e.append('\\"'):n===92?e.append("\\\\"):n===8?e.append("\\b"):n===9?e.append("\\t"):n===10?e.append("\\n"):n===12?e.append("\\f"):n===13?e.append("\\r"):n<32||n===8232||n===8233||n>=55296&&n<=57343?e.append(et(n)):e.append(r[o])}e.append('"')}}function tt(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function Le(e,r){e.append("Symbol(");let o=String(r);o.length>8&&ie(e,o.slice(7,-1)),e.append(")")}function Ae(e,r){typeof r=="symbol"?Le(e,r):ie(e,String(r))}function p(e,r=0){let o=Ze(),n=r===4?4:0,i=new WeakSet,l=0;function h(s){n&&o.append(" ".repeat(s*n))}function u(s,f){s&&o.append(","),n&&(o.append("\n"),h(f+1))}function c(s,f,y){n&&f&&(o.append("\n"),h(y)),o.append(s)}function a(s,f){Object.prototype.hasOwnProperty.call(s,"value")?$(s.value,f):o.append(tt(s))}function b(s,f){let y;try{y=Reflect.getOwnPropertyDescriptor(s,"length")}catch(d){o.append("[Uninspectable]");return}let m=y==null?void 0:y.value;if(!Number.isSafeInteger(m)||m<0){o.append("[Uninspectable]");return}o.append("[");let I=!1;for(let d=0;d<m&&!o.stopped();d+=1){if(u(I,f),I=!0,l>=50){o.append("[MaxEntries]");break}l+=1;let E;try{E=Reflect.getOwnPropertyDescriptor(s,String(d))}catch(v){o.append("[Uninspectable]");continue}E!=null&&E.enumerable?a(E,f+1):o.append("[Empty]")}c("]",I,f)}function A(s,f){let y;try{y=Reflect.ownKeys(s)}catch(I){o.append("[Uninspectable]");return}o.append("{");let m=!1;for(let I of y){if(o.stopped())break;if(l>=50){u(m,f),m=!0,ie(o,"\u2026"),o.append(n?": ":":"),o.append("[MaxEntries]");break}l+=1;let d;try{d=Reflect.getOwnPropertyDescriptor(s,I)}catch(E){u(m,f),m=!0,Ae(o,I),o.append(n?": ":":"),o.append("[Uninspectable]");continue}d!=null&&d.enumerable&&(u(m,f),m=!0,Ae(o,I),o.append(n?": ":":"),a(d,f+1))}c("}",m,f)}function C(s,f){if(i.has(s)){o.append("[Circular]");return}if(f>=5){o.append("[MaxDepth]");return}let y;try{y=Array.isArray(s)}catch(m){o.append("[Uninspectable]");return}i.add(s);try{y?b(s,f):A(s,f)}finally{i.delete(s)}}function $(s,f){s===null?o.append("null"):typeof s=="string"?ie(o,s):typeof s=="number"?o.append(Object.is(s,-0)?"-0":String(s)):typeof s=="boolean"?o.append(s?"true":"false"):typeof s>"u"?o.append("undefined"):typeof s=="bigint"?o.append("".concat(s,"n")):typeof s=="symbol"?Le(o,s):typeof s=="function"?o.append("[Function]"):C(s,f)}try{return $(e,0),o.result()}catch(s){return"[Uninspectable]"}}var bt=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),nt=Object.prototype.hasOwnProperty;function q(e){if(!O(e)||e.length!==1)return!1;let r=e.charCodeAt(0);return r<128?r>64&&r<91||r>96&&r<123:e.toUpperCase()!==e.toLowerCase()}function k(e){if(!O(e)||!e)return!1;let r=e.charCodeAt(0);return r<128?r===32||r>8&&r<14:!e[0].trim()}function W(e){if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function O(e){return typeof e=="string"}function Ce(e){return Number.isFinite(e)}function H(e){return Number.isSafeInteger(e)&&e>=0}var De,Tt=(De=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:De.get;var yt=Date.prototype.getTime;function j(e){return e!=null}function Ie(e,r){return W(e)&&O(r)&&nt.call(e,r)}var rt={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function z(e,r){if(!Array.isArray(e)||!e.length)return e;let o=R(R({},rt),r),n,i;if(o.strictlyTwoElementsInRangeArrays&&!e.every((u,c)=>!Array.isArray(u)||u.length!==2?(n=c,i=u.length,!1):!0))throw new TypeError("ranges-sort/rSort(): [THROW_ID_01] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ".concat(n,"th range (").concat(p(e[n],4),") has not two but ").concat(i," elements!"));if(!e.every((u,c)=>!Array.isArray(u)||!Number.isInteger(u[0])||u[0]<0||!Number.isInteger(u[1])||u[1]<0?(n=c,!1):!0))throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ".concat(n,"th range (").concat(p(e[n],4),") does not consist of only natural numbers!"));let l=e.length**2,h=0;return Array.from(e).sort((u,c)=>(o.progressFn&&(h+=1,o.progressFn(Math.floor(h*100/l))),u[0]===c[0]?u[1]<c[1]?-1:u[1]>c[1]?1:0:u[0]<c[0]?-1:1))}var it={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function ge(e,r){function o(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;if(r&&!o(r))throw new TypeError("ranges-merge/rMerge(): [THROW_ID_01] the second input argument must be a plain object. It was given as:\n".concat(p(r,4)," (type ").concat(typeof r,")"));let n=R(R({},it),r);if(n.progressFn&&o(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_02] opts.progressFn must be a function! It was given of a type: "'.concat(typeof n.progressFn,'", equal to ').concat(p(n.progressFn,4)));if(n.mergeType!==1&&n.mergeType!==2&&n.mergeType!=="1"&&n.mergeType!=="2")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_03] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof n.mergeType,'", equal to ').concat(p(n.mergeType,4)));if(typeof n.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof n.joinRangesThatTouchEdges,'", equal to ').concat(p(n.joinRangesThatTouchEdges,4)));let i=n.progressFn,l=n.joinRangesThatTouchEdges,h=[];for(let s of e)Array.isArray(s)&&(s[2]!==void 0||s[0]!==s[1])&&h.push([...s]);let u,c,a;i?u=z(h,{progressFn:s=>{a=Math.floor(s/5),a!==c&&(c=a,i(a))}}):u=z(h);let b=u.length-1,A=n.mergeType===2||n.mergeType==="2",C=u.length;for(let s=b;s>=0;s--){let f=u[s];for(i&&s<b&&(a=Math.floor((1-(s+1)/b)*78)+21,a!==c&&a>c&&(c=a,i(a)));C<u.length;){let y=u[C],m=y[0]===f[0];if(!m&&(l?y[0]>f[1]:y[0]>=f[1]))break;let I=y[1]>=f[1];I&&(f[1]=y[1]),y[2]!==void 0&&(m||I)&&f[2]!==null&&(y[2]===null&&f[2]!==null?f[2]=null:f[2]!=null?A&&m?f[2]=y[2]:f[2]+=y[2]:f[2]=y[2]),C+=1}C-=1,u[C]=f}let $=u.length-C;for(let s=0;s<$;s++)u[s]=u[C+s];return u.length=$,u.length?u:null}function oe(e){if(typeof e=="number")return Number.isInteger(e)&&e>=0;if(typeof e!="string"||!e.trim())return!1;let r=Number(e);return Number.isInteger(r)&&r>=0}function ve(e,r,o){let n=0,i=0;if(e===void 0&&r===void 0&&o===void 0)throw new Error("ranges-apply/rApply(): [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply/rApply(): [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(p(e,4)));if(r!=null&&!Array.isArray(r))throw new TypeError("ranges-apply/rApply(): [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof r,", equal to: ").concat(p(r,4)));if(o&&typeof o!="function")throw new TypeError("ranges-apply/rApply(): [THROW_ID_04] the third input argument must be a function (or falsy)! Currently it's: ".concat(typeof o,", equal to: ").concat(p(o,4)));if(!(r!=null&&r.some(Boolean)))return e;let l;Array.isArray(r)&&!Array.isArray(r[0])&&oe(r[0])&&oe(r[1])?l=[Array.from(r)]:l=Array.from(r);let h=l.length,u=0;l.forEach((b,A)=>{if(b){if(o&&(n=Math.floor(u/h*10),n!==i&&(i=n,o(n))),!Array.isArray(b))throw new TypeError("ranges-apply/rApply(): [THROW_ID_05] ranges array, second input arg., has ".concat(A,"th element not an array: ").concat(p(b,4),", which is ").concat(typeof b));if(!oe(b[0]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_06] ranges array, second input arg. has ".concat(A,"th element, array ").concat(p(b),". Its first element is not a non-negative integer or string index, but ").concat(typeof b[0],", equal to: ").concat(p(b[0],4),"."));if(typeof b[0]=="string"&&(l[A]=[...b],l[A][0]=Number(b[0])),!oe(b[1]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_07] ranges array, second input arg. has ".concat(A,"th element, array ").concat(p(b),". Its second element is not a non-negative integer or string index, but ").concat(typeof b[1],", equal to: ").concat(p(b[1],4),"."));typeof b[1]=="string"&&(l[A]===b&&(l[A]=[...b]),l[A][1]=Number(b[1])),u+=1}});let c=o?ge(l,{progressFn:b=>{n=10+Math.floor(b/10),n!==i&&(i=n,o(n))}}):ge(l),a=(c==null?void 0:c.length)||0;if(c&&a>0){let b=e.slice(c[a-1][1]);e=c.reduce((A,C,$,s)=>{o&&(n=20+Math.floor($/a*80),n!==i&&(i=n,o(n)));let f=$===0?0:s[$-1][1],y=s[$][0];return"".concat(A).concat(e.slice(f,y)).concat(s[$][2]||"")},""),e+=b}return e}function le(e,r=1){let o="\xA0";function n(l){return Array.from(l).reverse().join("")}function i(l,h,u){let c=u?"\n":"\r",a=u?"\r":"\n";if(!l)return l;let b=0,A=0,C="";for(let $=0,s=l.length;$<s;$++)(l[$]===c||l[$]===a&&l[$-1]!==c)&&A++,"\r\n".includes(l[$])||l[$]===o?(b=0,l[$]===o?C+=l[$]:l[$]===c?A<=h&&(C+=l[$],l[$+1]===a&&(C+=l[$+1],$++)):l[$]===a&&(l==null?void 0:l[$-1])!==c&&A<=h&&(C+=l[$])):(b++,!l[$+1]&&!A&&(C+=" "));return C}if(typeof e=="string"&&e.length){let l=1;typeof+r=="number"&&Number.isInteger(+r)&&+r>=0&&(l=+r);let h="",u="";if(!e.trim())h=e;else if(!e[0].trim()){for(let c=0,a=e.length;c<a;c++)if(e[c].trim()){h=e.slice(0,c);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===o)){for(let c=e.length;c--;)if(e[c].trim()){u=e.slice(c+1);break}}return"".concat(i(h,l,!1)).concat(e.trim()).concat(n(i(n(u),l,!0)))}return e}var ot={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function lt(e,r){function o(a){return!!a&&typeof a=="object"&&!Array.isArray(a)}if(!Array.isArray(e)||!e.length)return null;if(r&&!o(r))throw new TypeError("ranges-push/rMerge(): [THROW_ID_10] the second input argument must be a plain object. It was given as:\n".concat(p(r,4)," (type ").concat(typeof r,")"));let n=R(R({},ot),r);if(n.progressFn&&o(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new TypeError('ranges-push/rMerge(): [THROW_ID_11] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof n.progressFn,'", equal to ').concat(p(n.progressFn,4)));if(![1,2,"1","2"].includes(n.mergeType))throw new TypeError('ranges-push/rMerge(): [THROW_ID_12] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof n.mergeType,'", equal to ').concat(p(n.mergeType,4)));if(typeof n.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-push/rMerge(): [THROW_ID_13] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof n.joinRangesThatTouchEdges,'", equal to ').concat(p(n.joinRangesThatTouchEdges,4)));let i=e.filter(a=>Array.isArray(a)).map(a=>[...a]).filter(a=>a[2]!==void 0||a[0]!==a[1]),l,h,u;n.progressFn?l=z(i,{progressFn:a=>{u=Math.floor(a/5),u!==h&&(h=u,n.progressFn!=null&&n.progressFn(u))}}):l=z(i);let c=l.length-1;for(let a=c;a>0;a--)n.progressFn&&(u=Math.floor((1-a/c)*78)+21,u!==h&&u>h&&(h=u,n.progressFn(u))),(l[a][0]<=l[a-1][0]||!n.joinRangesThatTouchEdges&&l[a][0]<l[a-1][1]||n.joinRangesThatTouchEdges&&l[a][0]<=l[a-1][1])&&(l[a-1][0]=Math.min(l[a][0],l[a-1][0]),l[a-1][1]=Math.max(l[a][1],l[a-1][1]),l[a][2]!==void 0&&(l[a-1][0]>=l[a][0]||l[a-1][1]<=l[a][1])&&l[a-1][2]!==null&&(l[a][2]===null&&l[a-1][2]!==null?l[a-1][2]=null:l[a-1][2]!=null?+n.mergeType==2&&l[a-1][0]===l[a][0]?l[a-1][2]=l[a][2]:l[a-1][2]+=l[a][2]:l[a-1][2]=l[a][2]),l.splice(a,1),a=l.length);return l.length?l:null}var st={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1};function Re(e){return e[2]===void 0&&e[0]===e[1]}function at(e){let r=-1;for(let o=0,n=e.length;o<n;o++){let i=e[o];if(Array.isArray(i)){if(i[0]<r)return!1;r=i[0]}}return!0}var Ve=class{constructor(e){X(this,"ranges");X(this,"opts");X(this,"sorted");if(e!=null&&!W(e))throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_01] The options argument must be a plain object. It was given as ".concat(p(e,4)," (type ").concat(typeof e,")."));let r=R(R({},st),e);if(r.mergeType&&r.mergeType!==1&&r.mergeType!==2)if(O(r.mergeType)&&r.mergeType.trim()==="1")r.mergeType=1;else if(O(r.mergeType)&&r.mergeType.trim()==="2")r.mergeType=2;else throw new Error('ranges-push/Ranges/constructor(): [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof r.mergeType,'", equal to ').concat(p(r.mergeType,4)));this.opts=r,this.ranges=[],this.sorted=!0}add(e,r,o){var l;if(e==null&&r==null)return;if(j(e)&&!j(r)){if(Array.isArray(e)){if(e.length){if(e.some(h=>Array.isArray(h))){e.forEach(h=>{Array.isArray(h)&&this.add(...h)});return}e.length&&H(+e[0])&&H(+e[1])&&this.add(...e)}return}throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_03] the first input argument, "from" is set ('.concat(p(e),') but second-one, "to" is not (').concat(p(r),")"))}else if(!j(e)&&j(r))throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_04] the second input argument, "to" is set ('.concat(p(r),') but first-one, "from" is not (').concat(p(e),")"));let n=+e,i=+r;if(H(n)&&H(i)){if(j(o)&&!O(o)&&!Ce(o))throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_05] The third argument, the value to add, was given not as string but ".concat(typeof o,", equal to:\n").concat(p(o,4)));if(j(this.ranges)&&Array.isArray(this.last())&&n===this.last()[1]){if(this.last()[1]=i,this.last()[2],this.last()[2]!==null&&j(o)){let h=this.last()[2]&&this.last()[2].length&&(!((l=this.opts)!=null&&l.mergeType)||this.opts.mergeType===1)?"".concat(this.last()[2]).concat(o):o;this.opts.limitToBeAddedWhitespace&&(h=le(h,this.opts.limitLinebreaksCount)),O(h)&&!h.length||(this.last()[2]=h)}}else{this.ranges||(this.ranges=[]);let h=this.last();h&&n<h[0]&&(this.sorted=!1);let u=o!==void 0&&!(O(o)&&!o.length)?[n,i,o&&this.opts.limitToBeAddedWhitespace?le(o,this.opts.limitLinebreaksCount):o]:[n,i];this.ranges.push(u)}}else throw H(n)?new TypeError('ranges-push/Ranges/add(): [THROW_ID_07] "to" value, the second input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof r,'" equal to: ').concat(p(r,4))):new TypeError('ranges-push/Ranges/add(): [THROW_ID_06] "from" value, the first input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof e,'" equal to: ').concat(p(e,4)))}push(e,r,o){this.add(e,r,o)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=lt(this.ranges,{mergeType:this.opts.mergeType}),this.sorted=!0,this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>j(e[2])?[e[0],e[1],le(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}firstCovers(e){if(!H(e))throw new TypeError("ranges-push/Ranges/firstCovers(): [THROW_ID_08] the input argument must be a natural number or zero! It was given as ".concat(p(e,4)," (type ").concat(typeof e,")"));if(!Array.isArray(this.ranges)||!this.ranges.length)return!1;let r=null;if(this.sorted){for(let n=0,i=this.ranges.length;n<i;n++){let l=this.ranges[n];if(!(!Array.isArray(l)||Re(l))){if(r===null){if(l[0]!==0)return!1;r=l[1]}else{if(l[0]>r)break;l[1]>r&&(r=l[1])}if(r>=e)return!0}}return r!==null&&r>=e}let o=!0;for(;o;){o=!1;for(let n=0,i=this.ranges.length;n<i;n++){let l=this.ranges[n];if(!(!Array.isArray(l)||Re(l))){if(l[0]<0)return!1;(r===null?l[0]===0:l[0]<=r&&l[1]>r)&&(r=l[1],o=!0)}}}return r!==null&&r>=e}wipe(){this.ranges=[],this.sorted=!0}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&H(e[0][0]))this.ranges=Array.from(e),this.sorted=at(this.ranges);else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_09] Single range was given but we expected array of arrays! The first element, ".concat(p(e[0],4)," should be an array and its first element should be an integer, a string index."));else this.ranges=[],this.sorted=!0}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var ce="\xA0";function me(e){return e===32||e>=9&&e<=13||e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function B(e,r=0){if(typeof e!="string"||!e.length)return null;(!r||typeof r!="number")&&(r=0);let o=e[r+1];if(!o)return null;if(!me(o.charCodeAt(0)))return r+1;if(o=e[r+2],o&&!me(o.charCodeAt(0)))return r+2;for(let n=r+3,i=e.length;n<i;n++)if(!me(e.charCodeAt(n)))return n;return null}function ut({str:e,idx:r,stopAtNewlines:o,stopAtRawNbsp:n}){if(typeof e!="string"||!e.length||((!r||typeof r!="number")&&(r=0),r<1))return null;if(e[~-r]&&(e[~-r].trim()||o&&"\n\r".includes(e[~-r])||n&&e[~-r]===ce))return~-r;if(e[r-2]&&(e[r-2].trim()||o&&"\n\r".includes(e[r-2])||n&&e[r-2]===ce))return r-2;for(let i=r;i--;)if(e[i]&&(e[i].trim()||o&&"\n\r".includes(e[i])||n&&e[i]===ce))return i;return null}function se(e,r=0){return ut({str:e,idx:r,stopAtNewlines:!1,stopAtRawNbsp:!1})}function Ne(e){return typeof e!="string"?e:e.length?[e]:[]}var Me={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},ft=e=>e+1;function ht(e,r,o,n,i=!1,l=ft){var d;let h=typeof o=="function"?o():o;if(+r<0&&i&&h==="EOL")return h;let u=R(R({},Me),n);if(r>=e.length&&!i)return!1;let c=i?1:o.length,a=0,b=!1,A=!1,C=!1,$=u.maxMismatches,s=r,f=!1,y=!1,m=!1;function I(){return a===1&&$<u.maxMismatches-1}for(;e[s];){let E=l(s);if(u.trimBeforeMatching&&e[s].trim()===""){if(!e[E]&&i&&o==="EOL")return!0;s=l(s);continue}if(u&&!u.i&&((d=u==null?void 0:u.trimCharsBeforeMatching)!=null&&d.includes(e[s]))||u!=null&&u.i&&u.trimCharsBeforeMatching&&u.trimCharsBeforeMatching.map(V=>V.toLowerCase()).includes(e[s].toLowerCase())){if(i&&o==="EOL"&&!e[E])return!0;s=l(s);continue}let v=E>s?o[o.length-c]:o[c-1];if(!u.i&&e[s]===v||u.i&&v!==void 0&&e[s].toLowerCase()===v.toLowerCase()){if(f||(f=!0),C||(C=!0),c===o.length){if(y=!0,$!==u.maxMismatches)return!1}else c===1&&(m=!0);if(c-=1,a++,I())return!1;if(!c)return a!==o.length||$===u.maxMismatches||!b?s:!1}else if(!b&&!a&&(b=!0),u.maxMismatches&&$&&s){$-=1;for(let V=0;V<=$;V++){let P=E>s?o[o.length-c+1+V]:o[c-2-V],J=e[l(s)];if(P&&(!u.i&&e[s]===P||u.i&&e[s].toLowerCase()===P.toLowerCase())&&(!u.firstMustMatch||c!==o.length)){if(a++,I())return!1;c-=2,f=!0;break}else if(J&&P&&(!u.i&&J===P||u.i&&J.toLowerCase()===P.toLowerCase())&&(!u.firstMustMatch||c!==o.length)){if(!a&&!u.hungry)return!1;c-=1,f=!0;break}else if(P===void 0&&$>=0&&f&&(!u.firstMustMatch||y)&&(!u.lastMustMatch||m))return s}f||(A=s)}else return s===0&&c===1&&!u.lastMustMatch&&C?0:!1;if(A!==!1&&A!==s&&(A=!1),c<1)return s;s=l(s)}if(c>0)return i&&h==="EOL"?!0:u&&u.maxMismatches>=c&&C?A||0:!1}function $e(e,r,o,n,i){var b,A,C;if(W(i)&&Ie(i,"trimBeforeMatching")&&i&&typeof i.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_01] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(i.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let l=R(R({},Me),i);if(typeof l.trimCharsBeforeMatching=="string"&&(l.trimCharsBeforeMatching=Ne(l.trimCharsBeforeMatching)),l.trimCharsBeforeMatching=l.trimCharsBeforeMatching.map($=>O($)?$:String($)),!O(r)||!r.length)return!1;if(!Number.isInteger(o)||o<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_02] the second argument should be a natural number. Currently it's of a type: ").concat(typeof o,", equal to:\n").concat(p(o,4)));let h,u;if(O(n))h=[n];else if(Array.isArray(n))h=n;else if(!n)h=n;else if(typeof n=="function")h=[],h.push(n);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof n,", equal to:\n").concat(p(n,4)));if(i&&!W(i))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_04] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof i,'", and equal to:\n').concat(p(i,4)));let c=0,a="";if((b=l==null?void 0:l.trimCharsBeforeMatching)!=null&&b.some(($,s)=>$.length>1?(c=s,a=$,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(c," is longer than 1 character, ").concat(a.length," (equals to ").concat(a,"). Please split it into separate characters and put into array as separate elements."));if(!h||!Array.isArray(h)||Array.isArray(h)&&!h.length||Array.isArray(h)&&h.length===1&&O(h[0])&&!h[0].trim()){if(typeof l.cb=="function"){let s,f=o;if((e==="matchLeftIncl"||e==="matchRight")&&(f+=1),e[5]==="L")for(let d=f;d--;){let E=r[d];if((!l.trimBeforeMatching||l.trimBeforeMatching&&(E!=null&&E.trim()))&&(!((A=l.trimCharsBeforeMatching)!=null&&A.length)||E!==void 0&&!l.trimCharsBeforeMatching.includes(E))){s=d;break}}else if(e.startsWith("matchRight"))for(let d=f;d<r.length;d++){let E=r[d];if((!l.trimBeforeMatching||l.trimBeforeMatching&&E.trim())&&(!((C=l.trimCharsBeforeMatching)!=null&&C.length)||!l.trimCharsBeforeMatching.includes(E))){s=d;break}}if(s===void 0)return!1;let y=r[s],m=s+1,I="";return m&&m>0&&(I=r.slice(0,m)),e[5]==="L"||s&&s>0&&(I=r.slice(s)),l.cb(y,I,s)}let $="";throw i||($=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_06] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat($))}for(let $=0,s=h.length;$<s;$++){u=typeof h[$]=="function";let f=h[$],y,m,I="",d=o;e==="matchRight"?d+=1:e==="matchLeft"&&(d-=1);let E=ht(r,d,f,l,u,v=>e[5]==="L"?v-1:v+1);if(E&&u&&typeof f=="function"&&f()==="EOL")return f()&&(!l.cb||l.cb(y,I,m))?f():!1;if(Number.isInteger(E)&&(m=e.startsWith("matchLeft")?E-1:E+1,e[5]==="L"?I=r.slice(0,E):I=r.slice(m)),m<0&&(m=void 0),r[m]&&(y=r[m]),Number.isInteger(E)&&(!l.cb||l.cb(y,I,m)))return f}return!1}function xe(e,r,o,n){return $e("matchLeft",e,r,o,n)}function Pe(e,r,o,n){return $e("matchRightIncl",e,r,o,n)}function _e(e,r,o,n){return $e("matchRight",e,r,o,n)}var gt={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function ae(e){var u,c;let r=/^[0-9a-zA-Z]+$/;function o(a){return O(a)&&!a.trim()}if(W(e)){if(!Object.keys(e).length)throw new Error('string-range-expander/expander(): [THROW_ID_02] Input must be a plain object but it\'s been given as a plain object without any keys. However, "from" and "to" settings are obligatory!')}else{let a;throw e===void 0?a="but it is missing completely.":e===null?a="but it was given as null.":a="but it was given as ".concat(typeof e,", equal to:\n").concat(p(e,4),"."),new Error("string-range-expander/expander(): [THROW_ID_01] Input must be a plain object ".concat(a))}if(!H(e.from))throw new Error("string-range-expander/expander(): [THROW_ID_03] The input's \"from\" value resolvedOpts.from, is not a number! It's been given as ".concat(typeof e.from,", equal to ").concat(p(e.from)));if(!H(e.to))throw new Error("string-range-expander/expander(): [THROW_ID_04] The input's \"to\" value resolvedOpts.to, is not a number! It's been given as ".concat(typeof e.to,", equal to ").concat(p(e.to)));if(e!=null&&e.str&&!e.str[e.from]&&e.from!==e.to)throw new Error('string-range-expander/expander(): [THROW_ID_05] The given input string resolvedOpts.str ("'.concat(e.str,'") must contain the character at index "from" ("').concat(e.from,'")'));if(e!=null&&e.str&&!e.str[e.to-1])throw new Error('string-range-expander/expander(): [THROW_ID_06] The given input string, resolvedOpts.str ("'.concat(e.str,'") must contain the character at index before "to" ("').concat(e.to-1,'")'));if(e.from>e.to)throw new Error('string-range-expander/expander(): [THROW_ID_07] The given "from" index, "'.concat(e.from,'" is greater than "to" index, "').concat(e.to,"\". That's wrong!"));if(e.extendToOneSide===null||O(e.extendToOneSide)&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right"||!O(e.extendToOneSide)&&e.extendToOneSide!==void 0&&e.extendToOneSide)throw new Error('string-range-expander/expander(): [THROW_ID_08] The options value "extendToOneSide" is not recognisable! It\'s set to: "'.concat(e.extendToOneSide,'" (').concat(typeof e.extendToOneSide,'). It has to be either Boolean "false" or one of strings: "left" or "right"'));if(e!=null&&e.ifLeftSideIncludesThisThenCropTightly&&!O(e.ifLeftSideIncludesThisThenCropTightly))throw new Error('string-range-expander/expander(): [THROW_ID_09] The option "ifLeftSideIncludesThisThenCropTightly", is not a string! It\'s been given as '.concat(typeof e.ifLeftSideIncludesThisThenCropTightly,", equal to ").concat(p(e.ifLeftSideIncludesThisThenCropTightly)));if(e!=null&&e.ifLeftSideIncludesThisCropItToo&&!O(e.ifLeftSideIncludesThisCropItToo))throw new Error('string-range-expander/expander(): [THROW_ID_10] The option "ifLeftSideIncludesThisCropItToo", is not a string! It\'s been given as '.concat(typeof e.ifLeftSideIncludesThisCropItToo,", equal to ").concat(p(e.ifLeftSideIncludesThisCropItToo)));if(e!=null&&e.ifRightSideIncludesThisThenCropTightly&&!O(e.ifRightSideIncludesThisThenCropTightly))throw new Error('string-range-expander/expander(): [THROW_ID_11] The option "ifRightSideIncludesThisThenCropTightly", is not a string! It\'s been given as '.concat(typeof e.ifRightSideIncludesThisThenCropTightly,", equal to ").concat(p(e.ifRightSideIncludesThisThenCropTightly)));if(e!=null&&e.ifRightSideIncludesThisCropItToo&&!O(e.ifRightSideIncludesThisCropItToo))throw new Error('string-range-expander/expander(): [THROW_ID_12] The option "ifRightSideIncludesThisCropItToo", is not a string! It\'s been given as '.concat(typeof e.ifRightSideIncludesThisCropItToo,", equal to ").concat(p(e.ifRightSideIncludesThisCropItToo)));let n=R(R({},gt),e),i=n.str,l=n.from,h=n.to;if(n.extendToOneSide!=="right"&&(o(i[l-1])&&(o(i[l-2])||n.ifLeftSideIncludesThisCropItToo.includes(i[l-2]))||i[l-1]&&n.ifLeftSideIncludesThisCropItToo.includes(i[l-1])||n.wipeAllWhitespaceOnLeft&&o(i[l-1]))){for(let a=l;a--;)if(!n.ifLeftSideIncludesThisCropItToo.includes(i[a])){if(i[a].trim()){n.wipeAllWhitespaceOnLeft||n.ifLeftSideIncludesThisCropItToo.includes(i[a+1])?l=a+1:l=a+2;break}else if(a===0){n.wipeAllWhitespaceOnLeft?l=0:l=1;break}}}if(n.extendToOneSide!=="left"&&(o(i[h])&&(n.wipeAllWhitespaceOnRight||o(i[h+1]))||n.ifRightSideIncludesThisCropItToo.includes(i[h]))){for(let a=h,b=i.length;a<b;a++)if(!n.ifRightSideIncludesThisCropItToo.includes(i[a])){if(i[a].trim()){n.wipeAllWhitespaceOnRight||n.ifRightSideIncludesThisCropItToo.includes(i[a-1])?h=a:h=a-1;break}else if(a===i.length-1){n.wipeAllWhitespaceOnRight?h=i.length:h=i.length-1;break}}}return(n.extendToOneSide!=="right"&&O(n.ifLeftSideIncludesThisThenCropTightly)&&n.ifLeftSideIncludesThisThenCropTightly&&(i[l-2]&&n.ifLeftSideIncludesThisThenCropTightly.includes(i[l-2])||i[l-1]&&n.ifLeftSideIncludesThisThenCropTightly.includes(i[l-1]))||n.extendToOneSide!=="left"&&O(n.ifRightSideIncludesThisThenCropTightly)&&n.ifRightSideIncludesThisThenCropTightly&&(i[h+1]&&n.ifRightSideIncludesThisThenCropTightly.includes(i[h+1])||i[h]&&n.ifRightSideIncludesThisThenCropTightly.includes(i[h])))&&(n.extendToOneSide!=="right"&&o(i[l-1])&&!n.wipeAllWhitespaceOnLeft&&(l-=1),n.extendToOneSide!=="left"&&o(i[h])&&!n.wipeAllWhitespaceOnRight&&(h+=1)),n.addSingleSpaceToPreventAccidentalConcatenation&&((u=i[l-1])!=null&&u.trim())&&((c=i[h])!=null&&c.trim())&&(!n.ifLeftSideIncludesThisThenCropTightly&&!n.ifRightSideIncludesThisThenCropTightly||!((!n.ifLeftSideIncludesThisThenCropTightly||n.ifLeftSideIncludesThisThenCropTightly.includes(i[l-1]))&&(!n.ifRightSideIncludesThisThenCropTightly||i[h]&&n.ifRightSideIncludesThisThenCropTightly.includes(i[h]))))&&(r.test(i[l-1])||r.test(i[h]))?[l,h," "]:[l,h]}var He="6.2.2";var mt=He;function Fe(e){return e>96&&e<123||e>64&&e<91||e>47&&e<58||e===95}function Z(e){return e!==void 0&&Fe(e.charCodeAt(0))}var ke={lineLengthLimit:500,removeIndentations:!0,removeLineBreaks:!1,removeHTMLComments:!1,removeCSSComments:!0,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,breakToTheLeftOf:["</td","<html","</html","<head","</head","<meta","<link","<table","<script","<\/script","<!DOCTYPE","<style","</style","<title","<body","@media","</body","<!--[if","<!--<![endif","<![endif]"],mindTheInlineTags:["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]};function $t(e,r){var Te,ye;let o=Date.now();if(!O(e))throw e===void 0?new Error("html-crush/crush(): [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error('html-crush/crush(): [THROW_ID_02] the first input argument must be string! It was given as "'.concat(typeof e,'", equal to:\n').concat(p(e,4)));if(r&&!W(r))throw new Error("html-crush/crush(): [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ".concat(typeof r,", equal to ").concat(p(r,4)));if(r&&Array.isArray(r.breakToTheLeftOf)&&r.breakToTheLeftOf.length){for(let L=0,t=r.breakToTheLeftOf.length;L<t;L++)if(!O(r.breakToTheLeftOf[L]))throw new TypeError("html-crush/crush(): [THROW_ID_04] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ".concat(L,' is of a type "').concat(typeof r.breakToTheLeftOf[L],'" and is equal to:\n').concat(p(r.breakToTheLeftOf[L],4)))}let n=new Ve({limitToBeAddedWhitespace:!0}),i=R(R({},ke),r);typeof i.removeHTMLComments=="boolean"&&(i.removeHTMLComments=i.removeHTMLComments?1:0);let l="";Array.isArray(i.breakToTheLeftOf)&&i.breakToTheLeftOf.length&&(l=[...new Set(i.breakToTheLeftOf.map(L=>L[0]))].join(""));let h={removeHTMLComments:!1,removeCSSComments:!1},u=Array.isArray(i.mindTheInlineTags)?i.mindTheInlineTags:[],c=new Set(u),a=!!u.length&&u.every(L=>O(L)&&!!L.length&&![...L].some(t=>!Z(t))),b=new Map,A=Array.isArray(i.breakToTheLeftOf)&&!!i.breakToTheLeftOf.length&&i.breakToTheLeftOf.every(O)&&!(i.breakToTheLeftOf.length===1&&!i.breakToTheLeftOf[0].trim());if(A)for(let L of i.breakToTheLeftOf){if(!L.length)continue;let t=b.get(L[0]);t?t.push(L):b.set(L[0],[L])}function C(L){if(!A)return!!Pe(e,L,i.breakToTheLeftOf);let t=b.get(e[L]);if(t===void 0)return!1;for(let _=0,g=t.length;_<g;_++)if(e.startsWith(t[_],L))return!0;return!1}function $(L,t){if(!a)return!!_e(e,L,i.mindTheInlineTags,we(R({},t?{trimCharsBeforeMatching:"/"}:{}),{cb:M=>!M||!Z(M)}));let _=L+1;if(t)for(;e[_]==="/";)_++;let g=_;for(;g<N&&Fe(e.charCodeAt(g));)g++;return g>_&&c.has(e.slice(_,g))}let s=null,f=null,y=!1,m=0,I=0,d=!1,E=!1,v=null,V=null,P=null,J=null,w,T=null,S=null,D=null,F=null,G=null,ee=null,K=">};",Q="<",We="!",Be=">",je="<",pe="{},:;<>~+",ue=pe,fe=pe,Y=!0,N=e.length,te=0;for(;te<N&&k(e[te]);)te++;let Ue=Math.floor(N/2),de=.01,be;i.reportProgressFunc&&(be=Math.floor(i.reportProgressFuncTo-(i.reportProgressFuncTo-i.reportProgressFuncFrom)*de-i.reportProgressFuncFrom));let U,ne=0,x="\n";if(e.includes("\r\n")?x="\r\n":e.includes("\r")&&(x="\r"),N){for(let t=0;t<N;t++){if(i.reportProgressFunc&&(N>1e3&&N<2e3?t===Ue&&i.reportProgressFunc(Math.floor((i.reportProgressFuncTo-i.reportProgressFuncFrom)/2)):N>=2e3&&(U=i.reportProgressFuncFrom+Math.floor(t/N*(be||1)),U!==ne&&(ne=U,i.reportProgressFunc(U)))),I++,!w&&d&&e[t]==="}"&&e[t-1]==="}"&&(m+1>=i.lineLengthLimit?(n.push(t,t,x),m=0):(T=t,S=t,D=" ")),w&&typeof w=="number"&&t>=w&&(w=void 0),J!==null&&e[t]==="<"&&e.startsWith("<\/script",t)&&!q(e[t+8])){if((i.removeIndentations||i.removeLineBreaks)&&t>0&&e[~-t]&&k(e[~-t])){for(let g=t;g--;)if(e[g]==="\n"||e[g]==="\r"||!k(e[g])){g+1<t&&n.push(g+1,t);break}}J=null,w=!1,t+=8;continue}if(!w&&!d&&e[t]==="<"&&e.startsWith("<script",t)&&!q(e[t+7])){J=t,w=!0;let g="";(i.removeLineBreaks||i.removeIndentations)&&f!==null&&(f>0&&(g=x),n.push(f,t,g)),f=null,s=null}if(G!==null&&F===null&&!Z(e[t])){F=e.slice(G,t);let g=B(e,~-t),M=B(e,t);if(typeof g=="number"&&e[g]===">"&&k(e[t])&&M)n.push(t,M);else if(g&&e[g]==="/"&&e[B(e,g)]===">"){k(e[t])&&M&&n.push(t,M);let Ee=B(e,g+1);e[g+1]!==">"&&Ee&&n.push(g+1,Ee)}}if(!w&&!d&&!v&&e[~-t]==="<"&&G===null)if(Z(e[t]))G=t;else{let g=B(e,~-t),M=B(e,g);e[g]==="/"&&Z(e[M]||"")&&(G=M)}if(!w&&(d||v)&&V!==null&&e[t]==="*"&&e[t+1]==="/"&&([T,S]=ae({str:e,from:V,to:t+2,ifLeftSideIncludesThisThenCropTightly:ue||"",ifRightSideIncludesThisThenCropTightly:fe||""}),V=null,T!=null?n.push(T,S):(m+=1,t+=1),w=t+2),!w&&(d||v)&&V===null&&e[t]==="/"&&e[t+1]==="*"&&(h.removeCSSComments||(h.removeCSSComments=!0),i.removeCSSComments&&(V=t)),E&&e.startsWith("![endif",t+1)&&(E=!1),!w&&!d&&!v&&P!==null){let g;e.startsWith("-->",t)?g=3:e[t]===">"&&e[t-1]==="]"&&(g=1),g&&([T,S]=ae({str:e,from:P,to:t+g}),P=null,T!=null?i.lineLengthLimit&&I-(S-T)>=i.lineLengthLimit?(n.push(T,S,x),I=-g):(n.push(T,S),I-=S-T):(m+=g-1,t+=g-1),w=t+g)}if(!w&&!d&&!v&&e[t]==="<"&&(e.startsWith("<!--",t)||i.removeHTMLComments===2&&e.startsWith("<![endif",t))&&P===null&&(e.startsWith("[if",t+4)?(E||(E=!0),i.removeHTMLComments===2&&(P=t)):i.removeHTMLComments&&(!E||i.removeHTMLComments===2)&&(P=t),h.removeHTMLComments||(h.removeHTMLComments=!0)),!w&&d&&V===null&&e[t]==="<"&&e.startsWith("</style",t)&&!q(e[t+7])?d=!1:!w&&!d&&V===null&&e[t]==="<"&&e.startsWith("<style",t)&&!q(e[t+6])&&(d=!0,(i.removeLineBreaks||i.removeIndentations)&&i.breakToTheLeftOf.includes("<style")&&e.startsWith(' type="text/css">',t+6)&&e[t+24]&&n.push(t+23,t+23,x)),!w&&!v&&"\"'".includes(e[t])&&e.endsWith("style=",t)&&(v=t),!w&&k(e[t]))f===null&&(f=t);else if(!w&&!((d||v)&&V!==null)){if(f!==null){if(i.removeLineBreaks&&(m+=1),Y)Y=!1,(i.removeIndentations||i.removeLineBreaks)&&n.push(0,t);else if(i.removeIndentations&&!i.removeLineBreaks&&(!y&&s!==null&&t>s?n.push(s+1,t):f+1<t&&(e.endsWith("]>",f)||e.endsWith("-->",f)||e.startsWith("<![",t)||e.startsWith("<!--<![",t)?n.push(f,t):e[f]===" "?n.push(f+1,t):e[~-t]===" "?n.push(f,~-t):n.push(f,t," "))),i.removeLineBreaks||v){if(l.includes(e[t])&&C(t)){!("\r\n".includes(e[~-t])&&f===~-t)&&!(e[~-t]==="\n"&&e[t-2]==="\r"&&f===t-2)&&n.push(f,t,x),T=null,S=null,D=null,f=null,m=1;continue}let g=" ";if(!(e[t]==="<"&&$(t,!1))){if(e[~-f]&&Be.includes(e[~-f])&&je.includes(e[t])||(d||v)&&V===null&&(ue.includes(e[~-f])||fe.includes(e[t]))||e[t]==="!"&&e.startsWith("!important",t)&&!E||v&&(e[~-f]==="'"||e[~-f]==='"')||e[~-f]==="}"&&e.startsWith("</style",t)||e[t]===">"&&("'\"".includes(e[se(e,t)])||e[B(e,t)]==="<")||e[t]==="/"&&e[B(e,t)]===">"){g="";let M=e[t]==="/"&&e[t+1]===">"?B(e,t):null;M&&M>t+1&&(n.push(t+1,M),m-=M-t+1)}}d&&e[t]==="}"&&f&&e[f-1]==="}"&&(g=" "),g!=null&&g.length&&(m+=1),i.lineLengthLimit?m>=i.lineLengthLimit||!e[t+1]||e[t]===">"||e[t]==="/"&&e[t+1]===">"?((m>i.lineLengthLimit||m===i.lineLengthLimit&&((Te=e[t+1])!=null&&Te.trim())&&!K.includes(e[t])&&!Q.includes(e[t+1]))&&(g=x,m=1),(m>i.lineLengthLimit||!(g===" "&&t===f+1))&&(n.push(f,t,g),s=null),T=null,S=null,D=null):(T===null||f<T)&&(T=f,S=t,D=g):t===f+1&&g===" "||n.push(f,t,g)}f=null,y||(y=!0)}else Y&&(Y=!1),i.removeLineBreaks&&(m+=1);y||(y=!0)}if(!w&&!Y&&t!==0&&i.removeLineBreaks&&(i.lineLengthLimit||l)&&!(e[t]==="<"&&e.startsWith("</a",t))){if(l&&C(t)&&te<t&&(e[t]!=="<"||!e.startsWith("<![endif]",t)||!xe(e,t,"<!--"))){n.push(t,t,x),T=null,S=null,D=null,m=1;continue}else if(i.lineLengthLimit&&m<=i.lineLengthLimit){if(!e[t+1]||Q.includes(e[t])&&!We.includes(e[t])||K.includes(e[t])||k(e[t])){if(T!==null&&S!==null&&(T!==S||D!=null&&D.length)){let g=D;!k(e[t])&&((ye=e[t+1])!=null&&ye.trim())&&m+(D?D.length:0)>i.lineLengthLimit&&(g=x),(m+(g?g.length:0)>i.lineLengthLimit||!(g===" "&&S===T+1&&e[T]===" "))&&(e[~-T]==="}"&&e[S]==="{"||(n.push(T,S,g),s=null))}!k(e[t])&&(Q.includes(e[t])||e[~-t]&&K.includes(e[~-t]))&&O(ee)&&(!F||!c.has(F))&&!(e[t]==="<"&&$(t,!1))&&!(e[t]==="<"&&$(t,!0))?(T=t,S=t,D=null):V===null&&T!==null&&(v||!i.mindTheInlineTags||!Array.isArray(i.mindTheInlineTags)||Array.isArray(i.mindTheInlineTags.length)&&!i.mindTheInlineTags.length||!O(F)||Array.isArray(i.mindTheInlineTags)&&i.mindTheInlineTags.length&&O(F)&&!c.has(F))&&!(e[t]==="<"&&$(t,!0))&&(T=null,S=null,D=null)}}else if(i.lineLengthLimit)if(Q.includes(e[t])&&!(e[t]==="<"&&$(t,!0)))if(T!==null&&S!==null&&(T!==S||D!=null&&D.length)){let g=D!=null&&D.length?D.length:0;m-(S-T-g)-1>i.lineLengthLimit||(n.push(T,S,D),m-(S-T-g)-1===i.lineLengthLimit&&(n.push(t,t,x),m=0),T=null,S=null,D=null)}else n.push(t,t,x),m=0;else e[t+1]&&K.includes(e[t])&&O(F)&&Array.isArray(i.mindTheInlineTags)&&i.mindTheInlineTags.length&&!c.has(F)?T!==null&&S!==null&&(T!==S||D!=null&&D.length)||(n.push(t+1,t+1,x),m=0):k(e[t])||e[t+1]||T!==null&&S!==null&&(T!==S||D!=null&&D.length)&&n.push(T,S,x)}if(!w&&!Y&&i.removeLineBreaks&&i.lineLengthLimit&&m>=i.lineLengthLimit&&T!==null&&S!==null&&!K.includes(e[t])&&!Q.includes(e[t])&&!"/".includes(e[t])&&!(m===i.lineLengthLimit&&e[t+1]&&!e[t+1].trim())){let g=x;e[t+1]&&!e[t+1].trim()&&m===i.lineLengthLimit&&(g=D),g===x&&!e[~-T].trim()&&se(e,T)&&(T=se(e,T)+1),n.push(T,S,g),m=t-S,e[t].length&&(m+=1),T=null,S=null,D=null}if((!w&&e[t]==="\n"||e[t]==="\r"&&(!e[t+1]||e[t+1]&&e[t+1]!=="\n"))&&(s=t,y&&(y=!1),!i.removeLineBreaks&&f!==null&&f<t&&e[t+1]&&e[t+1]!=="\r"&&e[t+1]!=="\n"&&n.push(f,t)),e[t+1]||(d&&V!==null?n.push([...ae({str:e,from:V,to:t,ifLeftSideIncludesThisThenCropTightly:ue||"",ifRightSideIncludesThisThenCropTightly:fe||""})]):f&&e[t]!=="\n"&&e[t]!=="\r"?n.push(f,t+1):f&&(e[t]==="\r"&&e[t+1]==="\n"||e[t]==="\n"&&e[t-1]!=="\r")&&n.push(f,t)),!w&&v&&v<t&&e[v]===e[t]&&(v=null),!w&&!d&&e[t]==="<"&&e.startsWith("<pre",t)&&!q(e[t+4])){let g=e.indexOf("</pre",t+5);g>0&&(w=g)}if(!w&&!d&&e[t]==="<"&&e.startsWith("<code",t)&&!q(e[t+5])){let g=e.indexOf("</code",t+5);g>0&&(w=g)}if(!w&&e[t]==="<"&&e.startsWith("<![CDATA[",t)){let g=e.indexOf("]]>",t+9);g>0&&(w=g)}if(!w&&!d&&!v&&G!==null&&e[t]===">"&&(e[B(e,t)]==="<"&&(ee=F),G=null,F=null),e[t]==="<"&&ee!==null&&(ee=null),!w&&d&&e[t]==="{"&&e[t+1]==="{"){let g=e.indexOf("}}",t+2);g!==-1&&(w=g+2)}let _=!0}let L=n.current();if(L){let t=i.reportProgressFuncTo-(i.reportProgressFuncTo-i.reportProgressFuncFrom)*de,_=ve(e,L,M=>{i.reportProgressFunc&&N>=2e3&&(U=Math.floor(t+(i.reportProgressFuncTo-t)*(M/100)),U!==ne&&(ne=U,i.reportProgressFunc(U)))}),g=_.length;return{log:{timeTakenInMilliseconds:Date.now()-o,originalLength:N,cleanedLength:g,bytesSaved:Math.max(N-g,0),percentageReducedOfOriginal:N?Math.round(Math.max(N-g,0)*100/N):0},ranges:L,applicableOpts:h,result:_}}}return{log:{timeTakenInMilliseconds:Date.now()-o,originalLength:N,cleanedLength:N,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:h,ranges:null,result:e}}return Xe(pt);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-utils
|
|
13
13
|
* @fileoverview Various utility functions
|
|
14
|
-
* @version 1.
|
|
14
|
+
* @version 1.9.0
|
|
15
15
|
* @author Roy Revelt
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/codsen-utils/}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* @name ranges-sort
|
|
21
21
|
* @fileoverview Sort string index ranges
|
|
22
|
-
* @version 6.2.
|
|
22
|
+
* @version 6.2.1
|
|
23
23
|
* @author Roy Revelt
|
|
24
24
|
* @license MIT
|
|
25
25
|
* {@link https://codsen.com/os/ranges-sort/}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
/**
|
|
28
28
|
* @name ranges-merge
|
|
29
29
|
* @fileoverview Merge and sort string index ranges
|
|
30
|
-
* @version 9.2.
|
|
30
|
+
* @version 9.2.2
|
|
31
31
|
* @author Roy Revelt
|
|
32
32
|
* @license MIT
|
|
33
33
|
* {@link https://codsen.com/os/ranges-merge/}
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
/**
|
|
36
36
|
* @name ranges-apply
|
|
37
37
|
* @fileoverview Take an array of string index ranges, delete/replace the string according to them
|
|
38
|
-
* @version 7.2.
|
|
38
|
+
* @version 7.2.2
|
|
39
39
|
* @author Roy Revelt
|
|
40
40
|
* @license MIT
|
|
41
41
|
* {@link https://codsen.com/os/ranges-apply/}
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
/**
|
|
52
52
|
* @name ranges-push
|
|
53
53
|
* @fileoverview Gather string index ranges
|
|
54
|
-
* @version 7.2.
|
|
54
|
+
* @version 7.2.1
|
|
55
55
|
* @author Roy Revelt
|
|
56
56
|
* @license MIT
|
|
57
57
|
* {@link https://codsen.com/os/ranges-push/}
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
/**
|
|
60
60
|
* @name string-left-right
|
|
61
61
|
* @fileoverview Looks up the first non-whitespace character to the left/right of a given index
|
|
62
|
-
* @version 6.2.
|
|
62
|
+
* @version 6.2.1
|
|
63
63
|
* @author Roy Revelt
|
|
64
64
|
* @license MIT
|
|
65
65
|
* {@link https://codsen.com/os/string-left-right/}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
/**
|
|
68
68
|
* @name arrayiffy-if-string
|
|
69
69
|
* @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
|
|
70
|
-
* @version 5.2.
|
|
70
|
+
* @version 5.2.1
|
|
71
71
|
* @author Roy Revelt
|
|
72
72
|
* @license MIT
|
|
73
73
|
* {@link https://codsen.com/os/arrayiffy-if-string/}
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
/**
|
|
76
76
|
* @name string-match-left-right
|
|
77
77
|
* @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
|
|
78
|
-
* @version 9.2.
|
|
78
|
+
* @version 9.2.2
|
|
79
79
|
* @author Roy Revelt
|
|
80
80
|
* @license MIT
|
|
81
81
|
* {@link https://codsen.com/os/string-match-left-right/}
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
/**
|
|
84
84
|
* @name string-range-expander
|
|
85
85
|
* @fileoverview Expands string index ranges within whitespace boundaries until letters are met
|
|
86
|
-
* @version 4.2.
|
|
86
|
+
* @version 4.2.1
|
|
87
87
|
* @author Roy Revelt
|
|
88
88
|
* @license MIT
|
|
89
89
|
* {@link https://codsen.com/os/string-range-expander/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "html-crush",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.2",
|
|
4
4
|
"description": "Minify email templates",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"breaks",
|
|
@@ -76,15 +76,15 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"codsen-utils": "^1.
|
|
80
|
-
"ranges-apply": "^7.2.
|
|
81
|
-
"ranges-push": "^7.2.
|
|
82
|
-
"string-left-right": "^6.2.
|
|
83
|
-
"string-match-left-right": "^9.2.
|
|
84
|
-
"string-range-expander": "^4.2.
|
|
79
|
+
"codsen-utils": "^1.9.0",
|
|
80
|
+
"ranges-apply": "^7.2.2",
|
|
81
|
+
"ranges-push": "^7.2.1",
|
|
82
|
+
"string-left-right": "^6.2.1",
|
|
83
|
+
"string-match-left-right": "^9.2.2",
|
|
84
|
+
"string-range-expander": "^4.2.1"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"test-mixer": "^4.3.
|
|
87
|
+
"test-mixer": "^4.3.1"
|
|
88
88
|
},
|
|
89
89
|
"engines": {
|
|
90
90
|
"node": ">=18.20.8"
|